@lowentry/mui 1.4.5 → 2.0.1
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/LICENSE +23 -0
- package/dist/index.d.ts +129 -0
- package/dist/index.js +720 -0
- package/dist/index.js.map +1 -0
- package/package.json +82 -73
- package/Avatar/index.js +0 -44
- package/Avatar/index.js.map +0 -1
- package/DatePicker/index.js +0 -166
- package/DatePicker/index.js.map +0 -1
- package/Dialog/index.js +0 -45
- package/Dialog/index.js.map +0 -1
- package/InitiallyInvisible/index.js +0 -40
- package/InitiallyInvisible/index.js.map +0 -1
- package/LeMuiUtils-c46ed1cc.js +0 -34
- package/LeMuiUtils-c46ed1cc.js.map +0 -1
- package/LoadingSpinner/index.js +0 -10
- package/LoadingSpinner/index.js.map +0 -1
- package/LoadingSpinner-4ccdb773.js +0 -67
- package/LoadingSpinner-4ccdb773.js.map +0 -1
- package/LoadingSpinnerWidget/index.js +0 -10
- package/LoadingSpinnerWidget/index.js.map +0 -1
- package/MenuButton/index.js +0 -63
- package/MenuButton/index.js.map +0 -1
- package/MuiRoot/index.js +0 -30
- package/MuiRoot/index.js.map +0 -1
- package/NumericTextField/index.js +0 -108
- package/NumericTextField/index.js.map +0 -1
- package/RemovableNumericTextField/index.js +0 -48
- package/RemovableNumericTextField/index.js.map +0 -1
- package/RemovableTextField/index.js +0 -54
- package/RemovableTextField/index.js.map +0 -1
- package/Submittable/index.js +0 -33
- package/Submittable/index.js.map +0 -1
- package/TextField/index.js +0 -33
- package/TextField/index.js.map +0 -1
- package/api-extractor.json +0 -43
- package/index.js +0 -38
- package/index.js.map +0 -1
- package/src/LeMuiUtils.js +0 -52
- package/src/components/Avatar.jsx +0 -28
- package/src/components/DatePicker.jsx +0 -120
- package/src/components/DatePicker.less +0 -32
- package/src/components/Dialog.jsx +0 -35
- package/src/components/Dialog.less +0 -7
- package/src/components/InitiallyInvisible.jsx +0 -20
- package/src/components/LoadingSpinner/LoadingSpinner.jsx +0 -50
- package/src/components/LoadingSpinner/LoadingSpinner.less +0 -9
- package/src/components/LoadingSpinner.jsx +0 -1
- package/src/components/LoadingSpinnerWidget.jsx +0 -1
- package/src/components/MenuButton.jsx +0 -54
- package/src/components/MuiRoot.jsx +0 -23
- package/src/components/MuiRoot.less +0 -21
- package/src/components/NumericTextField.jsx +0 -115
- package/src/components/RemovableNumericTextField.jsx +0 -41
- package/src/components/RemovableTextField.jsx +0 -48
- package/src/components/Submittable.jsx +0 -41
- package/src/components/TextField.jsx +0 -30
- package/src/components/TextField.less +0 -4
- package/src/index.js +0 -13
- package/style-inject.es-1f59c1d0.js +0 -29
- package/style-inject.es-1f59c1d0.js.map +0 -1
- package/tsconfig.d.ts +0 -1
- package/tsconfig.json +0 -39
package/TextField/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { LeRed } from '@lowentry/react-redux';
|
|
5
|
-
import TextField$1 from '@mui/material/TextField';
|
|
6
|
-
import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
|
|
7
|
-
|
|
8
|
-
var css_248z = ".lowentry-mui--textfield{cursor:auto}";
|
|
9
|
-
styleInject(css_248z);
|
|
10
|
-
|
|
11
|
-
var _excluded = ["className", "onClick", "children"];
|
|
12
|
-
var TextField = LeRed.memo(function (_ref) {
|
|
13
|
-
var className = _ref.className,
|
|
14
|
-
onClick = _ref.onClick,
|
|
15
|
-
children = _ref.children,
|
|
16
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
-
var onClicked = LeRed.useCallback(function (event) {
|
|
18
|
-
try {
|
|
19
|
-
event.stopPropagation();
|
|
20
|
-
} catch (e) {}
|
|
21
|
-
if (onClick) {
|
|
22
|
-
onClick(event);
|
|
23
|
-
}
|
|
24
|
-
}, [onClick]);
|
|
25
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextField$1, _extends({
|
|
26
|
-
className: 'lowentry-mui--textfield ' + (className !== null && className !== void 0 ? className : ''),
|
|
27
|
-
autoComplete: "off",
|
|
28
|
-
onClick: onClicked
|
|
29
|
-
}, props), children));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export { TextField as default };
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/TextField/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/TextField.jsx"],"sourcesContent":["import React from 'react';\nimport {LeRed} from '@lowentry/react-redux';\nimport MuiTextField from '@mui/material/TextField';\nimport './TextField.less';\n\n\nconst TextField = LeRed.memo(({className, onClick, children, ...props}) =>\n{\n\tconst onClicked = LeRed.useCallback((event) =>\n\t{\n\t\ttry\n\t\t{\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t}\n\t\t\n\t\tif(onClick)\n\t\t{\n\t\t\tonClick(event);\n\t\t}\n\t}, [onClick]);\n\t\n\t\n\treturn (<>\n\t\t<MuiTextField className={'lowentry-mui--textfield ' + (className ?? '')} autoComplete=\"off\" onClick={onClicked} {...props}>{children}</MuiTextField>\n\t</>);\n});\nexport default TextField;\n"],"names":["TextField","LeRed","memo","_ref","className","onClick","children","props","_objectWithoutProperties","_excluded","onClicked","useCallback","event","stopPropagation","e","React","createElement","Fragment","MuiTextField","_extends","autoComplete"],"mappings":";;;;;;;;;;;AAMMA,IAAAA,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC,UAAAC,IAAA,EAC7B;AAAA,EAAA,IAD+BC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA,CAAA;EAEpE,IAAMC,SAAS,GAAGT,KAAK,CAACU,WAAW,CAAC,UAACC,KAAK,EAC1C;IACC,IACA;MACCA,KAAK,CAACC,eAAe,EAAE,CAAA;AACxB,KAAC,CACD,OAAMC,CAAC,EACP,EACA;AAEA,IAAA,IAAGT,OAAO,EACV;MACCA,OAAO,CAACO,KAAK,CAAC,CAAA;AACf,KAAA;AACD,GAAC,EAAE,CAACP,OAAO,CAAC,CAAC,CAAA;AAGb,EAAA,oBAAQU,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EACPF,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACE,WAAY,EAAAC,QAAA,CAAA;IAACf,SAAS,EAAE,0BAA0B,IAAIA,SAAS,KAAA,IAAA,IAATA,SAAS,KAATA,KAAAA,CAAAA,GAAAA,SAAS,GAAI,EAAE,CAAE;AAACgB,IAAAA,YAAY,EAAC,KAAK;AAACf,IAAAA,OAAO,EAAEK,SAAAA;AAAU,GAAA,EAAKH,KAAK,CAAA,EAAGD,QAAuB,CAClJ,CAAC,CAAA;AACJ,CAAC;;;;"}
|
package/api-extractor.json
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"projectFolder": ".",
|
|
3
|
-
"mainEntryPointFilePath": "<projectFolder>/build/index.d.ts",
|
|
4
|
-
"bundledPackages": [],
|
|
5
|
-
"compiler": {
|
|
6
|
-
"tsconfigFilePath": "<projectFolder>/tsconfig.json"
|
|
7
|
-
},
|
|
8
|
-
"dtsRollup": {
|
|
9
|
-
"enabled": true,
|
|
10
|
-
"untrimmedFilePath": "<projectFolder>/dist/index.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"apiReport": {
|
|
13
|
-
"enabled": false,
|
|
14
|
-
"includeForgottenExports": true
|
|
15
|
-
},
|
|
16
|
-
"docModel": {
|
|
17
|
-
"enabled": false,
|
|
18
|
-
"includeForgottenExports": true
|
|
19
|
-
},
|
|
20
|
-
"tsdocMetadata": {
|
|
21
|
-
"enabled": false
|
|
22
|
-
},
|
|
23
|
-
"messages": {
|
|
24
|
-
"compilerMessageReporting": {
|
|
25
|
-
"default": {
|
|
26
|
-
"logLevel": "none"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"extractorMessageReporting": {
|
|
30
|
-
"default": {
|
|
31
|
-
"logLevel": "none"
|
|
32
|
-
},
|
|
33
|
-
"ae-wrong-input-file-type": {
|
|
34
|
-
"logLevel": "none"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"tsdocMessageReporting": {
|
|
38
|
-
"default": {
|
|
39
|
-
"logLevel": "none"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
package/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export { default as Avatar } from './Avatar/index.js';
|
|
2
|
-
export { default as DatePicker } from './DatePicker/index.js';
|
|
3
|
-
export { default as Dialog } from './Dialog/index.js';
|
|
4
|
-
export { default as InitiallyInvisible } from './InitiallyInvisible/index.js';
|
|
5
|
-
export { L as LoadingSpinner, a as LoadingSpinnerWidget } from './LoadingSpinner-4ccdb773.js';
|
|
6
|
-
export { default as MenuButton } from './MenuButton/index.js';
|
|
7
|
-
export { default as MuiRoot } from './MuiRoot/index.js';
|
|
8
|
-
export { default as NumericTextField } from './NumericTextField/index.js';
|
|
9
|
-
export { default as RemovableNumericTextField } from './RemovableNumericTextField/index.js';
|
|
10
|
-
export { default as RemovableTextField } from './RemovableTextField/index.js';
|
|
11
|
-
export { default as Submittable } from './Submittable/index.js';
|
|
12
|
-
export { default as TextField } from './TextField/index.js';
|
|
13
|
-
import '@babel/runtime/helpers/extends';
|
|
14
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
15
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
16
|
-
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
17
|
-
import 'react';
|
|
18
|
-
import '@lowentry/react-redux';
|
|
19
|
-
import '@mui/material/Avatar';
|
|
20
|
-
import '@lowentry/utils';
|
|
21
|
-
import 'dayjs';
|
|
22
|
-
import '@mui/material/Button';
|
|
23
|
-
import '@mui/material/Stack';
|
|
24
|
-
import '@mui/material/TextField';
|
|
25
|
-
import '@mui/x-date-pickers/DatePicker';
|
|
26
|
-
import '@mui/icons-material/ArrowBackIosNew';
|
|
27
|
-
import '@mui/icons-material/ArrowForwardIos';
|
|
28
|
-
import './style-inject.es-1f59c1d0.js';
|
|
29
|
-
import '@mui/material/Dialog';
|
|
30
|
-
import '@mui/material/Backdrop';
|
|
31
|
-
import '@mui/material/CircularProgress';
|
|
32
|
-
import '@mui/material/Menu';
|
|
33
|
-
import '@mui/material/CssBaseline';
|
|
34
|
-
import '@mui/material/styles/ThemeProvider';
|
|
35
|
-
import '@mui/x-date-pickers/LocalizationProvider';
|
|
36
|
-
import '@mui/x-date-pickers/AdapterDayjs';
|
|
37
|
-
import './LeMuiUtils-c46ed1cc.js';
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/src/LeMuiUtils.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {LeUtils, STRING, INT_LAX} from '@lowentry/utils';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const HIDDEN_CHAR = '\u200B';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const LeMuiUtils = {
|
|
8
|
-
onSelectEnsureMinimumOffset:
|
|
9
|
-
(charactersCount) =>
|
|
10
|
-
{
|
|
11
|
-
charactersCount = Math.max(0, INT_LAX(charactersCount));
|
|
12
|
-
if(charactersCount <= 0)
|
|
13
|
-
{
|
|
14
|
-
return () =>
|
|
15
|
-
{
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return (event) =>
|
|
20
|
-
{
|
|
21
|
-
if(event && event.target)
|
|
22
|
-
{
|
|
23
|
-
if(event.target.selectionEnd < charactersCount)
|
|
24
|
-
{
|
|
25
|
-
event.target.setSelectionRange(charactersCount, charactersCount);
|
|
26
|
-
}
|
|
27
|
-
else if(event.target.selectionStart < charactersCount)
|
|
28
|
-
{
|
|
29
|
-
event.target.setSelectionRange(charactersCount, event.target.selectionEnd);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
prependHiddenChar:
|
|
36
|
-
(string) =>
|
|
37
|
-
{
|
|
38
|
-
string = STRING(string);
|
|
39
|
-
if(string.startsWith(HIDDEN_CHAR))
|
|
40
|
-
{
|
|
41
|
-
return string;
|
|
42
|
-
}
|
|
43
|
-
return HIDDEN_CHAR + string;
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
purgePrependedHiddenChar:
|
|
47
|
-
(string) =>
|
|
48
|
-
{
|
|
49
|
-
string = STRING(string);
|
|
50
|
-
return LeUtils.trimStart(string, ['\u200B', ' ', '\t', '\r', '\n']);
|
|
51
|
-
},
|
|
52
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import MuiAvatar from '@mui/material/Avatar';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const Avatar = LeRed.memo(({src, slotProps, retryOptions, children, ...props}) =>
|
|
7
|
-
{
|
|
8
|
-
const [imgSrc, onImgError] = LeRed.useRetryingImageUrl(src, retryOptions);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const onError = LeRed.useCallback((...args) =>
|
|
12
|
-
{
|
|
13
|
-
onImgError(...args);
|
|
14
|
-
|
|
15
|
-
if(slotProps?.img?.onError)
|
|
16
|
-
{
|
|
17
|
-
slotProps.img.onError(...args);
|
|
18
|
-
}
|
|
19
|
-
}, [onImgError, slotProps?.img?.onError]);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return (<>
|
|
23
|
-
<MuiAvatar src={imgSrc} slotProps={{...(slotProps ?? {}), img:{referrerPolicy:'no-referrer', ...(slotProps?.img ?? {}), onError:onError}}} {...props}>
|
|
24
|
-
{children}
|
|
25
|
-
</MuiAvatar>
|
|
26
|
-
</>);
|
|
27
|
-
});
|
|
28
|
-
export default Avatar;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import {IS_ARRAY} from '@lowentry/utils';
|
|
4
|
-
import Dayjs from 'dayjs';
|
|
5
|
-
import Button from '@mui/material/Button';
|
|
6
|
-
import Stack from '@mui/material/Stack';
|
|
7
|
-
import TextField from '@mui/material/TextField';
|
|
8
|
-
import {DatePicker as MuiDatePicker} from '@mui/x-date-pickers/DatePicker';
|
|
9
|
-
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew';
|
|
10
|
-
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
|
11
|
-
import './DatePicker.less';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const DatePickerTextField = LeRed.memo(({dateFormat, value, className, children, ...props}) =>
|
|
15
|
-
{
|
|
16
|
-
const onClick = LeRed.useMemo(() =>
|
|
17
|
-
{
|
|
18
|
-
if(props?.ownerState?.open)
|
|
19
|
-
{
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
let propsLoop = props?.InputProps?.endAdornment?.props;
|
|
23
|
-
while(propsLoop)
|
|
24
|
-
{
|
|
25
|
-
if(propsLoop.onClick)
|
|
26
|
-
{
|
|
27
|
-
return propsLoop.onClick;
|
|
28
|
-
}
|
|
29
|
-
if(propsLoop?.children)
|
|
30
|
-
{
|
|
31
|
-
propsLoop = propsLoop.children;
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if(IS_ARRAY(propsLoop))
|
|
35
|
-
{
|
|
36
|
-
let continueLoop = false;
|
|
37
|
-
for(const propsLoopItem of propsLoop)
|
|
38
|
-
{
|
|
39
|
-
if(propsLoopItem?.props)
|
|
40
|
-
{
|
|
41
|
-
propsLoop = propsLoopItem.props;
|
|
42
|
-
continueLoop = true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if(continueLoop)
|
|
46
|
-
{
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
propsLoop = propsLoop?.props;
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}, [props?.ownerState?.open, props?.InputProps?.endAdornment?.props]);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const onSelect = LeRed.useCallback((event) =>
|
|
57
|
-
{
|
|
58
|
-
event.target.selectionStart = event.target.selectionEnd;
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
}, []);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return (<>
|
|
64
|
-
<Button variant="outlined" onClick={onClick}>
|
|
65
|
-
<TextField {...props} className={'lowentry-mui--date-picker--textfield ' + (className ?? '')} variant="outlined" value={Dayjs(value).format(dateFormat)} InputProps={{...(props.InputProps ?? {}), readOnly:true, endAdornment:null, onSelect:onSelect, onSelectCapture:onSelect, onMouseDown:onSelect, onTouchStart:onSelect, onTouchMove:onSelect}}>{children}</TextField>
|
|
66
|
-
</Button>
|
|
67
|
-
</>);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const DatePicker = LeRed.memo(({value, dateFormat, onChange, className, children, ...props}) =>
|
|
72
|
-
{
|
|
73
|
-
/** @type {*} */
|
|
74
|
-
const textFieldProps = LeRed.useMemo(() =>
|
|
75
|
-
{
|
|
76
|
-
if(!dateFormat)
|
|
77
|
-
{
|
|
78
|
-
return {dateFormat:'ddd, D MMM YYYY'};
|
|
79
|
-
}
|
|
80
|
-
return {dateFormat};
|
|
81
|
-
}, [dateFormat]);
|
|
82
|
-
|
|
83
|
-
const [datepickerOpen, openDatepicker, closeDatepicker] = LeRed.useHistoryState(false);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const onChanged = LeRed.useCallback((...args) =>
|
|
87
|
-
{
|
|
88
|
-
if(onChange)
|
|
89
|
-
{
|
|
90
|
-
onChange(...args);
|
|
91
|
-
}
|
|
92
|
-
}, [onChange]);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return (<>
|
|
96
|
-
<Stack className={'lowentry-mui--date-picker ' + (className ?? '')} direction="row" justifyContent="space-between" spacing={1} {...props}>
|
|
97
|
-
<Button className="lowentry-mui--date-picker--arrow-button" variant="text" color="primary" onClick={() => onChanged(Dayjs(value).subtract(1, 'day'))}><ArrowBackIosNewIcon/></Button>
|
|
98
|
-
<MuiDatePicker
|
|
99
|
-
open={datepickerOpen}
|
|
100
|
-
onOpen={openDatepicker}
|
|
101
|
-
onClose={closeDatepicker}
|
|
102
|
-
showDaysOutsideCurrentMonth={true}
|
|
103
|
-
views={['day']}
|
|
104
|
-
format="YYYY-MM-DD"
|
|
105
|
-
label=""
|
|
106
|
-
value={value}
|
|
107
|
-
onChange={onChanged}
|
|
108
|
-
slots={{
|
|
109
|
-
textField:DatePickerTextField,
|
|
110
|
-
toolbar: (props) => null,
|
|
111
|
-
}}
|
|
112
|
-
slotProps={{
|
|
113
|
-
textField:textFieldProps,
|
|
114
|
-
}}
|
|
115
|
-
/>
|
|
116
|
-
<Button className="lowentry-mui--date-picker--arrow-button" variant="text" color="primary" onClick={() => onChanged(Dayjs(value).add(1, 'day'))}><ArrowForwardIosIcon/></Button>
|
|
117
|
-
</Stack>
|
|
118
|
-
</>);
|
|
119
|
-
});
|
|
120
|
-
export default DatePicker;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.lowentry-mui--date-picker
|
|
2
|
-
{
|
|
3
|
-
padding: 0.5rem;
|
|
4
|
-
|
|
5
|
-
.lowentry-mui--date-picker--arrow-button
|
|
6
|
-
{
|
|
7
|
-
min-width: 0;
|
|
8
|
-
padding: 6px 12px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.lowentry-mui--date-picker--textfield
|
|
12
|
-
{
|
|
13
|
-
max-width: 150px;
|
|
14
|
-
cursor: pointer !important;
|
|
15
|
-
|
|
16
|
-
.MuiInputBase-input
|
|
17
|
-
{
|
|
18
|
-
text-align: center;
|
|
19
|
-
padding: 10px 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.MuiOutlinedInput-notchedOutline
|
|
23
|
-
{
|
|
24
|
-
border: 0 !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
{
|
|
29
|
-
cursor: pointer !important;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import {LeUtils, STRING} from '@lowentry/utils';
|
|
4
|
-
import MuiDialog from '@mui/material/Dialog';
|
|
5
|
-
import './Dialog.less';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Dialog = LeRed.memo(({onClose, children, 'aria-label':ariaLabel, ...props}) =>
|
|
9
|
-
{
|
|
10
|
-
const ariaLabelId = LeRed.useMemo(() => 'lowentrymui_dialog_arialabel_' + LeUtils.uniqueId(), []);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const onClosed = LeRed.useCallback((event, reason) =>
|
|
14
|
-
{
|
|
15
|
-
if(!STRING(reason).toLowerCase().includes('escape'))
|
|
16
|
-
{
|
|
17
|
-
// prevent closing when clicking on the backdrop, only allow escape-key closing
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if(onClose)
|
|
22
|
-
{
|
|
23
|
-
onClose(event, reason);
|
|
24
|
-
}
|
|
25
|
-
}, [onClose]);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return (<>
|
|
29
|
-
<MuiDialog className="lowentry-mui--dialog" onClose={onClosed} aria-labelledby={ariaLabelId} open={false} {...props}>
|
|
30
|
-
<span className="lowentry-mui--dialog--arialabel" id={ariaLabelId} style={{display:'none'}}>{ariaLabel ?? ''}</span>
|
|
31
|
-
{children}
|
|
32
|
-
</MuiDialog>
|
|
33
|
-
</>);
|
|
34
|
-
});
|
|
35
|
-
export default Dialog;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import {LeUtils, INT_LAX} from '@lowentry/utils';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const InitiallyInvisible = LeRed.memo(({frames, transition, style, children, opacityKey, ...other}) =>
|
|
7
|
-
{
|
|
8
|
-
const [opacity, setOpacity] = LeRed.useState(0);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
LeRed.useEffect(() =>
|
|
12
|
-
{
|
|
13
|
-
setOpacity(0);
|
|
14
|
-
return LeUtils.setAnimationFrameTimeout(() => setOpacity(1), Math.max((opacityKey ? 2 : 0), INT_LAX(frames))).remove;
|
|
15
|
-
}, [opacityKey]);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return (<div style={{width:'100%', height:'100%', opacity, transition:(((opacity > 0) && transition) ? ('opacity ' + transition) : 'none'), ...(style ?? {})}} {...other}>{children}</div>);
|
|
19
|
-
});
|
|
20
|
-
export default InitiallyInvisible;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import Backdrop from '@mui/material/Backdrop';
|
|
4
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
5
|
-
import './LoadingSpinner.less';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let loadingSpinnerCount = {};
|
|
9
|
-
|
|
10
|
-
const LoadingSpinnerGrab = ({type}) =>
|
|
11
|
-
{
|
|
12
|
-
loadingSpinnerCount[type] = (loadingSpinnerCount[type] || 0) + 1;
|
|
13
|
-
if(loadingSpinnerCount[type] === 1)
|
|
14
|
-
{
|
|
15
|
-
LeRed.trigger('lowentry-mui--loading-spinner--' + type);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const LoadingSpinnerRelease = ({type}) =>
|
|
20
|
-
{
|
|
21
|
-
loadingSpinnerCount[type] = (loadingSpinnerCount[type] || 1) - 1;
|
|
22
|
-
if(loadingSpinnerCount[type] === 0)
|
|
23
|
-
{
|
|
24
|
-
LeRed.trigger('lowentry-mui--loading-spinner--' + type);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export const LoadingSpinner = LeRed.memo(({type}) =>
|
|
30
|
-
{
|
|
31
|
-
LeRed.useEffect(() =>
|
|
32
|
-
{
|
|
33
|
-
LoadingSpinnerGrab({type});
|
|
34
|
-
return () => LoadingSpinnerRelease({type});
|
|
35
|
-
}, [type]);
|
|
36
|
-
|
|
37
|
-
return null;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export const LoadingSpinnerWidget = LeRed.memo(({type, className, sx, children, ...props}) =>
|
|
42
|
-
{
|
|
43
|
-
LeRed.useTriggerable('lowentry-mui--loading-spinner--' + type);
|
|
44
|
-
|
|
45
|
-
return (<>
|
|
46
|
-
<Backdrop className={'lowentry-mui--loading-spinner lowentry-mui--loading-spinner--' + type + ' ' + (className ?? '')} sx={{zIndex:(theme) => theme.zIndex.drawer + 1, ...(sx ?? {})}} open={(loadingSpinnerCount[type] || 0) > 0} {...props}>
|
|
47
|
-
<CircularProgress color="inherit" size="min(120px,30vw)"/>
|
|
48
|
-
</Backdrop>
|
|
49
|
-
</>);
|
|
50
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {LoadingSpinner as default} from './LoadingSpinner/LoadingSpinner.jsx';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {LoadingSpinnerWidget as default} from './LoadingSpinner/LoadingSpinner.jsx';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import {LeUtils, ARRAY} from '@lowentry/utils';
|
|
4
|
-
import Button from '@mui/material/Button';
|
|
5
|
-
import Menu from '@mui/material/Menu';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const MenuButton = LeRed.memo(({icon, className, ref, onClick, onClose, children, ...props}) =>
|
|
9
|
-
{
|
|
10
|
-
const buttonRef = LeRed.useRef();
|
|
11
|
-
const [open, setOpen] = LeRed.useState(false);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const onClicked = LeRed.useCallback((event) =>
|
|
15
|
-
{
|
|
16
|
-
setOpen(true);
|
|
17
|
-
|
|
18
|
-
if(onClick)
|
|
19
|
-
{
|
|
20
|
-
onClick(event);
|
|
21
|
-
}
|
|
22
|
-
}, [onClick]);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const onClosed = LeRed.useCallback((event) =>
|
|
26
|
-
{
|
|
27
|
-
setOpen(false);
|
|
28
|
-
|
|
29
|
-
if(onClose)
|
|
30
|
-
{
|
|
31
|
-
onClose(event);
|
|
32
|
-
}
|
|
33
|
-
}, [onClose]);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return (<>
|
|
37
|
-
<Button ref={LeRed.mergeRefs(buttonRef, ref)} className={'lowentry-mui--menu-button ' + (className ?? '')} variant="text" color="primary" onClick={onClicked} {...props}>{icon}</Button>
|
|
38
|
-
<Menu anchorEl={buttonRef.current} open={open} onClose={onClosed}>
|
|
39
|
-
{LeUtils.mapToArray(ARRAY(children), (child, index) => !!child && LeRed.cloneElement(child, {
|
|
40
|
-
key: index,
|
|
41
|
-
onClick: () =>
|
|
42
|
-
{
|
|
43
|
-
setOpen(false);
|
|
44
|
-
if(child?.props?.onClick)
|
|
45
|
-
{
|
|
46
|
-
child.props.onClick();
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
disabled:(typeof child?.props?.disabled !== 'undefined') ? child.props.disabled : !child?.props?.onClick,
|
|
50
|
-
}))}
|
|
51
|
-
</Menu>
|
|
52
|
-
</>);
|
|
53
|
-
});
|
|
54
|
-
export default MenuButton;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {LeRed} from '@lowentry/react-redux';
|
|
3
|
-
import CssBaseline from '@mui/material/CssBaseline';
|
|
4
|
-
import ThemeProvider from '@mui/material/styles/ThemeProvider';
|
|
5
|
-
import {LocalizationProvider} from '@mui/x-date-pickers/LocalizationProvider';
|
|
6
|
-
import {AdapterDayjs} from '@mui/x-date-pickers/AdapterDayjs';
|
|
7
|
-
import './MuiRoot.less';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const MuiRoot = LeRed.memo(({theme, className, children, ...props}) =>
|
|
11
|
-
{
|
|
12
|
-
return (<>
|
|
13
|
-
<CssBaseline/>
|
|
14
|
-
<ThemeProvider theme={theme}>
|
|
15
|
-
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
16
|
-
<div className={'lowentry-mui--mui-root ' + (className ?? '')} {...props}>
|
|
17
|
-
{children}
|
|
18
|
-
</div>
|
|
19
|
-
</LocalizationProvider>
|
|
20
|
-
</ThemeProvider>
|
|
21
|
-
</>);
|
|
22
|
-
});
|
|
23
|
-
export default MuiRoot;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.lowentry-mui--mui-root
|
|
2
|
-
{
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
|
|
6
|
-
@media not (hover: hover), not (pointer: fine) // mobile devices
|
|
7
|
-
{
|
|
8
|
-
.MuiButtonBase-root.disallow-mobile-hover-background:hover
|
|
9
|
-
{
|
|
10
|
-
background-color: rgba(255, 255, 255, 0) !important;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.disallow-mobile-hover-background
|
|
14
|
-
{
|
|
15
|
-
.MuiButtonBase-root:hover
|
|
16
|
-
{
|
|
17
|
-
background-color: rgba(255, 255, 255, 0) !important;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|