Skip to content

Conversation

@ArthurStam
Copy link
Contributor

@ArthurStam ArthurStam commented Apr 28, 2020

Заметка дополняется

Breaking changes

Button

  • Поменялись значения свойства size. Было m, l, xl, стало — s, m, l
  • Кнопки размера l теперь автоматически не растягиваются на всю ширину. Для достижения эффекта растягивания нужно передать streteched={true}

Cell

  • Удалено свойство size. Теперь чтобы отрисовать Cell size="l" нужно использовать RichCell
  • Свойство asideContent переименовано в after

ActionSheet

  • Добавлены обязательные свойства toggleRef (desktop only) и iosCloseItem (ios only)

Panel

  • (надо сделать) Удалено устаревшее свойство separator, отвечавшее за отрисовку разделителя после шапки. Свойство перекочевало в PanelHeader

MiniInfoCell

  • Удалено свойство multiline. Вместо него нужно использовать textWrap="short".

Формы

  • FormLayout Теперь просто оборачивает children в form. Никакой итерации по детям внутри него нет.
  • В элементы форм больше не нужно передавать top, bottom и status. Компоненты нужно оборачивать в FormItem, передавая ему эти свойства.
  • FormLayoutGroup так же лишен свойств top, bottom и status. Он теперь предназначен только для группировки FormItem.

New

Адаптивность

image

Основные инструменты адаптивности:

  • <AdaptivityProvider>
  • <SplitLayout>, <SplitCol>, <SplitFixedCol>
  • withAdaptivity HOC и SizeType тип

В будущем будет добавлены абстракции инкапсулирующие самые популярные лаяуты адаптивности, сейчас это нужно делать вручную через <SplitLayout>.

Пример:

const App = ({ children }) => {
  return <AdaptivityProvider>
    <SplitFixedCol width="280px">
      <Nav />
    </SplitFixedCol>
    <SplitLayout>
      <SplitCol spaced width="800px">{children}</SplitCol>
    </SplitLayout>
  </AdaptivityProvider>
};

Создание адаптивного компонента

Для создания адаптивного компонента, его нужно обернуть в withAdpativity HOC.

const AdaptiveBox = withAdaptivity(({ sizeX, sizeY }) => {
  if (sizeX === SizeType.COMPACT) {
    return <div style={{ padding: '8px' }} />
  } else {
    return <div style={{ padding: '20px' }} />
  }
}, {
  sizeX: true,
  sizeY: true,
});

@@ -0,0 +1,35 @@
import { IS_PLATFORM_IOS } from '../lib/platform';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

весь этот файл ломает концепцию SSR. IS_PLATFORM_IOS будет неправильно определяться на сервере. Вот тут можно почитать подробнее
https://vkcom.github.io/vkui-styleguide/#!/Utils
https://vkcom.github.io/vkui-styleguide/#!/Server%20Side%20Rendering

.View--animated .View__panel,
.View--swiping-back .View__panel {
position: fixed;
position: absolute;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Уверены, что ничего не оторвет на мобилке?

Copy link
Contributor

Choose a reason for hiding this comment

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

Оторвало. Нужно было для анимации на десктопе, но так как её пока нет, то верну.

/**
* Обработчик событий mouseenter
*
* @param {Object} e Браузерное событие
Copy link
Contributor Author

Choose a reason for hiding this comment

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

кажется, что JSDoc не нужно, учитывая, что мы используем TS. Максимум, что можно оставлять — это текстовое описание метода. Но и оно тут не нужно, и так понятно.

}

const Separator: FunctionComponent<SeparatorProps> = ({ className, wide, ...restProps }: SeparatorProps) => {
let Separator: FunctionComponent<SeparatorProps> = ({ className, wide, expanded, ...restProps }: SeparatorProps) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

зачем поменяли const на let?


.Checkbox--ios {
padding: 12px;
padding: 12px 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

смотрится не очень
Screenshot 2020-05-15 at 14 38 24


return (
<Input
top={top}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FormLayout цепляет top у дочерних компонентов. Сюда его прокидывать нет смысла, кажется, потому что это дочерний компонент дочернего компонента DatePicker

Copy link
Contributor

@renataclover renataclover May 27, 2020

Choose a reason for hiding this comment

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

нет, это и есть дейтпикер по сути для мобильного вида (если hasMouse в true)
top срабатывает
Снимок экрана 2020-05-27 в 12 58 51

}

componentDidMount() {
this.onMountResizeTimeout = setTimeout(() => this.doResize());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

выглядит, как плохой хак для ожидания отрисовки

Используется для создания модальных окон. Содержимое `Root` – это коллекция `View`. У каждой `View` должен быть `id`.
Свойство `activeView` определяет, какая `View` сейчас активна.

При смене значения свойства `activeView` плавный происходит переход от одной `View` к другой.
Copy link
Contributor

@danyadev danyadev Jul 8, 2020

Choose a reason for hiding this comment

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

плавный происходит

нужно поменять слова

@ArthurStam ArthurStam requested a review from a team as a code owner October 2, 2020 09:31
INFRA: Deploy PRs to github pages
@github-actions
Copy link
Contributor

👀 Styleguide deployed

See the styleguide for this PR at https://vkcom.github.io/VKUI/pull/665/

ewgenius and others added 24 commits December 18, 2020 09:55
…ulation

 Calculate sizeX/sizeY from viewWidth/viewHeight
Proposal: Fix File nested labels and wrong paddings
Gallery: scrollable и left/right arrows
#148: Состояние скролла сохраняется для всех вкладок Epic
- 3 integration modes for VKUI: full, embedded and partial
- new AppRoot component
…github.com:VKCOM/VKUI into edzhumak/popout-backdrop-desktop-height
…height

Edzhumak/popout backdrop desktop height
@ArthurStam ArthurStam merged commit 68e02e4 into master Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.