@onsvisual/svelte-components 1.1.24 → 1.1.26

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.
@@ -37,7 +37,7 @@
37
37
  export let small = false;
38
38
  /**
39
39
  * Icon on button, eg. "arrow", "search"
40
- * @type {"arrow"|"carret"|"chevron"|"code"|"cog"|"copy"|"cross"|"download"|"expand"|"external"|"pin"|"print"|"search"|"shrink"|"signout"|"tick"|null}
40
+ * @type {"arrow"|"carret"|"chevron"|"code"|"cog"|"copy"|"cross"|"download"|"expand"|"external"|"pin"|"print"|"search"|"shrink"|"signout"|"tick"|"upload"|null}
41
41
  */
42
42
  export let icon = null;
43
43
  /**
@@ -9,7 +9,7 @@ export default class Button extends SvelteComponentTyped<{
9
9
  type?: "button" | "reset" | "submit" | undefined;
10
10
  variant?: "primary" | "secondary" | "ghost" | undefined;
11
11
  noScroll?: boolean | undefined;
12
- icon?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | null | undefined;
12
+ icon?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | "upload" | null | undefined;
13
13
  iconPosition?: "before" | "after" | undefined;
14
14
  iconRotation?: number | undefined;
15
15
  disabled?: boolean | undefined;
@@ -38,7 +38,7 @@ declare const __propDef: {
38
38
  type?: "button" | "reset" | "submit" | undefined;
39
39
  variant?: "primary" | "secondary" | "ghost" | undefined;
40
40
  noScroll?: boolean | undefined;
41
- icon?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | null | undefined;
41
+ icon?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | "upload" | null | undefined;
42
42
  iconPosition?: "before" | "after" | undefined;
43
43
  iconRotation?: number | undefined;
44
44
  disabled?: boolean | undefined;
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  /**
3
3
  * Set the type of icon
4
- * @type {"arrow"|"carret"|"chevron"|"code"|"cog"|"copy"|"cross"|"download"|"expand"|"external"|"pin"|"print"|"search"|"shrink"|"signout"|"tick"}
4
+ * @type {"arrow"|"carret"|"chevron"|"code"|"cog"|"copy"|"cross"|"download"|"expand"|"external"|"pin"|"print"|"search"|"shrink"|"signout"|"tick"|"upload"}
5
5
  */
6
6
  export let type = "arrow";
7
7
  /**
@@ -99,6 +99,10 @@
99
99
  tick: {
100
100
  d: "M14.35,3.9l-.71-.71a.5.5,0,0,0-.71,0h0L5.79,10.34,3.07,7.61a.51.51,0,0,0-.71,0l-.71.71a.51.51,0,0,0,0,.71l3.78,3.78a.5.5,0,0,0,.71,0h0L14.35,4.6A.5.5,0,0,0,14.35,3.9Z",
101
101
  viewBox: "1.5 3 13 10"
102
+ },
103
+ upload: {
104
+ d: "M6.35.15c-.18-.19-.49-.2-.68-.02,0,0-.01.01-.02.02l-3,3.2c-.19.18-.2.49-.02.68,0,0,.01.01.02.02,0,.1.1.1.3.1h1.5v4.5c-.02.26.18.48.44.5.02,0,.04,0,.06,0h2c.26.02.48-.18.5-.44,0-.02,0-.04,0-.06v-4.5h1.5c.26.02.48-.18.5-.44,0-.02,0-.04,0-.06.01-.11-.02-.22-.1-.3L6.35.15ZM11.5,9h-.5c-.26-.02-.48.18-.5.44,0,.02,0,.04,0,.06v1H1.5v-1c.02-.26-.18-.48-.44-.5-.02,0-.04,0-.06,0h-.5C.24,8.98.02,9.18,0,9.44c0,.02,0,.04,0,.06v2c-.02.26.18.48.44.5.02,0,.04,0,.06,0h11c.26.02.48-.18.5-.44,0-.02,0-.04,0-.06v-2c.02-.26-.18-.48-.44-.5-.02,0-.04,0-.06,0Z",
105
+ viewBox: "0 0 12 12"
102
106
  }
103
107
  };
104
108
  </script>
@@ -2,7 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} IconEvents */
3
3
  /** @typedef {typeof __propDef.slots} IconSlots */
4
4
  export default class Icon extends SvelteComponentTyped<{
5
- type?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | undefined;
5
+ type?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | "upload" | undefined;
6
6
  size?: "s" | "m" | "l" | "xl" | "2xl" | "3xl" | null | undefined;
7
7
  rotation?: number | undefined;
8
8
  svgPath?: string | null | undefined;
@@ -19,7 +19,7 @@ export type IconSlots = typeof __propDef.slots;
19
19
  import { SvelteComponentTyped } from "svelte";
20
20
  declare const __propDef: {
21
21
  props: {
22
- type?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | undefined;
22
+ type?: "code" | "search" | "copy" | "arrow" | "carret" | "chevron" | "cog" | "cross" | "download" | "expand" | "external" | "pin" | "print" | "shrink" | "signout" | "tick" | "upload" | undefined;
23
23
  size?: "s" | "m" | "l" | "xl" | "2xl" | "3xl" | null | undefined;
24
24
  rotation?: number | undefined;
25
25
  svgPath?: string | null | undefined;
@@ -128,7 +128,7 @@
128
128
  }
129
129
 
130
130
  function inputValueTemplate(result) {
131
- return result && result[labelKey];
131
+ return result?.[labelKey] || result || "";
132
132
  }
133
133
 
134
134
  function highlight(text, query = "") {
@@ -140,11 +140,11 @@
140
140
 
141
141
  function suggestionTemplate(result) {
142
142
  const query = inputElement?.value || "";
143
- return groupKey && result[groupKey]
143
+ return groupKey && result?.[groupKey]
144
144
  ? `${highlight(result?.[labelKey] || "", query)} <span class="muted-text">${
145
145
  result[groupKey]
146
146
  }</span>`
147
- : highlight(result?.[labelKey] || "", query);
147
+ : highlight(result?.[labelKey] || result || "", query);
148
148
  }
149
149
 
150
150
  async function select(option) {
@@ -170,7 +170,7 @@
170
170
  element,
171
171
  id,
172
172
  name,
173
- defaultValue: value?.[labelKey] || undefined,
173
+ defaultValue: value?.[labelKey] || value || undefined,
174
174
  source: loadOptions,
175
175
  autoselect: true,
176
176
  onConfirm: select,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "1.1.24",
3
+ "version": "1.1.26",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "npm run build:package && npm run build:docs",