@mediquo/elements 0.5.2 → 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/dist/env.js +1 -1
- package/dist/mq-dashboard.d.ts +1 -1
- package/dist/mq-documents.d.ts +42 -1
- package/dist/mq-documents.js +1 -1
- package/dist/mq-schedule.d.ts +1 -1
- package/dist/mq-support-chat.d.ts +1 -1
- package/dist/react/mq-documents-page.d.ts +32 -0
- package/dist/react/mq-documents-page.js +2 -0
- package/dist/react/mq-documents.d.ts +2 -0
- package/dist/react/mq-documents.js +1 -1
- package/package.json +1 -1
package/dist/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.
|
|
1
|
+
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.6.0",n={development:{MODE:"development",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"47836441",ASSETS_BASE_URL:E},production:{MODE:"production",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"46655102",ASSETS_BASE_URL:E}};let t=o;const _=new Proxy({},{get:(E,o)=>n[t??"production"][o]});function S(E){t=E}export{E as ASSETS_BASE_URL,_ as env,S as setEnv};
|
package/dist/mq-dashboard.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ declare class SupportChatBanner extends LitElement {
|
|
|
34
34
|
private get _hasUnread();
|
|
35
35
|
private _toggleSupportChat;
|
|
36
36
|
private _ctaIcon;
|
|
37
|
-
render(): lit_html.TemplateResult<1> |
|
|
37
|
+
render(): typeof nothing | lit_html.TemplateResult<1> | null;
|
|
38
38
|
}
|
|
39
39
|
declare global {
|
|
40
40
|
interface HTMLElementTagNameMap {
|
package/dist/mq-documents.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import './chunks/index-DNUbmrQl.js';
|
|
6
6
|
import './ui/mq-skeleton.js';
|
|
7
|
+
import './ui/back-link.js';
|
|
7
8
|
import './ui/mq-button.js';
|
|
8
9
|
import 'zod';
|
|
10
|
+
import './ui/mq-text-button.js';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Patient documents list (prescriptions, reports). Fetches the patient's
|
|
@@ -14,6 +16,13 @@ import 'zod';
|
|
|
14
16
|
*
|
|
15
17
|
* Pagination is internal component state — no router or URL coupling — so the
|
|
16
18
|
* element is self-contained in any host.
|
|
19
|
+
*
|
|
20
|
+
* Content only: no title and no back affordance. Hosts that want the page
|
|
21
|
+
* chrome mount `mq-documents-page` instead.
|
|
22
|
+
*
|
|
23
|
+
* Hosts can retune the outer padding with `--mq-documents-padding` (defaults to
|
|
24
|
+
* `var(--sp-5) var(--sp-4)`), the way `mq-layout`-based screens expose
|
|
25
|
+
* `--mq-layout-padding`.
|
|
17
26
|
*/
|
|
18
27
|
declare class MqDocuments extends LitElement {
|
|
19
28
|
static styles: lit.CSSResult;
|
|
@@ -43,4 +52,36 @@ declare global {
|
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Page-level variant of `mq-documents`: the documents list plus the page chrome
|
|
57
|
+
* a standalone screen needs — a title and a back affordance.
|
|
58
|
+
*
|
|
59
|
+
* The chrome is always on. Hosts that provide their own title and back
|
|
60
|
+
* navigation mount `mq-documents` instead, which stays content-only.
|
|
61
|
+
*
|
|
62
|
+
* Back is decoupled from routing, like every other back affordance here: the
|
|
63
|
+
* `back-link` emits `mq-back` with `source: "documents"`, and the host decides
|
|
64
|
+
* where that goes.
|
|
65
|
+
*
|
|
66
|
+
* Props are forwarded verbatim to the inner `mq-documents`, which owns the
|
|
67
|
+
* env/token/locale wiring — this element adds no side effects of its own.
|
|
68
|
+
*/
|
|
69
|
+
declare class MqDocumentsPage extends LitElement {
|
|
70
|
+
static styles: lit.CSSResult;
|
|
71
|
+
/** Mediquo API key. Required when used standalone. */
|
|
72
|
+
apiKey?: string;
|
|
73
|
+
/** Already-exchanged access token. Required when used standalone. */
|
|
74
|
+
token?: string;
|
|
75
|
+
/** Locale (e.g. "es_ES"). Optional; defaults to the host/build locale. */
|
|
76
|
+
locale?: string;
|
|
77
|
+
/** Environment override ("development" | "production"). Optional. */
|
|
78
|
+
env?: Env;
|
|
79
|
+
render(): lit_html.TemplateResult<1>;
|
|
80
|
+
}
|
|
81
|
+
declare global {
|
|
82
|
+
interface HTMLElementTagNameMap {
|
|
83
|
+
"mq-documents-page": MqDocumentsPage;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { MqDocuments, MqDocumentsPage };
|
package/dist/mq-documents.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as
|
|
1
|
+
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as o,t as r}from"./chunks/custom-element-DA9Fxvxd.js";import{m as s,s as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as c}from"./chunks/localized-decorator-BlOuLhym.js";import{Q as p}from"./chunks/query-controller-BlO1Ax65.js";import{g as l,a as u}from"./chunks/i18n-formats-DYS91YEa.js";import{g as d}from"./chunks/get-patient-documents-query-DIQH-TMM.js";import{g as m}from"./chunks/get-patient-profile-query-B0tUDJmT.js";import{i as h,a as g,x as v,E as k}from"./chunks/lit-element-DiWJYFwC.js";import{n as y}from"./chunks/property-scuRaFcM.js";import{r as f}from"./chunks/state-LQivXIgA.js";import{setEnv as b}from"./env.js";import{a as j}from"./chunks/api-chat-client-1Vz6ZOwp.js";import{chevronLeftIcon as x}from"./ui/icons/chevron-left-icon.js";import{chevronRightIcon as $}from"./ui/icons/chevron-right-icon.js";import"./chunks/index-Bx8TWBsk.js";import"./ui/mq-skeleton.js";import{o as P}from"./chunks/if-defined-BYeVdwgd.js";import"./ui/back-link.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/types.js";import"./ui/icons/download-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./events.js";import"./chunks/style-map-CIdqdn7C.js";import"./ui/mq-text-button.js";const q=h`:host{display:block}.container{background-color:var(--color-card);padding:var(--mq-documents-padding,var(--sp-5) var(--sp-4));border-radius:var(--border-radius-md)}.documents-list{border-radius:var(--border-radius-md);background-color:var(--color-muted);padding:var(--sp-3);display:flex;flex-direction:column;gap:var(--sp-4)}.empty{font-family:var(--font-body);font-size:var(--text-sm);color:var(--color-neutrals-text-default);text-align:center;padding:var(--sp-6) var(--sp-4);margin:0}hr{width:100%;border:none;border-top:1px solid var(--color-border);margin:0}.pagination{display:flex;align-items:center;justify-content:center;gap:var(--sp-2_5);margin-top:var(--sp-4)}.pagination-text{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal}.pagination-button{background:0 0;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--color-neutrals-text-default)}.pagination-button:disabled{opacity:0;cursor:not-allowed}.pagination-button:not(:disabled):hover{opacity:.7}@media (min-width:768px){.documents-list{padding:var(--sp-6)}}`;let _=class MqDocuments extends g{constructor(){super(...arguments),this.currentPage=1,this.getPatientProfileQuery=new p(this,()=>m(j)),this.getPatientDocumentsQuery=new p(this,()=>({...d(j,{patient_hash:this._patientHash,page:this.currentPage,per_page:6}),enabled:!!this._patientHash})),this.getOrganizationSpecialtiesQuery=new p(this,()=>l(j))}static{this.styles=q}willUpdate(i){i.has("env")&&this.env&&b(this.env),i.has("apiKey")&&this.apiKey&&j.setApiKey(this.apiKey),i.has("token")&&this.token&&j.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),j.setLanguage(this.locale))}get _patientHash(){return this.getPatientProfileQuery.result?.data?.hash??""}handlePreviousPage(){this.currentPage>1&&(this.currentPage-=1)}handleNextPage(){const t=this.getPatientDocumentsQuery.result?.data?.meta?.last_page??1;this.currentPage<t&&(this.currentPage+=1)}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>{const e=i();return 0===t.data.length?v`<p class="empty">${s("Aquí se mostrarán tus recetas e informes médicos.")}</p>`:v`<div class="documents-list">${t.data.map((i,n)=>v`<patient-document filename="${i.name}" kind="${i.document_type}" specialty="${(()=>{const t=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>t.id===i.professional.speciality_id);return u(t?.code??"",e,t?.name)})()}" description="${i.name}" date="${i.created_at}" downloadUrl="${i.url}"></patient-document>${n<t.data.length-1?v`<hr>`:k}`)}</div>${this.renderPagination(t.meta)}`},pending:()=>v`<div class="documents-list"><mq-skeleton height="57px"></mq-skeleton><hr><mq-skeleton height="57px"></mq-skeleton><hr><mq-skeleton height="57px"></mq-skeleton></div>`})}renderPagination(t){const e=t.current_page>1,i=t.current_page<t.last_page;return v`<div class="pagination"><button class="pagination-button" @click="${this.handlePreviousPage}" ?disabled="${!e}" aria-label="${s("Página anterior")}">${x({size:24})}</button> <span class="pagination-text">${s(a`${t.current_page} de ${t.last_page}`)} </span><button class="pagination-button" @click="${this.handleNextPage}" ?disabled="${!i}" aria-label="${s("Página siguiente")}">${$({size:24})}</button></div>`}render(){return v`<div class="container">${this.renderDocuments()}</div>`}};o([y({type:String,attribute:"api-key"})],_.prototype,"apiKey",void 0),o([y({type:String,attribute:"token"})],_.prototype,"token",void 0),o([y({type:String,attribute:"locale"})],_.prototype,"locale",void 0),o([y({type:String,attribute:"env"})],_.prototype,"env",void 0),o([f()],_.prototype,"currentPage",void 0),_=o([c(),r("mq-documents")],_);const w=h`:host{display:block}.title{margin:var(--sp-3) 0;font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold)}`;let S=class MqDocumentsPage extends g{static{this.styles=w}render(){return v`<back-link source="documents">${s("Volver")}</back-link><h1 class="title">${s("Mis documentos")}</h1><mq-documents api-key="${P(this.apiKey)}" token="${P(this.token)}" locale="${P(this.locale)}" env="${P(this.env)}"></mq-documents>`}};o([y({type:String,attribute:"api-key"})],S.prototype,"apiKey",void 0),o([y({type:String,attribute:"token"})],S.prototype,"token",void 0),o([y({type:String,attribute:"locale"})],S.prototype,"locale",void 0),o([y({type:String,attribute:"env"})],S.prototype,"env",void 0),S=o([c(),r("mq-documents-page")],S),n();export{_ as MqDocuments,S as MqDocumentsPage};
|
package/dist/mq-schedule.d.ts
CHANGED
|
@@ -781,7 +781,7 @@ declare class ProfessionalsList extends LitElement {
|
|
|
781
781
|
private getOrganizationSpecialtiesQuery;
|
|
782
782
|
private getScheduleServicesQuery;
|
|
783
783
|
private getProfessionalsBySpecialtyAndServiceQuery;
|
|
784
|
-
render(): lit_html.TemplateResult<1> |
|
|
784
|
+
render(): typeof nothing | lit_html.TemplateResult<1> | null;
|
|
785
785
|
}
|
|
786
786
|
declare global {
|
|
787
787
|
interface HTMLElementTagNameMap {
|
|
@@ -75,7 +75,7 @@ declare class MqSupportChat extends LitElement {
|
|
|
75
75
|
private _open;
|
|
76
76
|
private _onKeydown;
|
|
77
77
|
private _close;
|
|
78
|
-
render(): lit_html.TemplateResult<1
|
|
78
|
+
render(): typeof nothing | lit_html.TemplateResult<1>;
|
|
79
79
|
}
|
|
80
80
|
declare global {
|
|
81
81
|
interface HTMLElementTagNameMap {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MqDocumentsPage as MqDocumentsPage$1 } from '../mq-documents.js';
|
|
3
|
+
import { MqBackEvent } from '../events.js';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import '../env.js';
|
|
7
|
+
import '../chunks/index-DNUbmrQl.js';
|
|
8
|
+
import '../ui/mq-button.js';
|
|
9
|
+
import 'zod';
|
|
10
|
+
import '../ui/mq-skeleton.js';
|
|
11
|
+
import '../ui/back-link.js';
|
|
12
|
+
import '../ui/mq-text-button.js';
|
|
13
|
+
|
|
14
|
+
interface MqDocumentsPageProps {
|
|
15
|
+
/** Mediquo API key. Required when used standalone. */
|
|
16
|
+
apiKey?: MqDocumentsPage$1["apiKey"];
|
|
17
|
+
/** Already-exchanged access token. Required when used standalone. */
|
|
18
|
+
token?: MqDocumentsPage$1["token"];
|
|
19
|
+
/** Locale, e.g. `"es_ES"`. Defaults to the host/build locale. */
|
|
20
|
+
locale?: MqDocumentsPage$1["locale"];
|
|
21
|
+
/** Environment override (`"development" | "production"`). */
|
|
22
|
+
env?: MqDocumentsPage$1["env"];
|
|
23
|
+
/** The user asked to leave the documents screen (`detail.source === "documents"`). */
|
|
24
|
+
onBack?: (event: MqBackEvent) => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
id?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const MqDocumentsPage: React.ForwardRefExoticComponent<MqDocumentsPageProps & React.RefAttributes<MqDocumentsPage$1>>;
|
|
30
|
+
|
|
31
|
+
export { MqDocumentsPage };
|
|
32
|
+
export type { MqDocumentsPageProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as s from"react";import{MqDocumentsPage as o}from"../mq-documents.js";import"../i18n.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/chunk-4FFT6DC2-CVWibomC.js";import"../chunks/external-CJj32K_p.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/localized-decorator-BlOuLhym.js";import"../chunks/query-controller-BlO1Ax65.js";import"../chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"../chunks/create-context-DqP79qjF.js";import"../chunks/context-consumer-ESdICVAb.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/query-Cjvi4_dT.js";import"../chunks/i18n-formats-DYS91YEa.js";import"../chunks/get-patient-documents-query-DIQH-TMM.js";import"../chunks/get-patient-profile-query-B0tUDJmT.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../env.js";import"../chunks/api-chat-client-1Vz6ZOwp.js";import"../chunks/parseISO-Dj3qSTG8.js";import"../chunks/format-CRFiCNHw.js";import"../chunks/isBefore-CPpTogxo.js";import"../ui/icons/chevron-left-icon.js";import"../chunks/if-defined-BYeVdwgd.js";import"../ui/icons/types.js";import"../ui/icons/chevron-right-icon.js";import"../chunks/index-Bx8TWBsk.js";import"../ui/icons/download-icon.js";import"../ui/mq-button.js";import"../chunks/class-map-Co76I6aw.js";import"../chunks/directive-2EDmOukv.js";import"../events.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../ui/back-link.js";import"../ui/mq-text-button.js";const i=t({react:s,tagName:"mq-documents-page",elementClass:o,events:{onBack:"mq-back"}});export{i as MqDocumentsPage};
|
|
@@ -7,6 +7,8 @@ import '../chunks/index-DNUbmrQl.js';
|
|
|
7
7
|
import '../ui/mq-button.js';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import '../ui/mq-skeleton.js';
|
|
10
|
+
import '../ui/back-link.js';
|
|
11
|
+
import '../ui/mq-text-button.js';
|
|
10
12
|
|
|
11
13
|
interface MqDocumentsProps {
|
|
12
14
|
/** Mediquo API key. Required when used standalone. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{o as
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as s from"react";import{MqDocuments as o}from"../mq-documents.js";import"../i18n.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/chunk-4FFT6DC2-CVWibomC.js";import"../chunks/external-CJj32K_p.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/localized-decorator-BlOuLhym.js";import"../chunks/query-controller-BlO1Ax65.js";import"../chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"../chunks/create-context-DqP79qjF.js";import"../chunks/context-consumer-ESdICVAb.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/query-Cjvi4_dT.js";import"../chunks/i18n-formats-DYS91YEa.js";import"../chunks/get-patient-documents-query-DIQH-TMM.js";import"../chunks/get-patient-profile-query-B0tUDJmT.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../env.js";import"../chunks/api-chat-client-1Vz6ZOwp.js";import"../chunks/parseISO-Dj3qSTG8.js";import"../chunks/format-CRFiCNHw.js";import"../chunks/isBefore-CPpTogxo.js";import"../ui/icons/chevron-left-icon.js";import"../chunks/if-defined-BYeVdwgd.js";import"../ui/icons/types.js";import"../ui/icons/chevron-right-icon.js";import"../chunks/index-Bx8TWBsk.js";import"../ui/icons/download-icon.js";import"../ui/mq-button.js";import"../chunks/class-map-Co76I6aw.js";import"../chunks/directive-2EDmOukv.js";import"../events.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../ui/back-link.js";import"../ui/mq-text-button.js";const i=t({react:s,tagName:"mq-documents",elementClass:o});export{i as MqDocuments};
|