@1024pix/pix-ui 49.3.0 → 49.4.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/addon/components/pix-label-wrapped.hbs +2 -2
- package/addon/components/pix-table-column.hbs +9 -0
- package/addon/components/pix-table-column.js +7 -0
- package/addon/components/pix-table.hbs +17 -0
- package/addon/components/pix-table.js +28 -0
- package/addon/styles/_pix-table.scss +49 -0
- package/addon/styles/addon.scss +1 -0
- package/app/components/pix-table-column.js +1 -0
- package/app/components/pix-table.js +1 -0
- package/package.json +1 -1
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
{{yield to="inputElement"}}
|
|
20
20
|
|
|
21
21
|
<span class="{{if @screenReaderOnly 'screen-reader-only'}}">
|
|
22
|
+
{{yield}}
|
|
23
|
+
|
|
22
24
|
{{#if @requiredLabel}}
|
|
23
25
|
<abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
|
|
24
26
|
{{/if}}
|
|
25
27
|
|
|
26
|
-
{{yield}}
|
|
27
|
-
|
|
28
28
|
{{#if @subLabel}}
|
|
29
29
|
<span class="pix-label__sub-label">{{@subLabel}}</span>
|
|
30
30
|
{{/if}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="pix-table">
|
|
2
|
+
<table>
|
|
3
|
+
<caption class="screen-reader-only">{{this.caption}}</caption>
|
|
4
|
+
<thead class={{this.headerClass}}>
|
|
5
|
+
<tr>
|
|
6
|
+
{{yield null "header" to="columns"}}
|
|
7
|
+
</tr>
|
|
8
|
+
</thead>
|
|
9
|
+
<tbody>
|
|
10
|
+
{{#each @data as |row|}}
|
|
11
|
+
<tr>
|
|
12
|
+
{{yield row "cell" to="columns"}}
|
|
13
|
+
</tr>
|
|
14
|
+
{{/each}}
|
|
15
|
+
</tbody>
|
|
16
|
+
</table>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { warn } from '@ember/debug';
|
|
3
|
+
|
|
4
|
+
export default class PixTable extends Component {
|
|
5
|
+
get variant() {
|
|
6
|
+
const value = this.args.variant ?? 'primary';
|
|
7
|
+
warn(
|
|
8
|
+
`PixTable: @variant "${value}" should be certif, orga or primary`,
|
|
9
|
+
['primary', 'orga', 'certif'].includes(value),
|
|
10
|
+
{
|
|
11
|
+
id: 'pix-ui.pix-table.variant.not-valid',
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get caption() {
|
|
19
|
+
warn(`PixTable: @caption is required`, Boolean(this.args.caption), {
|
|
20
|
+
id: 'pix-ui.pix-table.caption.required',
|
|
21
|
+
});
|
|
22
|
+
return this.args.caption;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get headerClass() {
|
|
26
|
+
return `pix-table-header--${this.variant}`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.pix-table {
|
|
2
|
+
width: 100%;
|
|
3
|
+
padding: var(--pix-spacing-4x);
|
|
4
|
+
overflow: auto;
|
|
5
|
+
border: solid 1px var(--pix-neutral-100);
|
|
6
|
+
border-radius: var(--pix-spacing-2x);
|
|
7
|
+
|
|
8
|
+
@extend %pix-body-s;
|
|
9
|
+
|
|
10
|
+
table {
|
|
11
|
+
min-width: 100%;
|
|
12
|
+
border-collapse: collapse;
|
|
13
|
+
|
|
14
|
+
tbody > tr:nth-of-type(even) {
|
|
15
|
+
background-color: var(--pix-neutral-20);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
thead.pix-table-header {
|
|
19
|
+
&--primary {
|
|
20
|
+
background: var(--pix-primary-10);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--orga {
|
|
24
|
+
background: var(--pix-orga-50);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--certif {
|
|
28
|
+
background: var(--pix-certif-50);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
th {
|
|
33
|
+
text-align: start;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
td, th {
|
|
37
|
+
padding: var(--pix-spacing-6x) var(--pix-spacing-4x);
|
|
38
|
+
|
|
39
|
+
&:first-child {
|
|
40
|
+
border-radius: var(--pix-spacing-2x) 0 0 var(--pix-spacing-2x);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:last-child {
|
|
44
|
+
border-radius: 0 var(--pix-spacing-2x) var(--pix-spacing-2x) 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
package/addon/styles/addon.scss
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@1024pix/pix-ui/components/pix-table-column';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@1024pix/pix-ui/components/pix-table';
|