mn-angular-lib 0.0.61 → 0.0.63
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.
|
@@ -178,10 +178,11 @@ const mnAlertVariants = tv({
|
|
|
178
178
|
warning: 'bg-warning/10 border-warning/30 text-warning',
|
|
179
179
|
error: 'bg-error/10 border-error/30 text-error',
|
|
180
180
|
default: 'bg-base-100 border-base-300 text-base-content',
|
|
181
|
+
accent: 'bg-accent/10 border-accent/30 text-accent',
|
|
181
182
|
},
|
|
182
183
|
variant: {
|
|
183
184
|
fill: '',
|
|
184
|
-
outline: 'bg-
|
|
185
|
+
outline: 'bg-base-200 border-2',
|
|
185
186
|
soft: 'border-none shadow-none',
|
|
186
187
|
}
|
|
187
188
|
},
|
|
@@ -205,7 +206,12 @@ const mnAlertVariants = tv({
|
|
|
205
206
|
kind: 'error',
|
|
206
207
|
variant: 'fill',
|
|
207
208
|
class: 'bg-error border-error text-error-content'
|
|
208
|
-
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
kind: 'accent',
|
|
212
|
+
variant: 'fill',
|
|
213
|
+
class: 'bg-accent border-accent text-accent-content'
|
|
214
|
+
},
|
|
209
215
|
],
|
|
210
216
|
defaultVariants: {
|
|
211
217
|
kind: 'info',
|
|
@@ -271,6 +277,7 @@ const mnButtonVariants = tv({
|
|
|
271
277
|
danger: '',
|
|
272
278
|
warning: '',
|
|
273
279
|
success: '',
|
|
280
|
+
accent: '',
|
|
274
281
|
},
|
|
275
282
|
borderRadius: {
|
|
276
283
|
none: 'rounded-none',
|
|
@@ -294,18 +301,21 @@ const mnButtonVariants = tv({
|
|
|
294
301
|
{ variant: 'fill', color: 'danger', class: 'bg-error text-error-content hover:bg-error/80' },
|
|
295
302
|
{ variant: 'fill', color: 'warning', class: 'bg-warning text-warning-content hover:bg-warning/80' },
|
|
296
303
|
{ variant: 'fill', color: 'success', class: 'bg-success text-success-content hover:bg-success/80' },
|
|
304
|
+
{ variant: 'fill', color: 'accent', class: 'bg-accent text-accent-content hover:bg-accent/80' },
|
|
297
305
|
// Outline
|
|
298
306
|
{ variant: 'outline', color: 'primary', class: 'border-primary text-primary hover:bg-primary/10' },
|
|
299
307
|
{ variant: 'outline', color: 'secondary', class: 'border-neutral text-neutral hover:bg-neutral/10' },
|
|
300
308
|
{ variant: 'outline', color: 'danger', class: 'border-error text-error hover:bg-error/10' },
|
|
301
309
|
{ variant: 'outline', color: 'warning', class: 'border-warning text-warning hover:bg-warning/10' },
|
|
302
310
|
{ variant: 'outline', color: 'success', class: 'border-success text-success hover:bg-success/10' },
|
|
311
|
+
{ variant: 'outline', color: 'accent', class: 'border-accent text-accent hover:bg-accent/10' },
|
|
303
312
|
// Text
|
|
304
313
|
{ variant: 'text', color: 'primary', class: 'text-primary hover:bg-primary/10' },
|
|
305
314
|
{ variant: 'text', color: 'secondary', class: 'text-neutral hover:bg-neutral/10' },
|
|
306
315
|
{ variant: 'text', color: 'danger', class: 'text-error hover:bg-error/10' },
|
|
307
316
|
{ variant: 'text', color: 'warning', class: 'text-warning hover:bg-warning/10' },
|
|
308
317
|
{ variant: 'text', color: 'success', class: 'text-success hover:bg-success/10' },
|
|
318
|
+
{ variant: 'text', color: 'accent', class: 'text-accent hover:bg-accent/10' },
|
|
309
319
|
],
|
|
310
320
|
defaultVariants: {
|
|
311
321
|
size: 'md',
|
|
@@ -3321,10 +3331,25 @@ class MnTable {
|
|
|
3321
3331
|
dataSubscription;
|
|
3322
3332
|
searchSubject = new Subject();
|
|
3323
3333
|
searchSubscription;
|
|
3334
|
+
/** Tracks the previous toolbar template reference for change detection. */
|
|
3335
|
+
previousToolbarTemplate;
|
|
3336
|
+
/**
|
|
3337
|
+
* Checks for changes to dataSource properties that are not covered
|
|
3338
|
+
* by Angular's default change detection (e.g. toolbarTemplate).
|
|
3339
|
+
*/
|
|
3340
|
+
ngDoCheck() {
|
|
3341
|
+
const currentTemplate = this.dataSource?.toolbarTemplate;
|
|
3342
|
+
if (currentTemplate !== this.previousToolbarTemplate) {
|
|
3343
|
+
this.previousToolbarTemplate = currentTemplate;
|
|
3344
|
+
this.cdr.markForCheck();
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3324
3347
|
ngOnInit() {
|
|
3325
3348
|
this.currentSort = this.dataSource.defaultSort ?? null;
|
|
3326
|
-
this.
|
|
3327
|
-
|
|
3349
|
+
this.applyFilterAndSort(false);
|
|
3350
|
+
// Skip the initial BehaviorSubject emission (already handled above)
|
|
3351
|
+
// to avoid triggering markForCheck during the first change detection cycle.
|
|
3352
|
+
this.dataSubscription = this.dataSource.dataRows.pipe(skip(1)).subscribe(() => {
|
|
3328
3353
|
this.applyFilterAndSort(false);
|
|
3329
3354
|
this.cdr.markForCheck();
|
|
3330
3355
|
});
|