ish-ui 1.2.6 → 1.2.7
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.
|
@@ -21,9 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
* */
|
|
22
22
|
import React, { useRef } from 'react';
|
|
23
23
|
import AttachmentIcon from '@mui/icons-material/Attachment';
|
|
24
|
+
import Close from '@mui/icons-material/Close';
|
|
24
25
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
25
26
|
import EditInPlaceField from './EditInPlaceField';
|
|
26
27
|
import { stubFunction } from '../utils';
|
|
28
|
+
import IconButton from '@mui/material/IconButton';
|
|
27
29
|
function EditInPlaceFileField(_a) {
|
|
28
30
|
var _b;
|
|
29
31
|
var { input } = _a, restProps = __rest(_a, ["input"]);
|
|
@@ -42,6 +44,9 @@ function EditInPlaceFileField(_a) {
|
|
|
42
44
|
inputRef.current.blur();
|
|
43
45
|
}, 200);
|
|
44
46
|
};
|
|
47
|
+
const onClear = () => {
|
|
48
|
+
input.onChange(null);
|
|
49
|
+
};
|
|
45
50
|
return (React.createElement(React.Fragment, null,
|
|
46
51
|
React.createElement("input", { type: "file", ref: fileRef, onChange: handleFileSelect, className: "d-none" }),
|
|
47
52
|
React.createElement(EditInPlaceField, Object.assign({}, restProps, { input: {
|
|
@@ -51,6 +56,9 @@ function EditInPlaceFileField(_a) {
|
|
|
51
56
|
}, InputProps: {
|
|
52
57
|
startAdornment: React.createElement(InputAdornment, { position: "start", className: (_b = restProps.fieldClasses) === null || _b === void 0 ? void 0 : _b.text },
|
|
53
58
|
React.createElement(AttachmentIcon, null)),
|
|
59
|
+
endAdornment: input.value && React.createElement(InputAdornment, { position: "end", className: "d-none" },
|
|
60
|
+
React.createElement(IconButton, { color: 'primary', size: 'small', onClick: onClear },
|
|
61
|
+
React.createElement(Close, null))),
|
|
54
62
|
onFocus,
|
|
55
63
|
inputProps: {
|
|
56
64
|
ref: inputRef
|
|
@@ -25,6 +25,7 @@ import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
|
|
|
25
25
|
import { CKEditor } from '@ckeditor/ckeditor5-react';
|
|
26
26
|
import { createRoot } from 'react-dom/client';
|
|
27
27
|
import CodeIcon from '@mui/icons-material/Code';
|
|
28
|
+
import 'ace-builds/webpack-resolver';
|
|
28
29
|
const SourceEditingSwitch = () => (React.createElement("div", { className: "ck_source_edit_custom" },
|
|
29
30
|
React.createElement(CodeIcon, { className: "ck_code_icon_custom" })));
|
|
30
31
|
const config = {
|