@reqquest/ui 1.1.10 → 1.1.11
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/api.d.ts +48 -0
- package/dist/components/FieldCardCheckbox.svelte.d.ts +109 -0
- package/dist/components/FieldCardRadio.svelte.d.ts +125 -0
- package/dist/components/QuestionnairePrompt.svelte +17 -4
- package/dist/components/QuestionnairePrompt.svelte.d.ts +52 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/registry.d.ts +216 -0
- package/dist/typed-client/index.d.ts +25 -0
- package/dist/typed-client/runtime/batcher.d.ts +105 -0
- package/dist/typed-client/runtime/createClient.d.ts +17 -0
- package/dist/typed-client/runtime/error.d.ts +18 -0
- package/dist/typed-client/runtime/fetcher.d.ts +10 -0
- package/dist/typed-client/runtime/generateGraphqlOperation.d.ts +30 -0
- package/dist/typed-client/runtime/index.d.ts +11 -0
- package/dist/typed-client/runtime/linkTypeMap.d.ts +9 -0
- package/dist/typed-client/runtime/typeSelection.d.ts +28 -0
- package/dist/typed-client/runtime/types.d.ts +55 -0
- package/dist/typed-client/schema.d.ts +2033 -0
- package/dist/typed-client/schema.graphql +49 -1
- package/dist/typed-client/schema.js +7 -0
- package/dist/typed-client/types.d.ts +732 -0
- package/dist/typed-client/types.js +501 -482
- package/dist/types.d.ts +56 -0
- package/package.json +2 -4
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { APIBase } from '@txstate-mws/sveltekit-utils';
|
|
2
|
+
import type { AppRequestStatus, createClient } from './typed-client/index.js';
|
|
3
|
+
export interface ReqquestAPI extends APIBase {
|
|
4
|
+
client: ReturnType<typeof createClient>;
|
|
5
|
+
getDownloadTicket: () => Promise<string>;
|
|
6
|
+
}
|
|
7
|
+
export interface ReviewerCardRequest<OtherInfoType = any> {
|
|
8
|
+
complete: boolean;
|
|
9
|
+
status: AppRequestStatus;
|
|
10
|
+
closedAt: string;
|
|
11
|
+
applicant: ReviewerCardApplicant<OtherInfoType>;
|
|
12
|
+
period: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
code: string;
|
|
16
|
+
openDate: string;
|
|
17
|
+
closeDate: string;
|
|
18
|
+
archiveDate: string;
|
|
19
|
+
};
|
|
20
|
+
applications: {
|
|
21
|
+
id: string;
|
|
22
|
+
navTitle: string;
|
|
23
|
+
programKey: string;
|
|
24
|
+
}[];
|
|
25
|
+
actions: {
|
|
26
|
+
acceptOffer: boolean;
|
|
27
|
+
cancel: boolean;
|
|
28
|
+
close: boolean;
|
|
29
|
+
completeRequest: boolean;
|
|
30
|
+
completeReview: boolean;
|
|
31
|
+
reopen: boolean;
|
|
32
|
+
returnToApplicant: boolean;
|
|
33
|
+
returnToNonBlocking: boolean;
|
|
34
|
+
returnToOffer: boolean;
|
|
35
|
+
returnToReview: boolean;
|
|
36
|
+
review: boolean;
|
|
37
|
+
submit: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface ReviewerCardApplicant<OtherInfoType = any> {
|
|
41
|
+
login: string;
|
|
42
|
+
fullname: string;
|
|
43
|
+
otherIdentifiers: {
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
}[];
|
|
47
|
+
otherInfo: OtherInfoType;
|
|
48
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { CardSelectItem } from '../components/FieldCardRadio.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
/**
|
|
21
|
+
* A form field component that displays a grid of selectable cards (multiple selection).
|
|
22
|
+
* Similar to FieldCardRadio but allows selecting multiple cards (checkbox behavior).
|
|
23
|
+
*
|
|
24
|
+
* The form value is an array of selected item values.
|
|
25
|
+
*
|
|
26
|
+
* By default this component expects values to be strings. If you wish to use other types of values, you
|
|
27
|
+
* must provide a `serialize` and `deserialize` function that handle individual item values.
|
|
28
|
+
*
|
|
29
|
+
* If your `items` are not ready on first load (e.g. they're being loaded from an API fetch), you must
|
|
30
|
+
* place this field inside an `{#if}` block until they are ready.
|
|
31
|
+
*/
|
|
32
|
+
declare const FieldCardCheckbox: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
33
|
+
/**
|
|
34
|
+
* Path to the form field in the data structure
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/ path: string;
|
|
37
|
+
/**
|
|
38
|
+
* Array of card options
|
|
39
|
+
* @type {CardSelectItem[]}
|
|
40
|
+
*/ items: CardSelectItem[];
|
|
41
|
+
/**
|
|
42
|
+
* Whether the field group is conditional
|
|
43
|
+
* @type {boolean}
|
|
44
|
+
* @default true
|
|
45
|
+
*/ conditional?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Set to true to prevent null/undefined values (will default to empty array)
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
* @default false
|
|
50
|
+
*/ notNull?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Default selected values (array)
|
|
53
|
+
* @type {any[]}
|
|
54
|
+
* @default []
|
|
55
|
+
*/ defaultValue?: any[];
|
|
56
|
+
/**
|
|
57
|
+
* Text to display in the fieldset legend
|
|
58
|
+
* @type {string | undefined}
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/ legendText?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* When true, the field is marked as required in the UI. This is only for visual indication
|
|
63
|
+
* and does not affect validation. Validation is handled by the API that receives the data.
|
|
64
|
+
* @type {boolean}
|
|
65
|
+
* @default false
|
|
66
|
+
*/ required?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* CSS size for the grid minimum item width (like CardGrid)
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @default '20rem'
|
|
71
|
+
*/ cardSize?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Gap between cards in the grid
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @default '16px'
|
|
76
|
+
*/ gap?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Custom function to serialize individual item values for form submission.
|
|
79
|
+
* Each item value is serialized independently before being stored in the array.
|
|
80
|
+
* @type {((value: any) => string) | undefined}
|
|
81
|
+
* @default undefined
|
|
82
|
+
*/ serialize?: ((value: any) => string) | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Custom function to deserialize individual item values from form data.
|
|
85
|
+
* Each item value is deserialized independently after being retrieved from the array.
|
|
86
|
+
* @type {((value: string) => any) | undefined}
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/ deserialize?: ((value: string) => any) | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
default: {
|
|
91
|
+
item: CardSelectItem;
|
|
92
|
+
selected: any;
|
|
93
|
+
index: any;
|
|
94
|
+
};
|
|
95
|
+
}>, {
|
|
96
|
+
focus: CustomEvent<any>;
|
|
97
|
+
blur: CustomEvent<any>;
|
|
98
|
+
update: CustomEvent<any>;
|
|
99
|
+
} & {
|
|
100
|
+
[evt: string]: CustomEvent<any>;
|
|
101
|
+
}, {
|
|
102
|
+
default: {
|
|
103
|
+
item: CardSelectItem;
|
|
104
|
+
selected: any;
|
|
105
|
+
index: any;
|
|
106
|
+
};
|
|
107
|
+
}, {}, string>;
|
|
108
|
+
type FieldCardCheckbox = InstanceType<typeof FieldCardCheckbox>;
|
|
109
|
+
export default FieldCardCheckbox;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { CardImage, TagItem } from '@txstate-mws/carbon-svelte';
|
|
2
|
+
export interface CardSelectItem {
|
|
3
|
+
value: any;
|
|
4
|
+
title: string;
|
|
5
|
+
subhead?: string;
|
|
6
|
+
image?: CardImage;
|
|
7
|
+
tags?: TagItem[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
selectionLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
12
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
13
|
+
$$bindings?: Bindings;
|
|
14
|
+
} & Exports;
|
|
15
|
+
(internal: unknown, props: Props & {
|
|
16
|
+
$$events?: Events;
|
|
17
|
+
$$slots?: Slots;
|
|
18
|
+
}): Exports & {
|
|
19
|
+
$set?: any;
|
|
20
|
+
$on?: any;
|
|
21
|
+
};
|
|
22
|
+
z_$$bindings?: Bindings;
|
|
23
|
+
}
|
|
24
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
25
|
+
default: any;
|
|
26
|
+
} ? Props extends Record<string, never> ? any : {
|
|
27
|
+
children?: any;
|
|
28
|
+
} : {});
|
|
29
|
+
/**
|
|
30
|
+
* A form field component that displays a grid of selectable cards (single selection).
|
|
31
|
+
* Similar to FieldRadioTile but with richer card-based visuals including images and tags.
|
|
32
|
+
*
|
|
33
|
+
* By default this component expects values to be strings. If you wish to use other types of values, you
|
|
34
|
+
* must provide a `serialize` and `deserialize` function. If you set the `number` prop, an appropriate
|
|
35
|
+
* serializer and deserializer will be provided by default.
|
|
36
|
+
*
|
|
37
|
+
* If your `items` are not ready on first load (e.g. they're being loaded from an API fetch), you must
|
|
38
|
+
* place this field inside an `{#if}` block until they are ready.
|
|
39
|
+
*/
|
|
40
|
+
declare const FieldCardRadio: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
41
|
+
/**
|
|
42
|
+
* Path to the form field in the data structure
|
|
43
|
+
* @type {string}
|
|
44
|
+
*/ path: string;
|
|
45
|
+
/**
|
|
46
|
+
* Array of card options
|
|
47
|
+
* @type {CardSelectItem[]}
|
|
48
|
+
*/ items: CardSelectItem[];
|
|
49
|
+
/**
|
|
50
|
+
* Set to true to treat the value as a number instead of string
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
* @default false
|
|
53
|
+
*/ number?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Set to true to treat the value as a boolean
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
* @default false
|
|
58
|
+
*/ boolean?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Set to true to prevent null values
|
|
61
|
+
* @type {boolean}
|
|
62
|
+
* @default false
|
|
63
|
+
*/ notNull?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the field group is conditional
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
* @default true
|
|
68
|
+
*/ conditional?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Default selected value
|
|
71
|
+
* @type {any}
|
|
72
|
+
* @default undefined
|
|
73
|
+
*/ defaultValue?: any;
|
|
74
|
+
/**
|
|
75
|
+
* Text to display in the fieldset legend
|
|
76
|
+
* @type {string | undefined}
|
|
77
|
+
* @default undefined
|
|
78
|
+
*/ legendText?: string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* When true, the field is marked as required in the UI. This is only for visual indication
|
|
81
|
+
* and does not affect validation. Validation is handled by the API that receives the data.
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
* @default false
|
|
84
|
+
*/ required?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* CSS size for the grid minimum item width (like CardGrid)
|
|
87
|
+
* @type {string}
|
|
88
|
+
* @default '20rem'
|
|
89
|
+
*/ cardSize?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Gap between cards in the grid
|
|
92
|
+
* @type {string}
|
|
93
|
+
* @default '16px'
|
|
94
|
+
*/ gap?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Custom function to serialize values for form submission
|
|
97
|
+
* @type {((value: any) => string) | undefined}
|
|
98
|
+
* @default undefined
|
|
99
|
+
*/ serialize?: ((value: any) => string) | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Custom function to deserialize values from form data
|
|
102
|
+
* @type {((value: string) => any) | undefined}
|
|
103
|
+
* @default undefined
|
|
104
|
+
*/ deserialize?: ((value: string) => any) | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
default: {
|
|
107
|
+
item: CardSelectItem;
|
|
108
|
+
selected: any;
|
|
109
|
+
index: any;
|
|
110
|
+
};
|
|
111
|
+
}>, {
|
|
112
|
+
focus: CustomEvent<any>;
|
|
113
|
+
blur: CustomEvent<any>;
|
|
114
|
+
update: CustomEvent<any>;
|
|
115
|
+
} & {
|
|
116
|
+
[evt: string]: CustomEvent<any>;
|
|
117
|
+
}, {
|
|
118
|
+
default: {
|
|
119
|
+
item: CardSelectItem;
|
|
120
|
+
selected: any;
|
|
121
|
+
index: any;
|
|
122
|
+
};
|
|
123
|
+
}, {}, string>;
|
|
124
|
+
type FieldCardRadio = InstanceType<typeof FieldCardRadio>;
|
|
125
|
+
export default FieldCardRadio;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* There can be up to 3 external links to help applicants if there are things they need to do externally to the app request.
|
|
8
8
|
* @type {{ url: string, label: string }[]}
|
|
9
9
|
*/
|
|
10
|
-
export let externalLinks: { url: string, label: string, target?: string, rel?: string}[] = []
|
|
10
|
+
export let externalLinks: { url: string, label: string, target?: string, rel?: string }[] = []
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* If true, the form will take the full width of its container. If false, it will be constrained to max-w-screen-md.
|
|
@@ -20,12 +20,25 @@
|
|
|
20
20
|
* @type {'left' | 'center'}
|
|
21
21
|
*/
|
|
22
22
|
export let align: 'left' | 'center' = 'center'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Text alignment for the intro slot content. Defaults to the value of `align`.
|
|
26
|
+
* @type {'left' | 'center' | 'right' | undefined}
|
|
27
|
+
*/
|
|
28
|
+
export let introTextAlignment: 'left' | 'center' | 'right' | undefined = undefined
|
|
29
|
+
|
|
30
|
+
$: effectiveIntroAlignment = introTextAlignment ?? align
|
|
23
31
|
</script>
|
|
32
|
+
{#if $$slots.intro}
|
|
33
|
+
<div id="questionnaire-intro" class="prompt-intro flow max-w-screen-md px-6" class:mx-auto={align === 'center'} class:text-center={effectiveIntroAlignment === 'center'} class:text-right={effectiveIntroAlignment === 'right'} style:color="var(--cds-text-02)">
|
|
34
|
+
<slot name="intro" />
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
24
37
|
{#if externalLinks.length > 0}
|
|
25
|
-
<div class="prompt-intro-links flow max-w-screen-md mx-auto
|
|
26
|
-
<ul class="flex gap-4 flex-wrap mb-4 justify-center
|
|
38
|
+
<div class="prompt-intro-links flow max-w-screen-md px-6" class:mx-auto={align === 'center'}>
|
|
39
|
+
<ul class="flex gap-4 flex-wrap mb-4" class:justify-center={align === 'center'}>
|
|
27
40
|
{#each externalLinks.slice(0, 3) as link (link.url)}
|
|
28
|
-
<li><Button kind="ghost" icon={Launch} href={link.url} target={link.target ?? '_blank'} rel={link.rel ?? 'noopener noreferrer'}>{link.label}</Button></li>
|
|
41
|
+
<li><Button kind="ghost" icon={Launch} href={link.url} target={link.target ?? '_blank'} rel={link.rel ?? 'noopener noreferrer'}>{link.label}{#if (link.target ?? '_blank') === '_blank'}<span class="sr-only"> (opens in a new tab)</span>{/if}</Button></li>
|
|
29
42
|
{/each}
|
|
30
43
|
</ul>
|
|
31
44
|
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const QuestionnairePrompt: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
/**
|
|
21
|
+
* Array of external links to show above the form.
|
|
22
|
+
* There can be up to 3 external links to help applicants if there are things they need to do externally to the app request.
|
|
23
|
+
* @type {{ url: string, label: string }[]}
|
|
24
|
+
*/ externalLinks?: {
|
|
25
|
+
url: string;
|
|
26
|
+
label: string;
|
|
27
|
+
target?: string;
|
|
28
|
+
rel?: string;
|
|
29
|
+
}[];
|
|
30
|
+
/**
|
|
31
|
+
* If true, the form will take the full width of its container. If false, it will be constrained to max-w-screen-md.
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
*/ fullWidth?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Alignment of the form container. 'center' will center it and 'left' will align it to the left.
|
|
36
|
+
* @type {'left' | 'center'}
|
|
37
|
+
*/ align?: "left" | "center";
|
|
38
|
+
/**
|
|
39
|
+
* Text alignment for the intro slot content. Defaults to the value of `align`.
|
|
40
|
+
* @type {'left' | 'center' | 'right' | undefined}
|
|
41
|
+
*/ introTextAlignment?: "left" | "center" | "right" | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
intro: {};
|
|
44
|
+
default: {};
|
|
45
|
+
}>, {
|
|
46
|
+
[evt: string]: CustomEvent<any>;
|
|
47
|
+
}, {
|
|
48
|
+
intro: {};
|
|
49
|
+
default: {};
|
|
50
|
+
}, {}, string>;
|
|
51
|
+
type QuestionnairePrompt = InstanceType<typeof QuestionnairePrompt>;
|
|
52
|
+
export default QuestionnairePrompt;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { LayoutStructureNode, LayoutStructureNodeRoot } from '@txstate-mws/carbon-svelte';
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
export interface ProgramDefinition {
|
|
4
|
+
/**
|
|
5
|
+
* The key for the program. Allows us to match up API programs with
|
|
6
|
+
* the appropriate definition.
|
|
7
|
+
*/
|
|
8
|
+
key: string;
|
|
9
|
+
/**
|
|
10
|
+
* An icon to represent this program in the navigation.
|
|
11
|
+
*/
|
|
12
|
+
icon?: Component;
|
|
13
|
+
}
|
|
14
|
+
export interface RequirementDefinition {
|
|
15
|
+
/**
|
|
16
|
+
* The key for the requirement. Allows us to match up API requirements with
|
|
17
|
+
* the appropriate definition.
|
|
18
|
+
*/
|
|
19
|
+
key: string;
|
|
20
|
+
/**
|
|
21
|
+
* An icon to represent this requirement in the navigation. Requirements do not appear
|
|
22
|
+
* in the navigation in the applicant's view.
|
|
23
|
+
*/
|
|
24
|
+
icon?: Component;
|
|
25
|
+
/**
|
|
26
|
+
* A component that will be used to render the form for this prompt's configuration, if applicable.
|
|
27
|
+
*/
|
|
28
|
+
configureComponent?: Component;
|
|
29
|
+
/**
|
|
30
|
+
* Read-only version of the configuration.
|
|
31
|
+
*/
|
|
32
|
+
configureDisplayComponent?: Component;
|
|
33
|
+
}
|
|
34
|
+
export interface PromptDefinition {
|
|
35
|
+
key: string;
|
|
36
|
+
/**
|
|
37
|
+
* The component that will be used to render the form for this prompt.
|
|
38
|
+
*
|
|
39
|
+
* If not provided, it will be assumed that the prompt is meant to be filled in
|
|
40
|
+
* by an automation. The applicant view cannot handle this, so always include
|
|
41
|
+
* a formComponent for applicant prompts.
|
|
42
|
+
*/
|
|
43
|
+
formComponent?: Component;
|
|
44
|
+
/**
|
|
45
|
+
* Control the size of the area the formComponent will be rendered in.
|
|
46
|
+
* - 'small' will render the form in a small area (about 8 lines or less at 320px width).
|
|
47
|
+
* - 'large' will render the form in a large area (about 32 lines or less at 800px width) (still has to be responsive down to 320px).
|
|
48
|
+
* - 'full' will render the form in a modal that takes up the full screen (still has to be responsive down to 320px). This also disables autosaving in the reviewer UI.
|
|
49
|
+
* Defaults to 'small'.
|
|
50
|
+
*/
|
|
51
|
+
formMode?: 'small' | 'large' | 'full';
|
|
52
|
+
/**
|
|
53
|
+
* Set this to true to make the prompt visually distinct as something that is meant to
|
|
54
|
+
* be filled in by an automation. If you provide a formComponent, humans with permission
|
|
55
|
+
* will still have an edit pencil and be able to edit the prompt in a modal.
|
|
56
|
+
*
|
|
57
|
+
* - If you didn't provide a formComponent, `automation` defaults to true.
|
|
58
|
+
* - When `automation` is true, `formMode` is ignored (behaves like 'full').
|
|
59
|
+
* - The applicant view will ignore this setting.
|
|
60
|
+
*
|
|
61
|
+
* Note: if you set this and also provide a formComponent, it might be a good idea to add
|
|
62
|
+
* a hidden field to the formComponent to mark the data as written by a human, so automations
|
|
63
|
+
* know to stop updating the data. Automations will set data directly so anything you do
|
|
64
|
+
* in the formComponent will only affect human edits / overrides.
|
|
65
|
+
*/
|
|
66
|
+
automation?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* A component that displays the data collected from this prompt instead of collecting
|
|
69
|
+
* it. Should be as compact as possible, as it will be displayed in a big list of prompts.
|
|
70
|
+
*/
|
|
71
|
+
displayComponent: Component;
|
|
72
|
+
/**
|
|
73
|
+
* Control the size of the area the displayComponent will be rendered in.
|
|
74
|
+
* - 'small' will render the component in a small area (about 8 lines or less at 320px width).
|
|
75
|
+
* - 'large' will render the component in a large area (about 32 lines or less at 800px width) (still has to be responsive down to 320px).
|
|
76
|
+
* Defaults to 'small'.
|
|
77
|
+
*
|
|
78
|
+
* There is no 'full' mode for displayComponent, since we always want to be able to print the
|
|
79
|
+
* full information dump on a one-pager.
|
|
80
|
+
*/
|
|
81
|
+
displayMode?: 'small' | 'large';
|
|
82
|
+
/**
|
|
83
|
+
* A component that will be used to render the form for this prompt's configuration, if applicable.
|
|
84
|
+
*
|
|
85
|
+
* Configuration forms are always rendered in a modal that takes up (up to) the full screen.
|
|
86
|
+
*/
|
|
87
|
+
configureComponent?: Component;
|
|
88
|
+
/**
|
|
89
|
+
* Read-only version of the configuration.
|
|
90
|
+
*/
|
|
91
|
+
configureDisplayComponent?: Component;
|
|
92
|
+
/**
|
|
93
|
+
* An icon for the navigation.
|
|
94
|
+
*/
|
|
95
|
+
icon?: Component;
|
|
96
|
+
}
|
|
97
|
+
export interface Terminologies {
|
|
98
|
+
/**
|
|
99
|
+
* The name of the container for all the applications/programes.
|
|
100
|
+
*
|
|
101
|
+
* Defaults to "App Request", but can be changed to something like "Request" or "Application".
|
|
102
|
+
* "Application" works well if the project only has one program.
|
|
103
|
+
*/
|
|
104
|
+
appRequest?: string;
|
|
105
|
+
/**
|
|
106
|
+
* What to call the login for each user.
|
|
107
|
+
*
|
|
108
|
+
* Defaults to "Login", but can be changed to something like "Username" or "Email" or something
|
|
109
|
+
* unique to the organization like "NetID".
|
|
110
|
+
*/
|
|
111
|
+
login?: string;
|
|
112
|
+
/**
|
|
113
|
+
* The name of the time periods that applications are placed inside.
|
|
114
|
+
*
|
|
115
|
+
* Defaults to "Period", but can be changed to something like "Year" or "Term" or "Application
|
|
116
|
+
* Window".
|
|
117
|
+
*/
|
|
118
|
+
period?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A type for the config object that should be exported from a CMS instance's admin/local/index.js
|
|
122
|
+
* to configure how that instance should work.
|
|
123
|
+
*/
|
|
124
|
+
export interface UIConfig {
|
|
125
|
+
programs: ProgramDefinition[];
|
|
126
|
+
requirements: RequirementDefinition[];
|
|
127
|
+
prompts: PromptDefinition[];
|
|
128
|
+
appName: string;
|
|
129
|
+
applicantDashboardTitle?: string;
|
|
130
|
+
applicantDashboardNavTitle?: string;
|
|
131
|
+
/**
|
|
132
|
+
* The header text for the applicant dashboard intro section.
|
|
133
|
+
*/
|
|
134
|
+
applicantDashboardIntroHeader?: string;
|
|
135
|
+
applicantDashboardIntroDetail?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The number of days an application is considered "recent" on the applicant dashboard.
|
|
138
|
+
* Defaults to 30 if not specified.
|
|
139
|
+
*/
|
|
140
|
+
applicantDashboardRecentDays?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Whether to constrain the applicant review/submission page to a medium
|
|
143
|
+
* screen-width container. Defaults to true.
|
|
144
|
+
*/
|
|
145
|
+
applicantReviewMaxWidth?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* URL to the support/help page. If provided, a support link will be shown on applicant review screen.
|
|
148
|
+
*/
|
|
149
|
+
supportUrl?: string;
|
|
150
|
+
extraNavItems?: LayoutStructureNodeRoot<LayoutStructureNode>[];
|
|
151
|
+
/**
|
|
152
|
+
* This is where you should describe what kind of attributes app users will be able to search users by.
|
|
153
|
+
* Displayed on user management page /roles/users.
|
|
154
|
+
*/
|
|
155
|
+
roleUsersAttributeDescription?: string;
|
|
156
|
+
/**
|
|
157
|
+
* These options give you the ability to customize the terminology used in the UI.
|
|
158
|
+
*
|
|
159
|
+
* This is useful for changing the wording to better fit your project's
|
|
160
|
+
* context.
|
|
161
|
+
*/
|
|
162
|
+
terminology?: Terminologies & {
|
|
163
|
+
/**
|
|
164
|
+
* Optionally, provide plural forms for each of the above. By default we will use a pluralization
|
|
165
|
+
* library.
|
|
166
|
+
*/
|
|
167
|
+
plural?: Terminologies;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Several spots in the UI allow you to provide custom components to add extra data or functionality.
|
|
171
|
+
*
|
|
172
|
+
* Specify the components here.
|
|
173
|
+
*/
|
|
174
|
+
slots?: {
|
|
175
|
+
/**
|
|
176
|
+
* This will be placed inside the top card on the reviewer sidebar that displays applicant information.
|
|
177
|
+
*
|
|
178
|
+
* It will receive receive the following props:
|
|
179
|
+
* - `appRequest` with lots of app request details, import the ReviewerCardRequest type from `@reqquest/ui`
|
|
180
|
+
* - `applicant` with applicant details, import the ReviewerCardApplicant type from `@reqquest/ui`. Notably
|
|
181
|
+
* this includes `otherInfo`, which contains any custom user information returned by the userLookup function you provided.
|
|
182
|
+
* - `api` which is an instance of the API client, import the ReqquestAPI type from `@reqquest/ui`. This allows you to make
|
|
183
|
+
* additional API calls if you need information not included in the other props.
|
|
184
|
+
*/
|
|
185
|
+
reviewerSidebarCard?: Component;
|
|
186
|
+
/**
|
|
187
|
+
* This will be placed below the request details in the sidebar.
|
|
188
|
+
*
|
|
189
|
+
* It will receive receive the following props:
|
|
190
|
+
* - `appRequest` with lots of app request details, import the ReviewerCardRequest type from `@reqquest/ui`
|
|
191
|
+
* - `applicant` with applicant details, import the ReviewerCardApplicant type from `@reqquest/ui`. Notably
|
|
192
|
+
* this includes `otherInfo`, which contains any custom user information returned by the userLookup function you provided.
|
|
193
|
+
* - `api` which is an instance of the API client, import the ReqquestAPI type from `@reqquest/ui`. This allows you to make
|
|
194
|
+
* additional API calls if you need information not included in the other props.
|
|
195
|
+
*/
|
|
196
|
+
reviewerSidebar?: Component;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export interface UIConfigWithDefaults extends UIConfig {
|
|
200
|
+
terminology: Required<Terminologies>;
|
|
201
|
+
plural: Required<Terminologies>;
|
|
202
|
+
}
|
|
203
|
+
export declare class UIRegistry {
|
|
204
|
+
config: UIConfig;
|
|
205
|
+
protected promptMap: Record<string, PromptDefinition>;
|
|
206
|
+
protected requirementMap: Record<string, RequirementDefinition>;
|
|
207
|
+
protected programMap: Record<string, ProgramDefinition>;
|
|
208
|
+
protected lang: Required<Terminologies>;
|
|
209
|
+
protected plural: Required<Terminologies>;
|
|
210
|
+
constructor(config: UIConfig);
|
|
211
|
+
getWord(key: keyof Terminologies, count?: number, inclusive?: boolean): string;
|
|
212
|
+
getPlural(key: keyof Terminologies): string;
|
|
213
|
+
getPrompt(key: string): PromptDefinition | undefined;
|
|
214
|
+
getRequirement(key: string): RequirementDefinition | undefined;
|
|
215
|
+
getProgram(key: string): ProgramDefinition | undefined;
|
|
216
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { QueryGenqlSelection, Query, MutationGenqlSelection, Mutation } from './schema';
|
|
2
|
+
import { type FieldsSelection, type GraphqlOperation, type ClientOptions, GenqlError } from './runtime';
|
|
3
|
+
export type { FieldsSelection } from './runtime';
|
|
4
|
+
export { GenqlError };
|
|
5
|
+
export * from './schema';
|
|
6
|
+
export interface Client {
|
|
7
|
+
query<R extends QueryGenqlSelection>(request: R & {
|
|
8
|
+
__name?: string;
|
|
9
|
+
}): Promise<FieldsSelection<Query, R>>;
|
|
10
|
+
mutation<R extends MutationGenqlSelection>(request: R & {
|
|
11
|
+
__name?: string;
|
|
12
|
+
}): Promise<FieldsSelection<Mutation, R>>;
|
|
13
|
+
}
|
|
14
|
+
export declare const createClient: (options?: ClientOptions) => Client;
|
|
15
|
+
export declare const everything: {
|
|
16
|
+
__scalar: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type QueryResult<fields extends QueryGenqlSelection> = FieldsSelection<Query, fields>;
|
|
19
|
+
export declare const generateQueryOp: (fields: QueryGenqlSelection & {
|
|
20
|
+
__name?: string;
|
|
21
|
+
}) => GraphqlOperation;
|
|
22
|
+
export type MutationResult<fields extends MutationGenqlSelection> = FieldsSelection<Mutation, fields>;
|
|
23
|
+
export declare const generateMutationOp: (fields: MutationGenqlSelection & {
|
|
24
|
+
__name?: string;
|
|
25
|
+
}) => GraphqlOperation;
|