@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,50 @@
|
|
|
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 { useThemeColor } from '../../../theme/ThemeContext';
|
|
20
|
+
import ReactNativeRenderHTML, { HTMLContentModel, HTMLElementModel, } from 'react-native-render-html';
|
|
21
|
+
const PERCENTAGE_WIDTH_NOTES = 0.95;
|
|
22
|
+
const RenderHtml = ({ data, widthNotes }) => {
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
if (data == null || data === '') {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const fontElementModel = HTMLElementModel.fromCustomModel({
|
|
28
|
+
tagName: 'font',
|
|
29
|
+
contentModel: HTMLContentModel.mixed,
|
|
30
|
+
getUADerivedStyleFromAttributes({ face, color, size }) {
|
|
31
|
+
let style = { fontFamily: '', color: '', fontSize: '' };
|
|
32
|
+
if (face) {
|
|
33
|
+
style.fontFamily = face;
|
|
34
|
+
}
|
|
35
|
+
if (color) {
|
|
36
|
+
style.color = color;
|
|
37
|
+
}
|
|
38
|
+
if (size) {
|
|
39
|
+
style.fontSize = size;
|
|
40
|
+
}
|
|
41
|
+
return style;
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
const customHTMLElementModels = { font: fontElementModel };
|
|
45
|
+
return (<ReactNativeRenderHTML source={{
|
|
46
|
+
html: data,
|
|
47
|
+
}} customHTMLElementModels={customHTMLElementModels} contentWidth={widthNotes != null ? widthNotes * PERCENTAGE_WIDTH_NOTES : 100} baseStyle={{ color: Colors.text }}/>);
|
|
48
|
+
};
|
|
49
|
+
export default RenderHtml;
|
|
50
|
+
//# sourceMappingURL=RenderHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderHtml.js","sourceRoot":"","sources":["../../../../src/components/atoms/RenderHtml/RenderHtml.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAOpC,MAAM,UAAU,GAAG,CAAC,EAAC,IAAI,EAAE,UAAU,EAAkB,EAAE,EAAE;IACzD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IAED,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,eAAe,CAAC;QACxD,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,gBAAgB,CAAC,KAAK;QACpC,+BAA+B,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC;YACjD,IAAI,KAAK,GAAG,EAAC,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAC,CAAC;YACtD,IAAI,IAAI,EAAE;gBACR,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;aACzB;YACD,IAAI,KAAK,EAAE;gBACT,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;aACrB;YACD,IAAI,IAAI,EAAE;gBACR,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;aACvB;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,uBAAuB,GAAG,EAAC,IAAI,EAAE,gBAAgB,EAAC,CAAC;IAEzD,OAAO,CACL,CAAC,qBAAqB,CACpB,MAAM,CAAC,CAAC;YACN,IAAI,EAAE,IAAI;SACX,CAAC,CACF,uBAAuB,CAAC,CAAC,uBAAuB,CAAC,CACjD,YAAY,CAAC,CACX,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,GAAG,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAC/D,CACD,SAAS,CAAC,CAAC,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAC,CAAC,EAChC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ScreenProps {
|
|
2
|
+
style?: any;
|
|
3
|
+
children: any;
|
|
4
|
+
fixedItems?: any;
|
|
5
|
+
removeSpaceOnTop?: boolean;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const Screen: ({ style, children, fixedItems, removeSpaceOnTop, loading, }: ScreenProps) => JSX.Element;
|
|
9
|
+
export default Screen;
|
|
@@ -0,0 +1,74 @@
|
|
|
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 } from 'react';
|
|
19
|
+
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
20
|
+
import SystemNavigationBar from 'react-native-system-navigation-bar';
|
|
21
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
22
|
+
import { useConfig } from '../../../config/ConfigContext';
|
|
23
|
+
const immersiveMode = async () => {
|
|
24
|
+
await SystemNavigationBar.navigationHide();
|
|
25
|
+
};
|
|
26
|
+
const Screen = ({ style, children, fixedItems, removeSpaceOnTop = false, loading = false, }) => {
|
|
27
|
+
const Colors = useThemeColor();
|
|
28
|
+
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
29
|
+
const { showActivityIndicator } = useConfig();
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
immersiveMode();
|
|
32
|
+
}, []);
|
|
33
|
+
if (loading) {
|
|
34
|
+
return <ActivityIndicator size="large"/>;
|
|
35
|
+
}
|
|
36
|
+
return (<View pointerEvents={showActivityIndicator === true ? 'none' : 'auto'} style={[
|
|
37
|
+
styles.container,
|
|
38
|
+
removeSpaceOnTop ? null : styles.marginTop,
|
|
39
|
+
style,
|
|
40
|
+
]}>
|
|
41
|
+
{children}
|
|
42
|
+
{React.Children.count(fixedItems) > 0 && (<View style={[styles.fixedContainer, styles.smallTopShadow]}>
|
|
43
|
+
{fixedItems}
|
|
44
|
+
</View>)}
|
|
45
|
+
</View>);
|
|
46
|
+
};
|
|
47
|
+
const getStyles = Colors => StyleSheet.create({
|
|
48
|
+
container: {
|
|
49
|
+
backgroundColor: Colors.screenBackgroundColor,
|
|
50
|
+
flex: 1,
|
|
51
|
+
},
|
|
52
|
+
fixedContainer: {
|
|
53
|
+
width: '100%',
|
|
54
|
+
alignContent: 'flex-end',
|
|
55
|
+
alignSelf: 'flex-end',
|
|
56
|
+
backgroundColor: Colors.backgroundColor,
|
|
57
|
+
borderTopLeftRadius: 13,
|
|
58
|
+
borderTopRightRadius: 13,
|
|
59
|
+
},
|
|
60
|
+
smallTopShadow: {
|
|
61
|
+
borderTopWidth: 0.5,
|
|
62
|
+
borderRightWidth: 1,
|
|
63
|
+
borderLeftWidth: 0.5,
|
|
64
|
+
borderTopColor: 'rgba(0,0,0,0.1)',
|
|
65
|
+
borderRightColor: 'rgba(0,0,0,0.2)',
|
|
66
|
+
borderLeftColor: 'rgba(0,0,0,0.1)',
|
|
67
|
+
elevation: 24,
|
|
68
|
+
},
|
|
69
|
+
marginTop: {
|
|
70
|
+
paddingTop: '1.5%',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
export default Screen;
|
|
74
|
+
//# sourceMappingURL=Screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../../src/components/atoms/Screen/Screen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AACjE,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC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AC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CACzB,UAAU,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,eAAe,EAAE,MAAM,CAAC,qBAAqB;QAC7C,IAAI,EAAE,CAAC;KACR;IACD,cAAc,EAAE;QACd,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,UAAU;QACxB,SAAS,EAAE,UAAU;QACrB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,mBAAmB,EAAE,EAAE;QACvB,oBAAoB,EAAE,EAAE;KACzB;IACD,cAAc,EAAE;QACd,cAAc,EAAE,GAAG;QACnB,gBAAgB,EAAE,CAAC;QACnB,eAAe,EAAE,GAAG;QACpB,cAAc,EAAE,iBAAiB;QACjC,gBAAgB,EAAE,iBAAiB;QACnC,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,EAAE;KACd;IACD,SAAS,EAAE;QACT,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { ScrollView as ReactNativeScrollView, StyleSheet } from 'react-native';
|
|
20
|
+
const ScrollView = ({ style, children }) => {
|
|
21
|
+
return (<ReactNativeScrollView contentContainerStyle={[styles.container, style]}>
|
|
22
|
+
{children}
|
|
23
|
+
</ReactNativeScrollView>);
|
|
24
|
+
};
|
|
25
|
+
const styles = StyleSheet.create({
|
|
26
|
+
container: {
|
|
27
|
+
paddingTop: 10,
|
|
28
|
+
paddingBottom: 10,
|
|
29
|
+
height: '100%',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
export default ScrollView;
|
|
33
|
+
//# sourceMappingURL=ScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollView.js","sourceRoot":"","sources":["../../../../src/components/atoms/ScrollView/ScrollView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,IAAI,qBAAqB,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAO7E,MAAM,UAAU,GAAG,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAkB,EAAE,EAAE;IACxD,OAAO,CACL,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACtE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,qBAAqB,CAAC,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;QACjB,MAAM,EAAE,MAAM;KACf;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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, { useState } from 'react';
|
|
19
|
+
import { Switch as RNSwitch } from 'react-native';
|
|
20
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
21
|
+
const Switch = ({ isEnabled, handleToggle }) => {
|
|
22
|
+
const [enabled, setEnabled] = useState(isEnabled);
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
const toggleSwitch = () => {
|
|
25
|
+
handleToggle(!enabled);
|
|
26
|
+
setEnabled(previousState => !previousState);
|
|
27
|
+
};
|
|
28
|
+
return (<RNSwitch trackColor={{
|
|
29
|
+
false: Colors.secondaryColor.background_light,
|
|
30
|
+
true: Colors.primaryColor.background_light,
|
|
31
|
+
}} thumbColor={Colors.secondaryColor_dark.background} ios_backgroundColor={Colors.backgroundColor} onValueChange={toggleSwitch} value={enabled}/>);
|
|
32
|
+
};
|
|
33
|
+
export default Switch;
|
|
34
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,MAAM,IAAI,QAAQ,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAO1D,MAAM,MAAM,GAAG,CAAC,EAAC,SAAS,EAAE,YAAY,EAAc,EAAE,EAAE;IACxD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC;QACvB,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,QAAQ,CACP,UAAU,CAAC,CAAC;YACV,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,gBAAgB;YAC7C,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,gBAAgB;SAC3C,CAAC,CACF,UAAU,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAClD,mBAAmB,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAC5C,aAAa,CAAC,CAAC,YAAY,CAAC,CAC5B,KAAK,CAAC,CAAC,OAAO,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface TextProps {
|
|
2
|
+
style?: any;
|
|
3
|
+
numberOfLines?: number;
|
|
4
|
+
adjustsFontSizeToFit?: boolean;
|
|
5
|
+
onTextLayout?: (any: any) => void;
|
|
6
|
+
children: any;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
fontSize?: number;
|
|
9
|
+
writingType?: 'title' | 'subtitle' | 'important' | 'details' | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const Text: ({ style, numberOfLines, adjustsFontSizeToFit, onTextLayout, children, textColor, fontSize, writingType, }: TextProps) => JSX.Element;
|
|
12
|
+
export default Text;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { Text as ReactNativeText } from 'react-native';
|
|
20
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
21
|
+
import { useWritingType } from '../../../theme/writingTheme';
|
|
22
|
+
const Text = ({ style, numberOfLines, adjustsFontSizeToFit = false, onTextLayout, children, textColor, fontSize, writingType, }) => {
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
const writingStyle = useWritingType(writingType);
|
|
25
|
+
const defaultStyle = useMemo(() => {
|
|
26
|
+
return {
|
|
27
|
+
...writingStyle,
|
|
28
|
+
color: textColor ? textColor : Colors.text,
|
|
29
|
+
fontSize: fontSize ? fontSize : writingStyle.fontSize,
|
|
30
|
+
};
|
|
31
|
+
}, [Colors.text, fontSize, textColor, writingStyle]);
|
|
32
|
+
return (<ReactNativeText style={[defaultStyle, style]} numberOfLines={numberOfLines} adjustsFontSizeToFit={adjustsFontSizeToFit} onTextLayout={onTextLayout}>
|
|
33
|
+
{children}
|
|
34
|
+
</ReactNativeText>);
|
|
35
|
+
};
|
|
36
|
+
export default Text;
|
|
37
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../../src/components/atoms/Text/Text.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,IAAI,IAAI,eAAe,EAAY,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAa3D,MAAM,IAAI,GAAG,CAAC,EACZ,KAAK,EACL,aAAa,EACb,oBAAoB,GAAG,KAAK,EAC5B,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,GACD,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,YAAY,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAEjD,MAAM,YAAY,GAAc,OAAO,CAAC,GAAG,EAAE;QAC3C,OAAO;YACL,GAAG,YAAY;YACf,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI;YAC1C,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ;SACtD,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAErD,OAAO,CACL,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAC7B,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as BlockInteractionScreen } from './BlockInteractionScreen/BlockInteractionScreen';
|
|
2
|
+
export { default as Card } from './Card/Card';
|
|
3
|
+
export { default as HorizontalRule } from './HorizontalRule/HorizontalRule';
|
|
4
|
+
export { default as HtmlInput } from './HtmlInput/HtmlInput';
|
|
5
|
+
export { default as DottedLine } from './DottedLine/DottedLine';
|
|
6
|
+
export { default as Icon } from './Icon/Icon';
|
|
7
|
+
export { default as Input } from './Input/Input';
|
|
8
|
+
export { default as RenderHtml } from './RenderHtml/RenderHtml';
|
|
9
|
+
export { default as Screen } from './Screen/Screen';
|
|
10
|
+
export { default as ScrollView } from './ScrollView/ScrollView';
|
|
11
|
+
export { default as Switch } from './Switch/Switch';
|
|
12
|
+
export { default as Text } from './Text/Text';
|
|
@@ -0,0 +1,30 @@
|
|
|
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 BlockInteractionScreen } from './BlockInteractionScreen/BlockInteractionScreen';
|
|
19
|
+
export { default as Card } from './Card/Card';
|
|
20
|
+
export { default as HorizontalRule } from './HorizontalRule/HorizontalRule';
|
|
21
|
+
export { default as HtmlInput } from './HtmlInput/HtmlInput';
|
|
22
|
+
export { default as DottedLine } from './DottedLine/DottedLine';
|
|
23
|
+
export { default as Icon } from './Icon/Icon';
|
|
24
|
+
export { default as Input } from './Input/Input';
|
|
25
|
+
export { default as RenderHtml } from './RenderHtml/RenderHtml';
|
|
26
|
+
export { default as Screen } from './Screen/Screen';
|
|
27
|
+
export { default as ScrollView } from './ScrollView/ScrollView';
|
|
28
|
+
export { default as Switch } from './Switch/Switch';
|
|
29
|
+
export { default as Text } from './Text/Text';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/atoms/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 * from './atoms';
|
|
19
|
+
export * from './molecules';
|
|
20
|
+
export * from './organisms';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface AttachmentCardProps {
|
|
2
|
+
fileName: string;
|
|
3
|
+
creationDate: string;
|
|
4
|
+
onPress: () => void;
|
|
5
|
+
translator: (translationKey: string) => string;
|
|
6
|
+
}
|
|
7
|
+
declare const AttachmentCard: ({ fileName, creationDate, onPress, translator, }: AttachmentCardProps) => JSX.Element;
|
|
8
|
+
export default AttachmentCard;
|
|
@@ -0,0 +1,61 @@
|
|
|
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, TouchableOpacity, View } from 'react-native';
|
|
20
|
+
import File from '../../../types/file';
|
|
21
|
+
import { formatDate } from '../../../utils/formatters';
|
|
22
|
+
import { HorizontalRule, Icon, Text } from '../../atoms';
|
|
23
|
+
const AttachmentCard = ({ fileName, creationDate, onPress, translator, }) => {
|
|
24
|
+
return (<TouchableOpacity onPress={onPress} activeOpacity={0.8}>
|
|
25
|
+
<View style={styles.container}>
|
|
26
|
+
<Icon name={File.getFileIcon(fileName)} size={35}/>
|
|
27
|
+
<View style={styles.textContainer}>
|
|
28
|
+
<Text style={styles.text}>{fileName}</Text>
|
|
29
|
+
{creationDate && (<Text style={styles.text}>
|
|
30
|
+
{`${translator != null ? translator('Base_AddedOn') : 'Added on'} : ${formatDate(creationDate, translator != null
|
|
31
|
+
? translator('Base_DateFormat')
|
|
32
|
+
: 'MM/DD/YYYY')}`}
|
|
33
|
+
</Text>)}
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
<HorizontalRule style={styles.bottomLine}/>
|
|
37
|
+
</TouchableOpacity>);
|
|
38
|
+
};
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
marginHorizontal: 16,
|
|
44
|
+
marginTop: 15,
|
|
45
|
+
marginBottom: 5,
|
|
46
|
+
},
|
|
47
|
+
textContainer: {
|
|
48
|
+
flexDirection: 'column',
|
|
49
|
+
marginLeft: '5%',
|
|
50
|
+
},
|
|
51
|
+
text: {
|
|
52
|
+
fontSize: 18,
|
|
53
|
+
},
|
|
54
|
+
bottomLine: {
|
|
55
|
+
marginTop: 10,
|
|
56
|
+
width: '45%',
|
|
57
|
+
alignSelf: 'center',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
export default AttachmentCard;
|
|
61
|
+
//# sourceMappingURL=AttachmentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentCard.js","sourceRoot":"","sources":["../../../../src/components/molecules/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,cAAc,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AASvD,MAAM,cAAc,GAAG,CAAC,EACtB,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,UAAU,GACU,EAAE,EAAE;IACxB,OAAO,CACL,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CACrD;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC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ACZ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Color } from '../../../theme/themes';
|
|
2
|
+
interface BadgeProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
txtStyle?: any;
|
|
5
|
+
title: string | number;
|
|
6
|
+
color: Color;
|
|
7
|
+
numberOfLines?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const Badge: ({ style, txtStyle, title, color, numberOfLines, }: BadgeProps) => JSX.Element;
|
|
10
|
+
export default Badge;
|
|
@@ -0,0 +1,43 @@
|
|
|
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, View } from 'react-native';
|
|
20
|
+
import { Text } from '../../atoms';
|
|
21
|
+
const Badge = ({ style, txtStyle, title, color, numberOfLines = 1, }) => {
|
|
22
|
+
const badgeStyle = useMemo(() => getStyles(color), [color]);
|
|
23
|
+
return (<View style={[badgeStyle.container, style]}>
|
|
24
|
+
<Text style={txtStyle} numberOfLines={numberOfLines} textColor={color?.foreground} fontSize={14}>
|
|
25
|
+
{title}
|
|
26
|
+
</Text>
|
|
27
|
+
</View>);
|
|
28
|
+
};
|
|
29
|
+
const getStyles = color => StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
backgroundColor: color.background_light,
|
|
32
|
+
borderColor: color.background,
|
|
33
|
+
borderWidth: 2,
|
|
34
|
+
borderRadius: 7,
|
|
35
|
+
margin: '1%',
|
|
36
|
+
width: 87,
|
|
37
|
+
height: 22,
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export default Badge;
|
|
43
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/components/molecules/Badge/Badge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAUjC,MAAM,KAAK,GAAG,CAAC,EACb,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,aAAa,GAAG,CAAC,GACN,EAAE,EAAE;IACf,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAE5D,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACzC;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,CAAC,CAChB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,SAAS,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAC7B,QAAQ,CAAC,CAAC,EAAE,CAAC,CACb;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,KAAK,CAAC,EAAE,CACxB,UAAU,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,eAAe,EAAE,KAAK,CAAC,gBAAgB;QACvC,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC;AAEL,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Color } from '../../../theme/themes';
|
|
2
|
+
interface ButtonProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
color?: Color;
|
|
5
|
+
title: string;
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Button: ({ style, color, title, onPress, disabled, }: ButtonProps) => JSX.Element;
|
|
10
|
+
export default Button;
|
|
@@ -0,0 +1,48 @@
|
|
|
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, TouchableOpacity } from 'react-native';
|
|
20
|
+
import { getCommonStyles } from '../../../utils/commons-styles';
|
|
21
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
22
|
+
import { Text } from '../../atoms';
|
|
23
|
+
const Button = ({ style, color, title, onPress = () => { }, disabled = false, }) => {
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
const buttonColor = useMemo(() => (color != null ? color : Colors.primaryColor), [Colors, color]);
|
|
26
|
+
const styles = useMemo(() => {
|
|
27
|
+
return getStyles(buttonColor.background);
|
|
28
|
+
}, [buttonColor]);
|
|
29
|
+
const commonStyles = useMemo(() => {
|
|
30
|
+
return getCommonStyles(Colors);
|
|
31
|
+
}, [Colors]);
|
|
32
|
+
return (<TouchableOpacity style={[styles.colorButton, commonStyles.button, style]} onPress={onPress} disabled={disabled}>
|
|
33
|
+
<Text style={styles.text} fontSize={15} textColor={buttonColor.foreground}>
|
|
34
|
+
{title}
|
|
35
|
+
</Text>
|
|
36
|
+
</TouchableOpacity>);
|
|
37
|
+
};
|
|
38
|
+
const getStyles = backgroundColor => StyleSheet.create({
|
|
39
|
+
colorButton: {
|
|
40
|
+
backgroundColor: backgroundColor,
|
|
41
|
+
},
|
|
42
|
+
text: {
|
|
43
|
+
fontWeight: 'bold',
|
|
44
|
+
textAlign: 'center',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
export default Button;
|
|
48
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/molecules/Button/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OA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CAAC,CAClC;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,eAAe,CAAC,EAAE,CAClC,UAAU,CAAC,MAAM,CAAC;IAChB,WAAW,EAAE;QACX,eAAe,EAAE,eAAe;KACjC;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface CardIconButtonProps {
|
|
2
|
+
style?: any;
|
|
3
|
+
iconName: string;
|
|
4
|
+
iconColor: string;
|
|
5
|
+
onPress: (any: any) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const CardIconButton: ({ style, iconName, iconColor, onPress, }: CardIconButtonProps) => JSX.Element;
|
|
8
|
+
export default CardIconButton;
|
|
@@ -0,0 +1,42 @@
|
|
|
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, TouchableOpacity } from 'react-native';
|
|
20
|
+
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
21
|
+
import { Icon } from '../../atoms';
|
|
22
|
+
const CardIconButton = ({ style, iconName, iconColor, onPress = () => { }, }) => {
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
25
|
+
return (<TouchableOpacity style={[styles.container, style]} onPress={onPress} activeOpacity={0.4}>
|
|
26
|
+
<Icon size={20} name={iconName} color={iconColor}/>
|
|
27
|
+
</TouchableOpacity>);
|
|
28
|
+
};
|
|
29
|
+
const getStyles = Colors => StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
height: '100%',
|
|
32
|
+
width: '90%',
|
|
33
|
+
borderRadius: 8,
|
|
34
|
+
alignSelf: 'center',
|
|
35
|
+
elevation: 0,
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
backgroundColor: Colors.backgroundColor,
|
|
38
|
+
margin: 2,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
export default CardIconButton;
|
|
42
|
+
//# sourceMappingURL=CardIconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardIconButton.js","sourceRoot":"","sources":["../../../../src/components/molecules/CardIconButton/CardIconButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AASjC,MAAM,cAAc,GAAG,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,GACE,EAAE,EAAE;IACxB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,M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