-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f18fbb
commit 5d3d38c
Showing
16 changed files
with
585 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
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
30 changes: 30 additions & 0 deletions
30
src/bundle/Resources/public/js/scripts/helpers/react.helper.js
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,30 @@ | ||
import { getRootDOMElement } from './context.helper'; | ||
|
||
const createDynamicRoot = ({ contextDOMElement = getRootDOMElement(), id } = {}) => { | ||
if (id && window.document.getElementById(id) !== null) { | ||
console.warn(`You're creating second root element with ID "${id}". IDs should be unique inside a document.`); | ||
} | ||
|
||
const rootDOMElement = document.createElement('div'); | ||
|
||
rootDOMElement.classList.add('ibexa-react-root'); | ||
|
||
if (id) { | ||
rootDOMElement.id = id; | ||
} | ||
|
||
contextDOMElement.appendChild(rootDOMElement); | ||
|
||
const reactRoot = window.ReactDOM.createRoot(rootDOMElement); | ||
|
||
return reactRoot; | ||
}; | ||
|
||
const removeDynamicRoot = (reactRoot) => { | ||
const rootDOMElement = reactRoot._internalRoot?.containerInfo; | ||
|
||
reactRoot.unmount(); | ||
rootDOMElement?.remove(); | ||
}; | ||
|
||
export { createDynamicRoot, removeDynamicRoot }; |
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
13 changes: 13 additions & 0 deletions
13
src/bundle/Resources/public/scss/ui/modules/common/_draggable.dialog.scss
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,13 @@ | ||
.c-draggable-dialog { | ||
position: fixed; | ||
z-index: 10000; | ||
|
||
&--hidden { | ||
visibility: hidden; | ||
} | ||
|
||
&__draggable { | ||
cursor: grab; | ||
user-select: none; | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
src/bundle/Resources/public/scss/ui/modules/common/_popup.menu.scss
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,74 @@ | ||
.c-popup-menu { | ||
display: flex; | ||
flex-direction: column; | ||
gap: calculateRem(1px); | ||
padding: calculateRem(8px) 0; | ||
background: $ibexa-color-white; | ||
border: calculateRem(1px) solid $ibexa-color-light; | ||
border-radius: $ibexa-border-radius; | ||
box-shadow: calculateRem(4px) calculateRem(22px) calculateRem(67px) 0 rgba($ibexa-color-info, 0.2); | ||
position: fixed; | ||
z-index: 1060; | ||
|
||
&--hidden { | ||
visibility: hidden; | ||
} | ||
|
||
&__search { | ||
margin-bottom: calculateRem(4px); | ||
padding: 0 calculateRem(8px); | ||
|
||
&--hidden { | ||
display: none; | ||
} | ||
} | ||
|
||
&__search-input { | ||
border-radius: $ibexa-border-radius; | ||
} | ||
|
||
&__groups { | ||
max-height: calculateRem(390px); | ||
overflow-y: auto; | ||
} | ||
|
||
&__group:not(:last-child) { | ||
&::after { | ||
content: ''; | ||
border-top: calculateRem(1px) solid $ibexa-color-light; | ||
display: flex; | ||
width: calc(100% - calculateRem(16px)); | ||
margin: calculateRem(1px) calculateRem(8px) 0; | ||
} | ||
} | ||
|
||
&__item { | ||
display: flex; | ||
align-items: center; | ||
min-width: calculateRem(150px); | ||
padding: 0 calculateRem(8px); | ||
transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; | ||
} | ||
|
||
&__item-content { | ||
position: relative; | ||
display: flex; | ||
align-items: baseline; | ||
width: 100%; | ||
cursor: pointer; | ||
padding: calculateRem(9px); | ||
color: $ibexa-color-dark; | ||
font-size: $ibexa-text-font-size-medium; | ||
text-align: left; | ||
text-decoration: none; | ||
border: none; | ||
border-radius: $ibexa-border-radius; | ||
transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; | ||
|
||
&:hover { | ||
background-color: $ibexa-color-light-300; | ||
color: $ibexa-color-black; | ||
text-decoration: none; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/bundle/Resources/translations/ibexa_popup_menu.en.xliff
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,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2"> | ||
<file source-language="en" target-language="en" datatype="plaintext" original="not.available"> | ||
<header> | ||
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/> | ||
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note> | ||
</header> | ||
<body> | ||
<trans-unit id="e4f3034ecab5de30a4ea60991375e4c6ccb21ed1" resname="ibexa_popup_menu.search.placeholder"> | ||
<source>Search...</source> | ||
<target state="new">Search...</target> | ||
<note>key: ibexa_popup_menu.search.placeholder</note> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
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
Oops, something went wrong.