@progress/kendo-angular-buttons 6.4.0 → 7.0.0-dev.202201101733

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.
Files changed (82) hide show
  1. package/dist/cdn/js/kendo-angular-buttons.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/button/button.directive.js +239 -89
  4. package/dist/es/button/button.service.js +1 -5
  5. package/dist/es/buttongroup/buttongroup.component.js +1 -53
  6. package/dist/es/chip/chip-list.component.js +54 -7
  7. package/dist/es/chip/chip.component.js +175 -86
  8. package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
  9. package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
  10. package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
  11. package/dist/es/{button-look.js → common/models.js} +0 -0
  12. package/dist/es/dropdownbutton/dropdownbutton.component.js +74 -33
  13. package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
  14. package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
  15. package/dist/es/focusable/focusable.directive.js +4 -4
  16. package/dist/es/listbutton/list-button.js +1 -1
  17. package/dist/es/listbutton/list.component.js +20 -1
  18. package/dist/es/package-metadata.js +1 -1
  19. package/dist/es/splitbutton/splitbutton.component.js +91 -33
  20. package/dist/es/util.js +52 -0
  21. package/dist/es2015/button/button.directive.d.ts +85 -22
  22. package/dist/es2015/button/button.directive.js +222 -85
  23. package/dist/es2015/button/button.service.d.ts +1 -4
  24. package/dist/es2015/button/button.service.js +1 -5
  25. package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
  26. package/dist/es2015/buttongroup/buttongroup.component.js +1 -41
  27. package/dist/es2015/chip/chip-list.component.d.ts +19 -3
  28. package/dist/es2015/chip/chip-list.component.js +49 -7
  29. package/dist/es2015/chip/chip.component.d.ts +67 -32
  30. package/dist/es2015/chip/chip.component.js +186 -97
  31. package/dist/es2015/common/models/fillmode.d.ts +12 -0
  32. package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
  33. package/dist/es2015/common/models/rounded.d.ts +12 -0
  34. package/dist/es2015/common/models/rounded.js +4 -0
  35. package/dist/es2015/common/models/shape.d.ts +2 -9
  36. package/dist/es2015/common/models/size.d.ts +9 -6
  37. package/dist/es2015/common/models/styling-classes.d.ts +11 -0
  38. package/dist/es2015/common/models/styling-classes.js +4 -0
  39. package/dist/es2015/common/models/theme-color.d.ts +15 -4
  40. package/dist/es2015/common/models.d.ts +10 -0
  41. package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
  42. package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +58 -7
  43. package/dist/es2015/dropdownbutton/dropdownbutton.component.js +81 -28
  44. package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
  45. package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
  46. package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
  47. package/dist/es2015/focusable/focusable.directive.js +4 -4
  48. package/dist/es2015/index.metadata.json +1 -1
  49. package/dist/es2015/listbutton/list-button.js +1 -1
  50. package/dist/es2015/listbutton/list.component.d.ts +3 -0
  51. package/dist/es2015/listbutton/list.component.js +37 -20
  52. package/dist/es2015/main.d.ts +4 -4
  53. package/dist/es2015/package-metadata.js +1 -1
  54. package/dist/es2015/splitbutton/splitbutton.component.d.ts +53 -7
  55. package/dist/es2015/splitbutton/splitbutton.component.js +101 -29
  56. package/dist/es2015/util.d.ts +21 -0
  57. package/dist/es2015/util.js +52 -0
  58. package/dist/fesm2015/index.js +832 -395
  59. package/dist/fesm5/index.js +817 -393
  60. package/dist/npm/button/button.directive.js +239 -89
  61. package/dist/npm/button/button.service.js +0 -4
  62. package/dist/npm/buttongroup/buttongroup.component.js +1 -53
  63. package/dist/npm/chip/chip-list.component.js +52 -5
  64. package/dist/npm/chip/chip.component.js +173 -84
  65. package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
  66. package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
  67. package/dist/npm/common/models/styling-classes.js +6 -0
  68. package/dist/npm/{button-look.js → common/models.js} +0 -0
  69. package/dist/npm/dropdownbutton/dropdownbutton.component.js +74 -33
  70. package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
  71. package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
  72. package/dist/npm/focusable/focusable.directive.js +4 -4
  73. package/dist/npm/listbutton/list-button.js +1 -1
  74. package/dist/npm/listbutton/list.component.js +20 -1
  75. package/dist/npm/package-metadata.js +1 -1
  76. package/dist/npm/splitbutton/splitbutton.component.js +89 -31
  77. package/dist/npm/util.js +52 -0
  78. package/dist/systemjs/kendo-angular-buttons.js +1 -1
  79. package/package.json +18 -15
  80. package/dist/es2015/button-look.d.ts +0 -21
  81. package/dist/es2015/chip/models/chip-look.d.ts +0 -20
  82. package/dist/es2015/chip/models/type.d.ts +0 -21
