ngwr 5.0.3 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/alert/public-api.d.ts +0 -1
  2. package/avatar/public-api.d.ts +0 -1
  3. package/button/public-api.d.ts +0 -1
  4. package/cdk/base.directive.d.ts +6 -1
  5. package/checkbox/public-api.d.ts +0 -1
  6. package/dialog/dialog.module.d.ts +1 -6
  7. package/divider/public-api.d.ts +0 -1
  8. package/dropdown/dropdown-menu-item.component.d.ts +12 -0
  9. package/dropdown/dropdown-menu.component.d.ts +14 -0
  10. package/dropdown/dropdown.directive.d.ts +29 -0
  11. package/dropdown/dropdown.types.d.ts +9 -0
  12. package/dropdown/index.d.ts +5 -0
  13. package/dropdown/public-api.d.ts +10 -0
  14. package/dropdown/styles/_index.scss +91 -0
  15. package/dropdown/styles/vars.scss +18 -0
  16. package/fesm2022/ngwr-alert.mjs +7 -27
  17. package/fesm2022/ngwr-alert.mjs.map +1 -1
  18. package/fesm2022/ngwr-avatar.mjs +7 -27
  19. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  20. package/fesm2022/ngwr-button.mjs +10 -31
  21. package/fesm2022/ngwr-button.mjs.map +1 -1
  22. package/fesm2022/ngwr-cdk.mjs +9 -4
  23. package/fesm2022/ngwr-cdk.mjs.map +1 -1
  24. package/fesm2022/ngwr-checkbox.mjs +5 -24
  25. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  26. package/fesm2022/ngwr-dialog.mjs +130 -148
  27. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  28. package/fesm2022/ngwr-divider.mjs +5 -19
  29. package/fesm2022/ngwr-divider.mjs.map +1 -1
  30. package/fesm2022/ngwr-dropdown.mjs +315 -0
  31. package/fesm2022/ngwr-dropdown.mjs.map +1 -0
  32. package/fesm2022/ngwr-form.mjs +8 -29
  33. package/fesm2022/ngwr-form.mjs.map +1 -1
  34. package/fesm2022/ngwr-icon.mjs +11 -31
  35. package/fesm2022/ngwr-icon.mjs.map +1 -1
  36. package/fesm2022/ngwr-input.mjs +8 -28
  37. package/fesm2022/ngwr-input.mjs.map +1 -1
  38. package/fesm2022/ngwr-pagination.mjs +125 -0
  39. package/fesm2022/ngwr-pagination.mjs.map +1 -0
  40. package/fesm2022/ngwr-pipes.mjs +5 -25
  41. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  42. package/fesm2022/ngwr-progress.mjs +6 -25
  43. package/fesm2022/ngwr-progress.mjs.map +1 -1
  44. package/fesm2022/ngwr-qr.mjs +6 -25
  45. package/fesm2022/ngwr-qr.mjs.map +1 -1
  46. package/fesm2022/ngwr-select.mjs +405 -0
  47. package/fesm2022/ngwr-select.mjs.map +1 -0
  48. package/fesm2022/ngwr-skeleton.mjs +5 -19
  49. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  50. package/fesm2022/ngwr-spinner.mjs +16 -28
  51. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  52. package/fesm2022/ngwr-table.mjs +258 -0
  53. package/fesm2022/ngwr-table.mjs.map +1 -0
  54. package/fesm2022/ngwr-tag.mjs +7 -21
  55. package/fesm2022/ngwr-tag.mjs.map +1 -1
  56. package/fesm2022/ngwr-textarea.mjs +6 -25
  57. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  58. package/form/public-api.d.ts +0 -1
  59. package/icon/public-api.d.ts +0 -1
  60. package/input/public-api.d.ts +0 -1
  61. package/package.json +33 -5
  62. package/pagination/index.d.ts +5 -0
  63. package/pagination/pagination.component.d.ts +23 -0
  64. package/pagination/pagination.types.d.ts +7 -0
  65. package/pagination/public-api.d.ts +8 -0
  66. package/pagination/styles/_index.scss +60 -0
  67. package/pagination/styles/vars.scss +14 -0
  68. package/pipes/public-api.d.ts +0 -1
  69. package/progress/public-api.d.ts +0 -1
  70. package/qr/public-api.d.ts +0 -1
  71. package/select/index.d.ts +5 -0
  72. package/select/public-api.d.ts +10 -0
  73. package/select/select-option-group.component.d.ts +19 -0
  74. package/select/select-option.component.d.ts +22 -0
  75. package/select/select.component.d.ts +63 -0
  76. package/select/select.types.d.ts +17 -0
  77. package/select/styles/_index.scss +237 -0
  78. package/select/styles/vars.scss +32 -0
  79. package/skeleton/index.d.ts +0 -1
  80. package/spinner/index.d.ts +0 -1
  81. package/spinner/spinner.component.d.ts +4 -2
  82. package/spinner/spinner.types.d.ts +7 -0
  83. package/spinner/styles/_index.scss +10 -3
  84. package/styles.scss +4 -0
  85. package/table/index.d.ts +5 -0
  86. package/table/public-api.d.ts +11 -0
  87. package/table/styles/_index.scss +4 -0
  88. package/table/styles/table-filter.scss +202 -0
  89. package/table/styles/table-sort.scss +47 -0
  90. package/table/styles/table.scss +232 -0
  91. package/table/styles/vars.scss +21 -0
  92. package/table/table-cell/index.d.ts +7 -0
  93. package/table/table-cell/table-cell.directive.d.ts +8 -0
  94. package/table/table-filter/index.d.ts +7 -0
  95. package/table/table-filter/table-filter.component.d.ts +18 -0
  96. package/table/table-sort/index.d.ts +7 -0
  97. package/table/table-sort/table-sort.component.d.ts +8 -0
  98. package/table/table.component.d.ts +33 -0
  99. package/table/types/index.d.ts +6 -0
  100. package/table/types/table-cell-context.d.ts +6 -0
  101. package/table/types/table-columns.d.ts +7 -0
  102. package/table/types/table-filter-emit.d.ts +5 -0
  103. package/table/types/table-filter-item.d.ts +6 -0
  104. package/table/types/table-order-item.d.ts +5 -0
  105. package/table/types/table-order.enum.d.ts +5 -0
  106. package/tag/public-api.d.ts +0 -1
  107. package/textarea/public-api.d.ts +0 -1
  108. package/alert/alert.module.d.ts +0 -7
  109. package/avatar/avatar.module.d.ts +0 -7
  110. package/button/button.module.d.ts +0 -8
  111. package/checkbox/checkbox.module.d.ts +0 -7
  112. package/divider/divider.module.d.ts +0 -7
  113. package/form/form.module.d.ts +0 -8
  114. package/icon/icon.module.d.ts +0 -7
  115. package/input/input.module.d.ts +0 -7
  116. package/pipes/pipes.module.d.ts +0 -7
  117. package/progress/progress.module.d.ts +0 -7
  118. package/qr/qr.module.d.ts +0 -7
  119. package/skeleton/skeleton.module.d.ts +0 -7
  120. package/spinner/spinner.module.d.ts +0 -7
  121. package/tag/tag.module.d.ts +0 -7
  122. package/textarea/textarea.module.d.ts +0 -7
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export * from './alert-type';
8
8
  export * from './alert.component';
