@bahmni/widgets 0.0.1-dev.336 → 0.0.1-dev.338

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 (47) hide show
  1. package/dist/{DocumentsTable-NywEycWy.js → DocumentsTable-DwzMSQBY.js} +1 -1
  2. package/dist/{FormsTable-CaEwK3-q.js → FormsTable-C6IhR7Ju.js} +1 -1
  3. package/dist/{Observations-CtJ_g_-p.js → Observations-Dz2tbSRx.js} +1 -1
  4. package/dist/{index-iRMlne97.js → index-9HLwBpJu.js} +22000 -21289
  5. package/dist/index.css +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/search/commonSearch/CommonSearchWidget.d.ts.map +1 -1
  8. package/dist/search/commonSearch/CriterionRow.d.ts +12 -0
  9. package/dist/search/commonSearch/CriterionRow.d.ts.map +1 -0
  10. package/dist/search/commonSearch/SearchForm.d.ts +10 -0
  11. package/dist/search/commonSearch/SearchForm.d.ts.map +1 -0
  12. package/dist/search/commonSearch/__tests__/__mocks__/commonSearchWidgetMocks.d.ts +11 -1
  13. package/dist/search/commonSearch/__tests__/__mocks__/commonSearchWidgetMocks.d.ts.map +1 -1
  14. package/dist/search/commonSearch/__tests__/__mocks__/criterionRowMocks.d.ts +5 -0
  15. package/dist/search/commonSearch/__tests__/__mocks__/criterionRowMocks.d.ts.map +1 -0
  16. package/dist/search/commonSearch/__tests__/__mocks__/dateCriterionInputMocks.d.ts +7 -0
  17. package/dist/search/commonSearch/__tests__/__mocks__/dateCriterionInputMocks.d.ts.map +1 -0
  18. package/dist/search/commonSearch/__tests__/__mocks__/lookupCriterionInputMocks.d.ts +4 -0
  19. package/dist/search/commonSearch/__tests__/__mocks__/lookupCriterionInputMocks.d.ts.map +1 -0
  20. package/dist/search/commonSearch/__tests__/__mocks__/numericCriterionInputMocks.d.ts +7 -0
  21. package/dist/search/commonSearch/__tests__/__mocks__/numericCriterionInputMocks.d.ts.map +1 -0
  22. package/dist/search/commonSearch/__tests__/__mocks__/optionsCriterionInputMocks.d.ts +4 -0
  23. package/dist/search/commonSearch/__tests__/__mocks__/optionsCriterionInputMocks.d.ts.map +1 -0
  24. package/dist/search/commonSearch/__tests__/__mocks__/searchFormMocks.d.ts +11 -0
  25. package/dist/search/commonSearch/__tests__/__mocks__/searchFormMocks.d.ts.map +1 -0
  26. package/dist/search/commonSearch/__tests__/__mocks__/textCriterionInputMocks.d.ts +4 -0
  27. package/dist/search/commonSearch/__tests__/__mocks__/textCriterionInputMocks.d.ts.map +1 -0
  28. package/dist/search/commonSearch/__tests__/__mocks__/utilsMocks.d.ts +11 -0
  29. package/dist/search/commonSearch/__tests__/__mocks__/utilsMocks.d.ts.map +1 -0
  30. package/dist/search/commonSearch/inputs/DateCriterionInput.d.ts +11 -0
  31. package/dist/search/commonSearch/inputs/DateCriterionInput.d.ts.map +1 -0
  32. package/dist/search/commonSearch/inputs/LookupCriterionInput.d.ts +10 -0
  33. package/dist/search/commonSearch/inputs/LookupCriterionInput.d.ts.map +1 -0
  34. package/dist/search/commonSearch/inputs/NumericCriterionInput.d.ts +11 -0
  35. package/dist/search/commonSearch/inputs/NumericCriterionInput.d.ts.map +1 -0
  36. package/dist/search/commonSearch/inputs/OptionsCriterionInput.d.ts +10 -0
  37. package/dist/search/commonSearch/inputs/OptionsCriterionInput.d.ts.map +1 -0
  38. package/dist/search/commonSearch/inputs/TextCriterionInput.d.ts +10 -0
  39. package/dist/search/commonSearch/inputs/TextCriterionInput.d.ts.map +1 -0
  40. package/dist/search/commonSearch/inputs/index.d.ts +11 -0
  41. package/dist/search/commonSearch/inputs/index.d.ts.map +1 -0
  42. package/dist/search/commonSearch/models.d.ts +77 -1
  43. package/dist/search/commonSearch/models.d.ts.map +1 -1
  44. package/dist/search/commonSearch/schema.json.d.ts +195 -2
  45. package/dist/search/commonSearch/utils.d.ts +10 -0
  46. package/dist/search/commonSearch/utils.d.ts.map +1 -0
  47. package/package.json +3 -3
