@justeattakeaway/pie-data-table 0.0.0-snapshot-release-20250815153945 → 0.0.0-snapshot-release-20250818121553
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.
|
@@ -25,6 +25,10 @@ export declare class PieDataTableHeader extends PieElement implements DataTableH
|
|
|
25
25
|
* @param event - The slot change event
|
|
26
26
|
*/
|
|
27
27
|
private handleSlotChange;
|
|
28
|
+
/**
|
|
29
|
+
* Lit lifecycle: called after the component's DOM has been rendered the first time.
|
|
30
|
+
*/
|
|
31
|
+
firstUpdated(): void;
|
|
28
32
|
render(): import('lit-html').TemplateResult<1>;
|
|
29
33
|
static styles: import('lit').CSSResult;
|
|
30
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pie-data-table-header/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAKrF,OAAO,EACH,KAAK,oBAAoB,EAEzB,YAAY,EACf,MAAM,QAAQ,CAAC;AAGhB,cAAc,QAAQ,CAAC;AAEvB,QAAA,MAAM,iBAAiB,0BAA0B,CAAC;AAElD;;GAEG;AACH,qBACa,kBAAmB,SAAQ,UAAW,YAAW,oBAAoB;IAC9E;;OAEG;IAEI,KAAK,EAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAE7C;;OAEG;IAEI,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAElD;;OAEG;IAGI,OAAO,CAAC,EAAE,OAAO,YAAY,CAAC,OAAO,CAAC;IAG7C,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAKxB,MAAM;IA0BN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;KAC3C;CACJ"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pie-data-table-header/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAKrF,OAAO,EACH,KAAK,oBAAoB,EAEzB,YAAY,EACf,MAAM,QAAQ,CAAC;AAGhB,cAAc,QAAQ,CAAC;AAEvB,QAAA,MAAM,iBAAiB,0BAA0B,CAAC;AAElD;;GAEG;AACH,qBACa,kBAAmB,SAAQ,UAAW,YAAW,oBAAoB;IAC9E;;OAEG;IAEI,KAAK,EAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAE7C;;OAEG;IAEI,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAElD;;OAEG;IAGI,OAAO,CAAC,EAAE,OAAO,YAAY,CAAC,OAAO,CAAC;IAG7C,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;OAEG;IACH,YAAY;IAQZ,MAAM;IA0BN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;KAC3C;CACJ"}
|
|
@@ -6,13 +6,13 @@ import { classMap as v } from "lit/directives/class-map.js";
|
|
|
6
6
|
const m = "*,*:after,*:before{box-sizing:inherit}:host{display:block}.c-data-table-header{--data-table-header-background: transparent;padding:var(--dt-spacing-d);background-color:var(--data-table-header-background);border-bottom:1px solid var(--data-table-border-color);display:flex;justify-content:space-between;align-items:flex-end}.c-data-table-header-title-wrapper{display:flex;flex-direction:column;gap:var(--dt-spacing-b)}.c-data-table-header-title{font-weight:var(--dt-font-weight-extrabold);font-size:calc(var(--dt-font-size-24) * 1px);line-height:calc(var(--dt-font-size-24-line-height) * 1px)}.c-data-table-header-subtitle{font-weight:var(--dt-font-weight-regular);font-size:calc(var(--dt-font-size-16) * 1px);line-height:calc(var(--dt-font-size-16-line-height) * 1px)}.c-data-table-header--strong{--data-table-header-background: var(--dt-color-support-brand-02)}.c-data-table-action-buttons-wrapper{display:flex;gap:var(--dt-spacing-d)}", y = ["subtle", "strong"], x = {
|
|
7
7
|
variant: "subtle"
|
|
8
8
|
};
|
|
9
|
-
var w = Object.defineProperty,
|
|
10
|
-
for (var a = o > 1 ? void 0 : o ?
|
|
11
|
-
(d = e[i]) && (a = (o ? d(t,
|
|
12
|
-
return o && a && w(t,
|
|
9
|
+
var w = Object.defineProperty, S = Object.getOwnPropertyDescriptor, l = (e, t, r, o) => {
|
|
10
|
+
for (var a = o > 1 ? void 0 : o ? S(t, r) : t, i = e.length - 1, d; i >= 0; i--)
|
|
11
|
+
(d = e[i]) && (a = (o ? d(t, r, a) : d(a)) || a);
|
|
12
|
+
return o && a && w(t, r, a), a;
|
|
13
13
|
};
|
|
14
|
-
const
|
|
15
|
-
let
|
|
14
|
+
const P = "pie-data-table-header";
|
|
15
|
+
let s = class extends g {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.hasActionButtons = !1;
|
|
18
18
|
}
|
|
@@ -25,15 +25,23 @@ let r = class extends g {
|
|
|
25
25
|
const t = e.target;
|
|
26
26
|
this.hasActionButtons = t.assignedElements().length > 0;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Lit lifecycle: called after the component's DOM has been rendered the first time.
|
|
30
|
+
*/
|
|
31
|
+
firstUpdated() {
|
|
32
|
+
var t;
|
|
33
|
+
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector('slot[name="action-button"]');
|
|
34
|
+
e && (this.hasActionButtons = e.assignedElements().length > 0);
|
|
35
|
+
}
|
|
28
36
|
render() {
|
|
29
|
-
const { title: e, subtitle: t, variant:
|
|
37
|
+
const { title: e, subtitle: t, variant: r } = this;
|
|
30
38
|
return n`
|
|
31
39
|
<header class="${v({
|
|
32
40
|
"c-data-table-header": !0,
|
|
33
|
-
"c-data-table-header--strong":
|
|
41
|
+
"c-data-table-header--strong": r === "strong"
|
|
34
42
|
})}">
|
|
35
43
|
<div class="c-data-table-header-title-wrapper">
|
|
36
|
-
${e ? n`<span class="c-data-table-header-title">${e}</span>` : p}
|
|
44
|
+
${e ? n`<span class="c-data-table-header-title">${e}</span>` : p}
|
|
37
45
|
${t ? n`<span class="c-data-table-header-subtitle">${t}</span>` : p}
|
|
38
46
|
</div>
|
|
39
47
|
${this.hasActionButtons ? n`
|
|
@@ -47,25 +55,25 @@ let r = class extends g {
|
|
|
47
55
|
`;
|
|
48
56
|
}
|
|
49
57
|
};
|
|
50
|
-
|
|
58
|
+
s.styles = h(m);
|
|
51
59
|
l([
|
|
52
60
|
c({ type: String })
|
|
53
|
-
],
|
|
61
|
+
], s.prototype, "title", 2);
|
|
54
62
|
l([
|
|
55
63
|
c({ type: String })
|
|
56
|
-
],
|
|
64
|
+
], s.prototype, "subtitle", 2);
|
|
57
65
|
l([
|
|
58
66
|
c({ type: String }),
|
|
59
|
-
u(
|
|
60
|
-
],
|
|
67
|
+
u(P, y, x.variant)
|
|
68
|
+
], s.prototype, "variant", 2);
|
|
61
69
|
l([
|
|
62
70
|
b()
|
|
63
|
-
],
|
|
64
|
-
|
|
71
|
+
], s.prototype, "hasActionButtons", 2);
|
|
72
|
+
s = l([
|
|
65
73
|
f("pie-data-table-header")
|
|
66
|
-
],
|
|
74
|
+
], s);
|
|
67
75
|
export {
|
|
68
|
-
|
|
76
|
+
s as PieDataTableHeader,
|
|
69
77
|
y as dataTableHeaderVariant,
|
|
70
78
|
x as defaultProps
|
|
71
79
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-data-table",
|
|
3
3
|
"description": "PIE Design System Data Table built using Web Components",
|
|
4
|
-
"version": "0.0.0-snapshot-release-
|
|
4
|
+
"version": "0.0.0-snapshot-release-20250818121553",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -53,6 +53,17 @@ export class PieDataTableHeader extends PieElement implements DataTableHeaderPro
|
|
|
53
53
|
this.hasActionButtons = slot.assignedElements().length > 0;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Lit lifecycle: called after the component's DOM has been rendered the first time.
|
|
58
|
+
*/
|
|
59
|
+
firstUpdated () {
|
|
60
|
+
// Get the named slot element after shadowRoot is ready
|
|
61
|
+
const slot = this.shadowRoot?.querySelector('slot[name="action-button"]') as HTMLSlotElement | null;
|
|
62
|
+
if (slot) {
|
|
63
|
+
this.hasActionButtons = slot.assignedElements().length > 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
56
67
|
render () {
|
|
57
68
|
const { title, subtitle, variant } = this;
|
|
58
69
|
|
|
@@ -64,7 +75,7 @@ export class PieDataTableHeader extends PieElement implements DataTableHeaderPro
|
|
|
64
75
|
return html`
|
|
65
76
|
<header class="${classMap(classes)}">
|
|
66
77
|
<div class="c-data-table-header-title-wrapper">
|
|
67
|
-
${title ? html`<span class="c-data-table-header-title">${title}</span>` : nothing}
|
|
78
|
+
${title ? html`<span class="c-data-table-header-title">${title}</span>` : nothing}
|
|
68
79
|
${subtitle ? html`<span class="c-data-table-header-subtitle">${subtitle}</span>` : nothing}
|
|
69
80
|
</div>
|
|
70
81
|
${this.hasActionButtons ? html`
|