dynamic-modal 1.0.10 → 1.0.12

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.
Files changed (59) hide show
  1. package/.idea/dynamic-modal.iml +12 -0
  2. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  3. package/.idea/modules.xml +8 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/README-ES.md +119 -119
  6. package/README.md +119 -119
  7. package/dist/components/input-upload/input-upload.js +18 -8
  8. package/dist/components/make-autocomplete/make-autocomplete.js +24 -17
  9. package/dist/components/make-input/make-input.js +24 -17
  10. package/dist/components/make-multi-select/make-multi-select.js +24 -17
  11. package/dist/components/make-select/make-select.js +24 -17
  12. package/dist/components/make-textarea/make-textarea.js +23 -16
  13. package/dist/components/make-toggle/make-toggle.js +36 -14
  14. package/dist/components/make-upload/make-upload.js +20 -8
  15. package/dist/components/portal/portal.js +17 -7
  16. package/dist/interfaces/field.d.ts +7 -4
  17. package/dist/interfaces/input-upload.d.ts +1 -15
  18. package/dist/interfaces/modal.d.ts +1 -1
  19. package/dist/modal.js +17 -7
  20. package/eslint.config.mjs +13 -13
  21. package/examples/enable-if.ts +129 -129
  22. package/examples/live-data.ts +63 -63
  23. package/examples/render-if.ts +130 -130
  24. package/examples/simple.ts +76 -76
  25. package/index.ts +2 -2
  26. package/package.json +48 -48
  27. package/src/components/input-upload/input-upload.tsx +72 -72
  28. package/src/components/make-autocomplete/make-autocomplete.tsx +54 -53
  29. package/src/components/make-button/make-button.tsx +17 -17
  30. package/src/components/make-input/make-input.tsx +47 -46
  31. package/src/components/make-multi-select/make-multi-select.tsx +56 -55
  32. package/src/components/make-select/make-select.tsx +54 -53
  33. package/src/components/make-text/make-text.tsx +16 -16
  34. package/src/components/make-textarea/make-textarea.tsx +48 -47
  35. package/src/components/make-title/make-title.tsx +12 -12
  36. package/src/components/make-toggle/make-toggle.tsx +44 -44
  37. package/src/components/make-upload/make-upload.tsx +34 -41
  38. package/src/components/portal/portal.tsx +36 -36
  39. package/src/hooks/field-render.ts +108 -108
  40. package/src/hooks/modal-handler.ts +37 -37
  41. package/src/interfaces/field.ts +35 -31
  42. package/src/interfaces/input-upload.ts +21 -37
  43. package/src/interfaces/make-autocomplete.ts +13 -13
  44. package/src/interfaces/make-button.ts +20 -20
  45. package/src/interfaces/make-field-group.ts +13 -13
  46. package/src/interfaces/make-field.ts +14 -14
  47. package/src/interfaces/make-multi-select.ts +14 -14
  48. package/src/interfaces/make-select.ts +12 -12
  49. package/src/interfaces/make-text.ts +12 -12
  50. package/src/interfaces/make-textarea.ts +11 -11
  51. package/src/interfaces/make-title.ts +3 -3
  52. package/src/interfaces/make-toggle.ts +9 -9
  53. package/src/interfaces/make-upload.ts +14 -14
  54. package/src/interfaces/modal.ts +51 -51
  55. package/src/interfaces/option.ts +3 -3
  56. package/src/interfaces/portal.ts +8 -8
  57. package/src/modal.tsx +174 -174
  58. package/src/tools/general.ts +6 -6
  59. package/tsconfig.json +13 -13
