Skip to content

Conversation

dHIM24
Copy link
Contributor

@dHIM24 dHIM24 commented Jul 23, 2025

  • Добавлен props checkmarkPosition, позволяющий управлять положением чекбокса в "Выбрать всё"

Чек лист

  • Задача сформулирована и описана в JIRA
  • В названии ветки есть айдишник задачи в JIRA (fix/DS-1234), ссылку прикреплять не надо
  • У реквеста осмысленное название feat(...) или fix(...) по conventional commits (https://www.conventionalcommits.org)
  • Код покрыт тестами и протестирован в различных браузерах
  • Добавленные пропсы добавлены в демки и описаны в документации
  • К реквесту добавлен changeset

Если есть визуальные изменения

  • Прикреплено изображение было/стало
2025-07-24.00.17.57.mov

Copy link

changeset-bot bot commented Jul 23, 2025

🦋 Changeset detected

Latest commit: 6cf5d17

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@alfalab/core-components-select Minor
@alfalab/core-components-custom-picker-button Patch
@alfalab/core-components-input-autocomplete Patch
@alfalab/core-components-international-phone-input Patch
@alfalab/core-components-intl-phone-input Patch
@alfalab/core-components-picker-button Patch
@alfalab/core-components-select-with-tags Patch
@alfalab/core-components-table Patch
@alfalab/core-components-tabs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dHIM24
Copy link
Contributor Author

dHIM24 commented Jul 23, 2025

const OPTIONS = [
    { key: '1', content: 'Neptunium' },
    { key: '2', content: 'Plutonium' },
    { key: '3', content: 'Americium' },
    { key: '4', content: 'Curium' },
    { key: '5', content: 'Berkelium' },
    { key: '6', content: 'Californium' },
    { key: '7', content: 'Einsteinium' },
    { key: '8', content: 'Fermium' },
];

render(() => {
    const [selectedFirst, setSelectedFirst] = React.useState([]);

    return (
        <div style={{ width: 320 }}>
            <Select
                allowUnselect={true}
                size={56}
                placeholder='Выберите элементы'
                label='Множественный выбор'
                Option={BaseOption}
                multiple={true}
                block={true}
                 optionProps={{
                       checkmarkPosition: 'before' 
                 }}
                {...useSelectWithApply({
                    options: OPTIONS,
                    checkmarkPosition: 'after',
                    showHeaderWithSelectAll: true,
                    selected: selectedFirst,
                    onChange: ({ selectedMultiple }) => {
                        setSelectedFirst(selectedMultiple.map((option) => option.key));
                    },
                })}
            />
        </div>
    );
});

Copy link
Contributor

github-actions bot commented Jul 23, 2025

Собрана новая демка.

@coveralls
Copy link

coveralls commented Jul 23, 2025

Pull Request Test Coverage Report for Build 16498193246

Details

  • 2 of 3 (66.67%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 82.439%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/select/src/presets/useSelectWithApply/options-list-with-apply/header/Component.tsx 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
packages/select/src/presets/useSelectWithApply/options-list-with-apply/header/Component.tsx 1 31.58%
Totals Coverage Status
Change from base Build 16443420098: -0.01%
Covered Lines: 11513
Relevant Lines: 12823

💛 - Coveralls

})}
>
<Checkbox
className={cn({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

положение чекбокса скорее должно быть частью API Checkbox, а не исправляться здесь стилями.

и в самом Checkbox рисовать чекбокс условно, чтобы не полагаться на flex

checkmarkPosition === 'before' && <checkmark /> <content /> checkmarkPosition === 'after' && <checkmark /> 

@dHIM24 dHIM24 marked this pull request as draft August 4, 2025 09:56
Copy link
Contributor

Demo build

https://core-ds.github.io/core-components/1789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants