@axelor/aos-mobile-core 8.2.6 → 8.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.
- package/lib/components/external/Scanner/Scanner.d.ts +1 -1
- package/lib/components/external/Scanner/Scanner.js +87 -38
- package/lib/components/external/Scanner/Scanner.js.map +1 -1
- package/lib/components/external/Scanner/intent.helpers.d.ts +11 -0
- package/lib/components/external/Scanner/intent.helpers.js +43 -0
- package/lib/components/external/Scanner/intent.helpers.js.map +1 -0
- package/lib/components/external/Scanner/path.helpers.d.ts +15 -0
- package/lib/components/external/Scanner/path.helpers.js +35 -0
- package/lib/components/external/Scanner/path.helpers.js.map +1 -0
- package/lib/components/templates/PeriodInput/PeriodInput.d.ts +7 -4
- package/lib/components/templates/PeriodInput/PeriodInput.js +17 -4
- package/lib/components/templates/PeriodInput/PeriodInput.js.map +1 -1
- package/package.json +3 -3
|
@@ -15,60 +15,109 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { useEffect } from 'react';
|
|
18
|
+
import { useCallback, useEffect, useMemo } from 'react';
|
|
19
19
|
import { DeviceEventEmitter, Platform } from 'react-native';
|
|
20
|
-
import
|
|
21
|
-
import
|
|
20
|
+
import DataWedgeIntents from 'react-native-datawedge-intents';
|
|
21
|
+
import DeviceInfo from 'react-native-device-info';
|
|
22
|
+
import { useDispatch } from '../../../redux/hooks';
|
|
22
23
|
import { scanValue, useScannerSelector } from '../../../features/scannerSlice';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (barcodeType === ean13LabelType) {
|
|
26
|
-
return barcodeValue.slice(0, -1);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return barcodeValue;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const KEYS = {
|
|
33
|
-
LABEL_TYPE: 'com.symbol.datawedge.label_type',
|
|
34
|
-
DATA_DISPATCH_TIME: 'com.symbol.datawedge.data_dispatch_time',
|
|
35
|
-
DATA_STRING: 'com.symbol.datawedge.data_string',
|
|
36
|
-
};
|
|
37
|
-
function castIntent(intent) {
|
|
38
|
-
return {
|
|
39
|
-
labelType: intent[KEYS.LABEL_TYPE],
|
|
40
|
-
time: new Date(intent[KEYS.DATA_DISPATCH_TIME]),
|
|
41
|
-
value: intent[KEYS.DATA_STRING],
|
|
42
|
-
};
|
|
43
|
-
}
|
|
24
|
+
import { DATAWEDGE_API } from './path.helpers';
|
|
25
|
+
import { castScanIntent, castVersionIntent, formatBarcode, isScanIntent, isVersionIntent, } from './intent.helpers';
|
|
44
26
|
const Scanner = () => {
|
|
45
27
|
const { isEnabled } = useScannerSelector();
|
|
46
28
|
const dispatch = useDispatch();
|
|
29
|
+
const appConfig = useMemo(() => ({
|
|
30
|
+
profileName: `${DeviceInfo.getApplicationName().replaceAll(' ', '_')}${__DEV__ ? '_demo' : ''}`,
|
|
31
|
+
intentAction: `${DeviceInfo.getBundleId()}.zebra.ACTION`,
|
|
32
|
+
packageName: `${DeviceInfo.getBundleId()}`,
|
|
33
|
+
}), []);
|
|
34
|
+
const registerBroadcastReceiver = useCallback(() => {
|
|
35
|
+
DataWedgeIntents.registerBroadcastReceiver({
|
|
36
|
+
filterActions: [appConfig.intentAction, DATAWEDGE_API.RESULT_ACTION],
|
|
37
|
+
filterCategories: ['android.intent.category.DEFAULT'],
|
|
38
|
+
});
|
|
39
|
+
}, [appConfig.intentAction]);
|
|
40
|
+
const sendCommand = useCallback((extraName, extraValue = '') => {
|
|
41
|
+
DataWedgeIntents.sendBroadcastWithExtras({
|
|
42
|
+
action: DATAWEDGE_API.ACTION,
|
|
43
|
+
extras: { [extraName]: extraValue, SEND_RESULT: 'true' },
|
|
44
|
+
});
|
|
45
|
+
}, []);
|
|
46
|
+
const determineVersion = useCallback(() => {
|
|
47
|
+
sendCommand(DATAWEDGE_API.GET_VERSION_INFO);
|
|
48
|
+
}, [sendCommand]);
|
|
49
|
+
const createProfile = useCallback(() => {
|
|
50
|
+
sendCommand(DATAWEDGE_API.CREATE_PROFILE, appConfig.profileName);
|
|
51
|
+
sendCommand(DATAWEDGE_API.SET_CONFIG, {
|
|
52
|
+
PROFILE_NAME: appConfig.profileName,
|
|
53
|
+
PROFILE_ENABLED: 'true',
|
|
54
|
+
CONFIG_MODE: 'UPDATE',
|
|
55
|
+
PLUGIN_CONFIG: {
|
|
56
|
+
PLUGIN_NAME: 'BARCODE',
|
|
57
|
+
RESET_CONFIG: 'true',
|
|
58
|
+
PARAM_LIST: {},
|
|
59
|
+
},
|
|
60
|
+
APP_LIST: [
|
|
61
|
+
{
|
|
62
|
+
PACKAGE_NAME: appConfig.packageName,
|
|
63
|
+
ACTIVITY_LIST: ['*'],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
});
|
|
67
|
+
sendCommand(DATAWEDGE_API.SET_CONFIG, {
|
|
68
|
+
PROFILE_NAME: appConfig.profileName,
|
|
69
|
+
PROFILE_ENABLED: 'true',
|
|
70
|
+
CONFIG_MODE: 'UPDATE',
|
|
71
|
+
PLUGIN_CONFIG: {
|
|
72
|
+
PLUGIN_NAME: 'INTENT',
|
|
73
|
+
RESET_CONFIG: 'true',
|
|
74
|
+
PARAM_LIST: {
|
|
75
|
+
intent_output_enabled: 'true',
|
|
76
|
+
intent_action: appConfig.intentAction,
|
|
77
|
+
intent_delivery: '2',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}, [
|
|
82
|
+
appConfig.intentAction,
|
|
83
|
+
appConfig.packageName,
|
|
84
|
+
appConfig.profileName,
|
|
85
|
+
sendCommand,
|
|
86
|
+
]);
|
|
87
|
+
const broadcastReceiver = useCallback((intent) => {
|
|
88
|
+
if (isScanIntent(intent)) {
|
|
89
|
+
const { labelType, value } = castScanIntent(intent);
|
|
90
|
+
const formattedValue = formatBarcode(value, labelType);
|
|
91
|
+
dispatch(scanValue(formattedValue));
|
|
92
|
+
}
|
|
93
|
+
if (isVersionIntent(intent)) {
|
|
94
|
+
const { version } = castVersionIntent(intent);
|
|
95
|
+
if (version >= '06.4') {
|
|
96
|
+
createProfile();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, [createProfile, dispatch]);
|
|
47
100
|
useEffect(() => {
|
|
48
101
|
if (Platform.OS !== 'ios') {
|
|
49
|
-
registerBroadcastReceiver(
|
|
50
|
-
|
|
51
|
-
'com.aosmobile.zebra.ACTION',
|
|
52
|
-
'com.symbol.datawedge.api.RESULT_ACTION',
|
|
53
|
-
],
|
|
54
|
-
filterCategories: ['android.intent.category.DEFAULT'],
|
|
55
|
-
});
|
|
102
|
+
registerBroadcastReceiver();
|
|
103
|
+
determineVersion();
|
|
56
104
|
}
|
|
57
|
-
}, []);
|
|
105
|
+
}, [determineVersion, registerBroadcastReceiver]);
|
|
58
106
|
useEffect(() => {
|
|
59
107
|
if (Platform.OS !== 'ios') {
|
|
60
108
|
if (isEnabled) {
|
|
61
|
-
const listener = DeviceEventEmitter.addListener('datawedge_broadcast_intent',
|
|
62
|
-
const { labelType, value } = castIntent(intent);
|
|
63
|
-
const formattedValue = formatScan(value, labelType);
|
|
64
|
-
dispatch(scanValue(formattedValue));
|
|
65
|
-
});
|
|
109
|
+
const listener = DeviceEventEmitter.addListener('datawedge_broadcast_intent', broadcastReceiver);
|
|
66
110
|
return () => {
|
|
67
111
|
listener.remove();
|
|
68
112
|
};
|
|
69
113
|
}
|
|
70
114
|
}
|
|
71
|
-
}, [
|
|
115
|
+
}, [
|
|
116
|
+
broadcastReceiver,
|
|
117
|
+
determineVersion,
|
|
118
|
+
isEnabled,
|
|
119
|
+
registerBroadcastReceiver,
|
|
120
|
+
]);
|
|
72
121
|
return null;
|
|
73
122
|
};
|
|
74
123
|
export default Scanner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scanner.js","sourceRoot":"","sources":["../../../../src/components/external/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,CAClB,CAAC;gBAEF,OAAO,GAAG,EAAE;oBACV,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACpB,CAAC,CAAC;aACH;SACF;IACH,CAAC,EAAE;QACD,iBAAiB;QACjB,gBAAgB;QAChB,SAAS;QACT,yBAAyB;KAC1B,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function isScanIntent(intent: any): boolean;
|
|
2
|
+
export declare function castScanIntent(intent: any): {
|
|
3
|
+
labelType: any;
|
|
4
|
+
time: Date;
|
|
5
|
+
value: any;
|
|
6
|
+
};
|
|
7
|
+
export declare function formatBarcode(value: string, type: string): string;
|
|
8
|
+
export declare function isVersionIntent(intent: any): boolean;
|
|
9
|
+
export declare function castVersionIntent(intent: any): {
|
|
10
|
+
version: any;
|
|
11
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { DATAWEDGE_API, DATAWEDGE_RESULT } from './path.helpers';
|
|
19
|
+
export function isScanIntent(intent) {
|
|
20
|
+
return (intent.hasOwnProperty(DATAWEDGE_RESULT.LABEL_TYPE) &&
|
|
21
|
+
intent.hasOwnProperty(DATAWEDGE_RESULT.DATA_STRING));
|
|
22
|
+
}
|
|
23
|
+
export function castScanIntent(intent) {
|
|
24
|
+
return {
|
|
25
|
+
labelType: intent[DATAWEDGE_RESULT.LABEL_TYPE],
|
|
26
|
+
time: new Date(intent[DATAWEDGE_RESULT.DATA_DISPATCH_TIME]),
|
|
27
|
+
value: intent[DATAWEDGE_RESULT.DATA_STRING],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const EAN13_LABEL_TYPE = 'LABEL-TYPE-EAN13';
|
|
31
|
+
export function formatBarcode(value, type) {
|
|
32
|
+
return type === EAN13_LABEL_TYPE ? value.slice(0, -1) : value;
|
|
33
|
+
}
|
|
34
|
+
export function isVersionIntent(intent) {
|
|
35
|
+
return intent.hasOwnProperty(DATAWEDGE_API.RESULT_GET_VERSION_INFO);
|
|
36
|
+
}
|
|
37
|
+
export function castVersionIntent(intent) {
|
|
38
|
+
const versionInfo = intent[DATAWEDGE_API.RESULT_GET_VERSION_INFO];
|
|
39
|
+
return {
|
|
40
|
+
version: versionInfo.DATAWEDGE,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=intent.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.helpers.js","sourceRoot":"","sources":["../../../../src/components/external/Scanner/intent.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAE/D,MAAM,UAAU,YAAY,CAAC,MAAW;IACtC,OAAO,CACL,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,UAAU,CAAC;QAClD,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,WAAW,CAAC,CACpD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAW;IACxC,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC;QAC9C,IAAI,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QAC3D,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,IAAY;IACvD,OAAO,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAW;IACzC,OAAO,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAW;IAC3C,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAClE,OAAO;QACL,OAAO,EAAE,WAAW,CAAC,SAAS;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DATAWEDGE_API: {
|
|
2
|
+
GET_VERSION_INFO: string;
|
|
3
|
+
RESULT_ACTION: string;
|
|
4
|
+
RESULT_GET_VERSION_INFO: string;
|
|
5
|
+
ACTION: string;
|
|
6
|
+
CREATE_PROFILE: string;
|
|
7
|
+
GET_ACTIVE_PROFILE: string;
|
|
8
|
+
SET_CONFIG: string;
|
|
9
|
+
ENUMERATE_SCANNERS: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const DATAWEDGE_RESULT: {
|
|
12
|
+
LABEL_TYPE: string;
|
|
13
|
+
DATA_DISPATCH_TIME: string;
|
|
14
|
+
DATA_STRING: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
const DATAWEDGE_PATH = 'com.symbol.datawedge';
|
|
19
|
+
const API_PATH = `${DATAWEDGE_PATH}.api`;
|
|
20
|
+
export const DATAWEDGE_API = {
|
|
21
|
+
GET_VERSION_INFO: `${API_PATH}.GET_VERSION_INFO`,
|
|
22
|
+
RESULT_ACTION: `${API_PATH}.RESULT_ACTION`,
|
|
23
|
+
RESULT_GET_VERSION_INFO: `${API_PATH}.RESULT_GET_VERSION_INFO`,
|
|
24
|
+
ACTION: `${API_PATH}.ACTION`,
|
|
25
|
+
CREATE_PROFILE: `${API_PATH}.CREATE_PROFILE`,
|
|
26
|
+
GET_ACTIVE_PROFILE: `${API_PATH}.GET_ACTIVE_PROFILE`,
|
|
27
|
+
SET_CONFIG: `${API_PATH}.SET_CONFIG`,
|
|
28
|
+
ENUMERATE_SCANNERS: `${API_PATH}.ENUMERATE_SCANNERS`,
|
|
29
|
+
};
|
|
30
|
+
export const DATAWEDGE_RESULT = {
|
|
31
|
+
LABEL_TYPE: `${DATAWEDGE_PATH}.label_type`,
|
|
32
|
+
DATA_DISPATCH_TIME: `${DATAWEDGE_PATH}.data_dispatch_time`,
|
|
33
|
+
DATA_STRING: `${DATAWEDGE_PATH}.data_string`,
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=path.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.helpers.js","sourceRoot":"","sources":["../../../../src/components/external/Scanner/path.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAC9C,MAAM,QAAQ,GAAG,GAAG,cAAc,MAAM,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,gBAAgB,EAAE,GAAG,QAAQ,mBAAmB;IAChD,aAAa,EAAE,GAAG,QAAQ,gBAAgB;IAC1C,uBAAuB,EAAE,GAAG,QAAQ,0BAA0B;IAC9D,MAAM,EAAE,GAAG,QAAQ,SAAS;IAC5B,cAAc,EAAE,GAAG,QAAQ,iBAAiB;IAC5C,kBAAkB,EAAE,GAAG,QAAQ,qBAAqB;IACpD,UAAU,EAAE,GAAG,QAAQ,aAAa;IACpC,kBAAkB,EAAE,GAAG,QAAQ,qBAAqB;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,GAAG,cAAc,aAAa;IAC1C,kBAAkB,EAAE,GAAG,cAAc,qBAAqB;IAC1D,WAAW,EAAE,GAAG,cAAc,cAAc;CAC7C,CAAC"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface dateInputConfig {
|
|
3
|
+
dateInputMode?: 'date' | 'datetime' | 'time';
|
|
4
|
+
nullable?: boolean;
|
|
3
5
|
date?: Date;
|
|
4
6
|
onDateChange: (date: Date) => void;
|
|
5
7
|
readonly?: boolean;
|
|
6
8
|
required?: boolean;
|
|
7
9
|
}
|
|
8
10
|
interface PeriodInputProps {
|
|
11
|
+
style?: any;
|
|
12
|
+
horizontal?: boolean;
|
|
13
|
+
showTitle?: boolean;
|
|
9
14
|
startDateConfig: dateInputConfig;
|
|
10
15
|
endDateConfig: dateInputConfig;
|
|
11
|
-
showTitle?: boolean;
|
|
12
|
-
horizontal?: boolean;
|
|
13
|
-
style?: any;
|
|
14
16
|
defaultIntervalHours?: number;
|
|
17
|
+
onPeriodErrorChange?: (isPeriodError: boolean) => void;
|
|
15
18
|
}
|
|
16
|
-
declare const PeriodInput: ({
|
|
19
|
+
declare const PeriodInput: ({ style, horizontal, showTitle, startDateConfig, endDateConfig, defaultIntervalHours, onPeriodErrorChange, }: PeriodInputProps) => React.JSX.Element;
|
|
17
20
|
export default PeriodInput;
|
|
@@ -25,7 +25,7 @@ const DATE_INPUT_MODE = {
|
|
|
25
25
|
startDate: 0,
|
|
26
26
|
endDate: 1,
|
|
27
27
|
};
|
|
28
|
-
const PeriodInput = ({
|
|
28
|
+
const PeriodInput = ({ style, horizontal = true, showTitle = true, startDateConfig, endDateConfig, defaultIntervalHours = null, onPeriodErrorChange, }) => {
|
|
29
29
|
const I18n = useTranslator();
|
|
30
30
|
const [startDate, setStartDate] = useState(startDateConfig.date);
|
|
31
31
|
const [endDate, setEndDate] = useState(endDateConfig.date);
|
|
@@ -54,8 +54,20 @@ const PeriodInput = ({ startDateConfig, endDateConfig, showTitle = true, horizon
|
|
|
54
54
|
}
|
|
55
55
|
}, [startDate, endDate, interval, startDateConfig, endDateConfig]);
|
|
56
56
|
useEffect(() => {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const _startDate = startDateConfig.dateInputMode === 'date'
|
|
58
|
+
? getStartOfDay(startDate)
|
|
59
|
+
: startDate;
|
|
60
|
+
const _endDate = endDateConfig.dateInputMode === 'date' ? getEndOfDay(endDate) : endDate;
|
|
61
|
+
const isError = startDate && endDate && _startDate > _endDate;
|
|
62
|
+
setIsPeriodError(isError);
|
|
63
|
+
onPeriodErrorChange(isError);
|
|
64
|
+
}, [
|
|
65
|
+
startDate,
|
|
66
|
+
endDate,
|
|
67
|
+
startDateConfig.dateInputMode,
|
|
68
|
+
endDateConfig.dateInputMode,
|
|
69
|
+
onPeriodErrorChange,
|
|
70
|
+
]);
|
|
59
71
|
const styles = useMemo(() => {
|
|
60
72
|
return getStyles(horizontal);
|
|
61
73
|
}, [horizontal]);
|
|
@@ -100,7 +112,8 @@ const PeriodInput = ({ startDateConfig, endDateConfig, showTitle = true, horizon
|
|
|
100
112
|
const translationKey = isStartDate ? 'Base_StartDate' : 'Base_EndDate';
|
|
101
113
|
const date = isStartDate ? startDate : endDate;
|
|
102
114
|
const dateConfig = isStartDate ? startDateConfig : endDateConfig;
|
|
103
|
-
|
|
115
|
+
const nullable = dateConfig.nullable || dateConfig.nullable == null ? true : false;
|
|
116
|
+
return (<DateInput style={styles.dateInput} title={showTitle && I18n.t(translationKey)} mode={dateConfig.dateInputMode ?? 'date'} nullable={nullable} popup={horizontal} defaultDate={date} onDateChange={_date => handleDateChange(isStartDate, _date)} readonly={dateConfig.readonly} required={dateConfig.required}/>);
|
|
104
117
|
}, [
|
|
105
118
|
startDate,
|
|
106
119
|
endDate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodInput.js","sourceRoot":"","sources":["../../../../src/components/templates/PeriodInput/PeriodInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvE,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAE5C,MAAM,eAAe,GAA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;QACT,KAAK,EAAE,KAAK;KACb;IACD,cAAc,EAAE;QACd,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;QAC5C,cAAc,EAAE,eAAe;KAChC;IACD,SAAS,EAAE;QACT,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;KACnC;CACF,CAAC,CAAC;AAEL,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axelor/aos-mobile-core",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.7",
|
|
4
4
|
"author": "Axelor",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"license:add": "npx add-copyright-header --generate --dir 'src'"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@axelor/aos-mobile-error": "8.2.
|
|
28
|
-
"@axelor/aos-mobile-ui": "8.2.
|
|
27
|
+
"@axelor/aos-mobile-error": "8.2.7",
|
|
28
|
+
"@axelor/aos-mobile-ui": "8.2.7",
|
|
29
29
|
"@react-navigation/drawer": "6.7.2",
|
|
30
30
|
"@react-navigation/native": "6.1.18",
|
|
31
31
|
"@react-navigation/native-stack": "6.11.0",
|