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

FIO-8465: added templates for select all rows alert #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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 };