@openmrs/esm-styleguide 9.0.1 → 9.0.2-pre.4055
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/.turbo/turbo-build.log +4 -4
- package/dist/datepicker/auto-close-dialog.component.d.ts +1 -2
- package/dist/datepicker/auto-close-dialog.component.d.ts.map +1 -1
- package/dist/datepicker/calendar-popover.component.d.ts +28 -0
- package/dist/datepicker/calendar-popover.component.d.ts.map +1 -0
- package/dist/datepicker/date-picker-icon.component.d.ts +9 -0
- package/dist/datepicker/date-picker-icon.component.d.ts.map +1 -0
- package/dist/datepicker/{DatePickerInput.d.ts → date-picker-input.component.d.ts} +1 -1
- package/dist/datepicker/date-picker-input.component.d.ts.map +1 -0
- package/dist/datepicker/{DateSegment.d.ts → date-segment.component.d.ts} +1 -1
- package/dist/datepicker/date-segment.component.d.ts.map +1 -0
- package/dist/datepicker/defaults.d.ts +10 -0
- package/dist/datepicker/defaults.d.ts.map +1 -0
- package/dist/datepicker/hooks.d.ts +23 -2
- package/dist/datepicker/hooks.d.ts.map +1 -1
- package/dist/datepicker/i18n-wrapper.component.d.ts +7 -0
- package/dist/datepicker/i18n-wrapper.component.d.ts.map +1 -0
- package/dist/datepicker/index.d.ts +2 -2
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/{MonthYear.d.ts → month-year.component.d.ts} +1 -1
- package/dist/datepicker/month-year.component.d.ts.map +1 -0
- package/dist/datepicker/openmrs-date-picker.component.d.ts +27 -0
- package/dist/datepicker/openmrs-date-picker.component.d.ts.map +1 -0
- package/dist/datepicker/{date-range/date-range-picker.component.d.ts → openmrs-date-range-picker.component.d.ts} +6 -25
- package/dist/datepicker/openmrs-date-range-picker.component.d.ts.map +1 -0
- package/dist/datepicker/types.d.ts +31 -0
- package/dist/datepicker/types.d.ts.map +1 -0
- package/dist/datepicker/utils.d.ts +1 -1
- package/dist/datepicker/utils.d.ts.map +1 -1
- package/dist/openmrs-esm-styleguide.css +1 -1
- package/dist/openmrs-esm-styleguide.css.map +1 -1
- package/dist/openmrs-esm-styleguide.js +2 -2
- package/dist/openmrs-esm-styleguide.js.map +1 -1
- package/package.json +14 -13
- package/src/datepicker/auto-close-dialog.component.tsx +3 -4
- package/src/datepicker/calendar-popover.component.tsx +78 -0
- package/src/datepicker/date-picker-icon.component.tsx +21 -0
- package/src/datepicker/date-range-picker.test.tsx +188 -0
- package/src/datepicker/datepicker.module.scss +214 -163
- package/src/datepicker/datepicker.test.tsx +149 -35
- package/src/datepicker/defaults.ts +10 -0
- package/src/datepicker/hooks.ts +56 -34
- package/src/datepicker/i18n-wrapper.component.tsx +10 -0
- package/src/datepicker/index.tsx +2 -2
- package/src/datepicker/{MonthYear.tsx → month-year.component.tsx} +2 -2
- package/src/datepicker/openmrs-date-picker.component.tsx +156 -0
- package/src/datepicker/{date-range/date-range-picker.component.tsx → openmrs-date-range-picker.component.tsx} +41 -102
- package/src/datepicker/types.ts +32 -0
- package/src/datepicker/utils.test.ts +123 -0
- package/src/datepicker/utils.ts +1 -1
- package/dist/datepicker/DatePickerIcon.d.ts +0 -7
- package/dist/datepicker/DatePickerIcon.d.ts.map +0 -1
- package/dist/datepicker/DatePickerInput.d.ts.map +0 -1
- package/dist/datepicker/DateSegment.d.ts.map +0 -1
- package/dist/datepicker/MonthYear.d.ts.map +0 -1
- package/dist/datepicker/OpenmrsDatePicker.d.ts +0 -50
- package/dist/datepicker/OpenmrsDatePicker.d.ts.map +0 -1
- package/dist/datepicker/date-range/date-range-icon.component.d.ts +0 -3
- package/dist/datepicker/date-range/date-range-icon.component.d.ts.map +0 -1
- package/dist/datepicker/date-range/date-range-picker.component.d.ts.map +0 -1
- package/dist/datepicker/locale-context.d.ts +0 -3
- package/dist/datepicker/locale-context.d.ts.map +0 -1
- package/src/datepicker/DatePickerIcon.tsx +0 -17
- package/src/datepicker/OpenmrsDatePicker.tsx +0 -243
- package/src/datepicker/date-range/date-range-icon.component.tsx +0 -13
- package/src/datepicker/date-range/date-range-picker.module.scss +0 -38
- package/src/datepicker/date-range/date-range-picker.test.tsx +0 -98
- package/src/datepicker/locale-context.ts +0 -5
- /package/src/datepicker/{DatePickerInput.tsx → date-picker-input.component.tsx} +0 -0
- /package/src/datepicker/{DateSegment.tsx → date-segment.component.tsx} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[0] WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.
|
|
2
2
|
[0] │ Assets:
|
|
3
|
-
[0] │ openmrs-esm-styleguide.css (3.
|
|
4
|
-
[0] │ openmrs-esm-styleguide.js (
|
|
3
|
+
[0] │ openmrs-esm-styleguide.css (3.045 MiB)
|
|
4
|
+
[0] │ openmrs-esm-styleguide.js (263.064 KiB)
|
|
5
5
|
[0]
|
|
6
6
|
[0] WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.
|
|
7
7
|
[0] │ Entrypoints:
|
|
8
|
-
[0] │ main (3.
|
|
8
|
+
[0] │ main (3.302 MiB)
|
|
9
9
|
[0] │ openmrs-esm-styleguide.js
|
|
10
10
|
[0] │ openmrs-esm-styleguide.css
|
|
11
11
|
[0]
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
[0] │ You can limit the size of your bundles by using import() to lazy load some parts of your application.
|
|
14
14
|
[0] │ For more info visit https://rspack.rs/guide/optimization/code-splitting
|
|
15
15
|
[0]
|
|
16
|
-
[0] Rspack compiled with 3 warnings in
|
|
16
|
+
[0] Rspack compiled with 3 warnings in 9.05 s
|
|
17
17
|
[0] rspack --mode=production exited with code 0
|
|
18
18
|
[1] tsc --project tsconfig.build.json exited with code 0
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface AutoCloseDialogProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
isRangePicker?: boolean;
|
|
5
4
|
}
|
|
6
|
-
export declare function AutoCloseDialog({ children
|
|
5
|
+
export declare function AutoCloseDialog({ children }: Readonly<AutoCloseDialogProps>): React.JSX.Element;
|
|
7
6
|
export {};
|
|
8
7
|
//# sourceMappingURL=auto-close-dialog.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-close-dialog.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/auto-close-dialog.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-close-dialog.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/auto-close-dialog.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,oBAAoB,CAAC,qBAa3E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CalendarDate, type DateValue } from '@internationalized/date';
|
|
3
|
+
type CalendarPopoverProps = {
|
|
4
|
+
/** The current date */
|
|
5
|
+
today_: CalendarDate;
|
|
6
|
+
} & ({
|
|
7
|
+
/** Either 'single' (for a Calendar) or 'range' (for a RangeCalendar) */
|
|
8
|
+
variant: 'single';
|
|
9
|
+
/** The minimum selectable date (only used for RangeCalendar) */
|
|
10
|
+
minDate?: never;
|
|
11
|
+
/** The maximum selectable date (only used for RangeCalendar) */
|
|
12
|
+
maxDate?: never;
|
|
13
|
+
} | {
|
|
14
|
+
/** Either 'single' (for a Calendar) or 'range' (for a range) */
|
|
15
|
+
variant: 'range';
|
|
16
|
+
/** The minimum selectable date (only used for RangeCalendar) */
|
|
17
|
+
minDate?: DateValue | null;
|
|
18
|
+
/** The maximum selectable date (only used for RangeCalendar) */
|
|
19
|
+
maxDate?: DateValue | null;
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* The calendar dropdown content shared between the single and range date pickers.
|
|
23
|
+
* Renders the popover, auto-close dialog, navigation header, and calendar grid.
|
|
24
|
+
* The `variant` prop selects between Calendar (single) and RangeCalendar (range).
|
|
25
|
+
*/
|
|
26
|
+
export declare const CalendarPopover: React.ForwardRefExoticComponent<CalendarPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=calendar-popover.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-popover.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/calendar-popover.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAM5E,KAAK,oBAAoB,GAAG;IAC1B,uBAAuB;IACvB,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,CACA;IACE,wEAAwE;IACxE,OAAO,EAAE,QAAQ,CAAC;IAClB,gEAAgE;IAChE,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,gEAAgE;IAChE,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACE,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CAC5B,CACJ,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,6FAyC1B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a calendar or warning icon depending on the validation state
|
|
4
|
+
* of the enclosing picker. Works in both DatePicker and DateRangePicker
|
|
5
|
+
* contexts by trying both React Aria state contexts — the same approach
|
|
6
|
+
* used by MonthYear for CalendarStateContext vs RangeCalendarStateContext.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DatePickerIcon: React.ForwardRefExoticComponent<React.RefAttributes<SVGSVGElement>>;
|
|
9
|
+
//# sourceMappingURL=date-picker-icon.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-icon.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/date-picker-icon.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAItD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,qEAUzB,CAAC"}
|
|
@@ -9,4 +9,4 @@ interface OpenmrsDateInputProps {
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const DatePickerInput: React.ForwardRefExoticComponent<DateInputProps & OpenmrsDateInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=date-picker-input.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-input.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/date-picker-input.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoE,MAAM,OAAO,CAAC;AAEzF,OAAO,EAGL,KAAK,cAAc,EASpB,MAAM,uBAAuB,CAAC;AAI/B,UAAU,qBAAqB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,+GA4C3B,CAAC"}
|
|
@@ -8,4 +8,4 @@ import { type DateSegmentProps } from 'react-aria-components';
|
|
|
8
8
|
* segment.
|
|
9
9
|
*/
|
|
10
10
|
export declare const DateSegment: React.ForwardRefExoticComponent<DateSegmentProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=date-segment.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-segment.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/date-segment.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIrF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,yFAoDtB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CalendarDate } from '@internationalized/date';
|
|
2
|
+
/**
|
|
3
|
+
* Default lower bound used when consumers do not provide `minDate`.
|
|
4
|
+
*
|
|
5
|
+
* React Aria date pickers otherwise allow effectively unbounded past
|
|
6
|
+
* entry/navigation (e.g., year 1), which can produce nonsensical values.
|
|
7
|
+
* 1793-01-01 is used as a practical historical floor for OpenMRS.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_MIN_DATE_FLOOR: CalendarDate;
|
|
10
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/datepicker/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,cAA+B,CAAC"}
|
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { today, type Calendar } from '@internationalized/date';
|
|
2
3
|
import { type AriaLabelingProps, type DOMProps } from '@react-types/shared';
|
|
4
|
+
export declare const OpenmrsIntlLocaleContext: import("react").Context<Intl.Locale | null>;
|
|
5
|
+
export declare const useIntlLocale: () => Intl.Locale;
|
|
6
|
+
/**
|
|
7
|
+
* This is the context provided to the OpenmrsDatePicker and OpenmrsDateRangePicker
|
|
8
|
+
*/
|
|
9
|
+
interface DatepickerContext {
|
|
10
|
+
calendar: Calendar | undefined;
|
|
11
|
+
intlLocale: Intl.Locale;
|
|
12
|
+
today_: ReturnType<typeof today>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the active locale, calendar system, and "today" value for use
|
|
16
|
+
* in both OpenmrsDatePicker and OpenmrsDateRangePicker.
|
|
17
|
+
*
|
|
18
|
+
* The locale is resolved from i18next, mapped through the user's preferred
|
|
19
|
+
* date locale config, and then used to derive the calendar system. This
|
|
20
|
+
* supports non-Gregorian calendars (e.g., Ethiopic) based on locale settings.
|
|
21
|
+
*
|
|
22
|
+
* Depends on `window.i18next.language` to re-compute when the UI language changes.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useDatepickerContext(): DatepickerContext;
|
|
3
25
|
interface RenderPropsHookOptions<T> extends DOMProps, AriaLabelingProps {
|
|
4
26
|
/** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. */
|
|
5
27
|
className?: string | ((values: T & {
|
|
@@ -816,6 +838,5 @@ export declare function useRenderProps<T>(props: RenderPropsHookOptions<T>): {
|
|
|
816
838
|
children: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined;
|
|
817
839
|
'data-rac': string;
|
|
818
840
|
};
|
|
819
|
-
export declare function useSlot(initialState?: boolean | (() => boolean)): [RefCallback<Element>, boolean];
|
|
820
841
|
export {};
|
|
821
842
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/datepicker/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/datepicker/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,aAAa,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAgD,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAK5E,eAAO,MAAM,wBAAwB,6CAA0C,CAAC;AAEhF,eAAO,MAAM,aAAa,mBAA8C,CAAC;AAEzE;;GAEG;AACH,UAAU,iBAAiB;IACzB,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAyBxD;AAKD,UAAU,sBAAsB,CAAC,CAAC,CAAE,SAAQ,QAAQ,EAAE,iBAAiB;IACrE,yLAAyL;IACzL,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG;QAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,KAAK,MAAM,CAAC,CAAC;IACxF,wLAAwL;IACxL,KAAK,CAAC,EAAE,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG;QAAE,YAAY,EAAE,aAAa,CAAA;KAAE,KAAK,aAAa,GAAG,SAAS,CAAC,CAAC;IACrG,gHAAgH;IAChH,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG;QAAE,eAAe,EAAE,SAAS,GAAG,SAAS,CAAA;KAAE,KAAK,SAAS,CAAC,CAAC;IAC/F,MAAM,EAAE,CAAC,CAAC;IACV,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CjE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type I18nProviderProps } from 'react-aria';
|
|
2
|
+
/**
|
|
3
|
+
* Thin wrapper around React Aria's I18nProvider to work around a JSX return type mismatch
|
|
4
|
+
* between the library's types and our TSX configuration.
|
|
5
|
+
*/
|
|
6
|
+
export declare function I18nWrapper(props: I18nProviderProps): JSX.Element;
|
|
7
|
+
//# sourceMappingURL=i18n-wrapper.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-wrapper.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/i18n-wrapper.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAElE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAEjE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { OpenmrsDatePicker, type OpenmrsDatePickerProps } from './
|
|
2
|
-
export { OpenmrsDateRangePicker, type OpenmrsDateRangePickerProps } from './
|
|
1
|
+
export { OpenmrsDatePicker, type OpenmrsDatePickerProps } from './openmrs-date-picker.component';
|
|
2
|
+
export { OpenmrsDateRangePicker, type OpenmrsDateRangePickerProps } from './openmrs-date-range-picker.component';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datepicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datepicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -8,4 +8,4 @@ import React from 'react';
|
|
|
8
8
|
export declare const MonthYear: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
9
9
|
children?: React.ReactNode | undefined;
|
|
10
10
|
} & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=month-year.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"month-year.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/month-year.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2F,MAAM,OAAO,CAAC;AA2BhH;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;yCAqDrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DateValue } from 'react-aria';
|
|
3
|
+
import { type DatePickerProps } from 'react-aria-components';
|
|
4
|
+
import { type CalendarDate } from '@internationalized/date';
|
|
5
|
+
import { type DateInputValue, type DatePickerBaseProps } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Properties for the OpenmrsDatePicker
|
|
8
|
+
*/
|
|
9
|
+
export interface OpenmrsDatePickerProps extends Omit<DatePickerProps<CalendarDate>, 'className' | 'onChange' | 'defaultValue' | 'value'>, DatePickerBaseProps {
|
|
10
|
+
/** The default value (uncontrolled) */
|
|
11
|
+
defaultValue?: DateInputValue;
|
|
12
|
+
/** Handler that is called when the value changes. */
|
|
13
|
+
onChange?: (value: Date | null | undefined) => void;
|
|
14
|
+
/** Handler that is called when the value changes. Note that this provides types from @internationalized/date. */
|
|
15
|
+
onChangeRaw?: (value: DateValue | null) => void;
|
|
16
|
+
/** Specifies the size of the input. Currently supports either `sm`, `md`, or `lg` as an option */
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
/** 'true' to use the short version. */
|
|
19
|
+
short?: boolean;
|
|
20
|
+
/** The value (controlled) */
|
|
21
|
+
value?: DateInputValue;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A date picker component to select a single date. Based on React Aria, but styled to look like Carbon.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OpenmrsDatePicker: React.ForwardRefExoticComponent<OpenmrsDatePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//# sourceMappingURL=openmrs-date-picker.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openmrs-date-picker.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/openmrs-date-picker.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAsB,KAAK,eAAe,EAAsC,MAAM,uBAAuB,CAAC;AACrH,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAWxE;;GAEG;AACH,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,EAC9F,mBAAmB;IACrB,uCAAuC;IACvC,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,iHAAiH;IACjH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,kGAAkG;IAClG,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAOD;;GAEG;AACH,eAAO,MAAM,iBAAiB,+FA+G7B,CAAC"}
|
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { type Argument } from 'classnames';
|
|
3
|
-
import { type CalendarDate } from '@internationalized/date';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
import { type DateRangePickerProps, type DateRange } from 'react-aria-components';
|
|
5
|
-
import { type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { type CalendarDate } from '@internationalized/date';
|
|
4
|
+
import { type DateInputValue, type DatePickerBaseProps } from './types';
|
|
5
|
+
/** Properties for the OpenmrsDateRangePicker */
|
|
6
|
+
export interface OpenmrsDateRangePickerProps extends Omit<DateRangePickerProps<CalendarDate>, 'className' | 'onChange' | 'defaultValue' | 'value'>, DatePickerBaseProps {
|
|
9
7
|
/** The default value (uncontrolled) */
|
|
10
8
|
defaultValue?: [DateInputValue, DateInputValue];
|
|
11
|
-
/** Whether the input value is invalid. */
|
|
12
|
-
invalid?: boolean;
|
|
13
|
-
/** Text to show if the input is invalid e.g. an error message */
|
|
14
|
-
invalidText?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The label for this DatePicker element
|
|
17
|
-
* @deprecated Use labelText instead
|
|
18
|
-
*/
|
|
19
|
-
label?: string | ReactElement;
|
|
20
|
-
/** The label for this DatePicker element. */
|
|
21
|
-
labelText?: string | ReactElement;
|
|
22
|
-
/** 'true' to use the light version. */
|
|
23
|
-
light?: boolean;
|
|
24
|
-
/** The latest date it is possible to select */
|
|
25
|
-
maxDate?: DateInputValue;
|
|
26
|
-
/** The earliest date it is possible to select */
|
|
27
|
-
minDate?: DateInputValue;
|
|
28
9
|
/** Handler that is called when the value changes. */
|
|
29
10
|
onChange?: (value: [Date | null | undefined, Date | null | undefined]) => void;
|
|
30
11
|
/** Handler that is called when the value changes. Note that this provides types from @internationalized/date. */
|
|
@@ -36,4 +17,4 @@ export interface OpenmrsDateRangePickerProps extends Omit<DateRangePickerProps<C
|
|
|
36
17
|
* A date range picker to enter or select a date and time range. Based on React Aria, but styled to look like Carbon.
|
|
37
18
|
*/
|
|
38
19
|
export declare const OpenmrsDateRangePicker: React.ForwardRefExoticComponent<OpenmrsDateRangePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
-
//# sourceMappingURL=date-range-picker.component.d.ts.map
|
|
20
|
+
//# sourceMappingURL=openmrs-date-range-picker.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openmrs-date-range-picker.component.d.ts","sourceRoot":"","sources":["../../src/datepicker/openmrs-date-range-picker.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAE1D,OAAO,EAIL,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EAEf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAOxE,gDAAgD;AAChD,MAAM,WAAW,2BACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,EACnG,mBAAmB;IACrB,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAChD,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IAC/E,iHAAiH;IACjH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,6BAA6B;IAC7B,KAAK,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,oGAiJlC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type Argument } from 'classnames';
|
|
3
|
+
import { type ConfigType as DayjsConfigType } from 'dayjs';
|
|
4
|
+
import { type CalendarDate, type CalendarDateTime, type ZonedDateTime } from '@internationalized/date';
|
|
5
|
+
/** A type for any of the acceptable date formats */
|
|
6
|
+
export type DateInputValue = CalendarDate | CalendarDateTime | ZonedDateTime | DayjsConfigType;
|
|
7
|
+
/**
|
|
8
|
+
* Common props shared by both OpenmrsDatePicker and OpenmrsDateRangePicker.
|
|
9
|
+
*/
|
|
10
|
+
export interface DatePickerBaseProps {
|
|
11
|
+
/** Any CSS classes to add to the outer div of the date picker */
|
|
12
|
+
className?: Argument;
|
|
13
|
+
/** Whether the input value is invalid. */
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
/** Text to show if the input is invalid e.g. an error message */
|
|
16
|
+
invalidText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The label for this DatePicker element
|
|
19
|
+
* @deprecated Use labelText instead
|
|
20
|
+
*/
|
|
21
|
+
label?: string | ReactElement;
|
|
22
|
+
/** The label for this DatePicker element. */
|
|
23
|
+
labelText?: string | ReactElement;
|
|
24
|
+
/** 'true' to use the light version. */
|
|
25
|
+
light?: boolean;
|
|
26
|
+
/** The latest date it is possible to select */
|
|
27
|
+
maxDate?: DateInputValue;
|
|
28
|
+
/** The earliest date it is possible to select. Defaults to January 1, 1793 when omitted. */
|
|
29
|
+
minDate?: DateInputValue;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/datepicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEvG,oDAAoD;AACpD,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,gBAAgB,GAAG,aAAa,GAAG,eAAe,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC9B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAClC,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Calendar, type DateValue } from '@internationalized/date';
|
|
2
|
-
import { type DateInputValue } from './
|
|
2
|
+
import { type DateInputValue } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Function to convert relatively arbitrary date values into a React Aria `DateValue`,
|
|
5
5
|
* normally a `CalendarDate`, which represents a date without time or timezone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/datepicker/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/datepicker/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,SAAS,EAAE,IAAI,GACd,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;AAChC,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,SAAS,EAAE,KAAK,GACf,SAAS,GAAG,SAAS,CAAC;AACzB,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAC7B,SAAS,GAAG,SAAS,CAAC;AAuBzB;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAK7E;AAED,iDAAiD;AACjD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAWnD"}
|