@onsvisual/svelte-components 0.1.56 → 0.1.58

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.
@@ -19,6 +19,7 @@ export default class Select extends SvelteComponentTyped<{
19
19
  labelKey?: string;
20
20
  groupKey?: string;
21
21
  clusterByGroup?: boolean;
22
+ hideIcon?: boolean;
22
23
  colors?: any[];
23
24
  itemFilter?: Function;
24
25
  loadOptions?: Function;
@@ -56,6 +57,7 @@ declare const __propDef: {
56
57
  labelKey?: string;
57
58
  groupKey?: string | null;
58
59
  clusterByGroup?: boolean;
60
+ hideIcon?: boolean;
59
61
  colors?: any[];
60
62
  itemFilter?: Function;
61
63
  loadOptions?: Function;
@@ -4,6 +4,7 @@
4
4
  export default class ErrorPage extends SvelteComponentTyped<{
5
5
  page?: any;
6
6
  status?: number;
7
+ message?: string;
7
8
  }, {
8
9
  [evt: string]: CustomEvent<any>;
9
10
  }, {}> {
@@ -16,6 +17,7 @@ declare const __propDef: {
16
17
  props: {
17
18
  page?: any;
18
19
  status?: number;
20
+ message?: string;
19
21
  };
20
22
  events: {
21
23
  [evt: string]: CustomEvent<any>;
@@ -88,6 +88,11 @@
88
88
  * @type {number}
89
89
  */
90
90
  export let width = 30;
91
+ /**
92
+ * Hide the icon in the search box
93
+ * @type {boolean}
94
+ */
95
+ export let hideIcon = false;
91
96
  /**
92
97
  * An array of colours for multi-select
93
98
  * @type {array}
@@ -159,7 +164,7 @@
159
164
  itemId="{idKey}"
160
165
  label="{labelKey}"
161
166
  groupBy="{groupKey && clusterByGroup ? (item) => item[groupKey] : null}"
162
- showChevron="{true}"
167
+ showChevron="{!hideIcon}"
163
168
  multiple="{multiple}"
164
169
  clearable="{clearable}"
165
170
  on:change="{handleChange}"
@@ -8,7 +8,12 @@
8
8
  * (Optional) Explicitly pass a page status number, eg. 404 or 500.
9
9
  * @type {number}
10
10
  */
11
- export let status = $page ? $page.status : null;
11
+ export let status = $page ? $page?.status : null;
12
+ /**
13
+ * (Optional) Explicitly pass a page status message.
14
+ * @type {string}
15
+ */
16
+ export let message = $page ? $page?.error?.message : "";
12
17
  </script>
13
18
 
14
19
  <div class="ons-page__container ons-container">
@@ -16,20 +21,19 @@
16
21
  <div class="ons-grid__col ons-col-12@m">
17
22
  <main id="main-content" class="ons-page__main">
18
23
  {#if status === 404}
19
- <h1>Page not found</h1>
24
+ <h1>{message || "Page not found"}</h1>
20
25
  <p>If you entered a web address, check it is correct.</p>
21
26
  <p>If you pasted the web address, check you copied the whole address.</p>
22
27
  <p>
23
- If the web address is correct or you selected a link or button, <a href="/feedback"
24
- >contact us</a
28
+ If the web address is correct or you selected a link or button, <a
29
+ href="https://www.ons.gov.uk/feedback">contact us</a
25
30
  > for more help.
26
31
  </p>
27
32
  {:else}
28
- <h1>Sorry, there is a problem with the service</h1>
29
- <p>Try again later.</p>
33
+ <h1>{message || "Sorry, there is a problem with the service"}</h1>
30
34
  <p>
31
- If you continue to experience problems with this service, please <a href="/feedback"
32
- >contact us</a
35
+ If you continue to experience problems with this service, please <a
36
+ href="https://www.ons.gov.uk/feedback">contact us</a
33
37
  >.
34
38
  </p>
35
39
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",