Skip to content

Commit e7710e1

Browse files
authored
Merge pull request #51 from y0c/dev
1.0.2
2 parents a1f1be6 + ab238b4 commit e7710e1

File tree

7 files changed

+89
-21563
lines changed

7 files changed

+89
-21563
lines changed

package-lock.json

Lines changed: 0 additions & 21492 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"bump:minor": "yarn version --minor",
2121
"bump:major": "yarn version --major",
2222
"prepublish": "yarn lint && yarn test",
23-
"deploy-storybook": "storybook-to-ghpages"
23+
"deploy-storybook": "storybook-to-ghpages",
24+
"test:unit:output": "yarn test --json --outputFile=.jest.test.result.json",
25+
"start": "yarn test:unit:output && start-storybook -p 6006"
2426
},
2527
"lint-staged": {
2628
"{src}/**/*.ts*": [
@@ -34,7 +36,7 @@
3436
},
3537
"dependencies": {
3638
"classnames": "^2.2.6",
37-
"dayjs": "^1.8.12",
39+
"dayjs": "^1.8.21",
3840
"react": "^16.8.4",
3941
"react-dom": "^16.8.4"
4042
},

src/common/@types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export namespace IDatePicker {
2-
export type Locale = string | { name: string; [key: string]: any };
2+
export type Locale = any;
33
export enum PickerDirection {
44
TOP,
55
BOTTOM,

src/components/DatePicker.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,19 @@ class DatePicker extends React.Component<Props, State> {
179179
};
180180

181181
public renderInputComponent = (): JSX.Element => {
182-
const { inputComponent, readOnly, disabled, clear, autoFocus, showDefaultIcon } = this.props;
182+
const { inputComponent, readOnly, disabled, clear, autoFocus, showDefaultIcon, placeholder } = this.props;
183183
const { inputValue } = this.state;
184184
const inputProps = {
185185
readOnly,
186186
autoFocus,
187187
disabled,
188188
clear,
189+
placeholder,
189190
onChange: this.handleInputChange,
190191
onClear: this.handleInputClear,
191192
onBlur: this.handleInputBlur,
192193
value: inputValue,
193-
icon: showDefaultIcon ? <SVGIcon id="calendar" /> : undefined,
194+
icon: showDefaultIcon ? <SVGIcon id="calendar" /> : undefined
194195
};
195196
return inputComponent ? inputComponent({ ...inputProps }) : <PickerInput {...inputProps} />;
196197
};

src/components/TimeInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ const TimeInput: React.FunctionComponent<Props> = ({ onUp, onDown, onChange, onB
1818
return (
1919
<div className="time-input">
2020
<div className="time-input__up">
21-
<button onClick={onUp}>
21+
<button onClick={onUp} type="button">
2222
<SVGIcon id="up" />
2323
</button>
2424
</div>
2525
<div className="time-input__text">
2626
<input type="text" value={value} onChange={onChange} onBlur={onBlur} />
2727
</div>
2828
<div className="time-input__down">
29-
<button onClick={onDown}>
29+
<button onClick={onDown} type="button">
3030
<SVGIcon id="down" />
3131
</button>
3232
</div>

stories/DatePicker.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ storiesOf('DatePicker', module)
3737
<DatePicker {...defaultProps} direction={0} />
3838
</div>
3939
);
40+
})
41+
.add('placeholder', () => {
42+
return <DatePicker {...defaultProps} placeholder="Select date" />;
4043
});
4144

4245
storiesOf('DatePicker - Input Props', module)

0 commit comments

Comments
 (0)