@ng-nest/ui 21.0.2 → 21.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ng-nest-ui-affix.mjs +12 -12
- package/fesm2022/ng-nest-ui-affix.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-alert.mjs +22 -24
- package/fesm2022/ng-nest-ui-alert.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-anchor.mjs +19 -19
- package/fesm2022/ng-nest-ui-anchor.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-api.mjs +7 -7
- package/fesm2022/ng-nest-ui-attachments.mjs +22 -22
- package/fesm2022/ng-nest-ui-attachments.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-auto-complete.mjs +26 -30
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-avatar.mjs +17 -17
- package/fesm2022/ng-nest-ui-avatar.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-back-top.mjs +13 -13
- package/fesm2022/ng-nest-ui-back-top.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-badge.mjs +16 -16
- package/fesm2022/ng-nest-ui-badge.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-base-form.mjs +13 -13
- package/fesm2022/ng-nest-ui-base-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-bubble.mjs +20 -20
- package/fesm2022/ng-nest-ui-bubble.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-button.mjs +31 -31
- package/fesm2022/ng-nest-ui-button.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-calendar.mjs +10 -10
- package/fesm2022/ng-nest-ui-card.mjs +11 -11
- package/fesm2022/ng-nest-ui-card.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-carousel.mjs +24 -24
- package/fesm2022/ng-nest-ui-carousel.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +25 -29
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-checkbox.mjs +22 -22
- package/fesm2022/ng-nest-ui-checkbox.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-collapse.mjs +22 -22
- package/fesm2022/ng-nest-ui-collapse.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color-picker.mjs +25 -25
- package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color.mjs +10 -10
- package/fesm2022/ng-nest-ui-comment.mjs +19 -19
- package/fesm2022/ng-nest-ui-comment.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-container.mjs +34 -34
- package/fesm2022/ng-nest-ui-container.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-core.mjs +18 -18
- package/fesm2022/ng-nest-ui-coversations.mjs +11 -11
- package/fesm2022/ng-nest-ui-coversations.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-crumb.mjs +11 -11
- package/fesm2022/ng-nest-ui-crumb.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-date-picker.mjs +87 -87
- package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-description.mjs +20 -20
- package/fesm2022/ng-nest-ui-description.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dialog.mjs +58 -58
- package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-doc.mjs +7 -7
- package/fesm2022/ng-nest-ui-drag.mjs +10 -10
- package/fesm2022/ng-nest-ui-drawer.mjs +34 -34
- package/fesm2022/ng-nest-ui-drawer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dropdown.mjs +21 -21
- package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-empty.mjs +10 -10
- package/fesm2022/ng-nest-ui-examples.mjs +7 -7
- package/fesm2022/ng-nest-ui-find.mjs +31 -35
- package/fesm2022/ng-nest-ui-find.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +21 -21
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-highlight.mjs +14 -14
- package/fesm2022/ng-nest-ui-highlight.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-i18n.mjs +32 -31
- package/fesm2022/ng-nest-ui-i18n.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-icon.mjs +14 -14
- package/fesm2022/ng-nest-ui-icon.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-image.mjs +21 -21
- package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-inner.mjs +11 -11
- package/fesm2022/ng-nest-ui-inner.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs +21 -21
- package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input.mjs +36 -40
- package/fesm2022/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-keyword.mjs +11 -11
- package/fesm2022/ng-nest-ui-keyword.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-layout.mjs +25 -25
- package/fesm2022/ng-nest-ui-layout.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-link.mjs +13 -13
- package/fesm2022/ng-nest-ui-link.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-list.mjs +41 -41
- package/fesm2022/ng-nest-ui-list.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-loading.mjs +14 -14
- package/fesm2022/ng-nest-ui-loading.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-menu.mjs +22 -22
- package/fesm2022/ng-nest-ui-menu.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-message-box.mjs +10 -10
- package/fesm2022/ng-nest-ui-message.mjs +10 -10
- package/fesm2022/ng-nest-ui-notification.mjs +10 -10
- package/fesm2022/ng-nest-ui-outlet.mjs +7 -7
- package/fesm2022/ng-nest-ui-page-header.mjs +10 -10
- package/fesm2022/ng-nest-ui-pagination.mjs +27 -31
- package/fesm2022/ng-nest-ui-pagination.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-pattern.mjs +7 -7
- package/fesm2022/ng-nest-ui-popconfirm.mjs +14 -14
- package/fesm2022/ng-nest-ui-popconfirm.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-popover.mjs +19 -19
- package/fesm2022/ng-nest-ui-popover.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-portal.mjs +7 -7
- package/fesm2022/ng-nest-ui-progress.mjs +22 -22
- package/fesm2022/ng-nest-ui-progress.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-prompts.mjs +12 -12
- package/fesm2022/ng-nest-ui-prompts.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-radio.mjs +20 -20
- package/fesm2022/ng-nest-ui-radio.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-rate.mjs +15 -15
- package/fesm2022/ng-nest-ui-rate.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-resizable.mjs +14 -14
- package/fesm2022/ng-nest-ui-resizable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-result.mjs +10 -10
- package/fesm2022/ng-nest-ui-ripple.mjs +12 -12
- package/fesm2022/ng-nest-ui-ripple.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-scrollable.mjs +19 -7
- package/fesm2022/ng-nest-ui-scrollable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +35 -39
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-sender.mjs +19 -19
- package/fesm2022/ng-nest-ui-sender.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-skeleton.mjs +13 -13
- package/fesm2022/ng-nest-ui-skeleton.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider-select.mjs +21 -21
- package/fesm2022/ng-nest-ui-slider-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider.mjs +16 -18
- package/fesm2022/ng-nest-ui-slider.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-statistic.mjs +16 -16
- package/fesm2022/ng-nest-ui-steps.mjs +33 -18
- package/fesm2022/ng-nest-ui-steps.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-suggestion.mjs +17 -17
- package/fesm2022/ng-nest-ui-suggestion.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-switch.mjs +15 -15
- package/fesm2022/ng-nest-ui-switch.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table-view.mjs +58 -58
- package/fesm2022/ng-nest-ui-table.mjs +90 -112
- package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tabs.mjs +38 -40
- package/fesm2022/ng-nest-ui-tabs.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tag.mjs +16 -16
- package/fesm2022/ng-nest-ui-tag.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-text-retract.mjs +11 -11
- package/fesm2022/ng-nest-ui-text-retract.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-textarea.mjs +19 -19
- package/fesm2022/ng-nest-ui-textarea.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-theme.mjs +12 -12
- package/fesm2022/ng-nest-ui-theme.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-thought-chain.mjs +12 -12
- package/fesm2022/ng-nest-ui-thought-chain.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-ago.mjs +7 -7
- package/fesm2022/ng-nest-ui-time-picker.mjs +28 -28
- package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-range.mjs +7 -7
- package/fesm2022/ng-nest-ui-timeline.mjs +12 -12
- package/fesm2022/ng-nest-ui-timeline.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tooltip.mjs +17 -17
- package/fesm2022/ng-nest-ui-tooltip.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-transfer.mjs +14 -14
- package/fesm2022/ng-nest-ui-transfer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-file.mjs +17 -17
- package/fesm2022/ng-nest-ui-tree-file.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-select.mjs +36 -42
- package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree.mjs +44 -46
- package/fesm2022/ng-nest-ui-tree.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-typography.mjs +10 -10
- package/fesm2022/ng-nest-ui-upload.mjs +24 -24
- package/fesm2022/ng-nest-ui-upload.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-welcome.mjs +10 -10
- package/package.json +1 -1
- package/types/ng-nest-ui-i18n.d.ts +13 -11
- package/types/ng-nest-ui-scrollable.d.ts +6 -0
- package/types/ng-nest-ui-steps.d.ts +18 -3
|
@@ -32,22 +32,22 @@ class XPromptsProperty extends XPropertyFunction(X_PROPMTS_CONFIG_NAME) {
|
|
|
32
32
|
* @zh_CN 纵向展示
|
|
33
33
|
* @en_US List vertical display
|
|
34
34
|
*/
|
|
35
|
-
this.vertical = input(this.config?.vertical ?? false, ...(ngDevMode ?
|
|
35
|
+
this.vertical = input(this.config?.vertical ?? false, { ...(ngDevMode ? { debugName: "vertical" } : {}), transform: XToBoolean });
|
|
36
36
|
/**
|
|
37
37
|
* @zh_CN wrap
|
|
38
38
|
* @en_US List wrap display
|
|
39
39
|
*/
|
|
40
|
-
this.wrap = input(this.config?.wrap ?? false, ...(ngDevMode ?
|
|
40
|
+
this.wrap = input(this.config?.wrap ?? false, { ...(ngDevMode ? { debugName: "wrap" } : {}), transform: XToBoolean });
|
|
41
41
|
/**
|
|
42
42
|
* @zh_CN Item 点击事件
|
|
43
43
|
* @en_US Item click event
|
|
44
44
|
*/
|
|
45
45
|
this.itemClick = output();
|
|
46
46
|
}
|
|
47
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
48
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
47
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
48
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: XPromptsProperty, isStandalone: true, selector: "x-prompts-property", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
49
49
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsProperty, decorators: [{
|
|
51
51
|
type: Component,
|
|
52
52
|
args: [{ selector: `${XPromptsPrefix}-property`, template: '' }]
|
|
53
53
|
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], vertical: [{ type: i0.Input, args: [{ isSignal: true, alias: "vertical", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrap", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
@@ -74,20 +74,20 @@ class XPromptsComponent extends XPromptsProperty {
|
|
|
74
74
|
this.nodes.set(x);
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
78
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.
|
|
77
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
78
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: XPromptsComponent, isStandalone: true, selector: "x-prompts", usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"x-prompts\" [class.x-prompts-vertical]=\"vertical()\" [class.x-prompts-wrap]=\"wrap()\">\r\n <div class=\"x-prompts-title\">\r\n <ng-container *xOutlet=\"title()\">{{ title() }}</ng-container>\r\n </div>\r\n <div class=\"x-prompts-list\">\r\n @for (item of nodes(); track item.id) {\r\n <div class=\"x-prompts-item\" [class.x-disabled]=\"item.disabled\" [style]=\"item.style\" (click)=\"onItemClick(item)\">\r\n @if (item.icon) {\r\n <div class=\"x-prompts-item-icon\">\r\n <x-icon [type]=\"item.icon\" [style]=\"item.iconStyle\"></x-icon>\r\n </div>\r\n }\r\n <div class=\"x-prompts-item-content\">\r\n @if (item.label) {\r\n <div class=\"x-prompts-item-label\" [class.x-prompts-item-only-label]=\"item.label && !item.description\">\r\n {{ item.label }}\r\n </div>\r\n }\r\n @if (item.description) {\r\n <div\r\n class=\"x-prompts-item-description\"\r\n [class.x-prompts-item-only-description]=\"!item.label && item.description\"\r\n >\r\n {{ item.description }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-prompts{margin:0;padding:0}.x-prompts{width:100%}.x-prompts-title{color:var(--x-text-400);margin-bottom:.5rem}.x-prompts-list{display:flex;gap:.5rem;overflow-x:auto;scrollbar-width:none;list-style:none;padding-inline-start:0;margin-block:0;align-items:stretch}.x-prompts-vertical .x-prompts-list{flex-direction:column;align-items:flex-start}.x-prompts-wrap .x-prompts-list{flex-wrap:wrap}.x-prompts-item{flex:none;min-width:10rem;display:inline-flex;gap:.5rem;padding:.5rem 1rem;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);transition:all var(--x-animation-duration-base);cursor:pointer}.x-prompts-item:hover:not(.x-disabled){background-color:var(--x-background-a200)}.x-prompts-item.x-disabled{cursor:default;background-color:var(--x-background-a300)}.x-prompts-item-content{flex:1;display:flex;flex-direction:column;gap:.25rem}.x-prompts-item-label{margin:0;font-weight:600}.x-prompts-item-description{color:var(--x-text-400)}.x-prompts-item-only-label{font-weight:500}.x-prompts-item-only-description{color:currentColor}\n"], dependencies: [{ kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: XIconComponent, selector: "x-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
79
79
|
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsComponent, decorators: [{
|
|
81
81
|
type: Component,
|
|
82
82
|
args: [{ selector: 'x-prompts', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [XOutletDirective, XIconComponent], template: "<div class=\"x-prompts\" [class.x-prompts-vertical]=\"vertical()\" [class.x-prompts-wrap]=\"wrap()\">\r\n <div class=\"x-prompts-title\">\r\n <ng-container *xOutlet=\"title()\">{{ title() }}</ng-container>\r\n </div>\r\n <div class=\"x-prompts-list\">\r\n @for (item of nodes(); track item.id) {\r\n <div class=\"x-prompts-item\" [class.x-disabled]=\"item.disabled\" [style]=\"item.style\" (click)=\"onItemClick(item)\">\r\n @if (item.icon) {\r\n <div class=\"x-prompts-item-icon\">\r\n <x-icon [type]=\"item.icon\" [style]=\"item.iconStyle\"></x-icon>\r\n </div>\r\n }\r\n <div class=\"x-prompts-item-content\">\r\n @if (item.label) {\r\n <div class=\"x-prompts-item-label\" [class.x-prompts-item-only-label]=\"item.label && !item.description\">\r\n {{ item.label }}\r\n </div>\r\n }\r\n @if (item.description) {\r\n <div\r\n class=\"x-prompts-item-description\"\r\n [class.x-prompts-item-only-description]=\"!item.label && item.description\"\r\n >\r\n {{ item.description }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-prompts{margin:0;padding:0}.x-prompts{width:100%}.x-prompts-title{color:var(--x-text-400);margin-bottom:.5rem}.x-prompts-list{display:flex;gap:.5rem;overflow-x:auto;scrollbar-width:none;list-style:none;padding-inline-start:0;margin-block:0;align-items:stretch}.x-prompts-vertical .x-prompts-list{flex-direction:column;align-items:flex-start}.x-prompts-wrap .x-prompts-list{flex-wrap:wrap}.x-prompts-item{flex:none;min-width:10rem;display:inline-flex;gap:.5rem;padding:.5rem 1rem;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);transition:all var(--x-animation-duration-base);cursor:pointer}.x-prompts-item:hover:not(.x-disabled){background-color:var(--x-background-a200)}.x-prompts-item.x-disabled{cursor:default;background-color:var(--x-background-a300)}.x-prompts-item-content{flex:1;display:flex;flex-direction:column;gap:.25rem}.x-prompts-item-label{margin:0;font-weight:600}.x-prompts-item-description{color:var(--x-text-400)}.x-prompts-item-only-label{font-weight:500}.x-prompts-item-only-description{color:currentColor}\n"] }]
|
|
83
83
|
}] });
|
|
84
84
|
|
|
85
85
|
class XPromptsModule {
|
|
86
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
87
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.
|
|
88
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.
|
|
86
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
87
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: XPromptsModule, imports: [XPromptsComponent], exports: [XPromptsComponent] }); }
|
|
88
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsModule, imports: [XPromptsComponent] }); }
|
|
89
89
|
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XPromptsModule, decorators: [{
|
|
91
91
|
type: NgModule,
|
|
92
92
|
args: [{
|
|
93
93
|
exports: [XPromptsComponent],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui-prompts.mjs","sources":["../../../../lib/ng-nest/ui/prompts/prompts.property.ts","../../../../lib/ng-nest/ui/prompts/prompts.component.ts","../../../../lib/ng-nest/ui/prompts/prompts.component.html","../../../../lib/ng-nest/ui/prompts/prompts.module.ts","../../../../lib/ng-nest/ui/prompts/ng-nest-ui-prompts.ts"],"sourcesContent":["import { Component, input, output } from '@angular/core';\r\nimport { XBoolean, XData, XIdentityProperty, XPropertyFunction, XStyle, XTemplate, XToBoolean } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Prompts\r\n * @selector x-prompts\r\n * @decorator component\r\n */\r\nexport const XPromptsPrefix = 'x-prompts';\r\nconst X_PROPMTS_CONFIG_NAME = 'prompts';\r\n\r\n/**\r\n * Prompts Property\r\n */\r\n@Component({ selector: `${XPromptsPrefix}-property`, template: '' })\r\nexport class XPromptsProperty extends XPropertyFunction(X_PROPMTS_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 显示标题,支持自定义模板\r\n * @en_US Display title, support custom template\r\n */\r\n readonly title = input<XTemplate>();\r\n /**\r\n * @zh_CN 列表数据\r\n * @en_US List data\r\n */\r\n readonly data = input<XData<XPromptsNode>>([]);\r\n /**\r\n * @zh_CN 纵向展示\r\n * @en_US List vertical display\r\n */\r\n readonly vertical = input<boolean, XBoolean>(this.config?.vertical ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN wrap\r\n * @en_US List wrap display\r\n */\r\n readonly wrap = input<boolean, XBoolean>(this.config?.wrap ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN Item 点击事件\r\n * @en_US Item click event\r\n */\r\n readonly itemClick = output<XPromptsNode>();\r\n}\r\n\r\n/**\r\n * @zh_CN 提示词\r\n * @en_US Promtp\r\n */\r\nexport interface XPromptsNode extends XIdentityProperty {\r\n /**\r\n * @zh_CN 描述\r\n * @en_US Description\r\n */\r\n description?: string;\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 style\r\n */\r\n style?: XStyle;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n iconStyle?: XStyle;\r\n /**\r\n * @zh_CN 是否禁用\r\n * @en_US Whether to disable\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 自定义属性\r\n * @en_US Custom attributes\r\n */\r\n [property: string]: any;\r\n}\r\n","import { ChangeDetectionStrategy, Component, signal, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\nimport { XPromptsProperty, XPromptsNode } from './prompts.property';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\nimport { XIsChange, XSetData } from '@ng-nest/ui/core';\r\nimport { Subject } from 'rxjs';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\n\r\n@Component({\r\n selector: 'x-prompts',\r\n templateUrl: './prompts.component.html',\r\n styleUrls: ['./prompts.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [XOutletDirective, XIconComponent]\r\n})\r\nexport class XPromptsComponent extends XPromptsProperty {\r\n nodes = signal<XPromptsNode[]>([]);\r\n\r\n unSubject = new Subject<void>();\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.complete();\r\n }\r\n\r\n onItemClick(node: XPromptsNode) {\r\n this.itemClick.emit(node);\r\n }\r\n\r\n private setData() {\r\n XSetData<XPromptsNode>(this.data(), this.unSubject, true).subscribe((x) => {\r\n this.nodes.set(x);\r\n });\r\n }\r\n}\r\n","<div class=\"x-prompts\" [class.x-prompts-vertical]=\"vertical()\" [class.x-prompts-wrap]=\"wrap()\">\r\n <div class=\"x-prompts-title\">\r\n <ng-container *xOutlet=\"title()\">{{ title() }}</ng-container>\r\n </div>\r\n <div class=\"x-prompts-list\">\r\n @for (item of nodes(); track item.id) {\r\n <div class=\"x-prompts-item\" [class.x-disabled]=\"item.disabled\" [style]=\"item.style\" (click)=\"onItemClick(item)\">\r\n @if (item.icon) {\r\n <div class=\"x-prompts-item-icon\">\r\n <x-icon [type]=\"item.icon\" [style]=\"item.iconStyle\"></x-icon>\r\n </div>\r\n }\r\n <div class=\"x-prompts-item-content\">\r\n @if (item.label) {\r\n <div class=\"x-prompts-item-label\" [class.x-prompts-item-only-label]=\"item.label && !item.description\">\r\n {{ item.label }}\r\n </div>\r\n }\r\n @if (item.description) {\r\n <div\r\n class=\"x-prompts-item-description\"\r\n [class.x-prompts-item-only-description]=\"!item.label && item.description\"\r\n >\r\n {{ item.description }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XPromptsComponent } from './prompts.component';\r\n\r\n@NgModule({\r\n exports: [XPromptsComponent],\r\n imports: [XPromptsComponent]\r\n})\r\nexport class XPromptsModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAGA;;;;AAIG;AACI,MAAM,cAAc,GAAG;AAC9B,MAAM,qBAAqB,GAAG,SAAS;AAEvC;;AAEG;MAEU,gBAAiB,SAAQ,iBAAiB,CAAC,qBAAqB,CAAC,CAAA;AAD9E,IAAA,WAAA,GAAA;;AAEE;;;AAGG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAa;AACnC;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAsB,EAAE,gDAAC;AAC9C;;;AAGG;
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-prompts.mjs","sources":["../../../../lib/ng-nest/ui/prompts/prompts.property.ts","../../../../lib/ng-nest/ui/prompts/prompts.component.ts","../../../../lib/ng-nest/ui/prompts/prompts.component.html","../../../../lib/ng-nest/ui/prompts/prompts.module.ts","../../../../lib/ng-nest/ui/prompts/ng-nest-ui-prompts.ts"],"sourcesContent":["import { Component, input, output } from '@angular/core';\r\nimport { XBoolean, XData, XIdentityProperty, XPropertyFunction, XStyle, XTemplate, XToBoolean } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Prompts\r\n * @selector x-prompts\r\n * @decorator component\r\n */\r\nexport const XPromptsPrefix = 'x-prompts';\r\nconst X_PROPMTS_CONFIG_NAME = 'prompts';\r\n\r\n/**\r\n * Prompts Property\r\n */\r\n@Component({ selector: `${XPromptsPrefix}-property`, template: '' })\r\nexport class XPromptsProperty extends XPropertyFunction(X_PROPMTS_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 显示标题,支持自定义模板\r\n * @en_US Display title, support custom template\r\n */\r\n readonly title = input<XTemplate>();\r\n /**\r\n * @zh_CN 列表数据\r\n * @en_US List data\r\n */\r\n readonly data = input<XData<XPromptsNode>>([]);\r\n /**\r\n * @zh_CN 纵向展示\r\n * @en_US List vertical display\r\n */\r\n readonly vertical = input<boolean, XBoolean>(this.config?.vertical ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN wrap\r\n * @en_US List wrap display\r\n */\r\n readonly wrap = input<boolean, XBoolean>(this.config?.wrap ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN Item 点击事件\r\n * @en_US Item click event\r\n */\r\n readonly itemClick = output<XPromptsNode>();\r\n}\r\n\r\n/**\r\n * @zh_CN 提示词\r\n * @en_US Promtp\r\n */\r\nexport interface XPromptsNode extends XIdentityProperty {\r\n /**\r\n * @zh_CN 描述\r\n * @en_US Description\r\n */\r\n description?: string;\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 style\r\n */\r\n style?: XStyle;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n iconStyle?: XStyle;\r\n /**\r\n * @zh_CN 是否禁用\r\n * @en_US Whether to disable\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 自定义属性\r\n * @en_US Custom attributes\r\n */\r\n [property: string]: any;\r\n}\r\n","import { ChangeDetectionStrategy, Component, signal, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\nimport { XPromptsProperty, XPromptsNode } from './prompts.property';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\nimport { XIsChange, XSetData } from '@ng-nest/ui/core';\r\nimport { Subject } from 'rxjs';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\n\r\n@Component({\r\n selector: 'x-prompts',\r\n templateUrl: './prompts.component.html',\r\n styleUrls: ['./prompts.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [XOutletDirective, XIconComponent]\r\n})\r\nexport class XPromptsComponent extends XPromptsProperty {\r\n nodes = signal<XPromptsNode[]>([]);\r\n\r\n unSubject = new Subject<void>();\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.complete();\r\n }\r\n\r\n onItemClick(node: XPromptsNode) {\r\n this.itemClick.emit(node);\r\n }\r\n\r\n private setData() {\r\n XSetData<XPromptsNode>(this.data(), this.unSubject, true).subscribe((x) => {\r\n this.nodes.set(x);\r\n });\r\n }\r\n}\r\n","<div class=\"x-prompts\" [class.x-prompts-vertical]=\"vertical()\" [class.x-prompts-wrap]=\"wrap()\">\r\n <div class=\"x-prompts-title\">\r\n <ng-container *xOutlet=\"title()\">{{ title() }}</ng-container>\r\n </div>\r\n <div class=\"x-prompts-list\">\r\n @for (item of nodes(); track item.id) {\r\n <div class=\"x-prompts-item\" [class.x-disabled]=\"item.disabled\" [style]=\"item.style\" (click)=\"onItemClick(item)\">\r\n @if (item.icon) {\r\n <div class=\"x-prompts-item-icon\">\r\n <x-icon [type]=\"item.icon\" [style]=\"item.iconStyle\"></x-icon>\r\n </div>\r\n }\r\n <div class=\"x-prompts-item-content\">\r\n @if (item.label) {\r\n <div class=\"x-prompts-item-label\" [class.x-prompts-item-only-label]=\"item.label && !item.description\">\r\n {{ item.label }}\r\n </div>\r\n }\r\n @if (item.description) {\r\n <div\r\n class=\"x-prompts-item-description\"\r\n [class.x-prompts-item-only-description]=\"!item.label && item.description\"\r\n >\r\n {{ item.description }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XPromptsComponent } from './prompts.component';\r\n\r\n@NgModule({\r\n exports: [XPromptsComponent],\r\n imports: [XPromptsComponent]\r\n})\r\nexport class XPromptsModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAGA;;;;AAIG;AACI,MAAM,cAAc,GAAG;AAC9B,MAAM,qBAAqB,GAAG,SAAS;AAEvC;;AAEG;MAEU,gBAAiB,SAAQ,iBAAiB,CAAC,qBAAqB,CAAC,CAAA;AAD9E,IAAA,WAAA,GAAA;;AAEE;;;AAGG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAa;AACnC;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAsB,EAAE,gDAAC;AAC9C;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAoB,IAAI,CAAC,MAAM,EAAE,QAAQ,IAAI,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,UAAA,EAAA,GAAA,EAAA,CAAA,EAAI,SAAS,EAAE,UAAU,GAAG;AACvG;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAoB,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,MAAA,EAAA,GAAA,EAAA,CAAA,EAAI,SAAS,EAAE,UAAU,GAAG;AAC/F;;;AAGG;QACM,IAAA,CAAA,SAAS,GAAG,MAAM,EAAgB;AAC5C,IAAA;iIA1BY,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EA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AA,EAAA,CAAA,CAAA;;2FAEhB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB;AAC5B,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -31,17 +31,17 @@ class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {
|
|
|
31
31
|
* @zh_CN 按钮样式
|
|
32
32
|
* @en_US Button style
|
|
33
33
|
*/
|
|
34
|
-
this.button = input(false, ...(ngDevMode ?
|
|
34
|
+
this.button = input(false, { ...(ngDevMode ? { debugName: "button" } : {}), transform: XToBoolean });
|
|
35
35
|
/**
|
|
36
36
|
* @zh_CN 图标样式
|
|
37
37
|
* @en_US Icon style
|
|
38
38
|
*/
|
|
39
|
-
this.icon = input(false, ...(ngDevMode ?
|
|
39
|
+
this.icon = input(false, { ...(ngDevMode ? { debugName: "icon" } : {}), transform: XToBoolean });
|
|
40
40
|
/**
|
|
41
41
|
* @zh_CN tag 标签样式
|
|
42
42
|
* @en_US Tag style
|
|
43
43
|
*/
|
|
44
|
-
this.tag = input(false, ...(ngDevMode ?
|
|
44
|
+
this.tag = input(false, { ...(ngDevMode ? { debugName: "tag" } : {}), transform: XToBoolean });
|
|
45
45
|
/**
|
|
46
46
|
* @zh_CN 按钮/图标/ tag 标签样式时生效
|
|
47
47
|
* @en_US Take effect when button style
|
|
@@ -51,22 +51,22 @@ class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {
|
|
|
51
51
|
* @zh_CN tag 标签边框
|
|
52
52
|
* @en_US Tag bordered
|
|
53
53
|
*/
|
|
54
|
-
this.tagBordered = input(true, ...(ngDevMode ?
|
|
54
|
+
this.tagBordered = input(true, { ...(ngDevMode ? { debugName: "tagBordered" } : {}), transform: XToBoolean });
|
|
55
55
|
/**
|
|
56
56
|
* @zh_CN tag 标签深色主题
|
|
57
57
|
* @en_US Tag dark theme
|
|
58
58
|
*/
|
|
59
|
-
this.tagDark = input(false, ...(ngDevMode ?
|
|
59
|
+
this.tagDark = input(false, { ...(ngDevMode ? { debugName: "tagDark" } : {}), transform: XToBoolean });
|
|
60
60
|
/**
|
|
61
61
|
* @zh_CN 允许取消选中
|
|
62
62
|
* @en_US Allow cancel checked
|
|
63
63
|
*/
|
|
64
|
-
this.allowCancel = input(false, ...(ngDevMode ?
|
|
64
|
+
this.allowCancel = input(false, { ...(ngDevMode ? { debugName: "allowCancel" } : {}), transform: XToBoolean });
|
|
65
65
|
/**
|
|
66
66
|
* @zh_CN 垂直布局,不支持 button 和 icon 样式
|
|
67
67
|
* @en_US Vertical layout, does not support button and icon styles
|
|
68
68
|
*/
|
|
69
|
-
this.vertical = input(false, ...(ngDevMode ?
|
|
69
|
+
this.vertical = input(false, { ...(ngDevMode ? { debugName: "vertical" } : {}), transform: XToBoolean });
|
|
70
70
|
/**
|
|
71
71
|
* @zh_CN 标签
|
|
72
72
|
* @en_US Label
|
|
@@ -76,7 +76,7 @@ class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {
|
|
|
76
76
|
* @zh_CN 标签宽度
|
|
77
77
|
* @en_US Label width
|
|
78
78
|
*/
|
|
79
|
-
this.labelWidth = input('', ...(ngDevMode ?
|
|
79
|
+
this.labelWidth = input('', { ...(ngDevMode ? { debugName: "labelWidth" } : {}), transform: XToCssPixelValue });
|
|
80
80
|
/**
|
|
81
81
|
* @zh_CN 标签文字对齐方式
|
|
82
82
|
* @en_US Label text alignment method
|
|
@@ -101,12 +101,12 @@ class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {
|
|
|
101
101
|
* @zh_CN 禁用
|
|
102
102
|
* @en_US Disabled
|
|
103
103
|
*/
|
|
104
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
104
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: XToBoolean });
|
|
105
105
|
/**
|
|
106
106
|
* @zh_CN 必填
|
|
107
107
|
* @en_US Required
|
|
108
108
|
*/
|
|
109
|
-
this.required = input(false, ...(ngDevMode ?
|
|
109
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: XToBoolean });
|
|
110
110
|
/**
|
|
111
111
|
* @zh_CN 前置标签
|
|
112
112
|
* @en_US Before label
|
|
@@ -118,10 +118,10 @@ class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {
|
|
|
118
118
|
*/
|
|
119
119
|
this.after = input(...(ngDevMode ? [undefined, { debugName: "after" }] : []));
|
|
120
120
|
}
|
|
121
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
122
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
121
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
122
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: XRadioProperty, isStandalone: true, selector: "x-radio-property", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, button: { classPropertyName: "button", publicName: "button", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, tag: { classPropertyName: "tag", publicName: "tag", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, tagBordered: { classPropertyName: "tagBordered", publicName: "tagBordered", isSignal: true, isRequired: false, transformFunction: null }, tagDark: { classPropertyName: "tagDark", publicName: "tagDark", isSignal: true, isRequired: false, transformFunction: null }, allowCancel: { classPropertyName: "allowCancel", publicName: "allowCancel", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, labelAlign: { classPropertyName: "labelAlign", publicName: "labelAlign", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, before: { classPropertyName: "before", publicName: "before", isSignal: true, isRequired: false, transformFunction: null }, after: { classPropertyName: "after", publicName: "after", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
123
123
|
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioProperty, decorators: [{
|
|
125
125
|
type: Component,
|
|
126
126
|
args: [{ selector: `${XRadioPrefix}-property`, template: '' }]
|
|
127
127
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], button: [{ type: i0.Input, args: [{ isSignal: true, alias: "button", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], tag: [{ type: i0.Input, args: [{ isSignal: true, alias: "tag", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], tagBordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagBordered", required: false }] }], tagDark: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagDark", required: false }] }], allowCancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCancel", required: false }] }], vertical: [{ type: i0.Input, args: [{ isSignal: true, alias: "vertical", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelWidth", required: false }] }], labelAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelAlign", required: false }] }], justify: [{ type: i0.Input, args: [{ isSignal: true, alias: "justify", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], before: [{ type: i0.Input, args: [{ isSignal: true, alias: "before", required: false }] }], after: [{ type: i0.Input, args: [{ isSignal: true, alias: "after", required: false }] }] } });
|
|
@@ -184,20 +184,20 @@ class XRadioComponent extends XRadioProperty {
|
|
|
184
184
|
this.nodes.set(x);
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
188
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: XRadioComponent, isStandalone: true, selector: "x-radio", providers: [XValueAccessor(XRadioComponent)], viewQueries: [{ propertyName: "radio", first: true, predicate: ["radio"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #radio\r\n class=\"x-radio\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\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-vertical]=\"vertical()\"\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 @if (label()) {\r\n <label\r\n [class.x-radio-label-required]=\"requiredComputed()\"\r\n [style.width]=\"labelWidth()\"\r\n [ngClass]=\"labelMapSignal()\"\r\n *xOutlet=\"label()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n <div class=\"x-radio-row\">\r\n @if (before()) {\r\n <div class=\"x-radio-row-before\">\r\n <ng-container *xOutlet=\"before()\">{{ before() }}</ng-container>\r\n </div>\r\n }\r\n <div class=\"x-radio-row-list\">\r\n @switch (radioType()) {\r\n @case ('initial') {\r\n @for (item of nodes(); track item.id) {\r\n <div\r\n class=\"x-radio-row-item\"\r\n [class.x-checked]=\"item.id === value()\"\r\n [class.x-disabled]=\"disabledComputed() || 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 }\r\n }\r\n @case ('button') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('icon') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('tag') {\r\n @for (item of nodes(); track item.id) {\r\n <x-tag\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]=\"disabledComputed() || item.disabled!\"\r\n [selected]=\"value() === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n }\r\n }\r\n }\r\n </div>\r\n @if (after()) {\r\n <div class=\"x-radio-row-after\">\r\n <ng-container *xOutlet=\"after()\">{{ after() }}</ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-radio{margin:0;padding:0}.x-radio{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:var(--x-height-medium);line-height:var(--x-height-medium);position:relative;color:var(--x-text-300);font-weight:500}.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:var(--x-height-medium);line-height:var(--x-height-medium)}.x-radio-row .x-radio-row-before,.x-radio-row .x-radio-row-after{border-radius:var(--x-border-radius);background-color:var(--x-background-a200);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:var(--x-font-size)}.x-radio-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:var(--x-font-size);font-size:var(--x-font-size);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);border-width:.375rem}.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-a900);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-vertical .x-radio-row-list{flex-direction:column;align-items:flex-start}.x-radio-vertical .x-radio-row-list x-tag{margin-left:0}.x-radio-vertical .x-radio-row-list x-tag:not(:first-child){margin-top:.25rem}.x-radio-vertical .x-radio-row-item{margin-right:0}.x-radio-vertical .x-radio-row-item:not(:first-child){margin-top:.25rem}.x-radio-box{border:var(--x-border-width) solid var(--x-border);border-radius:100%;width:calc(var(--x-height-medium) - .875rem);height:calc(var(--x-height-medium) - .875rem);background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .2s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.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,.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:0}.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,.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:0}.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-a900);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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: XButtonComponent, selector: "x-button" }, { kind: "component", type: XButtonsComponent, selector: "x-buttons" }, { kind: "component", type: XTagComponent, selector: "x-tag" }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
187
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
188
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: XRadioComponent, isStandalone: true, selector: "x-radio", providers: [XValueAccessor(XRadioComponent)], viewQueries: [{ propertyName: "radio", first: true, predicate: ["radio"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #radio\r\n class=\"x-radio\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\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-vertical]=\"vertical()\"\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 @if (label()) {\r\n <label\r\n [class.x-radio-label-required]=\"requiredComputed()\"\r\n [style.width]=\"labelWidth()\"\r\n [ngClass]=\"labelMapSignal()\"\r\n *xOutlet=\"label()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n <div class=\"x-radio-row\">\r\n @if (before()) {\r\n <div class=\"x-radio-row-before\">\r\n <ng-container *xOutlet=\"before()\">{{ before() }}</ng-container>\r\n </div>\r\n }\r\n <div class=\"x-radio-row-list\">\r\n @switch (radioType()) {\r\n @case ('initial') {\r\n @for (item of nodes(); track item.id) {\r\n <div\r\n class=\"x-radio-row-item\"\r\n [class.x-checked]=\"item.id === value()\"\r\n [class.x-disabled]=\"disabledComputed() || 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 }\r\n }\r\n @case ('button') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('icon') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('tag') {\r\n @for (item of nodes(); track item.id) {\r\n <x-tag\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]=\"disabledComputed() || item.disabled!\"\r\n [selected]=\"value() === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n }\r\n }\r\n }\r\n </div>\r\n @if (after()) {\r\n <div class=\"x-radio-row-after\">\r\n <ng-container *xOutlet=\"after()\">{{ after() }}</ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-radio{margin:0;padding:0}.x-radio{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:var(--x-height-medium);line-height:var(--x-height-medium);position:relative;color:var(--x-text-300);font-weight:500}.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:var(--x-height-medium);line-height:var(--x-height-medium)}.x-radio-row .x-radio-row-before,.x-radio-row .x-radio-row-after{border-radius:var(--x-border-radius);background-color:var(--x-background-a200);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:var(--x-font-size)}.x-radio-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:var(--x-font-size);font-size:var(--x-font-size);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);border-width:.375rem}.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-a900);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-vertical .x-radio-row-list{flex-direction:column;align-items:flex-start}.x-radio-vertical .x-radio-row-list x-tag{margin-left:0}.x-radio-vertical .x-radio-row-list x-tag:not(:first-child){margin-top:.25rem}.x-radio-vertical .x-radio-row-item{margin-right:0}.x-radio-vertical .x-radio-row-item:not(:first-child){margin-top:.25rem}.x-radio-box{border:var(--x-border-width) solid var(--x-border);border-radius:100%;width:calc(var(--x-height-medium) - .875rem);height:calc(var(--x-height-medium) - .875rem);background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .2s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.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,.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:0}.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,.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:0}.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-a900);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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: XButtonComponent, selector: "x-button" }, { kind: "component", type: XButtonsComponent, selector: "x-buttons" }, { kind: "component", type: XTagComponent, selector: "x-tag" }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
189
189
|
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioComponent, decorators: [{
|
|
191
191
|
type: Component,
|
|
192
192
|
args: [{ selector: `${XRadioPrefix}`, imports: [NgClass, FormsModule, XButtonComponent, XButtonsComponent, XTagComponent, XOutletDirective], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XRadioComponent)], template: "<div\r\n #radio\r\n class=\"x-radio\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\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-vertical]=\"vertical()\"\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 @if (label()) {\r\n <label\r\n [class.x-radio-label-required]=\"requiredComputed()\"\r\n [style.width]=\"labelWidth()\"\r\n [ngClass]=\"labelMapSignal()\"\r\n *xOutlet=\"label()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n <div class=\"x-radio-row\">\r\n @if (before()) {\r\n <div class=\"x-radio-row-before\">\r\n <ng-container *xOutlet=\"before()\">{{ before() }}</ng-container>\r\n </div>\r\n }\r\n <div class=\"x-radio-row-list\">\r\n @switch (radioType()) {\r\n @case ('initial') {\r\n @for (item of nodes(); track item.id) {\r\n <div\r\n class=\"x-radio-row-item\"\r\n [class.x-checked]=\"item.id === value()\"\r\n [class.x-disabled]=\"disabledComputed() || 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 }\r\n }\r\n @case ('button') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('icon') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('tag') {\r\n @for (item of nodes(); track item.id) {\r\n <x-tag\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]=\"disabledComputed() || item.disabled!\"\r\n [selected]=\"value() === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n }\r\n }\r\n }\r\n </div>\r\n @if (after()) {\r\n <div class=\"x-radio-row-after\">\r\n <ng-container *xOutlet=\"after()\">{{ after() }}</ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-radio{margin:0;padding:0}.x-radio{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:var(--x-height-medium);line-height:var(--x-height-medium);position:relative;color:var(--x-text-300);font-weight:500}.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:var(--x-height-medium);line-height:var(--x-height-medium)}.x-radio-row .x-radio-row-before,.x-radio-row .x-radio-row-after{border-radius:var(--x-border-radius);background-color:var(--x-background-a200);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:var(--x-font-size)}.x-radio-row-item{position:relative;display:inline-flex;align-items:center;white-space:nowrap;outline:none;margin-right:var(--x-font-size);font-size:var(--x-font-size);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);border-width:.375rem}.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-a900);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-vertical .x-radio-row-list{flex-direction:column;align-items:flex-start}.x-radio-vertical .x-radio-row-list x-tag{margin-left:0}.x-radio-vertical .x-radio-row-list x-tag:not(:first-child){margin-top:.25rem}.x-radio-vertical .x-radio-row-item{margin-right:0}.x-radio-vertical .x-radio-row-item:not(:first-child){margin-top:.25rem}.x-radio-box{border:var(--x-border-width) solid var(--x-border);border-radius:100%;width:calc(var(--x-height-medium) - .875rem);height:calc(var(--x-height-medium) - .875rem);background-color:var(--x-background-a100);position:relative;box-sizing:border-box;transition:all .2s;display:inline-flex;align-items:center;justify-content:center}.x-radio-box:hover{border-color:var(--x-primary)}.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,.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:0}.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,.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:0}.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-a900);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"] }]
|
|
193
193
|
}], propDecorators: { radio: [{ type: i0.ViewChild, args: ['radio', { ...{ read: (ElementRef) }, isSignal: true }] }] } });
|
|
194
194
|
|
|
195
195
|
class XRadioModule {
|
|
196
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
197
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.
|
|
198
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.
|
|
196
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
197
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: XRadioModule, imports: [XRadioComponent], exports: [XRadioComponent] }); }
|
|
198
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioModule, imports: [XRadioComponent] }); }
|
|
199
199
|
}
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRadioModule, decorators: [{
|
|
201
201
|
type: NgModule,
|
|
202
202
|
args: [{
|
|
203
203
|
exports: [XRadioComponent],
|
|
@@ -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 { XToBoolean, XToCssPixelValue } from '@ng-nest/ui/core';\r\nimport { Component, input } from '@angular/core';\r\nimport { XButtonType } from '@ng-nest/ui/button';\r\nimport { XFormControlFunction, XFormOption } from '@ng-nest/ui/base-form';\r\nimport type {\r\n XData,\r\n XIdentityProperty,\r\n XBoolean,\r\n XTemplate,\r\n XDirection,\r\n XAlign,\r\n XJustify,\r\n XNumber\r\n} from '@ng-nest/ui/core';\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_RADIO_CONFIG_NAME = 'radio';\r\n\r\n/**\r\n * Radio Property\r\n */\r\n@Component({ selector: `${XRadioPrefix}-property`, template: '' })\r\nexport class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n readonly data = input<XData<XRadioNode>>([]);\r\n /**\r\n * @zh_CN 按钮样式\r\n * @en_US Button style\r\n */\r\n readonly button = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n readonly icon = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN tag 标签样式\r\n * @en_US Tag style\r\n */\r\n readonly tag = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 按钮/图标/ tag 标签样式时生效\r\n * @en_US Take effect when button style\r\n */\r\n readonly type = input<XButtonType>('initial');\r\n /**\r\n * @zh_CN tag 标签边框\r\n * @en_US Tag bordered\r\n */\r\n readonly tagBordered = input<boolean, XBoolean>(true, { transform: XToBoolean });\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n readonly tagDark = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 允许取消选中\r\n * @en_US Allow cancel checked\r\n */\r\n readonly allowCancel = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 垂直布局,不支持 button 和 icon 样式\r\n * @en_US Vertical layout, does not support button and icon styles\r\n */\r\n readonly vertical = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n override readonly label = input<XTemplate>('');\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n override readonly labelWidth = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n override readonly labelAlign = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n override readonly justify = input<XJustify>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n override readonly align = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n override readonly direction = input<XDirection>('column');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n override readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n override readonly required = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n override readonly before = input<XTemplate>();\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n override readonly after = input<XTemplate>();\r\n}\r\n\r\n/**\r\n * Radio Option\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?: boolean;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n icon?: boolean;\r\n /**\r\n * @zh_CN tag 标签样式\r\n * @en_US Tag style\r\n */\r\n tag?: boolean;\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?: boolean;\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n tagDark?: boolean;\r\n /**\r\n * @zh_CN 允许取消选中\r\n * @en_US Allow cancel checked\r\n */\r\n allowCancel?: boolean;\r\n /**\r\n * @zh_CN 垂直布局,不支持 button 和 icon 样式\r\n * @en_US Vertical layout, does not support button and icon styles\r\n */\r\n vertical?: boolean;\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n label?: string;\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n labelWidth?: string;\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n labelAlign?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n justify?: XJustify;\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n align?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n direction?: XDirection;\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 Required\r\n */\r\n required?: boolean;\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 ElementRef,\r\n OnChanges,\r\n SimpleChanges,\r\n TemplateRef,\r\n OnDestroy,\r\n viewChild,\r\n signal,\r\n computed\r\n} from '@angular/core';\r\nimport { XRadioPrefix, XRadioNode, XRadioProperty } from './radio.property';\r\nimport { Subject } from 'rxjs';\r\nimport { XIsChange, XSetData } from '@ng-nest/ui/core';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\nimport { NgClass } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonComponent, XButtonsComponent } from '@ng-nest/ui/button';\r\nimport { XTagComponent } from '@ng-nest/ui/tag';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\n\r\n@Component({\r\n selector: `${XRadioPrefix}`,\r\n imports: [NgClass, FormsModule, XButtonComponent, XButtonsComponent, XTagComponent, XOutletDirective],\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, OnDestroy {\r\n radio = viewChild.required('radio', { read: ElementRef<HTMLElement> });\r\n nodes = signal<XRadioNode[]>([]);\r\n private unSubject = new Subject<void>();\r\n\r\n beforeIsTemplate = computed(() => this.before() instanceof TemplateRef);\r\n afterIsTemplate = computed(() => this.after() instanceof TemplateRef);\r\n\r\n classMap = computed(() => ({\r\n [`x-justify-${this.justify()}`]: !!this.justify(),\r\n [`x-align-${this.align()}`]: !!this.align(),\r\n [`x-direction-${this.direction()}`]: !!this.direction()\r\n }));\r\n labelMapSignal = computed(() => ({\r\n [`x-text-align-${this.labelAlign()}`]: !!this.labelAlign()\r\n }));\r\n radioType = computed(() => {\r\n if (this.button()) {\r\n return 'button';\r\n } else if (this.icon()) {\r\n return 'icon';\r\n } else if (this.tag()) {\r\n return 'tag';\r\n } else {\r\n return 'initial';\r\n }\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.complete();\r\n }\r\n\r\n radioClick(event: Event, node: XRadioNode) {\r\n event.preventDefault();\r\n if (this.disabledComputed() || 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.set(null);\r\n } else {\r\n this.value.set(node.id);\r\n }\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.set(x);\r\n });\r\n }\r\n}\r\n","<div\r\n #radio\r\n class=\"x-radio\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\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-vertical]=\"vertical()\"\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 @if (label()) {\r\n <label\r\n [class.x-radio-label-required]=\"requiredComputed()\"\r\n [style.width]=\"labelWidth()\"\r\n [ngClass]=\"labelMapSignal()\"\r\n *xOutlet=\"label()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n <div class=\"x-radio-row\">\r\n @if (before()) {\r\n <div class=\"x-radio-row-before\">\r\n <ng-container *xOutlet=\"before()\">{{ before() }}</ng-container>\r\n </div>\r\n }\r\n <div class=\"x-radio-row-list\">\r\n @switch (radioType()) {\r\n @case ('initial') {\r\n @for (item of nodes(); track item.id) {\r\n <div\r\n class=\"x-radio-row-item\"\r\n [class.x-checked]=\"item.id === value()\"\r\n [class.x-disabled]=\"disabledComputed() || 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 }\r\n }\r\n @case ('button') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('icon') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('tag') {\r\n @for (item of nodes(); track item.id) {\r\n <x-tag\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]=\"disabledComputed() || item.disabled!\"\r\n [selected]=\"value() === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n }\r\n }\r\n }\r\n </div>\r\n @if (after()) {\r\n <div class=\"x-radio-row-after\">\r\n <ng-container *xOutlet=\"after()\">{{ after() }}</ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XRadioComponent } from './radio.component';\r\n\r\n@NgModule({\r\n exports: [XRadioComponent],\r\n imports: [XRadioComponent]\r\n})\r\nexport class XRadioModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAeA;;;;AAIG;AACI,MAAM,YAAY,GAAG;AAC5B,MAAM,mBAAmB,GAAG,OAAO;AAEnC;;AAEG;MAEU,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,CAAC,CAAA;AAD7E,IAAA,WAAA,GAAA;;AAEE;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAoB,EAAE,gDAAC;AAC5C;;;AAGG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAoB,KAAK,0CAAI,SA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,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAFb,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAEd,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,eAAe;AAC1B,iBAAA;;;ACND;;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 { XToBoolean, XToCssPixelValue } from '@ng-nest/ui/core';\r\nimport { Component, input } from '@angular/core';\r\nimport { XButtonType } from '@ng-nest/ui/button';\r\nimport { XFormControlFunction, XFormOption } from '@ng-nest/ui/base-form';\r\nimport type {\r\n XData,\r\n XIdentityProperty,\r\n XBoolean,\r\n XTemplate,\r\n XDirection,\r\n XAlign,\r\n XJustify,\r\n XNumber\r\n} from '@ng-nest/ui/core';\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_RADIO_CONFIG_NAME = 'radio';\r\n\r\n/**\r\n * Radio Property\r\n */\r\n@Component({ selector: `${XRadioPrefix}-property`, template: '' })\r\nexport class XRadioProperty extends XFormControlFunction(X_RADIO_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 单选框数据\r\n * @en_US Radio data\r\n */\r\n readonly data = input<XData<XRadioNode>>([]);\r\n /**\r\n * @zh_CN 按钮样式\r\n * @en_US Button style\r\n */\r\n readonly button = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n readonly icon = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN tag 标签样式\r\n * @en_US Tag style\r\n */\r\n readonly tag = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 按钮/图标/ tag 标签样式时生效\r\n * @en_US Take effect when button style\r\n */\r\n readonly type = input<XButtonType>('initial');\r\n /**\r\n * @zh_CN tag 标签边框\r\n * @en_US Tag bordered\r\n */\r\n readonly tagBordered = input<boolean, XBoolean>(true, { transform: XToBoolean });\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n readonly tagDark = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 允许取消选中\r\n * @en_US Allow cancel checked\r\n */\r\n readonly allowCancel = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 垂直布局,不支持 button 和 icon 样式\r\n * @en_US Vertical layout, does not support button and icon styles\r\n */\r\n readonly vertical = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n override readonly label = input<XTemplate>('');\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n override readonly labelWidth = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n override readonly labelAlign = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n override readonly justify = input<XJustify>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n override readonly align = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n override readonly direction = input<XDirection>('column');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n override readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n override readonly required = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n override readonly before = input<XTemplate>();\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n override readonly after = input<XTemplate>();\r\n}\r\n\r\n/**\r\n * Radio Option\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?: boolean;\r\n /**\r\n * @zh_CN 图标样式\r\n * @en_US Icon style\r\n */\r\n icon?: boolean;\r\n /**\r\n * @zh_CN tag 标签样式\r\n * @en_US Tag style\r\n */\r\n tag?: boolean;\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?: boolean;\r\n /**\r\n * @zh_CN tag 标签深色主题\r\n * @en_US Tag dark theme\r\n */\r\n tagDark?: boolean;\r\n /**\r\n * @zh_CN 允许取消选中\r\n * @en_US Allow cancel checked\r\n */\r\n allowCancel?: boolean;\r\n /**\r\n * @zh_CN 垂直布局,不支持 button 和 icon 样式\r\n * @en_US Vertical layout, does not support button and icon styles\r\n */\r\n vertical?: boolean;\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n label?: string;\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n labelWidth?: string;\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n labelAlign?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n justify?: XJustify;\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n align?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n direction?: XDirection;\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 Required\r\n */\r\n required?: boolean;\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 ElementRef,\r\n OnChanges,\r\n SimpleChanges,\r\n TemplateRef,\r\n OnDestroy,\r\n viewChild,\r\n signal,\r\n computed\r\n} from '@angular/core';\r\nimport { XRadioPrefix, XRadioNode, XRadioProperty } from './radio.property';\r\nimport { Subject } from 'rxjs';\r\nimport { XIsChange, XSetData } from '@ng-nest/ui/core';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\nimport { NgClass } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonComponent, XButtonsComponent } from '@ng-nest/ui/button';\r\nimport { XTagComponent } from '@ng-nest/ui/tag';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\n\r\n@Component({\r\n selector: `${XRadioPrefix}`,\r\n imports: [NgClass, FormsModule, XButtonComponent, XButtonsComponent, XTagComponent, XOutletDirective],\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, OnDestroy {\r\n radio = viewChild.required('radio', { read: ElementRef<HTMLElement> });\r\n nodes = signal<XRadioNode[]>([]);\r\n private unSubject = new Subject<void>();\r\n\r\n beforeIsTemplate = computed(() => this.before() instanceof TemplateRef);\r\n afterIsTemplate = computed(() => this.after() instanceof TemplateRef);\r\n\r\n classMap = computed(() => ({\r\n [`x-justify-${this.justify()}`]: !!this.justify(),\r\n [`x-align-${this.align()}`]: !!this.align(),\r\n [`x-direction-${this.direction()}`]: !!this.direction()\r\n }));\r\n labelMapSignal = computed(() => ({\r\n [`x-text-align-${this.labelAlign()}`]: !!this.labelAlign()\r\n }));\r\n radioType = computed(() => {\r\n if (this.button()) {\r\n return 'button';\r\n } else if (this.icon()) {\r\n return 'icon';\r\n } else if (this.tag()) {\r\n return 'tag';\r\n } else {\r\n return 'initial';\r\n }\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.complete();\r\n }\r\n\r\n radioClick(event: Event, node: XRadioNode) {\r\n event.preventDefault();\r\n if (this.disabledComputed() || 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.set(null);\r\n } else {\r\n this.value.set(node.id);\r\n }\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.set(x);\r\n });\r\n }\r\n}\r\n","<div\r\n #radio\r\n class=\"x-radio\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\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-vertical]=\"vertical()\"\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 @if (label()) {\r\n <label\r\n [class.x-radio-label-required]=\"requiredComputed()\"\r\n [style.width]=\"labelWidth()\"\r\n [ngClass]=\"labelMapSignal()\"\r\n *xOutlet=\"label()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n <div class=\"x-radio-row\">\r\n @if (before()) {\r\n <div class=\"x-radio-row-before\">\r\n <ng-container *xOutlet=\"before()\">{{ before() }}</ng-container>\r\n </div>\r\n }\r\n <div class=\"x-radio-row-list\">\r\n @switch (radioType()) {\r\n @case ('initial') {\r\n @for (item of nodes(); track item.id) {\r\n <div\r\n class=\"x-radio-row-item\"\r\n [class.x-checked]=\"item.id === value()\"\r\n [class.x-disabled]=\"disabledComputed() || 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 }\r\n }\r\n @case ('button') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('icon') {\r\n <x-buttons boxShadow=\"false\">\r\n @for (item of nodes(); track item.id) {\r\n <x-button\r\n [icon]=\"item.icon!\"\r\n [size]=\"size()\"\r\n [type]=\"type()\"\r\n [activated]=\"item.id === value()\"\r\n [disabled]=\"disabledComputed() || item.disabled!\"\r\n attrType=\"button\"\r\n (click)=\"radioClick($event, item)\"\r\n plain\r\n >{{ item.label }}</x-button\r\n >\r\n }\r\n </x-buttons>\r\n }\r\n @case ('tag') {\r\n @for (item of nodes(); track item.id) {\r\n <x-tag\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]=\"disabledComputed() || item.disabled!\"\r\n [selected]=\"value() === item.id\"\r\n (click)=\"radioClick($event, item)\"\r\n >{{ item.label }}</x-tag\r\n >\r\n }\r\n }\r\n }\r\n </div>\r\n @if (after()) {\r\n <div class=\"x-radio-row-after\">\r\n <ng-container *xOutlet=\"after()\">{{ after() }}</ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XRadioComponent } from './radio.component';\r\n\r\n@NgModule({\r\n exports: [XRadioComponent],\r\n imports: [XRadioComponent]\r\n})\r\nexport class XRadioModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAeA;;;;AAIG;AACI,MAAM,YAAY,GAAG;AAC5B,MAAM,mBAAmB,GAAG,OAAO;AAEnC;;AAEG;MAEU,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,CAAC,CAAA;AAD7E,IAAA,WAAA,GAAA;;AAEE;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAoB,EAAE,gDAAC;AAC5C;;;AAGG;QACM,IAA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B,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC,CAAC,cAAc,CAAA,eAAA,CAAiB,CAAC,EAAA,QAAA,EAAA,ooHAAA,EAAA,MAAA,EAAA,CAAA,ozMAAA,CAAA,EAAA;AAGjB,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,OAAO,OAAE,EAAE,IAAI,GAAE,UAAuB,CAAA,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ME1B1D,YAAY,CAAA;iIAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAZ,YAAY,EAAA,OAAA,EAAA,CAFb,eAAe,CAAA,EAAA,OAAA,EAAA,CADf,eAAe,CAAA,EAAA,CAAA,CAAA;AAGd,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAFb,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAEd,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,eAAe;AAC1B,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -23,12 +23,12 @@ class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {
|
|
|
23
23
|
* @zh_CN 评分个数
|
|
24
24
|
* @en_US Number of ratings
|
|
25
25
|
*/
|
|
26
|
-
this.count = input(5, ...(ngDevMode ?
|
|
26
|
+
this.count = input(5, { ...(ngDevMode ? { debugName: "count" } : {}), transform: XToNumber });
|
|
27
27
|
/**
|
|
28
28
|
* @zh_CN 半星模式
|
|
29
29
|
* @en_US Number of ratings
|
|
30
30
|
*/
|
|
31
|
-
this.half = input(false, ...(ngDevMode ?
|
|
31
|
+
this.half = input(false, { ...(ngDevMode ? { debugName: "half" } : {}), transform: XToBoolean });
|
|
32
32
|
/**
|
|
33
33
|
* @zh_CN 颜色
|
|
34
34
|
* @en_US Color
|
|
@@ -48,7 +48,7 @@ class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {
|
|
|
48
48
|
* @zh_CN 标签宽度
|
|
49
49
|
* @en_US Label width
|
|
50
50
|
*/
|
|
51
|
-
this.labelWidth = input('', ...(ngDevMode ?
|
|
51
|
+
this.labelWidth = input('', { ...(ngDevMode ? { debugName: "labelWidth" } : {}), transform: XToCssPixelValue });
|
|
52
52
|
/**
|
|
53
53
|
* @zh_CN 标签文字对齐方式
|
|
54
54
|
* @en_US Label text alignment method
|
|
@@ -73,17 +73,17 @@ class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {
|
|
|
73
73
|
* @zh_CN 禁用
|
|
74
74
|
* @en_US Disabled
|
|
75
75
|
*/
|
|
76
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
76
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: XToBoolean });
|
|
77
77
|
/**
|
|
78
78
|
* @zh_CN 必填
|
|
79
79
|
* @en_US Required
|
|
80
80
|
*/
|
|
81
|
-
this.required = input(false, ...(ngDevMode ?
|
|
81
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: XToBoolean });
|
|
82
82
|
}
|
|
83
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
84
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
83
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
84
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: XRateProperty, isStandalone: true, selector: "x-rate-property", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, half: { classPropertyName: "half", publicName: "half", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, customTemp: { classPropertyName: "customTemp", publicName: "customTemp", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, labelAlign: { classPropertyName: "labelAlign", publicName: "labelAlign", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
85
85
|
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateProperty, decorators: [{
|
|
87
87
|
type: Component,
|
|
88
88
|
args: [{ selector: `${XRatePrefix}-property`, template: '' }]
|
|
89
89
|
}], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], half: [{ type: i0.Input, args: [{ isSignal: true, alias: "half", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], customTemp: [{ type: i0.Input, args: [{ isSignal: true, alias: "customTemp", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelWidth", required: false }] }], labelAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelAlign", required: false }] }], justify: [{ type: i0.Input, args: [{ isSignal: true, alias: "justify", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
|
|
@@ -170,20 +170,20 @@ class XRateComponent extends XRateProperty {
|
|
|
170
170
|
this.onChange(this.value());
|
|
171
171
|
}
|
|
172
172
|
formControlChanges() { }
|
|
173
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
174
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.
|
|
173
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
174
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: XRateComponent, isStandalone: true, selector: "x-rate", providers: [XValueAccessor(XRateComponent)], viewQueries: [{ propertyName: "rate", first: true, predicate: ["rate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n #rate\r\n class=\"x-rate\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n>\r\n @if (label()) {\r\n <label [class.x-rate-label-required]=\"requiredComputed()\" [style.width]=\"labelWidth()\" [ngClass]=\"labelMapSignal()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <div class=\"x-rate-icons\" (mouseleave)=\"leaveRates()\">\r\n @for (rate of rates(); track rate; let i = $index) {\r\n <div\r\n class=\"x-rate-icon\"\r\n [class.activated]=\"rate <= hoverActivated()\"\r\n [class.half-activated]=\"rate <= hoverHalfActivated()\"\r\n [style.color]=\"rate <= hoverActivated() ? getColor() : ''\"\r\n >\r\n @if (half()) {\r\n <div\r\n class=\"x-rate-half\"\r\n [style.color]=\"rate <= hoverHalfActivated() ? getColor() : ''\"\r\n (mouseenter)=\"rateHalfHover(rate, $event)\"\r\n (click)=\"rateHalfClick(rate, $event)\"\r\n >\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n }\r\n <div class=\"x-rate-back\" (mouseenter)=\"rateHover(rate, $event)\" (click)=\"rateClick(rate, $event)\">\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #iconTpl>\r\n <x-icon type=\"adf-star\"></x-icon>\r\n</ng-template>\r\n", styles: [".x-rate{margin:0;padding:0}.x-rate{width:100%}.x-rate.x-flex{display:flex}.x-rate.x-justify-start{justify-content:flex-start}.x-rate.x-justify-center{justify-content:center}.x-rate.x-justify-end{justify-content:flex-end}.x-rate.x-justify-space-between{justify-content:space-between}.x-rate.x-justify-space-around{justify-content:space-around}.x-rate.x-align-start{align-items:flex-start}.x-rate.x-align-center{align-items:center}.x-rate.x-align-end{align-items:flex-end}.x-rate.x-direction-column{flex-direction:column}.x-rate.x-direction-column-reverse{flex-direction:column-reverse}.x-rate.x-direction-row{flex-direction:row}.x-rate.x-direction-row-reverse{flex-direction:row-reverse}.x-rate>label{display:inline-block;white-space:nowrap;height:var(--x-height-medium);line-height:var(--x-height-medium);position:relative;color:var(--x-text-300);font-weight:500}.x-rate>label.x-text-align-start{text-align:start}.x-rate>label.x-text-align-center{text-align:center}.x-rate>label.x-text-align-end{text-align:end}.x-rate-icons{display:inline-flex;align-items:center;height:var(--x-height-medium);cursor:pointer}.x-rate-icon{margin:0 .2rem;display:flex;align-items:center;position:relative;color:var(--x-info);transition:transform var(--x-animation-duration-base),color var(--x-animation-duration-base);font-size:calc(var(--x-font-size-big) + .125rem)}.x-rate-icon .x-icon{vertical-align:0}.x-rate-icon:hover{transform:scale(1.1)}.x-rate-icon.activated,.x-rate-icon.half-activated .x-rate-half{color:var(--x-warning)}.x-rate-half{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;display:flex;align-items:center}.x-rate-half:hover{opacity:1}.x-rate-back{display:flex;align-items:center}.x-rate-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-rate.x-invalid>label,.x-rate.x-required>label{color:var(--x-danger)}.x-rate.x-disabled .x-rate-icons{cursor:not-allowed;opacity:.8}.x-rate.x-direction-row>label{padding:0 .5rem 0 0}.x-rate.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-rate.x-direction-column,.x-rate.x-direction-column-reverse{align-items:inherit}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: XIconComponent, selector: "x-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
175
175
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateComponent, decorators: [{
|
|
177
177
|
type: Component,
|
|
178
178
|
args: [{ selector: `${XRatePrefix}`, imports: [NgClass, NgTemplateOutlet, FormsModule, XIconComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XRateComponent)], template: "<div\r\n #rate\r\n class=\"x-rate\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n>\r\n @if (label()) {\r\n <label [class.x-rate-label-required]=\"requiredComputed()\" [style.width]=\"labelWidth()\" [ngClass]=\"labelMapSignal()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <div class=\"x-rate-icons\" (mouseleave)=\"leaveRates()\">\r\n @for (rate of rates(); track rate; let i = $index) {\r\n <div\r\n class=\"x-rate-icon\"\r\n [class.activated]=\"rate <= hoverActivated()\"\r\n [class.half-activated]=\"rate <= hoverHalfActivated()\"\r\n [style.color]=\"rate <= hoverActivated() ? getColor() : ''\"\r\n >\r\n @if (half()) {\r\n <div\r\n class=\"x-rate-half\"\r\n [style.color]=\"rate <= hoverHalfActivated() ? getColor() : ''\"\r\n (mouseenter)=\"rateHalfHover(rate, $event)\"\r\n (click)=\"rateHalfClick(rate, $event)\"\r\n >\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n }\r\n <div class=\"x-rate-back\" (mouseenter)=\"rateHover(rate, $event)\" (click)=\"rateClick(rate, $event)\">\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #iconTpl>\r\n <x-icon type=\"adf-star\"></x-icon>\r\n</ng-template>\r\n", styles: [".x-rate{margin:0;padding:0}.x-rate{width:100%}.x-rate.x-flex{display:flex}.x-rate.x-justify-start{justify-content:flex-start}.x-rate.x-justify-center{justify-content:center}.x-rate.x-justify-end{justify-content:flex-end}.x-rate.x-justify-space-between{justify-content:space-between}.x-rate.x-justify-space-around{justify-content:space-around}.x-rate.x-align-start{align-items:flex-start}.x-rate.x-align-center{align-items:center}.x-rate.x-align-end{align-items:flex-end}.x-rate.x-direction-column{flex-direction:column}.x-rate.x-direction-column-reverse{flex-direction:column-reverse}.x-rate.x-direction-row{flex-direction:row}.x-rate.x-direction-row-reverse{flex-direction:row-reverse}.x-rate>label{display:inline-block;white-space:nowrap;height:var(--x-height-medium);line-height:var(--x-height-medium);position:relative;color:var(--x-text-300);font-weight:500}.x-rate>label.x-text-align-start{text-align:start}.x-rate>label.x-text-align-center{text-align:center}.x-rate>label.x-text-align-end{text-align:end}.x-rate-icons{display:inline-flex;align-items:center;height:var(--x-height-medium);cursor:pointer}.x-rate-icon{margin:0 .2rem;display:flex;align-items:center;position:relative;color:var(--x-info);transition:transform var(--x-animation-duration-base),color var(--x-animation-duration-base);font-size:calc(var(--x-font-size-big) + .125rem)}.x-rate-icon .x-icon{vertical-align:0}.x-rate-icon:hover{transform:scale(1.1)}.x-rate-icon.activated,.x-rate-icon.half-activated .x-rate-half{color:var(--x-warning)}.x-rate-half{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;display:flex;align-items:center}.x-rate-half:hover{opacity:1}.x-rate-back{display:flex;align-items:center}.x-rate-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-rate.x-invalid>label,.x-rate.x-required>label{color:var(--x-danger)}.x-rate.x-disabled .x-rate-icons{cursor:not-allowed;opacity:.8}.x-rate.x-direction-row>label{padding:0 .5rem 0 0}.x-rate.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-rate.x-direction-column,.x-rate.x-direction-column-reverse{align-items:inherit}\n"] }]
|
|
179
179
|
}], propDecorators: { rate: [{ type: i0.ViewChild, args: ['rate', { isSignal: true }] }] } });
|
|
180
180
|
|
|
181
181
|
class XRateModule {
|
|
182
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
183
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.
|
|
184
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.
|
|
182
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
183
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: XRateModule, imports: [XRateComponent], exports: [XRateComponent] }); }
|
|
184
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateModule, imports: [XRateComponent] }); }
|
|
185
185
|
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: XRateModule, decorators: [{
|
|
187
187
|
type: NgModule,
|
|
188
188
|
args: [{
|
|
189
189
|
exports: [XRateComponent],
|