@uxland/primary-shell 4.3.1 → 5.0.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 (74) hide show
  1. package/dist/index.js +1183 -1237
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.cjs +117 -125
  4. package/dist/index.umd.cjs.map +1 -1
  5. package/dist/primary/shell/src/UI/components/primaria-shell/primaria-shell.d.ts +3 -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/region-manager/region-manager.d.ts +1 -0
  18. package/dist/primary/shell/src/events.d.ts +1 -0
  19. package/dist/primary/shell/src/features/bootstrapper.d.ts +1 -1
  20. package/dist/primary/shell/src/index.d.ts +1 -2
  21. 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
  22. package/dist/primary/shell/src/internal-plugins/activity-history/localization.d.ts +0 -1
  23. package/dist/primary/shell/src/locales.d.ts +4 -0
  24. package/package.json +4 -1
  25. package/src/UI/components/primaria-shell/primaria-shell.ts +24 -7
  26. package/src/UI/components/quick-actions-menu/quick-actions-menu.ts +13 -3
  27. package/src/UI/shared-components/index.ts +0 -1
  28. package/src/api/api.ts +11 -8
  29. package/src/api/http-client/http-client.test.ts +188 -76
  30. package/src/api/http-client/http-client.ts +62 -11
  31. package/src/api/interaction-service/confirmation-message.tsx +5 -0
  32. package/src/api/interaction-service/index.ts +1 -0
  33. package/src/api/interaction-service/interaction-service-impl.tsx +225 -0
  34. package/src/api/interaction-service/interaction-service.ts +46 -0
  35. package/src/api/notification-service/notification-service.ts +6 -0
  36. package/src/api/notification-service/notification.service-impl.ts +45 -0
  37. package/src/api/plugin-busy-manager/plugin-busy-list/component.ts +3 -4
  38. package/src/api/plugin-busy-manager/plugin-busy-list/template.ts +1 -1
  39. package/src/api/region-manager/region-manager.ts +5 -0
  40. package/src/disposer.ts +1 -1
  41. package/src/events.ts +1 -0
  42. package/src/features/bootstrapper.ts +6 -3
  43. package/src/features/exit/handler.ts +8 -11
  44. package/src/features/get-user-info/handler.ts +3 -4
  45. package/src/index.ts +1 -2
  46. package/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/export-pdf-modal/export-pdf-modal.ts +1 -10
  47. package/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/export-pdf-modal/template.ts +0 -7
  48. package/src/internal-plugins/activity-history/activity-history-item/export-to-pdf/handler.ts +8 -8
  49. package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/template.ts +1 -1
  50. package/src/internal-plugins/activity-history/activity-history-item/search/handler.ts +5 -3
  51. package/src/internal-plugins/activity-history/localization.ts +0 -1
  52. package/src/locales.ts +5 -0
  53. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/components/dialog-component.d.ts +0 -19
  54. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/components/notifier-component.d.ts +0 -12
  55. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/confirm-mixin.d.ts +0 -11
  56. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/confirm.d.ts +0 -3
  57. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/index.d.ts +0 -5
  58. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/notify.d.ts +0 -4
  59. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/open-dialog.d.ts +0 -3
  60. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/shared.d.ts +0 -3
  61. package/dist/primary/shell/src/UI/shared-components/primaria-interaction/typings.d.ts +0 -40
  62. package/dist/primary/shell/src/api/interaction-manager/interaction.d.ts +0 -9
  63. package/src/UI/shared-components/primaria-interaction/components/dialog-component-styles.css +0 -104
  64. package/src/UI/shared-components/primaria-interaction/components/dialog-component.ts +0 -138
  65. package/src/UI/shared-components/primaria-interaction/components/notifier-component-styles.css +0 -136
  66. package/src/UI/shared-components/primaria-interaction/components/notifier-component.ts +0 -69
  67. package/src/UI/shared-components/primaria-interaction/confirm-mixin.ts +0 -35
  68. package/src/UI/shared-components/primaria-interaction/confirm.ts +0 -9
  69. package/src/UI/shared-components/primaria-interaction/index.ts +0 -5
  70. package/src/UI/shared-components/primaria-interaction/notify.ts +0 -153
  71. package/src/UI/shared-components/primaria-interaction/open-dialog.ts +0 -8
  72. package/src/UI/shared-components/primaria-interaction/shared.ts +0 -29
  73. package/src/UI/shared-components/primaria-interaction/typings.ts +0 -46
  74. package/src/api/interaction-manager/interaction.ts +0 -26
