@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.
@@ -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.5/dist/theme-only.css">
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.5/dist';
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"),r=require("lit/decorators.js");require("@material/web/checkbox/checkbox.js");var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,o=(c,t,e,i)=>{for(var a=i>1?void 0:i?d(t,e):t,n=c.length-1,l;n>=0;n--)(l=c[n])&&(a=(i?l(t,e,a):l(a))||a);return i&&a&&h(t,e,a),a};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}render(){const t=this.label||"Checkbox",e=this.touchTarget?"wrapper":void 0,i=`checkbox-${Math.random().toString(36).substr(2,9)}`;return this.label?s.html`
2
- <label class="checkbox-label" for=${i}>
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=${i}
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||"wrapper"}
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||"wrapper"}
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
- `;o([r.property({type:Boolean})],exports.PdCheckbox.prototype,"checked",2);o([r.property({type:Boolean})],exports.PdCheckbox.prototype,"indeterminate",2);o([r.property({type:Boolean})],exports.PdCheckbox.prototype,"disabled",2);o([r.property({type:Boolean})],exports.PdCheckbox.prototype,"required",2);o([r.property({type:String})],exports.PdCheckbox.prototype,"value",2);o([r.property({type:String})],exports.PdCheckbox.prototype,"name",2);o([r.property({type:String})],exports.PdCheckbox.prototype,"label",2);o([r.property({type:Boolean,attribute:"touch-target"})],exports.PdCheckbox.prototype,"touchTarget",2);exports.PdCheckbox=o([r.customElement("pd-checkbox")],exports.PdCheckbox);
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 d, LitElement as m, html as h } from "lit";
2
- import { property as r, customElement as p } from "lit/decorators.js";
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 u = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (a, e, o, c) => {
5
- for (var s = c > 1 ? void 0 : c ? b(e, o) : e, n = a.length - 1, l; n >= 0; n--)
6
- (l = a[n]) && (s = (c ? l(e, o, s) : l(s)) || s);
7
- return c && s && u(e, o, s), s;
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 m {
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 a = this.label || "Checkbox", e = this.touchTarget ? "wrapper" : void 0, o = `checkbox-${Math.random().toString(36).substr(2, 9)}`;
15
+ const i = this.label || "Checkbox", e = this.touchTarget ? "wrapper" : void 0;
15
16
  return this.label ? h`
16
- <label class="checkbox-label" for=${o}>
17
+ <label class="checkbox-label" for=${this.inputId}>
17
18
  <md-checkbox