9
- export * from './alert.module';
@@ -5,4 +5,3 @@
5
5
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
6
  */
7
7
  export * from './avatar.component';
8
- export * from './avatar.module';
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export * from './button.component';
8
8
  export * from './button-group.component';
9
- export * from './button.module';
@@ -4,11 +4,16 @@
4
4
  * Use of this source code is governed by an MIT-style license that can be
5
5
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
6
  */
7
- import { OnDestroy } from '@angular/core';
7
+ import { DestroyRef, OnDestroy } from '@angular/core';
8
8
  import { Subject } from 'rxjs';
9
9
  import * as i0 from "@angular/core";
10
10
  export declare abstract class WrAbstractBase implements OnDestroy {
11
+ /**
12
+ * @deprecated use destroyRef$ instead
13
+ * @protected
14
+ */
11
15
  protected readonly destroyed$: Subject<void>;
16
+ protected readonly destroyRef$: DestroyRef;
12
17
  ngOnDestroy(): void;
13
18
  static ɵfac: i0.ɵɵFactoryDeclaration<WrAbstractBase, never>;
14
19
  static ɵdir: i0.ɵɵDirectiveDeclaration<WrAbstractBase, never, never, {}, {}, never, never, true, never>;
@@ -5,4 +5,3 @@
5
5
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
6
  */
7
7
  export * from './checkbox.component';
8
- export * from './checkbox.module';
@@ -1,11 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./dialog.component";
3
- import * as i2 from "./dialog-footer.directive";
4
- import * as i3 from "./dialog-content.directive";
5
- import * as i4 from "./dialog-close.directive";
6
- import * as i5 from "./dialog-title.directive";
7
2
  export declare class WrDialogModule {
8
3
  static ɵfac: i0.ɵɵFactoryDeclaration<WrDialogModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<WrDialogModule, never, [typeof i1.WrDialogComponent, typeof i2.WrDialogFooterDirective, typeof i3.WrDialogContentDirective, typeof i4.WrDialogCloseDirective, typeof i5.WrDialogTitleDirective], [typeof i4.WrDialogCloseDirective, typeof i2.WrDialogFooterDirective, typeof i3.WrDialogContentDirective, typeof i5.WrDialogTitleDirective]>;
4
+ static ɵmod: i0.ɵɵNgModuleDeclaration<WrDialogModule, never, never, never>;
10
5
  static ɵinj: i0.ɵɵInjectorDeclaration<WrDialogModule>;
11
6
  }
@@ -5,4 +5,3 @@
5
5
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
6
  */
7
7
  export * from './divider.component';
8
- export * from './divider.module';
@@ -0,0 +1,12 @@
1
+ import { wrIconName } from 'ngwr/icon';
2
+ import * as i0 from "@angular/core";
3
+ export declare class WrDropdownMenuItemComponent {
4
+ icon: import("@angular/core").InputSignal<wrIconName | null>;
5
+ disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
6
+ get hostClasses(): Record<string, boolean>;
7
+ attrRole: string;
8
+ tabindex: string;
9
+ protected onClick(event: MouseEvent): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<WrDropdownMenuItemComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<WrDropdownMenuItemComponent, "wr-dropdown-menu-item", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
12
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Use of this source code is governed by an MIT-style license that can be
5
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
+ */
7
+ import { TemplateRef } from '@angular/core';
8
+ import * as i0 from "@angular/core";
9
+ export declare class WrDropdownMenuComponent {
10
+ get hostClasses(): Record<string, string>;
11
+ contentTpl: TemplateRef<void>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<WrDropdownMenuComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<WrDropdownMenuComponent, "wr-dropdown-menu", ["wrDropdownMenu"], {}, {}, never, ["*"], true, never>;
14
+ }
@@ -0,0 +1,29 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { WrDropdownMenuComponent } from './dropdown-menu.component';
3
+ import { WrDropdownTrigger } from './dropdown.types';
4
+ import * as i0 from "@angular/core";
5
+ export declare class WrDropdownDirective implements OnDestroy {
6
+ dropdownMenu: import("@angular/core").InputSignal<WrDropdownMenuComponent | undefined>;
7
+ trigger: import("@angular/core").InputSignal<WrDropdownTrigger>;
8
+ position: import("@angular/core").InputSignal<string>;
9
+ private readonly isOpen;
10
+ private overlayRef?;
11
+ private clickTimeStamp;
12
+ private readonly overlay;
13
+ private readonly elementRef;
14
+ private readonly viewContainerRef;
15
+ private readonly scrollStrategyOptions;
16
+ private readonly destroyRef;
17
+ get hostClasses(): Record<string, boolean>;
18
+ constructor();
19
+ ngOnDestroy(): void;
20
+ protected onClick(event: MouseEvent): void;
21
+ protected onMouseEnter(): void;
22
+ private open;
23
+ private setupClickEvents;
24
+ private setupHoverEvents;
25
+ private close;
26
+ private destroyOverlay;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<WrDropdownDirective, never>;
28
+ static ɵdir: i0.ɵɵDirectiveDeclaration<WrDropdownDirective, "[wrDropdown]", never, { "dropdownMenu": { "alias": "dropdownMenu"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
29
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Use of this source code is governed by an MIT-style license that can be
5
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
+ */
7
+ import { ConnectedPosition } from '@angular/cdk/overlay';
8
+ export type WrDropdownTrigger = 'click' | 'hover';
9
+ export declare const WR_DROPDOWN_POSITIONS: Record<string, ConnectedPosition[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="ngwr/dropdown" />
5
+ export * from './public-api';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Use of this source code is governed by an MIT-style license that can be
5
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
+ */
7
+ export * from './dropdown.types';
8
+ export * from './dropdown.directive';
9
+ export * from './dropdown-menu.component';
10
+ export * from './dropdown-menu-item.component';
@@ -0,0 +1,91 @@
1
+ @forward "./vars";
2
+
3
+ .wr-dropdown {
4
+ &-trigger {
5
+ cursor: pointer;
6
+ }
7
+
8
+ &-menu {
9
+ display: flex;
10
+ flex-direction: column;
11
+ min-width: var(--wr-dropdown-min-width);
12
+ padding: var(--wr-dropdown-padding);
13
+ box-shadow: var(--wr-dropdown-shadow);
14
+ background: var(--wr-dropdown-bg);
15
+ border: 1px solid var(--wr-dropdown-border-color);
16
+ border-radius: var(--wr-dropdown-border-radius);
17
+ }
18
+
19
+ &--top, &--topRight, &--topLeft {
20
+ padding-bottom: 4px;
21
+ }
22
+
23
+ &--bottom, &--bottomLeft, &--bottomRight {
24
+ padding-top: 4px;
25
+ }
26
+
27
+ &--left {
28
+ padding-right: 4px;
29
+ }
30
+
31
+ &--right {
32
+ padding-left: 4px;
33
+ }
34
+ }
35
+
36
+ .wr-dropdown-item {
37
+ position: relative;
38
+ display: flex;
39
+ align-items: center;
40
+ width: 100%;
41
+ height: var(--wr-dropdown-item-height);
42
+ padding: var(--wr-dropdown-item-padding);
43
+ background: none;
44
+ border: none;
45
+ cursor: pointer;
46
+ user-select: none;
47
+ color: var(--wr-dropdown-item-color);
48
+ text-align: left;
49
+ font: inherit;
50
+ white-space: nowrap;
51
+ transition: all var(--wr-transition-base);
52
+
53
+ &:not(&--disabled) {
54
+ &:hover {
55
+ background-color: var(--wr-dropdown-item-hover-bg);
56
+ }
57
+
58
+ &:focus {
59
+ background-color: var(--wr-dropdown-item-hover-bg);
60
+ outline: none;
61
+ }
62
+
63
+ &:active {
64
+ background-color: var(--wr-dropdown-item-active-bg);
65
+ }
66
+ }
67
+
68
+ &__content {
69
+ display: flex;
70
+ align-items: center;
71
+ width: 100%;
72
+ font-size: var(--wr-dropdown-item-font-size);
73
+ gap: var(--wr-dropdown-item-gap);
74
+ }
75
+
76
+ &__icon {
77
+ --wr-icon-size: var(--wr-dropdown-item-icon-size);
78
+ }
79
+
80
+ &__label {
81
+ flex: 1;
82
+ text-overflow: ellipsis;
83
+ overflow: hidden;
84
+ }
85
+
86
+ &--disabled {
87
+ cursor: not-allowed;
88
+ color: var(--wr-dropdown-item-disabled-color);
89
+ pointer-events: none;
90
+ }
91
+ }
@@ -0,0 +1,18 @@
1
+ :root {
2
+ --wr-dropdown-bg: var(--wr-color-white);
3
+ --wr-dropdown-border-color: var(--wr-color-light-lighter);
4
+ --wr-dropdown-border-radius: 0.375rem;
5
+ --wr-dropdown-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
6
+ --wr-dropdown-padding: 4px 0;
7
+ --wr-dropdown-min-width: 160px;
8
+
9
+ --wr-dropdown-item-height: 32px;
10
+ --wr-dropdown-item-padding: 0 16px;
11
+ --wr-dropdown-item-color: var(--wr-color-dark);
12
+ --wr-dropdown-item-hover-bg: rgba(var(--wr-color-light-rgb), 0.2);
13
+ --wr-dropdown-item-active-bg: var(--wr-color-light-lighter);
14
+ --wr-dropdown-item-disabled-color: var(--wr-color-medium);
15
+ --wr-dropdown-item-gap: 16px;
16
+ --wr-dropdown-item-icon-size: 16px;
17
+ --wr-dropdown-item-font-size: 14px;
18
+ }
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
3
- import * as i1 from 'ngwr/icon';
4
- import { provideWrIcons, close, WrIconModule } from 'ngwr/icon';
2
+ import { signal, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
3
+ import { provideWrIcons, close, WrIconComponent } from 'ngwr/icon';
5
4
 
6
5
  /**
7
6
  * @license
@@ -39,12 +38,12 @@ class WrAlertComponent {
39
38
  onClose() {
40
39
  this.isClosed.set(true);
41
40
  }
42
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
43
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.3", type: WrAlertComponent, isStandalone: true, selector: "wr-alert", inputs: { title: "title", message: "message", type: "type", closeable: ["closeable", "closeable", booleanAttribute] }, host: { properties: { "class": "this.elClasses" } }, providers: [provideWrIcons([close])], ngImport: i0, template: "@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: WrIconModule }, { kind: "component", type: i1.WrIconComponent, selector: "wr-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: WrAlertComponent, isStandalone: true, selector: "wr-alert", inputs: { title: "title", message: "message", type: "type", closeable: ["closeable", "closeable", booleanAttribute] }, host: { properties: { "class": "this.elClasses" } }, providers: [provideWrIcons([close])], ngImport: i0, template: "@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
44
43
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertComponent, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrAlertComponent, decorators: [{
46
45
  type: Component,
47
- args: [{ selector: 'wr-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconModule], providers: [provideWrIcons([close])], template: "@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n" }]
46
+ args: [{ selector: 'wr-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconComponent], providers: [provideWrIcons([close])], template: "@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n" }]
48
47
  }], propDecorators: { title: [{
49
48
  type: Input,
50
49
  args: [{ required: true }]
@@ -60,25 +59,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
60
59
  args: ['class']
61
60
  }] } });
62
61
 
63
- /**
64
- * @license
65
- *
66
- * Use of this source code is governed by an MIT-style license that can be
67
- * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
68
- */
69
- class WrAlertModule {
70
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
71
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, imports: [WrAlertComponent], exports: [WrAlertComponent] }); }
72
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, imports: [WrAlertComponent] }); }
73
- }
74
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, decorators: [{
75
- type: NgModule,
76
- args: [{
77
- imports: [WrAlertComponent],
78
- exports: [WrAlertComponent],
79
- }]
80
- }] });
81
-
82
62
  /**
83
63
  * @license
84
64
  *
@@ -90,5 +70,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
90
70
  * Generated bundle index. Do not edit.
91
71
  */