@@ -0,0 +1,10 @@
1
+ import { LookupInput as LookupInputConfig, ScalarValue } from '../models';
2
+ interface Props {
3
+ input: LookupInputConfig;
4
+ value: ScalarValue | null;
5
+ onChange: (value: ScalarValue | null) => void;
6
+ validationError: string | null;
7
+ }
8
+ declare const LookupCriterionInput: ({ input, value, onChange, validationError, }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default LookupCriterionInput;
10
+ //# sourceMappingURL=LookupCriterionInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LookupCriterionInput.d.ts","sourceRoot":"","sources":["../../../../src/search/commonSearch/inputs/LookupCriterionInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE1E,UAAU,KAAK;IACb,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,oBAAoB,GAAI,8CAK3B,KAAK,4CAuBP,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { NumericInput as NumericInputConfig, RangeValue } from '../models';
2
+ interface Props {
3
+ input: NumericInputConfig;
4
+ value: RangeValue | null;
5
+ onChange: (value: RangeValue | null) => void;
6
+ validationError: string | null;
7
+ rangeOrderError: string | null;
8
+ }
9
+ declare const NumericCriterionInput: ({ input, value, onChange, validationError, rangeOrderError, }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default NumericCriterionInput;
11
+ //# sourceMappingURL=NumericCriterionInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericCriterionInput.d.ts","sourceRoot":"","sources":["../../../../src/search/commonSearch/inputs/NumericCriterionInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG3E,UAAU,KAAK;IACb,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAOD,QAAA,MAAM,qBAAqB,GAAI,+DAM5B,KAAK,4CAuFP,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { OptionsInput as OptionsInputConfig, ScalarValue } from '../models';
2
+ interface Props {
3
+ input: OptionsInputConfig;
4
+ value: ScalarValue | null;
5
+ onChange: (value: ScalarValue | null) => void;
6
+ validationError: string | null;
7
+ }
8
+ declare const OptionsCriterionInput: ({ input, value, onChange, validationError, }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default OptionsCriterionInput;
10
+ //# sourceMappingURL=OptionsCriterionInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionsCriterionInput.d.ts","sourceRoot":"","sources":["../../../../src/search/commonSearch/inputs/OptionsCriterionInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,IAAI,kBAAkB,EAClC,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,UAAU,KAAK;IACb,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,qBAAqB,GAAI,8CAK5B,KAAK,4CA6BP,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ScalarValue, TextInput as TextInputConfig } from '../models';
2
+ interface Props {
3
+ input: TextInputConfig;
4
+ value: ScalarValue | null;
5
+ onChange: (value: ScalarValue | null) => void;
6
+ validationError: string | null;
7
+ }
8
+ declare const TextCriterionInput: ({ input, value, onChange, validationError, }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default TextCriterionInput;
10
+ //# sourceMappingURL=TextCriterionInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextCriterionInput.d.ts","sourceRoot":"","sources":["../../../../src/search/commonSearch/inputs/TextCriterionInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AAEtE,UAAU,KAAK;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,kBAAkB,GAAI,8CAKzB,KAAK,4CAmBP,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { CriterionValue, InputConfig } from '../models';
2
+ interface CriterionInputProps {
3
+ input: InputConfig;
4
+ value: CriterionValue | null;
5
+ onChange: (value: CriterionValue | null) => void;
6
+ validationError: string | null;
7
+ rangeOrderError: string | null;
8
+ }
9
+ declare const CriterionInput: ({ input, value, onChange, validationError, rangeOrderError, }: CriterionInputProps) => import("react/jsx-runtime").JSX.Element;
10
+ export { CriterionInput };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/search/commonSearch/inputs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EAGZ,MAAM,WAAW,CAAC;AAOnB,UAAU,mBAAmB;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,cAAc,GAAI,+DAMrB,mBAAmB,4CAkDrB,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,2 +1,78 @@
1
- export type CommonSearchWidgetConfig = Record<string, unknown>;
1
+ export type Comparator = 'eq' | 'ne' | 'gt' | 'lt' | 'ge' | 'le';
2
+ export interface FieldConfig {
3
+ key: string;
4
+ keyType?: string;
5
+ }
6
+ export interface OptionItem {
7
+ translationKey: string;
8
+ value: string;
9
+ }
10
+ export interface LookupConfig {
11
+ source: string;
12
+ prefetch?: boolean;
13
+ valueSet?: string;
14
+ }
15
+ export interface BoundValue {
16
+ value: string | null;
17
+ comparator: Comparator | null;
18
+ }
19
+ export interface ScalarValue {
20
+ value: string;
21
+ }
22
+ export interface RangeValue {
23
+ from: BoundValue;
24
+ to?: BoundValue;
25
+ }
26
+ export type CriterionValue = ScalarValue | RangeValue;
27
+ export interface TextInput {
28
+ kind: 'text';
29
+ placeholderTranslationKey: string;
30
+ }
31
+ export interface NumericInput {
32
+ kind: 'numeric';
33
+ placeholderTranslationKey: string;
34
+ rangeAllowed?: boolean;
35
+ }
36
+ export interface DateInput {
37
+ kind: 'date';
38
+ placeholderTranslationKey: string;
39
+ rangeAllowed?: boolean;
40
+ }
41
+ export interface OptionsInput {
42
+ kind: 'options';
43
+ placeholderTranslationKey: string;
44
+ options: OptionItem[];
45
+ }
46
+ export interface LookupInput {
47
+ kind: 'lookup';
48
+ placeholderTranslationKey: string;
49
+ lookup: LookupConfig;
50
+ }
51
+ export type InputConfig = TextInput | NumericInput | DateInput | OptionsInput | LookupInput;
52
+ export interface CriterionConfig {
53
+ field: FieldConfig;
54
+ translationKey: string;
55
+ default?: boolean;
56
+ input: InputConfig;
57
+ }
58
+ export interface SearchContextConfig {
59
+ context: 'patient' | 'appointment' | 'episodeOfCare';
60
+ translationKey: string;
61
+ requiredPrivileges: string[];
62
+ locationAware: 'loggedInLocation' | 'allowedLocation';
63
+ url: string;
64
+ pageSize: number;
65
+ criteria: CriterionConfig[];
66
+ }
67
+ export type CommonSearchWidgetConfig = [
68
+ SearchContextConfig,
69
+ ...SearchContextConfig[]
70
+ ];
71
+ export interface CriterionRow {
72
+ rowId: string;
73
+ criterionKey: string | null;
74
+ value: CriterionValue | null;
75
+ validationError: string | null;
76
+ rangeOrderError: string | null;
77
+ }
2
78
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/search/commonSearch/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/search/commonSearch/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,CAAC,EAAE,UAAU,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,yBAAyB,EAAE,MAAM,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB,EAAE,MAAM,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,yBAAyB,EAAE,MAAM,CAAC;IAClC,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,yBAAyB,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,WAAW,CAAC;AAEhB,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,GAAG,aAAa,GAAG,eAAe,CAAC;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,mBAAmB;IACnB,GAAG,mBAAmB,EAAE;CACzB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
@@ -1,7 +1,200 @@
1
1
  declare const _default: {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Tab Config Schema",
4
- "type": "object"
3
+ "title": "Common Search Widget Config Schema",
4
+ "description": "Configuration for the common search widget, defining search criteria per context",
5
+ "type": "array",
6
+ "minItems": 1,
7
+ "items": {
8
+ "$ref": "#/definitions/searchContextConfig"
9
+ },
10
+ "definitions": {
11
+ "searchContextConfig": {
12
+ "type": "object",
13
+ "required": [
14
+ "context",
15
+ "translationKey",
16
+ "requiredPrivileges",
17
+ "locationAware",
18
+ "url",
19
+ "pageSize",
20
+ "criteria"
21
+ ],
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "context": {
25
+ "type": "string",
26
+ "enum": ["patient", "appointment", "episodeOfCare"],
27
+ "description": "The context this search configuration applies to"
28
+ },
29
+ "translationKey": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "description": "i18n key for the tab/section label"
33
+ },
34
+ "requiredPrivileges": {
35
+ "type": "array",
36
+ "items": { "type": "string" },
37
+ "minItems": 1,
38
+ "uniqueItems": true,
39
+ "description": "Privileges required to access this search context"
40
+ },
41
+ "locationAware": {
42
+ "type": "string",
43
+ "enum": ["loggedInLocation", "allowedLocation"],
44
+ "description": "Location scope applied when executing searches in this context"
45
+ },
46
+ "url": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "description": "API endpoint URL for search results"
50
+ },
51
+ "pageSize": {
52
+ "type": "integer",
53
+ "minimum": 1,
54
+ "description": "Number of results per page"
55
+ },
56
+ "criteria": {
57
+ "type": "array",
58
+ "items": { "$ref": "#/definitions/criterionConfig" },
59
+ "minItems": 1,
60
+ "description": "Search criteria available in this context"
61
+ }
62
+ }
63
+ },
64
+ "criterionConfig": {
65
+ "type": "object",
66
+ "required": ["field", "translationKey", "input"],
67
+ "additionalProperties": false,
68
+ "properties": {
69
+ "field": { "$ref": "#/definitions/fieldConfig" },
70
+ "default": {
71
+ "type": "boolean",
72
+ "description": "Whether this criterion is shown by default in the UI"
73
+ },
74
+ "translationKey": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "description": "i18n key for the criterion label"
78
+ },
79
+ "input": { "$ref": "#/definitions/inputConfig" }
80
+ }
81
+ },
82
+ "fieldConfig": {
83
+ "type": "object",
84
+ "required": ["key"],
85
+ "additionalProperties": false,
86
+ "properties": {
87
+ "key": {
88
+ "type": "string",
89
+ "minLength": 1,
90
+ "description": "Field identifier used when constructing the search query"
91
+ },
92
+ "keyType": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "description": "UUID or type qualifier for polymorphic fields such as identifier or personAttribute"
96
+ }
97
+ }
98
+ },
99
+ "inputConfig": {
100
+ "oneOf": [
101
+ { "$ref": "#/definitions/textInput" },
102
+ { "$ref": "#/definitions/dateInput" },
103
+ { "$ref": "#/definitions/numericInput" },
104
+ { "$ref": "#/definitions/optionsInput" },
105
+ { "$ref": "#/definitions/lookupInput" }
106
+ ]
107
+ },
108
+ "textInput": {
109
+ "type": "object",
110
+ "required": ["kind", "placeholderTranslationKey"],
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "kind": { "type": "string", "const": "text" },
114
+ "placeholderTranslationKey": { "type": "string", "minLength": 1 }
115
+ }
116
+ },
117
+ "dateInput": {
118
+ "type": "object",
119
+ "required": ["kind", "placeholderTranslationKey"],
120
+ "additionalProperties": false,
121
+ "properties": {
122
+ "kind": { "type": "string", "const": "date" },
123
+ "placeholderTranslationKey": { "type": "string", "minLength": 1 },
124
+ "rangeAllowed": {
125
+ "type": "boolean",
126
+ "description": "When true, UI renders two inputs (From and To), each with its own value and comparator"
127
+ }
128
+ }
129
+ },
130
+ "numericInput": {
131
+ "type": "object",
132
+ "required": ["kind", "placeholderTranslationKey"],
133
+ "additionalProperties": false,
134
+ "properties": {
135
+ "kind": { "type": "string", "const": "numeric" },
136
+ "placeholderTranslationKey": { "type": "string", "minLength": 1 },
137
+ "rangeAllowed": {
138
+ "type": "boolean",
139
+ "description": "When true, UI renders two inputs (From and To), each with its own value and comparator"
140
+ }
141
+ }
142
+ },
143
+ "optionsInput": {
144
+ "type": "object",
145
+ "required": ["kind", "placeholderTranslationKey", "options"],
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "kind": { "type": "string", "const": "options" },
149
+ "placeholderTranslationKey": { "type": "string", "minLength": 1 },
150
+ "options": {
151
+ "type": "array",
152
+ "minItems": 1,
153
+ "items": { "$ref": "#/definitions/optionItem" },
154
+ "description": "Static list of selectable options"
155
+ }
156
+ }
157
+ },
158
+ "optionItem": {
159
+ "type": "object",
160
+ "required": ["translationKey", "value"],
161
+ "additionalProperties": false,
162
+ "properties": {
163
+ "translationKey": { "type": "string", "minLength": 1 },
164
+ "value": { "type": "string", "minLength": 1 }
165
+ }
166
+ },
167
+ "lookupInput": {
168
+ "type": "object",
169
+ "required": ["kind", "placeholderTranslationKey", "lookup"],
170
+ "additionalProperties": false,
171
+ "properties": {
172
+ "kind": { "type": "string", "const": "lookup" },
173
+ "placeholderTranslationKey": { "type": "string", "minLength": 1 },
174
+ "lookup": { "$ref": "#/definitions/lookupConfig" }
175
+ }
176
+ },
177
+ "lookupConfig": {
178
+ "type": "object",
179
+ "required": ["source"],
180
+ "additionalProperties": false,
181
+ "properties": {
182
+ "source": {
183
+ "type": "string",
184
+ "minLength": 1,
185
+ "description": "Identifies the lookup source (e.g. appointmentService, concept)"
186
+ },
187
+ "prefetch": {
188
+ "type": "boolean",
189
+ "description": "Whether to load all options upfront rather than on user input"
190
+ },
191
+ "valueSet": {
192
+ "type": "string",
193
+ "description": "UUID of the concept value set to restrict lookup results"
194
+ }
195
+ }
196
+ }
197
+ }
5
198
  }
