@wavemaker-ai/app-rn-runtime 1.0.0-rc.322 → 1.0.0-rc.326
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/basic/bottomsheet/bottomsheet.component.js +156 -14
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/basic/bottomsheet/bottomsheet.styles.js +0 -3
- package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
- package/components/basic/button/button.component.js +4 -2
- package/components/basic/button/button.component.js.map +1 -1
- package/components/basic/message/message.component.js +1 -0
- package/components/basic/message/message.component.js.map +1 -1
- package/components/basic/progress-circle/progress-circle.component.js +3 -1
- package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- package/components/basic/search/search.styles.js +8 -3
- package/components/basic/search/search.styles.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/basechart.component.js +0 -1
- package/components/chart/basechart.component.js.map +1 -1
- package/components/chart/basechart.props.js +1 -0
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/container/container.component.js +24 -1
- package/components/container/container.component.js.map +1 -1
- package/components/container/container.props.js +7 -0
- package/components/container/container.props.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +25 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +1 -0
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.component.js +5 -14
- package/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.props.js +0 -2
- package/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.styles.js +1 -43
- package/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- package/components/container/tabs/tabs.component.js +2 -6
- package/components/container/tabs/tabs.component.js.map +1 -1
- package/components/container/tabs/tabs.props.js +0 -2
- package/components/container/tabs/tabs.props.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.component.js +22 -3
- package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.props.js +2 -0
- package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- package/components/data/form/form-field/form-field.component.js +2 -0
- package/components/data/form/form-field/form-field.component.js.map +1 -1
- package/components/data/form/form-field/form-field.props.js +2 -0
- package/components/data/form/form-field/form-field.props.js.map +1 -1
- package/components/data/form/form.component.js +4 -1
- package/components/data/form/form.component.js.map +1 -1
- package/components/data/list/list.styles.js +1 -0
- package/components/data/list/list.styles.js.map +1 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js +2 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- package/components/input/baseinput/baseinput.component.js +28 -3
- package/components/input/baseinput/baseinput.component.js.map +1 -1
- package/components/input/baseinput/baseinput.props.js +1 -0
- package/components/input/baseinput/baseinput.props.js.map +1 -1
- package/components/input/basenumber/basenumber.component.js +18 -3
- package/components/input/basenumber/basenumber.component.js.map +1 -1
- package/components/input/basenumber/basenumber.props.js +1 -0
- package/components/input/basenumber/basenumber.props.js.map +1 -1
- package/components/input/calendar/calendar.component.js +4 -0
- package/components/input/calendar/calendar.component.js.map +1 -1
- package/components/input/calendar/views/month-view.js +8 -1
- package/components/input/calendar/views/month-view.js.map +1 -1
- package/components/input/checkboxset/checkboxset.component.js +3 -3
- package/components/input/checkboxset/checkboxset.component.js.map +1 -1
- package/components/input/checkboxset/checkboxset.props.js +1 -0
- package/components/input/checkboxset/checkboxset.props.js.map +1 -1
- package/components/input/checkboxset/checkboxset.styles.js +6 -0
- package/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- package/components/input/currency/currency.component.js +1 -0
- package/components/input/currency/currency.component.js.map +1 -1
- package/components/input/currency/currency.styles.js +4 -0
- package/components/input/currency/currency.styles.js.map +1 -1
- package/components/input/number/number.component.js +1 -0
- package/components/input/number/number.component.js.map +1 -1
- package/components/input/number/number.styles.js +4 -0
- package/components/input/number/number.styles.js.map +1 -1
- package/components/input/radioset/radioset.component.js +5 -3
- package/components/input/radioset/radioset.component.js.map +1 -1
- package/components/input/radioset/radioset.props.js +1 -0
- package/components/input/radioset/radioset.props.js.map +1 -1
- package/components/input/radioset/radioset.styles.js +6 -0
- package/components/input/radioset/radioset.styles.js.map +1 -1
- package/components/input/text/text.component.js +14 -3
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +1 -0
- package/components/input/text/text.props.js.map +1 -1
- package/components/input/text/text.styles.js +3 -1
- package/components/input/text/text.styles.js.map +1 -1
- package/components/input/textarea/textarea.component.js +3 -2
- package/components/input/textarea/textarea.component.js.map +1 -1
- package/components/input/textarea/textarea.styles.js +4 -0
- package/components/input/textarea/textarea.styles.js.map +1 -1
- package/components/input/toggle/toggle.component.js +4 -13
- package/components/input/toggle/toggle.component.js.map +1 -1
- package/components/input/toggle/toggle.props.js +1 -3
- package/components/input/toggle/toggle.props.js.map +1 -1
- package/components/input/toggle/toggle.styles.js +4 -12
- package/components/input/toggle/toggle.styles.js.map +1 -1
- package/components/navigation/appnavbar/appnavbar.props.js +1 -1
- package/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- package/components/page/tabbar/tabbar.component.js +3 -2
- package/components/page/tabbar/tabbar.component.js.map +1 -1
- package/core/AppConfig.js.map +1 -1
- package/core/advanced-promise-rejection-tracker.js +1 -2
- package/core/advanced-promise-rejection-tracker.js.map +1 -1
- package/core/auto-layout-host.component.js +8 -2
- package/core/auto-layout-host.component.js.map +1 -1
- package/core/components/floatinglabel.component.js +5 -2
- package/core/components/floatinglabel.component.js.map +1 -1
- package/core/components/textinput.component.js +23 -3
- package/core/components/textinput.component.js.map +1 -1
- package/core/outside-press-handler.js +65 -0
- package/core/outside-press-handler.js.map +1 -0
- package/core/tappable.component.js +109 -15
- package/core/tappable.component.js.map +1 -1
- package/core/viewport.js +13 -8
- package/core/viewport.js.map +1 -1
- package/gestures/carousel-swipe.animation.js +0 -1
- package/gestures/carousel-swipe.animation.js.map +1 -1
- package/npm-shrinkwrap.json +4166 -6251
- package/package-lock.json +4166 -6251
- package/package.json +18 -16
- package/runtime/navigator/drawer.navigator.js +1 -0
- package/runtime/navigator/drawer.navigator.js.map +1 -1
- package/runtime/navigator/stack.navigator.js +16 -1
- package/runtime/navigator/stack.navigator.js.map +1 -1
- package/runtime/services/device/scan-service.js +12 -34
- package/runtime/services/device/scan-service.js.map +1 -1
- package/styles/theme.js +7 -0
- package/styles/theme.js.map +1 -1
- package/styles/theme.variables.js.map +1 -1
- package/components-prism/basic/search/search.component.js +0 -171
- package/components-prism/basic/search/search.component.js.map +0 -1
- package/components-prism/basic/search/search.props.js +0 -13
- package/components-prism/basic/search/search.props.js.map +0 -1
- package/components-prism/basic/search/search.styles.js +0 -115
- package/components-prism/basic/search/search.styles.js.map +0 -1
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Platform, Text, TextInput, View } from 'react-native';
|
|
4
|
-
import { ScrollView } from 'react-native-gesture-handler';
|
|
5
|
-
import { isEmpty, isNull } from 'lodash';
|
|
6
|
-
import WmSearchProps from './search.props';
|
|
7
|
-
import { DEFAULT_CLASS } from './search.styles';
|
|
8
|
-
import CoreWmSearch, { WmSearchState as CoreWmSearchState } from '@wavemaker-ai/app-rn-runtime/components/basic/search/search.component';
|
|
9
|
-
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';
|
|
10
|
-
import { ModalConsumer } from '@wavemaker-ai/app-rn-runtime/core/modal.service';
|
|
11
|
-
import WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';
|
|
12
|
-
import WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';
|
|
13
|
-
import { Tappable } from '@wavemaker-ai/app-rn-runtime/core/tappable.component';
|
|
14
|
-
import { AssetProvider } from '@wavemaker-ai/app-rn-runtime/core/asset.provider';
|
|
15
|
-
import { createSkeleton } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
|
16
|
-
export class WmSearchState extends CoreWmSearchState {}
|
|
17
|
-
function isIconClass(val) {
|
|
18
|
-
return typeof val === 'string' && val.length > 0 && val !== 'false' && val !== 'null' && val !== 'undefined';
|
|
19
|
-
}
|
|
20
|
-
export default class WmSearch extends CoreWmSearch {
|
|
21
|
-
constructor(props, defaultClass = DEFAULT_CLASS, defaultProps = new WmSearchProps(), defaultState = new WmSearchState()) {
|
|
22
|
-
super(props, defaultClass, defaultProps, defaultState);
|
|
23
|
-
}
|
|
24
|
-
handleLeadingIconPress() {
|
|
25
|
-
this.invokeEventCallback('onLeadingiconclick', [this.proxy]);
|
|
26
|
-
}
|
|
27
|
-
handleBackIconPress() {
|
|
28
|
-
this.hide();
|
|
29
|
-
}
|
|
30
|
-
handleTrailingIconPress() {
|
|
31
|
-
this.invokeEventCallback('onTrailingiconclick', [this.proxy]);
|
|
32
|
-
}
|
|
33
|
-
renderSkeleton(props) {
|
|
34
|
-
var _this$styles$root, _this$styles$root2;
|
|
35
|
-
return createSkeleton(this.theme, this.styles.skeleton, {
|
|
36
|
-
...this.styles.root,
|
|
37
|
-
width: props.skeletonwidth || ((_this$styles$root = this.styles.root) === null || _this$styles$root === void 0 ? void 0 : _this$styles$root.width),
|
|
38
|
-
height: props.skeletonheight || ((_this$styles$root2 = this.styles.root) === null || _this$styles$root2 === void 0 ? void 0 : _this$styles$root2.height)
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
renderSearchItem(item, index) {
|
|
42
|
-
const props = this.state.props;
|
|
43
|
-
const imageStyles = {
|
|
44
|
-
root: {
|
|
45
|
-
height: props.imagewidth,
|
|
46
|
-
width: props.imagewidth
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return /*#__PURE__*/React.createElement(Tappable, _extends({
|
|
50
|
-
key: item.key || `${props.name}-item-${index}`,
|
|
51
|
-
onTap: this.onItemSelect.bind(this, item)
|
|
52
|
-
}, this.getTestProps(`action${index}`), {
|
|
53
|
-
disableTouchEffect: this.state.props.disabletoucheffect
|
|
54
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
55
|
-
style: this.styles.searchItem
|
|
56
|
-
}, !isEmpty(this.state.template) && this.props.renderitempartial ? this.props.renderitempartial(item.dataObject, index, this.state.template) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WmPicture, {
|
|
57
|
-
id: this.getTestId(`picture${index}`),
|
|
58
|
-
styles: imageStyles,
|
|
59
|
-
name: props.name + '_image',
|
|
60
|
-
picturesource: item.imgSrc
|
|
61
|
-
}), /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel(index + ''), {
|
|
62
|
-
style: this.styles.searchItemText
|
|
63
|
-
}), item.displayexp || item.displayfield))));
|
|
64
|
-
}
|
|
65
|
-
renderDropdownContent(props, filteredData) {
|
|
66
|
-
const items = filteredData.map((item, index) => {
|
|
67
|
-
if (props.limit && index + 1 > props.limit) return null;
|
|
68
|
-
return this.renderSearchItem(item, index);
|
|
69
|
-
});
|
|
70
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
71
|
-
style: {
|
|
72
|
-
width: '100%'
|
|
73
|
-
}
|
|
74
|
-
}, /*#__PURE__*/React.createElement(AssetProvider, {
|
|
75
|
-
value: this.loadAsset
|
|
76
|
-
}, props.scrollablesearchresults ? /*#__PURE__*/React.createElement(ScrollView, {
|
|
77
|
-
style: this.styles.dropdownScrollView,
|
|
78
|
-
contentContainerStyle: this.styles.dropDownContent,
|
|
79
|
-
showsVerticalScrollIndicator: false
|
|
80
|
-
}, items) : /*#__PURE__*/React.createElement(View, {
|
|
81
|
-
style: this.styles.dropDownContent
|
|
82
|
-
}, items)));
|
|
83
|
-
}
|
|
84
|
-
renderWidget(props) {
|
|
85
|
-
var _this$state$data$leng, _this$state$data, _this$styles$placehol;
|
|
86
|
-
const isOpened = this.state.isOpened;
|
|
87
|
-
const filteredData = this.state.data || [];
|
|
88
|
-
const hasResults = filteredData.length > 0;
|
|
89
|
-
const isDropdownVisible = isOpened && hasResults;
|
|
90
|
-
if (isOpened && !hasResults) {
|
|
91
|
-
setTimeout(() => this.hide(), 0);
|
|
92
|
-
}
|
|
93
|
-
const leadingIcon = props.leadingiconclass;
|
|
94
|
-
const hasLeadingIcon = isIconClass(leadingIcon);
|
|
95
|
-
const hasTrailingIcon = isIconClass(props.searchiconclass);
|
|
96
|
-
const isSearchType = props.type === 'search';
|
|
97
|
-
const showLeadingIcon = hasLeadingIcon && !isDropdownVisible;
|
|
98
|
-
const showBackIcon = hasLeadingIcon && isDropdownVisible;
|
|
99
|
-
const showSearchIcon = isSearchType && hasTrailingIcon && !isDropdownVisible;
|
|
100
|
-
const showClearIcon = isSearchType && hasTrailingIcon && isDropdownVisible;
|
|
101
|
-
let inputOpts = {};
|
|
102
|
-
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
|
103
|
-
inputOpts[valueExpr] = this.state.props.query || '';
|
|
104
|
-
const rootStyle = [this.styles.root, isDropdownVisible ? {
|
|
105
|
-
borderBottomLeftRadius: 0,
|
|
106
|
-
borderBottomRightRadius: 0
|
|
107
|
-
} : null];
|
|
108
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
109
|
-
onLayout: event => this.handleLayout(event)
|
|
110
|
-
}, this._background, /*#__PURE__*/React.createElement(View, {
|
|
111
|
-
style: rootStyle,
|
|
112
|
-
ref: ref => {
|
|
113
|
-
this.view = ref;
|
|
114
|
-
},
|
|
115
|
-
onLayout: e => {
|
|
116
|
-
this.searchInputWidth = e.nativeEvent.layout.width;
|
|
117
|
-
}
|
|
118
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
119
|
-
style: [this.styles.searchInputWrapper, hasLeadingIcon ? this.styles.inputWithLeadingIcon : {}, hasTrailingIcon ? this.styles.inputWithTrailingIcon : {}]
|
|
120
|
-
}, /*#__PURE__*/React.createElement(TextInput, _extends({}, this.getTestPropsForInput(), getAccessibilityProps(AccessibilityWidgetType.SEARCH, props), {
|
|
121
|
-
ref: ref => {
|
|
122
|
-
this.widgetRef = ref;
|
|
123
|
-
// @ts-ignore
|
|
124
|
-
if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
ref.selectionStart = ref.selectionEnd = this.cursor;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
style: [this.styles.text, this.state.isValid ? {} : this.styles.invalid, this.state.isOpened && ((_this$state$data$leng = (_this$state$data = this.state.data) === null || _this$state$data === void 0 ? void 0 : _this$state$data.length) !== null && _this$state$data$leng !== void 0 ? _this$state$data$leng : 0) > 0 ? this.styles.focusedText : null, this.styles.input, Platform.OS === 'web' ? this.styles.inputWeb : null],
|
|
130
|
-
placeholder: props.placeholder || 'Search',
|
|
131
|
-
placeholderTextColor: (_this$styles$placehol = this.styles.placeholderText) === null || _this$styles$placehol === void 0 ? void 0 : _this$styles$placehol.color,
|
|
132
|
-
autoFocus: props.autofocus,
|
|
133
|
-
editable: !(props.disabled || props.readonly),
|
|
134
|
-
autoComplete: "off",
|
|
135
|
-
autoCorrect: false,
|
|
136
|
-
autoCapitalize: "none",
|
|
137
|
-
onChangeText: this.onChange.bind(this),
|
|
138
|
-
onChange: this.invokeChange.bind(this),
|
|
139
|
-
onFocus: this.onFocus.bind(this),
|
|
140
|
-
onBlur: this.onBlur.bind(this)
|
|
141
|
-
}, inputOpts))), (showLeadingIcon || showBackIcon) && /*#__PURE__*/React.createElement(View, {
|
|
142
|
-
style: [this.styles.iconWrapper, {
|
|
143
|
-
left: 4
|
|
144
|
-
}],
|
|
145
|
-
pointerEvents: "box-none"
|
|
146
|
-
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
147
|
-
styles: this.styles.leadingIcon,
|
|
148
|
-
id: this.getTestId(showBackIcon ? 'backicon' : 'leadingicon'),
|
|
149
|
-
iconclass: showBackIcon ? props.backsearchiconclass || 'wi wi-arrow-left' : leadingIcon,
|
|
150
|
-
iconsize: 24,
|
|
151
|
-
onTap: showBackIcon ? this.handleBackIconPress.bind(this) : this.handleLeadingIconPress.bind(this),
|
|
152
|
-
disabled: !showBackIcon && (props.disabled || props.readonly)
|
|
153
|
-
})), (showSearchIcon || showClearIcon || hasTrailingIcon && props.searchiconclass) && /*#__PURE__*/React.createElement(View, {
|
|
154
|
-
style: [this.styles.iconWrapper, {
|
|
155
|
-
right: 4
|
|
156
|
-
}],
|
|
157
|
-
pointerEvents: "box-none"
|
|
158
|
-
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
159
|
-
styles: this.styles.trailingIcon,
|
|
160
|
-
id: this.getTestId(showClearIcon ? 'clear' : showSearchIcon ? 'search' : 'trailingicon'),
|
|
161
|
-
iconclass: showClearIcon ? props.clearsearchiconclass || 'wi wi-clear' : props.searchiconclass || props.iconclass || 'wm-sl-l sl-search',
|
|
162
|
-
iconsize: 24,
|
|
163
|
-
onTap: showClearIcon ? this.clearSearch.bind(this) : showSearchIcon ? this.searchIconPress.bind(this) : this.handleTrailingIconPress.bind(this),
|
|
164
|
-
disabled: !showClearIcon && (props.disabled || props.readonly)
|
|
165
|
-
}))), isDropdownVisible ? /*#__PURE__*/React.createElement(ModalConsumer, null, modalService => {
|
|
166
|
-
modalService.showModal(this.prepareModalOptions(this.renderDropdownContent(props, filteredData), this.styles, modalService));
|
|
167
|
-
return null;
|
|
168
|
-
}) : null);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
//# sourceMappingURL=search.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Text","TextInput","View","ScrollView","isEmpty","isNull","WmSearchProps","DEFAULT_CLASS","CoreWmSearch","WmSearchState","CoreWmSearchState","AccessibilityWidgetType","getAccessibilityProps","ModalConsumer","WmIcon","WmPicture","Tappable","AssetProvider","createSkeleton","isIconClass","val","length","WmSearch","constructor","props","defaultClass","defaultProps","defaultState","handleLeadingIconPress","invokeEventCallback","proxy","handleBackIconPress","hide","handleTrailingIconPress","renderSkeleton","_this$styles$root","_this$styles$root2","theme","styles","skeleton","root","width","skeletonwidth","height","skeletonheight","renderSearchItem","item","index","state","imageStyles","imagewidth","createElement","_extends","key","name","onTap","onItemSelect","bind","getTestProps","disableTouchEffect","disabletoucheffect","style","searchItem","template","renderitempartial","dataObject","Fragment","id","getTestId","picturesource","imgSrc","getTestPropsForLabel","searchItemText","displayexp","displayfield","renderDropdownContent","filteredData","items","map","limit","value","loadAsset","scrollablesearchresults","dropdownScrollView","contentContainerStyle","dropDownContent","showsVerticalScrollIndicator","renderWidget","_this$state$data$leng","_this$state$data","_this$styles$placehol","isOpened","data","hasResults","isDropdownVisible","setTimeout","leadingIcon","leadingiconclass","hasLeadingIcon","hasTrailingIcon","searchiconclass","isSearchType","type","showLeadingIcon","showBackIcon","showSearchIcon","showClearIcon","inputOpts","valueExpr","OS","query","rootStyle","borderBottomLeftRadius","borderBottomRightRadius","onLayout","event","handleLayout","_background","ref","view","e","searchInputWidth","nativeEvent","layout","searchInputWrapper","inputWithLeadingIcon","inputWithTrailingIcon","getTestPropsForInput","SEARCH","widgetRef","selectionStart","selectionEnd","cursor","text","isValid","invalid","focusedText","input","inputWeb","placeholder","placeholderTextColor","placeholderText","color","autoFocus","autofocus","editable","disabled","readonly","autoComplete","autoCorrect","autoCapitalize","onChangeText","onChange","invokeChange","onFocus","onBlur","iconWrapper","left","pointerEvents","iconclass","backsearchiconclass","iconsize","right","trailingIcon","clearsearchiconclass","clearSearch","searchIconPress","modalService","showModal","prepareModalOptions"],"sources":["search.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Platform, Text, TextInput, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { isEmpty, isNull } from 'lodash';\n\nimport WmSearchProps from './search.props';\nimport { DEFAULT_CLASS } from './search.styles';\nimport CoreWmSearch, { WmSearchState as CoreWmSearchState } from '@wavemaker-ai/app-rn-runtime/components/basic/search/search.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { ModalConsumer, ModalService } from '@wavemaker-ai/app-rn-runtime/core/modal.service';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';\nimport { Tappable } from '@wavemaker-ai/app-rn-runtime/core/tappable.component';\nimport { AssetProvider } from '@wavemaker-ai/app-rn-runtime/core/asset.provider';\nimport { createSkeleton } from '@wavemaker-ai/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmSearchState extends CoreWmSearchState {\n}\n\nfunction isIconClass(val: any): boolean {\n return typeof val === 'string' && val.length > 0 && val !== 'false' && val !== 'null' && val !== 'undefined';\n}\n\nexport default class WmSearch extends (CoreWmSearch as any) {\n\n constructor(\n props: WmSearchProps,\n defaultClass: string = DEFAULT_CLASS,\n defaultProps: WmSearchProps = new WmSearchProps(),\n defaultState: WmSearchState = new WmSearchState(),\n ) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n private handleLeadingIconPress() {\n this.invokeEventCallback('onLeadingiconclick', [this.proxy]);\n }\n\n private handleBackIconPress() {\n this.hide();\n }\n\n private handleTrailingIconPress() {\n this.invokeEventCallback('onTrailingiconclick', [this.proxy]);\n }\n\n public renderSkeleton(props: WmSearchProps): React.ReactNode {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: (props.skeletonwidth || this.styles.root?.width) as DimensionValue,\n height: (props.skeletonheight || this.styles.root?.height) as DimensionValue,\n });\n }\n\n renderSearchItem(item: any, index: number) {\n const props = this.state.props as WmSearchProps;\n const imageStyles = { root: { height: props.imagewidth, width: props.imagewidth } };\n return (\n <Tappable\n key={item.key || `${props.name}-item-${index}`}\n onTap={this.onItemSelect.bind(this, item)}\n {...this.getTestProps(`action${index}`)}\n disableTouchEffect={this.state.props.disabletoucheffect}\n >\n <View style={this.styles.searchItem}>\n {!isEmpty(this.state.template) && this.props.renderitempartial ? (\n this.props.renderitempartial(item.dataObject, index, this.state.template)\n ) : (\n <>\n <WmPicture\n id={this.getTestId(`picture${index}`)}\n styles={imageStyles}\n name={props.name + '_image'}\n picturesource={item.imgSrc}\n />\n <Text\n {...this.getTestPropsForLabel(index + '')}\n style={this.styles.searchItemText}\n >\n {item.displayexp || item.displayfield}\n </Text>\n </>\n )}\n </View>\n </Tappable>\n );\n }\n\n renderDropdownContent(props: WmSearchProps, filteredData: any[]) {\n const items = filteredData.map((item: any, index: number) => {\n if (props.limit && index + 1 > props.limit) return null;\n return this.renderSearchItem(item, index);\n });\n\n return (\n <View style={{ width: '100%' }}>\n <AssetProvider value={this.loadAsset}>\n {props.scrollablesearchresults ? (\n <ScrollView\n style={this.styles.dropdownScrollView}\n contentContainerStyle={this.styles.dropDownContent}\n showsVerticalScrollIndicator={false}\n >\n {items}\n </ScrollView>\n ) : (\n <View style={this.styles.dropDownContent}>\n {items}\n </View>\n )}\n </AssetProvider>\n </View>\n );\n }\n\n renderWidget(props: WmSearchProps) {\n const isOpened = this.state.isOpened;\n const filteredData = this.state.data || [];\n const hasResults = filteredData.length > 0;\n const isDropdownVisible = isOpened && hasResults;\n\n if (isOpened && !hasResults) {\n setTimeout(() => this.hide(), 0);\n }\n\n const leadingIcon = props.leadingiconclass;\n const hasLeadingIcon = isIconClass(leadingIcon);\n const hasTrailingIcon = isIconClass(props.searchiconclass); \n const isSearchType = props.type === 'search';\n const showLeadingIcon = hasLeadingIcon && !isDropdownVisible;\n const showBackIcon = hasLeadingIcon && isDropdownVisible;\n const showSearchIcon = isSearchType && hasTrailingIcon && !isDropdownVisible;\n const showClearIcon = isSearchType && hasTrailingIcon && isDropdownVisible;\n\n let inputOpts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n inputOpts[valueExpr] = this.state.props.query || '';\n\n const rootStyle = [\n this.styles.root,\n isDropdownVisible\n ? { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }\n : null,\n ];\n\n return (\n <View\n onLayout={(event: any) => this.handleLayout(event)}\n >\n {this._background}\n <View\n style={rootStyle}\n ref={(ref: any) => { this.view = ref; }}\n onLayout={(e: any) => { this.searchInputWidth = e.nativeEvent.layout.width; }}\n >\n <View style={[\n this.styles.searchInputWrapper,\n hasLeadingIcon ? this.styles.inputWithLeadingIcon : {},\n hasTrailingIcon ? this.styles.inputWithTrailingIcon : {},\n ]}>\n <TextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.SEARCH, props)}\n ref={(ref: any) => {\n this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }\n }}\n style={[\n this.styles.text,\n this.state.isValid ? {} : this.styles.invalid,\n this.state.isOpened && (this.state.data?.length ?? 0) > 0\n ? this.styles.focusedText\n : null,\n this.styles.input,\n Platform.OS === 'web' ? this.styles.inputWeb : null,\n ]}\n placeholder={props.placeholder || 'Search'}\n placeholderTextColor={this.styles.placeholderText?.color as any}\n autoFocus={props.autofocus}\n editable={!(props.disabled || props.readonly)}\n autoComplete=\"off\"\n autoCorrect={false}\n autoCapitalize=\"none\"\n onChangeText={this.onChange.bind(this)}\n onChange={this.invokeChange.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n {...inputOpts}\n />\n </View>\n\n {(showLeadingIcon || showBackIcon) && (\n <View style={[this.styles.iconWrapper, { left: 4 }]} pointerEvents=\"box-none\">\n <WmIcon\n styles={this.styles.leadingIcon}\n id={this.getTestId(showBackIcon ? 'backicon' : 'leadingicon')}\n iconclass={showBackIcon\n ? (props.backsearchiconclass || 'wi wi-arrow-left')\n : leadingIcon\n }\n iconsize={24}\n onTap={showBackIcon\n ? this.handleBackIconPress.bind(this)\n : this.handleLeadingIconPress.bind(this)\n }\n disabled={!showBackIcon && (props.disabled || props.readonly)}\n />\n </View>\n )}\n {(showSearchIcon || showClearIcon || (hasTrailingIcon && props.searchiconclass)) && (\n <View style={[this.styles.iconWrapper, { right: 4 }]} pointerEvents=\"box-none\">\n <WmIcon\n styles={this.styles.trailingIcon}\n id={this.getTestId(showClearIcon ? 'clear' : showSearchIcon ? 'search' : 'trailingicon')}\n iconclass={\n showClearIcon\n ? (props.clearsearchiconclass || 'wi wi-clear')\n : (props.searchiconclass || props.iconclass || 'wm-sl-l sl-search')\n }\n iconsize={24}\n onTap={\n showClearIcon\n ? this.clearSearch.bind(this)\n : showSearchIcon\n ? this.searchIconPress.bind(this)\n : this.handleTrailingIconPress.bind(this)\n }\n disabled={!showClearIcon && (props.disabled || props.readonly)}\n />\n </View>\n )}\n </View>\n\n {isDropdownVisible ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(\n this.prepareModalOptions(\n this.renderDropdownContent(props, filteredData),\n this.styles,\n modalService\n )\n );\n return null;\n }}\n </ModalConsumer>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9E,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAASC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAExC,OAAOC,aAAa,MAAM,gBAAgB;AA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-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import WmSearchPropsBase from '@wavemaker-ai/app-rn-runtime/components/basic/search/search.props';
|
|
5
|
-
export default class WmSearchProps extends WmSearchPropsBase {
|
|
6
|
-
constructor(...args) {
|
|
7
|
-
super(...args);
|
|
8
|
-
_defineProperty(this, "leadingiconclass", void 0);
|
|
9
|
-
_defineProperty(this, "backsearchiconclass", void 0);
|
|
10
|
-
_defineProperty(this, "scrollablesearchresults", true);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=search.props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WmSearchPropsBase","WmSearchProps","constructor","args","_defineProperty"],"sources":["search.props.ts"],"sourcesContent":["import WmSearchPropsBase from '@wavemaker-ai/app-rn-runtime/components/basic/search/search.props';\n\nexport default class WmSearchProps extends WmSearchPropsBase {\n leadingiconclass?: string;\n backsearchiconclass?: string;\n scrollablesearchresults?: boolean = true;\n}\n"],"mappings":";;;AAAA,OAAOA,iBAAiB,MAAM,mEAAmE;AAEjG,eAAe,MAAMC,aAAa,SAASD,iBAAiB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,kCAGvB,IAAI;EAAA;AAC1C","ignoreList":[]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import '@wavemaker-ai/app-rn-runtime/components/basic/search/search.styles';
|
|
2
|
-
import BASE_THEME from '@wavemaker-ai/app-rn-runtime/styles/theme';
|
|
3
|
-
import { defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';
|
|
4
|
-
export const DEFAULT_CLASS = 'app-search';
|
|
5
|
-
BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
6
|
-
const prismSearchOverrides = defineStyles({
|
|
7
|
-
root: {
|
|
8
|
-
position: 'relative',
|
|
9
|
-
borderWidth: 1
|
|
10
|
-
},
|
|
11
|
-
inputWeb: {
|
|
12
|
-
outline: 'none',
|
|
13
|
-
boxShadow: 'none'
|
|
14
|
-
},
|
|
15
|
-
leadingIcon: {
|
|
16
|
-
root: {
|
|
17
|
-
width: 48,
|
|
18
|
-
height: 48,
|
|
19
|
-
justifyContent: 'center',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
backgroundColor: 'transparent',
|
|
22
|
-
color: themeVariables.defaultColor4
|
|
23
|
-
},
|
|
24
|
-
icon: {
|
|
25
|
-
fontSize: 24
|
|
26
|
-
},
|
|
27
|
-
text: {}
|
|
28
|
-
},
|
|
29
|
-
trailingIcon: {
|
|
30
|
-
root: {
|
|
31
|
-
width: 48,
|
|
32
|
-
height: 48,
|
|
33
|
-
justifyContent: 'center',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
backgroundColor: 'transparent',
|
|
36
|
-
color: themeVariables.defaultColor4
|
|
37
|
-
},
|
|
38
|
-
icon: {
|
|
39
|
-
fontSize: 24
|
|
40
|
-
},
|
|
41
|
-
text: {}
|
|
42
|
-
},
|
|
43
|
-
inputWithLeadingIcon: {
|
|
44
|
-
paddingLeft: 38
|
|
45
|
-
},
|
|
46
|
-
inputWithTrailingIcon: {
|
|
47
|
-
paddingRight: 38
|
|
48
|
-
},
|
|
49
|
-
iconWrapper: {
|
|
50
|
-
position: 'absolute',
|
|
51
|
-
top: 0,
|
|
52
|
-
bottom: 0,
|
|
53
|
-
justifyContent: 'center'
|
|
54
|
-
},
|
|
55
|
-
modalContent: {
|
|
56
|
-
borderWidth: 0,
|
|
57
|
-
borderTopLeftRadius: 0,
|
|
58
|
-
borderTopRightRadius: 0,
|
|
59
|
-
borderBottomLeftRadius: 28,
|
|
60
|
-
borderBottomRightRadius: 28,
|
|
61
|
-
overflow: 'hidden'
|
|
62
|
-
},
|
|
63
|
-
dropDownContent: {
|
|
64
|
-
width: '100%'
|
|
65
|
-
},
|
|
66
|
-
dropdownScrollView: {
|
|
67
|
-
width: '100%',
|
|
68
|
-
maxHeight: 200
|
|
69
|
-
},
|
|
70
|
-
dropdownContainer: {
|
|
71
|
-
position: 'absolute',
|
|
72
|
-
top: 56,
|
|
73
|
-
width: '100%',
|
|
74
|
-
minHeight: 48,
|
|
75
|
-
borderTopLeftRadius: 0,
|
|
76
|
-
borderTopRightRadius: 0,
|
|
77
|
-
borderBottomLeftRadius: 28,
|
|
78
|
-
borderBottomRightRadius: 28,
|
|
79
|
-
overflow: 'hidden'
|
|
80
|
-
},
|
|
81
|
-
searchItem: {
|
|
82
|
-
gap: 12,
|
|
83
|
-
paddingHorizontal: 16,
|
|
84
|
-
paddingVertical: 12
|
|
85
|
-
},
|
|
86
|
-
searchItemText: {
|
|
87
|
-
color: themeVariables.searchItemTextColor
|
|
88
|
-
},
|
|
89
|
-
searchItemImage: {
|
|
90
|
-
width: 24,
|
|
91
|
-
height: 24,
|
|
92
|
-
borderRadius: 12
|
|
93
|
-
},
|
|
94
|
-
skeleton: {
|
|
95
|
-
root: {
|
|
96
|
-
borderRadius: 28
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
addStyle(DEFAULT_CLASS, '', prismSearchOverrides);
|
|
101
|
-
addStyle(DEFAULT_CLASS + '-disabled', '', {
|
|
102
|
-
root: {
|
|
103
|
-
opacity: 0.5
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
addStyle(DEFAULT_CLASS + '-rtl', '', {
|
|
107
|
-
root: {
|
|
108
|
-
flexDirection: 'row-reverse'
|
|
109
|
-
},
|
|
110
|
-
searchItem: {
|
|
111
|
-
flexDirection: 'row-reverse'
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
//# sourceMappingURL=search.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","prismSearchOverrides","root","position","borderWidth","inputWeb","outline","boxShadow","leadingIcon","width","height","justifyContent","alignItems","backgroundColor","color","defaultColor4","icon","fontSize","text","trailingIcon","inputWithLeadingIcon","paddingLeft","inputWithTrailingIcon","paddingRight","iconWrapper","top","bottom","modalContent","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","overflow","dropDownContent","dropdownScrollView","maxHeight","dropdownContainer","minHeight","searchItem","gap","paddingHorizontal","paddingVertical","searchItemText","searchItemTextColor","searchItemImage","borderRadius","skeleton","opacity","flexDirection"],"sources":["search.styles.ts"],"sourcesContent":["import '@wavemaker-ai/app-rn-runtime/components/basic/search/search.styles';\n\nimport { DimensionValue, TextStyle } from 'react-native';\nimport BASE_THEME, {\n AllStyle,\n} from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport { defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSearchStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/search/search.styles';\n\nexport type WmSearchPrismStyles = WmSearchStyles & {\n input: AllStyle;\n inputWeb: AllStyle;\n leadingIcon: WmIconStyles;\n trailingIcon: WmIconStyles;\n dropdownScrollView: AllStyle;\n iconWrapper: AllStyle; \n inputWithLeadingIcon: AllStyle; \n inputWithTrailingIcon: AllStyle;\n dropdownContainer: AllStyle;\n searchItemImage: AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-search';\n\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const prismSearchOverrides = defineStyles({\n root: {\n position: 'relative',\n borderWidth: 1\n },\n inputWeb: {\n outline: 'none',\n boxShadow: 'none',\n },\n leadingIcon: {\n root: {\n width: 48,\n height: 48,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'transparent',\n color: themeVariables.defaultColor4,\n },\n icon: { fontSize: 24 },\n text: {},\n } as WmIconStyles,\n trailingIcon: {\n root: {\n width: 48,\n height: 48,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'transparent',\n color: themeVariables.defaultColor4,\n },\n icon: { fontSize: 24 },\n text: {},\n } as WmIconStyles,\n inputWithLeadingIcon: {\n paddingLeft: 38,\n },\n inputWithTrailingIcon: {\n paddingRight: 38,\n },\n iconWrapper: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n justifyContent: 'center'\n },\n\n modalContent: {\n borderWidth: 0,\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomLeftRadius: 28,\n borderBottomRightRadius: 28,\n overflow: 'hidden'\n },\n dropDownContent: {\n width: '100%',\n },\n dropdownScrollView: {\n width: '100%',\n maxHeight: 200,\n },\n dropdownContainer: {\n position: 'absolute',\n top: 56,\n width: '100%',\n minHeight: 48,\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomLeftRadius: 28,\n borderBottomRightRadius: 28,\n overflow: 'hidden',\n },\n searchItem: {\n gap: 12,\n paddingHorizontal: 16,\n paddingVertical: 12,\n },\n searchItemText: {\n color: themeVariables.searchItemTextColor,\n },\n searchItemImage: {\n width: 24,\n height: 24,\n borderRadius: 12,\n },\n skeleton: {\n root: {\n borderRadius: 28,\n },\n } as any,\n }) as any;\n\n addStyle(DEFAULT_CLASS, '', prismSearchOverrides);\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root: {\n opacity: 0.5,\n },\n });\n\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root: {\n flexDirection: 'row-reverse',\n },\n searchItem: {\n flexDirection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