92
72
 
93
- export { WrAlertComponent, WrAlertModule };
73
+ export { WrAlertComponent };
94
74
  //# sourceMappingURL=ngwr-alert.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-alert.mjs","sources":["../../../projects/lib/alert/alert-type.ts","../../../projects/lib/alert/alert.component.ts","../../../projects/lib/alert/alert.component.html","../../../projects/lib/alert/alert.module.ts","../../../projects/lib/alert/public-api.ts","../../../projects/lib/alert/ngwr-alert.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport type WrAlertType = 'info' | 'success' | 'warning' | 'danger';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { provideWrIcons, close, WrIconModule } from 'ngwr/icon';\n\nimport { WrAlertType } from './alert-type';\n\n/**\n * NGWR alert component.\n * Closeable component for feedback.\n *\n * {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/alert}\n */\n@Component({\n selector: 'wr-alert',\n templateUrl: './alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrIconModule],\n providers: [provideWrIcons([close])],\n})\nexport class WrAlertComponent {\n @Input({ required: true }) title!: string;\n @Input() message?: string;\n @Input() type: WrAlertType = 'info';\n @Input({ transform: booleanAttribute }) closeable = false;\n\n protected readonly isClosed = signal(false);\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-alert': true,\n 'wr-alert--success': this.type === 'success',\n 'wr-alert--warning': this.type === 'warning',\n 'wr-alert--danger': this.type === 'danger',\n };\n }\n\n onClose(): void {\n this.isClosed.set(true);\n }\n}\n","@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { WrAlertComponent } from './alert.component';\n\n@NgModule({\n imports: [WrAlertComponent],\n exports: [WrAlertComponent],\n})\nexport class WrAlertModule {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './alert-type';\nexport * from './alert.component';\nexport * from './alert.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;;ACLH;;;;;AAKG;AAiBH;;;;;AAKG;MASU,gBAAgB,CAAA;AAR7B,IAAA,WAAA,GAAA;QAWW,IAAI,CAAA,IAAA,GAAgB,MAAM;QACK,IAAS,CAAA,SAAA,GAAG,KAAK;AAEtC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;AAe5C;AAbC,IAAA,IACI,SAAS,GAAA;QACX,OAAO;AACL,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,mBAAmB,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;AAC5C,YAAA,mBAAmB,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;AAC5C,YAAA,kBAAkB,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;SAC3C;;IAGH,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;;8GAnBd,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CA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Z;gBACuC,SAAS,EAAA,CAAA;sBAAhD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAKlC,SAAS,EAAA,CAAA;sBADZ,WAAW;uBAAC,OAAO;;;AE5CtB;;;;;AAKG;MAUU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAb,aAAa,EAAA,OAAA,EAAA,CAHd,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAChB,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAEf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHd,gBAAgB,CAAA,EAAA,CAAA,CAAA;;2FAGf,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC5B,iBAAA;;;ACdD;;;;;AAKG;;ACLH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-alert.mjs","sources":["../../../projects/lib/alert/alert-type.ts","../../../projects/lib/alert/alert.component.ts","../../../projects/lib/alert/alert.component.html","../../../projects/lib/alert/public-api.ts","../../../projects/lib/alert/ngwr-alert.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport type WrAlertType = 'info' | 'success' | 'warning' | 'danger';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { provideWrIcons, close, WrIconComponent } from 'ngwr/icon';\n\nimport { WrAlertType } from './alert-type';\n\n/**\n * NGWR alert component.\n * Closeable component for feedback.\n *\n * {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/alert}\n */\n@Component({\n selector: 'wr-alert',\n templateUrl: './alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrIconComponent],\n providers: [provideWrIcons([close])],\n})\nexport class WrAlertComponent {\n @Input({ required: true }) title!: string;\n @Input() message?: string;\n @Input() type: WrAlertType = 'info';\n @Input({ transform: booleanAttribute }) closeable = false;\n\n protected readonly isClosed = signal(false);\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-alert': true,\n 'wr-alert--success': this.type === 'success',\n 'wr-alert--warning': this.type === 'warning',\n 'wr-alert--danger': this.type === 'danger',\n };\n }\n\n onClose(): void {\n this.isClosed.set(true);\n }\n}\n","@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './alert-type';\nexport * from './alert.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;;ACLH;;;;;AAKG;AAiBH;;;;;AAKG;MASU,gBAAgB,CAAA;AAR7B,IAAA,WAAA,GAAA;QAWW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,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAGd,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAR5B,SAAS;+BACE,UAAU,EAAA,eAAA,EAEH,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAC5B,OAAA,EAAA,CAAC,eAAe,CAAC,EAAA,SAAA,EACf,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAA,QAAA,EAAA,6ZAAA,EAAA;8BAGT,KAAK,EAAA,CAAA;sBAA/B,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAChB,OAAO,EAAA,CAAA;sBAAf;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACuC,SAAS,EAAA,CAAA;sBAAhD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAKlC,SAAS,EAAA,CAAA;sBADZ,WAAW;uBAAC,OAAO;;;AE5CtB;;;;;AAKG;;ACLH;;AAEG;;;;"}
