@axelor/aos-mobile-ui 0.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/README.md +234 -0
- package/lib/components/atoms/BlockInteractionScreen/BlockInteractionScreen.d.ts +7 -0
- package/lib/components/atoms/BlockInteractionScreen/BlockInteractionScreen.js +50 -0
- package/lib/components/atoms/BlockInteractionScreen/BlockInteractionScreen.js.map +1 -0
- package/lib/components/atoms/Card/Card.d.ts +6 -0
- package/lib/components/atoms/Card/Card.js +37 -0
- package/lib/components/atoms/Card/Card.js.map +1 -0
- package/lib/components/atoms/DottedLine/DottedLine.d.ts +5 -0
- package/lib/components/atoms/DottedLine/DottedLine.js +38 -0
- package/lib/components/atoms/DottedLine/DottedLine.js.map +1 -0
- package/lib/components/atoms/HorizontalRule/HorizontalRule.d.ts +5 -0
- package/lib/components/atoms/HorizontalRule/HorizontalRule.js +35 -0
- package/lib/components/atoms/HorizontalRule/HorizontalRule.js.map +1 -0
- package/lib/components/atoms/HtmlInput/HtmlInput.d.ts +9 -0
- package/lib/components/atoms/HtmlInput/HtmlInput.js +50 -0
- package/lib/components/atoms/HtmlInput/HtmlInput.js.map +1 -0
- package/lib/components/atoms/Icon/Icon.d.ts +13 -0
- package/lib/components/atoms/Icon/Icon.js +49 -0
- package/lib/components/atoms/Icon/Icon.js.map +1 -0
- package/lib/components/atoms/Input/Input.d.ts +18 -0
- package/lib/components/atoms/Input/Input.js +37 -0
- package/lib/components/atoms/Input/Input.js.map +1 -0
- package/lib/components/atoms/RenderHtml/RenderHtml.d.ts +6 -0
- package/lib/components/atoms/RenderHtml/RenderHtml.js +50 -0
- package/lib/components/atoms/RenderHtml/RenderHtml.js.map +1 -0
- package/lib/components/atoms/Screen/Screen.d.ts +9 -0
- package/lib/components/atoms/Screen/Screen.js +74 -0
- package/lib/components/atoms/Screen/Screen.js.map +1 -0
- package/lib/components/atoms/ScrollView/ScrollView.d.ts +6 -0
- package/lib/components/atoms/ScrollView/ScrollView.js +33 -0
- package/lib/components/atoms/ScrollView/ScrollView.js.map +1 -0
- package/lib/components/atoms/Switch/Switch.d.ts +6 -0
- package/lib/components/atoms/Switch/Switch.js +34 -0
- package/lib/components/atoms/Switch/Switch.js.map +1 -0
- package/lib/components/atoms/Text/Text.d.ts +12 -0
- package/lib/components/atoms/Text/Text.js +37 -0
- package/lib/components/atoms/Text/Text.js.map +1 -0
- package/lib/components/atoms/index.d.ts +12 -0
- package/lib/components/atoms/index.js +30 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +21 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/AttachmentCard/AttachmentCard.d.ts +8 -0
- package/lib/components/molecules/AttachmentCard/AttachmentCard.js +61 -0
- package/lib/components/molecules/AttachmentCard/AttachmentCard.js.map +1 -0
- package/lib/components/molecules/Badge/Badge.d.ts +10 -0
- package/lib/components/molecules/Badge/Badge.js +43 -0
- package/lib/components/molecules/Badge/Badge.js.map +1 -0
- package/lib/components/molecules/Button/Button.d.ts +10 -0
- package/lib/components/molecules/Button/Button.js +48 -0
- package/lib/components/molecules/Button/Button.js.map +1 -0
- package/lib/components/molecules/CardIconButton/CardIconButton.d.ts +8 -0
- package/lib/components/molecules/CardIconButton/CardIconButton.js +42 -0
- package/lib/components/molecules/CardIconButton/CardIconButton.js.map +1 -0
- package/lib/components/molecules/Chip/Chip.d.ts +11 -0
- package/lib/components/molecules/Chip/Chip.js +69 -0
- package/lib/components/molecules/Chip/Chip.js.map +1 -0
- package/lib/components/molecules/ClearableCard/ClearableCard.d.ts +8 -0
- package/lib/components/molecules/ClearableCard/ClearableCard.js +43 -0
- package/lib/components/molecules/ClearableCard/ClearableCard.js.map +1 -0
- package/lib/components/molecules/DropdownCard/DropdownCard.d.ts +10 -0
- package/lib/components/molecules/DropdownCard/DropdownCard.js +84 -0
- package/lib/components/molecules/DropdownCard/DropdownCard.js.map +1 -0
- package/lib/components/molecules/DropdownMenu/DropdownMenu.d.ts +5 -0
- package/lib/components/molecules/DropdownMenu/DropdownMenu.js +57 -0
- package/lib/components/molecules/DropdownMenu/DropdownMenu.js.map +1 -0
- package/lib/components/molecules/DropdownMenuItem/DropdownMenuItem.d.ts +7 -0
- package/lib/components/molecules/DropdownMenuItem/DropdownMenuItem.js +42 -0
- package/lib/components/molecules/DropdownMenuItem/DropdownMenuItem.js.map +1 -0
- package/lib/components/molecules/EditableInput/EditableInput.d.ts +9 -0
- package/lib/components/molecules/EditableInput/EditableInput.js +65 -0
- package/lib/components/molecules/EditableInput/EditableInput.js.map +1 -0
- package/lib/components/molecules/FromTo/FromTo.d.ts +8 -0
- package/lib/components/molecules/FromTo/FromTo.js +44 -0
- package/lib/components/molecules/FromTo/FromTo.js.map +1 -0
- package/lib/components/molecules/HalfLabelCard/HalfLabelCard.d.ts +8 -0
- package/lib/components/molecules/HalfLabelCard/HalfLabelCard.js +51 -0
- package/lib/components/molecules/HalfLabelCard/HalfLabelCard.js.map +1 -0
- package/lib/components/molecules/HeaderIndicator/HeaderIndicator.d.ts +2 -0
- package/lib/components/molecules/HeaderIndicator/HeaderIndicator.js +65 -0
- package/lib/components/molecules/HeaderIndicator/HeaderIndicator.js.map +1 -0
- package/lib/components/molecules/IconButton/IconButton.d.ts +11 -0
- package/lib/components/molecules/IconButton/IconButton.js +48 -0
- package/lib/components/molecules/IconButton/IconButton.js.map +1 -0
- package/lib/components/molecules/IconInput/IconInput.d.ts +19 -0
- package/lib/components/molecules/IconInput/IconInput.js +50 -0
- package/lib/components/molecules/IconInput/IconInput.js.map +1 -0
- package/lib/components/molecules/Image/Image.d.ts +10 -0
- package/lib/components/molecules/Image/Image.js +36 -0
- package/lib/components/molecules/Image/Image.js.map +1 -0
- package/lib/components/molecules/Increment/Increment.d.ts +8 -0
- package/lib/components/molecules/Increment/Increment.js +97 -0
- package/lib/components/molecules/Increment/Increment.js.map +1 -0
- package/lib/components/molecules/InfoBubble/InfoBubble.d.ts +9 -0
- package/lib/components/molecules/InfoBubble/InfoBubble.js +73 -0
- package/lib/components/molecules/InfoBubble/InfoBubble.js.map +1 -0
- package/lib/components/molecules/LabelText/LabelText.d.ts +14 -0
- package/lib/components/molecules/LabelText/LabelText.js +45 -0
- package/lib/components/molecules/LabelText/LabelText.js.map +1 -0
- package/lib/components/molecules/LoadingIndicator/LoadingIndicator.d.ts +6 -0
- package/lib/components/molecules/LoadingIndicator/LoadingIndicator.js +49 -0
- package/lib/components/molecules/LoadingIndicator/LoadingIndicator.js.map +1 -0
- package/lib/components/molecules/MessageBox/MessageBox.d.ts +9 -0
- package/lib/components/molecules/MessageBox/MessageBox.js +60 -0
- package/lib/components/molecules/MessageBox/MessageBox.js.map +1 -0
- package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.d.ts +14 -0
- package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js +66 -0
- package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js.map +1 -0
- package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.d.ts +11 -0
- package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js +80 -0
- package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js.map +1 -0
- package/lib/components/molecules/NotesCard/NotesCard.d.ts +6 -0
- package/lib/components/molecules/NotesCard/NotesCard.js +55 -0
- package/lib/components/molecules/NotesCard/NotesCard.js.map +1 -0
- package/lib/components/molecules/PopUp/PopUp.d.ts +9 -0
- package/lib/components/molecules/PopUp/PopUp.js +74 -0
- package/lib/components/molecules/PopUp/PopUp.js.map +1 -0
- package/lib/components/molecules/RightIconButton/RightIconButton.d.ts +10 -0
- package/lib/components/molecules/RightIconButton/RightIconButton.js +49 -0
- package/lib/components/molecules/RightIconButton/RightIconButton.js.map +1 -0
- package/lib/components/molecules/SelectionContainer/SelectionContainer.d.ts +11 -0
- package/lib/components/molecules/SelectionContainer/SelectionContainer.js +111 -0
- package/lib/components/molecules/SelectionContainer/SelectionContainer.js.map +1 -0
- package/lib/components/molecules/StarScore/StarScore.d.ts +11 -0
- package/lib/components/molecules/StarScore/StarScore.js +58 -0
- package/lib/components/molecules/StarScore/StarScore.js.map +1 -0
- package/lib/components/molecules/SwitchCard/SwitchCard.d.ts +8 -0
- package/lib/components/molecules/SwitchCard/SwitchCard.js +31 -0
- package/lib/components/molecules/SwitchCard/SwitchCard.js.map +1 -0
- package/lib/components/molecules/TitledValue/TitledValue.d.ts +7 -0
- package/lib/components/molecules/TitledValue/TitledValue.js +40 -0
- package/lib/components/molecules/TitledValue/TitledValue.js.map +1 -0
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.d.ts +8 -0
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js +66 -0
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js.map +1 -0
- package/lib/components/molecules/UnorderedList/UnorderedList.d.ts +8 -0
- package/lib/components/molecules/UnorderedList/UnorderedList.js +51 -0
- package/lib/components/molecules/UnorderedList/UnorderedList.js.map +1 -0
- package/lib/components/molecules/ViewAllContainer/ViewAllContainer.d.ts +14 -0
- package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js +91 -0
- package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js.map +1 -0
- package/lib/components/molecules/index.d.ts +33 -0
- package/lib/components/molecules/index.js +51 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.d.ts +19 -0
- package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js +148 -0
- package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js.map +1 -0
- package/lib/components/organisms/ChipSelect/ChipSelect.d.ts +6 -0
- package/lib/components/organisms/ChipSelect/ChipSelect.js +39 -0
- package/lib/components/organisms/ChipSelect/ChipSelect.js.map +1 -0
- package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.d.ts +12 -0
- package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js +40 -0
- package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js.map +1 -0
- package/lib/components/organisms/HeaderContainer/HeaderContainer.d.ts +9 -0
- package/lib/components/organisms/HeaderContainer/HeaderContainer.js +65 -0
- package/lib/components/organisms/HeaderContainer/HeaderContainer.js.map +1 -0
- package/lib/components/organisms/ImageBubble/ImageBubble.d.ts +10 -0
- package/lib/components/organisms/ImageBubble/ImageBubble.js +105 -0
- package/lib/components/organisms/ImageBubble/ImageBubble.js.map +1 -0
- package/lib/components/organisms/MultiValuePicker/MultiValuePicker.d.ts +16 -0
- package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js +103 -0
- package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js.map +1 -0
- package/lib/components/organisms/Picker/Picker.d.ts +18 -0
- package/lib/components/organisms/Picker/Picker.js +101 -0
- package/lib/components/organisms/Picker/Picker.js.map +1 -0
- package/lib/components/organisms/PopUpOneButton/PopUpOneButton.d.ts +9 -0
- package/lib/components/organisms/PopUpOneButton/PopUpOneButton.js +35 -0
- package/lib/components/organisms/PopUpOneButton/PopUpOneButton.js.map +1 -0
- package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.d.ts +11 -0
- package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.js +38 -0
- package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.js.map +1 -0
- package/lib/components/organisms/ScrollList/ScrollList.d.ts +13 -0
- package/lib/components/organisms/ScrollList/ScrollList.js +70 -0
- package/lib/components/organisms/ScrollList/ScrollList.js.map +1 -0
- package/lib/components/organisms/SearchBar/SearchBar.d.ts +14 -0
- package/lib/components/organisms/SearchBar/SearchBar.js +44 -0
- package/lib/components/organisms/SearchBar/SearchBar.js.map +1 -0
- package/lib/components/organisms/index.d.ts +11 -0
- package/lib/components/organisms/index.js +29 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/config/ConfigContext.d.ts +26 -0
- package/lib/config/ConfigContext.js +184 -0
- package/lib/config/ConfigContext.js.map +1 -0
- package/lib/hooks/use-click-outside.d.ts +6 -0
- package/lib/hooks/use-click-outside.helper.d.ts +10 -0
- package/lib/hooks/use-click-outside.helper.js +35 -0
- package/lib/hooks/use-click-outside.helper.js.map +1 -0
- package/lib/hooks/use-click-outside.js +123 -0
- package/lib/hooks/use-click-outside.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +26 -0
- package/lib/index.js.map +1 -0
- package/lib/theme/ThemeContext.d.ts +19 -0
- package/lib/theme/ThemeContext.js +110 -0
- package/lib/theme/ThemeContext.js.map +1 -0
- package/lib/theme/WritingThemeContext.d.ts +10 -0
- package/lib/theme/WritingThemeContext.js +77 -0
- package/lib/theme/WritingThemeContext.js.map +1 -0
- package/lib/theme/index.d.ts +4 -0
- package/lib/theme/index.js +22 -0
- package/lib/theme/index.js.map +1 -0
- package/lib/theme/themes.d.ts +32 -0
- package/lib/theme/themes.js +178 -0
- package/lib/theme/themes.js.map +1 -0
- package/lib/theme/writingTheme.d.ts +19 -0
- package/lib/theme/writingTheme.js +45 -0
- package/lib/theme/writingTheme.js.map +1 -0
- package/lib/tools/AnimationUtil.d.ts +12 -0
- package/lib/tools/AnimationUtil.js +40 -0
- package/lib/tools/AnimationUtil.js.map +1 -0
- package/lib/types/file.d.ts +5 -0
- package/lib/types/file.js +62 -0
- package/lib/types/file.js.map +1 -0
- package/lib/utils/arrays.d.ts +2 -0
- package/lib/utils/arrays.js +31 -0
- package/lib/utils/arrays.js.map +1 -0
- package/lib/utils/commons-styles.d.ts +34 -0
- package/lib/utils/commons-styles.js +53 -0
- package/lib/utils/commons-styles.js.map +1 -0
- package/lib/utils/formatters.d.ts +2 -0
- package/lib/utils/formatters.js +48 -0
- package/lib/utils/formatters.js.map +1 -0
- package/lib/utils/headerStyle.d.ts +12 -0
- package/lib/utils/headerStyle.js +31 -0
- package/lib/utils/headerStyle.js.map +1 -0
- package/lib/utils/list.d.ts +2 -0
- package/lib/utils/list.js +47 -0
- package/lib/utils/list.js.map +1 -0
- package/lib/utils/number.d.ts +4 -0
- package/lib/utils/number.js +34 -0
- package/lib/utils/number.js.map +1 -0
- package/lib/utils/strings.d.ts +2 -0
- package/lib/utils/strings.js +33 -0
- package/lib/utils/strings.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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 React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
20
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
21
|
+
import { getCommonStyles } from '../../../utils/commons-styles';
|
|
22
|
+
import { Icon, Text } from '../../atoms';
|
|
23
|
+
import { LabelText, SelectionContainer, RightIconButton } from '../../molecules';
|
|
24
|
+
import { getFromList } from '../../../utils/list';
|
|
25
|
+
import { OUTSIDE_INDICATOR, useClickOutside, } from '../../../hooks/use-click-outside';
|
|
26
|
+
const Picker = ({ style, pickerStyle, styleTxt, title, onValueChange, defaultValue = '', listItems, labelField, valueField, emptyValue = true, isValueItem = false, disabled = false, disabledValue = null, iconName = null, }) => {
|
|
27
|
+
const [pickerIsOpen, setPickerIsOpen] = useState(false);
|
|
28
|
+
const wrapperRef = useRef(null);
|
|
29
|
+
const clickOutside = useClickOutside({
|
|
30
|
+
wrapperRef,
|
|
31
|
+
visible: pickerIsOpen,
|
|
32
|
+
});
|
|
33
|
+
const Colors = useThemeColor();
|
|
34
|
+
const [selectedItem, setSelectedItem] = useState(getFromList(listItems, valueField, defaultValue));
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setSelectedItem(getFromList(listItems, valueField, defaultValue));
|
|
37
|
+
}, [defaultValue, listItems, valueField]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (clickOutside === OUTSIDE_INDICATOR && pickerIsOpen) {
|
|
40
|
+
setPickerIsOpen(false);
|
|
41
|
+
}
|
|
42
|
+
}, [clickOutside, pickerIsOpen]);
|
|
43
|
+
const togglePicker = () => {
|
|
44
|
+
setPickerIsOpen(current => !current);
|
|
45
|
+
};
|
|
46
|
+
const handleValueChange = itemValue => {
|
|
47
|
+
setPickerIsOpen(false);
|
|
48
|
+
setSelectedItem(itemValue);
|
|
49
|
+
itemValue
|
|
50
|
+
? onValueChange(isValueItem
|
|
51
|
+
? getFromList(listItems, 'id', itemValue[valueField])
|
|
52
|
+
: itemValue[valueField])
|
|
53
|
+
: onValueChange(itemValue);
|
|
54
|
+
};
|
|
55
|
+
const commonStyles = useMemo(() => getCommonStyles(Colors), [Colors]);
|
|
56
|
+
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
57
|
+
return (<View ref={wrapperRef} style={style}>
|
|
58
|
+
{!disabled && (<View style={styles.titleContainer}>
|
|
59
|
+
<Text style={styleTxt}>{title}</Text>
|
|
60
|
+
</View>)}
|
|
61
|
+
{disabled ? (<View style={[
|
|
62
|
+
commonStyles.filter,
|
|
63
|
+
commonStyles.filterSize,
|
|
64
|
+
commonStyles.filterAlign,
|
|
65
|
+
styles.infosCard,
|
|
66
|
+
pickerStyle,
|
|
67
|
+
]}>
|
|
68
|
+
<LabelText value={disabledValue == null || disabledValue === ''
|
|
69
|
+
? '-'
|
|
70
|
+
: disabledValue} title={`${title} :`} iconName={iconName}/>
|
|
71
|
+
</View>) : (<View>
|
|
72
|
+
<RightIconButton onPress={togglePicker} icon={<Icon name="chevron-down" color={Colors.secondaryColor_dark.background}/>} title={selectedItem ? selectedItem[labelField] : ''} styleText={styles.styleTextButton} style={[
|
|
73
|
+
commonStyles.filter,
|
|
74
|
+
commonStyles.filterSize,
|
|
75
|
+
commonStyles.filterAlign,
|
|
76
|
+
styles.rightIconButton,
|
|
77
|
+
pickerStyle,
|
|
78
|
+
]}/>
|
|
79
|
+
{pickerIsOpen ? (<SelectionContainer emptyValue={emptyValue} objectList={listItems} keyField={valueField} displayValue={item => item[labelField]} handleSelect={handleValueChange} isPicker={true}/>) : null}
|
|
80
|
+
</View>)}
|
|
81
|
+
</View>);
|
|
82
|
+
};
|
|
83
|
+
const getStyles = Colors => StyleSheet.create({
|
|
84
|
+
titleContainer: {
|
|
85
|
+
marginHorizontal: 24,
|
|
86
|
+
},
|
|
87
|
+
rightIconButton: {
|
|
88
|
+
width: Dimensions.get('window').width * 0.9,
|
|
89
|
+
borderColor: Colors.secondaryColor.background,
|
|
90
|
+
borderWidth: 1,
|
|
91
|
+
},
|
|
92
|
+
styleTextButton: {
|
|
93
|
+
left: '-20%',
|
|
94
|
+
},
|
|
95
|
+
infosCard: {
|
|
96
|
+
justifyContent: 'flex-start',
|
|
97
|
+
width: Dimensions.get('window').width * 0.9,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
export default Picker;
|
|
101
|
+
//# sourceMappingURL=Picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Picker.js","sourceRoot":"","sources":["../../../../src/components/organisms/Picker/Picker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC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AAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CACvC,YAAY,CAAC,CAAC,iBAAiB,CAAC,CAChC,QAAQ,CAAC,CAAC,IAAI,CAAC,EACf,CACH,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CACzB,UAAU,CAAC,MAAM,CAAC;IAChB,cAAc,EAAE;QACd,gBAAgB,EAAE,EAAE;KACrB;IACD,eAAe,EAAE;QACf,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,GAAG;QAC3C,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QAC7C,WAAW,EAAE,CAAC;KACf;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;IACD,SAAS,EAAE;QACT,cAAc,EAAE,YAAY;QAC5B,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,GAAG;KAC5C;CACF,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface PopUpOneButtonProps {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
data: string;
|
|
5
|
+
btnTitle: string;
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const PopUpOneButton: ({ visible, title, data, btnTitle, onPress, }: PopUpOneButtonProps) => JSX.Element;
|
|
9
|
+
export default PopUpOneButton;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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 React from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { Button, PopUp } from '../../molecules';
|
|
21
|
+
const PopUpOneButton = ({ visible, title, data, btnTitle, onPress, }) => {
|
|
22
|
+
return (<PopUp visible={visible} title={title} data={data}>
|
|
23
|
+
<Button style={styles.button} title={btnTitle} onPress={onPress}/>
|
|
24
|
+
</PopUp>);
|
|
25
|
+
};
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
button: {
|
|
28
|
+
alignSelf: 'center',
|
|
29
|
+
marginTop: 15,
|
|
30
|
+
elevation: 5,
|
|
31
|
+
width: '40%',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export default PopUpOneButton;
|
|
35
|
+
//# sourceMappingURL=PopUpOneButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopUpOneButton.js","sourceRoot":"","sources":["../../../../src/components/organisms/PopUpOneButton/PopUpOneButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAU9C,MAAM,cAAc,GAAG,CAAC,EACtB,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,OAAO,GACa,EAAE,EAAE;IACxB,OAAO,CACL,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAChD;MAAA,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAClE;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface PopUpTwoButtonProps {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
data: string;
|
|
5
|
+
PrimaryBtnTitle: string;
|
|
6
|
+
onPressPrimary: () => void;
|
|
7
|
+
SecondaryBtnTitle: string;
|
|
8
|
+
onPressSecondary: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const PopUpTwoButton: ({ visible, title, data, PrimaryBtnTitle, onPressPrimary, SecondaryBtnTitle, onPressSecondary, }: PopUpTwoButtonProps) => JSX.Element;
|
|
11
|
+
export default PopUpTwoButton;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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 React from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
21
|
+
import { Button, PopUp } from '../../molecules';
|
|
22
|
+
const PopUpTwoButton = ({ visible, title, data, PrimaryBtnTitle, onPressPrimary, SecondaryBtnTitle, onPressSecondary, }) => {
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
return (<PopUp visible={visible} title={title} data={data}>
|
|
25
|
+
<Button style={styles.button} color={Colors.secondaryColor} title={SecondaryBtnTitle} onPress={onPressSecondary}/>
|
|
26
|
+
<Button style={styles.button} color={Colors.primaryColor} title={PrimaryBtnTitle} onPress={onPressPrimary}/>
|
|
27
|
+
</PopUp>);
|
|
28
|
+
};
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
button: {
|
|
31
|
+
marginHorizontal: 4,
|
|
32
|
+
marginTop: 15,
|
|
33
|
+
elevation: 5,
|
|
34
|
+
width: '40%',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export default PopUpTwoButton;
|
|
38
|
+
//# sourceMappingURL=PopUpTwoButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopUpTwoButton.js","sourceRoot":"","sources":["../../../../src/components/organisms/PopUpTwoButton/PopUpTwoButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU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|
5
|
+
renderItem: (item: any) => any;
|
|
6
|
+
fetchData: (fetchOptions?: any) => any[] | void;
|
|
7
|
+
moreLoading: boolean;
|
|
8
|
+
isListEnd: boolean;
|
|
9
|
+
filter: boolean;
|
|
10
|
+
translator?: (translationKey: string) => string;
|
|
11
|
+
}
|
|
12
|
+
declare const ScrollList: ({ style, loadingList, data, renderItem, fetchData, moreLoading, isListEnd, filter, translator, }: ScrollListProps) => JSX.Element;
|
|
13
|
+
export default ScrollList;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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 React, { useCallback, useEffect, useState } from 'react';
|
|
19
|
+
import { StyleSheet, View, FlatList, ActivityIndicator } from 'react-native';
|
|
20
|
+
import { Text } from '../../atoms';
|
|
21
|
+
const ScrollList = ({ style, loadingList = false, data = [], renderItem, fetchData = () => [], moreLoading = false, isListEnd = false, filter = false, translator, }) => {
|
|
22
|
+
const [page, setPage] = useState(0);
|
|
23
|
+
const updateData = useCallback(() => {
|
|
24
|
+
setPage(0);
|
|
25
|
+
fetchData(0);
|
|
26
|
+
}, [fetchData]);
|
|
27
|
+
const initialize = useCallback(() => {
|
|
28
|
+
updateData();
|
|
29
|
+
}, [updateData]);
|
|
30
|
+
const handleMoreData = useCallback(currentPage => {
|
|
31
|
+
if (!isListEnd && !moreLoading && !filter) {
|
|
32
|
+
setPage(currentPage + 1);
|
|
33
|
+
fetchData(currentPage + 1);
|
|
34
|
+
}
|
|
35
|
+
}, [fetchData, filter, isListEnd, moreLoading]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
initialize();
|
|
38
|
+
}, [initialize]);
|
|
39
|
+
if (loadingList) {
|
|
40
|
+
return (<View style={styles.loadingContainer}>
|
|
41
|
+
<ActivityIndicator size="large" color="black"/>
|
|
42
|
+
</View>);
|
|
43
|
+
}
|
|
44
|
+
return (<FlatList style={[styles.scrollView, style]} data={data} onRefresh={updateData} refreshing={loadingList} onEndReached={() => handleMoreData(page)} ListFooterComponent={() => {
|
|
45
|
+
return (<View style={styles.footerText}>
|
|
46
|
+
{moreLoading && <ActivityIndicator size="large" color="black"/>}
|
|
47
|
+
{data == null || data?.length === 0 ? (<Text>
|
|
48
|
+
{translator != null ? translator('Base_NoData') : 'No data.'}
|
|
49
|
+
</Text>) : (isListEnd && (<Text>
|
|
50
|
+
{translator != null
|
|
51
|
+
? translator('Base_NoMoreItems')
|
|
52
|
+
: 'No more items.'}
|
|
53
|
+
</Text>))}
|
|
54
|
+
</View>);
|
|
55
|
+
}} renderItem={renderItem}/>);
|
|
56
|
+
};
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
loadingContainer: {
|
|
59
|
+
flex: 1,
|
|
60
|
+
},
|
|
61
|
+
footerText: {
|
|
62
|
+
alignSelf: 'center',
|
|
63
|
+
marginBottom: 7,
|
|
64
|
+
},
|
|
65
|
+
scrollView: {
|
|
66
|
+
paddingTop: 7,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
export default ScrollList;
|
|
70
|
+
//# sourceMappingURL=ScrollList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollList.js","sourceRoot":"","sources":["../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,IAAI,CAAC,CACR,CACF,CACH;UAAA,EAAE,IAAI,CAAC,CACR,CAAC;QACJ,CAAC,CAAC,CACF,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,gBAAgB,EAAE;QAChB,IAAI,EAAE,CAAC;KACR;IACD,UAAU,EAAE;QACV,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,CAAC;KAChB;IACD,UAAU,EAAE;QACV,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface SearchBarProps {
|
|
2
|
+
style?: any;
|
|
3
|
+
valueTxt: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
onClearPress: () => void;
|
|
6
|
+
onChangeTxt: (any: any) => void;
|
|
7
|
+
onSelection?: () => void;
|
|
8
|
+
onEndFocus: () => void;
|
|
9
|
+
isFocus?: boolean;
|
|
10
|
+
onScanPress?: () => void;
|
|
11
|
+
scanIconColor?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const SearchBar: ({ style, valueTxt, placeholder, onClearPress, onChangeTxt, onSelection, onEndFocus, isFocus, onScanPress, scanIconColor, }: SearchBarProps) => JSX.Element;
|
|
14
|
+
export default SearchBar;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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 React, { useMemo } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { getCommonStyles } from '../../../utils/commons-styles';
|
|
21
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
22
|
+
import { Icon } from '../../atoms';
|
|
23
|
+
import { IconInput } from '../../molecules';
|
|
24
|
+
const SearchBar = ({ style, valueTxt, placeholder, onClearPress, onChangeTxt, onSelection = () => { }, onEndFocus = () => { }, isFocus = false, onScanPress = () => { }, scanIconColor = null, }) => {
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const commonStyles = useMemo(() => getCommonStyles(Colors), [Colors]);
|
|
27
|
+
return (<IconInput style={[
|
|
28
|
+
commonStyles.filter,
|
|
29
|
+
commonStyles.filterAlign,
|
|
30
|
+
commonStyles.filterSize,
|
|
31
|
+
style,
|
|
32
|
+
]} value={valueTxt} placeholder={placeholder} onChange={onChangeTxt} onSelection={onSelection} onEndFocus={onEndFocus} isFocus={isFocus} rightIconsList={[
|
|
33
|
+
<Icon style={styles.action} name="times" color={Colors.secondaryColor_dark.background} size={20} touchable={true} visible={valueTxt != null && valueTxt !== ''} onPress={onClearPress}/>,
|
|
34
|
+
<Icon style={styles.action} name="search" color={Colors.secondaryColor_dark.background} size={20}/>,
|
|
35
|
+
<Icon style={styles.action} name="qrcode" FontAwesome5={false} color={scanIconColor} size={20} touchable={true} visible={scanIconColor != null} onPress={onScanPress}/>,
|
|
36
|
+
]}/>);
|
|
37
|
+
};
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
action: {
|
|
40
|
+
marginLeft: 12,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export default SearchBar;
|
|
44
|
+
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/components/organisms/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAe1C,MAAM,SAAS,GAAG,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,GAAG,GAAG,EAAE,GAAE,CAAC,EACtB,UAAU,GAAG,GAAG,EAAE,GAAE,CAAC,EACrB,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,GAAG,EAAE,GAAE,CAAC,EACtB,aAAa,GAAG,IAAI,GACL,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtE,OAAO,CACL,CAAC,SAAS,CACR,KAAK,CAAC,CAAC;YACL,YAAY,CAAC,MAAM;YACnB,YAAY,CAAC,WAAW;YACxB,YAAY,CAAC,UAAU;YACvB,KAAK;SACN,CAAC,CACF,KAAK,CAAC,CAAC,QAAQ,CAAC,CAChB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,WAAW,CAAC,CACtB,WAAW,CAAC,CAAC,WAAW,CAAC,CAC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{ default as ChipSelect } from './ChipSelect/ChipSelect';
|
|
3
|
+
export { default as DropdownCardSwitch } from './DropdownCardSwitch/DropdownCardSwitch';
|
|
4
|
+
export { default as HeaderContainer } from './HeaderContainer/HeaderContainer';
|
|
5
|
+
export { default as ImageBubble } from './ImageBubble/ImageBubble';
|
|
6
|
+
export { default as MultiValuePicker } from './MultiValuePicker/MultiValuePicker';
|
|
7
|
+
export { default as Picker } from './Picker/Picker';
|
|
8
|
+
export { default as PopUpOneButton } from './PopUpOneButton/PopUpOneButton';
|
|
9
|
+
export { default as PopUpTwoButton } from './PopUpTwoButton/PopUpTwoButton';
|
|
10
|
+
export { default as ScrollList } from './ScrollList/ScrollList';
|
|
11
|
+
export { default as SearchBar } from './SearchBar/SearchBar';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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
|
+
export { default as AutoCompleteSearch } from './AutoCompleteSearch/AutoCompleteSearch';
|
|
19
|
+
export { default as ChipSelect } from './ChipSelect/ChipSelect';
|
|
20
|
+
export { default as DropdownCardSwitch } from './DropdownCardSwitch/DropdownCardSwitch';
|
|
21
|
+
export { default as HeaderContainer } from './HeaderContainer/HeaderContainer';
|
|
22
|
+
export { default as ImageBubble } from './ImageBubble/ImageBubble';
|
|
23
|
+
export { default as MultiValuePicker } from './MultiValuePicker/MultiValuePicker';
|
|
24
|
+
export { default as Picker } from './Picker/Picker';
|
|
25
|
+
export { default as PopUpOneButton } from './PopUpOneButton/PopUpOneButton';
|
|
26
|
+
export { default as PopUpTwoButton } from './PopUpTwoButton/PopUpTwoButton';
|
|
27
|
+
export { default as ScrollList } from './ScrollList/ScrollList';
|
|
28
|
+
export { default as SearchBar } from './SearchBar/SearchBar';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/organisms/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface ConfigContextState {
|
|
2
|
+
showFilter: boolean;
|
|
3
|
+
hideVirtualKeyboard: boolean;
|
|
4
|
+
showActivityIndicator: boolean;
|
|
5
|
+
headerHeight: number;
|
|
6
|
+
isHeaderIndicatorVisible: boolean;
|
|
7
|
+
headerIndicatorState: HeaderIndicatorState;
|
|
8
|
+
setActivityIndicator: (option: boolean) => void;
|
|
9
|
+
setFilterConfig: (option: boolean) => void;
|
|
10
|
+
toggleFilterConfig: () => void;
|
|
11
|
+
setVirtualKeyboardConfig: (option: boolean) => void;
|
|
12
|
+
toggleVirtualKeyboardConfig: () => void;
|
|
13
|
+
setHeaderHeight: (height: number) => void;
|
|
14
|
+
setIsHeaderIndicatorVisible: (option: boolean) => void;
|
|
15
|
+
setHeaderIndicatorState: (state: HeaderIndicatorState) => void;
|
|
16
|
+
}
|
|
17
|
+
interface HeaderIndicatorState {
|
|
18
|
+
text: string;
|
|
19
|
+
color?: string;
|
|
20
|
+
textColor?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const ConfigProvider: ({ children }: {
|
|
23
|
+
children: any;
|
|
24
|
+
}) => JSX.Element;
|
|
25
|
+
export declare const useConfig: () => ConfigContextState;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 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 React, { createContext, useCallback, useContext, useMemo, useReducer, } from 'react';
|
|
19
|
+
const defaultConfigContext = {
|
|
20
|
+
showFilter: true,
|
|
21
|
+
hideVirtualKeyboard: false,
|
|
22
|
+
showActivityIndicator: false,
|
|
23
|
+
headerHeight: 115,
|
|
24
|
+
isHeaderIndicatorVisible: false,
|
|
25
|
+
headerIndicatorState: {
|
|
26
|
+
text: '',
|
|
27
|
+
},
|
|
28
|
+
setActivityIndicator: () => {
|
|
29
|
+
throw new Error('ConfigProvider should be mounted to set Indicator config');
|
|
30
|
+
},
|
|
31
|
+
setFilterConfig: () => {
|
|
32
|
+
throw new Error('ConfigProvider should be mounted to set filter config');
|
|
33
|
+
},
|
|
34
|
+
toggleFilterConfig: () => {
|
|
35
|
+
throw new Error('ConfigProvider should be mounted to toggle filter config');
|
|
36
|
+
},
|
|
37
|
+
setVirtualKeyboardConfig: () => {
|
|
38
|
+
throw new Error('ConfigProvider should be mounted to set virtual keyboard config');
|
|
39
|
+
},
|
|
40
|
+
toggleVirtualKeyboardConfig: () => {
|
|
41
|
+
throw new Error('ConfigProvider should be mounted to toggle virtual keyboard config');
|
|
42
|
+
},
|
|
43
|
+
setHeaderHeight: () => {
|
|
44
|
+
throw new Error('ConfigProvider should be mounted to set header height config');
|
|
45
|
+
},
|
|
46
|
+
setIsHeaderIndicatorVisible: () => {
|
|
47
|
+
throw new Error('ConfigProvider should be mounted to set is header indicator visible config');
|
|
48
|
+
},
|
|
49
|
+
setHeaderIndicatorState: () => {
|
|
50
|
+
throw new Error('ConfigProvider should be mounted to set header indicator state config');
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const ConfigContext = createContext(defaultConfigContext);
|
|
54
|
+
const actionTypes = {
|
|
55
|
+
setFilterConfig: 'setFilterConfig',
|
|
56
|
+
toggleFilterConfig: 'toggleFilterConfig',
|
|
57
|
+
setVirtualKeyboardConfig: 'setVirtualKeyboardConfig',
|
|
58
|
+
toggleVirtualKeyboardConfig: 'toggleVirtualKeyboardConfig',
|
|
59
|
+
setActivityIndicator: 'setActivityIndicator',
|
|
60
|
+
setHeaderHeight: 'setHeaderHeight',
|
|
61
|
+
setIsHeaderIndicatorVisible: 'setIsHeaderIndicatorVisible',
|
|
62
|
+
setHeaderIndicatorState: 'setHeaderIndicatorState',
|
|
63
|
+
};
|
|
64
|
+
const configReducer = (state, action) => {
|
|
65
|
+
switch (action.type) {
|
|
66
|
+
case actionTypes.setActivityIndicator: {
|
|
67
|
+
return {
|
|
68
|
+
...state,
|
|
69
|
+
showActivityIndicator: action.payload,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
case actionTypes.setFilterConfig: {
|
|
73
|
+
return {
|
|
74
|
+
...state,
|
|
75
|
+
showFilter: action.payload,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
case actionTypes.toggleFilterConfig: {
|
|
79
|
+
return {
|
|
80
|
+
...state,
|
|
81
|
+
showFilter: !state.showFilter,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
case actionTypes.setVirtualKeyboardConfig: {
|
|
85
|
+
return {
|
|
86
|
+
...state,
|
|
87
|
+
hideVirtualKeyboard: action.payload,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
case actionTypes.toggleVirtualKeyboardConfig: {
|
|
91
|
+
return {
|
|
92
|
+
...state,
|
|
93
|
+
hideVirtualKeyboard: !state.hideVirtualKeyboard,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
case actionTypes.setHeaderHeight: {
|
|
97
|
+
return {
|
|
98
|
+
...state,
|
|
99
|
+
headerHeight: action.payload,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
case actionTypes.setIsHeaderIndicatorVisible: {
|
|
103
|
+
return {
|
|
104
|
+
...state,
|
|
105
|
+
isHeaderIndicatorVisible: action.payload,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
case actionTypes.setHeaderIndicatorState: {
|
|
109
|
+
return {
|
|
110
|
+
...state,
|
|
111
|
+
headerIndicatorState: action.payload,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const actions = {
|
|
117
|
+
setActivityIndicator: option => ({
|
|
118
|
+
type: actionTypes.setActivityIndicator,
|
|
119
|
+
payload: option,
|
|
120
|
+
}),
|
|
121
|
+
setFilterConfig: option => ({
|
|
122
|
+
type: actionTypes.setFilterConfig,
|
|
123
|
+
payload: option,
|
|
124
|
+
}),
|
|
125
|
+
toggleFilterConfig: () => ({
|
|
126
|
+
type: actionTypes.toggleFilterConfig,
|
|
127
|
+
}),
|
|
128
|
+
setVirtualKeyboardConfig: option => ({
|
|
129
|
+
type: actionTypes.setVirtualKeyboardConfig,
|
|
130
|
+
payload: option,
|
|
131
|
+
}),
|
|
132
|
+
toggleVirtualKeyboardConfig: () => ({
|
|
133
|
+
type: actionTypes.toggleVirtualKeyboardConfig,
|
|
134
|
+
}),
|
|
135
|
+
setHeaderHeight: value => ({
|
|
136
|
+
type: actionTypes.setHeaderHeight,
|
|
137
|
+
payload: value,
|
|
138
|
+
}),
|
|
139
|
+
setIsHeaderIndicatorVisible: option => ({
|
|
140
|
+
type: actionTypes.setIsHeaderIndicatorVisible,
|
|
141
|
+
payload: option,
|
|
142
|
+
}),
|
|
143
|
+
setHeaderIndicatorState: state => ({
|
|
144
|
+
type: actionTypes.setHeaderIndicatorState,
|
|
145
|
+
payload: state,
|
|
146
|
+
}),
|
|
147
|
+
};
|
|
148
|
+
export const ConfigProvider = ({ children }) => {
|
|
149
|
+
const [state, dispatch] = useReducer(configReducer, defaultConfigContext);
|
|
150
|
+
const setActivityIndicator = useCallback(option => dispatch(actions.setActivityIndicator(option)), []);
|
|
151
|
+
const setFilterConfig = useCallback(option => dispatch(actions.setFilterConfig(option)), []);
|
|
152
|
+
const toggleFilterConfig = useCallback(() => dispatch(actions.toggleFilterConfig()), []);
|
|
153
|
+
const setVirtualKeyboardConfig = useCallback(option => dispatch(actions.setVirtualKeyboardConfig(option)), []);
|
|
154
|
+
const toggleVirtualKeyboardConfig = useCallback(() => dispatch(actions.toggleVirtualKeyboardConfig()), []);
|
|
155
|
+
const setHeaderHeight = useCallback(value => dispatch(actions.setHeaderHeight(value)), []);
|
|
156
|
+
const setIsHeaderIndicatorVisible = useCallback(option => dispatch(actions.setIsHeaderIndicatorVisible(option)), []);
|
|
157
|
+
const setHeaderIndicatorState = useCallback(headerIndicatorState => dispatch(actions.setHeaderIndicatorState(headerIndicatorState)), []);
|
|
158
|
+
const configContextState = useMemo(() => ({
|
|
159
|
+
...state,
|
|
160
|
+
setActivityIndicator,
|
|
161
|
+
setFilterConfig,
|
|
162
|
+
toggleFilterConfig,
|
|
163
|
+
setVirtualKeyboardConfig,
|
|
164
|
+
toggleVirtualKeyboardConfig,
|
|
165
|
+
setHeaderHeight,
|
|
166
|
+
setIsHeaderIndicatorVisible,
|
|
167
|
+
setHeaderIndicatorState,
|
|
168
|
+
}), [
|
|
169
|
+
setActivityIndicator,
|
|
170
|
+
setFilterConfig,
|
|
171
|
+
setVirtualKeyboardConfig,
|
|
172
|
+
state,
|
|
173
|
+
toggleFilterConfig,
|
|
174
|
+
toggleVirtualKeyboardConfig,
|
|
175
|
+
setHeaderHeight,
|
|
176
|
+
setIsHeaderIndicatorVisible,
|
|
177
|
+
setHeaderIndicatorState,
|
|
178
|
+
]);
|
|
179
|
+
return (<ConfigContext.Provider value={configContextState}>
|
|
180
|
+
{children}
|
|
181
|
+
</ConfigContext.Provider>);
|
|
182
|
+
};
|
|
183
|
+
export const useConfig = () => useContext(ConfigContext);
|
|
184
|
+
//# sourceMappingURL=ConfigContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigContext.js","sourceRoot":"","sources":["../../src/config/ConfigContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;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