@progress/kendo-themes-html 14.5.1-dev.7 → 14.5.1-dev.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/dist/cjs/colorgradient/demos/colorgradient.js +1 -1
- package/dist/cjs/colorpicker/colorpicker.spec.js +1 -1
- package/dist/cjs/colorpicker/templates/colorpicker-adaptive.js +1 -1
- package/dist/cjs/colorpicker/templates/colorpicker-disabled.js +1 -1
- package/dist/cjs/colorpicker/templates/colorpicker-normal.js +1 -1
- package/dist/cjs/combobox/demos/combobox.js +1 -1
- package/dist/cjs/combobox/templates/combobox-grouping-modern-custom-value.js +1 -1
- package/dist/cjs/filemanager/filemanager-listview.spec.js +1 -1
- package/dist/cjs/floating-toolbar/floating-toolbar.spec.js +1 -1
- package/dist/cjs/imageeditor/imageeditor-option-list.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-option-preview.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-pane.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-placeholder.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-preview-thumbnail.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-resize-handles.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-sidebar.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-toolbar.js +1 -1
- package/dist/cjs/imageeditor/imageeditor.spec.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-adjustments.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-blur.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-crop.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-disabled.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-filters.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-frames.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-line.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-shape.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-text.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-normal.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-pixelate.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-resize.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-rotate.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-shadow.js +1 -0
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/listview/demos/listview.js +1 -1
- package/dist/cjs/listview/listview.spec.js +1 -1
- package/dist/cjs/listview/templates/listview-no-data.js +1 -1
- package/dist/cjs/listview/templates/listview-normal.js +1 -1
- package/dist/cjs/listview/templates/listview-selectable.js +1 -1
- package/dist/cjs/pager/index.js +1 -1
- package/dist/cjs/prompt/templates/prompt-inline-input-only.js +1 -1
- package/dist/cjs/prompt/templates/prompt-inline.js +1 -1
- package/dist/cjs/prompt/templates/prompt-more-actions.js +1 -1
- package/dist/cjs/prompt/templates/prompt-normal.js +1 -1
- package/dist/cjs/prompt/templates/prompt-output.js +1 -1
- package/dist/cjs/prompt/templates/prompt-popup.js +1 -1
- package/dist/cjs/prompt/templates/prompt-settings.js +1 -1
- package/dist/cjs/prompt/templates/prompt-suggestions.js +1 -1
- package/dist/cjs/scheduler/scheduler-toolbar.spec.js +1 -1
- package/dist/cjs/spreadsheet/spreadsheet-action-bar.js +1 -1
- package/dist/cjs/toolbar/demos/toolbar.js +1 -1
- package/dist/cjs/toolbar/templates/toolbar-scrollable-buttons-hidden.js +1 -1
- package/dist/cjs/toolbar/templates/toolbar-scrollable.js +1 -1
- package/dist/esm/colorgradient/demos/colorgradient.mjs +1 -1
- package/dist/esm/colorpicker/colorpicker.spec.mjs +1 -1
- package/dist/esm/colorpicker/templates/colorpicker-adaptive.mjs +1 -1
- package/dist/esm/colorpicker/templates/colorpicker-disabled.mjs +1 -1
- package/dist/esm/colorpicker/templates/colorpicker-normal.mjs +1 -1
- package/dist/esm/combobox/demos/combobox.mjs +1 -1
- package/dist/esm/combobox/templates/combobox-grouping-modern-custom-value.mjs +1 -1
- package/dist/esm/filemanager/filemanager-listview.spec.mjs +1 -1
- package/dist/esm/floating-toolbar/floating-toolbar.spec.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor-option-list.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-option-preview.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-pane.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-placeholder.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-preview-thumbnail.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-resize-handles.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-sidebar.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-toolbar.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor.spec.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-adjustments.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-blur.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-crop.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-disabled.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-filters.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-frames.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-line.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-shape.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-text.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-normal.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-pixelate.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-resize.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-rotate.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-shadow.mjs +1 -0
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/listview/demos/listview.mjs +1 -1
- package/dist/esm/listview/templates/listview-no-data.mjs +1 -1
- package/dist/esm/listview/templates/listview-normal.mjs +1 -1
- package/dist/esm/listview/templates/listview-selectable.mjs +1 -1
- package/dist/esm/pager/index.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-inline-input-only.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-inline.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-more-actions.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-normal.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-output.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-popup.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-settings.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-suggestions.mjs +1 -1
- package/dist/esm/scheduler/scheduler-toolbar.spec.mjs +1 -1
- package/dist/esm/spreadsheet/spreadsheet-action-bar.mjs +1 -1
- package/dist/esm/toolbar/demos/toolbar.mjs +1 -1
- package/dist/esm/toolbar/templates/toolbar-scrollable-buttons-hidden.mjs +1 -1
- package/dist/esm/toolbar/templates/toolbar-scrollable.mjs +1 -1
- package/dist/types/combobox/combobox.spec.d.ts +1 -1
- package/dist/types/imageeditor/imageeditor-option-list.d.ts +18 -0
- package/dist/types/imageeditor/imageeditor-option-preview.d.ts +18 -0
- package/dist/types/imageeditor/imageeditor-pane.d.ts +21 -0
- package/dist/types/imageeditor/imageeditor-placeholder.d.ts +7 -0
- package/dist/types/imageeditor/imageeditor-preview-thumbnail.d.ts +12 -0
- package/dist/types/imageeditor/imageeditor-resize-handles.d.ts +14 -0
- package/dist/types/imageeditor/imageeditor-sidebar.d.ts +11 -0
- package/dist/types/imageeditor/imageeditor-toolbar.d.ts +1 -0
- package/dist/types/imageeditor/imageeditor.spec.d.ts +40 -4
- package/dist/types/imageeditor/index.d.ts +18 -0
- package/dist/types/imageeditor/templates/imageeditor-adjustments.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-blur.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-disabled.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-filters.d.ts +6 -0
- package/dist/types/imageeditor/templates/imageeditor-frames.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-line.d.ts +2 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-shape.d.ts +2 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-text.d.ts +2 -0
- package/dist/types/imageeditor/templates/imageeditor-pixelate.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-rotate.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-shadow.d.ts +1 -0
- package/dist/types/numerictextbox/numerictextbox.spec.d.ts +1 -1
- package/package.json +4 -4
- package/src/combobox/combobox.spec.tsx +2 -2
- package/src/imageeditor/imageeditor-option-list.tsx +53 -0
- package/src/imageeditor/imageeditor-option-preview.tsx +56 -0
- package/src/imageeditor/imageeditor-pane.tsx +70 -0
- package/src/imageeditor/imageeditor-placeholder.tsx +51 -0
- package/src/imageeditor/imageeditor-preview-thumbnail.tsx +42 -0
- package/src/imageeditor/imageeditor-resize-handles.tsx +37 -0
- package/src/imageeditor/imageeditor-sidebar.tsx +66 -0
- package/src/imageeditor/imageeditor-toolbar.tsx +14 -13
- package/src/imageeditor/imageeditor.spec.tsx +79 -13
- package/src/imageeditor/index.ts +19 -0
- package/src/imageeditor/templates/imageeditor-adjustments.tsx +88 -0
- package/src/imageeditor/templates/imageeditor-blur.tsx +92 -0
- package/src/imageeditor/templates/imageeditor-crop.tsx +64 -59
- package/src/imageeditor/templates/imageeditor-disabled.tsx +45 -0
- package/src/imageeditor/templates/imageeditor-filters.tsx +98 -0
- package/src/imageeditor/templates/imageeditor-frames.tsx +180 -0
- package/src/imageeditor/templates/imageeditor-insert-line.tsx +141 -0
- package/src/imageeditor/templates/imageeditor-insert-shape.tsx +195 -0
- package/src/imageeditor/templates/imageeditor-insert-text.tsx +143 -0
- package/src/imageeditor/templates/imageeditor-normal.tsx +20 -1
- package/src/imageeditor/templates/imageeditor-pixelate.tsx +92 -0
- package/src/imageeditor/templates/imageeditor-resize.tsx +68 -50
- package/src/imageeditor/templates/imageeditor-rotate.tsx +98 -0
- package/src/imageeditor/templates/imageeditor-shadow.tsx +96 -0
- package/src/imageeditor/tests/imageeditor-adaptive-small.tsx +373 -0
- package/src/imageeditor/tests/imageeditor-adjustments-pane.tsx +14 -0
- package/src/imageeditor/tests/imageeditor-blur-pane.tsx +29 -0
- package/src/imageeditor/tests/imageeditor-crop-pane.tsx +3 -2
- package/src/imageeditor/tests/imageeditor-export-dialog.tsx +85 -0
- package/src/imageeditor/tests/imageeditor-filters-pane.tsx +14 -0
- package/src/imageeditor/tests/imageeditor-frames-pane.tsx +22 -0
- package/src/imageeditor/tests/imageeditor-insert-line-pane.tsx +52 -0
- package/src/imageeditor/tests/imageeditor-insert-shape-pane.tsx +57 -0
- package/src/imageeditor/tests/imageeditor-insert-text-pane.tsx +51 -0
- package/src/imageeditor/tests/imageeditor-interactive-states.tsx +79 -0
- package/src/imageeditor/tests/imageeditor-option-list-states.tsx +17 -0
- package/src/imageeditor/tests/imageeditor-pixelate-pane.tsx +29 -0
- package/src/imageeditor/tests/imageeditor-resize-pane.tsx +15 -1
- package/src/imageeditor/tests/imageeditor-responsive.tsx +71 -0
- package/src/imageeditor/tests/imageeditor-rotate-pane.tsx +27 -0
- package/src/imageeditor/tests/imageeditor-shadow-pane.tsx +14 -0
- package/src/imageeditor/tests/imageeditor-sidebar-scrollable.tsx +97 -0
- package/src/numerictextbox/numerictextbox.spec.tsx +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KendoToolbarProps, Toolbar, ToolbarItem, ToolbarSeparator } from '../toolbar';
|
|
2
2
|
import { classNames } from '../misc';
|
|
3
3
|
import { Button } from '../button';
|
|
4
|
-
import {
|
|
4
|
+
import { Autocomplete } from '../autocomplete';
|
|
5
5
|
|
|
6
6
|
export const IMAGEEDITORTOOLBAR_CLASSNAME = `k-imageeditor-toolbar`;
|
|
7
7
|
|
|
@@ -13,24 +13,24 @@ export type KendoImageEditorToolbarProps = {
|
|
|
13
13
|
toolbarItems?: React.JSX.Element | React.JSX.Element[];
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<Button key="toolbar-button-
|
|
16
|
+
// Shared toolbar preset for tool templates that have an active image/history (undo, redo and zoom enabled)
|
|
17
|
+
export const imageEditorToolbarItems = [
|
|
18
|
+
<Button fillMode="flat" key="toolbar-button-1" icon="image-add" aria-label="Image Add"></Button>,
|
|
19
19
|
<ToolbarSeparator key="toolbar-separator-1"></ToolbarSeparator>,
|
|
20
|
-
<Button key="toolbar-button-
|
|
21
|
-
<Button key="toolbar-button-
|
|
20
|
+
<Button fillMode="flat" key="toolbar-button-2" icon="undo" aria-label="Undo"></Button>,
|
|
21
|
+
<Button fillMode="flat" key="toolbar-button-3" icon="redo" aria-label="Redo"></Button>,
|
|
22
22
|
<ToolbarSeparator key="toolbar-separator-2"></ToolbarSeparator>,
|
|
23
|
-
<Button key="toolbar-button-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
<Button key="toolbar-button-8" disabled icon="zoom-out" aria-label="Zoom out"></Button>,
|
|
23
|
+
<Button fillMode="flat" key="toolbar-button-4" icon="download" aria-label="Download"></Button>,
|
|
24
|
+
<div className="k-spacer" key="toolbar-spacer"></div>,
|
|
25
|
+
<Button fillMode="flat" key="toolbar-button-5" icon="zoom-in" aria-label="Zoom In"></Button>,
|
|
27
26
|
<ToolbarItem key="toolbar-item-1">
|
|
28
|
-
<
|
|
29
|
-
</ToolbarItem
|
|
27
|
+
<Autocomplete fillMode="flat" value="Fit" aria-label="Zoom options" />
|
|
28
|
+
</ToolbarItem>,
|
|
29
|
+
<Button fillMode="flat" key="toolbar-button-6" icon="zoom-out" aria-label="Zoom Out"></Button>
|
|
30
30
|
];
|
|
31
31
|
|
|
32
32
|
const defaultOptions = {
|
|
33
|
-
toolbarItems:
|
|
33
|
+
toolbarItems: imageEditorToolbarItems
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export const ImageEditorToolbar = (
|
|
@@ -50,6 +50,7 @@ export const ImageEditorToolbar = (
|
|
|
50
50
|
props.className,
|
|
51
51
|
IMAGEEDITORTOOLBAR_CLASSNAME,
|
|
52
52
|
)}
|
|
53
|
+
fillMode="flat"
|
|
53
54
|
>
|
|
54
55
|
{toolbarItems}
|
|
55
56
|
</Toolbar>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { classNames } from '../misc';
|
|
2
2
|
import { ImageEditorToolbar } from './imageeditor-toolbar';
|
|
3
|
+
import { ImageEditorSidebar } from './imageeditor-sidebar';
|
|
4
|
+
import { Overlay } from '../overlay';
|
|
5
|
+
import { Loader } from '../loader';
|
|
3
6
|
|
|
4
7
|
import { KendoComponent } from '../_types/component';
|
|
5
8
|
import { IMAGEEDITOR_FOLDER_NAME, IMAGEEDITOR_MODULE_NAME } from './constants';
|
|
@@ -12,7 +15,14 @@ const options = {};
|
|
|
12
15
|
export type KendoImageEditorProps = {
|
|
13
16
|
toolbarItems?: React.JSX.Element | React.JSX.Element[];
|
|
14
17
|
actionPane?: React.JSX.Element | React.JSX.Element[];
|
|
18
|
+
sidebarItems?: React.JSX.Element | React.JSX.Element[];
|
|
19
|
+
placeholder?: React.JSX.Element;
|
|
15
20
|
contentHeight?: string;
|
|
21
|
+
exporting?: boolean;
|
|
22
|
+
/** Renders the mobile layout: canvas, then the pane and sidebar docked at the bottom. */
|
|
23
|
+
adaptive?: boolean;
|
|
24
|
+
sidebarScrollable?: boolean;
|
|
25
|
+
sidebarScrollingPosition?: 'start' | 'end' | 'both';
|
|
16
26
|
};
|
|
17
27
|
|
|
18
28
|
const defaultOptions = {};
|
|
@@ -20,11 +30,13 @@ const defaultOptions = {};
|
|
|
20
30
|
/**
|
|
21
31
|
* @aria {role="img"} Indicates the canvas role as an image. Applicable when an image is loaded.
|
|
22
32
|
* @aria {aria-label|aria-labelledby} Provides an accessible name for the canvas by describing the image content. Applicable when an image is loaded.
|
|
33
|
+
* @aria {role="status"} Announces the busy overlay shown while `exporting` is true.
|
|
23
34
|
* @ux {Canvas} Renders the image on an editable canvas.
|
|
24
35
|
* @ux {Crop} A crop tool lets the user select and apply a cropping region.
|
|
25
36
|
* @ux {Pan and zoom} The canvas can be panned by dragging and zoomed with the mouse wheel.
|
|
26
37
|
* @ux {Undo / Redo} All edit operations can be undone and redone.
|
|
27
38
|
* @ux {Export} The edited image can be saved or downloaded.
|
|
39
|
+
* @ux {Exporting} While `exporting` is true, a busy overlay covers the editor and interaction is blocked.
|
|
28
40
|
*/
|
|
29
41
|
export const ImageEditor: KendoComponent<KendoImageEditorProps & React.HTMLAttributes<HTMLDivElement>> = (
|
|
30
42
|
props: KendoImageEditorProps &
|
|
@@ -33,33 +45,60 @@ export const ImageEditor: KendoComponent<KendoImageEditorProps & React.HTMLAttri
|
|
|
33
45
|
const {
|
|
34
46
|
toolbarItems,
|
|
35
47
|
actionPane,
|
|
48
|
+
sidebarItems,
|
|
49
|
+
placeholder,
|
|
36
50
|
contentHeight,
|
|
51
|
+
exporting,
|
|
52
|
+
adaptive,
|
|
53
|
+
sidebarScrollable,
|
|
54
|
+
sidebarScrollingPosition,
|
|
37
55
|
children,
|
|
38
56
|
...other
|
|
39
57
|
} = props;
|
|
40
58
|
|
|
59
|
+
const canvasContainer = (
|
|
60
|
+
<div className="k-imageeditor-canvas-container">
|
|
61
|
+
{placeholder ?? (
|
|
62
|
+
<div className="k-imageeditor-canvas">
|
|
63
|
+
{children}
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const pane = actionPane &&
|
|
70
|
+
<div className="k-imageeditor-action-pane">{actionPane}</div>;
|
|
71
|
+
|
|
72
|
+
const sidebar = <ImageEditorSidebar sidebarItems={sidebarItems} scrollable={sidebarScrollable} scrollingPosition={sidebarScrollingPosition} />;
|
|
73
|
+
|
|
41
74
|
return (
|
|
42
75
|
<div
|
|
43
76
|
{...other}
|
|
44
77
|
className={classNames(
|
|
45
78
|
props.className,
|
|
46
|
-
IMAGEEDITOR_CLASSNAME
|
|
79
|
+
IMAGEEDITOR_CLASSNAME,
|
|
80
|
+
{ [`${IMAGEEDITOR_CLASSNAME}-adaptive`]: adaptive }
|
|
47
81
|
)}>
|
|
48
82
|
<div className="k-imageeditor-header">
|
|
49
83
|
<ImageEditorToolbar toolbarItems={toolbarItems} />
|
|
50
84
|
</div>
|
|
51
85
|
|
|
52
86
|
<div className="k-imageeditor-content" style={{ height: contentHeight }}>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
{actionPane &&
|
|
60
|
-
<div className="k-imageeditor-action-pane">{actionPane}</div>
|
|
87
|
+
{adaptive
|
|
88
|
+
? <>{canvasContainer}{pane}{sidebar}</>
|
|
89
|
+
: <>{sidebar}{pane}{canvasContainer}</>
|
|
61
90
|
}
|
|
62
91
|
</div>
|
|
92
|
+
|
|
93
|
+
{exporting &&
|
|
94
|
+
<div className="k-loader-container k-loader-top" role="status" aria-live="polite" aria-label="Exporting">
|
|
95
|
+
<Overlay className="k-loader-container-overlay" />
|
|
96
|
+
<div className="k-loader-container-inner k-loader-container-panel">
|
|
97
|
+
<Loader animation="pulsing" themeColor="base" size="medium" aria-label="Exporting" />
|
|
98
|
+
<div className="k-loader-container-label">Exporting</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
}
|
|
63
102
|
</div>
|
|
64
103
|
);
|
|
65
104
|
};
|
|
@@ -72,10 +111,37 @@ ImageEditor.moduleName = IMAGEEDITOR_MODULE_NAME;
|
|
|
72
111
|
ImageEditor.folderName = IMAGEEDITOR_FOLDER_NAME;
|
|
73
112
|
|
|
74
113
|
/**
|
|
75
|
-
* @keyboard {
|
|
76
|
-
* @keyboard {
|
|
77
|
-
* @keyboard {
|
|
78
|
-
* @keyboard {
|
|
114
|
+
* @keyboard {Alt/Opt(Mac) + Number} Focuses the component.
|
|
115
|
+
* @keyboard {Tab} Focuses the next focusable item.
|
|
116
|
+
* @keyboard {Shift + Tab} Focuses the previous focusable item.
|
|
117
|
+
* @keyboard {Enter} Presses the focused button.
|
|
118
|
+
* @keyboard {Space} Presses the focused button.
|
|
119
|
+
* @keyboard {Control/Cmd(Mac) + Z} Undo the operation.
|
|
120
|
+
* @keyboard {Control/Cmd(Mac) + Y} Redo the operation.
|
|
121
|
+
* @keyboard {Escape} Deselect / Cancel operation.
|
|
122
|
+
* @keyboard {Delete} Delete selected element.
|
|
123
|
+
* @keyboard {Control/Cmd(Mac) + Plus} Zooms in on the image. Conflicts with the browser zoom in all browsers; requires `preventDefault` when the component is focused.
|
|
124
|
+
* @keyboard {Control/Cmd(Mac) + Minus} Zooms out from the image. Conflicts with the browser zoom out in all browsers; requires `preventDefault` when the component is focused.
|
|
125
|
+
* @keyboard {Control/Cmd(Mac) + O} Opens the image browser to import a new image. Conflicts with the Open File dialog in all browsers; requires `preventDefault` when the component is focused.
|
|
126
|
+
* @keyboard {Control/Cmd(Mac) + D} Duplicates the selected element. Conflicts with Bookmark Page in all browsers; requires `preventDefault` when the component is focused.
|
|
127
|
+
* @keyboard {Control/Cmd(Mac) + Shift + S} Exports the image. Conflicts with the Firefox Screenshot tool; requires `preventDefault` when the component is focused.
|
|
128
|
+
* @keyboard {Shift + 1} Fit to screen.
|
|
129
|
+
* @keyboard {Shift + 0} Zoom to 100%.
|
|
130
|
+
* @keyboard {Control/Cmd(Mac) + F3} Moves keyboard focus directly to the Side Panel.
|
|
131
|
+
* @keyboard {R} Inserts a rectangle shape and selects it. The Floating Toolbar appears, but the side panel remains closed.
|
|
132
|
+
* @keyboard {O} Inserts an oval shape and selects it. The Floating Toolbar appears, but the side panel remains closed.
|
|
133
|
+
* @keyboard {L} Inserts a line shape and selects it. The Floating Toolbar appears, but the side panel remains closed.
|
|
134
|
+
* @keyboard {T} Inserts a text box with a typing cursor and selects it. The Floating Toolbar appears, but the side panel remains closed.
|
|
135
|
+
* @keyboard {ArrowLeft} Moves the selected object left.
|
|
136
|
+
* @keyboard {ArrowRight} Moves the selected object right.
|
|
137
|
+
* @keyboard {ArrowUp} Moves the selected object up.
|
|
138
|
+
* @keyboard {ArrowDown} Moves the selected object down.
|
|
139
|
+
* @keyboard {Control/Cmd(Mac) + B} Bolds the text. Conflicts with the Firefox Bookmarks Sidebar; requires `preventDefault` when the component is focused.
|
|
140
|
+
* @keyboard {Control/Cmd(Mac) + I} Italicizes the text. Conflicts with Firefox Page Info; requires `preventDefault` when the component is focused.
|
|
141
|
+
* @keyboard {Control/Cmd(Mac) + U} Underlines the text. Conflicts with View Source in Chrome, Firefox, and Edge; requires `preventDefault` when the component is focused.
|
|
142
|
+
* @keyboard {Control/Cmd(Mac) + Shift + L} Left-aligns the text.
|
|
143
|
+
* @keyboard {Control/Cmd(Mac) + Shift + E} Center-aligns the text. Conflicts with Firefox Search in Tabs; requires `preventDefault` when the component is focused.
|
|
144
|
+
* @keyboard {Control/Cmd(Mac) + Shift + R} Right-aligns the text. Conflicts with Hard Refresh in all browsers; requires `preventDefault` when the component is focused.
|
|
79
145
|
*
|
|
80
146
|
* @see https://pauljadam.com/demos/canvas.html HTML Canvas Accessibility
|
|
81
147
|
*/
|
package/src/imageeditor/index.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
export * from './imageeditor.spec';
|
|
2
2
|
export * from './imageeditor-toolbar';
|
|
3
|
+
export * from './imageeditor-sidebar';
|
|
4
|
+
export * from './imageeditor-placeholder';
|
|
5
|
+
export * from './imageeditor-pane';
|
|
6
|
+
export * from './imageeditor-option-preview';
|
|
7
|
+
export * from './imageeditor-option-list';
|
|
8
|
+
export * from './imageeditor-preview-thumbnail';
|
|
9
|
+
export * from './imageeditor-resize-handles';
|
|
3
10
|
export * from './templates/imageeditor-normal';
|
|
4
11
|
export * from './templates/imageeditor-resize';
|
|
12
|
+
export * from './templates/imageeditor-rotate';
|
|
5
13
|
export * from './templates/imageeditor-crop';
|
|
14
|
+
export * from './templates/imageeditor-disabled';
|
|
15
|
+
export * from './templates/imageeditor-insert-text';
|
|
16
|
+
export * from './templates/imageeditor-insert-shape';
|
|
17
|
+
export * from './templates/imageeditor-insert-line';
|
|
18
|
+
export * from './templates/imageeditor-blur';
|
|
19
|
+
export * from './templates/imageeditor-pixelate';
|
|
20
|
+
export * from './templates/imageeditor-filters';
|
|
21
|
+
export * from './templates/imageeditor-adjustments';
|
|
22
|
+
export * from './templates/imageeditor-frames';
|
|
23
|
+
export * from './templates/imageeditor-shadow';
|
|
24
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ImageEditor, ImageEditorPane } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { NumericTextbox } from "../../numerictextbox";
|
|
4
|
+
import { Form, FormField } from "../../form";
|
|
5
|
+
import { Slider } from "../../slider";
|
|
6
|
+
|
|
7
|
+
const adjustmentsSidebarItems = [
|
|
8
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
9
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
10
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
11
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
13
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
14
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
16
|
+
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" selected aria-label="Adjustments"></Button>,
|
|
17
|
+
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
18
|
+
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
19
|
+
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
20
|
+
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const AdjustmentSlider = ({ id, label, value, min = 0, max = 100 }: { id: string; label: string; value: number; min?: number; max?: number }) => (
|
|
24
|
+
<FormField
|
|
25
|
+
label={label}
|
|
26
|
+
editorId={id}
|
|
27
|
+
editor={
|
|
28
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
29
|
+
<Slider
|
|
30
|
+
className="k-imageeditor-adjustment-slider"
|
|
31
|
+
aria-label={label}
|
|
32
|
+
showButtons={false}
|
|
33
|
+
showTicks={false}
|
|
34
|
+
value={value}
|
|
35
|
+
min={min}
|
|
36
|
+
max={max}
|
|
37
|
+
style={{ "--kendo-slider-start": min < 0 ? 0 : min, "--kendo-slider-end": value } as React.CSSProperties}
|
|
38
|
+
/>
|
|
39
|
+
<NumericTextbox
|
|
40
|
+
id={id}
|
|
41
|
+
style={{ width: "80px", flex: "none" }}
|
|
42
|
+
showClearButton={false}
|
|
43
|
+
showSpinButton={false}
|
|
44
|
+
value={String(value)}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export const ImageEditorAdjustments = ({
|
|
52
|
+
brightness = 0,
|
|
53
|
+
contrast = 0,
|
|
54
|
+
saturation = 0,
|
|
55
|
+
hue = 0,
|
|
56
|
+
exposure = 0,
|
|
57
|
+
blur = 24,
|
|
58
|
+
opacity = 24,
|
|
59
|
+
...props
|
|
60
|
+
}: any) => (
|
|
61
|
+
<ImageEditor
|
|
62
|
+
sidebarItems={adjustmentsSidebarItems}
|
|
63
|
+
actionPane={
|
|
64
|
+
<ImageEditorPane title="Adjustments" actions={
|
|
65
|
+
<>
|
|
66
|
+
<Button>Reset</Button>
|
|
67
|
+
<Button themeColor="primary">Apply</Button>
|
|
68
|
+
</>
|
|
69
|
+
}>
|
|
70
|
+
<Form tag="div">
|
|
71
|
+
<AdjustmentSlider id="adjustments-brightness" label="Brightness" value={brightness} min={-100} max={100} />
|
|
72
|
+
<AdjustmentSlider id="adjustments-contrast" label="Contrast" value={contrast} min={-100} max={100} />
|
|
73
|
+
<AdjustmentSlider id="adjustments-saturation" label="Saturation" value={saturation} min={-100} max={100} />
|
|
74
|
+
<AdjustmentSlider id="adjustments-hue" label="Hue" value={hue} min={-100} max={100} />
|
|
75
|
+
<AdjustmentSlider id="adjustments-exposure" label="Exposure" value={exposure} min={-100} max={100} />
|
|
76
|
+
<AdjustmentSlider id="adjustments-blur" label="Blur" value={blur} />
|
|
77
|
+
<AdjustmentSlider id="adjustments-opacity" label="Opacity" value={opacity} />
|
|
78
|
+
</Form>
|
|
79
|
+
</ImageEditorPane>
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
children={
|
|
83
|
+
<>
|
|
84
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{ backgroundImage: "url('/packages/html/assets/sofia.jpg')", backgroundSize: "cover" }}></canvas>
|
|
85
|
+
</>
|
|
86
|
+
}
|
|
87
|
+
{...props} />
|
|
88
|
+
);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ImageEditor, ImageEditorPane } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { NumericTextbox } from "../../numerictextbox";
|
|
4
|
+
import { Form, FormField } from "../../form";
|
|
5
|
+
import { RadioGroup, RadioItem, RadioButtonWithLabelAfter } from "../../radio";
|
|
6
|
+
import { SegmentedControl, SegmentedControlButton } from "../../segmented-control";
|
|
7
|
+
import { Slider } from "../../slider";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const blurSidebarItems = [
|
|
11
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
13
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
14
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
16
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
17
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
18
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" selected aria-label="Blur"></Button>,
|
|
19
|
+
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
20
|
+
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
21
|
+
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
22
|
+
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
23
|
+
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export const ImageEditorBlur = ({ shape = "rectangular", intensity = 16, ...props }: any) => (
|
|
27
|
+
<ImageEditor
|
|
28
|
+
sidebarItems={blurSidebarItems}
|
|
29
|
+
actionPane={
|
|
30
|
+
<ImageEditorPane title="Blur" actions={
|
|
31
|
+
<>
|
|
32
|
+
<Button>Reset</Button>
|
|
33
|
+
<Button themeColor="primary">Apply</Button>
|
|
34
|
+
</>
|
|
35
|
+
}>
|
|
36
|
+
<SegmentedControl thumbStyles={{ width: "50%" }} stretched aria-label="Redaction Tool" style={{ flexShrink: 0 }}>
|
|
37
|
+
<SegmentedControlButton icon="blur" selected>Blur</SegmentedControlButton>
|
|
38
|
+
<SegmentedControlButton icon="grid">Pixelate</SegmentedControlButton>
|
|
39
|
+
</SegmentedControl>
|
|
40
|
+
|
|
41
|
+
<Form tag="div">
|
|
42
|
+
<FormField
|
|
43
|
+
label="Marquee Tool Shape"
|
|
44
|
+
editor={
|
|
45
|
+
<RadioGroup layout="horizontal">
|
|
46
|
+
<RadioItem>
|
|
47
|
+
<RadioButtonWithLabelAfter id="blur-shape-rectangular" name="blur-shape" checked={shape === "rectangular"}>Rectangular</RadioButtonWithLabelAfter>
|
|
48
|
+
</RadioItem>
|
|
49
|
+
<RadioItem>
|
|
50
|
+
<RadioButtonWithLabelAfter id="blur-shape-elliptical" name="blur-shape" checked={shape === "elliptical"}>Elliptical</RadioButtonWithLabelAfter>
|
|
51
|
+
</RadioItem>
|
|
52
|
+
</RadioGroup>
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
<FormField
|
|
56
|
+
label="Blur Intensity"
|
|
57
|
+
editorId="blur-intensity"
|
|
58
|
+
editor={
|
|
59
|
+
<div className="k-imageeditor-field-row">
|
|
60
|
+
<Slider
|
|
61
|
+
style={{ flex: 1, "--kendo-slider-start": 0, "--kendo-slider-end": intensity } as React.CSSProperties}
|
|
62
|
+
aria-label="Blur Intensity"
|
|
63
|
+
showButtons={false}
|
|
64
|
+
showTicks={false}
|
|
65
|
+
value={intensity}
|
|
66
|
+
min={0}
|
|
67
|
+
max={100}
|
|
68
|
+
/>
|
|
69
|
+
<NumericTextbox
|
|
70
|
+
id="blur-intensity"
|
|
71
|
+
style={{ width: "80px", flex: "none" }}
|
|
72
|
+
showClearButton={false}
|
|
73
|
+
showSpinButton={false}
|
|
74
|
+
value={String(intensity)}
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
</Form>
|
|
80
|
+
</ImageEditorPane>
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
children={
|
|
84
|
+
<>
|
|
85
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{ backgroundImage: "url('/packages/html/assets/sofia.jpg')", backgroundSize: "cover", filter: "blur(8px)" }}></canvas>
|
|
86
|
+
<div className="k-imageeditor-crop-overlay">
|
|
87
|
+
<div className="k-imageeditor-crop" style={{ borderStyle: "dashed" }}></div>
|
|
88
|
+
</div>
|
|
89
|
+
</>
|
|
90
|
+
}
|
|
91
|
+
{...props} />
|
|
92
|
+
);
|
|
@@ -1,70 +1,81 @@
|
|
|
1
|
-
import { ImageEditor } from "..";
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorOptionList, ImageEditorOptionPreview, ImageEditorResizeHandles } from "..";
|
|
2
2
|
import { Button } from "../../button";
|
|
3
3
|
import { CheckboxWithLabelAfter } from "../../checkbox";
|
|
4
|
-
import { DropdownList } from "../../dropdownlist";
|
|
5
|
-
import { FormNormal, Fieldset, FormField } from "../../form";
|
|
6
4
|
import { NumericTextbox } from "../../numerictextbox";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { Form, FormField, Fieldset } from "../../form";
|
|
6
|
+
import { Icon } from "../../icon";
|
|
7
|
+
import { RadioGroup, RadioItem, RadioButtonWithLabelAfter } from "../../radio";
|
|
8
|
+
|
|
9
|
+
const cropSidebarItems = [
|
|
10
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
11
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" selected aria-label="Crop"></Button>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
13
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
14
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
16
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
17
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
18
|
+
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
19
|
+
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
20
|
+
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
21
|
+
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
22
|
+
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
23
|
+
];
|
|
9
24
|
|
|
10
25
|
export const ImageEditorCrop = (props: any) => (
|
|
11
26
|
<ImageEditor
|
|
12
|
-
|
|
13
|
-
<Button key="toolbar-button-1" icon="upload" aria-label="Upload"></Button>,
|
|
14
|
-
<Button key="toolbar-button-2" icon="download" aria-label="Download"></Button>,
|
|
15
|
-
<ToolbarSeparator key="toolbar-separator-1"></ToolbarSeparator>,
|
|
16
|
-
<Button key="toolbar-button-3" disabled icon="undo" aria-label="Undo"></Button>,
|
|
17
|
-
<Button key="toolbar-button-4" disabled icon="redo" aria-label="Redo"></Button>,
|
|
18
|
-
<ToolbarSeparator key="toolbar-separator-2"></ToolbarSeparator>,
|
|
19
|
-
<Button key="toolbar-button-5" icon="crop" aria-label="Crop"></Button>,
|
|
20
|
-
<Button key="toolbar-button-6" icon="image-resize" aria-label="Resize"></Button>,
|
|
21
|
-
<Button key="toolbar-button-7" icon="zoom-in" aria-label="Zoom in"></Button>,
|
|
22
|
-
<Button key="toolbar-button-8" icon="zoom-out" aria-label="Zoom out"></Button>,
|
|
23
|
-
<ToolbarItem key="toolbar-item-1">
|
|
24
|
-
<DropdownList value="Zoom options" aria-label="Zoom options" />
|
|
25
|
-
</ToolbarItem>
|
|
26
|
-
]}
|
|
27
|
+
sidebarItems={cropSidebarItems}
|
|
27
28
|
actionPane={
|
|
28
|
-
<
|
|
29
|
+
<ImageEditorPane title="Crop" actions={
|
|
29
30
|
<>
|
|
30
|
-
<Button
|
|
31
|
-
<Button
|
|
31
|
+
<Button>Reset</Button>
|
|
32
|
+
<Button themeColor="primary">Apply</Button>
|
|
32
33
|
</>
|
|
33
34
|
}>
|
|
34
|
-
<
|
|
35
|
-
<FormField
|
|
36
|
-
colSpan="2"
|
|
37
|
-
label="Aspect Ratio:"
|
|
38
|
-
editor={ <DropdownList value="Original ratio" aria-label="Aspect ratio" /> }
|
|
39
|
-
/>
|
|
35
|
+
<Form tag="div">
|
|
40
36
|
<FormField
|
|
41
|
-
|
|
42
|
-
label="Orientation:"
|
|
37
|
+
label="Orientation"
|
|
43
38
|
editor={
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
<RadioGroup layout="horizontal">
|
|
40
|
+
<RadioItem>
|
|
41
|
+
<RadioButtonWithLabelAfter id="crop-orientation-landscape" name="crop-orientation" checked>Landscape</RadioButtonWithLabelAfter>
|
|
42
|
+
</RadioItem>
|
|
43
|
+
<RadioItem>
|
|
44
|
+
<RadioButtonWithLabelAfter id="crop-orientation-portrait" name="crop-orientation">Portrait</RadioButtonWithLabelAfter>
|
|
45
|
+
</RadioItem>
|
|
46
|
+
</RadioGroup>
|
|
48
47
|
}
|
|
49
48
|
/>
|
|
50
49
|
<FormField
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
editor={ <CheckboxWithLabelAfter id="crop-lock">Lock aspect ratio</CheckboxWithLabelAfter> }
|
|
50
|
+
label="Aspect Ratio"
|
|
51
|
+
editor={
|
|
52
|
+
<ImageEditorOptionList scrollable scrollableEnd>
|
|
53
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">Original</span></ImageEditorOptionPreview>
|
|
54
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">1:1</span></ImageEditorOptionPreview>
|
|
55
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">3:2</span></ImageEditorOptionPreview>
|
|
56
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">4:3</span></ImageEditorOptionPreview>
|
|
57
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">5:4</span></ImageEditorOptionPreview>
|
|
58
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">7:5</span></ImageEditorOptionPreview>
|
|
59
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">16:9</span></ImageEditorOptionPreview>
|
|
60
|
+
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">Custom</span></ImageEditorOptionPreview>
|
|
61
|
+
</ImageEditorOptionList>
|
|
62
|
+
}
|
|
65
63
|
/>
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "8px" }}>
|
|
65
|
+
<FormField
|
|
66
|
+
label="Width"
|
|
67
|
+
editorId="crop-width"
|
|
68
|
+
editor={ <NumericTextbox id="crop-width" showClearButton={false} value="400" prefix={<Icon icon="arrows-left-right" />} /> }
|
|
69
|
+
/>
|
|
70
|
+
<FormField
|
|
71
|
+
label="Height"
|
|
72
|
+
editorId="crop-height"
|
|
73
|
+
editor={ <NumericTextbox id="crop-height" showClearButton={false} value="360" prefix={<Icon icon="arrows-top-bottom" />} /> }
|
|
74
|
+
/>
|
|
75
|
+
</Fieldset>
|
|
76
|
+
<FormField editor={ <CheckboxWithLabelAfter id="crop-lock" checked>Lock Aspect Ratio</CheckboxWithLabelAfter> } />
|
|
77
|
+
</Form>
|
|
78
|
+
</ImageEditorPane>
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
children={
|
|
@@ -72,17 +83,11 @@ export const ImageEditorCrop = (props: any) => (
|
|
|
72
83
|
<canvas width="61" height="68" role="img" aria-label="Image being edited"></canvas>
|
|
73
84
|
<div className="k-imageeditor-crop-overlay">
|
|
74
85
|
<div className="k-imageeditor-crop" style={{ width: "61px", height: "68px" }}>
|
|
75
|
-
<
|
|
76
|
-
<span className="k-resize-handle k-resize-n"></span>
|
|
77
|
-
<span className="k-resize-handle k-resize-ne"></span>
|
|
78
|
-
<span className="k-resize-handle k-resize-w"></span>
|
|
79
|
-
<span className="k-resize-handle k-resize-e"></span>
|
|
80
|
-
<span className="k-resize-handle k-resize-sw"></span>
|
|
81
|
-
<span className="k-resize-handle k-resize-s"></span>
|
|
82
|
-
<span className="k-resize-handle k-resize-se"></span>
|
|
86
|
+
<ImageEditorResizeHandles variant="crop" grid />
|
|
83
87
|
</div>
|
|
84
88
|
</div>
|
|
85
89
|
</>
|
|
86
90
|
}
|
|
87
91
|
{...props} />
|
|
88
92
|
);
|
|
93
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ImageEditor } from "..";
|
|
2
|
+
import { ToolbarItem, ToolbarSeparator } from "../../toolbar";
|
|
3
|
+
import { Button } from "../../button";
|
|
4
|
+
import { Autocomplete } from "../../autocomplete";
|
|
5
|
+
|
|
6
|
+
const disabledToolbarItems = [
|
|
7
|
+
<Button fillMode="flat" key="toolbar-button-1" icon="image-add" aria-label="Image Add"></Button>,
|
|
8
|
+
<ToolbarSeparator key="toolbar-separator-1"></ToolbarSeparator>,
|
|
9
|
+
<Button fillMode="flat" key="toolbar-button-2" disabled icon="undo" aria-label="Undo"></Button>,
|
|
10
|
+
<Button fillMode="flat" key="toolbar-button-3" disabled icon="redo" aria-label="Redo"></Button>,
|
|
11
|
+
<ToolbarSeparator key="toolbar-separator-2"></ToolbarSeparator>,
|
|
12
|
+
<Button fillMode="flat" key="toolbar-button-4" disabled icon="download" aria-label="Download"></Button>,
|
|
13
|
+
<div className="k-spacer" key="toolbar-spacer"></div>,
|
|
14
|
+
<Button fillMode="flat" key="toolbar-button-5" disabled icon="zoom-in" aria-label="Zoom In"></Button>,
|
|
15
|
+
<ToolbarItem key="toolbar-item-1">
|
|
16
|
+
<Autocomplete fillMode="flat" disabled value="Fit" aria-label="Zoom options" />
|
|
17
|
+
</ToolbarItem>,
|
|
18
|
+
<Button fillMode="flat" key="toolbar-button-6" disabled icon="zoom-out" aria-label="Zoom Out"></Button>
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const disabledSidebarItems = [
|
|
22
|
+
<Button fillMode="flat" key="sidebar-button-1" disabled icon="image-resize" aria-label="Resize" />,
|
|
23
|
+
<Button fillMode="flat" key="sidebar-button-2" disabled icon="crop" aria-label="Crop" />,
|
|
24
|
+
<Button fillMode="flat" key="sidebar-button-3" disabled icon="rotate" aria-label="Rotate" />,
|
|
25
|
+
<div className="k-separator" key="sidebar-separator-1" />,
|
|
26
|
+
<Button fillMode="flat" key="sidebar-button-4" disabled icon="free-text" aria-label="Text" />,
|
|
27
|
+
<Button fillMode="flat" key="sidebar-button-5" disabled icon="shapes" aria-label="Shapes" />,
|
|
28
|
+
<div className="k-separator" key="sidebar-separator-2" />,
|
|
29
|
+
<Button fillMode="flat" key="sidebar-button-6" disabled icon="drop-half-pixelated" aria-label="Blur" />,
|
|
30
|
+
<Button fillMode="flat" key="sidebar-button-7" disabled icon="sliders-horizontal" aria-label="Adjustments" />,
|
|
31
|
+
<Button fillMode="flat" key="sidebar-button-8" disabled icon="circles-three-intersecting" aria-label="Filters" />,
|
|
32
|
+
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
33
|
+
<Button fillMode="flat" key="sidebar-button-9" disabled icon="frame-corners" aria-label="Frame" />,
|
|
34
|
+
<Button fillMode="flat" key="sidebar-button-10" disabled icon="circle-half-tilted" aria-label="Shadow" />
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
// Non-editable state (Empty, Loading, Error): only the upload action is available,
|
|
38
|
+
// sidebar tools and the rest of the toolbar are disabled.
|
|
39
|
+
export const ImageEditorDisabled = (props: any) => (
|
|
40
|
+
<ImageEditor
|
|
41
|
+
toolbarItems={disabledToolbarItems}
|
|
42
|
+
sidebarItems={disabledSidebarItems}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
);
|