@fundamental-ngx/core 0.33.4-rc.6 → 0.33.4

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 (156) hide show
  1. package/README.md +1 -3
  2. package/action-bar/package.json +3 -3
  3. package/action-sheet/package.json +3 -3
  4. package/alert/package.json +3 -3
  5. package/avatar/avatar.component.d.ts +2 -0
  6. package/avatar/esm2020/avatar.component.mjs +8 -5
  7. package/avatar/fesm2015/fundamental-ngx-core-avatar.mjs +7 -4
  8. package/avatar/fesm2015/fundamental-ngx-core-avatar.mjs.map +1 -1
  9. package/avatar/fesm2020/fundamental-ngx-core-avatar.mjs +7 -4
  10. package/avatar/fesm2020/fundamental-ngx-core-avatar.mjs.map +1 -1
  11. package/avatar/package.json +3 -3
  12. package/avatar-group/package.json +3 -3
  13. package/bar/package.json +3 -3
  14. package/breadcrumb/package.json +3 -3
  15. package/busy-indicator/package.json +3 -3
  16. package/button/package.json +3 -3
  17. package/calendar/package.json +3 -3
  18. package/card/package.json +3 -3
  19. package/carousel/package.json +3 -3
  20. package/checkbox/checkbox/checkbox.component.d.ts +30 -35
  21. package/checkbox/esm2020/checkbox/checkbox.component.mjs +61 -80
  22. package/checkbox/fesm2015/fundamental-ngx-core-checkbox.mjs +59 -77
  23. package/checkbox/fesm2015/fundamental-ngx-core-checkbox.mjs.map +1 -1
  24. package/checkbox/fesm2020/fundamental-ngx-core-checkbox.mjs +59 -77
  25. package/checkbox/fesm2020/fundamental-ngx-core-checkbox.mjs.map +1 -1
  26. package/checkbox/package.json +3 -3
  27. package/combobox/package.json +3 -3
  28. package/date-picker/package.json +3 -3
  29. package/datetime/package.json +3 -3
  30. package/datetime-picker/package.json +3 -3
  31. package/dialog/package.json +3 -3
  32. package/dynamic-page/package.json +3 -3
  33. package/dynamic-side-content/package.json +3 -3
  34. package/esm2020/avatar/avatar.component.mjs +8 -5
  35. package/esm2020/checkbox/checkbox/checkbox.component.mjs +61 -80
  36. package/esm2020/input-group/input-group.component.mjs +2 -2
  37. package/esm2020/list/list-item/list-item.component.mjs +6 -2
  38. package/esm2020/multi-input/multi-input.component.mjs +38 -11
  39. package/esm2020/utils/helpers/range-selector.mjs +113 -0
  40. package/esm2020/utils/public_api.mjs +2 -1
  41. package/facets/package.json +3 -3
  42. package/feed-input/package.json +3 -3
  43. package/feed-list-item/package.json +3 -3
  44. package/fesm2015/fundamental-ngx-core-avatar.mjs +7 -4
  45. package/fesm2015/fundamental-ngx-core-avatar.mjs.map +1 -1
  46. package/fesm2015/fundamental-ngx-core-checkbox.mjs +59 -77
  47. package/fesm2015/fundamental-ngx-core-checkbox.mjs.map +1 -1
  48. package/fesm2015/fundamental-ngx-core-input-group.mjs +2 -2
  49. package/fesm2015/fundamental-ngx-core-list.mjs +5 -1
  50. package/fesm2015/fundamental-ngx-core-list.mjs.map +1 -1
  51. package/fesm2015/fundamental-ngx-core-multi-input.mjs +40 -11
  52. package/fesm2015/fundamental-ngx-core-multi-input.mjs.map +1 -1
  53. package/fesm2015/fundamental-ngx-core-utils.mjs +114 -1
  54. package/fesm2015/fundamental-ngx-core-utils.mjs.map +1 -1
  55. package/fesm2020/fundamental-ngx-core-avatar.mjs +7 -4
  56. package/fesm2020/fundamental-ngx-core-avatar.mjs.map +1 -1
  57. package/fesm2020/fundamental-ngx-core-checkbox.mjs +59 -77
  58. package/fesm2020/fundamental-ngx-core-checkbox.mjs.map +1 -1
  59. package/fesm2020/fundamental-ngx-core-input-group.mjs +2 -2
  60. package/fesm2020/fundamental-ngx-core-list.mjs +5 -1
  61. package/fesm2020/fundamental-ngx-core-list.mjs.map +1 -1
  62. package/fesm2020/fundamental-ngx-core-multi-input.mjs +38 -11
  63. package/fesm2020/fundamental-ngx-core-multi-input.mjs.map +1 -1
  64. package/fesm2020/fundamental-ngx-core-utils.mjs +114 -1
  65. package/fesm2020/fundamental-ngx-core-utils.mjs.map +1 -1
  66. package/file-uploader/package.json +3 -3
  67. package/fixed-card-layout/package.json +3 -3
  68. package/flexible-column-layout/package.json +3 -3
  69. package/form/package.json +3 -3
  70. package/formatted-text/package.json +3 -3
  71. package/grid-list/package.json +3 -3
  72. package/icon/package.json +3 -3
  73. package/illustrated-message/package.json +3 -3
  74. package/infinite-scroll/package.json +3 -3
  75. package/info-label/package.json +3 -3
  76. package/inline-help/package.json +3 -3
  77. package/input-group/esm2020/input-group.component.mjs +2 -2
  78. package/input-group/fesm2015/fundamental-ngx-core-input-group.mjs +2 -2
  79. package/input-group/fesm2020/fundamental-ngx-core-input-group.mjs +2 -2
  80. package/input-group/package.json +3 -3
  81. package/layout-grid/package.json +3 -3
  82. package/layout-panel/package.json +3 -3
  83. package/link/package.json +3 -3
  84. package/list/esm2020/list-item/list-item.component.mjs +6 -2
  85. package/list/fesm2015/fundamental-ngx-core-list.mjs +5 -1
  86. package/list/fesm2015/fundamental-ngx-core-list.mjs.map +1 -1
  87. package/list/fesm2020/fundamental-ngx-core-list.mjs +5 -1
  88. package/list/fesm2020/fundamental-ngx-core-list.mjs.map +1 -1
  89. package/list/package.json +3 -3
  90. package/menu/package.json +3 -3
  91. package/message-box/package.json +3 -3
  92. package/message-page/package.json +2 -2
  93. package/message-strip/package.json +3 -3
  94. package/message-toast/package.json +3 -3
  95. package/micro-process-flow/package.json +3 -3
  96. package/mobile-mode/package.json +3 -3
  97. package/multi-input/esm2020/multi-input.component.mjs +38 -11
  98. package/multi-input/fesm2015/fundamental-ngx-core-multi-input.mjs +40 -11
  99. package/multi-input/fesm2015/fundamental-ngx-core-multi-input.mjs.map +1 -1
  100. package/multi-input/fesm2020/fundamental-ngx-core-multi-input.mjs +38 -11
  101. package/multi-input/fesm2020/fundamental-ngx-core-multi-input.mjs.map +1 -1
  102. package/multi-input/multi-input.component.d.ts +8 -1
  103. package/multi-input/package.json +3 -3
  104. package/nested-list/package.json +3 -3
  105. package/notification/package.json +3 -3
  106. package/object-identifier/package.json +3 -3
  107. package/object-marker/package.json +3 -3
  108. package/object-number/package.json +3 -3
  109. package/object-status/package.json +3 -3
  110. package/package.json +7 -7
  111. package/pagination/package.json +3 -3
  112. package/panel/package.json +3 -3
  113. package/popover/package.json +3 -3
  114. package/product-switch/package.json +3 -3
  115. package/progress-indicator/package.json +1 -1
  116. package/quick-view/package.json +3 -3
  117. package/radio/package.json +3 -3
  118. package/rating-indicator/package.json +3 -3
  119. package/resizable-card-layout/package.json +3 -3
  120. package/scroll-spy/package.json +3 -3
  121. package/scrollbar/package.json +3 -3
  122. package/segmented-button/package.json +3 -3
  123. package/select/package.json +3 -3
  124. package/shared/package.json +3 -3
  125. package/shellbar/package.json +3 -3
  126. package/side-navigation/package.json +3 -3
  127. package/slider/package.json +3 -3
  128. package/split-button/package.json +3 -3
  129. package/splitter/package.json +3 -3
  130. package/status-indicator/package.json +3 -3
  131. package/step-input/package.json +3 -3
  132. package/switch/package.json +3 -3
  133. package/table/package.json +3 -3
  134. package/tabs/package.json +3 -3
  135. package/tests/package.json +2 -2
  136. package/text/package.json +3 -3
  137. package/tile/package.json +3 -3
  138. package/time/package.json +3 -3
  139. package/time-picker/package.json +3 -3
  140. package/timeline/package.json +3 -3
  141. package/title/package.json +3 -3
  142. package/token/package.json +3 -3
  143. package/toolbar/package.json +3 -3
  144. package/tree/package.json +3 -3
  145. package/upload-collection/package.json +3 -3
  146. package/utils/esm2020/helpers/range-selector.mjs +113 -0
  147. package/utils/esm2020/public_api.mjs +2 -1
  148. package/utils/fesm2015/fundamental-ngx-core-utils.mjs +114 -1
  149. package/utils/fesm2015/fundamental-ngx-core-utils.mjs.map +1 -1
  150. package/utils/fesm2020/fundamental-ngx-core-utils.mjs +114 -1
  151. package/utils/fesm2020/fundamental-ngx-core-utils.mjs.map +1 -1
  152. package/utils/helpers/range-selector.d.ts +84 -0
  153. package/utils/package.json +6 -6
  154. package/utils/public_api.d.ts +1 -0
  155. package/vertical-navigation/package.json +3 -3
  156. package/wizard/package.json +3 -3
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Utility type, that allows to track and select ranges of elements while using multi-selection.
3
+ *
4
+ * @usage
5
+ * Imagine we have a simple list of checkboxes:
6
+ * ```html
7
+ * <input
8
+ * #checkboxInput
9
+ * *ngFor="let o of options; let idx = index"
10
+ * type="checkbox"
11
+ * [checked]="selectionModel.checked(o)"
12
+ * (click)="toggle(idx, $event)"
13
+ * >
14
+ * ```
15
+ * With the given layout the logic should be as follows:
16
+ * ```typescript
17
+ * export class YourComponent {
18
+ * options = ['a', 'b', 'c'];
19
+ * readonly selectionModel = new SelectionModel(true);
20
+ *
21
+ * private readonly _rangeSelector = new RangeSelector();
22
+ *
23
+ *
24
+ * toggle(idx: number, event: PointerEvent): void {
25
+ * // getting the toggled value of the checkbox
26
+ * const toggledSelection = event.target.value;
27
+ *
28
+ * // registering the selection of current checkbox
29
+ * this._rangeSelector.onRangeElementToggled(idx, event);
30
+ *
31
+ * // Apply value to each element in range.
32
+ * // If checkbox was toggled without shift pressed or without previously selected one,
33
+ * // this method will select only it.
34
+ * this._rangeSelector.applyValueToEachInRange(idx => {
35
+ * if (toggledSelection) {
36
+ * this.selectionModel.select(options[idx]);
37
+ * } else {
38
+ * this.selectionModel.deselect(options[idx]);
39
+ * }
40
+ * });
41
+ * }
42
+ * }
43
+ * ```
44
+ */
45
+ export declare class RangeSelector {
46
+ /** @hidden */
47
+ private _previousSelectedIndex;
48
+ /** @hidden */
49
+ private _state;
50
+ /**
51
+ * Last registered selection state (either multiple or single).
52
+ * Is updated on each `onRangeElementClicked` invokation. Will be `null` initially or once `reset()` is called.
53
+ */
54
+ get lastRangeSelectionState(): RangeSelectionState | null;
55
+ /**
56
+ * The method that should be used to register each checkbox toggle.
57
+ * Accepts two arguments: `index` and `event`. If none provided, will reset existing state.
58
+ * Otherwise will register current index as last checked.
59
+ *
60
+ * If toggling was done with "shift" pressed and there's a previously registered index, will register a range selection.
61
+ * At the same time if checkbox was toggled without shift pressed or without previously selected one, this method will select only it.
62
+ *
63
+ * After calling this method it's recommended to use `applyValueToEachInRange` to actually toggle each checkbox in range.
64
+ *
65
+ * See usage example on this class itself.
66
+ */
67
+ onRangeElementToggled(index?: number, event?: KeyboardEvent | MouseEvent | TouchEvent): RangeSelectionState;
68
+ /**
69
+ * Allows to apply selection to each item in selection range.
70
+ * Accepts a function to apply selection to each item by registered index.
71
+ *
72
+ * See usage example on this class itself.
73
+ */
74
+ applyValueToEachInRange(selectionMethod: (index: number) => void): void;
75
+ /** Resets selection state. Useful when the list of selectable items is changed (e.g. by filtering, sorting, page change) */
76
+ reset(): void;
77
+ /** @hidden */
78
+ private _isNonNegativeInteger;
79
+ }
80
+ export interface RangeSelectionState {
81
+ isRangeSelection: boolean;
82
+ from: number;
83
+ to: number;
84
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@fundamental-ngx/core/utils",
3
- "version": "0.33.4-rc.6",
3
+ "version": "0.33.4",
4
4
  "peerDependencies": {
5
- "@angular/common": "^13,.0.0",
6
- "@angular/core": "^13,.0.0",
7
- "@angular/forms": "^13,.0.0",
8
- "@angular/animations": "^13,.0.0",
9
- "@angular/router": "^13,.0.0",
5
+ "@angular/common": "^13.0.0",
6
+ "@angular/core": "^13.0.0",
7
+ "@angular/forms": "^13.0.0",
8
+ "@angular/animations": "^13.0.0",
9
+ "@angular/router": "^13.0.0",
10
10
  "rxjs": "7.5.2"
11
11
  },
12
12
  "dependencies": {
@@ -42,6 +42,7 @@ export * from './dynamic-component/dynamic-component-config';
42
42
  export * from './dynamic-component/dynamic-component-injector';
43
43
  export * from './dynamic-component/dynamic-component.service';
44
44
  export * from './dynamic-component/dynamic-component-container';
45
+ export * from './helpers/range-selector';
45
46
  export * from './utils.module';
46
47
  export * from './datatypes/hash.datatype';
47
48
  export * from './datatypes/size.datatype';
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@fundamental-ngx/core/vertical-navigation",
3
- "version": "0.33.4-rc.6",
3
+ "version": "0.33.4",
4
4
  "peerDependencies": {
5
- "@angular/common": "^13,.0.0",
6
- "@angular/core": "^13,.0.0"
5
+ "@angular/common": "^13.0.0",
6
+ "@angular/core": "^13.0.0"
7
7
  },
8
8
  "dependencies": {
9
9
  "tslib": "^2.0.0"
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@fundamental-ngx/core/wizard",
3
- "version": "0.33.4-rc.6",
3
+ "version": "0.33.4",
4
4
  "peerDependencies": {
5
- "@angular/common": "^13,.0.0",
6
- "@angular/core": "^13,.0.0"
5
+ "@angular/common": "^13.0.0",
6
+ "@angular/core": "^13.0.0"
7
7
  },
8
8
  "dependencies": {
9
9
  "tslib": "^2.0.0"