@progress/kendo-angular-dateinputs 19.0.0-develop.6 → 19.0.0-develop.8

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.
@@ -7,7 +7,7 @@ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
7
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { PopupService } from '@progress/kendo-angular-popup';
9
9
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
10
- import { hasObservers, isControlRequired, isDocumentAvailable, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
10
+ import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
11
11
  import { AdaptiveService } from '@progress/kendo-angular-utils';
12
12
  import { validatePackage } from '@progress/kendo-licensing';
13
13
  import { packageMetadata } from '../package-metadata';
@@ -280,18 +280,13 @@ export class TimePickerComponent extends MultiTabStop {
280
280
  * Sets the title of the input element of the TimePicker and the title text rendered
281
281
  * in the header of the popup(action sheet). Applicable only when [`AdaptiveMode` is set to `auto`](slug:api_dateinputs_adaptivemode).
282
282
  */
283
- title = "";
283
+ adaptiveTitle = '';
284
284
  /**
285
285
  * Sets the subtitle text rendered in the header of the popup(action sheet).
286
286
  * Applicable only when [`AdaptiveMode` is set to `auto`](slug:api_dateinputs_adaptivemode).
287
+ * By default, subtitle is not rendered.
287
288
  */
288
- set subtitle(subtitle) {
289
- this._subtitle = subtitle;
290
- }
291
- get subtitle() {
292
- return this._subtitle || this.placeholder;
293
- }
294
- _subtitle;
289
+ adaptiveSubtitle;
295
290
  /**
296
291
  * Determines whether the built-in min or max validators are enforced when a form is being validated.
297
292
  *
@@ -492,6 +487,10 @@ export class TimePickerComponent extends MultiTabStop {
492
487
  get isControlRequired() {
493
488
  return isControlRequired(this.control);
494
489
  }
490
+ /**
491
+ * @hidden
492
+ */
493
+ windowSize;
495
494
  get adaptiveAcceptButton() {
496
495
  return this.actionSheet.element.nativeElement.querySelector(ACCEPT_BUTTON_SELECTOR);
497
496
  }
@@ -522,7 +521,6 @@ export class TimePickerComponent extends MultiTabStop {
522
521
  _size = DEFAULT_SIZE;
523
522
  _rounded = DEFAULT_ROUNDED;
524
523
  _fillMode = DEFAULT_FILL_MODE;
525
- windowSize;
526
524
  constructor(bus, zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, intl, adaptiveService) {
527
525
  super();
528
526
  this.bus = bus;
@@ -569,11 +567,6 @@ export class TimePickerComponent extends MultiTabStop {
569
567
  ngAfterViewInit() {
570
568
  this.setComponentClasses();
571
569
  this.windowSize = this.adaptiveService.size;
572
- if (this.actionSheet && isDocumentAvailable()) {
573
- // The following syntax is used as it does not violate CSP compliance
574
- this.actionSheet.element.nativeElement.style.setProperty('--kendo-actionsheet-height', '60vh');
575
- this.actionSheet.element.nativeElement.style.setProperty('--kendo-actionsheet-max-height', 'none');
576
- }
577
570
  }
578
571
  /**
579
572
  * @hidden
@@ -920,7 +913,6 @@ export class TimePickerComponent extends MultiTabStop {
920
913
  }
921
914
  if (show && !this.isOpen) {
922
915
  this.actionSheet.toggle();
923
- this.updateActionSheetAdaptiveAppearance();
924
916
  this.renderer.setAttribute(this.actionSheet.element.nativeElement, 'id', this.popupUID);
925
917
  this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaControls, this.popupUID);
926
918
  }
@@ -931,6 +923,7 @@ export class TimePickerComponent extends MultiTabStop {
931
923
  this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaControls);
932
924
  }
933
925
  this.actionSheet.toggle();
926
+ this.dateInput.focus();
934
927
  }
935
928
  this._show = show;
936
929
  }
@@ -965,25 +958,6 @@ export class TimePickerComponent extends MultiTabStop {
965
958
  }
966
959
  }
967
960
  }
968
- updateActionSheetAdaptiveAppearance() {
969
- let element;
970
- let animationContainer;
971
- if (this.actionSheet) {
972
- element = this.actionSheet['element'].nativeElement.querySelector('.k-actionsheet');
973
- animationContainer = this.actionSheet['element'].nativeElement.querySelector('.k-child-animation-container');
974
- if (this.windowSize === 'medium') {
975
- this.renderer.removeClass(element, 'k-actionsheet-fullscreen');
976
- this.renderer.removeStyle(animationContainer, 'height');
977
- }
978
- else if (this.windowSize === 'small') {
979
- this.renderer.addClass(element, 'k-actionsheet-fullscreen');
980
- this.renderer.setStyle(animationContainer, 'height', '100%');
981
- }
982
- this.renderer.addClass(element, 'k-adaptive-actionsheet');
983
- this.renderer.addClass(element, 'k-actionsheet-bottom');
984
- this.renderer.setStyle(animationContainer, 'bottom', '0px');
985
- }
986
- }
987
961
  focusInput() {
988
962
  if (touchEnabled) {
989
963
  return;
@@ -1094,7 +1068,7 @@ export class TimePickerComponent extends MultiTabStop {
1094
1068
  }
1095
1069
  }
1096
1070
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TimePickerComponent, deps: [{ token: i1.BusViewService }, { token: i0.NgZone }, { token: i2.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i4.PickerService }, { token: i5.IntlService }, { token: i6.AdaptiveService }], target: i0.ɵɵFactoryTarget.Component });
1097
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TimePickerComponent, isStandalone: true, selector: "kendo-timepicker", inputs: { focusableId: "focusableId", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", clearButton: "clearButton", format: "format", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", min: "min", max: "max", incompleteDateValidation: "incompleteDateValidation", autoSwitchParts: "autoSwitchParts", autoSwitchKeys: "autoSwitchKeys", enableMouseWheel: "enableMouseWheel", allowCaretMode: "allowCaretMode", cancelButton: "cancelButton", nowButton: "nowButton", steps: "steps", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex", title: "title", subtitle: "subtitle", rangeValidation: "rangeValidation", adaptiveMode: "adaptiveMode", value: "value", size: "size", rounded: "rounded", fillMode: "fillMode", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close", escape: "escape" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-timepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
1071
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TimePickerComponent, isStandalone: true, selector: "kendo-timepicker", inputs: { focusableId: "focusableId", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", clearButton: "clearButton", format: "format", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", min: "min", max: "max", incompleteDateValidation: "incompleteDateValidation", autoSwitchParts: "autoSwitchParts", autoSwitchKeys: "autoSwitchKeys", enableMouseWheel: "enableMouseWheel", allowCaretMode: "allowCaretMode", cancelButton: "cancelButton", nowButton: "nowButton", steps: "steps", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex", adaptiveTitle: "adaptiveTitle", adaptiveSubtitle: "adaptiveSubtitle", rangeValidation: "rangeValidation", adaptiveMode: "adaptiveMode", value: "value", size: "size", rounded: "rounded", fillMode: "fillMode", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close", escape: "escape" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-timepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
1098
1072
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TimePickerComponent), multi: true },
1099
1073
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => TimePickerComponent), multi: true },
1100
1074
  { provide: KendoInput, useExisting: forwardRef(() => TimePickerComponent) },
@@ -1146,6 +1120,9 @@ export class TimePickerComponent extends MultiTabStop {
1146
1120
 
1147
1121
  i18n-clearTitle="kendo.timepicker.clearTitle|The title of the clear button"
1148
1122
  clearTitle="clear"
1123
+
1124
+ i18n-adaptiveCloseButtonTitle="kendo.timepicker.adaptiveCloseButtonTitle|The title of the Close button of the ActionSheet that is rendered instead of the Popup when using small screen devices in adaptive mode"
1125
+ adaptiveCloseButtonTitle="Close"
1149
1126
  >
1150
1127
  </ng-container>
1151
1128
  <kendo-dateinput
@@ -1175,7 +1152,7 @@ export class TimePickerComponent extends MultiTabStop {
1175
1152
  [steps]="steps"
1176
1153
  [tabindex]="!show ? tabindex : -1"
1177
1154
  [isRequired]="isControlRequired"
1178
- [title]="title"
1155
+ [title]="adaptiveTitle"
1179
1156
  [inputAttributes]="inputAttributes"
1180
1157
  [value]="value"
1181
1158
  (valueChange)="handleInputChange($event)"
@@ -1218,20 +1195,28 @@ export class TimePickerComponent extends MultiTabStop {
1218
1195
  (overlayClick)="show=false"
1219
1196
  (collapse)="handleActionSheetCollapse()"
1220
1197
  [titleId]="focusableId"
1198
+ [cssClass]="{
1199
+ 'k-adaptive-actionsheet': true,
1200
+ 'k-actionsheet-fullscreen': windowSize === 'small',
1201
+ 'k-actionsheet-bottom': windowSize === 'medium'
1202
+ }"
1203
+ [cssStyle]="{
1204
+ height: windowSize === 'small' ? '100vh' : '60vh'
1205
+ }"
1221
1206
  >
1222
1207
  <ng-template kendoActionSheetTemplate>
1223
1208
  <div class="k-actionsheet-titlebar">
1224
1209
  <div class="k-actionsheet-titlebar-group">
1225
1210
  <div class="k-actionsheet-title">
1226
- <div *ngIf="title" class="k-text-center">{{ title }}</div>
1227
- <div *ngIf="subtitle" class="k-actionsheet-subtitle k-text-center">{{ subtitle }}</div>
1211
+ <div class="k-text-center" *ngIf="adaptiveTitle">{{ adaptiveTitle }}</div>
1212
+ <div class="k-actionsheet-subtitle k-text-center" *ngIf="adaptiveSubtitle">{{ adaptiveSubtitle }}</div>
1228
1213
  </div>
1229
1214
  <div class="k-actionsheet-actions">
1230
1215
  <button
1231
1216
  kendoButton
1232
1217
  type="button"
1233
1218
  icon="check"
1234
- [attr.title]="localization.get('clearTitle')"
1219
+ [attr.title]="localization.get('adaptiveCloseButtonTitle')"
1235
1220
  [svgIcon]="checkIcon"
1236
1221
  fillMode="flat"
1237
1222
  size="large"
@@ -1312,7 +1297,7 @@ export class TimePickerComponent extends MultiTabStop {
1312
1297
  </kendo-timeselector-messages>
1313
1298
  </kendo-timeselector>
1314
1299
  </ng-template>
1315
- `, isInline: true, dependencies: [{ kind: "directive", type: TimePickerLocalizedMessagesDirective, selector: "[kendoTimePickerLocalizedMessages]" }, { kind: "component", type: DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "clearButton", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "isRequired", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { kind: "component", type: DateInputCustomMessagesComponent, selector: "kendo-dateinput-messages" }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "component", type: ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["actions", "actionsLayout", "overlayClickClose", "title", "subtitle", "items", "cssClass", "cssStyle", "animation", "expanded", "titleId"], outputs: ["expandedChange", "action", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { kind: "directive", type: ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: TimeSelectorComponent, selector: "kendo-timeselector", inputs: ["format", "min", "max", "cancelButton", "setButton", "nowButton", "disabled", "isAdaptiveEnabled", "isDateTimePicker", "steps", "value"], outputs: ["valueChange", "valueReject", "tabOutLastPart", "tabOutFirstPart", "tabOutNow"], exportAs: ["kendo-timeselector"] }, { kind: "component", type: TimeSelectorCustomMessagesComponent, selector: "kendo-timeselector-messages" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1300
+ `, isInline: true, dependencies: [{ kind: "directive", type: TimePickerLocalizedMessagesDirective, selector: "[kendoTimePickerLocalizedMessages]" }, { kind: "component", type: DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "clearButton", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "isRequired", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { kind: "component", type: DateInputCustomMessagesComponent, selector: "kendo-dateinput-messages" }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "component", type: ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["actions", "actionsLayout", "overlayClickClose", "title", "subtitle", "items", "cssClass", "cssStyle", "animation", "expanded", "titleId", "initialFocus"], outputs: ["expandedChange", "action", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { kind: "directive", type: ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: TimeSelectorComponent, selector: "kendo-timeselector", inputs: ["format", "min", "max", "cancelButton", "setButton", "nowButton", "disabled", "isAdaptiveEnabled", "isDateTimePicker", "steps", "value"], outputs: ["valueChange", "valueReject", "tabOutLastPart", "tabOutFirstPart", "tabOutNow"], exportAs: ["kendo-timeselector"] }, { kind: "component", type: TimeSelectorCustomMessagesComponent, selector: "kendo-timeselector-messages" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1316
1301
  }
1317
1302
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TimePickerComponent, decorators: [{
1318
1303
  type: Component,
@@ -1373,6 +1358,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1373
1358
 
1374
1359
  i18n-clearTitle="kendo.timepicker.clearTitle|The title of the clear button"
1375
1360
  clearTitle="clear"
1361
+
1362
+ i18n-adaptiveCloseButtonTitle="kendo.timepicker.adaptiveCloseButtonTitle|The title of the Close button of the ActionSheet that is rendered instead of the Popup when using small screen devices in adaptive mode"
1363
+ adaptiveCloseButtonTitle="Close"
1376
1364
  >
1377
1365
  </ng-container>
1378
1366
  <kendo-dateinput
@@ -1402,7 +1390,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1402
1390
  [steps]="steps"
1403
1391
  [tabindex]="!show ? tabindex : -1"
1404
1392
  [isRequired]="isControlRequired"
1405
- [title]="title"
1393
+ [title]="adaptiveTitle"
1406
1394
  [inputAttributes]="inputAttributes"
1407
1395
  [value]="value"
1408
1396
  (valueChange)="handleInputChange($event)"
@@ -1445,20 +1433,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1445
1433
  (overlayClick)="show=false"
1446
1434
  (collapse)="handleActionSheetCollapse()"
1447
1435
  [titleId]="focusableId"
1436
+ [cssClass]="{
1437
+ 'k-adaptive-actionsheet': true,
1438
+ 'k-actionsheet-fullscreen': windowSize === 'small',
1439
+ 'k-actionsheet-bottom': windowSize === 'medium'
1440
+ }"
1441
+ [cssStyle]="{
1442
+ height: windowSize === 'small' ? '100vh' : '60vh'
1443
+ }"
1448
1444
  >
1449
1445
  <ng-template kendoActionSheetTemplate>
1450
1446
  <div class="k-actionsheet-titlebar">
1451
1447
  <div class="k-actionsheet-titlebar-group">
1452
1448
  <div class="k-actionsheet-title">
1453
- <div *ngIf="title" class="k-text-center">{{ title }}</div>
1454
- <div *ngIf="subtitle" class="k-actionsheet-subtitle k-text-center">{{ subtitle }}</div>
1449
+ <div class="k-text-center" *ngIf="adaptiveTitle">{{ adaptiveTitle }}</div>
1450
+ <div class="k-actionsheet-subtitle k-text-center" *ngIf="adaptiveSubtitle">{{ adaptiveSubtitle }}</div>
1455
1451
  </div>
1456
1452
  <div class="k-actionsheet-actions">
1457
1453
  <button
1458
1454
  kendoButton
1459
1455
  type="button"
1460
1456
  icon="check"
1461
- [attr.title]="localization.get('clearTitle')"
1457
+ [attr.title]="localization.get('adaptiveCloseButtonTitle')"
1462
1458
  [svgIcon]="checkIcon"
1463
1459
  fillMode="flat"
1464
1460
  size="large"
@@ -1600,9 +1596,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1600
1596
  type: Input
1601
1597
  }], tabIndex: [{
1602
1598
  type: Input
1603
- }], title: [{
1599
+ }], adaptiveTitle: [{
1604
1600
  type: Input
1605
- }], subtitle: [{
1601
+ }], adaptiveSubtitle: [{
1606
1602
  type: Input
1607
1603
  }], rangeValidation: [{
1608
1604
  type: Input