@prioticket/design-system-web 1.0.5 → 1.0.7
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/COMPONENT-DOCUMENTATION.md +561 -430
- package/README.md +344 -341
- package/component-documentation.json +1755 -1128
- package/custom-elements.json +6453 -0
- package/dist/component-gallery.html +2 -2
- package/dist/components/pd-checkbox.cjs.js +6 -6
- package/dist/components/pd-checkbox.es.js +39 -38
- package/dist/components/pd-menu.cjs.js +13 -13
- package/dist/components/pd-menu.es.js +19 -19
- package/dist/components/pd-segmented-stepper.cjs.js +3 -3
- package/dist/components/pd-segmented-stepper.es.js +4 -11
- package/dist/components/pd-stepper.cjs.js +3 -3
- package/dist/components/pd-stepper.es.js +19 -5
- package/dist/components/pd-tabs.cjs.js +4 -4
- package/dist/components/pd-tabs.es.js +53 -60
- package/dist/demo-theming.html +305 -305
- package/dist/types/components/pd-checkbox.d.ts +1 -0
- package/dist/types/components/pd-segmented-stepper.d.ts +2 -3
- package/dist/types/components/pd-stepper.d.ts +2 -0
- package/dist/types/components/pd-tabs.d.ts +2 -2
- package/package.json +25 -5
|
@@ -1,64 +1,54 @@
|
|
|
1
|
-
import { css as u, LitElement as
|
|
2
|
-
import { property as r, state as m, customElement as h } from "lit/decorators.js";
|
|
1
|
+
import { css as u, LitElement as b, html as l } from "lit";
|
|
2
|
+
import { property as r, state as m, queryAssignedElements as v, customElement as h } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/tabs/tabs.js";
|
|
4
4
|
import "@material/web/tabs/primary-tab.js";
|
|
5
5
|
import "@material/web/tabs/secondary-tab.js";
|
|
6
6
|
import "@material/web/icon/icon.js";
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
(
|
|
10
|
-
return
|
|
7
|
+
var y = Object.defineProperty, T = Object.getOwnPropertyDescriptor, i = (t, a, e, d) => {
|
|
8
|
+
for (var s = d > 1 ? void 0 : d ? T(a, e) : a, c = t.length - 1, p; c >= 0; c--)
|
|
9
|
+
(p = t[c]) && (s = (d ? p(a, e, s) : p(s)) || s);
|
|
10
|
+
return d && s && y(a, e, s), s;
|
|
11
11
|
};
|
|
12
|
-
let
|
|
12
|
+
let n = class extends b {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), this.activeTabIndex = 0, this.autoActivate = !1, this.tabs = [], this.slottedTabs = [];
|
|
15
15
|
}
|
|
16
|
-
connectedCallback() {
|
|
17
|
-
super.connectedCallback(), setTimeout(() => this.collectTabsFromSlot(), 0);
|
|
18
|
-
}
|
|
19
16
|
firstUpdated() {
|
|
20
|
-
this.
|
|
17
|
+
this.updateTabsFromSlot();
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
icon: e.getAttribute("icon") || void 0,
|
|
32
|
-
secondary: e.hasAttribute("secondary"),
|
|
33
|
-
inlineIcon: e.hasAttribute("inline-icon"),
|
|
34
|
-
ariaLabel: e.getAttribute("aria-label") || void 0
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}), this.slottedTabs = i, this.requestUpdate();
|
|
19
|
+
updateTabsFromSlot() {
|
|
20
|
+
const a = (this.assignedTabs ?? []).map((e) => ({
|
|
21
|
+
label: e.textContent?.trim() || "",
|
|
22
|
+
icon: e.getAttribute("icon") || void 0,
|
|
23
|
+
secondary: e.hasAttribute("secondary"),
|
|
24
|
+
inlineIcon: e.hasAttribute("inline-icon"),
|
|
25
|
+
ariaLabel: e.getAttribute("aria-label") || void 0
|
|
26
|
+
}));
|
|
27
|
+
this.slottedTabs = a, this.requestUpdate(), this.updateComplete.then(() => this.forceActiveTabUpdate());
|
|
38
28
|
}
|
|
39
29
|
handleSlotChange() {
|
|
40
|
-
this.
|
|
30
|
+
this.updateTabsFromSlot();
|
|
41
31
|
}
|
|
42
32
|
forceActiveTabUpdate() {
|
|
43
33
|
const t = this.shadowRoot?.querySelector("md-tabs");
|
|
44
34
|
t && this.activeTabIndex !== void 0 && (t.activeTabIndex = this.activeTabIndex);
|
|
45
35
|
}
|
|
46
36
|
renderTab(t, a) {
|
|
47
|
-
const
|
|
48
|
-
return t.secondary ?
|
|
37
|
+
const e = t.icon ? l`<md-icon slot="icon">${t.icon}</md-icon>` : "";
|
|
38
|
+
return t.secondary ? l`
|
|
49
39
|
<md-secondary-tab
|
|
50
40
|
?inline-icon=${t.inlineIcon}
|
|
51
41
|
aria-label=${t.ariaLabel || t.label}
|
|
52
42
|
>
|
|
53
|
-
${
|
|
43
|
+
${e}
|
|
54
44
|
${t.label}
|
|
55
45
|
</md-secondary-tab>
|
|
56
|
-
` :
|
|
46
|
+
` : l`
|
|
57
47
|
<md-primary-tab
|
|
58
48
|
?inline-icon=${t.inlineIcon}
|
|
59
49
|
aria-label=${t.ariaLabel || t.label}
|
|
60
50
|
>
|
|
61
|
-
${
|
|
51
|
+
${e}
|
|
62
52
|
${t.label}
|
|
63
53
|
</md-primary-tab>
|
|
64
54
|
`;
|
|
@@ -68,13 +58,13 @@ let l = class extends p {
|
|
|
68
58
|
}
|
|
69
59
|
render() {
|
|
70
60
|
const t = this.tabs.length > 0 ? this.tabs : this.slottedTabs;
|
|
71
|
-
return
|
|
61
|
+
return l`
|
|
72
62
|
<md-tabs
|
|
73
63
|
.activeTabIndex=${this.activeTabIndex}
|
|
74
64
|
?auto-activate=${this.autoActivate}
|
|
75
65
|
@change=${this.handleChange}
|
|
76
66
|
>
|
|
77
|
-
${t.map((a,
|
|
67
|
+
${t.map((a, e) => this.renderTab(a, e))}
|
|
78
68
|
</md-tabs>
|
|
79
69
|
<div style="display: none;">
|
|
80
70
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
@@ -90,50 +80,53 @@ let l = class extends p {
|
|
|
90
80
|
}));
|
|
91
81
|
}
|
|
92
82
|
};
|
|
93
|
-
|
|
83
|
+
i([
|
|
94
84
|
r({ type: Number, attribute: "active-tab-index" })
|
|
95
|
-
],
|
|
96
|
-
|
|
85
|
+
], n.prototype, "activeTabIndex", 2);
|
|
86
|
+
i([
|
|
97
87
|
r({ type: Boolean, attribute: "auto-activate" })
|
|
98
|
-
],
|
|
99
|
-
|
|
88
|
+
], n.prototype, "autoActivate", 2);
|
|
89
|
+
i([
|
|
100
90
|
r({ type: Array })
|
|
101
|
-
],
|
|
102
|
-
|
|
91
|
+
], n.prototype, "tabs", 2);
|
|
92
|
+
i([
|
|
103
93
|
m()
|
|
104
|
-
],
|
|
105
|
-
|
|
94
|
+
], n.prototype, "slottedTabs", 2);
|
|
95
|
+
i([
|
|
96
|
+
v({ flatten: !0, selector: "pd-tab" })
|
|
97
|
+
], n.prototype, "assignedTabs", 2);
|
|
98
|
+
n = i([
|
|
106
99
|
h("pd-tabs")
|
|
107
|
-
],
|
|
108
|
-
let
|
|
100
|
+
], n);
|
|
101
|
+
let o = class extends b {
|
|
109
102
|
constructor() {
|
|
110
103
|
super(...arguments), this.secondary = !1, this.inlineIcon = !1, this.icon = "", this.ariaLabel = "";
|
|
111
104
|
}
|
|
112
105
|
render() {
|
|
113
|
-
return
|
|
106
|
+
return l`<slot></slot>`;
|
|
114
107
|
}
|
|
115
108
|
};
|
|
116
|
-
|
|
109
|
+
o.styles = u`
|
|
117
110
|
:host {
|
|
118
111
|
display: none;
|
|
119
112
|
}
|
|
120
113
|
`;
|
|
121
|
-
|
|
114
|
+
i([
|
|
122
115
|
r({ type: Boolean })
|
|
123
|
-
],
|
|
124
|
-
|
|
116
|
+
], o.prototype, "secondary", 2);
|
|
117
|
+
i([
|
|
125
118
|
r({ type: Boolean, attribute: "inline-icon" })
|
|
126
|
-
],
|
|
127
|
-
|
|
119
|
+
], o.prototype, "inlineIcon", 2);
|
|
120
|
+
i([
|
|
128
121
|
r({ type: String })
|
|
129
|
-
],
|
|
130
|
-
|
|
122
|
+
], o.prototype, "icon", 2);
|
|
123
|
+
i([
|
|
131
124
|
r({ type: String, attribute: "aria-label" })
|
|
132
|
-
],
|
|
133
|
-
|
|
125
|
+
], o.prototype, "ariaLabel", 2);
|
|
126
|
+
o = i([
|
|
134
127
|
h("pd-tab")
|
|
135
|
-
],
|
|
128
|
+
], o);
|
|
136
129
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
o as PdTab,
|
|
131
|
+
n as PdTabs
|
|
139
132
|
};
|