@ioca/react 1.5.3 → 1.5.5
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/lib/cjs/components/editor/controls.js +31 -40
- package/lib/cjs/components/editor/controls.js.map +1 -1
- package/lib/cjs/components/editor/editor.js +204 -41
- package/lib/cjs/components/editor/editor.js.map +1 -1
- package/lib/cjs/components/editor/memtion.js +171 -0
- package/lib/cjs/components/editor/memtion.js.map +1 -0
- package/lib/cjs/components/image/image.js +46 -30
- package/lib/cjs/components/image/image.js.map +1 -1
- package/lib/cjs/components/input/textarea.js +12 -5
- package/lib/cjs/components/input/textarea.js.map +1 -1
- package/lib/cjs/components/modal/hookModal.js +1 -1
- package/lib/cjs/components/modal/hookModal.js.map +1 -1
- package/lib/cjs/components/picker/colors/footer.js +1 -1
- package/lib/cjs/components/picker/colors/footer.js.map +1 -1
- package/lib/cjs/components/popconfirm/popconfirm.js +3 -3
- package/lib/cjs/components/popconfirm/popconfirm.js.map +1 -1
- package/lib/cjs/components/tabs/tabs.js +95 -37
- package/lib/cjs/components/tabs/tabs.js.map +1 -1
- package/lib/cjs/js/hooks.js +60 -40
- package/lib/cjs/js/hooks.js.map +1 -1
- package/lib/css/colors.css +13 -8
- package/lib/css/index.css +1 -1
- package/lib/css/index.css.map +1 -1
- package/lib/css/input.css +12 -6
- package/lib/css/reset.css +2 -5
- package/lib/css/utilities.css +9 -10
- package/lib/es/components/editor/controls.js +32 -37
- package/lib/es/components/editor/controls.js.map +1 -1
- package/lib/es/components/editor/editor.js +205 -42
- package/lib/es/components/editor/editor.js.map +1 -1
- package/lib/es/components/editor/memtion.js +160 -0
- package/lib/es/components/editor/memtion.js.map +1 -0
- package/lib/es/components/image/image.js +47 -31
- package/lib/es/components/image/image.js.map +1 -1
- package/lib/es/components/image/index.js +2 -2
- package/lib/es/components/image/list.js +2 -2
- package/lib/es/components/image/list.js.map +1 -1
- package/lib/es/components/input/textarea.js +12 -5
- package/lib/es/components/input/textarea.js.map +1 -1
- package/lib/es/components/modal/hookModal.js +1 -1
- package/lib/es/components/modal/hookModal.js.map +1 -1
- package/lib/es/components/picker/colors/footer.js +1 -1
- package/lib/es/components/picker/colors/footer.js.map +1 -1
- package/lib/es/components/popconfirm/popconfirm.js +3 -3
- package/lib/es/components/popconfirm/popconfirm.js.map +1 -1
- package/lib/es/components/tabs/tabs.js +95 -37
- package/lib/es/components/tabs/tabs.js.map +1 -1
- package/lib/es/components/upload/renderFile.js +2 -2
- package/lib/es/components/upload/renderFile.js.map +1 -1
- package/lib/es/js/hooks.js +61 -41
- package/lib/es/js/hooks.js.map +1 -1
- package/lib/index.js +608 -195
- package/lib/types/components/editor/type.d.ts +25 -12
- package/lib/types/components/image/image.d.ts +2 -2
- package/lib/types/components/image/index.d.ts +2 -2
- package/lib/types/components/input/type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
import { HTMLAttributes,
|
|
1
|
+
import { HTMLAttributes, Ref, ReactNode, MouseEvent, SyntheticEvent, KeyboardEvent, FocusEvent } from 'react';
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
|
|
3
|
+
interface IEditorAddtionControl {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
onClick?: (selection: Range | null, e: MouseEvent<HTMLElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
interface IEditorMemtionOption {
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
value: string | number;
|
|
10
|
+
}
|
|
11
|
+
interface IEditorMemtion {
|
|
12
|
+
key?: string;
|
|
13
|
+
options: IEditorMemtionOption[];
|
|
14
|
+
insert?: (option: IEditorMemtionOption) => ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface IEditor extends Omit<HTMLAttributes<HTMLDivElement>, "onInput" | "onChange"> {
|
|
17
|
+
ref?: Ref<HTMLDivElement>;
|
|
18
|
+
value?: string;
|
|
5
19
|
placeholder?: string;
|
|
6
20
|
width?: string | number;
|
|
7
21
|
height?: string | number;
|
|
8
22
|
autosize?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
mode?: "rich" | "plaintext";
|
|
24
|
+
hideControl?: boolean;
|
|
25
|
+
addtionControls?: IEditorAddtionControl[];
|
|
26
|
+
memtion?: IEditorMemtion;
|
|
11
27
|
border?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
input: HTMLDivElement | null;
|
|
16
|
-
getSafeValue: () => string;
|
|
17
|
-
setValue: (html: string) => void;
|
|
28
|
+
onChange?: (value: string, e: SyntheticEvent<HTMLDivElement>) => void;
|
|
29
|
+
onEnter?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
30
|
+
onFocus?: (e: FocusEvent<HTMLDivElement>) => void;
|
|
18
31
|
}
|
|
19
32
|
|
|
20
|
-
export type { IEditor,
|
|
33
|
+
export type { IEditor, IEditorAddtionControl, IEditorMemtion, IEditorMemtionOption };
|
|
@@ -14,6 +14,7 @@ interface ITextarea extends Omit<BaseInput, "ref">, Omit<TextareaHTMLAttributes<
|
|
|
14
14
|
ref?: RefObject<RefTextarea | null>;
|
|
15
15
|
autoSize?: boolean;
|
|
16
16
|
width?: string | number;
|
|
17
|
+
resize?: boolean;
|
|
17
18
|
}
|
|
18
19
|
interface RefTextarea {
|
|
19
20
|
input: HTMLTextAreaElement | null;
|