@uxland/primary-shell 4.3.1 → 5.1.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.
Files changed (83) hide show
  1. package/dist/index.js +13397 -12875
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.cjs +1748 -1506
  4. package/dist/index.umd.cjs.map +1 -1
  5. package/dist/primary/shell/src/UI/components/primaria-shell/primaria-shell.d.ts +4 -0
  6. package/dist/primary/shell/src/UI/components/quick-actions-menu/quick-actions-menu.d.ts +1 -0
  7. package/dist/primary/shell/src/UI/shared-components/index.d.ts +0 -1
  8. package/dist/primary/shell/src/api/api.d.ts +4 -2
  9. package/dist/primary/shell/src/api/http-client/http-client.d.ts +7 -1
  10. package/dist/primary/shell/src/api/interaction-service/confirmation-message.d.ts +3 -0
  11. package/dist/primary/shell/src/api/interaction-service/index.d.ts +1 -0
  12. package/dist/primary/shell/src/api/interaction-service/interaction-service-impl.d.ts +7 -0
  13. package/dist/primary/shell/src/api/interaction-service/interaction-service.d.ts +32 -0
  14. package/dist/primary/shell/src/api/notification-service/notification-service.d.ts +6 -0
  15. package/dist/primary/shell/src/api/notification-service/notification.service-impl.d.ts +9 -0
  16. package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/component.d.ts +2 -4
  17. package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.d.ts +17 -1
  18. package/dist/primary/shell/src/api/region-manager/region-manager.d.ts +1 -0
  19. package/dist/primary/shell/src/events.d.ts +2 -0
  20. package/dist/primary/shell/src/features/bootstrapper.d.ts +1 -1
  21. package/dist/primary/shell/src/index.d.ts +1 -2
  22. package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/export-pdf-modal/export-pdf-modal.d.ts +1 -5
  23. package/dist/primary/shell/src/internal-plugins/activity-history/localization.d.ts +0 -1
  24. package/dist/primary/shell/src/locales.d.ts +4 -0
  25. package/dist/style.css +1 -1
  26. package/package.json +5 -2
  27. package/src/UI/components/clinical-monitoring/styles.css +4 -2
  28. package/src/UI/components/primaria-shell/primaria-shell.ts +33 -7
  29. package/src/UI/components/primaria-shell/styles.css +15 -2
  30. package/src/UI/components/primaria-shell/template.ts +7 -3
  31. package/src/UI/components/quick-actions-menu/quick-actions-menu.ts +13 -3
  32. package/src/UI/components/shell-header/template.ts +1 -1
  33. package/src/UI/shared-components/index.ts +0 -1
  34. package/src/api/api.ts +12 -9
  35. package/src/api/http-client/http-client.test.ts +188 -76
  36. package/src/api/http-client/http-client.ts +62 -11
  37. package/src/api/interaction-service/confirmation-message.tsx +5 -0
  38. package/src/api/interaction-service/index.ts +1 -0
  39. package/src/api/interaction-service/interaction-service-impl.tsx +203 -0
  40. package/src/api/interaction-service/interaction-service.ts +46 -0
  41. package/src/api/interaction-service/modal-styles.css +69 -0
  42. package/src/api/notification-service/notification-service.ts +6 -0
  43. package/src/api/notification-service/notification.service-impl.ts +45 -0
  44. package/src/api/plugin-busy-manager/plugin-busy-list/component.ts +3 -4
  45. package/src/api/plugin-busy-manager/plugin-busy-list/template.ts +1 -1
  46. package/src/api/plugin-busy-manager/plugin-busy-manager.test.ts +93 -31
  47. package/src/api/plugin-busy-manager/plugin-busy-manager.ts +44 -1
  48. package/src/api/region-manager/region-manager.ts +5 -0
  49. package/src/disposer.ts +1 -1
  50. package/src/events.ts +2 -0
  51. package/src/features/bootstrapper.ts +6 -3
  52. package/src/features/exit/handler.ts +7 -12
  53. package/src/features/get-user-info/handler.ts +3 -4
  54. package/src/index.ts +1 -2
  55. package/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/export-pdf-modal/export-pdf-modal.ts +1 -10
  56. package/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/export-pdf-modal/template.ts +0 -7
  57. package/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/handler.ts +8 -8
  58. package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/template.ts +1 -1
  59. package/src/internal-plugins/activity-history/activity-history-item/search/handler.ts +5 -3
  60. package/src/internal-plugins/activity-history/localization.ts +0 -1
  61. package/src/locales.ts +5 -0
  62. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/components/dialog-component.d.ts +0 -19
  63. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/components/notifier-component.d.ts +0 -12
  64. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/confirm-mixin.d.ts +0 -11
  65. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/confirm.d.ts +0 -3
  66. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/index.d.ts +0 -5
  67. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/notify.d.ts +0 -4
  68. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/open-dialog.d.ts +0 -3
  69. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/shared.d.ts +0 -3
  70. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/typings.d.ts +0 -40
  71. package/dist/primary/shell/src/api/interaction-manager/interaction.d.ts +0 -9
  72. package/src/UI/shared-components/primaria-interaction/components/dialog-component-styles.css +0 -104
  73. package/src/UI/shared-components/primaria-interaction/components/dialog-component.ts +0 -138
  74. package/src/UI/shared-components/primaria-interaction/components/notifier-component-styles.css +0 -136
  75. package/src/UI/shared-components/primaria-interaction/components/notifier-component.ts +0 -69
  76. package/src/UI/shared-components/primaria-interaction/confirm-mixin.ts +0 -35
  77. package/src/UI/shared-components/primaria-interaction/confirm.ts +0 -9
  78. package/src/UI/shared-components/primaria-interaction/index.ts +0 -5
  79. package/src/UI/shared-components/primaria-interaction/notify.ts +0 -153
  80. package/src/UI/shared-components/primaria-interaction/open-dialog.ts +0 -8
  81. package/src/UI/shared-components/primaria-interaction/shared.ts +0 -29
  82. package/src/UI/shared-components/primaria-interaction/typings.ts +0 -46
  83. package/src/api/interaction-manager/interaction.ts +0 -26
