@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
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@prioticket/design-system-web@1.0.
|
|
29
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@prioticket/design-system-web@1.0.7/dist/theme-only.css">
|
|
30
30
|
|
|
31
31
|
<style>
|
|
32
32
|
:root {
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
</main>
|
|
322
322
|
|
|
323
323
|
<script type="module">
|
|
324
|
-
const CDN_BASE = 'https://cdn.jsdelivr.net/npm/@prioticket/design-system-web@1.0.
|
|
324
|
+
const CDN_BASE = 'https://cdn.jsdelivr.net/npm/@prioticket/design-system-web@1.0.7/dist';
|
|
325
325
|
const COMPONENT_BASE = CDN_BASE + '/components';
|
|
326
326
|
|
|
327
327
|
const COMPONENTS = [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("lit"),
|
|
2
|
-
<label class="checkbox-label" for=${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("lit"),d=require("lit/directives/if-defined.js"),i=require("lit/decorators.js");require("@material/web/checkbox/checkbox.js");var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,r=(c,t,e,a)=>{for(var o=a>1?void 0:a?p(t,e):t,n=c.length-1,l;n>=0;n--)(l=c[n])&&(o=(a?l(t,e,o):l(o))||o);return a&&o&&h(t,e,o),o};exports.PdCheckbox=class extends s.LitElement{constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.required=!1,this.value="",this.name="",this.label="",this.touchTarget=!1,this.inputId=`checkbox-${Math.random().toString(36).slice(2,11)}`}render(){const t=this.label||"Checkbox",e=this.touchTarget?"wrapper":void 0;return this.label?s.html`
|
|
2
|
+
<label class="checkbox-label" for=${this.inputId}>
|
|
3
3
|
<md-checkbox
|
|
4
|
-
id=${
|
|
4
|
+
id=${this.inputId}
|
|
5
5
|
?checked=${this.checked}
|
|
6
6
|
?indeterminate=${this.indeterminate}
|
|
7
7
|
?disabled=${this.disabled}
|
|
8
8
|
?required=${this.required}
|
|
9
|
-
touch-target=${e
|
|
9
|
+
touch-target=${d.ifDefined(e)}
|
|
10
10
|
aria-label=${t}
|
|
11
11
|
.value=${this.value}
|
|
12
12
|
.name=${this.name}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
?indeterminate=${this.indeterminate}
|
|
22
22
|
?disabled=${this.disabled}
|
|
23
23
|
?required=${this.required}
|
|
24
|
-
touch-target=${e
|
|
24
|
+
touch-target=${d.ifDefined(e)}
|
|
25
25
|
aria-label=${t}
|
|
26
26
|
.value=${this.value}
|
|
27
27
|
.name=${this.name}
|
|
@@ -82,4 +82,4 @@
|
|
|
82
82
|
:host([error]) .label-text {
|
|
83
83
|
color: var(--md-sys-color-error);
|
|
84
84
|
}
|
|
85
|
-
`;
|
|
85
|
+
`;r([i.property({type:Boolean})],exports.PdCheckbox.prototype,"checked",2);r([i.property({type:Boolean})],exports.PdCheckbox.prototype,"indeterminate",2);r([i.property({type:Boolean})],exports.PdCheckbox.prototype,"disabled",2);r([i.property({type:Boolean})],exports.PdCheckbox.prototype,"required",2);r([i.property({type:String})],exports.PdCheckbox.prototype,"value",2);r([i.property({type:String})],exports.PdCheckbox.prototype,"name",2);r([i.property({type:String})],exports.PdCheckbox.prototype,"label",2);r([i.property({type:Boolean,attribute:"touch-target"})],exports.PdCheckbox.prototype,"touchTarget",2);exports.PdCheckbox=r([i.customElement("pd-checkbox")],exports.PdCheckbox);
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import {
|
|
1
|
+
import { css as m, LitElement as p, html as h } from "lit";
|
|
2
|
+
import { ifDefined as d } from "lit/directives/if-defined.js";
|
|
3
|
+
import { property as s, customElement as u } from "lit/decorators.js";
|
|
3
4
|
import "@material/web/checkbox/checkbox.js";
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
(l =
|
|
7
|
-
return
|
|
5
|
+
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (i, e, o, n) => {
|
|
6
|
+
for (var r = n > 1 ? void 0 : n ? y(e, o) : e, c = i.length - 1, l; c >= 0; c--)
|
|
7
|
+
(l = i[c]) && (r = (n ? l(e, o, r) : l(r)) || r);
|
|
8
|
+
return n && r && b(e, o, r), r;
|
|
8
9
|
};
|
|
9
|
-
let t = class extends
|
|
10
|
+
let t = class extends p {
|
|
10
11
|
constructor() {
|
|
11
|
-
super(...arguments), this.checked = !1, this.indeterminate = !1, this.disabled = !1, this.required = !1, this.value = "", this.name = "", this.label = "", this.touchTarget = !1
|
|
12
|
+
super(...arguments), this.checked = !1, this.indeterminate = !1, this.disabled = !1, this.required = !1, this.value = "", this.name = "", this.label = "", this.touchTarget = !1, this.inputId = `checkbox-${Math.random().toString(36).slice(2, 11)}`;
|
|
12
13
|
}
|
|
13
14
|
render() {
|
|
14
|
-
const
|
|
15
|
+
const i = this.label || "Checkbox", e = this.touchTarget ? "wrapper" : void 0;
|
|
15
16
|
return this.label ? h`
|
|
16
|
-
<label class="checkbox-label" for=${
|
|
17
|
+
<label class="checkbox-label" for=${this.inputId}>
|
|
17
18
|
<md-checkbox
|
|
18
|
-
id=${
|
|
19
|
+
id=${this.inputId}
|
|
19
20
|
?checked=${this.checked}
|
|
20
21
|
?indeterminate=${this.indeterminate}
|
|
21
22
|
?disabled=${this.disabled}
|
|
22
23
|
?required=${this.required}
|
|
23
|
-
touch-target=${e
|
|
24
|
-
aria-label=${
|
|
24
|
+
touch-target=${d(e)}
|
|
25
|
+
aria-label=${i}
|
|
25
26
|
.value=${this.value}
|
|
26
27
|
.name=${this.name}
|
|
27
28
|
@change=${this._handleChange}
|
|
@@ -35,8 +36,8 @@ let t = class extends m {
|
|
|
35
36
|
?indeterminate=${this.indeterminate}
|
|
36
37
|
?disabled=${this.disabled}
|
|
37
38
|
?required=${this.required}
|
|
38
|
-
touch-target=${e
|
|
39
|
-
aria-label=${
|
|
39
|
+
touch-target=${d(e)}
|
|
40
|
+
aria-label=${i}
|
|
40
41
|
.value=${this.value}
|
|
41
42
|
.name=${this.name}
|
|
42
43
|
@change=${this._handleChange}
|
|
@@ -44,8 +45,8 @@ let t = class extends m {
|
|
|
44
45
|
></md-checkbox>
|
|
45
46
|
`;
|
|
46
47
|
}
|
|
47
|
-
_handleChange(
|
|
48
|
-
const e =
|
|
48
|
+
_handleChange(i) {
|
|
49
|
+
const e = i.target;
|
|
49
50
|
this.checked = e.checked, this.indeterminate = e.indeterminate, this.dispatchEvent(new CustomEvent("change", {
|
|
50
51
|
detail: {
|
|
51
52
|
checked: e.checked,
|
|
@@ -55,8 +56,8 @@ let t = class extends m {
|
|
|
55
56
|
bubbles: !0
|
|
56
57
|
}));
|
|
57
58
|
}
|
|
58
|
-
_handleInput(
|
|
59
|
-
const e =
|
|
59
|
+
_handleInput(i) {
|
|
60
|
+
const e = i.target;
|
|
60
61
|
this.checked = e.checked, this.indeterminate = e.indeterminate, this.dispatchEvent(new CustomEvent("input", {
|
|
61
62
|
detail: {
|
|
62
63
|
checked: e.checked,
|
|
@@ -67,7 +68,7 @@ let t = class extends m {
|
|
|
67
68
|
}));
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
|
-
t.styles =
|
|
71
|
+
t.styles = m`
|
|
71
72
|
:host {
|
|
72
73
|
display: inline-flex;
|
|
73
74
|
align-items: center;
|
|
@@ -122,32 +123,32 @@ t.styles = d`
|
|
|
122
123
|
color: var(--md-sys-color-error);
|
|
123
124
|
}
|
|
124
125
|
`;
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
a([
|
|
127
|
+
s({ type: Boolean })
|
|
127
128
|
], t.prototype, "checked", 2);
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
a([
|
|
130
|
+
s({ type: Boolean })
|
|
130
131
|
], t.prototype, "indeterminate", 2);
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
a([
|
|
133
|
+
s({ type: Boolean })
|
|
133
134
|
], t.prototype, "disabled", 2);
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
a([
|
|
136
|
+
s({ type: Boolean })
|
|
136
137
|
], t.prototype, "required", 2);
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
a([
|
|
139
|
+
s({ type: String })
|
|
139
140
|
], t.prototype, "value", 2);
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
a([
|
|
142
|
+
s({ type: String })
|
|
142
143
|
], t.prototype, "name", 2);
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
a([
|
|
145
|
+
s({ type: String })
|
|
145
146
|
], t.prototype, "label", 2);
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
a([
|
|
148
|
+
s({ type: Boolean, attribute: "touch-target" })
|
|
148
149
|
], t.prototype, "touchTarget", 2);
|
|
149
|
-
t =
|
|
150
|
-
|
|
150
|
+
t = a([
|
|
151
|
+
u("pd-checkbox")
|
|
151
152
|
], t);
|
|
152
153
|
export {
|
|
153
154
|
t as PdCheckbox
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("lit"),e=require("lit/decorators.js");require("@material/web/menu/menu.js");require("@material/web/menu/menu-item.js");var c=Object.defineProperty,y=Object.getOwnPropertyDescriptor,t=(p,r,s,n)=>{for(var o=n>1?void 0:n?y(r,s):r,i=p.length-1,u;i>=0;i--)(u=p[i])&&(o=(n?u(r,s,o):u(o))||o);return n&&o&&c(r,s,o),o};exports.PdMenu=class extends a.LitElement{constructor(){super(...arguments),this.anchor="",this.open=!1,this.positioning="popover",this.anchorCorner="start-start",this.menuCorner="start-start",this.quick=!1,this.hasOverflow=!1,this.xOffset=0,this.yOffset=0,this.defaultFocus="list-root",this.stayOpenOnFocusout=!1,this.stayOpenOnOutsideClick=!1,this.skipRestoreFocus=!1}updated(r){if(r.has("anchor")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("lit"),e=require("lit/decorators.js");require("@material/web/menu/menu.js");require("@material/web/menu/menu-item.js");var c=Object.defineProperty,y=Object.getOwnPropertyDescriptor,t=(p,r,s,n)=>{for(var o=n>1?void 0:n?y(r,s):r,i=p.length-1,u;i>=0;i--)(u=p[i])&&(o=(n?u(r,s,o):u(o))||o);return n&&o&&c(r,s,o),o};exports.PdMenu=class extends a.LitElement{constructor(){super(...arguments),this.anchor="",this.open=!1,this.positioning="popover",this.anchorCorner="start-start",this.menuCorner="start-start",this.quick=!1,this.hasOverflow=!1,this.xOffset=0,this.yOffset=0,this.defaultFocus="list-root",this.stayOpenOnFocusout=!1,this.stayOpenOnOutsideClick=!1,this.skipRestoreFocus=!1}updated(r){if(r.has("anchor")){const s=this.getRootNode();this.anchor&&s?this.anchorElement=s.getElementById(this.anchor)??void 0:this.anchor||(this.anchorElement=void 0)}}render(){return a.html`
|
|
2
2
|
<md-menu
|
|
3
3
|
.anchorElement=${this.anchorElement}
|
|
4
|
-
|
|
5
|
-
positioning=${this.positioning}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
.open=${this.open}
|
|
5
|
+
.positioning=${this.positioning}
|
|
6
|
+
.anchorCorner=${this.anchorCorner}
|
|
7
|
+
.menuCorner=${this.menuCorner}
|
|
8
|
+
.quick=${this.quick}
|
|
9
|
+
.hasOverflow=${this.hasOverflow}
|
|
10
|
+
.xOffset=${this.xOffset}
|
|
11
|
+
.yOffset=${this.yOffset}
|
|
12
|
+
.defaultFocus=${this.defaultFocus}
|
|
13
|
+
.stayOpenOnFocusout=${this.stayOpenOnFocusout}
|
|
14
|
+
.stayOpenOnOutsideClick=${this.stayOpenOnOutsideClick}
|
|
15
|
+
.skipRestoreFocus=${this.skipRestoreFocus}
|
|
16
16
|
@closed=${()=>this.open=!1}
|
|
17
17
|
>
|
|
18
18
|
<slot></slot>
|
|
@@ -2,10 +2,10 @@ import { css as c, LitElement as l, html as h } from "lit";
|
|
|
2
2
|
import { query as f, property as o, customElement as y } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/menu/menu.js";
|
|
4
4
|
import "@material/web/menu/menu-item.js";
|
|
5
|
-
var m = Object.defineProperty, d = Object.getOwnPropertyDescriptor, e = (n,
|
|
6
|
-
for (var
|
|
7
|
-
(u = n[
|
|
8
|
-
return i &&
|
|
5
|
+
var m = Object.defineProperty, d = Object.getOwnPropertyDescriptor, e = (n, s, a, i) => {
|
|
6
|
+
for (var r = i > 1 ? void 0 : i ? d(s, a) : s, p = n.length - 1, u; p >= 0; p--)
|
|
7
|
+
(u = n[p]) && (r = (i ? u(s, a, r) : u(r)) || r);
|
|
8
|
+
return i && r && m(s, a, r), r;
|
|
9
9
|
};
|
|
10
10
|
let t = class extends l {
|
|
11
11
|
constructor() {
|
|
@@ -18,27 +18,27 @@ let t = class extends l {
|
|
|
18
18
|
* which correctly handles Shadow DOM boundaries.
|
|
19
19
|
*/
|
|
20
20
|
updated(n) {
|
|
21
|
-
if (n.has("anchor")
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
if (n.has("anchor")) {
|
|
22
|
+
const s = this.getRootNode();
|
|
23
|
+
this.anchor && s ? this.anchorElement = s.getElementById(this.anchor) ?? void 0 : this.anchor || (this.anchorElement = void 0);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
27
|
return h`
|
|
28
28
|
<md-menu
|
|
29
29
|
.anchorElement=${this.anchorElement}
|
|
30
|
-
|
|
31
|
-
positioning=${this.positioning}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
.open=${this.open}
|
|
31
|
+
.positioning=${this.positioning}
|
|
32
|
+
.anchorCorner=${this.anchorCorner}
|
|
33
|
+
.menuCorner=${this.menuCorner}
|
|
34
|
+
.quick=${this.quick}
|
|
35
|
+
.hasOverflow=${this.hasOverflow}
|
|
36
|
+
.xOffset=${this.xOffset}
|
|
37
|
+
.yOffset=${this.yOffset}
|
|
38
|
+
.defaultFocus=${this.defaultFocus}
|
|
39
|
+
.stayOpenOnFocusout=${this.stayOpenOnFocusout}
|
|
40
|
+
.stayOpenOnOutsideClick=${this.stayOpenOnOutsideClick}
|
|
41
|
+
.skipRestoreFocus=${this.skipRestoreFocus}
|
|
42
42
|
@closed=${() => this.open = !1}
|
|
43
43
|
>
|
|
44
44
|
<slot></slot>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lit"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lit"),r=require("lit/decorators.js");require("@material/web/icon/icon.js");var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(c,e,t,s)=>{for(var o=s>1?void 0:s?d(e,t):e,a=c.length-1,l;a>=0;a--)(l=c[a])&&(o=(s?l(e,t,o):l(o))||o);return s&&o&&n(e,t,o),o};exports.PdSegmentedStepper=class extends p.LitElement{constructor(){super(...arguments),this.activeStep=0,this.completedSteps=[],this.size="medium",this.disabled=!1,this.allowStepNavigation=!0,this.linear=!0,this._steps=[],this._completedStepsSet=new Set}connectedCallback(){super.connectedCallback(),this.addEventListener("stepper-item-click",this._handleStepClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("stepper-item-click",this._handleStepClick)}firstUpdated(){this._updateSteps()}updated(e){super.updated(e),(e.has("activeStep")||e.has("completedSteps")||e.has("disabled")||e.has("allowStepNavigation")||e.has("linear"))&&(this._updateSteps(),e.has("completedSteps")&&(this._completedStepsSet=new Set(this.completedSteps)))}_updateSteps(){const e=this.querySelectorAll("pd-stepper-item");this._steps=Array.from(e),this._steps.forEach((t,s)=>{t.disabled=this.disabled,t.setAttribute("data-step-index",s.toString()),t.stepNumber=s+1;const o=this._completedStepsSet.has(s)||this.completedSteps.includes(s);o?t.state="completed":s===this.activeStep?t.state="active":t.state="pending";const a=!this.linear||s<=this.activeStep||o;t.clickable=this.allowStepNavigation&&a&&!this.disabled})}_handleStepClick(e){if(this.disabled)return;const t=e.target,s=parseInt(t.getAttribute("data-step-index")||"0");t.clickable&&this.allowStepNavigation&&this.goToStep(s)}goToStep(e){if(e>=0&&e<this._steps.length&&e!==this.activeStep){const t=this.activeStep;this.activeStep=e,this._completedStepsSet=new Set(this.completedSteps),this._updateSteps(),this._dispatchStepChange(t)}}_dispatchStepChange(e){this.dispatchEvent(new CustomEvent("step-change",{detail:{currentStep:this.activeStep,previousStep:e??this.activeStep,totalSteps:this._steps.length},bubbles:!0,composed:!0}))}next(){this.activeStep<this._steps.length-1&&(this.completeStep(this.activeStep),this.goToStep(this.activeStep+1))}back(){this.activeStep>0&&this.goToStep(this.activeStep-1)}nextStep(){this.next()}previousStep(){this.back()}completeCurrentStep(){this.completeStep(this.activeStep)}completeStep(e){e>=0&&e<this._steps.length&&!this._completedStepsSet.has(e)&&(this._completedStepsSet.add(e),this.completedSteps=Array.from(this._completedStepsSet).sort((t,s)=>t-s),this._updateSteps(),this.dispatchEvent(new CustomEvent("step-complete",{detail:{completedStep:e,completedSteps:this.completedSteps,totalSteps:this._steps.length},bubbles:!0,composed:!0})))}resetStep(e){e>=0&&e<this._steps.length&&this._completedStepsSet.has(e)&&(this._completedStepsSet.delete(e),this.completedSteps=Array.from(this._completedStepsSet).sort((t,s)=>t-s),this._updateSteps())}reset(){this.activeStep=0,this.completedSteps=[],this._completedStepsSet.clear(),this._updateSteps()}render(){return p.html`
|
|
2
2
|
<div class="segmented-stepper" role="group" aria-label="Progress stepper">
|
|
3
3
|
<slot @slotchange=${this._updateSteps}></slot>
|
|
4
4
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
:host([disabled]) ::slotted(pd-stepper-item) {
|
|
46
46
|
border-right-color: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
47
47
|
}
|
|
48
|
-
`;
|
|
48
|
+
`;i([r.property({type:Number,attribute:"active-step"})],exports.PdSegmentedStepper.prototype,"activeStep",2);i([r.property({type:Array,attribute:"completed-steps"})],exports.PdSegmentedStepper.prototype,"completedSteps",2);i([r.property({type:String,reflect:!0})],exports.PdSegmentedStepper.prototype,"size",2);i([r.property({type:Boolean,reflect:!0})],exports.PdSegmentedStepper.prototype,"disabled",2);i([r.property({type:Boolean,attribute:"allow-step-navigation"})],exports.PdSegmentedStepper.prototype,"allowStepNavigation",2);i([r.property({type:Boolean})],exports.PdSegmentedStepper.prototype,"linear",2);i([r.state()],exports.PdSegmentedStepper.prototype,"_steps",2);i([r.state()],exports.PdSegmentedStepper.prototype,"_completedStepsSet",2);exports.PdSegmentedStepper=i([r.customElement("pd-segmented-stepper")],exports.PdSegmentedStepper);exports.PdStepperItem=class extends p.LitElement{constructor(){super(...arguments),this.stepNumber=1,this.state="pending",this.disabled=!1,this.clickable=!1,this.icon=""}_handleClick(){this.disabled||!this.clickable||this.dispatchEvent(new CustomEvent("stepper-item-click",{detail:{stepNumber:this.stepNumber},bubbles:!0,composed:!0}))}render(){const e=this.state==="completed"&&!this.icon,t=this.state!=="completed"&&!this.icon;return p.html`
|
|
49
49
|
<button
|
|
50
50
|
class="step ${this.state} ${this.clickable?"clickable":""}"
|
|
51
51
|
?disabled=${this.disabled}
|
|
@@ -188,4 +188,4 @@
|
|
|
188
188
|
outline: 2px solid var(--md-sys-color-primary, #6750a4);
|
|
189
189
|
outline-offset: 2px;
|
|
190
190
|
}
|
|
191
|
-
`;
|
|
191
|
+
`;i([r.property({type:Number,attribute:"step-number"})],exports.PdStepperItem.prototype,"stepNumber",2);i([r.property({type:String,reflect:!0})],exports.PdStepperItem.prototype,"state",2);i([r.property({type:Boolean,reflect:!0})],exports.PdStepperItem.prototype,"disabled",2);i([r.property({type:Boolean})],exports.PdStepperItem.prototype,"clickable",2);i([r.property({type:String})],exports.PdStepperItem.prototype,"icon",2);exports.PdStepperItem=i([r.customElement("pd-stepper-item")],exports.PdStepperItem);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css as h, LitElement as m, html as l } from "lit";
|
|
2
2
|
import { property as a, state as u, customElement as b } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/icon/icon.js";
|
|
4
|
-
var
|
|
5
|
-
for (var r = c > 1 ? void 0 : c ?
|
|
4
|
+
var S = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (e, t, s, c) => {
|
|
5
|
+
for (var r = c > 1 ? void 0 : c ? v(t, s) : t, n = e.length - 1, d; n >= 0; n--)
|
|
6
6
|
(d = e[n]) && (r = (c ? d(t, s, r) : d(r)) || r);
|
|
7
|
-
return c && r &&
|
|
7
|
+
return c && r && S(t, s, r), r;
|
|
8
8
|
};
|
|
9
9
|
let o = class extends m {
|
|
10
10
|
constructor() {
|
|
@@ -48,13 +48,6 @@ let o = class extends m {
|
|
|
48
48
|
this.dispatchEvent(new CustomEvent("step-change", {
|
|
49
49
|
detail: {
|
|
50
50
|
currentStep: this.activeStep,
|
|
51
|
-
previousStep: e ?? this.activeStep
|
|
52
|
-
},
|
|
53
|
-
bubbles: !0,
|
|
54
|
-
composed: !0
|
|
55
|
-
})), this.dispatchEvent(new CustomEvent("stepchange", {
|
|
56
|
-
detail: {
|
|
57
|
-
activeStep: this.activeStep,
|
|
58
51
|
previousStep: e ?? this.activeStep,
|
|
59
52
|
totalSteps: this._steps.length
|
|
60
53
|
},
|
|
@@ -84,7 +77,7 @@ let o = class extends m {
|
|
|
84
77
|
}
|
|
85
78
|
/** Mark a specific step as completed. */
|
|
86
79
|
completeStep(e) {
|
|
87
|
-
e >= 0 && e < this._steps.length && !this._completedStepsSet.has(e) && (this._completedStepsSet.add(e), this.completedSteps = Array.from(this._completedStepsSet).sort((t, s) => t - s), this._updateSteps(), this.dispatchEvent(new CustomEvent("
|
|
80
|
+
e >= 0 && e < this._steps.length && !this._completedStepsSet.has(e) && (this._completedStepsSet.add(e), this.completedSteps = Array.from(this._completedStepsSet).sort((t, s) => t - s), this._updateSteps(), this.dispatchEvent(new CustomEvent("step-complete", {
|
|
88
81
|
detail: {
|
|
89
82
|
completedStep: e,
|
|
90
83
|
completedSteps: this.completedSteps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lit"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lit"),p=require("lit/decorators.js"),n=require("lit/directives/class-map.js");var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,a=(c,e,t,s)=>{for(var r=s>1?void 0:s?y(e,t):e,i=c.length-1,l;i>=0;i--)(l=c[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&u(e,t,r),r};exports.PdStepper=class extends o.LitElement{constructor(){super(...arguments),this.steps=[],this.currentStep=0,this.orientation="horizontal",this.linear=!0,this.showContent=!0,this.alternativeLabel=!1,this._completedSteps=new Set}render(){const e=this.orientation==="vertical",t={stepper:!0,vertical:e,horizontal:!e,"alternative-label":this.alternativeLabel&&!e};return o.html`
|
|
2
2
|
<div class=${n.classMap(t)}>
|
|
3
3
|
${this.steps.map((s,r)=>this._renderStep(s,r))}
|
|
4
4
|
${this.showContent&&!e?this._renderContent():""}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class="stepper-content">
|
|
26
26
|
${e.content}
|
|
27
27
|
</div>
|
|
28
|
-
`:""}_handleStepClick(e,t){if(!t)return;const s=this.currentStep;this.currentStep=e,this.dispatchEvent(new CustomEvent("step-change",{detail:{currentStep:e,previousStep:s},bubbles:!0,composed:!0}))}completeStep(e){this._completedSteps.add(e),this.requestUpdate()}resetStep(e){this._completedSteps.delete(e),this.requestUpdate()}next(){this.currentStep<this.steps.length-1
|
|
28
|
+
`:""}_handleStepClick(e,t){if(!t)return;const s=this.currentStep;this.currentStep=e,this.dispatchEvent(new CustomEvent("step-change",{detail:{currentStep:e,previousStep:s,totalSteps:this.steps.length},bubbles:!0,composed:!0}))}completeStep(e){this._completedSteps.add(e),this.requestUpdate()}resetStep(e){this._completedSteps.delete(e),this.requestUpdate()}next(){if(this.currentStep<this.steps.length-1){const e=this.currentStep;this.completeStep(this.currentStep),this.currentStep++,this._dispatchStepChange(e)}}back(){if(this.currentStep>0){const e=this.currentStep;this.currentStep--,this._dispatchStepChange(e)}}_dispatchStepChange(e){this.dispatchEvent(new CustomEvent("step-change",{detail:{currentStep:this.currentStep,previousStep:e??this.currentStep,totalSteps:this.steps.length},bubbles:!0,composed:!0}))}};exports.PdStepper.styles=o.css`
|
|
29
29
|
:host {
|
|
30
30
|
display: block;
|
|
31
31
|
font-family: var(--md-sys-typescale-body-large-font, 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
|
|
@@ -276,4 +276,4 @@
|
|
|
276
276
|
align-items: flex-start;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
`;
|
|
279
|
+
`;a([p.property({type:Array})],exports.PdStepper.prototype,"steps",2);a([p.property({type:Number})],exports.PdStepper.prototype,"currentStep",2);a([p.property({type:String})],exports.PdStepper.prototype,"orientation",2);a([p.property({type:Boolean})],exports.PdStepper.prototype,"linear",2);a([p.property({type:Boolean})],exports.PdStepper.prototype,"showContent",2);a([p.property({type:Boolean})],exports.PdStepper.prototype,"alternativeLabel",2);a([p.state()],exports.PdStepper.prototype,"_completedSteps",2);exports.PdStepper=a([p.customElement("pd-stepper")],exports.PdStepper);
|
|
@@ -65,7 +65,11 @@ let a = class extends y {
|
|
|
65
65
|
if (!t) return;
|
|
66
66
|
const s = this.currentStep;
|
|
67
67
|
this.currentStep = e, this.dispatchEvent(new CustomEvent("step-change", {
|
|
68
|
-
detail: {
|
|
68
|
+
detail: {
|
|
69
|
+
currentStep: e,
|
|
70
|
+
previousStep: s,
|
|
71
|
+
totalSteps: this.steps.length
|
|
72
|
+
},
|
|
69
73
|
bubbles: !0,
|
|
70
74
|
composed: !0
|
|
71
75
|
}));
|
|
@@ -80,15 +84,25 @@ let a = class extends y {
|
|
|
80
84
|
}
|
|
81
85
|
/** Go to next step */
|
|
82
86
|
next() {
|
|
83
|
-
this.currentStep < this.steps.length - 1
|
|
87
|
+
if (this.currentStep < this.steps.length - 1) {
|
|
88
|
+
const e = this.currentStep;
|
|
89
|
+
this.completeStep(this.currentStep), this.currentStep++, this._dispatchStepChange(e);
|
|
90
|
+
}
|
|
84
91
|
}
|
|
85
92
|
/** Go to previous step */
|
|
86
93
|
back() {
|
|
87
|
-
this.currentStep > 0
|
|
94
|
+
if (this.currentStep > 0) {
|
|
95
|
+
const e = this.currentStep;
|
|
96
|
+
this.currentStep--, this._dispatchStepChange(e);
|
|
97
|
+
}
|
|
88
98
|
}
|
|
89
|
-
_dispatchStepChange() {
|
|
99
|
+
_dispatchStepChange(e) {
|
|
90
100
|
this.dispatchEvent(new CustomEvent("step-change", {
|
|
91
|
-
detail: {
|
|
101
|
+
detail: {
|
|
102
|
+
currentStep: this.currentStep,
|
|
103
|
+
previousStep: e ?? this.currentStep,
|
|
104
|
+
totalSteps: this.steps.length
|
|
105
|
+
},
|
|
92
106
|
bubbles: !0,
|
|
93
107
|
composed: !0
|
|
94
108
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lit"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lit"),a=require("lit/decorators.js");require("@material/web/tabs/tabs.js");require("@material/web/tabs/primary-tab.js");require("@material/web/tabs/secondary-tab.js");require("@material/web/icon/icon.js");var b=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(o,t,i,e)=>{for(var n=e>1?void 0:e?c(t,i):t,d=o.length-1,l;d>=0;d--)(l=o[d])&&(n=(e?l(t,i,n):l(n))||n);return e&&n&&b(t,i,n),n};exports.PdTabs=class extends r.LitElement{constructor(){super(...arguments),this.activeTabIndex=0,this.autoActivate=!1,this.tabs=[],this.slottedTabs=[]}firstUpdated(){this.updateTabsFromSlot()}updateTabsFromSlot(){const i=(this.assignedTabs??[]).map(e=>({label:e.textContent?.trim()||"",icon:e.getAttribute("icon")||void 0,secondary:e.hasAttribute("secondary"),inlineIcon:e.hasAttribute("inline-icon"),ariaLabel:e.getAttribute("aria-label")||void 0}));this.slottedTabs=i,this.requestUpdate(),this.updateComplete.then(()=>this.forceActiveTabUpdate())}handleSlotChange(){this.updateTabsFromSlot()}forceActiveTabUpdate(){const t=this.shadowRoot?.querySelector("md-tabs");t&&this.activeTabIndex!==void 0&&(t.activeTabIndex=this.activeTabIndex)}renderTab(t,i){const e=t.icon?r.html`<md-icon slot="icon">${t.icon}</md-icon>`:"";return t.secondary?r.html`
|
|
2
2
|
<md-secondary-tab
|
|
3
3
|
?inline-icon=${t.inlineIcon}
|
|
4
4
|
aria-label=${t.ariaLabel||t.label}
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
?auto-activate=${this.autoActivate}
|
|
21
21
|
@change=${this.handleChange}
|
|
22
22
|
>
|
|
23
|
-
${t.map((
|
|
23
|
+
${t.map((i,e)=>this.renderTab(i,e))}
|
|
24
24
|
</md-tabs>
|
|
25
25
|
<div style="display: none;">
|
|
26
26
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
27
27
|
</div>
|
|
28
|
-
`}handleChange(t){const
|
|
28
|
+
`}handleChange(t){const i=t.target;this.activeTabIndex=i.activeTabIndex,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{activeTabIndex:this.activeTabIndex}}))}};s([a.property({type:Number,attribute:"active-tab-index"})],exports.PdTabs.prototype,"activeTabIndex",2);s([a.property({type:Boolean,attribute:"auto-activate"})],exports.PdTabs.prototype,"autoActivate",2);s([a.property({type:Array})],exports.PdTabs.prototype,"tabs",2);s([a.state()],exports.PdTabs.prototype,"slottedTabs",2);s([a.queryAssignedElements({flatten:!0,selector:"pd-tab"})],exports.PdTabs.prototype,"assignedTabs",2);exports.PdTabs=s([a.customElement("pd-tabs")],exports.PdTabs);exports.PdTab=class extends r.LitElement{constructor(){super(...arguments),this.secondary=!1,this.inlineIcon=!1,this.icon="",this.ariaLabel=""}render(){return r.html`<slot></slot>`}};exports.PdTab.styles=r.css`
|
|
29
29
|
:host {
|
|
30
30
|
display: none;
|
|
31
31
|
}
|
|
32
|
-
`;
|
|
32
|
+
`;s([a.property({type:Boolean})],exports.PdTab.prototype,"secondary",2);s([a.property({type:Boolean,attribute:"inline-icon"})],exports.PdTab.prototype,"inlineIcon",2);s([a.property({type:String})],exports.PdTab.prototype,"icon",2);s([a.property({type:String,attribute:"aria-label"})],exports.PdTab.prototype,"ariaLabel",2);exports.PdTab=s([a.customElement("pd-tab")],exports.PdTab);
|