@wavemaker/app-rn-runtime 11.4.0-next.26251 → 11.4.0-next.28151
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/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.component.js +1 -1
- app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +1 -1
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
- 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/icon/icon.component.js +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +1 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- 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/message/message.component.js +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +37 -26
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +4 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +56 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -0
- app-rn-runtime/components/basic/video/video.props.js +22 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -0
- app-rn-runtime/components/basic/video/video.styles.js +11 -0
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
- app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +1 -1
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +1 -1
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +68 -67
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -1
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +1 -1
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +1 -30
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +1 -4
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +3 -0
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +0 -9
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +1 -1
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +1 -1
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +19 -22
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +7 -7
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +1 -10
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
- app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
- app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
- app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +1 -1
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page.component.js +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +1 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/core/asset.provider.js +5 -0
- app-rn-runtime/core/asset.provider.js.map +1 -0
- app-rn-runtime/core/base.component.js +113 -41
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +1 -0
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +105 -0
- app-rn-runtime/gestures/swipe.animation.js.map +1 -0
- app-rn-runtime/package.json +4 -3
- app-rn-runtime/runtime/App.js +11 -2
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +6 -4
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
- app-rn-runtime/runtime/navigator/stack.navigator.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/background.component.js +259 -0
- app-rn-runtime/styles/background.component.js.map +1 -0
- app-rn-runtime/styles/style-prop.validator.js +38 -8
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/style-props.js +93 -0
- app-rn-runtime/styles/style-props.js.map +1 -0
- app-rn-runtime/styles/theme.js +6 -37
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/variables/http.service.js +3 -12
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +13 -7
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isNumber, isString } from 'lodash-es';
|
|
2
|
+
import * as Font from 'expo-font';
|
|
2
3
|
const isColor = c => true;
|
|
3
4
|
const isStringOrNumber = v => isNumber(v) || isString(v);
|
|
4
5
|
const isIn = function () {
|
|
@@ -36,6 +37,10 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
36
37
|
isValid: isColor,
|
|
37
38
|
ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'
|
|
38
39
|
},
|
|
40
|
+
backgroundImage: {
|
|
41
|
+
isValid: isString,
|
|
42
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
43
|
+
},
|
|
39
44
|
borderBottomColor: {
|
|
40
45
|
isValid: isColor,
|
|
41
46
|
ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'
|
|
@@ -48,6 +53,18 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
48
53
|
isValid: isNumber,
|
|
49
54
|
ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'
|
|
50
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
|
+
},
|
|
51
68
|
borderBottomRightRadius: {
|
|
52
69
|
isValid: isNumber,
|
|
53
70
|
ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'
|
|
@@ -89,7 +106,7 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
89
106
|
ref: 'https://reactnative.dev/docs/image-style-props#borderradius'
|
|
90
107
|
},
|
|
91
108
|
borderRightColor: {
|
|
92
|
-
isValid:
|
|
109
|
+
isValid: isColor,
|
|
93
110
|
ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'
|
|
94
111
|
},
|
|
95
112
|
borderRightWidth: {
|
|
@@ -108,12 +125,8 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
108
125
|
isValid: isIn('solid', 'dotted', 'dashed'),
|
|
109
126
|
ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'
|
|
110
127
|
},
|
|
111
|
-
borderTopColor: {
|
|
112
|
-
isValid: isNumber,
|
|
113
|
-
ref: 'https://reactnative.dev/docs/view-style-props#bordertopcolor'
|
|
114
|
-
},
|
|
115
128
|
borderTopEndRadius: {
|
|
116
|
-
isValid:
|
|
129
|
+
isValid: isColor,
|
|
117
130
|
ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'
|
|
118
131
|
},
|
|
119
132
|
borderTopLeftRadius: {
|
|
@@ -128,6 +141,10 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
128
141
|
isValid: isNumber,
|
|
129
142
|
ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'
|
|
130
143
|
},
|
|
144
|
+
borderTopColor: {
|
|
145
|
+
isValid: isColor,
|
|
146
|
+
ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'
|
|
147
|
+
},
|
|
131
148
|
borderTopWidth: {
|
|
132
149
|
isValid: isNumber,
|
|
133
150
|
ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'
|
|
@@ -189,7 +206,8 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
189
206
|
ref: 'https://reactnative.dev/docs/layout-props#flexwrap'
|
|
190
207
|
},
|
|
191
208
|
fontFamily: {
|
|
192
|
-
isValid:
|
|
209
|
+
isValid: v => Font.isLoaded(v),
|
|
210
|
+
errorMsg: v => `Font '${v}' is not loaded. Font family names are case-sensitive. Please add font either in theme or app.`,
|
|
193
211
|
ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'
|
|
194
212
|
},
|
|
195
213
|
fontSize: {
|
|
@@ -431,6 +449,18 @@ export const getStyleReference = name => {
|
|
|
431
449
|
};
|
|
432
450
|
export const isValidStyleProp = (name, value) => {
|
|
433
451
|
const info = STYLE_PROP_TYPE_INFO[name];
|
|
434
|
-
return
|
|
452
|
+
return (name === null || name === void 0 ? void 0 : name.trim().startsWith('__')) || info && info.isValid(value);
|
|
453
|
+
};
|
|
454
|
+
export const getErrorMessage = (name, value) => {
|
|
455
|
+
const info = STYLE_PROP_TYPE_INFO[name];
|
|
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
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return `'${name}' is not a supported style property in one or all Native Platforms.`;
|
|
435
465
|
};
|
|
436
466
|
//# sourceMappingURL=style-prop.validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isNumber","isString","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","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","bottom","color","columnGap","direction","display","elevation","end","flex","flexBasis","flexDirection","flexGrow","flexShrink","flexWrap","fontFamily","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"],"sources":["style-prop.validator.ts"],"sourcesContent":["import {isNumber, isNil, isString } from 'lodash-es';\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 borderTopColor: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopcolor'\n },\n borderTopEndRadius: {\n isValid: isNumber,\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: isString,\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};"],"mappings":"AAAA,SAAQA,QAAQ,EAASC,QAAQ,QAAQ,WAAW;AAEpD,MAAMC,OAAO,GAAIC,CAAS,IAAK,IAAI;AACnC,MAAMC,gBAAgB,GAAIC,CAAM,IAAKL,QAAQ,CAACK,CAAC,CAAC,IAAIJ,QAAQ,CAACI,CAAC,CAAC;AAC/D,MAAMC,IAAI,GAAG,YAAiB;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5G,oBAAoB,CAAS2G,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAACzG,GAAG;AAC5B,CAAC;AAED,OAAO,MAAM0G,gBAAgB,GAAG,CAACF,IAAY,EAAEG,KAAU,KAAK;EAC1D,MAAMF,IAAI,GAAI5G,oBAAoB,CAAS2G,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAAC1G,OAAO,CAAC4G,KAAK,CAAC;AACvC,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,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,CAAC;IAC7FQ,GAAG,EAAE;EACT,CAAC;EACDC,UAAU,EAAE;IACRF,OAAO,EAAEP,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IACxEQ,GAAG,EAAE;EACT,CAAC;EACDE,SAAS,EAAE;IACPH,OAAO,EAAEP,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAChFQ,GAAG,EAAE;EACT,CAAC;EACDG,WAAW,EAAE;IACTJ,OAAO,EAAET,gBAAgB;IACzBU,GAAG,EAAE;EACT,CAAC;EACDI,k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I,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"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
export class StyleProps {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "backgroundimage", void 0);
|
|
7
|
+
_defineProperty(this, "backgroundsize", void 0);
|
|
8
|
+
_defineProperty(this, "backgroundrepeat", void 0);
|
|
9
|
+
_defineProperty(this, "backgroundresizemode", void 0);
|
|
10
|
+
_defineProperty(this, "backgroundposition", void 0);
|
|
11
|
+
_defineProperty(this, "backgroundcolor", void 0);
|
|
12
|
+
_defineProperty(this, "bordercolor", void 0);
|
|
13
|
+
_defineProperty(this, "borderradius", void 0);
|
|
14
|
+
_defineProperty(this, "borderstyle", void 0);
|
|
15
|
+
_defineProperty(this, "borderwidth", void 0);
|
|
16
|
+
_defineProperty(this, "borderbottomwidth", void 0);
|
|
17
|
+
_defineProperty(this, "borderleftwidth", void 0);
|
|
18
|
+
_defineProperty(this, "borderrightwidth", void 0);
|
|
19
|
+
_defineProperty(this, "bordertopwidth", void 0);
|
|
20
|
+
_defineProperty(this, "color", void 0);
|
|
21
|
+
_defineProperty(this, "display", void 0);
|
|
22
|
+
_defineProperty(this, "fontsize", void 0);
|
|
23
|
+
_defineProperty(this, "fontfamily", void 0);
|
|
24
|
+
_defineProperty(this, "fontstyle", void 0);
|
|
25
|
+
_defineProperty(this, "fontvariant", void 0);
|
|
26
|
+
_defineProperty(this, "fontweight", void 0);
|
|
27
|
+
_defineProperty(this, "height", void 0);
|
|
28
|
+
_defineProperty(this, "horizontalalign", void 0);
|
|
29
|
+
_defineProperty(this, "lineheight", void 0);
|
|
30
|
+
_defineProperty(this, "margin", void 0);
|
|
31
|
+
_defineProperty(this, "marginbottom", void 0);
|
|
32
|
+
_defineProperty(this, "marginleft", void 0);
|
|
33
|
+
_defineProperty(this, "marginright", void 0);
|
|
34
|
+
_defineProperty(this, "margintop", void 0);
|
|
35
|
+
_defineProperty(this, "opacity", void 0);
|
|
36
|
+
_defineProperty(this, "overflow", void 0);
|
|
37
|
+
_defineProperty(this, "padding", void 0);
|
|
38
|
+
_defineProperty(this, "paddingbottom", void 0);
|
|
39
|
+
_defineProperty(this, "paddingleft", void 0);
|
|
40
|
+
_defineProperty(this, "paddingright", void 0);
|
|
41
|
+
_defineProperty(this, "paddingtop", void 0);
|
|
42
|
+
_defineProperty(this, "textalign", void 0);
|
|
43
|
+
_defineProperty(this, "textdecoration", void 0);
|
|
44
|
+
_defineProperty(this, "verticalalign", void 0);
|
|
45
|
+
_defineProperty(this, "width", void 0);
|
|
46
|
+
_defineProperty(this, "zindex", void 0);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const styleMapping = {
|
|
50
|
+
backgroundimage: 'backgroundImage',
|
|
51
|
+
backgroundsize: 'backgroundSize',
|
|
52
|
+
backgroundrepeat: 'backgroundRepeat',
|
|
53
|
+
backgroundresizemode: 'backgroundResizeMode',
|
|
54
|
+
backgroundposition: 'backgroundPosition',
|
|
55
|
+
backgroundcolor: 'backgroundColor',
|
|
56
|
+
bordercolor: 'borderColor',
|
|
57
|
+
borderradius: 'borderRadius',
|
|
58
|
+
borderstyle: 'borderStyle',
|
|
59
|
+
borderwidth: 'borderWidth',
|
|
60
|
+
borderbottomwidth: 'borderBottomWidth',
|
|
61
|
+
borderleftwidth: 'borderLeftWidth',
|
|
62
|
+
borderrightwidth: 'borderRightWidth',
|
|
63
|
+
bordertopwidth: 'borderTopWidth',
|
|
64
|
+
color: 'color',
|
|
65
|
+
display: 'display',
|
|
66
|
+
fontsize: 'fontSize',
|
|
67
|
+
fontfamily: 'fontFamily',
|
|
68
|
+
fontstyle: 'fontStyle',
|
|
69
|
+
fontvariant: 'fontVariant',
|
|
70
|
+
fontweight: 'fontWeight',
|
|
71
|
+
height: 'height',
|
|
72
|
+
//horizontalalign: any;
|
|
73
|
+
lineheight: 'lineHeight',
|
|
74
|
+
margin: 'margin',
|
|
75
|
+
marginbottom: 'marginBottom',
|
|
76
|
+
marginleft: 'marginLeft',
|
|
77
|
+
marginright: 'marginRight',
|
|
78
|
+
margintop: 'marginTop',
|
|
79
|
+
opacity: 'opacity',
|
|
80
|
+
overflow: 'overflow',
|
|
81
|
+
padding: 'padding',
|
|
82
|
+
paddingbottom: 'paddingBottom',
|
|
83
|
+
paddingleft: 'paddingLeft',
|
|
84
|
+
paddingright: 'paddingRight',
|
|
85
|
+
paddingtop: 'paddingTop',
|
|
86
|
+
textalign: 'textAlign',
|
|
87
|
+
textdecoration: 'textDecoration',
|
|
88
|
+
verticalalign: 'verticalAlign',
|
|
89
|
+
width: 'width',
|
|
90
|
+
zindex: 'zindex'
|
|
91
|
+
};
|
|
92
|
+
export const getStyleName = name => styleMapping[name];
|
|
93
|
+
//# sourceMappingURL=style-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleProps","styleMapping","backgroundimage","backgroundsize","backgroundrepeat","backgroundresizemode","backgroundposition","backgroundcolor","bordercolor","borderradius","borderstyle","borderwidth","borderbottomwidth","borderleftwidth","borderrightwidth","bordertopwidth","color","display","fontsize","fontfamily","fontstyle","fontvariant","fontweight","height","lineheight","margin","marginbottom","marginleft","marginright","margintop","opacity","overflow","padding","paddingbottom","paddingleft","paddingright","paddingtop","textalign","textdecoration","verticalalign","width","zindex","getStyleName","name"],"sources":["style-props.ts"],"sourcesContent":["export class StyleProps {\n backgroundimage?: any;\n backgroundsize?: any;\n backgroundrepeat?: any;\n backgroundresizemode?: any;\n backgroundposition?: any;\n backgroundcolor?: any;\n bordercolor?: any;\n borderradius?: any;\n borderstyle?: any;\n borderwidth?: any;\n borderbottomwidth?: any;\n borderleftwidth?: any;\n borderrightwidth?: any;\n bordertopwidth?: any;\n color?: any;\n display?: any;\n fontsize?: any;\n fontfamily?: any;\n fontstyle?: any;\n fontvariant?: any;\n fontweight?: any;\n height?: any;\n horizontalalign?: any;\n lineheight?: any;\n margin?: any;\n marginbottom?: any;\n marginleft?: any;\n marginright?: any;\n margintop?: any;\n opacity?: any;\n overflow?: any;\n padding?: any;\n paddingbottom?: any;\n paddingleft?: any;\n paddingright?: any;\n paddingtop?: any;\n textalign?: any;\n textdecoration?: any;\n verticalalign?: any;\n width?: any;\n zindex?: any;\n}\n\nconst styleMapping = {\n backgroundimage: 'backgroundImage',\n backgroundsize: 'backgroundSize',\n backgroundrepeat: 'backgroundRepeat',\n backgroundresizemode: 'backgroundResizeMode',\n backgroundposition: 'backgroundPosition',\n backgroundcolor: 'backgroundColor',\n bordercolor: 'borderColor',\n borderradius: 'borderRadius',\n borderstyle: 'borderStyle',\n borderwidth: 'borderWidth',\n borderbottomwidth: 'borderBottomWidth',\n borderleftwidth: 'borderLeftWidth',\n borderrightwidth: 'borderRightWidth',\n bordertopwidth: 'borderTopWidth',\n color: 'color',\n display: 'display',\n fontsize: 'fontSize',\n fontfamily: 'fontFamily',\n fontstyle: 'fontStyle',\n fontvariant: 'fontVariant',\n fontweight: 'fontWeight',\n height: 'height',\n //horizontalalign: any;\n lineheight: 'lineHeight',\n margin: 'margin',\n marginbottom: 'marginBottom',\n marginleft: 'marginLeft',\n marginright: 'marginRight',\n margintop: 'marginTop',\n opacity: 'opacity',\n overflow: 'overflow',\n padding: 'padding',\n paddingbottom: 'paddingBottom',\n paddingleft: 'paddingLeft',\n paddingright: 'paddingRight',\n paddingtop: 'paddingTop',\n textalign: 'textAlign',\n textdecoration: 'textDecoration',\n verticalalign: 'verticalAlign',\n width: 'width',\n zindex: 'zindex'\n};\n\nexport const getStyleName = (name: string) => (styleMapping as any)[name];\n"],"mappings":";;;AAAA,OAAO,MAAMA,UAAU,CAAC;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AA0CxB;AAEA,MAAMC,YAAY,GAAG;EACjBC,eAAe,EAAE,iBAAiB;EAClCC,cAAc,EAAE,gBAAgB;EAChCC,gBAAgB,EAAE,kBAAkB;EACpCC,oBAAoB,EAAE,sBAAsB;EAC5CC,kBAAkB,EAAE,oBAAoB;EACxCC,eAAe,EAAE,iBAAiB;EAClCC,WAAW,EAAE,aAAa;EAC1BC,YAAY,EAAE,cAAc;EAC5BC,WAAW,EAAE,aAAa;EAC1BC,WAAW,EAAE,aAAa;EAC1BC,iBAAiB,EAAE,mBAAmB;EACtCC,eAAe,EAAE,iBAAiB;EAClCC,gBAAgB,EAAE,kBAAkB;EACpCC,cAAc,EAAE,gBAAgB;EAChCC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,WAAW,EAAE,aAAa;EAC1BC,UAAU,EAAE,YAAY;EACxBC,MAAM,EAAE,QAAQ;EAChB;EACAC,UAAU,EAAE,YAAY;EACxBC,MAAM,EAAE,QAAQ;EAChBC,YAAY,EAAE,cAAc;EAC5BC,UAAU,EAAE,YAAY;EACxBC,WAAW,EAAE,aAAa;EAC1BC,SAAS,EAAE,WAAW;EACtBC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,WAAW,EAAE,aAAa;EAC1BC,YAAY,EAAE,cAAc;EAC5BC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,cAAc,EAAE,gBAAgB;EAChCC,aAAa,EAAE,eAAe;EAC9BC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,YAAY,GAAIC,IAAY,IAAM1C,YAAY,CAAS0C,IAAI,CAAC"}
|
app-rn-runtime/styles/theme.js
CHANGED
|
@@ -3,13 +3,12 @@ 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 { cloneDeep, forEach, flatten, isArray, isEmpty, isObject, isString, get, reverse } from 'lodash';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { ImageBackground } from 'react-native';
|
|
7
6
|
import { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
8
7
|
import EventNotifier from '@wavemaker/app-rn-runtime/core/event-notifier';
|
|
9
8
|
import ViewPort, { EVENTS as ViewPortEvents } from '@wavemaker/app-rn-runtime/core/viewport';
|
|
10
9
|
import MediaQueryList from './MediaQueryList';
|
|
11
10
|
import ThemeVariables from './theme.variables';
|
|
12
|
-
import { getStyleReference, isValidStyleProp } from './style-prop.validator';
|
|
11
|
+
import { getErrorMessage, getStyleReference, isValidStyleProp } from './style-prop.validator';
|
|
13
12
|
export const DEFAULT_CLASS = 'DEFAULT_CLASS';
|
|
14
13
|
if (typeof window !== "undefined") {
|
|
15
14
|
// @ts-ignore: does not properly extend MediaQueryList
|
|
@@ -64,15 +63,12 @@ export class Theme {
|
|
|
64
63
|
checkStyleProperties(name, value) {
|
|
65
64
|
if (isObject(value)) {
|
|
66
65
|
Object.keys(value).map(k => this.checkStyleProperties(k, value[k]));
|
|
67
|
-
} else if (!isValidStyleProp(name, value)) {
|
|
68
|
-
console.log(`%cInvalid Style property
|
|
66
|
+
} else if (name && !isValidStyleProp(name, value)) {
|
|
67
|
+
console.log(`%cInvalid Style property in ${this.name}: ${getErrorMessage(name, value)}`, 'background-color: #FF0000;font-weight: bold; color: #fff');
|
|
69
68
|
console.log(`Refer: ${getStyleReference(name)}`);
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
addStyle(name, extend, style) {
|
|
73
|
-
if (this !== Theme.BASE && isWebPreviewMode()) {
|
|
74
|
-
this.checkStyleProperties(name, style);
|
|
75
|
-
}
|
|
76
72
|
this.styles[name] = deepCopy(this.getStyle(extend), this.styles[name], style);
|
|
77
73
|
}
|
|
78
74
|
addTrace(styleName, mergedChildstyle, childStyle, parentStyle) {
|
|
@@ -147,6 +143,9 @@ export class Theme {
|
|
|
147
143
|
if (!mediaQuery || matchMedia(mediaQuery).matches) {
|
|
148
144
|
clonedStyle = cloneDeep(this.styles[name]);
|
|
149
145
|
}
|
|
146
|
+
if (this !== Theme.BASE && isWebPreviewMode()) {
|
|
147
|
+
this.checkStyleProperties('', clonedStyle);
|
|
148
|
+
}
|
|
150
149
|
style = deepCopy(parentStyle, clonedStyle);
|
|
151
150
|
this.addTrace(`@${this.name}:${name}`, style, clonedStyle, parentStyle);
|
|
152
151
|
}
|
|
@@ -187,36 +186,6 @@ ViewPort.subscribe(ViewPortEvents.SIZE_CHANGE, () => {
|
|
|
187
186
|
Theme.BASE.reset();
|
|
188
187
|
});
|
|
189
188
|
export default Theme.BASE;
|
|
190
|
-
export const attachBackground = (c, style) => {
|
|
191
|
-
const background = style._background;
|
|
192
|
-
if (background) {
|
|
193
|
-
const backgroundStyle = {
|
|
194
|
-
width: style.width || '100%',
|
|
195
|
-
height: style.height || '100%'
|
|
196
|
-
};
|
|
197
|
-
Object.keys(background).forEach(k => {
|
|
198
|
-
if (k !== 'imageStyle') {
|
|
199
|
-
backgroundStyle[k] = background[k];
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
const imgSrc = background.uri;
|
|
203
|
-
let source;
|
|
204
|
-
if (isString(imgSrc) && (imgSrc.startsWith('http') || imgSrc.startsWith('file:'))) {
|
|
205
|
-
source = {
|
|
206
|
-
uri: imgSrc
|
|
207
|
-
};
|
|
208
|
-
} else {
|
|
209
|
-
source = imgSrc;
|
|
210
|
-
}
|
|
211
|
-
return /*#__PURE__*/React.createElement(ImageBackground, {
|
|
212
|
-
source: source,
|
|
213
|
-
resizeMode: background.resizeMode || 'repeat',
|
|
214
|
-
imageStyle: background.imageStyle,
|
|
215
|
-
style: backgroundStyle
|
|
216
|
-
}, c);
|
|
217
|
-
}
|
|
218
|
-
return c;
|
|
219
|
-
};
|
|
220
189
|
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
221
190
|
export const ThemeProvider = ThemeContext.Provider;
|
|
222
191
|
export const ThemeConsumer = ThemeContext.Consumer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cloneDeep","forEach","flatten","isArray","isEmpty","isObject","isString","get","reverse","React","ImageBackground","deepCopy","isWebPreviewMode","EventNotifier","ViewPort","EVENTS","ViewPortEvents","MediaQueryList","ThemeVariables","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","BASE","styles","getStyle","addTrace","styleName","mergedChildstyle","childStyle","parentStyle","v","__trace","prefix","result","collect","mergeStyle","flattenStyles","s","cs","filter","length","indexOf","split","c","mediaQuery","clonedStyle","matches","$new","newTheme","reset","destroy","i","splice","themeVariables","CHANGE","SIZE_CHANGE","attachBackground","background","_background","backgroundStyle","width","height","imgSrc","uri","source","startsWith","resizeMode","imageStyle","ThemeContext","createContext","ThemeProvider","Provider","ThemeConsumer","Consumer","addColStyles","device","minWidth","root","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","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 { 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: '${value}' is not a valid value to '${name}' in ${this.name}.`,\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 if (this !== Theme.BASE && isWebPreviewMode()) {\n this.checkStyleProperties(name, style);\n }\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 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};\nexport const attachBackground = (c: ReactNode, style: ViewStyle) => {\n const background = (style as any)._background;\n if (background) {\n const backgroundStyle = {\n width: style.width || '100%',\n height: style.height || '100%'\n } as any;\n Object.keys(background).forEach(k => {\n if (k !== 'imageStyle') {\n backgroundStyle[k] = background[k];\n }\n });\n const imgSrc = background.uri;\n let source;\n if (isString(imgSrc) && (imgSrc.startsWith('http') || imgSrc.startsWith('file:'))) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n return (\n <ImageBackground\n source={source}\n resizeMode={background.resizeMode || 'repeat'}\n imageStyle={background.imageStyle}\n style={backgroundStyle}>\n {c}\n </ImageBackground>);\n }\n return c;\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,Q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AC,YAAY,EAAE,EAAE,EAAE;IAAEmE,IAAI,EAAE;MAAEqB,eAAe,EAAE7C,cAAc,CAACkD;IAAa;EAAC,CAAC,CAAC;EAErF7F,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE;IAAEmE,IAAI,EAAE;MAAE2B,WAAW,EAAEnD,cAAc,CAAC8C;IAAY;EAAC,CAAC,CAAC;EACnFzF,QAAQ,CAAC,aAAa,EAAE,EAAE,EAAE;IAAEmE,IAAI,EAAE;MAAE2B,WAAW,EAAEnD,cAAc,CAAC+C;IAAU;EAAC,CAAC,CAAC;EAC/E1F,QAAQ,CAAC,gBAAgB,EAAE,EAAE,EAAE;IAAEmE,IAAI,EAAE;MAAE2B,WAAW,EAAEnD,cAAc,CAACgD;IAAa;EAAC,CAAC,CAAC;EACrF3F,QAAQ,CAAC,gBAAgB,EAAE,EAAE,EAAE;IAAEmE,IAAI,EAAE;MAAE2B,WAAW,EAAEnD,cAAc,CAACiD;IAAa;EAAC,CAAC,CAAC;EACrF5F,QAAQ,CAAC,gBAAgB,EAAE,EAAE,EAAE;IAAEmE,IAAI,EAAE;MAAE2B,WAAW,EAAEnD,cAAc,CAACkD;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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C;AACzF,CAAC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { WS_CONSTANTS } from '@wavemaker/app-rn-runtime/variables/utils/variable.constants';
|
|
3
|
-
import { get, isEmpty } from 'lodash';
|
|
4
3
|
import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
5
4
|
import injector from '@wavemaker/app-rn-runtime/core/injector';
|
|
6
5
|
export class HttpService {
|
|
@@ -9,23 +8,15 @@ export class HttpService {
|
|
|
9
8
|
const serviceInfo = variable.serviceInfo;
|
|
10
9
|
let headers = options.headers,
|
|
11
10
|
requestBody = options.data,
|
|
12
|
-
|
|
13
|
-
url = isProxyCall ? '.' + options.url : options.url;
|
|
11
|
+
url = options.url;
|
|
14
12
|
variable.cancelTokenSource = axios.CancelToken.source();
|
|
15
|
-
if (!isWebPreviewMode() && !(url.startsWith('http://') || url.startsWith("https://"))) {
|
|
16
|
-
const queryParams = options.url.split('?');
|
|
17
|
-
url = variable.config.baseUrl + serviceInfo.relativePath;
|
|
18
|
-
if (!isEmpty(queryParams[1])) {
|
|
19
|
-
url = url + '?' + queryParams[1];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
13
|
if (!isWebPreviewMode() && ((variable === null || variable === void 0 ? void 0 : (_variable$serviceInfo = variable.serviceInfo) === null || _variable$serviceInfo === void 0 ? void 0 : _variable$serviceInfo.consumes) || [])[0] === 'multipart/form-data') {
|
|
23
14
|
headers['Content-Type'] = 'multipart/form-data';
|
|
24
15
|
let formData = new FormData();
|
|
25
16
|
(variable.serviceInfo.parameters || []).forEach(p => {
|
|
26
|
-
const v = variable.
|
|
17
|
+
const v = variable.params[p.name];
|
|
27
18
|
if (v) {
|
|
28
|
-
formData.append(p.name, variable.
|
|
19
|
+
formData.append(p.name, variable.params[p.name]);
|
|
29
20
|
}
|
|
30
21
|
});
|
|
31
22
|
requestBody = formData;
|