@iamproperty/components 6.0.0 → 6.1.0--beta
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/README.md +8 -7
- package/assets/bootstrap/js/index.esm.js +19 -0
- package/assets/bootstrap/js/index.umd.js +34 -0
- package/assets/bootstrap/js/src/alert.js +1 -1
- package/assets/bootstrap/js/src/base-component.js +2 -2
- package/assets/bootstrap/js/src/button.js +1 -1
- package/assets/bootstrap/js/src/carousel.js +1 -1
- package/assets/bootstrap/js/src/collapse.js +1 -1
- package/assets/bootstrap/js/src/dom/data.js +1 -1
- package/assets/bootstrap/js/src/dom/event-handler.js +1 -1
- package/assets/bootstrap/js/src/dom/manipulator.js +1 -1
- package/assets/bootstrap/js/src/dom/selector-engine.js +1 -1
- package/assets/bootstrap/js/src/dropdown.js +3 -12
- package/assets/bootstrap/js/src/modal.js +13 -17
- package/assets/bootstrap/js/src/offcanvas.js +1 -1
- package/assets/bootstrap/js/src/popover.js +1 -1
- package/assets/bootstrap/js/src/scrollspy.js +10 -14
- package/assets/bootstrap/js/src/tab.js +4 -2
- package/assets/bootstrap/js/src/toast.js +4 -9
- package/assets/bootstrap/js/src/tooltip.js +50 -32
- package/assets/bootstrap/js/src/util/backdrop.js +1 -1
- package/assets/bootstrap/js/src/util/component-functions.js +1 -1
- package/assets/bootstrap/js/src/util/config.js +1 -1
- package/assets/bootstrap/js/src/util/focustrap.js +1 -1
- package/assets/bootstrap/js/src/util/index.js +1 -1
- package/assets/bootstrap/js/src/util/sanitizer.js +1 -1
- package/assets/bootstrap/js/src/util/scrollbar.js +1 -1
- package/assets/bootstrap/js/src/util/swipe.js +1 -1
- package/assets/bootstrap/js/src/util/template-factory.js +1 -1
- package/assets/bootstrap/package.json +27 -28
- package/assets/bootstrap/scss/_accordion.scss +4 -7
- package/assets/bootstrap/scss/_button-group.scss +1 -1
- package/assets/bootstrap/scss/_buttons.scss +7 -28
- package/assets/bootstrap/scss/_carousel.scss +3 -0
- package/assets/bootstrap/scss/_dropdown.scss +1 -2
- package/assets/bootstrap/scss/_functions.scss +2 -2
- package/assets/bootstrap/scss/_list-group.scss +5 -6
- package/assets/bootstrap/scss/_modal.scss +1 -1
- package/assets/bootstrap/scss/_nav.scss +2 -2
- package/assets/bootstrap/scss/_navbar.scss +0 -2
- package/assets/bootstrap/scss/_offcanvas.scss +4 -5
- package/assets/bootstrap/scss/_pagination.scss +1 -1
- package/assets/bootstrap/scss/_popover.scss +5 -5
- package/assets/bootstrap/scss/_toasts.scss +2 -5
- package/assets/bootstrap/scss/_variables-dark.scss +87 -0
- package/assets/bootstrap/scss/_variables.scss +17 -18
- package/assets/bootstrap/scss/bootstrap-utilities.scss +0 -3
- package/assets/bootstrap/scss/forms/_floating-labels.scss +0 -1
- package/assets/bootstrap/scss/forms/_input-group.scss +4 -7
- package/assets/bootstrap/scss/helpers/_focus-ring.scss +5 -0
- package/assets/bootstrap/scss/helpers/_icon-link.scss +25 -0
- package/assets/bootstrap/scss/mixins/_banner.scss +2 -2
- package/assets/bootstrap/scss/mixins/_color-mode.scss +21 -0
- package/assets/bootstrap/scss/mixins/_forms.scss +10 -10
- package/assets/bootstrap/scss/mixins/_table-variants.scss +2 -2
- package/assets/bootstrap/scss/mixins/_utilities.scss +1 -1
- package/assets/css/components/barchart.component.css +1 -1
- package/assets/css/components/barchart.component.css.map +1 -1
- package/assets/css/components/card.component.css +1 -0
- package/assets/css/components/card.component.css.map +1 -0
- package/assets/css/components/card.module.css +1 -0
- package/assets/css/components/card.module.css.map +1 -0
- package/assets/css/components/charts.config.css +1 -1
- package/assets/css/components/charts.config.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/charts.module.css +1 -1
- package/assets/css/components/charts.module.css.map +1 -1
- package/assets/css/components/filter-card.component.css +1 -0
- package/assets/css/components/filter-card.component.css.map +1 -0
- package/assets/css/components/multiselect.preload.css +1 -1
- package/assets/css/components/multiselect.preload.css.map +1 -1
- package/assets/css/components/record-card.component.css +1 -0
- package/assets/css/components/record-card.component.css.map +1 -0
- package/assets/css/components/timeline.css +1 -1
- package/assets/css/components/timeline.css.map +1 -1
- package/assets/css/components/video-card.component.css +1 -0
- package/assets/css/components/video-card.component.css.map +1 -0
- 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/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +5 -5
- package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js.map +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js.map +1 -1
- package/assets/js/components/barchart/barchart.component.js +2 -0
- package/assets/js/components/barchart/barchart.component.min.js +4 -2
- package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
- package/assets/js/components/card/card.component.js +92 -154
- package/assets/js/components/card/card.component.min.js +26 -31
- package/assets/js/components/card/card.component.min.js.map +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +1 -1
- package/assets/js/components/carousel/carousel.component.min.js.map +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js.map +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js.map +1 -1
- package/assets/js/components/filter-card/filter-card.component.js +71 -0
- package/assets/js/components/filter-card/filter-card.component.min.js +27 -0
- package/assets/js/components/filter-card/filter-card.component.min.js.map +1 -0
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js.map +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.min.js.map +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js.map +1 -1
- package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.min.js.map +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js.map +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js.map +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js.map +1 -1
- package/assets/js/components/record-card/record-card.component.js +69 -0
- package/assets/js/components/record-card/record-card.component.min.js +27 -0
- package/assets/js/components/record-card/record-card.component.min.js.map +1 -0
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js.map +1 -1
- package/assets/js/components/table/table.component.min.js +2 -2
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js.map +1 -1
- package/assets/js/components/video-card/video-card.component.js +176 -0
- package/assets/js/components/video-card/video-card.component.min.js +30 -0
- package/assets/js/components/video-card/video-card.component.min.js.map +1 -0
- package/assets/js/components.bundle.js +5 -0
- package/assets/js/components.bundle.js.map +1 -0
- package/assets/js/components.js +30 -0
- package/assets/js/modules/card.module.js +33 -0
- package/assets/js/modules/chart.js +2 -2
- package/assets/js/modules/dialogs.js +0 -6
- package/assets/js/modules/table.js +1 -1
- package/assets/js/scripts.bundle.js +3 -194
- 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/scripts.js +17 -0
- package/assets/js/tests/filterlist.spec.js +1 -1
- package/assets/sass/_components.scss +81 -1
- package/assets/sass/_corefiles.scss +4 -10
- package/assets/sass/_elements.scss +2 -0
- package/assets/sass/components/card.component.scss +229 -0
- package/assets/sass/components/card.module.scss +154 -0
- package/assets/sass/components/charts.config.scss +3 -0
- package/assets/sass/components/charts.module.scss +5 -3
- package/assets/sass/components/filter-card.component.scss +106 -0
- package/assets/sass/components/multiselect.preload.scss +7 -0
- package/assets/sass/components/record-card.component.scss +204 -0
- package/assets/sass/components/video-card.component.scss +80 -0
- package/assets/sass/components.reset.scss +5 -43
- package/assets/sass/elements/badge-tag.scss +5 -1
- package/assets/sass/elements/buttons.scss +3 -0
- package/assets/sass/elements/dialog.scss +2 -744
- package/assets/sass/elements/forms.scss +5 -0
- package/assets/sass/elements/media.scss +0 -38
- package/assets/sass/elements/modal.scss +553 -0
- package/assets/sass/elements/popover.scss +207 -0
- package/assets/sass/foundations/reboot.scss +2 -2
- package/assets/sass/foundations/root.scss +0 -1
- package/assets/ts/components/barchart/barchart.component.ts +2 -0
- package/assets/ts/components/card/card.component.ts +94 -192
- package/assets/ts/components/filter-card/filter-card.component.ts +81 -0
- package/assets/ts/components/record-card/record-card.component.ts +82 -0
- package/assets/ts/components/video-card/video-card.component.ts +227 -0
- package/assets/ts/components.ts +38 -0
- package/assets/ts/modules/card.module.ts +43 -0
- package/assets/ts/modules/dialogs.ts +0 -8
- package/assets/ts/modules/table.ts +1 -1
- package/assets/ts/scripts.ts +22 -0
- package/assets/ts/tests/filterlist.spec.ts +1 -1
- package/dist/components.es.js +201 -201
- package/dist/components.umd.js +76 -81
- package/package.json +8 -7
- package/src/components/BarChart/BarChart.vue +2 -2
- package/src/components/FilterCard/FilterCard.vue +25 -0
- package/src/components/RecordCard/RecordCard.vue +25 -0
- package/src/components/VideoCard/VideoCard.vue +25 -0
- package/assets/css/components/card.css +0 -1
- package/assets/css/components/card.css.map +0 -1
- package/assets/css/components/card.global.css +0 -1
- package/assets/css/components/card.global.css.map +0 -1
- package/assets/css/components/card.preload.css +0 -1
- package/assets/css/components/card.preload.css.map +0 -1
- package/assets/js/bundle.js +0 -74
- package/assets/js/dynamic.js +0 -80
- package/assets/js/dynamic.min.js +0 -18
- package/assets/js/dynamic.min.js.map +0 -1
- package/assets/js/flat-components.js +0 -84
- package/assets/js/modules/youtubevideo.js +0 -106
- package/assets/sass/components/card.global.scss +0 -102
- package/assets/sass/components/card.preload.scss +0 -8
- package/assets/sass/components/card.scss +0 -606
- package/assets/ts/bundle.ts +0 -94
- package/assets/ts/components/barchart/README.md +0 -37
- package/assets/ts/components/card/README.md +0 -39
- package/assets/ts/dynamic.ts +0 -107
- package/assets/ts/flat-components.ts +0 -106
- package/assets/ts/modules/youtubevideo.ts +0 -141
- package/src/foundations/YoutubeVideo/README.md +0 -11
- package/src/foundations/YoutubeVideo/YoutubeVideo.vue +0 -24
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
```
|
|
2
|
-
<iam-chart>
|
|
3
|
-
<table>
|
|
4
|
-
<thead>
|
|
5
|
-
<tr>
|
|
6
|
-
<th>Issue</th>
|
|
7
|
-
<th>Democrat</th>
|
|
8
|
-
<th>Republican</th>
|
|
9
|
-
</tr>
|
|
10
|
-
</thead>
|
|
11
|
-
<tbody>
|
|
12
|
-
<tr><td>Inflation</td><td>45%</td><td>18%</td></tr><tr><td>Abortion</td><td>12%</td><td>43%</td></tr>
|
|
13
|
-
<tr><td>Gun policy</td><td>8%</td><td>14%</td></tr><tr><td>Immigration</td><td>15%</td><td>5%</td></tr>
|
|
14
|
-
<tr><td>Crime</td><td>13%</td><td>10%</td></tr>
|
|
15
|
-
</tbody>
|
|
16
|
-
</table>
|
|
17
|
-
</iam-chart>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
**To do**
|
|
21
|
-
|
|
22
|
-
- Animation
|
|
23
|
-
- Add more chart types
|
|
24
|
-
- optimise code
|
|
25
|
-
- change key
|
|
26
|
-
- Fill in readme with class and attributes
|
|
27
|
-
- flout
|
|
28
|
-
|
|
29
|
-
**Note**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
**Properties**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
**Class modifiers**
|
|
36
|
-
|
|
37
|
-
- .chart--no-animate turns of the animation
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
**Add the below to your initialise script**
|
|
2
|
-
|
|
3
|
-
```
|
|
4
|
-
import('../node_modules/@iamproperty/components/assets/js/components/card/card.component.min').then(module => { // Might need to update the path
|
|
5
|
-
|
|
6
|
-
if (!window.customElements.get(`iam-card`))
|
|
7
|
-
window.customElements.define(`iam-card`, module.default);
|
|
8
|
-
|
|
9
|
-
}).catch((err) => {
|
|
10
|
-
console.log(err.message);
|
|
11
|
-
});
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
**Add the below HTML code to where you want the component to live.**
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
<a href="/link-url">
|
|
18
|
-
<iam-card>Link content</iam-card>
|
|
19
|
-
</a>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Note**
|
|
23
|
-
|
|
24
|
-
The card component needs to be wrapped with a link or a button, this is required to give the card any functionality.
|
|
25
|
-
|
|
26
|
-
**Properties**
|
|
27
|
-
|
|
28
|
-
| Option | Type | Default Value | Description |
|
|
29
|
-
| ------ | ---- | ------------- | ----------- |
|
|
30
|
-
| data-total | Int | - | Optional total number , usually use on the filter card type |
|
|
31
|
-
| data-image | image url | - | Optional image url to create a card header with an image as its background |
|
|
32
|
-
|
|
33
|
-
**Class modifiers**
|
|
34
|
-
|
|
35
|
-
- Adding a class of **.card--filter** will implement the filter card design.
|
|
36
|
-
- Adding a class of **.colour-danger** will add a left hand border with the danger colour (See status card). This works with all of the theme
|
|
37
|
-
- Adding a class of **.border-o** will remove the box-shadow of the card and make some minor sizing adjustments.
|
|
38
|
-
- Adding a class like **.colour-warning** will update the colour of the left berder for the card. The theme colours will be avialable to use.
|
|
39
|
-
- Adding a class of **.card--flag** will add a card to the top right corner.
|
package/assets/ts/dynamic.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Modules
|
|
3
|
-
import * as helpers from '../js/modules/helpers'
|
|
4
|
-
import extendDialogs from '../js/modules/dialogs'
|
|
5
|
-
import createDataLayer from '../js/modules/data-layer'
|
|
6
|
-
import extendInputs from '../js/modules/inputs';
|
|
7
|
-
import nav from '../js/modules/nav'
|
|
8
|
-
import table from '../js/modules/table'
|
|
9
|
-
import testimonial from '../js/modules/testimonial'
|
|
10
|
-
import carousel from '../js/modules/carousel'
|
|
11
|
-
import form from '../js/modules/form'
|
|
12
|
-
import youtubeVideo from '../js/modules/youtubevideo'
|
|
13
|
-
|
|
14
|
-
import iamNotification from './components/notification/notification.component'
|
|
15
|
-
|
|
16
|
-
const components = ['accordion','header','tabs', 'table','card','pagination','filterlist', 'applied-filters', 'nav', 'marketing'];
|
|
17
|
-
const prefix = "iam"
|
|
18
|
-
const options = {
|
|
19
|
-
rootMargin: '50px',
|
|
20
|
-
threshold: 0.1
|
|
21
|
-
}
|
|
22
|
-
const componentExt = ".component.min.js";
|
|
23
|
-
|
|
24
|
-
// Load components - Each component will load once the first of its type has been loaded
|
|
25
|
-
components.forEach((component) => {
|
|
26
|
-
|
|
27
|
-
console.log(component)
|
|
28
|
-
|
|
29
|
-
if(document.getElementsByTagName(`${prefix}-${component}`).length === 0)
|
|
30
|
-
return;
|
|
31
|
-
|
|
32
|
-
let callback = (entries:any) => {
|
|
33
|
-
entries.forEach((entry:any) => {
|
|
34
|
-
|
|
35
|
-
if(entry.intersectionRatio > 0){
|
|
36
|
-
|
|
37
|
-
console.log(component)
|
|
38
|
-
|
|
39
|
-
import(`./components/${component}/${component}${componentExt}`).then(module => {
|
|
40
|
-
if (!window.customElements.get(`${prefix}-${component}`))
|
|
41
|
-
window.customElements.define(`${prefix}-${component}`, module.default);
|
|
42
|
-
}).catch((err) => {
|
|
43
|
-
console.log(err.message);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
intObserver.unobserve(entry.target);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const intObserver = new IntersectionObserver(callback, options);
|
|
52
|
-
intObserver.observe(document.getElementsByTagName(`${prefix}-${component}`)[0]);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// Attach classes to dom elements
|
|
57
|
-
document.addEventListener("DOMContentLoaded", function() {
|
|
58
|
-
|
|
59
|
-
createDataLayer();
|
|
60
|
-
|
|
61
|
-
// Global stuff
|
|
62
|
-
helpers.addBodyClasses(document.body);
|
|
63
|
-
helpers.addGlobalEvents(document.body);
|
|
64
|
-
//helpers.checkElements(document.body);
|
|
65
|
-
extendDialogs(document.body);
|
|
66
|
-
extendInputs(document.body);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!window.customElements.get(`iam-notification`))
|
|
70
|
-
window.customElements.define(`iam-notification`, iamNotification);
|
|
71
|
-
|
|
72
|
-
// ANav
|
|
73
|
-
Array.from(document.querySelectorAll('.nav')).forEach((arrayElement) => {
|
|
74
|
-
nav(arrayElement);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// Testimonial
|
|
78
|
-
Array.from(document.querySelectorAll('.testimonial')).forEach((arrayElement) => {
|
|
79
|
-
testimonial(arrayElement);
|
|
80
|
-
});
|
|
81
|
-
// Carousel
|
|
82
|
-
Array.from(document.querySelectorAll('.carousel')).forEach((arrayElement) => {
|
|
83
|
-
carousel(arrayElement);
|
|
84
|
-
});
|
|
85
|
-
// Form
|
|
86
|
-
Array.from(document.querySelectorAll('form')).forEach((arrayElement) => {
|
|
87
|
-
form(arrayElement);
|
|
88
|
-
});
|
|
89
|
-
// YouTube videos
|
|
90
|
-
Array.from(document.querySelectorAll('.youtube-embed')).forEach((arrayElement) => {
|
|
91
|
-
|
|
92
|
-
console.log(arrayElement)
|
|
93
|
-
|
|
94
|
-
new youtubeVideo(arrayElement);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
window.addEventListener('hashchange', function() {
|
|
99
|
-
|
|
100
|
-
const hash = location.hash.replace('#','');
|
|
101
|
-
const label = document.querySelector(`label[for="${hash}"]`);
|
|
102
|
-
|
|
103
|
-
if (label instanceof HTMLElement)
|
|
104
|
-
label.click();
|
|
105
|
-
|
|
106
|
-
}, false);
|
|
107
|
-
});
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Modules
|
|
3
|
-
import * as helpers from '../js/modules/helpers'
|
|
4
|
-
import extendDialogs from '../js/modules/dialogs'
|
|
5
|
-
import createDataLayer from '../js/modules/data-layer'
|
|
6
|
-
import extendInputs from '../js/modules/inputs';
|
|
7
|
-
import nav from '../js/modules/nav'
|
|
8
|
-
import * as tableModule from './modules/table'
|
|
9
|
-
import testimonial from '../js/modules/testimonial'
|
|
10
|
-
import carousel from '../js/modules/carousel'
|
|
11
|
-
import form from '../js/modules/form'
|
|
12
|
-
import youtubeVideo from '../js/modules/youtubevideo'
|
|
13
|
-
import tabs from '../js/modules/tabs'
|
|
14
|
-
import filterlist from '../js/modules/filterlist'
|
|
15
|
-
import createPaginationButttons from '../js/modules/pagination'
|
|
16
|
-
import setupNotification from '../js/modules/notification'
|
|
17
|
-
|
|
18
|
-
// Attach classes to dom elements
|
|
19
|
-
document.addEventListener("DOMContentLoaded", function() {
|
|
20
|
-
|
|
21
|
-
createDataLayer();
|
|
22
|
-
|
|
23
|
-
// Global stuff
|
|
24
|
-
helpers.addBodyClasses(document.body);
|
|
25
|
-
helpers.addGlobalEvents(document.body);
|
|
26
|
-
//helpers.checkElements(document.body);
|
|
27
|
-
extendDialogs(document.body);
|
|
28
|
-
extendInputs(document.body);
|
|
29
|
-
|
|
30
|
-
// ANav
|
|
31
|
-
Array.from(document.querySelectorAll('.nav')).forEach((arrayElement) => {
|
|
32
|
-
nav(arrayElement);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Advanced tables
|
|
36
|
-
Array.from(document.querySelectorAll('table')).forEach((arrayElement) => {
|
|
37
|
-
|
|
38
|
-
tableModule.addTableEventListeners(arrayElement);
|
|
39
|
-
tableModule.createMobileButton(arrayElement);
|
|
40
|
-
tableModule.addDataAttributes(arrayElement);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if(arrayElement.closest('.table--cta')){
|
|
44
|
-
|
|
45
|
-
const largestWidth = tableModule.getLargestLastColWidth(arrayElement);
|
|
46
|
-
arrayElement.closest('.table--cta').style.setProperty("--cta-width", `${largestWidth}rem`);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Testimonial
|
|
51
|
-
Array.from(document.querySelectorAll('.testimonial')).forEach((arrayElement) => {
|
|
52
|
-
testimonial(arrayElement);
|
|
53
|
-
});
|
|
54
|
-
// Carousel
|
|
55
|
-
Array.from(document.querySelectorAll('.carousel')).forEach((arrayElement) => {
|
|
56
|
-
carousel(arrayElement);
|
|
57
|
-
});
|
|
58
|
-
// Form
|
|
59
|
-
Array.from(document.querySelectorAll('form')).forEach((arrayElement) => {
|
|
60
|
-
form(arrayElement);
|
|
61
|
-
});
|
|
62
|
-
// YouTube videos
|
|
63
|
-
Array.from(document.querySelectorAll('.youtube-embed')).forEach((arrayElement) => {
|
|
64
|
-
new youtubeVideo(arrayElement);
|
|
65
|
-
});
|
|
66
|
-
// Tabs
|
|
67
|
-
Array.from(document.querySelectorAll('.tabs')).forEach((arrayElement) => {
|
|
68
|
-
tabs(arrayElement);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// filterlist
|
|
72
|
-
Array.from(document.querySelectorAll('.iam-filterlist')).forEach((arrayElement) => {
|
|
73
|
-
if(arrayElement.hasAttribute('data-input') && document.querySelector(arrayElement.getAttribute('data-input')))
|
|
74
|
-
filterlist(arrayElement.querySelector('ul'),document.querySelector(arrayElement.getAttribute('data-input')));
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// notification
|
|
79
|
-
Array.from(document.querySelectorAll('.iam-notification')).forEach((arrayElement) => {
|
|
80
|
-
if(arrayElement.hasAttribute('data-type'))
|
|
81
|
-
setupNotification(arrayElement);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
Array.from(document.querySelectorAll('.pagination__wrapper')).forEach((arrayElement) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const params = new URLSearchParams(window.location.search);
|
|
88
|
-
arrayElement.setAttribute('data-page', (params.has('page') ? params.get('page') : 1));
|
|
89
|
-
arrayElement.setAttribute('data-show', (params.has('show') ? params.get('show') : 15));
|
|
90
|
-
arrayElement.setAttribute('data-increment', 15);
|
|
91
|
-
arrayElement.setAttribute('data-pages', Math.ceil(arrayElement.getAttribute('data-total') / arrayElement.getAttribute('data-show')));
|
|
92
|
-
|
|
93
|
-
createPaginationButttons(arrayElement,arrayElement);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
window.addEventListener('hashchange', function() {
|
|
98
|
-
|
|
99
|
-
const hash = location.hash.replace('#','');
|
|
100
|
-
const label = document.querySelector(`label[for="${hash}"]`);
|
|
101
|
-
|
|
102
|
-
if (label instanceof HTMLElement)
|
|
103
|
-
label.click();
|
|
104
|
-
|
|
105
|
-
}, false);
|
|
106
|
-
});
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* Integrate YouTube videos as a way of hosting videos without the overhead and worry surrounding hosting vides. i.e. file sizes, performance and accessibility.
|
|
4
|
-
*/
|
|
5
|
-
class youtubeVideo {
|
|
6
|
-
|
|
7
|
-
/** @param {Element} embed dom element */
|
|
8
|
-
constructor(embed){
|
|
9
|
-
|
|
10
|
-
// If the scripts is already loaded then lets just create the embed
|
|
11
|
-
if(document.body.classList.contains('youtubeLoaded')){
|
|
12
|
-
embed.addEventListener('click', function(e){
|
|
13
|
-
|
|
14
|
-
// loop parent nodes from the target to the delegation node
|
|
15
|
-
for (var target = e.target; target && target != this; target = target.parentNode) {
|
|
16
|
-
|
|
17
|
-
if (target.matches('a')) {
|
|
18
|
-
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
createEmbed(target);
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}, false);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
this.loadScripts(embed, this.createEmbed);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Load the YouTube scripts before trying to create the embed
|
|
33
|
-
* @param {HTMLElement} embed dom element
|
|
34
|
-
*/
|
|
35
|
-
loadScripts(embed){
|
|
36
|
-
|
|
37
|
-
return new Promise((resolve, reject) => {
|
|
38
|
-
|
|
39
|
-
const image = new Image();
|
|
40
|
-
image.onload = function(){
|
|
41
|
-
|
|
42
|
-
// This code loads the IFrame Player API code asynchronously.
|
|
43
|
-
var tag = document.createElement('script');
|
|
44
|
-
tag.src = "https://www.youtube.com/iframe_api";
|
|
45
|
-
var firstScriptTag = document.getElementsByTagName('script')[0];
|
|
46
|
-
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
|
47
|
-
document.body.classList.add('youtubeLoaded');
|
|
48
|
-
resolve(true);
|
|
49
|
-
|
|
50
|
-
// script has loaded, you can now use it safely
|
|
51
|
-
tag.onload = () => {
|
|
52
|
-
embed.addEventListener('click', function(event){
|
|
53
|
-
console.log('click')
|
|
54
|
-
// loop parent nodes from the target to the delegation node
|
|
55
|
-
|
|
56
|
-
if (event && event.target instanceof HTMLElement && event.target.closest('a')) {
|
|
57
|
-
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
createEmbed(event.target.closest('a'));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}, false);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
image.onerror = function(){
|
|
67
|
-
reject(false);
|
|
68
|
-
};
|
|
69
|
-
image.src = "https://youtube.com/favicon.ico";
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Create the YouTube embed after the user has clicked on it.
|
|
76
|
-
* @param {HTMLElement} embed dom element
|
|
77
|
-
*/
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export const createEmbed = function(target){
|
|
81
|
-
|
|
82
|
-
// If there is more than one video lets make sure there is only one playing at a time.
|
|
83
|
-
if(typeof window.player != "undefined" && typeof window.player.pauseVideo == "function")
|
|
84
|
-
window.player.pauseVideo();
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var video_id = target.getAttribute('data-id');
|
|
88
|
-
var link_id = target.getAttribute('id')
|
|
89
|
-
|
|
90
|
-
// create an id to pass t the script if one isn't present
|
|
91
|
-
if(typeof link_id == 'undefined' || link_id == null){
|
|
92
|
-
|
|
93
|
-
var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26));
|
|
94
|
-
link_id = randLetter + Date.now();
|
|
95
|
-
target.setAttribute('id',link_id);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// This function creates an <iframe> (and YouTube player) after the API code downloads.
|
|
99
|
-
function onYouTubeIframeAPIReady() {
|
|
100
|
-
|
|
101
|
-
window.player = new YT.Player(link_id, {
|
|
102
|
-
height: '100%',
|
|
103
|
-
width: '100%',
|
|
104
|
-
videoId: video_id,
|
|
105
|
-
playerVars: {
|
|
106
|
-
'modestbranding': 1,
|
|
107
|
-
'playsinline': 1,
|
|
108
|
-
'rel': 0,
|
|
109
|
-
'showinfo': 0
|
|
110
|
-
},
|
|
111
|
-
events: {
|
|
112
|
-
'onReady': onPlayerReady,
|
|
113
|
-
'onStateChange': onPlayerStateChange
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
onYouTubeIframeAPIReady();
|
|
119
|
-
|
|
120
|
-
// The API will call this function when the video player is ready.
|
|
121
|
-
function onPlayerReady(event) {
|
|
122
|
-
// Play the video straight away
|
|
123
|
-
event.target.playVideo();
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// The API calls this function when the player's state changes.
|
|
128
|
-
// The function indicates that when playing a video (state=1)
|
|
129
|
-
var done = false;
|
|
130
|
-
function onPlayerStateChange(event) {
|
|
131
|
-
|
|
132
|
-
if (event.data == YT.PlayerState.PLAYING && !done) {
|
|
133
|
-
|
|
134
|
-
var link = document.getElementById(link_id);
|
|
135
|
-
link.classList.add('player-ready');
|
|
136
|
-
|
|
137
|
-
done = true;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
export default youtubeVideo
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="youtube-embed ratio ratio-16x9" ref="wrapper">
|
|
3
|
-
<a :href="`https://www.youtube.com/watch?v=${video}`" target="_blank" title="Investments Video" :data-id="video">
|
|
4
|
-
<img :src="`https://img.youtube.com/vi/${video}/maxresdefault.jpg`" alt="">
|
|
5
|
-
<span class="btn btn-secondary">Play Video</span>
|
|
6
|
-
</a>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
<script>
|
|
10
|
-
import youtubeVideo from '../../../assets/ts/modules/youtubevideo'
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
name: 'YoutubeVideo',
|
|
14
|
-
props: {
|
|
15
|
-
video: {
|
|
16
|
-
type: String,
|
|
17
|
-
required: true
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
mounted(){
|
|
21
|
-
new youtubeVideo(this.$refs.wrapper);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
</script>
|