@@ -1,22 +1,44 @@
1
+ import { shellEvents } from "../../events";
2
+ import { PrimariaBroker } from "../broker/primaria-broker";
3
+
1
4
  export interface PluginBusyTask {
2
5
  taskId: string;
3
6
  taskDescription: string;
4
7
  }
5
8
 
9
+ export interface QuickActionBusyTask {
10
+ taskId: string;
11
+ }
12
+
6
13
  export abstract class PluginBusyManager {
7
14
  abstract addBusyPluginTask(busyTask: PluginBusyTask): void;
8
- abstract removeBusyPluginTask(taskId: string): any;
15
+ abstract removeBusyPluginTask(taskId: string): void;
16
+ abstract addBusyQuickActionTask(busyTask: QuickActionBusyTask): void;
17
+ abstract removeBusyQuickActionTask(taskId: string): void;
9
18
  abstract clearAllBusyPlugins(): void;
10
19
  abstract isAnyPluginBusy(): boolean;
20
+ abstract isAnyQuickActionBusy(): boolean;
11
21
  abstract getBusyPluginTasks(): PluginBusyTask[];
12
22
  }
13
23
  export class PluginBusyManagerImpl implements PluginBusyManager {
24
+ constructor(public broker: PrimariaBroker) {}
14
25
  private busyPluginTasks: PluginBusyTask[] = [];
26
+ private busyQuickActionTasks: QuickActionBusyTask[] = [];
15
27
 
16
28
  public addBusyPluginTask(busyTask: PluginBusyTask): void {
17
29
  this.busyPluginTasks.push(busyTask);
18
30
  }
19
31
 
32
+ public addBusyQuickActionTask(busyTask: QuickActionBusyTask): void {
33
+ const index = this.busyQuickActionTasks.findIndex((item) => item.taskId === busyTask.taskId);
34
+ if (index > -1) {
35
+ return;
36
+ }
37
+
38
+ this.busyQuickActionTasks.push(busyTask);
39
+ this.emitQuickActionBusyChanged();
40
+ }
41
+
20
42
  public removeBusyPluginTask(taskId: string): any {
21
43
  const index = this.busyPluginTasks.findIndex((item) => item.taskId === taskId);
22
44
  if (index > -1) {
@@ -24,15 +46,36 @@ export class PluginBusyManagerImpl implements PluginBusyManager {
24
46
  }
25
47
  }
26
48
 
49
+ public removeBusyQuickActionTask(taskId: string): any {
50
+ const index = this.busyQuickActionTasks.findIndex((item) => item.taskId === taskId);
51
+ if (index > -1) {
52
+ this.busyQuickActionTasks.splice(index, 1);
53
+ this.emitQuickActionBusyChanged();
54
+ }
55
+ }
56
+
27
57
  public isAnyPluginBusy(): boolean {
28
58
  return this.busyPluginTasks.length > 0;
29
59
  }
30
60
 
61
+ public isAnyQuickActionBusy(): boolean {
62
+ return this.busyQuickActionTasks.length > 0;
63
+ }
64
+
31
65
  public clearAllBusyPlugins(): void {
32
66
  this.busyPluginTasks = [];
33
67
  }
34
68
 
69
+ public clearAllBusyQuickActions(): void {
70
+ this.busyQuickActionTasks = [];
71
+ }
72
+
35
73
  public getBusyPluginTasks(): PluginBusyTask[] {
36
74
  return this.busyPluginTasks;
37
75
  }
76
+
77
+ private emitQuickActionBusyChanged() {
78
+ const busy = this.isAnyQuickActionBusy();
79
+ this.broker.publish(shellEvents.quickActionBusyChanged, { busy });
80
+ }
38
81
  }
@@ -11,6 +11,7 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
11
11
  registerMainView(view: HarmonixViewDefinition): Promise<void>;
12
12
  activateMainView(viewId: string): Promise<void>;
13
13
  getCurrentMainViewActive(): string | undefined;
14
+ _destroy(): void;
14
15
  }
