@madgex/design-system 6.3.9 → 6.3.11

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.
Files changed (59) hide show
  1. package/dist/_tokens/css/_tokens.css +1 -1
  2. package/dist/_tokens/js/_tokens-module.js +1 -1
  3. package/dist/assets/icons.json +1 -1
  4. package/dist/css/index.css +1 -1
  5. package/package.json +2 -2
  6. package/src/components/_preview.njk +0 -16
  7. package/src/components/accordion/accordion.config.js +1 -2
  8. package/src/components/accordion/accordion.njk +0 -46
  9. package/src/components/button/button.config.js +1 -1
  10. package/src/components/button/button.njk +0 -36
  11. package/src/components/button/button.scss +3 -1
  12. package/src/components/card/card.config.js +1 -1
  13. package/src/components/icons/icons.config.js +1 -1
  14. package/src/components/icons/icons.njk +0 -78
  15. package/src/components/inputs/checkbox-list/checkbox-list.config.js +1 -1
  16. package/src/components/inputs/checkbox-list/checkbox-list.njk +0 -51
  17. package/src/components/inputs/combobox/combobox.config.js +1 -1
  18. package/src/components/inputs/combobox/combobox.njk +0 -77
  19. package/src/components/inputs/file-upload/file-upload.config.js +1 -1
  20. package/src/components/inputs/input/input.config.js +1 -1
  21. package/src/components/inputs/input/input.njk +0 -63
  22. package/src/components/inputs/label/label.config.js +1 -1
  23. package/src/components/inputs/label/label.njk +0 -35
  24. package/src/components/inputs/radio/radio.config.js +1 -1
  25. package/src/components/inputs/radio/radio.njk +0 -58
  26. package/src/components/inputs/select/select.config.js +1 -1
  27. package/src/components/inputs/single-checkbox/single-checkbox.config.js +1 -1
  28. package/src/components/inputs/single-checkbox/single-checkbox.njk +0 -61
  29. package/src/components/inputs/text-editor/text-editor.config.js +1 -1
  30. package/src/components/inputs/textarea/textarea.config.js +1 -1
  31. package/src/components/modal/modal.config.js +1 -1
  32. package/src/components/notification/notification.config.js +1 -1
  33. package/src/components/pagination/pagination.config.js +1 -1
  34. package/src/components/pagination/pagination.njk +0 -40
  35. package/src/components/pagination-numbers/pagination-numbers.config.js +1 -1
  36. package/src/components/popover/popover.config.js +1 -1
  37. package/src/components/popover/popover.njk +0 -24
  38. package/src/components/section-title/title-with-action.config.js +1 -1
  39. package/src/components/section-title/title.config.js +1 -1
  40. package/src/components/skip-link/skip-link.config.js +1 -1
  41. package/src/components/switch-state/switch-state.config.js +1 -1
  42. package/src/components/tabs/tabs.config.js +1 -1
  43. package/src/components/toggle-button-links/toggle-button-links.config.js +1 -1
  44. package/src/components/toggle-button-links/toggle-button-links.njk +9 -36
  45. package/src/scss/components/__index.scss +0 -2
  46. package/src/scss/constants/_sd-tokens.scss +1 -1
  47. package/src/components/_import-MdsLibrary.njk +0 -7
  48. package/src/components/inputs/checkbox-pill/README.md +0 -18
  49. package/src/components/inputs/checkbox-pill/checkbox-pill.config.js +0 -5
  50. package/src/components/inputs/checkbox-pill/checkbox-pill.njk +0 -87
  51. package/src/components/inputs/checkbox-pill/checkbox-pill.scss +0 -47
  52. package/src/components/inputs/form-item/README.md +0 -28
  53. package/src/components/inputs/form-item/form-item.config.js +0 -5
  54. package/src/components/inputs/form-item/form-item.njk +0 -42
  55. package/src/components/inputs/input-number/README.md +0 -37
  56. package/src/components/inputs/input-number/input-number.config.js +0 -5
  57. package/src/components/inputs/input-number/input-number.njk +0 -68
  58. package/src/components/inputs/input-number/input-number.scss +0 -60
  59. package/tasks/design-system-vue.js +0 -14
@@ -1,6 +1,5 @@
1
1
  {% from "./inputs/single-checkbox/_macro.njk" import MdsSingleCheckbox %}
2
2
 
3
- <em>Nunjucks</em>
4
3
  <div class="mds-form-field">
