@nucleus-suite-pe/core 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, EnvironmentProviders, Signal } from '@angular/core';
|
|
2
|
+
import { InjectionToken, EnvironmentProviders, Signal, TemplateRef } from '@angular/core';
|
|
3
3
|
import { HttpContextToken, HttpInterceptorFn } from '@angular/common/http';
|
|
4
4
|
import * as _primeuix_themes from '@primeuix/themes';
|
|
5
5
|
import * as _primeuix_themes_types_base from '@primeuix/themes/types/base';
|
|
6
6
|
import * as _nucleus_suite_pe_core from '@nucleus-suite-pe/core';
|
|
7
|
+
import { MenuItem } from 'primeng/api';
|
|
7
8
|
|
|
8
9
|
interface NucleusConfig {
|
|
9
10
|
readonly appId: string;
|
|
@@ -317,6 +318,172 @@ declare class NucleusLordicon {
|
|
|
317
318
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusLordicon, "nucleus-lordicon", never, { "src": { "alias": "src"; "required": true; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
declare class NucleusCard {
|
|
322
|
+
readonly heading: _angular_core.InputSignal<string>;
|
|
323
|
+
readonly subtitle: _angular_core.InputSignal<string>;
|
|
324
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusCard, never>;
|
|
325
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusCard, "nucleus-card", never, { "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[nucleusCardActions]"], true, never>;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface TabItem {
|
|
329
|
+
readonly id: string;
|
|
330
|
+
readonly label: string;
|
|
331
|
+
readonly icon?: string;
|
|
332
|
+
readonly badge?: number;
|
|
333
|
+
}
|
|
334
|
+
declare class NucleusTabs {
|
|
335
|
+
readonly tabs: _angular_core.InputSignal<readonly TabItem[]>;
|
|
336
|
+
readonly active: _angular_core.ModelSignal<string>;
|
|
337
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusTabs, never>;
|
|
338
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusTabs, "nucleus-tabs", never, { "tabs": { "alias": "tabs"; "required": true; "isSignal": true; }; "active": { "alias": "active"; "required": true; "isSignal": true; }; }, { "active": "activeChange"; }, never, never, true, never>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
interface Crumb {
|
|
342
|
+
readonly label: string;
|
|
343
|
+
readonly route?: readonly unknown[];
|
|
344
|
+
}
|
|
345
|
+
declare class NucleusPage {
|
|
346
|
+
readonly heading: _angular_core.WritableSignal<string>;
|
|
347
|
+
readonly lead: _angular_core.WritableSignal<string>;
|
|
348
|
+
readonly crumbs: _angular_core.WritableSignal<readonly Crumb[]>;
|
|
349
|
+
set(heading: string, lead?: string, crumbs?: readonly Crumb[]): void;
|
|
350
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusPage, never>;
|
|
351
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NucleusPage>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface ConfirmRequest {
|
|
355
|
+
readonly header: string;
|
|
356
|
+
readonly message: string;
|
|
357
|
+
readonly accept: string;
|
|
358
|
+
readonly reject: string;
|
|
359
|
+
readonly icon?: string;
|
|
360
|
+
readonly tone?: 'accent' | 'danger';
|
|
361
|
+
}
|
|
362
|
+
declare function provideNucleusFeedback(): EnvironmentProviders;
|
|
363
|
+
declare class NucleusFeedback {
|
|
364
|
+
private readonly confirmation;
|
|
365
|
+
private readonly messages;
|
|
366
|
+
ask(request: ConfirmRequest): Promise<boolean>;
|
|
367
|
+
done(summary: string, detail?: string): void;
|
|
368
|
+
failed(summary: string, detail?: string): void;
|
|
369
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusFeedback, never>;
|
|
370
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NucleusFeedback>;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
type FieldKind = 'text' | 'email' | 'password' | 'number' | 'textarea' | 'select' | 'checkbox' | 'switch';
|
|
374
|
+
type FieldSpan = 1 | 2 | 3 | 4 | 'full';
|
|
375
|
+
type FieldSize = 'xs' | 'sm' | 'md' | 'lg' | 'full';
|
|
376
|
+
interface FieldOption {
|
|
377
|
+
readonly label: string;
|
|
378
|
+
readonly value: unknown;
|
|
379
|
+
}
|
|
380
|
+
interface FormField {
|
|
381
|
+
readonly key: string;
|
|
382
|
+
readonly label: string;
|
|
383
|
+
readonly kind?: FieldKind;
|
|
384
|
+
readonly span?: FieldSpan;
|
|
385
|
+
readonly size?: FieldSize;
|
|
386
|
+
readonly hint?: string;
|
|
387
|
+
readonly placeholder?: string;
|
|
388
|
+
readonly maxlength?: number;
|
|
389
|
+
readonly rows?: number;
|
|
390
|
+
readonly options?: readonly FieldOption[];
|
|
391
|
+
readonly disabled?: boolean;
|
|
392
|
+
readonly clearable?: boolean;
|
|
393
|
+
}
|
|
394
|
+
type FormValue = Record<string, unknown>;
|
|
395
|
+
declare function resolveFieldSize(field: FormField): FieldSize;
|
|
396
|
+
|
|
397
|
+
declare class NucleusForm {
|
|
398
|
+
readonly fields: _angular_core.InputSignal<readonly FormField[]>;
|
|
399
|
+
readonly value: _angular_core.InputSignal<FormValue>;
|
|
400
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
401
|
+
readonly columns: _angular_core.InputSignal<number | null>;
|
|
402
|
+
readonly valueChange: _angular_core.OutputEmitterRef<FormValue>;
|
|
403
|
+
protected read(field: FormField): unknown;
|
|
404
|
+
protected text(field: FormField): string;
|
|
405
|
+
protected checked(field: FormField): boolean;
|
|
406
|
+
protected write(field: FormField, next: unknown): void;
|
|
407
|
+
protected isDisabled(field: FormField): boolean;
|
|
408
|
+
protected fieldClass(field: FormField): string;
|
|
409
|
+
protected gridClass(): string;
|
|
410
|
+
protected optionsOf(field: FormField): FieldOption[];
|
|
411
|
+
protected kindOf(field: FormField): string;
|
|
412
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusForm, never>;
|
|
413
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusForm, "nucleus-form", never, { "fields": { "alias": "fields"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
type ListAlign = 'left' | 'center' | 'right';
|
|
417
|
+
type ListColumnKind = 'text' | 'switch';
|
|
418
|
+
interface ListTag {
|
|
419
|
+
readonly label: string;
|
|
420
|
+
readonly severity?: 'success' | 'info' | 'warn' | 'danger' | 'secondary';
|
|
421
|
+
}
|
|
422
|
+
interface ListColumn<T = Record<string, unknown>> {
|
|
423
|
+
readonly key: string;
|
|
424
|
+
readonly header: string;
|
|
425
|
+
readonly kind?: ListColumnKind;
|
|
426
|
+
readonly align?: ListAlign;
|
|
427
|
+
readonly strong?: boolean;
|
|
428
|
+
readonly width?: string;
|
|
429
|
+
readonly value?: (row: T) => string;
|
|
430
|
+
readonly tag?: (row: T) => ListTag | null;
|
|
431
|
+
readonly checked?: (row: T) => boolean;
|
|
432
|
+
readonly disabled?: (row: T) => boolean;
|
|
433
|
+
readonly hint?: (row: T) => string;
|
|
434
|
+
}
|
|
435
|
+
interface ListAction<T = Record<string, unknown>> {
|
|
436
|
+
readonly id: string;
|
|
437
|
+
readonly icon: string;
|
|
438
|
+
readonly label: string;
|
|
439
|
+
readonly tone?: 'default' | 'danger';
|
|
440
|
+
readonly visible?: (row: T) => boolean;
|
|
441
|
+
}
|
|
442
|
+
interface ListActionEvent<T = Record<string, unknown>> {
|
|
443
|
+
readonly id: string;
|
|
444
|
+
readonly row: T;
|
|
445
|
+
}
|
|
446
|
+
interface ListToggleEvent<T = Record<string, unknown>> {
|
|
447
|
+
readonly key: string;
|
|
448
|
+
readonly row: T;
|
|
449
|
+
readonly value: boolean;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare class NucleusCell {
|
|
453
|
+
readonly nucleusCell: _angular_core.InputSignal<string>;
|
|
454
|
+
readonly template: TemplateRef<any>;
|
|
455
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusCell, never>;
|
|
456
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NucleusCell, "[nucleusCell]", never, { "nucleusCell": { "alias": "nucleusCell"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare class NucleusList<T extends object = Record<string, unknown>> {
|
|
460
|
+
readonly rows: _angular_core.InputSignal<T[]>;
|
|
461
|
+
readonly columns: _angular_core.InputSignal<readonly ListColumn<T>[]>;
|
|
462
|
+
readonly actions: _angular_core.InputSignal<readonly ListAction<T>[]>;
|
|
463
|
+
readonly empty: _angular_core.InputSignal<string>;
|
|
464
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
465
|
+
readonly minWidth: _angular_core.InputSignal<string>;
|
|
466
|
+
readonly rowClass: _angular_core.InputSignal<(row: T) => string>;
|
|
467
|
+
readonly action: _angular_core.OutputEmitterRef<ListActionEvent<T>>;
|
|
468
|
+
readonly toggle: _angular_core.OutputEmitterRef<ListToggleEvent<T>>;
|
|
469
|
+
private readonly cells;
|
|
470
|
+
protected readonly tableStyle: _angular_core.Signal<{
|
|
471
|
+
'min-width': string;
|
|
472
|
+
}>;
|
|
473
|
+
protected readonly showEmpty: _angular_core.Signal<boolean>;
|
|
474
|
+
protected cellTemplate(key: string): TemplateRef<unknown> | null;
|
|
475
|
+
protected text(column: ListColumn<T>, row: T): string;
|
|
476
|
+
protected tagOf(column: ListColumn<T>, row: T): ListTag | null;
|
|
477
|
+
protected visibleActions(row: T): readonly ListAction<T>[];
|
|
478
|
+
protected run(entry: ListAction<T>, row: T): void;
|
|
479
|
+
protected isChecked(column: ListColumn<T>, row: T): boolean;
|
|
480
|
+
protected isLocked(column: ListColumn<T>, row: T): boolean;
|
|
481
|
+
protected hintOf(column: ListColumn<T>, row: T): string;
|
|
482
|
+
protected flip(column: ListColumn<T>, row: T): void;
|
|
483
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusList<any>, never>;
|
|
484
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusList<any>, "nucleus-list", never, { "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "empty": { "alias": "empty"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "rowClass": { "alias": "rowClass"; "required": false; "isSignal": true; }; }, { "action": "action"; "toggle": "toggle"; }, ["cells"], ["[nucleusListTitle]", "[nucleusListActions]"], true, never>;
|
|
485
|
+
}
|
|
486
|
+
|
|
320
487
|
declare class NucleusMark {
|
|
321
488
|
readonly accent: _angular_core.InputSignal<string>;
|
|
322
489
|
readonly size: _angular_core.InputSignal<number>;
|
|
@@ -403,6 +570,7 @@ declare class NucleusShell {
|
|
|
403
570
|
private readonly sessionAuth;
|
|
404
571
|
private readonly themes;
|
|
405
572
|
private readonly language;
|
|
573
|
+
private readonly page;
|
|
406
574
|
private readonly config;
|
|
407
575
|
private readonly injector;
|
|
408
576
|
private readonly router;
|
|
@@ -415,6 +583,18 @@ declare class NucleusShell {
|
|
|
415
583
|
readonly navSelect: _angular_core.OutputEmitterRef<string>;
|
|
416
584
|
readonly menuSelect: _angular_core.OutputEmitterRef<MenuNode>;
|
|
417
585
|
protected readonly lang: _angular_core.Signal<NucleusLang>;
|
|
586
|
+
protected readonly icons: {
|
|
587
|
+
readonly trash: "https://cdn.lordicon.com/wpyrrmcq.json";
|
|
588
|
+
readonly check: "https://cdn.lordicon.com/lomfljuq.json";
|
|
589
|
+
readonly warning: "https://cdn.lordicon.com/vihyezfv.json";
|
|
590
|
+
readonly power: "https://cdn.lordicon.com/gwvmctbb.json";
|
|
591
|
+
readonly user: "https://cdn.lordicon.com/hrjifpbq.json";
|
|
592
|
+
readonly key: "https://cdn.lordicon.com/ossgtprr.json";
|
|
593
|
+
};
|
|
594
|
+
protected readonly title: _angular_core.Signal<string>;
|
|
595
|
+
protected readonly subtitle: _angular_core.Signal<string>;
|
|
596
|
+
protected readonly home: _angular_core.Signal<MenuItem>;
|
|
597
|
+
protected readonly crumbs: _angular_core.Signal<MenuItem[]>;
|
|
418
598
|
protected readonly copy: _angular_core.Signal<_nucleus_suite_pe_core.ShellCopy>;
|
|
419
599
|
protected readonly starfield: _angular_core.Signal<boolean>;
|
|
420
600
|
protected readonly themePreference: _angular_core.Signal<ThemePreference>;
|
|
@@ -461,5 +641,5 @@ declare class NucleusShell {
|
|
|
461
641
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusShell, "nucleus-shell", never, { "brand": { "alias": "brand"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "lead": { "alias": "lead"; "required": false; "isSignal": true; }; "navItems": { "alias": "navItems"; "required": false; "isSignal": true; }; "activeNavId": { "alias": "activeNavId"; "required": false; "isSignal": true; }; "selectedMenuId": { "alias": "selectedMenuId"; "required": false; "isSignal": true; }; }, { "navSelect": "navSelect"; "menuSelect": "menuSelect"; }, never, ["[nucleusTop]", "*"], true, never>;
|
|
462
642
|
}
|
|
463
643
|
|
|
464
|
-
export { DEFAULT_THEME, NO_PERMISSIONS, NUCLEUS_CONFIG, NUCLEUS_DARK_SELECTOR, NUCLEUS_FORCE_BEARER, NUCLEUS_ICONS, NUCLEUS_LANGS, NUCLEUS_LOGOUT_PARAM, NUCLEUS_SKIP_AUTH, NucleusAuth, NucleusLanguage, NucleusLordicon, NucleusMark, NucleusPreset, NucleusSessionAuth, NucleusShell, NucleusStarfield, SHELL_COPY, SessionService, THEMES, THEME_LABELS, ThemeService, UserSyncService, consumeNucleusLogout, findMenuByRoute, isNucleusConfigured, isThemePreference, loadLordicon, loadNucleusConfig, nucleusAuthInterceptor, nucleusLogoutUrl, ownsUrl, permissionsOf, provideNucleus, provideNucleusTheme, themeById };
|
|
465
|
-
export type { AccessScope, AppSummary, AppUser, AuthSyncRequest, CompanyOption, CompanyRelation, CompanySummary, LauncherApp, MeResponse, MenuNode, MenuPermissions, NucleusConfig, NucleusIdentity, NucleusLang, SessionTicket, ShellCopy, ShellNavItem, Site, SiteAccess, Subscription, Theme, ThemeId, ThemePreference, ThemeTokens, UserProfile };
|
|
644
|
+
export { DEFAULT_THEME, NO_PERMISSIONS, NUCLEUS_CONFIG, NUCLEUS_DARK_SELECTOR, NUCLEUS_FORCE_BEARER, NUCLEUS_ICONS, NUCLEUS_LANGS, NUCLEUS_LOGOUT_PARAM, NUCLEUS_SKIP_AUTH, NucleusAuth, NucleusCard, NucleusCell, NucleusFeedback, NucleusForm, NucleusLanguage, NucleusList, NucleusLordicon, NucleusMark, NucleusPage, NucleusPreset, NucleusSessionAuth, NucleusShell, NucleusStarfield, NucleusTabs, SHELL_COPY, SessionService, THEMES, THEME_LABELS, ThemeService, UserSyncService, consumeNucleusLogout, findMenuByRoute, isNucleusConfigured, isThemePreference, loadLordicon, loadNucleusConfig, nucleusAuthInterceptor, nucleusLogoutUrl, ownsUrl, permissionsOf, provideNucleus, provideNucleusFeedback, provideNucleusTheme, resolveFieldSize, themeById };
|
|
645
|
+
export type { AccessScope, AppSummary, AppUser, AuthSyncRequest, CompanyOption, CompanyRelation, CompanySummary, ConfirmRequest, Crumb, FieldKind, FieldOption, FieldSize, FieldSpan, FormField, FormValue, LauncherApp, ListAction, ListActionEvent, ListAlign, ListColumn, ListColumnKind, ListTag, ListToggleEvent, MeResponse, MenuNode, MenuPermissions, NucleusConfig, NucleusIdentity, NucleusLang, SessionTicket, ShellCopy, ShellNavItem, Site, SiteAccess, Subscription, TabItem, Theme, ThemeId, ThemePreference, ThemeTokens, UserProfile };
|