-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/select): hide clear button on disabled and readonly (#1574)
Co-authored-by: Lukas Maurer <[email protected]>
- Loading branch information
1 parent
5ca2446
commit 57586a7
Showing
4 changed files
with
119 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@siemens/ix': patch | ||
--- | ||
|
||
Hide clear button in ix-select for disabled and readonly states. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
import type { Components } from '@siemens/ix/components'; | ||
import type { ArgTypes, Meta, StoryObj } from '@storybook/web-components'; | ||
import { genericRender, makeArgTypes } from './utils/generic-render'; | ||
import { html } from 'lit'; | ||
|
||
type Element = Components.IxSelect; | ||
|
||
const meta = { | ||
title: 'Example/Select', | ||
tags: [], | ||
render: (args) => genericRender('ix-select', args), | ||
argTypes: makeArgTypes<Partial<ArgTypes<Element>>>('ix-select'), | ||
parameters: { | ||
design: { | ||
type: 'figma', | ||
url: 'https://www.figma.com/design/r2nqdNNXXZtPmWuVjIlM1Q/iX-Components---Brand-Dark?node-id=42365-175539&m=dev', | ||
}, | ||
}, | ||
} satisfies Meta<Element>; | ||
|
||
export default meta; | ||
type Story = StoryObj<Element>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const editableSelect: Story = { | ||
render: ({ value, editable, allowClear, disabled }) => { | ||
return html` <ix-select | ||
value=${value} | ||
?editable=${editable} | ||
?allow-clear=${allowClear} | ||
disabled=${disabled} | ||
> | ||
<ix-select-item label="Item 1" value="1"></ix-select-item> | ||
<ix-select-item label="Item 2" value="2"></ix-select-item> | ||
<ix-select-item label="Item 3" value="3"></ix-select-item> | ||
<ix-select-item label="Item 4" value="4"></ix-select-item> | ||
</ix-select>`; | ||
}, | ||
args: { | ||
value: 'Administrator', | ||
editable: true, | ||
allowClear: true, | ||
disabled: false, | ||
}, | ||
}; |