5
4
  {{- MdsSingleCheckbox({
6
5
  name: name,
@@ -18,63 +17,3 @@
18
17
  i18n: i18n
19
18
  }) -}}
20
19
  </div>
21
-
22
- <em>Vue</em>
23
- <div class="mds-form-field">
24
-
25
- <div id="vue-{{id}}"></div>
26
- {% set option = (options[0] or options) %}
27
- <script type="module" async>
28
- {% include '_import-MdsLibrary.njk' %}
29
-
30
- vue.createApp({
31
- data() {
32
- return {
33
- option: {{ option | dump | safe}},
34
- i18n: {{(i18n or {}) | dump | safe}},
35
- optional: {{optional or false}},
36
- disabled: {{disabled or false}},
37
- isChecked: false,
38
- helpText: "{{helpText or ''}}",
39
- error: {{state === 'error'}},
40
- validationError: "{{validationError or ''}}",
41
- describedBy: "{{describedBy or ''}}"
42
- };
43
- },
44
- methods: {
45
- createDescribedBy(ids) {
46
- return [this.describedBy, ...ids].filter(id => !!id).join(' ');
47
- }
48
- },
49
- template: `<div>
50
- <MdsFormItem :error="error">
51
- <template v-if="validationError" #error>{{validationError}}</template>
52
- <template v-if="helpText" #help>{{helpText}}</template>
53
- <template #default="slotProps">
54
- <MdsSingleCheckbox
55
- id="{{id}}-vue-version"
56
- name="{{name}}"
57
- :describedBy="createDescribedBy([slotProps.errorMessageId, slotProps.helpMessageId])"
58
- classes="{{classes}}"
59
- state="{{state}}"
60
- :value="option.value"
61
- v-model="isChecked"
62
- :disabled="disabled"
63
- :optional="optional"
64
- :i18n="i18n" >{{option.labelText | safe}}
65
- </MdsSingleCheckbox>
66
- </template>
67
- </MdsFormItem>
68
- </div>`
69
-
70
- }).use(MdsLibrary).mount('#vue-{{id}}');
71
- </script>
72
-
73
- </div>
74
-
75
- {% if id === "error" %}
76
- <div id="topcv-example">Learn more about TopCV.</div>
77
- {% endif %}
78
-
79
-
80
- <div style="margin-bottom:40px"></div>
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Text Editor',
3
- meta: { status: { njk: 'wip' } },
3
+ status: 'wip',
4
4
  context: {
5
5
  variantTitle: 'Default editor',
6
6
  id: 'default-editor',
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Textarea',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  context: {
5
5
  variantTitle: 'Example Textarea',
6
6
  name: 'Example Textarea',
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
2
  title: 'Modal',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  };
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Notifications',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  context: {
5
5
  text: 'Notification - Success',
6
6
  classes: 'mds-button--plain js-notification-example',
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  title: 'Pagination',
3
3
  label: 'Pagination',
