editor.js/src/components/utils/popover/popover.const.ts
Tatiana Fomina 5125f015dc
feat: nested popover (#2649)
* Move popover types to separate file

* tmp

* open top

* Fix bug with keyboard navigation

* Fix bug with scroll

* Fix mobile

* Add popover header class

* Display nested items on mobile

* Refactor history

* Fix positioning on desktop

* Fix tests

* Fix child popover indent left

* Fix ts errors in popover files

* Move files

* Rename cn to bem

* Clarify comments and rename method

* Refactor popover css classes

* Rename cls to css

* Split popover desktop and mobile classes

* Add ability to open popover to the left if not enough space to open to the right

* Add nested popover test

* Add popover test for mobile screens

* Fix tests

* Add union type for both popovers

* Add global window resize event

* Multiple fixes

* Move nodes initialization to constructor

* Rename handleShowingNestedItems to showNestedItems

* Replace WindowResize with EditorMobileLayoutToggled

* New doze of fixes

* Review fixes

* Fixes

* Fixes

* Make each nested popover decide itself if it should open top

* Update changelog

* Update changelog

* Update changelog
2024-04-13 17:34:26 +00:00

28 lines
869 B
TypeScript

import { bem } from '../bem';
/**
* Popover block CSS class constructor
*/
const className = bem('ce-popover');
/**
* CSS class names to be used in popover
*/
export const css = {
popover: className(),
popoverContainer: className('container'),
popoverOpenTop: className(null, 'open-top'),
popoverOpenLeft: className(null, 'open-left'),
popoverOpened: className(null, 'opened'),
search: className('search'),
nothingFoundMessage: className('nothing-found-message'),
nothingFoundMessageDisplayed: className('nothing-found-message', 'displayed'),
customContent: className('custom-content'),
customContentHidden: className('custom-content', 'hidden'),
items: className('items'),
overlay: className('overlay'),
overlayHidden: className('overlay', 'hidden'),
popoverNested: className(null, 'nested'),
popoverHeader: className('header'),
};