mn-angular-lib 1.0.49 → 1.0.51

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.
@@ -171,7 +171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
171
171
  }] }] });
172
172
 
173
173
  const mnAlertVariants = tv({
174
- base: 'flex items-start gap-3 p-4 border rounded-xl shadow-sm transition-all duration-300',
174
+ base: 'flex items-start gap-3 p-4 border rounded-xl shadow-sm transition-all duration-300 w-full max-sm:rounded-none',
175
175
  variants: {
176
176
  kind: {
177
177
  success: 'bg-success/10 border-success/30 text-success',
@@ -374,11 +374,11 @@ class MnAlertOutletComponent {
374
374
  };
375
375
  }
376
376
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnAlertOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
377
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MnAlertOutletComponent, isStandalone: true, selector: "mn-alert-outlet", inputs: { template: "template" }, ngImport: i0, template: "@if (alerts$ | async; as alerts) {\n <div class=\"fixed top-4 right-4 z-[9999] flex flex-col gap-3 w-full max-w-sm\">\n @for (a of alerts; track trackById($index, a)) {\n @if (template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"contextFor(a)\">\n </ng-container>\n } @else {\n <div [class]=\"getAlertClasses(a)\" [class.extra]=\"a.cssClass\" class=\"relative\">\n <div class=\"flex-1 min-w-0 pr-8\">\n <h4 class=\"font-semibold text-sm\">{{ a.title }}</h4>\n @if (a.subTitle) {\n <p class=\"text-sm mt-1 opacity-90 leading-tight\">{{ a.subTitle }}</p>\n }\n </div>\n <button\n mnButton\n [data]=\"{ size: 'md', variant: 'text' }\"\n (click)=\"dismissAlert(a.id)\"\n class=\"absolute top-2 right-2 shrink-0 !text-current hover:!bg-current/10\"\n aria-label=\"Close\"\n >\n &times;\n </button>\n </div>\n }\n }\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MnButton, selector: "button[mnButton], a[mnButton]", inputs: ["data"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
377
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MnAlertOutletComponent, isStandalone: true, selector: "mn-alert-outlet", inputs: { template: "template" }, ngImport: i0, template: "@if (alerts$ | async; as alerts) {\n <div class=\"fixed top-4 left-0 right-0 z-[9999] flex flex-col gap-3 w-full px-2 sm:px-0 sm:left-auto sm:right-4 sm:max-w-sm\">\n @for (a of alerts; track trackById($index, a)) {\n @if (template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"contextFor(a)\">\n </ng-container>\n } @else {\n <div [class]=\"getAlertClasses(a)\" [class.extra]=\"a.cssClass\" class=\"relative\">\n <div class=\"flex-1 min-w-0 pr-8\">\n <h4 class=\"font-semibold text-sm\">{{ a.title }}</h4>\n @if (a.subTitle) {\n <p class=\"text-sm mt-1 opacity-90 leading-tight\">{{ a.subTitle }}</p>\n }\n </div>\n <button\n mnButton\n [data]=\"{ size: 'md', variant: 'text' }\"\n (click)=\"dismissAlert(a.id)\"\n class=\"absolute top-2 right-2 shrink-0 !text-current hover:!bg-current/10\"\n aria-label=\"Close\"\n >\n &times;\n </button>\n </div>\n }\n }\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MnButton, selector: "button[mnButton], a[mnButton]", inputs: ["data"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
378
378
  }
379
379
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnAlertOutletComponent, decorators: [{
380
380
  type: Component,
381
- args: [{ selector: 'mn-alert-outlet', standalone: true, imports: [CommonModule, MnButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (alerts$ | async; as alerts) {\n <div class=\"fixed top-4 right-4 z-[9999] flex flex-col gap-3 w-full max-w-sm\">\n @for (a of alerts; track trackById($index, a)) {\n @if (template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"contextFor(a)\">\n </ng-container>\n } @else {\n <div [class]=\"getAlertClasses(a)\" [class.extra]=\"a.cssClass\" class=\"relative\">\n <div class=\"flex-1 min-w-0 pr-8\">\n <h4 class=\"font-semibold text-sm\">{{ a.title }}</h4>\n @if (a.subTitle) {\n <p class=\"text-sm mt-1 opacity-90 leading-tight\">{{ a.subTitle }}</p>\n }\n </div>\n <button\n mnButton\n [data]=\"{ size: 'md', variant: 'text' }\"\n (click)=\"dismissAlert(a.id)\"\n class=\"absolute top-2 right-2 shrink-0 !text-current hover:!bg-current/10\"\n aria-label=\"Close\"\n >\n &times;\n </button>\n </div>\n }\n }\n </div>\n}\n" }]
381
+ args: [{ selector: 'mn-alert-outlet', standalone: true, imports: [CommonModule, MnButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (alerts$ | async; as alerts) {\n <div class=\"fixed top-4 left-0 right-0 z-[9999] flex flex-col gap-3 w-full px-2 sm:px-0 sm:left-auto sm:right-4 sm:max-w-sm\">\n @for (a of alerts; track trackById($index, a)) {\n @if (template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"contextFor(a)\">\n </ng-container>\n } @else {\n <div [class]=\"getAlertClasses(a)\" [class.extra]=\"a.cssClass\" class=\"relative\">\n <div class=\"flex-1 min-w-0 pr-8\">\n <h4 class=\"font-semibold text-sm\">{{ a.title }}</h4>\n @if (a.subTitle) {\n <p class=\"text-sm mt-1 opacity-90 leading-tight\">{{ a.subTitle }}</p>\n }\n </div>\n <button\n mnButton\n [data]=\"{ size: 'md', variant: 'text' }\"\n (click)=\"dismissAlert(a.id)\"\n class=\"absolute top-2 right-2 shrink-0 !text-current hover:!bg-current/10\"\n aria-label=\"Close\"\n >\n &times;\n </button>\n </div>\n }\n }\n </div>\n}\n" }]
382
382
  }], ctorParameters: () => [], propDecorators: { template: [{
383
383
  type: Input
384
384
  }] } });
@@ -1674,7 +1674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
1674
1674
  }] } });
