Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: columns in dynamic containers #209

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{% from 'print_designer/page/print_designer/jinja/macros/render_element.html' import render_element with context %}

{% macro relative_containers(element, send_to_jinja) -%}
<div style="position:relative; left:{{ element.startX }}px; {%- if not element.isDynamicHeight -%} height:{{ element.height }}px; {%- endif -%} {{convert_css(element.style)}} border: none !important;"
{% macro relative_columns(element, send_to_jinja) -%}
<div style="position:relative; top: 0px; width:{{ element.width }}px; {%- if not element.isDynamicHeight -%} height:{{ element.height }}px; {%- endif -%} {{convert_css(element.style)}}"
class="rectangle {{ element.classes | join(' ') }}">
{% if element.childrens %}
{% for object in element.childrens %}
{{ render_element(object, send_to_jinja, element.get("isDynamicHeight", false)) }}
{% endfor %}
{% endif %}
</div>
{%- endmacro %}

{% macro relative_containers(element, send_to_jinja) -%}
<div style="position:relative; left:{{ element.startX }}px; {%- if not element.isDynamicHeight -%} height:{{ element.height }}px; {%- endif -%} {{convert_css(element.style)}}"
class="rectangle relative-row {{ element.classes | join(' ') }}">
{% if element.childrens %}
{% for object in element.childrens %}
{{ relative_columns(object, send_to_jinja) }}
{% endfor %}
{% endif %}
</div>
{%- endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
margin: auto !important;
}
}
/* set margin to 0 for print (Ctrl + p) on client browsers
and remove margin container that was added for screen ( viewing ) */
@media print {
.print-format {
margin: 0 !important;
}
.printview-header-margin {
display: none;
}
}
.print-designer-container {
position: absolute;
}
Expand Down Expand Up @@ -71,8 +81,19 @@
.flexDirectionColumn .baseSpanTag .valueSpanTag {
display: block;
}
/* https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1522 */
.relative-row {
display: -webkit-box;
display: -webkit-flex;
display: flex;
border-width: 0 !important;
}
.relative-column {
margin-right: -4px;
border-width: 1px !important;
border-color: white !important;
}
* {
-webkit-box-sizing: border-box;
}
</style>
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<div id="__print_designer">
<div id="header-html">
<div style="position: relative; top:0px; left: 0px; width: 100%; height:{{ settings.page.headerHeightWithMargin }}px;">
<div class="visible-pdf" style="height: {{ settings.page.marginTop }}px;"></div>
<div class="hidden-pdf printview-header-margin" style="height: {{ settings.page.marginTop }}px;"></div>
{% if headerElement %}{{ render(pd_format.header, send_to_jinja) }}{%endif%}
</div>
</div>
{% if bodyElement %}{{ render(pd_format.body, send_to_jinja) }}{%endif%}
<div id="footer-html">
<div style="width: 100%; position: relative; top:0px; left: 0px; height:{{ settings.page.footerHeightWithMargin }}px; ">
<div style="width: 100%; position: relative; top:0px; left: 0px; height:{{ settings.page.footerHeightWithMargin }}px;">
{% if footerElement %}{{ render(pd_format.footer, send_to_jinja) }}{%endif%}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export const createPropertiesPanel = () => {
currentEl?.type === "table") ||
(currentEl.type === "text" && currentEl.isDynamic)
) {
return !currentEl.isElementOverlapping;
return true;
}
return false;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const {
selectedColumn,
selectedDynamicText,
DOMRef,
isDynamicHeight,
} = toRefs(props.object);

watch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,15 @@ watch(
margin-right: calc(var(--print-margin-right) * -1);
margin-bottom: calc(var(--print-margin-bottom) * -1);
}
.relative-row {
background-color: transparent !important;
border: none !important;
z-index: 9999 !important;
}
.relative-column {
background-color: transparent !important;
border: none !important;
z-index: 9999 !important;
outline: 1px solid var(--primary) !important;
}
</style>
Loading
Loading