@transferwise/components 0.0.0-experimental-088517f → 0.0.0-experimental-db52174
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/build/index.esm.js +2 -0
- package/build/index.esm.js.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts +1 -0
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/dateLookup/DateLookup.js +2 -0
- package/src/dateLookup/DateLookup.story.js +3 -0
- package/src/dateLookup/DateLookup.view.spec.js +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateLookup.d.ts","sourceRoot":"","sources":["../../../src/dateLookup/DateLookup.js"],"names":[],"mappings":";AAoBA;IAoBE;;;;;;aAqBC;IApCD,wBAaC;IAjBD,wCAAsB;IAEtB,yCAAuB;IAIrB;;;;;;;;;;MAUC;IA0BH,6CAMC;IAFC,uCAAyE;IAI3E,6BAGC;IAED,iBAOE;IAEF,oBAME;IAEF,kBAME;IAEF,oCA6CE;IAEF,wEAmBE;IAEF,+DAOE;IAEF,gCAIE;IAEF,yBAA+C;IAE/C,2BAAmD;IAEnD,0BAAiD;IAEjD,sDAME;IAEF;;;eAEE;IAEF,+CA8BE;IAEF,wBAGE;IAEF,
|
|
1
|
+
{"version":3,"file":"DateLookup.d.ts","sourceRoot":"","sources":["../../../src/dateLookup/DateLookup.js"],"names":[],"mappings":";AAoBA;IAoBE;;;;;;aAqBC;IApCD,wBAaC;IAjBD,wCAAsB;IAEtB,yCAAuB;IAIrB;;;;;;;;;;MAUC;IA0BH,6CAMC;IAFC,uCAAyE;IAI3E,6BAGC;IAED,iBAOE;IAEF,oBAME;IAEF,kBAME;IAEF,oCA6CE;IAEF,wEAmBE;IAEF,+DAOE;IAEF,gCAIE;IAEF,yBAA+C;IAE/C,2BAAmD;IAEnD,0BAAiD;IAEjD,sDAME;IAEF;;;eAEE;IAEF,+CA8BE;IAEF,wBAGE;IAEF,sCAqCC;CACF"}
|
package/package.json
CHANGED
|
@@ -253,6 +253,7 @@ class DateLookup extends PureComponent {
|
|
|
253
253
|
return (
|
|
254
254
|
<div // eslint-disable-line jsx-a11y/no-static-element-interactions
|
|
255
255
|
ref={this.element}
|
|
256
|
+
id={this.props.id}
|
|
256
257
|
aria-labelledby={ariaLabelledBy}
|
|
257
258
|
className="input-group"
|
|
258
259
|
onKeyDown={this.handleKeyDown}
|
|
@@ -277,6 +278,7 @@ class DateLookup extends PureComponent {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
DateLookup.propTypes = {
|
|
281
|
+
id: PropTypes.string,
|
|
280
282
|
value: PropTypes.instanceOf(Date),
|
|
281
283
|
min: PropTypes.instanceOf(Date),
|
|
282
284
|
max: PropTypes.instanceOf(Date),
|
|
@@ -25,12 +25,14 @@ export const Basic = () => {
|
|
|
25
25
|
const monthFormat = select('monthFormat', ['long', 'short']);
|
|
26
26
|
const placeholder = text('placeholder', 'placeholder');
|
|
27
27
|
const size = select('size', Object.values(Size), Size.MEDIUM);
|
|
28
|
+
const id = text('id', 'date-lookup');
|
|
28
29
|
|
|
29
30
|
const clearable = boolean('clearable', false);
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<DateLookup
|
|
33
34
|
disabled={disabled}
|
|
35
|
+
id={id}
|
|
34
36
|
label={label}
|
|
35
37
|
min={thePast}
|
|
36
38
|
monthFormat={monthFormat}
|
|
@@ -81,6 +83,7 @@ export const RightAligned = () => {
|
|
|
81
83
|
</div>
|
|
82
84
|
<div className="col-xs-6">
|
|
83
85
|
<DateLookup
|
|
86
|
+
id="right-aligned"
|
|
84
87
|
disabled={disabled}
|
|
85
88
|
label={label}
|
|
86
89
|
min={new Date(minvalue)}
|
|
@@ -37,6 +37,7 @@ describe('DateLookup view', () => {
|
|
|
37
37
|
placeholder: 'Asd..',
|
|
38
38
|
label: 'Date..',
|
|
39
39
|
onChange: jest.fn(),
|
|
40
|
+
id: '123456',
|
|
40
41
|
};
|
|
41
42
|
component = shallow(<DateLookup {...props} />);
|
|
42
43
|
});
|
|
@@ -45,6 +46,10 @@ describe('DateLookup view', () => {
|
|
|
45
46
|
expect(dateTrigger()).toHaveLength(1);
|
|
46
47
|
});
|
|
47
48
|
|
|
49
|
+
it('passes id to the component', () => {
|
|
50
|
+
expect(component.prop('id')).toBe('123456');
|
|
51
|
+
});
|
|
52
|
+
|
|
48
53
|
it('passes props forward to open button', () => {
|
|
49
54
|
expect(+dateTrigger().prop('selectedDate')).toBe(+date);
|
|
50
55
|
expect(dateTrigger().prop('size')).toBe('lg');
|