18
- id=${o}
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 || "wrapper"}
24
- aria-label=${a}
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 || "wrapper"}
39
- aria-label=${a}
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(a) {
48
- const e = a.target;
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(a) {
59
- const e = a.target;
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 = d`
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
- i([
126
- r({ type: Boolean })
126
+ a([
127
+ s({ type: Boolean })
127
128
  ], t.prototype, "checked", 2);
128
- i([
129
- r({ type: Boolean })
129
+ a([
130
+ s({ type: Boolean })
130
131
  ], t.prototype, "indeterminate", 2);
131
- i([
132
- r({ type: Boolean })
132
+ a([
133
+ s({ type: Boolean })
133
134
  ], t.prototype, "disabled", 2);
134
- i([
135
- r({ type: Boolean })
135
+ a([
136
+ s({ type: Boolean })
136
137
  ], t.prototype, "required", 2);
137
- i([
138
- r({ type: String })
138
+ a([
139
+ s({ type: String })
139
140
  ], t.prototype, "value", 2);
140
- i([
141
- r({ type: String })
141
+ a([
142
+ s({ type: String })
142
143
  ], t.prototype, "name", 2);
143
- i([
144
- r({ type: String })
144
+ a([
145
+ s({ type: String })
145
146
  ], t.prototype, "label", 2);
146
- i([
147
- r({ type: Boolean, attribute: "touch-target" })
147
+ a([
148
+ s({ type: Boolean, attribute: "touch-target" })
148
149
  ], t.prototype, "touchTarget", 2);
149
- t = i([
150
- p("pd-checkbox")
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")&&this.anchor){const s=this.getRootNode();s&&(this.anchorElement=s.getElementById(this.anchor)??void 0)}}render(){return a.html`
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
- ?open=${this.open}
5
- positioning=${this.positioning}
6
- anchor-corner=${this.anchorCorner}
7
- menu-corner=${this.menuCorner}
8
- ?quick=${this.quick}
9
- ?has-overflow=${this.hasOverflow}
10
- x-offset=${this.xOffset}
11
- y-offset=${this.yOffset}
12
- default-focus=${this.defaultFocus}
13
- ?stay-open-on-focusout=${this.stayOpenOnFocusout}
14
- ?stay-open-on-outside-click=${this.stayOpenOnOutsideClick}
15
- ?skip-restore-focus=${this.skipRestoreFocus}
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, r, p, i) => {
6
- for (var s = i > 1 ? void 0 : i ? d(r, p) : r, a = n.length - 1, u; a >= 0; a--)
7
- (u = n[a]) && (s = (i ? u(r, p, s) : u(s)) || s);
8
- return i && s && m(r, p, s), s;
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") && this.anchor) {
22
- const r = this.getRootNode();
23
- r && (this.anchorElement = r.getElementById(this.anchor) ?? void 0);
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
- ?open=${this.open}
31
- positioning=${this.positioning}
32
- anchor-corner=${this.anchorCorner}
33
- menu-corner=${this.menuCorner}
34
- ?quick=${this.quick}
35
- ?has-overflow=${this.hasOverflow}
36
- x-offset=${this.xOffset}
37
- y-offset=${this.yOffset}
38
- default-focus=${this.defaultFocus}
39
- ?stay-open-on-focusout=${this.stayOpenOnFocusout}
40
- ?stay-open-on-outside-click=${this.stayOpenOnOutsideClick}
41
- ?skip-restore-focus=${this.skipRestoreFocus}
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"),i=require("lit/decorators.js");require("@material/web/icon/icon.js");var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,r=(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},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("stepchange",{detail:{activeStep: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("stepcomplete",{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`
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
- `;r([i.property({type:Number,attribute:"active-step"})],exports.PdSegmentedStepper.prototype,"activeStep",2);r([i.property({type:Array,attribute:"completed-steps"})],exports.PdSegmentedStepper.prototype,"completedSteps",2);r([i.property({type:String,reflect:!0})],exports.PdSegmentedStepper.prototype,"size",2);r([i.property({type:Boolean,reflect:!0})],exports.PdSegmentedStepper.prototype,"disabled",2);r([i.property({type:Boolean,attribute:"allow-step-navigation"})],exports.PdSegmentedStepper.prototype,"allowStepNavigation",2);r([i.property({type:Boolean})],exports.PdSegmentedStepper.prototype,"linear",2);r([i.state()],exports.PdSegmentedStepper.prototype,"_steps",2);r([i.state()],exports.PdSegmentedStepper.prototype,"_completedStepsSet",2);exports.PdSegmentedStepper=r([i.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`
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
- `;r([i.property({type:Number,attribute:"step-number"})],exports.PdStepperItem.prototype,"stepNumber",2);r([i.property({type:String,reflect:!0})],exports.PdStepperItem.prototype,"state",2);r([i.property({type:Boolean,reflect:!0})],exports.PdStepperItem.prototype,"disabled",2);r([i.property({type:Boolean})],exports.PdStepperItem.prototype,"clickable",2);r([i.property({type:String})],exports.PdStepperItem.prototype,"icon",2);exports.PdStepperItem=r([i.customElement("pd-stepper-item")],exports.PdStepperItem);
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 v = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (e, t, s, c) => {
5
- for (var r = c > 1 ? void 0 : c ? S(t, s) : t, n = e.length - 1, d; n >= 0; n--)
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 && v(t, s, r), 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("stepcomplete", {
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"),a=require("lit/decorators.js"),n=require("lit/directives/class-map.js");var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,p=(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`
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&&(this.completeStep(this.currentStep),this.currentStep++,this._dispatchStepChange())}back(){this.currentStep>0&&(this.currentStep--,this._dispatchStepChange())}_dispatchStepChange(){this.dispatchEvent(new CustomEvent("step-change",{detail:{currentStep:this.currentStep},bubbles:!0,composed:!0}))}};exports.PdStepper.styles=o.css`
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
- `;p([a.property({type:Array})],exports.PdStepper.prototype,"steps",2);p([a.property({type:Number})],exports.PdStepper.prototype,"currentStep",2);p([a.property({type:String})],exports.PdStepper.prototype,"orientation",2);p([a.property({type:Boolean})],exports.PdStepper.prototype,"linear",2);p([a.property({type:Boolean})],exports.PdStepper.prototype,"showContent",2);p([a.property({type:Boolean})],exports.PdStepper.prototype,"alternativeLabel",2);p([a.state()],exports.PdStepper.prototype,"_completedSteps",2);exports.PdStepper=p([a.customElement("pd-stepper")],exports.PdStepper);
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: { currentStep: e, previousStep: s },
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 && (this.completeStep(this.currentStep), this.currentStep++, this._dispatchStepChange());
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 && (this.currentStep--, this._dispatchStepChange());
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: { currentStep: this.currentStep },
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"),i=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 d=Object.defineProperty,b=Object.getOwnPropertyDescriptor,o=(l,t,a,e)=>{for(var s=e>1?void 0:e?b(t,a):t,n=l.length-1,c;n>=0;n--)(c=l[n])&&(s=(e?c(t,a,s):c(s))||s);return e&&s&&d(t,a,s),s};exports.PdTabs=class extends r.LitElement{constructor(){super(...arguments),this.activeTabIndex=0,this.autoActivate=!1,this.tabs=[],this.slottedTabs=[]}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.collectTabsFromSlot(),0)}firstUpdated(){this.collectTabsFromSlot(),this.updateComplete.then(()=>this.forceActiveTabUpdate())}collectTabsFromSlot(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const a=t.assignedElements({flatten:!0}),e=[];a.forEach(s=>{if(s.tagName==="PD-TAB"){const n=s;e.push({label:n.textContent?.trim()||"",icon:n.getAttribute("icon")||void 0,secondary:n.hasAttribute("secondary"),inlineIcon:n.hasAttribute("inline-icon"),ariaLabel:n.getAttribute("aria-label")||void 0})}}),this.slottedTabs=e,this.requestUpdate()}handleSlotChange(){this.collectTabsFromSlot(),this.updateComplete.then(()=>this.forceActiveTabUpdate())}forceActiveTabUpdate(){const t=this.shadowRoot?.querySelector("md-tabs");t&&this.activeTabIndex!==void 0&&(t.activeTabIndex=this.activeTabIndex)}renderTab(t,a){const e=t.icon?r.html`<md-icon slot="icon">${t.icon}</md-icon>`:"";return t.secondary?r.html`
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((a,e)=>this.renderTab(a,e))}
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 a=t.target;this.activeTabIndex=a.activeTabIndex,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{activeTabIndex:this.activeTabIndex}}))}};o([i.property({type:Number,attribute:"active-tab-index"})],exports.PdTabs.prototype,"activeTabIndex",2);o([i.property({type:Boolean,attribute:"auto-activate"})],exports.PdTabs.prototype,"autoActivate",2);o([i.property({type:Array})],exports.PdTabs.prototype,"tabs",2);o([i.state()],exports.PdTabs.prototype,"slottedTabs",2);exports.PdTabs=o([i.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`
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
- `;o([i.property({type:Boolean})],exports.PdTab.prototype,"secondary",2);o([i.property({type:Boolean,attribute:"inline-icon"})],exports.PdTab.prototype,"inlineIcon",2);o([i.property({type:String})],exports.PdTab.prototype,"icon",2);o([i.property({type:String,attribute:"aria-label"})],exports.PdTab.prototype,"ariaLabel",2);exports.PdTab=o([i.customElement("pd-tab")],exports.PdTab);
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);