@iamproperty/components 3.4.6 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/bootstrap/LICENSE +22 -0
- package/assets/bootstrap/README.md +246 -0
- package/assets/bootstrap/js/src/alert.js +87 -0
- package/assets/bootstrap/js/src/base-component.js +85 -0
- package/assets/bootstrap/js/src/button.js +72 -0
- package/assets/bootstrap/js/src/carousel.js +475 -0
- package/assets/bootstrap/js/src/collapse.js +302 -0
- package/assets/bootstrap/js/src/dom/data.js +55 -0
- package/assets/bootstrap/js/src/dom/event-handler.js +320 -0
- package/assets/bootstrap/js/src/dom/manipulator.js +71 -0
- package/assets/bootstrap/js/src/dom/selector-engine.js +83 -0
- package/assets/bootstrap/js/src/dropdown.js +454 -0
- package/assets/bootstrap/js/src/modal.js +377 -0
- package/assets/bootstrap/js/src/offcanvas.js +283 -0
- package/assets/bootstrap/js/src/popover.js +97 -0
- package/assets/bootstrap/js/src/scrollspy.js +294 -0
- package/assets/bootstrap/js/src/tab.js +305 -0
- package/assets/bootstrap/js/src/toast.js +225 -0
- package/assets/bootstrap/js/src/tooltip.js +633 -0
- package/assets/bootstrap/js/src/util/backdrop.js +149 -0
- package/assets/bootstrap/js/src/util/component-functions.js +34 -0
- package/assets/bootstrap/js/src/util/config.js +66 -0
- package/assets/bootstrap/js/src/util/focustrap.js +115 -0
- package/assets/bootstrap/js/src/util/index.js +336 -0
- package/assets/bootstrap/js/src/util/sanitizer.js +118 -0
- package/assets/bootstrap/js/src/util/scrollbar.js +114 -0
- package/assets/bootstrap/js/src/util/swipe.js +146 -0
- package/assets/bootstrap/js/src/util/template-factory.js +160 -0
- package/assets/bootstrap/package.json +181 -0
- package/assets/bootstrap/scss/_accordion.scss +149 -0
- package/assets/bootstrap/scss/_alert.scss +71 -0
- package/assets/bootstrap/scss/_badge.scss +38 -0
- package/assets/bootstrap/scss/_breadcrumb.scss +40 -0
- package/assets/bootstrap/scss/_button-group.scss +142 -0
- package/assets/bootstrap/scss/_buttons.scss +207 -0
- package/assets/bootstrap/scss/_card.scss +234 -0
- package/assets/bootstrap/scss/_carousel.scss +226 -0
- package/assets/bootstrap/scss/_close.scss +40 -0
- package/assets/bootstrap/scss/_containers.scss +41 -0
- package/assets/bootstrap/scss/_dropdown.scss +249 -0
- package/assets/bootstrap/scss/_forms.scss +9 -0
- package/assets/bootstrap/scss/_functions.scss +302 -0
- package/assets/bootstrap/scss/_grid.scss +33 -0
- package/assets/bootstrap/scss/_helpers.scss +10 -0
- package/assets/bootstrap/scss/_images.scss +42 -0
- package/assets/bootstrap/scss/_list-group.scss +192 -0
- package/assets/bootstrap/scss/_maps.scss +54 -0
- package/assets/bootstrap/scss/_mixins.scss +43 -0
- package/assets/bootstrap/scss/_modal.scss +237 -0
- package/assets/bootstrap/scss/_nav.scss +172 -0
- package/assets/bootstrap/scss/_navbar.scss +278 -0
- package/assets/bootstrap/scss/_offcanvas.scss +144 -0
- package/assets/bootstrap/scss/_pagination.scss +109 -0
- package/assets/bootstrap/scss/_placeholders.scss +51 -0
- package/assets/bootstrap/scss/_popover.scss +196 -0
- package/assets/bootstrap/scss/_progress.scss +59 -0
- package/assets/bootstrap/scss/_reboot.scss +610 -0
- package/assets/bootstrap/scss/_root.scss +73 -0
- package/assets/bootstrap/scss/_spinners.scss +85 -0
- package/assets/bootstrap/scss/_tables.scss +164 -0
- package/assets/bootstrap/scss/_toasts.scss +73 -0
- package/assets/bootstrap/scss/_tooltip.scss +120 -0
- package/assets/bootstrap/scss/_transitions.scss +27 -0
- package/assets/bootstrap/scss/_type.scss +106 -0
- package/assets/bootstrap/scss/_utilities.scss +647 -0
- package/assets/bootstrap/scss/_variables.scss +1634 -0
- package/assets/bootstrap/scss/bootstrap-grid.scss +64 -0
- package/assets/bootstrap/scss/bootstrap-reboot.scss +9 -0
- package/assets/bootstrap/scss/bootstrap-utilities.scss +18 -0
- package/assets/bootstrap/scss/bootstrap.scss +51 -0
- package/assets/bootstrap/scss/forms/_floating-labels.scss +75 -0
- package/assets/bootstrap/scss/forms/_form-check.scss +175 -0
- package/assets/bootstrap/scss/forms/_form-control.scss +194 -0
- package/assets/bootstrap/scss/forms/_form-range.scss +91 -0
- package/assets/bootstrap/scss/forms/_form-select.scss +71 -0
- package/assets/bootstrap/scss/forms/_form-text.scss +11 -0
- package/assets/bootstrap/scss/forms/_input-group.scss +132 -0
- package/assets/bootstrap/scss/forms/_labels.scss +36 -0
- package/assets/bootstrap/scss/forms/_validation.scss +12 -0
- package/assets/bootstrap/scss/helpers/_clearfix.scss +3 -0
- package/assets/bootstrap/scss/helpers/_color-bg.scss +10 -0
- package/assets/bootstrap/scss/helpers/_colored-links.scss +12 -0
- package/assets/bootstrap/scss/helpers/_position.scss +36 -0
- package/assets/bootstrap/scss/helpers/_ratio.scss +26 -0
- package/assets/bootstrap/scss/helpers/_stacks.scss +15 -0
- package/assets/bootstrap/scss/helpers/_stretched-link.scss +15 -0
- package/assets/bootstrap/scss/helpers/_text-truncation.scss +7 -0
- package/assets/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
- package/assets/bootstrap/scss/helpers/_vr.scss +8 -0
- package/assets/bootstrap/scss/mixins/_alert.scss +15 -0
- package/assets/bootstrap/scss/mixins/_backdrop.scss +14 -0
- package/assets/bootstrap/scss/mixins/_banner.scss +9 -0
- package/assets/bootstrap/scss/mixins/_border-radius.scss +78 -0
- package/assets/bootstrap/scss/mixins/_box-shadow.scss +18 -0
- package/assets/bootstrap/scss/mixins/_breakpoints.scss +127 -0
- package/assets/bootstrap/scss/mixins/_buttons.scss +70 -0
- package/assets/bootstrap/scss/mixins/_caret.scss +64 -0
- package/assets/bootstrap/scss/mixins/_clearfix.scss +9 -0
- package/assets/bootstrap/scss/mixins/_color-scheme.scss +7 -0
- package/assets/bootstrap/scss/mixins/_container.scss +11 -0
- package/assets/bootstrap/scss/mixins/_deprecate.scss +10 -0
- package/assets/bootstrap/scss/mixins/_forms.scss +152 -0
- package/assets/bootstrap/scss/mixins/_gradients.scss +47 -0
- package/assets/bootstrap/scss/mixins/_grid.scss +151 -0
- package/assets/bootstrap/scss/mixins/_image.scss +16 -0
- package/assets/bootstrap/scss/mixins/_list-group.scss +24 -0
- package/assets/bootstrap/scss/mixins/_lists.scss +7 -0
- package/assets/bootstrap/scss/mixins/_pagination.scss +10 -0
- package/assets/bootstrap/scss/mixins/_reset-text.scss +17 -0
- package/assets/bootstrap/scss/mixins/_resize.scss +6 -0
- package/assets/bootstrap/scss/mixins/_table-variants.scss +24 -0
- package/assets/bootstrap/scss/mixins/_text-truncate.scss +8 -0
- package/assets/bootstrap/scss/mixins/_transition.scss +26 -0
- package/assets/bootstrap/scss/mixins/_utilities.scss +97 -0
- package/assets/bootstrap/scss/mixins/_visually-hidden.scss +29 -0
- package/assets/bootstrap/scss/utilities/_api.scss +47 -0
- package/assets/bootstrap/scss/vendor/_rfs.scss +354 -0
- package/assets/css/components/accordion.css +1 -1
- package/assets/css/components/accordion.css.map +1 -1
- package/assets/css/components/admin-panel.css +1 -0
- package/assets/css/components/admin-panel.css.map +1 -0
- package/assets/css/components/alert.css +1 -1
- package/assets/css/components/alert.css.map +1 -1
- package/assets/css/components/applied-filters.css +1 -0
- package/assets/css/components/applied-filters.css.map +1 -0
- package/assets/css/components/card.css +1 -1
- package/assets/css/components/card.css.map +1 -1
- package/assets/css/components/carousel.css +1 -1
- package/assets/css/components/carousel.css.map +1 -1
- package/assets/css/components/charts.css +1 -1
- package/assets/css/components/charts.css.map +1 -1
- package/assets/css/components/container.css +1 -1
- package/assets/css/components/container.css.map +1 -1
- package/assets/css/components/dialog.css +1 -0
- package/assets/css/components/dialog.css.map +1 -0
- package/assets/css/components/forms.css +1 -1
- package/assets/css/components/forms.css.map +1 -1
- package/assets/css/components/header.css +1 -1
- package/assets/css/components/header.css.map +1 -1
- package/assets/css/components/lists.css +1 -1
- package/assets/css/components/lists.css.map +1 -1
- package/assets/css/components/nav.css +1 -1
- package/assets/css/components/nav.css.map +1 -1
- package/assets/css/components/pagination.css +1 -0
- package/assets/css/components/pagination.css.map +1 -0
- package/assets/css/components/property-searchbar.css +1 -1
- package/assets/css/components/property-searchbar.css.map +1 -1
- package/assets/css/components/stepper.css +1 -1
- package/assets/css/components/stepper.css.map +1 -1
- package/assets/css/components/table.css +1 -0
- package/assets/css/components/table.css.map +1 -0
- package/assets/css/components/tabs.css +1 -1
- package/assets/css/components/tabs.css.map +1 -1
- package/assets/css/components/tooltips.css +1 -1
- package/assets/css/components/tooltips.css.map +1 -1
- package/assets/css/core.min.css +1 -1
- package/assets/css/core.min.css.map +1 -1
- package/assets/css/style.min.css +1 -1
- package/assets/css/style.min.css.map +1 -1
- package/assets/js/bundle.js +18 -11
- package/assets/js/components/accordion/accordion.component.js +6 -0
- package/assets/js/components/accordion/accordion.component.min.js +3 -3
- package/assets/js/components/accordion/accordion.component.min.js.map +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.js +26 -0
- package/assets/js/components/card/card.component.js +91 -0
- package/assets/js/components/card/card.component.min.js +21 -0
- package/assets/js/components/card/card.component.min.js.map +1 -0
- package/assets/js/components/filterlist/filterlist.component.js +49 -0
- package/assets/js/components/filterlist/filterlist.component.min.js +23 -0
- package/assets/js/components/filterlist/filterlist.component.min.js.map +1 -0
- package/assets/js/components/header/header.component.js +6 -0
- package/assets/js/components/header/header.component.min.js +5 -5
- package/assets/js/components/header/header.component.min.js.map +1 -1
- package/assets/js/components/pagination/pagination.component.js +34 -0
- package/assets/js/components/table/table.component.js +108 -0
- package/assets/js/components/table/table.component.min.js +24 -0
- package/assets/js/components/table/table.component.min.js.map +1 -0
- package/assets/js/components/tabs/tabs.component.js +6 -0
- package/assets/js/components/tabs/tabs.component.min.js +17 -0
- package/assets/js/components/tabs/tabs.component.min.js.map +1 -0
- package/assets/js/dynamic.js +7 -18
- package/assets/js/dynamic.min.js +2 -53
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/flat-components.js +27 -9
- package/assets/js/modules/applied-filters.js +100 -0
- package/assets/js/modules/data-layer.js +45 -0
- package/assets/js/modules/filterlist.js +32 -0
- package/assets/js/modules/helpers.js +102 -49
- package/assets/js/modules/pagination.js +33 -0
- package/assets/js/modules/table.js +506 -420
- package/assets/js/modules/tabs.js +6 -0
- package/assets/js/modules/youtubevideo.js +53 -61
- package/assets/js/scripts.bundle.js +77 -62
- package/assets/js/scripts.bundle.js.map +1 -1
- package/assets/js/scripts.bundle.min.js +2 -2
- package/assets/js/scripts.bundle.min.js.map +1 -1
- package/assets/js/tests/filterlist.spec.js +22 -0
- package/assets/js/tests/pagination.spec.js +15 -0
- package/assets/js/tests/table.spec.js +149 -0
- package/assets/sass/_components.scss +1 -2
- package/assets/sass/_corefiles.scss +20 -19
- package/assets/sass/_forms.scss +7 -7
- package/assets/sass/_functions/functions.scss +1 -1
- package/assets/sass/_functions/mixins.scss +19 -21
- package/assets/sass/_functions/utilities.scss +67 -9
- package/assets/sass/_functions/variables.scss +109 -55
- package/assets/sass/_tests/colours.spec.scss +8 -22
- package/assets/sass/components/accordion.scss +13 -0
- package/assets/sass/components/admin-panel.scss +106 -0
- package/assets/sass/components/alert.scss +22 -0
- package/assets/sass/components/applied-filters.scss +65 -0
- package/assets/sass/components/card.scss +177 -233
- package/assets/sass/components/carousel.scss +72 -0
- package/assets/sass/components/charts.scss +41 -1
- package/assets/sass/components/container.scss +8 -3
- package/assets/sass/components/dialog.scss +208 -0
- package/assets/sass/components/forms.scss +37 -5
- package/assets/sass/components/lists.scss +29 -0
- package/assets/sass/components/nav.scss +6 -2
- package/assets/sass/components/pagination.scss +140 -0
- package/assets/sass/components/stepper.scss +3 -3
- package/assets/sass/components/table.scss +423 -0
- package/assets/sass/components/tabs.scss +20 -7
- package/assets/sass/components/tooltips.scss +1 -1
- package/assets/sass/foundations/buttons.scss +366 -0
- package/assets/sass/foundations/icons.scss +1 -1
- package/assets/sass/foundations/links.scss +125 -0
- package/assets/sass/foundations/media.scss +1 -1
- package/assets/sass/foundations/reboot.scss +21 -17
- package/assets/sass/foundations/root.scss +9 -29
- package/assets/sass/foundations/type.scss +1 -1
- package/assets/svg/illustrations/table.svg +165 -0
- package/assets/ts/bundle.ts +23 -12
- package/assets/ts/components/accordion/accordion.component.ts +7 -0
- package/assets/ts/components/applied-filters/README.md +5 -0
- package/assets/ts/components/applied-filters/applied-filters.component.ts +33 -0
- package/assets/ts/components/card/README.md +22 -0
- package/assets/ts/components/card/card.component.ts +117 -0
- package/assets/ts/components/filterlist/README.md +17 -0
- package/assets/ts/components/filterlist/filterlist.component.ts +60 -0
- package/assets/ts/components/header/header.component.ts +8 -0
- package/assets/ts/components/pagination/README.md +11 -0
- package/assets/ts/components/pagination/pagination.component.ts +45 -0
- package/assets/ts/components/table/README.md +23 -0
- package/assets/ts/components/table/table.component.ts +133 -0
- package/assets/ts/components/tabs/tabs.component.ts +7 -0
- package/assets/ts/dynamic.ts +12 -19
- package/assets/ts/flat-components.ts +37 -9
- package/assets/ts/modules/applied-filters.ts +146 -0
- package/assets/ts/modules/data-layer.ts +58 -0
- package/assets/ts/modules/filterlist.ts +46 -0
- package/assets/ts/modules/helpers.ts +129 -58
- package/assets/ts/modules/pagination.ts +44 -0
- package/assets/ts/modules/table.ts +598 -433
- package/assets/ts/modules/tabs.ts +8 -1
- package/assets/ts/modules/youtubevideo.ts +58 -63
- package/assets/ts/tests/filterlist.spec.ts +29 -0
- package/assets/ts/tests/pagination.spec.ts +21 -0
- package/assets/ts/tests/table.spec.ts +194 -0
- package/dist/components.es.js +1267 -1295
- package/dist/components.umd.js +70 -65
- package/dist/style.css +1 -1
- package/package.json +8 -5
- package/src/components/AppliedFilters/AppliedFilters.vue +20 -0
- package/src/components/AppliedFilters/README.md +5 -0
- package/src/components/Card/Card.vue +11 -112
- package/src/components/Card/README.md +16 -18
- package/src/components/Carousel/Carousel.vue +49 -10
- package/src/components/Chart/Chart.vue +46 -4
- package/src/components/Filterlist/Filterlist.vue +20 -0
- package/src/components/Filterlist/README.md +17 -0
- package/src/components/Pagination/Pagination.vue +30 -0
- package/src/components/Pagination/README.md +11 -0
- package/src/components/Table/README.md +29 -44
- package/src/components/Table/Table.spec.js +5 -37
- package/src/components/Table/Table.vue +16 -91
- package/src/foundations/YoutubeVideo/YoutubeVideo.vue +1 -1
- package/src/index.js +3 -2
- package/assets/css/components/buttons.css +0 -1
- package/assets/css/components/buttons.css.map +0 -1
- package/assets/css/components/cardDeck.css +0 -1
- package/assets/css/components/cardDeck.css.map +0 -1
- package/assets/css/components/links.css +0 -1
- package/assets/css/components/links.css.map +0 -1
- package/assets/css/components/modal.css +0 -1
- package/assets/css/components/modal.css.map +0 -1
- package/assets/css/components/panel.css +0 -1
- package/assets/css/components/panel.css.map +0 -1
- package/assets/css/components/tables.css +0 -1
- package/assets/css/components/tables.css.map +0 -1
- package/assets/js/modules/modal.js +0 -69
- package/assets/sass/components/buttons.scss +0 -252
- package/assets/sass/components/cardDeck.scss +0 -108
- package/assets/sass/components/links.scss +0 -99
- package/assets/sass/components/modal.scss +0 -136
- package/assets/sass/components/panel.scss +0 -161
- package/assets/sass/components/tables.scss +0 -291
- package/assets/ts/modules/modal.ts +0 -91
- package/src/components/CardDeck/CardDeck.spec.js +0 -99
- package/src/components/CardDeck/CardDeck.vue +0 -77
- package/src/components/CardDeck/README.md +0 -25
- package/src/components/Modal/Modal.spec.js +0 -22
- package/src/components/Modal/Modal.vue +0 -43
- package/src/components/Modal/README.md +0 -20
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import { filterTheList } from "../modules/filterlist.js";
|
|
4
|
+
const listHTML = `
|
|
5
|
+
<li class="lead text-primary pb-1">Olivia Anderson</li>
|
|
6
|
+
<li class="lead text-primary pb-1">Ethan Ramirez</li>
|
|
7
|
+
<li class="lead text-primary pb-1">Sophia Patel</li>
|
|
8
|
+
<li class="lead text-primary pb-1">Noah Jenkins</li>
|
|
9
|
+
<li class="lead text-primary pb-1">Ava Thompson</li>
|
|
10
|
+
<li class="lead text-primary pb-1">Lucas Myers</li>
|
|
11
|
+
<li class="lead text-primary pb-1">Mia Carter</li>
|
|
12
|
+
<li class="lead text-primary pb-1">Benjamin Lee</li>
|
|
13
|
+
`;
|
|
14
|
+
describe('addDataAttributes', () => {
|
|
15
|
+
let list = document.createElement('ul');
|
|
16
|
+
list.innerHTML = listHTML;
|
|
17
|
+
filterTheList(list, "Lucas");
|
|
18
|
+
test('should add a class of d-none to each item except the one containing Lucas Myers', () => {
|
|
19
|
+
expect(list.querySelectorAll('li:not(.d-none)').length).toEqual(1);
|
|
20
|
+
expect(list.querySelector('li:not(.d-none').textContent).toEqual('Lucas Myers');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import createPaginationButttons from "../modules/pagination.js";
|
|
4
|
+
describe('createPaginationButttons', () => {
|
|
5
|
+
const pagination = document.createElement('div');
|
|
6
|
+
pagination.setAttribute('data-page', 2);
|
|
7
|
+
pagination.setAttribute('data-pages', 5);
|
|
8
|
+
pagination.setAttribute('data-show', 15);
|
|
9
|
+
pagination.setAttribute('data-total', 150);
|
|
10
|
+
pagination.setAttribute('data-increment', 15);
|
|
11
|
+
createPaginationButttons(pagination, pagination);
|
|
12
|
+
test('should populate the pagination with links to each page', () => {
|
|
13
|
+
expect(pagination.querySelectorAll('a.page-link').length).toEqual(6);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import * as tableModule from "../modules/table.js";
|
|
4
|
+
import "expect-puppeteer";
|
|
5
|
+
const basicTable = `<thead>
|
|
6
|
+
<tr>
|
|
7
|
+
<th>Heading 1</th>
|
|
8
|
+
<th>Heading 2</th>
|
|
9
|
+
<th>Heading 3</th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
<tbody>
|
|
13
|
+
<tr>
|
|
14
|
+
<td>Cell 1</td>
|
|
15
|
+
<td>Low</td>
|
|
16
|
+
<td>Cell 3</td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr>
|
|
19
|
+
<td>Cell 1</td>
|
|
20
|
+
<td>Low</td>
|
|
21
|
+
<td><a href="/link">View information</a></td>
|
|
22
|
+
</tr>
|
|
23
|
+
<tr>
|
|
24
|
+
<td>Different Cell 1</td>
|
|
25
|
+
<td>Medium</td>
|
|
26
|
+
<td><a href="/link">View information</a></td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<td>Different Cell 1</td>
|
|
30
|
+
<td>High</td>
|
|
31
|
+
<td><a href="/link">View information</a></td>
|
|
32
|
+
</tr>
|
|
33
|
+
</tbody>`;
|
|
34
|
+
describe('addDataAttributes', () => {
|
|
35
|
+
const table = document.createElement('table');
|
|
36
|
+
table.innerHTML = basicTable;
|
|
37
|
+
tableModule.addDataAttributes(table);
|
|
38
|
+
test('should add data-label attribute to the table cells', () => {
|
|
39
|
+
expect(table.querySelector('tbody td').getAttribute('data-label')).toEqual('Heading 1');
|
|
40
|
+
expect(table.querySelector('tbody td:nth-child(2)').getAttribute('data-label')).toEqual('Heading 2');
|
|
41
|
+
});
|
|
42
|
+
test('should add data-content attribute to the table cells if the content matches a pre-defined list', () => {
|
|
43
|
+
expect(table.querySelector('tbody tr:nth-child(2) td:nth-child(2)').getAttribute('data-content')).toEqual('Low');
|
|
44
|
+
expect(table.querySelector('tbody tr:nth-child(3) td:nth-child(2)').getAttribute('data-content')).toEqual('Medium');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
/* TODO: This unit test doesn't work as puppeteer seems to have an issue with query selector all
|
|
48
|
+
describe('getLargestLastColWidth', () => {
|
|
49
|
+
|
|
50
|
+
test('should return the width of the largest last column content', async() => {
|
|
51
|
+
|
|
52
|
+
const browser = await puppeteer.launch({});
|
|
53
|
+
try {
|
|
54
|
+
const page = await browser.newPage();
|
|
55
|
+
await page.exposeFunction("getLargestLastColWidth", tableModule.getLargestLastColWidth);
|
|
56
|
+
await page.setContent(`<table id="table">${basicTable}</table>`);
|
|
57
|
+
await page.waitForSelector('#table tr');
|
|
58
|
+
|
|
59
|
+
const largestWidth = await page.evaluate(`getLargestLastColWidth(document.querySelector("#table"))`);
|
|
60
|
+
|
|
61
|
+
//const links = await page.$$eval('#table', e=>getLargestLastColWidth(e))
|
|
62
|
+
console.log(await largestWidth)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.error(e);
|
|
67
|
+
} finally {
|
|
68
|
+
await browser.close();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
});
|
|
75
|
+
*/
|
|
76
|
+
describe('createMobileButton', () => {
|
|
77
|
+
const table = document.createElement('table');
|
|
78
|
+
table.innerHTML = basicTable;
|
|
79
|
+
tableModule.createMobileButton(table);
|
|
80
|
+
test('should add a button to the first cell in a column', () => {
|
|
81
|
+
expect(table.querySelector('tbody td:nth-child(1) button').textContent).toEqual('Cell 1');
|
|
82
|
+
expect(table.querySelector('tbody td:nth-child(1) span').textContent).toEqual('Cell 1');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe('createSearchDataList', () => {
|
|
86
|
+
const table = document.createElement('table');
|
|
87
|
+
table.innerHTML = basicTable;
|
|
88
|
+
const form = document.createElement('form');
|
|
89
|
+
form.innerHTML += `<div><input name="search" id="search" type="text" class="form-control" data-search="Heading 1"></div>`;
|
|
90
|
+
tableModule.addDataAttributes(table);
|
|
91
|
+
tableModule.createSearchDataList(table, form);
|
|
92
|
+
test('should create a datalist populated by the defined columns in the data-search ', () => {
|
|
93
|
+
expect(form.querySelectorAll('datalist').length).toEqual(1);
|
|
94
|
+
expect(form.querySelectorAll('datalist option').length).toEqual(2);
|
|
95
|
+
expect(form.querySelector('datalist option:nth-child(1)').value).toEqual('Cell 1');
|
|
96
|
+
expect(form.querySelector('datalist option:nth-child(2)').value).toEqual('Different Cell 1');
|
|
97
|
+
});
|
|
98
|
+
test('should set the autocomplete attribute to off', () => {
|
|
99
|
+
expect(form.querySelectorAll('datalist').length).toEqual(1);
|
|
100
|
+
expect(form.querySelectorAll('datalist option').length).toEqual(2);
|
|
101
|
+
expect(form.querySelector('datalist option:nth-child(1)').value).toEqual('Cell 1');
|
|
102
|
+
expect(form.querySelector('input').getAttribute('autocomplete')).toEqual('off');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
describe('sortTable', () => {
|
|
106
|
+
const table = document.createElement('table');
|
|
107
|
+
table.innerHTML = basicTable;
|
|
108
|
+
const form = document.createElement('form');
|
|
109
|
+
form.innerHTML += `<div><select type="select" name="sort" id="sort" class="form-select" data-sort=""><option value="-1">Sort by</option><option value="high" data-sort="Heading 2" data-order="High,Medium,Low" selected="selected">high to low</option></select></div>`;
|
|
110
|
+
const savedTableBody = table.querySelector('tbody');
|
|
111
|
+
tableModule.addDataAttributes(table);
|
|
112
|
+
tableModule.sortTable(table, form, savedTableBody);
|
|
113
|
+
test('should sort the table from high to low', () => {
|
|
114
|
+
expect(table.querySelector('tbody tr:nth-child(1) td:nth-child(2)').textContent).toEqual('High');
|
|
115
|
+
expect(table.querySelector('tbody tr:nth-child(2) td:nth-child(2)').textContent).toEqual('Medium');
|
|
116
|
+
expect(table.querySelector('tbody tr:nth-child(3) td:nth-child(2)').textContent).toEqual('Low');
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('filterTable', () => {
|
|
120
|
+
const table = document.createElement('table');
|
|
121
|
+
table.innerHTML = basicTable;
|
|
122
|
+
const form = document.createElement('form');
|
|
123
|
+
form.innerHTML += `<div><input type="text" name="filter" id="filter" data-filter="Heading 2" value="High" /></div>`;
|
|
124
|
+
tableModule.addDataAttributes(table);
|
|
125
|
+
tableModule.filterTable(table, form, document.createElement('div'));
|
|
126
|
+
test('should filter the table to only show high values', () => {
|
|
127
|
+
expect(table.querySelectorAll('tbody tr.filtered--matched').length).toEqual(1);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
describe('populateDataQueries', () => {
|
|
131
|
+
const table = document.createElement('table');
|
|
132
|
+
table.innerHTML = basicTable;
|
|
133
|
+
const form = document.createElement('form');
|
|
134
|
+
form.innerHTML += `<div><span data-query="total"></span><span data-query="Heading 2 == Low"></span></div>`;
|
|
135
|
+
tableModule.addDataAttributes(table);
|
|
136
|
+
tableModule.filterTable(table, form, document.createElement('div'));
|
|
137
|
+
tableModule.populateDataQueries(table, form);
|
|
138
|
+
console.log(table.outerHTML);
|
|
139
|
+
test('should populate elements with the data-query attribute with the result of the corresponding query', () => {
|
|
140
|
+
expect(form.querySelector('[data-query="total"]').textContent).toEqual('4');
|
|
141
|
+
expect(form.querySelector('[data-query="Heading 2 == Low"]').textContent).toEqual('2');
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
describe('formatCell', () => {
|
|
145
|
+
test('should format the text correctly', () => {
|
|
146
|
+
expect(tableModule.formatCell('date', '2023-05-15 12:10:45.000000')).toEqual('15 May 23');
|
|
147
|
+
expect(tableModule.formatCell('capitalise', 'low')).toEqual('Low');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
@use "components/card.scss";
|
|
1
2
|
@use "components/nav.scss";
|
|
2
3
|
@use "components/header.scss";
|
|
3
4
|
@use "components/testimonial.scss";
|
|
4
|
-
@use "components/cardDeck.scss";
|
|
5
5
|
@use "components/accordion.scss";
|
|
6
6
|
@use "components/alert";
|
|
7
7
|
@use "components/carousel.scss";
|
|
8
8
|
@use "components/property-searchbar.scss";
|
|
9
9
|
@use "components/tabs.scss";
|
|
10
|
-
@use "components/modal.scss";
|
|
11
10
|
@use "components/charts.scss";
|
|
12
11
|
@use "components/timeline.scss";
|
|
13
12
|
@use "components/snapshot.scss";
|
|
@@ -13,28 +13,29 @@
|
|
|
13
13
|
@use "components/lists.scss";
|
|
14
14
|
@use "components/tooltips.scss";
|
|
15
15
|
@use "components/container.scss";
|
|
16
|
-
@use "components/
|
|
17
|
-
@use "
|
|
18
|
-
@use "
|
|
19
|
-
@use "components/
|
|
20
|
-
@use "components/
|
|
16
|
+
@use "components/table.scss";
|
|
17
|
+
@use "foundations/links.scss";
|
|
18
|
+
@use "foundations/buttons";
|
|
19
|
+
@use "components/admin-panel.scss";
|
|
20
|
+
@use "components/dialog.scss";
|
|
21
|
+
|
|
22
|
+
@use "components/pagination.scss";
|
|
21
23
|
|
|
22
24
|
// Bootstrap elements
|
|
23
|
-
@import "
|
|
24
|
-
@import "
|
|
25
|
-
@import "../../node_modules/bootstrap/scss/_badge.scss";
|
|
25
|
+
@import "../bootstrap/scss/_transitions.scss";
|
|
26
|
+
@import "../bootstrap/scss/_badge.scss";
|
|
26
27
|
|
|
27
28
|
// Helpers
|
|
28
|
-
//@import "
|
|
29
|
-
@import "
|
|
30
|
-
//@import "
|
|
31
|
-
@import "
|
|
32
|
-
@import "
|
|
33
|
-
@import "
|
|
34
|
-
@import "
|
|
35
|
-
//@import "
|
|
36
|
-
@import "
|
|
37
|
-
//@import "
|
|
29
|
+
//@import "../bootstrap/scss/helpers";
|
|
30
|
+
@import "../bootstrap/scss/helpers/clearfix";
|
|
31
|
+
//@import "../bootstrap/scss/helpers/colored-links";
|
|
32
|
+
@import "../bootstrap/scss/helpers/ratio";
|
|
33
|
+
@import "../bootstrap/scss/helpers/position";
|
|
34
|
+
@import "../bootstrap/scss/helpers/stacks";
|
|
35
|
+
@import "../bootstrap/scss/helpers/visually-hidden";
|
|
36
|
+
//@import "../bootstrap/scss/helpers/stretched-link";
|
|
37
|
+
@import "../bootstrap/scss/helpers/text-truncation";
|
|
38
|
+
//@import "../bootstrap/scss/helpers/vr";
|
|
38
39
|
|
|
39
40
|
// Utilities
|
|
40
|
-
@import "
|
|
41
|
+
@import "../bootstrap/scss/utilities/_api.scss";
|
package/assets/sass/_forms.scss
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@use "_func" as *;
|
|
2
2
|
|
|
3
|
-
@import "
|
|
4
|
-
@import "
|
|
5
|
-
@import "
|
|
6
|
-
@import "
|
|
7
|
-
@import "
|
|
8
|
-
@import "
|
|
9
|
-
@import "
|
|
3
|
+
@import "../bootstrap/scss/forms/_labels";
|
|
4
|
+
@import "../bootstrap/scss/forms/_form-control";
|
|
5
|
+
@import "../bootstrap/scss/forms/_form-select";
|
|
6
|
+
@import "../bootstrap/scss/forms/_form-check";
|
|
7
|
+
@import "../bootstrap/scss/forms/_form-range";
|
|
8
|
+
@import "../bootstrap/scss/forms/_input-group";
|
|
9
|
+
@import "../bootstrap/scss/forms/_validation";
|
|
10
10
|
@import "components/forms.scss";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "../../bootstrap/scss/_mixins";
|
|
2
2
|
|
|
3
3
|
@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
|
|
4
4
|
|
|
@@ -134,20 +134,12 @@
|
|
|
134
134
|
|
|
135
135
|
@mixin reset-colours($compatible:$compatible) {
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
--colour-border: var(--colour-border-theme);
|
|
144
|
-
--colour-brand: var(--colour-primary);
|
|
145
|
-
|
|
146
|
-
--btn-bg: var(--colour-warning);
|
|
147
|
-
--btn-text: var(--colour-primary);
|
|
148
|
-
--btn-hover-text: var(--colour-primary);
|
|
149
|
-
--btn-tertiary-bg: var(--colour-primary);
|
|
150
|
-
--btn-tertiary-hover-text: white;
|
|
137
|
+
@each $color, $value in $non-theme-colors {
|
|
138
|
+
|
|
139
|
+
--colour-#{$color}: #{$value};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
151
143
|
|
|
152
144
|
.text-primary {
|
|
153
145
|
color: var(--colour-primary)!important;
|
|
@@ -156,16 +148,22 @@
|
|
|
156
148
|
|
|
157
149
|
@mixin invert-colours($compatible:$compatible) {
|
|
158
150
|
|
|
151
|
+
@each $color, $value in $dark-mode-colors {
|
|
152
|
+
|
|
153
|
+
--colour-#{$color}: #{$value};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
--btn-bg: var(--colour-inverted);
|
|
157
|
+
--btn-text: var(--colour-primary);
|
|
158
|
+
--btn-hover-text: var(--colour-heading);
|
|
159
|
+
--btn-tertiary-bg: var(--colour-inverted);;
|
|
160
|
+
--btn-tertiary-hover-text: var(--colour-primary);
|
|
161
|
+
|
|
162
|
+
|
|
159
163
|
--colour-body: #{$colour-inverted};
|
|
160
164
|
--colour-heading: #{$colour-inverted};
|
|
161
165
|
--colour-link: #{$colour-inverted};
|
|
162
166
|
--colour-hover: #{$colour-inverted};
|
|
163
167
|
--colour-border: #{$colour-inverted};
|
|
164
168
|
--colour-brand: #{$colour-inverted};
|
|
165
|
-
|
|
166
|
-
--btn-bg: #{$colour-inverted};
|
|
167
|
-
--btn-text: var(--colour-primary);
|
|
168
|
-
--btn-hover-text: var(--colour-heading);
|
|
169
|
-
--btn-tertiary-bg: #{$colour-inverted};
|
|
170
|
-
--btn-tertiary-hover-text: var(--colour-primary);
|
|
171
169
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use "functions" as *;
|
|
2
2
|
|
|
3
|
-
@import "
|
|
3
|
+
@import "../../bootstrap/scss/_utilities";
|
|
4
4
|
|
|
5
5
|
// #region Sizing
|
|
6
6
|
/* Enhance the max width utility to include fit-content which can come in handy for flex-box based layouts. */
|
|
@@ -104,7 +104,6 @@ $utilities: map-merge(
|
|
|
104
104
|
// #endregion
|
|
105
105
|
|
|
106
106
|
// #region Gradient colours
|
|
107
|
-
|
|
108
107
|
$utilities: map-merge(
|
|
109
108
|
$utilities,
|
|
110
109
|
(
|
|
@@ -116,29 +115,88 @@ $utilities: map-merge(
|
|
|
116
115
|
),
|
|
117
116
|
values:
|
|
118
117
|
(
|
|
119
|
-
"
|
|
118
|
+
"success": linear-gradient(var(--gradient-direction), var(--colour-success) 0, transparent 100%),
|
|
120
119
|
"primary": linear-gradient(var(--gradient-direction), var(--colour-primary) 0, transparent 100%),
|
|
121
120
|
"info": linear-gradient(var(--gradient-direction), var(--colour-info) 0, transparent 100%)
|
|
122
121
|
)
|
|
122
|
+
),
|
|
123
|
+
"colour": (
|
|
124
|
+
property: --colour,
|
|
125
|
+
class: colour,
|
|
126
|
+
values:
|
|
127
|
+
(
|
|
128
|
+
"primary": var(--colour-primary),
|
|
129
|
+
"secondary": var(--colour-secondary),
|
|
130
|
+
"info": var(--colour-info),
|
|
131
|
+
"success": var(--colour-success),
|
|
132
|
+
"warning": var(--colour-warning),
|
|
133
|
+
"danger": var(--colour-danger),
|
|
134
|
+
"light": var(--colour-light),
|
|
135
|
+
"dark": var(--colour-dark),
|
|
136
|
+
"admin": var(--colour-admin)
|
|
137
|
+
)
|
|
123
138
|
)
|
|
124
139
|
)
|
|
125
140
|
);
|
|
126
141
|
$utilities: map-merge(
|
|
127
142
|
$utilities,
|
|
128
|
-
(
|
|
143
|
+
(
|
|
129
144
|
"gradient-direction": (
|
|
130
145
|
css-var: true,
|
|
131
146
|
class: gradient-direction,
|
|
132
147
|
values:
|
|
133
148
|
(
|
|
134
149
|
"left": 90deg,
|
|
135
|
-
"
|
|
136
|
-
"up": 360deg
|
|
150
|
+
"angle": 135deg
|
|
137
151
|
)
|
|
138
152
|
)
|
|
139
153
|
)
|
|
140
154
|
);
|
|
155
|
+
// #endregion
|
|
141
156
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
157
|
+
// #region Tint helper classes
|
|
158
|
+
$utilities: map-merge(
|
|
159
|
+
$utilities,
|
|
160
|
+
(
|
|
161
|
+
"bg-opacity": (
|
|
162
|
+
css-var: true,
|
|
163
|
+
class: bg-opacity,
|
|
164
|
+
values:
|
|
165
|
+
(
|
|
166
|
+
"10": 0.1,
|
|
167
|
+
"20": 0.2,
|
|
168
|
+
"30": 0.3,
|
|
169
|
+
"40": 0.4,
|
|
170
|
+
"50": 0.5,
|
|
171
|
+
"60": 0.6,
|
|
172
|
+
"70": 0.7,
|
|
173
|
+
"80": 0.8,
|
|
174
|
+
"90": 0.9,
|
|
175
|
+
"100": 1
|
|
176
|
+
)
|
|
177
|
+
)
|
|
178
|
+
)
|
|
179
|
+
);
|
|
180
|
+
$utilities: map-merge(
|
|
181
|
+
$utilities,
|
|
182
|
+
(
|
|
183
|
+
"text-opacity": (
|
|
184
|
+
css-var: true,
|
|
185
|
+
class: text-opacity,
|
|
186
|
+
values:
|
|
187
|
+
(
|
|
188
|
+
"10": 0.1,
|
|
189
|
+
"20": 0.2,
|
|
190
|
+
"30": 0.3,
|
|
191
|
+
"40": 0.4,
|
|
192
|
+
"50": 0.5,
|
|
193
|
+
"60": 0.6,
|
|
194
|
+
"70": 0.7,
|
|
195
|
+
"80": 0.8,
|
|
196
|
+
"90": 0.9,
|
|
197
|
+
"100": 1
|
|
198
|
+
)
|
|
199
|
+
)
|
|
200
|
+
)
|
|
201
|
+
);
|
|
202
|
+
// #endregion
|