ish-ui 1.2.5 → 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
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import 'ace-builds/webpack-resolver';
2
3
  interface Props {
3
4
  value: string;
4
5
  onChange: (val: any) => void;
@@ -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 = {
@@ -313,7 +313,7 @@ const getDefaultThemeOverrides = (pallete) => ({
313
313
  secondary: 'rgba(0, 0, 0, 0.54)',
314
314
  primary: 'rgba(0, 0, 0, 0.87)',
315
315
  primaryEditable: 'rgba(0, 0, 0, 0.95)',
316
- disabled: 'rgba(34, 34, 34, 0.38)',
316
+ disabled: 'rgba(0, 0, 0, 0.87)',
317
317
  hint: 'rgba(34, 34, 34, 0.38)',
318
318
  grey: '#434343',
319
319
  } })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ish-ui",
3
3
  "sideEffects": false,
4
- "version": "1.2.5",
4
+ "version": "1.2.7",
5
5
  "description": "UI elements for onCourse and other ish apps",
6
6
  "main": "main.ts",
7
7
  "devDependencies": {