@@ -1,8 +1,7 @@
1
1
  import { NgOptimizedImage } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, ChangeDetectorRef, ElementRef, signal, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
4
- import * as i1 from 'ngwr/spinner';
5
- import { WrSpinnerModule } from 'ngwr/spinner';
3
+ import { inject, ChangeDetectorRef, ElementRef, signal, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
4
+ import { WrSpinnerComponent } from 'ngwr/spinner';
6
5
 
7
6
  /**
8
7
  * @license
@@ -50,12 +49,12 @@ class WrAvatarComponent {
50
49
  height: `${this.size}px`,
51
50
  };
52
51
  }
53
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
54
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.3", type: WrAvatarComponent, isStandalone: true, selector: "wr-avatar", inputs: { url: "url", alt: "alt", rounded: ["rounded", "rounded", booleanAttribute], size: ["size", "size", numberAttribute] }, host: { properties: { "class": "this.elClasses", "style": "this.elStyles" } }, ngImport: i0, template: "<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n", dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "ngmodule", type: WrSpinnerModule }, { kind: "component", type: i1.WrSpinnerComponent, selector: "wr-spinner" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
53
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: WrAvatarComponent, isStandalone: true, selector: "wr-avatar", inputs: { url: "url", alt: "alt", rounded: ["rounded", "rounded", booleanAttribute], size: ["size", "size", numberAttribute] }, host: { properties: { "class": "this.elClasses", "style": "this.elStyles" } }, ngImport: i0, template: "<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n", dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spinner", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
55
54
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarComponent, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrAvatarComponent, decorators: [{
57
56
  type: Component,
58
- args: [{ selector: 'wr-avatar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgOptimizedImage, WrSpinnerModule], template: "<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n" }]
57
+ args: [{ selector: 'wr-avatar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgOptimizedImage, WrSpinnerComponent], template: "<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n" }]
59
58
  }], ctorParameters: () => [], propDecorators: { url: [{
60
59
  type: Input,
61
60
  args: [{ required: true }]
@@ -76,25 +75,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
76
75
  args: ['style']
77
76
  }] } });
78
77
 
79
- /**
80
- * @license
81
- *
82
- * Use of this source code is governed by an MIT-style license that can be
83
- * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
84
- */
85
- class WrAvatarModule {
86
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
87
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, imports: [WrAvatarComponent], exports: [WrAvatarComponent] }); }
88
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, imports: [WrAvatarComponent] }); }
89
- }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, decorators: [{
91
- type: NgModule,
92
- args: [{
93
- imports: [WrAvatarComponent],
94
- exports: [WrAvatarComponent],
95
- }]
96
- }] });
97
-
98
78
  /**
99
79
  * @license
100
80
  *
@@ -106,5 +86,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
106
86
  * Generated bundle index. Do not edit.
107
87
  */
