@reqquest/ui 1.7.1 → 1.8.1
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/components/DelayedSkeleton.svelte +22 -0
- package/dist/components/DelayedSkeleton.svelte.d.ts +21 -0
- package/dist/components/QuestionnairePrompt.svelte +4 -4
- package/dist/components/QuestionnairePrompt.svelte.d.ts +1 -1
- package/dist/registry.d.ts +46 -2
- package/dist/typed-client/schema.d.ts +4 -2
- package/dist/typed-client/schema.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Loader } from "../registry"
|
|
3
|
+
import ApplicantPromptSkeleton from "../../internal/components/ApplicantPromptSkeleton.svelte"
|
|
4
|
+
|
|
5
|
+
export let loader: Loader
|
|
6
|
+
|
|
7
|
+
const wait = () => {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
setTimeout(resolve, typeof loader === 'boolean' ? 0 : loader?.delay ?? 0)
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
{#await wait()}
|
|
15
|
+
<!-- Nothing displayed if delayed, expecting content to load quickly -->
|
|
16
|
+
{:then}
|
|
17
|
+
{#if typeof loader === 'boolean'}
|
|
18
|
+
<ApplicantPromptSkeleton />
|
|
19
|
+
{:else}
|
|
20
|
+
<svelte:component this={loader.skeletonComponent} />
|
|
21
|
+
{/if}
|
|
22
|
+
{/await}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Loader } from "../registry";
|
|
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
|
+
declare const DelayedSkeleton: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
loader: Loader;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type DelayedSkeleton = InstanceType<typeof DelayedSkeleton>;
|
|
21
|
+
export default DelayedSkeleton;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
export let externalLinks: { url: string, label: string, target?: string, rel?: string }[] = []
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* If true, the form will take the full width of its container. If false, it will be constrained to max-w-
|
|
13
|
+
* If true, the form will take the full width of its container. If false, it will be constrained to max-w-[800px].
|
|
14
14
|
* @type {boolean}
|
|
15
15
|
*/
|
|
16
16
|
export let fullWidth = false
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
$: effectiveIntroAlignment = introTextAlignment ?? align
|
|
31
31
|
</script>
|
|
32
32
|
{#if $$slots.intro}
|
|
33
|
-
<div id="questionnaire-intro" class="prompt-intro flow max-w-
|
|
33
|
+
<div id="questionnaire-intro" class="prompt-intro flow max-w-[800px] px-px-3 sm:px-6" class:mx-auto={align === 'center'} class:text-center={effectiveIntroAlignment === 'center'} class:text-right={effectiveIntroAlignment === 'right'} style:color="var(--cds-text-02)">
|
|
34
34
|
<slot name="intro" />
|
|
35
35
|
</div>
|
|
36
36
|
{/if}
|
|
37
37
|
{#if externalLinks.length > 0}
|
|
38
|
-
<div class="prompt-intro-links flow max-w-
|
|
38
|
+
<div class="prompt-intro-links flow max-w-[800px] px-3 sm:px-6" class:mx-auto={align === 'center'}>
|
|
39
39
|
<ul class="flex gap-4 flex-wrap mb-4" class:justify-center={align === 'center'}>
|
|
40
40
|
{#each externalLinks.slice(0, 3) as link (link.url)}
|
|
41
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>
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
</div>
|
|
45
45
|
{/if}
|
|
46
46
|
|
|
47
|
-
<div class=
|
|
47
|
+
<div class={!fullWidth ? 'prompt-form flow px-3 sm:px-6 max-w-[800px]' : 'prompt-form flow px-3 sm:px-6 w-full'} class:mx-auto={align === 'center'}>
|
|
48
48
|
<slot />
|
|
49
49
|
</div>
|
|
@@ -28,7 +28,7 @@ declare const QuestionnairePrompt: $$__sveltets_2_IsomorphicComponent<$$__svelte
|
|
|
28
28
|
rel?: string;
|
|
29
29
|
}[];
|
|
30
30
|
/**
|
|
31
|
-
* If true, the form will take the full width of its container. If false, it will be constrained to max-w-
|
|
31
|
+
* If true, the form will take the full width of its container. If false, it will be constrained to max-w-[800px].
|
|
32
32
|
* @type {boolean}
|
|
33
33
|
*/ fullWidth?: boolean;
|
|
34
34
|
/**
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { LayoutStructureNode, LayoutStructureNodeRoot, UserProfile } from '@txstate-mws/carbon-svelte';
|
|
2
2
|
import type { Component } from 'svelte';
|
|
3
|
+
export interface PromptLoader {
|
|
4
|
+
skeletonComponent: Component<any>;
|
|
5
|
+
/**
|
|
6
|
+
* The number of milliseconds to wait before showing the skeleton loader. This is useful for preventing flickering when the data is fetched quickly.
|
|
7
|
+
* Since some data is can be cached, the initial load needs a skeleton loader, but after caching the data comes back quicker and no skeleton loader is needed.
|
|
8
|
+
*/
|
|
9
|
+
delay?: number;
|
|
10
|
+
}
|
|
11
|
+
export type Loader = PromptLoader | boolean;
|
|
3
12
|
export interface ProgramDefinition {
|
|
4
13
|
/**
|
|
5
14
|
* The key for the program. Allows us to match up API programs with
|
|
@@ -40,7 +49,7 @@ export interface PromptDefinition {
|
|
|
40
49
|
* by an automation. The applicant view cannot handle this, so always include
|
|
41
50
|
* a formComponent for applicant prompts.
|
|
42
51
|
*/
|
|
43
|
-
formComponent?: Component
|
|
52
|
+
formComponent?: Component<any>;
|
|
44
53
|
/**
|
|
45
54
|
* Control the size of the area the formComponent will be rendered in.
|
|
46
55
|
* - 'small' will render the form in a small area (about 8 lines or less at 320px width).
|
|
@@ -68,7 +77,7 @@ export interface PromptDefinition {
|
|
|
68
77
|
* A component that displays the data collected from this prompt instead of collecting
|
|
69
78
|
* it. Should be as compact as possible, as it will be displayed in a big list of prompts.
|
|
70
79
|
*/
|
|
71
|
-
displayComponent: Component
|
|
80
|
+
displayComponent: Component<any>;
|
|
72
81
|
/**
|
|
73
82
|
* Control the size of the area the displayComponent will be rendered in.
|
|
74
83
|
* - 'small' will render the component in a small area (about 8 lines or less at 320px width).
|
|
@@ -93,6 +102,33 @@ export interface PromptDefinition {
|
|
|
93
102
|
* An icon for the navigation.
|
|
94
103
|
*/
|
|
95
104
|
icon?: Component;
|
|
105
|
+
/**
|
|
106
|
+
* Determines if the prompt should display a skeleton loader while the data is being fetched. Defaults to false.
|
|
107
|
+
* A boolean value will result in a default skeleton loader.
|
|
108
|
+
*/
|
|
109
|
+
loader?: Loader;
|
|
110
|
+
/**
|
|
111
|
+
* This is the same applicantPromptPage CSS configurations that exist at the UIConfig (global applicant page prompt) level. Used in a situation where a specific prompt
|
|
112
|
+
* requires a specific layout that doesn't match default. This will override global configuration
|
|
113
|
+
*/
|
|
114
|
+
applicantPromptPage?: ApplicantPromptPageDefinition;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Applicant prompts are wrapped by the default CL Form component, so any styling applied within the svelte prompt
|
|
118
|
+
* is independent (does not influence) of the layout of form elements that exist as part of the CL Form (eg. Validation notices).
|
|
119
|
+
* This can result in inconsistencies in desired layouts as CL Form elements are default left aligned while prompts could expect/desire
|
|
120
|
+
* center alignment. This property allows the developer to set the global prompt page Form CSS class variable. This can be overwritten at the
|
|
121
|
+
* individual prompt level if specific prompts desire specific layouts. This definition is used for defining those elements if required
|
|
122
|
+
*/
|
|
123
|
+
export interface ApplicantPromptPageDefinition {
|
|
124
|
+
/**
|
|
125
|
+
* CSS class settings specific to the Form component that wraps the prompt
|
|
126
|
+
*/
|
|
127
|
+
formClass?: string;
|
|
128
|
+
/**
|
|
129
|
+
* CSS class settings specific to the corrections inline notification within the Form
|
|
130
|
+
*/
|
|
131
|
+
invalidatedInlineNotificationClass?: string;
|
|
96
132
|
}
|
|
97
133
|
export interface Terminologies {
|
|
98
134
|
/**
|
|
@@ -146,6 +182,14 @@ export interface UIConfig {
|
|
|
146
182
|
* Defaults to 30 if not specified.
|
|
147
183
|
*/
|
|
148
184
|
applicantDashboardRecentDays?: number;
|
|
185
|
+
/**
|
|
186
|
+
* Applicant prompts are wrapped by the default CL Form component, so any styling applied within the svelte prompt
|
|
187
|
+
* is independent (does not influence) of the layout of form elements that exist as part of the CL Form (eg. Validation notices).
|
|
188
|
+
* This can result in inconsistencies in desired layouts as CL Form elements are default left aligned while prompts could expect/desire
|
|
189
|
+
* center alignment. This property allows the developer to set the global prompt page Form CSS class variable. This can be overwritten at the
|
|
190
|
+
* individual prompt level if specific prompts desire specific layouts
|
|
191
|
+
*/
|
|
192
|
+
applicantPromptPage?: ApplicantPromptPageDefinition;
|
|
149
193
|
/**
|
|
150
194
|
* Applicant Review submission page title and subtitle text.
|
|
151
195
|
*/
|
|
@@ -271,7 +271,7 @@ export type AppRequestPhase = 'ACCEPTANCE' | 'COMPLETE' | 'STARTED' | 'SUBMITTED
|
|
|
271
271
|
* the database and the status of each application.
|
|
272
272
|
*
|
|
273
273
|
*/
|
|
274
|
-
export type AppRequestStatus = 'ACCEPTANCE' | 'ACCEPTED' | 'APPROVAL' | 'APPROVED' | 'CANCELLED' | 'DISQUALIFIED' | 'NOT_ACCEPTED' | 'NOT_APPROVED' | 'PREAPPROVAL' | 'READY_TO_ACCEPT' | 'READY_TO_SUBMIT' | 'REVIEW_COMPLETE' | 'STARTED' | 'WITHDRAWN';
|
|
274
|
+
export type AppRequestStatus = 'ACCEPTANCE' | 'ACCEPTED' | 'APPROVAL' | 'APPROVED' | 'CANCELLED' | 'DISQUALIFIED' | 'NOT_ACCEPTED' | 'NOT_APPROVED' | 'PREAPPROVAL' | 'READY_TO_ACCEPT' | 'READY_TO_SUBMIT' | 'REVIEW_IN_PROGRESS' | 'REVIEW_COMPLETE' | 'STARTED' | 'WITHDRAWN';
|
|
275
275
|
/** An application represents the applicant applying to a specific program. Each appRequest has multiple applications - one per program defined in the system. Some applications are mutually exclusive and/or will be eliminated early based on PREQUAL requirements, but they all technically exist in the data model - there is no concept of picking one application over another, just two applications where one dies and the other survives. */
|
|
276
276
|
export interface Application {
|
|
277
277
|
actions: ApplicationActions;
|
|
@@ -353,7 +353,7 @@ export interface ApplicationMetricTiming {
|
|
|
353
353
|
* is computed based on the status of the appRequest and of the requirements for the program.
|
|
354
354
|
*
|
|
355
355
|
*/
|
|
356
|
-
export type ApplicationPhase = 'ACCEPTANCE' | 'APPROVAL' | 'COMPLETE' | 'PREAPPROVAL' | 'PREQUAL' | 'QUALIFICATION' | 'READY_FOR_WORKFLOW' | 'READY_TO_ACCEPT' | 'READY_TO_COMPLETE' | 'READY_TO_SUBMIT' | 'REVIEW_COMPLETE' | 'WORKFLOW_BLOCKING' | 'WORKFLOW_NONBLOCKING';
|
|
356
|
+
export type ApplicationPhase = 'ACCEPTANCE' | 'APPROVAL' | 'COMPLETE' | 'PREAPPROVAL' | 'PREQUAL' | 'QUALIFICATION' | 'READY_FOR_WORKFLOW' | 'READY_TO_ACCEPT' | 'READY_TO_COMPLETE' | 'READY_TO_SUBMIT' | 'REVIEW_COMPLETE' | 'REVIEW_IN_PROGRESS' | 'WORKFLOW_BLOCKING' | 'WORKFLOW_NONBLOCKING';
|
|
357
357
|
/** The specific instance of a requirement on a particular application. Stores the status of the requirement, e.g. being satisfied or not. */
|
|
358
358
|
export interface ApplicationRequirement {
|
|
359
359
|
application: Application;
|
|
@@ -2193,6 +2193,7 @@ export declare const enumAppRequestStatus: {
|
|
|
2193
2193
|
READY_TO_ACCEPT: "READY_TO_ACCEPT";
|
|
2194
2194
|
READY_TO_SUBMIT: "READY_TO_SUBMIT";
|
|
2195
2195
|
REVIEW_COMPLETE: "REVIEW_COMPLETE";
|
|
2196
|
+
REVIEW_IN_PROGRESS: "REVIEW_IN_PROGRESS";
|
|
2196
2197
|
STARTED: "STARTED";
|
|
2197
2198
|
WITHDRAWN: "WITHDRAWN";
|
|
2198
2199
|
};
|
|
@@ -2208,6 +2209,7 @@ export declare const enumApplicationPhase: {
|
|
|
2208
2209
|
READY_TO_COMPLETE: "READY_TO_COMPLETE";
|
|
2209
2210
|
READY_TO_SUBMIT: "READY_TO_SUBMIT";
|
|
2210
2211
|
REVIEW_COMPLETE: "REVIEW_COMPLETE";
|
|
2212
|
+
REVIEW_IN_PROGRESS: "REVIEW_IN_PROGRESS";
|
|
2211
2213
|
WORKFLOW_BLOCKING: "WORKFLOW_BLOCKING";
|
|
2212
2214
|
WORKFLOW_NONBLOCKING: "WORKFLOW_NONBLOCKING";
|
|
2213
2215
|
};
|
|
@@ -346,6 +346,7 @@ export const enumAppRequestStatus = {
|
|
|
346
346
|
READY_TO_ACCEPT: 'READY_TO_ACCEPT',
|
|
347
347
|
READY_TO_SUBMIT: 'READY_TO_SUBMIT',
|
|
348
348
|
REVIEW_COMPLETE: 'REVIEW_COMPLETE',
|
|
349
|
+
REVIEW_IN_PROGRESS: 'REVIEW_IN_PROGRESS',
|
|
349
350
|
STARTED: 'STARTED',
|
|
350
351
|
WITHDRAWN: 'WITHDRAWN'
|
|
351
352
|
};
|
|
@@ -361,6 +362,7 @@ export const enumApplicationPhase = {
|
|
|
361
362
|
READY_TO_COMPLETE: 'READY_TO_COMPLETE',
|
|
362
363
|
READY_TO_SUBMIT: 'READY_TO_SUBMIT',
|
|
363
364
|
REVIEW_COMPLETE: 'REVIEW_COMPLETE',
|
|
365
|
+
REVIEW_IN_PROGRESS: 'REVIEW_IN_PROGRESS',
|
|
364
366
|
WORKFLOW_BLOCKING: 'WORKFLOW_BLOCKING',
|
|
365
367
|
WORKFLOW_NONBLOCKING: 'WORKFLOW_NONBLOCKING'
|
|
366
368
|
};
|