Update incentro.Autosearch.mpk, Autosearch.xml, and 5 more files...
This commit is contained in:
BIN
dist/1.0.0/incentro.Autosearch.mpk
vendored
BIN
dist/1.0.0/incentro.Autosearch.mpk
vendored
Binary file not shown.
7
dist/tmp/widgets/Autosearch.xml
vendored
7
dist/tmp/widgets/Autosearch.xml
vendored
@@ -20,6 +20,13 @@
|
|||||||
<caption>Editable</caption>
|
<caption>Editable</caption>
|
||||||
<description/>
|
<description/>
|
||||||
</property>
|
</property>
|
||||||
|
<property key="autoFocus" type="attribute">
|
||||||
|
<caption>Auto focus</caption>
|
||||||
|
<description>Boolean attribute to focus the element.</description>
|
||||||
|
<attributeTypes>
|
||||||
|
<attributeType name="Boolean"/>
|
||||||
|
</attributeTypes>
|
||||||
|
</property>
|
||||||
</propertyGroup>
|
</propertyGroup>
|
||||||
<propertyGroup caption="Events">
|
<propertyGroup caption="Events">
|
||||||
<property key="onChange" type="action" required="false">
|
<property key="onChange" type="action" required="false">
|
||||||
|
|||||||
@@ -244,13 +244,15 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
const defaultStyle = {
|
const defaultStyle = {
|
||||||
container: {},
|
container: {},
|
||||||
label: {
|
label: {
|
||||||
color: "#5997C0"
|
color: "#003C85"
|
||||||
},
|
},
|
||||||
input: {},
|
input: {},
|
||||||
text: {
|
text: {
|
||||||
color: "#5997C0",
|
color: "#003C85",
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
padding: 10,
|
paddingTop: 10,
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingBottom: 10
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
class Autosearch extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
class Autosearch extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
||||||
@@ -260,13 +262,33 @@ class Autosearch extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|||||||
this.onChangeHandler = this.onChange.bind(this);
|
this.onChangeHandler = this.onChange.bind(this);
|
||||||
this.onTouchStart = this.onTouch.bind(this);
|
this.onTouchStart = this.onTouch.bind(this);
|
||||||
this.onEndHandler = this.onEnd.bind(this);
|
this.onEndHandler = this.onEnd.bind(this);
|
||||||
|
this.inputRef = Object(react__WEBPACK_IMPORTED_MODULE_0__["createRef"])();
|
||||||
this.state = {
|
this.state = {
|
||||||
textboxValue: '',
|
textboxValue: '',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
componentDidUpdate(prevProps) {
|
||||||
|
var _a;
|
||||||
|
if (prevProps.autoFocus !== this.props.autoFocus) {
|
||||||
|
if (this.props.autoFocus.value) {
|
||||||
|
setTimeout(() => {
|
||||||
|
var _a;
|
||||||
|
(_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
||||||
|
this.props.autoFocus.setValue(false);
|
||||||
|
return;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (prevProps.searchvalue !== this.props.searchvalue) {
|
||||||
|
if (this.props.searchvalue === undefined || this.props.searchvalue.displayValue === '') {
|
||||||
|
this.setState({ textboxValue: '' });
|
||||||
|
(_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.clear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
render() {
|
render() {
|
||||||
return (Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.input },
|
return (Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.input },
|
||||||
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["TextInput"], { style: this.styles.text, value: this.state.textboxValue, onChangeText: this.onChangeHandler, onTouchStart: this.onTouchStart, onEndEditing: this.onEndHandler, placeholder: 'Zoeken naar monumentenborden', placeholderTextColor: "#5997C0", editable: this.props.editable })));
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["TextInput"], { style: this.styles.text, value: this.state.textboxValue, onChangeText: this.onChangeHandler, onTouchStart: this.onTouchStart, onEndEditing: this.onEndHandler, placeholder: 'Zoeken naar monumentenborden', placeholderTextColor: "#5997C0", editable: this.props.editable, ref: this.inputRef })));
|
||||||
}
|
}
|
||||||
onChange(text) {
|
onChange(text) {
|
||||||
this.setState({ textboxValue: text });
|
this.setState({ textboxValue: text });
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
import { Component, ReactNode, createElement } from "react";
|
import { Component, ReactNode, createElement, createRef } from "react";
|
||||||
import { TextStyle, ViewStyle, TextInput, View } from "react-native";
|
import { TextStyle, ViewStyle, TextInput, View } from "react-native";
|
||||||
|
|
||||||
import { Style, mergeNativeStyles } from "@mendix/pluggable-widgets-tools";
|
import { Style, mergeNativeStyles } from "@mendix/pluggable-widgets-tools";
|
||||||
@@ -26,7 +26,9 @@ const defaultStyle: AutosearchStyle = {
|
|||||||
text: {
|
text: {
|
||||||
color: "#003C85",
|
color: "#003C85",
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
padding: 10,
|
paddingTop: 10,
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingBottom: 10
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -35,6 +37,7 @@ export class Autosearch extends Component<AutosearchProps<AutosearchStyle>, Stat
|
|||||||
private readonly onChangeHandler = this.onChange.bind(this);
|
private readonly onChangeHandler = this.onChange.bind(this);
|
||||||
private readonly onTouchStart = this.onTouch.bind(this);
|
private readonly onTouchStart = this.onTouch.bind(this);
|
||||||
private readonly onEndHandler = this.onEnd.bind(this);
|
private readonly onEndHandler = this.onEnd.bind(this);
|
||||||
|
inputRef = createRef<TextInput>();
|
||||||
constructor(props: AutosearchProps<AutosearchStyle>){
|
constructor(props: AutosearchProps<AutosearchStyle>){
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
@@ -42,6 +45,23 @@ export class Autosearch extends Component<AutosearchProps<AutosearchStyle>, Stat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(prevProps: AutosearchProps<AutosearchStyle>) {
|
||||||
|
if (prevProps.autoFocus !== this.props.autoFocus) {
|
||||||
|
if (this.props.autoFocus.value) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.inputRef.current?.focus();
|
||||||
|
this.props.autoFocus.setValue(false);
|
||||||
|
return;
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (prevProps.searchvalue !== this.props.searchvalue) {
|
||||||
|
if (this.props.searchvalue === undefined || this.props.searchvalue.displayValue === '') {
|
||||||
|
this.setState({textboxValue: ''});
|
||||||
|
this.inputRef.current?.clear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
@@ -54,6 +74,7 @@ export class Autosearch extends Component<AutosearchProps<AutosearchStyle>, Stat
|
|||||||
placeholder={'Zoeken naar monumentenborden'}
|
placeholder={'Zoeken naar monumentenborden'}
|
||||||
placeholderTextColor="#5997C0"
|
placeholderTextColor="#5997C0"
|
||||||
editable={this.props.editable}
|
editable={this.props.editable}
|
||||||
|
ref={this.inputRef}
|
||||||
>
|
>
|
||||||
</TextInput>
|
</TextInput>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
<caption>Editable</caption>
|
<caption>Editable</caption>
|
||||||
<description/>
|
<description/>
|
||||||
</property>
|
</property>
|
||||||
|
<property key="autoFocus" type="attribute">
|
||||||
|
<caption>Auto focus</caption>
|
||||||
|
<description>Boolean attribute to focus the element.</description>
|
||||||
|
<attributeTypes>
|
||||||
|
<attributeType name="Boolean"/>
|
||||||
|
</attributeTypes>
|
||||||
|
</property>
|
||||||
</propertyGroup>
|
</propertyGroup>
|
||||||
<propertyGroup caption="Events">
|
<propertyGroup caption="Events">
|
||||||
<property key="onChange" type="action" required="false">
|
<property key="onChange" type="action" required="false">
|
||||||
|
|||||||
2
typings/AutosearchProps.d.ts
vendored
2
typings/AutosearchProps.d.ts
vendored
@@ -10,6 +10,7 @@ export interface AutosearchProps<Style> {
|
|||||||
style: Style[];
|
style: Style[];
|
||||||
searchvalue: EditableValue<string>;
|
searchvalue: EditableValue<string>;
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
|
autoFocus: EditableValue<boolean>;
|
||||||
onChange?: ActionValue;
|
onChange?: ActionValue;
|
||||||
onEnter?: ActionValue;
|
onEnter?: ActionValue;
|
||||||
}
|
}
|
||||||
@@ -19,6 +20,7 @@ export interface AutosearchPreviewProps {
|
|||||||
style: string;
|
style: string;
|
||||||
searchvalue: string;
|
searchvalue: string;
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
|
autoFocus: string;
|
||||||
onChange: {} | null;
|
onChange: {} | null;
|
||||||
onEnter: {} | null;
|
onEnter: {} | null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user