108
88
 
109
- export { WrAvatarComponent, WrAvatarModule };
89
+ export { WrAvatarComponent };
110
90
  //# sourceMappingURL=ngwr-avatar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-avatar.mjs","sources":["../../../projects/lib/avatar/avatar.component.ts","../../../projects/lib/avatar/avatar.component.html","../../../projects/lib/avatar/avatar.module.ts","../../../projects/lib/avatar/public-api.ts","../../../projects/lib/avatar/ngwr-avatar.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgOptimizedImage } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n inject,\n Input,\n numberAttribute,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { WrSpinnerModule } from 'ngwr/spinner';\n\n@Component({\n selector: 'wr-avatar',\n templateUrl: './avatar.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgOptimizedImage, WrSpinnerModule],\n})\nexport class WrAvatarComponent {\n readonly cdr = inject(ChangeDetectorRef);\n readonly elRef = inject(ElementRef);\n readonly remSize: number = 16;\n\n readonly isImgLoaded = signal(false);\n\n private calcRemToPx(): number {\n const nativeElement = this.elRef?.nativeElement as HTMLElement;\n const style = nativeElement?.ownerDocument?.documentElement;\n const fontSize = getComputedStyle(style)?.fontSize;\n return Number(fontSize) || 16;\n }\n\n constructor() {\n this.remSize = this.calcRemToPx();\n }\n\n @Input({ required: true }) url!: string;\n @Input({ required: true }) alt!: string;\n @Input({ transform: booleanAttribute }) rounded = false;\n\n /**\n * Width and height in rem\n * @example size=\"6\" transforms to 6 * remSize (16 by default)\n */\n @Input({ transform: numberAttribute })\n get size(): number {\n return this._size;\n }\n set size(value: number | string) {\n this._size = Number(value) * this.remSize;\n this.cdr.markForCheck();\n }\n private _size: number = 6 * this.remSize;\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-avatar': true,\n 'wr-avatar--rounded': this.rounded,\n 'wr-avatar--loaded': this.isImgLoaded(),\n };\n }\n\n @HostBinding('style')\n get elStyles(): SafeAny {\n return {\n width: `${this.size}px`,\n height: `${this.size}px`,\n };\n }\n}\n","<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { WrAvatarComponent } from './avatar.component';\n\n@NgModule({\n imports: [WrAvatarComponent],\n exports: [WrAvatarComponent],\n})\nexport class WrAvatarModule {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './avatar.component';\nexport * from './avatar.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;MA2BU,iBAAiB,CAAA;IAOpB,WAAW,GAAA;AACjB,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,aAA4B;AAC9D,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE,aAAa,EAAE,eAAe;QAC3D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAAE,QAAQ;AAClD,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;;AAG/B,IAAA,WAAA,GAAA;AAbS,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UA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;gBAUhB,QAAQ,EAAA,CAAA;sBADX,WAAW;uBAAC,OAAO;;;AE7EtB;;;;;AAKG;MAUU,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,OAAA,EAAA,CAHf,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAEhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHf,iBAAiB,CAAA,EAAA,CAAA,CAAA;;2FAGhB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA;;;ACdD;;;;;AAKG;;ACLH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-avatar.mjs","sources":["../../../projects/lib/avatar/avatar.component.ts","../../../projects/lib/avatar/avatar.component.html","../../../projects/lib/avatar/public-api.ts","../../../projects/lib/avatar/ngwr-avatar.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgOptimizedImage } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n inject,\n Input,\n numberAttribute,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { WrSpinnerComponent } from 'ngwr/spinner';\n\n@Component({\n selector: 'wr-avatar',\n templateUrl: './avatar.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgOptimizedImage, WrSpinnerComponent],\n})\nexport class WrAvatarComponent {\n readonly cdr = inject(ChangeDetectorRef);\n readonly elRef = inject(ElementRef);\n readonly remSize: number = 16;\n\n readonly isImgLoaded = signal(false);\n\n private calcRemToPx(): number {\n const nativeElement = this.elRef?.nativeElement as HTMLElement;\n const style = nativeElement?.ownerDocument?.documentElement;\n const fontSize = getComputedStyle(style)?.fontSize;\n return Number(fontSize) || 16;\n }\n\n constructor() {\n this.remSize = this.calcRemToPx();\n }\n\n @Input({ required: true }) url!: string;\n @Input({ required: true }) alt!: string;\n @Input({ transform: booleanAttribute }) rounded = false;\n\n /**\n * Width and height in rem\n * @example size=\"6\" transforms to 6 * remSize (16 by default)\n */\n @Input({ transform: numberAttribute })\n get size(): number {\n return this._size;\n }\n set size(value: number | string) {\n this._size = Number(value) * this.remSize;\n this.cdr.markForCheck();\n }\n private _size: number = 6 * this.remSize;\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-avatar': true,\n 'wr-avatar--rounded': this.rounded,\n 'wr-avatar--loaded': this.isImgLoaded(),\n };\n }\n\n @HostBinding('style')\n get elStyles(): SafeAny {\n return {\n width: `${this.size}px`,\n height: `${this.size}px`,\n };\n }\n}\n","<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './avatar.component';\n","/**\n * Generated bundle index. Do not edit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AAI,EAC5B,OAAA,EAAA,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,qYAAA,EAAA;wDAoBpB,GAAG,EAAA,CAAA;sBAA7B,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACE,GAAG,EAAA,CAAA;sBAA7B,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACe,OAAO,EAAA,CAAA;sBAA9C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAOlC,IAAI,EAAA,CAAA;sBADP,KAAK;uBAAC,EAAE,SAAS,EAAE,eAAe,EAAE;gBAWjC,SAAS,EAAA,CAAA;sBADZ,WAAW;uBAAC,OAAO;gBAUhB,QAAQ,EAAA,CAAA;sBADX,WAAW;uBAAC,OAAO;;;AE7EtB;;;;;AAKG;;ACLH;;AAEG;;;;"}
