@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.
Files changed (75) hide show
  1. package/checkbox/checkbox.component.d.ts +2 -0
  2. package/checkbox/checkbox.module.d.ts +4 -3
  3. package/checkbox/checkbox.property.d.ts +42 -1
  4. package/core/functions/date.d.ts +2 -0
  5. package/date-picker/date-picker-portal.component.d.ts +1 -0
  6. package/date-picker/date-picker.module.d.ts +18 -16
  7. package/date-picker/date-picker.property.d.ts +120 -1
  8. package/date-picker/date-quarter.pipe.d.ts +9 -0
  9. package/date-picker/picker-date.component.d.ts +1 -0
  10. package/date-picker/picker-quarter.component.d.ts +45 -0
  11. package/date-picker/public-api.d.ts +2 -0
  12. package/esm2020/checkbox/checkbox.component.mjs +21 -4
  13. package/esm2020/checkbox/checkbox.module.mjs +5 -4
  14. package/esm2020/checkbox/checkbox.property.mjs +28 -2
  15. package/esm2020/core/functions/date.mjs +15 -1
  16. package/esm2020/date-picker/date-picker-portal.component.mjs +16 -4
  17. package/esm2020/date-picker/date-picker.component.mjs +12 -3
  18. package/esm2020/date-picker/date-picker.module.mjs +18 -6
  19. package/esm2020/date-picker/date-picker.property.mjs +154 -1
  20. package/esm2020/date-picker/date-quarter.pipe.mjs +19 -0
  21. package/esm2020/date-picker/date-range-portal.component.mjs +7 -6
  22. package/esm2020/date-picker/date-range.component.mjs +28 -4
  23. package/esm2020/date-picker/picker-date.component.mjs +6 -3
  24. package/esm2020/date-picker/picker-quarter.component.mjs +237 -0
  25. package/esm2020/date-picker/public-api.mjs +3 -1
  26. package/esm2020/i18n/i18n.property.mjs +1 -1
  27. package/esm2020/i18n/languages/en_GB.mjs +4 -1
  28. package/esm2020/i18n/languages/en_US.mjs +4 -1
  29. package/esm2020/i18n/languages/zh_CN.mjs +4 -1
  30. package/esm2020/i18n/languages/zh_TW.mjs +4 -1
  31. package/esm2020/radio/radio.component.mjs +28 -6
  32. package/esm2020/radio/radio.module.mjs +5 -4
  33. package/esm2020/radio/radio.property.mjs +28 -3
  34. package/esm2020/tag/tag.component.mjs +4 -4
  35. package/esm2020/tag/tag.property.mjs +22 -2
  36. package/esm2020/tree/tree.component.mjs +47 -59
  37. package/fesm2015/ng-nest-ui-checkbox.mjs +51 -7
  38. package/fesm2015/ng-nest-ui-checkbox.mjs.map +1 -1
  39. package/fesm2015/ng-nest-ui-core.mjs +15 -1
  40. package/fesm2015/ng-nest-ui-core.mjs.map +1 -1
  41. package/fesm2015/ng-nest-ui-date-picker.mjs +468 -18
  42. package/fesm2015/ng-nest-ui-date-picker.mjs.map +1 -1
  43. package/fesm2015/ng-nest-ui-i18n.mjs +12 -0
  44. package/fesm2015/ng-nest-ui-i18n.mjs.map +1 -1
  45. package/fesm2015/ng-nest-ui-radio.mjs +58 -10
  46. package/fesm2015/ng-nest-ui-radio.mjs.map +1 -1
  47. package/fesm2015/ng-nest-ui-tag.mjs +24 -4
  48. package/fesm2015/ng-nest-ui-tag.mjs.map +1 -1
  49. package/fesm2015/ng-nest-ui-tree.mjs +45 -57
  50. package/fesm2015/ng-nest-ui-tree.mjs.map +1 -1
  51. package/fesm2020/ng-nest-ui-checkbox.mjs +51 -7
  52. package/fesm2020/ng-nest-ui-checkbox.mjs.map +1 -1
  53. package/fesm2020/ng-nest-ui-core.mjs +15 -1
  54. package/fesm2020/ng-nest-ui-core.mjs.map +1 -1
  55. package/fesm2020/ng-nest-ui-date-picker.mjs +467 -18
  56. package/fesm2020/ng-nest-ui-date-picker.mjs.map +1 -1
  57. package/fesm2020/ng-nest-ui-i18n.mjs +12 -0
  58. package/fesm2020/ng-nest-ui-i18n.mjs.map +1 -1
  59. package/fesm2020/ng-nest-ui-radio.mjs +58 -10
  60. package/fesm2020/ng-nest-ui-radio.mjs.map +1 -1
  61. package/fesm2020/ng-nest-ui-tag.mjs +24 -4
  62. package/fesm2020/ng-nest-ui-tag.mjs.map +1 -1
  63. package/fesm2020/ng-nest-ui-tree.mjs +45 -57
  64. package/fesm2020/ng-nest-ui-tree.mjs.map +1 -1
  65. package/i18n/i18n.property.d.ts +3 -0
  66. package/i18n/languages/en_GB.d.ts +3 -0
  67. package/i18n/languages/en_US.d.ts +3 -0
  68. package/i18n/languages/zh_CN.d.ts +3 -0
  69. package/i18n/languages/zh_TW.d.ts +3 -0
  70. package/package.json +1 -1
  71. package/radio/radio.component.d.ts +2 -0
  72. package/radio/radio.module.d.ts +4 -3
  73. package/radio/radio.property.d.ts +38 -3
  74. package/tag/tag.property.d.ts +8 -3
  75. 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/outlet';
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
 
