-
Notifications
You must be signed in to change notification settings - Fork 285
Date and Time zoom support #13964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Todor-ads
wants to merge
16
commits into
main
Choose a base branch
from
date_time_zoom
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Date and Time zoom support #13964
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1c5fba3
feat(zoom): Step 01-04 — 200% zoom support for DatePicker
Todor-ads 20e5435
fix(ui5-date-picker): fix min/max validation at 200% zoom
Todor-ads 722a0f9
feat(zoom): DatePicker HZ validation, calendar type toggle, YearPicke…
Todor-ads 5a155fb
feat(zoom): Step 03 — TimePicker high-zoom support
Todor-ads 9beef62
feat(zoom): Step 07 — Calendar standalone high-zoom support
Todor-ads 591adfe
feat(date and time controls): add support 200% zoom
Todor-ads 9d04dd2
feat(date and time controls): add support 200% zoom
Todor-ads 624d3ae
fix(zoom): sync input and dialog at high zoom and fix year picker layout
Todor-ads 72b3dc3
fix(zoom): center time inputs, align top padding and shorten time labels
Todor-ads 6b89ae6
fix(zoom): increase dialog padding to 1rem and prevent horizontal scroll
Todor-ads 4f5b23a
fix(zoom): increase dialog padding to 1rem and prevent horizontal scroll
Todor-ads 355f9fe
fix(ui5-date-picker): fix min/max ISO serialization for non-Gregorian…
Todor-ads 8782cdd
fix(ui5-date-picker): fix non-Gregorian year offset when confirming a…
Todor-ads d62d157
fix(zoom): fix CI lint and JSDoc errors introduced by high-zoom branch
Todor-ads 7e6c367
fix(zoom): accessibility, init fallback, and selectionMode guard for …
Todor-ads 9e36785
fix(zoom): correct non-Gregorian calendar support in high-zoom date i…
Todor-ads File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -387,7 +387,12 @@ | |
| this._handleResizeBound = this._handleResize.bind(this); | ||
| } | ||
|
|
||
| override get _shouldWatchZoom(): boolean { | ||
| return isPhone(); | ||
| } | ||
|
|
||
| onEnterDOM() { | ||
| super.onEnterDOM(); | ||
| ResizeHandler.register(document.body, this._handleResizeBound); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we start watch only for mobile devices we won't need this |
||
| this._handleResize(); | ||
| } | ||
|
|
@@ -421,6 +426,7 @@ | |
| } | ||
|
|
||
| onExitDOM() { | ||
| super.onExitDOM(); | ||
| ResizeHandler.deregister(document.body, this._handleResizeBound); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same logic should be applied also for |
||
| } | ||
|
|
||
|
|
@@ -948,6 +954,33 @@ | |
| this._selectedItemType = "None"; | ||
| } | ||
|
|
||
| get _hzDatePickerValue(): string { | ||
| const ts = this._selectedDatesTimestamps[0] ?? this._timestamp; | ||
| const calDate = CalendarDateComponent.fromTimestamp(ts * 1000, this._primaryCalendarType); | ||
| return DateFormat.getDateInstance({ pattern: "yyyy-MM-dd", calendarType: this._primaryCalendarType }).format(calDate.toUTCJSDate()) as string; | ||
| } | ||
|
|
||
| _onHzDatePickerChange(e: CustomEvent<{ value: string, valid: boolean }>) { | ||
| if (!e.detail.valid) { return; } | ||
| const fmt = DateFormat.getDateInstance({ strictParsing: true, pattern: "yyyy-MM-dd", calendarType: this._primaryCalendarType }); | ||
| const isoDate = fmt.parse(e.detail.value, true) as Date | null; | ||
| if (!isoDate) { return; } | ||
| const calDate = CalendarDateComponent.fromLocalJSDate(isoDate, this._primaryCalendarType); | ||
| const timestamp = calDate.valueOf() / 1000; | ||
| this.timestamp = timestamp; | ||
| this._fireEventAndUpdateSelectedDates([timestamp]); | ||
| } | ||
|
|
||
| get _hzMinISO(): string { | ||
| if (!this.minDate) { return ""; } | ||
| return DateFormat.getDateInstance({ pattern: "yyyy-MM-dd", calendarType: this._primaryCalendarType }).format(this._minDate.toUTCJSDate()) as string; | ||
| } | ||
|
|
||
| get _hzMaxISO(): string { | ||
| if (!this.maxDate) { return ""; } | ||
| return DateFormat.getDateInstance({ pattern: "yyyy-MM-dd", calendarType: this._primaryCalendarType }).format(this._maxDate.toUTCJSDate()) as string; | ||
| } | ||
|
|
||
| get _specialDates() { | ||
| return this.getSlottedNodes<SpecialCalendarDate>("specialDates"); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| export interface CalendarHeaderHost { | ||
| _previousButtonDisabled: boolean; | ||
| _nextButtonDisabled: boolean; | ||
| _portraitView: boolean; | ||
| _isHeaderMonthButtonHidden: boolean; | ||
| _isHeaderYearButtonHidden: boolean; | ||
| _isHeaderYearRangeButtonHidden: boolean; | ||
| _isHeaderYearRangeButtonReadonly?: boolean; | ||
| _headerMonthButtonText?: string; | ||
| _headerYearButtonText?: string; | ||
| _headerYearButtonTextSecType?: string; | ||
| _headerYearRangeButtonText?: string; | ||
| _headerYearRangeButtonTextSecType?: string; | ||
| secondMonthButtonText?: string; | ||
| hasSecondaryCalendarType: boolean; | ||
| onPrevButtonClick: (e: MouseEvent) => void; | ||
| onPrevButtonKeyDown: (e: KeyboardEvent) => void; | ||
| onPrevButtonKeyUp: (e: KeyboardEvent) => void; | ||
| onNextButtonClick: (e: MouseEvent) => void; | ||
| onNextButtonKeyDown: (e: KeyboardEvent) => void; | ||
| onNextButtonKeyUp: (e: KeyboardEvent) => void; | ||
| onHeaderMonthButtonPress?: (e: Event) => void; | ||
| onMonthButtonKeyDown?: (e: KeyboardEvent) => void; | ||
| onMonthButtonKeyUp?: (e: KeyboardEvent) => void; | ||
| onHeaderYearButtonPress?: (e: Event) => void; | ||
| onYearButtonKeyDown?: (e: KeyboardEvent) => void; | ||
| onYearButtonKeyUp?: (e: KeyboardEvent) => void; | ||
| onHeaderYearRangeButtonPress?: (e: Event) => void; | ||
| onYearRangeButtonKeyDown?: (e: KeyboardEvent) => void; | ||
| onYearRangeButtonKeyUp?: (e: KeyboardEvent) => void; | ||
| accInfo: { | ||
| ariaLabelMonthButton?: string; | ||
| ariaLabelYearButton?: string; | ||
| ariaLabelYearRangeButton?: string; | ||
| ariaLabelNextButton?: string; | ||
| ariaLabelPrevButton?: string; | ||
| keyShortcutMonthButton?: string; | ||
| keyShortcutYearButton?: string; | ||
| keyShortcutYearRangeButton?: string; | ||
| keyShortcutNextButton?: string; | ||
| keyShortcutPrevButton?: string; | ||
| tooltipMonthButton?: string; | ||
| tooltipYearButton?: string; | ||
| tooltipYearRangeButton?: string; | ||
| tooltipNextButton?: string; | ||
| tooltipPrevButton?: string; | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this for desktop devices?