Skip to content

Commit 67bb209

Browse files
committed
Merge branch 'v6' into release
2 parents 7e82d27 + 1493474 commit 67bb209

File tree

28 files changed

+168
-57
lines changed

28 files changed

+168
-57
lines changed

demo/src/screens/incubatorScreens/IncubatorTextFieldScreen.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class TextFieldScreen extends Component {
1414
state = {
1515
errorPosition: TextField.validationMessagePositions.TOP,
1616
shouldDisable: false,
17+
isReadonly: false,
1718
value: 'Initial Value',
1819
searching: false,
1920
preset: 'withUnderline'
@@ -50,7 +51,7 @@ export default class TextFieldScreen extends Component {
5051
}
5152

5253
render() {
53-
const {errorPosition, shouldDisable, price, preset} = this.state;
54+
const {errorPosition, shouldDisable, isReadonly, price, preset} = this.state;
5455
return (
5556
<ScrollView keyboardShouldPersistTaps="always">
5657
<View flex padding-page>
@@ -182,11 +183,19 @@ export default class TextFieldScreen extends Component {
182183
<Text h3 blue50 marginV-s4>
183184
Colors By State
184185
</Text>
185-
<Button
186-
label={shouldDisable ? 'Enable' : 'Disable'}
187-
onPress={() => this.setState({shouldDisable: !shouldDisable})}
188-
size={Button.sizes.xSmall}
189-
/>
186+
<View row>
187+
<Button
188+
label={isReadonly ? 'Enable' : 'Readonly'}
189+
onPress={() => this.setState({isReadonly: !isReadonly})}
190+
size={Button.sizes.xSmall}
191+
marginR-s4
192+
/>
193+
<Button
194+
label={shouldDisable ? 'Enable' : 'Disable'}
195+
onPress={() => this.setState({shouldDisable: !shouldDisable})}
196+
size={Button.sizes.xSmall}
197+
/>
198+
</View>
190199
</View>
191200

192201
<TextField
@@ -195,14 +204,16 @@ export default class TextFieldScreen extends Component {
195204
default: Colors.$textDefault,
196205
focus: Colors.$textGeneral,
197206
error: Colors.$textDangerLight,
198-
disabled: Colors.$textDisabled
207+
disabled: Colors.$textDisabled,
208+
readonly: Colors.$textNeutral
199209
}}
200210
placeholder="Enter valid email"
201211
validationMessage="Email is invalid"
202212
validate={'email'}
203213
validateOnChange
204214
fieldStyle={styles.withFrame}
205215
editable={!shouldDisable}
216+
readonly={isReadonly}
206217
/>
207218

208219
<View row spread centerV>
@@ -224,6 +235,7 @@ export default class TextFieldScreen extends Component {
224235
preset === 'withUnderline' ? styles.withUnderline : styles.withFrame
225236
}
226237
editable={!shouldDisable}
238+
readonly={isReadonly}
227239
/>
228240

229241
<Text h3 blue50 marginV-s4>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const fs = require('fs');
2+
const _ = require('lodash');
3+
4+
/* Write all components as separate packages */
5+
const path = './src/components';
6+
fs.readdir(path, (err, files) => {
7+
if (!err) {
8+
files
9+
.filter((f) => f !== 'index.js')
10+
.forEach((file) => {
11+
fs.writeFileSync(`${file}.js`,
12+
`module.exports = require('${path}/${file}').default;\n`);
13+
const componentName = _.upperFirst(file);
14+
fs.writeFileSync(`${file}.d.ts`,
15+
`import {${componentName}} from './src';\nexport default ${componentName};\n`);
16+
});
17+
}
18+
});

scripts/buildPackages.js renamed to scripts/buildPackages/buildCustomPackages.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const packages = [
1414
filename: 'constants.js',
1515
content: `module.exports = require('./src/commons/Constants').default;\n`
1616
},
17+
{
18+
filename: 'textField.js',
19+
content: `module.exports = require('./src/components/textField/TextFieldMigrator').default;\n`
20+
},
1721
{
1822
filename: 'core.js',
1923
components: ['View', 'Text', 'Image', 'TouchableOpacity', 'Button'],
@@ -84,19 +88,3 @@ packages.forEach((package) => {
8488
fs.writeFileSync(filename, typings);
8589
}
8690
});
87-
88-
/* Write all components as separate packages */
89-
const path = './src/components';
90-
fs.readdir(path, (err, files) => {
91-
if (!err) {
92-
files
93-
.filter((f) => f !== 'index.js')
94-
.forEach((file) => {
95-
fs.writeFileSync(`${file}.js`,
96-
`module.exports = require('${path}/${file}').default;\n`);
97-
const componentName = _.upperFirst(file);
98-
fs.writeFileSync(`${file}.d.ts`,
99-
`import {${componentName}} from './src';\nexport default ${componentName};\n`);
100-
});
101-
}
102-
});

scripts/buildPackages/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const childProcess = require('child_process');
2+
3+
const path = 'scripts/buildPackages';
4+
5+
childProcess.execSync(`node ${path}/buildComponentsPackages`);
6+
childProcess.execSync(`node ${path}/buildCustomPackages`);

src/components/colorPalette/ColorPalette.api.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
{"name": "containerWidth", "type": "number", "description": "The container margins"},
3939
{"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"},
4040
{"name": "style", "type": "ViewStyle", "description": "Component's style"},
41-
{"name": "testID", "type": "string", "description": "The test id for e2e tests"}
41+
{"name": "testID", "type": "string", "description": "The test id for e2e tests"},
42+
{"name": "backgroundColor", "type": "string", "description": "The ColorPalette's background color"}
4243
],
4344
"snippet": [
4445
"<ColorPalette",

src/components/colorPalette/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ interface Props {
5454
style?: StyleProp<ViewStyle>;
5555
testID?: string;
5656
/**
57-
* Give the ColorPalette a background color
57+
* The ColorPalette's background color
5858
*/
5959
backgroundColor?: string;
6060
}

src/components/colorPicker/colorPicker.api.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"description": "Accessibility labels as an object of strings",
3232
"default": "{\n addButton: 'add custom color using hex code',\n dismissButton: 'dismiss',\n doneButton: 'done',\n input: 'custom hex color code'\n}"
3333
},
34-
{"name": "style", "type": "ViewStyle", "description": "Component's style"},
35-
{"name": "testID", "type": "string", "description": "The test id for e2e tests"}
34+
{"name": "testID", "type": "string", "description": "The test id for e2e tests"},
35+
{"name": "backgroundColor", "type": "string", "description": "The ColorPicker's background color"}
3636
],
3737
"snippet": [
3838
"<ColorPicker",

src/components/colorPicker/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Button from '../button';
77
import ColorPalette from '../colorPalette';
88
import {SWATCH_MARGIN, SWATCH_SIZE} from '../colorSwatch';
99
import ColorPickerDialog, {ColorPickerDialogProps} from './ColorPickerDialog';
10+
import {LogService} from '../../services';
1011

1112
interface Props extends ColorPickerDialogProps {
1213
/**
@@ -43,7 +44,7 @@ interface Props extends ColorPickerDialogProps {
4344
style?: StyleProp<ViewStyle>;
4445
testID?: string;
4546
/**
46-
* Give the ColorPicker a background color
47+
* The ColorPicker's background color
4748
*/
4849
backgroundColor?: string;
4950
}
@@ -70,6 +71,14 @@ class ColorPicker extends PureComponent<Props> {
7071
backgroundColor: Colors.$backgroundDefault
7172
};
7273

74+
constructor(props: Props) {
75+
super(props);
76+
77+
if (props.style) {
78+
LogService.warn(`UILib ColorPicker's 'style' prop is deprecated. You can use the 'backgroundColor' prop instead`);
79+
}
80+
}
81+
7382
state = {
7483
show: false
7584
};

src/components/drawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ interface DrawerProps {
133133
* @description: Drawer Component
134134
* @important: If your app works with RNN, your screen must be wrapped
135135
* with gestureHandlerRootHOC from 'react-native-gesture-handler'. see
136-
* @importantLink: https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html#with-wix-react-native-navigation-https-githubcom-wix-react-native-navigation
136+
* @importantLink: https://docs.swmansion.com/react-native-gesture-handler/docs/installation/
137137
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Drawer/Drawer.gif?raw=true
138138
*/
139139
class Drawer extends PureComponent<DrawerProps> {

src/components/picker/PickerItemsList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ const PickerItemsList = (props: PickerItemsListProps) => {
8787
{topBarProps.doneLabel ?? 'Select'}
8888
</Text>
8989
</View>
90-
<WheelPicker initialValue={context.value as PickerSingleValue} items={items} onChange={setWheelPickerValue}/>
90+
<WheelPicker
91+
flatListProps={listProps}
92+
initialValue={context.value as PickerSingleValue}
93+
items={items}
94+
onChange={setWheelPickerValue}
95+
/>
9196
</View>
9297
);
9398
};

0 commit comments

Comments
 (0)