-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(SFT-1555): add the possibility to add separators for object pr…
…operties (#1624) * feat(SFT-1555): translations for object property separators in builder * feat(SFT-1555): added object separators for various CRM integrations in builder --------- Co-authored-by: kjmartens <[email protected]>
- Loading branch information
1 parent
cadc777
commit 80dae07
Showing
20 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
packages/client/src/app/components/form-controls/delimiter.tsx
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,58 @@ | ||
import React from 'react'; | ||
import type { Delimiter } from '@ff-client/types/properties'; | ||
|
||
type Props = { | ||
delimiter?: Delimiter; | ||
}; | ||
|
||
import { labelText } from '@ff-client/styles/mixins'; | ||
import { shadows } from '@ff-client/styles/variables'; | ||
import styled from 'styled-components'; | ||
|
||
const DelimiterWrapper = styled.div` | ||
position: relative; | ||
min-height: 10px; | ||
&:before { | ||
content: ''; | ||
position: absolute; | ||
top: 9px; | ||
left: 0; | ||
right: 0; | ||
z-index: 1; | ||
height: 1px; | ||
margin: 0 var(--margins); | ||
box-shadow: ${shadows.bottom}; | ||
} | ||
div { | ||
position: absolute; | ||
left: -5px; | ||
top: 0; | ||
z-index: 2; | ||
background: var(--background-color); | ||
padding: 0 5px; | ||
${labelText}; | ||
font-size: 11px; | ||
&:empty { | ||
display: none; | ||
} | ||
} | ||
`; | ||
|
||
export const DelimiterElement: React.FC<Props> = ({ delimiter }) => { | ||
if (!delimiter) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<DelimiterWrapper> | ||
<div>{delimiter.name}</div> | ||
</DelimiterWrapper> | ||
); | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Solspace\Freeform\Attributes\Property; | ||
|
||
use Solspace\Freeform\Library\Serialization\Normalizers\CustomNormalizerInterface; | ||
|
||
#[\Attribute(\Attribute::TARGET_PROPERTY)] | ||
class Delimiter implements CustomNormalizerInterface | ||
{ | ||
public function __construct( | ||
public ?string $name = null, | ||
public ?string $icon = null, | ||
) {} | ||
|
||
public function normalize(): array | ||
{ | ||
return [ | ||
'name' => $this->name, | ||
'icon' => $this->icon, | ||
]; | ||
} | ||
} |
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
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
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.