6
199
  ;
7
200
 
@@ -0,0 +1,10 @@
1
+ import { CriterionConfig, CriterionRow, CriterionValue, InputConfig, SearchContextConfig } from './models';
2
+ export declare const getValueError: (value: CriterionValue | null, input: InputConfig, errorMessage: string) => string | null;
3
+ export declare const getRangeOrderError: (value: CriterionValue | null, input: InputConfig, errorMessage: string) => string | null;
4
+ export declare const makeRow: (criterionKey: string | null) => CriterionRow;
5
+ export declare const initialRows: (context: SearchContextConfig) => CriterionRow[];
6
+ export declare const availableCriteriaForRow: (criteria: CriterionConfig[], rows: CriterionRow[], currentRowId: string) => CriterionConfig[];
7
+ export declare const criteriaAvailableToAdd: (criteria: CriterionConfig[], rows: CriterionRow[]) => CriterionConfig[];
8
+ export declare const updateRow: (rows: CriterionRow[], rowId: string, updater: (row: CriterionRow) => Partial<CriterionRow>) => CriterionRow[];
9
+ export declare const validateRows: (rows: CriterionRow[], criteria: CriterionConfig[], criterionError: string, valueError: string, rangeOrderMessage: string) => CriterionRow[];
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/search/commonSearch/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,cAAc,EACd,WAAW,EAEX,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAOlB,eAAO,MAAM,aAAa,GACxB,OAAO,cAAc,GAAG,IAAI,EAC5B,OAAO,WAAW,EAClB,cAAc,MAAM,KACnB,MAAM,GAAG,IAOX,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,cAAc,GAAG,IAAI,EAC5B,OAAO,WAAW,EAClB,cAAc,MAAM,KACnB,MAAM,GAAG,IAgBX,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,cAAc,MAAM,GAAG,IAAI,KAAG,YAMpD,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,SAAS,mBAAmB,KAAG,YAAY,EAItE,CAAC;AAeF,eAAO,MAAM,uBAAuB,GAClC,UAAU,eAAe,EAAE,EAC3B,MAAM,YAAY,EAAE,EACpB,cAAc,MAAM,KACnB,eAAe,EAGjB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,UAAU,eAAe,EAAE,EAC3B,MAAM,YAAY,EAAE,KACnB,eAAe,EAGjB,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,MAAM,YAAY,EAAE,EACpB,OAAO,MAAM,EACb,SAAS,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,KACpD,YAAY,EACqD,CAAC;AAErE,eAAO,MAAM,YAAY,GACvB,MAAM,YAAY,EAAE,EACpB,UAAU,eAAe,EAAE,EAC3B,gBAAgB,MAAM,EACtB,YAAY,MAAM,EAClB,mBAAmB,MAAM,KACxB,YAAY,EAUX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.336",
3
+ "version": "0.0.1-dev.338",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,11 +26,11 @@
26
26
  "prepublishOnly": "yarn run build"
27
27
  },
28
28
  "dependencies": {
29
- "@bahmni/design-system": "^0.0.1-0",
30
- "@bahmni/services": "^0.0.1-0",
31
29
  "cmdk": "^1.1.1"
32
30
  },
33
31
  "peerDependencies": {
32
+ "@bahmni/design-system": "^0.0.1-0",
33
+ "@bahmni/services": "^0.0.1-0",
34
34
  "@tanstack/react-query": "^5.85.5",
35
35
  "react": ">=18.0.0",
36
36
  "react-dom": ">=18.0.0"