@uxland/primary-shell 8.6.0 → 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: {
@@ -357,6 +357,10 @@ declare interface HttpClient {
357
357
  request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
358
358
  }
359
359
 
360
+ declare interface IActivityHistoryComponentFactoryProps<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
361
+ item: TItem;
362
+ }
363
+
360
364
  /**
361
365
  * Filtre propi d'un plugin, tal com el declara.
362
366
  *
@@ -372,7 +376,7 @@ export declare interface IActivityHistoryCustomFilter {
372
376
  /** Prop de l'ítem que es mostra a cada opció. Només als `Checkbox`: un
373
377
  * `Switch` s'etiqueta amb el títol del filtre. */
374
378
  propsPathDescription?: string[];
375
- type: ActivityHistoryFilterType;
379
+ type: `${ActivityHistoryFilterType}`;
376
380
  /**
377
381
  * Limita el filtre als ítems amb un d'aquests tipus de nota. Per defecte un
378
382
  * filtre parla de tota la col·lecció de la seva iniciativa.
@@ -495,10 +499,10 @@ export declare interface IHistoryDataImporterContext {
495
499
  * Quins ítems s'hi veuen NO es declara aquí: l'importador té una llista única
496
500
  * de tipus de nota que val per a totes les iniciatives.
497
501
  */
498
- export declare interface IHistoryDataImporterRules {
502
+ export declare interface IHistoryDataImporterRules<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
499
503
  /** If provided, items matching this predicate are auto-selected the first
500
504
  * time the importer modal renders the data. */
501
- shouldPreselect?: (item: IActivityHistoryItem, ctx: IHistoryDataImporterContext) => boolean;
505
+ shouldPreselect?: (item: TItem, ctx: IHistoryDataImporterContext) => boolean;
502
506
  }
503
507
 
504
508
  export declare interface ImportParams {
@@ -523,17 +527,17 @@ export declare interface ImportParamsDiagnostic {
523
527
  */
524
528
  export declare const initializeShell: (hostAppElement: HTMLElement, ecapContext?: EcapContext) => void;
525
529
 
526
- export declare interface InjectAsyncHistoryItemsPayload {
530
+ export declare interface InjectAsyncHistoryItemsPayload<TItem extends IActivityHistoryItem = IActivityHistoryItem> {
527
531
  entityId: string;
528
532
  entityDescription: string;
529
- asyncDataProvider: () => Promise<IActivityHistoryItem[]>;
530
- componentFactory: (item: IActivityHistoryItem) => HTMLElement;
531
- searchPredicate?: (searchString: string, item: IActivityHistoryItem) => boolean;
533
+ asyncDataProvider: () => Promise<TItem[]>;
534
+ componentFactory: TActivityHistoryComponentFactory<TItem>;
535
+ searchPredicate?: (searchString: string, item: TItem) => boolean;
532
536
  errorMessage: string;
533
537
  /** Grup de filtres propi del plugin. Opcional: sense grup, els seus ítems es
534
538
  * filtren només pels filtres globals de l'històric. */
535
539
  filters?: IActivityHistoryCustomFilterGroup;
536
- historyDataImporterRules?: IHistoryDataImporterRules;
540
+ historyDataImporterRules?: IHistoryDataImporterRules<TItem>;
537
541
  }
538
542
 
539
543
  declare interface IOwner {
@@ -959,6 +963,10 @@ declare const shellRegions: {
959
963
  importDataActivityHistory: string;
960
964
  };
961
965
 
966
+ declare type TActivityHistoryComponentFactory<TItem extends IActivityHistoryItem = IActivityHistoryItem> = (
967
+ props: IActivityHistoryComponentFactoryProps<TItem>,
968
+ ) => HTMLElement | Promise<HTMLElement>;
969
+
962
970
  /**
963
971
  * API pública de tokens disponible per als plugins via `api.tokenManager`.
964
972
  * Els plugins poden llegir el token actual o forçar-ne el refresc; NO poden
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
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-DL-lEtue.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
4
  e as CIPDS_SELECTION_REQUEST,
@@ -1,4 +1,4 @@
1
- import { d as xe, i as yt, a as ut, G as Tn, n as ee, C as On, D as E, k as h, r as q, b as j, h as Y, t as Q, Q as le, c as os, e as te, f as In, g as En, j as Mn, l as Dn, m as Pn, o as $i, p as Is, q as Fn, s as $n, P as An } from "./index-DL-lEtue.js";
1
+ import { d as xe, i as yt, a as ut, G as Tn, n as ee, C as On, D as E, k as h, r as q, b as j, h as Y, t as Q, Q as le, c as os, e as te, f as In, g as En, j as Mn, l as Dn, m as Pn, o as $i, p as Is, q as Fn, s as $n, P as An } from "./index-DM0vwBh-.js";
2
2
  const kn = ({ primaryApi: e, store: t }) => {
3
3
  class s {
4
4
  constructor(o) {
@@ -5509,8 +5509,8 @@ class Qu {
5509
5509
  * Element que ha de renderitzar l'item, creant-lo si encara no existeix o si
5510
5510
  * l'item ha canviat.
5511
5511
  *
5512
- * Les factories dels plugins són síncrones (`componentFactory: (item) =>
5513
- * HTMLElement`), així que el cas normal resol sense esperes ni segon render.
5512
+ * Si la factory retorna l'element, resol sense esperes ni segon render. Si
5513
+ * retorna una `Promise`, la fila queda buida fins que es resol.
5514
5514
  * Retorna `undefined` quan no hi ha res a pintar encara: sense factory, si ha
5515
5515
  * petat, o mentre una factory asíncrona estigui pendent.
5516
5516
  */
@@ -8421,4 +8421,4 @@ export {
8421
8421
  $p as dispose,
8422
8422
  Fp as initialize
8423
8423
  };
8424
- //# sourceMappingURL=plugin-DaByeVsR.js.map
8424
+ //# sourceMappingURL=plugin-Cw8FruuX.js.map