Skip to content

Commit

Permalink
(feat) O3-3505: Datepicker improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Jul 30, 2024
1 parent 4d3f1b0 commit c28d8fd
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 40 deletions.
4 changes: 2 additions & 2 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ A type for any of the acceptable date formats

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:58](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L58)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:73](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L73)

___

Expand Down Expand Up @@ -1559,7 +1559,7 @@ A date picker component to select a single date. Based on React Aria, but styled

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:251](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L251)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:402](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L402)

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Properties for the OpenmrsDatePicker

## Hierarchy

- `Omit`<`DatePickerProps`<`CalendarDate`\>, ``"className"`` \| ``"defaultValue"`` \| ``"value"``\>
- `Omit`<`DatePickerProps`<`CalendarDate`\>, ``"className"`` \| ``"onChange"`` \| ``"defaultValue"`` \| ``"value"``\>

**`OpenmrsDatePickerProps`**

Expand Down Expand Up @@ -58,6 +58,7 @@ Properties for the OpenmrsDatePicker
- [isDateUnavailable](OpenmrsDatePickerProps.md#isdateunavailable)
- [onBlur](OpenmrsDatePickerProps.md#onblur)
- [onChange](OpenmrsDatePickerProps.md#onchange)
- [onChangeRaw](OpenmrsDatePickerProps.md#onchangeraw)
- [onFocus](OpenmrsDatePickerProps.md#onfocus)
- [onFocusChange](OpenmrsDatePickerProps.md#onfocuschange)
- [onKeyDown](OpenmrsDatePickerProps.md#onkeydown)
Expand Down Expand Up @@ -171,7 +172,7 @@ Any CSS classes to add to the outer div of the date picker

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:76](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L76)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:91](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L91)

___

Expand Down Expand Up @@ -199,7 +200,7 @@ The default value (uncontrolled)

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:78](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L78)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L93)

___

Expand Down Expand Up @@ -277,7 +278,7 @@ Whether the input value is invalid.

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:80](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L80)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:95](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L95)

___

Expand All @@ -289,7 +290,7 @@ Text to show if the input is invalid e.g. an error message

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:82](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L82)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:97](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L97)

___

Expand Down Expand Up @@ -383,7 +384,7 @@ The label for this DatePicker element

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:87](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L87)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:102](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L102)

___

Expand All @@ -395,7 +396,7 @@ The label for this DatePicker element.

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:89](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L89)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:104](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L104)

___

Expand All @@ -407,7 +408,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:91](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L91)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:106](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L106)

___

Expand All @@ -419,7 +420,7 @@ The latest date it is possible to select

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L93)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:108](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L108)

___

Expand Down Expand Up @@ -447,7 +448,7 @@ The earliest date it is possible to select

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:95](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L95)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:110](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L110)

___

Expand Down Expand Up @@ -525,7 +526,7 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:99](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L99)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:118](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L118)

___

Expand Down Expand Up @@ -572,7 +573,7 @@ Specifies the size of the input. Currently supports either `sm`, `md`, or `lg` a

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:97](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L97)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:116](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L116)

___

Expand Down Expand Up @@ -637,7 +638,7 @@ The value (controlled)

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:101](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L101)
[packages/framework/esm-styleguide/src/datepicker/index.tsx:120](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L120)

## Methods

Expand Down Expand Up @@ -703,19 +704,37 @@ Handler that is called when the value changes.

| Name | Type |
| :------ | :------ |
| `value` | `C` |
| `value` | `undefined` \| ``null`` \| `Date` |

#### Returns

`void`

#### Inherited from
#### Defined in

[packages/framework/esm-styleguide/src/datepicker/index.tsx:112](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L112)

___

### onChangeRaw

`Optional` **onChangeRaw**(`value`): `void`

Handler that is called when the value changes. Note that this provides types from @internationalized/date.

#### Parameters

Omit.onChange
| Name | Type |
| :------ | :------ |
| `value` | ``null`` \| `DateValue` |

#### Returns

`void`

#### Defined in

node_modules/@react-types/shared/src/inputs.d.ts:71
[packages/framework/esm-styleguide/src/datepicker/index.tsx:114](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/index.tsx#L114)

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
}

&[data-placeholder] {
caret-color: var(--cds-text-primary);
color: theme.$text-disabled;
}
}
Expand Down
Loading

0 comments on commit c28d8fd

Please sign in to comment.