@nylas/react 1.3.6 → 1.4.1
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/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
- package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
- package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
- package/dist/archive-icon.entry-88459432.cjs +1 -0
- package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
- package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
- package/dist/bold-icon.entry-827e95bf.cjs +1 -0
- package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
- package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
- package/dist/button-component_2.entry-acd13f45.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
- package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
- package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
- package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
- package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
- package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
- package/dist/calendar-icon.entry-a289313a.cjs +1 -0
- package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
- package/dist/checkbox-component.entry-f4f98226.js +43 -0
- package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
- package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
- package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
- package/dist/chevron-icon_3.entry-25533d13.js +148 -0
- package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
- package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
- package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
- package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
- package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
- package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
- package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
- package/dist/delete-icon.entry-96420b21.cjs +1 -0
- package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
- package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
- package/dist/elements/index.d.ts +10 -0
- package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
- package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
- package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
- package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
- package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
- package/dist/forward-icon.entry-af8d2147.js +16 -0
- package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
- package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
- package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
- package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
- package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
- package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
- package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
- package/dist/inbox-icon.entry-c005ebc5.js +16 -0
- package/dist/index-05630f15.cjs +57 -0
- package/dist/index-78390f2e.js +17607 -0
- package/dist/index.d.ts +1 -3
- package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
- package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
- package/dist/info-icon_2.entry-b17298b6.js +35 -0
- package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
- package/dist/input-component.entry-24366ab8.cjs +1 -0
- package/dist/input-component.entry-9da5da6c.js +84 -0
- package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
- package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
- package/dist/italic-icon.entry-afa4332a.cjs +1 -0
- package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
- package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
- package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
- package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
- package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
- package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
- package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
- package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
- package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
- package/dist/nylas-form-card.entry-62578338.cjs +1 -0
- package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
- package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
- package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
- package/dist/nylas-key-points.entry-449e1be0.js +29 -0
- package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
- package/dist/nylas-login.entry-36544dc8.cjs +1 -0
- package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
- package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
- package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
- package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
- package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
- package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
- package/dist/nylas-transcript.entry-b129565c.js +128 -0
- package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
- package/dist/nylas-video-player.entry-e208d443.js +39 -0
- package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
- package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
- package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
- package/dist/person-icon.entry-e4d11400.cjs +1 -0
- package/dist/play-icon.entry-68bc660a.js +16 -0
- package/dist/play-icon.entry-9cab598b.cjs +1 -0
- package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
- package/dist/radio-button-group.entry-f7679911.js +47 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +134 -125
- package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
- package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
- package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
- package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
- package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
- package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
- package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
- package/dist/reply-icon.entry-77342442.cjs +1 -0
- package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
- package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
- package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
- package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
- package/dist/sent-icon.entry-20a8945d.cjs +1 -0
- package/dist/sent-icon.entry-2d122865.js +16 -0
- package/dist/spam-icon.entry-86178cc5.cjs +1 -0
- package/dist/spam-icon.entry-9e374d44.js +16 -0
- package/dist/star-icon.entry-1b94c861.cjs +1 -0
- package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
- package/dist/stop-icon.entry-7b21833b.cjs +1 -0
- package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
- package/dist/textarea-component.entry-ba3c9311.js +39 -0
- package/dist/textarea-component.entry-fdba933d.cjs +1 -0
- package/dist/toggle-switch.entry-4a980d1d.js +34 -0
- package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
- package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
- package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
- package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
- package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
- package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
- package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
- package/dist/warning-icon.entry-b1480f57.cjs +1 -0
- package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
- package/package.json +12 -4
- package/dist/add-circle-icon.entry-25aecb13.js +0 -15
- package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
- package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
- package/dist/archive-icon.entry-89e31121.js +0 -15
- package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
- package/dist/bold-icon.entry-d591e701.cjs +0 -1
- package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
- package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
- package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
- package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
- package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
- package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
- package/dist/chevron-icon_3.entry-783588a9.js +0 -147
- package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
- package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
- package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
- package/dist/close-icon.entry-fef4f624.js +0 -15
- package/dist/constants-6da0ede7-151395ad.cjs +0 -1
- package/dist/copy-icon.entry-25699ab8.js +0 -15
- package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
- package/dist/core-js-38e53e34.cjs +0 -4
- package/dist/core-js-a9d3b6e1.js +0 -3297
- package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
- package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
- package/dist/dom-68f08be9.cjs +0 -15
- package/dist/dom-86e17616.js +0 -664
- package/dist/folder-icon.entry-351e61fc.cjs +0 -1
- package/dist/forward-icon.entry-0ccfb600.js +0 -15
- package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
- package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
- package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
- package/dist/google-logo-icon_4.entry-04174684.js +0 -790
- package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
- package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
- package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
- package/dist/index-7e7c24f1.js +0 -16837
- package/dist/index-81719cc6.cjs +0 -81
- package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
- package/dist/info-icon_2.entry-a6d0e842.js +0 -34
- package/dist/input-color-picker.entry-d98d06ca.js +0 -48
- package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
- package/dist/input-component.entry-2e57b00e.cjs +0 -1
- package/dist/input-component.entry-f3aa3419.js +0 -70
- package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
- package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
- package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
- package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
- package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
- package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
- package/dist/nylas-form-card.entry-67aec298.js +0 -57
- package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
- package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
- package/dist/nylas-login.entry-589e45d0.cjs +0 -1
- package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
- package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
- package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
- package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
- package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
- package/dist/person-icon.entry-36b21e95.cjs +0 -1
- package/dist/play-icon.entry-953b1bc8.js +0 -15
- package/dist/play-icon.entry-c35ade8a.cjs +0 -1
- package/dist/refresh-icon.entry-038501ca.cjs +0 -1
- package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
- package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
- package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
- package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
- package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
- package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
- package/dist/sent-icon.entry-ec433cec.js +0 -15
- package/dist/spam-icon.entry-3a553ae4.js +0 -15
- package/dist/spam-icon.entry-a79819fd.cjs +0 -1
- package/dist/star-icon.entry-47ea44e7.cjs +0 -1
- package/dist/stop-icon.entry-26e2e633.cjs +0 -1
- package/dist/textarea-component.entry-6939d0fc.js +0 -38
- package/dist/textarea-component.entry-da0a861e.cjs +0 -1
- package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
- package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
- package/dist/translate-icon.entry-72e0369e.cjs +0 -1
- package/dist/trash-fill-icon.entry-815859c6.js +0 -15
- package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
- package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
- package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-81719cc6.cjs");require("react");require("react-dom");const d=':host{display:block;width:inherit;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.dropdown{display:inline-block;width:100%;position:relative}.dropdown .dropdown-label{display:flex;align-items:center;gap:0.25rem;color:var(--nylas-base-800)}.dropdown .dropdown-label p{margin:0}.dropdown .dropdown-label span.required{color:var(--nylas-error);padding:0 0.25rem}.dropdown span.error{color:var(--nylas-error);font-size:14px}.dropbtn{width:inherit;height:48px;color:var(--nylas-base-900);padding:0.5rem;font-size:16px;cursor:pointer;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn.error{border:1px solid var(--nylas-error)}.dropbtn:hover,.dropbtn:active{border:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn:disabled{cursor:not-allowed;background:var(--nylas-base-100)}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:72px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content ul li label{display:flex;align-items:center;gap:0.5rem}.dropdown-content ul li label input{margin:0}.selected-options{display:flex;flex-wrap:wrap;gap:0.5rem;padding:0.5rem 0;margin-top:0.25rem;background:var(--nylas-base-0)}.selected-options .selected-option{display:flex;align-items:center;gap:0.5rem;padding:4px 8px;border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-100);color:var(--nylas-base-800);font-size:16px;font-weight:500;line-height:1.5rem;letter-spacing:0.5px}.selected-options .selected-option button{background:transparent;border:none;cursor:pointer;padding:0}.selected-options .selected-option button:hover{color:var(--nylas-primary)}.selected-options .selected-option button:disabled{cursor:not-allowed;background:var(--nylas-base-100)}',p=d,r=class{constructor(e){a.registerInstance(this,e),this.selectedOptionsChanged=a.createEvent(this,"selectedOptionsChanged",7),this.name=void 0,this.label=void 0,this.options=[],this.error="",this.required=!1,this.readOnly=!1,this.availableOptions=this.options,this.isOpen=!1,this.ariaActivedescendant="",this.shouldFocusFirstOption=!1}areOptionsEqual(e,s){if(e.length!==s.length)return!1;const t=[...e].sort((n,o)=>n.label.localeCompare(o.label)||n.value.localeCompare(o.value)),i=[...s].sort((n,o)=>n.label.localeCompare(o.label)||n.value.localeCompare(o.value));return t.every((n,o)=>{const l=i[o];return n.label===l.label&&n.value===l.value})}optionsChangedHandler(e){this.areOptionsEqual(e,this.availableOptions)||(this.availableOptions=e)}componentDidLoad(){a.debug("multi-select-dropdown","componentDidLoad"),this.options&&(this.availableOptions=this.options)}componentDidRender(){var e;a.debug("multi-select-dropdown","componentDidRender"),this.isOpen&&this.shouldFocusFirstOption&&(this.ariaActivedescendant=(e=this.availableOptions[0])==null?void 0:e.value,this.focusOption(0),this.shouldFocusFirstOption=!1)}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}handleBookingFormSubmitted(e){const s=this.availableOptions.filter(t=>t.selected).map(t=>t.value);this.required&&(!s||s.length<=0)&&(this.error="Please select at least one option"),this.error&&e.preventDefault()}selectOption(e){this.availableOptions=this.availableOptions.map(t=>(t.value===e.value&&(t.selected=!e.selected,t.selected&&(this.error="")),t));const s=this.availableOptions.filter(t=>t.selected).map(t=>t.value);this.selectedOptionsChanged.emit({value:s,name:this.name})}toggleDropdown(){this.isOpen=!this.isOpen,this.isOpen?this.shouldFocusFirstOption=!0:this.ariaActivedescendant=""}handleSelectButtonKeyDown(e){switch(e.key){case"ArrowDown":case"Enter":e.preventDefault(),this.isOpen||this.toggleDropdown();break;case"Escape":this.isOpen=!1;break}}handleListboxKeydown(e){const s=this.availableOptions,t=s.findIndex(i=>i.value===this.ariaActivedescendant);switch(e.key){case"ArrowDown":case"Tab":if(e.shiftKey){e.preventDefault();const n=t-1>=0?t-1:s.length-1;this.ariaActivedescendant=s[n].value,this.focusOption(n)}else{e.preventDefault();const n=t+1<s.length?t+1:0;this.ariaActivedescendant=s[n].value,this.focusOption(n)}break;case"ArrowUp":e.preventDefault();const i=t-1>=0?t-1:s.length-1;this.ariaActivedescendant=s[i].value,this.focusOption(i);break;case"Enter":e.preventDefault(),this.ariaActivedescendant&&this.selectOption(s[t]);break;case"Escape":this.isOpen=!1;break}}focusOption(e){var n;const s=this.availableOptions[e];if(!s)return;const t=s.value,i=(n=this.el.shadowRoot)==null?void 0:n.getElementById(t);i&&(i.focus(),i.scrollIntoView({behavior:"smooth",block:"nearest"}))}getSelectedOptions(){return this.availableOptions.filter(e=>e.selected)}renderOption(e){return a.h("li",{key:e.value,id:e.value,role:"option",tabindex:"0","aria-selected":e.selected?"true":"false",onClick:s=>{s.stopImmediatePropagation(),this.selectOption(e)},class:{selected:!!e.selected}},a.h("label",{htmlFor:e.value},a.h("input",{"aria-hidden":"true",id:e.value,type:"checkbox",checked:e.selected}),a.h("span",null,e.label)))}render(){var e,s;return a.h(a.Host,{key:"37a31937cf135ac95283a6bda665376e898528a1"},a.h("div",{key:"9a563036244cd370513cd9b74deafea852c6e9bf",class:"dropdown",part:"msd_dropdown"},a.h("label",{key:"66e18a246555de11c9643937948ccab15a31f15d",class:"dropdown-label",part:"msd_dropdown-label"},a.h("p",{key:"41e3d3fde96d84a171e57731071649c102043fc1"},a.h("span",{key:"d5002292b0cf924c5394f1ecd1a8f8752e928b13",class:"label"},this.label),this.required&&a.h("span",{class:"required"},"*")),a.h("slot",{key:"a169bb5c2460002c307ea427c41597c0beb4ef21",name:"label-icon","aria-hidden":"true"})),a.h("button",{key:"06e0529ba120efb2af170aeda87f560f824b7deb",name:this.name,part:`msd_dropdown-button ${this.error?"msd_dropdown-button--error":""}`,class:{dropbtn:!0,open:this.isOpen,error:!!this.error},onClick:()=>this.toggleDropdown(),disabled:this.readOnly,title:this.readOnly?"read-only field":void 0,"aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false","aria-label":this.name,onKeyDown:t=>this.handleSelectButtonKeyDown(t)},a.h("slot",{key:"643778fc42ed44e62cff22958fe6aed421db4da2",name:"select-icon","aria-hidden":"true"}),a.h("span",{key:"a471f42326edcf0bfa49432504c1eaaa56e38f80",class:"selected-option",part:"msd_dropdown-button-selected-label"},this.getSelectedOptions().length>1?"Multiple options selected":((e=this.availableOptions.filter(t=>t.selected)[0])==null?void 0:e.label)??((s=this.availableOptions[0])==null?void 0:s.label)),a.h("span",{key:"a68f0eb8608f1fff68cf682ae5721e7966fffefd",class:this.isOpen?"open":"closed","aria-hidden":"true"},a.h("chevron-icon",{key:"915161be22a422ffdb8126d4a0c7530633d443d9",width:"16",height:"16"}))),this.error?a.h("span",{class:"error",part:"msd_dropdown_error"},this.error):null,this.isOpen?null:a.h("div",{class:"selected-options"},this.getSelectedOptions().map(t=>a.h("span",{class:"selected-option"},t.label,a.h("button",{disabled:this.readOnly,key:t.label,onClick:()=>this.selectOption(t)},a.h("close-icon",null))))),this.isOpen?a.h("div",{class:"dropdown-content",part:"msd_dropdown-content"},a.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-multiselectable":!0,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:t=>this.handleListboxKeydown(t)},this.availableOptions.map(t=>this.renderOption(t)))):null))}get el(){return a.getElement(this)}static get watchers(){return{options:["optionsChangedHandler"]}}};r.style=p;exports.multi_select_dropdown=r;
|