@madgex/design-system 1.47.1 → 1.47.3
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/coverage/cobertura-coverage.xml +61 -59
- package/coverage/components/accordion/accordion.js.html +1 -1
- package/coverage/components/accordion/index.html +1 -1
- package/coverage/components/inputs/combobox/combobox.js.html +121 -0
- package/coverage/components/inputs/combobox/index.html +110 -0
- package/coverage/components/inputs/combobox/vue-components/Combobox.vue.html +1 -1
- package/coverage/components/inputs/combobox/vue-components/index.html +1 -1
- package/coverage/components/inputs/multi-select/index.html +110 -0
- package/coverage/{js/fractal-scripts/multiselect.js.html → components/inputs/multi-select/multi-select.js.html} +41 -56
- package/coverage/components/inputs/multi-select/vue-components/MultiSelect.vue.html +1 -1
- package/coverage/components/inputs/multi-select/vue-components/MultiSelectCheckbox.vue.html +1 -1
- package/coverage/components/inputs/multi-select/vue-components/MultiSelectCheckboxGroup.vue.html +1 -1
- package/coverage/components/inputs/multi-select/vue-components/index.html +1 -1
- package/coverage/components/modal/index.html +1 -1
- package/coverage/components/modal/modal.js.html +1 -1
- package/coverage/components/notification/index.html +1 -1
- package/coverage/components/notification/notification.js.html +1 -1
- package/coverage/components/popover/index.html +1 -1
- package/coverage/components/popover/popover.js.html +1 -1
- package/coverage/components/switch-state/index.html +1 -1
- package/coverage/components/switch-state/switch-state.js.html +1 -1
- package/coverage/components/tabs/index.html +1 -1
- package/coverage/components/tabs/tabs.js.html +1 -1
- package/coverage/index.html +47 -17
- package/coverage/js/common.js.html +1 -1
- package/coverage/js/fractal-scripts/combobox.js.html +1 -1
- package/coverage/js/fractal-scripts/index.html +5 -20
- package/coverage/js/fractal-scripts/notification.js.html +1 -1
- package/coverage/js/fractal-scripts/switch-state.js.html +1 -1
- package/coverage/js/index-fractal.js.html +4 -10
- package/coverage/js/index-polyfills.js.html +1 -1
- package/coverage/js/index-vue.js.html +10 -34
- package/coverage/js/index.html +11 -11
- package/coverage/js/index.js.html +1 -1
- package/coverage/js/polyfills/closest.js.html +1 -1
- package/coverage/js/polyfills/index.html +1 -1
- package/coverage/js/polyfills/remove.js.html +1 -1
- package/coverage/tokens/_config.js.html +1 -1
- package/coverage/tokens/index.html +1 -1
- package/dist/_tokens/css/_tokens.css +1 -1
- package/dist/_tokens/js/_tokens-module.js +1 -1
- package/dist/_tokens/scss/_tokens.scss +1 -1
- package/dist/assets/icons.json +1 -1
- package/dist/css/index.css +1 -1
- package/dist/js/index.js +6 -6
- package/fractal.js +3 -0
- package/package.json +1 -1
- package/src/components/inputs/combobox/combobox.js +14 -0
- package/src/components/inputs/multi-select/multi-select.js +32 -0
- package/src/js/index-fractal.js +0 -2
- package/src/js/index-vue.js +4 -12
- package/src/scss/core/_lists.scss +2 -2
- package/src/scss/resets/__index.scss +0 -8
- package/src/typography/font-types.config.json +3 -0
- package/src/typography/font-types.njk +22 -32
- package/src/js/fractal-scripts/multiselect.js +0 -37
package/fractal.js
CHANGED
|
@@ -50,6 +50,9 @@ fractal.components.set('ext', '.njk');
|
|
|
50
50
|
fractal.components.set('path', path.join(__dirname, 'src'));
|
|
51
51
|
fractal.components.set('default.collated', 'true');
|
|
52
52
|
fractal.components.set('default.preview', '@preview');
|
|
53
|
+
fractal.components.set('default.context', {
|
|
54
|
+
tokens,
|
|
55
|
+
});
|
|
53
56
|
|
|
54
57
|
/*
|
|
55
58
|
* Tell Fractal where to look for documentation pages.
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Combobox from './vue-components/Combobox.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'mds-combobox',
|
|
5
|
+
component: Combobox,
|
|
6
|
+
hooks: {
|
|
7
|
+
connectedCallback() {
|
|
8
|
+
// If the custom element has loaded, clear up any fallback elements that could cause ID clashes or weirdness in form submission
|
|
9
|
+
const fallbackInput = this.parentElement.querySelector('input');
|
|
10
|
+
|
|
11
|
+
if (fallbackInput) fallbackInput.remove();
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import MultiSelect from './vue-components/MultiSelect.vue';
|
|
2
|
+
|
|
3
|
+
const optionsGroupSelector = '.mds-multiselect__checkbox-group';
|
|
4
|
+
const optionSelector = ':scope > .mds-multiselect__checkbox';
|
|
5
|
+
|
|
6
|
+
function constructOptionsList(rootGroup) {
|
|
7
|
+
const parentOptions = Array.from(rootGroup.querySelectorAll(optionSelector));
|
|
8
|
+
return parentOptions.reduce((optionsList, option) => {
|
|
9
|
+
const childGroup = option.querySelector(optionsGroupSelector);
|
|
10
|
+
const input = option.querySelector('input');
|
|
11
|
+
const label = option.querySelector('label');
|
|
12
|
+
optionsList.push({
|
|
13
|
+
id: input.id,
|
|
14
|
+
name: input.name,
|
|
15
|
+
value: input.value,
|
|
16
|
+
label: label.innerText,
|
|
17
|
+
checked: input.checked,
|
|
18
|
+
children: childGroup ? constructOptionsList(childGroup) : null,
|
|
19
|
+
});
|
|
20
|
+
return optionsList;
|
|
21
|
+
}, []);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'mds-multiselect',
|
|
26
|
+
component: MultiSelect,
|
|
27
|
+
hooks: {
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this.options = constructOptionsList(this.parentElement.querySelector(optionsGroupSelector));
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
package/src/js/index-fractal.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import switchStateScript from './fractal-scripts/switch-state';
|
|
2
2
|
import notificationScript from './fractal-scripts/notification';
|
|
3
3
|
import comboboxScript from './fractal-scripts/combobox';
|
|
4
|
-
import multiselectScript from './fractal-scripts/multiselect';
|
|
5
4
|
|
|
6
5
|
document.addEventListener('DOMContentLoaded', () => {
|
|
7
6
|
switchStateScript.init();
|
|
8
7
|
notificationScript.init();
|
|
9
8
|
comboboxScript.init();
|
|
10
|
-
multiselectScript.init();
|
|
11
9
|
});
|
package/src/js/index-vue.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import 'document-register-element/build/document-register-element';
|
|
2
2
|
import Vue from 'vue';
|
|
3
3
|
import vueCustomElement from 'vue-custom-element';
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import MultiSelect from '../components/inputs/multi-select/vue-components/MultiSelect.vue';
|
|
4
|
+
import MdsCombobox from '../components/inputs/combobox/combobox';
|
|
5
|
+
import MdsMultiSelect from '../components/inputs/multi-select/multi-select';
|
|
7
6
|
|
|
8
7
|
Vue.use(vueCustomElement);
|
|
9
8
|
Vue.config.devtools = process.env.NODE_ENV === 'development';
|
|
@@ -11,13 +10,6 @@ Vue.config.devtools = process.env.NODE_ENV === 'development';
|
|
|
11
10
|
Vue.config.keyCodes.end = 35;
|
|
12
11
|
Vue.config.keyCodes.home = 36;
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// If the custom element has loaded, clear up any fallback elements that could cause ID clashes or weirdness in form submission
|
|
17
|
-
const fallbackInput = this.parentElement.querySelector('input');
|
|
18
|
-
|
|
19
|
-
if (fallbackInput) fallbackInput.remove();
|
|
20
|
-
},
|
|
13
|
+
[MdsCombobox, MdsMultiSelect].forEach(({ name, component, hooks }) => {
|
|
14
|
+
Vue.customElement(name, component, hooks);
|
|
21
15
|
});
|
|
22
|
-
|
|
23
|
-
Vue.customElement('mds-multiselect', MultiSelect);
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
margin: 0;
|
|
37
37
|
}
|
|
38
38
|
.mds-list__key {
|
|
39
|
-
@extend .mds-font-
|
|
39
|
+
@extend .mds-font-brevier;
|
|
40
40
|
font-weight: bold;
|
|
41
41
|
margin-bottom: $mds-size-baseline;
|
|
42
42
|
}
|
|
43
43
|
.mds-list__value {
|
|
44
44
|
margin-bottom: $mds-size-baseline * 3;
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
&:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
@@ -18,12 +18,9 @@ a,
|
|
|
18
18
|
abbr,
|
|
19
19
|
acronym,
|
|
20
20
|
address,
|
|
21
|
-
big,
|
|
22
|
-
cite,
|
|
23
21
|
code,
|
|
24
22
|
del,
|
|
25
23
|
dfn,
|
|
26
|
-
em,
|
|
27
24
|
img,
|
|
28
25
|
ins,
|
|
29
26
|
kbd,
|
|
@@ -32,14 +29,9 @@ s,
|
|
|
32
29
|
samp,
|
|
33
30
|
small,
|
|
34
31
|
strike,
|
|
35
|
-
strong,
|
|
36
|
-
sub,
|
|
37
|
-
sup,
|
|
38
32
|
tt,
|
|
39
33
|
var,
|
|
40
|
-
b,
|
|
41
34
|
u,
|
|
42
|
-
i,
|
|
43
35
|
center,
|
|
44
36
|
dl,
|
|
45
37
|
dt,
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{
|
|
2
|
+
"notes": "## Usage\n\n- Canon: H1\n\n- Trafalgar: H4, section header\n\n- Paragon: Primary headline\n\n- Double Pica: Sub header\n\n- Great Primer: Headline title or subtitle\n\n- Body copy: Body copy\n\n- Body copy bulk: Body copy long text\n\n- Pica: Index links, titles or headlines\n\n- Long Primer: Index body copy and image captions\n\n- Brevier: Time stamps and bylines\n\n- Minion: Small header capitals"
|
|
3
|
+
}
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<p class="mds-font-pica">The quick brown fox jumps over the lazy dog</p>
|
|
24
|
-
|
|
25
|
-
<h4>Long Primer (Usage: Index body copy and image captions):</h4>
|
|
26
|
-
<p class="mds-font-long-primer">The quick brown fox jumps over the lazy dog</p>
|
|
27
|
-
|
|
28
|
-
<h4>Brevier (Usage: Time stamps and bylines):</h4>
|
|
29
|
-
<p class="mds-font-brevier">The quick brown fox jumps over the lazy dog</p>
|
|
30
|
-
|
|
31
|
-
<h4>Minion (Usage: Small header capitals):</h4>
|
|
32
|
-
<p class="mds-font-minion">The quick brown fox jumps over the lazy dog</p>
|
|
1
|
+
{% for fontName, item in tokens.font.type %}
|
|
2
|
+
<div class="mds-margin-bottom-b5">
|
|
3
|
+
<h2><strong>{{ fontName | capitalize }}:</strong></h2>
|
|
4
|
+
{% for viewport, subItem in item %}
|
|
5
|
+
<ul>
|
|
6
|
+
<strong>{{ viewport }}</strong>
|
|
7
|
+
{% for cssProperty, subSubItem in subItem %}
|
|
8
|
+
<li>{{ cssProperty }}: {{subSubItem.value}}</li>
|
|
9
|
+
{% endfor %}
|
|
10
|
+
</ul>
|
|
11
|
+
{% endfor %}
|
|
12
|
+
<p><strong>Example: </strong></p>
|
|
13
|
+
<p class="mds-font-{{ fontName }}">
|
|
14
|
+
{%- if fontName == 'body-copy-bulk' -%}
|
|
15
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eleifend accumsan elementum. Praesent quis facilisis elit. Donec vel suscipit leo. Cras tincidunt lacus sed mauris fringilla sodales. Donec facilisis suscipit augue, id pharetra nisl pharetra vitae. Etiam sed est id nulla ultricies accumsan sit amet ac urna. Etiam a neque eu erat rhoncus sollicitudin. Aenean maximus, mauris vitae porttitor varius, metus massa porttitor nulla, ac iaculis turpis tellus quis dui. Maecenas pharetra a ligula sed imperdiet.
|
|
16
|
+
{%- else -%}
|
|
17
|
+
The quick brown fox jumps over the lazy dog
|
|
18
|
+
{%- endif -%}
|
|
19
|
+
</p>
|
|
20
|
+
<hr>
|
|
21
|
+
</div>
|
|
22
|
+
{% endfor %}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
function constructNode(rootNode) {
|
|
2
|
-
const localObj = [];
|
|
3
|
-
const parentNodes = rootNode.querySelectorAll(':scope > .mds-multiselect__checkbox');
|
|
4
|
-
parentNodes.forEach((node, index) => {
|
|
5
|
-
let childGroup = 'null';
|
|
6
|
-
if (node.childElementCount === 3) {
|
|
7
|
-
childGroup = node.querySelector('.mds-multiselect__checkbox-group');
|
|
8
|
-
}
|
|
9
|
-
const input = node.querySelector('input');
|
|
10
|
-
const label = node.querySelector('label');
|
|
11
|
-
localObj[`${index}`] = {
|
|
12
|
-
id: input.id,
|
|
13
|
-
name: input.name,
|
|
14
|
-
value: input.value,
|
|
15
|
-
label: label.innerText,
|
|
16
|
-
checked: input.checked,
|
|
17
|
-
children: childGroup !== 'null' ? constructNode(childGroup) : null,
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
return localObj;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function bindData() {
|
|
24
|
-
const elements = Array.from(document.querySelectorAll('.js-mds-multiselect'));
|
|
25
|
-
elements.forEach((element) => {
|
|
26
|
-
const vueMultiselect = element.querySelector('mds-multiselect');
|
|
27
|
-
vueMultiselect.options = constructNode(element.querySelector('.mds-multiselect__checkbox-group'));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const multiselect = {
|
|
32
|
-
init: () => {
|
|
33
|
-
bindData();
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default multiselect;
|