Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking: Move $$restProps in Select from wrapper <div> to <select> #1807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions COMPONENT_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -1580,8 +1580,8 @@ None.
| expandedByDefault | No | <code>let</code> | No | <code>boolean</code> | <code>true</code> | Set to `false` to hide the side nav by default |
| uiShellAriaLabel | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the ARIA label for the header |
| href | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the `href` attribute |
| company | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the company name. <br />Alternatively, use the named slot "company" (e.g., `&lt;span slot="company"&gt;...&lt;/span&gt;`) |
| platformName | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the platform name.<br />Alternatively, use the named slot "platform" (e.g., `&lt;span slot="platform"&gt;...&lt;/span&gt;`) |
| company | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the company name.<br /><br />Alternatively, use the named slot "company" (e.g., `&lt;span slot="company"&gt;...&lt;/span&gt;`) |
| platformName | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the platform name.<br /><br />Alternatively, use the named slot "platform" (e.g., `&lt;span slot="platform"&gt;...&lt;/span&gt;`) |
| persistentHamburgerMenu | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to persist the hamburger menu |
| expansionBreakpoint | No | <code>let</code> | No | <code>number</code> | <code>1056</code> | The window width (px) at which the SideNav is expanded and the hamburger menu is hidden.<br />1056 represents the "large" breakpoint in pixels from the Carbon Design System:<br />- small: 320<br />- medium: 672<br />- large: 1056<br />- x-large: 1312<br />- max: 1584 |
| iconMenu | No | <code>let</code> | No | <code>typeof import("svelte").SvelteComponent<any></code> | <code>undefined</code> | Specify the icon to render for the closed state.<br />Defaults to `&lt;Menu size={20} /&gt;` |
Expand Down
6 changes: 3 additions & 3 deletions docs/src/COMPONENT_API.json
Original file line number Diff line number Diff line change
Expand Up @@ -4788,7 +4788,7 @@
{
"name": "company",
"kind": "let",
"description": "Specify the company name. \nAlternatively, use the named slot \"company\" (e.g., `<span slot=\"company\">...</span>`)",
"description": "Specify the company name.\n\nAlternatively, use the named slot \"company\" (e.g., `<span slot=\"company\">...</span>`)",
"type": "string",
"isFunction": false,
"isFunctionDeclaration": false,
Expand All @@ -4799,7 +4799,7 @@
{
"name": "platformName",
"kind": "let",
"description": "Specify the platform name.\nAlternatively, use the named slot \"platform\" (e.g., `<span slot=\"platform\">...</span>`)",
"description": "Specify the platform name.\n\nAlternatively, use the named slot \"platform\" (e.g., `<span slot=\"platform\">...</span>`)",
"type": "string",
"value": "\"\"",
"isFunction": false,
Expand Down Expand Up @@ -10367,7 +10367,7 @@
{ "type": "forwarded", "name": "blur", "element": "select" }
],
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
"rest_props": { "type": "Element", "name": "select" }
},
{
"moduleName": "SelectItem",
Expand Down
6 changes: 3 additions & 3 deletions src/ComboBox/ComboBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@
class:bx--label="{true}"
class:bx--label--disabled="{disabled}"
>
<slot name="titleText">
{titleText}
</slot>
<slot name="titleText">
{titleText}
</slot>
</label>
{/if}
<ListBox
Expand Down
6 changes: 3 additions & 3 deletions src/MultiSelect/MultiSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@
class:bx--label--disabled="{disabled}"
class:bx--visually-hidden="{hideLabel}"
>
<slot name="titleText">
{titleText}
</slot>
<slot name="titleText">
{titleText}
</slot>
</label>
{/if}
<ListBox
Expand Down
4 changes: 3 additions & 1 deletion src/Select/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
$: selectedValue.set(selected ?? $defaultValue);
</script>

<div class:bx--form-item="{true}" {...$$restProps}>
<div class:bx--form-item="{true}">
<div
class:bx--select="{true}"
class:bx--select--inline="{inline}"
Expand Down Expand Up @@ -162,6 +162,7 @@
class:bx--select-input="{true}"
class:bx--select-input--sm="{size === 'sm'}"
class:bx--select-input--xl="{size === 'xl'}"
{...$$restProps}
on:change="{handleChange}"
on:change
on:input
Expand Down Expand Up @@ -206,6 +207,7 @@
class:bx--select-input="{true}"
class:bx--select-input--sm="{size === 'sm'}"
class:bx--select-input--xl="{size === 'xl'}"
{...$$restProps}
on:change="{handleChange}"
on:change
on:input
Expand Down
6 changes: 4 additions & 2 deletions src/UIShell/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
*/
export let href = undefined;

/**
* Specify the company name.
/**
* Specify the company name.
*
* Alternatively, use the named slot "company" (e.g., `<span slot="company">...</span>`)
* @type {string}
*/
export let company = undefined;

/**
* Specify the platform name.
*
* Alternatively, use the named slot "platform" (e.g., `<span slot="platform">...</span>`)
*/
export let platformName = "";
Expand Down
2 changes: 1 addition & 1 deletion types/Select/Select.svelte.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";

type RestProps = SvelteHTMLElements["div"];
type RestProps = SvelteHTMLElements["select"];

export interface SelectProps extends RestProps {
/**
Expand Down
2 changes: 2 additions & 0 deletions types/UIShell/Header.svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ export interface HeaderProps extends RestProps {

/**
* Specify the company name.
*
* Alternatively, use the named slot "company" (e.g., `<span slot="company">...</span>`)
* @default undefined
*/
company?: string;

/**
* Specify the platform name.
*
* Alternatively, use the named slot "platform" (e.g., `<span slot="platform">...</span>`)
* @default ""
*/
Expand Down