@onehat/ui 0.2.17 → 0.2.19
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/package.json +2 -1
- package/src/Components/Form/Field/Date.js +10 -8
- package/src/Components/Hoc/withDraggable.js +7 -1
- package/src/Components/index.js +2 -2
- package/src/Functions/registerComponents.js +2 -1
- package/src/Functions/registerWebComponents.js +9 -0
- package/src/PlatformImports/ReactNative/Datetime.js +4 -0
- package/src/PlatformImports/Web/Datetime.js +5 -0
- /package/src/{Components/Form/Field → PlatformImports/Web}/datetime.css +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onehat/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "Base UI for OneHat apps",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@ckeditor/ckeditor5-react": "^5.0.6",
|
|
23
23
|
"@onehat/data": "^1.13.6",
|
|
24
|
+
"@hookform/resolvers": "^2.9.11",
|
|
24
25
|
"browser-or-node": "^2.1.1",
|
|
25
26
|
"ckeditor5-custom-build": "file:ckeditor5",
|
|
26
27
|
"js-cookie": "^3.0.1",
|
|
@@ -12,11 +12,6 @@ import {
|
|
|
12
12
|
TIME,
|
|
13
13
|
DATETIME,
|
|
14
14
|
} from '../../../Constants/Date.js';
|
|
15
|
-
// import DateTimePickerModal from 'react-native-modal-datetime-picker'; // https://github.com/mmazzarolo/react-native-modal-datetime-picker
|
|
16
|
-
// import DateTimePicker from '@react-native-community/datetimepicker'; // https://github.com/react-native-datetimepicker/datetimepicker
|
|
17
|
-
import Datetime from 'react-datetime'; // https://www.npmjs.com/package/react-datetime
|
|
18
|
-
import 'react-datetime/css/react-datetime.css';
|
|
19
|
-
import './datetime.css';
|
|
20
15
|
import {
|
|
21
16
|
UI_MODE_WEB,
|
|
22
17
|
} from '../../../Constants/UiModes.js';
|
|
@@ -30,6 +25,15 @@ import emptyFn from '../../../Functions/emptyFn.js';
|
|
|
30
25
|
import Calendar from '../../Icons/Calendar.js';
|
|
31
26
|
import _ from 'lodash';
|
|
32
27
|
|
|
28
|
+
// eslint-disable-next-line
|
|
29
|
+
let Datetime;
|
|
30
|
+
if (CURRENT_MODE === UI_MODE_WEB) {
|
|
31
|
+
Datetime = await import('../../../PlatformImports/Web/Datetime.js');
|
|
32
|
+
} else if (CURRENT_MODE === UI_MODE_REACT_NATIVE) {
|
|
33
|
+
Datetime = await import('../../../PlatformImports/ReactNative/Datetime.js');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
33
37
|
export function DateElement(props) {
|
|
34
38
|
const {
|
|
35
39
|
placeholderText,
|
|
@@ -226,8 +230,6 @@ export function DateElement(props) {
|
|
|
226
230
|
pickerValue = pickerValue.toDate();
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
const DT = Datetime.default || Datetime; // this shouldn't be necessary, but I couldn't get it to work unless doing this! Something is screwey with the ES6 import of Datetime.
|
|
230
|
-
|
|
231
233
|
// Web version
|
|
232
234
|
return <Tooltip label={tooltip} placement={tooltipPlacement}>
|
|
233
235
|
<Row flex={1} h="100%" alignItems="center" onLayout={() => setIsRendered(true)}>
|
|
@@ -322,7 +324,7 @@ export function DateElement(props) {
|
|
|
322
324
|
ref={pickerRef}
|
|
323
325
|
p={0}
|
|
324
326
|
>
|
|
325
|
-
<
|
|
327
|
+
<Datetime
|
|
326
328
|
open={true}
|
|
327
329
|
input={false}
|
|
328
330
|
closeOnClickOutside={false}
|
|
@@ -13,8 +13,14 @@ import {
|
|
|
13
13
|
v4 as uuid,
|
|
14
14
|
} from 'uuid';
|
|
15
15
|
|
|
16
|
+
|
|
16
17
|
// eslint-disable-next-line
|
|
17
|
-
|
|
18
|
+
let Draggable;
|
|
19
|
+
if (CURRENT_MODE === UI_MODE_WEB) {
|
|
20
|
+
Draggable = await import('../../PlatformImports/Web/Draggable.js');
|
|
21
|
+
} else if (CURRENT_MODE === UI_MODE_REACT_NATIVE) {
|
|
22
|
+
Draggable = await import('../../PlatformImports/ReactNative/Draggable.js');
|
|
23
|
+
}
|
|
18
24
|
|
|
19
25
|
|
|
20
26
|
|
package/src/Components/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import Blank from './Blank.js';
|
|
|
10
10
|
import BooleanCombo from './Form/Field/Combo/BooleanCombo.js';
|
|
11
11
|
// import CartButtonWithBadge from '../Components/Buttons/CartButtonWithBadge.js';
|
|
12
12
|
import CheckboxGroup from './Form/Field/CheckboxGroup/CheckboxGroup.js';
|
|
13
|
-
import CKEditor from './Form/Field/CKEditor/CKEditor.js';
|
|
13
|
+
// import CKEditor from './Form/Field/CKEditor/CKEditor.js'; // web only
|
|
14
14
|
import Color from './Form/Field/Color.js';
|
|
15
15
|
import Combo from './Form/Field/Combo/Combo.js';
|
|
16
16
|
// import ComboEditor from '../Components/Form/Field/Combo/ComboEditor.js';
|
|
@@ -56,7 +56,7 @@ const components = {
|
|
|
56
56
|
BooleanCombo,
|
|
57
57
|
// CartButtonWithBadge,
|
|
58
58
|
CheckboxGroup,
|
|
59
|
-
CKEditor,
|
|
59
|
+
// CKEditor,
|
|
60
60
|
Color,
|
|
61
61
|
Column,
|
|
62
62
|
Combo,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// import DateTimePickerModal from 'react-native-modal-datetime-picker'; // https://github.com/mmazzarolo/react-native-modal-datetime-picker
|
|
2
|
+
import Datetime from '@react-native-community/datetimepicker'; // https://github.com/react-native-datetimepicker/datetimepicker
|
|
3
|
+
|
|
4
|
+
export default Datetime.default || Datetime;
|
|
File without changes
|