4
- meta: { status: { njk: 'ready', vue: 'wip' } },
4
+ status: 'ready',
5
5
  context: {
6
6
  fractalTitle: 'Pagination',
7
7
  prevUrl: '/prev-page',
@@ -1,8 +1,6 @@
1
1
  {% from "./pagination/_macro.njk" import MdsPagination %}
2
2
 
3
- {# NUNJUCKS VERSION #}
4
3
  <h2>{{ fractalTitle }}</h2>
5
- <em>Nunjucks </em>
6
4
 
7
5
  {{ MdsPagination({
8
6
  name: name,
@@ -16,41 +14,3 @@
16
14
  id: id,
17
15
  i18n: i18n
18
16
  }) }}
19
-
20
- {# VUE 3 VERSION #}
21
- <em>Vue</em>
22
-
23
- <div id="vue-{{id}}"></div>
24
-
25
- <script type="module" async>
26
- {% include '_import-MdsLibrary.njk' %}
27
- const { MdsPagination} = MdsLibrary;
28
-
29
- vue.createApp({
30
- components: { MdsPagination },
31
- data() {
32
- return {
33
- i18n: {{ i18n | dump | safe }},
34
- hideIcons: {{hideIcons or false}},
35
- };
36
- },
37
- template: `<div>
38
- <MdsPagination
39
- name="{{ name }}"
40
- classes="{{ classes }}"
41
- prev-url="{{ prevUrl }}"
42
- prev-extra-label="{{ prevExtraLabel }}"
43
- next-url="{{ nextUrl }}"
44
- next-extra-label="{{ nextExtraLabel }}"
45
- back-to-url="{{ backToUrl }}"
46
- :i18n="i18n"
47
- :hide-icons="hideIcons"
48
- />
49
- </div>`
50
-
51
- }).mount('#vue-{{id}}');
52
- </script>
53
-
54
-
55
-
56
-
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Pagination numbers',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  label: 'Pagination numbers',
5
5
  context: {
6
6
  pageUrlTemplate: '/article/{pageNo}/my-seo-things',
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  title: 'Popover',
3
3
  label: 'Popover',
4
- meta: { status: { njk: 'ready', vue: 'wip' } },
4
+ status: 'ready',
5
5
  context: {
6
6
  id: 'simple-popover',
7
7
  text: 'Trigger <span>1</span>',
@@ -1,6 +1,5 @@
1
1
  {% from "./popover/_macro.njk" import MdsPopover %}
2
2
 
3
- <em>Nunjucks</em>
4
3
  <div style="padding: 10px">
5
4
  {{ MdsPopover({
6
5
  id: id,
@@ -10,26 +9,3 @@
10
9
  content: content
11
10
  }) }}
12
11
  </div>
13
-
14
- <em>Vue</em>
15
- <div id="vue-{{id}}" style="padding: 10px"></div>
16
-
17
- <script async type="module">
18
- {% include '_import-MdsLibrary.njk' %}
19
- const { MdsPopover } = MdsLibrary;
20
-
21
- vue.createApp({
22
- components: { MdsPopover },
23
- data() {
24
- return {
25
- placement: "{{placement}}" || undefined,
26
- };
27
- },
28
- template: `
29
- <MdsPopover id="{{id}}" classes="{{classes}}" :placement="placement">
30
- {{text | safe}}
31
- <template #content>{{content | safe}}</template>
32
- </MdsPopover>
33
- `
34
- }).mount('#vue-{{id}}');
35
- </script>
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'SectionTitle',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  context: {
5
5
  title: 'Similar jobs',
6
6
  headingTag: 'h3',
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'SectionTitle',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  context: {
5
5
  title: 'Similar jobs',
6
6
  classes: '',
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
2
  title: 'Skip Link',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  };
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Switch State',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  label: 'Switch State',
5
5
  context: {
6
6
  inverseLabel: 'Remove Job',
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Tabs',
3
- meta: { status: { njk: 'ready' } },
3
+ status: 'ready',
4
4
  label: 'Tabs',
5
5
  context: {
6
6
  name: 'Range',
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'ToggleButtonLinks',
3
- meta: { status: { njk: 'wip', vue: 'wip' } },
3
+ status: 'wip',
4
4
  context: {
5
5
  items: [
6
6
  {
@@ -1,39 +1,12 @@
1
1
  {% from "./toggle-button-links/_macro.njk" import MdsToggleButtonLinks %}
2
2
 
3
- <h3>Nunjucks</h3>
3
+ {% for item in items %}
4
+ {{ MdsToggleButtonLinks({
5
+ id: item.id,
6
+ i18n: item.i18n,
7
+ options: item.options,
8
+ activeHref: item.activeHref
9
+ })
10
+ }}
11
+ {% endfor %}
4
12
 
5
- <div class="nunjucks-items">
6
- {% for item in items %}
7
- {{ MdsToggleButtonLinks({
8
- id: item.id,
9
- i18n: item.i18n,
10
- options: item.options,
11
- activeHref: item.activeHref
12
- })
13
- }}
14
- {% endfor %}
15
- </div>
16
- <h3 style="margin-top: 10px">Vue</h3>
17
- {% for item in items %}
18
-
19
- <div id="vue-{{item.id}}"></div>
20
-
21
- <script type="module" async>
22
- {% include '_import-MdsLibrary.njk' %}
23
- vue.createApp({
24
- data() {
25
- return {
26
- id: "{{ item.id}}",
27
- i18n: {{(item.i18n or {}) | dump | safe}},
28
- options: {{ item.options | dump | safe}},
29
- activeHref: "{{ item.activeHref }}",
30
-
31
- };
32
- },
33
- template: `<MdsToggleButtonLinks :id="id" :i18n="i18n" :options="options" v-model="activeHref" />`
34
-
35
- }).use(MdsLibrary).mount('#vue-{{item.id}}');
36
- </script>
37
-
38
-
39
- {% endfor %}
@@ -12,9 +12,7 @@
12
12
  @import '../../components/inputs/combobox/combobox';
13
13
  @import '../../components/inputs/file-upload/file-upload';
14
14
  @import '../../components/inputs/textarea/textarea';
15
- @import '../../components/inputs/checkbox-pill/checkbox-pill';
16
15
  @import '../../components/inputs/text-editor/text-editor';
17
- @import '../../components/inputs/input-number/input-number';
18
16
  @import '../../components/modal/modal';
19
17
  @import '../../components/skip-link/skip-link';
20
18
  @import '../../components/toggle-button-links/toggle-button-links';
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Mon, 03 Jun 2024 14:08:10 GMT
4
+ * Generated on Thu, 04 Jul 2024 06:59:55 GMT
5
5
  */
6
6
 
7
7
  $constant-color-neutral-base: #707070;
@@ -1,7 +0,0 @@
1
- {% if isDev %}
2
- import * as MdsLibrary from 'http://localhost:8111/lib.js';
3
- {% else %}
4
- // es convention does not automatically import `index.js` from a folder name (nodejs does this)
5
- import * as MdsLibrary from '/assets/design-system-vue.js';
6
- {% endif %}
7
- import * as vue from 'vue';
@@ -1,18 +0,0 @@
1
- ## Vue
2
-
3
- ### Slots
4
-
5
- - `default <slot/>` - Content of the Pill.
6
-
7
- ### Props
8
-
9
- - `name`: `String` **required** - `name` attribute for the input field.
10
- - `v-model`: `Any type` _optional_ - Reactive value for the input. No default value.
11
- - `value`: `Any type` _optional_ - `value` attribute for the input field. No default value.
12
- - `describedBy`: `String` _optional_ - `aria-describedby` attribute for input field. Default value: `''`.
13
-
14
- ### Notes
15
-
16
- > When using multiple `<MdsCheckboxPill>` sharing the same `v-model` remember to wrap them in a `<fieldset>`.
17
-
18
- The component uses `<label>` as the root for a11y, so we don't have to pass it as a prop. Read Sara Soueidan's [article](https://www.sarasoueidan.com/blog/inclusively-hiding-and-styling-checkboxes-and-radio-buttons/) for reference.
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- title: 'CheckboxPill',
3
- meta: { status: { njk: '', vue: 'wip' } },
4
- context: {},
5
- };
@@ -1,87 +0,0 @@
1
- {# VUE VERSION #}
2
- <h2>Vue</h2>
3
-
4
- <div id="vue-app">
5
- {% raw %}
6
- <table style="
7
- width: 100%;
8
- opacity: 50%;
9
- max-width: 700px;
10
- text-align: left;
11
- margin-bottom: 10px;
12
- border: 1px solid lightgrey;
13
- padding: 10px"
14
- >
15
- <tr style="color: black; font-weight: bold">
16
- <th>pill</th>
17
- <th>value</th>
18
- </tr>
19
- <tr>
20
- <td>Default</td>
21
- <td :style="{color: defaultPill ? 'green' : 'red'}">{{defaultPill}}</td>
22
- </tr>
23
- <tr>
24
- <td>Default True</td>
25
- <td :style="{color: defaultTruePill ? 'green' : 'red'}">{{defaultTruePill}}</td>
26
- </tr>
27
- <tr>
28
- <td>Multiple</td>
29
- <td :style="{color: multiplePillsValues.length ? 'green' : 'red' }">{{ multiplePillsValues }}</td>
30
- </tr>
31
- </table>
32
-
33
- <h3>Default pill</h3>
34
- <div style="padding-bottom: 10px">
35
- <mds-checkbox-pill v-model="defaultPill" name="defaultPill">
36
- Default Pill
37
- </mds-checkbox-pill>
38
- </div>
39
-
40
- <h3>Default true pill</h3>
41
- <div style="padding-bottom: 10px">
42
- <mds-checkbox-pill v-model="defaultTruePill" name="defaultTruePill">
43
- {{ defaultTruePill ? 'True' : 'False' }}
44
- </mds-checkbox-pill>
45
- </div>
46
-
47
- <h3>Multiple pills</h3>
48
- <fieldset style="max-width: 500px; border: 2px dashed #F5F5F5; padding: 10px 5px 5px 10px">
49
- <legend style="padding: 3px 6px; color: lightgrey">Choose social media platforms</legend>
50
- <div style="display: flex; flex-wrap: wrap;">
51
- <mds-checkbox-pill
52
- v-for="pill in multiplePills"
53
- v-model="multiplePillsValues"
54
- :name="pill.name"
55
- :value="pill.name"
56
- style="margin-right: 5px; margin-bottom: 5px"
57
- >
58
- <span>{{ pill.label }}</span>
59
- <mds-icon v-show="!multiplePillsValues.includes(pill.name)" :icon-name="pill.icon" classes="mds-icon--after" />
60
- </mds-checkbox-pill>
61
- </div>
62
- </fieldset>
63
- {% endraw %}
64
- </div>
65
-
66
- <script type="module" async>
67
- {% include '_import-MdsLibrary.njk' %}
68
- const { MdsCheckboxPill, MdsIcon } = MdsLibrary;
69
-
70
- const app = vue.createApp({
71
- components: { MdsCheckboxPill, MdsIcon },
72
- data() {
73
- return {
74
- defaultPill: false,
75
- defaultTruePill: true,
76
- multiplePillsValues: [],
77
- multiplePills: [
78
- { name: 'pinterest', label: 'Pinterest', icon: 'social-pinterest'},
79
- { name: 'facebook', label: 'Facebook', icon: 'social-facebook'},
80
- { name: 'twitter', label: 'Twitter', icon: 'social-twitter'},
81
- { name: 'linkedin', label: 'Linkedin', icon: 'social-linkedin'},
82
- { name: 'reddit', label: 'Reddit', icon: 'social-reddit'}
83
- ]
84
- };
85
- },
86
- }).mount('#vue-app');
87
- </script>
@@ -1,47 +0,0 @@
1
- .mds-checkbox-pill {
2
- --background: #fff;
3
- --text-color: var(--mds-color-text-base);
4
-
5
- cursor: pointer;
6
- user-select: none;
7
- -webkit-appearance: none;
8
- width: auto;
9
-
10
- box-sizing: border-box;
11
- border: $regular-border;
12
- border-radius: $border-radius;
13
-
14
- display: inline-flex;
15
- align-items: center;
16
- text-align: left;
17
- padding: ($constant-size-baseline * 2) ($constant-size-baseline * 3);
18
-
19
- @extend .mds-font-body-copy;
20
- font-family: var(--mds-font-family-base);
21
- font-weight: var(--mds-font-weight-base);
22
- text-transform: none;
23
-
24
- background: var(--background);
25
- color: var(--text-color);
26
-
27
- &:hover,
28
- &:focus-within {
29
- --background: #{$constant-color-neutral-lightest};
30
- --text-color: #{$link-hover-color};
31
- }
32
-
33
- &:focus-within {
34
- outline: 2px solid var(--mds-color-text-base);
35
- }
36
- }
37
-
38
- .mds-checkbox-pill--active {
39
- --background: var(--mds-color-pill-bg-base, #000);
40
- --text-color: var(--mds-color-pill-text-base, #fff);
41
-
42
- &:hover,
43
- &:focus-within {
44
- --background: var(--mds-color-pill-bg-hover, #{$constant-color-neutral-darker});
45
- --text-color: var(--mds-color-pill-text-hover, #fff);
46
- }
47
- }
@@ -1,28 +0,0 @@
1
- # 🙋 What is MdsFormItem?
2
-
3
- MdsFormItem is a wrapper, to wrap input-type components such as MdsInput you see below. It should not be used on its own, but wrapping another component.
4
-
5
- It includes MdsLabel and MdsFormMessage, and influences the error styling of the input with an error prop.
6
-
7
- ## Vue
8
-
9
- ### Slots
10
-
11
- - `default <slot/>` - Slot for the main input element.
12
- - `label <slot/>` - Slot for the label's content.
13
- - `tooltip <slot/>` - Slot for the label's tooltip (only visible if label slot has also content).
14
- - `help <slot/>` - Slot for a help message.
15
- - `error <slot/>` - Slot for an error message.
16
-
17
- ### Props
18
-
19
- - `inputId`: `String` **required** - `for` attribute for the label's component (should match the id of the input in the slot).
20
- - `optional`: `Boolean` _optional_ - If the input is optional, otherwise is required. Default: `false`.
21
- - `hideLabel`: `Boolean` _optional_ - If the label is visually hidden. The text of the label will the used by default as a placeholder. Default: `false`.
22
- **(please see accessibility notes regarding the use of this parameter)**
23
- - `i18n`: `Object` _optional_ - Text to translate/customise. Default: `{}`.
24
- - `error`: `Boolean` _optional_ - Used for styling the input element. Default: `false`.
25
-
26
- ### Accessibility
27
-
28
- Avoid using `hideLabel` if you can. Only hide the label when there can be no mistake as to what the input is for, probably when there is only one input in the form.
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- title: 'FormItem',
3
- meta: { status: { vue: 'wip' } },
4
- context: {},
5
- };
@@ -1,42 +0,0 @@
1
- {# VUE VERSION #}
2
- <h2>Vue</h2>
3
-
4
- <blockquote style="background-color: #eee; border-radius: 3px; margin-bottom: 20px; padding: 20px;">
5
- <h3> 🙋 What is MdsFormItem?</h3>
6
- <p>MdsFormItem is a wrapper, to wrap input-type components such as MdsInput you see below. It should not be used on its own, but wrapping another component.</p>
7
- <p>It includes MdsLabel and MdsFormMessage, and influences the error styling of the input with an error prop.</p>
8
- </blockquote>
9
- <div id="vue-app">
10
- {% raw %}
11
- <div class="mds-form-field" v-for="item in items" :key="item.label">
12
- <mds-form-item :input-id="item.inputId" :optional="item.optional" class="mds-form-element--input" :error="item.error">
13
- <mds-input :id="item.inputId" model-value="MdsFormInput wrapping MdsInput"></mds-input>
14
- <template v-if="item.label" #label>{{item.label}}</template>
15
- <template v-if="item.tooltip" #tooltip>{{item.tooltip}}</template>
16
- <template v-if="item.help" #help>{{item.help}}</template>
17
- <template v-if="item.errorMessage" #error>{{item.errorMessage}}</template>
18
- </mds-form-item>
19
- </div>
20
- {% endraw %}
21
- </div>
22
-
23
- <script type="module" async>
24
- {% include '_import-MdsLibrary.njk' %}
25
- const { MdsFormItem, MdsInput } = MdsLibrary;
26
-
27
- const app = vue.createApp({
28
- components: { MdsFormItem, MdsInput },
29
- data() {
30
- return {
31
- items: [
32
- { inputId:'I', label: 'Required Input'},
33
- { inputId:'n', label: 'Optional Input', optional: true},
34
- { inputId:'N', label: 'Input with error style', error: true },
35
- { inputId:'P', label: 'Input with error message', errorMessage: 'This is an error!', error: true },
36
- { inputId:'U', label: 'Input with help', help: 'Some help message'},
37
- { inputId:'T', label: 'Input with tooltip', tooltip: 'Never miss a tip'},
38
- ],
39
- };
40
- },
41
- }).mount('#vue-app');
42
- </script>
@@ -1,37 +0,0 @@
1
- ## Vue
2
-
3
- ### Parameters
4
-
5
- - `v-model (:modelValue)`: **required** The value of the input.
6
- - `id`: `String` **required** - Id attribute of the input.
7
- - `name`: `String` _optional_ - Name attribute of the input.
8
- - `placeholder`: `String` _optional_ - Placeholder attribute of the input element. Default: `''`.
9
- - `min`: `Number` _optional_ - Min attribute of the input element. Default: `Number.NEGATIVE_INFINITY`.
10
- - `max`: `Number` _optional_ - Max attribute of the input element. Default: `Number.POSITIVE_INFINITY`.
11
- - `step`: `Number` _optional_ - Step attribute of input element. Default: `1`.
12
- - `error`: `Boolean` _optional_ - Used for a11y (`:aria-invalid` attribute). Default: `false`.
13
- - `i18n`: `Object` _optional_ - Text to translate/customise.
14
-
15
- ```text
16
- i18n: {
17
- increaseAriaLabel: 'Increase', // aria label for "Increase" button
18
- decreaseAriaLabel: 'Decrease', // aria label for "Decrease" button
19
- }
20
- ```
21
-
22
- ### i18n
23
-
24
- ```html
25
- <mds-form-item input-id="my-input-number-id" class="mds-form-element--input">
26
- <template #label>¿Cuántos idiomas hablas?</template>
27
- <mds-input-number
28
- id="my-input-number-id"
29
- v-model="value"
30
- min="1"
31
- max="50"
32
- :i18="{increaseAriaLabel: 'Aumentar', decreaseAriaLabel: 'Reducir'}"
33
- />
34
- </mds-form-item>
35
- ```
36
-
37
- > Note: Remember to wrap your input components with `mds-form-item` whenever you need to use them within a form.
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- title: 'InputNumber',
3
- meta: { status: { njk: '', vue: 'wip' } },
4
- context: {},
5
- };