@bahmni/widgets 0.0.1-dev.311 → 0.0.1-dev.312

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 (31) hide show
  1. package/dist/{DocumentsTable-BDwPkT3o.js → DocumentsTable-CQX3VBx9.js} +1 -1
  2. package/dist/{FormsTable-HPpw1ZAS.js → FormsTable-CTCi2T2q.js} +1 -1
  3. package/dist/{Observations-ByVqCjFc.js → Observations-CkBi-I0o.js} +1 -1
  4. package/dist/commandPalette/CommandPalette.d.ts +3 -0
  5. package/dist/commandPalette/CommandPalette.d.ts.map +1 -0
  6. package/dist/commandPalette/CommandPaletteContext.d.ts +12 -0
  7. package/dist/commandPalette/CommandPaletteContext.d.ts.map +1 -0
  8. package/dist/commandPalette/CommandPaletteProvider.d.ts +13 -0
  9. package/dist/commandPalette/CommandPaletteProvider.d.ts.map +1 -0
  10. package/dist/commandPalette/PatientCommandItem.d.ts +12 -0
  11. package/dist/commandPalette/PatientCommandItem.d.ts.map +1 -0
  12. package/dist/commandPalette/index.d.ts +5 -0
  13. package/dist/commandPalette/index.d.ts.map +1 -0
  14. package/dist/commandPalette/models.d.ts +40 -0
  15. package/dist/commandPalette/models.d.ts.map +1 -0
  16. package/dist/commandPalette/useCommandPalette.d.ts +3 -0
  17. package/dist/commandPalette/useCommandPalette.d.ts.map +1 -0
  18. package/dist/commandPalette/useCommandPaletteKeyboard.d.ts +3 -0
  19. package/dist/commandPalette/useCommandPaletteKeyboard.d.ts.map +1 -0
  20. package/dist/commandPalette/useCommandPaletteSearch.d.ts +10 -0
  21. package/dist/commandPalette/useCommandPaletteSearch.d.ts.map +1 -0
  22. package/dist/commandPalette/useDebounce.d.ts +2 -0
  23. package/dist/commandPalette/useDebounce.d.ts.map +1 -0
  24. package/dist/commandPalette/utils.d.ts +24 -0
  25. package/dist/commandPalette/utils.d.ts.map +1 -0
  26. package/dist/{index-BPBDx228.js → index-CvF-qMtP.js} +29688 -27462
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +39 -36
  31. package/package.json +3 -2
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
2
- import { u as W, a as Z, S as X, Z as J, $ as x, j as ee, P as te } from "./index-BPBDx228.js";
2
+ import { u as W, a as Z, S as X, Z as J, $ as x, j as ee, P as te } from "./index-CvF-qMtP.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as te, Fragment as oe } from "react/jsx-runtime";
2
- import { X as se, u as ae, H as ne, s as de, r as ie, n as ce, F as le, w as me, M as k, $ as ue, Z as fe, j as x, T as ye, R as pe, P as be, O as he } from "./index-BPBDx228.js";
2
+ import { X as se, u as ae, H as ne, s as de, r as ie, n as ce, F as le, w as me, M as k, $ as ue, Z as fe, j as x, T as ye, R as pe, P as be, O as he } from "./index-CvF-qMtP.js";
3
3
  import { useQueryClient as ge, useQuery as b } from "@tanstack/react-query";
4
4
  import { useState as H, useMemo as d, useCallback as h } from "react";
5
5
  import { useTranslation as Fe } from "react-i18next";
@@ -1,5 +1,5 @@
1
1
  import { jsx as d, jsxs as N } from "react/jsx-runtime";
2
- import { f as Q, J as D, t as H, b as K, c as V, d as k, e as j, Q as q, u as G, a as P, g as J, L as z, w as X, h as Y, i as W, k as Z, o as x, j as ee } from "./index-BPBDx228.js";
2
+ import { f as Q, J as D, t as H, b as K, c as V, d as k, e as j, Q as q, u as G, a as P, g as J, L as z, w as X, h as Y, i as W, k as Z, o as x, j as ee } from "./index-CvF-qMtP.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
4
  import { useRef as oe, useEffect as S, useMemo as g } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare const CommandPalette: React.FC;
