@skyux/list-builder-view-checklist 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/skyux-list-builder-view-checklist-testing.umd.js +4 -4
- package/bundles/skyux-list-builder-view-checklist-testing.umd.js.map +1 -1
- package/bundles/skyux-list-builder-view-checklist.umd.js +57 -65
- package/bundles/skyux-list-builder-view-checklist.umd.js.map +1 -1
- package/documentation.json +44 -39
- package/esm2015/modules/list-view-checklist/list-view-checklist-item.component.js +5 -5
- package/esm2015/modules/list-view-checklist/list-view-checklist.component.js +46 -37
- package/esm2015/modules/list-view-checklist/list-view-checklist.module.js +9 -23
- package/esm2015/modules/list-view-checklist/state/checklist-state-action.type.js +1 -1
- package/esm2015/modules/list-view-checklist/state/checklist-state.model.js +1 -1
- package/esm2015/modules/list-view-checklist/state/checklist-state.rxstate.js +4 -4
- package/esm2015/modules/list-view-checklist/state/checklist-state.state-node.js +5 -6
- package/esm2015/modules/list-view-checklist/state/items/items.orchestrator.js +2 -2
- package/esm2015/modules/list-view-checklist/state/items/load.action.js +1 -1
- package/esm2015/testing/list-view-checklist-fixture.js +2 -2
- package/esm2015/testing/list-view-checklist-item.js +1 -1
- package/fesm2015/skyux-list-builder-view-checklist-testing.js +1 -1
- package/fesm2015/skyux-list-builder-view-checklist-testing.js.map +1 -1
- package/fesm2015/skyux-list-builder-view-checklist.js +61 -67
- package/fesm2015/skyux-list-builder-view-checklist.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/platform-browser'), require('@skyux-sdk/testing')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@skyux/list-builder-view-checklist/testing', ['exports', '@angular/platform-browser', '@skyux-sdk/testing'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux[
|
|
5
|
-
}(this, (function (exports, platformBrowser, testing) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["list-builder-view-checklist"] = global.skyux["list-builder-view-checklist"] || {}, global.skyux["list-builder-view-checklist"].testing = {}), global.ng.platformBrowser, global.testing));
|
|
5
|
+
})(this, (function (exports, platformBrowser, testing) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var MULTI_SELECT_EL_SELECTOR = platformBrowser.By.css('.sky-checkbox-wrapper > input');
|
|
8
8
|
var SINGLE_SELECT_EL_SELECTOR = platformBrowser.By.css('.sky-list-view-checklist-single-button');
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
return {
|
|
24
24
|
label: testing.SkyAppTestUtility.getText(selectWrapperEl.query(platformBrowser.By.css('div.sky-emphasized'))),
|
|
25
25
|
description: testing.SkyAppTestUtility.getText(selectWrapperEl.query(platformBrowser.By.css('div:not(.sky-emphasized)'))),
|
|
26
|
-
selected: this.isChecked(selectEl)
|
|
26
|
+
selected: this.isChecked(selectEl),
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
|
|
95
95
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
96
96
|
|
|
97
|
-
}))
|
|
97
|
+
}));
|
|
98
98
|
//# sourceMappingURL=skyux-list-builder-view-checklist-testing.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-list-builder-view-checklist-testing.umd.js","sources":["../../../projects/list-builder-view-checklist/testing/src/list-view-checklist-fixture.ts","../../../projects/list-builder-view-checklist/testing/src/skyux-list-builder-view-checklist-testing.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"skyux-list-builder-view-checklist-testing.umd.js","sources":["../../../projects/list-builder-view-checklist/testing/src/list-view-checklist-fixture.ts","../../../projects/list-builder-view-checklist/testing/src/skyux-list-builder-view-checklist-testing.ts"],"sourcesContent":["import { ComponentFixture } from '@angular/core/testing';\n\nimport { DebugElement } from '@angular/core';\n\nimport { By } from '@angular/platform-browser';\n\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["By","SkyAppTestUtility"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@skyux/forms'), require('@skyux/list-builder'), require('@skyux/list-builder-common'), require('rxjs'), require('rxjs/operators')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@skyux/list-builder-view-checklist', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@skyux/forms', '@skyux/list-builder', '@skyux/list-builder-common', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux[
|
|
5
|
-
}(this, (function (exports, i0, i6, forms, i5, i1, listBuilderCommon, rxjs, operators) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["list-builder-view-checklist"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.i5, global.i1, global.listBuilderCommon, global.rxjs, global.rxjs.operators));
|
|
5
|
+
})(this, (function (exports, i0, i6, forms, i5, i1, listBuilderCommon, rxjs, operators) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -13,14 +13,12 @@
|
|
|
13
13
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
14
|
Object.defineProperty(n, k, d.get ? d : {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return e[k];
|
|
18
|
-
}
|
|
16
|
+
get: function () { return e[k]; }
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
|
-
n[
|
|
21
|
+
n["default"] = e;
|
|
24
22
|
return Object.freeze(n);
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -264,7 +262,7 @@
|
|
|
264
262
|
ar[i] = from[i];
|
|
265
263
|
}
|
|
266
264
|
}
|
|
267
|
-
return to.concat(ar || from);
|
|
265
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
268
266
|
}
|
|
269
267
|
function __await(v) {
|
|
270
268
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -354,9 +352,9 @@
|
|
|
354
352
|
}
|
|
355
353
|
return ChecklistStateDispatcher;
|
|
356
354
|
}(listBuilderCommon.StateDispatcher));
|
|
357
|
-
ChecklistStateDispatcher.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
358
|
-
ChecklistStateDispatcher.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
359
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
355
|
+
ChecklistStateDispatcher.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: ChecklistStateDispatcher, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
356
|
+
ChecklistStateDispatcher.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: ChecklistStateDispatcher });
|
|
357
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: ChecklistStateDispatcher, decorators: [{
|
|
360
358
|
type: i0.Injectable
|
|
361
359
|
}] });
|
|
362
360
|
var ChecklistStateOrchestrator = /** @class */ (function (_super) {
|
|
@@ -421,15 +419,14 @@
|
|
|
421
419
|
__extends(ChecklistState, _super);
|
|
422
420
|
function ChecklistState(initialState, dispatcher) {
|
|
423
421
|
var _this = _super.call(this, initialState, dispatcher) || this;
|
|
424
|
-
_this.register('items', ListViewChecklistItemsOrchestrator)
|
|
425
|
-
.begin();
|
|
422
|
+
_this.register('items', ListViewChecklistItemsOrchestrator).begin();
|
|
426
423
|
return _this;
|
|
427
424
|
}
|
|
428
425
|
return ChecklistState;
|
|
429
426
|
}(listBuilderCommon.StateNode));
|
|
430
|
-
ChecklistState.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
431
|
-
ChecklistState.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
432
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
427
|
+
ChecklistState.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: ChecklistState, deps: [{ token: ChecklistStateModel }, { token: ChecklistStateDispatcher }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
428
|
+
ChecklistState.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: ChecklistState });
|
|
429
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: ChecklistState, decorators: [{
|
|
433
430
|
type: i0.Injectable
|
|
434
431
|
}], ctorParameters: function () { return [{ type: ChecklistStateModel }, { type: ChecklistStateDispatcher }]; } });
|
|
435
432
|
|
|
@@ -438,15 +435,15 @@
|
|
|
438
435
|
}
|
|
439
436
|
return SkyListViewChecklistItemComponent;
|
|
440
437
|
}());
|
|
441
|
-
SkyListViewChecklistItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
442
|
-
SkyListViewChecklistItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
443
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
438
|
+
SkyListViewChecklistItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistItemComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
439
|
+
SkyListViewChecklistItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListViewChecklistItemComponent, selector: "sky-list-view-checklist-item", inputs: { item: "item" }, ngImport: i0__namespace, 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__namespace.ChangeDetectionStrategy.OnPush });
|
|
440
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistItemComponent, decorators: [{
|
|
444
441
|
type: i0.Component,
|
|
445
442
|
args: [{
|
|
446
443
|
selector: 'sky-list-view-checklist-item',
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
444
|
+
template: "<div class=\"sky-list-view-checklist-item\">\n <ng-content></ng-content>\n</div>\n",
|
|
445
|
+
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"],
|
|
446
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
450
447
|
}]
|
|
451
448
|
}], propDecorators: { item: [{
|
|
452
449
|
type: i0.Input
|
|
@@ -488,8 +485,12 @@
|
|
|
488
485
|
lastUpdate = items.lastUpdate;
|
|
489
486
|
var newItems = items.items.map(function (item) {
|
|
490
487
|
return new ListViewChecklistItemModel(item.id, {
|
|
491
|
-
label: _this.labelFieldSelector
|
|
492
|
-
|
|
488
|
+
label: _this.labelFieldSelector
|
|
489
|
+
? listBuilderCommon.getData(item.data, _this.labelFieldSelector)
|
|
490
|
+
: undefined,
|
|
491
|
+
description: _this.description
|
|
492
|
+
? listBuilderCommon.getData(item.data, _this.description)
|
|
493
|
+
: undefined,
|
|
493
494
|
});
|
|
494
495
|
});
|
|
495
496
|
_this.checklistDispatcher.next(new ListViewChecklistItemsLoadAction(newItems, true, dataChanged, items.count));
|
|
@@ -564,13 +565,14 @@
|
|
|
564
565
|
.subscribe(function (filters) {
|
|
565
566
|
var showSelectedFilter = filters.find(function (filter) { return filter.name === 'show-selected'; });
|
|
566
567
|
if (showSelectedFilter) {
|
|
567
|
-
_this._showOnlySelected =
|
|
568
|
+
_this._showOnlySelected = showSelectedFilter.value === 'true';
|
|
568
569
|
}
|
|
569
570
|
});
|
|
570
571
|
};
|
|
571
572
|
SkyListViewChecklistComponent.prototype.ngOnChanges = function (changes) {
|
|
572
573
|
if (changes['showOnlySelected'] &&
|
|
573
|
-
changes['showOnlySelected'].currentValue !==
|
|
574
|
+
changes['showOnlySelected'].currentValue !==
|
|
575
|
+
changes['showOnlySelected'].previousValue) {
|
|
574
576
|
this.reapplyFilter(changes['showOnlySelected'].currentValue);
|
|
575
577
|
}
|
|
576
578
|
};
|
|
@@ -592,8 +594,7 @@
|
|
|
592
594
|
this.state
|
|
593
595
|
.pipe(operators.map(function (state) { return state.items.items; }), operators.take(1))
|
|
594
596
|
.subscribe(function (items) {
|
|
595
|
-
_this.dispatcher
|
|
596
|
-
.next(new i1.ListSelectedSetItemsSelectedAction(items.map(function (item) { return item.id; }), false, false));
|
|
597
|
+
_this.dispatcher.next(new i1.ListSelectedSetItemsSelectedAction(items.map(function (item) { return item.id; }), false, false));
|
|
597
598
|
/* istanbul ignore else */
|
|
598
599
|
if (_this.showOnlySelected) {
|
|
599
600
|
_this.reapplyFilter(_this.showOnlySelected);
|
|
@@ -610,8 +611,7 @@
|
|
|
610
611
|
this.state
|
|
611
612
|
.pipe(operators.map(function (state) { return state.items.items; }), operators.take(1))
|
|
612
613
|
.subscribe(function (items) {
|
|
613
|
-
_this.dispatcher
|
|
614
|
-
.next(new i1.ListSelectedSetItemsSelectedAction(items.map(function (item) { return item.id; }), true, false));
|
|
614
|
+
_this.dispatcher.next(new i1.ListSelectedSetItemsSelectedAction(items.map(function (item) { return item.id; }), true, false));
|
|
615
615
|
/* istanbul ignore else */
|
|
616
616
|
if (_this.showOnlySelected) {
|
|
617
617
|
_this.reapplyFilter(_this.showOnlySelected);
|
|
@@ -685,7 +685,7 @@
|
|
|
685
685
|
return _this._selectedIdMap.get(model.id);
|
|
686
686
|
}
|
|
687
687
|
},
|
|
688
|
-
defaultValue: false.toString()
|
|
688
|
+
defaultValue: false.toString(),
|
|
689
689
|
});
|
|
690
690
|
};
|
|
691
691
|
SkyListViewChecklistComponent.prototype.reapplyFilter = function (isSelected) {
|
|
@@ -709,26 +709,32 @@
|
|
|
709
709
|
};
|
|
710
710
|
return SkyListViewChecklistComponent;
|
|
711
711
|
}(i1.ListViewComponent));
|
|
712
|
-
SkyListViewChecklistComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
713
|
-
SkyListViewChecklistComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
714
|
-
{
|
|
712
|
+
SkyListViewChecklistComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistComponent, deps: [{ token: i1__namespace.ListState }, { token: i1__namespace.ListStateDispatcher }, { token: ChecklistState }, { token: ChecklistStateDispatcher }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
713
|
+
SkyListViewChecklistComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListViewChecklistComponent, selector: "sky-list-view-checklist", inputs: { name: "name", search: "search", labelFieldSelector: ["label", "labelFieldSelector"], description: "description", selectMode: "selectMode", showOnlySelected: "showOnlySelected" }, providers: [
|
|
714
|
+
{
|
|
715
|
+
provide: i1.ListViewComponent,
|
|
716
|
+
useExisting: i0.forwardRef(function () { return SkyListViewChecklistComponent; }),
|
|
717
|
+
},
|
|
715
718
|
ChecklistState,
|
|
716
719
|
ChecklistStateDispatcher,
|
|
717
|
-
ChecklistStateModel
|
|
718
|
-
], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, 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
|
|
719
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
720
|
+
ChecklistStateModel,
|
|
721
|
+
], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, 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: SkyListViewChecklistItemComponent, selector: "sky-list-view-checklist-item", inputs: ["item"] }, { type: i5__namespace.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i5__namespace.λ4, selector: "sky-checkbox-label" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i6__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
722
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistComponent, decorators: [{
|
|
720
723
|
type: i0.Component,
|
|
721
724
|
args: [{
|
|
722
725
|
selector: 'sky-list-view-checklist',
|
|
723
|
-
|
|
724
|
-
|
|
726
|
+
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",
|
|
727
|
+
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"],
|
|
725
728
|
providers: [
|
|
726
|
-
{
|
|
729
|
+
{
|
|
730
|
+
provide: i1.ListViewComponent,
|
|
731
|
+
useExisting: i0.forwardRef(function () { return SkyListViewChecklistComponent; }),
|
|
732
|
+
},
|
|
727
733
|
ChecklistState,
|
|
728
734
|
ChecklistStateDispatcher,
|
|
729
|
-
ChecklistStateModel
|
|
735
|
+
ChecklistStateModel,
|
|
730
736
|
],
|
|
731
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
737
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
732
738
|
}]
|
|
733
739
|
}], ctorParameters: function () { return [{ type: i1__namespace.ListState }, { type: i1__namespace.ListStateDispatcher }, { type: ChecklistState }, { type: ChecklistStateDispatcher }]; }, propDecorators: { name: [{
|
|
734
740
|
type: i0.Input
|
|
@@ -750,33 +756,19 @@
|
|
|
750
756
|
}
|
|
751
757
|
return SkyListViewChecklistModule;
|
|
752
758
|
}());
|
|
753
|
-
SkyListViewChecklistModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
754
|
-
SkyListViewChecklistModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
755
|
-
SkyListViewChecklistItemComponent], imports: [i6.CommonModule,
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
SkyListViewChecklistItemComponent] });
|
|
759
|
-
SkyListViewChecklistModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: SkyListViewChecklistModule, imports: [[
|
|
760
|
-
i6.CommonModule,
|
|
761
|
-
forms.FormsModule,
|
|
762
|
-
i5.SkyCheckboxModule
|
|
763
|
-
]] });
|
|
764
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: SkyListViewChecklistModule, decorators: [{
|
|
759
|
+
SkyListViewChecklistModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
760
|
+
SkyListViewChecklistModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistModule, declarations: [SkyListViewChecklistComponent,
|
|
761
|
+
SkyListViewChecklistItemComponent], imports: [i6.CommonModule, forms.FormsModule, i5.SkyCheckboxModule], exports: [SkyListViewChecklistComponent, SkyListViewChecklistItemComponent] });
|
|
762
|
+
SkyListViewChecklistModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistModule, imports: [[i6.CommonModule, forms.FormsModule, i5.SkyCheckboxModule]] });
|
|
763
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyListViewChecklistModule, decorators: [{
|
|
765
764
|
type: i0.NgModule,
|
|
766
765
|
args: [{
|
|
767
766
|
declarations: [
|
|
768
767
|
SkyListViewChecklistComponent,
|
|
769
|
-
SkyListViewChecklistItemComponent
|
|
770
|
-
],
|
|
771
|
-
imports: [
|
|
772
|
-
i6.CommonModule,
|
|
773
|
-
forms.FormsModule,
|
|
774
|
-
i5.SkyCheckboxModule
|
|
768
|
+
SkyListViewChecklistItemComponent,
|
|
775
769
|
],
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
SkyListViewChecklistItemComponent
|
|
779
|
-
]
|
|
770
|
+
imports: [i6.CommonModule, forms.FormsModule, i5.SkyCheckboxModule],
|
|
771
|
+
exports: [SkyListViewChecklistComponent, SkyListViewChecklistItemComponent],
|
|
780
772
|
}]
|
|
781
773
|
}] });
|
|
782
774
|
|
|
@@ -793,9 +785,9 @@
|
|
|
793
785
|
exports.ListViewChecklistItemsOrchestrator = ListViewChecklistItemsOrchestrator;
|
|
794
786
|
exports.SkyListViewChecklistComponent = SkyListViewChecklistComponent;
|
|
795
787
|
exports.SkyListViewChecklistModule = SkyListViewChecklistModule;
|
|
796
|
-
exports
|
|
788
|
+
exports["λ1"] = SkyListViewChecklistItemComponent;
|
|
797
789
|
|
|
798
790
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
799
791
|
|
|
800
|
-
}))
|
|
792
|
+
}));
|
|
801
793
|
//# sourceMappingURL=skyux-list-builder-view-checklist.umd.js.map
|