@skyux/list-builder-view-checklist 5.7.2 → 6.0.0-beta.2

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 (61) hide show
  1. package/esm2020/index.mjs +15 -0
  2. package/esm2020/lib/modules/list-view-checklist/list-view-checklist-item.component.mjs +14 -0
  3. package/esm2020/lib/modules/list-view-checklist/list-view-checklist.component.mjs +287 -0
  4. package/esm2020/lib/modules/list-view-checklist/list-view-checklist.module.mjs +25 -0
  5. package/esm2020/lib/modules/list-view-checklist/state/checklist-state-action.type.mjs +2 -0
  6. package/esm2020/lib/modules/list-view-checklist/state/checklist-state.model.mjs +7 -0
  7. package/esm2020/lib/modules/list-view-checklist/state/checklist-state.rxstate.mjs +13 -0
  8. package/esm2020/lib/modules/list-view-checklist/state/checklist-state.state-node.mjs +20 -0
  9. package/esm2020/lib/modules/list-view-checklist/state/items/item.model.mjs +10 -0
  10. package/esm2020/lib/modules/list-view-checklist/state/items/items.orchestrator.mjs +19 -0
  11. package/esm2020/lib/modules/list-view-checklist/state/items/load.action.mjs +9 -0
  12. package/esm2020/skyux-list-builder-view-checklist.mjs +5 -0
  13. package/esm2020/testing/list-view-checklist-fixture.mjs +83 -0
  14. package/esm2020/testing/list-view-checklist-item.mjs +2 -0
  15. package/esm2020/testing/public-api.mjs +3 -0
  16. package/esm2020/testing/skyux-list-builder-view-checklist-testing.mjs +5 -0
  17. package/fesm2015/{skyux-list-builder-view-checklist-testing.js → skyux-list-builder-view-checklist-testing.mjs} +1 -1
  18. package/fesm2015/skyux-list-builder-view-checklist-testing.mjs.map +1 -0
  19. package/fesm2015/{skyux-list-builder-view-checklist.js → skyux-list-builder-view-checklist.mjs} +30 -41
  20. package/fesm2015/skyux-list-builder-view-checklist.mjs.map +1 -0
  21. package/{esm2015/testing/list-view-checklist-fixture.js → fesm2020/skyux-list-builder-view-checklist-testing.mjs} +9 -2
  22. package/fesm2020/skyux-list-builder-view-checklist-testing.mjs.map +1 -0
  23. package/fesm2020/skyux-list-builder-view-checklist.mjs +380 -0
  24. package/fesm2020/skyux-list-builder-view-checklist.mjs.map +1 -0
  25. package/package.json +39 -15
  26. package/testing/package.json +5 -5
  27. package/bundles/skyux-list-builder-view-checklist-testing.umd.js +0 -98
  28. package/bundles/skyux-list-builder-view-checklist.umd.js +0 -792
  29. package/esm2015/index.js +0 -15
  30. package/esm2015/index.js.map +0 -1
  31. package/esm2015/lib/modules/list-view-checklist/list-view-checklist-item.component.js +0 -19
  32. package/esm2015/lib/modules/list-view-checklist/list-view-checklist-item.component.js.map +0 -1
  33. package/esm2015/lib/modules/list-view-checklist/list-view-checklist.component.js +0 -293
  34. package/esm2015/lib/modules/list-view-checklist/list-view-checklist.component.js.map +0 -1
  35. package/esm2015/lib/modules/list-view-checklist/list-view-checklist.module.js +0 -25
  36. package/esm2015/lib/modules/list-view-checklist/list-view-checklist.module.js.map +0 -1
  37. package/esm2015/lib/modules/list-view-checklist/state/checklist-state-action.type.js +0 -2
  38. package/esm2015/lib/modules/list-view-checklist/state/checklist-state-action.type.js.map +0 -1
  39. package/esm2015/lib/modules/list-view-checklist/state/checklist-state.model.js +0 -7
  40. package/esm2015/lib/modules/list-view-checklist/state/checklist-state.model.js.map +0 -1
  41. package/esm2015/lib/modules/list-view-checklist/state/checklist-state.rxstate.js +0 -13
  42. package/esm2015/lib/modules/list-view-checklist/state/checklist-state.rxstate.js.map +0 -1
  43. package/esm2015/lib/modules/list-view-checklist/state/checklist-state.state-node.js +0 -20
  44. package/esm2015/lib/modules/list-view-checklist/state/checklist-state.state-node.js.map +0 -1
  45. package/esm2015/lib/modules/list-view-checklist/state/items/item.model.js +0 -10
  46. package/esm2015/lib/modules/list-view-checklist/state/items/item.model.js.map +0 -1
  47. package/esm2015/lib/modules/list-view-checklist/state/items/items.orchestrator.js +0 -19
  48. package/esm2015/lib/modules/list-view-checklist/state/items/items.orchestrator.js.map +0 -1
  49. package/esm2015/lib/modules/list-view-checklist/state/items/load.action.js +0 -9
  50. package/esm2015/lib/modules/list-view-checklist/state/items/load.action.js.map +0 -1
  51. package/esm2015/skyux-list-builder-view-checklist.js +0 -5
  52. package/esm2015/skyux-list-builder-view-checklist.js.map +0 -1
  53. package/esm2015/testing/list-view-checklist-fixture.js.map +0 -1
  54. package/esm2015/testing/list-view-checklist-item.js +0 -2
  55. package/esm2015/testing/list-view-checklist-item.js.map +0 -1
  56. package/esm2015/testing/public-api.js +0 -3
  57. package/esm2015/testing/public-api.js.map +0 -1
  58. package/esm2015/testing/skyux-list-builder-view-checklist-testing.js +0 -5
  59. package/esm2015/testing/skyux-list-builder-view-checklist-testing.js.map +0 -1
  60. package/fesm2015/skyux-list-builder-view-checklist-testing.js.map +0 -1
  61. package/fesm2015/skyux-list-builder-view-checklist.js.map +0 -1