@@ -1,108 +1,108 @@
1
- 'use client'
2
- import { useCallback, useMemo, useState } from 'react'
3
- import { IField, IFieldProps } from '../interfaces/field'
4
- import { IOption } from '../interfaces/option'
5
- import { IModalLiveDataCondition, IModalRenderCondition } from '../interfaces/modal'
6
-
7
- export type IFormData = Record<string, unknown>
8
-
9
- export interface IWatchEvent {
10
- name: string | undefined;
11
- type: string | undefined;
12
- }
13
-
14
- export interface IFieldRender {
15
- render: boolean | null;
16
- enable: boolean | null;
17
- checkField: (formData: IFormData, { name, type }: IWatchEvent) => void;
18
- liveData?: Array<IOption>;
19
- liveSearching?: boolean;
20
- }
21
-
22
- export interface IFieldRenderProps extends Pick<IFieldProps, 'setValue'|'unregister'> {
23
- element: Partial<Pick<IField, 'enableIf'|'renderIf'|'name' >> & Partial<Record<'liveData', IModalLiveDataCondition>>
24
- }
25
-
26
- export const useFieldRender = ({element, setValue, unregister}: IFieldRenderProps): IFieldRender => {
27
- const [render, setRender] = useState<boolean|null>(null)
28
- const [enable, setEnable] = useState<boolean|null>(null)
29
- const [liveSearching, setLiveSearching] = useState<boolean>(false)
30
- const [liveData, setLiveData] = useState<Array<IOption> | undefined>(undefined)
31
-
32
- const renderCondition = useMemo<boolean>(
33
- () => {
34
- const isRender: boolean = element.renderIf !== undefined
35
- if (render === null) setRender(!isRender)
36
- return isRender
37
- }, [element.renderIf, render]
38
- )
39
-
40
- const enableCondition = useMemo<boolean>(
41
- () => {
42
- const isEnable: boolean = element.enableIf !== undefined
43
- if (enable === null) setEnable(!isEnable)
44
- return isEnable
45
- }, [element.enableIf, enable]
46
- )
47
-
48
- const liveDataCondition = useMemo<boolean>(
49
- () => {
50
- return element.liveData !== undefined
51
- }, [element.liveData]
52
- )
53
-
54
- const renderConditionList: Array<string> = useMemo(() => {
55
- return renderCondition ? Object.keys(element.renderIf as IModalRenderCondition) : []
56
- }, [element.renderIf, renderCondition])
57
-
58
- const enableConditionList: Array<string> = useMemo(() => {
59
- return enableCondition ? Object.keys(element.enableIf as IModalRenderCondition) : []
60
- }, [enableCondition, element.enableIf])
61
-
62
- const liveDataAction = useCallback(
63
- async (field: string |number | Array<unknown>, formData: IFormData) => {
64
- if (typeof field === 'string' && element.liveData?.action) {
65
- const options = element.liveData.action(field, formData)
66
- return options ?? []
67
- }
68
- return [] as Array<IOption>
69
- }, [element.liveData]
70
- )
71
-
72
- const checkField = useCallback(
73
- async (formData: IFormData, { name }: IWatchEvent) => {
74
- const key: string = name ?? ''
75
- const targetField = formData[key] as string | number
76
- const fieldValidValue: boolean = targetField !== undefined && targetField !== null && targetField !== ''
77
-
78
- if (renderCondition && renderConditionList.includes(key) && fieldValidValue) {
79
- const renderStatus: boolean = (element.renderIf as IModalRenderCondition)[key].includes(targetField) || (element.renderIf as IModalRenderCondition)[key].includes('*')
80
- if (render !== renderStatus) {
81
- setRender(renderStatus)
82
- if(!renderStatus) unregister(element.name as string)
83
- }
84
- } else if (enableCondition && enableConditionList.includes(key) && fieldValidValue) {
85
- const enableStatus: boolean = (element.enableIf as IModalRenderCondition)[key].includes(targetField) || (element.enableIf as IModalRenderCondition)[key].includes('')
86
- if (enable !== enableStatus) setEnable(enableStatus)
87
- }
88
-
89
- if (liveDataCondition && element.liveData?.condition.includes(key)) {
90
- if (targetField) {
91
- setLiveSearching(true)
92
- const options: Array<IOption> = await liveDataAction(targetField, formData)
93
- if (liveData && JSON.stringify(liveData) !== JSON.stringify(options)) { setValue(element.name as string, options) }
94
- setLiveData(options)
95
- setLiveSearching(false)
96
- }
97
- }
98
- }, [enable, enableCondition, enableConditionList, liveData, liveDataAction, liveDataCondition, render, renderCondition, renderConditionList]
99
- )
100
-
101
- return {
102
- render,
103
- enable,
104
- checkField,
105
- liveData,
106
- liveSearching
107
- }
108
- }
1
+ 'use client'
2
+ import { useCallback, useMemo, useState } from 'react'
3
+ import { IField, IFieldProps } from '../interfaces/field'
4
+ import { IOption } from '../interfaces/option'
5
+ import { IModalLiveDataCondition, IModalRenderCondition } from '../interfaces/modal'
6
+
7
+ export type IFormData = Record<string, unknown>
8
+
9
+ export interface IWatchEvent {
10
+ name: string | undefined;
11
+ type: string | undefined;
12
+ }
13
+
14
+ export interface IFieldRender {
15
+ render: boolean | null;
16
+ enable: boolean | null;
17
+ checkField: (formData: IFormData, { name, type }: IWatchEvent) => void;
18
+ liveData?: Array<IOption>;
19
+ liveSearching?: boolean;
20
+ }
21
+
22
+ export interface IFieldRenderProps extends Pick<IFieldProps, 'setValue'|'unregister'> {
23
+ element: Partial<Pick<IField, 'enableIf'|'renderIf'|'name' >> & Partial<Record<'liveData', IModalLiveDataCondition>>
24
+ }
25
+
26
+ export const useFieldRender = ({element, setValue, unregister}: IFieldRenderProps): IFieldRender => {
27
+ const [render, setRender] = useState<boolean|null>(null)
28
+ const [enable, setEnable] = useState<boolean|null>(null)
29
+ const [liveSearching, setLiveSearching] = useState<boolean>(false)
30
+ const [liveData, setLiveData] = useState<Array<IOption> | undefined>(undefined)
31
+
32
+ const renderCondition = useMemo<boolean>(
33
+ () => {
34
+ const isRender: boolean = element.renderIf !== undefined
35
+ if (render === null) setRender(!isRender)
36
+ return isRender
37
+ }, [element.renderIf, render]
38
+ )
39
+
40
+ const enableCondition = useMemo<boolean>(
41
+ () => {
42
+ const isEnable: boolean = element.enableIf !== undefined
43
+ if (enable === null) setEnable(!isEnable)
44
+ return isEnable
45
+ }, [element.enableIf, enable]
46
+ )
47
+
48
+ const liveDataCondition = useMemo<boolean>(
49
+ () => {
50
+ return element.liveData !== undefined
51
+ }, [element.liveData]
52
+ )
53
+
54
+ const renderConditionList: Array<string> = useMemo(() => {
55
+ return renderCondition ? Object.keys(element.renderIf as IModalRenderCondition) : []
56
+ }, [element.renderIf, renderCondition])
57
+
58
+ const enableConditionList: Array<string> = useMemo(() => {
59
+ return enableCondition ? Object.keys(element.enableIf as IModalRenderCondition) : []
60
+ }, [enableCondition, element.enableIf])
61
+
62
+ const liveDataAction = useCallback(
63
+ async (field: string |number | Array<unknown>, formData: IFormData) => {
64
+ if (typeof field === 'string' && element.liveData?.action) {
65
+ const options = element.liveData.action(field, formData)
66
+ return options ?? []
67
+ }
68
+ return [] as Array<IOption>
69
+ }, [element.liveData]
70
+ )
71
+
72
+ const checkField = useCallback(
73
+ async (formData: IFormData, { name }: IWatchEvent) => {
74
+ const key: string = name ?? ''
75
+ const targetField = formData[key] as string | number
76
+ const fieldValidValue: boolean = targetField !== undefined && targetField !== null && targetField !== ''
77
+
78
+ if (renderCondition && renderConditionList.includes(key) && fieldValidValue) {
79
+ const renderStatus: boolean = (element.renderIf as IModalRenderCondition)[key].includes(targetField) || (element.renderIf as IModalRenderCondition)[key].includes('*')
80
+ if (render !== renderStatus) {
81
+ setRender(renderStatus)
82
+ if(!renderStatus) unregister(element.name as string)
83
+ }
84
+ } else if (enableCondition && enableConditionList.includes(key) && fieldValidValue) {
85
+ const enableStatus: boolean = (element.enableIf as IModalRenderCondition)[key].includes(targetField) || (element.enableIf as IModalRenderCondition)[key].includes('')
86
+ if (enable !== enableStatus) setEnable(enableStatus)
87
+ }
88
+
89
+ if (liveDataCondition && element.liveData?.condition.includes(key)) {
90
+ if (targetField) {
91
+ setLiveSearching(true)
92
+ const options: Array<IOption> = await liveDataAction(targetField, formData)
93
+ if (liveData && JSON.stringify(liveData) !== JSON.stringify(options)) { setValue(element.name as string, options) }
94
+ setLiveData(options)
95
+ setLiveSearching(false)
96
+ }
97
+ }
98
+ }, [enable, enableCondition, enableConditionList, liveData, liveDataAction, liveDataCondition, render, renderCondition, renderConditionList]
99
+ )
100
+
101
+ return {
102
+ render,
103
+ enable,
104
+ checkField,
105
+ liveData,
106
+ liveSearching
107
+ }
108
+ }
@@ -1,37 +1,37 @@
1
- 'use client'
2
- import { useState } from 'react'
3
- import { IModal, IModalConfigProps } from '../interfaces/modal'
4
-
5
- interface IModalHandler {
6
- openModal: (config: IModalConfigProps) => void
7
- modalProps: IModal
8
- }
9
-
10
- export function useModalHandler (): IModalHandler {
11
- const initialState: IModalHandler = {
12
- modalProps: {
13
- config: {} as IModalConfigProps,
14
- close: () => {},
15
- open: false,
16
- },
17
- openModal: () => {},
18
- }
19
-
20
- const [modalConfig, setModalConfig] = useState<IModalHandler>(initialState)
21
-
22
- const openModal = (config: IModalConfigProps) => {
23
- if (!config) {
24
- alert(`¡WARNING! this modal was not returned config, please check before use`)
25
- return
26
- }
27
-
28
- setModalConfig({ openModal, modalProps: { config, open: true, close } })
29
- }
30
-
31
- const closeModal = () => setModalConfig(initialState)
32
-
33
- return {
34
- openModal,
35
- modalProps: { ...modalConfig.modalProps, close: closeModal },
36
- }
37
- }
1
+ 'use client'
2
+ import { useState } from 'react'
3
+ import { IModal, IModalConfigProps } from '../interfaces/modal'
4
+
5
+ interface IModalHandler {
6
+ openModal: (config: IModalConfigProps) => void
7
+ modalProps: IModal
8
+ }
9
+
10
+ export function useModalHandler (): IModalHandler {
11
+ const initialState: IModalHandler = {
12
+ modalProps: {
13
+ config: {} as IModalConfigProps,
14
+ close: () => {},
15
+ open: false,
16
+ },
17
+ openModal: () => {},
18
+ }
19
+
20
+ const [modalConfig, setModalConfig] = useState<IModalHandler>(initialState)
21
+
22
+ const openModal = (config: IModalConfigProps) => {
23
+ if (!config) {
24
+ alert(`¡WARNING! this modal was not returned config, please check before use`)
25
+ return
26
+ }
27
+
28
+ setModalConfig({ openModal, modalProps: { config, open: true, close } })
29
+ }
30
+
31
+ const closeModal = () => setModalConfig(initialState)
32
+
33
+ return {
34
+ openModal,
35
+ modalProps: { ...modalConfig.modalProps, close: closeModal },
36
+ }
37
+ }
@@ -1,31 +1,35 @@
1
- import { CSSProperties } from 'react'
2
- import { Control, FieldValues, UseFormSetValue, UseFormUnregister, UseFormWatch } from 'react-hook-form'
3
- import { IOption } from './option'
4
-
5
- export interface IFieldLiveData {
6
- action: (data: string, ...args: unknown[]) => Promise<Array<IOption>>;
7
- condition: string
8
- }
9
-
10
- export interface IField {
11
- name: string
12
- id?: string
13
- label?: string
14
- styles?: CSSProperties
15
- defaultValue?: string
16
- renderIf?: Record<string, Array<string | number>>
17
- enableIf?: Record<string, Array<string | number>>
18
- validation: {
19
- required: boolean
20
- regex?: RegExp
21
- message?: string
22
- }
23
- disabled?: boolean
24
- }
25
-
26
- export interface IFieldProps {
27
- control: Control<FieldValues, unknown>;
28
- watch: UseFormWatch<FieldValues>;
29
- setValue: UseFormSetValue<FieldValues>;
30
- unregister: UseFormUnregister<FieldValues>;
31
- }
1
+ import { CSSProperties } from 'react'
2
+ import { Control, FieldValues, UseFormSetValue, UseFormUnregister, UseFormWatch } from 'react-hook-form'
3
+
4
+ export interface IValidationBase<T> {
5
+ value: T
6
+ message: string
7
+ }
8
+
9
+ export interface IField {
10
+ name: string
11
+ id?: string
12
+ label?: string
13
+ styles?: CSSProperties
14
+ defaultValue?: string
15
+ renderIf?: Record<string, Array<string | number>>
16
+ enableIf?: Record<string, Array<string | number>>
17
+ validation: {
18
+ required: boolean
19
+ regex?: RegExp
20
+ message?: string
21
+ maxLength?: IValidationBase<number>
22
+ minLength?: IValidationBase<number>
23
+ min?: IValidationBase<number | string>
24
+ max?: IValidationBase<number | string>
25
+ }
26
+ disabled?: boolean
27
+ //required?: boolean
28
+ }
29
+
30
+ export interface IFieldProps {
31
+ control: Control<FieldValues, unknown>;
32
+ watch: UseFormWatch<FieldValues>;
33
+ setValue: UseFormSetValue<FieldValues>;
34
+ unregister: UseFormUnregister<FieldValues>;
35
+ }
@@ -1,37 +1,21 @@
1
- import { ChangeEvent, CSSProperties } from 'react'
2
-
3
- export interface IFileResult {
4
- name: string;
5
- size: number;
6
- data: string
7
- }
8
-
9
-
10
- export interface IFile {
11
- data?: string
12
- name: string;
13
- size: number;
14
- }
15
- export interface IInputState {
16
- state: boolean;
17
- file: IFile
18
- }
19
-
20
- export interface IInputStorage {
21
- setData: (file: IInputState) => void;
22
- clearFuntion: () => void;
23
- }
24
- export interface IInputUpload {
25
- id?: string;
26
- value?: string;
27
- onChange: (event: ChangeEvent<HTMLInputElement> | IFileResult | FileList | null) => void;
28
- accept?:string;
29
- label?: string
30
- helpText?: string
31
- clearfunction?: () => void;
32
- style?:CSSProperties;
33
- readAsArrayBuffer?: boolean;
34
- name: string;
35
- disabled?: boolean;
36
- read?: boolean;
37
- }
1
+ import { ChangeEvent, CSSProperties } from 'react'
2
+
3
+ export interface IFileResult {
4
+ name: string;
5
+ size: number;
6
+ data: string
7
+ }
8
+
9
+ export interface IInputUpload {
10
+ id?: string;
11
+ value?: string;
12
+ onChange: (event: ChangeEvent<HTMLInputElement> | IFileResult | FileList | null) => void;
13
+ accept?:string;
14
+ label?: string
15
+ helpText?: string
16
+ styles?:CSSProperties;
17
+ readAsArrayBuffer?: boolean;
18
+ name: string;
19
+ disabled?: boolean;
20
+ read?: boolean;
21
+ }
@@ -1,13 +1,13 @@
1
- import { IField, IFieldProps } from './field'
2
- import { IModalLiveDataCondition } from './modal'
3
- import { IOption } from './option'
4
-
5
- export interface IMakeAutoComplete extends IField {
6
- elementType: 'autocomplete'
7
- options: Array<IOption>
8
- liveData?: IModalLiveDataCondition
9
- }
10
-
11
- export interface IMakeAutoCompleteProps extends IFieldProps {
12
- element: IMakeAutoComplete
13
- }
1
+ import { IField, IFieldProps } from './field'
2
+ import { IModalLiveDataCondition } from './modal'
3
+ import { IOption } from './option'
4
+
5
+ export interface IMakeAutoComplete extends IField {
6
+ elementType: 'autocomplete'
7
+ options: Array<IOption>
8
+ liveData?: IModalLiveDataCondition
9
+ }
10
+
11
+ export interface IMakeAutoCompleteProps extends IFieldProps {
12
+ element: IMakeAutoComplete
13
+ }
@@ -1,20 +1,20 @@
1
- import { CSSProperties } from 'react'
2
- import { IFieldProps } from './field'
3
-
4
- export interface IMakeButton {
5
- elementType: 'button';
6
- disabled?: boolean
7
- className?: string;
8
- variant?: 'solid' | 'light' | 'flat' | 'bordered' | 'faded' | 'shadow' | 'ghost'
9
- text?: string;
10
- type?: 'button' | 'submit' | 'reset';
11
- onClick?: () => void;
12
- iconName?: string;
13
- iconSize?: number | string;
14
- iconClassName?: CSSProperties;
15
- color?: 'primary' | 'secondary' | 'default' | 'success' | 'warning' | 'danger'
16
- }
17
-
18
- export interface IMakeButtonProps extends IFieldProps {
19
- element: IMakeButton
20
- }
1
+ import { CSSProperties } from 'react'
2
+ import { IFieldProps } from './field'
3
+
4
+ export interface IMakeButton {
5
+ elementType: 'button';
6
+ disabled?: boolean
7
+ className?: string;
8
+ variant?: 'solid' | 'light' | 'flat' | 'bordered' | 'faded' | 'shadow' | 'ghost'
9
+ text?: string;
10
+ type?: 'button' | 'submit' | 'reset';
11
+ onClick?: () => void;
12
+ iconName?: string;
13
+ iconSize?: number | string;
14
+ iconClassName?: CSSProperties;
15
+ color?: 'primary' | 'secondary' | 'default' | 'success' | 'warning' | 'danger'
16
+ }
17
+
18
+ export interface IMakeButtonProps extends IFieldProps {
19
+ element: IMakeButton
20
+ }
@@ -1,13 +1,13 @@
1
- import { CSSProperties } from 'react'
2
- import { IFieldProps } from './field'
3
- import { IModalField } from './modal'
4
-
5
- export interface IMakeFieldGroup {
6
- elementType: 'group';
7
- groups: Array<IModalField>;
8
- style?: CSSProperties;
9
- }
10
-
11
- export interface IMakeFieldGroupProps extends IFieldProps {
12
- element: IMakeFieldGroup;
13
- }
1
+ import { CSSProperties } from 'react'
2
+ import { IFieldProps } from './field'
3
+ import { IModalField } from './modal'
4
+
5
+ export interface IMakeFieldGroup {
6
+ elementType: 'group';
7
+ groups: Array<IModalField>;
8
+ style?: CSSProperties;
9
+ }
10
+
11
+ export interface IMakeFieldGroupProps extends IFieldProps {
12
+ element: IMakeFieldGroup;
13
+ }
@@ -1,14 +1,14 @@
1
- import { HTMLInputTypeAttribute } from 'react'
2
- import { IField, IFieldProps } from './field'
3
-
4
- export interface IMakeInput extends IField {
5
- elementType: 'input'
6
- placeHolder?: string
7
- min?: string
8
- max?: string
9
- type?: HTMLInputTypeAttribute
10
- }
11
-
12
- export interface IMakeInputProps extends IFieldProps {
13
- element: IMakeInput
14
- }
1
+ import { HTMLInputTypeAttribute } from 'react'
2
+ import { IField, IFieldProps } from './field'
3
+
4
+ export interface IMakeInput extends IField {
5
+ elementType: 'input'
6
+ placeHolder?: string
7
+ min?: string
8
+ max?: string
9
+ type?: HTMLInputTypeAttribute
10
+ }
11
+
12
+ export interface IMakeInputProps extends IFieldProps {
13
+ element: IMakeInput
14
+ }
@@ -1,14 +1,14 @@
1
- import { IOption } from './option'
2
- import { IField, IFieldProps } from './field'
3
- import { IModalLiveDataCondition } from './modal'
4
-
5
- export interface IMakeMultiSelect extends Omit<IField, 'defaultValue'> {
6
- elementType: 'multiselect';
7
- options: Array<IOption>;
8
- liveData?: IModalLiveDataCondition;
9
- defaultValue?: Array<string>
10
- }
11
-
12
- export interface IMakeMultiSelectProps extends IFieldProps {
13
- element: IMakeMultiSelect
14
- }
1
+ import { IOption } from './option'
2
+ import { IField, IFieldProps } from './field'
3
+ import { IModalLiveDataCondition } from './modal'
4
+
5
+ export interface IMakeMultiSelect extends Omit<IField, 'defaultValue'> {
6
+ elementType: 'multiselect';
7
+ options: Array<IOption>;
8
+ liveData?: IModalLiveDataCondition;
9
+ defaultValue?: Array<string>
10
+ }
11
+
12
+ export interface IMakeMultiSelectProps extends IFieldProps {
13
+ element: IMakeMultiSelect
14
+ }
@@ -1,12 +1,12 @@
1
- import { IField, IFieldProps } from './field'
2
- import { IModalLiveDataCondition } from './modal'
3
-
4
- export interface IMakeSelect extends IField {
5
- elementType: 'select'
6
- options: Array<Record<'id'|'name', string>>
7
- liveData?: IModalLiveDataCondition
8
- }
9
-
10
- export interface IMakeSelectProps extends IFieldProps {
11
- element: IMakeSelect
12
- }
1
+ import { IField, IFieldProps } from './field'
2
+ import { IModalLiveDataCondition } from './modal'
3
+
4
+ export interface IMakeSelect extends IField {
5
+ elementType: 'select'
6
+ options: Array<Record<'id'|'name', string>>
7
+ liveData?: IModalLiveDataCondition
8
+ }
9
+
10
+ export interface IMakeSelectProps extends IFieldProps {
11
+ element: IMakeSelect
12
+ }
@@ -1,12 +1,12 @@
1
- import { CSSProperties } from 'react'
2
- import { IFieldProps } from './field'
3
-
4
- export interface IMakeText {
5
- elementType: 'text'
6
- text: string
7
- styles?: CSSProperties
8
- }
9
-
10
- export interface IMakeTextProps extends IFieldProps {
11
- element: IMakeText
12
- }
1
+ import { CSSProperties } from 'react'
2
+ import { IFieldProps } from './field'
3
+
4
+ export interface IMakeText {
5
+ elementType: 'text'
6
+ text: string
7
+ styles?: CSSProperties
8
+ }
9
+
10
+ export interface IMakeTextProps extends IFieldProps {
11
+ element: IMakeText
12
+ }
@@ -1,11 +1,11 @@
1
- import { IField, IFieldProps } from './field'
2
-
3
- export interface IMakeTextarea extends IField {
4
- elementType: 'textarea'
5
- cols?: number
6
- rows?: number
7
- }
8
-
9
- export interface IMakeTextareaProps extends IFieldProps {
10
- element: IMakeTextarea
11
- }
1
+ import { IField, IFieldProps } from './field'
2
+
3
+ export interface IMakeTextarea extends IField {
4
+ elementType: 'textarea'
5
+ cols?: number
6
+ rows?: number
7
+ }
8
+
9
+ export interface IMakeTextareaProps extends IFieldProps {
10
+ element: IMakeTextarea
11
+ }
@@ -1,3 +1,3 @@
1
- export interface IMakeTitle {
2
- title: string
3
- }
1
+ export interface IMakeTitle {
2
+ title: string
3
+ }