@1024pix/pix-ui 58.4.2 → 58.4.4
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/addon/components/pix-accordions.gjs +81 -0
- package/addon/components/pix-app-layout.gjs +1 -1
- package/addon/components/pix-background-header.gjs +15 -0
- package/addon/components/{pix-banner-alert.js → pix-banner-alert.gjs} +49 -0
- package/addon/components/{pix-block.js → pix-block.gjs} +18 -0
- package/addon/components/pix-breadcrumb.gjs +40 -0
- package/addon/components/pix-button/pix-button-content.gjs +21 -0
- package/addon/components/pix-button-link.gjs +49 -0
- package/addon/components/{pix-button-upload.js → pix-button-upload.gjs} +15 -0
- package/addon/components/{pix-button.js → pix-button.gjs} +30 -0
- package/addon/components/{pix-checkbox.js → pix-checkbox.gjs} +42 -1
- package/addon/components/pix-code.gjs +59 -0
- package/addon/components/{pix-filterable-and-searchable-select.js → pix-filterable-and-searchable-select.gjs} +55 -0
- package/addon/components/pix-gauge.gjs +199 -0
- package/addon/components/{pix-icon-button.js → pix-icon-button.gjs} +21 -0
- package/addon/components/{pix-icon.js → pix-icon.gjs} +19 -0
- package/addon/components/pix-indicator-card.gjs +68 -0
- package/addon/components/{pix-input-code.js → pix-input-code.gjs} +29 -0
- package/addon/components/pix-input-password.gjs +102 -0
- package/addon/components/pix-input.gjs +57 -0
- package/addon/components/pix-label-wrapped.gjs +64 -0
- package/addon/components/pix-modal.gjs +55 -0
- package/addon/components/pix-navigation-separator.gjs +1 -0
- package/addon/components/{pix-navigation.js → pix-navigation.gjs} +49 -0
- package/addon/components/{pix-notification-alert.js → pix-notification-alert.gjs} +19 -0
- package/addon/components/pix-overlay.gjs +31 -0
- package/addon/components/{pix-pagination.js → pix-pagination.gjs} +58 -0
- package/addon/components/{pix-progress-bar.js → pix-progress-bar.gjs} +22 -0
- package/addon/components/{pix-radio-button.js → pix-radio-button.gjs} +42 -0
- package/addon/components/{pix-search-input.js → pix-search-input.gjs} +31 -0
- package/addon/components/pix-select-list.gjs +166 -0
- package/addon/components/pix-selectable-tag.gjs +23 -0
- package/addon/components/pix-sidebar.gjs +49 -0
- package/addon/components/pix-stars.gjs +34 -0
- package/addon/components/pix-structure-switcher.gjs +107 -0
- package/addon/components/{pix-table-column.js → pix-table-column.gjs} +33 -0
- package/addon/components/{pix-tabs.js → pix-tabs.gjs} +6 -0
- package/addon/components/pix-textarea.gjs +68 -0
- package/addon/components/pix-toast-container.gjs +16 -0
- package/addon/components/{pix-toast.js → pix-toast.gjs} +25 -0
- package/addon/components/pix-tooltip.gjs +82 -0
- package/addon/components/{toast-example.js → toast-example.gjs} +13 -0
- package/package.json +1 -1
- package/addon/components/pix-accordions.hbs +0 -48
- package/addon/components/pix-accordions.js +0 -26
- package/addon/components/pix-background-header.hbs +0 -7
- package/addon/components/pix-background-header.js +0 -5
- package/addon/components/pix-banner-alert.hbs +0 -38
- package/addon/components/pix-block.hbs +0 -8
- package/addon/components/pix-breadcrumb.hbs +0 -21
- package/addon/components/pix-breadcrumb.js +0 -12
- package/addon/components/pix-button/pix-button-content.hbs +0 -17
- package/addon/components/pix-button-link.hbs +0 -32
- package/addon/components/pix-button-link.js +0 -10
- package/addon/components/pix-button-upload.hbs +0 -11
- package/addon/components/pix-button.hbs +0 -25
- package/addon/components/pix-checkbox.hbs +0 -37
- package/addon/components/pix-code.hbs +0 -31
- package/addon/components/pix-code.js +0 -24
- package/addon/components/pix-filterable-and-searchable-select.hbs +0 -48
- package/addon/components/pix-gauge.hbs +0 -98
- package/addon/components/pix-gauge.js +0 -96
- package/addon/components/pix-icon-button.hbs +0 -15
- package/addon/components/pix-icon.hbs +0 -15
- package/addon/components/pix-indicator-card.hbs +0 -47
- package/addon/components/pix-indicator-card.js +0 -14
- package/addon/components/pix-input-code.hbs +0 -24
- package/addon/components/pix-input-password.hbs +0 -68
- package/addon/components/pix-input-password.js +0 -28
- package/addon/components/pix-input.hbs +0 -38
- package/addon/components/pix-input.js +0 -14
- package/addon/components/pix-label-wrapped.hbs +0 -32
- package/addon/components/pix-label-wrapped.js +0 -27
- package/addon/components/pix-modal.hbs +0 -33
- package/addon/components/pix-modal.js +0 -16
- package/addon/components/pix-navigation-separator.hbs +0 -1
- package/addon/components/pix-navigation.hbs +0 -43
- package/addon/components/pix-notification-alert.hbs +0 -13
- package/addon/components/pix-overlay.hbs +0 -11
- package/addon/components/pix-overlay.js +0 -13
- package/addon/components/pix-pagination.hbs +0 -52
- package/addon/components/pix-progress-bar.hbs +0 -19
- package/addon/components/pix-radio-button.hbs +0 -37
- package/addon/components/pix-search-input.hbs +0 -25
- package/addon/components/pix-select-list.hbs +0 -115
- package/addon/components/pix-select-list.js +0 -41
- package/addon/components/pix-selectable-tag.hbs +0 -10
- package/addon/components/pix-selectable-tag.js +0 -9
- package/addon/components/pix-sidebar.hbs +0 -28
- package/addon/components/pix-sidebar.js +0 -16
- package/addon/components/pix-stars.hbs +0 -17
- package/addon/components/pix-stars.js +0 -13
- package/addon/components/pix-structure-switcher.hbs +0 -41
- package/addon/components/pix-structure-switcher.js +0 -54
- package/addon/components/pix-table-column.hbs +0 -28
- package/addon/components/pix-tabs.hbs +0 -3
- package/addon/components/pix-textarea.hbs +0 -36
- package/addon/components/pix-textarea.js +0 -23
- package/addon/components/pix-toast-container.hbs +0 -5
- package/addon/components/pix-toast-container.js +0 -6
- package/addon/components/pix-toast.hbs +0 -17
- package/addon/components/pix-tooltip.hbs +0 -30
- package/addon/components/pix-tooltip.js +0 -46
- package/addon/components/toast-example.hbs +0 -7
- /package/addon/components/{pix-button-base.js → pix-button-base.gjs} +0 -0
- /package/addon/components/{pix-input-base.js → pix-input-base.gjs} +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { on } from '@ember/modifier';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
|
+
import Component from '@glimmer/component';
|
|
5
|
+
import { tracked } from '@glimmer/tracking';
|
|
6
|
+
|
|
7
|
+
import PixIcon from './pix-icon';
|
|
8
|
+
import PixTag from './pix-tag';
|
|
9
|
+
|
|
10
|
+
export default class PixAccordions extends Component {
|
|
11
|
+
text = 'pix-accordions';
|
|
12
|
+
contentId = 'pix-accordions-' + guidFor(this);
|
|
13
|
+
|
|
14
|
+
@tracked isCollapsed = true;
|
|
15
|
+
@tracked hasUnCollapsedOnce = false;
|
|
16
|
+
|
|
17
|
+
get isUnCollapsed() {
|
|
18
|
+
return !this.isCollapsed;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get isContentRendered() {
|
|
22
|
+
return this.hasUnCollapsedOnce;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@action
|
|
26
|
+
toggleAccordions() {
|
|
27
|
+
this.isCollapsed = !this.isCollapsed;
|
|
28
|
+
this.hasUnCollapsedOnce = true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="pix-accordions">
|
|
33
|
+
|
|
34
|
+
<button
|
|
35
|
+
class="pix-accordions__title"
|
|
36
|
+
type="button"
|
|
37
|
+
{{on "click" this.toggleAccordions}}
|
|
38
|
+
aria-controls={{this.contentId}}
|
|
39
|
+
aria-expanded={{if this.isUnCollapsed "true" "false"}}
|
|
40
|
+
...attributes
|
|
41
|
+
>
|
|
42
|
+
|
|
43
|
+
<span class="pix-accordions-title__container">
|
|
44
|
+
{{#if @iconName}}
|
|
45
|
+
<PixIcon
|
|
46
|
+
class="pix-accordions-title__icon"
|
|
47
|
+
@name={{@iconName}}
|
|
48
|
+
@plainIcon={{@plainIcon}}
|
|
49
|
+
@ariaHidden={{true}}
|
|
50
|
+
/>
|
|
51
|
+
{{/if}}
|
|
52
|
+
|
|
53
|
+
{{yield to="title"}}
|
|
54
|
+
</span>
|
|
55
|
+
|
|
56
|
+
<span class="pix-accordions-title__container">
|
|
57
|
+
{{#if @tagContent}}
|
|
58
|
+
<PixTag @color={{@tagColor}}>
|
|
59
|
+
{{@tagContent}}
|
|
60
|
+
</PixTag>
|
|
61
|
+
{{/if}}
|
|
62
|
+
<PixIcon
|
|
63
|
+
class="pix-accordions-title-container__toggle-icon"
|
|
64
|
+
@ariaHidden={{true}}
|
|
65
|
+
@name="{{if this.isCollapsed 'chevronBottom' 'chevronTop'}}"
|
|
66
|
+
/>
|
|
67
|
+
</span>
|
|
68
|
+
</button>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
id={{this.contentId}}
|
|
72
|
+
class="pix-accordions__content"
|
|
73
|
+
aria-hidden={{if this.isCollapsed "true" "false"}}
|
|
74
|
+
>
|
|
75
|
+
{{#if this.isContentRendered}}
|
|
76
|
+
{{yield to="content"}}
|
|
77
|
+
{{/if}}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
}
|
|
@@ -18,7 +18,7 @@ export default class PixAppLayout extends Component {
|
|
|
18
18
|
const top = bannerHeight / baseFontRemRatio;
|
|
19
19
|
|
|
20
20
|
const layoutElement = document.querySelector('.pix-app-layout');
|
|
21
|
-
layoutElement
|
|
21
|
+
layoutElement?.style.setProperty('--pix-app-layout-top', `${top}rem`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
|
|
3
|
+
export default class PixBackgroundHeaderComponent extends Component {
|
|
4
|
+
text = 'pix-background-header';
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div class="pix-background-header" ...attributes>
|
|
8
|
+
<div class="pix-background-header__background"></div>
|
|
9
|
+
|
|
10
|
+
<div class="pix-background-header__content">
|
|
11
|
+
{{yield}}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { action } from '@ember/object';
|
|
2
|
+
import { LinkTo } from '@ember/routing';
|
|
2
3
|
import Component from '@glimmer/component';
|
|
3
4
|
import { tracked } from '@glimmer/tracking';
|
|
5
|
+
|
|
6
|
+
import PixIcon from './pix-icon';
|
|
7
|
+
import PixIconButton from './pix-icon-button';
|
|
8
|
+
|
|
4
9
|
const TYPE_INFO = 'information';
|
|
5
10
|
const TYPE_ERROR = 'error';
|
|
6
11
|
const TYPE_WARNING = 'warning';
|
|
@@ -62,4 +67,48 @@ export default class PixBannerAlert extends Component {
|
|
|
62
67
|
}
|
|
63
68
|
this.isBannerVisible = false;
|
|
64
69
|
}
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
{{#if this.displayBanner}}
|
|
73
|
+
<div class="pix-banner-alert pix-banner-alert--{{this.type}}" role="alert" ...attributes>
|
|
74
|
+
<PixIcon
|
|
75
|
+
@name={{this.icon}}
|
|
76
|
+
@plainIcon={{true}}
|
|
77
|
+
@ariaHidden={{true}}
|
|
78
|
+
class="pix-banner-alert__icon"
|
|
79
|
+
/>
|
|
80
|
+
<div>
|
|
81
|
+
{{yield}}
|
|
82
|
+
{{#if this.displayAction}}
|
|
83
|
+
{{#if this.isExternalLink}}
|
|
84
|
+
<a
|
|
85
|
+
class="pix-banner-alert__action"
|
|
86
|
+
href={{@actionUrl}}
|
|
87
|
+
target="_blank"
|
|
88
|
+
rel="noopener noreferrer"
|
|
89
|
+
>
|
|
90
|
+
{{@actionLabel}}
|
|
91
|
+
<PixIcon @name="openNew" class="external-link" @ariaHidden={{true}} />
|
|
92
|
+
</a>
|
|
93
|
+
{{else}}
|
|
94
|
+
<LinkTo
|
|
95
|
+
class="pix-banner-alert__action"
|
|
96
|
+
@route={{@actionUrl}}
|
|
97
|
+
>{{@actionLabel}}</LinkTo>
|
|
98
|
+
{{/if}}
|
|
99
|
+
{{/if}}
|
|
100
|
+
</div>
|
|
101
|
+
{{#if this.canCloseBanner}}
|
|
102
|
+
<div class="pix-banner-alert__close">
|
|
103
|
+
<PixIconButton
|
|
104
|
+
@ariaLabel="Fermer"
|
|
105
|
+
@iconName="close"
|
|
106
|
+
@size="small"
|
|
107
|
+
@triggerAction={{this.closeBanner}}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
{{/if}}
|
|
111
|
+
</div>
|
|
112
|
+
{{/if}}
|
|
113
|
+
</template>
|
|
65
114
|
}
|
|
@@ -15,4 +15,22 @@ export default class PixBlockComponent extends Component {
|
|
|
15
15
|
|
|
16
16
|
return value;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
get cssClass() {
|
|
20
|
+
const cssClass = ['pix-block', `pix-block--${this.variant}`];
|
|
21
|
+
|
|
22
|
+
if (this.args.condensed) {
|
|
23
|
+
cssClass.push('pix-block--condensed');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return cssClass.join(' ');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class={{this.cssClass}} ...attributes>
|
|
31
|
+
|
|
32
|
+
{{yield}}
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
18
36
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { array } from '@ember/helper';
|
|
2
|
+
import { LinkTo } from '@ember/routing';
|
|
3
|
+
import Component from '@glimmer/component';
|
|
4
|
+
|
|
5
|
+
import PixIcon from './pix-icon';
|
|
6
|
+
|
|
7
|
+
export default class PixBreadcrumb extends Component {
|
|
8
|
+
defaultModel = [];
|
|
9
|
+
|
|
10
|
+
get links() {
|
|
11
|
+
return this.args.links.map((link) => ({
|
|
12
|
+
...link,
|
|
13
|
+
label: link.label.trim(),
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<nav class="pix-breadcrumb" ...attributes>
|
|
19
|
+
<ol>
|
|
20
|
+
{{#each this.links as |link|}}
|
|
21
|
+
{{#if link.route}}
|
|
22
|
+
<li>
|
|
23
|
+
<LinkTo
|
|
24
|
+
@route={{link.route}}
|
|
25
|
+
@models={{if link.model (array link.model) this.defaultModel}}
|
|
26
|
+
>
|
|
27
|
+
{{link.label}}
|
|
28
|
+
</LinkTo>
|
|
29
|
+
<PixIcon @name="chevronRight" @ariaHidden={{true}} />
|
|
30
|
+
</li>
|
|
31
|
+
{{else}}
|
|
32
|
+
<li aria-current="page">
|
|
33
|
+
<p>{{link.label}}</p>
|
|
34
|
+
</li>
|
|
35
|
+
{{/if}}
|
|
36
|
+
{{/each}}
|
|
37
|
+
</ol>
|
|
38
|
+
</nav>
|
|
39
|
+
</template>
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PixIcon from '../pix-icon';
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
{{#if @iconBefore}}
|
|
5
|
+
<PixIcon
|
|
6
|
+
class="pix-button__icon pix-button__icon--before"
|
|
7
|
+
@ariaHidden={{true}}
|
|
8
|
+
@name={{@iconBefore}}
|
|
9
|
+
@plainIcon={{@plainIconBefore}}
|
|
10
|
+
/>
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{yield}}
|
|
13
|
+
{{#if @iconAfter}}
|
|
14
|
+
<PixIcon
|
|
15
|
+
class="pix-button__icon pix-button__icon--after"
|
|
16
|
+
@name={{@iconAfter}}
|
|
17
|
+
@ariaHidden={{true}}
|
|
18
|
+
@plainIcon={{@plainIconAfter}}
|
|
19
|
+
/>
|
|
20
|
+
{{/if}}
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { array } from '@ember/helper';
|
|
2
|
+
import { LinkTo } from '@ember/routing';
|
|
3
|
+
|
|
4
|
+
import PixButtonContent from './pix-button/pix-button-content';
|
|
5
|
+
import PixButtonBase from './pix-button-base';
|
|
6
|
+
|
|
7
|
+
export default class PixButtonLink extends PixButtonBase {
|
|
8
|
+
defaultModel = [];
|
|
9
|
+
defaultParams = {};
|
|
10
|
+
|
|
11
|
+
get className() {
|
|
12
|
+
return super.baseClassNames.join(' ');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
{{#if @route}}
|
|
17
|
+
<LinkTo
|
|
18
|
+
@route={{@route}}
|
|
19
|
+
@models={{if @model (array @model) this.defaultModel}}
|
|
20
|
+
@disabled={{@isDisabled}}
|
|
21
|
+
@query={{if @query @query this.defaultParams}}
|
|
22
|
+
class={{this.className}}
|
|
23
|
+
aria-disabled="{{@isDisabled}}"
|
|
24
|
+
...attributes
|
|
25
|
+
>
|
|
26
|
+
<PixButtonContent
|
|
27
|
+
@iconBefore={{@iconBefore}}
|
|
28
|
+
@iconAfter={{@iconAfter}}
|
|
29
|
+
@plainIconAfter={{@plainIconAfter}}
|
|
30
|
+
@plainIconBefore={{@plainIconBefore}}
|
|
31
|
+
>
|
|
32
|
+
{{yield}}
|
|
33
|
+
</PixButtonContent>
|
|
34
|
+
</LinkTo>
|
|
35
|
+
{{else}}
|
|
36
|
+
{{! template-lint-disable no-unsupported-role-attributes }}
|
|
37
|
+
<a href={{@href}} class={{this.className}} aria-disabled="{{@isDisabled}}" ...attributes>
|
|
38
|
+
<PixButtonContent
|
|
39
|
+
@iconBefore={{@iconBefore}}
|
|
40
|
+
@iconAfter={{@iconAfter}}
|
|
41
|
+
@plainIconAfter={{@plainIconAfter}}
|
|
42
|
+
@plainIconBefore={{@plainIconBefore}}
|
|
43
|
+
>
|
|
44
|
+
{{yield}}
|
|
45
|
+
</PixButtonContent>
|
|
46
|
+
</a>
|
|
47
|
+
{{/if}}
|
|
48
|
+
</template>
|
|
49
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { on } from '@ember/modifier';
|
|
1
2
|
import { action } from '@ember/object';
|
|
2
3
|
import { tracked } from '@glimmer/tracking';
|
|
3
4
|
|
|
@@ -18,4 +19,18 @@ export default class PixButtonUpload extends PixButtonBase {
|
|
|
18
19
|
}
|
|
19
20
|
this.files = [];
|
|
20
21
|
}
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<label for={{@id}} class={{this.className}} role="button">
|
|
25
|
+
{{yield}}
|
|
26
|
+
</label>
|
|
27
|
+
<input
|
|
28
|
+
id={{@id}}
|
|
29
|
+
type="file"
|
|
30
|
+
class="screen-reader-only"
|
|
31
|
+
value={{this.files}}
|
|
32
|
+
{{on "change" this.handleChange}}
|
|
33
|
+
...attributes
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
21
36
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { warn } from '@ember/debug';
|
|
2
|
+
import { on } from '@ember/modifier';
|
|
2
3
|
import { action } from '@ember/object';
|
|
3
4
|
import { tracked } from '@glimmer/tracking';
|
|
4
5
|
|
|
6
|
+
import PixButtonContent from './pix-button/pix-button-content';
|
|
5
7
|
import PixButtonBase from './pix-button-base';
|
|
6
8
|
export default class PixButton extends PixButtonBase {
|
|
7
9
|
text = 'pix-button';
|
|
@@ -76,4 +78,32 @@ export default class PixButton extends PixButtonBase {
|
|
|
76
78
|
this.isTriggering = false;
|
|
77
79
|
}
|
|
78
80
|
}
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<button
|
|
84
|
+
type={{this.type}}
|
|
85
|
+
class={{this.className}}
|
|
86
|
+
{{on "click" this.triggerAction}}
|
|
87
|
+
aria-disabled="{{this.isDisabled}}"
|
|
88
|
+
...attributes
|
|
89
|
+
>
|
|
90
|
+
{{#if this.isLoading}}
|
|
91
|
+
<div class="loader loader--{{this.loadingColor}}">
|
|
92
|
+
<div class="bounce1"></div>
|
|
93
|
+
<div class="bounce2"></div>
|
|
94
|
+
<div class="bounce3"></div>
|
|
95
|
+
</div>
|
|
96
|
+
<span class="loader__not-visible-text">{{yield}}</span>
|
|
97
|
+
{{else}}
|
|
98
|
+
<PixButtonContent
|
|
99
|
+
@iconBefore={{@iconBefore}}
|
|
100
|
+
@iconAfter={{@iconAfter}}
|
|
101
|
+
@plainIconAfter={{@plainIconAfter}}
|
|
102
|
+
@plainIconBefore={{@plainIconBefore}}
|
|
103
|
+
>
|
|
104
|
+
{{yield}}
|
|
105
|
+
</PixButtonContent>
|
|
106
|
+
{{/if}}
|
|
107
|
+
</button>
|
|
108
|
+
</template>
|
|
79
109
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { warn } from '@ember/debug';
|
|
2
|
+
import { on } from '@ember/modifier';
|
|
2
3
|
import { action } from '@ember/object';
|
|
3
4
|
import { guidFor } from '@ember/object/internals';
|
|
4
5
|
import Component from '@glimmer/component';
|
|
5
6
|
|
|
6
7
|
import { formatMessage } from '../translations';
|
|
7
|
-
|
|
8
|
+
import PixLabelWrapped from './pix-label-wrapped';
|
|
8
9
|
export default class PixCheckbox extends Component {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
@@ -70,4 +71,44 @@ export default class PixCheckbox extends Component {
|
|
|
70
71
|
formatMessage(message) {
|
|
71
72
|
return formatMessage(this.args.locale ?? 'fr', `input.${message}`);
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<div class="pix-checkbox {{@class}}">
|
|
77
|
+
<PixLabelWrapped
|
|
78
|
+
@for={{this.id}}
|
|
79
|
+
@requiredLabel={{@requiredLabel}}
|
|
80
|
+
@subLabel={{@subLabel}}
|
|
81
|
+
@size={{@size}}
|
|
82
|
+
@inlineLabel={{true}}
|
|
83
|
+
@screenReaderOnly={{@screenReaderOnly}}
|
|
84
|
+
@isDisabled={{this.isDisabled}}
|
|
85
|
+
@variant={{@variant}}
|
|
86
|
+
@state={{@state}}
|
|
87
|
+
>
|
|
88
|
+
<:inputElement>
|
|
89
|
+
<input
|
|
90
|
+
type="checkbox"
|
|
91
|
+
id={{this.id}}
|
|
92
|
+
class={{this.inputClasses}}
|
|
93
|
+
checked={{@checked}}
|
|
94
|
+
aria-disabled={{this.isDisabled}}
|
|
95
|
+
aria-describedby={{this.stateId}}
|
|
96
|
+
{{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
|
|
97
|
+
...attributes
|
|
98
|
+
/>
|
|
99
|
+
</:inputElement>
|
|
100
|
+
<:default>
|
|
101
|
+
{{yield to="label"}}
|
|
102
|
+
</:default>
|
|
103
|
+
</PixLabelWrapped>
|
|
104
|
+
|
|
105
|
+
<span class="screen-reader-only" id={{this.stateId}}>
|
|
106
|
+
{{#if this.hasSuccessState}}
|
|
107
|
+
{{this.stateSuccessMessage}}
|
|
108
|
+
{{else if this.hasErrorState}}
|
|
109
|
+
{{this.stateErrorMessage}}
|
|
110
|
+
{{/if}}
|
|
111
|
+
</span>
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
73
114
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { warn } from '@ember/debug';
|
|
2
|
+
import { htmlSafe } from '@ember/template';
|
|
3
|
+
|
|
4
|
+
import PixInputBase from './pix-input-base';
|
|
5
|
+
import PixLabel from './pix-label';
|
|
6
|
+
|
|
7
|
+
export default class PixCode extends PixInputBase {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
|
|
11
|
+
this.prefix = 'pix-code';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get length() {
|
|
15
|
+
warn('PixCode: @length is required.', !['', null, undefined].includes(this.args.length), {
|
|
16
|
+
id: 'pix-ui.code.length.required',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return this.args.length || 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get style() {
|
|
23
|
+
return htmlSafe('--nb-characters:' + this.length);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div>
|
|
28
|
+
{{#if (has-block "label")}}
|
|
29
|
+
<PixLabel
|
|
30
|
+
@for={{this.id}}
|
|
31
|
+
@requiredLabel={{@requiredLabel}}
|
|
32
|
+
@subLabel={{@subLabel}}
|
|
33
|
+
@size={{@size}}
|
|
34
|
+
@screenReaderOnly={{@screenReaderOnly}}
|
|
35
|
+
>
|
|
36
|
+
{{yield to="label"}}
|
|
37
|
+
</PixLabel>
|
|
38
|
+
{{/if}}
|
|
39
|
+
<div>
|
|
40
|
+
<input
|
|
41
|
+
id={{this.id}}
|
|
42
|
+
class="pix-code"
|
|
43
|
+
style={{this.style}}
|
|
44
|
+
value={{@value}}
|
|
45
|
+
aria-required="{{if @requiredLabel true false}}"
|
|
46
|
+
required={{if @requiredLabel true false}}
|
|
47
|
+
maxlength={{this.length}}
|
|
48
|
+
minlength={{this.length}}
|
|
49
|
+
aria-describedby={{this.ariaDescribedBy}}
|
|
50
|
+
...attributes
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
{{#if this.hasErrorMessage}}
|
|
54
|
+
<p id={{this.ariaDescribedBy}} class="pix-code__error-message">{{@errorMessage}}</p>
|
|
55
|
+
{{/if}}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
}
|
|
@@ -4,6 +4,10 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import Component from '@glimmer/component';
|
|
5
5
|
import { tracked } from '@glimmer/tracking';
|
|
6
6
|
|
|
7
|
+
import PixLabel from './pix-label';
|
|
8
|
+
import PixMultiSelect from './pix-multi-select';
|
|
9
|
+
import PixSelect from './pix-select';
|
|
10
|
+
|
|
7
11
|
export default class PixFilterableAndSearchableSelect extends Component {
|
|
8
12
|
@service elementHelper;
|
|
9
13
|
@tracked selectedCategories = [];
|
|
@@ -71,4 +75,55 @@ export default class PixFilterableAndSearchableSelect extends Component {
|
|
|
71
75
|
|
|
72
76
|
return selectableOptions;
|
|
73
77
|
}
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<div id={{this.mainId}} ...attributes>
|
|
81
|
+
<PixLabel
|
|
82
|
+
@for={{this.pixSelectId}}
|
|
83
|
+
@requiredLabel={{@requiredLabel}}
|
|
84
|
+
@size={{@size}}
|
|
85
|
+
@subLabel={{@subLabel}}
|
|
86
|
+
@screenReaderOnly={{@screenReaderOnly}}
|
|
87
|
+
@inlineLabel={{@inlineLabel}}
|
|
88
|
+
>
|
|
89
|
+
{{yield to="label"}}
|
|
90
|
+
</PixLabel>
|
|
91
|
+
<div
|
|
92
|
+
class="pix-filterable-and-searchable-select{{if
|
|
93
|
+
@errorMessage
|
|
94
|
+
' pix-filterable-and-searchable-select--error'
|
|
95
|
+
}}"
|
|
96
|
+
>
|
|
97
|
+
<PixMultiSelect
|
|
98
|
+
id={{this.pixMultiSelectId}}
|
|
99
|
+
@values={{this.selectedCategories}}
|
|
100
|
+
@options={{this.categories}}
|
|
101
|
+
@onChange={{this.selectCategories}}
|
|
102
|
+
@isComputeWidthDisabled={{true}}
|
|
103
|
+
@screenReaderOnly={{true}}
|
|
104
|
+
@className="pix-filterable-and-searchable-select__pix-multi-select"
|
|
105
|
+
>
|
|
106
|
+
<:label>{{yield to="categoriesLabel"}}</:label>
|
|
107
|
+
<:placeholder>{{this.categoriesPlaceholder}}</:placeholder>
|
|
108
|
+
<:default as |option|>{{option.label}}</:default>
|
|
109
|
+
</PixMultiSelect>
|
|
110
|
+
<PixSelect
|
|
111
|
+
@id={{this.pixSelectId}}
|
|
112
|
+
@placeholder={{@placeholder}}
|
|
113
|
+
@value={{@value}}
|
|
114
|
+
@options={{this.selectableOptions}}
|
|
115
|
+
@onChange={{@onChange}}
|
|
116
|
+
@isSearchable={{@isSearchable}}
|
|
117
|
+
@searchLabel={{@searchLabel}}
|
|
118
|
+
@screenReaderOnly={{true}}
|
|
119
|
+
@hideDefaultOption={{@hideDefaultOption}}
|
|
120
|
+
@className="pix-filterable-and-searchable-select__pix-select"
|
|
121
|
+
@isComputeWidthDisabled={{true}}
|
|
122
|
+
/>
|
|
123
|
+
</div>
|
|
124
|
+
{{#if @errorMessage}}
|
|
125
|
+
<p class="pix-filterable-and-searchable-select__error-message">{{@errorMessage}}</p>
|
|
126
|
+
{{/if}}
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
74
129
|
}
|