Prettier 2.0 (#393)

This commit is contained in:
Steve Faulkner
2021-01-20 09:15:01 -06:00
committed by GitHub
parent c1937ca464
commit 4be53284b5
500 changed files with 41927 additions and 41838 deletions

View File

@@ -23,7 +23,7 @@ export type InputTypeValue = "number" | "string" | "boolean" | "object";
export enum UiType {
Spinner = "Spinner",
Slider = "Slider"
Slider = "Slider",
}
export type ChoiceItem = { label: string; key: string };
@@ -101,13 +101,13 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
private static readonly labelStyle = {
color: "#393939",
fontFamily: "wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif",
fontSize: 12
fontSize: 12,
};
constructor(props: SmartUiComponentProps) {
super(props);
this.state = {
errors: new Map()
errors: new Map(),
};
}
@@ -140,10 +140,10 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
label: {
root: {
...SmartUiComponent.labelStyle,
fontWeight: 600
}
}
}
fontWeight: 600,
},
},
},
}}
/>
</div>
@@ -200,7 +200,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
min: min,
max: max,
ariaLabel: label,
step: step
step: step,
};
const value = this.props.currentValues.get(dataFieldName) as number;
@@ -211,15 +211,15 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
{...props}
id={`${input.dataFieldName}-spinner-input`}
value={value?.toString()}
onValidate={newValue => this.onValidate(input, newValue, props.min, props.max)}
onIncrement={newValue => this.onIncrement(input, newValue, props.step, props.max)}
onDecrement={newValue => this.onDecrement(input, newValue, props.step, props.min)}
onValidate={(newValue) => this.onValidate(input, newValue, props.min, props.max)}
onIncrement={(newValue) => this.onIncrement(input, newValue, props.step, props.max)}
onDecrement={(newValue) => this.onDecrement(input, newValue, props.step, props.min)}
labelPosition={Position.top}
styles={{
label: {
...SmartUiComponent.labelStyle,
fontWeight: 600
}
fontWeight: 600,
},
}}
/>
{this.state.errors.has(dataFieldName) && (
@@ -233,13 +233,13 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
<Slider
{...props}
value={value}
onChange={newValue => this.props.onInputChange(input, newValue)}
onChange={(newValue) => this.props.onInputChange(input, newValue)}
styles={{
titleLabel: {
...SmartUiComponent.labelStyle,
fontWeight: 600
fontWeight: 600,
},
valueLabel: SmartUiComponent.labelStyle
valueLabel: SmartUiComponent.labelStyle,
}}
/>
</div>
@@ -264,13 +264,13 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
{
label: input.falseLabel,
key: "false",
onSelect: () => this.props.onInputChange(input, false)
onSelect: () => this.props.onInputChange(input, false),
},
{
label: input.trueLabel,
key: "true",
onSelect: () => this.props.onInputChange(input, true)
}
onSelect: () => this.props.onInputChange(input, true),
},
]}
selectedKey={selectedKey}
/>
@@ -288,16 +288,16 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
selectedKey={value ? value : defaultKey}
onChange={(_, item: IDropdownOption) => this.props.onInputChange(input, item.key.toString())}
placeholder={placeholder}
options={choices.map(c => ({
options={choices.map((c) => ({
key: c.key,
text: c.label
text: c.label,
}))}
styles={{
label: {
...SmartUiComponent.labelStyle,
fontWeight: 600
fontWeight: 600,
},
dropdown: SmartUiComponent.labelStyle
dropdown: SmartUiComponent.labelStyle,
}}
/>
);
@@ -334,7 +334,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
{node.info && this.renderInfo(node.info as Info)}
{node.input && this.renderInput(node.input)}
</Stack.Item>
{node.children && node.children.map(child => <div key={child.id}>{this.renderNode(child)}</div>)}
{node.children && node.children.map((child) => <div key={child.id}>{this.renderNode(child)}</div>)}
</Stack>
);
}