@acorex/components 18.10.7 → 18.10.9
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/alert/lib/alert.component.mjs +7 -5
- package/esm2022/map/lib/map.component.mjs +144 -40
- package/esm2022/range-slider/lib/range-slider.component.mjs +50 -24
- package/esm2022/rate-picker/lib/rate-picker.component.mjs +90 -28
- package/esm2022/side-menu/lib/side-menu-item/side-menu-item.compoent.mjs +10 -4
- package/esm2022/side-menu/lib/side-menu.component.mjs +2 -2
- package/fesm2022/acorex-components-alert.mjs +6 -4
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +143 -39
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +49 -23
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +89 -27
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +11 -5
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/map/lib/map.component.d.ts +97 -6
- package/package.json +35 -35
- package/range-slider/lib/range-slider.component.d.ts +47 -21
- package/rate-picker/lib/rate-picker.component.d.ts +77 -16
- package/side-menu/lib/side-menu-item/side-menu-item.compoent.d.ts +1 -0
@@ -50,41 +50,84 @@ function getPointerPercentage(event) {
|
|
50
50
|
}
|
51
51
|
|
52
52
|
/**
|
53
|
-
*
|
53
|
+
* @description
|
54
|
+
* The `AXRatePickerComponent` provides a customizable rating picker.
|
55
|
+
* The component allows users to select a rating between 0 and the defined maximum.
|
56
|
+
* It supports transitions, dynamic value changes, and hover states.
|
54
57
|
*
|
55
|
-
*
|
56
|
-
*
|
58
|
+
* @example
|
59
|
+
* <ax-rate-picker [max]="5" [readonly]="false" [disabled]="false"></ax-rate-picker>
|
57
60
|
*/
|
58
61
|
class AXRatePickerComponent extends MXValueComponent {
|
59
62
|
/**
|
63
|
+
* @description
|
60
64
|
* Initializes the component and sets up value change subscription.
|
61
65
|
*/
|
62
66
|
constructor() {
|
63
67
|
super();
|
64
|
-
/**
|
68
|
+
/**
|
69
|
+
* @description
|
70
|
+
* The icon to be used for each rating point.
|
71
|
+
* @default 'fa-star'
|
72
|
+
*/
|
65
73
|
this.iconName = input('fa-star');
|
66
|
-
/**
|
74
|
+
/**
|
75
|
+
* @description
|
76
|
+
* Maximum value for the rating.
|
77
|
+
* Defines how many rating points are available.
|
78
|
+
* @default 5
|
79
|
+
*/
|
67
80
|
this.max = input(5);
|
68
|
-
/**
|
69
|
-
|
70
|
-
|
81
|
+
/**
|
82
|
+
* @description
|
83
|
+
* Defines the step increment between rating values.
|
84
|
+
* The rating value will be rounded to the nearest multiple of this step.
|
85
|
+
* @default 0.01
|
86
|
+
*/
|
87
|
+
this.step = input(0.01);
|
88
|
+
/**
|
89
|
+
* @description
|
90
|
+
* Whether the rating should have a transition effect when changing values.
|
91
|
+
* @default true
|
92
|
+
*/
|
71
93
|
this.hasTransition = input(true);
|
72
|
-
/**
|
94
|
+
/**
|
95
|
+
* @description
|
96
|
+
* The percentage of the current rating value relative to the maximum rating.
|
97
|
+
*/
|
73
98
|
this.ratePercentage = computed(() => Math.round((this.currentValue() / this.max()) * 10000) / 100);
|
74
|
-
/**
|
99
|
+
/**
|
100
|
+
* @description
|
101
|
+
* The current rating value as a signal.
|
102
|
+
*/
|
75
103
|
this.currentValue = signal(this.max());
|
76
|
-
/**
|
104
|
+
/**
|
105
|
+
* @description
|
106
|
+
* State for tracking hover status and previous value.
|
107
|
+
*/
|
77
108
|
this.prevState = {
|
78
109
|
ishover: false,
|
79
110
|
previousValue: undefined,
|
80
111
|
};
|
81
|
-
/**
|
112
|
+
/**
|
113
|
+
* @description
|
114
|
+
* Reference to the container element.
|
115
|
+
*/
|
82
116
|
this.containerEl = viewChild.required('c');
|
83
|
-
/**
|
117
|
+
/**
|
118
|
+
* @description
|
119
|
+
* Reference to the rating element.
|
120
|
+
*/
|
84
121
|
this.ratingEl = viewChild.required('r');
|
85
|
-
/**
|
122
|
+
/**
|
123
|
+
* @description
|
124
|
+
* Renderer for manipulating styles.
|
125
|
+
*/
|
86
126
|
this.renderer = inject(Renderer2);
|
87
|
-
/**
|
127
|
+
/**
|
128
|
+
* @description
|
129
|
+
* Array of rating values from 1 to `max`.
|
130
|
+
*/
|
88
131
|
this.rates = computed(() => Array(this.max())
|
89
132
|
.fill(0)
|
90
133
|
.map((_, index) => index + 1));
|
@@ -109,6 +152,7 @@ class AXRatePickerComponent extends MXValueComponent {
|
|
109
152
|
});
|
110
153
|
}
|
111
154
|
/**
|
155
|
+
* @description
|
112
156
|
* Calculates and updates the rating based on the mouse or touch event.
|
113
157
|
*
|
114
158
|
* @param event - The mouse or touch event triggering the rating calculation.
|
@@ -123,19 +167,29 @@ class AXRatePickerComponent extends MXValueComponent {
|
|
123
167
|
if (pointerPercentage === -1) {
|
124
168
|
return console.log('Only support touch and click events.');
|
125
169
|
}
|
126
|
-
const value =
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
else {
|
133
|
-
this.commitValue(finalValue);
|
134
|
-
}
|
170
|
+
const value = this.roundToStep(pointerPercentage);
|
171
|
+
if (this.prevState.ishover === true) {
|
172
|
+
this.currentValue.set(value);
|
173
|
+
}
|
174
|
+
else {
|
175
|
+
this.commitValue(value);
|
135
176
|
}
|
136
177
|
}
|
137
178
|
}
|
138
179
|
/**
|
180
|
+
* @description
|
181
|
+
* Rounds the rating value to the nearest step.
|
182
|
+
*
|
183
|
+
* @param percentage - The calculated percentage from pointer event.
|
184
|
+
* @returns The rounded rating value.
|
185
|
+
*/
|
186
|
+
roundToStep(percentage) {
|
187
|
+
const value = (percentage / 100) * this.max();
|
188
|
+
const value2 = Math.round(value / (this.step() || 0.01)) * this.step();
|
189
|
+
return value2;
|
190
|
+
}
|
191
|
+
/**
|
192
|
+
* @description
|
139
193
|
* Handles mouse enter events to start tracking mouse movements for rating.
|
140
194
|
*/
|
141
195
|
mouseEnter() {
|
@@ -153,12 +207,17 @@ class AXRatePickerComponent extends MXValueComponent {
|
|
153
207
|
container.addEventListener('mouseup', endListener);
|
154
208
|
container.addEventListener('mouseleave', endListener);
|
155
209
|
}
|
210
|
+
/**
|
211
|
+
* @description
|
212
|
+
* Handles mouse leave events to reset styles.
|
213
|
+
*/
|
156
214
|
mouseLeave() {
|
157
215
|
if (this.hasTransition()) {
|
158
216
|
this.renderer.removeStyle(this.ratingEl().nativeElement, 'opacity');
|
159
217
|
}
|
160
218
|
}
|
161
219
|
/**
|
220
|
+
* @description
|
162
221
|
* Cleans up event listeners and restores the previous rating value.
|
163
222
|
*
|
164
223
|
* @param moveListener - The function to remove for mouse move events.
|
@@ -180,32 +239,35 @@ class AXRatePickerComponent extends MXValueComponent {
|
|
180
239
|
container.removeEventListener('mouseleave', endListener);
|
181
240
|
}
|
182
241
|
/**
|
242
|
+
* @description
|
183
243
|
* Determines if the component is active (i.e., not readonly or disabled).
|
184
244
|
*/
|
185
245
|
get isActive() {
|
186
246
|
return !this.readonly && !this.disabled;
|
187
247
|
}
|
188
248
|
/**
|
249
|
+
* @description
|
189
250
|
* Determines if the component is in readonly mode.
|
190
251
|
*/
|
191
252
|
get isReadonly() {
|
192
253
|
return this.readonly;
|
193
254
|
}
|
194
255
|
/**
|
256
|
+
* @description
|
195
257
|
* Determines if the component is disabled.
|
196
258
|
*/
|
197
259
|
get isDisabled() {
|
198
260
|
return this.disabled;
|
199
261
|
}
|
200
262
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
201
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXRatePickerComponent, selector: "ax-rate-picker", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, iconName: { classPropertyName: "iconName", publicName: "iconName", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null },
|
263
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXRatePickerComponent, selector: "ax-rate-picker", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, iconName: { classPropertyName: "iconName", publicName: "iconName", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hasTransition: { classPropertyName: "hasTransition", publicName: "hasTransition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.active": "this.isActive", "class.readonly": "this.isReadonly", "class.disable": "this.isDisabled" } }, providers: [
|
202
264
|
{ provide: AXValuableComponent, useExisting: AXRatePickerComponent },
|
203
265
|
{
|
204
266
|
provide: NG_VALUE_ACCESSOR,
|
205
267
|
useExisting: forwardRef(() => AXRatePickerComponent),
|
206
268
|
multi: true,
|
207
269
|
},
|
208
|
-
], viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["c"], descendants: true, isSignal: true }, { propertyName: "ratingEl", first: true, predicate: ["r"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #c\n class=\"ax-rate-picker-container\"\n (click)=\"calculateRate($event)\"\n (touchstart)=\"calculateRate($event)\"\n (mouseenter)=\"mouseEnter()\"\n (mouseleave)=\"mouseLeave()\"\n>\n <div #r class=\"ax-rate-picker-rating\" [style.width.%]=\"ratePercentage()\">\n <div class=\"ax-rate-picker-icons ax-rp-active\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\" [class.pointer]=\"!this.readonly\"></i>\n }\n </div>\n </div>\n <div class=\"ax-rate-picker-icons ax-rp-inactive\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\"></i>\n }\n </div>\n</div>\n", styles: [":root{--ax-rate-picker-color: rgba(var(--ax-color-primary-500));--ax-rate-picker-background: rgba(var(--ax-color-neutral-300))}ax-rate-picker.active{cursor:pointer}ax-rate-picker.
|
270
|
+
], viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["c"], descendants: true, isSignal: true }, { propertyName: "ratingEl", first: true, predicate: ["r"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #c\n class=\"ax-rate-picker-container\"\n (click)=\"calculateRate($event)\"\n (touchstart)=\"calculateRate($event)\"\n (mouseenter)=\"mouseEnter()\"\n (mouseleave)=\"mouseLeave()\"\n>\n <div #r class=\"ax-rate-picker-rating\" [style.width.%]=\"ratePercentage()\">\n <div class=\"ax-rate-picker-icons ax-rp-active\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\" [class.pointer]=\"!this.readonly\"></i>\n }\n </div>\n </div>\n <div class=\"ax-rate-picker-icons ax-rp-inactive\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\"></i>\n }\n </div>\n</div>\n", styles: [":root{--ax-rate-picker-color: rgba(var(--ax-color-primary-500));--ax-rate-picker-background: rgba(var(--ax-color-neutral-300))}ax-rate-picker.active{cursor:pointer}ax-rate-picker.disable{cursor:not-allowed;opacity:.5}ax-rate-picker.ax-sm{font-size:1rem}ax-rate-picker.ax-md{font-size:1.5rem}ax-rate-picker.ax-lg{font-size:2rem}ax-rate-picker.ax-xl{font-size:2.5rem}ax-rate-picker.ax-2xl{font-size:3rem}ax-rate-picker.ax-3xl{font-size:4rem}ax-rate-picker .ax-rate-picker-container{position:relative;width:min-content}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-rating{position:relative;z-index:10;overflow:hidden}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-rating .ax-rate-picker-icons{display:flex}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-rating .ax-rate-picker-icons.ax-rp-active{color:var(--ax-rate-picker-color)}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-icons{display:flex}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-icons.ax-rp-inactive{color:var(--ax-rate-picker-background);position:absolute;left:50%;top:50%;translate:-50% -50%;z-index:5}.ax-dark :root{--ax-rate-picker-color: rgba(var(--ax-color-primary-300));--ax-rate-picker-background: rgba(var(--ax-color-neutral-600))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
209
271
|
}
|
210
272
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRatePickerComponent, decorators: [{
|
211
273
|
type: Component,
|
@@ -216,7 +278,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
216
278
|
useExisting: forwardRef(() => AXRatePickerComponent),
|
217
279
|
multi: true,
|
218
280
|
},
|
219
|
-
], template: "<div\n #c\n class=\"ax-rate-picker-container\"\n (click)=\"calculateRate($event)\"\n (touchstart)=\"calculateRate($event)\"\n (mouseenter)=\"mouseEnter()\"\n (mouseleave)=\"mouseLeave()\"\n>\n <div #r class=\"ax-rate-picker-rating\" [style.width.%]=\"ratePercentage()\">\n <div class=\"ax-rate-picker-icons ax-rp-active\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\" [class.pointer]=\"!this.readonly\"></i>\n }\n </div>\n </div>\n <div class=\"ax-rate-picker-icons ax-rp-inactive\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\"></i>\n }\n </div>\n</div>\n", styles: [":root{--ax-rate-picker-color: rgba(var(--ax-color-primary-500));--ax-rate-picker-background: rgba(var(--ax-color-neutral-300))}ax-rate-picker.active{cursor:pointer}ax-rate-picker.
|
281
|
+
], template: "<div\n #c\n class=\"ax-rate-picker-container\"\n (click)=\"calculateRate($event)\"\n (touchstart)=\"calculateRate($event)\"\n (mouseenter)=\"mouseEnter()\"\n (mouseleave)=\"mouseLeave()\"\n>\n <div #r class=\"ax-rate-picker-rating\" [style.width.%]=\"ratePercentage()\">\n <div class=\"ax-rate-picker-icons ax-rp-active\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\" [class.pointer]=\"!this.readonly\"></i>\n }\n </div>\n </div>\n <div class=\"ax-rate-picker-icons ax-rp-inactive\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\"></i>\n }\n </div>\n</div>\n", styles: [":root{--ax-rate-picker-color: rgba(var(--ax-color-primary-500));--ax-rate-picker-background: rgba(var(--ax-color-neutral-300))}ax-rate-picker.active{cursor:pointer}ax-rate-picker.disable{cursor:not-allowed;opacity:.5}ax-rate-picker.ax-sm{font-size:1rem}ax-rate-picker.ax-md{font-size:1.5rem}ax-rate-picker.ax-lg{font-size:2rem}ax-rate-picker.ax-xl{font-size:2.5rem}ax-rate-picker.ax-2xl{font-size:3rem}ax-rate-picker.ax-3xl{font-size:4rem}ax-rate-picker .ax-rate-picker-container{position:relative;width:min-content}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-rating{position:relative;z-index:10;overflow:hidden}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-rating .ax-rate-picker-icons{display:flex}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-rating .ax-rate-picker-icons.ax-rp-active{color:var(--ax-rate-picker-color)}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-icons{display:flex}ax-rate-picker .ax-rate-picker-container .ax-rate-picker-icons.ax-rp-inactive{color:var(--ax-rate-picker-background);position:absolute;left:50%;top:50%;translate:-50% -50%;z-index:5}.ax-dark :root{--ax-rate-picker-color: rgba(var(--ax-color-primary-300));--ax-rate-picker-background: rgba(var(--ax-color-neutral-600))}\n"] }]
|
220
282
|
}], ctorParameters: () => [], propDecorators: { isActive: [{
|
221
283
|
type: HostBinding,
|
222
284
|
args: ['class.active']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-rate-picker.mjs","sources":["../../../../libs/components/rate-picker/src/lib/calculatePercentage.ts","../../../../libs/components/rate-picker/src/lib/rate-picker.component.ts","../../../../libs/components/rate-picker/src/lib/rate-picker.component.html","../../../../libs/components/rate-picker/src/lib/rate-picker.module.ts","../../../../libs/components/rate-picker/src/acorex-components-rate-picker.ts"],"sourcesContent":["/**\n * Calculates the horizontal position of a pointer event (mouse or touch) as a percentage\n * of the target element's width.\n *\n * @param event - The mouse or touch event to get the pointer position from.\n * @returns The percentage of the event's position relative to the target element's width,\n * or -1 if the event is invalid.\n *\n * @remarks\n * - For `MouseEvent`, it uses the `clientX` property.\n * - For `TouchEvent`, it uses the `clientX` of the first touch point.\n * - Returns `-1` if the event is neither a valid `MouseEvent` nor a `TouchEvent`.\n *\n * @example\n * ```typescript\n * document.addEventListener('click', function(event) {\n * const percentage = getPointerPercentage(event);\n * console.log(`Click position: ${percentage.toFixed(2)}% of the element's width`);\n * });\n *\n * document.addEventListener('touchstart', function(event) {\n * const percentage = getPointerPercentage(event);\n * console.log(`Touch position: ${percentage.toFixed(2)}% of the element's width`);\n * });\n * ```\n */\nexport function getPointerPercentage(event: MouseEvent | TouchEvent): number {\n let clientX: number;\n\n if (event instanceof MouseEvent) {\n clientX = event.clientX; // Mouse event uses clientX\n } else if (event instanceof TouchEvent && event.touches.length > 0) {\n clientX = event.touches[0].clientX; // Touch event uses the first touch's clientX\n } else {\n return -1; // Return -1 for invalid events\n }\n\n // Use currentTarget to get the bounding box of the element the event listener is attached to\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n const clickX = clientX - rect.left; // Calculate X position relative to the element\n const divWidth = rect.width; // Get the width from the bounding box\n const percentage = (clickX / divWidth) * 100; // Calculate percentage\n\n return percentage;\n}\n","import { AXValuableComponent, MXValueComponent } from '@acorex/components/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n HostBinding,\n inject,\n input,\n Renderer2,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { getPointerPercentage } from './calculatePercentage';\n\n/**\n * A component for selecting a rating using star icons.\n *\n * This component allows users to pick a rating by clicking or dragging over star icons.\n * It supports rounding options and manages the rating state internally.\n */\n@Component({\n selector: 'ax-rate-picker',\n templateUrl: './rate-picker.component.html',\n styleUrls: ['./rate-picker.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['readonly', 'disabled'],\n providers: [\n { provide: AXValuableComponent, useExisting: AXRatePickerComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXRatePickerComponent),\n multi: true,\n },\n ],\n})\nexport class AXRatePickerComponent extends MXValueComponent<number> {\n /** The icon name to use for stars (e.g., 'fa-star'). */\n iconName = input('fa-star');\n\n /** The maximum rating value (e.g., 5 stars). */\n max = input(5);\n\n /** Determines if the rating should be rounded to the nearest integer. */\n isRound = input(true);\n\n /** choosing to have css transition for unchanging value after hover. */\n hasTransition = input(true);\n\n /** The percentage of the current rating value relative to the maximum rating. */\n protected ratePercentage = computed(() => Math.round((this.currentValue() / this.max()) * 10000) / 100);\n\n /** The current rating value as a signal. */\n private currentValue = signal(this.max());\n\n /** State for tracking hover status and previous value. */\n private prevState: { ishover: boolean; previousValue?: number } = {\n ishover: false,\n previousValue: undefined,\n };\n\n /** Reference to the container element. */\n containerEl = viewChild.required<ElementRef>('c');\n\n /** Reference to the rating element. */\n ratingEl = viewChild.required<ElementRef>('r');\n\n /** Renderer for manipulating styles. */\n renderer = inject(Renderer2);\n\n /** Array of rating values from 1 to `max`. */\n protected rates = computed(() =>\n Array(this.max())\n .fill(0)\n .map((_, index) => index + 1),\n );\n\n /**\n * Initializes the component and sets up value change subscription.\n */\n constructor() {\n super();\n effect(() => {\n if (!this.hasTransition()) {\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'transition');\n }\n return this.hasTransition();\n });\n this.onValueChanged.subscribe((val: { value }) => {\n if (val.value < 0) {\n this.currentValue.set(0);\n console.warn('ax-rate-picker: value cant be negative!');\n } else if (val.value > this.max()) {\n this.currentValue.set(this.max());\n console.warn('ax-rate-picker: value cant be more than max!');\n } else {\n this.currentValue.set(val.value);\n }\n });\n }\n\n /**\n * Calculates and updates the rating based on the mouse or touch event.\n *\n * @param event - The mouse or touch event triggering the rating calculation.\n */\n protected calculateRate(event: MouseEvent | TouchEvent): void {\n if (this.hasTransition()) {\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'transition');\n }\n event.preventDefault();\n if (!this.readonly && !this.disabled) {\n const pointerPercentage = getPointerPercentage(event);\n if (pointerPercentage === -1) {\n return console.log('Only support touch and click events.');\n }\n const value = (pointerPercentage / 100) * this.max();\n const finalValue = this.isRound() ? Math.ceil(value) : Number.parseFloat(value.toFixed(2));\n if (finalValue !== this.value) {\n if (this.prevState.ishover === true) {\n this.currentValue.set(finalValue);\n } else {\n this.commitValue(finalValue);\n }\n }\n }\n }\n\n /**\n * Handles mouse enter events to start tracking mouse movements for rating.\n */\n protected mouseEnter() {\n this.prevState = {\n ishover: true,\n previousValue: this.value,\n };\n if (this.hasTransition()) {\n this.renderer.setStyle(this.ratingEl().nativeElement, 'opacity', '80%');\n }\n const moveListener = (moveEvent: MouseEvent | TouchEvent) => this.calculateRate(moveEvent);\n const endListener = () => this.onEnd(moveListener, endListener);\n const container = this.containerEl().nativeElement;\n container.addEventListener('mousemove', moveListener);\n container.addEventListener('mouseup', endListener);\n container.addEventListener('mouseleave', endListener);\n }\n mouseLeave() {\n if (this.hasTransition()) {\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'opacity');\n }\n }\n /**\n * Cleans up event listeners and restores the previous rating value.\n *\n * @param moveListener - The function to remove for mouse move events.\n * @param endListener - The function to remove for mouse end events.\n */\n private onEnd(moveListener: (event: MouseEvent | TouchEvent) => void, endListener: () => void): void {\n if (this.hasTransition()) {\n this.renderer.setStyle(\n this.ratingEl().nativeElement,\n 'transition',\n `width ${this.max() * 50 + 250}ms cubic-bezier(0.29, 0.72, 0.68, 0.85)`,\n );\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'opacity');\n }\n\n this.currentValue.set(this.prevState.previousValue);\n this.prevState = {\n ishover: false,\n previousValue: undefined,\n };\n\n const container = this.containerEl().nativeElement;\n container.removeEventListener('mousemove', moveListener);\n container.removeEventListener('mouseup', endListener);\n container.removeEventListener('mouseleave', endListener);\n }\n\n /**\n * Determines if the component is active (i.e., not readonly or disabled).\n */\n @HostBinding('class.active') get isActive() {\n return !this.readonly && !this.disabled;\n }\n\n /**\n * Determines if the component is in readonly mode.\n */\n @HostBinding('class.readonly') get isReadonly() {\n return this.readonly;\n }\n\n /**\n * Determines if the component is disabled.\n */\n @HostBinding('class.disable') get isDisabled() {\n return this.disabled;\n }\n}\n","<div\n #c\n class=\"ax-rate-picker-container\"\n (click)=\"calculateRate($event)\"\n (touchstart)=\"calculateRate($event)\"\n (mouseenter)=\"mouseEnter()\"\n (mouseleave)=\"mouseLeave()\"\n>\n <div #r class=\"ax-rate-picker-rating\" [style.width.%]=\"ratePercentage()\">\n <div class=\"ax-rate-picker-icons ax-rp-active\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\" [class.pointer]=\"!this.readonly\"></i>\n }\n </div>\n </div>\n <div class=\"ax-rate-picker-icons ax-rp-inactive\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\"></i>\n }\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXRatePickerComponent } from './rate-picker.component';\n\n@NgModule({\n declarations: [AXRatePickerComponent],\n imports: [CommonModule],\n exports: [AXRatePickerComponent],\n})\nexport class AXRatePickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG,SAAU,oBAAoB,CAAC,KAA8B,EAAA;AACjE,IAAA,IAAI,OAAe,CAAC;AAEpB,IAAA,IAAI,KAAK,YAAY,UAAU,EAAE;AAC/B,QAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;KACzB;AAAM,SAAA,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QAClE,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;KACpC;SAAM;AACL,QAAA,OAAO,CAAC,CAAC,CAAC;KACX;;IAGD,MAAM,IAAI,GAAI,KAAK,CAAC,aAA6B,CAAC,qBAAqB,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;AACnC,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5B,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,QAAQ,IAAI,GAAG,CAAC;AAE7C,IAAA,OAAO,UAAU,CAAC;AACpB;;ACzBA;;;;;AAKG;AAiBG,MAAO,qBAAsB,SAAQ,gBAAwB,CAAA;AAyCjE;;AAEG;AACH,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;AA3CV,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;;AAG5B,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;;A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EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-rate-picker.mjs","sources":["../../../../libs/components/rate-picker/src/lib/calculatePercentage.ts","../../../../libs/components/rate-picker/src/lib/rate-picker.component.ts","../../../../libs/components/rate-picker/src/lib/rate-picker.component.html","../../../../libs/components/rate-picker/src/lib/rate-picker.module.ts","../../../../libs/components/rate-picker/src/acorex-components-rate-picker.ts"],"sourcesContent":["/**\n * Calculates the horizontal position of a pointer event (mouse or touch) as a percentage\n * of the target element's width.\n *\n * @param event - The mouse or touch event to get the pointer position from.\n * @returns The percentage of the event's position relative to the target element's width,\n * or -1 if the event is invalid.\n *\n * @remarks\n * - For `MouseEvent`, it uses the `clientX` property.\n * - For `TouchEvent`, it uses the `clientX` of the first touch point.\n * - Returns `-1` if the event is neither a valid `MouseEvent` nor a `TouchEvent`.\n *\n * @example\n * ```typescript\n * document.addEventListener('click', function(event) {\n * const percentage = getPointerPercentage(event);\n * console.log(`Click position: ${percentage.toFixed(2)}% of the element's width`);\n * });\n *\n * document.addEventListener('touchstart', function(event) {\n * const percentage = getPointerPercentage(event);\n * console.log(`Touch position: ${percentage.toFixed(2)}% of the element's width`);\n * });\n * ```\n */\nexport function getPointerPercentage(event: MouseEvent | TouchEvent): number {\n let clientX: number;\n\n if (event instanceof MouseEvent) {\n clientX = event.clientX; // Mouse event uses clientX\n } else if (event instanceof TouchEvent && event.touches.length > 0) {\n clientX = event.touches[0].clientX; // Touch event uses the first touch's clientX\n } else {\n return -1; // Return -1 for invalid events\n }\n\n // Use currentTarget to get the bounding box of the element the event listener is attached to\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n const clickX = clientX - rect.left; // Calculate X position relative to the element\n const divWidth = rect.width; // Get the width from the bounding box\n const percentage = (clickX / divWidth) * 100; // Calculate percentage\n\n return percentage;\n}\n","import { AXValuableComponent, MXValueComponent } from '@acorex/components/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n HostBinding,\n inject,\n input,\n Renderer2,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { getPointerPercentage } from './calculatePercentage';\n\n/**\n * @description\n * The `AXRatePickerComponent` provides a customizable rating picker.\n * The component allows users to select a rating between 0 and the defined maximum.\n * It supports transitions, dynamic value changes, and hover states.\n *\n * @example\n * <ax-rate-picker [max]=\"5\" [readonly]=\"false\" [disabled]=\"false\"></ax-rate-picker>\n */\n@Component({\n selector: 'ax-rate-picker',\n templateUrl: './rate-picker.component.html',\n styleUrls: ['./rate-picker.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['readonly', 'disabled'],\n providers: [\n { provide: AXValuableComponent, useExisting: AXRatePickerComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXRatePickerComponent),\n multi: true,\n },\n ],\n})\nexport class AXRatePickerComponent extends MXValueComponent<number> {\n /**\n * @description\n * The icon to be used for each rating point.\n * @default 'fa-star'\n */\n iconName = input('fa-star');\n\n /**\n * @description\n * Maximum value for the rating.\n * Defines how many rating points are available.\n * @default 5\n */\n max = input(5);\n\n /**\n * @description\n * Defines the step increment between rating values.\n * The rating value will be rounded to the nearest multiple of this step.\n * @default 0.01\n */\n step = input(0.01);\n\n /**\n * @description\n * Whether the rating should have a transition effect when changing values.\n * @default true\n */\n hasTransition = input(true);\n\n /**\n * @description\n * The percentage of the current rating value relative to the maximum rating.\n */\n protected ratePercentage = computed(() => Math.round((this.currentValue() / this.max()) * 10000) / 100);\n\n /**\n * @description\n * The current rating value as a signal.\n */\n private currentValue = signal(this.max());\n\n /**\n * @description\n * State for tracking hover status and previous value.\n */\n private prevState: { ishover: boolean; previousValue?: number } = {\n ishover: false,\n previousValue: undefined,\n };\n\n /**\n * @description\n * Reference to the container element.\n */\n containerEl = viewChild.required<ElementRef>('c');\n\n /**\n * @description\n * Reference to the rating element.\n */\n ratingEl = viewChild.required<ElementRef>('r');\n\n /**\n * @description\n * Renderer for manipulating styles.\n */\n renderer = inject(Renderer2);\n\n /**\n * @description\n * Array of rating values from 1 to `max`.\n */\n protected rates = computed(() =>\n Array(this.max())\n .fill(0)\n .map((_, index) => index + 1),\n );\n\n /**\n * @description\n * Initializes the component and sets up value change subscription.\n */\n constructor() {\n super();\n effect(() => {\n if (!this.hasTransition()) {\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'transition');\n }\n return this.hasTransition();\n });\n this.onValueChanged.subscribe((val: { value }) => {\n if (val.value < 0) {\n this.currentValue.set(0);\n console.warn('ax-rate-picker: value cant be negative!');\n } else if (val.value > this.max()) {\n this.currentValue.set(this.max());\n console.warn('ax-rate-picker: value cant be more than max!');\n } else {\n this.currentValue.set(val.value);\n }\n });\n }\n\n /**\n * @description\n * Calculates and updates the rating based on the mouse or touch event.\n *\n * @param event - The mouse or touch event triggering the rating calculation.\n */\n protected calculateRate(event: MouseEvent | TouchEvent): void {\n if (this.hasTransition()) {\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'transition');\n }\n event.preventDefault();\n if (!this.readonly && !this.disabled) {\n const pointerPercentage = getPointerPercentage(event);\n if (pointerPercentage === -1) {\n return console.log('Only support touch and click events.');\n }\n const value = this.roundToStep(pointerPercentage);\n if (this.prevState.ishover === true) {\n this.currentValue.set(value);\n } else {\n this.commitValue(value);\n }\n }\n }\n\n /**\n * @description\n * Rounds the rating value to the nearest step.\n *\n * @param percentage - The calculated percentage from pointer event.\n * @returns The rounded rating value.\n */\n private roundToStep(percentage: number): number {\n const value = (percentage / 100) * this.max();\n const value2 = Math.round(value / (this.step() || 0.01)) * this.step();\n return value2;\n }\n\n /**\n * @description\n * Handles mouse enter events to start tracking mouse movements for rating.\n */\n protected mouseEnter() {\n this.prevState = {\n ishover: true,\n previousValue: this.value,\n };\n if (this.hasTransition()) {\n this.renderer.setStyle(this.ratingEl().nativeElement, 'opacity', '80%');\n }\n const moveListener = (moveEvent: MouseEvent | TouchEvent) => this.calculateRate(moveEvent);\n const endListener = () => this.onEnd(moveListener, endListener);\n const container = this.containerEl().nativeElement;\n container.addEventListener('mousemove', moveListener);\n container.addEventListener('mouseup', endListener);\n container.addEventListener('mouseleave', endListener);\n }\n\n /**\n * @description\n * Handles mouse leave events to reset styles.\n */\n mouseLeave() {\n if (this.hasTransition()) {\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'opacity');\n }\n }\n\n /**\n * @description\n * Cleans up event listeners and restores the previous rating value.\n *\n * @param moveListener - The function to remove for mouse move events.\n * @param endListener - The function to remove for mouse end events.\n */\n private onEnd(moveListener: (event: MouseEvent | TouchEvent) => void, endListener: () => void): void {\n if (this.hasTransition()) {\n this.renderer.setStyle(\n this.ratingEl().nativeElement,\n 'transition',\n `width ${this.max() * 50 + 250}ms cubic-bezier(0.29, 0.72, 0.68, 0.85)`,\n );\n this.renderer.removeStyle(this.ratingEl().nativeElement, 'opacity');\n }\n this.currentValue.set(this.prevState.previousValue);\n this.prevState = {\n ishover: false,\n previousValue: undefined,\n };\n const container = this.containerEl().nativeElement;\n container.removeEventListener('mousemove', moveListener);\n container.removeEventListener('mouseup', endListener);\n container.removeEventListener('mouseleave', endListener);\n }\n\n /**\n * @description\n * Determines if the component is active (i.e., not readonly or disabled).\n */\n @HostBinding('class.active') get isActive() {\n return !this.readonly && !this.disabled;\n }\n\n /**\n * @description\n * Determines if the component is in readonly mode.\n */\n @HostBinding('class.readonly') get isReadonly() {\n return this.readonly;\n }\n\n /**\n * @description\n * Determines if the component is disabled.\n */\n @HostBinding('class.disable') get isDisabled() {\n return this.disabled;\n }\n}\n","<div\n #c\n class=\"ax-rate-picker-container\"\n (click)=\"calculateRate($event)\"\n (touchstart)=\"calculateRate($event)\"\n (mouseenter)=\"mouseEnter()\"\n (mouseleave)=\"mouseLeave()\"\n>\n <div #r class=\"ax-rate-picker-rating\" [style.width.%]=\"ratePercentage()\">\n <div class=\"ax-rate-picker-icons ax-rp-active\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\" [class.pointer]=\"!this.readonly\"></i>\n }\n </div>\n </div>\n <div class=\"ax-rate-picker-icons ax-rp-inactive\">\n @for (rate of rates(); track rate) {\n <i class=\"ax-rate-picker-icon fa-solid\" [class]=\"iconName()\"></i>\n }\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXRatePickerComponent } from './rate-picker.component';\n\n@NgModule({\n declarations: [AXRatePickerComponent],\n imports: [CommonModule],\n exports: [AXRatePickerComponent],\n})\nexport class AXRatePickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG,SAAU,oBAAoB,CAAC,KAA8B,EAAA;AACjE,IAAA,IAAI,OAAe,CAAC;AAEpB,IAAA,IAAI,KAAK,YAAY,UAAU,EAAE;AAC/B,QAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;KACzB;AAAM,SAAA,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QAClE,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;KACpC;SAAM;AACL,QAAA,OAAO,CAAC,CAAC,CAAC;KACX;;IAGD,MAAM,IAAI,GAAI,KAAK,CAAC,aAA6B,CAAC,qBAAqB,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;AACnC,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5B,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,QAAQ,IAAI,GAAG,CAAC;AAE7C,IAAA,OAAO,UAAU,CAAC;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d,YAAA,EAAA,CAAA,qBAAqB,CAC1B,EAAA,OAAA,EAAA,CAAA,YAAY,aACZ,qBAAqB,CAAA,EAAA,CAAA,CAAA,EAAA;AAEpB,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,kBAAkB,YAHnB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGX,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
@@ -2,7 +2,7 @@ import * as i1 from '@acorex/components/common';
|
|
2
2
|
import { AXClickEvent, MXInteractiveComponent, MXColorComponent, MXBaseComponent, AXCommonModule, AXRippleDirective } from '@acorex/components/common';
|
3
3
|
import { trigger, state, style, AUTO_STYLE, transition, animate } from '@angular/animations';
|
4
4
|
import * as i0 from '@angular/core';
|
5
|
-
import { model, output, signal, afterNextRender, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
5
|
+
import { model, output, signal, afterNextRender, Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, NgModule } from '@angular/core';
|
6
6
|
import { classes } from 'polytype';
|
7
7
|
import * as i2 from '@acorex/components/loading';
|
8
8
|
import { AXLoadingModule } from '@acorex/components/loading';
|
@@ -55,8 +55,11 @@ class AXSideMenuItemComponent extends classes(MXInteractiveComponent, MXColorCom
|
|
55
55
|
close() {
|
56
56
|
this.isCollapsed.set(false);
|
57
57
|
}
|
58
|
+
get __hostClass() {
|
59
|
+
return [`ax-${this.color}-solid`];
|
60
|
+
}
|
58
61
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXSideMenuItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
59
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXSideMenuItemComponent, selector: "ax-side-menu-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: false, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoading: "isLoadingChange", text: "textChange", isCollapsed: "isCollapsedChange", active: "activeChange", onClick: "onClick" }, host: { attributes: { "ngSkipHydration": "true" } }, usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-title\"></ng-content>\n<div [axRipple] class=\"ax-side-item\" [class.ax-state-disabled]=\"disabled\" [class.ax-state-active]=\"active()\"\n (click)=\"_handleClickEvent($event)\">\n <div class=\"ax-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n @if(text()){\n <span>{{text()}}</span>\n }\n <ng-content></ng-content>\n </div>\n <div class=\"ax-end-side\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if(hasChild() && !isLoading()){\n <span class=\"ax-icon ax-icon-chevron-right arrow-icon\" [class.arrow-icon-expand]=\"!isCollapsed()\"></span>\n } @if(isLoading()){\n <ax-loading></ax-loading>\n }\n </div>\n</div>\n\n<div class=\"ax-side-children\" [@collapse]=\"isCollapsed()\">\n @if(isLoading()){\n <p>{{'loading' | translate | async }}</p>\n } @else {\n <ng-content select=\"ax-side-menu-item, ng-container\"></ng-content>\n }\n</div>\n\n<ng-content select=\"ax-divider\"></ng-content>", dependencies: [{ kind: "directive", type: i1.AXRippleDirective, selector: "[axRipple]", inputs: ["axRipple", "axRippleColor"] }, { kind: "component", type: i2.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], animations: [
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXSideMenuItemComponent, selector: "ax-side-menu-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: false, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoading: "isLoadingChange", text: "textChange", isCollapsed: "isCollapsedChange", active: "activeChange", onClick: "onClick" }, host: { attributes: { "ngSkipHydration": "true" }, properties: { "class": "this.__hostClass" } }, usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-title\"></ng-content>\n<div [axRipple] class=\"ax-side-item\" [class.ax-state-disabled]=\"disabled\" [class.ax-state-active]=\"active()\"\n (click)=\"_handleClickEvent($event)\">\n <div class=\"ax-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n @if(text()){\n <span>{{text()}}</span>\n }\n <ng-content></ng-content>\n </div>\n <div class=\"ax-end-side\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if(hasChild() && !isLoading()){\n <span class=\"ax-icon ax-icon-chevron-right arrow-icon\" [class.arrow-icon-expand]=\"!isCollapsed()\"></span>\n } @if(isLoading()){\n <ax-loading></ax-loading>\n }\n </div>\n</div>\n\n<div class=\"ax-side-children\" [@collapse]=\"isCollapsed()\">\n @if(isLoading()){\n <p>{{'loading' | translate | async }}</p>\n } @else {\n <ng-content select=\"ax-side-menu-item, ng-container\"></ng-content>\n }\n</div>\n\n<ng-content select=\"ax-divider\"></ng-content>", dependencies: [{ kind: "directive", type: i1.AXRippleDirective, selector: "[axRipple]", inputs: ["axRipple", "axRippleColor"] }, { kind: "component", type: i2.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], animations: [
|
60
63
|
trigger('collapse', [
|
61
64
|
state('false', style({ height: AUTO_STYLE, visibility: AUTO_STYLE })),
|
62
65
|
state('true', style({ height: '0', visibility: 'hidden' })),
|
@@ -75,7 +78,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
75
78
|
transition('true => false', animate(150 + 'ms ease-out')),
|
76
79
|
]),
|
77
80
|
], host: { ngSkipHydration: 'true' }, template: "<ng-content select=\"ax-title\"></ng-content>\n<div [axRipple] class=\"ax-side-item\" [class.ax-state-disabled]=\"disabled\" [class.ax-state-active]=\"active()\"\n (click)=\"_handleClickEvent($event)\">\n <div class=\"ax-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n @if(text()){\n <span>{{text()}}</span>\n }\n <ng-content></ng-content>\n </div>\n <div class=\"ax-end-side\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if(hasChild() && !isLoading()){\n <span class=\"ax-icon ax-icon-chevron-right arrow-icon\" [class.arrow-icon-expand]=\"!isCollapsed()\"></span>\n } @if(isLoading()){\n <ax-loading></ax-loading>\n }\n </div>\n</div>\n\n<div class=\"ax-side-children\" [@collapse]=\"isCollapsed()\">\n @if(isLoading()){\n <p>{{'loading' | translate | async }}</p>\n } @else {\n <ng-content select=\"ax-side-menu-item, ng-container\"></ng-content>\n }\n</div>\n\n<ng-content select=\"ax-divider\"></ng-content>" }]
|
78
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }]
|
81
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { __hostClass: [{
|
82
|
+
type: HostBinding,
|
83
|
+
args: ['class']
|
84
|
+
}] } });
|
79
85
|
|
80
86
|
/**
|
81
87
|
* @category
|
@@ -83,11 +89,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
83
89
|
*/
|
84
90
|
class AXSideMenuComponent extends MXBaseComponent {
|
85
91
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXSideMenuComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
86
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXSideMenuComponent, selector: "ax-side-menu", usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-side-menu-item,ax-title,ng-container,ng-content\"></ng-content>", styles: ["ax-side-menu{display:flex;width:100%;-webkit-user-select:none;user-select:none;flex-direction:column;font-size:.875rem;line-height:1.25rem;color:inherit}ax-side-menu>ax-title{margin-bottom:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-title{margin-bottom:.5rem;margin-top:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-divider{margin-top:.25rem;margin-bottom:.25rem;display:block;height:1px;width:100%;background-color:rgba(var(--ax-color-border-default))}ax-side-menu ax-side-menu-item .ax-side-item{padding:.5rem 1rem;margin-bottom:.25rem;font-size:inherit;position:relative;display:flex;cursor:pointer;align-items:center;justify-content:space-between;gap:.75rem;overflow:hidden;border-radius:var(--ax-rounded-border-default);font-weight:500;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-side-menu ax-side-menu-item .ax-side-item.ax-state-disabled{cursor:not-allowed;opacity:.5!important}ax-side-menu ax-side-menu-item .ax-side-item:hover:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled),ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled){background-color:rgba(var(--ax-
|
92
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXSideMenuComponent, selector: "ax-side-menu", usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-side-menu-item,ax-title,ng-container,ng-content\"></ng-content>", styles: ["ax-side-menu{display:flex;width:100%;-webkit-user-select:none;user-select:none;flex-direction:column;font-size:.875rem;line-height:1.25rem;color:inherit}ax-side-menu>ax-title{margin-bottom:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-title{margin-bottom:.5rem;margin-top:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-divider{margin-top:.25rem;margin-bottom:.25rem;display:block;height:1px;width:100%;background-color:rgba(var(--ax-color-border-default))}ax-side-menu ax-side-menu-item .ax-side-item{padding:.5rem 1rem;margin-bottom:.25rem;font-size:inherit;position:relative;display:flex;cursor:pointer;align-items:center;justify-content:space-between;gap:.75rem;overflow:hidden;border-radius:var(--ax-rounded-border-default);font-weight:500;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-side-menu ax-side-menu-item .ax-side-item.ax-state-disabled{cursor:not-allowed;opacity:.5!important}ax-side-menu ax-side-menu-item .ax-side-item:hover:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled),ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled){background-color:rgba(var(--ax-side-menu-bg))!important;color:rgba(var(--ax-side-menu-fore))!important}ax-side-menu ax-side-menu-item .ax-side-item:hover:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled) ax-loading ax-loading-spinner span,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled) ax-loading ax-loading-spinner span{border-color:rgba(var(--ax-side-menu-fore))}ax-side-menu ax-side-menu-item .ax-side-item .ax-start-side,ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side{display:flex;align-items:center}ax-side-menu ax-side-menu-item .ax-side-item .ax-start-side{gap:.5rem}ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon{display:block;line-height:1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon.arrow-icon-expand{transform:rotate(90deg)}ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side ax-loading ax-loading-spinner span{border-color:rgba(var(--ax-side-menu-fore))}ax-side-menu ax-side-menu-item .ax-side-item .ax-ripple{background-color:rgba(var(--ax-side-menu-fg),.3)!important}ax-side-menu ax-side-menu-item .ax-side-children{overflow:hidden;padding-left:1.25rem;padding-right:1.25rem}ax-side-menu ax-side-menu-item .ax-side-children ax-side-menu-item:first-child ax-title{margin-top:1em}ax-side-menu ax-side-menu-item .ax-side-children ax-side-menu-item .ax-side-item{font-weight:400}ax-side-menu ax-side-menu-item.ax-primary-solid{--ax-side-menu-bg: var(--ax-color-primary-200);--ax-side-menu-fg: var(--ax-color-primary-500);--ax-side-menu-fore: var(--ax-color-primary-fore-tint)}ax-side-menu ax-side-menu-item.ax-secondary-solid{--ax-side-menu-bg: var(--ax-color-secondary-200);--ax-side-menu-fg: var(--ax-color-secondary-500);--ax-side-menu-fore: var(--ax-color-secondary-fore-tint)}ax-side-menu ax-side-menu-item.ax-success-solid{--ax-side-menu-bg: var(--ax-color-success-200);--ax-side-menu-fg: var(--ax-color-success-500);--ax-side-menu-fore: var(--ax-color-success-fore-tint)}ax-side-menu ax-side-menu-item.ax-warning-solid{--ax-side-menu-bg: var(--ax-color-warning-200);--ax-side-menu-fg: var(--ax-color-warning-500);--ax-side-menu-fore: var(--ax-color-warning-fore-tint)}ax-side-menu ax-side-menu-item.ax-danger-solid{--ax-side-menu-bg: var(--ax-color-danger-200);--ax-side-menu-fg: var(--ax-color-danger-500);--ax-side-menu-fore: var(--ax-color-danger-fore-tint)}ax-side-menu ax-side-menu-item.ax-info-solid{--ax-side-menu-bg: var(--ax-color-info-200);--ax-side-menu-fg: var(--ax-color-info-500);--ax-side-menu-fore: var(--ax-color-info-fore-tint)}ax-side-menu ax-side-menu-item.ax-ghost-solid{--ax-side-menu-bg: var(--ax-color-neutral-200);--ax-side-menu-fg: var(--ax-color-neutral-500);--ax-side-menu-fore: var(--ax-color-neutral-fore-tint)}html[dir=rtl] ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon:before{-moz-transform:scale(-1,1);-webkit-transform:scale(-1,1);-o-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scaleX(-1)}html[dir=rtl] ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon.arrow-icon-expand{transform:rotate(-90deg)!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
87
93
|
}
|
88
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXSideMenuComponent, decorators: [{
|
89
95
|
type: Component,
|
90
|
-
args: [{ selector: 'ax-side-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-content select=\"ax-side-menu-item,ax-title,ng-container,ng-content\"></ng-content>", styles: ["ax-side-menu{display:flex;width:100%;-webkit-user-select:none;user-select:none;flex-direction:column;font-size:.875rem;line-height:1.25rem;color:inherit}ax-side-menu>ax-title{margin-bottom:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-title{margin-bottom:.5rem;margin-top:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-divider{margin-top:.25rem;margin-bottom:.25rem;display:block;height:1px;width:100%;background-color:rgba(var(--ax-color-border-default))}ax-side-menu ax-side-menu-item .ax-side-item{padding:.5rem 1rem;margin-bottom:.25rem;font-size:inherit;position:relative;display:flex;cursor:pointer;align-items:center;justify-content:space-between;gap:.75rem;overflow:hidden;border-radius:var(--ax-rounded-border-default);font-weight:500;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-side-menu ax-side-menu-item .ax-side-item.ax-state-disabled{cursor:not-allowed;opacity:.5!important}ax-side-menu ax-side-menu-item .ax-side-item:hover:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled),ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled){background-color:rgba(var(--ax-
|
96
|
+
args: [{ selector: 'ax-side-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-content select=\"ax-side-menu-item,ax-title,ng-container,ng-content\"></ng-content>", styles: ["ax-side-menu{display:flex;width:100%;-webkit-user-select:none;user-select:none;flex-direction:column;font-size:.875rem;line-height:1.25rem;color:inherit}ax-side-menu>ax-title{margin-bottom:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-title{margin-bottom:.5rem;margin-top:.5rem;display:block;padding:.25rem .75rem;font-size:.75rem;line-height:1rem;font-weight:500;text-transform:uppercase;opacity:.5}ax-side-menu ax-side-menu-item ax-divider{margin-top:.25rem;margin-bottom:.25rem;display:block;height:1px;width:100%;background-color:rgba(var(--ax-color-border-default))}ax-side-menu ax-side-menu-item .ax-side-item{padding:.5rem 1rem;margin-bottom:.25rem;font-size:inherit;position:relative;display:flex;cursor:pointer;align-items:center;justify-content:space-between;gap:.75rem;overflow:hidden;border-radius:var(--ax-rounded-border-default);font-weight:500;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-side-menu ax-side-menu-item .ax-side-item.ax-state-disabled{cursor:not-allowed;opacity:.5!important}ax-side-menu ax-side-menu-item .ax-side-item:hover:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled),ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled){background-color:rgba(var(--ax-side-menu-bg))!important;color:rgba(var(--ax-side-menu-fore))!important}ax-side-menu ax-side-menu-item .ax-side-item:hover:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled) ax-loading ax-loading-spinner span,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active:not(ax-side-menu ax-side-menu-item .ax-side-item:hover.ax-state-disabled,ax-side-menu ax-side-menu-item .ax-side-item.ax-state-active.ax-state-disabled) ax-loading ax-loading-spinner span{border-color:rgba(var(--ax-side-menu-fore))}ax-side-menu ax-side-menu-item .ax-side-item .ax-start-side,ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side{display:flex;align-items:center}ax-side-menu ax-side-menu-item .ax-side-item .ax-start-side{gap:.5rem}ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon{display:block;line-height:1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon.arrow-icon-expand{transform:rotate(90deg)}ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side ax-loading ax-loading-spinner span{border-color:rgba(var(--ax-side-menu-fore))}ax-side-menu ax-side-menu-item .ax-side-item .ax-ripple{background-color:rgba(var(--ax-side-menu-fg),.3)!important}ax-side-menu ax-side-menu-item .ax-side-children{overflow:hidden;padding-left:1.25rem;padding-right:1.25rem}ax-side-menu ax-side-menu-item .ax-side-children ax-side-menu-item:first-child ax-title{margin-top:1em}ax-side-menu ax-side-menu-item .ax-side-children ax-side-menu-item .ax-side-item{font-weight:400}ax-side-menu ax-side-menu-item.ax-primary-solid{--ax-side-menu-bg: var(--ax-color-primary-200);--ax-side-menu-fg: var(--ax-color-primary-500);--ax-side-menu-fore: var(--ax-color-primary-fore-tint)}ax-side-menu ax-side-menu-item.ax-secondary-solid{--ax-side-menu-bg: var(--ax-color-secondary-200);--ax-side-menu-fg: var(--ax-color-secondary-500);--ax-side-menu-fore: var(--ax-color-secondary-fore-tint)}ax-side-menu ax-side-menu-item.ax-success-solid{--ax-side-menu-bg: var(--ax-color-success-200);--ax-side-menu-fg: var(--ax-color-success-500);--ax-side-menu-fore: var(--ax-color-success-fore-tint)}ax-side-menu ax-side-menu-item.ax-warning-solid{--ax-side-menu-bg: var(--ax-color-warning-200);--ax-side-menu-fg: var(--ax-color-warning-500);--ax-side-menu-fore: var(--ax-color-warning-fore-tint)}ax-side-menu ax-side-menu-item.ax-danger-solid{--ax-side-menu-bg: var(--ax-color-danger-200);--ax-side-menu-fg: var(--ax-color-danger-500);--ax-side-menu-fore: var(--ax-color-danger-fore-tint)}ax-side-menu ax-side-menu-item.ax-info-solid{--ax-side-menu-bg: var(--ax-color-info-200);--ax-side-menu-fg: var(--ax-color-info-500);--ax-side-menu-fore: var(--ax-color-info-fore-tint)}ax-side-menu ax-side-menu-item.ax-ghost-solid{--ax-side-menu-bg: var(--ax-color-neutral-200);--ax-side-menu-fg: var(--ax-color-neutral-500);--ax-side-menu-fore: var(--ax-color-neutral-fore-tint)}html[dir=rtl] ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon:before{-moz-transform:scale(-1,1);-webkit-transform:scale(-1,1);-o-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scaleX(-1)}html[dir=rtl] ax-side-menu ax-side-menu-item .ax-side-item .ax-end-side .arrow-icon.arrow-icon-expand{transform:rotate(-90deg)!important}\n"] }]
|
91
97
|
}] });
|
92
98
|
|
93
99
|
const COMPONENT = [AXSideMenuComponent, AXSideMenuItemComponent];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-side-menu.mjs","sources":["../../../../libs/components/side-menu/src/lib/side-menu-item/side-menu-item.compoent.ts","../../../../libs/components/side-menu/src/lib/side-menu-item/side-menu-item.compoent.html","../../../../libs/components/side-menu/src/lib/side-menu.component.ts","../../../../libs/components/side-menu/src/lib/side-menu.component.html","../../../../libs/components/side-menu/src/lib/side-menu.module.ts","../../../../libs/components/side-menu/src/acorex-components-side-menu.ts"],"sourcesContent":["import { AXClickEvent, MXColorComponent, MXInteractiveComponent } from '@acorex/components/common';\nimport { AUTO_STYLE, animate, state, style, transition, trigger } from '@angular/animations';\nimport { ChangeDetectionStrategy, Component, ElementRef, ViewEncapsulation, afterNextRender, model, output, signal } from '@angular/core';\nimport { classes } from 'polytype';\n\nexport class AXSideMenuItemClickEvent extends AXClickEvent {\n handled = false;\n}\n\n@Component({\n selector: 'ax-side-menu-item',\n inputs: ['disabled', 'color'],\n templateUrl: './side-menu-item.compoent.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n animations: [\n trigger('collapse', [\n state('false', style({ height: AUTO_STYLE, visibility: AUTO_STYLE })),\n state('true', style({ height: '0', visibility: 'hidden' })),\n transition('false => true', animate(150 + 'ms ease-in')),\n transition('true => false', animate(150 + 'ms ease-out')),\n ]),\n ],\n host: { ngSkipHydration: 'true' },\n})\nexport class AXSideMenuItemComponent extends classes(MXInteractiveComponent, MXColorComponent) {\n isLoading = model(false);\n text = model('');\n\n isCollapsed = model(false);\n\n active = model(false);\n\n onClick = output<AXSideMenuItemClickEvent>();\n\n protected hasChild = signal(false);\n\n constructor(private elem: ElementRef) {\n super();\n\n afterNextRender(() => {\n this.hasChild.set(this.elem.nativeElement.getElementsByTagName('ax-side-menu-item').length > 0);\n });\n }\n\n _handleClickEvent(e: MouseEvent) {\n if (this.disabled || this.isLoading()) return;\n const event = {\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n handled: false,\n };\n this.onClick.emit(event);\n if (!event.handled) {\n this.toggle();\n }\n e.stopPropagation();\n }\n\n toggle() {\n this.isCollapsed.set(!this.isCollapsed());\n }\n\n open() {\n this.isCollapsed.set(true);\n }\n\n close() {\n this.isCollapsed.set(false);\n }\n}\n","<ng-content select=\"ax-title\"></ng-content>\n<div [axRipple] class=\"ax-side-item\" [class.ax-state-disabled]=\"disabled\" [class.ax-state-active]=\"active()\"\n (click)=\"_handleClickEvent($event)\">\n <div class=\"ax-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n @if(text()){\n <span>{{text()}}</span>\n }\n <ng-content></ng-content>\n </div>\n <div class=\"ax-end-side\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if(hasChild() && !isLoading()){\n <span class=\"ax-icon ax-icon-chevron-right arrow-icon\" [class.arrow-icon-expand]=\"!isCollapsed()\"></span>\n } @if(isLoading()){\n <ax-loading></ax-loading>\n }\n </div>\n</div>\n\n<div class=\"ax-side-children\" [@collapse]=\"isCollapsed()\">\n @if(isLoading()){\n <p>{{'loading' | translate | async }}</p>\n } @else {\n <ng-content select=\"ax-side-menu-item, ng-container\"></ng-content>\n }\n</div>\n\n<ng-content select=\"ax-divider\"></ng-content>","import { MXBaseComponent } from '@acorex/components/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n/**\n * @category\n * A component for displaying a side menu with customizable content.\n */\n@Component({\n selector: 'ax-side-menu',\n templateUrl: './side-menu.component.html',\n styleUrls: ['./side-menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXSideMenuComponent extends MXBaseComponent {}\n","<ng-content select=\"ax-side-menu-item,ax-title,ng-container,ng-content\"></ng-content>","import { AXCommonModule, AXRippleDirective } from '@acorex/components/common';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXSideMenuItemComponent } from './side-menu-item/side-menu-item.compoent';\nimport { AXSideMenuComponent } from './side-menu.component';\n\nconst COMPONENT = [AXSideMenuComponent, AXSideMenuItemComponent];\nconst MODULES = [CommonModule, AXCommonModule, AXRippleDirective, AXLoadingModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXSideMenuModule {}\n","/**\n * Gener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AAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBATV,mBAAmB,EAAE,uBAAuB,CAAA,EAAA,OAAA,EAAA,CAC9C,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,CADnF,EAAA,OAAA,EAAA,CAAA,mBAAmB,EAAE,uBAAuB,CAAA,EAAA,CAAA,CAAA,EAAA;AASlD,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,gBAAgB,YARZ,YAAY,EAAE,cAAc,EAAqB,eAAe,EAAE,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAQzF,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-side-menu.mjs","sources":["../../../../libs/components/side-menu/src/lib/side-menu-item/side-menu-item.compoent.ts","../../../../libs/components/side-menu/src/lib/side-menu-item/side-menu-item.compoent.html","../../../../libs/components/side-menu/src/lib/side-menu.component.ts","../../../../libs/components/side-menu/src/lib/side-menu.component.html","../../../../libs/components/side-menu/src/lib/side-menu.module.ts","../../../../libs/components/side-menu/src/acorex-components-side-menu.ts"],"sourcesContent":["import { AXClickEvent, MXColorComponent, MXInteractiveComponent } from '@acorex/components/common';\nimport { AUTO_STYLE, animate, state, style, transition, trigger } from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n ViewEncapsulation,\n afterNextRender,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { classes } from 'polytype';\n\nexport class AXSideMenuItemClickEvent extends AXClickEvent {\n handled = false;\n}\n\n@Component({\n selector: 'ax-side-menu-item',\n inputs: ['disabled', 'color'],\n templateUrl: './side-menu-item.compoent.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n animations: [\n trigger('collapse', [\n state('false', style({ height: AUTO_STYLE, visibility: AUTO_STYLE })),\n state('true', style({ height: '0', visibility: 'hidden' })),\n transition('false => true', animate(150 + 'ms ease-in')),\n transition('true => false', animate(150 + 'ms ease-out')),\n ]),\n ],\n host: { ngSkipHydration: 'true' },\n})\nexport class AXSideMenuItemComponent extends classes(MXInteractiveComponent, MXColorComponent) {\n isLoading = model(false);\n text = model('');\n\n isCollapsed = model(false);\n\n active = model(false);\n\n onClick = output<AXSideMenuItemClickEvent>();\n\n protected hasChild = signal(false);\n\n constructor(private elem: ElementRef) {\n super();\n\n afterNextRender(() => {\n this.hasChild.set(this.elem.nativeElement.getElementsByTagName('ax-side-menu-item').length > 0);\n });\n }\n\n _handleClickEvent(e: MouseEvent) {\n if (this.disabled || this.isLoading()) return;\n const event = {\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n handled: false,\n };\n this.onClick.emit(event);\n if (!event.handled) {\n this.toggle();\n }\n e.stopPropagation();\n }\n\n toggle() {\n this.isCollapsed.set(!this.isCollapsed());\n }\n\n open() {\n this.isCollapsed.set(true);\n }\n\n close() {\n this.isCollapsed.set(false);\n }\n @HostBinding('class')\n private get __hostClass(): string[] {\n return [`ax-${this.color}-solid`];\n }\n}\n","<ng-content select=\"ax-title\"></ng-content>\n<div [axRipple] class=\"ax-side-item\" [class.ax-state-disabled]=\"disabled\" [class.ax-state-active]=\"active()\"\n (click)=\"_handleClickEvent($event)\">\n <div class=\"ax-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n @if(text()){\n <span>{{text()}}</span>\n }\n <ng-content></ng-content>\n </div>\n <div class=\"ax-end-side\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if(hasChild() && !isLoading()){\n <span class=\"ax-icon ax-icon-chevron-right arrow-icon\" [class.arrow-icon-expand]=\"!isCollapsed()\"></span>\n } @if(isLoading()){\n <ax-loading></ax-loading>\n }\n </div>\n</div>\n\n<div class=\"ax-side-children\" [@collapse]=\"isCollapsed()\">\n @if(isLoading()){\n <p>{{'loading' | translate | async }}</p>\n } @else {\n <ng-content select=\"ax-side-menu-item, ng-container\"></ng-content>\n }\n</div>\n\n<ng-content select=\"ax-divider\"></ng-content>","import { MXBaseComponent } from '@acorex/components/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n/**\n * @category\n * A component for displaying a side menu with customizable content.\n */\n@Component({\n selector: 'ax-side-menu',\n templateUrl: './side-menu.component.html',\n styleUrls: ['./side-menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXSideMenuComponent extends MXBaseComponent {}\n","<ng-content select=\"ax-side-menu-item,ax-title,ng-container,ng-content\"></ng-content>","import { AXCommonModule, AXRippleDirective } from '@acorex/components/common';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXSideMenuItemComponent } from './side-menu-item/side-menu-item.compoent';\nimport { AXSideMenuComponent } from './side-menu.component';\n\nconst COMPONENT = [AXSideMenuComponent, AXSideMenuItemComponent];\nconst MODULES = [CommonModule, AXCommonModule, AXRippleDirective, AXLoadingModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXSideMenuModule {}\n","/**\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
3
3
|
import * as i0 from "@angular/core";
|
4
|
-
|
4
|
+
/**
|
5
|
+
* @description
|
6
|
+
* The `AXMapComponent` provides an interactive map powered by Leaflet. It supports markers, location tracking,
|
7
|
+
* and configurable zoom, latitude, longitude, and marker behavior. The component allows easy integration and
|
8
|
+
* manipulation of map features.
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* <ax-map [latitude]="51.505" [longitude]="-0.09" [zoomLevel]="13" [hasMarker]="true"></ax-map>
|
12
|
+
*/
|
13
|
+
export declare class AXMapComponent implements OnDestroy {
|
14
|
+
/**
|
15
|
+
* @description
|
16
|
+
* Zoom level of the map.
|
17
|
+
* @default 13
|
18
|
+
*/
|
5
19
|
zoomLevel: import("@angular/core").InputSignal<number>;
|
20
|
+
/**
|
21
|
+
* @description
|
22
|
+
* Latitude of the map center.
|
23
|
+
* @default 51.505
|
24
|
+
*/
|
6
25
|
latitude: import("@angular/core").InputSignal<number>;
|
26
|
+
/**
|
27
|
+
* @description
|
28
|
+
* Longitude of the map center.
|
29
|
+
* @default -0.09
|
30
|
+
*/
|
7
31
|
longitude: import("@angular/core").InputSignal<number>;
|
32
|
+
/**
|
33
|
+
* @description
|
34
|
+
* Maximum number of markers allowed on the map.
|
35
|
+
* @default 1
|
36
|
+
*/
|
37
|
+
maxMarker: import("@angular/core").InputSignal<number>;
|
38
|
+
/**
|
39
|
+
* @description
|
40
|
+
* Whether the map should have a marker control.
|
41
|
+
* @default false
|
42
|
+
*/
|
8
43
|
hasMarker: import("@angular/core").InputSignal<boolean>;
|
9
|
-
|
44
|
+
/**
|
45
|
+
* @description
|
46
|
+
* Whether the map should have a location control.
|
47
|
+
* @default false
|
48
|
+
*/
|
10
49
|
hasLocator: import("@angular/core").InputSignal<boolean>;
|
50
|
+
/**
|
51
|
+
* @description
|
52
|
+
* Position of the marker control on the map.
|
53
|
+
* @default 'topleft'
|
54
|
+
*/
|
55
|
+
markerPlace: import("@angular/core").InputSignal<AXMapControlPlace>;
|
56
|
+
/**
|
57
|
+
* @description
|
58
|
+
* Position of the locate control on the map.
|
59
|
+
* @default 'bottomright'
|
60
|
+
*/
|
11
61
|
locatePlace: import("@angular/core").InputSignal<AXMapControlPlace>;
|
62
|
+
/**
|
63
|
+
* @description
|
64
|
+
* Array or single marker location(s) to be placed on the map.
|
65
|
+
* @default undefined
|
66
|
+
*/
|
12
67
|
markers: import("@angular/core").InputSignal<AXMapLocation | AXMapLocation[]>;
|
68
|
+
/**
|
69
|
+
* @description
|
70
|
+
* Event triggered when a new marker is added to the map.
|
71
|
+
*/
|
13
72
|
onMarkerAdded: import("@angular/core").OutputEmitterRef<AXMapLocation>;
|
73
|
+
/**
|
74
|
+
* @description
|
75
|
+
* Event triggered when marker positions are changed on the map.
|
76
|
+
*/
|
14
77
|
onMarkerChanged: import("@angular/core").OutputEmitterRef<AXMapLocation[]>;
|
78
|
+
/**
|
79
|
+
* @description
|
80
|
+
* Event triggered when a location is found via the location control.
|
81
|
+
*/
|
15
82
|
onLocationFound: import("@angular/core").OutputEmitterRef<AXMapLocation>;
|
16
83
|
private mapContainer;
|
17
|
-
private
|
18
|
-
|
84
|
+
private leafletService;
|
85
|
+
private rendered;
|
86
|
+
/**
|
87
|
+
* @description
|
88
|
+
* Adds a marker to the specified location on the map.
|
89
|
+
* @param location - The location where the marker should be placed.
|
90
|
+
*/
|
19
91
|
addMarker(location: AXMapLocation): void;
|
92
|
+
/**
|
93
|
+
* @description
|
94
|
+
* Retrieves all markers currently placed on the map.
|
95
|
+
* @returns An array of `AXMapLocation` representing all markers.
|
96
|
+
*/
|
97
|
+
getMarkers(): AXMapLocation[];
|
98
|
+
/**
|
99
|
+
* @description
|
100
|
+
* Flies the map to a specific location with optional zoom, marker placement, and animation duration.
|
101
|
+
*
|
102
|
+
* @param location - The target location to fly to.
|
103
|
+
* @param zoom - Optional zoom level for the map.
|
104
|
+
* @param setMarker - Whether to set a marker at the destination.
|
105
|
+
* @param duration - Optional duration for the fly animation.
|
106
|
+
*/
|
20
107
|
flyTo(location: AXMapLocation, zoom?: number, setMarker?: boolean, duration?: number): void;
|
21
108
|
constructor();
|
109
|
+
/**
|
110
|
+
* @description
|
111
|
+
* Cleanup function that destroys the map when the component is destroyed.
|
112
|
+
*/
|
22
113
|
ngOnDestroy(): void;
|
23
114
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXMapComponent, never>;
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXMapComponent, "ax-map", never, { "zoomLevel": { "alias": "zoomLevel"; "required": false; "isSignal": true; }; "latitude": { "alias": "latitude"; "required": false; "isSignal": true; }; "longitude": { "alias": "longitude"; "required": false; "isSignal": true; }; "
|
115
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXMapComponent, "ax-map", never, { "zoomLevel": { "alias": "zoomLevel"; "required": false; "isSignal": true; }; "latitude": { "alias": "latitude"; "required": false; "isSignal": true; }; "longitude": { "alias": "longitude"; "required": false; "isSignal": true; }; "maxMarker": { "alias": "maxMarker"; "required": false; "isSignal": true; }; "hasMarker": { "alias": "hasMarker"; "required": false; "isSignal": true; }; "hasLocator": { "alias": "hasLocator"; "required": false; "isSignal": true; }; "markerPlace": { "alias": "markerPlace"; "required": false; "isSignal": true; }; "locatePlace": { "alias": "locatePlace"; "required": false; "isSignal": true; }; "markers": { "alias": "markers"; "required": false; "isSignal": true; }; }, { "onMarkerAdded": "onMarkerAdded"; "onMarkerChanged": "onMarkerChanged"; "onLocationFound": "onLocationFound"; }, never, never, false, never>;
|
25
116
|
}
|