Skip to content

Commit

Permalink
FIO-8465: added templates for select all rows alert
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaGashtold committed Dec 2, 2024
1 parent b1456a5 commit 9676924
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/templates/bootstrap3/grid/html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<div class="spinner-wrapper" ref="loader">
<div class="spinner-grow"></div>
</div>
{% if (ctx.component.selectAllRows) { %}
<div ref="selectAllRowsContainer"></div>
{% } %}
<table class="table{{ ctx.classes }} formio-grid">
<thead>
<tr>
Expand Down
5 changes: 4 additions & 1 deletion src/templates/bootstrap3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import pagination from './pagination';
import columnMenu from './column-menu';
import tbody from './tbody';
import paginationBottom from './pagination-bottom';
import selectAllContent from './selectAllContent';

export default {
transform(type, text) {
Expand All @@ -58,6 +59,7 @@ export default {
if (builder.scrollResizeObserver) {
builder.scrollResizeObserver.disconnect();
}
// @ts-ignore
builder.scrollResizeObserver = new ResizeObserver(() => {
setTimeout(() => {
const { form, sidebar } = builder.refs;
Expand Down Expand Up @@ -124,5 +126,6 @@ export default {
pagination,
columnMenu,
tbody,
paginationBottom
paginationBottom,
selectAllContent
};
23 changes: 23 additions & 0 deletions src/templates/bootstrap3/selectAllContent/html.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="formio-grid-select-wrapper alert text-secondary text-center">
<span class="formio-grid-select-info">
{% if (!ctx.allRowsSelected) { %}
All {{ ctx.totalSelected }} records on this page are selected.
{% } %}
{% if (ctx.allRowsSelected) { %}
All {{ ctx.totalItems }} records in the table are selected.
{% } %}
</span>
<span class="formio-grid-select-spinner">
<div class="spinner-grow"></div>
</span>
<span ref="selectAllBtn" class="formio-grid-select-btn text-primary">
<span>
{% if (!ctx.allRowsSelected) { %}
Select all {{ ctx.totalItems }} items in the table.
{% } %}
{% if (ctx.allRowsSelected) { %}
Clear selection.
{% } %}
</span>
</span>
</div>
2 changes: 2 additions & 0 deletions src/templates/bootstrap3/selectAllContent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import html from './html.ejs';
export default { html };
3 changes: 3 additions & 0 deletions src/templates/bootstrap4/grid/html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<div class="spinner-wrapper" ref="loader">
<div class="spinner-grow"></div>
</div>
{% if (ctx.component.selectAllRows) { %}
<div ref="selectAllRowsContainer"></div>
{% } %}
<table class="table{{ ctx.classes }} formio-grid">
<thead>
<tr>
Expand Down
4 changes: 3 additions & 1 deletion src/templates/bootstrap4/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import pagination from './pagination';
import columnMenu from './column-menu';
import tbody from './tbody';
import paginationBottom from './pagination-bottom';
import selectAllContent from './selectAllContent';

export default {
transform(type, text) {
Expand Down Expand Up @@ -148,5 +149,6 @@ export default {
pagination,
columnMenu,
tbody,
paginationBottom
paginationBottom,
selectAllContent
};
23 changes: 23 additions & 0 deletions src/templates/bootstrap4/selectAllContent/html.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="formio-grid-select-wrapper alert text-secondary text-center">
<span class="formio-grid-select-info">
{% if (!ctx.allRowsSelected) { %}
All {{ ctx.totalSelected }} records on this page are selected.
{% } %}
{% if (ctx.allRowsSelected) { %}
All {{ ctx.totalItems }} records in the table are selected.
{% } %}
</span>
<span class="formio-grid-select-spinner">
<div class="spinner-grow"></div>
</span>
<span ref="selectAllBtn" class="formio-grid-select-btn text-primary">
<span>
{% if (!ctx.allRowsSelected) { %}
Select all {{ ctx.totalItems }} items in the table.
{% } %}
{% if (ctx.allRowsSelected) { %}
Clear selection.
{% } %}
</span>
</span>
</div>
2 changes: 2 additions & 0 deletions src/templates/bootstrap4/selectAllContent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import html from './html.ejs';
export default { html };

0 comments on commit 9676924

Please sign in to comment.