@@ -1,8 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
2
+ import { booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
3
3
  import { WrIconComponent } from 'ngwr/icon';
4
- import * as i1 from 'ngwr/spinner';
5
- import { WrSpinnerModule } from 'ngwr/spinner';
4
+ import { WrSpinnerComponent } from 'ngwr/spinner';
6
5
 
7
6
  /**
8
7
  * @license
@@ -53,12 +52,12 @@ class WrButtonComponent {
53
52
  'wr-btn--loading--disabled': this.loading && this.isDisabledWhenLoading,
54
53
  };
55
54
  }
56
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
57
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.3", type: WrButtonComponent, isStandalone: true, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: { color: "color", size: "size", icon: "icon", iconPosition: "iconPosition", disabled: ["disabled", "disabled", booleanAttribute], outlined: ["outlined", "outlined", booleanAttribute], rounded: ["rounded", "rounded", booleanAttribute], block: ["block", "block", booleanAttribute], loading: ["loading", "loading", booleanAttribute], isDisabledWhenLoading: ["isDisabledWhenLoading", "isDisabledWhenLoading", booleanAttribute] }, host: { properties: { "attr.disabled": "this.nativeDisabled", "class": "this.elClasses" } }, ngImport: i0, template: "@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n", dependencies: [{ kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }, { kind: "ngmodule", type: WrSpinnerModule }, { kind: "component", type: i1.WrSpinnerComponent, selector: "wr-spinner" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
55
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
56
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: WrButtonComponent, isStandalone: true, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: { color: "color", size: "size", icon: "icon", iconPosition: "iconPosition", disabled: ["disabled", "disabled", booleanAttribute], outlined: ["outlined", "outlined", booleanAttribute], rounded: ["rounded", "rounded", booleanAttribute], block: ["block", "block", booleanAttribute], loading: ["loading", "loading", booleanAttribute], isDisabledWhenLoading: ["isDisabledWhenLoading", "isDisabledWhenLoading", booleanAttribute] }, host: { properties: { "attr.disabled": "this.nativeDisabled", "class": "this.elClasses" } }, ngImport: i0, template: "@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n", dependencies: [{ kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spinner", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
58
57
  }
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonComponent, decorators: [{
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrButtonComponent, decorators: [{
60
59
  type: Component,
61
- args: [{ selector: 'wr-btn, button[wr-btn], a[wr-btn]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconComponent, WrSpinnerModule], template: "@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n" }]
60
+ args: [{ selector: 'wr-btn, button[wr-btn], a[wr-btn]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconComponent, WrSpinnerComponent], template: "@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n" }]
62
61
  }], propDecorators: { color: [{
63
62
  type: Input
64
63
  }], size: [{
@@ -110,13 +109,12 @@ class WrButtonGroupComponent {
110
109
  'wr-btn-group': true,
111
110
  };
112
111
  }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
114
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: WrButtonGroupComponent, isStandalone: true, selector: "wr-btn-group", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
112
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
113
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: WrButtonGroupComponent, isStandalone: true, selector: "wr-btn-group", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
115
114
  }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonGroupComponent, decorators: [{
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: WrButtonGroupComponent, decorators: [{
117
116
  type: Component,
118
117
  args: [{
119
- standalone: true,
120
118
  selector: 'wr-btn-group',
121
119
  template: '<ng-content />',
122
120
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -127,25 +125,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
127
125
  args: ['class']
128
126
  }] } });
129
127
 
130
- /**
131
- * @license
132
- *
133
- * Use of this source code is governed by an MIT-style license that can be
134
- * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
135
- */
136
- class WrButtonModule {
137
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
138
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, imports: [WrButtonComponent, WrButtonGroupComponent], exports: [WrButtonComponent, WrButtonGroupComponent] }); }
139
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, imports: [WrButtonComponent] }); }
140
- }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, decorators: [{
142
- type: NgModule,
143
- args: [{
144
- imports: [WrButtonComponent, WrButtonGroupComponent],
145
- exports: [WrButtonComponent, WrButtonGroupComponent],
146
- }]
147
- }] });
148
-
149
128
  /**
150
129
  * @license
151
130
  *
@@ -157,5 +136,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
157
136
  * Generated bundle index. Do not edit.
158
137
  */
