@pega/cosmos-react-core 10.0.0-build.10.1 → 10.0.0-build.10.3
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/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.test-ids.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.test-ids.d.ts.map +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.styles.d.ts +1 -1
- package/lib/components/DateTime/DateTime.test-ids.d.ts +10 -10
- package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts +6 -0
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js +6 -2
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
- package/lib/components/DateTime/utils.d.ts +7 -1
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +21 -4
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapseButton.d.ts.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapseButton.js +3 -9
- package/lib/components/ExpandCollapse/ExpandCollapseButton.js.map +1 -1
- package/lib/components/File/File.test-ids.d.ts +1 -1
- package/lib/components/File/File.test-ids.d.ts.map +1 -1
- package/lib/components/File/FileInput.d.ts +1 -1
- package/lib/components/File/FileInput.styles.d.ts +1 -1
- package/lib/components/FormField/FormField.d.ts +9 -2
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +73 -3
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +2 -2
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
- package/lib/components/FormField/FormField.test-ids.js +1 -0
- package/lib/components/FormField/FormField.test-ids.js.map +1 -1
- package/lib/components/FormField/index.d.ts +1 -1
- package/lib/components/FormField/index.d.ts.map +1 -1
- package/lib/components/FormField/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts +5 -4
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +1 -0
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.test-ids.d.ts +1 -1
- package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.js +1 -1
- package/lib/components/LiveLog/LiveLog.js.map +1 -1
- package/lib/components/Location/Location.test-ids.d.ts +1 -1
- package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.js +5 -5
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
- package/lib/components/Number/Number.test-ids.d.ts +2 -2
- package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +1 -1
- package/lib/components/RadioButton/RadioButton.test-ids.d.ts +1 -1
- package/lib/components/RadioButton/RadioButton.test-ids.d.ts.map +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +1 -1
- package/lib/components/RadioCheck/RadioCheck.test-ids.d.ts +1 -1
- package/lib/components/RadioCheck/RadioCheck.test-ids.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +7 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +25 -14
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.test-ids.d.ts +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.test-ids.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
- package/lib/hooks/useI18n.d.ts +2 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +2 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +2 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +2 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/utils.d.ts +2 -0
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js +7 -0
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/themes/aurigaDarkTheme.json +1 -1
- package/lib/theme/themes/aurigaTheme.json +3 -3
- package/lib/theme/themes/velaDarkTheme.json +1 -1
- package/lib/theme/themes/velaTheme.json +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RadioCheckProps } from '../RadioCheck';
|
|
2
2
|
export type CheckboxProps = Omit<RadioCheckProps, 'type'>;
|
|
3
3
|
declare const _default: import("react").ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>> & {
|
|
4
|
-
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const getCheckboxTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getCheckboxTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
2
2
|
export declare const getCheckboxCardTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "content", "image", "label", "actions"]>;
|
|
3
3
|
//# sourceMappingURL=Checkbox.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.test-ids.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Checkbox.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.test-ids.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,qMAA+D,CAAC;AAE/F,eAAO,MAAM,sBAAsB,oJAGxB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RadioCheckGroupProps } from '../RadioCheckGroup';
|
|
2
2
|
export type CheckboxGroupProps = Omit<RadioCheckGroupProps, 'arrowNavigation'>;
|
|
3
3
|
declare const _default: import("react").ForwardRefExoticComponent<Omit<CheckboxGroupProps, "ref"> & import("react").RefAttributes<HTMLElement>> & {
|
|
4
|
-
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -47,7 +47,7 @@ type ColorResult = {
|
|
|
47
47
|
};
|
|
48
48
|
type ColorChangeHandler = (color: ColorResult, event: ChangeEvent<HTMLInputElement>) => void;
|
|
49
49
|
declare const _default: import("react").ForwardRefExoticComponent<Omit<ColorPickerProps, "ref"> & import("react").RefAttributes<HTMLInputElement>> & {
|
|
50
|
-
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
50
|
+
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
51
51
|
};
|
|
52
52
|
export default _default;
|
|
53
53
|
//# sourceMappingURL=ColorPicker.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getColorPickerTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getColorPickerTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
2
2
|
//# sourceMappingURL=ColorPicker.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ColorPicker.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,qMAGvB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type ComboBoxProps from './ComboBox.types';
|
|
2
2
|
declare const _default: import("react").ForwardRefExoticComponent<Omit<ComboBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
3
|
-
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
3
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
//# sourceMappingURL=ComboBox.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getComboBoxTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getComboBoxTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
2
2
|
//# sourceMappingURL=ComboxBox.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboxBox.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboxBox.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ComboxBox.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboxBox.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,qMAAgE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CompositeInputProps } from './CompositeInput.types';
|
|
2
2
|
declare const _default: (<P extends object>(props: CompositeInputProps<P>) => JSX.Element | null) & {
|
|
3
|
-
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
3
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
//# sourceMappingURL=CompositeInput.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getCompositeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getCompositeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
2
2
|
//# sourceMappingURL=CompositeInput.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeInput.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CompositeInput/CompositeInput.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"CompositeInput.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CompositeInput/CompositeInput.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,qMAG1B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getCurrencyInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getCurrencyInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
2
2
|
//# sourceMappingURL=Currency.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/Currency.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"Currency.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/Currency.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,qMAGzB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefForwardPropsComponent } from '../../types';
|
|
2
2
|
import type CurrencyInputProps from './CurrencyInput.types';
|
|
3
3
|
declare const _default: ForwardRefForwardPropsComponent<CurrencyInputProps> & {
|
|
4
|
-
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
//# sourceMappingURL=CurrencyInput.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const StyledCurrencyInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("../Input").InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLInputElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
3
3
|
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../Input").InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>> & {
|
|
4
|
-
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
+
getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
5
5
|
}, keyof import("react").Component<any, {}, any>>;
|
|
6
6
|
export default StyledCurrencyInput;
|
|
7
7
|
//# sourceMappingURL=CurrencyInput.styles.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export declare const getDurationInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
2
|
-
export declare const getDateInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
3
|
-
export declare const getDateRangeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
-
export declare const getDateTimeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
-
export declare const getDayOfWeekInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
6
|
-
export declare const getMonthInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
7
|
-
export declare const getQuarterInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
8
|
-
export declare const getTimeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "clear-current-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
9
|
-
export declare const getTimeRangeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
10
|
-
export declare const getWeekInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "picker", "clear-current-week", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getDurationInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
2
|
+
export declare const getDateInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
3
|
+
export declare const getDateRangeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
+
export declare const getDateTimeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
+
export declare const getDayOfWeekInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
6
|
+
export declare const getMonthInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
7
|
+
export declare const getQuarterInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
8
|
+
export declare const getTimeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "clear-current-time", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
9
|
+
export declare const getTimeRangeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
10
|
+
export declare const getWeekInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "picker", "clear-current-week", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
11
11
|
export declare const getDatePickerTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["previous-month", "month", "next-month", "calendar", "time", "set-current-date"]>;
|
|
12
12
|
//# sourceMappingURL=DateTime.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DateTime.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,gRAOzB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,mTASrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,kNAI1B,CAAC;AAEZ,eAAO,MAAM,uBAAuB,+aAezB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,qMAG1B,CAAC;AAEZ,eAAO,MAAM,oBAAoB,2NAItB,CAAC;AAEZ,eAAO,MAAM,sBAAsB,6NAIxB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,qTASrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,oPAM1B,CAAC;AAEZ,eAAO,MAAM,mBAAmB,+QAOrB,CAAC;AAEZ,eAAO,MAAM,oBAAoB,kLAOtB,CAAC"}
|
|
@@ -21,6 +21,12 @@ export interface DateTimeDisplayProps extends BaseProps {
|
|
|
21
21
|
* preserve backwards compatibility with callers that pass pre-converted values.
|
|
22
22
|
*/
|
|
23
23
|
timeZone?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Appends the timezone abbreviation after the value for the `datetime` variant. Requires a valid
|
|
26
|
+
* `timeZone`; ignored otherwise.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
showTimeZone?: boolean;
|
|
24
30
|
/** Ref for the wrapping element. */
|
|
25
31
|
ref?: Ref<HTMLTimeElement>;
|
|
26
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAK9E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,+DAA+D;IAC/D,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,kCAAkC;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,mOAAgB,CAAC;AAEnD,QAAA,MAAM,eAAe,EAAE,+BAA+B,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"DateTimeDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAK9E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,+DAA+D;IAC/D,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,kCAAkC;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,mOAAgB,CAAC;AAEnD,QAAA,MAAM,eAAe,EAAE,+BAA+B,CAAC,oBAAoB,CA6E1E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -8,12 +8,14 @@ import { getValidTimeZone, parseToDate } from './Input/utils';
|
|
|
8
8
|
import { isValidDate } from './Picker/utils';
|
|
9
9
|
import { formatDateTime } from './utils';
|
|
10
10
|
export const StyledDateTimeDisplay = styled.time ``;
|
|
11
|
-
const DateTimeDisplay = forwardRef(function DateTimeDisplay({ value, variant, format = 'medium', clockFormat, timeZone, ...restProps }, ref) {
|
|
11
|
+
const DateTimeDisplay = forwardRef(function DateTimeDisplay({ value, variant, format = 'medium', clockFormat, timeZone, showTimeZone = false, ...restProps }, ref) {
|
|
12
12
|
const { locale } = useConfiguration();
|
|
13
13
|
const t = useI18n();
|
|
14
14
|
const parsedDate = value || value === 0 ? parseToDate(value) : undefined;
|
|
15
15
|
const hasValue = !!parsedDate && isValidDate(parsedDate);
|
|
16
16
|
const resolvedTimeZone = useMemo(() => getValidTimeZone(timeZone) ?? 'UTC', [timeZone]);
|
|
17
|
+
// The timezone is only shown when the caller supplied a valid one; the UTC fallback is not shown.
|
|
18
|
+
const shouldShowTimeZone = showTimeZone && !!getValidTimeZone(timeZone);
|
|
17
19
|
const displayText = hasValue
|
|
18
20
|
? cap(formatDateTime(parsedDate, {
|
|
19
21
|
t,
|
|
@@ -21,7 +23,8 @@ const DateTimeDisplay = forwardRef(function DateTimeDisplay({ value, variant, fo
|
|
|
21
23
|
format,
|
|
22
24
|
variant,
|
|
23
25
|
clockFormat,
|
|
24
|
-
timeZone: resolvedTimeZone
|
|
26
|
+
timeZone: resolvedTimeZone,
|
|
27
|
+
showTimeZone: shouldShowTimeZone
|
|
25
28
|
}))
|
|
26
29
|
: undefined;
|
|
27
30
|
// Abbreviated month names (e.g. "Oct") read phonetically to screen readers, so an
|
|
@@ -36,6 +39,7 @@ const DateTimeDisplay = forwardRef(function DateTimeDisplay({ value, variant, fo
|
|
|
36
39
|
variant,
|
|
37
40
|
clockFormat,
|
|
38
41
|
timeZone: resolvedTimeZone,
|
|
42
|
+
showTimeZone: shouldShowTimeZone,
|
|
39
43
|
abbreviated: false
|
|
40
44
|
}))
|
|
41
45
|
: displayText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeDisplay.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimeDisplay.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA+BzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAEnD,MAAM,eAAe,GAA0D,UAAU,CACvF,SAAS,eAAe,CACtB,EACE,KAAK,EACL,OAAO,EACP,MAAM,GAAG,QAAQ,EACjB,WAAW,EACX,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,GAAG,SAAS,EAC0B,EACxC,GAAgC;IAEhC,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,UAAU,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,MAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;IAEzD,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxF,kGAAkG;IAClG,MAAM,kBAAkB,GAAG,YAAY,IAAI,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAExE,MAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,GAAG,CACD,cAAc,CAAC,UAAU,EAAE;YACzB,CAAC;YACD,MAAM;YACN,MAAM;YACN,OAAO;YACP,WAAW;YACX,QAAQ,EAAE,gBAAgB;YAC1B,YAAY,EAAE,kBAAkB;SACjC,CAAC,CACH;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,kFAAkF;IAClF,oFAAoF;IACpF,sFAAsF;IACtF,0EAA0E;IAC1E,MAAM,cAAc,GAClB,QAAQ,IAAI,MAAM,KAAK,QAAQ;QAC7B,CAAC,CAAC,GAAG,CACD,cAAc,CAAC,UAAU,EAAE;YACzB,CAAC;YACD,MAAM;YACN,MAAM;YACN,OAAO;YACP,WAAW;YACX,QAAQ,EAAE,gBAAgB;YAC1B,YAAY,EAAE,kBAAkB;YAChC,WAAW,EAAE,KAAK;SACnB,CAAC,CACH;QACH,CAAC,CAAC,WAAW,CAAC;IAElB,IAAI,OAAO,GAAG,KAAC,OAAO,KAAG,CAAC;IAC1B,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,WAAW,KAAK,cAAc,CAAC,CAAC,CAAC,CAC/B,6BAAkB,cAAc,YAAG,WAAW,GAAQ,CACvD,CAAC,CAAC,CAAC,CACF,4BAAG,WAAW,GAAI,CACnB,CAAC;IACN,CAAC;IAED,OAAO,CACL,KAAC,qBAAqB,IACpB,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,KACrD,SAAS,YAEZ,OAAO,GACc,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled from 'styled-components';\n\nimport type { BaseProps, ForwardRefForwardPropsComponent } from '../../types';\nimport { useConfiguration, useI18n } from '../../hooks';\nimport NoValue from '../NoValue/NoValue';\nimport cap from '../../utils/cap';\n\nimport type { DateTimeFormat, DateTimeVariant } from './DateTime.types';\nimport { getValidTimeZone, parseToDate } from './Input/utils';\nimport type { ClockFormat } from './Input/utils';\nimport { isValidDate } from './Picker/utils';\nimport { formatDateTime } from './utils';\n\nexport interface DateTimeDisplayProps extends BaseProps {\n /** Date as ISO8601 string, timestamp or native Date object. */\n value?: Date | string | number;\n /** Controls date time variant. */\n variant: DateTimeVariant;\n /**\n * Controls display format.\n * @default 'medium'\n */\n format?: DateTimeFormat;\n /** Defines clock format that overrides locale based format */\n clockFormat?: ClockFormat;\n /**\n * IANA timezone identifier (e.g. 'America/New_York', 'Europe/Paris').\n * When provided all screens will render the value in this timezone regardless\n * of the browser locale. When omitted the component defaults to UTC to\n * preserve backwards compatibility with callers that pass pre-converted values.\n */\n timeZone?: string;\n /**\n * Appends the timezone abbreviation after the value for the `datetime` variant. Requires a valid\n * `timeZone`; ignored otherwise.\n * @default false\n */\n showTimeZone?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTimeElement>;\n}\n\nexport const StyledDateTimeDisplay = styled.time``;\n\nconst DateTimeDisplay: ForwardRefForwardPropsComponent<DateTimeDisplayProps> = forwardRef(\n function DateTimeDisplay(\n {\n value,\n variant,\n format = 'medium',\n clockFormat,\n timeZone,\n showTimeZone = false,\n ...restProps\n }: PropsWithoutRef<DateTimeDisplayProps>,\n ref: DateTimeDisplayProps['ref']\n ) {\n const { locale } = useConfiguration();\n const t = useI18n();\n\n const parsedDate = value || value === 0 ? parseToDate(value) : undefined;\n const hasValue = !!parsedDate && isValidDate(parsedDate);\n\n const resolvedTimeZone = useMemo(() => getValidTimeZone(timeZone) ?? 'UTC', [timeZone]);\n // The timezone is only shown when the caller supplied a valid one; the UTC fallback is not shown.\n const shouldShowTimeZone = showTimeZone && !!getValidTimeZone(timeZone);\n\n const displayText = hasValue\n ? cap(\n formatDateTime(parsedDate, {\n t,\n locale,\n format,\n variant,\n clockFormat,\n timeZone: resolvedTimeZone,\n showTimeZone: shouldShowTimeZone\n })\n )\n : undefined;\n\n // Abbreviated month names (e.g. \"Oct\") read phonetically to screen readers, so an\n // accessible, fully expanded label (e.g. \"October\") is exposed via aria-label while\n // the visible, abbreviated text stays unchanged. Only 'medium' format ever renders an\n // abbreviated month name, so other formats simply reuse the display text.\n const accessibleText =\n hasValue && format === 'medium'\n ? cap(\n formatDateTime(parsedDate, {\n t,\n locale,\n format,\n variant,\n clockFormat,\n timeZone: resolvedTimeZone,\n showTimeZone: shouldShowTimeZone,\n abbreviated: false\n })\n )\n : displayText;\n\n let content = <NoValue />;\n if (hasValue) {\n content =\n displayText !== accessibleText ? (\n <abbr aria-label={accessibleText}>{displayText}</abbr>\n ) : (\n <>{displayText}</>\n );\n }\n\n return (\n <StyledDateTimeDisplay\n ref={ref}\n dateTime={hasValue ? parsedDate.toISOString() : undefined}\n {...restProps}\n >\n {content}\n </StyledDateTimeDisplay>\n );\n }\n);\n\nexport default DateTimeDisplay;\n"]}
|
|
@@ -31,7 +31,7 @@ export declare const StyledDateInput: import("styled-components/dist/types").ISt
|
|
|
31
31
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLDivElement> | null | undefined;
|
|
32
32
|
}, DateInputProps>> & string;
|
|
33
33
|
declare const _default: FunctionComponent<DateInputProps & ForwardProps> & {
|
|
34
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
34
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
35
35
|
};
|
|
36
36
|
export default _default;
|
|
37
37
|
//# sourceMappingURL=DateInput.d.ts.map
|
|
@@ -40,7 +40,7 @@ export interface DateRangeInputProps extends DateTimeProperties {
|
|
|
40
40
|
handle?: Ref<DateRangeInputHandleValue>;
|
|
41
41
|
}
|
|
42
42
|
declare const _default: import("react").ForwardRefExoticComponent<DateRangeInputProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
43
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
43
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
44
44
|
};
|
|
45
45
|
export default _default;
|
|
46
46
|
//# sourceMappingURL=DateRangeInput.d.ts.map
|
|
@@ -44,7 +44,7 @@ export declare const StyledDateTimeInput: import("styled-components/dist/types")
|
|
|
44
44
|
}, DateTimeInputProps>> & string;
|
|
45
45
|
export declare const convertToCallbackParameter: (date: Date, parts: DateTimeParts<string | undefined>, locale: string) => DateTimeCallbackParameter;
|
|
46
46
|
declare const _default: FunctionComponent<DateTimeInputProps & ForwardProps> & {
|
|
47
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
47
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
48
48
|
};
|
|
49
49
|
export default _default;
|
|
50
50
|
//# sourceMappingURL=DateTimeInput.d.ts.map
|
|
@@ -36,7 +36,7 @@ export interface DayOfWeekInputProps extends TestIdProp, BaseProps {
|
|
|
36
36
|
onChange?: (value: DayOfWeek) => void;
|
|
37
37
|
}
|
|
38
38
|
declare const _default: FunctionComponent<DayOfWeekInputProps & ForwardProps> & {
|
|
39
|
-
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
39
|
+
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
40
40
|
};
|
|
41
41
|
export default _default;
|
|
42
42
|
//# sourceMappingURL=DayOfWeekInput.d.ts.map
|
|
@@ -2,7 +2,7 @@ import type { FunctionComponent } from 'react';
|
|
|
2
2
|
import type { ForwardProps } from '../../../../types';
|
|
3
3
|
import type DurationInputProps from './DurationInput.types';
|
|
4
4
|
declare const _default: FunctionComponent<DurationInputProps & ForwardProps> & {
|
|
5
|
-
getTestIds: (testIdProp?: import("../../../..").TestIdProp["testId"]) => import("../../../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
+
getTestIds: (testIdProp?: import("../../../..").TestIdProp["testId"]) => import("../../../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
//# sourceMappingURL=DurationInput.d.ts.map
|
|
@@ -15,7 +15,7 @@ export declare const StyledMonthInput: import("styled-components/dist/types").IS
|
|
|
15
15
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
16
|
}, MonthInputProps>> & string;
|
|
17
17
|
declare const _default: FunctionComponent<MonthInputProps & ForwardProps> & {
|
|
18
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
18
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
19
19
|
};
|
|
20
20
|
export default _default;
|
|
21
21
|
//# sourceMappingURL=MonthInput.d.ts.map
|
|
@@ -10,7 +10,7 @@ export declare const StyledQuarterInput: import("styled-components/dist/types").
|
|
|
10
10
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
11
|
}, QuarterInputProps>> & string;
|
|
12
12
|
declare const _default: FunctionComponent<QuarterInputProps & ForwardProps> & {
|
|
13
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
13
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
|
16
16
|
//# sourceMappingURL=QuarterInput.d.ts.map
|
|
@@ -33,7 +33,7 @@ export declare const StyledTimeInput: import("styled-components/dist/types").ISt
|
|
|
33
33
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
34
34
|
}, TimeInputProps>> & string;
|
|
35
35
|
declare const _default: ForwardRefForwardPropsComponent<TimeInputComponentProps> & {
|
|
36
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "clear-current-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
36
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "picker", "clear-current-time", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
37
37
|
};
|
|
38
38
|
export default _default;
|
|
39
39
|
//# sourceMappingURL=TimeInput.d.ts.map
|
|
@@ -49,7 +49,7 @@ export interface TimeRangeInputProps extends DateTimeProperties {
|
|
|
49
49
|
handle?: Ref<TimeRangeInputHandleValue>;
|
|
50
50
|
}
|
|
51
51
|
declare const _default: import("react").ForwardRefExoticComponent<TimeRangeInputProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
52
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
52
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
53
53
|
};
|
|
54
54
|
export default _default;
|
|
55
55
|
//# sourceMappingURL=TimeRangeInput.d.ts.map
|
|
@@ -11,7 +11,7 @@ export declare const StyledWeekInput: import("styled-components/dist/types").ISt
|
|
|
11
11
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
12
|
}, WeekInputProps>> & string;
|
|
13
13
|
declare const _default: ForwardRefForwardPropsComponent<WeekInputComponentProps> & {
|
|
14
|
-
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "picker", "clear-current-week", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
14
|
+
getTestIds: (testIdProp?: import("../../..").TestIdProp["testId"]) => import("../../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "picker", "clear-current-week", "label", "info", "additional-info", "actions", "suggestion-accept", "suggestion-reject"]>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
17
17
|
//# sourceMappingURL=WeekInput.d.ts.map
|
|
@@ -7,6 +7,12 @@ type DateTimeFormatOptions<F extends DateTimeFormat = DateTimeFormat> = {
|
|
|
7
7
|
locale: string;
|
|
8
8
|
format: F;
|
|
9
9
|
timeZone?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Appends the timezone abbreviation after the formatted value. Only applies to the `datetime`
|
|
12
|
+
* variant when a valid `timeZone` is also supplied.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
showTimeZone?: boolean;
|
|
10
16
|
clockFormat?: ClockFormat;
|
|
11
17
|
calendarType?: CalendarType;
|
|
12
18
|
} & (F extends 'medium' ? {
|
|
@@ -28,7 +34,7 @@ type DateTimeFormatOptions<F extends DateTimeFormat = DateTimeFormat> = {
|
|
|
28
34
|
t: TranslationFunction<TranslationPack>;
|
|
29
35
|
});
|
|
30
36
|
export declare function getIntlDateTimeFormatFromCache(locale: string, options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
31
|
-
export declare function formatDateTime<F extends DateTimeFormat>(value: Date, { t, locale, format, variant, clockFormat, calendarType, timeZone, abbreviated }: DateTimeFormatOptions<F>): string;
|
|
37
|
+
export declare function formatDateTime<F extends DateTimeFormat>(value: Date, { t, locale, format, variant, clockFormat, calendarType, timeZone, showTimeZone, abbreviated }: DateTimeFormatOptions<F>): string;
|
|
32
38
|
interface DurationFormatOptions {
|
|
33
39
|
/** Locale to be used - en_US, jp_JP, fr_FR etc */
|
|
34
40
|
locale: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAAK,EAAmB,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAAK,EAAmB,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AASlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAwBjD,KAAK,qBAAqB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,GAAG,CAAC,CAAC,SAAS,QAAQ,GACnB;IACE;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACD;IAAE,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAC1B,CACI;IACE,OAAO,EAAE,aAAa,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IACvD,CAAC,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACD;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAA;CAAE,CACtE,CAAC;AA6KJ,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,IAAI,CAAC,qBAA0B,uBAUzC;AAkDD,wBAAgB,cAAc,CAAC,CAAC,SAAS,cAAc,EACrD,KAAK,EAAE,IAAI,EACX,EACE,CAAC,EACD,MAAM,EACN,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAsC,EACtC,QAAQ,EACR,YAAoB,EACpB,WAAkB,EACnB,EAAE,qBAAqB,CAAC,CAAC,CAAC,UAgH5B;AAOD,UAAU,qBAAqB;IAC7B,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,gBAAgB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACtD;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;CACrE;AAgBD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,EACE,MAAM,EACN,gBAAgB,EAChB,WAAsB,EACtB,YAAuB,EACxB,EAAE,qBAAqB,UAgCzB;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,IAIzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,KAAG,IAQpE,CAAC"}
|
|
@@ -4,7 +4,7 @@ import tz from 'dayjs/plugin/timezone';
|
|
|
4
4
|
import utc from 'dayjs/plugin/utc';
|
|
5
5
|
import { cap } from '../../utils';
|
|
6
6
|
import { CALENDAR_TYPES } from './Input/local';
|
|
7
|
-
import { getEndOfWeek, getQuarterForDateTimeZone, getStartOfWeek, getWeek, getWeekYear } from './Input/utils';
|
|
7
|
+
import { getEndOfWeek, getQuarterForDateTimeZone, getStartOfWeek, getValidTimeZone, getWeek, getWeekYear } from './Input/utils';
|
|
8
8
|
dayjs.extend(utc);
|
|
9
9
|
dayjs.extend(tz);
|
|
10
10
|
const unitsInMs = {
|
|
@@ -186,7 +186,19 @@ function expandAbbreviatedMonthParts(date, parts, locale, timeZone) {
|
|
|
186
186
|
return part.value === longMonth ? part : { ...part, value: longMonth };
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
function getTimeZoneText(date, locale, timeZone) {
|
|
190
|
+
const validTimeZone = getValidTimeZone(timeZone);
|
|
191
|
+
if (!validTimeZone)
|
|
192
|
+
return undefined;
|
|
193
|
+
return getIntlDateTimeFormatFromCache(locale, {
|
|
194
|
+
timeZone: validTimeZone,
|
|
195
|
+
timeZoneName: 'short',
|
|
196
|
+
hour: 'numeric'
|
|
197
|
+
})
|
|
198
|
+
.formatToParts(date)
|
|
199
|
+
.find(part => part.type === 'timeZoneName')?.value;
|
|
200
|
+
}
|
|
201
|
+
export function formatDateTime(value, { t, locale, format, variant, clockFormat, calendarType = CALENDAR_TYPES.ISO_8601, timeZone, showTimeZone = false, abbreviated = true }) {
|
|
190
202
|
const getFormattedDate = (date, dateVariant) => {
|
|
191
203
|
const resolvedVariant = dateVariant === 'time' || dateVariant === 'datetime'
|
|
192
204
|
? `${dateVariant}${clockFormat ?? ''}`
|
|
@@ -258,8 +270,13 @@ export function formatDateTime(value, { t, locale, format, variant, clockFormat,
|
|
|
258
270
|
return getFormattedWeek(value);
|
|
259
271
|
case 'quarteryear':
|
|
260
272
|
return getFormattedQuarterYear(value);
|
|
261
|
-
default:
|
|
262
|
-
|
|
273
|
+
default: {
|
|
274
|
+
const formattedDate = getFormattedDate(value, variant);
|
|
275
|
+
if (!showTimeZone || variant !== 'datetime')
|
|
276
|
+
return formattedDate;
|
|
277
|
+
const timeZoneText = getTimeZoneText(value, locale, timeZone);
|
|
278
|
+
return timeZoneText ? `${formattedDate} ${timeZoneText}` : formattedDate;
|
|
279
|
+
}
|
|
263
280
|
}
|
|
264
281
|
}
|
|
265
282
|
const dayInMs = 24 * 60 * 60 * 1000;
|