@prioticket/design-system-web 1.4.2 → 1.4.3

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.
@@ -1,6 +1,6 @@
1
1
  # @prioticket/design-system-web Components
2
2
 
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
 
5
5
  ### <pd-box> (PdBox)
6
6
 
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "package": {
3
3
  "name": "@prioticket/design-system-web",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "description": "",
6
6
  "installation": "npm install @prioticket/design-system-web"
7
7
  },
8
- "generatedAt": "2025-12-16T15:18:20.065Z",
8
+ "generatedAt": "2025-12-16T16:14:48.676Z",
9
9
  "components": {
10
10
  "pd-box": {
11
11
  "tagName": "pd-box",
@@ -4788,6 +4788,29 @@
4788
4788
  "name": "renderMultiSelect",
4789
4789
  "privacy": "private"
4790
4790
  },
4791
+ {
4792
+ "kind": "method",
4793
+ "name": "handleSingleSelectChange",
4794
+ "privacy": "private",
4795
+ "parameters": [
4796
+ {
4797
+ "name": "e",
4798
+ "type": {
4799
+ "text": "Event"
4800
+ }
4801
+ }
4802
+ ]
4803
+ },
4804
+ {
4805
+ "kind": "method",
4806
+ "name": "handleSingleSelectOpen",
4807
+ "privacy": "private"
4808
+ },
4809
+ {
4810
+ "kind": "method",
4811
+ "name": "handleSingleSelectClose",
4812
+ "privacy": "private"
4813
+ },
4791
4814
  {
4792
4815
  "kind": "method",
4793
4816
  "name": "renderSingleSelect",
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lit"),r=require("lit/decorators.js");require("@material/web/select/filled-select.js");require("@material/web/select/outlined-select.js");require("@material/web/select/select-option.js");require("@material/web/icon/icon.js");require("@material/web/checkbox/checkbox.js");require("./pd-chip.cjs.js");var c=Object.defineProperty,p=Object.getOwnPropertyDescriptor,s=(l,e,t,i)=>{for(var a=i>1?void 0:i?p(e,t):e,n=l.length-1,d;n>=0;n--)(d=l[n])&&(a=(i?d(e,t,a):d(a))||a);return i&&a&&c(e,t,a),a};exports.PdSelect=class extends o.LitElement{constructor(){super(...arguments),this.variant="outlined",this.label="",this.value="",this.disabled=!1,this.required=!1,this.errorText="",this.error=!1,this.supportingText="",this.options=[],this.leadingIcon="",this.multiple=!1,this.showChips=!0,this.chipVariant="input",this.placeholder="",this.searchable=!1,this.isOpen=!1,this.searchQuery="",this.selectedValues=[],this.overlayEl=null,this.updateOverlayPosition=()=>{if(!this.overlayEl||!this.trigger)return;const e=this.trigger.getBoundingClientRect();this.overlayEl.style.left=`${e.left}px`,this.overlayEl.style.top=`${e.bottom+4}px`,this.overlayEl.style.width=`${e.width}px`},this.handleTriggerClick=e=>{this.disabled||(e.stopPropagation(),this.searchQuery="",this.isOpen=!this.isOpen)},this.handleClickOutside=e=>{if(!this.isOpen)return;const t=e.composedPath();t.includes(this)||this.overlayEl&&t.includes(this.overlayEl)||(this.isOpen=!1)},this.handleKeyDown=e=>{e.key==="Escape"&&(this.isOpen=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleClickOutside),document.addEventListener("keydown",this.handleKeyDown),window.addEventListener("scroll",this.updateOverlayPosition,!0),window.addEventListener("resize",this.updateOverlayPosition)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleClickOutside),document.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("scroll",this.updateOverlayPosition,!0),window.removeEventListener("resize",this.updateOverlayPosition),this.closeOverlay()}willUpdate(e){e.has("value")&&this.multiple&&(this.selectedValues=Array.isArray(this.value)?[...this.value]:this.value?[this.value]:[]),e.has("isOpen")&&(this.isOpen?this.openOverlay():this.closeOverlay()),this.overlayEl&&(e.has("searchQuery")||e.has("selectedValues"))&&(o.render(this.renderDropdown(),this.overlayEl),e.has("selectedValues")&&this.updateComplete.then(()=>{requestAnimationFrame(()=>this.updateOverlayPosition())}))}getOptionLabel(e){return this.options.find(t=>t.value===e)?.label??e}get filteredOptions(){const e=this.searchQuery.trim().toLowerCase();return e?this.options.filter(t=>t.label.toLowerCase().includes(e)):this.options}openOverlay(){if(this.overlayEl||!this.trigger)return;const e=this.trigger.getBoundingClientRect(),t=document.createElement("div");t.style.position="fixed",t.style.left=`${e.left}px`,t.style.top=`${e.bottom+4}px`,t.style.width=`${e.width}px`,t.style.zIndex="10000";const i=document.createElement("style");i.textContent=exports.PdSelect.overlayStyles,t.appendChild(i),document.body.appendChild(t),this.overlayEl=t,o.render(this.renderDropdown(),t)}closeOverlay(){this.overlayEl&&(o.render(o.nothing,this.overlayEl),this.overlayEl.remove(),this.overlayEl=null)}handleOptionClick(e,t){if(t.stopPropagation(),this.selectedValues.includes(e))this.selectedValues=this.selectedValues.filter(i=>i!==e);else{if(this.maxSelections&&this.selectedValues.length>=this.maxSelections)return;this.selectedValues=[...this.selectedValues,e]}this.value=[...this.selectedValues],this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value}}))}handleChipRemove(e,t){t.stopPropagation(),this.selectedValues=this.selectedValues.filter(i=>i!==e),this.value=[...this.selectedValues]}renderDropdown(){return o.html`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lit"),s=require("lit/decorators.js");require("@material/web/select/filled-select.js");require("@material/web/select/outlined-select.js");require("@material/web/select/select-option.js");require("@material/web/icon/icon.js");require("@material/web/checkbox/checkbox.js");require("./pd-chip.cjs.js");var c=Object.defineProperty,p=Object.getOwnPropertyDescriptor,o=(a,e,t,i)=>{for(var l=i>1?void 0:i?p(e,t):e,n=a.length-1,d;n>=0;n--)(d=a[n])&&(l=(i?d(e,t,l):d(l))||l);return i&&l&&c(e,t,l),l};exports.PdSelect=class extends r.LitElement{constructor(){super(...arguments),this.variant="outlined",this.label="",this.value="",this.disabled=!1,this.required=!1,this.errorText="",this.error=!1,this.supportingText="",this.options=[],this.leadingIcon="",this.multiple=!1,this.showChips=!0,this.chipVariant="input",this.placeholder="",this.searchable=!1,this.isOpen=!1,this.searchQuery="",this.selectedValues=[],this.overlayEl=null,this.updateOverlayPosition=()=>{if(!this.overlayEl||!this.trigger)return;const e=this.trigger.getBoundingClientRect();this.overlayEl.style.left=`${e.left}px`,this.overlayEl.style.top=`${e.bottom+4}px`,this.overlayEl.style.width=`${e.width}px`},this.handleTriggerClick=e=>{this.disabled||(e.stopPropagation(),this.searchQuery="",this.isOpen=!this.isOpen)},this.handleClickOutside=e=>{if(!this.isOpen)return;const t=e.composedPath();t.includes(this)||this.overlayEl&&t.includes(this.overlayEl)||(this.isOpen=!1)},this.handleKeyDown=e=>{e.key==="Escape"&&(this.isOpen=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleClickOutside),document.addEventListener("keydown",this.handleKeyDown),window.addEventListener("scroll",this.updateOverlayPosition,!0),window.addEventListener("resize",this.updateOverlayPosition)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleClickOutside),document.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("scroll",this.updateOverlayPosition,!0),window.removeEventListener("resize",this.updateOverlayPosition),this.closeOverlay()}willUpdate(e){e.has("value")&&this.multiple&&(this.selectedValues=Array.isArray(this.value)?[...this.value]:this.value?[this.value]:[]),e.has("isOpen")&&(this.isOpen?this.openOverlay():this.closeOverlay()),this.overlayEl&&(e.has("searchQuery")||e.has("selectedValues"))&&(r.render(this.renderDropdown(),this.overlayEl),e.has("selectedValues")&&this.updateComplete.then(()=>{requestAnimationFrame(()=>this.updateOverlayPosition())}))}getOptionLabel(e){return this.options.find(t=>t.value===e)?.label??e}get filteredOptions(){const e=this.searchQuery.trim().toLowerCase();return e?this.options.filter(t=>t.label.toLowerCase().includes(e)):this.options}openOverlay(){if(this.overlayEl||!this.trigger)return;const e=this.trigger.getBoundingClientRect(),t=document.createElement("div");t.style.position="fixed",t.style.left=`${e.left}px`,t.style.top=`${e.bottom+4}px`,t.style.width=`${e.width}px`,t.style.zIndex="10000";const i=document.createElement("style");i.textContent=exports.PdSelect.overlayStyles,t.appendChild(i),document.body.appendChild(t),this.overlayEl=t,r.render(this.renderDropdown(),t)}closeOverlay(){this.overlayEl&&(r.render(r.nothing,this.overlayEl),this.overlayEl.remove(),this.overlayEl=null)}handleOptionClick(e,t){if(t.stopPropagation(),this.selectedValues.includes(e))this.selectedValues=this.selectedValues.filter(i=>i!==e);else{if(this.maxSelections&&this.selectedValues.length>=this.maxSelections)return;this.selectedValues=[...this.selectedValues,e]}this.value=[...this.selectedValues],this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value}}))}handleChipRemove(e,t){t.stopPropagation(),this.selectedValues=this.selectedValues.filter(i=>i!==e),this.value=[...this.selectedValues]}renderDropdown(){return r.html`
2
2
  <div class="dropdown" role="listbox" aria-multiselectable="true">
3
- ${this.searchable?o.html`
3
+ ${this.searchable?r.html`
4
4
  <div class="search">
5
5
  <md-icon class="pd-icon">search</md-icon>
6
6
  <input
@@ -9,15 +9,15 @@
9
9
  @input=${e=>this.searchQuery=e.target.value}
10
10
  />
11
11
  </div>
12
- `:o.nothing}
12
+ `:r.nothing}
13
13
 
14
14
  <div class="options">
15
- ${this.filteredOptions.map(e=>{const t=this.selectedValues.includes(e.value),i=e.disabled??!1;return o.html`
15
+ ${this.filteredOptions.map(e=>{const t=this.selectedValues.includes(e.value),i=e.disabled??!1;return r.html`
16
16
  <div
17
17
  class="option"
18
18
  data-selected=${t}
19
19
  data-disabled=${i}
20
- @click=${a=>!i&&this.handleOptionClick(e.value,a)}
20
+ @click=${l=>!i&&this.handleOptionClick(e.value,l)}
21
21
  >
22
22
  <md-checkbox ?checked=${t} ?disabled=${i}></md-checkbox>
23
23
  <span>${e.label}</span>
@@ -25,14 +25,14 @@
25
25
  `})}
26
26
  </div>
27
27
  </div>
28
- `}renderMultiSelect(){const e=this.selectedValues.length>0,t=e||this.isOpen;return o.html`
28
+ `}renderMultiSelect(){const e=this.selectedValues.length>0,t=e||this.isOpen;return r.html`
29
29
  <div class="container">
30
30
  <div class="wrap">
31
- ${this.label?o.html`
31
+ ${this.label?r.html`
32
32
  <label class="label" data-float=${t}>
33
- ${this.label}${this.required?o.html`<span class="required">*</span>`:o.nothing}
33
+ ${this.label}${this.required?r.html`<span class="required">*</span>`:r.nothing}
34
34
  </label>
35
- `:o.nothing}
35
+ `:r.nothing}
36
36
 
37
37
  <div
38
38
  class="field"
@@ -41,19 +41,19 @@
41
41
  role="combobox"
42
42
  @click=${this.handleTriggerClick}
43
43
  >
44
- ${this.leadingIcon?o.html`<md-icon class="pd-icon pd-icon--leading">${this.leadingIcon}</md-icon>`:o.nothing}
44
+ ${this.leadingIcon?r.html`<md-icon class="pd-icon pd-icon--leading">${this.leadingIcon}</md-icon>`:r.nothing}
45
45
 
46
46
  <div class="content">
47
- ${e?o.html`
47
+ ${e?r.html`
48
48
  <div class="chips">
49
- ${this.selectedValues.map(i=>o.html`
49
+ ${this.selectedValues.map(i=>r.html`
50
50
  <pd-chip
51
51
  label=${this.getOptionLabel(i)}
52
- @chip-remove=${a=>this.handleChipRemove(i,a)}
52
+ @chip-remove=${l=>this.handleChipRemove(i,l)}
53
53
  ></pd-chip>
54
54
  `)}
55
55
  </div>
56
- `:o.html`<span class="placeholder">${this.placeholder}</span>`}
56
+ `:r.html`<span class="placeholder">${this.placeholder}</span>`}
57
57
  </div>
58
58
 
59
59
  <md-icon class="pd-icon pd-icon--trailing" data-rotated=${this.isOpen}>
@@ -62,17 +62,43 @@
62
62
  </div>
63
63
  </div>
64
64
 
65
- ${this.supportingText?o.html`<div class="supporting">${this.supportingText}</div>`:o.nothing}
65
+ ${this.supportingText?r.html`<div class="supporting">${this.supportingText}</div>`:r.nothing}
66
66
  </div>
67
- `}renderSingleSelect(){const e=o.html`
68
- ${this.leadingIcon?o.html`<md-icon slot="leading-icon" class="pd-icon">${this.leadingIcon}</md-icon>`:o.nothing}
67
+ `}handleSingleSelectChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value}}))}handleSingleSelectOpen(){this.trailingIcon?.classList.add("rotated")}handleSingleSelectClose(){this.trailingIcon?.classList.remove("rotated")}renderSingleSelect(){const e=r.html`
68
+ ${this.leadingIcon?r.html`<md-icon slot="leading-icon" class="pd-icon">${this.leadingIcon}</md-icon>`:r.nothing}
69
69
  <md-icon slot="trailing-icon" class="pd-icon">keyboard_arrow_down</md-icon>
70
- ${this.options.map(t=>o.html`
70
+ ${this.options.map(t=>r.html`
71
71
  <md-select-option .value=${t.value} ?disabled=${t.disabled}>
72
72
  <div slot="headline">${t.label}</div>
73
73
  </md-select-option>
74
74
  `)}
75
- `;return this.variant==="filled"?o.html`<md-filled-select .label=${this.label}>${e}</md-filled-select>`:o.html`<md-outlined-select .label=${this.label}>${e}</md-outlined-select>`}render(){return this.multiple?this.renderMultiSelect():this.renderSingleSelect()}};exports.PdSelect.overlayStyles=`
75
+ `;return this.variant==="filled"?r.html`
76
+ <md-filled-select
77
+ .label=${this.label}
78
+ .value=${this.value}
79
+ ?disabled=${this.disabled}
80
+ ?required=${this.required}
81
+ ?error=${this.error}
82
+ .errorText=${this.errorText}
83
+ .supportingText=${this.supportingText}
84
+ @change=${this.handleSingleSelectChange}
85
+ @opening=${this.handleSingleSelectOpen}
86
+ @closed=${this.handleSingleSelectClose}
87
+ >${e}</md-filled-select>
88
+ `:r.html`
89
+ <md-outlined-select
90
+ .label=${this.label}
91
+ .value=${this.value}
92
+ ?disabled=${this.disabled}
93
+ ?required=${this.required}
94
+ ?error=${this.error}
95
+ .errorText=${this.errorText}
96
+ .supportingText=${this.supportingText}
97
+ @change=${this.handleSingleSelectChange}
98
+ @opening=${this.handleSingleSelectOpen}
99
+ @closed=${this.handleSingleSelectClose}
100
+ >${e}</md-outlined-select>
101
+ `}render(){return this.multiple?this.renderMultiSelect():this.renderSingleSelect()}};exports.PdSelect.overlayStyles=`
76
102
  .dropdown {
77
103
  background: var(--md-sys-color-surface-container, #f3edf7);
78
104
  border-radius: var(--md-sys-shape-corner-medium, 12px);
@@ -147,7 +173,7 @@
147
173
  font-size: 24px;
148
174
  color: var(--md-sys-color-on-surface-variant, #49454f);
149
175
  }
150
- `;exports.PdSelect.styles=o.css`
176
+ `;exports.PdSelect.styles=r.css`
151
177
  :host {
152
178
  display: inline-block;
153
179
  width: 100%;
@@ -397,4 +423,4 @@
397
423
  color: var(--md-sys-color-error);
398
424
  margin-left: 2px;
399
425
  }
400
- `;s([r.query("md-filled-select, md-outlined-select")],exports.PdSelect.prototype,"select",2);s([r.query('[slot="trailing-icon"]')],exports.PdSelect.prototype,"trailingIcon",2);s([r.query(".field")],exports.PdSelect.prototype,"trigger",2);s([r.property({type:String,reflect:!0})],exports.PdSelect.prototype,"variant",2);s([r.property({type:String})],exports.PdSelect.prototype,"label",2);s([r.property({type:String,reflect:!0})],exports.PdSelect.prototype,"value",2);s([r.property({type:Boolean,reflect:!0})],exports.PdSelect.prototype,"disabled",2);s([r.property({type:Boolean})],exports.PdSelect.prototype,"required",2);s([r.property({type:String,attribute:"error-text"})],exports.PdSelect.prototype,"errorText",2);s([r.property({type:Boolean,reflect:!0})],exports.PdSelect.prototype,"error",2);s([r.property({type:String,attribute:"supporting-text"})],exports.PdSelect.prototype,"supportingText",2);s([r.property({type:Array})],exports.PdSelect.prototype,"options",2);s([r.property({type:String,attribute:"leading-icon"})],exports.PdSelect.prototype,"leadingIcon",2);s([r.property({type:Boolean})],exports.PdSelect.prototype,"multiple",2);s([r.property({type:Number,attribute:"max-selections"})],exports.PdSelect.prototype,"maxSelections",2);s([r.property({type:Boolean,attribute:"show-chips"})],exports.PdSelect.prototype,"showChips",2);s([r.property({type:String,attribute:"chip-variant"})],exports.PdSelect.prototype,"chipVariant",2);s([r.property({type:String})],exports.PdSelect.prototype,"placeholder",2);s([r.property({type:Boolean})],exports.PdSelect.prototype,"searchable",2);s([r.state()],exports.PdSelect.prototype,"isOpen",2);s([r.state()],exports.PdSelect.prototype,"searchQuery",2);s([r.state()],exports.PdSelect.prototype,"selectedValues",2);exports.PdSelect=s([r.customElement("pd-select")],exports.PdSelect);
426
+ `;o([s.query("md-filled-select, md-outlined-select")],exports.PdSelect.prototype,"select",2);o([s.query('[slot="trailing-icon"]')],exports.PdSelect.prototype,"trailingIcon",2);o([s.query(".field")],exports.PdSelect.prototype,"trigger",2);o([s.property({type:String,reflect:!0})],exports.PdSelect.prototype,"variant",2);o([s.property({type:String})],exports.PdSelect.prototype,"label",2);o([s.property({type:String,reflect:!0})],exports.PdSelect.prototype,"value",2);o([s.property({type:Boolean,reflect:!0})],exports.PdSelect.prototype,"disabled",2);o([s.property({type:Boolean})],exports.PdSelect.prototype,"required",2);o([s.property({type:String,attribute:"error-text"})],exports.PdSelect.prototype,"errorText",2);o([s.property({type:Boolean,reflect:!0})],exports.PdSelect.prototype,"error",2);o([s.property({type:String,attribute:"supporting-text"})],exports.PdSelect.prototype,"supportingText",2);o([s.property({type:Array})],exports.PdSelect.prototype,"options",2);o([s.property({type:String,attribute:"leading-icon"})],exports.PdSelect.prototype,"leadingIcon",2);o([s.property({type:Boolean})],exports.PdSelect.prototype,"multiple",2);o([s.property({type:Number,attribute:"max-selections"})],exports.PdSelect.prototype,"maxSelections",2);o([s.property({type:Boolean,attribute:"show-chips"})],exports.PdSelect.prototype,"showChips",2);o([s.property({type:String,attribute:"chip-variant"})],exports.PdSelect.prototype,"chipVariant",2);o([s.property({type:String})],exports.PdSelect.prototype,"placeholder",2);o([s.property({type:Boolean})],exports.PdSelect.prototype,"searchable",2);o([s.state()],exports.PdSelect.prototype,"isOpen",2);o([s.state()],exports.PdSelect.prototype,"searchQuery",2);o([s.state()],exports.PdSelect.prototype,"selectedValues",2);exports.PdSelect=o([s.customElement("pd-select")],exports.PdSelect);
@@ -1,17 +1,17 @@
1
1
  import { css as y, LitElement as v, render as h, nothing as d, html as i } from "lit";
2
- import { query as m, property as a, state as u, customElement as f } from "lit/decorators.js";
2
+ import { query as u, property as a, state as m, customElement as f } from "lit/decorators.js";
3
3
  import "@material/web/select/filled-select.js";
4
4
  import "@material/web/select/outlined-select.js";
5
5
  import "@material/web/select/select-option.js";
6
6
  import "@material/web/icon/icon.js";
7
7
  import "@material/web/checkbox/checkbox.js";
8
8
  import "./pd-chip.es.js";
9
- var g = Object.defineProperty, b = Object.getOwnPropertyDescriptor, s = (e, t, r, l) => {
9
+ var g = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (e, t, r, l) => {
10
10
  for (var n = l > 1 ? void 0 : l ? b(t, r) : t, c = e.length - 1, p; c >= 0; c--)
11
11
  (p = e[c]) && (n = (l ? p(t, r, n) : p(n)) || n);
12
12
  return l && n && g(t, r, n), n;
13
13
  };
14
- let o = class extends v {
14
+ let s = class extends v {
15
15
  constructor() {
16
16
  super(...arguments), this.variant = "outlined", this.label = "", this.value = "", this.disabled = !1, this.required = !1, this.errorText = "", this.error = !1, this.supportingText = "", this.options = [], this.leadingIcon = "", this.multiple = !1, this.showChips = !0, this.chipVariant = "input", this.placeholder = "", this.searchable = !1, this.isOpen = !1, this.searchQuery = "", this.selectedValues = [], this.overlayEl = null, this.updateOverlayPosition = () => {
17
17
  if (!this.overlayEl || !this.trigger) return;
@@ -50,7 +50,7 @@ let o = class extends v {
50
50
  const e = this.trigger.getBoundingClientRect(), t = document.createElement("div");
51
51
  t.style.position = "fixed", t.style.left = `${e.left}px`, t.style.top = `${e.bottom + 4}px`, t.style.width = `${e.width}px`, t.style.zIndex = "10000";
52
52
  const r = document.createElement("style");
53
- r.textContent = o.overlayStyles, t.appendChild(r), document.body.appendChild(t), this.overlayEl = t, h(this.renderDropdown(), t);
53
+ r.textContent = s.overlayStyles, t.appendChild(r), document.body.appendChild(t), this.overlayEl = t, h(this.renderDropdown(), t);
54
54
  }
55
55
  closeOverlay() {
56
56
  this.overlayEl && (h(d, this.overlayEl), this.overlayEl.remove(), this.overlayEl = null);
@@ -148,6 +148,20 @@ let o = class extends v {
148
148
  </div>
149
149
  `;
150
150
  }
151
+ handleSingleSelectChange(e) {
152
+ const t = e.target;
153
+ this.value = t.value, this.dispatchEvent(new CustomEvent("change", {
154
+ bubbles: !0,
155
+ composed: !0,
156
+ detail: { value: this.value }
157
+ }));
158
+ }
159
+ handleSingleSelectOpen() {
160
+ this.trailingIcon?.classList.add("rotated");
161
+ }
162
+ handleSingleSelectClose() {
163
+ this.trailingIcon?.classList.remove("rotated");
164
+ }
151
165
  renderSingleSelect() {
152
166
  const e = i`
153
167
  ${this.leadingIcon ? i`<md-icon slot="leading-icon" class="pd-icon">${this.leadingIcon}</md-icon>` : d}
@@ -158,13 +172,39 @@ let o = class extends v {
158
172
  </md-select-option>
159
173
  `)}
160
174
  `;
161
- return this.variant === "filled" ? i`<md-filled-select .label=${this.label}>${e}</md-filled-select>` : i`<md-outlined-select .label=${this.label}>${e}</md-outlined-select>`;
175
+ return this.variant === "filled" ? i`
176
+ <md-filled-select
177
+ .label=${this.label}
178
+ .value=${this.value}
179
+ ?disabled=${this.disabled}
180
+ ?required=${this.required}
181
+ ?error=${this.error}
182
+ .errorText=${this.errorText}
183
+ .supportingText=${this.supportingText}
184
+ @change=${this.handleSingleSelectChange}
185
+ @opening=${this.handleSingleSelectOpen}
186
+ @closed=${this.handleSingleSelectClose}
187
+ >${e}</md-filled-select>
188
+ ` : i`
189
+ <md-outlined-select
190
+ .label=${this.label}
191
+ .value=${this.value}
192
+ ?disabled=${this.disabled}
193
+ ?required=${this.required}
194
+ ?error=${this.error}
195
+ .errorText=${this.errorText}
196
+ .supportingText=${this.supportingText}
197
+ @change=${this.handleSingleSelectChange}
198
+ @opening=${this.handleSingleSelectOpen}
199
+ @closed=${this.handleSingleSelectClose}
200
+ >${e}</md-outlined-select>
201
+ `;
162
202
  }
163
203
  render() {
164
204
  return this.multiple ? this.renderMultiSelect() : this.renderSingleSelect();
165
205
  }
166
206
  };
167
- o.overlayStyles = `
207
+ s.overlayStyles = `
168
208
  .dropdown {
169
209
  background: var(--md-sys-color-surface-container, #f3edf7);
170
210
  border-radius: var(--md-sys-shape-corner-medium, 12px);
@@ -240,7 +280,7 @@ o.overlayStyles = `
240
280
  color: var(--md-sys-color-on-surface-variant, #49454f);
241
281
  }
242
282
  `;
243
- o.styles = y`
283
+ s.styles = y`
244
284
  :host {
245
285
  display: inline-block;
246
286
  width: 100%;
@@ -491,75 +531,75 @@ o.styles = y`
491
531
  margin-left: 2px;
492
532
  }
493
533
  `;
494
- s([
495
- m("md-filled-select, md-outlined-select")
496
- ], o.prototype, "select", 2);
497
- s([
498
- m('[slot="trailing-icon"]')
499
- ], o.prototype, "trailingIcon", 2);
500
- s([
501
- m(".field")
502
- ], o.prototype, "trigger", 2);
503
- s([
534
+ o([
535
+ u("md-filled-select, md-outlined-select")
536
+ ], s.prototype, "select", 2);
537
+ o([
538
+ u('[slot="trailing-icon"]')
539
+ ], s.prototype, "trailingIcon", 2);
540
+ o([
541
+ u(".field")
542
+ ], s.prototype, "trigger", 2);
543
+ o([
504
544
  a({ type: String, reflect: !0 })
505
- ], o.prototype, "variant", 2);
506
- s([
545
+ ], s.prototype, "variant", 2);
546
+ o([
507
547
  a({ type: String })
508
- ], o.prototype, "label", 2);
509
- s([
548
+ ], s.prototype, "label", 2);
549
+ o([
510
550
  a({ type: String, reflect: !0 })
511
- ], o.prototype, "value", 2);
512
- s([
551
+ ], s.prototype, "value", 2);
552
+ o([
513
553
  a({ type: Boolean, reflect: !0 })
514
- ], o.prototype, "disabled", 2);
515
- s([
554
+ ], s.prototype, "disabled", 2);
555
+ o([
516
556
  a({ type: Boolean })
517
- ], o.prototype, "required", 2);
518
- s([
557
+ ], s.prototype, "required", 2);
558
+ o([
519
559
  a({ type: String, attribute: "error-text" })
520
- ], o.prototype, "errorText", 2);
521
- s([
560
+ ], s.prototype, "errorText", 2);
561
+ o([
522
562
  a({ type: Boolean, reflect: !0 })
523
- ], o.prototype, "error", 2);
524
- s([
563
+ ], s.prototype, "error", 2);
564
+ o([
525
565
  a({ type: String, attribute: "supporting-text" })
526
- ], o.prototype, "supportingText", 2);
527
- s([
566
+ ], s.prototype, "supportingText", 2);
567
+ o([
528
568
  a({ type: Array })
529
- ], o.prototype, "options", 2);
530
- s([
569
+ ], s.prototype, "options", 2);
570
+ o([
531
571
  a({ type: String, attribute: "leading-icon" })
532
- ], o.prototype, "leadingIcon", 2);
533
- s([
572
+ ], s.prototype, "leadingIcon", 2);
573
+ o([
534
574
  a({ type: Boolean })
535
- ], o.prototype, "multiple", 2);
536
- s([
575
+ ], s.prototype, "multiple", 2);
576
+ o([
537
577
  a({ type: Number, attribute: "max-selections" })
538
- ], o.prototype, "maxSelections", 2);
539
- s([
578
+ ], s.prototype, "maxSelections", 2);
579
+ o([
540
580
  a({ type: Boolean, attribute: "show-chips" })
541
- ], o.prototype, "showChips", 2);
542
- s([
581
+ ], s.prototype, "showChips", 2);
582
+ o([
543
583
  a({ type: String, attribute: "chip-variant" })
544
- ], o.prototype, "chipVariant", 2);
545
- s([
584
+ ], s.prototype, "chipVariant", 2);
585
+ o([
546
586
  a({ type: String })
547
- ], o.prototype, "placeholder", 2);
548
- s([
587
+ ], s.prototype, "placeholder", 2);
588
+ o([
549
589
  a({ type: Boolean })
550
- ], o.prototype, "searchable", 2);
551
- s([
552
- u()
553
- ], o.prototype, "isOpen", 2);
554
- s([
555
- u()
556
- ], o.prototype, "searchQuery", 2);
557
- s([
558
- u()
559
- ], o.prototype, "selectedValues", 2);
560
- o = s([
590
+ ], s.prototype, "searchable", 2);
591
+ o([
592
+ m()
593
+ ], s.prototype, "isOpen", 2);
594
+ o([
595
+ m()
596
+ ], s.prototype, "searchQuery", 2);
597
+ o([
598
+ m()
599
+ ], s.prototype, "selectedValues", 2);
600
+ s = o([
561
601
  f("pd-select")
562
- ], o);
602
+ ], s);
563
603
  export {
564
- o as PdSelect
604
+ s as PdSelect
565
605
  };
@@ -51,6 +51,9 @@ export declare class PdSelect extends LitElement {
51
51
  private handleChipRemove;
52
52
  private renderDropdown;
53
53
  private renderMultiSelect;
54
+ private handleSingleSelectChange;
55
+ private handleSingleSelectOpen;
56
+ private handleSingleSelectClose;
54
57
  private renderSingleSelect;
55
58
  render(): TemplateResult<1>;
56
59
  static styles: import("lit").CSSResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prioticket/design-system-web",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "type": "module",
5
5
  "packageManager": "yarn@3.6.4",
6
6
  "main": "./dist/prioticket-design-system-web.cjs.js",