package/esm2015/index.js DELETED
@@ -1,15 +0,0 @@
1
- export * from './lib/modules/list-view-checklist/list-view-checklist.module';
2
- export * from './lib/modules/list-view-checklist/state/checklist-state-action.type';
3
- export * from './lib/modules/list-view-checklist/state/checklist-state.model';
4
- export * from './lib/modules/list-view-checklist/state/checklist-state.rxstate';
5
- export * from './lib/modules/list-view-checklist/state/checklist-state.state-node';
6
- export * from './lib/modules/list-view-checklist/state/items/item.model';
7
- export * from './lib/modules/list-view-checklist/state/items/items.orchestrator';
8
- export * from './lib/modules/list-view-checklist/state/items/load.action';
9
- // The following export is used internally by `@skyux/select-field`.
10
- // TODO: Find a way to remove this in the next major version release.
11
- export * from './lib/modules/list-view-checklist/list-view-checklist.component';
12
- // Components and directives must be exported to support Angular’s “partial” Ivy compiler.
13
- // Obscure names are used to indicate types are not part of the public API.
14
- export { SkyListViewChecklistItemComponent as λ1 } from './lib/modules/list-view-checklist/list-view-checklist-item.component';
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/list-builder-view-checklist/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qEAAqE,CAAC;AACpF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,iEAAiE,CAAC;AAChF,cAAc,oEAAoE,CAAC;AACnF,cAAc,0DAA0D,CAAC;AACzE,cAAc,kEAAkE,CAAC;AACjF,cAAc,2DAA2D,CAAC;AAE1E,oEAAoE;AACpE,qEAAqE;AACrE,cAAc,iEAAiE,CAAC;AAEhF,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,iCAAiC,IAAI,EAAE,EAAE,MAAM,sEAAsE,CAAC","sourcesContent":["export * from './lib/modules/list-view-checklist/list-view-checklist.module';\nexport * from './lib/modules/list-view-checklist/state/checklist-state-action.type';\nexport * from './lib/modules/list-view-checklist/state/checklist-state.model';\nexport * from './lib/modules/list-view-checklist/state/checklist-state.rxstate';\nexport * from './lib/modules/list-view-checklist/state/checklist-state.state-node';\nexport * from './lib/modules/list-view-checklist/state/items/item.model';\nexport * from './lib/modules/list-view-checklist/state/items/items.orchestrator';\nexport * from './lib/modules/list-view-checklist/state/items/load.action';\n\n// The following export is used internally by `@skyux/select-field`.\n// TODO: Find a way to remove this in the next major version release.\nexport * from './lib/modules/list-view-checklist/list-view-checklist.component';\n\n// Components and directives must be exported to support Angular’s “partial” Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyListViewChecklistItemComponent as λ1 } from './lib/modules/list-view-checklist/list-view-checklist-item.component';\n"]}
@@ -1,19 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2
- import { ListViewChecklistItemModel } from './state/items/item.model';
3
- import * as i0 from "@angular/core";
4
- export class SkyListViewChecklistItemComponent {
5
- }
6
- SkyListViewChecklistItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
- SkyListViewChecklistItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyListViewChecklistItemComponent, selector: "sky-list-view-checklist-item", inputs: { item: "item" }, ngImport: i0, template: "<div class=\"sky-list-view-checklist-item\">\n <ng-content></ng-content>\n</div>\n", styles: [".sky-list-view-checklist-item{display:block;width:100%;cursor:pointer;word-wrap:break-word}.sky-list-view-checklist-item:last-child{border-bottom-width:0}.sky-list-view-checklist-item ::ng-deep sky-checkbox{display:block;position:relative;width:100%;padding:10px;cursor:pointer;border-bottom:1px dotted #cdcfd2}.sky-list-view-checklist-item ::ng-deep sky-checkbox-label div{overflow:hidden;text-overflow:ellipsis}.sky-list-view-checklist-item ::ng-deep .sky-list-view-checklist-single-button{background-color:transparent;border:none;border-bottom:1px dotted #cdcfd2;display:block;text-align:left;margin-bottom:0;padding:10px;width:100%;cursor:pointer}.sky-list-view-checklist-item ::ng-deep .sky-list-view-checklist-single-button.sky-list-view-checklist-row-selected{background-color:#f1eef6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistItemComponent, decorators: [{
9
- type: Component,
10
- args: [{
11
- selector: 'sky-list-view-checklist-item',
12
- templateUrl: './list-view-checklist-item.component.html',
13
- styleUrls: ['./list-view-checklist-item.component.scss'],
14
- changeDetection: ChangeDetectionStrategy.OnPush,
15
- }]
16
- }], propDecorators: { item: [{
17
- type: Input
18
- }] } });
19
- //# sourceMappingURL=list-view-checklist-item.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-view-checklist-item.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/list-view-checklist-item.component.ts","../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/list-view-checklist-item.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;;AAQtE,MAAM,OAAO,iCAAiC;;+HAAjC,iCAAiC;mHAAjC,iCAAiC,8FCV9C,qFAGA;4FDOa,iCAAiC;kBAN7C,SAAS;mBAAC;oBACT,QAAQ,EAAE,8BAA8B;oBACxC,WAAW,EAAE,2CAA2C;oBACxD,SAAS,EAAE,CAAC,2CAA2C,CAAC;oBACxD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAGQ,IAAI;sBADV,KAAK","sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nimport { ListViewChecklistItemModel } from './state/items/item.model';\n\n@Component({\n selector: 'sky-list-view-checklist-item',\n templateUrl: './list-view-checklist-item.component.html',\n styleUrls: ['./list-view-checklist-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyListViewChecklistItemComponent {\n @Input()\n public item: ListViewChecklistItemModel;\n}\n","<div class=\"sky-list-view-checklist-item\">\n <ng-content></ng-content>\n</div>\n"]}
@@ -1,293 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input, forwardRef, } from '@angular/core';
2
- import { ListFilterModel, ListSelectedSetItemSelectedAction, ListSelectedSetItemsSelectedAction, ListState, ListStateDispatcher, ListToolbarSetTypeAction, ListViewComponent, } from '@skyux/list-builder';
3
- import { getData, } from '@skyux/list-builder-common';
4
- import { Subject } from 'rxjs';
5
- import { distinctUntilChanged, map as observableMap, take, takeUntil, } from 'rxjs/operators';
6
- import { ChecklistStateModel } from './state/checklist-state.model';
7
- import { ChecklistStateDispatcher } from './state/checklist-state.rxstate';
8
- import { ChecklistState } from './state/checklist-state.state-node';
9
- import { ListViewChecklistItemModel } from './state/items/item.model';
10
- import { ListViewChecklistItemsLoadAction } from './state/items/load.action';
11
- import * as i0 from "@angular/core";
12
- import * as i1 from "@skyux/list-builder";
13
- import * as i2 from "./state/checklist-state.state-node";
14
- import * as i3 from "./state/checklist-state.rxstate";
15
- import * as i4 from "./list-view-checklist-item.component";
16
- import * as i5 from "@skyux/forms";
17
- import * as i6 from "@angular/common";
18
- export class SkyListViewChecklistComponent extends ListViewComponent {
19
- constructor(state, dispatcher, checklistState, checklistDispatcher) {
20
- super(state, 'Checklist View');
21
- this.dispatcher = dispatcher;
22
- this.checklistState = checklistState;
23
- this.checklistDispatcher = checklistDispatcher;
24
- /**
25
- * Specifies a search function to apply on the view data.
26
- * The default function searches view data on label, description,
27
- * and category if field selectors are defined for the given field.
28
- * @default default search function
29
- */
30
- this.search = this.searchFunction();
31
- /**
32
- * Specifies the name of the label field selector.
33
- * @default "label"
34
- */
35
- // eslint-disable-next-line @angular-eslint/no-input-rename
36
- this.labelFieldSelector = 'label';
37
- /**
38
- * Specifies the name of the description field selector.
39
- * @default "description"
40
- */
41
- this.description = 'description';
42
- this.ngUnsubscribe = new Subject();
43
- this._selectMode = 'multiple';
44
- this._selectedIdMap = new Map();
45
- this._showOnlySelected = false;
46
- let lastUpdate;
47
- this.state
48
- .pipe(observableMap((s) => s.items), distinctUntilChanged(), observableMap((items) => {
49
- const dataChanged = lastUpdate === undefined || items.lastUpdate !== lastUpdate;
50
- lastUpdate = items.lastUpdate;
51
- const newItems = items.items.map((item) => {
52
- return new ListViewChecklistItemModel(item.id, {
53
- label: this.labelFieldSelector
54
- ? getData(item.data, this.labelFieldSelector)
55
- : undefined,
56
- description: this.description
57
- ? getData(item.data, this.description)
58
- : undefined,
59
- });
60
- });
61
- this.checklistDispatcher.next(new ListViewChecklistItemsLoadAction(newItems, true, dataChanged, items.count));
62
- }))
63
- .pipe(takeUntil(this.ngUnsubscribe))
64
- .subscribe();
65
- this.state
66
- .pipe(observableMap((t) => t.selected), takeUntil(this.ngUnsubscribe))
67
- .subscribe((selectedItems) => {
68
- this._selectedIdMap = selectedItems.item.selectedIdMap;
69
- });
70
- }
71
- /**
72
- * Specifies the name of the view.
73
- * @required
74
- */
75
- set name(value) {
76
- this.viewName = value;
77
- }
78
- /**
79
- * Specifies how many items users can select.
80
- * `"single"` allows users to select one item in the checklist, while `"multiple"`
81
- * allows users to select multiple items in the checklist.
82
- * @default "multiple"
83
- */
84
- set selectMode(value) {
85
- this._selectMode = value;
86
- if (this.selectMode === 'multiple') {
87
- this.dispatcher.toolbarShowMultiselectToolbar(true);
88
- }
89
- else {
90
- this.showOnlySelected = false;
91
- this.dispatcher.toolbarShowMultiselectToolbar(false);
92
- }
93
- this.reapplyFilter(this.showOnlySelected);
94
- }
95
- get selectMode() {
96
- return this._selectMode || 'multiple';
97
- }
98
- /**
99
- * Indicates whether to display selected items only.
100
- * @default false
101
- */
102
- set showOnlySelected(value) {
103
- this._showOnlySelected = value;
104
- }
105
- get showOnlySelected() {
106
- return this._showOnlySelected;
107
- }
108
- ngOnInit() {
109
- if (this.selectMode === 'multiple') {
110
- this.dispatcher.toolbarShowMultiselectToolbar(true);
111
- }
112
- // If 'show-selected' filter is changed from multiselect toolbar (list-builder)
113
- // make sure the private variable _showOnlySelected stays in sync.
114
- this.state
115
- .pipe(observableMap((t) => t.filters), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.showSelectedValuesEqual))
116
- .subscribe((filters) => {
117
- const showSelectedFilter = filters.find((filter) => filter.name === 'show-selected');
118
- if (showSelectedFilter) {
119
- this._showOnlySelected = showSelectedFilter.value === 'true';
120
- }
121
- });
122
- }
123
- ngOnChanges(changes) {
124
- if (changes['showOnlySelected'] &&
125
- changes['showOnlySelected'].currentValue !==
126
- changes['showOnlySelected'].previousValue) {
127
- this.reapplyFilter(changes['showOnlySelected'].currentValue);
128
- }
129
- }
130
- /**
131
- * @deprecated since version 3.2.0
132
- * Multiselect toolbar will automatically show if select mode is set to 'multiple'.
133
- * These methods are no longer needed, as that functionality is part of list-builder.
134
- */
135
- changeVisibleItems(change) {
136
- this.showOnlySelected = change.checked;
137
- }
138
- /**
139
- * @deprecated since version 3.2.0
140
- * Multiselect toolbar will automatically show if select mode is set to 'multiple'.
141
- * These methods are no longer needed, as that functionality is part of list-builder.
142
- */
143
- clearSelections() {
144
- this.state
145
- .pipe(observableMap((state) => state.items.items), take(1))
146
- .subscribe((items) => {
147
- this.dispatcher.next(new ListSelectedSetItemsSelectedAction(items.map((item) => item.id), false, false));
148
- /* istanbul ignore else */
149
- if (this.showOnlySelected) {
150
- this.reapplyFilter(this.showOnlySelected);
151
- }
152
- });
153
- }
154
- /**
155
- * @deprecated since version 3.2.0
156
- * Multiselect toolbar will automatically show if select mode is set to 'multiple'.
157
- * These methods are no longer needed, as that functionality is part of list-builder.
158
- */
159
- selectAll() {
160
- this.state
161
- .pipe(observableMap((state) => state.items.items), take(1))
162
- .subscribe((items) => {
163
- this.dispatcher.next(new ListSelectedSetItemsSelectedAction(items.map((item) => item.id), true, false));
164
- /* istanbul ignore else */
165
- if (this.showOnlySelected) {
166
- this.reapplyFilter(this.showOnlySelected);
167
- }
168
- });
169
- }
170
- onViewActive() {
171
- if (this.search !== undefined) {
172
- this.dispatcher.searchSetFunctions([this.search]);
173
- }
174
- const fieldSelectors = [];
175
- if (this.labelFieldSelector) {
176
- fieldSelectors.push(this.labelFieldSelector);
177
- }
178
- if (this.description) {
179
- fieldSelectors.push(this.description);
180
- }
181
- this.dispatcher.searchSetFieldSelectors(fieldSelectors);
182
- this.dispatcher.next(new ListToolbarSetTypeAction('search'));
183
- }
184
- ngOnDestroy() {
185
- this.ngUnsubscribe.next();
186
- this.ngUnsubscribe.complete();
187
- }
188
- get items() {
189
- return this.checklistState.pipe(observableMap((state) => state.items.items));
190
- }
191
- searchFunction() {
192
- return (data, searchText) => {
193
- if (this.labelFieldSelector !== undefined) {
194
- const label = getData(data, this.labelFieldSelector);
195
- if (label !== undefined &&
196
- label !== null &&
197
- label.toString().toLowerCase().indexOf(searchText) !== -1) {
198
- return true;
199
- }
200
- }
201
- if (this.description !== undefined) {
202
- const description = getData(data, this.description);
203
- if (description !== undefined &&
204
- description !== null &&
205
- description.toString().toLowerCase().indexOf(searchText) !== -1) {
206
- return true;
207
- }
208
- }
209
- return false;
210
- };
211
- }
212
- itemSelected(id) {
213
- return this.state.pipe(observableMap((state) => state.selected.item.selectedIdMap.get(id)));
214
- }
215
- setItemSelection(item, event) {
216
- this.dispatcher.next(new ListSelectedSetItemSelectedAction(item.id, event.checked));
217
- }
218
- singleSelectRowClick(item) {
219
- this.dispatcher.next(new ListSelectedSetItemsSelectedAction([item.id], true, true));
220
- }
221
- getShowSelectedFilter(isSelected) {
222
- return new ListFilterModel({
223
- name: 'show-selected',
224
- value: isSelected.toString(),
225
- filterFunction: (model, showOnlySelected) => {
226
- /* istanbul ignore else */
227
- if (showOnlySelected.toString() !== false.toString()) {
228
- return this._selectedIdMap.get(model.id);
229
- }
230
- },
231
- defaultValue: false.toString(),
232
- });
233
- }
234
- reapplyFilter(isSelected) {
235
- this.state
236
- .pipe(observableMap((state) => state.filters), take(1))
237
- .subscribe((filters) => {
238
- filters = filters.filter((filter) => filter.name !== 'show-selected');
239
- filters.push(this.getShowSelectedFilter(isSelected));
240
- this.dispatcher.filtersUpdate(filters);
241
- });
242
- }
243
- showSelectedValuesEqual(prev, next) {
244
- const prevShowSelectedFilter = prev.find((filter) => filter.name === 'show-selected');
245
- const nextShowSelectedFilter = next.find((filter) => filter.name === 'show-selected');
246
- if (prevShowSelectedFilter && nextShowSelectedFilter) {
247
- return prevShowSelectedFilter.value === nextShowSelectedFilter.value;
248
- }
249
- return true;
250
- }
251
- }
252
- SkyListViewChecklistComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistComponent, deps: [{ token: i1.ListState }, { token: i1.ListStateDispatcher }, { token: i2.ChecklistState }, { token: i3.ChecklistStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
253
- SkyListViewChecklistComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyListViewChecklistComponent, selector: "sky-list-view-checklist", inputs: { name: "name", search: "search", labelFieldSelector: ["label", "labelFieldSelector"], description: "description", selectMode: "selectMode", showOnlySelected: "showOnlySelected" }, providers: [
254
- {
255
- provide: ListViewComponent,
256
- useExisting: forwardRef(() => SkyListViewChecklistComponent),
257
- },
258
- ChecklistState,
259
- ChecklistStateDispatcher,
260
- ChecklistStateModel,
261
- ], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"sky-list-view-checklist\" *ngIf=\"active | async\">\n <div [ngSwitch]=\"selectMode\">\n <ng-template ngSwitchCase=\"single\">\n <div role=\"radiogroup\">\n <sky-list-view-checklist-item\n *ngFor=\"let item of items | async\"\n [attr.sky-cmp-id]=\"item.id\"\n [item]=\"item\"\n >\n <button\n role=\"radio\"\n type=\"button\"\n class=\"sky-list-view-checklist-single-button\"\n [attr.aria-checked]=\"(itemSelected(item.id) | async) || false\"\n [ngClass]=\"{\n 'sky-list-view-checklist-row-selected':\n (itemSelected(item.id) | async)\n }\"\n (click)=\"singleSelectRowClick(item)\"\n >\n <div *ngIf=\"item.label\" class=\"sky-emphasized\">\n {{ item.label }}\n </div>\n <div *ngIf=\"item.description\">{{ item.description }}</div>\n </button>\n </sky-list-view-checklist-item>\n </div>\n </ng-template>\n\n <ng-template ngSwitchDefault>\n <sky-list-view-checklist-item\n *ngFor=\"let item of items | async\"\n [attr.sky-cmp-id]=\"item.id\"\n [item]=\"item\"\n >\n <sky-checkbox\n [checked]=\"itemSelected(item.id) | async\"\n (change)=\"setItemSelection(item, $event)\"\n >\n <sky-checkbox-label>\n <div\n *ngIf=\"item.label\"\n class=\"sky-emphasized\"\n [attr.title]=\"item.label\"\n >\n {{ item.label }}\n </div>\n <div *ngIf=\"item.description\" [attr.title]=\"item.description\">\n {{ item.description }}\n </div>\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-list-view-checklist-item>\n </ng-template>\n </div>\n</div>\n", styles: [".sky-list-view-checklist ::ng-deep .sky-checkbox-wrapper{display:flex;align-items:flex-start}.sky-list-view-checklist ::ng-deep .sky-checkbox-wrapper>.sky-checkbox,.sky-list-view-checklist ::ng-deep .sky-checkbox-wrapper>input{flex:1;max-width:22px}.sky-list-view-checklist ::ng-deep .sky-switch{white-space:nowrap}.sky-list-view-checklist ::ng-deep .sky-switch-label{margin:0}.sky-list-view-checklist ::ng-deep sky-checkbox-label{min-width:0}.sky-list-view-checklist ::ng-deep .sky-switch-control{margin:0 5px 0 0}\n"], components: [{ type: i4.SkyListViewChecklistItemComponent, selector: "sky-list-view-checklist-item", inputs: ["item"] }, { type: i5.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i5.λ4, selector: "sky-checkbox-label" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i6.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
262
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistComponent, decorators: [{
263
- type: Component,
264
- args: [{
265
- selector: 'sky-list-view-checklist',
266
- templateUrl: './list-view-checklist.component.html',
267
- styleUrls: ['./list-view-checklist.component.scss'],
268
- providers: [
269
- {
270
- provide: ListViewComponent,
271
- useExisting: forwardRef(() => SkyListViewChecklistComponent),
272
- },
273
- ChecklistState,
274
- ChecklistStateDispatcher,
275
- ChecklistStateModel,
276
- ],
277
- changeDetection: ChangeDetectionStrategy.OnPush,
278
- }]
279
- }], ctorParameters: function () { return [{ type: i1.ListState }, { type: i1.ListStateDispatcher }, { type: i2.ChecklistState }, { type: i3.ChecklistStateDispatcher }]; }, propDecorators: { name: [{
280
- type: Input
281
- }], search: [{
282
- type: Input
283
- }], labelFieldSelector: [{
284
- type: Input,
285
- args: ['label']
286
- }], description: [{
287
- type: Input
288
- }], selectMode: [{
289
- type: Input
290
- }], showOnlySelected: [{
291
- type: Input
292
- }] } });
293
- //# sourceMappingURL=list-view-checklist.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-view-checklist.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/list-view-checklist.component.ts","../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/list-view-checklist.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,EAKL,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EAEf,iCAAiC,EACjC,kCAAkC,EAClC,SAAS,EACT,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,OAAO,GACR,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,GAAG,IAAI,aAAa,EACpB,IAAI,EACJ,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;;;;;;;;AAiB7E,MAAM,OAAO,6BACX,SAAQ,i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,EAAE,yBAAyB;oBACnC,WAAW,EAAE,sCAAsC;oBACnD,SAAS,EAAE,CAAC,sCAAsC,CAAC;oBACnD,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;yBAC7D;wBACD,cAAc;wBACd,wBAAwB;wBACxB,mBAAmB;qBACpB;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;sMAUK,IAAI;sBADP,KAAK;gBAYC,MAAM;sBADZ,KAAK;gBAUC,kBAAkB;sBADxB,KAAK;uBAAC,OAAO;gBAQP,WAAW;sBADjB,KAAK;gBAUK,UAAU;sBADpB,KAAK;gBAuBK,gBAAgB;sBAD1B,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n forwardRef,\n} from '@angular/core';\nimport { SkyCheckboxChange } from '@skyux/forms';\nimport {\n ListFilterModel,\n ListSelectedModel,\n ListSelectedSetItemSelectedAction,\n ListSelectedSetItemsSelectedAction,\n ListState,\n ListStateDispatcher,\n ListToolbarSetTypeAction,\n ListViewComponent,\n} from '@skyux/list-builder';\nimport {\n AsyncItem,\n AsyncList,\n ListItemModel,\n getData,\n} from '@skyux/list-builder-common';\n\nimport { Observable, Subject } from 'rxjs';\nimport {\n distinctUntilChanged,\n map as observableMap,\n take,\n takeUntil,\n} from 'rxjs/operators';\n\nimport { ChecklistStateModel } from './state/checklist-state.model';\nimport { ChecklistStateDispatcher } from './state/checklist-state.rxstate';\nimport { ChecklistState } from './state/checklist-state.state-node';\nimport { ListViewChecklistItemModel } from './state/items/item.model';\nimport { ListViewChecklistItemsLoadAction } from './state/items/load.action';\n\n@Component({\n selector: 'sky-list-view-checklist',\n templateUrl: './list-view-checklist.component.html',\n styleUrls: ['./list-view-checklist.component.scss'],\n providers: [\n {\n provide: ListViewComponent,\n useExisting: forwardRef(() => SkyListViewChecklistComponent),\n },\n ChecklistState,\n ChecklistStateDispatcher,\n ChecklistStateModel,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyListViewChecklistComponent\n extends ListViewComponent\n implements OnInit, OnDestroy, OnChanges\n{\n /**\n * Specifies the name of the view.\n * @required\n */\n @Input()\n set name(value: string) {\n this.viewName = value;\n }\n\n /**\n * Specifies a search function to apply on the view data.\n * The default function searches view data on label, description,\n * and category if field selectors are defined for the given field.\n * @default default search function\n */\n @Input()\n public search: (data: any, searchText: string) => boolean =\n this.searchFunction();\n\n /**\n * Specifies the name of the label field selector.\n * @default \"label\"\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('label')\n public labelFieldSelector = 'label';\n\n /**\n * Specifies the name of the description field selector.\n * @default \"description\"\n */\n @Input()\n public description = 'description';\n\n /**\n * Specifies how many items users can select.\n * `\"single\"` allows users to select one item in the checklist, while `\"multiple\"`\n * allows users to select multiple items in the checklist.\n * @default \"multiple\"\n */\n @Input()\n public set selectMode(value: string) {\n this._selectMode = value;\n\n if (this.selectMode === 'multiple') {\n this.dispatcher.toolbarShowMultiselectToolbar(true);\n } else {\n this.showOnlySelected = false;\n this.dispatcher.toolbarShowMultiselectToolbar(false);\n }\n\n this.reapplyFilter(this.showOnlySelected);\n }\n\n public get selectMode(): string {\n return this._selectMode || 'multiple';\n }\n\n /**\n * Indicates whether to display selected items only.\n * @default false\n */\n @Input()\n public set showOnlySelected(value: boolean) {\n this._showOnlySelected = value;\n }\n\n public get showOnlySelected(): boolean {\n return this._showOnlySelected;\n }\n\n private ngUnsubscribe = new Subject();\n\n private _selectMode = 'multiple';\n\n private _selectedIdMap: Map<string, boolean> = new Map<string, boolean>();\n\n private _showOnlySelected = false;\n\n constructor(\n state: ListState,\n private dispatcher: ListStateDispatcher,\n private checklistState: ChecklistState,\n private checklistDispatcher: ChecklistStateDispatcher\n ) {\n super(state, 'Checklist View');\n\n let lastUpdate: any;\n this.state\n .pipe(\n observableMap((s) => s.items),\n distinctUntilChanged(),\n observableMap((items: AsyncList<ListItemModel>) => {\n const dataChanged =\n lastUpdate === undefined || items.lastUpdate !== lastUpdate;\n lastUpdate = items.lastUpdate;\n const newItems = items.items.map((item) => {\n return new ListViewChecklistItemModel(item.id, {\n label: this.labelFieldSelector\n ? getData(item.data, this.labelFieldSelector)\n : undefined,\n description: this.description\n ? getData(item.data, this.description)\n : undefined,\n });\n });\n\n this.checklistDispatcher.next(\n new ListViewChecklistItemsLoadAction(\n newItems,\n true,\n dataChanged,\n items.count\n )\n );\n })\n )\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe();\n\n this.state\n .pipe(\n observableMap((t) => t.selected),\n takeUntil(this.ngUnsubscribe)\n )\n .subscribe((selectedItems: AsyncItem<ListSelectedModel>) => {\n this._selectedIdMap = selectedItems.item.selectedIdMap;\n });\n }\n\n public ngOnInit() {\n if (this.selectMode === 'multiple') {\n this.dispatcher.toolbarShowMultiselectToolbar(true);\n }\n\n // If 'show-selected' filter is changed from multiselect toolbar (list-builder)\n // make sure the private variable _showOnlySelected stays in sync.\n this.state\n .pipe(\n observableMap((t) => t.filters),\n takeUntil(this.ngUnsubscribe),\n distinctUntilChanged(this.showSelectedValuesEqual)\n )\n .subscribe((filters: ListFilterModel[]) => {\n const showSelectedFilter = filters.find(\n (filter: ListFilterModel) => filter.name === 'show-selected'\n );\n if (showSelectedFilter) {\n this._showOnlySelected = showSelectedFilter.value === 'true';\n }\n });\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (\n changes['showOnlySelected'] &&\n changes['showOnlySelected'].currentValue !==\n changes['showOnlySelected'].previousValue\n ) {\n this.reapplyFilter(changes['showOnlySelected'].currentValue);\n }\n }\n\n /**\n * @deprecated since version 3.2.0\n * Multiselect toolbar will automatically show if select mode is set to 'multiple'.\n * These methods are no longer needed, as that functionality is part of list-builder.\n */\n public changeVisibleItems(change: SkyCheckboxChange) {\n this.showOnlySelected = change.checked;\n }\n\n /**\n * @deprecated since version 3.2.0\n * Multiselect toolbar will automatically show if select mode is set to 'multiple'.\n * These methods are no longer needed, as that functionality is part of list-builder.\n */\n public clearSelections() {\n this.state\n .pipe(\n observableMap((state) => state.items.items),\n take(1)\n )\n .subscribe((items) => {\n this.dispatcher.next(\n new ListSelectedSetItemsSelectedAction(\n items.map((item) => item.id),\n false,\n false\n )\n );\n\n /* istanbul ignore else */\n if (this.showOnlySelected) {\n this.reapplyFilter(this.showOnlySelected);\n }\n });\n }\n\n /**\n * @deprecated since version 3.2.0\n * Multiselect toolbar will automatically show if select mode is set to 'multiple'.\n * These methods are no longer needed, as that functionality is part of list-builder.\n */\n public selectAll() {\n this.state\n .pipe(\n observableMap((state) => state.items.items),\n take(1)\n )\n .subscribe((items) => {\n this.dispatcher.next(\n new ListSelectedSetItemsSelectedAction(\n items.map((item) => item.id),\n true,\n false\n )\n );\n\n /* istanbul ignore else */\n if (this.showOnlySelected) {\n this.reapplyFilter(this.showOnlySelected);\n }\n });\n }\n\n public onViewActive() {\n if (this.search !== undefined) {\n this.dispatcher.searchSetFunctions([this.search]);\n }\n\n const fieldSelectors: Array<string> = [];\n if (this.labelFieldSelector) {\n fieldSelectors.push(this.labelFieldSelector);\n }\n\n if (this.description) {\n fieldSelectors.push(this.description);\n }\n\n this.dispatcher.searchSetFieldSelectors(fieldSelectors);\n\n this.dispatcher.next(new ListToolbarSetTypeAction('search'));\n }\n\n public ngOnDestroy() {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n get items(): Observable<ListViewChecklistItemModel[]> {\n return this.checklistState.pipe(\n observableMap((state) => state.items.items)\n );\n }\n\n public searchFunction() {\n return (data: any, searchText: string) => {\n if (this.labelFieldSelector !== undefined) {\n const label = getData(data, this.labelFieldSelector);\n if (\n label !== undefined &&\n label !== null &&\n label.toString().toLowerCase().indexOf(searchText) !== -1\n ) {\n return true;\n }\n }\n\n if (this.description !== undefined) {\n const description = getData(data, this.description);\n if (\n description !== undefined &&\n description !== null &&\n description.toString().toLowerCase().indexOf(searchText) !== -1\n ) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n public itemSelected(id: string): Observable<boolean> {\n return this.state.pipe(\n observableMap((state) => state.selected.item.selectedIdMap.get(id))\n );\n }\n\n public setItemSelection(item: ListItemModel, event: any) {\n this.dispatcher.next(\n new ListSelectedSetItemSelectedAction(item.id, event.checked)\n );\n }\n\n public singleSelectRowClick(item: ListItemModel) {\n this.dispatcher.next(\n new ListSelectedSetItemsSelectedAction([item.id], true, true)\n );\n }\n\n private getShowSelectedFilter(isSelected: boolean) {\n return new ListFilterModel({\n name: 'show-selected',\n value: isSelected.toString(),\n filterFunction: (model: ListItemModel, showOnlySelected: boolean) => {\n /* istanbul ignore else */\n if (showOnlySelected.toString() !== false.toString()) {\n return this._selectedIdMap.get(model.id);\n }\n },\n defaultValue: false.toString(),\n });\n }\n\n private reapplyFilter(isSelected: boolean) {\n this.state\n .pipe(\n observableMap((state) => state.filters),\n take(1)\n )\n .subscribe((filters: ListFilterModel[]) => {\n filters = filters.filter((filter) => filter.name !== 'show-selected');\n filters.push(this.getShowSelectedFilter(isSelected));\n this.dispatcher.filtersUpdate(filters);\n });\n }\n\n private showSelectedValuesEqual(\n prev: ListFilterModel[],\n next: ListFilterModel[]\n ) {\n const prevShowSelectedFilter = prev.find(\n (filter) => filter.name === 'show-selected'\n );\n const nextShowSelectedFilter = next.find(\n (filter) => filter.name === 'show-selected'\n );\n\n if (prevShowSelectedFilter && nextShowSelectedFilter) {\n return prevShowSelectedFilter.value === nextShowSelectedFilter.value;\n }\n\n return true;\n }\n}\n","<div class=\"sky-list-view-checklist\" *ngIf=\"active | async\">\n <div [ngSwitch]=\"selectMode\">\n <ng-template ngSwitchCase=\"single\">\n <div role=\"radiogroup\">\n <sky-list-view-checklist-item\n *ngFor=\"let item of items | async\"\n [attr.sky-cmp-id]=\"item.id\"\n [item]=\"item\"\n >\n <button\n role=\"radio\"\n type=\"button\"\n class=\"sky-list-view-checklist-single-button\"\n [attr.aria-checked]=\"(itemSelected(item.id) | async) || false\"\n [ngClass]=\"{\n 'sky-list-view-checklist-row-selected':\n (itemSelected(item.id) | async)\n }\"\n (click)=\"singleSelectRowClick(item)\"\n >\n <div *ngIf=\"item.label\" class=\"sky-emphasized\">\n {{ item.label }}\n </div>\n <div *ngIf=\"item.description\">{{ item.description }}</div>\n </button>\n </sky-list-view-checklist-item>\n </div>\n </ng-template>\n\n <ng-template ngSwitchDefault>\n <sky-list-view-checklist-item\n *ngFor=\"let item of items | async\"\n [attr.sky-cmp-id]=\"item.id\"\n [item]=\"item\"\n >\n <sky-checkbox\n [checked]=\"itemSelected(item.id) | async\"\n (change)=\"setItemSelection(item, $event)\"\n >\n <sky-checkbox-label>\n <div\n *ngIf=\"item.label\"\n class=\"sky-emphasized\"\n [attr.title]=\"item.label\"\n >\n {{ item.label }}\n </div>\n <div *ngIf=\"item.description\" [attr.title]=\"item.description\">\n {{ item.description }}\n </div>\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-list-view-checklist-item>\n </ng-template>\n </div>\n</div>\n"]}
@@ -1,25 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { FormsModule } from '@angular/forms';
4
- import { SkyCheckboxModule } from '@skyux/forms';
5
- import { SkyListViewChecklistItemComponent } from './list-view-checklist-item.component';
6
- import { SkyListViewChecklistComponent } from './list-view-checklist.component';
7
- import * as i0 from "@angular/core";
8
- export class SkyListViewChecklistModule {
9
- }
10
- SkyListViewChecklistModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11
- SkyListViewChecklistModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistModule, declarations: [SkyListViewChecklistComponent,
12
- SkyListViewChecklistItemComponent], imports: [CommonModule, FormsModule, SkyCheckboxModule], exports: [SkyListViewChecklistComponent, SkyListViewChecklistItemComponent] });
13
- SkyListViewChecklistModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistModule, imports: [[CommonModule, FormsModule, SkyCheckboxModule]] });
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewChecklistModule, decorators: [{
15
- type: NgModule,
16
- args: [{
17
- declarations: [
18
- SkyListViewChecklistComponent,
19
- SkyListViewChecklistItemComponent,
20
- ],
21
- imports: [CommonModule, FormsModule, SkyCheckboxModule],
22
- exports: [SkyListViewChecklistComponent, SkyListViewChecklistItemComponent],
23
- }]
24
- }] });
25
- //# sourceMappingURL=list-view-checklist.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-view-checklist.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/list-view-checklist.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;;AAUhF,MAAM,OAAO,0BAA0B;;wHAA1B,0BAA0B;yHAA1B,0BAA0B,iBANnC,6BAA6B;QAC7B,iCAAiC,aAEzB,YAAY,EAAE,WAAW,EAAE,iBAAiB,aAC5C,6BAA6B,EAAE,iCAAiC;yHAE/D,0BAA0B,YAH5B,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,CAAC;4FAG5C,0BAA0B;kBARtC,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,6BAA6B;wBAC7B,iCAAiC;qBAClC;oBACD,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,CAAC;oBACvD,OAAO,EAAE,CAAC,6BAA6B,EAAE,iCAAiC,CAAC;iBAC5E","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyCheckboxModule } from '@skyux/forms';\n\nimport { SkyListViewChecklistItemComponent } from './list-view-checklist-item.component';\nimport { SkyListViewChecklistComponent } from './list-view-checklist.component';\n\n@NgModule({\n declarations: [\n SkyListViewChecklistComponent,\n SkyListViewChecklistItemComponent,\n ],\n imports: [CommonModule, FormsModule, SkyCheckboxModule],\n exports: [SkyListViewChecklistComponent, SkyListViewChecklistItemComponent],\n})\nexport class SkyListViewChecklistModule {}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=checklist-state-action.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checklist-state-action.type.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/checklist-state-action.type.ts"],"names":[],"mappings":"","sourcesContent":["import { ListViewChecklistItemsLoadAction } from './items/load.action';\n\nexport type ChecklistStateAction = ListViewChecklistItemsLoadAction;\n"]}
@@ -1,7 +0,0 @@
1
- import { AsyncList } from '@skyux/list-builder-common';
2
- export class ChecklistStateModel {
3
- constructor() {
4
- this.items = new AsyncList();
5
- }
6
- }
7
- //# sourceMappingURL=checklist-state.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checklist-state.model.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/checklist-state.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAIvD,MAAM,OAAO,mBAAmB;IAAhC;QACS,UAAK,GACV,IAAI,SAAS,EAA8B,CAAC;IAChD,CAAC;CAAA","sourcesContent":["import { AsyncList } from '@skyux/list-builder-common';\n\nimport { ListViewChecklistItemModel } from './items/item.model';\n\nexport class ChecklistStateModel {\n public items: AsyncList<ListViewChecklistItemModel> =\n new AsyncList<ListViewChecklistItemModel>();\n}\n"]}
@@ -1,13 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { StateDispatcher, StateOrchestrator } from '@skyux/list-builder-common';
3
- import * as i0 from "@angular/core";
4
- export class ChecklistStateDispatcher extends StateDispatcher {
5
- }
6
- ChecklistStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChecklistStateDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
7
- ChecklistStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChecklistStateDispatcher });
8
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChecklistStateDispatcher, decorators: [{
9
- type: Injectable
10
- }] });
11
- export class ChecklistStateOrchestrator extends StateOrchestrator {
12
- }
13
- //# sourceMappingURL=checklist-state.rxstate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checklist-state.rxstate.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/checklist-state.rxstate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;;AAKhF,MAAM,OAAO,wBAAyB,SAAQ,eAAqC;;sHAAtE,wBAAwB;0HAAxB,wBAAwB;4FAAxB,wBAAwB;kBADpC,UAAU;;AAGX,MAAM,OAAO,0BAA8B,SAAQ,iBAGlD;CAAG","sourcesContent":["import { Injectable } from '@angular/core';\nimport { StateDispatcher, StateOrchestrator } from '@skyux/list-builder-common';\n\nimport { ChecklistStateAction } from './checklist-state-action.type';\n\n@Injectable()\nexport class ChecklistStateDispatcher extends StateDispatcher<ChecklistStateAction> {}\n\nexport class ChecklistStateOrchestrator<T> extends StateOrchestrator<\n T,\n ChecklistStateAction\n> {}\n"]}
@@ -1,20 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { StateNode } from '@skyux/list-builder-common';
3
- import { ChecklistStateModel } from './checklist-state.model';
4
- import { ChecklistStateDispatcher } from './checklist-state.rxstate';
5
- import { ListViewChecklistItemsOrchestrator } from './items/items.orchestrator';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "./checklist-state.model";
8
- import * as i2 from "./checklist-state.rxstate";
9
- export class ChecklistState extends StateNode {
10
- constructor(initialState, dispatcher) {
11
- super(initialState, dispatcher);
12
- this.register('items', ListViewChecklistItemsOrchestrator).begin();
13
- }
14
- }
15
- ChecklistState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChecklistState, deps: [{ token: i1.ChecklistStateModel }, { token: i2.ChecklistStateDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
16
- ChecklistState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChecklistState });
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChecklistState, decorators: [{
18
- type: Injectable
19
- }], ctorParameters: function () { return [{ type: i1.ChecklistStateModel }, { type: i2.ChecklistStateDispatcher }]; } });
20
- //# sourceMappingURL=checklist-state.state-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checklist-state.state-node.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/checklist-state.state-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;;;;AAGhF,MAAM,OAAO,cAAe,SAAQ,SAA8B;IAChE,YACE,YAAiC,EACjC,UAAoC;QAEpC,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAEhC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC,KAAK,EAAE,CAAC;IACrE,CAAC;;4GARU,cAAc;gHAAd,cAAc;4FAAd,cAAc;kBAD1B,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport { StateNode } from '@skyux/list-builder-common';\n\nimport { ChecklistStateModel } from './checklist-state.model';\nimport { ChecklistStateDispatcher } from './checklist-state.rxstate';\nimport { ListViewChecklistItemsOrchestrator } from './items/items.orchestrator';\n\n@Injectable()\nexport class ChecklistState extends StateNode<ChecklistStateModel> {\n constructor(\n initialState: ChecklistStateModel,\n dispatcher: ChecklistStateDispatcher\n ) {\n super(initialState, dispatcher);\n\n this.register('items', ListViewChecklistItemsOrchestrator).begin();\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- export class ListViewChecklistItemModel {
2
- constructor(id, data) {
3
- this.id = id;
4
- if (data) {
5
- this.label = data.label;
6
- this.description = data.description;
7
- }
8
- }
9
- }
10
- //# sourceMappingURL=item.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"item.model.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/items/item.model.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,0BAA0B;IAKrC,YAAY,EAAU,EAAE,IAAU;QAChC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;SACrC;IACH,CAAC;CACF","sourcesContent":["export class ListViewChecklistItemModel {\n public id: string;\n public label: string;\n public description: string;\n\n constructor(id: string, data?: any) {\n this.id = id;\n\n if (data) {\n this.label = data.label;\n this.description = data.description;\n }\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- import { AsyncList } from '@skyux/list-builder-common';
2
- import { ChecklistStateOrchestrator } from '../checklist-state.rxstate';
3
- import { ListViewChecklistItemModel } from './item.model';
4
- import { ListViewChecklistItemsLoadAction } from './load.action';
5
- export class ListViewChecklistItemsOrchestrator extends ChecklistStateOrchestrator {
6
- /* istanbul ignore next */
7
- constructor() {
8
- super();
9
- this.register(ListViewChecklistItemsLoadAction, this.load);
10
- }
11
- load(state, action) {
12
- const newListItems = action.items.map((item) => new ListViewChecklistItemModel(item.id, item));
13
- if (action.refresh) {
14
- return new AsyncList([...newListItems], action.dataChanged ? Date.now() : state.lastUpdate, false, state.count);
15
- }
16
- return new AsyncList([...state.items, ...newListItems], action.dataChanged ? Date.now() : state.lastUpdate, false, action.itemCount);
17
- }
18
- }
19
- //# sourceMappingURL=items.orchestrator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"items.orchestrator.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/items/items.orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,OAAO,kCAAmC,SAAQ,0BAEvD;IACC,0BAA0B;IAC1B;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,CAAC,gCAAgC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAEO,IAAI,CACV,KAA4C,EAC5C,MAAwC;QAExC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CACnC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,0BAA0B,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CACxD,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,OAAO,IAAI,SAAS,CAClB,CAAC,GAAG,YAAY,CAAC,EACjB,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAClD,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;SACH;QAED,OAAO,IAAI,SAAS,CAClB,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,YAAY,CAAC,EACjC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAClD,KAAK,EACL,MAAM,CAAC,SAAS,CACjB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { AsyncList } from '@skyux/list-builder-common';\n\nimport { ChecklistStateOrchestrator } from '../checklist-state.rxstate';\n\nimport { ListViewChecklistItemModel } from './item.model';\nimport { ListViewChecklistItemsLoadAction } from './load.action';\n\nexport class ListViewChecklistItemsOrchestrator extends ChecklistStateOrchestrator<\n AsyncList<ListViewChecklistItemModel>\n> {\n /* istanbul ignore next */\n constructor() {\n super();\n this.register(ListViewChecklistItemsLoadAction, this.load);\n }\n\n private load(\n state: AsyncList<ListViewChecklistItemModel>,\n action: ListViewChecklistItemsLoadAction\n ): AsyncList<ListViewChecklistItemModel> {\n const newListItems = action.items.map(\n (item) => new ListViewChecklistItemModel(item.id, item)\n );\n\n if (action.refresh) {\n return new AsyncList<ListViewChecklistItemModel>(\n [...newListItems],\n action.dataChanged ? Date.now() : state.lastUpdate,\n false,\n state.count\n );\n }\n\n return new AsyncList<ListViewChecklistItemModel>(\n [...state.items, ...newListItems],\n action.dataChanged ? Date.now() : state.lastUpdate,\n false,\n action.itemCount\n );\n }\n}\n"]}
@@ -1,9 +0,0 @@
1
- export class ListViewChecklistItemsLoadAction {
2
- constructor(items = [], refresh = false, dataChanged = true, itemCount = items.length) {
3
- this.items = items;
4
- this.refresh = refresh;
5
- this.dataChanged = dataChanged;
6
- this.itemCount = itemCount;
7
- }
8
- }
9
- //# sourceMappingURL=load.action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load.action.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/list-builder-view-checklist/src/lib/modules/list-view-checklist/state/items/load.action.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,gCAAgC;IAC3C,YACS,QAA2C,EAAE,EAC7C,UAAmB,KAAK,EACxB,cAAuB,IAAI,EAC3B,YAAoB,KAAK,CAAC,MAAM;QAHhC,UAAK,GAAL,KAAK,CAAwC;QAC7C,YAAO,GAAP,OAAO,CAAiB;QACxB,gBAAW,GAAX,WAAW,CAAgB;QAC3B,cAAS,GAAT,SAAS,CAAuB;IACtC,CAAC;CACL","sourcesContent":["import { ListViewChecklistItemModel } from './item.model';\n\nexport class ListViewChecklistItemsLoadAction {\n constructor(\n public items: Array<ListViewChecklistItemModel> = [],\n public refresh: boolean = false,\n public dataChanged: boolean = true,\n public itemCount: number = items.length\n ) {}\n}\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=skyux-list-builder-view-checklist.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skyux-list-builder-view-checklist.js","sourceRoot":"","sources":["../../../../../libs/components/list-builder-view-checklist/src/skyux-list-builder-view-checklist.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-view-checklist-fixture.js","sourceRoot":"","sources":["../../../../../../libs/components/list-builder-view-checklist/testing/src/list-view-checklist-fixture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,wBAAwB,GAAG,EAAE,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AACzE,MAAM,yBAAyB,GAAG,EAAE,CAAC,GAAG,CACtC,wCAAwC,CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAGtC,YAAY,OAA8B,EAAE,SAAiB;QAC3D,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,uBAAuB,CACtD,OAAO,EACP,SAAS,EACT,yBAAyB,CAC1B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,KAAa;QAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzC,OAAO;YACL,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAC9B,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CACpD;YACD,WAAW,EAAE,iBAAiB,CAAC,OAAO,CACpC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAC1D;YACD,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;SACnC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,KAAa;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzC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C,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAEjE,IAAI,aAAa,EAAE;YACjB,OAAO,aAAa,CAAC;SACtB;QAED,4CAA4C;QAC5C,OAAO,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACjD,CAAC;IAEO,SAAS,CAAC,QAAsB;QACtC,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC;QAElC,IAAI,EAAE,CAAC,OAAO,KAAK,OAAO,EAAE;YAC1B,OAAO,EAAE,CAAC,OAAO,CAAC;SACnB;QAED,4CAA4C;QAC5C,OAAO,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,MAAM,CAAC;IACpD,CAAC;CACF","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\nimport { SkyListViewChecklistItem } from './list-view-checklist-item';\n\nconst MULTI_SELECT_EL_SELECTOR = By.css('.sky-checkbox-wrapper > input');\nconst SINGLE_SELECT_EL_SELECTOR = By.css(\n '.sky-list-view-checklist-single-button'\n);\n\n/**\n * Allows interaction with a SKY UX list view checklist component.\n */\nexport class SkyListViewChecklistFixture {\n private debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-list-view-checklist'\n );\n }\n\n /**\n * Gets an item at the specified index.\n * @param index The item's index.\n */\n public getItem(index: number): SkyListViewChecklistItem {\n const selectWrapperEl = this.getSelectWrapperEl(index);\n const selectEl = this.getSelectEl(index);\n\n return {\n label: SkyAppTestUtility.getText(\n selectWrapperEl.query(By.css('div.sky-emphasized'))\n ),\n description: SkyAppTestUtility.getText(\n selectWrapperEl.query(By.css('div:not(.sky-emphasized)'))\n ),\n selected: this.isChecked(selectEl),\n };\n }\n\n /**\n * Selects the item at the specified index.\n * @param index The item's index.\n */\n public selectItem(index: number) {\n const selectEl = this.getSelectEl(index);\n\n if (!this.isChecked(selectEl)) {\n selectEl.nativeElement.click();\n }\n }\n\n /**\n * Deselects the item at the specified index.\n * @param index The item's index.\n */\n public deselectItem(index: number) {\n const selectEl = this.getSelectEl(index);\n\n if (selectEl.nativeElement.tagName === 'BUTTON') {\n throw new Error(`Items cannot be deselected in single select mode.`);\n }\n\n if (this.isChecked(selectEl)) {\n selectEl.nativeElement.click();\n }\n }\n\n private getItemEl(index: number): DebugElement {\n const itemEls = this.debugEl.queryAll(\n By.css('sky-list-view-checklist-item')\n );\n\n const itemEl = itemEls[index];\n\n if (!itemEl) {\n throw new Error(`No item exists at index ${index}.`);\n }\n\n return itemEl;\n }\n\n private getSelectEl(index: number): DebugElement {\n const itemEl = this.getItemEl(index);\n\n const checkboxEl = itemEl.query(MULTI_SELECT_EL_SELECTOR);\n\n if (checkboxEl) {\n return checkboxEl;\n }\n\n // Assume the list is in single-select mode.\n return itemEl.query(SINGLE_SELECT_EL_SELECTOR);\n }\n\n private getSelectWrapperEl(index: number): DebugElement {\n const itemEl = this.getItemEl(index);\n\n const itemWrapperEl = itemEl.query(By.css('sky-checkbox-label'));\n\n if (itemWrapperEl) {\n return itemWrapperEl;\n }\n\n // Assume the list is in single-select mode.\n return itemEl.query(SINGLE_SELECT_EL_SELECTOR);\n }\n\n private isChecked(selectEl: DebugElement): boolean {\n const el = selectEl.nativeElement;\n\n if (el.tagName === 'INPUT') {\n return el.checked;\n }\n\n // Assume the list is in single-select mode.\n return el.getAttribute('aria-checked') === 'true';\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=list-view-checklist-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-view-checklist-item.js","sourceRoot":"","sources":["../../../../../../libs/components/list-builder-view-checklist/testing/src/list-view-checklist-item.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Properties of a list view checklist item.\n */\nexport interface SkyListViewChecklistItem {\n /**\n * The item's label.\n */\n label: string;\n\n /**\n * The item's description.\n */\n description: string;\n\n /**\n * A flag indicating whether the item is selected.\n */\n selected: boolean;\n}\n"]}
@@ -1,3 +0,0 @@
1
- export * from './list-view-checklist-fixture';
2
- export * from './list-view-checklist-item';
3
- //# sourceMappingURL=public-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../../../../libs/components/list-builder-view-checklist/testing/src/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './list-view-checklist-fixture';\nexport * from './list-view-checklist-item';\n"]}