@uxland/primary-shell 8.5.5 → 8.6.1

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/dist/index.d.ts CHANGED
@@ -31,20 +31,20 @@ declare const activityHistoryRegions: {
31
31
  customFilters: string;
32
32
  };
33
33
 
34
- export declare interface AddHistoryItemPayload {
34
+ export declare interface AddHistoryItemPayload<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
35
35
  entityId: string;
36
- item: IActivityHistoryItem;
37
- componentFactory: (item: IActivityHistoryItem) => HTMLElement;
36
+ item: TItem;
37
+ componentFactory: TActivityHistoryComponentFactory<TItem>;
38
38
  searchPredicate?: (searchString: string, item: any) => boolean;
39
39
  }
40
40
 
41
- export declare interface AddHistoryItemsPayload {
41
+ export declare interface AddHistoryItemsPayload<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
42
42
  entityId: string;
43
- items: IActivityHistoryItem[];
44
- componentFactory: (item: IActivityHistoryItem) => HTMLElement;
43
+ items: TItem[];
44
+ componentFactory: TActivityHistoryComponentFactory<TItem>;
45
45
  filters?: IActivityHistoryCustomFilterGroup;
46
46
  searchPredicate?: (searchString: string, item: any) => boolean;
47
- historyDataImporterRules?: IHistoryDataImporterRules;
47
+ historyDataImporterRules?: IHistoryDataImporterRules<TItem>;
48
48
  }
49
49
 
50
50
  declare const administrativeManagementRegions: {
@@ -86,6 +86,7 @@ declare const BROKER_EVENTS: {
86
86
  };
87
87
  readonly shell: {
88
88
  readonly appCrashed: "appCrashed";
89
+ readonly primaryQuickActionChanged: "primaryQuickActionChanged";
89
90
  readonly mainViewChanged: "mainViewChanged";
90
91
  readonly refreshTokenFailed: "refreshTokenFailed";
91
92
  readonly mpidHeaderInvalid: "mpidHeaderInvalid";
@@ -128,6 +129,12 @@ declare const BROKER_REQUESTS: {
128
129
  readonly diagnosticsSelectorRequested: "request_diagnostics_selector";
129
130
  readonly selectionRequested: "cipds_selection_request";
130
131
  };
132
+ readonly patient: {
133
+ readonly cipRequested: "get_patient_cip";
134
+ };
135
+ readonly visit: {
136
+ readonly visiIdRequested: "get_visi_id";
137
+ };
131
138
  };
132
139
 
133
140
  export { BrokerDisposableHandler }
@@ -350,6 +357,10 @@ declare interface HttpClient {
350
357
  request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
351
358
  }
352
359
 
360
+ declare interface IActivityHistoryComponentFactoryProps<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
361
+ item: TItem;
362
+ }
363
+
353
364
  /**
354
365
  * Filtre propi d'un plugin, tal com el declara.
355
366
  *
@@ -365,7 +376,7 @@ export declare interface IActivityHistoryCustomFilter {
365
376
  /** Prop de l'ítem que es mostra a cada opció. Només als `Checkbox`: un
366
377
  * `Switch` s'etiqueta amb el títol del filtre. */
367
378
  propsPathDescription?: string[];
368
- type: ActivityHistoryFilterType;
379
+ type: `${ActivityHistoryFilterType}`;
369
380
  /**
370
381
  * Limita el filtre als ítems amb un d'aquests tipus de nota. Per defecte un
371
382
  * filtre parla de tota la col·lecció de la seva iniciativa.
@@ -488,10 +499,10 @@ export declare interface IHistoryDataImporterContext {
488
499
  * Quins ítems s'hi veuen NO es declara aquí: l'importador té una llista única
489
500
  * de tipus de nota que val per a totes les iniciatives.
490
501
  */
491
- export declare interface IHistoryDataImporterRules {
502
+ export declare interface IHistoryDataImporterRules<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
492
503
  /** If provided, items matching this predicate are auto-selected the first
493
504
  * time the importer modal renders the data. */
494
- shouldPreselect?: (item: IActivityHistoryItem, ctx: IHistoryDataImporterContext) => boolean;
505
+ shouldPreselect?: (item: TItem, ctx: IHistoryDataImporterContext) => boolean;
495
506
  }
496
507
 