1675
1675
 
1676
1676
  const mnTextareaVariants = tv({
1677
- base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm',
1677
+ base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary',
1678
1678
  variants: {
1679
1679
  shadow: {
1680
1680
  true: 'shadow-lg',
@@ -8117,6 +8117,105 @@ class CrudService {
8117
8117
  }
8118
8118
  }
8119
8119
 
8120
+ /**
8121
+ * Lightweight abstract HTTP base class that removes common boilerplate
8122
+ * from API services.
8123
+ *
8124
+ * Provides typed `get`, `post`, `patch`, `put`, and `delete` methods
8125
+ * that return Promises, automatic query-param building, and base-URL
8126
+ * injection via the `API_BASE_URL` token.
8127
+ *
8128
+ * Subclass this directly for services with static or mixed endpoints.
8129
+ * No CRUD structure is imposed — every method accepts a free-form path.
8130
+ */
8131
+ class MnHttpService {
8132
+ /** Angular HTTP client injected automatically. */
8133
+ http = inject(HttpClient);
8134
+ /** Base API URL provided via the `API_BASE_URL` injection token. */
8135
+ baseUrl = inject(API_BASE_URL);
8136
+ /**
8137
+ * Sends a typed GET request.
8138
+ * @param path The path appended to the base URL.
8139
+ * @param query Optional query parameters.
8140
+ * @returns A promise resolving to the typed response body.
8141
+ */
8142
+ get(path, query) {
8143
+ return firstValueFrom(this.http.get(`${this.baseUrl}${path}`, {
8144
+ params: this.toHttpParams(query),
8145
+ }));
8146
+ }
8147
+ /**
8148
+ * Sends a typed POST request.
8149
+ * @param path The path appended to the base URL.
8150
+ * @param body Optional request body.
8151
+ * @param query Optional query parameters.
8152
+ * @returns A promise resolving to the typed response body.
8153
+ */
8154
+ post(path, body, query) {
8155
+ return firstValueFrom(this.http.post(`${this.baseUrl}${path}`, body ?? {}, {
8156
+ params: this.toHttpParams(query),
8157
+ }));
8158
+ }
8159
+ /**
8160
+ * Sends a typed PATCH request.
8161
+ * @param path The path appended to the base URL.
8162
+ * @param body Optional request body.
8163
+ * @param query Optional query parameters.
8164
+ * @returns A promise resolving to the typed response body.
8165
+ */
8166
+ patch(path, body, query) {
8167
+ return firstValueFrom(this.http.patch(`${this.baseUrl}${path}`, body ?? {}, {
8168
+ params: this.toHttpParams(query),
8169
+ }));
8170
+ }
8171
+ /**
8172
+ * Sends a typed PUT request.
8173
+ * @param path The path appended to the base URL.
8174
+ * @param body Optional request body.
8175
+ * @param query Optional query parameters.
8176
+ * @returns A promise resolving to the typed response body.
8177
+ */
8178
+ put(path, body, query) {
8179
+ return firstValueFrom(this.http.put(`${this.baseUrl}${path}`, body ?? {}, {
8180
+ params: this.toHttpParams(query),
8181
+ }));
8182
+ }
8183
+ /**
8184
+ * Sends a typed DELETE request.
8185
+ * @param path The path appended to the base URL.
8186
+ * @param query Optional query parameters.
8187
+ * @returns A promise resolving to the typed response body.
8188
+ */
8189
+ delete(path, query) {
8190
+ return firstValueFrom(this.http.delete(`${this.baseUrl}${path}`, {
8191
+ params: this.toHttpParams(query),
8192
+ }));
8193
+ }
8194
+ /**
8195
+ * Converts a query-params record to Angular `HttpParams`.
8196
+ * Null and undefined values are silently skipped.
8197
+ * Array values are appended as multiple entries for the same key.
8198
+ * @param query The query parameter record to convert.
8199
+ * @returns An `HttpParams` instance, or `undefined` when no parameters are provided.
8200
+ */
8201
+ toHttpParams(query) {
8202
+ if (!query)
8203
+ return undefined;
8204
+ let params = new HttpParams();
8205
+ for (const [key, rawValue] of Object.entries(query)) {
8206
+ if (rawValue === null || rawValue === undefined)
8207
+ continue;
8208
+ const values = Array.isArray(rawValue) ? rawValue : [rawValue];
8209
+ for (const value of values) {
8210
+ if (value === null || value === undefined)
8211
+ continue;
8212
+ params = params.append(key, String(value));
8213
+ }
8214
+ }
8215
+ return params;
8216
+ }
8217
+ }
8218
+
8120
8219
  /**
8121
8220
  * Enable live preview mode. Listens for postMessage events from
8122
8221
  * Mn Web Manager and hot-swaps config/translations at runtime.
@@ -8161,5 +8260,5 @@ function enableMnPreviewMode(configService, langService, allowedOrigins) {
8161
8260
  * Generated bundle index. Do not edit.
8162
8261
  */
8163
8262
 
8164
- export { API_BASE_URL, ActionStyle, BackdropMode, BaseModalBuilder, CALENDAR_CONFIG, CALENDAR_DATE_FORMATTER, CalendarDayComponent, CalendarEventComponent, CalendarEventDefaultComponent, CalendarEventLayoutService, CalendarMonthComponent, CalendarUtility, CalendarView, CalendarViewComponent, CalendarWeekComponent, CloseMode, ColumnSortType, ConfirmationModalBuilder, ConfirmationTone, CrudService, CustomModalBuilder, DEFAULT_CALENDAR_CONFIG, DEFAULT_MN_ALERT_CONFIG, DefaultCalendarDateFormatter, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_ALERT_CONFIG, MN_CALENDAR_COMPONENT_NAME, MN_CALENDAR_CONFIG, MN_CHECKBOX_CONFIG, MN_DATETIME_CONFIG, MN_ICON_MAP, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_SELECT_CONFIG, MN_TEXTAREA_CONFIG, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnBadge, MnButton, MnCheckbox, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDatetime, MnDualHorizontalImage, MnFormBodyComponent, MnHiddenBelowDirective, MnIcon, MnIconAttributes, MnInformationCard, MnInputField, MnInstanceDirective, MnLanguageService, MnList, MnModalRef, MnModalService, MnModalShellComponent, MnMultiSelect, MnSectionDirective, MnSelect, MnTabComponent, MnTable, MnTextarea, MnTranslatePipe, MnWizardBodyComponent, ModalBuilder, ModalCloseReason, ModalIntent, ModalKind, ModalSize, NavigationDirection, OptionState, SelectionMode, StepBuilder, StepState, SubmitMode, UpcomingEventRowComponent, UpcomingEventsComponent, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, dateTimeAdapter, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnBadgeVariants, mnButtonVariants, mnCheckboxVariants, mnCheckboxWrapperVariants, mnDatetimeVariants, mnIconVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnSelectVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig };
8263
+ export { API_BASE_URL, ActionStyle, BackdropMode, BaseModalBuilder, CALENDAR_CONFIG, CALENDAR_DATE_FORMATTER, CalendarDayComponent, CalendarEventComponent, CalendarEventDefaultComponent, CalendarEventLayoutService, CalendarMonthComponent, CalendarUtility, CalendarView, CalendarViewComponent, CalendarWeekComponent, CloseMode, ColumnSortType, ConfirmationModalBuilder, ConfirmationTone, CrudService, CustomModalBuilder, DEFAULT_CALENDAR_CONFIG, DEFAULT_MN_ALERT_CONFIG, DefaultCalendarDateFormatter, FieldAppearance, FieldKind, FormLayoutMode, FormModalBuilder, KeyboardMode, MN_ALERT_CONFIG, MN_CALENDAR_COMPONENT_NAME, MN_CALENDAR_CONFIG, MN_CHECKBOX_CONFIG, MN_DATETIME_CONFIG, MN_ICON_MAP, MN_INPUT_FIELD_CONFIG, MN_INSTANCE_ID, MN_LIB_DUAL_HORIZONTAL_IMAGE, MN_MULTI_SELECT_CONFIG, MN_SECTION_PATH, MN_SELECT_CONFIG, MN_TEXTAREA_CONFIG, MnAlertOutletComponent, MnAlertService, MnAlertStore, MnBadge, MnButton, MnCheckbox, MnConfigService, MnConfirmationBodyComponent, MnCustomBodyHostComponent, MnDatetime, MnDualHorizontalImage, MnFormBodyComponent, MnHiddenBelowDirective, MnHttpService, MnIcon, MnIconAttributes, MnInformationCard, MnInputField, MnInstanceDirective, MnLanguageService, MnList, MnModalRef, MnModalService, MnModalShellComponent, MnMultiSelect, MnSectionDirective, MnSelect, MnTabComponent, MnTable, MnTextarea, MnTranslatePipe, MnWizardBodyComponent, ModalBuilder, ModalCloseReason, ModalIntent, ModalKind, ModalSize, NavigationDirection, OptionState, SelectionMode, StepBuilder, StepState, SubmitMode, UpcomingEventRowComponent, UpcomingEventsComponent, ValidationCode, ValidationStatus, WizardFlowMode, WizardModalBuilder, dateTimeAdapter, defaultTextAdapter, enableMnPreviewMode, isTranslatable, mnAlertVariants, mnBadgeVariants, mnButtonVariants, mnCheckboxVariants, mnCheckboxWrapperVariants, mnDatetimeVariants, mnIconVariants, mnInformationCardVariants, mnInputFieldVariants, mnMultiSelectVariants, mnSelectVariants, mnTextareaVariants, numberAdapter, pickAdapter, provideMnAlerts, provideMnCalendarConfig, provideMnComponentConfig, provideMnConfig, provideMnLanguage, resolveCalendarConfig };
8165
8264
  //# sourceMappingURL=mn-angular-lib.mjs.map