@@ -32,14 +34,19 @@ class XRadioProperty extends XControlValueAccessor {
32
34
  */
33
35
  this.data = [];
34
36
  /**
35
- * @zh_CN 按钮样式时生效
37
+ * @zh_CN 按钮/图标/ tag 标签样式时生效
36
38
  * @en_US Take effect when button style
37
39
  */
38
40
  this.type = 'initial';
41
+ /**
42
+ * @zh_CN tag 标签边框
43
+ * @en_US Tag bordered
44
+ */
45
+ this.tagBordered = true;
39
46
  }
40
47
  }
41
48
  /** @nocollapse */ XRadioProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
42
- /** @nocollapse */ XRadioProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XRadioProperty, selector: "ng-component", inputs: { data: "data", button: "button", icon: "icon", size: "size", type: "type", before: "before", after: "after" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
49
+ /** @nocollapse */ XRadioProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XRadioProperty, selector: "ng-component", inputs: { data: "data", button: "button", icon: "icon", tag: "tag", size: "size", type: "type", tagBordered: "tagBordered", tagDark: "tagDark", allowCancel: "allowCancel", before: "before", after: "after" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
43
50
  __decorate([
44
51
  XDataConvert()
45
52
  ], XRadioProperty.prototype, "data", void 0);
@@ -49,9 +56,21 @@ __decorate([
49
56
  __decorate([
50
57
  XInputBoolean()
51
58
  ], XRadioProperty.prototype, "icon", void 0);
59
+ __decorate([
60
+ XInputBoolean()
61
+ ], XRadioProperty.prototype, "tag", void 0);
52
62
  __decorate([
53
63
  XWithConfig(X_CONFIG_NAME, 'medium')
54
64
  ], XRadioProperty.prototype, "size", void 0);
65
+ __decorate([
66
+ XInputBoolean()
67
+ ], XRadioProperty.prototype, "tagBordered", void 0);
68
+ __decorate([
69
+ XInputBoolean()
70
+ ], XRadioProperty.prototype, "tagDark", void 0);
71
+ __decorate([
72
+ XInputBoolean()
73
+ ], XRadioProperty.prototype, "allowCancel", void 0);
55
74
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioProperty, decorators: [{
56
75
  type: Component,
57
76
  args: [{ template: '' }]
@@ -61,10 +80,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
61
80
  type: Input
62
81
  }], icon: [{
63
82
  type: Input
83
+ }], tag: [{
84
+ type: Input
64
85
  }], size: [{
65
86
  type: Input
66
87
  }], type: [{
67
88
  type: Input
89
+ }], tagBordered: [{
90
+ type: Input
91
+ }], tagDark: [{
92
+ type: Input
93
+ }], allowCancel: [{
94
+ type: Input
68
95
  }], before: [{
69
96
  type: Input
70
97
  }], after: [{
@@ -90,6 +117,7 @@ class XRadioComponent extends XRadioProperty {
90
117
  ngOnInit() {
91
118
  this.setFlex(this.radio.nativeElement, this.renderer, this.justify, this.align, this.direction);
92
119
  this.setClassMap();
120
+ this.setRadioType();
93
121
  }
94
122
  ngOnChanges(changes) {
95
123
  const { data } = changes;
@@ -107,12 +135,32 @@ class XRadioComponent extends XRadioProperty {
107
135
  XClearClass(this.labelMap);
108
136
  this.labelMap[`x-text-align-${this.labelAlign}`] = this.labelAlign ? true : false;
109
137
  }
138
+ setRadioType() {
139
+ if (this.button) {
140
+ this.radioType = 'button';
141
+ }
142
+ else if (this.icon) {
143
+ this.radioType = 'icon';
144
+ }
145
+ else if (this.tag) {
146
+ this.radioType = 'tag';
147
+ }
148
+ else {
149
+ this.radioType = 'initial';
150
+ }
151
+ this.cdr.detectChanges();
152
+ }
110
153
  radioClick(event, node) {
111
154
  event.preventDefault();
112
- if (this.disabled || node.disabled || node.id === this.value)
155
+ if (this.disabled || node.disabled || (!this.allowCancel && node.id === this.value))
113
156
  return;
114
157
  this.formControlValidator();
115
- this.value = node.id;
158
+ if (this.allowCancel && node.id === this.value) {
159
+ this.value = null;
160
+ }
161
+ else {
162
+ this.value = node.id;
163
+ }
116
164
  this.cdr.detectChanges();
117
165
  if (this.onChange)
118
166
  this.onChange(this.value);
@@ -133,10 +181,10 @@ class XRadioComponent extends XRadioProperty {
133
181
  }
134
182
  }
135
183
  /** @nocollapse */ XRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
136
- /** @nocollapse */ XRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XRadioComponent, selector: "x-radio", providers: [XValueAccessor(XRadioComponent)], viewQueries: [{ propertyName: "radio", first: true, predicate: ["radio"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #radio\r\n class=\"x-radio\"\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-radio-button]=\"button\"\r\n [class.x-radio-icon]=\"icon\"\r\n [class.x-radio-after]=\"after\"\r\n [class.x-radio-before]=\"before\"\r\n [class.x-radio-after-template]=\"afterIsTemplate\"\r\n [class.x-radio-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-radio-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-radio-row\">\r\n <div class=\"x-radio-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-radio-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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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-radio-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-radio-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"item.id === value\"\r\n [class.x-disabled]=\"item.disabled\"\r\n (click)=\"radioClick($event, item)\"\r\n >\r\n <span class=\"x-radio-box\"></span>\r\n <span class=\"x-radio-label\">{{ item.label }}</span>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-radio{margin:0;padding:0;width:100%}.x-radio.x-flex{display:flex}.x-radio.x-justify-start{justify-content:flex-start}.x-radio.x-justify-center{justify-content:center}.x-radio.x-justify-end{justify-content:flex-end}.x-radio.x-justify-space-between{justify-content:space-between}.x-radio.x-justify-space-around{justify-content:space-around}.x-radio.x-align-start{align-items:flex-start}.x-radio.x-align-center{align-items:center}.x-radio.x-align-end{align-items:flex-end}.x-radio.x-direction-column{flex-direction:column}.x-radio.x-direction-column-reverse{flex-direction:column-reverse}.x-radio.x-direction-row{flex-direction:row}.x-radio.x-direction-row-reverse{flex-direction:row-reverse}.x-radio>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-radio>label.x-text-align-start{text-align:start}.x-radio>label.x-text-align-center{text-align:center}.x-radio>label.x-text-align-end{text-align:end}.x-radio-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-radio-row .x-radio-row-before,.x-radio-row .x-radio-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-radio-row-list{position:relative;display:inline-flex;align-items:center}.x-radio-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-radio-row-item:hover{color:var(--x-primary)}.x-radio-row-item:hover .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item:last-child{margin-right:0}.x-radio-row-item.x-checked .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item.x-checked .x-radio-box:after{transform:scale(1);opacity:1}.x-radio-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-radio-row-item.x-disabled .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio-row-item.x-disabled .x-radio-box:after{background-color:var(--x-text-400)}.x-radio-button .x-radio-row-before,.x-radio-icon .x-radio-row-before{margin-right:0}.x-radio-button .x-radio-row-after,.x-radio-icon .x-radio-row-after{margin-left:0}.x-radio-box{border:.0625rem solid var(--x-border);border-radius:100%;width:1rem;height:1rem;background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .3s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.x-radio-box:after{position:absolute;display:inline-block;width:.5rem;height:.5rem;background-color:var(--x-primary);border-radius:1rem;transform:scale(0);opacity:0;transition:all .3s cubic-bezier(.78,.14,.15,.86);content:\" \"}.x-radio-label{margin-left:.325rem}.x-radio-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-radio-before:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-before{margin-right:var(--x-padding-medium)}.x-radio-before.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-radio-before.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-before.x-radio-button .x-radio-row-before,.x-radio-before.x-radio-icon .x-radio-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-before-template .x-radio-row-before{display:contents}.x-radio-before-template .x-radio-row-list{margin-left:var(--x-padding-medium)}.x-radio-before-template.x-radio-button .x-radio-row-list,.x-radio-before-template.x-radio-icon .x-radio-row-list{margin-left:0}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input:hover,.x-radio-before-template.x-radio-button .x-radio-row-before input:focus,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before input:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before input:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-before input,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-after{margin-left:var(--x-padding-medium)}.x-radio-after.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-radio-after.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after.x-radio-button .x-radio-row-after,.x-radio-after.x-radio-icon .x-radio-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-after-template .x-radio-row-after{display:contents}.x-radio-after-template .x-radio-row-list{margin-right:var(--x-padding-medium)}.x-radio-after-template.x-radio-button .x-radio-row-list,.x-radio-after-template.x-radio-icon .x-radio-row-list{margin-right:0}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input:hover,.x-radio-after-template.x-radio-button .x-radio-row-after input:focus,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after input:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after input:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-after input,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio.x-disabled .x-radio-item{color:var(--x-text-400);cursor:not-allowed}.x-radio.x-disabled .x-radio-item .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio.x-disabled .x-radio-item .x-radio-box:after{background-color:var(--x-text-400)}.x-radio.x-invalid>label,.x-radio.x-required>label{color:var(--x-danger)}.x-radio.x-direction-row>label{padding:0 .5rem 0 0}.x-radio.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-radio.x-direction-column,.x-radio.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 });
184
+ /** @nocollapse */ XRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: XRadioComponent, selector: "x-radio", providers: [XValueAccessor(XRadioComponent)], viewQueries: [{ propertyName: "radio", first: true, predicate: ["radio"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #radio\r\n class=\"x-radio\"\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-radio-button]=\"button\"\r\n [class.x-radio-icon]=\"icon\"\r\n [class.x-radio-after]=\"after\"\r\n [class.x-radio-before]=\"before\"\r\n [class.x-radio-after-template]=\"afterIsTemplate\"\r\n [class.x-radio-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-radio-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-radio-row\">\r\n <div class=\"x-radio-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-radio-row-list\" [ngSwitch]=\"radioType\">\r\n <ng-container *ngSwitchCase=\"'initial'\">\r\n <div\r\n class=\"x-radio-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"item.id === value\"\r\n [class.x-disabled]=\"item.disabled\"\r\n (click)=\"radioClick($event, item)\"\r\n >\r\n <span class=\"x-radio-box\"></span>\r\n <span class=\"x-radio-label\">{{ item.label }}</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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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]=\"disabled! || item.disabled!\"\r\n [selected]=\"value === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n </ng-container>\r\n </div>\r\n <div class=\"x-radio-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".x-radio{margin:0;padding:0;width:100%}.x-radio.x-flex{display:flex}.x-radio.x-justify-start{justify-content:flex-start}.x-radio.x-justify-center{justify-content:center}.x-radio.x-justify-end{justify-content:flex-end}.x-radio.x-justify-space-between{justify-content:space-between}.x-radio.x-justify-space-around{justify-content:space-around}.x-radio.x-align-start{align-items:flex-start}.x-radio.x-align-center{align-items:center}.x-radio.x-align-end{align-items:flex-end}.x-radio.x-direction-column{flex-direction:column}.x-radio.x-direction-column-reverse{flex-direction:column-reverse}.x-radio.x-direction-row{flex-direction:row}.x-radio.x-direction-row-reverse{flex-direction:row-reverse}.x-radio>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-radio>label.x-text-align-start{text-align:start}.x-radio>label.x-text-align-center{text-align:center}.x-radio>label.x-text-align-end{text-align:end}.x-radio-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-radio-row .x-radio-row-before,.x-radio-row .x-radio-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-radio-row-list{position:relative;display:inline-flex;align-items:center}.x-radio-row-list x-tag:not(:first-child){margin-left:.875rem}.x-radio-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-radio-row-item:hover{color:var(--x-primary)}.x-radio-row-item:hover .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item:last-child{margin-right:0}.x-radio-row-item.x-checked .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item.x-checked .x-radio-box:after{transform:scale(1);opacity:1}.x-radio-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-radio-row-item.x-disabled .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio-row-item.x-disabled .x-radio-box:after{background-color:var(--x-text-400)}.x-radio-button .x-radio-row-before,.x-radio-icon .x-radio-row-before{margin-right:0}.x-radio-button .x-radio-row-after,.x-radio-icon .x-radio-row-after{margin-left:0}.x-radio-box{border:.0625rem solid var(--x-border);border-radius:100%;width:1rem;height:1rem;background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .3s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.x-radio-box:after{position:absolute;display:inline-block;width:.5rem;height:.5rem;background-color:var(--x-primary);border-radius:1rem;transform:scale(0);opacity:0;transition:all .3s cubic-bezier(.78,.14,.15,.86);content:\" \"}.x-radio-label{margin-left:.325rem}.x-radio-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-radio-before:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-before{margin-right:var(--x-padding-medium)}.x-radio-before.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-radio-before.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-before.x-radio-button .x-radio-row-before,.x-radio-before.x-radio-icon .x-radio-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-before-template .x-radio-row-before{display:contents}.x-radio-before-template .x-radio-row-list{margin-left:var(--x-padding-medium)}.x-radio-before-template.x-radio-button .x-radio-row-list,.x-radio-before-template.x-radio-icon .x-radio-row-list{margin-left:0}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input:hover,.x-radio-before-template.x-radio-button .x-radio-row-before input:focus,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before input:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before input:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-before input,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-after{margin-left:var(--x-padding-medium)}.x-radio-after.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-radio-after.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after.x-radio-button .x-radio-row-after,.x-radio-after.x-radio-icon .x-radio-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-after-template .x-radio-row-after{display:contents}.x-radio-after-template .x-radio-row-list{margin-right:var(--x-padding-medium)}.x-radio-after-template.x-radio-button .x-radio-row-list,.x-radio-after-template.x-radio-icon .x-radio-row-list{margin-right:0}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input:hover,.x-radio-after-template.x-radio-button .x-radio-row-after input:focus,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after input:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after input:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-after input,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio.x-disabled .x-radio-item{color:var(--x-text-400);cursor:not-allowed}.x-radio.x-disabled .x-radio-item .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio.x-disabled .x-radio-item .x-radio-box:after{background-color:var(--x-text-400)}.x-radio.x-invalid>label,.x-radio.x-required>label{color:var(--x-danger)}.x-radio.x-direction-row>label{padding:0 .5rem 0 0}.x-radio.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-radio.x-direction-column,.x-radio.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 });
137
185
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioComponent, decorators: [{
138
186
  type: Component,
139
- args: [{ selector: `${XRadioPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XRadioComponent)], template: "<div\r\n #radio\r\n class=\"x-radio\"\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-radio-button]=\"button\"\r\n [class.x-radio-icon]=\"icon\"\r\n [class.x-radio-after]=\"after\"\r\n [class.x-radio-before]=\"before\"\r\n [class.x-radio-after-template]=\"afterIsTemplate\"\r\n [class.x-radio-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-radio-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-radio-row\">\r\n <div class=\"x-radio-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-radio-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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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-radio-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-radio-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"item.id === value\"\r\n [class.x-disabled]=\"item.disabled\"\r\n (click)=\"radioClick($event, item)\"\r\n >\r\n <span class=\"x-radio-box\"></span>\r\n <span class=\"x-radio-label\">{{ item.label }}</span>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-radio{margin:0;padding:0;width:100%}.x-radio.x-flex{display:flex}.x-radio.x-justify-start{justify-content:flex-start}.x-radio.x-justify-center{justify-content:center}.x-radio.x-justify-end{justify-content:flex-end}.x-radio.x-justify-space-between{justify-content:space-between}.x-radio.x-justify-space-around{justify-content:space-around}.x-radio.x-align-start{align-items:flex-start}.x-radio.x-align-center{align-items:center}.x-radio.x-align-end{align-items:flex-end}.x-radio.x-direction-column{flex-direction:column}.x-radio.x-direction-column-reverse{flex-direction:column-reverse}.x-radio.x-direction-row{flex-direction:row}.x-radio.x-direction-row-reverse{flex-direction:row-reverse}.x-radio>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-radio>label.x-text-align-start{text-align:start}.x-radio>label.x-text-align-center{text-align:center}.x-radio>label.x-text-align-end{text-align:end}.x-radio-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-radio-row .x-radio-row-before,.x-radio-row .x-radio-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-radio-row-list{position:relative;display:inline-flex;align-items:center}.x-radio-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-radio-row-item:hover{color:var(--x-primary)}.x-radio-row-item:hover .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item:last-child{margin-right:0}.x-radio-row-item.x-checked .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item.x-checked .x-radio-box:after{transform:scale(1);opacity:1}.x-radio-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-radio-row-item.x-disabled .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio-row-item.x-disabled .x-radio-box:after{background-color:var(--x-text-400)}.x-radio-button .x-radio-row-before,.x-radio-icon .x-radio-row-before{margin-right:0}.x-radio-button .x-radio-row-after,.x-radio-icon .x-radio-row-after{margin-left:0}.x-radio-box{border:.0625rem solid var(--x-border);border-radius:100%;width:1rem;height:1rem;background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .3s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.x-radio-box:after{position:absolute;display:inline-block;width:.5rem;height:.5rem;background-color:var(--x-primary);border-radius:1rem;transform:scale(0);opacity:0;transition:all .3s cubic-bezier(.78,.14,.15,.86);content:\" \"}.x-radio-label{margin-left:.325rem}.x-radio-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-radio-before:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-before{margin-right:var(--x-padding-medium)}.x-radio-before.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-radio-before.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-before.x-radio-button .x-radio-row-before,.x-radio-before.x-radio-icon .x-radio-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-before-template .x-radio-row-before{display:contents}.x-radio-before-template .x-radio-row-list{margin-left:var(--x-padding-medium)}.x-radio-before-template.x-radio-button .x-radio-row-list,.x-radio-before-template.x-radio-icon .x-radio-row-list{margin-left:0}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input:hover,.x-radio-before-template.x-radio-button .x-radio-row-before input:focus,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before input:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before input:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-before input,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-after{margin-left:var(--x-padding-medium)}.x-radio-after.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-radio-after.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after.x-radio-button .x-radio-row-after,.x-radio-after.x-radio-icon .x-radio-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-after-template .x-radio-row-after{display:contents}.x-radio-after-template .x-radio-row-list{margin-right:var(--x-padding-medium)}.x-radio-after-template.x-radio-button .x-radio-row-list,.x-radio-after-template.x-radio-icon .x-radio-row-list{margin-right:0}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input:hover,.x-radio-after-template.x-radio-button .x-radio-row-after input:focus,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after input:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after input:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-after input,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio.x-disabled .x-radio-item{color:var(--x-text-400);cursor:not-allowed}.x-radio.x-disabled .x-radio-item .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio.x-disabled .x-radio-item .x-radio-box:after{background-color:var(--x-text-400)}.x-radio.x-invalid>label,.x-radio.x-required>label{color:var(--x-danger)}.x-radio.x-direction-row>label{padding:0 .5rem 0 0}.x-radio.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-radio.x-direction-column,.x-radio.x-direction-column-reverse{align-items:inherit}\n"] }]
187
+ args: [{ selector: `${XRadioPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XRadioComponent)], template: "<div\r\n #radio\r\n class=\"x-radio\"\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-radio-button]=\"button\"\r\n [class.x-radio-icon]=\"icon\"\r\n [class.x-radio-after]=\"after\"\r\n [class.x-radio-before]=\"before\"\r\n [class.x-radio-after-template]=\"afterIsTemplate\"\r\n [class.x-radio-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-radio-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-radio-row\">\r\n <div class=\"x-radio-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-radio-row-list\" [ngSwitch]=\"radioType\">\r\n <ng-container *ngSwitchCase=\"'initial'\">\r\n <div\r\n class=\"x-radio-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"item.id === value\"\r\n [class.x-disabled]=\"item.disabled\"\r\n (click)=\"radioClick($event, item)\"\r\n >\r\n <span class=\"x-radio-box\"></span>\r\n <span class=\"x-radio-label\">{{ item.label }}</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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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]=\"disabled! || item.disabled!\"\r\n [selected]=\"value === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n </ng-container>\r\n </div>\r\n <div class=\"x-radio-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".x-radio{margin:0;padding:0;width:100%}.x-radio.x-flex{display:flex}.x-radio.x-justify-start{justify-content:flex-start}.x-radio.x-justify-center{justify-content:center}.x-radio.x-justify-end{justify-content:flex-end}.x-radio.x-justify-space-between{justify-content:space-between}.x-radio.x-justify-space-around{justify-content:space-around}.x-radio.x-align-start{align-items:flex-start}.x-radio.x-align-center{align-items:center}.x-radio.x-align-end{align-items:flex-end}.x-radio.x-direction-column{flex-direction:column}.x-radio.x-direction-column-reverse{flex-direction:column-reverse}.x-radio.x-direction-row{flex-direction:row}.x-radio.x-direction-row-reverse{flex-direction:row-reverse}.x-radio>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-radio>label.x-text-align-start{text-align:start}.x-radio>label.x-text-align-center{text-align:center}.x-radio>label.x-text-align-end{text-align:end}.x-radio-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-radio-row .x-radio-row-before,.x-radio-row .x-radio-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-radio-row-list{position:relative;display:inline-flex;align-items:center}.x-radio-row-list x-tag:not(:first-child){margin-left:.875rem}.x-radio-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-radio-row-item:hover{color:var(--x-primary)}.x-radio-row-item:hover .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item:last-child{margin-right:0}.x-radio-row-item.x-checked .x-radio-box{border-color:var(--x-primary)}.x-radio-row-item.x-checked .x-radio-box:after{transform:scale(1);opacity:1}.x-radio-row-item.x-disabled{color:var(--x-text-400);cursor:not-allowed}.x-radio-row-item.x-disabled .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio-row-item.x-disabled .x-radio-box:after{background-color:var(--x-text-400)}.x-radio-button .x-radio-row-before,.x-radio-icon .x-radio-row-before{margin-right:0}.x-radio-button .x-radio-row-after,.x-radio-icon .x-radio-row-after{margin-left:0}.x-radio-box{border:.0625rem solid var(--x-border);border-radius:100%;width:1rem;height:1rem;background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .3s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.x-radio-box:after{position:absolute;display:inline-block;width:.5rem;height:.5rem;background-color:var(--x-primary);border-radius:1rem;transform:scale(0);opacity:0;transition:all .3s cubic-bezier(.78,.14,.15,.86);content:\" \"}.x-radio-label{margin-left:.325rem}.x-radio-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-radio-before:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-before{margin-right:var(--x-padding-medium)}.x-radio-before.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button,.x-radio-before.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:first-child .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-before.x-radio-button .x-radio-row-before,.x-radio-before.x-radio-icon .x-radio-row-before{margin-right:0;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-before-template .x-radio-row-before{display:contents}.x-radio-before-template .x-radio-row-list{margin-left:var(--x-padding-medium)}.x-radio-before-template.x-radio-button .x-radio-row-list,.x-radio-before-template.x-radio-icon .x-radio-row-list{margin-left:0}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button{margin-left:calc(var(--x-border-width) * -1)}.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input:hover,.x-radio-before-template.x-radio-button .x-radio-row-before input:focus,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before input:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before input:focus,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:hover,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button:focus{z-index:1}.x-radio-before-template.x-radio-button .x-radio-row-before input,.x-radio-before-template.x-radio-button .x-radio-row-before .x-button,.x-radio-before-template.x-radio-icon .x-radio-row-before input,.x-radio-before-template.x-radio-icon .x-radio-row-before .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after:not(.x-radio-before-template,.x-radio-button,.x-radio-icon) .x-radio-row-after{margin-left:var(--x-padding-medium)}.x-radio-after.x-radio-button .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button,.x-radio-after.x-radio-icon .x-buttons:not(.x-buttons-space)>x-button:last-child .x-button{border-top-right-radius:0;border-bottom-right-radius:0}.x-radio-after.x-radio-button .x-radio-row-after,.x-radio-after.x-radio-icon .x-radio-row-after{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.x-radio-after-template .x-radio-row-after{display:contents}.x-radio-after-template .x-radio-row-list{margin-right:var(--x-padding-medium)}.x-radio-after-template.x-radio-button .x-radio-row-list,.x-radio-after-template.x-radio-icon .x-radio-row-list{margin-right:0}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button{margin-right:calc(var(--x-border-width) * -1)}.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-list .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-list .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input:hover,.x-radio-after-template.x-radio-button .x-radio-row-after input:focus,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after input:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after input:focus,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:hover,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button:focus{z-index:1}.x-radio-after-template.x-radio-button .x-radio-row-after input,.x-radio-after-template.x-radio-button .x-radio-row-after .x-button,.x-radio-after-template.x-radio-icon .x-radio-row-after input,.x-radio-after-template.x-radio-icon .x-radio-row-after .x-button{border-top-left-radius:0;border-bottom-left-radius:0}.x-radio.x-disabled .x-radio-item{color:var(--x-text-400);cursor:not-allowed}.x-radio.x-disabled .x-radio-item .x-radio-box{border-color:var(--x-border-100);background-color:var(--x-border-300)}.x-radio.x-disabled .x-radio-item .x-radio-box:after{background-color:var(--x-text-400)}.x-radio.x-invalid>label,.x-radio.x-required>label{color:var(--x-danger)}.x-radio.x-direction-row>label{padding:0 .5rem 0 0}.x-radio.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-radio.x-direction-column,.x-radio.x-direction-column-reverse{align-items:inherit}\n"] }]
140
188
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.XConfigService }]; }, propDecorators: { radio: [{
141
189
  type: ViewChild,
142
190
  args: ['radio', { static: true }]
@@ -145,14 +193,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
145
193
  class XRadioModule {
146
194
  }
147
195
  /** @nocollapse */ XRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
148
- /** @nocollapse */ XRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: XRadioModule, declarations: [XRadioComponent, XRadioProperty], imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule], exports: [XRadioComponent] });
149
- /** @nocollapse */ XRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioModule, imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule] });
196
+ /** @nocollapse */ XRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: XRadioModule, declarations: [XRadioComponent, XRadioProperty], imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule], exports: [XRadioComponent] });
197
+ /** @nocollapse */ XRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioModule, imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule] });
150
198
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: XRadioModule, decorators: [{
151
199
  type: NgModule,
152
200
  args: [{
153
201
  declarations: [XRadioComponent, XRadioProperty],
154
202
  exports: [XRadioComponent],
155
- imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule]
203
+ imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule]
156
204
  }]
157
205
  }] });
