+
Skip to content
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
15 changes: 15 additions & 0 deletions .changeset/cyan-baths-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@crowdstrike/glide-core': minor
---

Our Form Controls Layout component has been removed. To replace Form Controls Layout, a `split` attribute has been added to Checkbox, Checkbox Group, Dropdown, Input, Radio Group, Slider, and Textarea.

The value of each component's `split` attribute matches that of Form Controls Layout: `split` can be `'left"`, `'middle'`, `'right'`, or undefined. You'll need to set `split` on each component in your form—which isn't as convenient. But it does allow form controls to be laid out independent of Form Controls Layout and of each other if desired.

The impetus for these changes is to prepare for Dropdown moving out of Glide Core:

For components to participate in Form Controls Layout, they previously exposed a `privateSplit` property that Form Controls Layout set. When Dropdown is moved out of Glide Core, its contract with Form Controls Layout will no longer be guaranteed.

So Dropdown won't be able to participate in Form Controls Layout, and Form Controls Layout would work with every Glide form control component except Dropdown—leaving Dropdown consumers to manually set `split` on Dropdown.

Rather than oddly have some components that work with Form Controls Layout and some that don't, we decided to remove Form Controls Layout and instead expose `split` on each component.
46 changes: 0 additions & 46 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,52 +140,6 @@ export default {
$component.removeAttribute('style');
}

if (context.componentId === 'form-controls-layout') {
const hasValueChanged =
context.args['<glide-core-dropdown>.value'].toString() !==
context.initialArgs['<glide-core-dropdown>.value'].toString();

if (hasValueChanged) {
$component
.querySelector('glide-core-dropdown')
.setAttribute(
'value',
JSON.stringify(context.args['<glide-core-dropdown>.value']),
);
}

const isCheckboxGroupValueChanged =
context.args['<glide-core-checkbox-group>.value'].toString() !==
context.initialArgs[
'<glide-core-checkbox-group>.value'
].toString();

if (isCheckboxGroupValueChanged) {
$component
.querySelector('glide-core-checkbox-group')
.setAttribute(
'value',
JSON.stringify(
context.args['<glide-core-checkbox-group>.value'],
),
);
}

for (const $option of $component.querySelectorAll(
'glide-core-dropdown-option',
)) {
$option.removeAttribute('aria-selected');
}

for (const $radio of $component.querySelectorAll(
'glide-core-radio-group-radio',
)) {
$radio.removeAttribute('aria-checked');
$radio.removeAttribute('aria-disabled');
$radio.removeAttribute('aria-label');
}
}

if (context.componentId === 'dropdown') {
const hasValueChanged =
context.args.value.toString() !==
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载