15
16
 
16
17
  class RegionManagerProxy implements PrimariaRegionManager {
@@ -140,6 +141,10 @@ class RegionManagerProxy implements PrimariaRegionManager {
140
141
  _notifyMainViewChanged(viewId: string) {
141
142
  this.broker.publish(shellEvents.mainViewChanged, { viewId });
142
143
  }
144
+
145
+ _destroy() {
146
+ this.regionManager.destroy();
147
+ }
143
148
  }
144
149
 
145
150
  /**
package/src/disposer.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { shellApi } from "./api/api";
2
2
  import { teardownFeatures } from "./features/bootstrapper";
3
3
  export const disposeShell = () => {
4
- teardownFeatures();
4
+ teardownFeatures(shellApi);
5
5
  };
6
6
 
7
7
  export const raiseCloseEvent = () => {
package/src/events.ts CHANGED
@@ -3,4 +3,6 @@ export const shellEvents = {
3
3
  appCrashed: "appCrashed",
4
4
  mainViewChanged: "mainViewChanged",
5
5
  refreshTokenFailed: "refreshTokenFailed",
6
+ mpidHeaderInvalid: "mpidHeaderInvalid",
7
+ quickActionBusyChanged: "quickActionBusyChanged",
6
8
  };
@@ -1,4 +1,5 @@
1
- import { PrimariaApi, shellApi } from "../api/api";
1
+ import { mediatorSettings } from "mediatr-ts";
2
+ import { PrimariaApi } from "../api/api";
2
3
  import { container } from "../infrastructure/ioc/container";
3
4
  import { TYPES } from "../infrastructure/ioc/types";
4
5
  import { bootstrapExitShell, teardownExitShell } from "./exit/bootstrapper";
@@ -9,11 +10,13 @@ export const bootstrapFeatures = (api: PrimariaApi) => {
9
10
  container.bind(TYPES.primaryApi).toConstantValue(api);
10
11
  bootstrapGetUserInfo();
11
12
  bootstrapExitShell();
12
- shellApi.broker.send(new GetUserInfo());
13
+ api.broker.send(new GetUserInfo());
13
14
  };
14
15
 
15
- export const teardownFeatures = () => {
16
+ export const teardownFeatures = (api: PrimariaApi) => {
16
17
  teardownGetUserInfo();
17
18
  teardownExitShell();
18
19
  container.unbindAll();
20
+ api.regionManager._destroy();
21
+ mediatorSettings.resolver.clear();
19
22
  };
@@ -1,4 +1,4 @@
1
- import { CustomConfirmOptions, PrimariaApi } from "@uxland/primary-shell";
1
+ import { PrimariaApi } from "@uxland/primary-shell";
2
2
  import { TYPES } from "../../infrastructure/ioc/types";
3
3
  import { inject } from "inversify";
4
4
  import { ExitShell } from "./request";
@@ -27,22 +27,17 @@ export class ExitShellHandler {
27
27
 
28
28
  raiseCloseEvent();
29
29
  } catch (error) {
30
- this.api.interactionManager.notify({
31
- type: "error",
32
- message: error.message,
33
- });
30
+ this.api.notificationService.error(error.message);
34
31
  }
35
32
  }
36
33
 
37
34
  private askForClose(busyTasks: PluginBusyTask[]) {
38
- return this.api.interactionManager.customConfirm({
35
+ return this.api.interactionService.confirm({ busyTasks }, PluginBusyList, {
39
36
  title: translate("actions.askExit"),
40
- componentConstructor: PluginBusyList,
41
- type: "danger",
42
- model: { busyTasks },
43
- acceptLabel: "Si",
44
- cancelLabel: "No",
45
- } as CustomConfirmOptions<{ busyTasks: PluginBusyTask[] }>);
37
+ state: "error",
38
+ confirmButtonText: "",
39
+ cancelButtonText: "No",
40
+ });
46
41
  }
47
42
 
48
43
  private timeout(ms: number) {
@@ -17,10 +17,9 @@ export class GetUserInfoHandler {
17
17
  this.api.globalStateManager.setData("userInfo", userInfo);
18
18
  return userInfo;
19
19
  } catch (error) {
20
- this.api.interactionManager.notify({
21
- type: "error",
22
- message: error.message,
23
- });
20
+ this.api.notificationService.error(
21
+ error.message,
22
+ );
24
23
  }
25
24
  }
26
25
  }
package/src/index.ts CHANGED
@@ -7,8 +7,6 @@ export * from "./api/api";
7
7
  export * from "./api/broker/primaria-broker";
8
8
  export * from "./UI/index";
9
9
  export { PrimariaNavItem } from "./UI/shared-components/primaria-nav-item/primaria-nav-item";
10
- export { confirmMixin } from "./UI/shared-components/primaria-interaction";
11
- export type { CustomConfirmOptions } from "./UI/shared-components/primaria-interaction";
12
10
  export {
13
11
  EcapEventManager,
14
12
  createEcapEventManager,
@@ -17,3 +15,4 @@ export type { IEcapEvent } from "./api/ecap-event-manager/typings";
17
15
  export * from "./internal-plugins";
18
16
  export * from "@uxland/harmonix-adapters";
19
17
  export * from "./events";
18
+ export * from "./api/interaction-service";
@@ -2,10 +2,9 @@ import { LitElement, css, html, unsafeCSS } from "lit";
2
2
  import { customElement, property } from "lit/decorators.js";
3
3
  import styles from "./export-pdf-modal.css?inline";
4
4
  import { template } from "./template";
5
- import { confirmMixin } from "../../../../../UI/shared-components/primaria-interaction/confirm-mixin";
6
5
 
7
6
  @customElement("export-pdf-modal")
8
- export class ExportPdfModal extends confirmMixin(LitElement) {
7
+ export class ExportPdfModal extends LitElement {
9
8
  render() {
10
9
  return html`
11
10
  ${template(this)}
@@ -38,14 +37,6 @@ export class ExportPdfModal extends confirmMixin(LitElement) {
38
37
  { label: "Element 4", value: "4" },
39
38
  ];
40
39
 
41
- _accept() {
42
- this.close({ confirmed: true, outputModel: this.outputModel });
43
- }
44
-
45
- _cancel() {
46
- this.close({ confirmed: false, outputModel: this.outputModel });
47
- }
48
-
49
40
  handleTest() {
50
41
  console.log(
51
42
  // this.selectedVisibilityLevelElement,
@@ -14,7 +14,6 @@ export const template = (props: ExportPdfModal) => {
14
14
  <input id="dropdown1" slot="input" type="text" class="dss-input" />
15
15
  </dss-input-dropdown> -->
16
16
  <div class="content-options">
17
- <span>${translate("modal.selectExportOption")}</span>
18
17
  <div class="selector-options">
19
18
  <dss-radio-button>
20
19
  <input slot="input" id="radioButton1" type="radio" name="exportOption" @change=${() => {
@@ -47,11 +46,5 @@ export const template = (props: ExportPdfModal) => {
47
46
  </div>`
48
47
  : nothing
49
48
  }
50
- <div class="actions">
51
- <dss-button @click="${props._cancel}" id="cancel-btn" label="${translate("modal.cancel")}" size="md" variant="secondary"></dss-button>
52
- <dss-button @click="${props._accept}" ?disabled="${!props.selectedRadioOption}" id="accept-btn" label="${translate("modal.export")}" size="md"></dss-button>
53
- </div>
54
- <!-- Button to test
55
- <button @click=${() => props.handleTest()}>Console log</button> -->
56
49
  </div>`;
57
50
  };
@@ -1,13 +1,14 @@
1
1
  import { ApiBaseHandler } from "../../infrastructure/base-handlers";
2
+ import { translate } from "../../localization";
2
3
  import { ExportPdfModal } from "./export-pdf-modal/export-pdf-modal";
3
4
 
4
5
  export class ExportToPdfHandler extends ApiBaseHandler {
5
6
  async handle() {
6
7
  try {
7
- this.api.interactionManager.customConfirm({
8
- title: "Exportar a PDF",
9
- componentConstructor: ExportPdfModal,
10
- type: "info",
8
+ this.api.interactionService.confirm(undefined, ExportPdfModal, {
9
+ title: translate("modal.selectExportOption"),
10
+ confirmButtonText: "Exportar",
11
+ cancelButtonText: "Cancelar",
11
12
  });
12
13
  } catch (error) {
13
14
  this._notifyError(error.message);
@@ -15,9 +16,8 @@ export class ExportToPdfHandler extends ApiBaseHandler {
15
16
  }
16
17
 
17
18
  _notifyError(errorMessage?: string) {
18
- this.api.interactionManager.notify({
19
- type: "error",
20
- message: errorMessage || "actions.delete.error",
21
- });
19
+ this.api.notificationService.error(
20
+ errorMessage || "actions.delete.error",
21
+ );
22
22
  }
23
23
  }
@@ -25,7 +25,7 @@ export const template = (props: ActivityHistoryMain) =>
25
25
  <dss-action-menu position="bottom-start">
26
26
  <dss-action-menu-item lefticon="view_timeline" label=${translate("actions.cronogram")} @click=${props._raiseEcapCronogramEvent}></dss-action-menu-item>
27
27
  <dss-action-menu-item lefticon="file_download" label=${translate("actions.exportPdf")} @click=${() => props.api.broker.send(new ExportPdf())}></dss-action-menu-item>
28
- <dss-action-menu-item label=${translate("actions.noteLegend")}></dss-action-menu-item>
28
+ <dss-action-menu-item lefticon="info" label=${translate("actions.entryLegend")}></dss-action-menu-item>
29
29
  </dss-action-menu>
30
30
  </div>
31
31
  </div>`
@@ -7,9 +7,11 @@ export class SearchItemsHandler extends BaseHandler {
7
7
  async handle(request: SearchActivityHistoryItems) {
8
8
  try {
9
9
  this.store.dispatch(setSearchString(request.searchString));
10
- this.api.broker.publish(events.activityHistorySearched, {
11
- searchQuery: request.searchString,
12
- });
10
+ setTimeout(() => {
11
+ this.api.broker.publish(events.activityHistorySearched, {
12
+ searchQuery: request.searchString,
13
+ });
14
+ }, 300);
13
15
  } catch (e) {
14
16
  console.log(e.message);
15
17
  }
@@ -40,7 +40,6 @@ export const locales = {
40
40
  actions: {
41
41
  cronogram: "Cronograma",
42
42
  exportPdf: "Exportar PDF",
43
- noteLegend: "Llegenda notes",
44
43
  moreOptions: "Més opcions",
45
44
  entryLegend: "Llegenda entrades",
46
45
  maximizeButton: "Botó maximitzar",
package/src/locales.ts CHANGED
@@ -40,6 +40,11 @@ export const locales = {
40
40
  clinicalMonitoring: {
41
41
  title: "Seguiment clínic",
42
42
  },
43
+ errors: {
44
+ session: "Hi ha hagut un error amb la sessió. Siusplau, tanca i torna a obrir l'aplicació.",
45
+ invalidPatient:
46
+ "El pacient actual no és vàlid. Siusplau, tanca i torna a obrir l'aplicació.",
47
+ },
43
48
  header: {
44
49
  workCenter: "Centre treball",
45
50
  role: "Rol",
@@ -1,19 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import { ConfirmOptions, ConfirmResult, CustomConfirmOptions } from '../typings';
3
-
4
- export declare class DialogComponent extends LitElement {
5
- render(): import('lit').TemplateResult<1>;
6
- static get styles(): import('lit').CSSResult;
7
- options: ConfirmOptions & CustomConfirmOptions;
8
- modal: any;
9
- _cancel(e: any): void;
10
- _accept(e: any): void;
11
- componentCloseRequest(e: CustomEvent): void;
12
- close(result: ConfirmResult): Promise<void>;
13
- getCustomComponent(): any;
14
- acceptButton: HTMLElement;
15
- actionsContainer: HTMLElement;
16
- header: HTMLElement;
17
- content: HTMLElement;
18
- show(): void;
19
- }
@@ -1,12 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import { NotifyOptions } from '../typings';
3
-
4
- export declare class NotifierComponent extends LitElement {
5
- render(): import('lit').TemplateResult<1>;
6
- static get styles(): import('lit').CSSResult;
7
- options: NotifyOptions;
8
- snackbar: HTMLElement;
9
- show(): void;
10
- clearAndUpdateOrder(order: string): void;
11
- close(): void;
12
- }
@@ -1,11 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import { ConfirmResult, Constructor } from './typings';
3
-
4
- export declare class ConfirmMixinBase {
5
- model: any;
6
- outputModel: any;
7
- close(result: ConfirmResult): void;
8
- canAccept(): Promise<boolean> | boolean;
9
- accept(result: ConfirmResult): Promise<ConfirmResult>;
10
- }
11
- export declare function confirmMixin<T extends Constructor<LitElement>>(superClass: T): Constructor<ConfirmMixinBase> & T;
@@ -1,3 +0,0 @@
1
- import { ConfirmOptions, ConfirmResult, CustomConfirmOptions } from './typings';
2
-
3
- export declare const confirm: (options: (ConfirmOptions & CustomConfirmOptions) | any) => Promise<ConfirmResult>;
@@ -1,5 +0,0 @@
1
- export * from './confirm';
2
- export * from './notify';
3
- export * from './open-dialog';
4
- export * from './confirm-mixin';
5
- export * from './typings';
@@ -1,4 +0,0 @@
1
- import { NotifyOptions } from './typings';
2
-
3
- export declare function generateId(): string;
4
- export declare const notify: (options: NotifyOptions) => void;
@@ -1,3 +0,0 @@
1
- import { DialogOptions } from './typings';
2
-
3
- export declare const openDialog: (options: DialogOptions | any) => void;
@@ -1,3 +0,0 @@
1
- import { ConfirmOptions, ConfirmResult, CustomConfirmOptions, DialogOptions } from './typings';
2
-
3
- export declare const buildDialogComponent: (options: DialogOptions & ConfirmOptions & CustomConfirmOptions) => Promise<ConfirmResult>;
@@ -1,40 +0,0 @@
1
- import { LitElement } from 'lit';
2
-
3
- export declare type Constructor<T = Record<string, unknown>> = new (...args: any[]) => T;
4
- export interface ConfirmOptions {
5
- title: string;
6
- message: string;
7
- type: ConfirmType;
8
- acceptLabel: string;
9
- cancelLabel: string;
10
- }
11
- export interface CustomConfirmOptions<T = any> {
12
- title: string;
13
- componentConstructor: Constructor<LitElement | any>;
14
- type: ConfirmType;
15
- acceptLabel?: string;
16
- cancelLabel?: string;
17
- model?: T;
18
- fullCustomization?: boolean;
19
- }
20
- export interface DialogOptions<T = any> {
21
- title: string;
22
- componentConstructor: Constructor<LitElement | any>;
23
- model?: T;
24
- showCloseButton?: boolean;
25
- fullCustomization?: boolean;
26
- }
27
- export type ConfirmType = "danger" | "warning" | "info" | "success";
28
- export interface NotifyOptions {
29
- message?: string;
30
- type?: NotifyType;
31
- position?: NotifyPosition;
32
- order?: string;
33
- }
34
- export interface ConfirmResult<T = any> {
35
- confirmed: boolean;
36
- outputModel?: T;
37
- }
38
- export type NotifyOrder = "first" | "second" | "third" | "fourth" | "fifth";
39
- export type NotifyPosition = "bottom" | "center" | "top";
40
- export type NotifyType = "warning" | "info" | "success" | "error";
@@ -1,9 +0,0 @@
1
- import { ConfirmOptions, ConfirmResult, CustomConfirmOptions, DialogOptions, NotifyOptions } from '../../UI/shared-components/primaria-interaction';
2
-
3
- export interface PrimariaInteractionManager {
4
- notify(options: NotifyOptions): void;
5
- confirm(options: ConfirmOptions): Promise<ConfirmResult>;
6
- customConfirm(options: CustomConfirmOptions): Promise<ConfirmResult>;
7
- openDialog(options: DialogOptions): void;
8
- }
9
- export declare const createInteractionManager: () => PrimariaInteractionManager;
@@ -1,104 +0,0 @@
1
- *[hidden] {
2
- display: none !important;
3
- }
4
-
5
- .modal {
6
- font-family: "Open Sans";
7
- display: none;
8
- position: fixed;
9
- z-index: 400;
10
- left: 0;
11
- top: 0;
12
- width: 100%;
13
- height: 100%;
14
- background-color: rgba(0, 0, 0, 0.65);
15
-
16
- .dialog {
17
- display: flex;
18
- flex-direction: column;
19
- position: absolute;
20
- top: 50%;
21
- left: 50%;
22
- transform: translate(-50%, -50%);
23
- z-index: 21;
24
- background: #fff;
25
- border-radius: 16px;
26
- width: auto;
27
- height: auto;
28
- max-height: 95%;
29
- min-width: 400px;
30
- box-shadow:
31
- 0px 0px 14px rgb(0 0 0 / 25%),
32
- 0px 1px 10px rgb(0 0 0 / 22%);
33
-
34
- .dialog__header {
35
- display: flex;
36
- flex-direction: row;
37
- justify-content: center;
38
- padding: 24px;
39
- border-top-left-radius: 8px;
40
- border-top-right-radius: 8px;
41
- align-items: center;
42
-
43
- &.with-close{
44
- justify-content: space-between;
45
- }
46
- h2 {
47
- color: var(--color-neutral-900);
48
- padding: 0;
49
- margin: 0;
50
- font-weight: 700;
51
- font-size: 1.286rem;
52
- line-height: 30px;
53
- }
54
- }
55
- .dialog__content {
56
- display: flex;
57
- flex-direction: column;
58
- flex: 1;
59
- align-items: center;
60
-
61
- min-height: 1px;
62
- height: 100%;
63
- padding-inline: 24px;
64
- padding-bottom: 24px;
65
- font-weight: 400;
66
- font-size: 16px;
67
- line-height: 24px;
68
- border-bottom-left-radius: 8px;
69
- border-bottom-right-radius: 8px;
70
-
71
- & > * {
72
- border-bottom-left-radius: 8px;
73
- border-bottom-right-radius: 8px;
74
- }
75
- }
76
- .dialog__actions {
77
- display: flex;
78
- flex-direction: row;
79
- align-items: center;
80
- justify-content: center;
81
- gap: 16px;
82
- padding: 24px 16px;
83
- }
84
- }
85
- }
86
-
87
- /* Animations to fade the snackbar in and out */
88
- @-webkit-keyframes fadein {
89
- from {
90
- opacity: 0;
91
- }
92
- to {
93
- opacity: 1;
94
- }
95
- }
96
-
97
- @keyframes fadein {
98
- from {
99
- opacity: 0;
100
- }
101
- to {
102
- opacity: 1;
103
- }
104
- }