ish-ui 1.0.13 → 1.0.15
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/README.md +2 -1
- package/dist/Demo.d.ts +4 -0
- package/dist/Demo.js +37 -0
- package/dist/DemoField.d.ts +3 -0
- package/dist/DemoField.js +87 -0
- package/dist/colorPicker/ColorPicker.d.ts +1 -1
- package/dist/colorPicker/ColorPicker.js +1 -1
- package/dist/dev.d.ts +1 -0
- package/dist/dev.js +9 -0
- package/dist/fieldMessage/ErrorMessage.d.ts +1 -1
- package/dist/fieldMessage/WarningMessage.d.ts +1 -1
- package/dist/fieldMessage/styles.d.ts +1 -1
- package/dist/formFields/EditInPlacePhoneField.js +1 -1
- package/dist/formFields/FilePreview.d.ts +1 -1
- package/dist/formFields/SelectCustomComponents.d.ts +1 -1
- package/dist/formFields/Switch.d.ts +1 -1
- package/dist/tagsInput/TagInputList.js +1 -1
- package/ish-ui.iml +8 -0
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
UI elements for onCourse and other ish apps
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/ish-ui)
|
|
5
6
|
|
|
6
7
|
## Installation
|
|
7
8
|
|
|
@@ -77,4 +78,4 @@ tools/webpack/webpack.config.dev.js
|
|
|
77
78
|
|
|
78
79
|
# Production webpack config
|
|
79
80
|
tools/webpack/webpack.config.prod.js
|
|
80
|
-
```
|
|
81
|
+
```
|
package/dist/Demo.d.ts
ADDED
package/dist/Demo.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
|
|
3
|
+
* No copying or use of this code is allowed without permission in writing from ish.
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { CacheProvider } from '@emotion/react';
|
|
7
|
+
import createCache from '@emotion/cache';
|
|
8
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
9
|
+
import { Box, Grid } from '@mui/material';
|
|
10
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
11
|
+
import { defaultTheme } from './themes';
|
|
12
|
+
import { GlobalStylesProvider } from './styles';
|
|
13
|
+
import { DemoField } from './DemoField';
|
|
14
|
+
export const muiCache = createCache({
|
|
15
|
+
key: 'mui',
|
|
16
|
+
prepend: true,
|
|
17
|
+
});
|
|
18
|
+
function Demo() {
|
|
19
|
+
return (React.createElement(CacheProvider, { value: muiCache },
|
|
20
|
+
React.createElement(ThemeProvider, { theme: defaultTheme },
|
|
21
|
+
React.createElement(CssBaseline, null),
|
|
22
|
+
React.createElement(GlobalStylesProvider, null,
|
|
23
|
+
React.createElement(Box, { sx: {
|
|
24
|
+
width: '100vw',
|
|
25
|
+
height: '100vh',
|
|
26
|
+
padding: 4
|
|
27
|
+
} },
|
|
28
|
+
React.createElement(Grid, { container: true, columnSpacing: 3, rowSpacing: 2 },
|
|
29
|
+
React.createElement(Grid, { item: true, xs: 6 },
|
|
30
|
+
React.createElement(DemoField, { label: "Test phone", type: "phone" })),
|
|
31
|
+
React.createElement(Grid, { item: true, xs: 6 },
|
|
32
|
+
React.createElement(DemoField, { label: "Test text", type: "text" })),
|
|
33
|
+
React.createElement(Grid, { item: true, xs: 6 }),
|
|
34
|
+
React.createElement(Grid, { item: true, xs: 6 }),
|
|
35
|
+
React.createElement(Grid, { item: true, xs: 6 })))))));
|
|
36
|
+
}
|
|
37
|
+
export default Demo;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
+
t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
import React, { useMemo, useState } from 'react';
|
|
20
|
+
import { stubFunction } from './utils';
|
|
21
|
+
import { CheckboxField, CodeEditorField, ColoredCheckBox, EditInPlaceDateTimeField, EditInPlaceDurationField, EditInPlaceField, EditInPlaceFileField, EditInPlaceMoneyField, EditInPlacePhoneField, EditInPlaceSearchSelect, FormSwitch } from './formFields';
|
|
22
|
+
import { TagInputList } from './tagsInput';
|
|
23
|
+
const stubFieldMocks = { input: { onChange: stubFunction, onBlur: stubFunction }, format: null, debounced: null };
|
|
24
|
+
export function DemoField(props) {
|
|
25
|
+
const { type } = props, rest = __rest(props, ["type"]);
|
|
26
|
+
const { input, format, debounced = true } = type !== 'stub'
|
|
27
|
+
? props
|
|
28
|
+
: stubFieldMocks;
|
|
29
|
+
// const currencySymbol = useAppSelector(state => state.currency?.shortCurrencySymbol);
|
|
30
|
+
// const processActionId = useAppSelector(state => state.fieldProcessing[input?.name]);
|
|
31
|
+
//
|
|
32
|
+
// const entity = type === "remoteDataSelect" ? props.entity : null;
|
|
33
|
+
//
|
|
34
|
+
// const color = type === "coloredCheckbox" ? props.color : null;
|
|
35
|
+
//
|
|
36
|
+
// const rootEntity = type === "aql" ? props.rootEntity : null;
|
|
37
|
+
//
|
|
38
|
+
// const tags = type === "tags" ? props.tags : null;
|
|
39
|
+
const [value, setValue] = useState(undefined);
|
|
40
|
+
const inputProxy = useMemo(() => (Object.assign(Object.assign({}, input || {}), { value, onChange: e => {
|
|
41
|
+
const val = (e === null || e === void 0 ? void 0 : e.target) ? e.target.value : e;
|
|
42
|
+
setValue(format ? format(val) : val);
|
|
43
|
+
}, onBlur: e => {
|
|
44
|
+
const val = (e === null || e === void 0 ? void 0 : e.target) ? e.target.value : e;
|
|
45
|
+
setValue(format ? format(val) : val);
|
|
46
|
+
} })), [value, input]);
|
|
47
|
+
const sharedProps = Object.assign(Object.assign(Object.assign({}, rest), debounced ? { input: inputProxy } : {}), { meta: {} });
|
|
48
|
+
switch (type) {
|
|
49
|
+
case 'phone':
|
|
50
|
+
return React.createElement(EditInPlacePhoneField, Object.assign({}, sharedProps));
|
|
51
|
+
case 'duration':
|
|
52
|
+
return React.createElement(EditInPlaceDurationField, Object.assign({}, sharedProps));
|
|
53
|
+
case 'file':
|
|
54
|
+
return React.createElement(EditInPlaceFileField, Object.assign({}, sharedProps));
|
|
55
|
+
case 'money':
|
|
56
|
+
return React.createElement(EditInPlaceMoneyField, Object.assign({}, sharedProps, { currencySymbol: "$" }));
|
|
57
|
+
case 'select':
|
|
58
|
+
return React.createElement(EditInPlaceSearchSelect, Object.assign({}, sharedProps));
|
|
59
|
+
case 'number':
|
|
60
|
+
return React.createElement(EditInPlaceField, Object.assign({}, sharedProps, { type: "number" }));
|
|
61
|
+
case 'date':
|
|
62
|
+
return React.createElement(EditInPlaceDateTimeField, Object.assign({}, sharedProps, { type: "date" }));
|
|
63
|
+
case 'time':
|
|
64
|
+
return React.createElement(EditInPlaceDateTimeField, Object.assign({}, sharedProps, { type: "time" }));
|
|
65
|
+
case 'dateTime':
|
|
66
|
+
return React.createElement(EditInPlaceDateTimeField, Object.assign({}, sharedProps, { type: "datetime" }));
|
|
67
|
+
case 'code':
|
|
68
|
+
return React.createElement(CodeEditorField, Object.assign({}, sharedProps));
|
|
69
|
+
case 'coloredCheckbox':
|
|
70
|
+
return React.createElement(ColoredCheckBox, Object.assign({}, sharedProps, { color: "red" }));
|
|
71
|
+
case 'password':
|
|
72
|
+
return React.createElement(EditInPlaceField, Object.assign({}, sharedProps, { type: "password" }));
|
|
73
|
+
case 'switch':
|
|
74
|
+
return React.createElement(FormSwitch, Object.assign({}, sharedProps));
|
|
75
|
+
case 'checkbox':
|
|
76
|
+
return React.createElement(CheckboxField, Object.assign({}, sharedProps));
|
|
77
|
+
case 'multilineText':
|
|
78
|
+
return React.createElement(EditInPlaceField, Object.assign({}, sharedProps, { multiline: true }));
|
|
79
|
+
case 'stub':
|
|
80
|
+
return React.createElement("div", { className: "invisible" });
|
|
81
|
+
case 'tags':
|
|
82
|
+
return React.createElement(TagInputList, Object.assign({}, sharedProps, { tags: [] }));
|
|
83
|
+
case 'text':
|
|
84
|
+
default:
|
|
85
|
+
return React.createElement(EditInPlaceField, Object.assign({}, sharedProps));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -7,5 +7,5 @@ interface ColorPickerWrapperProps {
|
|
|
7
7
|
theme?: Theme;
|
|
8
8
|
placement?: PopperPlacementType;
|
|
9
9
|
}
|
|
10
|
-
declare const _default: React.JSXElementConstructor<Omit<ColorPickerWrapperProps, "
|
|
10
|
+
declare const _default: React.JSXElementConstructor<Omit<ColorPickerWrapperProps, "theme" | "classes"> & import("@mui/styles").StyledComponentProps<never>>;
|
|
11
11
|
export default _default;
|
|
@@ -9,8 +9,8 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
9
9
|
import ButtonBase from '@mui/material/ButtonBase';
|
|
10
10
|
import Popper from '@mui/material/Popper';
|
|
11
11
|
import { AlphaPicker, HuePicker } from 'react-color';
|
|
12
|
-
import { ClickAwayListener } from '@mui/material';
|
|
13
12
|
import { createStyles, withStyles } from '@mui/styles';
|
|
13
|
+
import { ClickAwayListener } from '@mui/base';
|
|
14
14
|
import Paper from '@mui/material/Paper';
|
|
15
15
|
import Grow from '@mui/material/Grow';
|
|
16
16
|
import clsx from 'clsx';
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
|
|
3
|
+
* No copying or use of this code is allowed without permission in writing from ish.
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { createRoot } from 'react-dom/client';
|
|
7
|
+
import Demo from './Demo';
|
|
8
|
+
const root = createRoot(document.getElementById('dev-demo'));
|
|
9
|
+
root.render(React.createElement(Demo, null));
|
|
@@ -4,5 +4,5 @@ interface Props {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
message: string;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"
|
|
7
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"root" | "icon">>;
|
|
8
8
|
export default _default;
|
|
@@ -4,5 +4,5 @@ interface Props {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
warning: string;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"
|
|
7
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"root" | "icon">>;
|
|
8
8
|
export default _default;
|
|
@@ -26,7 +26,7 @@ import { getPhoneMask } from '../utils';
|
|
|
26
26
|
const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
27
27
|
const { onChange } = props, other = __rest(props, ["onChange"]);
|
|
28
28
|
const inputRef = useRef();
|
|
29
|
-
const [format, setFormat] = useState(
|
|
29
|
+
const [format, setFormat] = useState(undefined);
|
|
30
30
|
const [prefix, setPrefix] = useState(undefined);
|
|
31
31
|
const processFormat = useCallback(debounce(data => {
|
|
32
32
|
setFormat(getPhoneMask(data.value));
|
|
@@ -13,5 +13,5 @@ interface Props {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
avatarSize?: number;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<"
|
|
16
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<"root" | "active" | "rounded" | "backdrop" | "actionButton" | "noValue" | "avatarRoot">>;
|
|
17
17
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const selectStyles: (theme: any) => import("@mui/styles").StyleRules<{}, "
|
|
2
|
+
export declare const selectStyles: (theme: any) => import("@mui/styles").StyleRules<{}, "root" | "label" | "expandIcon" | "error" | "inline" | "multiple" | "menuItem" | "inputWrapper" | "readonly" | "inputEndAdornment" | "editIcon" | "bottomMargin" | "bottomPadding" | "topMargin" | "editable" | "valid" | "autoWidthSelect" | "emptySelect" | "validUnderline" | "menuItemActive" | "menuList" | "hasPopup" | "hasClear">;
|
|
3
3
|
export declare const ListRow: React.MemoExoticComponent<any>;
|
|
4
4
|
export declare const ListboxComponent: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
5
5
|
export declare const NoWrapOption: (content: any, data: any, search: any, parentProps: any) => React.JSX.Element;
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FieldInputProps, FormSwitchProps } from '../model';
|
|
6
|
-
export declare const Switch: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles").StyledComponentProps<"default" | "
|
|
6
|
+
export declare const Switch: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles").StyledComponentProps<"default" | "root" | "icon" | "disabled" | "inline" | "checked" | "focusVisible" | "bar">>;
|
|
7
7
|
export declare function FormSwitch<InputProps extends FieldInputProps>({ input, color, disabled, stringValue, label, className, inline, onChangeHandler, onClick }: FormSwitchProps<InputProps>): React.JSX.Element;
|
|
@@ -18,7 +18,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
18
18
|
};
|
|
19
19
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
20
|
import { InputAdornment, MenuItem, Select } from '@mui/material';
|
|
21
|
-
import ClickAwayListener from '@mui/
|
|
21
|
+
import { ClickAwayListener } from '@mui/base';
|
|
22
22
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
23
23
|
import clsx from 'clsx';
|
|
24
24
|
import { Edit } from '@mui/icons-material';
|
package/ish-ui.iml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ish-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "UI elements for onCourse and other ish apps",
|
|
5
5
|
"main": "main.ts",
|
|
6
6
|
"devDependencies": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-color": "^2.19.3",
|
|
83
83
|
"react-dom": "^18.2.0",
|
|
84
84
|
"react-dropzone": "^14.2.3",
|
|
85
|
-
"react-number-format": "4.9.
|
|
85
|
+
"react-number-format": "4.9.4",
|
|
86
86
|
"react-window": "^1.8.9",
|
|
87
87
|
"react-window-infinite-loader": "^1.0.9",
|
|
88
88
|
"redux": "^4.2.1"
|
|
@@ -105,8 +105,5 @@
|
|
|
105
105
|
"bugs": {
|
|
106
106
|
"url": "https://github.com/ishgroup/ish-ui/issues"
|
|
107
107
|
},
|
|
108
|
-
"homepage": "https://github.com/ishgroup/ish-ui#readme"
|
|
109
|
-
"publishConfig": {
|
|
110
|
-
"@ishgroup:registry": "https://npm.pkg.github.com"
|
|
111
|
-
}
|
|
108
|
+
"homepage": "https://github.com/ishgroup/ish-ui#readme"
|
|
112
109
|
}
|