158
206
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-nest-ui-radio.mjs","sources":["../../../../lib/ng-nest/ui/radio/radio.property.ts","../../../../lib/ng-nest/ui/radio/radio.component.ts","../../../../lib/ng-nest/ui/radio/radio.component.html","../../../../lib/ng-nest/ui/radio/radio.module.ts","../../../../lib/ng-nest/ui/radio/ng-nest-ui-radio.ts"],"sourcesContent":["import { XData, XIdentityProperty, XDataConvert, XInputBoolean, XSize, XBoolean, XWithConfig, XTemplate } 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 * Radio\r\n * @selector x-radio\r\n * @decorator component\r\n */\r\nexport const XRadioPrefix = 'x-radio';\r\nconst X_CONFIG_NAME = 'radio';\r\n\r\n/**\r\n * Radio Property\r\n */\r\n@Component({ template: '' })\r\nexport class XRadioProperty extends XControlValueAccessor<any> implements XRadioOption {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n @Input() @XDataConvert() data: XData<XRadioNode> = [];\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 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 Take effect when button style\r\n */\r\n @Input() type: XButtonType = 'initial';\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 * Radio Option\r\n * @undocument true\r\n */\r\nexport interface XRadioOption extends XFormOption {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n data?: XData<XRadioNode>;\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 Size\r\n */\r\n size?: XSize;\r\n /**\r\n * @zh_CN 按钮样式时生效\r\n * @en_US Take effect when button style\r\n */\r\n type?: XButtonType;\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 Radio 数据对象\r\n * @en_US Radio data object\r\n */\r\nexport interface XRadioNode extends XIdentityProperty {\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\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","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 { XRadioPrefix, XRadioNode, XRadioProperty } from './radio.property';\r\nimport { Subject } from 'rxjs';\r\nimport { XIsChange, XSetData, XClearClass, XConfigService } from '@ng-nest/ui/core';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\n\r\n@Component({\r\n selector: `${XRadioPrefix}`,\r\n templateUrl: './radio.component.html',\r\n styleUrls: ['./radio.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XRadioComponent)]\r\n})\r\nexport class XRadioComponent extends XRadioProperty implements OnChanges {\r\n @ViewChild('radio', { static: true }) radio!: ElementRef<HTMLElement>;\r\n nodes: XRadioNode[] = [];\r\n private _unSubject = new Subject<void>();\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 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.radio.nativeElement, this.renderer, this.justify, this.align, this.direction);\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 override writeValue(value: any) {\r\n this.value = value;\r\n this.cdr.detectChanges();\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 radioClick(event: Event, node: XRadioNode) {\r\n event.preventDefault();\r\n if (this.disabled || node.disabled || node.id === this.value) return;\r\n this.formControlValidator();\r\n this.value = node.id;\r\n this.cdr.detectChanges();\r\n if (this.onChange) this.onChange(this.value);\r\n }\r\n\r\n private setData() {\r\n XSetData<XRadioNode>(this.data, this._unSubject).subscribe((x) => {\r\n this.nodes = x;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n trackByItem(_index: number, item: XRadioNode) {\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 #radio\r\n class=\"x-radio\"\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-radio-button]=\"button\"\r\n [class.x-radio-icon]=\"icon\"\r\n [class.x-radio-after]=\"after\"\r\n [class.x-radio-before]=\"before\"\r\n [class.x-radio-after-template]=\"afterIsTemplate\"\r\n [class.x-radio-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-radio-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-radio-row\">\r\n <div class=\"x-radio-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-radio-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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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-radio-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-radio-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"item.id === value\"\r\n [class.x-disabled]=\"item.disabled\"\r\n (click)=\"radioClick($event, item)\"\r\n >\r\n <span class=\"x-radio-box\"></span>\r\n <span class=\"x-radio-label\">{{ item.label }}</span>\r\n </div>\r\n</ng-template>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { XRadioComponent } from './radio.component';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonModule } from '@ng-nest/ui/button';\r\nimport { XRadioProperty } from './radio.property';\r\nimport { XBaseFormModule } from '@ng-nest/ui/base-form';\r\nimport { XOutletModule } from '@ng-nest/ui/outlet';\r\n\r\n@NgModule({\r\n declarations: [XRadioComponent, XRadioProperty],\r\n exports: [XRadioComponent],\r\n imports: [CommonModule, FormsModule, XButtonModule, XOutletModule, XBaseFormModule]\r\n})\r\nexport class XRadioModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAKA;;;;AAIG;AACI,MAAM,YAAY,GAAG,UAAU;AACtC,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;AAEG;AAEG,MAAO,cAAe,SAAQ,qBAA0B,CAAA;AAD9D,IAAA,WAAA,GAAA;;AAEE;;;AAGG;QACsB,IAAI,CAAA,IAAA,GAAsB,EAAE,CAAC;AAgBtD;;;AAGG;QACM,IAAI,CAAA,IAAA,GAAgB,SAAS,CAAC;AAWxC,KAAA;;8HApCY,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAd,mBAAA,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,mMADJ,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AAME,UAAA,CAAA;AAAf,IAAA,YAAY,EAAE;AAA8B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAK5B,UAAA,CAAA;AAAhB,IAAA,aAAa,EAAE;AAAmB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,C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EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;;;MEZzB,YAAY,CAAA;;4HAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAZ,mBAAA,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,EAJR,YAAA,EAAA,CAAA,eAAe,EAAE,cAAc,aAEpC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,aADxE,eAAe,CAAA,EAAA,CAAA,CAAA;6HAGd,YAAY,EAAA,OAAA,EAAA,CAFb,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA;2FAEvE,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC;oBAC/C,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,CAAC;AACpF,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-nest-ui-radio.mjs","sources":["../../../../lib/ng-nest/ui/radio/radio.property.ts","../../../../lib/ng-nest/ui/radio/radio.component.ts","../../../../lib/ng-nest/ui/radio/radio.component.html","../../../../lib/ng-nest/ui/radio/radio.module.ts","../../../../lib/ng-nest/ui/radio/ng-nest-ui-radio.ts"],"sourcesContent":["import { XData, XIdentityProperty, XDataConvert, XInputBoolean, XSize, XBoolean, XWithConfig, XTemplate } 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 * Radio\r\n * @selector x-radio\r\n * @decorator component\r\n */\r\nexport const XRadioPrefix = 'x-radio';\r\nconst X_CONFIG_NAME = 'radio';\r\n\r\n/**\r\n * Radio Property\r\n */\r\n@Component({ template: '' })\r\nexport class XRadioProperty extends XControlValueAccessor<any> implements XRadioOption {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n @Input() @XDataConvert() data: XData<XRadioNode> = [];\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 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() @XInputBoolean() tagBordered: XBoolean = true;\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n @Input() @XInputBoolean() tagDark?: XBoolean;\r\n /**\r\n * @zh_CN 允许取消选中\r\n * @en_US Allow cancel checked\r\n */\r\n @Input() @XInputBoolean() allowCancel?: XBoolean;\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 * Radio Option\r\n * @undocument true\r\n */\r\nexport interface XRadioOption extends XFormOption {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n data?: XData<XRadioNode>;\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 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 Radio 数据对象\r\n * @en_US Radio data object\r\n */\r\nexport interface XRadioNode extends XIdentityProperty {\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\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","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 { XRadioPrefix, XRadioNode, XRadioProperty } from './radio.property';\r\nimport { Subject } from 'rxjs';\r\nimport { XIsChange, XSetData, XClearClass, XConfigService } from '@ng-nest/ui/core';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\n\r\n@Component({\r\n selector: `${XRadioPrefix}`,\r\n templateUrl: './radio.component.html',\r\n styleUrls: ['./radio.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XRadioComponent)]\r\n})\r\nexport class XRadioComponent extends XRadioProperty implements OnChanges {\r\n @ViewChild('radio', { static: true }) radio!: ElementRef<HTMLElement>;\r\n nodes: XRadioNode[] = [];\r\n radioType!: 'initial' | 'button' | 'icon' | 'tag';\r\n private _unSubject = new Subject<void>();\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 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.radio.nativeElement, this.renderer, this.justify, this.align, this.direction);\r\n this.setClassMap();\r\n this.setRadioType();\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 override writeValue(value: any) {\r\n this.value = value;\r\n this.cdr.detectChanges();\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 setRadioType() {\r\n if (this.button) {\r\n this.radioType = 'button';\r\n } else if (this.icon) {\r\n this.radioType = 'icon';\r\n } else if (this.tag) {\r\n this.radioType = 'tag';\r\n } else {\r\n this.radioType = 'initial';\r\n }\r\n this.cdr.detectChanges();\r\n }\r\n\r\n radioClick(event: Event, node: XRadioNode) {\r\n event.preventDefault();\r\n if (this.disabled || node.disabled || (!this.allowCancel && node.id === this.value)) return;\r\n this.formControlValidator();\r\n if (this.allowCancel && node.id === this.value) {\r\n this.value = null;\r\n } else {\r\n 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 private setData() {\r\n XSetData<XRadioNode>(this.data, this._unSubject).subscribe((x) => {\r\n this.nodes = x;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n trackByItem(_index: number, item: XRadioNode) {\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 #radio\r\n class=\"x-radio\"\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-radio-button]=\"button\"\r\n [class.x-radio-icon]=\"icon\"\r\n [class.x-radio-after]=\"after\"\r\n [class.x-radio-before]=\"before\"\r\n [class.x-radio-after-template]=\"afterIsTemplate\"\r\n [class.x-radio-before-template]=\"beforeIsTemplate\"\r\n>\r\n <label *ngIf=\"label\" [class.x-radio-label-required]=\"required\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-radio-row\">\r\n <div class=\"x-radio-row-before\" *ngIf=\"before\">\r\n <ng-container *xOutlet=\"before\">{{ before }}</ng-container>\r\n </div>\r\n <div class=\"x-radio-row-list\" [ngSwitch]=\"radioType\">\r\n <ng-container *ngSwitchCase=\"'initial'\">\r\n <div\r\n class=\"x-radio-row-item\"\r\n *ngFor=\"let item of nodes; trackBy: trackByItem\"\r\n [class.x-checked]=\"item.id === value\"\r\n [class.x-disabled]=\"item.disabled\"\r\n (click)=\"radioClick($event, item)\"\r\n >\r\n <span class=\"x-radio-box\"></span>\r\n <span class=\"x-radio-label\">{{ item.label }}</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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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 [size]=\"size\"\r\n [type]=\"type\"\r\n [activated]=\"item.id === value\"\r\n [disabled]=\"disabled || item.disabled\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($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]=\"disabled! || item.disabled!\"\r\n [selected]=\"value === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n </ng-container>\r\n </div>\r\n <div class=\"x-radio-row-after\" *ngIf=\"after\">\r\n <ng-container *xOutlet=\"after\">{{ after }}</ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { XRadioComponent } from './radio.component';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonModule } from '@ng-nest/ui/button';\r\nimport { XRadioProperty } from './radio.property';\r\nimport { XBaseFormModule } from '@ng-nest/ui/base-form';\r\nimport { XOutletModule } from '@ng-nest/ui/outlet';\r\nimport { XTagModule } from '@ng-nest/ui/tag';\r\n\r\n@NgModule({\r\n declarations: [XRadioComponent, XRadioProperty],\r\n exports: [XRadioComponent],\r\n imports: [CommonModule, FormsModule, XButtonModule, XTagModule, XOutletModule, XBaseFormModule]\r\n})\r\nexport class XRadioModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKA;;;;AAIG;AACI,MAAM,YAAY,GAAG,UAAU;AACtC,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;AAEG;AAEG,MAAO,cAAe,SAAQ,qBAA0B,CAAA;AAD9D,IAAA,WAAA,GAAA;;AAEE;;;AAGG;QACsB,IAAI,CAAA,IAAA,GAAsB,EAAE,CAAC;AAqBtD;;;AAGG;QACM,IAAI,CAAA,IAAA,GAAgB,SAAS,CAAC;AACvC;;;AAGG;QACuB,IAAW,CAAA,WAAA,GAAa,IAAI,CAAC;AAqBxD,KAAA;;8HAxDY,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAd,mBAAA,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,2RADJ,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AAME,UAAA,CAAA;AAAf,IAAA,YAAY,EAAE;AAA8B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAK5B,UAAA,CAAA;AAAhB,IAAA,aAAa,EAAE;AAAmB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAKlB,UAAA,CAAA;AAA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