@@ -2,14 +2,16 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { QueryList, EventEmitter, OnDestroy, OnInit, Renderer2, AfterContentInit } from '@angular/core';
5
+ import { QueryList, EventEmitter, OnDestroy, OnInit, Renderer2, AfterContentInit, AfterViewInit, ElementRef } from '@angular/core';
6
6
  import { LocalizationService } from '@progress/kendo-angular-l10n';
7
7
  import { ChipComponent } from './chip.component';
8
8
  import { ChipListSelection } from './models/selection';
9
9
  import { ChipListRemoveEvent } from './chip-list-remove-event-args.interface';
10
- export declare class ChipListComponent implements OnInit, AfterContentInit, OnDestroy {
10
+ import { ChipListSize } from '../common/models';
11
+ export declare class ChipListComponent implements OnInit, AfterViewInit, AfterContentInit, OnDestroy {
11
12
  private localizationService;
12
13
  private renderer;
14
+ private element;
13
15
  hostClass: boolean;
14
16
  /**
15
17
  * @hidden
@@ -24,6 +26,17 @@ export declare class ChipListComponent implements OnInit, AfterContentInit, OnDe
24
26
  * * `multiple`
25
27
  */
26
28
  selection: ChipListSelection;
29
+ /**
30
+ * The size property specifies the gap between the Chips in the ChipList
31
+ * ([see example]({% slug appearance_chiplist %}#toc-size)).
32
+ *
33
+ * The possible values are:
34
+ * * `'small'`
35
+ * * `'medium'` (default)
36
+ * * `'large'`
37
+ * * `null`
38
+ */
39
+ size: ChipListSize;
27
40
  /**
28
41
  * Fires each time when the ChipList selection is changed.
29
42
  */
@@ -37,12 +50,14 @@ export declare class ChipListComponent implements OnInit, AfterContentInit, OnDe
37
50
  readonly multiple: boolean;
38
51
  role: string;
39
52
  private dynamicRTLSubscription;
53
+ private _size;
40
54
  /**
41
55
  * @hidden
42
56
  */
43
57
  onClick($event: any): void;
44
- constructor(localizationService: LocalizationService, renderer: Renderer2);
58
+ constructor(localizationService: LocalizationService, renderer: Renderer2, element: ElementRef);
45
59
  ngOnInit(): void;
60
+ ngAfterViewInit(): void;
46
61
  ngAfterContentInit(): void;
47
62
  ngOnDestroy(): void;
48
63
  private selectedChips;
@@ -51,4 +66,5 @@ export declare class ChipListComponent implements OnInit, AfterContentInit, OnDe
51
66
  */
52
67
  private setSelection;
53
68
  private clearSelection;
69
+ private handleClasses;
54
70
  }
@@ -3,14 +3,15 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- import { Component, Input, HostBinding, ContentChildren, QueryList, EventEmitter, Output, HostListener, Renderer2 } from '@angular/core';
6
+ import { Component, Input, HostBinding, ContentChildren, QueryList, EventEmitter, Output, HostListener, Renderer2, ElementRef } from '@angular/core';
7
7
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
8
8
  import { ChipComponent } from './chip.component';
9
- import { closest } from '../util';
9
+ import { closest, getStylingClasses } from '../util';
10
10
  let ChipListComponent = class ChipListComponent {
11
- constructor(localizationService, renderer) {
11
+ constructor(localizationService, renderer, element) {
12
12
  this.localizationService = localizationService;
13
13
  this.renderer = renderer;
14
+ this.element = element;
14
15
  this.hostClass = true;
15
16
  /**
16
17
  * Sets the selection mode of the ChipList.
@@ -30,8 +31,26 @@ let ChipListComponent = class ChipListComponent {
30
31
  */
31
32
  this.remove = new EventEmitter();
32
33
  this.role = 'listbox';
34
+ this._size = 'medium';
33
35
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
34
36
  }
37
+ /**
38
+ * The size property specifies the gap between the Chips in the ChipList
39
+ * ([see example]({% slug appearance_chiplist %}#toc-size)).
40
+ *
41
+ * The possible values are:
42
+ * * `'small'`
43
+ * * `'medium'` (default)
44
+ * * `'large'`
45
+ * * `null`
46
+ */
47
+ set size(size) {
48
+ this.handleClasses(size, 'size');
49
+ this._size = size;
50
+ }
51
+ get size() {
52
+ return this._size;
53
+ }
35
54
  get single() {
36
55
  return this.selection === 'single';
37
56
  }
@@ -43,7 +62,7 @@ let ChipListComponent = class ChipListComponent {
43
62
  */
44
63
  onClick($event) {
45
64
  const target = $event.target;
46
- const isRemoveClicked = closest(target, '.k-remove-icon');
65
+ const isRemoveClicked = closest(target, '.k-chip-remove-action');
47
66
  const clickedChip = closest(target, '.k-chip');
48
67
  const chip = this.chips.find((chip) => clickedChip === chip.element.nativeElement);
49
68
  if (isRemoveClicked && clickedChip) {
@@ -58,6 +77,12 @@ let ChipListComponent = class ChipListComponent {
58
77
  this.dynamicRTLSubscription = this.localizationService.changes
59
78
  .subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
60
79
  }
80
+ ngAfterViewInit() {
81
+ const stylingInputs = ['size'];
82
+ stylingInputs.forEach(input => {
83
+ this.handleClasses(this[input], input);
84
+ });
85
+ }
61
86
  ngAfterContentInit() {
62
87
  this.chips.forEach((chip) => {
63
88
  this.renderer.setAttribute(chip.element.nativeElement, 'role', 'option');
@@ -88,6 +113,16 @@ let ChipListComponent = class ChipListComponent {
88
113
  }
89
114
  });
90
115
  }
116
+ handleClasses(value, input) {
117
+ const elem = this.element.nativeElement;
118
+ const classes = getStylingClasses('chip-list', input, this[input], value);
119
+ if (classes.toRemove) {
120
+ this.renderer.removeClass(elem, classes.toRemove);
121
+ }
122
+ if (classes.toAdd) {
123
+ this.renderer.addClass(elem, classes.toAdd);
124
+ }
125
+ }
91
126
  };
92
127
  tslib_1.__decorate([
93
128
  HostBinding('class.k-chip-list'),
@@ -101,6 +136,11 @@ tslib_1.__decorate([
101
136
  Input(),
102
137
  tslib_1.__metadata("design:type", String)
103
138
  ], ChipListComponent.prototype, "selection", void 0);
139
+ tslib_1.__decorate([
140
+ Input(),
141
+ tslib_1.__metadata("design:type", String),
142
+ tslib_1.__metadata("design:paramtypes", [String])
143
+ ], ChipListComponent.prototype, "size", null);
104
144
  tslib_1.__decorate([
105
145
  Output(),
106
146
  tslib_1.__metadata("design:type", EventEmitter)
@@ -135,7 +175,7 @@ tslib_1.__decorate([
135
175
  ], ChipListComponent.prototype, "onClick", null);
136
176
  ChipListComponent = tslib_1.__decorate([
137
177
  Component({
138
- selector: 'kendo-chip-list, kendo-chiplist',
178
+ selector: 'kendo-chiplist, kendo-chip-list',
139
179
  template: `
140
180
  <ng-content></ng-content>
141
181
  `,
@@ -143,10 +183,12 @@ ChipListComponent = tslib_1.__decorate([
143
183
  LocalizationService,
144
184
  {
145
185
  provide: L10N_PREFIX,
146
- useValue: 'kendo.chip-list'
186
+ useValue: 'kendo.chiplist'
147
187
  }
148
188
  ]
149
189
  }),
150
- tslib_1.__metadata("design:paramtypes", [LocalizationService, Renderer2])
190
+ tslib_1.__metadata("design:paramtypes", [LocalizationService,
191
+ Renderer2,
192
+ ElementRef])
151
193
  ], ChipListComponent);
152
194
  export { ChipListComponent };
@@ -5,9 +5,8 @@
5
5
  import { EventEmitter, ElementRef, Renderer2, AfterViewInit, OnInit, NgZone } from '@angular/core';
6
6
  import { LocalizationService } from '@progress/kendo-angular-l10n';
7
7
  import { ChipRemoveEvent } from './chip-remove-event-args.interface';
8
- import { ChipLook } from './models/chip-look';
9
- import { ChipType } from './models/type';
10
8
  import { ChipContentClickEvent } from './chip-content-click-event-args.interface';
9
+ import { ChipFillMode, ChipRounded, ChipSize, ChipThemeColor } from '../common/models';
11
10
  /**
12
11
  * Displays a Chip that represents an input, attribute or an action.
13
12
  */
@@ -16,16 +15,6 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
16
15
  private renderer;
17
16
  private ngZone;
18
17
  private localizationService;
19
- /**
20
- * Changes the visual appearance by using alternative styling options.
21
- *
22
- * The available values are:
23
- * * `solid`
24
- * * `outline`
25
- * * `filled` (The `filled` option will be deprecated. To apply identical styling, use `solid` instead).
26
- * * `outlined` (The `outlined` option will be deprecated. To apply identical styling, use `outline` instead).
27
- */
28
- look: ChipLook;
29
18
  /**
30
19
  * Sets the label text of the Chip.
31
20
  */
@@ -42,17 +31,18 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
42
31
  */
43
32
  iconClass: string;
44
33
  /**
45
- * Specifies the selected state of the Chip.
34
+ * The avatarClass allows the usage of avatar icons rendered in the Chip.
46
35
  */
47
- selected: boolean;
36
+ avatarClass: string;
48
37
  /**
49
- * Specifies a custom select icon that will be rendered when the Chip is selected.
50
- * [see example]({% slug icons %})
38
+ * Specifies the selected state of the Chip.
39
+ * @default false
51
40
  */
52
- selectedIcon: string;
41
+ selected: boolean;
53
42
  /**
54
43
  * Specifies if the Chip will be removable or not.
55
44
  * If the property is set to `true`, the Chip renders a remove icon.
45
+ * @default false
56
46
  */
57
47
  removable: boolean;
58
48
  /**
@@ -61,20 +51,57 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
61
51
  */
62
52
  removeIcon: string;
63
53
  /**
64
- * Specifies the Chip type.
54
+ * If set to `true`, the Chip will be disabled.
55
+ * @default false
56
+ */
57
+ disabled: boolean;
58
+ /**
59
+ * The size property specifies the height, padding and line height of the Chip
60
+ * ([see example]({% slug appearance_chip %}#toc-size)).
65
61
  *
66
62
  * The possible values are:
67
- * - `none` (default)
68
- * - `success`
69
- * - `error`
70
- * - `warning`
71
- * - `info`
63
+ * * `'small'`
64
+ * * `'medium'` (default)
65
+ * * `'large'`
66
+ * * `null`
72
67
  */
73
- type: ChipType;
68
+ size: ChipSize;
74
69
  /**
75
- * If set to `true`, the Chip will be disabled.
70
+ * The rounded property specifies the border radius of the Chip
71
+ * ([see example]({% slug appearance_chip %}#toc-rounded)).
72
+ *
73
+ * The possible values are:
74
+ * * `'small'`
75
+ * * `'medium'` (default)
76
+ * * `'large'`
77
+ * * `'full'`
78
+ * * `null`
76
79
  */
77
- disabled: boolean;
80
+ rounded: ChipRounded;
81
+ /**
82
+ * The fillMode property specifies the background and border styles of the Chip
83
+ * ([see example]({% slug appearance_chip %}#toc-fillMode)).
84
+ *
85
+ * The possible values are:
86
+ * * `'solid'` (default)
87
+ * * `'outline'`
88
+ * * `null`
89
+ */
90
+ fillMode: ChipFillMode;
91
+ /**
92
+ * The Chip allows you to specify predefined theme colors.
93
+ * The theme color will be applied as a background and border color while also amending the text color accordingly
94
+ * ([see example]({% slug appearance_chip %}#toc-themeColor)).
95
+ *
96
+ * The possible values are:
97
+ * * `'base'` (default)
98
+ * * `'info'`
99
+ * * `'success'`
100
+ * * `'warning'`
101
+ * * `'error'`
102
+ * * `null`
103
+ */
104
+ themeColor: ChipThemeColor;
78
105
  /**
79
106
  * Fires each time the user clicks the remove icon of the Chip.
80
107
  */
@@ -86,8 +113,6 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
86
113
  tabIndex: number;
87
114
  readonly ariaChecked: boolean;
88
115
  hostClass: boolean;
89
- readonly outlineClass: boolean;
90
- readonly solidClass: boolean;
91
116
  readonly hasIconClass: boolean;
92
117
  readonly disabledClass: boolean;
93
118
  readonly selectedClass: boolean;
@@ -96,6 +121,10 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
96
121
  * @hidden
97
122
  */
98
123
  direction: string;
124
+ private _size;
125
+ private _rounded;
126
+ private _fillMode;
127
+ private _themeColor;
99
128
  private focused;
100
129
  private dynamicRTLSubscription;
101
130
  private detachDomEvents;
@@ -106,19 +135,19 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
106
135
  /**
107
136
  * @hidden
108
137
  */
109
- readonly iconClasses: string[];
138
+ readonly kendoIconClass: string;
110
139
  /**
111
140
  * @hidden
112
141
  */
113
- readonly selectedIconClasses: string;
142
+ readonly customIconClass: string;
114
143
  /**
115
144
  * @hidden
116
145
  */
117
- readonly removeIconClasses: string;
146
+ readonly chipAvatarClass: string;
118
147
  /**
119
148
  * @hidden
120
149
  */
121
- typeClass(): string;
150
+ readonly removeIconClass: string;
122
151
  /**
123
152
  * Focuses the Chip component.
124
153
  */
@@ -132,4 +161,10 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
132
161
  */
133
162
  onRemoveClick(e: any): void;
134
163
  private attachElementEventHandlers;
164
+ /**
165
+ * @hidden
166
+ */
167
+ private verifyIconSettings;
168
+ private handleClasses;
169
+ private handleThemeColor;
135
170
  }