497
508
  export declare interface ImportParams {
@@ -516,17 +527,17 @@ export declare interface ImportParamsDiagnostic {
516
527
  */
517
528
  export declare const initializeShell: (hostAppElement: HTMLElement, ecapContext?: EcapContext) => void;
518
529
 
519
- export declare interface InjectAsyncHistoryItemsPayload {
530
+ export declare interface InjectAsyncHistoryItemsPayload<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
520
531
  entityId: string;
521
532
  entityDescription: string;
522
- asyncDataProvider: () => Promise<IActivityHistoryItem[]>;
523
- componentFactory: (item: IActivityHistoryItem) => HTMLElement;
524
- searchPredicate?: (searchString: string, item: IActivityHistoryItem) => boolean;
533
+ asyncDataProvider: () => Promise<TItem[]>;
534
+ componentFactory: TActivityHistoryComponentFactory<TItem>;
535
+ searchPredicate?: (searchString: string, item: TItem) => boolean;
525
536
  errorMessage: string;
526
537
  /** Grup de filtres propi del plugin. Opcional: sense grup, els seus ítems es
527
538
  * filtren només pels filtres globals de l'històric. */
528
539
  filters?: IActivityHistoryCustomFilterGroup;
529
- historyDataImporterRules?: IHistoryDataImporterRules;
540
+ historyDataImporterRules?: IHistoryDataImporterRules<TItem>;
530
541
  }
531
542
 
532
543
  declare interface IOwner {
@@ -843,6 +854,8 @@ declare interface PrimariaRegionManager extends HarmonixRegionManager {
843
854
  administrativeManagement: typeof administrativeManagementRegions;
844
855
  };
845
856
  registerQuickAction(view: HarmonixViewDefinition): Promise<void>;
857
+ registerPrimaryQuickAction(action: PrimaryQuickAction): void;
858
+ removePrimaryQuickAction(): void;
846
859
  registerNavigationMenu(view: HarmonixViewDefinition): Promise<void>;
847
860
  registerMainView(view: HarmonixViewDefinition): Promise<void>;
848
861
  activateMainView(viewId: string): Promise<void>;
@@ -856,10 +869,35 @@ export declare interface PrimariaStartupPlugin {
856
869
  params: any;
857
870
  }
858
871
 
872
+ /**
873
+ * Acció principal del botó d'accions ràpides.
874
+ *
875
+ * El botó és un `dss-split-button`: el clic principal fa una acció concreta i la
876
+ * fletxa obre la resta, que són les vistes que injecten les iniciatives a la
877
+ * regió `quickActions`.
878
+ *
879
+ * El label i el callback de l'acció principal són d'una iniciativa —avui, el
880
+ * "Nou curs clínic" de clinical-course—, però el botó el pinta el shell. Per no
881
+ * fer que el shell conegui cap iniciativa concreta, la que vulgui ocupar aquell
882
+ * lloc s'hi declara amb `regionManager.registerPrimaryQuickAction(...)` i el
883
+ * shell només en llegeix el que necessita per pintar-lo.
884
+ *
885
+ * Si ningú no s'hi registra —perquè el plugin no està desplegat, o està
886
+ * desactivat per rol al Plugin Store—, el shell torna al botó "Crear" d'abans,
887
+ * que només obre el menú.
888
+ */
889
+ declare interface PrimaryQuickAction {
890
+ icon: string;
891
+ label: string;
892
+ callbackFn: () => void | Promise<void>;
893
+ }
894
+
859
895
  declare abstract class QuickActionBusyManager {
860
896
  abstract addTask(task: QuickActionTask): void;
861
897
  abstract removeTask(taskId: string): void;
862
898
  abstract isBusy(): boolean;
899
+ /** Suma dels `count` de les tasques pendents. */
900
+ abstract pendingCount(): number;
863
901
  }
864
902
 
865
903
  export declare class QuickActionItem extends LitElement {
@@ -872,6 +910,14 @@ export declare class QuickActionItem extends LitElement {
872
910
 
873
911
  declare interface QuickActionTask {
874
912
  taskId: string;
913
+ /**
914
+ * Quantes coses pendents representa la tasca. Per defecte, 1.
915
+ *
916
+ * El badge del botó d'accions ràpides ensenya el número, no només un punt, i
917
+ * una sola tasca pot valer per més d'una cosa: clinical-course en registra una
918
+ * per tots els seus esborranys signables i el número és quants n'hi ha.
919
+ */
920
+ count?: number;
875
921
  }
876
922
 
877
923
  declare const RegionLitElement: Constructor<RegionViewMixin> & typeof LitElement;
@@ -910,10 +956,17 @@ declare const shellRegions: {
910
956
  communicationSidenav: string;
911
957
  clinicalPathwaysSidenav: string;
912
958
  petitionerSidenav: string;
959
+ activityRecordSidenav: string;
960
+ documentsSidenav: string;
961
+ sharedHistoriesSidenav: string;
913
962
  importData: string;
914
963
  importDataActivityHistory: string;
915
964
  };
916
965
 
966
+ declare type TActivityHistoryComponentFactory<TItem extends IActivityHistoryItem = IActivityHistoryItem> = (
967
+ props: IActivityHistoryComponentFactoryProps<TItem>,
968
+ ) => HTMLElement | Promise<HTMLElement>;
969
+
917
970
  /**
918
971
  * API pública de tokens disponible per als plugins via `api.tokenManager`.
919
972
  * Els plugins poden llegir el token actual o forçar-ne el refresc; NO poden
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { f as E, v as s, w as e, E as r, x as t, H as S, L as I, y as n, z as T, A as _, B as R, F as P, P as o, G as C, R as D, I as c, J as A, K as l, M as m, s as N, N as L } from "./index-4DpXGD6e.js";
1
+ import { f as E, w as e, x as s, E as r, y as S, H as t, L as I, z as n, A as T, B as _, F as R, I as P, P as o, J as C, R as D, K as c, M as A, N as l, O as m, u as N, S as O } from "./index-DM0vwBh-.js";
2
2
  export {
3
3
  E as CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED,
4
- s as CIPDS_SELECTION_REQUEST,
5
- e as CLINICAL_COURSE_DRAFT_APPEND_REQUESTED,
4
+ e as CIPDS_SELECTION_REQUEST,
5
+ s as CLINICAL_COURSE_DRAFT_APPEND_REQUESTED,
6
6
  r as EcapEventManager,
7
- t as ExitShell,
8
- S as HELP_REQUESTED,
7
+ S as ExitShell,
8
+ t as HELP_REQUESTED,
9
9
  I as LAST_WORKED_DIAGNOSTICS_KEY,
10
10
  n as PrimariaContentSwitcher,
11
11
  T as PrimariaInteractionService,
@@ -20,6 +20,6 @@ export {
20
20
  l as initializeShell,
21
21
  m as setInitialTokens,
22
22
  N as shellApi,
23
- L as wrapReactViewFactory
23
+ O as wrapReactViewFactory
24
24
  };
25
25
  //# sourceMappingURL=index.js.map