3
+ //# sourceMappingURL=CommandPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../../src/commandPalette/CommandPalette.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgC,MAAM,OAAO,CAAC;AA4BrD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAuSlC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { NavItem, PatientAction, PatientFieldsConfig, SearchAnnotation } from './models';
2
+ export interface CommandPaletteContextType {
3
+ isOpen: boolean;
4
+ toggle: () => void;
5
+ setOpen: (open: boolean) => void;
6
+ navItems: NavItem[];
7
+ patientActions: PatientAction[];
8
+ patientFieldsConfig: PatientFieldsConfig;
9
+ searchAnnotations: SearchAnnotation[];
10
+ }
11
+ export declare const CommandPaletteContext: import('react').Context<CommandPaletteContextType | null>;
12
+ //# sourceMappingURL=CommandPaletteContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteContext.d.ts","sourceRoot":"","sources":["../../src/commandPalette/CommandPaletteContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,qBAAqB,2DACqB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { NavItem, PatientAction, PatientFieldsConfig, SearchAnnotation, TriggerConfig } from './models';
3
+ interface CommandPaletteProviderProps {
4
+ children?: ReactNode;
5
+ navItems: NavItem[];
6
+ patientActions: PatientAction[];
7
+ patientFieldsConfig: PatientFieldsConfig;
8
+ trigger: TriggerConfig;
9
+ searchAnnotations: SearchAnnotation[];
10
+ }
11
+ export declare const CommandPaletteProvider: React.FC<CommandPaletteProviderProps>;
12
+ export {};
13
+ //# sourceMappingURL=CommandPaletteProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteProvider.d.ts","sourceRoot":"","sources":["../../src/commandPalette/CommandPaletteProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,UAAU,2BAA2B;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AA2CD,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAMxE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { PatientSearchResult } from '@bahmni/services';
2
+ import { default as React } from 'react';
3
+ import { PatientAction, PatientFieldsConfig } from './models';
4
+ export interface PatientCommandItemProps {
5
+ patient: PatientSearchResult;
6
+ patientFieldsConfig: PatientFieldsConfig;
7
+ patientActions: PatientAction[];
8
+ activeActionIndex: number;
9
+ onNavigate: (path: string) => void;
10
+ }
11
+ export declare const PatientCommandItem: React.FC<PatientCommandItemProps>;
12
+ //# sourceMappingURL=PatientCommandItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientCommandItem.d.ts","sourceRoot":"","sources":["../../src/commandPalette/PatientCommandItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EACV,aAAa,EAEb,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAsHhE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { CommandPaletteProvider } from './CommandPaletteProvider';
2
+ export { useCommandPalette } from './useCommandPalette';
3
+ export type { CommandPaletteContextType } from './CommandPaletteContext';
4
+ export type { AnnotationSearchType, NavItem, PatientAction, PatientActionContext, PatientFieldKey, PatientFieldsConfig, SearchAnnotation, TriggerConfig, } from './models';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commandPalette/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EACV,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACd,MAAM,UAAU,CAAC"}
@@ -0,0 +1,40 @@
1
+ export type PatientFieldKey = 'name' | 'identifier' | 'age' | 'gender' | 'birthDate' | 'addressFieldValue' | 'extraIdentifiers' | 'customAttribute' | 'activeVisitUuid';
2
+ export interface NavItem {
3
+ id: string;
4
+ label: string;
5
+ path: string;
6
+ icon?: string;
7
+ newTab?: boolean;
8
+ }
9
+ export interface PatientActionContext {
10
+ patientUuid: string;
11
+ patientIdentifier?: string;
12
+ }
13
+ export interface PatientAction {
14
+ id: string;
15
+ label: string;
16
+ icon?: string;
17
+ getPath: (context: PatientActionContext) => string;
18
+ basePath: string;
19
+ }
20
+ export interface PatientFieldsConfig {
21
+ primaryFields: PatientFieldKey[];
22
+ additionalFields: PatientFieldKey[];
23
+ }
24
+ export type AnnotationSearchType = 'patientAttribute' | 'patientNameOrId';
25
+ export interface SearchAnnotation {
26
+ prefix: string;
27
+ label: string;
28
+ searchType?: AnnotationSearchType;
29
+ fieldType: 'person' | 'address';
30
+ fieldsToSearch: string[];
31
+ }
32
+ export type TriggerConfig = {
33
+ type: 'combination';
34
+ keys: string[];
35
+ } | {
36
+ type: 'double';
37
+ keys: string[];
38
+ interval?: number;
39
+ };
40
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/commandPalette/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,YAAY,GACZ,KAAK,GACL,QAAQ,GACR,WAAW,GACX,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,MAAM,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,SAAS,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CommandPaletteContextType } from './CommandPaletteContext';
2
+ export declare function useCommandPalette(): CommandPaletteContextType;
3
+ //# sourceMappingURL=useCommandPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCommandPalette.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useCommandPalette.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,wBAAgB,iBAAiB,IAAI,yBAAyB,CAQ7D"}
@@ -0,0 +1,3 @@
1
+ import { TriggerConfig } from './models';
2
+ export declare function useCommandPaletteKeyboard(isOpen: boolean, toggle: () => void, trigger: TriggerConfig): void;
3
+ //# sourceMappingURL=useCommandPaletteKeyboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCommandPaletteKeyboard.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useCommandPaletteKeyboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,IAAI,EAClB,OAAO,EAAE,aAAa,GACrB,IAAI,CAyCN"}
@@ -0,0 +1,10 @@
1
+ import { PatientSearchResult } from '@bahmni/services';
2
+ import { SearchAnnotation } from './models';
3
+ interface CommandPaletteSearchState {
4
+ patients: PatientSearchResult[];
5
+ loading: boolean;
6
+ error: string | null;
7
+ }
8
+ export declare function useCommandPaletteSearch(searchTerm: string, activeAnnotation?: SearchAnnotation | null): CommandPaletteSearchState;
9
+ export {};
10
+ //# sourceMappingURL=useCommandPaletteSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCommandPaletteSearch.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useCommandPaletteSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,gBAAgB,GAAE,gBAAgB,GAAG,IAAW,GAC/C,yBAAyB,CAkE3B"}
@@ -0,0 +1,2 @@
1
+ export declare function useDebounce<T>(value: T, delay?: number): T;
2
+ //# sourceMappingURL=useDebounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebounce.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useDebounce.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAE,MAAY,GAAG,CAAC,CAc/D"}
@@ -0,0 +1,24 @@
1
+ import { PatientSearchResult } from '@bahmni/services';
2
+ import { PatientFieldKey } from './models';
3
+ export interface FieldDef {
4
+ labelKey: string;
5
+ getValue: (p: PatientSearchResult) => string | null | undefined;
6
+ }
7
+ export declare const FIELD_LABEL_KEYS: {
8
+ readonly name: "COMMAND_PALETTE_FIELD_NAME";
9
+ readonly identifier: "COMMAND_PALETTE_FIELD_ID";
10
+ readonly age: "COMMAND_PALETTE_FIELD_AGE";
11
+ readonly gender: "COMMAND_PALETTE_FIELD_GENDER";
12
+ readonly birthDate: "COMMAND_PALETTE_FIELD_DOB";
13
+ readonly addressFieldValue: "COMMAND_PALETTE_FIELD_ADDRESS";
14
+ readonly extraIdentifiers: "COMMAND_PALETTE_FIELD_EXTRA_IDS";
15
+ readonly customAttribute: "COMMAND_PALETTE_FIELD_ATTRIBUTE";
16
+ readonly activeVisitUuid: "COMMAND_PALETTE_FIELD_ACTIVE_VISIT";
17
+ };
18
+ export declare const PATIENT_FIELD_MAP: Record<PatientFieldKey, FieldDef>;
19
+ export declare const filterItems: (value: string, search: string) => number;
20
+ export declare function getInitials(givenName: string, familyName: string): string;
21
+ export declare function buildPrimaryText(patient: PatientSearchResult, primaryFields: PatientFieldKey[]): string;
22
+ export declare const DEFAULT_DOUBLE_INTERVAL = 350;
23
+ export declare function matchesKeys(e: KeyboardEvent, keys: string[]): boolean;
24
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/commandPalette/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,mBAAmB,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACjE;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUuB,CAAC;AAErD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,QAAQ,CAsC/D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAI3D,CAAC;AAEF,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIzE;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,eAAe,EAAE,GAC/B,MAAM,CAKR;AAED,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAqB3C,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAWrE"}