@ng-nest/ui 15.0.15 → 15.0.17
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/checkbox/checkbox.component.d.ts +2 -0
- package/checkbox/checkbox.module.d.ts +4 -3
- package/checkbox/checkbox.property.d.ts +42 -1
- package/core/functions/date.d.ts +2 -0
- package/date-picker/date-picker-portal.component.d.ts +1 -0
- package/date-picker/date-picker.module.d.ts +18 -16
- package/date-picker/date-picker.property.d.ts +120 -1
- package/date-picker/date-quarter.pipe.d.ts +9 -0
- package/date-picker/picker-date.component.d.ts +1 -0
- package/date-picker/picker-quarter.component.d.ts +45 -0
- package/date-picker/public-api.d.ts +2 -0
- package/esm2020/checkbox/checkbox.component.mjs +21 -4
- package/esm2020/checkbox/checkbox.module.mjs +5 -4
- package/esm2020/checkbox/checkbox.property.mjs +28 -2
- package/esm2020/core/functions/date.mjs +15 -1
- package/esm2020/date-picker/date-picker-portal.component.mjs +16 -4
- package/esm2020/date-picker/date-picker.component.mjs +12 -3
- package/esm2020/date-picker/date-picker.module.mjs +18 -6
- package/esm2020/date-picker/date-picker.property.mjs +154 -1
- package/esm2020/date-picker/date-quarter.pipe.mjs +19 -0
- package/esm2020/date-picker/date-range-portal.component.mjs +7 -6
- package/esm2020/date-picker/date-range.component.mjs +28 -4
- package/esm2020/date-picker/picker-date.component.mjs +6 -3
- package/esm2020/date-picker/picker-quarter.component.mjs +237 -0
- package/esm2020/date-picker/public-api.mjs +3 -1
- package/esm2020/i18n/i18n.property.mjs +1 -1
- package/esm2020/i18n/languages/en_GB.mjs +4 -1
- package/esm2020/i18n/languages/en_US.mjs +4 -1
- package/esm2020/i18n/languages/zh_CN.mjs +4 -1
- package/esm2020/i18n/languages/zh_TW.mjs +4 -1
- package/esm2020/radio/radio.component.mjs +28 -6
- package/esm2020/radio/radio.module.mjs +5 -4
- package/esm2020/radio/radio.property.mjs +28 -3
- package/esm2020/tag/tag.component.mjs +4 -4
- package/esm2020/tag/tag.property.mjs +22 -2
- package/esm2020/tree/tree.component.mjs +47 -59
- package/fesm2015/ng-nest-ui-checkbox.mjs +51 -7
- package/fesm2015/ng-nest-ui-checkbox.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-core.mjs +15 -1
- package/fesm2015/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-date-picker.mjs +468 -18
- package/fesm2015/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-i18n.mjs +12 -0
- package/fesm2015/ng-nest-ui-i18n.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-radio.mjs +58 -10
- package/fesm2015/ng-nest-ui-radio.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-tag.mjs +24 -4
- package/fesm2015/ng-nest-ui-tag.mjs.map +1 -1
- package/fesm2015/ng-nest-ui-tree.mjs +45 -57
- package/fesm2015/ng-nest-ui-tree.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-checkbox.mjs +51 -7
- package/fesm2020/ng-nest-ui-checkbox.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-core.mjs +15 -1
- package/fesm2020/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-date-picker.mjs +467 -18
- package/fesm2020/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-i18n.mjs +12 -0
- package/fesm2020/ng-nest-ui-i18n.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-radio.mjs +58 -10
- package/fesm2020/ng-nest-ui-radio.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-tag.mjs +24 -4
- package/fesm2020/ng-nest-ui-tag.mjs.map +1 -1
- package/fesm2020/ng-nest-ui-tree.mjs +45 -57
- package/fesm2020/ng-nest-ui-tree.mjs.map +1 -1
- package/i18n/i18n.property.d.ts +3 -0
- package/i18n/languages/en_GB.d.ts +3 -0
- package/i18n/languages/en_US.d.ts +3 -0
- package/i18n/languages/zh_CN.d.ts +3 -0
- package/i18n/languages/zh_TW.d.ts +3 -0
- package/package.json +1 -1
- package/radio/radio.component.d.ts +2 -0
- package/radio/radio.module.d.ts +4 -3
- package/radio/radio.property.d.ts +38 -3
- package/tag/tag.property.d.ts +8 -3
- package/tree/tree.component.d.ts +1 -1
|
@@ -9,7 +9,9 @@ import * as i2 from '@angular/common';
|
|
|
9
9
|
import { CommonModule } from '@angular/common';
|
|
10
10
|
import * as i3 from '@ng-nest/ui/button';
|
|
11
11
|
import { XButtonModule } from '@ng-nest/ui/button';
|
|
12
|
-
import * as i4 from '@ng-nest/ui/
|
|
12
|
+
import * as i4 from '@ng-nest/ui/tag';
|
|
13
|
+
import { XTagModule } from '@ng-nest/ui/tag';
|
|
14
|
+
import * as i5 from '@ng-nest/ui/outlet';
|
|
13
15
|
import { XOutletModule } from '@ng-nest/ui/outlet';
|
|
14
16
|
import { FormsModule } from '@angular/forms';
|
|
15
17
|
|
|
@@ -31,10 +33,25 @@ class XCheckboxProperty extends XControlValueAccessor {
|
|
|
31
33
|
* @en_US Checkbox data
|
|
32
34
|
*/
|
|
33
35
|
this.data = [];
|
|
36
|
+
/**
|
|
37
|
+
* @zh_CN 按钮/图标/ tag 标签样式时生效
|
|
38
|
+
* @en_US Take effect when button style
|
|
39
|
+
*/
|
|
40
|
+
this.type = 'initial';
|
|
41
|
+
/**
|
|
42
|
+
* @zh_CN tag 标签边框
|
|
43
|
+
* @en_US Tag bordered
|
|
44
|
+
*/
|
|
45
|
+
this.tagBordered = true;
|
|
46
|
+
/**
|
|
47
|
+
* @zh_CN tag 标签深色主题
|
|
48
|
+
* @en_US Tag dark theme
|
|
49
|
+
*/
|
|
50
|
+
this.tagDark = false;
|
|
34
51
|
}
|
|
35
52
|
}
|
|
36
53
|
/** @nocollapse */ XCheckboxProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
37
|
-
/** @nocollapse */ XCheckboxProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XCheckboxProperty, selector: "ng-component", inputs: { data: "data", button: "button", icon: "icon", indeterminate: "indeterminate", size: "size", before: "before", after: "after" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
54
|
+
/** @nocollapse */ XCheckboxProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XCheckboxProperty, selector: "ng-component", inputs: { data: "data", button: "button", icon: "icon", tag: "tag", indeterminate: "indeterminate", size: "size", type: "type", tagBordered: "tagBordered", tagDark: "tagDark", before: "before", after: "after" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
38
55
|
__decorate([
|
|
39
56
|
XDataConvert()
|
|
40
57
|
], XCheckboxProperty.prototype, "data", void 0);
|
|
@@ -44,6 +61,9 @@ __decorate([
|
|
|
44
61
|
__decorate([
|
|
45
62
|
XInputBoolean()
|
|
46
63
|
], XCheckboxProperty.prototype, "icon", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
XInputBoolean()
|
|
66
|
+
], XCheckboxProperty.prototype, "tag", void 0);
|
|
47
67
|
__decorate([
|
|
48
68
|
XInputBoolean()
|
|
49
69
|
], XCheckboxProperty.prototype, "indeterminate", void 0);
|
|
@@ -59,10 +79,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
59
79
|
type: Input
|
|
60
80
|
}], icon: [{
|
|
61
81
|
type: Input
|
|
82
|
+
}], tag: [{
|
|
83
|
+
type: Input
|
|
62
84
|
}], indeterminate: [{
|
|
63
85
|
type: Input
|
|
64
86
|
}], size: [{
|
|
65
87
|
type: Input
|
|
88
|
+
}], type: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}], tagBordered: [{
|
|
91
|
+
type: Input
|
|
92
|
+
}], tagDark: [{
|
|
93
|
+
type: Input
|
|
66
94
|
}], before: [{
|
|
67
95
|
type: Input
|
|
68
96
|
}], after: [{
|
|
@@ -96,6 +124,7 @@ class XCheckboxComponent extends XCheckboxProperty {
|
|
|
96
124
|
ngOnInit() {
|
|
97
125
|
this.setFlex(this.checkbox.nativeElement, this.renderer, this.justify, this.align, this.direction);
|
|
98
126
|
this.setClassMap();
|
|
127
|
+
this.setCheckboxType();
|
|
99
128
|
}
|
|
100
129
|
ngOnChanges(changes) {
|
|
101
130
|
const { data } = changes;
|
|
@@ -109,6 +138,21 @@ class XCheckboxComponent extends XCheckboxProperty {
|
|
|
109
138
|
XClearClass(this.labelMap);
|
|
110
139
|
this.labelMap[`x-text-align-${this.labelAlign}`] = this.labelAlign ? true : false;
|
|
111
140
|
}
|
|
141
|
+
setCheckboxType() {
|
|
142
|
+
if (this.button) {
|
|
143
|
+
this.checkboxType = 'button';
|
|
144
|
+
}
|
|
145
|
+
else if (this.icon) {
|
|
146
|
+
this.checkboxType = 'icon';
|
|
147
|
+
}
|
|
148
|
+
else if (this.tag) {
|
|
149
|
+
this.checkboxType = 'tag';
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this.checkboxType = 'initial';
|
|
153
|
+
}
|
|
154
|
+
this.cdr.detectChanges();
|
|
155
|
+
}
|
|
112
156
|
checkboxClick(event, node) {
|
|
113
157
|
event.preventDefault();
|
|
114
158
|
if (this.disabled || node.disabled)
|
|
@@ -154,10 +198,10 @@ class XCheckboxComponent extends XCheckboxProperty {
|
|
|
154
198
|
}
|
|
155
199
|
}
|
|
156
200
|
/** @nocollapse */ XCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
157
|
-
/** @nocollapse */ XCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XCheckboxComponent, selector: "x-checkbox", providers: [XValueAccessor(XCheckboxComponent)], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkbox"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #checkbox\r\n class=\"x-checkbox\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [class.x-checkbox-button]=\"button\"\r\n [class.x-checkbox-icon]=\"icon\"\r\n [class.x-checkbox-after]=\"after\"\r\n [class.x-checkbox-before]=\"before\"\r\n [class.x-checkbox-after-template]=\"afterIsTemplate\"\r\n [class.x-checkbox-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-checkbox-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-checkbox-row\">\r\n <div class=\"x-checkbox-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-list\">\r\n <ng-container *ngIf=\"button || icon; else default\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #default>\r\n <div\r\n class=\"x-checkbox-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"getChecked(item.id)\"\r\n [class.x-disabled]=\"disabled || item.disabled\"\r\n [class.x-indeterminate]=\"indeterminate\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >\r\n <span class=\"x-checkbox-box\"></span>\r\n <span class=\"x-checkbox-label\">\r\n <ng-container *xOutlet=\"item.label; context: { $node: item }\">{{ item.label }}</ng-container>\r\n </span>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-checkbox{margin:0;padding:0;width:100%}.x-checkbox.x-flex{display:flex}.x-checkbox.x-justify-start{justify-content:flex-start}.x-checkbox.x-justify-center{justify-content:center}.x-checkbox.x-justify-end{justify-content:flex-end}.x-checkbox.x-justify-space-between{justify-content:space-between}.x-checkbox.x-justify-space-around{justify-content:space-around}.x-checkbox.x-align-start{align-items:flex-start}.x-checkbox.x-align-center{align-items:center}.x-checkbox.x-align-end{align-items:flex-end}.x-checkbox.x-direction-column{flex-direction:column}.x-checkbox.x-direction-column-reverse{flex-direction:column-reverse}.x-checkbox.x-direction-row{flex-direction:row}.x-checkbox.x-direction-row-reverse{flex-direction:row-reverse}.x-checkbox>label{display:inline-block;white-space:nowrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem);position:relative;color:var(--x-text-300);font-weight:600}.x-checkbox>label.x-text-align-start{text-align:start}.x-checkbox>label.x-text-align-center{text-align:center}.x-checkbox>label.x-text-align-end{text-align:end}.x-checkbox-row{flex:1;display:flex;align-items:center;flex-wrap:wrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem)}.x-checkbox-row .x-checkbox-row-before,.x-checkbox-row .x-checkbox-row-after{border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background-a100);padding:0 var(--x-padding-medium);height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-checkbox-row-list{position:relative;display:inline-flex;align-items:center}.x-checkbox-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:.875rem;font-size:.875rem;cursor:pointer;transition:all .3s}.x-checkbox-row-item:hover{color:var(--x-primary)}.x-checkbox-row-item:hover .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item:last-child{margin-right:0}.x-checkbox-row-item.x-indeterminate .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item.x-indeterminate .x-checkbox-box:after{top:50%;left:50%;width:.5rem;height:.5rem;background-color:var(--x-primary);border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:\" \"}.x-checkbox-row-item.x-checked .x-checkbox-box{border-color:var(--x-primary);background-color:var(--x-primary)}.x-checkbox-row-item.x-checked .x-checkbox-box:after{border:.125rem solid var(--x-background-100);border-top:0;border-left:0;top:.3875rem;left:.1875rem;width:.3125rem;height:.625rem;transform:rotate(40deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s;content:\" \"}.x-checkbox-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-checkbox-row-item.x-disabled .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox-row-item.x-disabled .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox-button .x-checkbox-row-before,.x-checkbox-icon .x-checkbox-row-before{margin-right:0}.x-checkbox-button .x-checkbox-row-after,.x-checkbox-icon .x-checkbox-row-after{margin-left:0}.x-checkbox-box{border:var(--x-border-width) solid var(--x-border);width:1rem;height:1rem;border-radius:.0625rem;background-color:var(--x-background-a100);position:relative;display:inline-block;box-sizing:border-box;transition:all .3s}.x-checkbox-box:hover{border-color:var(--x-primary)}.x-checkbox-box:after{position:absolute;top:.35rem;left:.175rem;display:inline-block;width:.3rem;height:.6rem;border:.125rem solid var(--x-background-a100);border-top:0;border-left:0;transform:rotate(40deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .3s;content:\" \"}.x-checkbox-label{margin-left:.325rem;-webkit-user-select:none;user-select:none}.x-checkbox-label-required:before{display:inline-block;margin-right:.25rem;color:var(--x-danger);line-height:1;font-size:var(--x-font-size-small);content:\"*\"}.x-checkbox-before:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-before{margin-right:var(--x-padding-medium)}.x-checkbox-before.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-checkbox-before.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-before.x-checkbox-button .x-checkbox-row-before,.x-checkbox-before.x-checkbox-icon .x-checkbox-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-before-template .x-checkbox-row-before{display:contents}.x-checkbox-before-template .x-checkbox-row-list{margin-left:var(--x-padding-medium)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list{margin-left:0}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-after{margin-left:var(--x-padding-medium)}.x-checkbox-after.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-checkbox-after.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after.x-checkbox-button .x-checkbox-row-after,.x-checkbox-after.x-checkbox-icon .x-checkbox-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-after-template .x-checkbox-row-after{display:contents}.x-checkbox-after-template .x-checkbox-row-list{margin-right:var(--x-padding-medium)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list{margin-right:0}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox.x-disabled .x-checkbox-item{color:var(--x-text-400);cursor:not-allowed}.x-checkbox.x-disabled .x-checkbox-item.x-indeterminate .x-checkbox-box:after{background-color:var(--x-text-400)}.x-checkbox.x-disabled .x-checkbox-item.x-checked .x-checkbox-box:after{background-color:transparent}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox.x-invalid>label,.x-checkbox.x-required>label{color:var(--x-danger)}.x-checkbox.x-direction-row>label{padding:0 .5rem 0 0}.x-checkbox.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-checkbox.x-direction-column,.x-checkbox.x-direction-column-reverse{align-items:inherit}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.XButtonComponent, selector: "x-button" }, { kind: "component", type: i3.XButtonsComponent, selector: "x-buttons" }, { kind: "directive", type: i4.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
201
|
+
/** @nocollapse */ XCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XCheckboxComponent, selector: "x-checkbox", providers: [XValueAccessor(XCheckboxComponent)], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkbox"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #checkbox\r\n class=\"x-checkbox\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [class.x-checkbox-button]=\"button\"\r\n [class.x-checkbox-icon]=\"icon\"\r\n [class.x-checkbox-after]=\"after\"\r\n [class.x-checkbox-before]=\"before\"\r\n [class.x-checkbox-after-template]=\"afterIsTemplate\"\r\n [class.x-checkbox-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-checkbox-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-checkbox-row\">\r\n <div class=\"x-checkbox-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-list\" [ngSwitch]=\"checkboxType\">\r\n <ng-container *ngSwitchCase=\"'initial'\">\r\n <div\r\n class=\"x-checkbox-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"getChecked(item.id)\"\r\n [class.x-disabled]=\"disabled || item.disabled\"\r\n [class.x-indeterminate]=\"indeterminate\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >\r\n <span class=\"x-checkbox-box\"></span>\r\n <span class=\"x-checkbox-label\">\r\n <ng-container *xOutlet=\"item.label; context: { $node: item }\">{{ item.label }}</ng-container>\r\n </span>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'button'\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tag'\">\r\n <x-tag\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n checked\r\n manual\r\n [type]=\"type\"\r\n [size]=\"size\"\r\n [bordered]=\"tagBordered\"\r\n [dark]=\"tagDark\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n [selected]=\"getChecked(item.id)\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n </ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #default> </ng-template>\r\n", styles: [".x-checkbox{margin:0;padding:0;width:100%}.x-checkbox.x-flex{display:flex}.x-checkbox.x-justify-start{justify-content:flex-start}.x-checkbox.x-justify-center{justify-content:center}.x-checkbox.x-justify-end{justify-content:flex-end}.x-checkbox.x-justify-space-between{justify-content:space-between}.x-checkbox.x-justify-space-around{justify-content:space-around}.x-checkbox.x-align-start{align-items:flex-start}.x-checkbox.x-align-center{align-items:center}.x-checkbox.x-align-end{align-items:flex-end}.x-checkbox.x-direction-column{flex-direction:column}.x-checkbox.x-direction-column-reverse{flex-direction:column-reverse}.x-checkbox.x-direction-row{flex-direction:row}.x-checkbox.x-direction-row-reverse{flex-direction:row-reverse}.x-checkbox>label{display:inline-block;white-space:nowrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem);position:relative;color:var(--x-text-300);font-weight:600}.x-checkbox>label.x-text-align-start{text-align:start}.x-checkbox>label.x-text-align-center{text-align:center}.x-checkbox>label.x-text-align-end{text-align:end}.x-checkbox-row{flex:1;display:flex;align-items:center;flex-wrap:wrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem)}.x-checkbox-row .x-checkbox-row-before,.x-checkbox-row .x-checkbox-row-after{border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background-a100);padding:0 var(--x-padding-medium);height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-checkbox-row-list{position:relative;display:inline-flex;align-items:center}.x-checkbox-row-list x-tag:not(:first-child){margin-left:.875rem}.x-checkbox-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:.875rem;font-size:.875rem;cursor:pointer;transition:all .3s}.x-checkbox-row-item:hover{color:var(--x-primary)}.x-checkbox-row-item:hover .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item:last-child{margin-right:0}.x-checkbox-row-item.x-indeterminate .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item.x-indeterminate .x-checkbox-box:after{top:50%;left:50%;width:.5rem;height:.5rem;background-color:var(--x-primary);border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:\" \"}.x-checkbox-row-item.x-checked .x-checkbox-box{border-color:var(--x-primary);background-color:var(--x-primary)}.x-checkbox-row-item.x-checked .x-checkbox-box:after{border:.125rem solid var(--x-background-100);border-top:0;border-left:0;top:.3875rem;left:.1875rem;width:.3125rem;height:.625rem;transform:rotate(40deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s;content:\" \"}.x-checkbox-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-checkbox-row-item.x-disabled .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox-row-item.x-disabled .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox-button .x-checkbox-row-before,.x-checkbox-icon .x-checkbox-row-before{margin-right:0}.x-checkbox-button .x-checkbox-row-after,.x-checkbox-icon .x-checkbox-row-after{margin-left:0}.x-checkbox-box{border:var(--x-border-width) solid var(--x-border);width:1rem;height:1rem;border-radius:.0625rem;background-color:var(--x-background-a100);position:relative;display:inline-block;box-sizing:border-box;transition:all .3s}.x-checkbox-box:hover{border-color:var(--x-primary)}.x-checkbox-box:after{position:absolute;top:.35rem;left:.175rem;display:inline-block;width:.3rem;height:.6rem;border:.125rem solid var(--x-background-a100);border-top:0;border-left:0;transform:rotate(40deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .3s;content:\" \"}.x-checkbox-label{margin-left:.325rem;-webkit-user-select:none;user-select:none}.x-checkbox-label-required:before{display:inline-block;margin-right:.25rem;color:var(--x-danger);line-height:1;font-size:var(--x-font-size-small);content:\"*\"}.x-checkbox-before:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-before{margin-right:var(--x-padding-medium)}.x-checkbox-before.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-checkbox-before.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-before.x-checkbox-button .x-checkbox-row-before,.x-checkbox-before.x-checkbox-icon .x-checkbox-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-before-template .x-checkbox-row-before{display:contents}.x-checkbox-before-template .x-checkbox-row-list{margin-left:var(--x-padding-medium)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list{margin-left:0}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-after{margin-left:var(--x-padding-medium)}.x-checkbox-after.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-checkbox-after.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after.x-checkbox-button .x-checkbox-row-after,.x-checkbox-after.x-checkbox-icon .x-checkbox-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-after-template .x-checkbox-row-after{display:contents}.x-checkbox-after-template .x-checkbox-row-list{margin-right:var(--x-padding-medium)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list{margin-right:0}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox.x-disabled .x-checkbox-item{color:var(--x-text-400);cursor:not-allowed}.x-checkbox.x-disabled .x-checkbox-item.x-indeterminate .x-checkbox-box:after{background-color:var(--x-text-400)}.x-checkbox.x-disabled .x-checkbox-item.x-checked .x-checkbox-box:after{background-color:transparent}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox.x-invalid>label,.x-checkbox.x-required>label{color:var(--x-danger)}.x-checkbox.x-direction-row>label{padding:0 .5rem 0 0}.x-checkbox.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-checkbox.x-direction-column,.x-checkbox.x-direction-column-reverse{align-items:inherit}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3.XButtonComponent, selector: "x-button" }, { kind: "component", type: i3.XButtonsComponent, selector: "x-buttons" }, { kind: "component", type: i4.XTagComponent, selector: "x-tag" }, { kind: "directive", type: i5.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
158
202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxComponent, decorators: [{
|
|
159
203
|
type: Component,
|
|
160
|
-
args: [{ selector: `${XCheckboxPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XCheckboxComponent)], template: "<div\r\n #checkbox\r\n class=\"x-checkbox\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [class.x-checkbox-button]=\"button\"\r\n [class.x-checkbox-icon]=\"icon\"\r\n [class.x-checkbox-after]=\"after\"\r\n [class.x-checkbox-before]=\"before\"\r\n [class.x-checkbox-after-template]=\"afterIsTemplate\"\r\n [class.x-checkbox-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-checkbox-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-checkbox-row\">\r\n <div class=\"x-checkbox-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-list\">\r\n <ng-container *ngIf=\"button || icon; else default\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #default>\r\n <div\r\n class=\"x-checkbox-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"getChecked(item.id)\"\r\n [class.x-disabled]=\"disabled || item.disabled\"\r\n [class.x-indeterminate]=\"indeterminate\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >\r\n <span class=\"x-checkbox-box\"></span>\r\n <span class=\"x-checkbox-label\">\r\n <ng-container *xOutlet=\"item.label; context: { $node: item }\">{{ item.label }}</ng-container>\r\n </span>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-checkbox{margin:0;padding:0;width:100%}.x-checkbox.x-flex{display:flex}.x-checkbox.x-justify-start{justify-content:flex-start}.x-checkbox.x-justify-center{justify-content:center}.x-checkbox.x-justify-end{justify-content:flex-end}.x-checkbox.x-justify-space-between{justify-content:space-between}.x-checkbox.x-justify-space-around{justify-content:space-around}.x-checkbox.x-align-start{align-items:flex-start}.x-checkbox.x-align-center{align-items:center}.x-checkbox.x-align-end{align-items:flex-end}.x-checkbox.x-direction-column{flex-direction:column}.x-checkbox.x-direction-column-reverse{flex-direction:column-reverse}.x-checkbox.x-direction-row{flex-direction:row}.x-checkbox.x-direction-row-reverse{flex-direction:row-reverse}.x-checkbox>label{display:inline-block;white-space:nowrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem);position:relative;color:var(--x-text-300);font-weight:600}.x-checkbox>label.x-text-align-start{text-align:start}.x-checkbox>label.x-text-align-center{text-align:center}.x-checkbox>label.x-text-align-end{text-align:end}.x-checkbox-row{flex:1;display:flex;align-items:center;flex-wrap:wrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem)}.x-checkbox-row .x-checkbox-row-before,.x-checkbox-row .x-checkbox-row-after{border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background-a100);padding:0 var(--x-padding-medium);height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-checkbox-row-list{position:relative;display:inline-flex;align-items:center}.x-checkbox-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:.875rem;font-size:.875rem;cursor:pointer;transition:all .3s}.x-checkbox-row-item:hover{color:var(--x-primary)}.x-checkbox-row-item:hover .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item:last-child{margin-right:0}.x-checkbox-row-item.x-indeterminate .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item.x-indeterminate .x-checkbox-box:after{top:50%;left:50%;width:.5rem;height:.5rem;background-color:var(--x-primary);border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:\" \"}.x-checkbox-row-item.x-checked .x-checkbox-box{border-color:var(--x-primary);background-color:var(--x-primary)}.x-checkbox-row-item.x-checked .x-checkbox-box:after{border:.125rem solid var(--x-background-100);border-top:0;border-left:0;top:.3875rem;left:.1875rem;width:.3125rem;height:.625rem;transform:rotate(40deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s;content:\" \"}.x-checkbox-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-checkbox-row-item.x-disabled .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox-row-item.x-disabled .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox-button .x-checkbox-row-before,.x-checkbox-icon .x-checkbox-row-before{margin-right:0}.x-checkbox-button .x-checkbox-row-after,.x-checkbox-icon .x-checkbox-row-after{margin-left:0}.x-checkbox-box{border:var(--x-border-width) solid var(--x-border);width:1rem;height:1rem;border-radius:.0625rem;background-color:var(--x-background-a100);position:relative;display:inline-block;box-sizing:border-box;transition:all .3s}.x-checkbox-box:hover{border-color:var(--x-primary)}.x-checkbox-box:after{position:absolute;top:.35rem;left:.175rem;display:inline-block;width:.3rem;height:.6rem;border:.125rem solid var(--x-background-a100);border-top:0;border-left:0;transform:rotate(40deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .3s;content:\" \"}.x-checkbox-label{margin-left:.325rem;-webkit-user-select:none;user-select:none}.x-checkbox-label-required:before{display:inline-block;margin-right:.25rem;color:var(--x-danger);line-height:1;font-size:var(--x-font-size-small);content:\"*\"}.x-checkbox-before:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-before{margin-right:var(--x-padding-medium)}.x-checkbox-before.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-checkbox-before.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-before.x-checkbox-button .x-checkbox-row-before,.x-checkbox-before.x-checkbox-icon .x-checkbox-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-before-template .x-checkbox-row-before{display:contents}.x-checkbox-before-template .x-checkbox-row-list{margin-left:var(--x-padding-medium)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list{margin-left:0}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-after{margin-left:var(--x-padding-medium)}.x-checkbox-after.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-checkbox-after.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after.x-checkbox-button .x-checkbox-row-after,.x-checkbox-after.x-checkbox-icon .x-checkbox-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-after-template .x-checkbox-row-after{display:contents}.x-checkbox-after-template .x-checkbox-row-list{margin-right:var(--x-padding-medium)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list{margin-right:0}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox.x-disabled .x-checkbox-item{color:var(--x-text-400);cursor:not-allowed}.x-checkbox.x-disabled .x-checkbox-item.x-indeterminate .x-checkbox-box:after{background-color:var(--x-text-400)}.x-checkbox.x-disabled .x-checkbox-item.x-checked .x-checkbox-box:after{background-color:transparent}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox.x-invalid>label,.x-checkbox.x-required>label{color:var(--x-danger)}.x-checkbox.x-direction-row>label{padding:0 .5rem 0 0}.x-checkbox.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-checkbox.x-direction-column,.x-checkbox.x-direction-column-reverse{align-items:inherit}\n"] }]
|
|
204
|
+
args: [{ selector: `${XCheckboxPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XCheckboxComponent)], template: "<div\r\n #checkbox\r\n class=\"x-checkbox\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [class.x-checkbox-button]=\"button\"\r\n [class.x-checkbox-icon]=\"icon\"\r\n [class.x-checkbox-after]=\"after\"\r\n [class.x-checkbox-before]=\"before\"\r\n [class.x-checkbox-after-template]=\"afterIsTemplate\"\r\n [class.x-checkbox-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-checkbox-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-checkbox-row\">\r\n <div class=\"x-checkbox-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-list\" [ngSwitch]=\"checkboxType\">\r\n <ng-container *ngSwitchCase=\"'initial'\">\r\n <div\r\n class=\"x-checkbox-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"getChecked(item.id)\"\r\n [class.x-disabled]=\"disabled || item.disabled\"\r\n [class.x-indeterminate]=\"indeterminate\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >\r\n <span class=\"x-checkbox-box\"></span>\r\n <span class=\"x-checkbox-label\">\r\n <ng-container *xOutlet=\"item.label; context: { $node: item }\">{{ item.label }}</ng-container>\r\n </span>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'button'\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tag'\">\r\n <x-tag\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n checked\r\n manual\r\n [type]=\"type\"\r\n [size]=\"size\"\r\n [bordered]=\"tagBordered\"\r\n [dark]=\"tagDark\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n [selected]=\"getChecked(item.id)\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n </ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #default> </ng-template>\r\n", styles: [".x-checkbox{margin:0;padding:0;width:100%}.x-checkbox.x-flex{display:flex}.x-checkbox.x-justify-start{justify-content:flex-start}.x-checkbox.x-justify-center{justify-content:center}.x-checkbox.x-justify-end{justify-content:flex-end}.x-checkbox.x-justify-space-between{justify-content:space-between}.x-checkbox.x-justify-space-around{justify-content:space-around}.x-checkbox.x-align-start{align-items:flex-start}.x-checkbox.x-align-center{align-items:center}.x-checkbox.x-align-end{align-items:flex-end}.x-checkbox.x-direction-column{flex-direction:column}.x-checkbox.x-direction-column-reverse{flex-direction:column-reverse}.x-checkbox.x-direction-row{flex-direction:row}.x-checkbox.x-direction-row-reverse{flex-direction:row-reverse}.x-checkbox>label{display:inline-block;white-space:nowrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem);position:relative;color:var(--x-text-300);font-weight:600}.x-checkbox>label.x-text-align-start{text-align:start}.x-checkbox>label.x-text-align-center{text-align:center}.x-checkbox>label.x-text-align-end{text-align:end}.x-checkbox-row{flex:1;display:flex;align-items:center;flex-wrap:wrap;height:calc(var(--x-font-size) + .875rem);line-height:calc(var(--x-font-size) + .875rem)}.x-checkbox-row .x-checkbox-row-before,.x-checkbox-row .x-checkbox-row-after{border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background-a100);padding:0 var(--x-padding-medium);height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-checkbox-row-list{position:relative;display:inline-flex;align-items:center}.x-checkbox-row-list x-tag:not(:first-child){margin-left:.875rem}.x-checkbox-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:.875rem;font-size:.875rem;cursor:pointer;transition:all .3s}.x-checkbox-row-item:hover{color:var(--x-primary)}.x-checkbox-row-item:hover .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item:last-child{margin-right:0}.x-checkbox-row-item.x-indeterminate .x-checkbox-box{border-color:var(--x-primary)}.x-checkbox-row-item.x-indeterminate .x-checkbox-box:after{top:50%;left:50%;width:.5rem;height:.5rem;background-color:var(--x-primary);border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:\" \"}.x-checkbox-row-item.x-checked .x-checkbox-box{border-color:var(--x-primary);background-color:var(--x-primary)}.x-checkbox-row-item.x-checked .x-checkbox-box:after{border:.125rem solid var(--x-background-100);border-top:0;border-left:0;top:.3875rem;left:.1875rem;width:.3125rem;height:.625rem;transform:rotate(40deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s;content:\" \"}.x-checkbox-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-checkbox-row-item.x-disabled .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox-row-item.x-disabled .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox-button .x-checkbox-row-before,.x-checkbox-icon .x-checkbox-row-before{margin-right:0}.x-checkbox-button .x-checkbox-row-after,.x-checkbox-icon .x-checkbox-row-after{margin-left:0}.x-checkbox-box{border:var(--x-border-width) solid var(--x-border);width:1rem;height:1rem;border-radius:.0625rem;background-color:var(--x-background-a100);position:relative;display:inline-block;box-sizing:border-box;transition:all .3s}.x-checkbox-box:hover{border-color:var(--x-primary)}.x-checkbox-box:after{position:absolute;top:.35rem;left:.175rem;display:inline-block;width:.3rem;height:.6rem;border:.125rem solid var(--x-background-a100);border-top:0;border-left:0;transform:rotate(40deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .3s;content:\" \"}.x-checkbox-label{margin-left:.325rem;-webkit-user-select:none;user-select:none}.x-checkbox-label-required:before{display:inline-block;margin-right:.25rem;color:var(--x-danger);line-height:1;font-size:var(--x-font-size-small);content:\"*\"}.x-checkbox-before:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-before{margin-right:var(--x-padding-medium)}.x-checkbox-before.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-checkbox-before.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-before.x-checkbox-button .x-checkbox-row-before,.x-checkbox-before.x-checkbox-icon .x-checkbox-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-before-template .x-checkbox-row-before{display:contents}.x-checkbox-before-template .x-checkbox-row-list{margin-left:var(--x-padding-medium)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list{margin-left:0}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input:focus,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:hover,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button:focus{z-index:1}.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-button .x-checkbox-row-before .x-button,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before input,.x-checkbox-before-template.x-checkbox-icon .x-checkbox-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after:not(.x-checkbox-before-template,.x-checkbox-button,.x-checkbox-icon) .x-checkbox-row-after{margin-left:var(--x-padding-medium)}.x-checkbox-after.x-checkbox-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-checkbox-after.x-checkbox-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-checkbox-after.x-checkbox-button .x-checkbox-row-after,.x-checkbox-after.x-checkbox-icon .x-checkbox-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox-after-template .x-checkbox-row-after{display:contents}.x-checkbox-after-template .x-checkbox-row-list{margin-right:var(--x-padding-medium)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list{margin-right:0}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-list .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-list .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input:focus,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:hover,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button:focus{z-index:1}.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-button .x-checkbox-row-after .x-button,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after input,.x-checkbox-after-template.x-checkbox-icon .x-checkbox-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-checkbox.x-disabled .x-checkbox-item{color:var(--x-text-400);cursor:not-allowed}.x-checkbox.x-disabled .x-checkbox-item.x-indeterminate .x-checkbox-box:after{background-color:var(--x-text-400)}.x-checkbox.x-disabled .x-checkbox-item.x-checked .x-checkbox-box:after{background-color:transparent}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-checkbox.x-disabled .x-checkbox-item .x-checkbox-box:after{border-color:var(--x-text-400);background-color:transparent}.x-checkbox.x-invalid>label,.x-checkbox.x-required>label{color:var(--x-danger)}.x-checkbox.x-direction-row>label{padding:0 .5rem 0 0}.x-checkbox.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-checkbox.x-direction-column,.x-checkbox.x-direction-column-reverse{align-items:inherit}\n"] }]
|
|
161
205
|
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.XConfigService }]; }, propDecorators: { checkbox: [{
|
|
162
206
|
type: ViewChild,
|
|
163
207
|
args: ['checkbox', { static: true }]
|
|
@@ -166,14 +210,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
166
210
|
class XCheckboxModule {
|
|
167
211
|
}
|
|
168
212
|
/** @nocollapse */ XCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
169
|
-
/** @nocollapse */ XCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxModule, declarations: [XCheckboxComponent, XCheckboxProperty], imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule], exports: [XCheckboxComponent] });
|
|
170
|
-
/** @nocollapse */ XCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxModule, imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule] });
|
|
213
|
+
/** @nocollapse */ XCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxModule, declarations: [XCheckboxComponent, XCheckboxProperty], imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule], exports: [XCheckboxComponent] });
|
|
214
|
+
/** @nocollapse */ XCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxModule, imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule] });
|
|
171
215
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XCheckboxModule, decorators: [{
|
|
172
216
|
type: NgModule,
|
|
173
217
|
args: [{
|
|
174
218
|
declarations: [XCheckboxComponent, XCheckboxProperty],
|
|
175
219
|
exports: [XCheckboxComponent],
|
|
176
|
-
imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule]
|
|
220
|
+
imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule]
|
|
177
221
|
}]
|
|
178
222
|
}] });
|
|
179
223
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui-checkbox.mjs","sources":["../../../../lib/ng-nest/ui/checkbox/checkbox.property.ts","../../../../lib/ng-nest/ui/checkbox/checkbox.component.ts","../../../../lib/ng-nest/ui/checkbox/checkbox.component.html","../../../../lib/ng-nest/ui/checkbox/checkbox.module.ts","../../../../lib/ng-nest/ui/checkbox/ng-nest-ui-checkbox.ts"],"sourcesContent":["import { XData, XTemplate, XIdentityProperty, XDataConvert, XInputBoolean, XSize, XBoolean, XWithConfig } from '@ng-nest/ui/core';\r\nimport { Input, Component } from '@angular/core';\r\nimport { XControlValueAccessor, XFormOption } from '@ng-nest/ui/base-form';\r\n\r\n/**\r\n * Checkbox\r\n * @selector x-checkbox\r\n * @decorator component\r\n */\r\nexport const XCheckboxPrefix = 'x-checkbox';\r\nconst X_CONFIG_NAME = 'checkbox';\r\n\r\n/**\r\n * Checkbox Property\r\n */\r\n@Component({ template: '' })\r\nexport class XCheckboxProperty extends XControlValueAccessor<boolean | Array<any>> implements XCheckboxOption {\r\n /**\r\n * @zh_CN 多选框数据\r\n * @en_US Checkbox data\r\n */\r\n @Input() @XDataConvert() data: XData<XCheckboxNode> = [];\r\n /**\r\n * @zh_CN 按钮样式\r\n * @en_US Button style\r\n */\r\n @Input() @XInputBoolean() button?: XBoolean;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n @Input() @XInputBoolean() icon?: XBoolean;\r\n /**\r\n * @zh_CN 不确定状态的样式\r\n * @en_US Uncertain state style\r\n */\r\n @Input() @XInputBoolean() indeterminate?: XBoolean;\r\n /**\r\n * @zh_CN 尺寸\r\n * @en_US Size\r\n */\r\n @Input() @XWithConfig<XSize>(X_CONFIG_NAME, 'medium') override size?: XSize;\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n @Input() override before!: XTemplate;\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n @Input() override after!: XTemplate;\r\n}\r\n\r\n/**\r\n * Checkbox Option\r\n * @undocument true\r\n */\r\nexport interface XCheckboxOption extends XFormOption {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n data?: XData<XCheckboxNode>;\r\n /**\r\n * @zh_CN 按钮样式\r\n * @en_US Button style\r\n */\r\n button?: XBoolean;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n icon?: XBoolean;\r\n /**\r\n * @zh_CN 不确定状态的样式\r\n * @en_US Uncertain state style\r\n */\r\n indeterminate?: XBoolean;\r\n /**\r\n * @zh_CN 尺寸\r\n * @en_US Size\r\n */\r\n size?: XSize;\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n before?: XTemplate;\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n after?: XTemplate;\r\n}\r\n\r\n/**\r\n * @zh_CN Checkbox 数据对象\r\n * @en_US Checkbox data object\r\n */\r\nexport interface XCheckboxNode extends XIdentityProperty {\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disable\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 图标\r\n * @en_US Icon\r\n */\r\n icon?: string;\r\n /**\r\n * @zh_CN 图标的提示信息\r\n * @en_US Icon message\r\n */\r\n title?: string;\r\n /**\r\n * @zh_CN 标签文字\r\n * @en_US Label text\r\n */\r\n label?: XTemplate;\r\n}\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n Renderer2,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n OnChanges,\r\n SimpleChanges,\r\n ViewChild,\r\n TemplateRef\r\n} from '@angular/core';\r\nimport { XCheckboxPrefix, XCheckboxNode, XCheckboxProperty } from './checkbox.property';\r\nimport { Subject } from 'rxjs';\r\nimport { XIsChange, XSetData, XClearClass, XConfigService, XBoolean, XJustify, XAlign, XDirection } from '@ng-nest/ui/core';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\n\r\n@Component({\r\n selector: `${XCheckboxPrefix}`,\r\n templateUrl: './checkbox.component.html',\r\n styleUrls: ['./checkbox.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XCheckboxComponent)]\r\n})\r\nexport class XCheckboxComponent extends XCheckboxProperty implements OnChanges {\r\n @ViewChild('checkbox', { static: true }) checkbox!: ElementRef<HTMLElement>;\r\n\r\n override writeValue(value: boolean | Array<any>) {\r\n this.value = value;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n get beforeIsTemplate() {\r\n return this.before instanceof TemplateRef;\r\n }\r\n\r\n get afterIsTemplate() {\r\n return this.after instanceof TemplateRef;\r\n }\r\n\r\n getDisabled(disabled?: boolean) {\r\n return (this.disabled || disabled) as XBoolean;\r\n }\r\n\r\n nodes: XCheckboxNode[] = [];\r\n single: boolean = false;\r\n private _unSubject = new Subject<void>();\r\n constructor(\r\n public renderer: Renderer2,\r\n public elementRef: ElementRef<HTMLElement>,\r\n public override cdr: ChangeDetectorRef,\r\n public configService: XConfigService\r\n ) {\r\n super();\r\n }\r\n\r\n ngOnInit() {\r\n this.setFlex(this.checkbox.nativeElement, this.renderer, this.justify as XJustify, this.align as XAlign, this.direction as XDirection);\r\n this.setClassMap();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n const { data } = changes;\r\n XIsChange(data) && this.setData();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unSubject.next();\r\n this._unSubject.unsubscribe();\r\n }\r\n\r\n setClassMap() {\r\n XClearClass(this.labelMap);\r\n this.labelMap[`x-text-align-${this.labelAlign}`] = this.labelAlign ? true : false;\r\n }\r\n\r\n checkboxClick(event: Event, node: XCheckboxNode) {\r\n event.preventDefault();\r\n if (this.disabled || node.disabled) return;\r\n this.formControlValidator();\r\n if (this.single) {\r\n this.value = !this.value;\r\n } else {\r\n this.value = (this.value as Array<any>) || [];\r\n let index = this.value.indexOf(node.id);\r\n if (index >= 0) {\r\n this.value.splice(index, 1);\r\n this.value = [...this.value];\r\n } else this.value = [...this.value, node.id];\r\n }\r\n this.cdr.detectChanges();\r\n if (this.onChange) this.onChange(this.value);\r\n }\r\n\r\n getChecked(id: any): boolean {\r\n if (this.single) return this.value as boolean;\r\n else return Array.isArray(this.value) && this.value.includes(id);\r\n }\r\n\r\n private setData() {\r\n XSetData<XCheckboxNode>(this.data, this._unSubject).subscribe((x) => {\r\n this.nodes = x;\r\n this.single = this.nodes.length === 1;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n trackByItem(_index: number, item: XCheckboxNode) {\r\n return item.id;\r\n }\r\n\r\n formControlChanges() {\r\n this.setData();\r\n this.ngOnInit();\r\n this.cdr.detectChanges();\r\n }\r\n}\r\n","<div\r\n #checkbox\r\n class=\"x-checkbox\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [class.x-checkbox-button]=\"button\"\r\n [class.x-checkbox-icon]=\"icon\"\r\n [class.x-checkbox-after]=\"after\"\r\n [class.x-checkbox-before]=\"before\"\r\n [class.x-checkbox-after-template]=\"afterIsTemplate\"\r\n [class.x-checkbox-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-checkbox-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-checkbox-row\">\r\n <div class=\"x-checkbox-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-list\">\r\n <ng-container *ngIf=\"button || icon; else default\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #default>\r\n <div\r\n class=\"x-checkbox-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"getChecked(item.id)\"\r\n [class.x-disabled]=\"disabled || item.disabled\"\r\n [class.x-indeterminate]=\"indeterminate\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >\r\n <span class=\"x-checkbox-box\"></span>\r\n <span class=\"x-checkbox-label\">\r\n <ng-container *xOutlet=\"item.label; context: { $node: item }\">{{ item.label }}</ng-container>\r\n </span>\r\n </div>\r\n</ng-template>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { XCheckboxComponent } from './checkbox.component';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonModule } from '@ng-nest/ui/button';\r\nimport { XOutletModule } from '@ng-nest/ui/outlet';\r\nimport { XCheckboxProperty } from './checkbox.property';\r\nimport { XBaseFormModule } from '@ng-nest/ui/base-form';\r\n\r\n@NgModule({\r\n declarations: [XCheckboxComponent, XCheckboxProperty],\r\n exports: [XCheckboxComponent],\r\n imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule]\r\n})\r\nexport class XCheckboxModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA;;;;AAIG;AACI,MAAM,eAAe,GAAG,aAAa;AAC5C,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC;;AAEG;AAEG,MAAO,iBAAkB,SAAQ,qBAA2C,CAAA;AADlF,IAAA,WAAA,GAAA;;AAEE;;;AAGG;AACsB,QAAA,IAAI,CAAA,IAAA,GAAyB,EAAE,CAAC;KA+B1D;;iIApCY,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,mBAAA,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,qNADP,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AAME,UAAA,CAAA;AAAf,IAAA,YAAY,EAAE;CAAiC,EAAA,iBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAK/B,UAAA,CAAA;AAAhB,IAAA,aAAa,EAAE;CAAmB,EAAA,iBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAKlB,UAAA,CAAA;AAAhB,IAAA,aAAa,EAAE;CAAiB,EAAA,iBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAKhB,UAAA,CAAA;AAAhB,IAAA,aAAa,EAAE;CAA0B,EAAA,iBAAA,CAAA,SAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAKG,UAAA,CAAA;AAA5C,IAAA,WAAW,CAAQ,aAAa,EAAE,QAAQ,CAAC;CAAuB,EAAA,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BAAkB,CAAA,EAAA,CAAA,CAAA;gIAGjB,eAAe,EAAA,OAAA,EAAA,CAFhB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA;2FAEvE,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;oBACrD,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,CAAC;iBACpF,CAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-checkbox.mjs","sources":["../../../../lib/ng-nest/ui/checkbox/checkbox.property.ts","../../../../lib/ng-nest/ui/checkbox/checkbox.component.ts","../../../../lib/ng-nest/ui/checkbox/checkbox.component.html","../../../../lib/ng-nest/ui/checkbox/checkbox.module.ts","../../../../lib/ng-nest/ui/checkbox/ng-nest-ui-checkbox.ts"],"sourcesContent":["import { XData, XTemplate, XIdentityProperty, XDataConvert, XInputBoolean, XSize, XBoolean, XWithConfig } from '@ng-nest/ui/core';\r\nimport { Input, Component } from '@angular/core';\r\nimport { XButtonType } from '@ng-nest/ui/button';\r\nimport { XControlValueAccessor, XFormOption } from '@ng-nest/ui/base-form';\r\n\r\n/**\r\n * Checkbox\r\n * @selector x-checkbox\r\n * @decorator component\r\n */\r\nexport const XCheckboxPrefix = 'x-checkbox';\r\nconst X_CONFIG_NAME = 'checkbox';\r\n\r\n/**\r\n * Checkbox Property\r\n */\r\n@Component({ template: '' })\r\nexport class XCheckboxProperty extends XControlValueAccessor<boolean | Array<any>> implements XCheckboxOption {\r\n /**\r\n * @zh_CN 多选框数据\r\n * @en_US Checkbox data\r\n */\r\n @Input() @XDataConvert() data: XData<XCheckboxNode> = [];\r\n /**\r\n * @zh_CN 按钮样式\r\n * @en_US Button style\r\n */\r\n @Input() @XInputBoolean() button?: XBoolean;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n @Input() @XInputBoolean() icon?: XBoolean;\r\n /**\r\n * @zh_CN tag 标签样式\r\n * @en_US Tag style\r\n */\r\n @Input() @XInputBoolean() tag?: XBoolean;\r\n /**\r\n * @zh_CN 不确定状态的样式\r\n * @en_US Uncertain state style\r\n */\r\n @Input() @XInputBoolean() indeterminate?: XBoolean;\r\n /**\r\n * @zh_CN 尺寸\r\n * @en_US Size\r\n */\r\n @Input() @XWithConfig<XSize>(X_CONFIG_NAME, 'medium') override size?: XSize;\r\n /**\r\n * @zh_CN 按钮/图标/ tag 标签样式时生效\r\n * @en_US Take effect when button style\r\n */\r\n @Input() type: XButtonType = 'initial';\r\n /**\r\n * @zh_CN tag 标签边框\r\n * @en_US Tag bordered\r\n */\r\n @Input() tagBordered: XBoolean = true;\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n @Input() tagDark: XBoolean = false;\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n @Input() override before!: XTemplate;\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n @Input() override after!: XTemplate;\r\n}\r\n\r\n/**\r\n * Checkbox Option\r\n * @undocument true\r\n */\r\nexport interface XCheckboxOption extends XFormOption {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n data?: XData<XCheckboxNode>;\r\n /**\r\n * @zh_CN 按钮样式\r\n * @en_US Button style\r\n */\r\n button?: XBoolean;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n icon?: XBoolean;\r\n /**\r\n * @zh_CN tag 标签样式\r\n * @en_US Tag style\r\n */\r\n tag?: XBoolean;\r\n /**\r\n * @zh_CN 不确定状态的样式\r\n * @en_US Uncertain state style\r\n */\r\n indeterminate?: XBoolean;\r\n /**\r\n * @zh_CN 尺寸\r\n * @en_US Size\r\n */\r\n size?: XSize;\r\n /**\r\n * @zh_CN 按钮/图标/ tag 标签样式时生效\r\n * @en_US Take effect when button style\r\n */\r\n type?: XButtonType;\r\n /**\r\n * @zh_CN tag 标签边框\r\n * @en_US Tag bordered\r\n */\r\n tagBordered?: XBoolean;\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n tagDark?: XBoolean;\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n before?: XTemplate;\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n after?: XTemplate;\r\n}\r\n\r\n/**\r\n * @zh_CN Checkbox 数据对象\r\n * @en_US Checkbox data object\r\n */\r\nexport interface XCheckboxNode extends XIdentityProperty {\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disable\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 图标\r\n * @en_US Icon\r\n */\r\n icon?: string;\r\n /**\r\n * @zh_CN 图标的提示信息\r\n * @en_US Icon message\r\n */\r\n title?: string;\r\n /**\r\n * @zh_CN 标签文字\r\n * @en_US Label text\r\n */\r\n label?: XTemplate;\r\n}\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n Renderer2,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n OnChanges,\r\n SimpleChanges,\r\n ViewChild,\r\n TemplateRef\r\n} from '@angular/core';\r\nimport { XCheckboxPrefix, XCheckboxNode, XCheckboxProperty } from './checkbox.property';\r\nimport { Subject } from 'rxjs';\r\nimport { XIsChange, XSetData, XClearClass, XConfigService, XBoolean, XJustify, XAlign, XDirection } from '@ng-nest/ui/core';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\n\r\n@Component({\r\n selector: `${XCheckboxPrefix}`,\r\n templateUrl: './checkbox.component.html',\r\n styleUrls: ['./checkbox.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XCheckboxComponent)]\r\n})\r\nexport class XCheckboxComponent extends XCheckboxProperty implements OnChanges {\r\n @ViewChild('checkbox', { static: true }) checkbox!: ElementRef<HTMLElement>;\r\n checkboxType!: 'initial' | 'button' | 'icon' | 'tag';\r\n\r\n override writeValue(value: boolean | Array<any>) {\r\n this.value = value;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n get beforeIsTemplate() {\r\n return this.before instanceof TemplateRef;\r\n }\r\n\r\n get afterIsTemplate() {\r\n return this.after instanceof TemplateRef;\r\n }\r\n\r\n getDisabled(disabled?: boolean) {\r\n return (this.disabled || disabled) as XBoolean;\r\n }\r\n\r\n nodes: XCheckboxNode[] = [];\r\n single: boolean = false;\r\n private _unSubject = new Subject<void>();\r\n constructor(\r\n public renderer: Renderer2,\r\n public elementRef: ElementRef<HTMLElement>,\r\n public override cdr: ChangeDetectorRef,\r\n public configService: XConfigService\r\n ) {\r\n super();\r\n }\r\n\r\n ngOnInit() {\r\n this.setFlex(this.checkbox.nativeElement, this.renderer, this.justify as XJustify, this.align as XAlign, this.direction as XDirection);\r\n this.setClassMap();\r\n this.setCheckboxType();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n const { data } = changes;\r\n XIsChange(data) && this.setData();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._unSubject.next();\r\n this._unSubject.unsubscribe();\r\n }\r\n\r\n setClassMap() {\r\n XClearClass(this.labelMap);\r\n this.labelMap[`x-text-align-${this.labelAlign}`] = this.labelAlign ? true : false;\r\n }\r\n\r\n setCheckboxType() {\r\n if (this.button) {\r\n this.checkboxType = 'button';\r\n } else if (this.icon) {\r\n this.checkboxType = 'icon';\r\n } else if (this.tag) {\r\n this.checkboxType = 'tag';\r\n } else {\r\n this.checkboxType = 'initial';\r\n }\r\n this.cdr.detectChanges();\r\n }\r\n\r\n checkboxClick(event: Event, node: XCheckboxNode) {\r\n event.preventDefault();\r\n if (this.disabled || node.disabled) return;\r\n this.formControlValidator();\r\n if (this.single) {\r\n this.value = !this.value;\r\n } else {\r\n this.value = (this.value as Array<any>) || [];\r\n let index = this.value.indexOf(node.id);\r\n if (index >= 0) {\r\n this.value.splice(index, 1);\r\n this.value = [...this.value];\r\n } else this.value = [...this.value, node.id];\r\n }\r\n this.cdr.detectChanges();\r\n if (this.onChange) this.onChange(this.value);\r\n }\r\n\r\n getChecked(id: any): boolean {\r\n if (this.single) return this.value as boolean;\r\n else return Array.isArray(this.value) && this.value.includes(id);\r\n }\r\n\r\n private setData() {\r\n XSetData<XCheckboxNode>(this.data, this._unSubject).subscribe((x) => {\r\n this.nodes = x;\r\n this.single = this.nodes.length === 1;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n trackByItem(_index: number, item: XCheckboxNode) {\r\n return item.id;\r\n }\r\n\r\n formControlChanges() {\r\n this.setData();\r\n this.ngOnInit();\r\n this.cdr.detectChanges();\r\n }\r\n}\r\n","<div\r\n #checkbox\r\n class=\"x-checkbox\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [class.x-checkbox-button]=\"button\"\r\n [class.x-checkbox-icon]=\"icon\"\r\n [class.x-checkbox-after]=\"after\"\r\n [class.x-checkbox-before]=\"before\"\r\n [class.x-checkbox-after-template]=\"afterIsTemplate\"\r\n [class.x-checkbox-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-checkbox-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-checkbox-row\">\r\n <div class=\"x-checkbox-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-list\" [ngSwitch]=\"checkboxType\">\r\n <ng-container *ngSwitchCase=\"'initial'\">\r\n <div\r\n class=\"x-checkbox-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"getChecked(item.id)\"\r\n [class.x-disabled]=\"disabled || item.disabled\"\r\n [class.x-indeterminate]=\"indeterminate\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >\r\n <span class=\"x-checkbox-box\"></span>\r\n <span class=\"x-checkbox-label\">\r\n <ng-container *xOutlet=\"item.label; context: { $node: item }\">{{ item.label }}</ng-container>\r\n </span>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'button'\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <x-buttons>\r\n <x-button\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [icon]=\"item.icon\"\r\n [title]=\"item.title\"\r\n [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"getChecked(item.id)\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n attrType=\"button\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-button\r\n >\r\n </x-buttons>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'tag'\">\r\n <x-tag\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n checked\r\n manual\r\n [type]=\"type\"\r\n [size]=\"size\"\r\n [bordered]=\"tagBordered\"\r\n [dark]=\"tagDark\"\r\n [disabled]=\"getDisabled(item.disabled)\"\r\n [selected]=\"getChecked(item.id)\"\r\n (click)=\"checkboxClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n </ng-container>\r\n </div>\r\n <div class=\"x-checkbox-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #default> </ng-template>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { XCheckboxComponent } from './checkbox.component';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonModule } from '@ng-nest/ui/button';\r\nimport { XOutletModule } from '@ng-nest/ui/outlet';\r\nimport { XCheckboxProperty } from './checkbox.property';\r\nimport { XBaseFormModule } from '@ng-nest/ui/base-form';\r\nimport { XTagModule } from '@ng-nest/ui/tag';\r\n\r\n@NgModule({\r\n declarations: [XCheckboxComponent, XCheckboxProperty],\r\n exports: [XCheckboxComponent],\r\n imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule]\r\n})\r\nexport class XCheckboxModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKA;;;;AAIG;AACI,MAAM,eAAe,GAAG,aAAa;AAC5C,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC;;AAEG;AAEG,MAAO,iBAAkB,SAAQ,qBAA2C,CAAA;AADlF,IAAA,WAAA,GAAA;;AAEE;;;AAGG;AACsB,QAAA,IAAI,CAAA,IAAA,GAAyB,EAAE,CAAC;AA0BzD;;;AAGG;AACM,QAAA,IAAI,CAAA,IAAA,GAAgB,SAAS,CAAC;AACvC;;;AAGG;AACM,QAAA,IAAW,CAAA,WAAA,GAAa,IAAI,CAAC;AACtC;;;AAGG;AACM,QAAA,IAAO,CAAA,OAAA,GAAa,KAAK,CAAC;KAWpC;;iIAxDY,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAA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}
|
|
735
|
+
function XDateYearQuarter(date) {
|
|
736
|
+
let dt = XToDate(date);
|
|
737
|
+
if (!isNaN(dt.valueOf())) {
|
|
738
|
+
return `${dt.getFullYear()}-${XDateQuarter(dt)}`;
|
|
739
|
+
}
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
function XDateQuarter(date) {
|
|
743
|
+
let dt = XToDate(date);
|
|
744
|
+
if (!isNaN(dt.valueOf())) {
|
|
745
|
+
return `Q${Math.ceil((dt.getMonth() + 1) / 3)}`;
|
|
746
|
+
}
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
735
749
|
function getISOWeek(date) {
|
|
736
750
|
const diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime();
|
|
737
751
|
return Math.round(diff / 604800000) + 1;
|
|
@@ -1581,5 +1595,5 @@ function XWithConfig(componentName, innerDefaultValue) {
|
|
|
1581
1595
|
* Generated bundle index. Do not edit.
|
|
1582
1596
|
*/
|
|
1583
1597
|
|
|
1584
|
-
export { XAddDays, XAddHours, XAddMilliseconds, XAddMinutes, XAddMonths, XAddSeconds, XAddYears, XBadgeAnimation, XBadgeStandaloneAnimation, XBaseAnimation, XChunk, XClamp, XClearClass, XCloneDeep, XConfigService, XConnectAnimation, XConnectBaseAnimation, XDataConvert, XDateWeek, XDateWeekYear, XDateYearWeek, XDrop, XDropAnimation, XDuration, XFadeAnimation, XGetChildren, XGroupBy, XGuid, XHasIn, XHttpService, XIdentity, XInputBoolean, XInputNumber, XInvertKeyValues, XIsArray, XIsBoolean, XIsChange, XIsDate, XIsEmpty, XIsFunction, XIsNull, XIsNumber, XIsObject, XIsObjectArray, XIsObservable, XIsRegExp, XIsString, XIsTemplateRef, XIsType, XIsUndefined, XIsValue, XIsValueArray, XIsXTemplate, XMoveAnimation, XMoveBoxAnimation, XOpacityAnimation, XOrderBy, XParentPath, XPreloadingStrategyService, XProperty, XRemove, XRepositoryAbstract, XRepositoryService, XResize, XReuseStrategyService, XSetData, XSetFlex, XSlideAnimation, XSliderAnimation, XStorageService, XThemeService, XToBoolean, XToDataConvert, XToDate, XWithConfig, X_CONFIG, X_THEME, X_THEME_AMOUNTS, X_THEME_BACKGROUNDS, X_THEME_BLACK_MERGE, X_THEME_BORDERS, X_THEME_COLORS, X_THEME_COLOR_KEYS, X_THEME_DARK_COLORS, X_THEME_EXCHANGES, X_THEME_MERGE, X_THEME_PREFIX, X_THEME_TEXTS, computedStyle, fillDefault, isNil, isNotNil, mixColors, removeNgTag, reqAnimFrame, stripTags, toHex, toRgb, warnIconTypeNotFound, warnSVGTagNotFound };
|
|
1598
|
+
export { XAddDays, XAddHours, XAddMilliseconds, XAddMinutes, XAddMonths, XAddSeconds, XAddYears, XBadgeAnimation, XBadgeStandaloneAnimation, XBaseAnimation, XChunk, XClamp, XClearClass, XCloneDeep, XConfigService, XConnectAnimation, XConnectBaseAnimation, XDataConvert, XDateQuarter, XDateWeek, XDateWeekYear, XDateYearQuarter, XDateYearWeek, XDrop, XDropAnimation, XDuration, XFadeAnimation, XGetChildren, XGroupBy, XGuid, XHasIn, XHttpService, XIdentity, XInputBoolean, XInputNumber, XInvertKeyValues, XIsArray, XIsBoolean, XIsChange, XIsDate, XIsEmpty, XIsFunction, XIsNull, XIsNumber, XIsObject, XIsObjectArray, XIsObservable, XIsRegExp, XIsString, XIsTemplateRef, XIsType, XIsUndefined, XIsValue, XIsValueArray, XIsXTemplate, XMoveAnimation, XMoveBoxAnimation, XOpacityAnimation, XOrderBy, XParentPath, XPreloadingStrategyService, XProperty, XRemove, XRepositoryAbstract, XRepositoryService, XResize, XReuseStrategyService, XSetData, XSetFlex, XSlideAnimation, XSliderAnimation, XStorageService, XThemeService, XToBoolean, XToDataConvert, XToDate, XWithConfig, X_CONFIG, X_THEME, X_THEME_AMOUNTS, X_THEME_BACKGROUNDS, X_THEME_BLACK_MERGE, X_THEME_BORDERS, X_THEME_COLORS, X_THEME_COLOR_KEYS, X_THEME_DARK_COLORS, X_THEME_EXCHANGES, X_THEME_MERGE, X_THEME_PREFIX, X_THEME_TEXTS, computedStyle, fillDefault, isNil, isNotNil, mixColors, removeNgTag, reqAnimFrame, stripTags, toHex, toRgb, warnIconTypeNotFound, warnSVGTagNotFound };
|
|
1585
1599
|
//# sourceMappingURL=ng-nest-ui-core.mjs.map
|