|
21 | 21 | let yearMin = 1800; |
22 | 22 | let yearMax = 1980; |
23 | 23 |
|
24 | | - const countryCodeTableURL = 'https://docs.google.com/spreadsheets/d/1LfmR0QLmalz_6rJT_37QjRyFggsCXXOl5e24nOuw6XI/'; |
25 | | - const portCodeTableURL = 'https://docs.google.com/spreadsheets/d/1Zhs2RUElDE96EJmXGOCogfUdukj6mpbhWwsd6e2Sb34/edit?gid=1972875230#gid=1972875230'; |
| 24 | + const countryCodeTableURL = |
| 25 | + 'https://docs.google.com/spreadsheets/d/1LfmR0QLmalz_6rJT_37QjRyFggsCXXOl5e24nOuw6XI/'; |
| 26 | + const portCodeTableURL = |
| 27 | + 'https://docs.google.com/spreadsheets/d/1Zhs2RUElDE96EJmXGOCogfUdukj6mpbhWwsd6e2Sb34/edit?gid=1972875230#gid=1972875230'; |
26 | 28 |
|
27 | 29 | $: isSearchInvalid = selectedFields.length === 0 && query.length > 0; |
28 | 30 | $: cobSelected = selectedFields.includes('fields.cob.nara'); |
|
31 | 33 |
|
32 | 34 | <div class="max-w-[75ch] py-4"> |
33 | 35 | <p class="py-2"> |
34 | | - <AFileIcon class="inline" size="20" /> <span class="font-bold">A-Files</span> are individual immigration records, each identified by a unique registration number (A-Number). They contain all the documentation of a person's interactions with immigration bureaucracies. |
| 36 | + <AFileIcon class="inline" size="20" /> <span class="font-bold">A-Files</span> are individual immigration |
| 37 | + records, each identified by a unique registration number (A-Number). They contain all the documentation |
| 38 | + of a person's interactions with immigration bureaucracies. |
35 | 39 | </p> |
36 | 40 | <p class="py-2">Read more in the <Link href="{base}/data-guide">Data Guide</Link>.</p> |
37 | 41 | </div> |
38 | 42 |
|
39 | 43 | <Form scope="afile" on:submit={handleSubmit}> |
40 | 44 | <div class="py-4 font-bold">Search Within</div> |
41 | 45 | <FormGroup legendText="Fields"> |
42 | | - <div class="flex flex-row justify-start"> |
43 | | - <div class="basis-1/3"> |
| 46 | + <div class="flex flex-row flex-wrap justify-start"> |
| 47 | + <div class="basis-full md:basis-1/3"> |
44 | 48 | <MultiSelect |
45 | 49 | name="fields" |
46 | | - label="Select fields" |
| 50 | + label="Select" |
47 | 51 | selectionFeedback="fixed" |
48 | 52 | itemToInput={(item) => ({ name: 'selectedFields', value: item.id })} |
49 | 53 | bind:selectedIds={selectedFields} |
|
52 | 56 | items={fields['afile'].filter((field) => field.search)} |
53 | 57 | /> |
54 | 58 | </div> |
55 | | - <div class="basis-2/3"> |
| 59 | + <div class="basis-full md:basis-2/3"> |
56 | 60 | <TextInput |
57 | 61 | name="query" |
58 | 62 | placeholder="Search..." |
59 | 63 | invalidText="Select 1+ fields for the search" |
60 | 64 | bind:value={query} |
61 | 65 | invalid={isSearchInvalid} |
62 | 66 | /> |
63 | | - <div class='my-2 ml-4 text-xs opacity-7'> |
| 67 | + <div class="opacity-7 my-2 ml-4 text-xs"> |
64 | 68 | {#if cobSelected} |
65 | | - * Please use the country code (see: <a target='_blank' href='{countryCodeTableURL}'>reference table</a>) to search Country of Birth (NARA).<br> |
| 69 | + * Please use the country code (see: <a target="_blank" href={countryCodeTableURL} |
| 70 | + >reference table</a |
| 71 | + >) to search Country of Birth (NARA).<br /> |
66 | 72 | {/if} |
67 | 73 | {#if poeSelected} |
68 | | - * Please use the port code (see: <a target='_blank' href='{portCodeTableURL}'>reference table</a>) to search Port of Entry (NARA). |
| 74 | + * Please use the port code (see: <a target="_blank" href={portCodeTableURL} |
| 75 | + >reference table</a |
| 76 | + >) to search Port of Entry (NARA). |
69 | 77 | {/if} |
70 | 78 | </div> |
71 | 79 | </div> |
|
76 | 84 |
|
77 | 85 | <FormGroup> |
78 | 86 | <RadioButtonGroup legendText="Sex (NARA)" name="limit_fields.sex.nara" selected="any"> |
79 | | - <RadioButton labelText="Any" value="any" /> |
80 | | - <RadioButton labelText="F" value="F" /> |
81 | | - <RadioButton labelText="M" value="M" /> |
| 87 | + <div class="flex flex-row flex-wrap justify-start gap-2"> |
| 88 | + <RadioButton labelText="Any" value="any" /> |
| 89 | + <RadioButton labelText="F" value="F" /> |
| 90 | + <RadioButton labelText="M" value="M" /> |
| 91 | + </div> |
82 | 92 | </RadioButtonGroup> |
83 | 93 | </FormGroup> |
84 | 94 |
|
85 | 95 | <FormGroup> |
86 | 96 | <RadioButtonGroup legendText="Sex (LLM)" name="limit_fields.sex.ms_sex_llm_v1" selected="any"> |
87 | | - <RadioButton labelText="Any" value="any" /> |
88 | | - <RadioButton labelText="Female" value="female" /> |
89 | | - <RadioButton labelText="Male" value="male" /> |
| 97 | + <div class="flex flex-row flex-wrap justify-start gap-2"> |
| 98 | + <RadioButton labelText="Any" value="any" /> |
| 99 | + <RadioButton labelText="Female" value="female" /> |
| 100 | + <RadioButton labelText="Male" value="male" /> |
| 101 | + </div> |
90 | 102 | </RadioButtonGroup> |
91 | 103 | </FormGroup> |
92 | 104 |
|
93 | 105 | <FormGroup disabled legendText="Page Count"> |
94 | 106 | <div class="flex justify-start py-2"> |
95 | 107 | <div class="basis-1/2"> |
96 | 108 | <NumberInput |
| 109 | + allowEmpty |
| 110 | + name="range_min.page_count" |
97 | 111 | inline |
98 | 112 | helperText="Minimum" |
99 | | - value="0" |
100 | | - min="0" |
| 113 | + min="1" |
101 | 114 | max="1000" |
102 | 115 | invalidText="Number must be between 0 and 1000." |
103 | 116 | /> |
104 | 117 | </div> |
105 | 118 | <div class="basis-1/2"> |
106 | 119 | <NumberInput |
107 | 120 | inline |
| 121 | + allowEmpty |
| 122 | + name="range_max.page_count" |
108 | 123 | helperText="Maximum" |
109 | | - value="1000" |
110 | 124 | min="0" |
111 | | - max="1000" |
| 125 | + max="2000" |
112 | 126 | invalidText="Number must be between 0 and 1000." |
113 | 127 | /> |
114 | 128 | </div> |
|
120 | 134 | <div class="basis-1/2"> |
121 | 135 | <NumberInput |
122 | 136 | inline |
| 137 | + allowEmpty |
123 | 138 | helperText="Start Year" |
124 | | - value={yearMin} |
125 | 139 | min={yearMin} |
126 | 140 | max={yearMax} |
127 | 141 | invalidText="Number must be between {yearMin} and {yearMax}." |
128 | 142 | /> |
129 | 143 | </div> |
130 | | - <div class="basis-1/2"> |
| 144 | + <div disabled class="basis-1/2"> |
131 | 145 | <NumberInput |
132 | 146 | inline |
| 147 | + allowEmpty |
133 | 148 | helperText="End Year" |
134 | | - value={yearMax} |
135 | 149 | min={yearMin} |
136 | 150 | max={yearMax} |
137 | 151 | invalidText="Number must be between {yearMin} and {yearMax}." |
|
145 | 159 | <div class="basis-1/2"> |
146 | 160 | <NumberInput |
147 | 161 | inline |
| 162 | + allowEmpty |
148 | 163 | helperText="Start Year" |
149 | | - value={yearMin} |
150 | 164 | min={yearMin} |
151 | 165 | max={yearMax} |
152 | 166 | invalidText="Number must be between {yearMin} and {yearMax}." |
|
155 | 169 | <div class="basis-1/2"> |
156 | 170 | <NumberInput |
157 | 171 | inline |
| 172 | + allowEmpty |
158 | 173 | helperText="End Year" |
159 | | - value={yearMax} |
160 | 174 | min={yearMin} |
161 | 175 | max={yearMax} |
162 | 176 | invalidText="Number must be between {yearMin} and {yearMax}." |
|
0 commit comments