carbon-components-svelte 0.106.0 → 0.106.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-components-svelte",
3
- "version": "0.106.0",
3
+ "version": "0.106.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Svelte implementation of the Carbon Design System",
6
6
  "type": "module",
@@ -91,7 +91,10 @@
91
91
  */
92
92
  export let href = undefined;
93
93
 
94
- /** Specify the tabindex */
94
+ /**
95
+ * Specify the tabindex
96
+ * @type {number | string | undefined}
97
+ */
95
98
  export let tabindex = "0";
96
99
 
97
100
  /** Specify the `type` attribute for the button element */
@@ -113,7 +113,7 @@ type $Props<Icon = any> = {
113
113
  * Specify the tabindex
114
114
  * @default "0"
115
115
  */
116
- tabindex?: string;
116
+ tabindex?: number | string | undefined;
117
117
 
118
118
  /**
119
119
  * Specify the `type` attribute for the button element
@@ -1,6 +1,4 @@
1
1
  <script>
2
- /** @extends {"./DataTable.svelte"} DataTableHeader */
3
-
4
2
  /**
5
3
  * Specify the number of columns.
6
4
  * Superseded by `headers` if `headers` is a non-empty array.
@@ -25,7 +23,7 @@
25
23
  /**
26
24
  * Set the column headers.
27
25
  * Supersedes `columns` if value is a non-empty array.
28
- * @type {ReadonlyArray<string | Partial<DataTableHeader>>}
26
+ * @type {ReadonlyArray<string | Partial<import('./DataTable.svelte').DataTableHeader>>}
29
27
  */
30
28
  export let headers = [];
31
29
 
@@ -1,6 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { SvelteHTMLElements } from "svelte/elements";
3
- import type { DataTableHeader } from "./DataTable.svelte";
4
3
 
5
4
  type $RestProps = SvelteHTMLElements["div"];
6
5
 
@@ -41,7 +40,9 @@ type $Props = {
41
40
  * Supersedes `columns` if value is a non-empty array.
42
41
  * @default []
43
42
  */
44
- headers?: ReadonlyArray<string | Partial<DataTableHeader>>;
43
+ headers?: ReadonlyArray<
44
+ string | Partial<import("./DataTable.svelte").DataTableHeader>
45
+ >;
45
46
 
46
47
  /**
47
48
  * Set to `false` to hide the toolbar
@@ -52,12 +53,7 @@ type $Props = {
52
53
  [key: `data-${string}`]: unknown;
53
54
  };
54
55
 
55
- export type DataTableSkeletonProps = Omit<
56
- $RestProps,
57
- keyof ($Props & DataTableHeader)
58
- > &
59
- $Props &
60
- DataTableHeader;
56
+ export type DataTableSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
61
57
 
62
58
  export default class DataTableSkeleton extends SvelteComponentTyped<
63
59
  DataTableSkeletonProps,
@@ -38,7 +38,10 @@
38
38
  */
39
39
  export let filteredRowIds = [];
40
40
 
41
- /** Specify the tabindex */
41
+ /**
42
+ * Specify the tabindex
43
+ * @type {number | string | undefined}
44
+ */
42
45
  export let tabindex = "0";
43
46
 
44
47
  /**
@@ -53,7 +53,7 @@ type $Props<
53
53
  * Specify the tabindex
54
54
  * @default "0"
55
55
  */
56
- tabindex?: string;
56
+ tabindex?: number | string | undefined;
57
57
 
58
58
  /**
59
59
  * Obtain a reference to the input HTML element.
@@ -35,7 +35,10 @@
35
35
  /** Set to `true` to disable the input */
36
36
  export let disabled = false;
37
37
 
38
- /** Specify `tabindex` attribute */
38
+ /**
39
+ * Specify `tabindex` attribute
40
+ * @type {number | string | undefined}
41
+ */
39
42
  export let tabindex = "0";
40
43
 
41
44
  /** Set an id for the input element */
@@ -50,7 +50,7 @@ type $Props = {
50
50
  * Specify `tabindex` attribute
51
51
  * @default "0"
52
52
  */
53
- tabindex?: string;
53
+ tabindex?: number | string | undefined;
54
54
 
55
55
  /**
56
56
  * Set an id for the input element
@@ -9,7 +9,10 @@
9
9
  /** Specify the role attribute */
10
10
  export let role = "combobox";
11
11
 
12
- /** Specify the tabindex */
12
+ /**
13
+ * Specify the tabindex
14
+ * @type {number | string | undefined}
15
+ */
13
16
  export let tabindex = "-1";
14
17
 
15
18
  /** Default translation ids */
@@ -22,7 +22,7 @@ type $Props = {
22
22
  * Specify the tabindex
23
23
  * @default "-1"
24
24
  */
25
- tabindex?: string;
25
+ tabindex?: number | string | undefined;
26
26
 
27
27
  /**
28
28
  * Override the default translation ids.
@@ -115,12 +115,13 @@
115
115
  selectedValue.set(value);
116
116
  };
117
117
 
118
- let prevSelected = undefined;
118
+ let prevSelected = null;
119
119
 
120
120
  afterUpdate(() => {
121
121
  if (selected !== $selectedValue) {
122
+ const isInitialRender = prevSelected === null;
122
123
  selected = $selectedValue;
123
- if (prevSelected !== undefined) {
124
+ if (!isInitialRender) {
124
125
  dispatch("update", $selectedValue);
125
126
  }
126
127
  }
@@ -5,7 +5,10 @@
5
5
  /** Set to `true` to render a label slot */
6
6
  export let label = false;
7
7
 
8
- /** Specify the tabindex */
8
+ /**
9
+ * Specify the tabindex
10
+ * @type {number | string | undefined}
11
+ */
9
12
  export let tabindex = "0";
10
13
  </script>
11
14
 
@@ -20,7 +20,7 @@ type $Props = {
20
20
  * Specify the tabindex
21
21
  * @default "0"
22
22
  */
23
- tabindex?: string;
23
+ tabindex?: number | string | undefined;
24
24
 
25
25
  children?: (this: void) => void;
26
26
 
@@ -21,7 +21,10 @@
21
21
  /** Set to `true` to disable the tab */
22
22
  export let disabled = false;
23
23
 
24
- /** Specify the tabindex */
24
+ /**
25
+ * Specify the tabindex
26
+ * @type {number | string | undefined}
27
+ */
25
28
  export let tabindex = "0";
26
29
 
27
30
  /** Set an id for the top-level element */
@@ -33,7 +33,7 @@ type $Props<Icon = any> = {
33
33
  * Specify the tabindex
34
34
  * @default "0"
35
35
  */
36
- tabindex?: string;
36
+ tabindex?: number | string | undefined;
37
37
 
38
38
  /**
39
39
  * Set an id for the top-level element
@@ -23,7 +23,10 @@
23
23
  /** Specify the icon label of the collapsed tile */
24
24
  export let tileCollapsedLabel = "";
25
25
 
26
- /** Specify the tabindex */
26
+ /**
27
+ * Specify the tabindex
28
+ * @type {number | string | undefined}
29
+ */
27
30
  export let tabindex = "0";
28
31
 
29
32
  /** Set an id for the top-level div element */
@@ -56,7 +56,7 @@ type $Props = {
56
56
  * Specify the tabindex
57
57
  * @default "0"
58
58
  */
59
- tabindex?: string;
59
+ tabindex?: number | string | undefined;
60
60
 
61
61
  /**
62
62
  * Set an id for the top-level div element
@@ -22,7 +22,10 @@
22
22
  */
23
23
  export let value = "";
24
24
 
25
- /** Specify the tabindex */
25
+ /**
26
+ * Specify the tabindex
27
+ * @type {number | string | undefined}
28
+ */
26
29
  export let tabindex = "0";
27
30
 
28
31
  /** Specify the ARIA label for the radio tile checkmark icon */
@@ -38,7 +38,7 @@ type $Props<Value extends string = string> = {
38
38
  * Specify the tabindex
39
39
  * @default "0"
40
40
  */
41
- tabindex?: string;
41
+ tabindex?: number | string | undefined;
42
42
 
43
43
  /**
44
44
  * Specify the ARIA label for the radio tile checkmark icon
@@ -19,7 +19,10 @@
19
19
  /** Specify the value of the selectable tile */
20
20
  export let value = "value";
21
21
 
22
- /** Specify the tabindex */
22
+ /**
23
+ * Specify the tabindex
24
+ * @type {number | string | undefined}
25
+ */
23
26
  export let tabindex = "0";
24
27
 
25
28
  /** Specify the ARIA label for the selectable tile checkmark icon */
@@ -38,7 +38,7 @@ type $Props = {
38
38
  * Specify the tabindex
39
39
  * @default "0"
40
40
  */
41
- tabindex?: string;
41
+ tabindex?: number | string | undefined;
42
42
 
43
43
  /**
44
44
  * Specify the ARIA label for the selectable tile checkmark icon
@@ -42,7 +42,10 @@
42
42
  /** Specify the icon name attribute */
43
43
  export let iconName = "";
44
44
 
45
- /** Set the button tabindex */
45
+ /**
46
+ * Set the button tabindex
47
+ * @type {number | string | undefined}
48
+ */
46
49
  export let tabindex = "0";
47
50
 
48
51
  /**
@@ -55,7 +55,7 @@ type $Props<Icon = any> = {
55
55
  * Set the button tabindex
56
56
  * @default "0"
57
57
  */
58
- tabindex?: string;
58
+ tabindex?: number | string | undefined;
59
59
 
60
60
  /**
61
61
  * Set an id for the tooltip.
@@ -2,7 +2,10 @@
2
2
  /** Specify the `href` attribute */
3
3
  export let href = "#main-content";
4
4
 
5
- /** Specify the tabindex */
5
+ /**
6
+ * Specify the tabindex
7
+ * @type {number | string | undefined}
8
+ */
6
9
  export let tabindex = "0";
7
10
  </script>
8
11
 
@@ -14,7 +14,7 @@ type $Props = {
14
14
  * Specify the tabindex
15
15
  * @default "0"
16
16
  */
17
- tabindex?: string;
17
+ tabindex?: number | string | undefined;
18
18
 
19
19
  children?: (this: void) => void;
20
20