159
138
 
160
- export { WrButtonComponent, WrButtonGroupComponent, WrButtonModule };
139
+ export { WrButtonComponent, WrButtonGroupComponent };
161
140
  //# sourceMappingURL=ngwr-button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-button.mjs","sources":["../../../projects/lib/button/button.component.ts","../../../projects/lib/button/button.component.html","../../../projects/lib/button/button-group.component.ts","../../../projects/lib/button/button.module.ts","../../../projects/lib/button/public-api.ts","../../../projects/lib/button/ngwr-button.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny, WrThemeColor } from 'ngwr/cdk/types';\nimport { WrIconComponent, wrIconName } from 'ngwr/icon';\nimport { WrSpinnerModule } from 'ngwr/spinner';\n\n/**\n * NGWR button component.\n * Trigger an operation or perform an action.\n *\n * {@tutorial} [How to use wr-btn]{@link http://ngwr.dev/docs/components/button}\n */\n@Component({\n selector: 'wr-btn, button[wr-btn], a[wr-btn]',\n templateUrl: './button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrIconComponent, WrSpinnerModule],\n})\nexport class WrButtonComponent {\n @Input() color?: WrThemeColor | null;\n @Input() size: 'default' | 'small' = 'default';\n @Input() icon: wrIconName | null = null;\n @Input() iconPosition: 'start' | 'end' = 'start';\n @Input({ transform: booleanAttribute }) disabled = false;\n @Input({ transform: booleanAttribute }) outlined = false;\n @Input({ transform: booleanAttribute }) rounded = false;\n @Input({ transform: booleanAttribute }) block = false;\n @Input({ transform: booleanAttribute }) loading = false;\n @Input({ transform: booleanAttribute }) isDisabledWhenLoading = true;\n\n @HostBinding('attr.disabled')\n get nativeDisabled(): '' | null {\n return this.disabled ? '' : null;\n }\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-btn': true,\n 'wr-btn--color-primary': this.color === 'primary',\n 'wr-btn--color-secondary': this.color === 'secondary',\n 'wr-btn--color-success': this.color === 'success',\n 'wr-btn--color-warning': this.color === 'warning',\n 'wr-btn--color-danger': this.color === 'danger',\n 'wr-btn--color-light': this.color === 'light',\n 'wr-btn--color-medium': this.color === 'medium',\n 'wr-btn--color-dark': this.color === 'dark',\n 'wr-btn--small': this.size === 'small',\n 'wr-btn--block': this.block,\n 'wr-btn--rounded': this.rounded,\n 'wr-btn--icon': this.icon,\n 'wr-btn--icon-start': this.icon && this.iconPosition === 'start',\n 'wr-btn--icon-end': this.icon && this.iconPosition === 'end',\n 'wr-btn--outlined': this.outlined,\n 'wr-btn--loading': this.loading,\n 'wr-btn--loading--disabled': this.loading && this.isDisabledWhenLoading,\n };\n }\n}\n","@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, HostBinding, ViewEncapsulation } from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\n\n/**\n * NGWR button group.\n *\n * {@tutorial} [How to use wr-btn-group]{@link http://ngwr.dev/docs/components/button-group}\n */\n@Component({\n standalone: true,\n selector: 'wr-btn-group',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrButtonGroupComponent {\n @HostBinding('class')\n get classes(): SafeAny {\n return {\n 'wr-btn-group': true,\n };\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { WrButtonGroupComponent } from './button-group.component';\nimport { WrButtonComponent } from './button.component';\n\n@NgModule({\n imports: [WrButtonComponent, WrButtonGroupComponent],\n exports: [WrButtonComponent, WrButtonGroupComponent],\n})\nexport class WrButtonModule {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './button.component';\nexport * from './button-group.component';\nexport * from './button.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;AAeH;;;;;AAKG;MAQU,iBAAiB,CAAA;AAP9B,IAAA,WAAA,GAAA;QASW,IAAI,CAAA,IAAA,GAAwB,SAAS;QACrC,IAAI,CAAA,IAAA,GAAsB,IAAI;QAC9B,IAAY,CAAA,YAAA,GAAoB,OAAO;QACR,IAAQ,CAAA,QAAA,GAAG,KAAK;QAChB,IAAQ,CAAA,QAAA,GAAG,KAAK;QAChB,IAAO,CAAA,OAAA,GAAG,KAAK;QACf,IAAK,CAAA,KAAA,GAA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file":"ngwr-button.mjs","sources":["../../../projects/lib/button/button.component.ts","../../../projects/lib/button/button.component.html","../../../projects/lib/button/button-group.component.ts","../../../projects/lib/button/public-api.ts","../../../projects/lib/button/ngwr-button.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny, WrThemeColor } from 'ngwr/cdk/types';\nimport { WrIconComponent, wrIconName } from 'ngwr/icon';\nimport { WrSpinnerComponent } from 'ngwr/spinner';\n\n/**\n * NGWR button component.\n * Trigger an operation or perform an action.\n *\n * {@tutorial} [How to use wr-btn]{@link http://ngwr.dev/docs/components/button}\n */\n@Component({\n selector: 'wr-btn, button[wr-btn], a[wr-btn]',\n templateUrl: './button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrIconComponent, WrSpinnerComponent],\n})\nexport class WrButtonComponent {\n @Input() color?: WrThemeColor | null;\n @Input() size: 'default' | 'small' = 'default';\n @Input() icon: wrIconName | null = null;\n @Input() iconPosition: 'start' | 'end' = 'start';\n @Input({ transform: booleanAttribute }) disabled = false;\n @Input({ transform: booleanAttribute }) outlined = false;\n @Input({ transform: booleanAttribute }) rounded = false;\n @Input({ transform: booleanAttribute }) block = false;\n @Input({ transform: booleanAttribute }) loading = false;\n @Input({ transform: booleanAttribute }) isDisabledWhenLoading = true;\n\n @HostBinding('attr.disabled')\n get nativeDisabled(): '' | null {\n return this.disabled ? '' : null;\n }\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-btn': true,\n 'wr-btn--color-primary': this.color === 'primary',\n 'wr-btn--color-secondary': this.color === 'secondary',\n 'wr-btn--color-success': this.color === 'success',\n 'wr-btn--color-warning': this.color === 'warning',\n 'wr-btn--color-danger': this.color === 'danger',\n 'wr-btn--color-light': this.color === 'light',\n 'wr-btn--color-medium': this.color === 'medium',\n 'wr-btn--color-dark': this.color === 'dark',\n 'wr-btn--small': this.size === 'small',\n 'wr-btn--block': this.block,\n 'wr-btn--rounded': this.rounded,\n 'wr-btn--icon': this.icon,\n 'wr-btn--icon-start': this.icon && this.iconPosition === 'start',\n 'wr-btn--icon-end': this.icon && this.iconPosition === 'end',\n 'wr-btn--outlined': this.outlined,\n 'wr-btn--loading': this.loading,\n 'wr-btn--loading--disabled': this.loading && this.isDisabledWhenLoading,\n };\n }\n}\n","@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, HostBinding, ViewEncapsulation } from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\n\n/**\n * NGWR button group.\n *\n * {@tutorial} [How to use wr-btn-group]{@link http://ngwr.dev/docs/components/button-group}\n */\n@Component({\n selector: 'wr-btn-group',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrButtonGroupComponent {\n @HostBinding('class')\n get classes(): SafeAny {\n return {\n 'wr-btn-group': true,\n };\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './button.component';\nexport * from './button-group.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAeH;;;;;AAKG;MAQU,iBAAiB,CAAA;AAP9B,IAAA,WAAA,GAAA;QASW,IAAI,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