@@ -0,0 +1,46 @@
1
+ import * as React from "react";
2
+
3
+ export interface ConfirmationResult<T = undefined> {
4
+ confirmed: boolean;
5
+ result: T | undefined;
6
+ }
7
+
8
+ export interface ConfirmationContentProps<TData, TResult = undefined> {
9
+ data: TData | undefined;
10
+ setResult: (result: TResult) => void;
11
+ setIsValid: (isValid: boolean) => void;
12
+ confirm: () => void;
13
+ cancel: () => void;
14
+ }
15
+
16
+ export interface ConfirmationWithResultContentProps<TData, TResult = undefined> {
17
+ data: TData | undefined;
18
+ confirmResult: (result: TResult) => void;
19
+ cancel: () => void;
20
+ }
21
+
22
+ export interface ConfirmationOptions {
23
+ title?: string | undefined;
24
+ showConfirmButton?: boolean | undefined;
25
+ showCancelButton?: boolean | undefined;
26
+ confirmButtonText?: string | undefined;
27
+ cancelButtonText?: string | undefined;
28
+ showCloseButton?: boolean | undefined;
29
+ fullWidth?: boolean | undefined;
30
+ fullCustomization?: boolean | undefined;
31
+ state?: "success" | "info" | "alert" | "error";
32
+ }
33
+
34
+ export abstract class PrimariaInteractionService {
35
+ abstract confirm<TData = undefined, TResult = undefined>(
36
+ data: TData | undefined,
37
+ dialogComponent:
38
+ | React.ComponentType<ConfirmationContentProps<TData, TResult> | ConfirmationWithResultContentProps<TData, TResult>>
39
+ | (new () => HTMLElement),
40
+ options?: ConfirmationOptions | undefined,
41
+ ): Promise<ConfirmationResult<TResult | undefined>>;
42
+ abstract confirmMessage(
43
+ message: string,
44
+ options?: ConfirmationOptions | undefined,
45
+ ): Promise<ConfirmationResult>;
46
+ }
@@ -0,0 +1,6 @@
1
+ export abstract class PrimariaNotificationService {
2
+ abstract info(message: string): void;
3
+ abstract warning(message: string): void;
4
+ abstract error(message: string): void;
5
+ abstract success(message: string): void;
6
+ }
@@ -0,0 +1,45 @@
1
+ import { PrimariaNotificationService } from "./notification-service";
2
+
3
+ export class PrimariaNotificationServiceImpl extends PrimariaNotificationService {
4
+ private notify(
5
+ message: string,
6
+ state: "info" | "warning" | "error" | "success",
7
+ duration = 3000,
8
+ ): void {
9
+ // Crear el Web Component
10
+ const toast = document.createElement("dss-toast");
11
+ toast.setAttribute("isshow", "true");
12
+ toast.setAttribute("state", state);
13
+ toast.setAttribute("position", "bottom-left");
14
+ toast.setAttribute("text", message);
15
+ toast.setAttribute("hasicon", "true");
16
+ toast.setAttribute("duration", duration.toString());
17
+
18
+ // Agregar al body
19
+ document.body.appendChild(toast);
20
+
21
+ // Remover después del tiempo de duración
22
+ setTimeout(() => {
23
+ toast.setAttribute("isshow", "false");
24
+ setTimeout(() => {
25
+ toast.remove();
26
+ }, 300); // Espera un poco para animación de salida (ajustable)
27
+ }, duration);
28
+ }
29
+
30
+ info(message: string, duration?: number): void {
31
+ this.notify(message, "info", duration);
32
+ }
33
+
34
+ warning(message: string, duration?: number): void {
35
+ this.notify(message, "warning", duration);
36
+ }
37
+
38
+ error(message: string, duration?: number): void {
39
+ this.notify(message, "error", duration);
40
+ }
41
+
42
+ success(message: string, duration?: number): void {
43
+ this.notify(message, "success", duration);
44
+ }
45
+ }
@@ -1,12 +1,11 @@
1
1
  import { LitElement, css, html, unsafeCSS } from "lit";
2
2
  import { customElement } from "lit/decorators.js";
3
+ import { PluginBusyTask } from "../plugin-busy-manager";
3
4
  import styles from "./styles.css?inline";
4
5
  import { template } from "./template";
5
- import { confirmMixin } from "../../../UI/shared-components/primaria-interaction/confirm-mixin";
6
- import { PluginBusyTask } from "../plugin-busy-manager";
7
6
 
8
7
  @customElement("plugin-busy-list")
9
- export class PluginBusyList extends confirmMixin(LitElement) {
8
+ export class PluginBusyList extends LitElement {
10
9
  static styles = css`
11
10
  ${unsafeCSS(styles)}
12
11
  `;
@@ -15,5 +14,5 @@ export class PluginBusyList extends confirmMixin(LitElement) {
15
14
  return html`${template(this)}`;
16
15
  }
17
16
 
18
- model: { busyTasks: PluginBusyTask[] };
17
+ data: { busyTasks: PluginBusyTask[] };
19
18
  }
@@ -7,7 +7,7 @@ export const template = (props: PluginBusyList) => html`
7
7
  <div class="container">
8
8
  <div class="title">${translate("busyManager.title")}</div>
9
9
  <div class="list">
10
- ${props.model?.busyTasks?.map((item: PluginBusyTask) => html`<div class="plugin-busy-item">${item.taskDescription}</div>`)}
10
+ ${props.data?.busyTasks?.map((item: PluginBusyTask) => html`<div class="plugin-busy-item">${item.taskDescription}</div>`)}
11
11
  </div>
12
12
  </div>
13
13
  `;
@@ -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,5 @@ export const shellEvents = {
3
3
  appCrashed: "appCrashed",
4
4
  mainViewChanged: "mainViewChanged",
5
5
  refreshTokenFailed: "refreshTokenFailed",
6
+ mpidHeaderInvalid: "mpidHeaderInvalid",
6
7
  };
@@ -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
  };
@@ -27,22 +27,19 @@ 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(
31
+ error.message,
32
+ );
34
33
  }
35
34
  }
36
35
 
37
36
  private askForClose(busyTasks: PluginBusyTask[]) {
38
- return this.api.interactionManager.customConfirm({
37
+ return this.api.interactionService.confirm({ busyTasks }, PluginBusyList, {
39
38
  title: translate("actions.askExit"),
40
- componentConstructor: PluginBusyList,
41
- type: "danger",
42
- model: { busyTasks },
43
- acceptLabel: "Si",
44
- cancelLabel: "No",
45
- } as CustomConfirmOptions<{ busyTasks: PluginBusyTask[] }>);
39
+ state: "error",
40
+ confirmButtonText: "",
41
+ cancelButtonText: "No",
42
+ });
46
43
  }
47
44
 
48
45
  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
- }