@ui5/webcomponents 2.20.0 → 2.21.0-rc.0
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/CHANGELOG.md +36 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/Button.d.ts +6 -0
- package/dist/Button.js +11 -2
- package/dist/Button.js.map +1 -1
- package/dist/Carousel.d.ts +14 -13
- package/dist/Carousel.js +93 -177
- package/dist/Carousel.js.map +1 -1
- package/dist/CarouselTemplate.js +2 -2
- package/dist/CarouselTemplate.js.map +1 -1
- package/dist/ColorPaletteTemplate.js +1 -1
- package/dist/ColorPaletteTemplate.js.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/DayPickerTemplate.js +1 -1
- package/dist/DayPickerTemplate.js.map +1 -1
- package/dist/Dialog.d.ts +0 -3
- package/dist/Dialog.js +3 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +12 -4
- package/dist/Icon.js.map +1 -1
- package/dist/IconTemplate.js +1 -1
- package/dist/IconTemplate.js.map +1 -1
- package/dist/Input.d.ts +2 -1
- package/dist/Input.js +38 -16
- package/dist/Input.js.map +1 -1
- package/dist/Menu.js +6 -1
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.d.ts +8 -0
- package/dist/MenuItem.js +29 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MenuItemTemplate.js +2 -2
- package/dist/MenuItemTemplate.js.map +1 -1
- package/dist/MultiComboBox.js +5 -0
- package/dist/MultiComboBox.js.map +1 -1
- package/dist/MultiInput.js +4 -5
- package/dist/MultiInput.js.map +1 -1
- package/dist/StepInput.d.ts +5 -0
- package/dist/StepInput.js +26 -5
- package/dist/StepInput.js.map +1 -1
- package/dist/Switch.d.ts +8 -4
- package/dist/Switch.js +15 -11
- package/dist/Switch.js.map +1 -1
- package/dist/SwitchTemplate.js +1 -1
- package/dist/SwitchTemplate.js.map +1 -1
- package/dist/TimePicker.d.ts +55 -3
- package/dist/TimePicker.js +160 -26
- package/dist/TimePicker.js.map +1 -1
- package/dist/TimePickerTemplate.js +1 -1
- package/dist/TimePickerTemplate.js.map +1 -1
- package/dist/TimeSelectionClocks.js +8 -0
- package/dist/TimeSelectionClocks.js.map +1 -1
- package/dist/Token.js +2 -2
- package/dist/Token.js.map +1 -1
- package/dist/Tokenizer.js +2 -1
- package/dist/Tokenizer.js.map +1 -1
- package/dist/css/themes/Breadcrumbs.css +1 -1
- package/dist/css/themes/ColorPaletteItem.css +1 -1
- package/dist/css/themes/DatePickerPopover.css +1 -1
- package/dist/css/themes/MenuItem.css +1 -1
- package/dist/css/themes/PopupsCommon.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/custom-elements-internal.json +69 -6
- package/dist/custom-elements.json +66 -6
- package/dist/features/InputSuggestions.js +2 -1
- package/dist/features/InputSuggestions.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +7 -2
- package/dist/generated/i18n/i18n-defaults.js +7 -2
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/Breadcrumbs.css.d.ts +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js.map +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.d.ts +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js.map +1 -1
- package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/MenuItem.css.d.ts +1 -1
- package/dist/generated/themes/MenuItem.css.js +1 -1
- package/dist/generated/themes/MenuItem.css.js.map +1 -1
- package/dist/generated/themes/PopupsCommon.css.d.ts +1 -1
- package/dist/generated/themes/PopupsCommon.css.js +1 -1
- package/dist/generated/themes/PopupsCommon.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +13 -3
- package/dist/web-types.json +28 -8
- package/package.json +9 -9
- package/src/CarouselTemplate.tsx +3 -3
- package/src/ColorPaletteTemplate.tsx +2 -2
- package/src/DayPickerTemplate.tsx +1 -1
- package/src/IconTemplate.tsx +1 -0
- package/src/MenuItemTemplate.tsx +11 -1
- package/src/SwitchTemplate.tsx +2 -2
- package/src/TimePickerTemplate.tsx +1 -1
- package/src/i18n/messagebundle.properties +17 -2
- package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
- package/src/themes/Breadcrumbs.css +6 -2
- package/src/themes/ColorPaletteItem.css +14 -0
- package/src/themes/DatePickerPopover.css +5 -0
- package/src/themes/MenuItem.css +5 -0
- package/src/themes/PopupsCommon.css +7 -0
- package/src/themes/base/Bar-parameters.css +1 -0
- package/src/themes/base/Breadcrumbs-parameters.css +4 -0
- package/src/themes/sap_fiori_3/parameters-bundle.css +2 -1
- package/src/themes/sap_fiori_3_dark/parameters-bundle.css +2 -1
- package/src/themes/sap_fiori_3_hcb/parameters-bundle.css +2 -1
- package/src/themes/sap_fiori_3_hcw/parameters-bundle.css +2 -1
- package/src/themes/sap_horizon/Breadcrumbs-parameters.css +5 -1
- package/src/themes/sap_horizon/CalendarHeader-parameters.css +3 -3
- package/src/themes/sap_horizon/DayPicker-parameters.css +3 -3
- package/src/themes/sap_horizon_dark/Breadcrumbs-parameters.css +5 -1
- package/src/themes/sap_horizon_dark/CalendarHeader-parameters.css +2 -2
- package/src/themes/sap_horizon_hcb/Breadcrumbs-parameters.css +6 -0
- package/src/themes/sap_horizon_hcb/parameters-bundle.css +2 -1
- package/src/themes/sap_horizon_hcw/Breadcrumbs-parameters.css +6 -0
- package/src/themes/sap_horizon_hcw/parameters-bundle.css +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchTemplate.js","sourceRoot":"","sources":["../src/SwitchTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,UAAU,MAAM,yCAAyC,CAAC;AACjE,OAAO,WAAW,MAAM,0CAA0C,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,cAAc;IACrC,OAAO,CACN,eACC,KAAK,EAAE;YACN,iBAAiB,EAAE,IAAI;YACvB,qBAAqB,EAAE,SAAS,EAAE;YAClC,sBAAsB,EAAE,IAAI,CAAC,QAAQ;YACrC,qBAAqB,EAAE,IAAI,CAAC,OAAO;YACnC,sBAAsB,EAAE,IAAI,CAAC,SAAS;YACtC,sBAAsB,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC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AK,EAAC,oBAAoB,GAAE,GAC9C,EACP,eAAM,KAAK,EAAC,sCAAsC,YACjD,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,qBAAqB,GAAE,GAChD,IACL;gCACH,CAAC;oCACD,4BACE,IAAI,CAAC,UAAU,CAAC,CAAC;4CACjB,8BACC,eAAM,KAAK,EAAC,8DAA8D,EAAC,IAAI,EAAC,SAAS,YACxF,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAC,6BAA6B,GAAG,GAC9D,EACP,eAAM,KAAK,EAAC,+DAA+D,EAAC,IAAI,EAAC,UAAU,YAC1F,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAC,8BAA8B,GAAG,GAC/D,IACL;4CACH,CAAC;gDACD,8BACC,eAAM,KAAK,EAAC,qCAAqC,EAAC,IAAI,EAAC,SAAS,iBAAc,IAAI,CAAC,eAAe,YAAG,IAAI,CAAC,OAAO,GAAQ,EACzH,eAAM,KAAK,EAAC,sCAAsC,EAAC,IAAI,EAAC,UAAU,iBAAc,IAAI,CAAC,eAAe,YAAG,IAAI,CAAC,QAAQ,GAAQ,IAC1H,GAEF,EAGJ,eAAM,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAC,QAAQ,GAAQ,IAChD,GACD,GACD,EACN,gBAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,kBAAkB,gCAAsB,IACvF,CAAC,CAAC;AACV,CAAC","sourcesContent":["import Icon from \"./Icon.js\";\nimport { isDesktop, isSafari } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type Switch from \"./Switch.js\";\nimport acceptIcon from \"@ui5/webcomponents-icons/dist/accept.js\";\nimport declineIcon from \"@ui5/webcomponents-icons/dist/decline.js\";\n\nexport default function SwitchTemplate(this: Switch) {\n\treturn (\n\t\t<div\n\t\t\tclass={{\n\t\t\t\t\"ui5-switch-root\": true,\n\t\t\t\t\"ui5-switch--desktop\": isDesktop(),\n\t\t\t\t\"ui5-switch--disabled\": this.disabled,\n\t\t\t\t\"ui5-switch--checked\": this.checked,\n\t\t\t\t\"ui5-switch--semantic\": this.graphical,\n\t\t\t\t\"ui5-switch--no-label\": !(this.graphical || this.textOn || this.textOff),\n\t\t\t\t\"ui5-switch--safari\": isSafari(),\n\t\t\t}}\n\t\t\trole=\"switch\"\n\t\t\taria-label={this.ariaLabelText}\n\t\t\taria-checked={this.checked}\n\t\t\taria-disabled={this.effectiveAriaDisabled}\n\t\t\taria-required={this.required}\n\t\t\tonClick={this._onclick}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\ttabindex={this.effectiveTabIndex}\n\t\t\ttitle={this.tooltip}\n\t\t>\n\t\t\t<div class=\"ui5-switch-inner\">\n\t\t\t\t<div class=\"ui5-switch-track\" part=\"slider\">\n\t\t\t\t\t<div class=\"ui5-switch-slider\">\n\t\t\t\t\t\t{this.graphical ?\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<span class=\"ui5-switch-text ui5-switch-text--on\">\n\t\t\t\t\t\t\t\t\t<Icon name={acceptIcon} class=\"ui5-switch-icon-on\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"ui5-switch-text ui5-switch-text--off\">\n\t\t\t\t\t\t\t\t\t<Icon name={declineIcon} class=\"ui5-switch-icon-off\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{this.hasNoLabel ?\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<span class=\"ui5-switch-text ui5-switch-text--on ui5-switch-no-label-icon\" part=\"text-on\">\n\t\t\t\t\t\t\t\t\t\t\t<Icon name={this.sapNextIcon} class=\"ui5-switch-no-label-icon-on\" />\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"ui5-switch-text ui5-switch-text--off ui5-switch-no-label-icon\" part=\"text-off\">\n\t\t\t\t\t\t\t\t\t\t\t<Icon name={this.sapNextIcon} class=\"ui5-switch-no-label-icon-off\" />\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<span class=\"ui5-switch-text ui5-switch-text--on\" part=\"text-on\" aria-hidden={this._textAriaHidden}>{this._textOn}</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"ui5-switch-text ui5-switch-text--off\" part=\"text-off\" aria-hidden={this._textAriaHidden}>{this._textOff}</span>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<span class=\"ui5-switch-handle\" part=\"handle\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<input type='checkbox' checked={this.checked} class=\"ui5-switch-input\" data-sap-no-tab-ref/>\n\t\t</div>);\n}\n"]}
|
package/dist/TimePicker.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { IFormInputElement } from "@ui5/webcomponents-base/dist/features/In
|
|
|
4
4
|
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
5
5
|
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
|
|
6
6
|
import "@ui5/webcomponents-localization/dist/features/calendar/Gregorian.js";
|
|
7
|
+
import DateFormat from "@ui5/webcomponents-localization/dist/DateFormat.js";
|
|
7
8
|
import IconMode from "./types/IconMode.js";
|
|
8
9
|
import type Popover from "./Popover.js";
|
|
9
10
|
import type DateTimeInput from "./DateTimeInput.js";
|
|
@@ -43,8 +44,8 @@ type TimePickerInputEventDetail = TimePickerChangeInputEventDetail;
|
|
|
43
44
|
* Supported format options are pattern-based on Unicode LDML Date Format notation.
|
|
44
45
|
* For more information, see [UTS #35: Unicode Locale Data Markup Language](https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
|
45
46
|
*
|
|
46
|
-
* For example, if the
|
|
47
|
-
*
|
|
47
|
+
* For example, if the valueFormat is "HH:mm:ss", the displayFormat is "hh:mm: ss a", and the used locale is English, a valid value string is "11:42:35", which leads to an output of "11:42:35 AM".
|
|
48
|
+
* If no placeholder is set to the TimePicker, the used displayFormat is displayed as a placeholder. If another placeholder is needed, it must be set.
|
|
48
49
|
*
|
|
49
50
|
* ### Keyboard handling
|
|
50
51
|
* [F4], [Alt]+[Up], [Alt]+[Down] Open/Close picker dialog and move focus to it.
|
|
@@ -133,6 +134,20 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
133
134
|
* @public
|
|
134
135
|
*/
|
|
135
136
|
placeholder?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Determines the format, displayed in the input field.
|
|
139
|
+
* @default undefined
|
|
140
|
+
* @since 2.20.0
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
displayFormat?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Determines the format, used for the value attribute.
|
|
146
|
+
* @default undefined
|
|
147
|
+
* @since 2.20.0
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
valueFormat?: string;
|
|
136
151
|
/**
|
|
137
152
|
* Determines the format, displayed in the input field.
|
|
138
153
|
*
|
|
@@ -141,6 +156,7 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
141
156
|
* hh:mm:ss a -> 2:23:15 PM
|
|
142
157
|
* mm:ss -> 12:04 (only minutes and seconds)
|
|
143
158
|
* @default undefined
|
|
159
|
+
* @deprecated Use displayFormat and valueFormat instead
|
|
144
160
|
* @public
|
|
145
161
|
*/
|
|
146
162
|
formatPattern?: string;
|
|
@@ -202,6 +218,12 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
202
218
|
_inputsPopover: Popover;
|
|
203
219
|
_dateTimeInput: DateTimeInput;
|
|
204
220
|
tempValue?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Cached instance of DateFormat with a format pattern of "HH:mm:ss".
|
|
223
|
+
* Used by the getISOFormat method to avoid creating a new DateFormat instance on each call.
|
|
224
|
+
* @private
|
|
225
|
+
*/
|
|
226
|
+
_isoFormatInstance?: DateFormat;
|
|
205
227
|
static i18nBundle: I18nBundle;
|
|
206
228
|
get formValidityMessage(): string;
|
|
207
229
|
get formValidity(): ValidityStateFlags;
|
|
@@ -227,7 +249,8 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
227
249
|
* @protected
|
|
228
250
|
*/
|
|
229
251
|
get _formatPattern(): string | undefined;
|
|
230
|
-
get _displayFormat(): string;
|
|
252
|
+
get _displayFormat(): string | undefined;
|
|
253
|
+
get _valueFormat(): string | undefined;
|
|
231
254
|
get _effectiveValue(): string;
|
|
232
255
|
get _timeSelectionValue(): string | undefined;
|
|
233
256
|
get _isPhone(): boolean;
|
|
@@ -277,7 +300,13 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
277
300
|
_getInputField(): HTMLInputElement | import("./Input.js").default | null;
|
|
278
301
|
_onkeydown(e: KeyboardEvent): void;
|
|
279
302
|
get _isPattern(): boolean;
|
|
303
|
+
get _isValueFormatPattern(): boolean;
|
|
304
|
+
get _isDisplayFormatPattern(): boolean;
|
|
305
|
+
get displayValue(): string;
|
|
280
306
|
getFormat(): import("sap/ui/core/format/DateFormat").default;
|
|
307
|
+
getISOFormat(): DateFormat;
|
|
308
|
+
getDisplayFormat(): import("sap/ui/core/format/DateFormat").default;
|
|
309
|
+
getValueFormat(): import("sap/ui/core/format/DateFormat").default;
|
|
281
310
|
/**
|
|
282
311
|
* Formats a Java Script date object into a string representing a locale date and time
|
|
283
312
|
* according to the `formatPattern` property of the TimePicker instance
|
|
@@ -294,6 +323,29 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
294
323
|
* @public
|
|
295
324
|
*/
|
|
296
325
|
isValid(value: string | undefined): boolean;
|
|
326
|
+
isValidDisplayValue(value: string | undefined): boolean;
|
|
327
|
+
/**
|
|
328
|
+
* Checks if a value is valid against the current `valueFormat` value.
|
|
329
|
+
*
|
|
330
|
+
* **Note:** an empty string is considered as valid value.
|
|
331
|
+
* @param value The value to be tested against the value format
|
|
332
|
+
* @public
|
|
333
|
+
*/
|
|
334
|
+
isValidValue(value: string | undefined): boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Converts a value from displayFormat to valueFormat
|
|
337
|
+
* @param value Value in displayFormat
|
|
338
|
+
* @returns Value in valueFormat
|
|
339
|
+
* @private
|
|
340
|
+
*/
|
|
341
|
+
getValueFromDisplayValue(value: string): string;
|
|
342
|
+
/**
|
|
343
|
+
* Converts a value from valueFormat to displayFormat
|
|
344
|
+
* @param value Value in valueFormat
|
|
345
|
+
* @returns Value in displayFormat
|
|
346
|
+
* @private
|
|
347
|
+
*/
|
|
348
|
+
getDisplayValueFromValue(value: string): string;
|
|
297
349
|
normalizeValue(value: string): string;
|
|
298
350
|
_modifyValueBy(amount: number, unit: string): void;
|
|
299
351
|
/**
|
package/dist/TimePicker.js
CHANGED
|
@@ -32,6 +32,7 @@ import TimePickerCss from "./generated/themes/TimePicker.css.js";
|
|
|
32
32
|
import TimePickerPopoverCss from "./generated/themes/TimePickerPopover.css.js";
|
|
33
33
|
import ResponsivePopoverCommonCss from "./generated/themes/ResponsivePopoverCommon.css.js";
|
|
34
34
|
import ValueStateMessageCss from "./generated/themes/ValueStateMessage.css.js";
|
|
35
|
+
const DEFAULT_ISO_FORMAT = "HH:mm:ss";
|
|
35
36
|
/**
|
|
36
37
|
* @class
|
|
37
38
|
*
|
|
@@ -58,8 +59,8 @@ import ValueStateMessageCss from "./generated/themes/ValueStateMessage.css.js";
|
|
|
58
59
|
* Supported format options are pattern-based on Unicode LDML Date Format notation.
|
|
59
60
|
* For more information, see [UTS #35: Unicode Locale Data Markup Language](https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
|
60
61
|
*
|
|
61
|
-
* For example, if the
|
|
62
|
-
*
|
|
62
|
+
* For example, if the valueFormat is "HH:mm:ss", the displayFormat is "hh:mm: ss a", and the used locale is English, a valid value string is "11:42:35", which leads to an output of "11:42:35 AM".
|
|
63
|
+
* If no placeholder is set to the TimePicker, the used displayFormat is displayed as a placeholder. If another placeholder is needed, it must be set.
|
|
63
64
|
*
|
|
64
65
|
* ### Keyboard handling
|
|
65
66
|
* [F4], [Alt]+[Up], [Alt]+[Down] Open/Close picker dialog and move focus to it.
|
|
@@ -144,18 +145,18 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
144
145
|
const validity = this.formValidity;
|
|
145
146
|
if (validity.valueMissing) {
|
|
146
147
|
// @ts-ignore oFormatOptions is a private API of DateFormat
|
|
147
|
-
return TimePicker_1.i18nBundle.getText(TIMEPICKER_VALUE_MISSING, this.
|
|
148
|
+
return TimePicker_1.i18nBundle.getText(TIMEPICKER_VALUE_MISSING, this.getValueFormat().oFormatOptions.pattern);
|
|
148
149
|
}
|
|
149
150
|
if (validity.patternMismatch) {
|
|
150
151
|
// @ts-ignore oFormatOptions is a private API of DateFormat
|
|
151
|
-
return TimePicker_1.i18nBundle.getText(TIMEPICKER_PATTERN_MISSMATCH, this.
|
|
152
|
+
return TimePicker_1.i18nBundle.getText(TIMEPICKER_PATTERN_MISSMATCH, this.getValueFormat().oFormatOptions.pattern);
|
|
152
153
|
}
|
|
153
154
|
return "";
|
|
154
155
|
}
|
|
155
156
|
get formValidity() {
|
|
156
157
|
return {
|
|
157
158
|
valueMissing: this.required && !this.value,
|
|
158
|
-
patternMismatch: !this.
|
|
159
|
+
patternMismatch: !this.isValidValue(this.value),
|
|
159
160
|
};
|
|
160
161
|
}
|
|
161
162
|
async formElementAnchor() {
|
|
@@ -194,12 +195,12 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
194
195
|
* @default null
|
|
195
196
|
*/
|
|
196
197
|
get dateValue() {
|
|
197
|
-
return this.
|
|
198
|
+
return this.getValueFormat().parse(this._effectiveValue);
|
|
198
199
|
}
|
|
199
200
|
get _lastAvailableTime() {
|
|
200
201
|
const date = UI5Date.getInstance();
|
|
201
202
|
date.setHours(23, 59, 59, 999);
|
|
202
|
-
return this.
|
|
203
|
+
return this.getValueFormat().format(date);
|
|
203
204
|
}
|
|
204
205
|
/**
|
|
205
206
|
* @protected
|
|
@@ -221,8 +222,21 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
221
222
|
return fallback ? localeData.getTimePattern("medium") : this.formatPattern;
|
|
222
223
|
}
|
|
223
224
|
get _displayFormat() {
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
if (this.displayFormat) {
|
|
226
|
+
return this.displayFormat;
|
|
227
|
+
}
|
|
228
|
+
if (this._formatPattern) {
|
|
229
|
+
return this._formatPattern;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
get _valueFormat() {
|
|
233
|
+
if (this.valueFormat) {
|
|
234
|
+
return this.valueFormat;
|
|
235
|
+
}
|
|
236
|
+
if (this.formatPattern) {
|
|
237
|
+
return this._formatPattern;
|
|
238
|
+
}
|
|
239
|
+
return "";
|
|
226
240
|
}
|
|
227
241
|
get _effectiveValue() {
|
|
228
242
|
return this.value;
|
|
@@ -285,7 +299,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
285
299
|
* @returns Resolves when the Inputs popover is open
|
|
286
300
|
*/
|
|
287
301
|
openInputsPopover() {
|
|
288
|
-
this.tempValue = this.value && this.
|
|
302
|
+
this.tempValue = this.value && this.isValidValue(this.value) ? this.value : this.getValueFormat().format(UI5Date.getInstance());
|
|
289
303
|
const popover = this._inputsPopover;
|
|
290
304
|
popover.opener = this;
|
|
291
305
|
popover.open = true;
|
|
@@ -340,25 +354,33 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
340
354
|
}
|
|
341
355
|
}
|
|
342
356
|
_updateValueAndFireEvents(value, normalizeValue, eventsNames) {
|
|
343
|
-
|
|
357
|
+
const isInputEvent = eventsNames.includes("input");
|
|
358
|
+
const valid = this.isValidValue(value);
|
|
359
|
+
let normalizedValue = value;
|
|
360
|
+
// Only normalize if valid - if invalid, keep raw value
|
|
361
|
+
if (value !== undefined && valid && normalizeValue && !isInputEvent) {
|
|
362
|
+
normalizedValue = this.normalizeValue(value); // transform valid values (in any format) to the correct format
|
|
363
|
+
}
|
|
364
|
+
// Store the previous value to check if it actually changed
|
|
365
|
+
const previousValue = this.value;
|
|
366
|
+
// During input events (live typing), only update tempValue, not the public value property
|
|
367
|
+
if (!isInputEvent) {
|
|
368
|
+
this.value = ""; // Do not remove! DurationPicker (an external component extending TimePicker) use case
|
|
369
|
+
this.value = normalizedValue;
|
|
370
|
+
}
|
|
371
|
+
// Always sync tempValue for the picker
|
|
372
|
+
this.tempValue = isInputEvent ? value : normalizedValue;
|
|
373
|
+
this._updateValueState(); // Change the value state to Error/None, but only if needed (must be called before early return)
|
|
374
|
+
if (previousValue === this.value) {
|
|
344
375
|
return;
|
|
345
376
|
}
|
|
346
|
-
const valid = this.isValid(value);
|
|
347
|
-
if (value !== undefined && valid && normalizeValue) { // if value === undefined, valid is guaranteed to be falsy
|
|
348
|
-
value = this.normalizeValue(value); // transform valid values (in any format) to the correct format
|
|
349
|
-
}
|
|
350
|
-
if (!eventsNames.includes("input")) {
|
|
351
|
-
this.value = ""; // Do not remove! DurationPicker (an external component extending TimePicker) use case -> value is 05:10, user tries 05:12, after normalization value is changed back to 05:10 so no invalidation happens, but the input still shows 05:12. Thus we enforce invalidation with the ""
|
|
352
|
-
this.value = value;
|
|
353
|
-
}
|
|
354
|
-
this.tempValue = value; // if the picker is open, sync it
|
|
355
|
-
this._updateValueState(); // Change the value state to Error/None, but only if needed
|
|
356
377
|
eventsNames.forEach(eventName => {
|
|
357
378
|
this.fireDecoratorEvent(eventName, { value, valid });
|
|
358
379
|
});
|
|
359
380
|
}
|
|
360
381
|
_updateValueState() {
|
|
361
|
-
|
|
382
|
+
// During live typing, validate against displayFormat (what user types), otherwise validate against valueFormat (stored value)
|
|
383
|
+
const isValid = this.isValidValue(this.value);
|
|
362
384
|
if (!isValid) { // If not valid - always set Error regardless of the current value state
|
|
363
385
|
this.valueState = ValueState.Negative;
|
|
364
386
|
}
|
|
@@ -435,20 +457,75 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
435
457
|
get _isPattern() {
|
|
436
458
|
return this._formatPattern !== "medium" && this._formatPattern !== "short" && this._formatPattern !== "long";
|
|
437
459
|
}
|
|
460
|
+
get _isValueFormatPattern() {
|
|
461
|
+
return this._valueFormat !== "medium" && this._valueFormat !== "short" && this._valueFormat !== "long";
|
|
462
|
+
}
|
|
463
|
+
get _isDisplayFormatPattern() {
|
|
464
|
+
return this._displayFormat !== "medium" && this._displayFormat !== "short" && this._displayFormat !== "long";
|
|
465
|
+
}
|
|
466
|
+
get displayValue() {
|
|
467
|
+
if (!this.value) {
|
|
468
|
+
return "";
|
|
469
|
+
}
|
|
470
|
+
if (!this.getValueFormat().parse(this.value, true)) {
|
|
471
|
+
return this.value;
|
|
472
|
+
}
|
|
473
|
+
return this.getDisplayFormat().format(this.getValueFormat().parse(this.value, true), true);
|
|
474
|
+
}
|
|
438
475
|
getFormat() {
|
|
439
476
|
let dateFormat;
|
|
440
477
|
if (this._isPattern) {
|
|
441
478
|
dateFormat = DateFormat.getDateInstance({
|
|
479
|
+
strictParsing: true,
|
|
442
480
|
pattern: this._formatPattern,
|
|
443
481
|
});
|
|
444
482
|
}
|
|
445
483
|
else {
|
|
446
484
|
dateFormat = DateFormat.getDateInstance({
|
|
485
|
+
strictParsing: true,
|
|
447
486
|
style: this._formatPattern,
|
|
448
487
|
});
|
|
449
488
|
}
|
|
450
489
|
return dateFormat;
|
|
451
490
|
}
|
|
491
|
+
getISOFormat() {
|
|
492
|
+
if (!this._isoFormatInstance) {
|
|
493
|
+
this._isoFormatInstance = DateFormat.getTimeInstance({
|
|
494
|
+
strictParsing: true,
|
|
495
|
+
pattern: DEFAULT_ISO_FORMAT,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
return this._isoFormatInstance;
|
|
499
|
+
}
|
|
500
|
+
getDisplayFormat() {
|
|
501
|
+
// If no displayFormat is set, use the deprecated getFormat() for backward compatibility
|
|
502
|
+
if (!this._displayFormat) {
|
|
503
|
+
return this.getFormat();
|
|
504
|
+
}
|
|
505
|
+
return this._isDisplayFormatPattern
|
|
506
|
+
? DateFormat.getDateInstance({
|
|
507
|
+
strictParsing: true,
|
|
508
|
+
pattern: this._displayFormat,
|
|
509
|
+
})
|
|
510
|
+
: DateFormat.getDateInstance({
|
|
511
|
+
strictParsing: true,
|
|
512
|
+
style: this._displayFormat,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
getValueFormat() {
|
|
516
|
+
if (!this._valueFormat) {
|
|
517
|
+
return this.getISOFormat();
|
|
518
|
+
}
|
|
519
|
+
return this._isValueFormatPattern
|
|
520
|
+
? DateFormat.getTimeInstance({
|
|
521
|
+
strictParsing: true,
|
|
522
|
+
pattern: this._valueFormat,
|
|
523
|
+
})
|
|
524
|
+
: DateFormat.getTimeInstance({
|
|
525
|
+
strictParsing: true,
|
|
526
|
+
style: this._valueFormat,
|
|
527
|
+
});
|
|
528
|
+
}
|
|
452
529
|
/**
|
|
453
530
|
* Formats a Java Script date object into a string representing a locale date and time
|
|
454
531
|
* according to the `formatPattern` property of the TimePicker instance
|
|
@@ -457,7 +534,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
457
534
|
* @returns formatted value
|
|
458
535
|
*/
|
|
459
536
|
formatValue(date) {
|
|
460
|
-
return this.
|
|
537
|
+
return this.getValueFormat().format(date);
|
|
461
538
|
}
|
|
462
539
|
/**
|
|
463
540
|
* Checks if a value is valid against the current `formatPattern` value.
|
|
@@ -470,16 +547,67 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
470
547
|
if (value === "") {
|
|
471
548
|
return true;
|
|
472
549
|
}
|
|
473
|
-
return !!this.getFormat().parse(value);
|
|
550
|
+
return !!this.getFormat().parse(value, true);
|
|
551
|
+
}
|
|
552
|
+
isValidDisplayValue(value) {
|
|
553
|
+
if (value === "") {
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
return !!this.getDisplayFormat().parse(value, true);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Checks if a value is valid against the current `valueFormat` value.
|
|
560
|
+
*
|
|
561
|
+
* **Note:** an empty string is considered as valid value.
|
|
562
|
+
* @param value The value to be tested against the value format
|
|
563
|
+
* @public
|
|
564
|
+
*/
|
|
565
|
+
isValidValue(value) {
|
|
566
|
+
if (value === "") {
|
|
567
|
+
return true;
|
|
568
|
+
}
|
|
569
|
+
return !!this.getValueFormat().parse(value, true);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Converts a value from displayFormat to valueFormat
|
|
573
|
+
* @param value Value in displayFormat
|
|
574
|
+
* @returns Value in valueFormat
|
|
575
|
+
* @private
|
|
576
|
+
*/
|
|
577
|
+
getValueFromDisplayValue(value) {
|
|
578
|
+
if (!this.getDisplayFormat().parse(value, true)) {
|
|
579
|
+
return value;
|
|
580
|
+
}
|
|
581
|
+
return this.getValueFormat().format(this.getDisplayFormat().parse(value, true), true);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Converts a value from valueFormat to displayFormat
|
|
585
|
+
* @param value Value in valueFormat
|
|
586
|
+
* @returns Value in displayFormat
|
|
587
|
+
* @private
|
|
588
|
+
*/
|
|
589
|
+
getDisplayValueFromValue(value) {
|
|
590
|
+
if (!this.getValueFormat().parse(value, true)) {
|
|
591
|
+
return value;
|
|
592
|
+
}
|
|
593
|
+
return this.getDisplayFormat().format(this.getValueFormat().parse(value, true), true);
|
|
474
594
|
}
|
|
475
595
|
normalizeValue(value) {
|
|
476
596
|
if (value === "") {
|
|
477
597
|
return value;
|
|
478
598
|
}
|
|
479
|
-
|
|
599
|
+
const parsedFromDisplay = this.getDisplayFormat().parse(value, true);
|
|
600
|
+
if (parsedFromDisplay) {
|
|
601
|
+
return this.getValueFormat().format(parsedFromDisplay, true);
|
|
602
|
+
}
|
|
603
|
+
const parsedFromValue = this.getValueFormat().parse(value, true);
|
|
604
|
+
if (parsedFromValue) {
|
|
605
|
+
return this.getValueFormat().format(parsedFromValue, true);
|
|
606
|
+
}
|
|
607
|
+
return value;
|
|
480
608
|
}
|
|
481
609
|
_modifyValueBy(amount, unit) {
|
|
482
|
-
const date = this.
|
|
610
|
+
const date = this.getValueFormat().parse(this._effectiveValue);
|
|
483
611
|
if (!date) {
|
|
484
612
|
return;
|
|
485
613
|
}
|
|
@@ -590,6 +718,12 @@ __decorate([
|
|
|
590
718
|
__decorate([
|
|
591
719
|
property()
|
|
592
720
|
], TimePicker.prototype, "placeholder", void 0);
|
|
721
|
+
__decorate([
|
|
722
|
+
property()
|
|
723
|
+
], TimePicker.prototype, "displayFormat", void 0);
|
|
724
|
+
__decorate([
|
|
725
|
+
property()
|
|
726
|
+
], TimePicker.prototype, "valueFormat", void 0);
|
|
593
727
|
__decorate([
|
|
594
728
|
property()
|
|
595
729
|
], TimePicker.prototype, "formatPattern", void 0);
|