@wavemaker/app-rn-runtime 11.4.0-next.1417031 → 11.4.0-next.1417033
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.
- app-rn-runtime/components/basic/custom/custom.component.js +25 -0
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.props.js +16 -0
- app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
- app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
- app-rn-runtime/components/basic/spinner/spinner.component.js +9 -9
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/package.json +4 -3
- app-rn-runtime/runtime/App.js +4 -1
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
- app-rn-runtime/styles/style-prop.validator.js +30 -5
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/theme.js +1 -1
- app-rn-runtime/styles/theme.js.map +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
3
|
+
import WmCustomProps from './custom.props';
|
|
4
|
+
import { DEFAULT_CLASS } from './custom.styles';
|
|
5
|
+
import { View } from 'react-native';
|
|
6
|
+
import { createSkeleton } from '../skeleton/skeleton.component';
|
|
7
|
+
export class WmCustomState extends BaseComponentState {}
|
|
8
|
+
export default class WmCustom extends BaseComponent {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props, DEFAULT_CLASS, new WmCustomProps(), new WmCustomState());
|
|
11
|
+
}
|
|
12
|
+
renderSkeleton(prop) {
|
|
13
|
+
return createSkeleton(this.theme, this.styles.skeleton, {
|
|
14
|
+
...this.styles.root,
|
|
15
|
+
width: this.props.skeletonwidth || this.styles.root.width,
|
|
16
|
+
height: this.props.skeletonheight || this.styles.root.height
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
renderWidget(props) {
|
|
20
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
style: this.styles.root
|
|
22
|
+
}, props.renderview(props));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=custom.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","BaseComponent","BaseComponentState","WmCustomProps","DEFAULT_CLASS","View","createSkeleton","WmCustomState","WmCustom","constructor","props","renderSkeleton","prop","theme","styles","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","renderview"],"sources":["custom.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCustomProps from './custom.props';\nimport { DEFAULT_CLASS, WmCustomStyles } from './custom.styles';\nimport { Text, View } from 'react-native';\nimport { createSkeleton } from '../skeleton/skeleton.component';\n\n\nexport class WmCustomState extends BaseComponentState<WmCustomProps> { }\n\nexport default class WmCustom extends BaseComponent<WmCustomProps, WmCustomState, WmCustomStyles> {\n\n constructor(props: WmCustomProps) {\n super(props, DEFAULT_CLASS, new WmCustomProps(), new WmCustomState());\n }\n\n public renderSkeleton(prop: WmCustomProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: this.props.skeletonwidth || this.styles.root.width,\n height: this.props.skeletonheight || this.styles.root.height\n });\n }\n\n renderWidget(props: WmCustomProps) {\n return (\n <View style={this.styles.root}>\n {props.renderview(props)}\n </View>\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAAeC,IAAI,QAAQ,cAAc;AACzC,SAASC,cAAc,QAAQ,gCAAgC;AAG/D,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;AAErE,eAAe,MAAMM,QAAQ,SAASP,aAAa,CAA+C;EAEhGQ,WAAW,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,aAAa,EAAE,EAAE,IAAII,aAAa,EAAE,CAAC;EACvE;EAEOI,cAAc,CAACC,IAAmB,EAAE;IACzC,OAAON,cAAc,CAAC,IAAI,CAACO,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,QAAQ,EAAE;MACtD,GAAG,IAAI,CAACD,MAAM,CAACE,IAAI;MACnBC,KAAK,EAAE,IAAI,CAACP,KAAK,CAACQ,aAAa,IAAI,IAAI,CAACJ,MAAM,CAACE,IAAI,CAACC,KAAK;MACzDE,MAAM,EAAE,IAAI,CAACT,KAAK,CAACU,cAAc,IAAI,IAAI,CAACN,MAAM,CAACE,IAAI,CAACG;IACxD,CAAC,CAAC;EACJ;EAEAE,YAAY,CAACX,KAAoB,EAAE;IACjC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACI,MAAM,CAACE;IAAK,GAC3BN,KAAK,CAACY,UAAU,CAACZ,KAAK,CAAC,CACnB;EAEX;AACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
5
|
+
export default class WmCustomProps extends BaseProps {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
_defineProperty(this, "renderview", () => {
|
|
9
|
+
return null;
|
|
10
|
+
});
|
|
11
|
+
_defineProperty(this, "children", null);
|
|
12
|
+
_defineProperty(this, "skeletonheight", null);
|
|
13
|
+
_defineProperty(this, "skeletonwidth", null);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=custom.props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BaseProps","WmCustomProps"],"sources":["custom.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmCustomProps extends BaseProps {\n renderview:Function = () => {return null};\n children? = null as any;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAA;IAAA;IAAA,oCAC3B,MAAM;MAAC,OAAO,IAAI;IAAA,CAAC;IAAA,kCAC7B,IAAI;IAAA,wCACU,IAAI;IAAA,uCACL,IAAI;EAAA;AACjC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';
|
|
2
|
+
import { defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
3
|
+
export const DEFAULT_CLASS = 'app-custom';
|
|
4
|
+
BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
5
|
+
const defaultStyles = defineStyles({
|
|
6
|
+
root: {},
|
|
7
|
+
text: {},
|
|
8
|
+
skeleton: {
|
|
9
|
+
root: {
|
|
10
|
+
width: 96,
|
|
11
|
+
height: 48,
|
|
12
|
+
borderRadius: 4
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=custom.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","skeleton","width","height","borderRadius"],"sources":["custom.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../skeleton/skeleton.styles';\n\n\nexport type WmCustomStyles = BaseStyles & {\n skeleton: WmSkeletonStyles;\n}\n\nexport const DEFAULT_CLASS = 'app-custom';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmCustomStyles>({\n root: {},\n text: {},\n skeleton: {\n root: {\n width: 96,\n height: 48,\n borderRadius: 4\n }\n } as WmSkeletonStyles\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAQxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAGL,YAAY,CAAiB;IAC/CM,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACNF,IAAI,EAAE;QACJG,KAAK,EAAE,EAAE;QACTC,MAAM,EAAE,EAAE;QACVC,YAAY,EAAE;MAChB;IACF;EACN,CAAC,CAAC;EACFP,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import axios from 'axios';
|
|
6
|
+
import { Platform, View } from 'react-native';
|
|
7
|
+
import LottieView from 'lottie-react-native';
|
|
8
|
+
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
9
|
+
import WmLottieProps from './lottie.props';
|
|
10
|
+
import { DEFAULT_CLASS } from './lottie.styles';
|
|
11
|
+
export class WmLottieState extends BaseComponentState {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
_defineProperty(this, "animationData", void 0);
|
|
15
|
+
_defineProperty(this, "isCompleted", false);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export default class WmLottie extends BaseComponent {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props, DEFAULT_CLASS, new WmLottieProps(), new WmLottieState());
|
|
21
|
+
_defineProperty(this, "lottie", /*#__PURE__*/React.createRef());
|
|
22
|
+
}
|
|
23
|
+
play() {
|
|
24
|
+
if (this.lottie.current) {
|
|
25
|
+
if (this.state.isCompleted) {
|
|
26
|
+
this.reset();
|
|
27
|
+
} else {
|
|
28
|
+
this.lottie.current.play();
|
|
29
|
+
this.invokeEventCallback('onPlay', [null, this.proxy]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
pause() {
|
|
34
|
+
if (this.lottie.current) {
|
|
35
|
+
this.lottie.current.pause();
|
|
36
|
+
this.invokeEventCallback('onPause', [null, this.proxy]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
reset() {
|
|
40
|
+
if (this.lottie.current) {
|
|
41
|
+
if (this.lottie.current.reset) {
|
|
42
|
+
this.lottie.current.reset();
|
|
43
|
+
this.lottie.current.play();
|
|
44
|
+
} else if (this.lottie.current.goToAndPlay) {
|
|
45
|
+
this.lottie.current.goToAndPlay(0);
|
|
46
|
+
} else {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.invokeEventCallback('onPlay', [null, this.proxy]);
|
|
50
|
+
this.updateState({
|
|
51
|
+
isCompleted: false
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
onReady() {
|
|
56
|
+
this.invokeEventCallback('onReady', [null, this.proxy]);
|
|
57
|
+
if (this.state.props.autoplay) {
|
|
58
|
+
this.invokeEventCallback('onPlay', [null, this.proxy]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
loadAnimationData() {
|
|
62
|
+
if (this.state.animationData || !this.loadAsset) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (Platform.OS == 'web') {
|
|
66
|
+
const url = this.loadAsset(this.state.props.source);
|
|
67
|
+
axios.get(url).then(_ref => {
|
|
68
|
+
let {
|
|
69
|
+
data
|
|
70
|
+
} = _ref;
|
|
71
|
+
this.updateState({
|
|
72
|
+
animationData: data
|
|
73
|
+
}, () => this.onReady());
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
this.updateState({
|
|
77
|
+
animationData: this.loadAsset(this.state.props.source)
|
|
78
|
+
}, () => this.onReady());
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
onPropertyChange(name, $new, $old) {
|
|
82
|
+
super.onPropertyChange(name, $new, $old);
|
|
83
|
+
switch (name) {
|
|
84
|
+
case 'src':
|
|
85
|
+
this.loadAnimationData();
|
|
86
|
+
break;
|
|
87
|
+
case 'loop':
|
|
88
|
+
if (this.initialized && !this.state.isCompleted && ($new || this.state.props.autoplay)) {
|
|
89
|
+
setTimeout(() => this.reset(), 200);
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
componentDidMount() {
|
|
95
|
+
super.componentDidMount();
|
|
96
|
+
this.loadAnimationData();
|
|
97
|
+
}
|
|
98
|
+
renderWebLottie(props) {
|
|
99
|
+
const Lottie = require('react-lottie-player');
|
|
100
|
+
return /*#__PURE__*/React.createElement(Lottie, {
|
|
101
|
+
animationData: this.state.animationData,
|
|
102
|
+
ref: this.lottie,
|
|
103
|
+
loop: props.loop,
|
|
104
|
+
play: props.autoplay,
|
|
105
|
+
speed: props.speed,
|
|
106
|
+
style: this.styles.lottie,
|
|
107
|
+
onComplete: () => {
|
|
108
|
+
this.updateState({
|
|
109
|
+
isCompleted: true
|
|
110
|
+
});
|
|
111
|
+
this.invokeEventCallback('onComplete', [null, this.proxy]);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
renderNativeLottie(props) {
|
|
116
|
+
return /*#__PURE__*/React.createElement(LottieView, {
|
|
117
|
+
source: this.state.animationData,
|
|
118
|
+
ref: this.lottie,
|
|
119
|
+
autoPlay: props.autoplay,
|
|
120
|
+
speed: props.speed,
|
|
121
|
+
loop: props.loop,
|
|
122
|
+
style: this.styles.lottie,
|
|
123
|
+
onAnimationFinish: () => {
|
|
124
|
+
this.updateState({
|
|
125
|
+
isCompleted: true
|
|
126
|
+
});
|
|
127
|
+
this.invokeEventCallback('onComplete', [null, this.proxy]);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
renderWidget(props) {
|
|
132
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
133
|
+
style: this.styles.root
|
|
134
|
+
}, this._background, this.state.animationData ? Platform.OS == 'web' ? this.renderWebLottie(props) : this.renderNativeLottie(props) : null);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=lottie.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","axios","Platform","View","LottieView","BaseComponent","BaseComponentState","WmLottieProps","DEFAULT_CLASS","WmLottieState","WmLottie","constructor","props","createRef","play","lottie","current","state","isCompleted","reset","invokeEventCallback","proxy","pause","goToAndPlay","updateState","onReady","autoplay","loadAnimationData","animationData","loadAsset","OS","url","source","get","then","data","onPropertyChange","name","$new","$old","initialized","setTimeout","componentDidMount","renderWebLottie","Lottie","require","loop","speed","styles","renderNativeLottie","renderWidget","root","_background"],"sources":["lottie.component.tsx"],"sourcesContent":["import React from 'react';\nimport axios from 'axios';\nimport { Platform, View } from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmLottieProps from './lottie.props';\nimport { DEFAULT_CLASS, WmLottieStyles } from './lottie.styles';\n\nexport class WmLottieState extends BaseComponentState<WmLottieProps> {\n animationData: any;\n isCompleted = false;\n}\n\nexport default class WmLottie extends BaseComponent<WmLottieProps, WmLottieState, WmLottieStyles> {\n\n private lottie = React.createRef<LottieView>();\n\n constructor(props: WmLottieProps) {\n super(props, DEFAULT_CLASS, new WmLottieProps(), new WmLottieState());\n }\n \n play() {\n if (this.lottie.current) {\n if (this.state.isCompleted) {\n this.reset();\n } else {\n this.lottie.current.play();\n this.invokeEventCallback('onPlay', [null, this.proxy]);\n }\n }\n }\n\n pause() {\n if (this.lottie.current) {\n this.lottie.current.pause();\n this.invokeEventCallback('onPause', [null, this.proxy]);\n }\n }\n\n reset() {\n if (this.lottie.current) {\n if (this.lottie.current.reset) {\n this.lottie.current.reset();\n this.lottie.current.play();\n } else if((this.lottie.current as any).goToAndPlay) {\n (this.lottie.current as any).goToAndPlay(0);\n } else {\n return;\n }\n this.invokeEventCallback('onPlay', [null, this.proxy]);\n this.updateState({\n isCompleted: false\n } as WmLottieState);\n }\n \n }\n\n private onReady() {\n this.invokeEventCallback('onReady', [null, this.proxy]);\n if (this.state.props.autoplay) {\n this.invokeEventCallback('onPlay', [null, this.proxy]);\n }\n }\n\n private loadAnimationData() {\n if (this.state.animationData || ! this.loadAsset) {\n return;\n }\n if (Platform.OS == 'web') {\n const url = this.loadAsset(this.state.props.source) as string;\n axios.get(url).then(({data}) => {\n this.updateState({\n animationData: data\n } as WmLottieState, () => this.onReady());\n });\n } else {\n this.updateState({\n animationData: this.loadAsset(this.state.props.source)\n } as WmLottieState, () => this.onReady());\n }\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'src':\n this.loadAnimationData();\n break;\n case 'loop':\n if (this.initialized && \n !this.state.isCompleted && \n ($new || this.state.props.autoplay)) {\n setTimeout(() => this.reset(), 200);\n }\n break;\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.loadAnimationData();\n }\n\n private renderWebLottie(props: WmLottieProps) {\n const Lottie = require('react-lottie-player');\n return (<Lottie \n animationData={this.state.animationData}\n ref= {this.lottie}\n loop={props.loop}\n play={props.autoplay}\n speed={props.speed}\n style={this.styles.lottie}\n onComplete={() => {\n this.updateState({\n isCompleted: true\n } as WmLottieState);\n this.invokeEventCallback('onComplete', [null, this.proxy]);\n }}/>);\n }\n\n private renderNativeLottie(props: WmLottieProps) {\n return (\n <LottieView\n source={this.state.animationData}\n ref= {this.lottie}\n autoPlay={props.autoplay}\n speed={props.speed}\n loop={props.loop}\n style={this.styles.lottie} \n onAnimationFinish={() => {\n this.updateState({\n isCompleted: true\n } as WmLottieState);\n this.invokeEventCallback('onComplete', [null, this.proxy]);\n }}\n />\n );\n }\n\n renderWidget(props: WmLottieProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {this.state.animationData ? \n (Platform.OS == 'web' ? this.renderWebLottie(props) : this.renderNativeLottie(props)) \n : null \n }\n </View>); \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASH,kBAAkB,CAAgB;EAAA;IAAA;IAAA;IAAA,qCAErD,KAAK;EAAA;AACrB;AAEA,eAAe,MAAMI,QAAQ,SAASL,aAAa,CAA+C;EAIhGM,WAAW,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,aAAa,EAAE,EAAE,IAAIE,aAAa,EAAE,CAAC;IAAC,6CAHvDT,KAAK,CAACa,SAAS,EAAc;EAI9C;EAEAC,IAAI,GAAG;IACL,IAAI,IAAI,CAACC,MAAM,CAACC,OAAO,EAAE;MACvB,IAAI,IAAI,CAACC,KAAK,CAACC,WAAW,EAAE;QAC1B,IAAI,CAACC,KAAK,EAAE;MACd,CAAC,MAAM;QACL,IAAI,CAACJ,MAAM,CAACC,OAAO,CAACF,IAAI,EAAE;QAC1B,IAAI,CAACM,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,CAAC,CAAC;MACxD;IACF;EACF;EAEAC,KAAK,GAAG;IACN,IAAI,IAAI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AAK,CAAC,GACnF,IAAI,CAEH;EACX;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
5
|
+
export default class WmLottieProps extends BaseProps {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
_defineProperty(this, "speed", 1);
|
|
9
|
+
_defineProperty(this, "autoplay", false);
|
|
10
|
+
_defineProperty(this, "loop", false);
|
|
11
|
+
_defineProperty(this, "source", '');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=lottie.props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BaseProps","WmLottieProps"],"sources":["lottie.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmLottieProps extends BaseProps {\n speed = 1;\n autoplay = false;\n loop = false;\n source: string = '';\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAA;IAAA;IAAA,+BAC1C,CAAC;IAAA,kCACC,KAAK;IAAA,8BACT,KAAK;IAAA,gCACK,EAAE;EAAA;AACrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';
|
|
2
|
+
import { defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
3
|
+
export const DEFAULT_CLASS = 'app-lottie';
|
|
4
|
+
BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
5
|
+
const defaultStyles = defineStyles({
|
|
6
|
+
root: {},
|
|
7
|
+
text: {}
|
|
8
|
+
});
|
|
9
|
+
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=lottie.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text"],"sources":["lottie.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmLottieStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-lottie';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmLottieStyles>({\n root: {},\n text: {}\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAGL,YAAY,CAAiB;IAC/CM,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EACFH,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Text, View, Platform } from 'react-native';
|
|
6
|
+
import Color from "color";
|
|
6
7
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
7
8
|
import WmSpinnerProps from './spinner.props';
|
|
8
9
|
import { DEFAULT_CLASS } from './spinner.styles';
|
|
@@ -10,20 +11,19 @@ import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.compone
|
|
|
10
11
|
import WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';
|
|
11
12
|
import LottieView from 'lottie-react-native';
|
|
12
13
|
import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
|
|
13
|
-
import Color from "color";
|
|
14
14
|
export class WmSpinnerState extends BaseComponentState {}
|
|
15
15
|
export default class WmSpinner extends BaseComponent {
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props, DEFAULT_CLASS, new WmSpinnerProps());
|
|
18
18
|
_defineProperty(this, "recursiveSearch", (obj, colors) => {
|
|
19
|
-
Object.keys(obj).forEach(key => {
|
|
19
|
+
obj && Object.keys(obj).forEach(key => {
|
|
20
20
|
let value = obj[key];
|
|
21
21
|
let ind = Math.floor(Math.random() * (0 - colors.length) + colors.length);
|
|
22
22
|
if (key == "nm" && (value.toLowerCase().includes('fill ') || value.toLowerCase().includes('stroke '))) {
|
|
23
|
-
if (obj["c"]["k"].length == 4 || obj["c"]["k"].length == 3 && typeof obj["c"]["k"][0] == 'number') {
|
|
23
|
+
if (obj["c"] && obj["c"]["k"] && (obj["c"]["k"].length == 4 || obj["c"]["k"].length == 3 && typeof obj["c"]["k"][0] == 'number')) {
|
|
24
24
|
obj["c"]["k"] = colors[ind];
|
|
25
25
|
} else {
|
|
26
|
-
if (obj["c"]["k"]) {
|
|
26
|
+
if (obj["c"] && obj["c"]["k"]) {
|
|
27
27
|
for (let shape in obj["c"]["k"]) {
|
|
28
28
|
if (obj["c"]["k"][shape] && obj["c"]["k"][shape]["s"]) {
|
|
29
29
|
obj["c"]["k"][shape]["s"] = colors[ind];
|
|
@@ -51,13 +51,12 @@ export default class WmSpinner extends BaseComponent {
|
|
|
51
51
|
picturesource: props.image
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return result ? [parseInt(result[1], 16) / 255, parseInt(result[2], 16) / 255, parseInt(result[3], 16) / 255, 1] : null;
|
|
54
|
+
toRgbArray(color) {
|
|
55
|
+
return [color.red() / 255, color.green() / 255, color.blue() / 255, 1];
|
|
57
56
|
}
|
|
58
57
|
addClasstoLottie(lottiePath) {
|
|
59
|
-
let primaryColor = ThemeVariables.INSTANCE.primaryColor;
|
|
60
|
-
let colors = [this.
|
|
58
|
+
let primaryColor = Color(ThemeVariables.INSTANCE.primaryColor);
|
|
59
|
+
let colors = [this.toRgbArray(primaryColor), this.toRgbArray(primaryColor.darken(0.2)), this.toRgbArray(primaryColor.darken(0.4)), this.toRgbArray(primaryColor.darken(0.6)), this.toRgbArray(primaryColor.darken(0.8))];
|
|
61
60
|
return this.recursiveSearch(lottiePath.json, lottiePath.loader == 'circleSpinner' ? [colors[0]] : colors);
|
|
62
61
|
}
|
|
63
62
|
prepareLottie(props) {
|
|
@@ -69,6 +68,7 @@ export default class WmSpinner extends BaseComponent {
|
|
|
69
68
|
style: this.styles.lottie
|
|
70
69
|
}) : /*#__PURE__*/React.createElement(LottieView, {
|
|
71
70
|
source: this.addClasstoLottie(props.lottie),
|
|
71
|
+
resizeMode: "contain",
|
|
72
72
|
autoPlay: true,
|
|
73
73
|
loop: true,
|
|
74
74
|
style: this.styles.lottie
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Platform","BaseComponent","BaseComponentState","WmSpinnerProps","DEFAULT_CLASS","WmIcon","WmPicture","LottieView","ThemeVariables","
|
|
1
|
+
{"version":3,"names":["React","Text","View","Platform","Color","BaseComponent","BaseComponentState","WmSpinnerProps","DEFAULT_CLASS","WmIcon","WmPicture","LottieView","ThemeVariables","WmSpinnerState","WmSpinner","constructor","props","obj","colors","Object","keys","forEach","key","value","ind","Math","floor","random","length","toLowerCase","includes","shape","recursiveSearch","prepareIcon","styles","icon","iconclass","iconsize","prepareImage","image","toRgbArray","color","red","green","blue","addClasstoLottie","lottiePath","primaryColor","INSTANCE","darken","json","loader","prepareLottie","Lottie","OS","require","lottie","renderWidget","root","_background","caption","text"],"sources":["spinner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, Platform } from 'react-native';\nimport Color from \"color\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmSpinnerProps from './spinner.props';\nimport { DEFAULT_CLASS, WmSpinnerStyles } from './spinner.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\nimport LottieView from 'lottie-react-native';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class WmSpinnerState extends BaseComponentState<WmSpinnerProps> {\n\n}\n\nexport default class WmSpinner extends BaseComponent<WmSpinnerProps, WmSpinnerState, WmSpinnerStyles> {\n\n constructor(props: WmSpinnerProps) {\n super(props, DEFAULT_CLASS, new WmSpinnerProps());\n }\n\n private prepareIcon(props: any) {\n return (<WmIcon\n styles={this.styles.icon}\n iconclass={props.iconclass + ' fa-spin'} iconsize={props.iconsize}></WmIcon>);\n }\n\n private prepareImage(props: any) {\n return (<WmPicture\n styles={this.styles.image}\n picturesource={props.image}></WmPicture>);\n }\n\n private recursiveSearch = (obj: any, colors: any) => {\n obj && Object.keys(obj).forEach(key => {\n let value = obj[key];\n let ind = Math.floor(Math.random() * (0 - colors.length ) + colors.length);\n if (key == \"nm\" && (value.toLowerCase().includes('fill ') || value.toLowerCase().includes('stroke '))) {\n if (obj[\"c\"] && obj[\"c\"][\"k\"] \n && (obj[\"c\"][\"k\"].length == 4\n || (obj[\"c\"][\"k\"].length ==3 \n && typeof obj[\"c\"][\"k\"][0] == 'number'))) {\n obj[\"c\"][\"k\"] = colors[ind];\n }\n else {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]){\n for (let shape in obj[\"c\"][\"k\"]) {\n if(obj[\"c\"][\"k\"][shape] && obj[\"c\"][\"k\"][shape][\"s\"]){\n obj[\"c\"][\"k\"][shape][\"s\"] = colors[ind];\n }\n }\n }\n }\n } else if (typeof value === 'object') {\n this.recursiveSearch(value, colors);\n }\n });\n return obj;\n };\n\n private toRgbArray(color: Color) {\n return [\n color.red()/255,\n color.green()/255,\n color.blue()/255,\n 1\n ]\n }\n\n private addClasstoLottie(lottiePath: any) {\n let primaryColor = Color(ThemeVariables.INSTANCE.primaryColor);\n let colors = [this.toRgbArray(primaryColor), \n this.toRgbArray(primaryColor.darken(0.2)), \n this.toRgbArray(primaryColor.darken(0.4)), \n this.toRgbArray(primaryColor.darken(0.6)), \n this.toRgbArray(primaryColor.darken(0.8))];\n return this.recursiveSearch(lottiePath.json, lottiePath.loader == 'circleSpinner' ? [colors[0]] : colors);\n }\n\n private prepareLottie(props: any) {\n const Lottie = Platform.OS == 'web' ? require('react-lottie-player') : null;\n return (\n Platform.OS == 'web' ? <Lottie animationData={this.addClasstoLottie(props.lottie)} loop={true} play={true} style={this.styles.lottie} /> : <LottieView\n source={this.addClasstoLottie(props.lottie)}\n resizeMode='contain'\n autoPlay={true}\n loop={true}\n style={this.styles.lottie}\n />\n )\n }\n\n renderWidget(props: WmSpinnerProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {props.lottie ? this.prepareLottie(props) : props.image ? this.prepareImage(props) : this.prepareIcon(props)}\n {props.caption ? <Text style={this.styles.text}>{props.caption}</Text> : null}\n </View>\n );\n }\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MAAC,IAAI,EAAE,IAAK;MAAC,KAAK,EAAE,IAAI,CAACtB,MAAM,CAACsB;IAAO,EAAG,gBAAG,oBAAC,UAAU;MACpJ,MAAM,EAAE,IAAI,CAACX,gBAAgB,CAAC7B,KAAK,CAACwC,MAAM,CAAE;MAC5C,UAAU,EAAC,SAAS;MACpB,QAAQ,EAAE,IAAK;MACf,IAAI,EAAE,IAAK;MACX,KAAK,EAAE,IAAI,CAACtB,MAAM,CAACsB;IAAO,EAC1B;EAEN;EAEAC,YAAY,CAACzC,KAAqB,EAAE;IAClC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACkB,MAAM,CAACwB;IAAK,GAC3B,IAAI,CAACC,WAAW,EAChB3C,KAAK,CAACwC,MAAM,GAAG,IAAI,CAACJ,aAAa,CAACpC,KAAK,CAAC,GAAGA,KAAK,CAACuB,KAAK,GAAG,IAAI,CAACD,YAAY,CAACtB,KAAK,CAAC,GAAG,IAAI,CAACiB,WAAW,CAACjB,KAAK,CAAC,EAC3GA,KAAK,CAAC4C,OAAO,gBAAG,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAAC1B,MAAM,CAAC2B;IAAK,GAAE7C,KAAK,CAAC4C,OAAO,CAAQ,GAAG,IAAI,CACxE;EAEX;AACF"}
|
app-rn-runtime/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.4.0-next.
|
|
3
|
+
"version": "11.4.0-next.1417033",
|
|
4
4
|
"description": "''",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"module": "index",
|
|
@@ -49,11 +49,12 @@
|
|
|
49
49
|
"@react-navigation/native": "^6.0.16",
|
|
50
50
|
"@react-navigation/stack": "^6.3.7",
|
|
51
51
|
"@types/lodash-es": "^4.17.6",
|
|
52
|
-
"@wavemaker/variables": "11.4.0-next.
|
|
52
|
+
"@wavemaker/variables": "11.4.0-next.1417033",
|
|
53
53
|
"axios": "^0.21.1",
|
|
54
54
|
"color": "4.2.3",
|
|
55
55
|
"cross-env": "^5.2.0",
|
|
56
56
|
"css-mediaquery": "^0.1.2",
|
|
57
|
+
"expo-font": "^11.1.1",
|
|
57
58
|
"expo-linear-gradient": "~12.0.1",
|
|
58
59
|
"expo-modules-core": "~1.1.0",
|
|
59
60
|
"fast-xml-parser": "^3.17.6",
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
"typescript": "^4.9.3",
|
|
127
128
|
"victory-native": "^36.5.3",
|
|
128
129
|
"yargs": "^16.2.0",
|
|
129
|
-
"@wavemaker/variables": "11.4.0-next.
|
|
130
|
+
"@wavemaker/variables": "11.4.0-next.1417033"
|
|
130
131
|
},
|
|
131
132
|
"jest": {
|
|
132
133
|
"preset": "react-native",
|
app-rn-runtime/runtime/App.js
CHANGED
|
@@ -107,6 +107,9 @@ export default class BaseApp extends React.Component {
|
|
|
107
107
|
setTimeout(() => SplashScreen.hideAsync(), 10000);
|
|
108
108
|
this.appConfig.app = this;
|
|
109
109
|
this.appConfig.drawer = new DrawerImpl(() => this.refresh());
|
|
110
|
+
AppSpinnerService.setDefaultOptions({
|
|
111
|
+
spinner: this.appConfig.spinner
|
|
112
|
+
});
|
|
110
113
|
let refreshAfterWait = false;
|
|
111
114
|
this.baseUrl = this.appConfig.url;
|
|
112
115
|
let wait = 0;
|
|
@@ -207,7 +210,7 @@ export default class BaseApp extends React.Component {
|
|
|
207
210
|
if (errorDetails && errorDetails.errors) {
|
|
208
211
|
errMsg = parseErrors(errorDetails.errors) || "Service Call Failed";
|
|
209
212
|
} else {
|
|
210
|
-
errMsg =
|
|
213
|
+
errMsg = error.message || "Service Call Failed";
|
|
211
214
|
}
|
|
212
215
|
error.message = errMsg;
|
|
213
216
|
this.onServiceError(error.message, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","axios","Platform","TouchableOpacity","View","StatusBar","ProtoTypes","SafeAreaProvider","SafeAreaInsetsContext","SafeAreaView","DefaultTheme","Provider","PaperProvider","Linking","NativeModulesProxy","WebBrowser","get","last","RENDER_LOGGER","ThemeProvider","StorageService","injector","formatters","deepCopy","isWebPreviewMode","Utils","ModalProvider","FixedViewContainer","ToastProvider","NavigationServiceProvider","PartialProvider","WmNetworkInfoToaster","ThemeVariables","WmMessage","Animatedview","Watcher","preparePatch","AppDisplayManagerService","AppModalService","AppToastService","AppPartialService","AppSpinnerService","AppNavigator","SecurityProvider","CameraProvider","CameraService","ScanProvider","ScanService","AppSecurityService","getValidJSON","parseErrors","MaterialCommunityIconsFont","SplashScreen","WmMemo","style","any","MIN_TIME_BETWEEN_REFRESH_CYCLES","DrawerImpl","constructor","onChange","setContent","content","getContent","setAnimation","animation","getAnimation","SUPPORTED_SERVICES","BaseApp","Component","props","ROOT","refresh","preventAutoHideAsync","setTimeout","hideAsync","appConfig","app","drawer","refreshAfterWait","baseUrl","url","wait","bindServiceInterceptors","complete","reload","debug","forceUpdate","commonPartial","currentPage","watcher","check","goToPage","pageName","params","goBack","openUrl","onBeforeServiceCall","config","headers","console","log","isSkeletonEnabled","spinner","loader","onServiceSuccess","data","response","onServiceError","errorMsg","error","request","invokeNativeApi","key","EmbedCommModule","OS","sendToNative","Promise","reject","onPageReady","activePageName","activePageScope","openBrowser","window","open","startsWith","target","openBrowserAsync","openURL","resolve","axiosInterceptorIds","interceptors","use","errorDetails","errMsg","errors","message","status","eval","fn","failOnError","call","e","componentDidMount","show","all","startUpVariables","map","s","Variables","invoke","catch","then","onAppVariablesReady","isStarted","startUpActions","a","Actions","componentWillUnmount","id","eject","cleanup","forEach","getProviders","renderToasters","toastsOpened","length","watch","refreshCount","o","i","position","width","bottom","elevation","elevationIndex","zIndex","styles","onClick","text","type","renderDialogs","modalsOpened","animatedRefs","modalOptions","name","isModal","hideModal","appModal","centered","centeredModal","modalStyle","ref","animatedRef","appModalContent","contentStyle","evt","stopPropagation","renderDisplayManager","displayOptions","theme","displayViewContainer","renderIconsViewSupportForWeb","getSelectedLocale","selectedLocale","getDependency","serviceName","service","renderApp","autoUpdateVariables","value","invokeOnParamChange","colors","primary","INSTANCE","primaryColor","insets","top","left","right","flex","container","appLocale","alignItems","flexDirection","justifyContent","backgroundColor","height"],"sources":["App.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { Platform, TouchableOpacity, View, ViewStyle, StatusBar } from 'react-native';\nimport ProtoTypes from 'prop-types';\nimport { SafeAreaProvider, SafeAreaInsetsContext, SafeAreaView } from 'react-native-safe-area-context';\nimport { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';\nimport { Linking } from 'react-native';\nimport { NativeModulesProxy } from 'expo-modules-core';\nimport * as WebBrowser from 'expo-web-browser';\nimport { get, last } from 'lodash';\nimport { RENDER_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport AppConfig, { Drawer } from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport NetworkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport formatters from '@wavemaker/app-rn-runtime/core/formatters';\nimport { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport * as Utils from '@wavemaker/app-rn-runtime/core/utils';\nimport { ModalProvider } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { FixedViewContainer } from '@wavemaker/app-rn-runtime/core/fixed-view.component';\nimport { ToastProvider } from '@wavemaker/app-rn-runtime/core/toast.service';\nimport NavigationService, { NavigationServiceProvider } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { PartialProvider } from '@wavemaker/app-rn-runtime/core/partial.service';\nimport WmNetworkInfoToaster from '@wavemaker/app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/message.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\n\nimport { Watcher } from './watcher';\nimport { preparePatch } from './lib-patch';\nimport AppDisplayManagerService from './services/app-display-manager.service';\nimport AppModalService from './services/app-modal.service';\nimport AppToastService from './services/app-toast.service';\nimport AppPartialService from './services/partial.service';\nimport AppSpinnerService from './services/app-spinner.service';\nimport { AppNavigator } from './App.navigator';\nimport { SecurityProvider } from '../core/security.service';\nimport { CameraProvider } from '../core/device/camera-service';\nimport CameraService from './services/device/camera-service';\nimport { ScanProvider } from '../core/device/scan-service';\nimport ScanService from './services/device/scan-service';\nimport AppSecurityService from './services/app-security.service';\nimport {getValidJSON, parseErrors} from '@wavemaker/app-rn-runtime/variables/utils/variable.utils';\nimport MaterialCommunityIconsFont from '@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf';\n\nimport * as SplashScreen from 'expo-splash-screen';\nimport BasePartial from './base-partial.component';\nimport BasePage from './base-page.component';\nimport { WmMemo } from './memo.component';\n\ndeclare const window: any;\n\n//some old react libraries need this\n((View as any)['propTypes'] = { style: ProtoTypes.any})\n\nconst MIN_TIME_BETWEEN_REFRESH_CYCLES = 200;\n\nclass DrawerImpl implements Drawer {\n content: ReactNode;\n animation: string = 'slide-in';\n\n constructor(private onChange: () => void) {\n\n }\n\n setContent(content: ReactNode) {\n this.content = content;\n this.onChange();\n }\n\n getContent() {\n return this.content;\n }\n\n setAnimation(animation: string) {\n this.animation = animation;\n this.onChange();\n }\n\n getAnimation() {\n return this.animation;\n }\n}\nconst SUPPORTED_SERVICES = {\n Utils: Utils,\n StorageService: StorageService,\n AppDisplayManagerService: AppDisplayManagerService\n};\n\nexport default abstract class BaseApp extends React.Component implements NavigationService {\n\n Actions: any = {};\n Variables: any = {};\n onAppVariablesReady = () => {};\n isStarted = false;\n appConfig = injector.get<AppConfig>('APP_CONFIG');\n public baseUrl = '';\n public targetPlatform = 'NATIVE_MOBILE';\n public cleanup = [] as Function[];\n public commonPartial: BasePartial = null as any;\n private startUpVariables: string[] = [];\n private startUpActions: string[] = [];\n private autoUpdateVariables: string[] = [];\n private axiosInterceptorIds: number[] = [];\n public formatters = formatters;\n public serviceDefinitions = {} as any;\n private animatedRef: any;\n public modalsOpened: number = 0;\n public toastsOpened: number = 0;\n public watcher: Watcher = Watcher.ROOT;\n public lib = preparePatch(() => {\n this.refresh();\n });\n\n constructor(props: any) {\n super(props);\n SplashScreen.preventAutoHideAsync();\n setTimeout(() => SplashScreen.hideAsync(), 10000);\n this.appConfig.app = this;\n this.appConfig.drawer = new DrawerImpl(() => this.refresh());\n let refreshAfterWait = false;\n this.baseUrl = this.appConfig.url;\n let wait = 0;\n this.bindServiceInterceptors();\n this.appConfig.refresh = (complete = false) => {\n if (complete) {\n this.reload();\n return;\n }\n if (!wait) {\n RENDER_LOGGER.debug('refreshing the app...');\n wait = MIN_TIME_BETWEEN_REFRESH_CYCLES;\n refreshAfterWait = false;\n setTimeout(() => {\n this.forceUpdate();\n this.commonPartial?.forceUpdate();\n this.appConfig.currentPage?.forceUpdate();\n this.watcher.check();\n });\n setTimeout(() => {\n wait = 0;\n refreshAfterWait && this.appConfig.refresh();\n }, wait);\n } else {\n RENDER_LOGGER.debug('will refresh the app in the next cycle.');\n refreshAfterWait = true;\n }\n }\n }\n\n goToPage(pageName: string, params: any) {\n return this.appConfig.currentPage?.goToPage(pageName, params);\n }\n\n goBack(pageName: string, params: any) {\n return this.appConfig.currentPage?.goBack(pageName, params);\n }\n\n openUrl(url: string, params?: any) {\n return this.appConfig.currentPage?.openUrl(url, params);\n }\n\n onBeforeServiceCall(config: AxiosRequestConfig) {\n if(config.headers) config.headers['X-Requested-With'] = 'XMLHttpRequest';\n console.log('onBeforeService call invoked on ' + config.url);\n return config\n }\n\n isSkeletonEnabled() {\n return this.appConfig.spinner.loader == \"skeleton\";\n }\n\n onServiceSuccess(data: any, response: AxiosResponse) {\n\n }\n\n onServiceError(errorMsg: any, error: AxiosError<any>) {\n console.error(`Error ${errorMsg} recieved from ${error.request.url}`);\n }\n\n invokeNativeApi(key: string, data: Object) {\n if (NativeModulesProxy.EmbedCommModule \n && (Platform.OS === 'android' || Platform.OS === 'ios')) {\n return NativeModulesProxy.EmbedCommModule.sendToNative(key, data || {});\n } else {\n return Promise.reject('Not able to invoke Native API in this platform.');\n }\n }\n\n onPageReady(activePageName: string, activePageScope: BasePage) {\n\n }\n\n get spinner() {\n return AppSpinnerService;\n }\n\n openBrowser(url: string, params = {} as any) {\n if (url) {\n if (isWebPreviewMode()) {\n window.open(url, '_blank');\n } else if (url.startsWith('http') && params.target === '_blank') {\n WebBrowser.openBrowserAsync(url);\n } else {\n return Linking.openURL(url);\n }\n }\n return Promise.resolve();\n }\n\n // To support old api\n reload() {}\n\n bindServiceInterceptors() {\n this.axiosInterceptorIds = [\n axios.interceptors.request.use((config: AxiosRequestConfig) => {\n const url = config.url as string;\n if (!(url.startsWith('http://') || url.startsWith(\"https://\"))) {\n config.url = this.appConfig.url + '/' + url;\n }\n return this.onBeforeServiceCall(config);\n }),\n axios.interceptors.response.use(\n (response: AxiosResponse) => {\n this.onServiceSuccess(response.data, response);\n return response;\n },(error: AxiosError<any>) => {\n let errorDetails: any = error.response, errMsg;\n errorDetails = getValidJSON(errorDetails?.data) || errorDetails?.data;\n if (errorDetails && errorDetails.errors) {\n errMsg = parseErrors(errorDetails.errors) || \"Service Call Failed\";\n } else {\n errMsg = errMsg || \"Service Call Failed\";\n }\n error.message = errMsg;\n this.onServiceError(error.message, error);\n if (error.response?.config.url?.startsWith(this.appConfig.url) && error.response?.status === 401) {\n this.appConfig.currentPage?.pageName !== 'Login' && this.appConfig.currentPage?.goToPage('Login');\n }\n return Promise.reject(error)\n })\n ];\n }\n\n eval(fn: Function, failOnError = false) {\n try {\n return fn.call(this);\n } catch (e) {\n if (failOnError) {\n throw e;\n } else {\n return null;\n }\n }\n }\n\n componentDidMount() {\n AppSpinnerService.show({\n spinner: this.appConfig.spinner\n });\n Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke()))\n .catch(() => {})\n .then(() => {\n this.onAppVariablesReady();\n this.isStarted = true;\n this.forceUpdate();\n }, () => {}).then(() => {\n SplashScreen.hideAsync().then(() => {});\n });\n this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());\n }\n\n componentWillUnmount(): void {\n this.axiosInterceptorIds.map(id => {\n axios.interceptors.request.eject(id);\n });\n this.cleanup.forEach(fn => fn());\n }\n\n refresh() {\n this.appConfig.refresh();\n }\n\n getProviders(content: React.ReactNode) {\n return (\n <NavigationServiceProvider value={this}>\n <ToastProvider value={AppToastService}>\n <PartialProvider value={AppPartialService}>\n <SecurityProvider value={AppSecurityService}>\n <CameraProvider value={CameraService}>\n <ScanProvider value={ScanService}>\n <ModalProvider value={AppModalService}>\n { content }\n </ModalProvider>\n </ScanProvider>\n </CameraProvider>\n </SecurityProvider>\n </PartialProvider>\n </ToastProvider>\n </NavigationServiceProvider>\n );\n }\n\n renderToasters() {\n this.toastsOpened = AppToastService.toastsOpened.length;\n return <WmMemo watcher={this.watcher} render={(watch) => {\n watch(() => AppToastService.refreshCount);\n return (\n <>\n {AppToastService.toastsOpened.map((o, i) =>\n this.getProviders((\n <View key={i} style={[{\n position: 'absolute',\n width: '100%',\n bottom: 0,\n elevation: o.elevationIndex,\n zIndex: o.elevationIndex\n }, o.styles]}>\n <TouchableOpacity onPress={() => o.onClick && o.onClick()}>\n {o.content}\n {o.text && <WmMessage type={o.type} caption={o.text} hideclose={true}></WmMessage>}\n </TouchableOpacity>\n </View>\n )\n ))}\n </>);\n }}/>;\n }\n\n renderDialogs(): ReactNode {\n return <WmMemo watcher={this.watcher} render={(watch) => {\n watch(() => last(AppModalService.modalsOpened)?.content);\n this.modalsOpened = AppModalService.modalsOpened.length;\n AppModalService.animatedRefs.length = 0;\n return(\n <>\n {AppModalService.modalOptions.content &&\n AppModalService.modalsOpened.map((o, i) => {\n return (\n <View key={(o.name || '') + i}\n onStartShouldSetResponder={() => true}\n onResponderEnd={() => o.isModal && AppModalService.hideModal(o)}\n style={deepCopy(styles.appModal,\n o.centered ? styles.centeredModal: null,\n o.modalStyle,\n { elevation: o.elevationIndex,\n zIndex: o.elevationIndex })}>\n <Animatedview entryanimation={o.animation || 'fadeIn'}\n ref={ref => {\n this.animatedRef = ref;\n AppModalService.animatedRefs[i] = ref;\n }}\n style={[styles.appModalContent, o.contentStyle]}>\n <View\n onStartShouldSetResponder={evt => true}\n onResponderEnd={(e) => e.stopPropagation()}\n style={{width: '100%', 'alignItems': 'center'}}>\n {this.getProviders(o.content)}\n </View>\n </Animatedview>\n </View>\n )}\n )\n }\n </>);\n }}/>;\n }\n\n renderDisplayManager(): ReactNode {\n return <WmMemo watcher={this.watcher} render={(watch) => {\n watch(() => AppDisplayManagerService.displayOptions.content);\n return AppDisplayManagerService.displayOptions.content\n ? (\n <ThemeProvider value={this.appConfig.theme}>\n <View style={[styles.displayViewContainer, {\n elevation: this.toastsOpened + this.modalsOpened + 1,\n zIndex: this.toastsOpened + this.modalsOpened + 1\n }]}>\n {AppDisplayManagerService.displayOptions.content}\n </View>\n </ThemeProvider>) : null;\n }}/>\n }\n\n renderIconsViewSupportForWeb() {\n try {\n return (<style type=\"text/css\">{`\n @font-face {\n font-family: 'MaterialCommunityIcons';\n src: url(${MaterialCommunityIconsFont}) format('truetype');\n }\n `}</style>);\n } catch (e) {\n console.log('require react-native-vector-icons could not be loaded.');\n }\n return null;\n }\n\n getSelectedLocale() {\n return this.appConfig.selectedLocale;\n }\n\n getDependency(serviceName: string): any {\n const service = get(SUPPORTED_SERVICES, serviceName);\n if (service) {\n return service;\n }\n }\n\n renderApp(commonPartial:React.ReactNode) {\n this.autoUpdateVariables.forEach(value => this.Variables[value]?.invokeOnParamChange());\n return (\n <SafeAreaProvider>\n <PaperProvider theme={{\n ...DefaultTheme,\n colors: {\n ...DefaultTheme.colors,\n primary: ThemeVariables.INSTANCE.primaryColor\n }}}>\n <React.Fragment>\n {Platform.OS === 'web' ? this.renderIconsViewSupportForWeb() : null}\n <SafeAreaInsetsContext.Consumer>\n {(insets = {top: 0, bottom: 0, left: 0, right: 0}) =>\n (this.getProviders(\n (<SafeAreaView style={{flex: 1}}>\n <StatusBar />\n <FixedViewContainer>\n <View style={styles.container}>\n <AppNavigator\n app={this}\n landingPage={(this.props as any).pageName}\n landingPageParams={(this.props as any)?.pageName && this.props}\n hideDrawer={this.appConfig.drawer?.getContent() === null}\n drawerContent={() => this.appConfig.drawer? this.getProviders(this.appConfig.drawer.getContent()) : null}\n drawerAnimation={this.appConfig.drawer?.getAnimation()}></AppNavigator>\n {commonPartial}\n {this.renderToasters()}\n {this.renderDialogs()}\n {this.renderDisplayManager()}\n </View>\n <WmNetworkInfoToaster appLocale={this.appConfig.appLocale}></WmNetworkInfoToaster>\n </FixedViewContainer>\n </SafeAreaView>))\n )\n }\n </SafeAreaInsetsContext.Consumer>\n </React.Fragment>\n </PaperProvider>\n </SafeAreaProvider>\n );\n }\n}\n\nconst styles = {\n container: {\n flex: 1\n },\n appModal: {\n position: 'absolute',\n width: '100%'\n },\n appModalContent : {\n flex: 1,\n width: '100%',\n alignItems: 'center',\n flexDirection: 'column',\n justifyContent: 'center'\n },\n centeredModal: {\n flex: 1,\n position: 'absolute',\n top: 0,\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n height: '100%'\n },\n displayViewContainer: {\n position: 'absolute',\n justifyContent: 'center',\n width: '100%',\n left: 0,\n right: 0,\n top: 0,\n bottom:0\n } as ViewStyle\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAsB,OAAO;AACzC,OAAOC,KAAK,MAAyD,OAAO;AAC5E,SAASC,QAAQ,EAAEC,gBAAgB,EAAEC,IAAI,EAAaC,SAAS,QAAQ,cAAc;AACrF,OAAOC,U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,CAClB,CAE4B,CAChB,CACH,CACC;EAEvB;AACF;AAEA,MAAM7C,MAAM,GAAG;EACb4C,SAAS,EAAE;IACTD,IAAI,EAAE;EACR,CAAC;EACDhC,QAAQ,EAAE;IACRjB,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDsB,eAAe,EAAG;IAChB0B,IAAI,EAAE,CAAC;IACPhD,KAAK,EAAE,MAAM;IACbmD,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,QAAQ;IACvBC,cAAc,EAAE;EAClB,CAAC;EACDnC,aAAa,EAAE;IACb8B,IAAI,EAAE,CAAC;IACPjD,QAAQ,EAAE,UAAU;IACpB8C,GAAG,EAAE,CAAC;IACNO,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE,QAAQ;IACpBG,eAAe,EAAE,oBAAoB;IACrCC,MAAM,EAAE;EACV,CAAC;EACD1B,oBAAoB,EAAE;IACpB9B,QAAQ,EAAE,UAAU;IACpBsD,cAAc,EAAE,QAAQ;IACxBrD,KAAK,EAAE,MAAM;IACb8C,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRF,GAAG,EAAE,CAAC;IACN5C,MAAM,EAAC;EACT;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["React","axios","Platform","TouchableOpacity","View","StatusBar","ProtoTypes","SafeAreaProvider","SafeAreaInsetsContext","SafeAreaView","DefaultTheme","Provider","PaperProvider","Linking","NativeModulesProxy","WebBrowser","get","last","RENDER_LOGGER","ThemeProvider","StorageService","injector","formatters","deepCopy","isWebPreviewMode","Utils","ModalProvider","FixedViewContainer","ToastProvider","NavigationServiceProvider","PartialProvider","WmNetworkInfoToaster","ThemeVariables","WmMessage","Animatedview","Watcher","preparePatch","AppDisplayManagerService","AppModalService","AppToastService","AppPartialService","AppSpinnerService","AppNavigator","SecurityProvider","CameraProvider","CameraService","ScanProvider","ScanService","AppSecurityService","getValidJSON","parseErrors","MaterialCommunityIconsFont","SplashScreen","WmMemo","style","any","MIN_TIME_BETWEEN_REFRESH_CYCLES","DrawerImpl","constructor","onChange","setContent","content","getContent","setAnimation","animation","getAnimation","SUPPORTED_SERVICES","BaseApp","Component","props","ROOT","refresh","preventAutoHideAsync","setTimeout","hideAsync","appConfig","app","drawer","setDefaultOptions","spinner","refreshAfterWait","baseUrl","url","wait","bindServiceInterceptors","complete","reload","debug","forceUpdate","commonPartial","currentPage","watcher","check","goToPage","pageName","params","goBack","openUrl","onBeforeServiceCall","config","headers","console","log","isSkeletonEnabled","loader","onServiceSuccess","data","response","onServiceError","errorMsg","error","request","invokeNativeApi","key","EmbedCommModule","OS","sendToNative","Promise","reject","onPageReady","activePageName","activePageScope","openBrowser","window","open","startsWith","target","openBrowserAsync","openURL","resolve","axiosInterceptorIds","interceptors","use","errorDetails","errMsg","errors","message","status","eval","fn","failOnError","call","e","componentDidMount","show","all","startUpVariables","map","s","Variables","invoke","catch","then","onAppVariablesReady","isStarted","startUpActions","a","Actions","componentWillUnmount","id","eject","cleanup","forEach","getProviders","renderToasters","toastsOpened","length","watch","refreshCount","o","i","position","width","bottom","elevation","elevationIndex","zIndex","styles","onClick","text","type","renderDialogs","modalsOpened","animatedRefs","modalOptions","name","isModal","hideModal","appModal","centered","centeredModal","modalStyle","ref","animatedRef","appModalContent","contentStyle","evt","stopPropagation","renderDisplayManager","displayOptions","theme","displayViewContainer","renderIconsViewSupportForWeb","getSelectedLocale","selectedLocale","getDependency","serviceName","service","renderApp","autoUpdateVariables","value","invokeOnParamChange","colors","primary","INSTANCE","primaryColor","insets","top","left","right","flex","container","appLocale","alignItems","flexDirection","justifyContent","backgroundColor","height"],"sources":["App.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { Platform, TouchableOpacity, View, ViewStyle, StatusBar } from 'react-native';\nimport ProtoTypes from 'prop-types';\nimport { SafeAreaProvider, SafeAreaInsetsContext, SafeAreaView } from 'react-native-safe-area-context';\nimport { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';\nimport { Linking } from 'react-native';\nimport { NativeModulesProxy } from 'expo-modules-core';\nimport * as WebBrowser from 'expo-web-browser';\nimport { get, last } from 'lodash';\nimport { RENDER_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport AppConfig, { Drawer } from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport NetworkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport formatters from '@wavemaker/app-rn-runtime/core/formatters';\nimport { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport * as Utils from '@wavemaker/app-rn-runtime/core/utils';\nimport { ModalProvider } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { FixedViewContainer } from '@wavemaker/app-rn-runtime/core/fixed-view.component';\nimport { ToastProvider } from '@wavemaker/app-rn-runtime/core/toast.service';\nimport NavigationService, { NavigationServiceProvider } from '@wavemaker/app-rn-runtime/core/navigation.service';\nimport { PartialProvider } from '@wavemaker/app-rn-runtime/core/partial.service';\nimport WmNetworkInfoToaster from '@wavemaker/app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/message.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\n\nimport { Watcher } from './watcher';\nimport { preparePatch } from './lib-patch';\nimport AppDisplayManagerService from './services/app-display-manager.service';\nimport AppModalService from './services/app-modal.service';\nimport AppToastService from './services/app-toast.service';\nimport AppPartialService from './services/partial.service';\nimport AppSpinnerService from './services/app-spinner.service';\nimport { AppNavigator } from './App.navigator';\nimport { SecurityProvider } from '../core/security.service';\nimport { CameraProvider } from '../core/device/camera-service';\nimport CameraService from './services/device/camera-service';\nimport { ScanProvider } from '../core/device/scan-service';\nimport ScanService from './services/device/scan-service';\nimport AppSecurityService from './services/app-security.service';\nimport {getValidJSON, parseErrors} from '@wavemaker/app-rn-runtime/variables/utils/variable.utils';\nimport MaterialCommunityIconsFont from '@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf';\n\nimport * as SplashScreen from 'expo-splash-screen';\nimport BasePartial from './base-partial.component';\nimport BasePage from './base-page.component';\nimport { WmMemo } from './memo.component';\n\ndeclare const window: any;\n\n//some old react libraries need this\n((View as any)['propTypes'] = { style: ProtoTypes.any})\n\nconst MIN_TIME_BETWEEN_REFRESH_CYCLES = 200;\n\nclass DrawerImpl implements Drawer {\n content: ReactNode;\n animation: string = 'slide-in';\n\n constructor(private onChange: () => void) {\n\n }\n\n setContent(content: ReactNode) {\n this.content = content;\n this.onChange();\n }\n\n getContent() {\n return this.content;\n }\n\n setAnimation(animation: string) {\n this.animation = animation;\n this.onChange();\n }\n\n getAnimation() {\n return this.animation;\n }\n}\nconst SUPPORTED_SERVICES = {\n Utils: Utils,\n StorageService: StorageService,\n AppDisplayManagerService: AppDisplayManagerService\n};\n\nexport default abstract class BaseApp extends React.Component implements NavigationService {\n\n Actions: any = {};\n Variables: any = {};\n onAppVariablesReady = () => {};\n isStarted = false;\n appConfig = injector.get<AppConfig>('APP_CONFIG');\n public baseUrl = '';\n public targetPlatform = 'NATIVE_MOBILE';\n public cleanup = [] as Function[];\n public commonPartial: BasePartial = null as any;\n private startUpVariables: string[] = [];\n private startUpActions: string[] = [];\n private autoUpdateVariables: string[] = [];\n private axiosInterceptorIds: number[] = [];\n public formatters = formatters;\n public serviceDefinitions = {} as any;\n private animatedRef: any;\n public modalsOpened: number = 0;\n public toastsOpened: number = 0;\n public watcher: Watcher = Watcher.ROOT;\n public lib = preparePatch(() => {\n this.refresh();\n });\n\n constructor(props: any) {\n super(props);\n SplashScreen.preventAutoHideAsync();\n setTimeout(() => SplashScreen.hideAsync(), 10000);\n this.appConfig.app = this;\n this.appConfig.drawer = new DrawerImpl(() => this.refresh());\n AppSpinnerService.setDefaultOptions({\n spinner: this.appConfig.spinner\n });\n let refreshAfterWait = false;\n this.baseUrl = this.appConfig.url;\n let wait = 0;\n this.bindServiceInterceptors();\n this.appConfig.refresh = (complete = false) => {\n if (complete) {\n this.reload();\n return;\n }\n if (!wait) {\n RENDER_LOGGER.debug('refreshing the app...');\n wait = MIN_TIME_BETWEEN_REFRESH_CYCLES;\n refreshAfterWait = false;\n setTimeout(() => {\n this.forceUpdate();\n this.commonPartial?.forceUpdate();\n this.appConfig.currentPage?.forceUpdate();\n this.watcher.check();\n });\n setTimeout(() => {\n wait = 0;\n refreshAfterWait && this.appConfig.refresh();\n }, wait);\n } else {\n RENDER_LOGGER.debug('will refresh the app in the next cycle.');\n refreshAfterWait = true;\n }\n }\n }\n\n goToPage(pageName: string, params: any) {\n return this.appConfig.currentPage?.goToPage(pageName, params);\n }\n\n goBack(pageName: string, params: any) {\n return this.appConfig.currentPage?.goBack(pageName, params);\n }\n\n openUrl(url: string, params?: any) {\n return this.appConfig.currentPage?.openUrl(url, params);\n }\n\n onBeforeServiceCall(config: AxiosRequestConfig) {\n if(config.headers) config.headers['X-Requested-With'] = 'XMLHttpRequest';\n console.log('onBeforeService call invoked on ' + config.url);\n return config\n }\n\n isSkeletonEnabled() {\n return this.appConfig.spinner.loader == \"skeleton\";\n }\n\n onServiceSuccess(data: any, response: AxiosResponse) {\n\n }\n\n onServiceError(errorMsg: any, error: AxiosError<any>) {\n console.error(`Error ${errorMsg} recieved from ${error.request.url}`);\n }\n\n invokeNativeApi(key: string, data: Object) {\n if (NativeModulesProxy.EmbedCommModule \n && (Platform.OS === 'android' || Platform.OS === 'ios')) {\n return NativeModulesProxy.EmbedCommModule.sendToNative(key, data || {});\n } else {\n return Promise.reject('Not able to invoke Native API in this platform.');\n }\n }\n\n onPageReady(activePageName: string, activePageScope: BasePage) {\n\n }\n\n get spinner() {\n return AppSpinnerService;\n }\n\n openBrowser(url: string, params = {} as any) {\n if (url) {\n if (isWebPreviewMode()) {\n window.open(url, '_blank');\n } else if (url.startsWith('http') && params.target === '_blank') {\n WebBrowser.openBrowserAsync(url);\n } else {\n return Linking.openURL(url);\n }\n }\n return Promise.resolve();\n }\n\n // To support old api\n reload() {}\n\n bindServiceInterceptors() {\n this.axiosInterceptorIds = [\n axios.interceptors.request.use((config: AxiosRequestConfig) => {\n const url = config.url as string;\n if (!(url.startsWith('http://') || url.startsWith(\"https://\"))) {\n config.url = this.appConfig.url + '/' + url;\n }\n return this.onBeforeServiceCall(config);\n }),\n axios.interceptors.response.use(\n (response: AxiosResponse) => {\n this.onServiceSuccess(response.data, response);\n return response;\n },(error: AxiosError<any>) => {\n let errorDetails: any = error.response, errMsg;\n errorDetails = getValidJSON(errorDetails?.data) || errorDetails?.data;\n if (errorDetails && errorDetails.errors) {\n errMsg = parseErrors(errorDetails.errors) || \"Service Call Failed\";\n } else {\n errMsg = error.message || \"Service Call Failed\";\n }\n error.message = errMsg;\n this.onServiceError(error.message, error);\n if (error.response?.config.url?.startsWith(this.appConfig.url) && error.response?.status === 401) {\n this.appConfig.currentPage?.pageName !== 'Login' && this.appConfig.currentPage?.goToPage('Login');\n }\n return Promise.reject(error)\n })\n ];\n }\n\n eval(fn: Function, failOnError = false) {\n try {\n return fn.call(this);\n } catch (e) {\n if (failOnError) {\n throw e;\n } else {\n return null;\n }\n }\n }\n\n componentDidMount() {\n AppSpinnerService.show({\n spinner: this.appConfig.spinner\n });\n Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke()))\n .catch(() => {})\n .then(() => {\n this.onAppVariablesReady();\n this.isStarted = true;\n this.forceUpdate();\n }, () => {}).then(() => {\n SplashScreen.hideAsync().then(() => {});\n });\n this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());\n }\n\n componentWillUnmount(): void {\n this.axiosInterceptorIds.map(id => {\n axios.interceptors.request.eject(id);\n });\n this.cleanup.forEach(fn => fn());\n }\n\n refresh() {\n this.appConfig.refresh();\n }\n\n getProviders(content: React.ReactNode) {\n return (\n <NavigationServiceProvider value={this}>\n <ToastProvider value={AppToastService}>\n <PartialProvider value={AppPartialService}>\n <SecurityProvider value={AppSecurityService}>\n <CameraProvider value={CameraService}>\n <ScanProvider value={ScanService}>\n <ModalProvider value={AppModalService}>\n { content }\n </ModalProvider>\n </ScanProvider>\n </CameraProvider>\n </SecurityProvider>\n </PartialProvider>\n </ToastProvider>\n </NavigationServiceProvider>\n );\n }\n\n renderToasters() {\n this.toastsOpened = AppToastService.toastsOpened.length;\n return <WmMemo watcher={this.watcher} render={(watch) => {\n watch(() => AppToastService.refreshCount);\n return (\n <>\n {AppToastService.toastsOpened.map((o, i) =>\n this.getProviders((\n <View key={i} style={[{\n position: 'absolute',\n width: '100%',\n bottom: 0,\n elevation: o.elevationIndex,\n zIndex: o.elevationIndex\n }, o.styles]}>\n <TouchableOpacity onPress={() => o.onClick && o.onClick()}>\n {o.content}\n {o.text && <WmMessage type={o.type} caption={o.text} hideclose={true}></WmMessage>}\n </TouchableOpacity>\n </View>\n )\n ))}\n </>);\n }}/>;\n }\n\n renderDialogs(): ReactNode {\n return <WmMemo watcher={this.watcher} render={(watch) => {\n watch(() => last(AppModalService.modalsOpened)?.content);\n this.modalsOpened = AppModalService.modalsOpened.length;\n AppModalService.animatedRefs.length = 0;\n return(\n <>\n {AppModalService.modalOptions.content &&\n AppModalService.modalsOpened.map((o, i) => {\n return (\n <View key={(o.name || '') + i}\n onStartShouldSetResponder={() => true}\n onResponderEnd={() => o.isModal && AppModalService.hideModal(o)}\n style={deepCopy(styles.appModal,\n o.centered ? styles.centeredModal: null,\n o.modalStyle,\n { elevation: o.elevationIndex,\n zIndex: o.elevationIndex })}>\n <Animatedview entryanimation={o.animation || 'fadeIn'}\n ref={ref => {\n this.animatedRef = ref;\n AppModalService.animatedRefs[i] = ref;\n }}\n style={[styles.appModalContent, o.contentStyle]}>\n <View\n onStartShouldSetResponder={evt => true}\n onResponderEnd={(e) => e.stopPropagation()}\n style={{width: '100%', 'alignItems': 'center'}}>\n {this.getProviders(o.content)}\n </View>\n </Animatedview>\n </View>\n )}\n )\n }\n </>);\n }}/>;\n }\n\n renderDisplayManager(): ReactNode {\n return <WmMemo watcher={this.watcher} render={(watch) => {\n watch(() => AppDisplayManagerService.displayOptions.content);\n return AppDisplayManagerService.displayOptions.content\n ? (\n <ThemeProvider value={this.appConfig.theme}>\n <View style={[styles.displayViewContainer, {\n elevation: this.toastsOpened + this.modalsOpened + 1,\n zIndex: this.toastsOpened + this.modalsOpened + 1\n }]}>\n {AppDisplayManagerService.displayOptions.content}\n </View>\n </ThemeProvider>) : null;\n }}/>\n }\n\n renderIconsViewSupportForWeb() {\n try {\n return (<style type=\"text/css\">{`\n @font-face {\n font-family: 'MaterialCommunityIcons';\n src: url(${MaterialCommunityIconsFont}) format('truetype');\n }\n `}</style>);\n } catch (e) {\n console.log('require react-native-vector-icons could not be loaded.');\n }\n return null;\n }\n\n getSelectedLocale() {\n return this.appConfig.selectedLocale;\n }\n\n getDependency(serviceName: string): any {\n const service = get(SUPPORTED_SERVICES, serviceName);\n if (service) {\n return service;\n }\n }\n\n renderApp(commonPartial:React.ReactNode) {\n this.autoUpdateVariables.forEach(value => this.Variables[value]?.invokeOnParamChange());\n return (\n <SafeAreaProvider>\n <PaperProvider theme={{\n ...DefaultTheme,\n colors: {\n ...DefaultTheme.colors,\n primary: ThemeVariables.INSTANCE.primaryColor\n }}}>\n <React.Fragment>\n {Platform.OS === 'web' ? this.renderIconsViewSupportForWeb() : null}\n <SafeAreaInsetsContext.Consumer>\n {(insets = {top: 0, bottom: 0, left: 0, right: 0}) =>\n (this.getProviders(\n (<SafeAreaView style={{flex: 1}}>\n <StatusBar />\n <FixedViewContainer>\n <View style={styles.container}>\n <AppNavigator\n app={this}\n landingPage={(this.props as any).pageName}\n landingPageParams={(this.props as any)?.pageName && this.props}\n hideDrawer={this.appConfig.drawer?.getContent() === null}\n drawerContent={() => this.appConfig.drawer? this.getProviders(this.appConfig.drawer.getContent()) : null}\n drawerAnimation={this.appConfig.drawer?.getAnimation()}></AppNavigator>\n {commonPartial}\n {this.renderToasters()}\n {this.renderDialogs()}\n {this.renderDisplayManager()}\n </View>\n <WmNetworkInfoToaster appLocale={this.appConfig.appLocale}></WmNetworkInfoToaster>\n </FixedViewContainer>\n </SafeAreaView>))\n )\n }\n </SafeAreaInsetsContext.Consumer>\n </React.Fragment>\n </PaperProvider>\n </SafeAreaProvider>\n );\n }\n}\n\nconst styles = {\n container: {\n flex: 1\n },\n appModal: {\n position: 'absolute',\n width: '100%'\n },\n appModalContent : {\n flex: 1,\n width: '100%',\n alignItems: 'center',\n flexDirection: 'column',\n justifyContent: 'center'\n },\n centeredModal: {\n flex: 1,\n position: 'absolute',\n top: 0,\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n height: '100%'\n },\n displayViewContainer: {\n position: 'absolute',\n justifyContent: 'center',\n width: '100%',\n left: 0,\n right: 0,\n top: 0,\n bottom:0\n } as ViewStyle\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAsB,OAAO;AACzC,OAAOC,KAAK,MAAyD,OAAO;AAC5E,SAASC,QAAQ,EAAEC,gBAAgB,EAAEC,IAAI,EAAaC,SAAS,QAAQ,cAAc;AACrF,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,gBAAgB,EAAEC,qBAAqB,EAAEC,YAAY,QAAQ,gCAAgC;AACtG,SAASC,YAAY,EAAEC,QAAQ,IAAIC,aAAa,QAAQ,oBAAoB;AAC5E,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,SAASC,GAAG,EAAEC,IAAI,QAAQ,QAAQ;A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AC;EACDsB,eAAe,EAAG;IAChB0B,IAAI,EAAE,CAAC;IACPhD,KAAK,EAAE,MAAM;IACbmD,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,QAAQ;IACvBC,cAAc,EAAE;EAClB,CAAC;EACDnC,aAAa,EAAE;IACb8B,IAAI,EAAE,CAAC;IACPjD,QAAQ,EAAE,UAAU;IACpB8C,GAAG,EAAE,CAAC;IACNO,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE,QAAQ;IACpBG,eAAe,EAAE,oBAAoB;IACrCC,MAAM,EAAE;EACV,CAAC;EACD1B,oBAAoB,EAAE;IACpB9B,QAAQ,EAAE,UAAU;IACpBsD,cAAc,EAAE,QAAQ;IACxBrD,KAAK,EAAE,MAAM;IACb8C,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRF,GAAG,EAAE,CAAC;IACN5C,MAAM,EAAC;EACT;AACF,CAAC"}
|
|
@@ -15,12 +15,16 @@ export class AppSpinnerService {
|
|
|
15
15
|
_defineProperty(this, "count", 0);
|
|
16
16
|
_defineProperty(this, "image", '');
|
|
17
17
|
_defineProperty(this, "skeleton", false);
|
|
18
|
+
_defineProperty(this, "defaultDisplayOptions", {});
|
|
18
19
|
}
|
|
19
20
|
setImage(path) {
|
|
20
21
|
this.image = path;
|
|
21
22
|
}
|
|
23
|
+
setDefaultOptions(options) {
|
|
24
|
+
this.defaultDisplayOptions = options;
|
|
25
|
+
}
|
|
22
26
|
show() {
|
|
23
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
27
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.defaultDisplayOptions;
|
|
24
28
|
this.skeleton = options.spinner.loader == 'skeleton';
|
|
25
29
|
if (this.count === 0 && !this.destroy) {
|
|
26
30
|
setTimeout(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","appDisplayManagerService","WmSpinner","ThemeVariables","AppSpinnerService","constructor","displayManager","setImage","path","image","
|
|
1
|
+
{"version":3,"names":["React","View","appDisplayManagerService","WmSpinner","ThemeVariables","AppSpinnerService","constructor","displayManager","setImage","path","image","setDefaultOptions","options","defaultDisplayOptions","show","skeleton","spinner","loader","count","destroy","setTimeout","content","styles","appSpinnerContainer","message","delay","hide","call","justifyContent","alignItems","width","height","backgroundColor","INSTANCE","primaryContrastColor","opacity","spinnerService"],"sources":["app-spinner.service.tsx"],"sourcesContent":["import React from 'react';\n\nimport { View, ViewStyle } from 'react-native';\n\nimport { SpinnerService, DisplayOptions } from '@wavemaker/app-rn-runtime/core/spinner.service';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\nimport WmSpinner from '@wavemaker/app-rn-runtime/components/basic/spinner/spinner.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class AppSpinnerService implements SpinnerService {\n public displayOptions = {} as DisplayOptions;\n public destroy: any;\n public delay = 0;\n private count = 0;\n private image: string = '';\n public skeleton: boolean = false;\n private defaultDisplayOptions: DisplayOptions = {} as any;\n constructor(private displayManager: DisplayManager) {}\n\n setImage(path: string) {\n this.image = path;\n }\n\n setDefaultOptions(options: DisplayOptions) {\n this.defaultDisplayOptions = options;\n }\n\n show(options: DisplayOptions = this.defaultDisplayOptions) {\n this.skeleton = options.spinner.loader == 'skeleton';\n if (this.count === 0 && !this.destroy) { \n setTimeout(() => {\n const content = (<>\n {!this.skeleton? \n <View style={styles.appSpinnerContainer}>\n <WmSpinner\n caption={options.message || ''}\n classname=\"global-spinner\"\n lottie={options.spinner}></WmSpinner>\n </View> : null}\n </>);\n this.destroy = this.displayManager.show({ content: content });\n }, this.delay);\n }\n this.count++;\n }\n\n hide() {\n this.skeleton = false;\n if (this.count > 0) {\n this.count--;\n } else {\n this.count = 0;\n }\n if (this.count === 0) {\n setTimeout(() => {\n if (!this.count && this.destroy) {\n this.destroy.call(this.displayManager);\n this.destroy = null;\n }\n }, 300);\n }\n }\n}\n\nconst styles = {\n appSpinnerContainer:{ \n justifyContent: 'center', \n alignItems: 'center', \n width:'100%', \n height:'100%', \n backgroundColor: ThemeVariables.INSTANCE.primaryContrastColor, \n opacity: 0.8 \n } as ViewStyle\n}\n\nconst spinnerService = new AppSpinnerService(appDisplayManagerService);\nexport default spinnerService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,IAAI,QAAmB,cAAc;AAI9C,OAAOC,wBAAwB,MAAM,wEAAwE;AAC7G,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,iBAAiB,CAA2B;EAQvDC,WAAW,CAASC,cAA8B,EAAE;IAAA,KAAhCA,cAA8B,GAA9BA,cAA8B;IAAA,wCAP1B,CAAC,CAAC;IAAA;IAAA,+BAEX,CAAC;IAAA,+BACA,CAAC;IAAA,+BACO,EAAE;IAAA,kCACC,KAAK;IAAA,+CACiB,CAAC,CAAC;EACE;EAErDC,QAAQ,CAACC,IAAY,EAAE;IACrB,IAAI,CAACC,KAAK,GAAGD,IAAI;EACnB;EAEAE,iBAAiB,CAACC,OAAuB,EAAE;IACzC,IAAI,CAACC,qBAAqB,GAAGD,OAAO;EACtC;EAEAE,IAAI,GAAuD;IAAA,IAAtDF,OAAuB,uEAAG,IAAI,CAACC,qBAAqB;IACvD,IAAI,CAACE,QAAQ,GAAGH,OAAO,CAACI,OAAO,CAACC,MAAM,IAAI,UAAU;IACpD,IAAI,IAAI,CAACC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAACC,OAAO,EAAE;MACrCC,UAAU,CAAC,MAAM;QACf,MAAMC,OAAO,gBAAI,0CACd,CAAC,IAAI,CAACN,QAAQ,gBACb,oBAAC,IAAI;UAAC,KAAK,EAAEO,MAAM,CAACC;QAAoB,gBACtC,oB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
|
|
25
25
|
if (i < 0) {
|
|
26
|
-
options.elevationIndex =
|
|
26
|
+
options.elevationIndex = this.toastsOpened.length + this.getAppConfig().app.modalsOpened + 1;
|
|
27
27
|
this.toastsOpened.push(options);
|
|
28
28
|
// hide the toast when toaster is clicked
|
|
29
29
|
if (options.hideOnClick) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["injector","AppToastService","getAppConfig","appConfig","get","refresh","refreshCount","showToast","options","i","toastsOpened","findIndex","o","name","timeout","elevationIndex","
|
|
1
|
+
{"version":3,"names":["injector","AppToastService","getAppConfig","appConfig","get","refresh","refreshCount","showToast","options","i","toastsOpened","findIndex","o","name","timeout","elevationIndex","length","app","modalsOpened","push","hideOnClick","cb","onClick","hideToast","clearTimeout","duration","setTimeout","splice","onClose","appToastService"],"sources":["app-toast.service.tsx"],"sourcesContent":["import injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { ToastOptions, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\n\nclass AppToastService implements ToastService {\n\n public toastsOpened = [] as ToastOptions[];\n public appConfig: any;\n public refreshCount = 0;\n\n private getAppConfig() {\n if (!this.appConfig) {\n this.appConfig = injector.get<AppConfig>('APP_CONFIG');\n }\n return this.appConfig;\n }\n \n refresh() {\n this.refreshCount++;\n this.appConfig.refresh();\n }\n\n public showToast(options: ToastOptions) {\n const i = this.toastsOpened.findIndex(o => o.name === options.name);\n let timeout: any;\n this.refreshCount++;\n if (i < 0) {\n options.elevationIndex = this.toastsOpened.length + this.getAppConfig().app.modalsOpened + 1;\n this.toastsOpened.push(options);\n // hide the toast when toaster is clicked\n if (options.hideOnClick) {\n let cb = options.onClick;\n options.onClick = () => {\n cb && cb();\n this.hideToast(options);\n clearTimeout(timeout);\n }\n }\n if (options.duration) {\n timeout = setTimeout(() => {\n this.hideToast(options);\n }, options.duration);\n }\n }\n this.refresh();\n }\n\n public hideToast(options?: ToastOptions) {\n const i = options ? this.toastsOpened.findIndex(o => o.name === options.name) : (this.toastsOpened.length - 1);\n if (i >= 0) {\n const o = this.toastsOpened.splice(i, 1)[0];\n this.refresh();\n options?.onClose && options.onClose();\n }\n }\n}\n\nconst appToastService = new AppToastService();\n\nexport default appToastService;\n"],"mappings":";;;AAAA,OAAOA,QAAQ,MAAM,yCAAyC;AAI9D,MAAMC,eAAe,CAAyB;EAAA;IAAA,sCAEpB,EAAE;IAAA;IAAA,sCAEF,CAAC;EAAA;EAEfC,YAAY,GAAG;IACrB,IAAI,CAAC,IAAI,CAACC,SAAS,EAAE;MACnB,IAAI,CAACA,SAAS,GAAGH,QAAQ,CAACI,GAAG,CAAY,YAAY,CAAC;IACxD;IACA,OAAO,IAAI,CAACD,SAAS;EACvB;EAEAE,OAAO,GAAG;IACR,IAAI,CAACC,YAAY,EAAE;IACnB,IAAI,CAACH,SAAS,CAACE,OAAO,EAAE;EAC1B;EAEOE,SAAS,CAACC,OAAqB,EAAE;IACpC,MAAMC,CAAC,GAAG,IAAI,CAACC,YAAY,CAACC,SAAS,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,KAAKL,OAAO,CAACK,IAAI,CAAC;IACnE,IAAIC,OAAY;IAChB,IAAI,CAACR,YAAY,EAAE;IACnB,IAAIG,CAAC,GAAG,CAAC,EAAE;MACTD,OAAO,CAACO,cAAc,GAAG,IAAI,CAACL,YAAY,CAACM,MAAM,GAAG,IAAI,CAACd,YAAY,EAAE,CAACe,GAAG,CAACC,YAAY,GAAG,CAAC;MAC5F,IAAI,CAACR,YAAY,CAACS,IAAI,CAACX,OAAO,CAAC;MAC7B;MACA,IAAIA,OAAO,CAACY,WAAW,EAAE;QACvB,IAAIC,EAAE,GAAGb,OAAO,CAACc,OAAO;QACxBd,OAAO,CAACc,OAAO,GAAG,MAAM;UACtBD,EAAE,IAAIA,EAAE,EAAE;UACV,IAAI,CAACE,SAAS,CAACf,OAAO,CAAC;UACvBgB,YAAY,CAACV,OAAO,CAAC;QACvB,CAAC;MACH;MACA,IAAIN,OAAO,CAACiB,QAAQ,EAAE;QACpBX,OAAO,GAAGY,UAAU,CAAC,MAAM;UACrB,IAAI,CAACH,SAAS,CAACf,OAAO,CAAC;QAC3B,CAAC,EAAEA,OAAO,CAACiB,QAAQ,CAAC;MACxB;IACJ;IACA,IAAI,CAACpB,OAAO,EAAE;EAClB;EAEOkB,SAAS,CAACf,OAAsB,EAAE;IACrC,MAAMC,CAAC,GAAGD,OAAO,GAAG,IAAI,CAACE,YAAY,CAACC,SAAS,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,KAAKL,OAAO,CAACK,IAAI,CAAC,GAAI,IAAI,CAACH,YAAY,CAACM,MAAM,GAAG,CAAE;IAC9G,IAAIP,CAAC,IAAI,CAAC,EAAE;MACR,MAAMG,CAAC,GAAG,IAAI,CAACF,YAAY,CAACiB,MAAM,CAAClB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;MAC3C,IAAI,CAACJ,OAAO,EAAE;MACd,CAAAG,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEoB,OAAO,KAAIpB,OAAO,CAACoB,OAAO,EAAE;IACzC;EACJ;AACJ;AAEA,MAAMC,eAAe,GAAG,IAAI5B,eAAe,EAAE;AAE7C,eAAe4B,eAAe"}
|
|
@@ -37,6 +37,10 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
37
37
|
isValid: isColor,
|
|
38
38
|
ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'
|
|
39
39
|
},
|
|
40
|
+
backgroundImage: {
|
|
41
|
+
isValid: isString,
|
|
42
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
43
|
+
},
|
|
40
44
|
borderBottomColor: {
|
|
41
45
|
isValid: isColor,
|
|
42
46
|
ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'
|
|
@@ -49,6 +53,18 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
49
53
|
isValid: isNumber,
|
|
50
54
|
ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'
|
|
51
55
|
},
|
|
56
|
+
backgroundPosition: {
|
|
57
|
+
isValid: isStringOrNumber,
|
|
58
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
59
|
+
},
|
|
60
|
+
backgroundRepeat: {
|
|
61
|
+
isValid: isIn('repeat', 'repeat-x', 'repeat-y', 'no-repeat'),
|
|
62
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
63
|
+
},
|
|
64
|
+
backgroundSize: {
|
|
65
|
+
isValid: isStringOrNumber,
|
|
66
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
67
|
+
},
|
|
52
68
|
borderBottomRightRadius: {
|
|
53
69
|
isValid: isNumber,
|
|
54
70
|
ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'
|
|
@@ -90,7 +106,7 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
90
106
|
ref: 'https://reactnative.dev/docs/image-style-props#borderradius'
|
|
91
107
|
},
|
|
92
108
|
borderRightColor: {
|
|
93
|
-
isValid:
|
|
109
|
+
isValid: isColor,
|
|
94
110
|
ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'
|
|
95
111
|
},
|
|
96
112
|
borderRightWidth: {
|
|
@@ -125,6 +141,10 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
125
141
|
isValid: isNumber,
|
|
126
142
|
ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'
|
|
127
143
|
},
|
|
144
|
+
borderTopColor: {
|
|
145
|
+
isValid: isColor,
|
|
146
|
+
ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'
|
|
147
|
+
},
|
|
128
148
|
borderTopWidth: {
|
|
129
149
|
isValid: isNumber,
|
|
130
150
|
ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'
|
|
@@ -429,13 +449,18 @@ export const getStyleReference = name => {
|
|
|
429
449
|
};
|
|
430
450
|
export const isValidStyleProp = (name, value) => {
|
|
431
451
|
const info = STYLE_PROP_TYPE_INFO[name];
|
|
432
|
-
return
|
|
452
|
+
return (name === null || name === void 0 ? void 0 : name.trim().startsWith('__')) || info && info.isValid(value);
|
|
433
453
|
};
|
|
434
454
|
export const getErrorMessage = (name, value) => {
|
|
435
455
|
const info = STYLE_PROP_TYPE_INFO[name];
|
|
436
|
-
|
|
437
|
-
|
|
456
|
+
name = name.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`);
|
|
457
|
+
if (info) {
|
|
458
|
+
if (info.errorMsg) {
|
|
459
|
+
return info.errorMsg(value);
|
|
460
|
+
} else {
|
|
461
|
+
return `'${value}' is not a valid value to '${name}'.`;
|
|
462
|
+
}
|
|
438
463
|
}
|
|
439
|
-
return `'${
|
|
464
|
+
return `'${name}' is not a supported style property in one or all Native Platforms.`;
|
|
440
465
|
};
|
|
441
466
|
//# sourceMappingURL=style-prop.validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isNumber","isString","Font","isColor","c","isStringOrNumber","v","isIn","obj","arr","forEach","k","STYLE_PROP_TYPE_INFO","alignContent","isValid","ref","alignItems","alignSelf","aspectRatio","backfaceVisibility","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderCurve","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","bottom","color","columnGap","direction","display","elevation","end","flex","flexBasis","flexDirection","flexGrow","flexShrink","flexWrap","fontFamily","isLoaded","errorMsg","fontSize","fontStyle","fontVariant","fontWeight","gap","height","justifyContent","left","letterSpacing","lineHeight","margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","opacity","overflow","overlayColor","padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","pointerEvents","position","resizeMode","right","rowGap","shadowColor","shadowOpacity","shadowRadius","start","textAlign","textAlignVertical","textDecorationColor","textDecorationLine","textDecorationStyle","textShadowColor","textShadowRadius","textTransform","tintColor","top","verticalAlign","width","writingDirection","zIndex","getStyleReference","name","info","isValidStyleProp","value","getErrorMessage"],"sources":["style-prop.validator.ts"],"sourcesContent":["import {isNumber, isNil, isString } from 'lodash-es';\nimport * as Font from 'expo-font';\n\nconst isColor = (c: string) => true;\nconst isStringOrNumber = (v: any) => isNumber(v) || isString(v);\nconst isIn = (...arr: any) => {\n const obj = {};\n arr.forEach((v: any) => {\n (obj as any)[v] = true;\n })\n return (k: any) => (obj as any)[k] === true ;\n};\n\nconst STYLE_PROP_TYPE_INFO = {\n alignContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'space-between', 'space-around'),\n ref: 'https://reactnative.dev/docs/layout-props#aligncontent'\n },\n alignItems: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignitems'\n },\n alignSelf: {\n isValid: isIn('auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignself'\n },\n aspectRatio: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#aspectratio'\n },\n backfaceVisibility: {\n isValid: isIn('visible', 'hidden'),\n ref: 'https://reactnative.dev/docs/image-style-props#backfacevisibility'\n },\n backgroundColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'\n },\n borderBottomColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'\n },\n borderBottomEndRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomendradius'\n },\n borderBottomLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'\n },\n borderBottomRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'\n },\n borderBottomStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomstartradius'\n },\n borderBottomWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderbottomwidth'\n },\n borderColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#bordercolor'\n },\n borderCurve: {\n isValid: isIn('circular', 'continuous'),\n ref: 'https://reactnative.dev/docs/view-style-props#bordercurve-ios'\n },\n borderEndColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderendcolor'\n },\n borderEndWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderendwidth'\n },\n borderLeftColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderleftcolor'\n },\n borderLeftWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderleftwidth'\n },\n borderRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderradius'\n },\n borderRightColor: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'\n },\n borderRightWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderrightwidth'\n },\n borderStartColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderstartcolor'\n },\n borderStartWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderstartwidth'\n },\n borderStyle: {\n isValid: isIn('solid', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'\n },\n borderTopEndRadius: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'\n },\n borderTopLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertopleftradius'\n },\n borderTopRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertoprightradius'\n },\n borderTopStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'\n },\n borderTopWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'\n },\n borderWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderwidth'\n },\n bottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bottom'\n },\n color: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#color'\n },\n columnGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#columngap'\n },\n direction: {\n isValid: isIn('inherit', 'LTR', 'RTL'),\n ref: 'https://reactnative.dev/docs/layout-props#direction'\n },\n display: {\n isValid: isIn('none', 'flex'),\n ref: 'https://reactnative.dev/docs/layout-props#display'\n },\n elevation: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#elevation-android'\n },\n end: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#end'\n },\n flex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flex'\n },\n flexBasis: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexbasis'\n },\n flexDirection: {\n isValid: isIn('column', 'row', 'column-reverse', 'row-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexdirection'\n },\n flexGrow: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexgrow'\n },\n flexShrink: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexshrink'\n },\n flexWrap: {\n isValid: isIn('wrap', 'nowrap', 'wrap-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexwrap'\n },\n fontFamily: {\n isValid: (v: string) => Font.isLoaded(v),\n errorMsg: (v: string) => `Font '${v}' is not loaded. Font family names are case-sensitive. Please add font either in theme or app.`,\n ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'\n },\n fontSize: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#fontsize'\n },\n fontStyle: {\n isValid: isIn('normal', 'italic'),\n ref: 'https://reactnative.dev/docs/text-style-props#fontstyle'\n },\n fontVariant: {\n isValid: (v: any) => isIn('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') || isString(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontvariant'\n },\n fontWeight: {\n isValid: (v: any) => isIn('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') || isNumber(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontweight'\n },\n gap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#gap'\n },\n height: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#height'\n },\n justifyContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'),\n ref: 'https://reactnative.dev/docs/layout-props#justifycontent'\n },\n left: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#left'\n },\n letterSpacing: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#letterspacing'\n },\n lineHeight: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#lineheight'\n },\n margin: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margin'\n },\n marginBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginbottom'\n },\n marginEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginend'\n },\n marginHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginhorizontal'\n },\n marginLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginleft'\n },\n marginRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginright'\n },\n marginStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginstart'\n },\n marginTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margintop'\n },\n marginVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginvertical'\n },\n maxHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxheight'\n },\n maxWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxwidth'\n },\n minHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minheight'\n },\n minWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minwidth'\n },\n opacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#opacity'\n },\n overflow: {\n isValid: isIn('visible', 'hidden', 'scroll'),\n ref: 'https://reactnative.dev/docs/image-style-props#overflow'\n },\n overlayColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#overlaycolor-android'\n },\n padding: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#padding'\n },\n paddingBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingbottom'\n },\n paddingEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingend'\n },\n paddingHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddinghorizontal'\n },\n paddingLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingleft'\n },\n paddingRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingright'\n },\n paddingStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingstart'\n },\n paddingTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingtop'\n },\n paddingVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingvertical'\n },\n pointerEvents: {\n isValid: isIn('auto', 'box-none', 'box-only', 'none' ),\n ref: 'https://reactnative.dev/docs/view-style-props#pointerevents'\n },\n position: {\n isValid: isIn('absolute', 'relative', 'fixed'),\n ref: 'https://reactnative.dev/docs/layout-props#position'\n },\n resizeMode: {\n isValid: isIn('cover', 'contain', 'stretch', 'repeat', 'center'),\n ref: 'https://reactnative.dev/docs/image-style-props#resizemode'\n },\n right: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#right'\n },\n rowGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#rowgap'\n },\n shadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowcolor'\n },\n shadowOpacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowopacity-ios'\n },\n shadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowradius-ios'\n },\n start: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#start'\n },\n textAlign: {\n isValid: isIn('auto', 'left', 'right', 'center', 'justify'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalign'\n },\n textAlignVertical: {\n isValid: isIn('auto', 'top', 'bottom', 'center'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalignvertical-android'\n },\n textDecorationColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationcolor-ios'\n },\n textDecorationLine: {\n isValid: isIn('none', 'underline', 'line-through', 'underline line-through'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationline'\n },\n textDecorationStyle: {\n isValid: isIn('solid', 'double', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationstyle-ios'\n },\n textShadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowcolor'\n },\n textShadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowoffset'\n },\n textTransform: {\n isValid: isIn('none', 'uppercase', 'lowercase', 'capitalize'),\n ref: 'https://reactnative.dev/docs/text-style-props#texttransform'\n },\n tintColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#tintcolor'\n },\n top: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#top'\n },\n verticalAlign: {\n isValid: isIn('auto', 'top', 'bottom', 'middle'),\n ref: 'https://reactnative.dev/docs/text-style-props#verticalalign-android'\n },\n width: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#width'\n },\n writingDirection: {\n isValid: isIn('auto', 'ltr', 'rtl'),\n ref: 'https://reactnative.dev/docs/text-style-props#writingdirection-ios'\n },\n zIndex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#zindex'\n },\n};\n\nexport const getStyleReference = (name: string) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return !info || info.ref;\n};\n\nexport const isValidStyleProp = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return !info || info.isValid(value);\n};\n\nexport const getErrorMessage = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n if (info && info.errorMsg) {\n return info.errorMsg(value);\n }\n return `'${value}' is not a valid value to '${name}'.`;\n};"],"mappings":"AAAA,SAAQA,QAAQ,EAASC,QAAQ,QAAQ,WAAW;AACpD,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC,MA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AAK,CAAC;IACnCQ,GAAG,EAAE;EACT,CAAC;EACDuG,MAAM,EAAG;IACLxG,OAAO,EAAEd,QAAQ;IACjBe,GAAG,EAAE;EACT;AACJ,CAAC;AAED,OAAO,MAAMwG,iBAAiB,GAAIC,IAAY,IAAK;EAC/C,MAAMC,IAAI,GAAI7G,oBAAoB,CAAS4G,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAAC1G,GAAG;AAC5B,CAAC;AAED,OAAO,MAAM2G,gBAAgB,GAAG,CAACF,IAAY,EAAEG,KAAU,KAAK;EAC1D,MAAMF,IAAI,GAAI7G,oBAAoB,CAAS4G,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAAC3G,OAAO,CAAC6G,KAAK,CAAC;AACvC,CAAC;AAED,OAAO,MAAMC,eAAe,GAAG,CAACJ,IAAY,EAAEG,KAAU,KAAK;EACzD,MAAMF,IAAI,GAAI7G,oBAAoB,CAAS4G,IAAI,CAAC;EAChD,IAAIC,IAAI,IAAIA,IAAI,CAAC7D,QAAQ,EAAE;IACvB,OAAO6D,IAAI,CAAC7D,QAAQ,CAAC+D,KAAK,CAAC;EAC/B;EACA,OAAQ,IAAGA,KAAM,8BAA6BH,IAAK,IAAG;AAC1D,CAAC"}
|
|
1
|
+
{"version":3,"names":["isNumber","isString","Font","isColor","c","isStringOrNumber","v","isIn","obj","arr","forEach","k","STYLE_PROP_TYPE_INFO","alignContent","isValid","ref","alignItems","alignSelf","aspectRatio","backfaceVisibility","backgroundColor","backgroundImage","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","backgroundPosition","backgroundRepeat","backgroundSize","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderCurve","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopColor","borderTopWidth","borderWidth","bottom","color","columnGap","direction","display","elevation","end","flex","flexBasis","flexDirection","flexGrow","flexShrink","flexWrap","fontFamily","isLoaded","errorMsg","fontSize","fontStyle","fontVariant","fontWeight","gap","height","justifyContent","left","letterSpacing","lineHeight","margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","opacity","overflow","overlayColor","padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","pointerEvents","position","resizeMode","right","rowGap","shadowColor","shadowOpacity","shadowRadius","start","textAlign","textAlignVertical","textDecorationColor","textDecorationLine","textDecorationStyle","textShadowColor","textShadowRadius","textTransform","tintColor","top","verticalAlign","width","writingDirection","zIndex","getStyleReference","name","info","isValidStyleProp","value","trim","startsWith","getErrorMessage","replace","g","toLowerCase"],"sources":["style-prop.validator.ts"],"sourcesContent":["import {isNumber, isNil, isString } from 'lodash-es';\nimport * as Font from 'expo-font';\n\nconst isColor = (c: string) => true;\nconst isStringOrNumber = (v: any) => isNumber(v) || isString(v);\nconst isIn = (...arr: any) => {\n const obj = {};\n arr.forEach((v: any) => {\n (obj as any)[v] = true;\n })\n return (k: any) => (obj as any)[k] === true ;\n};\n\nconst STYLE_PROP_TYPE_INFO = {\n alignContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'space-between', 'space-around'),\n ref: 'https://reactnative.dev/docs/layout-props#aligncontent'\n },\n alignItems: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignitems'\n },\n alignSelf: {\n isValid: isIn('auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignself'\n },\n aspectRatio: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#aspectratio'\n },\n backfaceVisibility: {\n isValid: isIn('visible', 'hidden'),\n ref: 'https://reactnative.dev/docs/image-style-props#backfacevisibility'\n },\n backgroundColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'\n },\n backgroundImage: {\n isValid: isString,\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n borderBottomColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'\n },\n borderBottomEndRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomendradius'\n },\n borderBottomLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'\n },\n backgroundPosition: {\n isValid: isStringOrNumber,\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n backgroundRepeat: {\n isValid: isIn('repeat', 'repeat-x', 'repeat-y', 'no-repeat'),\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n backgroundSize: {\n isValid: isStringOrNumber,\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n borderBottomRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'\n },\n borderBottomStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomstartradius'\n },\n borderBottomWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderbottomwidth'\n },\n borderColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#bordercolor'\n },\n borderCurve: {\n isValid: isIn('circular', 'continuous'),\n ref: 'https://reactnative.dev/docs/view-style-props#bordercurve-ios'\n },\n borderEndColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderendcolor'\n },\n borderEndWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderendwidth'\n },\n borderLeftColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderleftcolor'\n },\n borderLeftWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderleftwidth'\n },\n borderRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderradius'\n },\n borderRightColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'\n },\n borderRightWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderrightwidth'\n },\n borderStartColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderstartcolor'\n },\n borderStartWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderstartwidth'\n },\n borderStyle: {\n isValid: isIn('solid', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'\n },\n borderTopEndRadius: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'\n },\n borderTopLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertopleftradius'\n },\n borderTopRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertoprightradius'\n },\n borderTopStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'\n },\n borderTopColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'\n },\n borderTopWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'\n },\n borderWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderwidth'\n },\n bottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bottom'\n },\n color: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#color'\n },\n columnGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#columngap'\n },\n direction: {\n isValid: isIn('inherit', 'LTR', 'RTL'),\n ref: 'https://reactnative.dev/docs/layout-props#direction'\n },\n display: {\n isValid: isIn('none', 'flex'),\n ref: 'https://reactnative.dev/docs/layout-props#display'\n },\n elevation: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#elevation-android'\n },\n end: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#end'\n },\n flex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flex'\n },\n flexBasis: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexbasis'\n },\n flexDirection: {\n isValid: isIn('column', 'row', 'column-reverse', 'row-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexdirection'\n },\n flexGrow: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexgrow'\n },\n flexShrink: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexshrink'\n },\n flexWrap: {\n isValid: isIn('wrap', 'nowrap', 'wrap-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexwrap'\n },\n fontFamily: {\n isValid: (v: string) => Font.isLoaded(v),\n errorMsg: (v: string) => `Font '${v}' is not loaded. Font family names are case-sensitive. Please add font either in theme or app.`,\n ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'\n },\n fontSize: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#fontsize'\n },\n fontStyle: {\n isValid: isIn('normal', 'italic'),\n ref: 'https://reactnative.dev/docs/text-style-props#fontstyle'\n },\n fontVariant: {\n isValid: (v: any) => isIn('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') || isString(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontvariant'\n },\n fontWeight: {\n isValid: (v: any) => isIn('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') || isNumber(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontweight'\n },\n gap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#gap'\n },\n height: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#height'\n },\n justifyContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'),\n ref: 'https://reactnative.dev/docs/layout-props#justifycontent'\n },\n left: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#left'\n },\n letterSpacing: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#letterspacing'\n },\n lineHeight: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#lineheight'\n },\n margin: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margin'\n },\n marginBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginbottom'\n },\n marginEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginend'\n },\n marginHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginhorizontal'\n },\n marginLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginleft'\n },\n marginRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginright'\n },\n marginStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginstart'\n },\n marginTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margintop'\n },\n marginVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginvertical'\n },\n maxHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxheight'\n },\n maxWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxwidth'\n },\n minHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minheight'\n },\n minWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minwidth'\n },\n opacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#opacity'\n },\n overflow: {\n isValid: isIn('visible', 'hidden', 'scroll'),\n ref: 'https://reactnative.dev/docs/image-style-props#overflow'\n },\n overlayColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#overlaycolor-android'\n },\n padding: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#padding'\n },\n paddingBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingbottom'\n },\n paddingEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingend'\n },\n paddingHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddinghorizontal'\n },\n paddingLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingleft'\n },\n paddingRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingright'\n },\n paddingStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingstart'\n },\n paddingTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingtop'\n },\n paddingVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingvertical'\n },\n pointerEvents: {\n isValid: isIn('auto', 'box-none', 'box-only', 'none' ),\n ref: 'https://reactnative.dev/docs/view-style-props#pointerevents'\n },\n position: {\n isValid: isIn('absolute', 'relative', 'fixed'),\n ref: 'https://reactnative.dev/docs/layout-props#position'\n },\n resizeMode: {\n isValid: isIn('cover', 'contain', 'stretch', 'repeat', 'center'),\n ref: 'https://reactnative.dev/docs/image-style-props#resizemode'\n },\n right: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#right'\n },\n rowGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#rowgap'\n },\n shadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowcolor'\n },\n shadowOpacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowopacity-ios'\n },\n shadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowradius-ios'\n },\n start: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#start'\n },\n textAlign: {\n isValid: isIn('auto', 'left', 'right', 'center', 'justify'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalign'\n },\n textAlignVertical: {\n isValid: isIn('auto', 'top', 'bottom', 'center'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalignvertical-android'\n },\n textDecorationColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationcolor-ios'\n },\n textDecorationLine: {\n isValid: isIn('none', 'underline', 'line-through', 'underline line-through'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationline'\n },\n textDecorationStyle: {\n isValid: isIn('solid', 'double', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationstyle-ios'\n },\n textShadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowcolor'\n },\n textShadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowoffset'\n },\n textTransform: {\n isValid: isIn('none', 'uppercase', 'lowercase', 'capitalize'),\n ref: 'https://reactnative.dev/docs/text-style-props#texttransform'\n },\n tintColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#tintcolor'\n },\n top: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#top'\n },\n verticalAlign: {\n isValid: isIn('auto', 'top', 'bottom', 'middle'),\n ref: 'https://reactnative.dev/docs/text-style-props#verticalalign-android'\n },\n width: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#width'\n },\n writingDirection: {\n isValid: isIn('auto', 'ltr', 'rtl'),\n ref: 'https://reactnative.dev/docs/text-style-props#writingdirection-ios'\n },\n zIndex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#zindex'\n },\n};\n\nexport const getStyleReference = (name: string) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return !info || info.ref;\n};\n\nexport const isValidStyleProp = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return name?.trim().startsWith('__') || (info && info.isValid(value));\n};\n\nexport const getErrorMessage = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n name = name.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);\n if (info) {\n if (info.errorMsg) {\n return info.errorMsg(value);\n } else {\n return `'${value}' is not a valid value to '${name}'.`;\n }\n }\n return `'${name}' is not a supported style property in one or all Native Platforms.`\n};"],"mappings":"AAAA,SAAQA,QAAQ,EAASC,QAAQ,QAAQ,WAAW;AACpD,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC,MAAMC,OAAO,GAAIC,CAAS,IAAK,IAAI;AACnC,MAAMC,gBAAgB,GAAIC,CAAM,IAAKN,QAAQ,CAACM,CAAC,CAAC,IAAIL,QAAQ,CAACK,CAAC,CAAC;AAC/D,MAAMC,IAAI,GAAG,YAAiB;EAC1B,MAAMC,GAAG,GAAG,CAAC,CAAC;EAAC,kCADFC,GAAG;IAAHA,GAAG;EAAA;EAEhBA,GAAG,CAACC,OAAO,CAAEJ,CAAM,IAAK;IACnBE,GAAG,CAASF,CAAC,CAAC,GAAG,IAAI;EAC1B,CAAC,CAAC;EACF,OAAQK,CAAM,IAAMH,GAAG,CAASG,CAAC,CAAC,KAAK,IAAI;AAC/C,CAAC;AAED,MAAMC,oBAAoB,GAAG;EACzBC,YAAY,EAAE;IACVC,OAAO,EAAEP,I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G,MAAM,EAAG;IACL7G,OAAO,EAAEd,QAAQ;IACjBe,GAAG,EAAE;EACT;AACJ,CAAC;AAED,OAAO,MAAM6G,iBAAiB,GAAIC,IAAY,IAAK;EAC/C,MAAMC,IAAI,GAAIlH,oBAAoB,CAASiH,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAAC/G,GAAG;AAC5B,CAAC;AAED,OAAO,MAAMgH,gBAAgB,GAAG,CAACF,IAAY,EAAEG,KAAU,KAAK;EAC1D,MAAMF,IAAI,GAAIlH,oBAAoB,CAASiH,IAAI,CAAC;EAChD,OAAO,CAAAA,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEI,IAAI,EAAE,CAACC,UAAU,CAAC,IAAI,CAAC,KAAKJ,IAAI,IAAIA,IAAI,CAAChH,OAAO,CAACkH,KAAK,CAAE;AACzE,CAAC;AAED,OAAO,MAAMG,eAAe,GAAG,CAACN,IAAY,EAAEG,KAAU,KAAK;EACzD,MAAMF,IAAI,GAAIlH,oBAAoB,CAASiH,IAAI,CAAC;EAChDA,IAAI,GAAGA,IAAI,CAACO,OAAO,CAAC,UAAU,EAAGC,CAAC,IAAM,IAAGA,CAAC,CAAC,CAAC,CAAC,CAACC,WAAW,EAAG,EAAC,CAAC;EAChE,IAAIR,IAAI,EAAE;IACN,IAAIA,IAAI,CAAC7D,QAAQ,EAAE;MACf,OAAO6D,IAAI,CAAC7D,QAAQ,CAAC+D,KAAK,CAAC;IAC/B,CAAC,MAAM;MACH,OAAQ,IAAGA,KAAM,8BAA6BH,IAAK,IAAG;IAC1D;EACJ;EACA,OAAQ,IAAGA,IAAK,qEAAoE;AACxF,CAAC"}
|
app-rn-runtime/styles/theme.js
CHANGED
|
@@ -63,7 +63,7 @@ export class Theme {
|
|
|
63
63
|
checkStyleProperties(name, value) {
|
|
64
64
|
if (isObject(value)) {
|
|
65
65
|
Object.keys(value).map(k => this.checkStyleProperties(k, value[k]));
|
|
66
|
-
} else if (!isValidStyleProp(name, value)) {
|
|
66
|
+
} else if (name && !isValidStyleProp(name, value)) {
|
|
67
67
|
console.log(`%cInvalid Style property in ${this.name}: ${getErrorMessage(name, value)}`, 'background-color: #FF0000;font-weight: bold; color: #fff');
|
|
68
68
|
console.log(`Refer: ${getStyleReference(name)}`);
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cloneDeep","forEach","flatten","isArray","isEmpty","isObject","isString","get","reverse","React","deepCopy","isWebPreviewMode","EventNotifier","ViewPort","EVENTS","ViewPortEvents","MediaQueryList","ThemeVariables","getErrorMessage","getStyleReference","isValidStyleProp","DEFAULT_CLASS","window","matchMedia","query","DEVICE_BREAK_POINTS","ThemeEvent","Theme","constructor","parent","name","traceEnabled","subscribe","event","fn","eventNotifer","notify","children","t","clearCache","cache","registerStyle","styleGenerators","push","INSTANCE","addStyle","bind","checkStyleProperties","value","Object","keys","map","k","console","log","extend","style","styles","getStyle","addTrace","styleName","mergedChildstyle","childStyle","parentStyle","v","__trace","prefix","result","collect","mergeStyle","flattenStyles","s","cs","filter","length","indexOf","split","c","mediaQuery","clonedStyle","matches","BASE","$new","newTheme","reset","destroy","i","splice","themeVariables","CHANGE","SIZE_CHANGE","ThemeContext","createContext","ThemeProvider","Provider","ThemeConsumer","Consumer","addColStyles","device","minWidth","root","width","MIN_EXTRA_SMALL_DEVICE","MIN_SMALL_DEVICE","MIN_MEDIUM_DEVICE","MIN_LARGE_DEVICE","display","addDisplayStyles","maxWidth","MAX_LARGE_DEVICE","MAX_EXTRA_SMALL_DEVICE","MAX_SMALL_DEVICE","MAX_MEDIUM_DEVICE","addElevationClasses","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius","elevation","zIndex","transform","scale","backgroundColor","dangerColor","infoColor","primaryColor","successColor","warningColor","borderColor"],"sources":["theme.tsx"],"sourcesContent":["import { cloneDeep, forEach, flatten, isArray, isEmpty, isObject, isString, isFunction, get, reverse } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { TextStyle, ViewStyle, ImageStyle, ImageBackground } from 'react-native';\nimport { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport EventNotifier from '@wavemaker/app-rn-runtime/core/event-notifier';\nimport ViewPort, {EVENTS as ViewPortEvents} from '@wavemaker/app-rn-runtime/core/viewport';\nimport MediaQueryList from './MediaQueryList';\nimport ThemeVariables from './theme.variables';\nimport { getErrorMessage, getStyleReference, isValidStyleProp } from './style-prop.validator';\nexport const DEFAULT_CLASS = 'DEFAULT_CLASS';\n\ndeclare const matchMedia: any, window: any;\n\nif (typeof window !== \"undefined\") {\n // @ts-ignore: does not properly extend MediaQueryList\n window.matchMedia = (query: string) => new MediaQueryList(query);\n}\n\nexport const DEVICE_BREAK_POINTS = {\n 'MIN_EXTRA_SMALL_DEVICE' : '0px',\n 'MAX_EXTRA_SMALL_DEVICE' : '767px',\n 'MIN_SMALL_DEVICE' : '768px',\n 'MAX_SMALL_DEVICE' : '991px',\n 'MIN_MEDIUM_DEVICE' : '992px',\n 'MAX_MEDIUM_DEVICE' : '1199px',\n 'MIN_LARGE_DEVICE' : '1200px',\n 'MAX_LARGE_DEVICE' : '1000000px',\n};\n\nexport type styleGeneratorFn<T extends NamedStyles<any>> = (\n themeVariables: ThemeVariables,\n addStyle: (name: string, extend: string, style: T) => void) => void\n\nexport enum ThemeEvent {\n CHANGE ='change'\n};\n\nexport class Theme {\n public static BASE = new Theme(null as any, 'default');\n\n static {\n ViewPort.subscribe(ViewPortEvents.SIZE_CHANGE, () => {\n Theme.BASE.reset();\n });\n }\n\n\n private eventNotifer = new EventNotifier();\n\n private children: Theme[] = [];\n\n private styles: any = {};\n\n private cache: any = {};\n\n private traceEnabled = false;\n\n private styleGenerators: styleGeneratorFn<any>[] = [];\n\n private constructor(private parent:Theme, public readonly name: string) {\n if (parent) {\n this.traceEnabled = parent.traceEnabled;\n } else {\n this.traceEnabled = isWebPreviewMode();\n }\n }\n\n public subscribe(event: ThemeEvent, fn: Function) {\n return this.eventNotifer.subscribe(event, fn);\n }\n\n public notify(event: ThemeEvent): void {\n this.eventNotifer.notify(event, []);\n this.children.forEach(t => t.notify(event));\n }\n\n clearCache() {\n this.cache = {};\n this.children.forEach((t) => t.clearCache());\n }\n\n registerStyle<T extends NamedStyles<any>>(fn: styleGeneratorFn<T>) {\n this.styleGenerators.push(fn);\n fn(ThemeVariables.INSTANCE, this.addStyle.bind(this));\n }\n\n checkStyleProperties(name: string, value : any) {\n if (isObject(value)) {\n Object.keys(value).map((k) => this.checkStyleProperties(k, (value as any)[k]));\n } else if(!isValidStyleProp(name, value)) {\n console.log(\n `%cInvalid Style property in ${this.name}: ${getErrorMessage(name, value)}`,\n 'background-color: #FF0000;font-weight: bold; color: #fff'\n );\n console.log(`Refer: ${getStyleReference(name)}`);\n }\n }\n\n private addStyle<T extends NamedStyles<any>>(name: string, extend: string, style: T) {\n this.styles[name] = deepCopy(this.getStyle(extend), this.styles[name], style);\n }\n\n private addTrace(styleName: string, mergedChildstyle: any, childStyle: any, parentStyle?: any) {\n if (!this.traceEnabled) {\n return;\n }\n let addTrace = !isEmpty(childStyle);\n forEach(mergedChildstyle, (v: any, k: string) => {\n if (v && !isString(v) && !isArray(v) && isObject(v)) {\n addTrace = false;\n this.addTrace(styleName + '.' + k, v, childStyle && childStyle[k], parentStyle && parentStyle[k])\n }\n });\n if (addTrace) {\n mergedChildstyle['__trace'] = [\n {\n name: styleName,\n value: childStyle\n },\n ...(parentStyle?.__trace|| [])\n ];\n } else {\n mergedChildstyle['__trace'] = [...(parentStyle?.__trace|| [])];\n }\n }\n\n private flatten(style: any, prefix = \"\", result = {} as any) {\n let collect = !isEmpty(style);\n forEach(style, (v: any, k: string) => {\n if (v && !isString(v) && !isArray(v) && isObject(v)) {\n collect = false;\n this.flatten(v, (prefix ? prefix + '.' : '') + k, result)\n }\n });\n if (collect) {\n result[prefix] = style;\n }\n return result;\n }\n\n mergeStyle(...styles: any) {\n const style = deepCopy(...styles);\n if (this.traceEnabled) {\n const flattenStyles = this.flatten(style);\n Object.keys(flattenStyles).forEach(k => {\n const s = flattenStyles[k];\n s['__trace'] = flatten(reverse(styles.map((v: any) => {\n const cs = get(v, k);\n if (cs && cs.__trace) {\n return [...cs.__trace];\n }\n return [];\n }).filter((t: any) => t.length > 0)));\n });\n }\n return style;\n }\n\n getStyle(name: string) {\n let style = this.cache[name];\n if (style) {\n return style;\n }\n if (!name) {\n return {};\n }\n if (name.indexOf(' ') > 0) {\n style = this.mergeStyle(...(name.split(' ').map(c => this.getStyle(c))));\n } else {\n const parentStyle = this.parent && this.parent.getStyle(name);\n const mediaQuery = (this.styles[name] || {})['@media'];\n let clonedStyle = {};\n if (!mediaQuery || matchMedia(mediaQuery).matches) {\n clonedStyle = cloneDeep(this.styles[name]);\n }\n if (this !== Theme.BASE && isWebPreviewMode()) {\n this.checkStyleProperties('', clonedStyle);\n }\n style = deepCopy(parentStyle, clonedStyle);\n this.addTrace(`@${this.name}:${name}`, style, clonedStyle, parentStyle);\n }\n this.cache[name] = style;\n return style;\n }\n\n $new(name = \"\", styles = {} as NamedStyles<any>) {\n const newTheme = new Theme(this, name);\n newTheme.reset(styles);\n this.children.push(newTheme);\n return newTheme;\n }\n\n destroy() {\n const i = this.parent.children.indexOf(this);\n if (i >= 0) {\n this.parent.children.splice(i, 1);\n }\n }\n\n reset(styles?: NamedStyles<any>) {\n this.styles = {};\n this.clearCache();\n if (styles) {\n this.registerStyle((themeVariables, addStyle) => {\n Object.keys(styles).forEach(k => {\n addStyle(k, '', styles[k] as any);\n });\n });\n } else {\n this.styleGenerators.forEach(fn => \n fn(ThemeVariables.INSTANCE, this.addStyle.bind(this)));\n }\n this.notify(ThemeEvent.CHANGE);\n }\n}\nexport default Theme.BASE;\nexport type NamedStyles<T> = { [P in keyof T]: ViewStyle | TextStyle | ImageStyle | NamedStyles<T>};\nexport type BackgroundImageStyle = {\n backgroundImage: string,\n backgroundPosition: string,\n backgroundRepeat: string,\n backgroundSize: string | number\n};\n\nexport type AllStyle = (ViewStyle & TextStyle & ImageStyle);\n\nconst ThemeContext = React.createContext<Theme>(null as any);\n\nexport const ThemeProvider = ThemeContext.Provider;\nexport const ThemeConsumer = ThemeContext.Consumer;\n/**\n * Common styles\n */\n Theme.BASE.registerStyle((themeVariables, addStyle) => {\n const addColStyles = (device: string, minWidth: string) => {\n for(let i = 1; i <= 12; i++) {\n addStyle(`col-${device}-${i}`, '', {\n \"@media\": `(min-width: ${minWidth})`,\n root: {\n width: (100 * i / 12) + '%'\n }\n } as any)\n }\n };\n addColStyles('xs', DEVICE_BREAK_POINTS.MIN_EXTRA_SMALL_DEVICE);\n addColStyles('sm', DEVICE_BREAK_POINTS.MIN_SMALL_DEVICE);\n addColStyles('md', DEVICE_BREAK_POINTS.MIN_MEDIUM_DEVICE);\n addColStyles('lg', DEVICE_BREAK_POINTS.MIN_LARGE_DEVICE);\n\n addStyle('d-none', '', {\n root: {\n display: 'none'\n }\n } as any);\n addStyle('d-flex', '', {\n root: {\n display: 'flex'\n }\n } as any);\n\n const addDisplayStyles = (device: string, minWidth: string, maxWidth: string) => {\n addStyle(`d-${device}-none`, '', {\n \"@media\": `(min-width: ${minWidth}) and (max-width: ${maxWidth})`,\n root: {\n display: 'none'\n }\n } as any);\n addStyle(`d-${device}-flex`, '', {\n \"@media\": `(min-width: ${minWidth}) and (max-width: ${maxWidth})`,\n root: {\n display: 'flex'\n }\n } as any);\n };\n addDisplayStyles('all', \n DEVICE_BREAK_POINTS.MIN_EXTRA_SMALL_DEVICE,\n DEVICE_BREAK_POINTS.MAX_LARGE_DEVICE);\n addDisplayStyles('xs', \n DEVICE_BREAK_POINTS.MIN_EXTRA_SMALL_DEVICE,\n DEVICE_BREAK_POINTS.MAX_EXTRA_SMALL_DEVICE);\n addDisplayStyles('sm', \n DEVICE_BREAK_POINTS.MIN_SMALL_DEVICE,\n DEVICE_BREAK_POINTS.MAX_SMALL_DEVICE);\n addDisplayStyles('md', \n DEVICE_BREAK_POINTS.MIN_MEDIUM_DEVICE,\n DEVICE_BREAK_POINTS.MAX_MEDIUM_DEVICE);\n addDisplayStyles('lg', \n DEVICE_BREAK_POINTS.MIN_LARGE_DEVICE,\n DEVICE_BREAK_POINTS.MAX_LARGE_DEVICE);\n\n const addElevationClasses = () => {\n for(let i = 1; i <= 10; i++) {\n addStyle(`elevate${i}`, '', {\n root : {\n shadowColor: \"#000000\",\n shadowOffset: {\n width: i,\n height: i,\n },\n shadowOpacity: 0.27,\n shadowRadius: i,\n elevation: i,\n zIndex: 1\n }\n });\n }\n };\n addElevationClasses();\n addStyle('hidden', '', {\n root: {\n width: 0,\n height: 0,\n transform: [{ scale: 0 }]\n }\n });\n addStyle('bg-danger', '', { root: { backgroundColor: themeVariables.dangerColor }});\n addStyle('bg-info', '', { root: { backgroundColor: themeVariables.infoColor }});\n addStyle('bg-primary', '', { root: { backgroundColor: themeVariables.primaryColor }});\n addStyle('bg-success', '', { root: { backgroundColor: themeVariables.successColor }});\n addStyle('bg-warning', '', { root: { backgroundColor: themeVariables.warningColor }});\n\n addStyle('border-danger', '', { root: { borderColor: themeVariables.dangerColor }});\n addStyle('border-info', '', { root: { borderColor: themeVariables.infoColor }});\n addStyle('border-primary', '', { root: { borderColor: themeVariables.primaryColor }});\n addStyle('border-success', '', { root: { borderColor: themeVariables.successColor }});\n addStyle('border-warning', '', { root: { borderColor: themeVariables.warningColor }});\n});\n\n"],"mappings":";;;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAcC,GAAG,EAAEC,OAAO,QAAQ,QAAQ;AACpH,OAAOC,KAAK,MAAqB,OAAO;AAExC,SAASC,QAAQ,EAAEC,gBAAgB,QAAQ,sCAAsC;AACjF,OAAOC,aAAa,MAAM,+CAA+C;AACzE,OAAOC,QAAQ,IAAGC,MAAM,IAAIC,cAAc,QAAO,yCAAyC;AAC1F,OAAOC,cAAc,MAAM,kBAA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;IAAa;EAAC,CAAC,CAAC;EAErFnF,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE;IAAEuD,IAAI,EAAE;MAAE6B,WAAW,EAAEzC,cAAc,CAACoC;IAAY;EAAC,CAAC,CAAC;EACnF/E,QAAQ,CAAC,aAAa,EAAE,EAAE,EAAE;IAAEuD,IAAI,EAAE;MAAE6B,WAAW,EAAEzC,cAAc,CAACqC;IAAU;EAAC,CAAC,CAAC;EAC/EhF,QAAQ,CAAC,gBAAgB,EAAE,EAAE,EAAE;IAAEuD,IAAI,EAAE;MAAE6B,WAAW,EAAEzC,cAAc,CAACsC;IAAa;EAAC,CAAC,CAAC;EACrFjF,QAAQ,CAAC,gBAAgB,EAAE,EAAE,EAAE;IAAEuD,IAAI,EAAE;MAAE6B,WAAW,EAAEzC,cAAc,CAACuC;IAAa;EAAC,CAAC,CAAC;EACrFlF,QAAQ,CAAC,gBAAgB,EAAE,EAAE,EAAE;IAAEuD,IAAI,EAAE;MAAE6B,WAAW,EAAEzC,cAAc,CAACwC;IAAa;EAAC,CAAC,CAAC;AACzF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["cloneDeep","forEach","flatten","isArray","isEmpty","isObject","isString","get","reverse","React","deepCopy","isWebPreviewMode","EventNotifier","ViewPort","EVENTS","ViewPortEvents","MediaQueryList","ThemeVariables","getErrorMessage","getStyleReference","isValidStyleProp","DEFAULT_CLASS","window","matchMedia","query","DEVICE_BREAK_POINTS","ThemeEvent","Theme","constructor","parent","name","traceEnabled","subscribe","event","fn","eventNotifer","notify","children","t","clearCache","cache","registerStyle","styleGenerators","push","INSTANCE","addStyle","bind","checkStyleProperties","value","Object","keys","map","k","console","log","extend","style","styles","getStyle","addTrace","styleName","mergedChildstyle","childStyle","parentStyle","v","__trace","prefix","result","collect","mergeStyle","flattenStyles","s","cs","filter","length","indexOf","split","c","mediaQuery","clonedStyle","matches","BASE","$new","newTheme","reset","destroy","i","splice","themeVariables","CHANGE","SIZE_CHANGE","ThemeContext","createContext","ThemeProvider","Provider","ThemeConsumer","Consumer","addColStyles","device","minWidth","root","width","MIN_EXTRA_SMALL_DEVICE","MIN_SMALL_DEVICE","MIN_MEDIUM_DEVICE","MIN_LARGE_DEVICE","display","addDisplayStyles","maxWidth","MAX_LARGE_DEVICE","MAX_EXTRA_SMALL_DEVICE","MAX_SMALL_DEVICE","MAX_MEDIUM_DEVICE","addElevationClasses","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius","elevation","zIndex","transform","scale","backgroundColor","dangerColor","infoColor","primaryColor","successColor","warningColor","borderColor"],"sources":["theme.tsx"],"sourcesContent":["import { cloneDeep, forEach, flatten, isArray, isEmpty, isObject, isString, isFunction, get, reverse } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { TextStyle, ViewStyle, ImageStyle, ImageBackground } from 'react-native';\nimport { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport EventNotifier from '@wavemaker/app-rn-runtime/core/event-notifier';\nimport ViewPort, {EVENTS as ViewPortEvents} from '@wavemaker/app-rn-runtime/core/viewport';\nimport MediaQueryList from './MediaQueryList';\nimport ThemeVariables from './theme.variables';\nimport { getErrorMessage, getStyleReference, isValidStyleProp } from './style-prop.validator';\nexport const DEFAULT_CLASS = 'DEFAULT_CLASS';\n\ndeclare const matchMedia: any, window: any;\n\nif (typeof window !== \"undefined\") {\n // @ts-ignore: does not properly extend MediaQueryList\n window.matchMedia = (query: string) => new MediaQueryList(query);\n}\n\nexport const DEVICE_BREAK_POINTS = {\n 'MIN_EXTRA_SMALL_DEVICE' : '0px',\n 'MAX_EXTRA_SMALL_DEVICE' : '767px',\n 'MIN_SMALL_DEVICE' : '768px',\n 'MAX_SMALL_DEVICE' : '991px',\n 'MIN_MEDIUM_DEVICE' : '992px',\n 'MAX_MEDIUM_DEVICE' : '1199px',\n 'MIN_LARGE_DEVICE' : '1200px',\n 'MAX_LARGE_DEVICE' : '1000000px',\n};\n\nexport type styleGeneratorFn<T extends NamedStyles<any>> = (\n themeVariables: ThemeVariables,\n addStyle: (name: string, extend: string, style: T) => void) => void\n\nexport enum ThemeEvent {\n CHANGE ='change'\n};\n\nexport class Theme {\n public static BASE = new Theme(null as any, 'default');\n\n static {\n ViewPort.subscribe(ViewPortEvents.SIZE_CHANGE, () => {\n Theme.BASE.reset();\n });\n }\n\n\n private eventNotifer = new EventNotifier();\n\n private children: Theme[] = [];\n\n private styles: any = {};\n\n private cache: any = {};\n\n private traceEnabled = false;\n\n private styleGenerators: styleGeneratorFn<any>[] = [];\n\n private constructor(private parent:Theme, public readonly name: string) {\n if (parent) {\n this.traceEnabled = parent.traceEnabled;\n } else {\n this.traceEnabled = isWebPreviewMode();\n }\n }\n\n public subscribe(event: ThemeEvent, fn: Function) {\n return this.eventNotifer.subscribe(event, fn);\n }\n\n public notify(event: ThemeEvent): void {\n this.eventNotifer.notify(event, []);\n this.children.forEach(t => t.notify(event));\n }\n\n clearCache() {\n this.cache = {};\n this.children.forEach((t) => t.clearCache());\n }\n\n registerStyle<T extends NamedStyles<any>>(fn: styleGeneratorFn<T>) {\n this.styleGenerators.push(fn);\n fn(ThemeVariables.INSTANCE, this.addStyle.bind(this));\n }\n\n checkStyleProperties(name: string, value : any) {\n if (isObject(value)) {\n Object.keys(value).map((k) => this.checkStyleProperties(k, (value as any)[k]));\n } else if(name && !isValidStyleProp(name, value)) {\n console.log(\n `%cInvalid Style property in ${this.name}: ${getErrorMessage(name, value)}`,\n 'background-color: #FF0000;font-weight: bold; color: #fff'\n );\n console.log(`Refer: ${getStyleReference(name)}`);\n }\n }\n\n private addStyle<T extends NamedStyles<any>>(name: string, extend: string, style: T) {\n this.styles[name] = deepCopy(this.getStyle(extend), this.styles[name], style);\n }\n\n private addTrace(styleName: string, mergedChildstyle: any, childStyle: any, parentStyle?: any) {\n if (!this.traceEnabled) {\n return;\n }\n let addTrace = !isEmpty(childStyle);\n forEach(mergedChildstyle, (v: any, k: string) => {\n if (v && !isString(v) && !isArray(v) && isObject(v)) {\n addTrace = false;\n this.addTrace(styleName + '.' + k, v, childStyle && childStyle[k], parentStyle && parentStyle[k])\n }\n });\n if (addTrace) {\n mergedChildstyle['__trace'] = [\n {\n name: styleName,\n value: childStyle\n },\n ...(parentStyle?.__trace|| [])\n ];\n } else {\n mergedChildstyle['__trace'] = [...(parentStyle?.__trace|| [])];\n }\n }\n\n private flatten(style: any, prefix = \"\", result = {} as any) {\n let collect = !isEmpty(style);\n forEach(style, (v: any, k: string) => {\n if (v && !isString(v) && !isArray(v) && isObject(v)) {\n collect = false;\n this.flatten(v, (prefix ? prefix + '.' : '') + k, result)\n }\n });\n if (collect) {\n result[prefix] = style;\n }\n return result;\n }\n\n mergeStyle(...styles: any) {\n const style = deepCopy(...styles);\n if (this.traceEnabled) {\n const flattenStyles = this.flatten(style);\n Object.keys(flattenStyles).forEach(k => {\n const s = flattenStyles[k];\n s['__trace'] = flatten(reverse(styles.map((v: any) => {\n const cs = get(v, k);\n if (cs && cs.__trace) {\n return [...cs.__trace];\n }\n return [];\n }).filter((t: any) => t.length > 0)));\n });\n }\n return style;\n }\n\n getStyle(name: string) {\n let style = this.cache[name];\n if (style) {\n return style;\n }\n if (!name) {\n return {};\n }\n if (name.indexOf(' ') > 0) {\n style = this.mergeStyle(...(name.split(' ').map(c => this.getStyle(c))));\n } else {\n const parentStyle = this.parent && this.parent.getStyle(name);\n const mediaQuery = (this.styles[name] || {})['@media'];\n let clonedStyle = {};\n if (!mediaQuery || matchMedia(mediaQuery).matches) {\n clonedStyle = cloneDeep(this.styles[name]);\n }\n if (this !== Theme.BASE && isWebPreviewMode()) {\n this.checkStyleProperties('', clonedStyle);\n }\n style = deepCopy(parentStyle, clonedStyle);\n this.addTrace(`@${this.name}:${name}`, style, clonedStyle, parentStyle);\n }\n this.cache[name] = style;\n return style;\n }\n\n $new(name = \"\", styles = {} as NamedStyles<any>) {\n const newTheme = new Theme(this, name);\n newTheme.reset(styles);\n this.children.push(newTheme);\n return newTheme;\n }\n\n destroy() {\n const i = this.parent.children.indexOf(this);\n if (i >= 0) {\n this.parent.children.splice(i, 1);\n }\n }\n\n reset(styles?: NamedStyles<any>) {\n this.styles = {};\n this.clearCache();\n if (styles) {\n this.registerStyle((themeVariables, addStyle) => {\n Object.keys(styles).forEach(k => {\n addStyle(k, '', styles[k] as any);\n });\n });\n } else {\n this.styleGenerators.forEach(fn => \n fn(ThemeVariables.INSTANCE, this.addStyle.bind(this)));\n }\n this.notify(ThemeEvent.CHANGE);\n }\n}\nexport default Theme.BASE;\nexport type NamedStyles<T> = { [P in keyof T]: ViewStyle | TextStyle | ImageStyle | NamedStyles<T>};\nexport type BackgroundImageStyle = {\n backgroundImage: string,\n backgroundPosition: string,\n backgroundRepeat: string,\n backgroundSize: string | number\n};\n\nexport type AllStyle = (ViewStyle & TextStyle & ImageStyle);\n\nconst ThemeContext = React.createContext<Theme>(null as any);\n\nexport const ThemeProvider = ThemeContext.Provider;\nexport const ThemeConsumer = ThemeContext.Consumer;\n/**\n * Common styles\n */\n Theme.BASE.registerStyle((themeVariables, addStyle) => {\n const addColStyles = (device: string, minWidth: string) => {\n for(let i = 1; i <= 12; i++) {\n addStyle(`col-${device}-${i}`, '', {\n \"@media\": `(min-width: ${minWidth})`,\n root: {\n width: (100 * i / 12) + '%'\n }\n } as any)\n }\n };\n addColStyles('xs', DEVICE_BREAK_POINTS.MIN_EXTRA_SMALL_DEVICE);\n addColStyles('sm', DEVICE_BREAK_POINTS.MIN_SMALL_DEVICE);\n addColStyles('md', DEVICE_BREAK_POINTS.MIN_MEDIUM_DEVICE);\n addColStyles('lg', DEVICE_BREAK_POINTS.MIN_LARGE_DEVICE);\n\n addStyle('d-none', '', {\n root: {\n display: 'none'\n }\n } as any);\n addStyle('d-flex', '', {\n root: {\n display: 'flex'\n }\n } as any);\n\n const addDisplayStyles = (device: string, minWidth: string, maxWidth: string) => {\n addStyle(`d-${device}-none`, '', {\n \"@media\": `(min-width: ${minWidth}) and (max-width: ${maxWidth})`,\n root: {\n display: 'none'\n }\n } as any);\n addStyle(`d-${device}-flex`, '', {\n \"@media\": `(min-width: ${minWidth}) and (max-width: ${maxWidth})`,\n root: {\n display: 'flex'\n }\n } as any);\n };\n addDisplayStyles('all', \n DEVICE_BREAK_POINTS.MIN_EXTRA_SMALL_DEVICE,\n DEVICE_BREAK_POINTS.MAX_LARGE_DEVICE);\n addDisplayStyles('xs', \n DEVICE_BREAK_POINTS.MIN_EXTRA_SMALL_DEVICE,\n DEVICE_BREAK_POINTS.MAX_EXTRA_SMALL_DEVICE);\n addDisplayStyles('sm', \n DEVICE_BREAK_POINTS.MIN_SMALL_DEVICE,\n DEVICE_BREAK_POINTS.MAX_SMALL_DEVICE);\n addDisplayStyles('md', \n DEVICE_BREAK_POINTS.MIN_MEDIUM_DEVICE,\n DEVICE_BREAK_POINTS.MAX_MEDIUM_DEVICE);\n addDisplayStyles('lg', \n DEVICE_BREAK_POINTS.MIN_LARGE_DEVICE,\n DEVICE_BREAK_POINTS.MAX_LARGE_DEVICE);\n\n const addElevationClasses = () => {\n for(let i = 1; i <= 10; i++) {\n addStyle(`elevate${i}`, '', {\n root : {\n shadowColor: \"#000000\",\n shadowOffset: {\n width: i,\n height: i,\n },\n shadowOpacity: 0.27,\n shadowRadius: i,\n elevation: i,\n zIndex: 1\n }\n });\n }\n };\n addElevationClasses();\n addStyle('hidden', '', {\n root: {\n width: 0,\n height: 0,\n transform: [{ scale: 0 }]\n }\n });\n addStyle('bg-danger', '', { root: { backgroundColor: themeVariables.dangerColor }});\n addStyle('bg-info', '', { root: { backgroundColor: themeVariables.infoColor }});\n addStyle('bg-primary', '', { root: { backgroundColor: themeVariables.primaryColor }});\n addStyle('bg-success', '', { root: { backgroundColor: themeVariables.successColor }});\n addStyle('bg-warning', '', { root: { backgroundColor: themeVariables.warningColor }});\n\n addStyle('border-danger', '', { root: { borderColor: themeVariables.dangerColor }});\n addStyle('border-info', '', { root: { borderColor: themeVariables.infoColor }});\n addStyle('border-primary', '', { root: { borderColor: themeVariables.primaryColor }});\n addStyle('border-success', '', { root: { borderColor: themeVariables.successColor }});\n addStyle('border-warning', '', { root: { borderColor: themeVariables.warningColor }});\n});\n\n"],"mappings":";;;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAcC,GAAG,EAAEC,OAAO,QAAQ,QAAQ;AACpH,OAAOC,KAAK,MAAqB,OAAO;AAExC,SAASC,QAAQ,EAAEC,gBAAgB,QAAQ,sCAAsC;AACjF,OAAOC,aAAa,MAAM,+CAA+C;AACzE,OAAOC,QAAQ,IAAGC,MAAM,IAAIC,cAAc,QAAO,yCAAyC;AAC1F,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,SAASC,eAAe,EAAEC,iBAAiB,EAAEC,gBAAgB,QAAQ,wBAAwB;AAC7F,OAAO,MAAMC,aAAa,GAAG,eAAe;AAI5C,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;EAC/B;EACAA,MAAM,CAACC,UAAU,GAAIC,KAAa,IAAK,IAAIR,cAAc,CAACQ,KAAK,CAAC;AACpE;AAEA,OAAO,MAAMC,mBAAmB,GAAG;EAC/B,wBAAwB,EAAG,KAAK;EAChC,wBAAwB,EAAG,OAAO;EAClC,kBAAkB,EAAG,OAAO;EAC5B,kBAAkB,EAAG,OAAO;EAC5B,mBAAmB,EAAG,OAAO;EAC7B,mBAAmB,EAAG,QAAQ;EAC9B,kBAAkB,EAAG,QAAQ;EAC7B,kBAAkB,EAAG;AACzB,CAAC;AAMD,WAAYC,UAAU;AAErB,WAFWA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU;AAErB;AAED,OAAO,MAAMC,KAAK,CAAC;EAsBPC,WAAW,CAASC,MAAY,EAAkBC,IAAY,EAAE;IAAA,KAA5CD,MAAY,GAAZA,MAAY;IAAA,KAAkBC,IAAY,GAA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