@spw-ds/spw-stencil-library 1.2.4 → 1.2.5
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/spw-button.spw-loading.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-button_2.cjs.entry.js +1 -1
- package/dist/cjs/spw-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-custom-select.cjs.entry.js +43 -7
- package/dist/cjs/spw-custom-select.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-custom-select.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-date-picker.cjs.entry.js +48 -28
- package/dist/cjs/spw-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-date-picker.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-field-label.spw-group.spw-icon.spw-link.spw-separator.spw-theme-provider.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-field-label_6.cjs.entry.js +1 -1
- package/dist/cjs/spw-field-label_6.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-pagination.cjs.entry.js +26 -16
- package/dist/cjs/spw-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-pagination.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-search-field.cjs.entry.js +12 -2
- package/dist/cjs/spw-search-field.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-search-field.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-select.cjs.entry.js +3 -1
- package/dist/cjs/spw-select.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-select.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-stencil-library.cjs.js +1 -1
- package/dist/cjs/spw-table-cell.cjs.entry.js +23 -2
- package/dist/cjs/spw-table-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-table-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-table-footer.cjs.entry.js +1 -1
- package/dist/cjs/spw-table-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-table-footer.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-table-header.cjs.entry.js +33 -3
- package/dist/cjs/spw-table-header.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-table-header.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-table-row.cjs.entry.js +34 -2
- package/dist/cjs/spw-table-row.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-table-row.entry.cjs.js.map +1 -1
- package/dist/cjs/spw-table.cjs.entry.js +26 -3
- package/dist/cjs/spw-table.cjs.entry.js.map +1 -1
- package/dist/cjs/spw-table.entry.cjs.js.map +1 -1
- package/dist/cjs/utils-D_vNTY6w.js.map +1 -1
- package/dist/collection/components/spw-button/spw-button.css +1 -1
- package/dist/collection/components/spw-custom-select/spw-custom-select.css +1 -1
- package/dist/collection/components/spw-custom-select/spw-custom-select.js +42 -6
- package/dist/collection/components/spw-custom-select/spw-custom-select.js.map +1 -1
- package/dist/collection/components/spw-date-picker/spw-date-picker.js +48 -28
- package/dist/collection/components/spw-date-picker/spw-date-picker.js.map +1 -1
- package/dist/collection/components/spw-link/spw-link.css +1 -1
- package/dist/collection/components/spw-pagination/spw-pagination.css +1 -1
- package/dist/collection/components/spw-pagination/spw-pagination.js +54 -13
- package/dist/collection/components/spw-pagination/spw-pagination.js.map +1 -1
- package/dist/collection/components/spw-search-field/spw-search-field.js +50 -2
- package/dist/collection/components/spw-search-field/spw-search-field.js.map +1 -1
- package/dist/collection/components/spw-select/spw-select.js +3 -1
- package/dist/collection/components/spw-select/spw-select.js.map +1 -1
- package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.css +1 -1
- package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.js +82 -1
- package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.js.map +1 -1
- package/dist/collection/components/spw-table/spw-table-footer/spw-table-footer.css +1 -1
- package/dist/collection/components/spw-table/spw-table-header/spw-table-header.css +1 -1
- package/dist/collection/components/spw-table/spw-table-header/spw-table-header.js +92 -2
- package/dist/collection/components/spw-table/spw-table-header/spw-table-header.js.map +1 -1
- package/dist/collection/components/spw-table/spw-table-row/spw-table-row.css +1 -1
- package/dist/collection/components/spw-table/spw-table-row/spw-table-row.js +66 -1
- package/dist/collection/components/spw-table/spw-table-row/spw-table-row.js.map +1 -1
- package/dist/collection/components/spw-table/spw-table.js +27 -2
- package/dist/collection/components/spw-table/spw-table.js.map +1 -1
- package/dist/collection/stories/organisms/spw-footer/spw-footer.stories.js +1 -1
- package/dist/collection/stories/organisms/spw-footer/spw-footer.stories.js.map +1 -1
- package/dist/collection/utils/utils.js +47 -48
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/{p-du-Bai6S.js → p-B2toBmC2.js} +32 -21
- package/dist/components/p-B2toBmC2.js.map +1 -0
- package/dist/components/p-BBi01mKM.js.map +1 -1
- package/dist/components/{p-AjhBdYbk.js → p-DjyPtAVX.js} +3 -3
- package/dist/components/p-DjyPtAVX.js.map +1 -0
- package/dist/components/{p-CNNUoO2J.js → p-qROlK2WR.js} +3 -3
- package/dist/components/p-qROlK2WR.js.map +1 -0
- package/dist/components/spw-breadcrumb-item.js +1 -1
- package/dist/components/spw-button.js +1 -1
- package/dist/components/spw-cookies.js +1 -1
- package/dist/components/spw-custom-select.js +43 -7
- package/dist/components/spw-custom-select.js.map +1 -1
- package/dist/components/spw-date-picker.js +48 -28
- package/dist/components/spw-date-picker.js.map +1 -1
- package/dist/components/spw-file-upload.js +1 -1
- package/dist/components/spw-header-lang.js +1 -1
- package/dist/components/spw-header.js +1 -1
- package/dist/components/spw-iodda.js +1 -1
- package/dist/components/spw-link.js +1 -1
- package/dist/components/spw-message.js +1 -1
- package/dist/components/spw-pagination.js +1 -1
- package/dist/components/spw-search-field.js +15 -4
- package/dist/components/spw-search-field.js.map +1 -1
- package/dist/components/spw-select.js +3 -1
- package/dist/components/spw-select.js.map +1 -1
- package/dist/components/spw-table-cell.js +26 -2
- package/dist/components/spw-table-cell.js.map +1 -1
- package/dist/components/spw-table-footer.js +1 -1
- package/dist/components/spw-table-footer.js.map +1 -1
- package/dist/components/spw-table-header.js +37 -4
- package/dist/components/spw-table-header.js.map +1 -1
- package/dist/components/spw-table-row.js +39 -3
- package/dist/components/spw-table-row.js.map +1 -1
- package/dist/components/spw-table.js +28 -4
- package/dist/components/spw-table.js.map +1 -1
- package/dist/components_json.json +268 -12
- package/dist/components_vscode.json +3088 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/spw-button.spw-loading.entry.js.map +1 -1
- package/dist/esm/spw-button_2.entry.js +1 -1
- package/dist/esm/spw-button_2.entry.js.map +1 -1
- package/dist/esm/spw-custom-select.entry.js +43 -7
- package/dist/esm/spw-custom-select.entry.js.map +1 -1
- package/dist/esm/spw-date-picker.entry.js +48 -28
- package/dist/esm/spw-date-picker.entry.js.map +1 -1
- package/dist/esm/spw-field-label.spw-group.spw-icon.spw-link.spw-separator.spw-theme-provider.entry.js.map +1 -1
- package/dist/esm/spw-field-label_6.entry.js +1 -1
- package/dist/esm/spw-field-label_6.entry.js.map +1 -1
- package/dist/esm/spw-pagination.entry.js +26 -16
- package/dist/esm/spw-pagination.entry.js.map +1 -1
- package/dist/esm/spw-search-field.entry.js +13 -3
- package/dist/esm/spw-search-field.entry.js.map +1 -1
- package/dist/esm/spw-select.entry.js +3 -1
- package/dist/esm/spw-select.entry.js.map +1 -1
- package/dist/esm/spw-stencil-library.js +1 -1
- package/dist/esm/spw-table-cell.entry.js +23 -2
- package/dist/esm/spw-table-cell.entry.js.map +1 -1
- package/dist/esm/spw-table-footer.entry.js +1 -1
- package/dist/esm/spw-table-footer.entry.js.map +1 -1
- package/dist/esm/spw-table-header.entry.js +33 -3
- package/dist/esm/spw-table-header.entry.js.map +1 -1
- package/dist/esm/spw-table-row.entry.js +35 -3
- package/dist/esm/spw-table-row.entry.js.map +1 -1
- package/dist/esm/spw-table.entry.js +26 -3
- package/dist/esm/spw-table.entry.js.map +1 -1
- package/dist/esm/utils-BBi01mKM.js.map +1 -1
- package/dist/spw-stencil-library/p-0f69442e.entry.js +2 -0
- package/dist/spw-stencil-library/p-0f69442e.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-14722019.entry.js +2 -0
- package/dist/spw-stencil-library/p-14722019.entry.js.map +1 -0
- package/dist/spw-stencil-library/{p-b1de48f3.entry.js → p-152525de.entry.js} +2 -2
- package/dist/spw-stencil-library/p-152525de.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-2ad00dfc.entry.js +2 -0
- package/dist/spw-stencil-library/p-2ad00dfc.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-4a273848.entry.js +2 -0
- package/dist/spw-stencil-library/p-4a273848.entry.js.map +1 -0
- package/dist/spw-stencil-library/{p-31793077.entry.js → p-5632f307.entry.js} +2 -2
- package/dist/spw-stencil-library/p-5632f307.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-5e43e2ed.entry.js +2 -0
- package/dist/spw-stencil-library/p-5e43e2ed.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-92583499.entry.js +2 -0
- package/dist/spw-stencil-library/p-92583499.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-9d760073.entry.js +2 -0
- package/dist/spw-stencil-library/p-9d760073.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-9e8a779e.entry.js +2 -0
- package/dist/spw-stencil-library/p-9e8a779e.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-BBi01mKM.js.map +1 -1
- package/dist/spw-stencil-library/p-c4e4cfd4.entry.js +2 -0
- package/dist/spw-stencil-library/p-c4e4cfd4.entry.js.map +1 -0
- package/dist/spw-stencil-library/{p-f7760a47.entry.js → p-fcc5884a.entry.js} +2 -2
- package/dist/spw-stencil-library/p-fcc5884a.entry.js.map +1 -0
- package/dist/spw-stencil-library/spw-button.spw-loading.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-custom-select.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-date-picker.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-field-label.spw-group.spw-icon.spw-link.spw-separator.spw-theme-provider.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-pagination.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-search-field.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-select.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-stencil-library.esm.js +1 -1
- package/dist/spw-stencil-library/spw-table-cell.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-table-footer.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-table-header.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-table-row.entry.esm.js.map +1 -1
- package/dist/spw-stencil-library/spw-table.entry.esm.js.map +1 -1
- package/dist/stats.json +611 -150
- package/dist/types/components/spw-custom-select/spw-custom-select.d.ts +3 -0
- package/dist/types/components/spw-date-picker/spw-date-picker.d.ts +1 -0
- package/dist/types/components/spw-pagination/spw-pagination.d.ts +4 -1
- package/dist/types/components/spw-search-field/spw-search-field.d.ts +5 -0
- package/dist/types/components/spw-select/spw-select.d.ts +1 -0
- package/dist/types/components/spw-table/spw-table-cell/spw-table-cell.d.ts +6 -0
- package/dist/types/components/spw-table/spw-table-header/spw-table-header.d.ts +6 -0
- package/dist/types/components/spw-table/spw-table-row/spw-table-row.d.ts +8 -0
- package/dist/types/components/spw-table/spw-table.d.ts +2 -0
- package/dist/types/components.d.ts +83 -0
- package/dist/types/utils/utils.d.ts +2 -1
- package/hydrate/index.js +265 -72
- package/hydrate/index.mjs +265 -72
- package/package.json +1 -1
- package/dist/components/p-AjhBdYbk.js.map +0 -1
- package/dist/components/p-CNNUoO2J.js.map +0 -1
- package/dist/components/p-du-Bai6S.js.map +0 -1
- package/dist/spw-stencil-library/p-22f972ca.entry.js +0 -2
- package/dist/spw-stencil-library/p-22f972ca.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-2c28684f.entry.js +0 -2
- package/dist/spw-stencil-library/p-2c28684f.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-31793077.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-4c21a696.entry.js +0 -2
- package/dist/spw-stencil-library/p-4c21a696.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-572188ac.entry.js +0 -2
- package/dist/spw-stencil-library/p-572188ac.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-823b60ae.entry.js +0 -2
- package/dist/spw-stencil-library/p-823b60ae.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-b1de48f3.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-d115a739.entry.js +0 -2
- package/dist/spw-stencil-library/p-d115a739.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-d2258e0a.entry.js +0 -2
- package/dist/spw-stencil-library/p-d2258e0a.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-ecec4588.entry.js +0 -2
- package/dist/spw-stencil-library/p-ecec4588.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-f5caed11.entry.js +0 -2
- package/dist/spw-stencil-library/p-f5caed11.entry.js.map +0 -1
- package/dist/spw-stencil-library/p-f7760a47.entry.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { d as defineCustomElement$4 } from './p-t1vZcpqC.js';
|
|
|
4
4
|
import { d as defineCustomElement$3 } from './p-qgvllwX6.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './p-_q4w18VU.js';
|
|
6
6
|
|
|
7
|
-
const spwCustomSelectCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-custom-select{position:relative}.spw-custom-select__container{align-items:center;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:4px;display:flex;height:40px;justify-content:space-between;line-height:40px;padding:0 12px;width:100%}.spw-custom-select__container:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-custom-select__container:focus-visible,.spw-custom-select__container:focus-within{box-shadow:0 0 0 6px #000;outline:3px solid #fff;outline-offset:0}.spw-custom-select--disabled .spw-custom-select__container{background:var(--spw-color-themes-grey-grey-100);border-color:var(--spw-color-themes-grey-grey-400);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-custom-select--disabled .spw-custom-select__container::-moz-placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container:focus,.spw-custom-select--disabled .spw-custom-select__container:focus-visible,.spw-custom-select--disabled .spw-custom-select__container:hover{outline:none}.spw-custom-select--is-error .spw-custom-select__container{border-color:var(--spw-colors-states-error-error-300)}.spw-custom-select--large .spw-custom-select__container{height:60px;line-height:60px;padding:0 24px}.spw-custom-select--is-opened .spw-custom-select__container{border-bottom-color:transparent;border-radius:4px 4px 0 0;height:auto;line-height:1;min-height:40px}.spw-custom-select__selected{flex:1;max-width:100%;padding-right:30px}.spw-custom-select__selected-item{align-items:center;background:var(--spw-color-themes-grey-grey-200);border:1px solid var(--spw-color-themes-grey-grey-900);border-radius:999px;color:var(--spw-color-themes-grey-grey-900);display:inline-flex;font-size:14px;gap:6px;height:24px;line-height:24px;margin:4px 6px 2px 0;padding:0 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.spw-custom-select__selected-items{text-wrap:nowrap;flex:1;overflow:hidden;text-overflow:ellipsis}.spw-custom-select--is-opened .spw-custom-select__selected-items{text-wrap:initial;overflow:visible;padding-bottom:4px;padding-top:3px;text-overflow:clip}.spw-custom-select__arrow{color:var(--spw-color-themes-grey-grey-600);font-size:16px;pointer-events:none;position:absolute;right:12px;top:10px}.spw-custom-select__wrapper{position:relative}.spw-custom-select--is-opened .spw-custom-select__search{left:0;margin-top:1px;position:absolute;top:0;width:100%;z-index:11}.spw-custom-select--has-value.spw-custom-select--is-opened .spw-custom-select__search{margin-top:-3px;top:auto;top:100%}.spw-custom-select__search-input{border:none;height:38px;line-height:40px;margin:0;padding:0;text-overflow:ellipsis;width:calc(100% - 30px)}.spw-custom-select__search-input:focus{outline:none}.spw-custom-select--is-opened .spw-custom-select__search-input{border-left:1px solid var(--spw-color-themes-grey-grey-800);padding:0 12px}.spw-custom-select--is-opened.spw-custom-select--has-value .spw-custom-select__search-input{border-right:1px solid var(--spw-color-themes-grey-grey-800);width:100%}.spw-custom-select__options{background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:0 0 4px 4px;max-height:200px;overflow-y:auto;position:absolute;width:100%;z-index:12}.spw-custom-select__options--down,.spw-custom-select__options--up{top:100%;transform:translateY(0)}.spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) .spw-custom-select__options{margin-top:35px}.spw-custom-select__no-results{color:var(--spw-color-themes-grey-grey-600);cursor:not-allowed;padding:12px}.spw-custom-select__option{border-bottom:1px solid var(--spw-color-themes-grey-grey-900);cursor:pointer;padding:12px}.spw-custom-select__option:hover{background-color:var(--spw-color-themes-grey-grey-200)}.spw-custom-select__option:last-child{border-bottom:none}.spw-custom-select__option--selected{font-weight:700}.spw-custom-select__error{color:var(--spw-color-themes-grey-grey-600);display:block;font-size:12px;margin-top:8px}.spw-custom-select__option--focused{background-color:var(--spw-color-themes-grey-grey-300)}.-spw-tw-mt-1{margin-top:-.25rem}.spw-tw-mb-2{margin-bottom:.5rem}.spw-tw-mr-2{margin-right:.5rem}";
|
|
7
|
+
const spwCustomSelectCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1200px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px;width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-custom-select{position:relative}.spw-custom-select__container{align-items:center;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:4px;display:flex;height:40px;justify-content:space-between;line-height:40px;padding:0 12px;width:100%}.spw-custom-select__container:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-custom-select__container:focus-visible,.spw-custom-select__container:focus-within{box-shadow:0 0 0 6px #000;outline:3px solid #fff;outline-offset:0}.spw-custom-select--disabled .spw-custom-select__container{background:var(--spw-color-themes-grey-grey-100);border-color:var(--spw-color-themes-grey-grey-400);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-custom-select--disabled .spw-custom-select__container::-moz-placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container:focus,.spw-custom-select--disabled .spw-custom-select__container:focus-visible,.spw-custom-select--disabled .spw-custom-select__container:hover{outline:none}.spw-custom-select--is-error .spw-custom-select__container{border-color:var(--spw-colors-states-error-error-300)}.spw-custom-select--large .spw-custom-select__container{height:60px;line-height:60px;padding:0 24px}.spw-custom-select--is-opened .spw-custom-select__container{border-bottom-color:transparent;border-radius:4px 4px 0 0;height:auto;line-height:1;min-height:40px}.spw-custom-select__selected{flex:1;max-width:100%;padding-right:30px}.spw-custom-select__selected-item{align-items:center;background:var(--spw-color-themes-grey-grey-200);border:1px solid var(--spw-color-themes-grey-grey-900);border-radius:999px;color:var(--spw-color-themes-grey-grey-900);display:inline-flex;font-size:14px;gap:6px;height:24px;line-height:24px;margin:4px 6px 2px 0;padding:0 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.spw-custom-select__selected-items{text-wrap:nowrap;flex:1;overflow:hidden;text-overflow:ellipsis}.spw-custom-select--is-opened .spw-custom-select__selected-items{text-wrap:initial;overflow:visible;padding-bottom:4px;padding-top:3px;text-overflow:clip}.spw-custom-select__arrow{color:var(--spw-color-themes-grey-grey-600);font-size:16px;pointer-events:none;position:absolute;right:12px;top:10px}.spw-custom-select__wrapper{position:relative}.spw-custom-select--is-opened .spw-custom-select__search{left:0;margin-top:1px;position:absolute;top:0;width:100%;z-index:11}.spw-custom-select--has-value.spw-custom-select--is-opened .spw-custom-select__search{margin-top:-3px;top:auto;top:100%}.spw-custom-select__search-input{border:none;height:38px;line-height:40px;margin:0;padding:0;text-overflow:ellipsis;width:calc(100% - 30px)}.spw-custom-select__search-input:focus{outline:none}.spw-custom-select--is-opened .spw-custom-select__search-input{border-left:1px solid var(--spw-color-themes-grey-grey-800);padding:0 12px}.spw-custom-select--is-opened.spw-custom-select--has-value .spw-custom-select__search-input{border-right:1px solid var(--spw-color-themes-grey-grey-800);width:100%}.spw-custom-select__options{background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:0 0 4px 4px;max-height:200px;overflow-y:auto;position:absolute;width:100%;z-index:12}.spw-custom-select__options--down,.spw-custom-select__options--up{top:100%;transform:translateY(0)}.spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) .spw-custom-select__options{margin-top:35px}.spw-custom-select__no-results{color:var(--spw-color-themes-grey-grey-600);cursor:not-allowed;padding:12px}.spw-custom-select__option{border-bottom:1px solid var(--spw-color-themes-grey-grey-900);cursor:pointer;padding:12px}.spw-custom-select__option:hover{background-color:var(--spw-color-themes-grey-grey-200)}.spw-custom-select__option:last-child{border-bottom:none}.spw-custom-select__option--selected{font-weight:700}.spw-custom-select__option--disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.spw-custom-select__option--disabled:hover{background-color:transparent}.spw-custom-select__error{color:var(--spw-color-themes-grey-grey-600);display:block;font-size:12px;margin-top:8px}.spw-custom-select__option--focused{background-color:var(--spw-color-themes-grey-grey-300)}.-spw-tw-mt-1{margin-top:-.25rem}.spw-tw-mb-2{margin-bottom:.5rem}.spw-tw-mr-2{margin-right:.5rem}";
|
|
8
8
|
|
|
9
9
|
const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect extends H {
|
|
10
10
|
constructor() {
|
|
@@ -49,6 +49,11 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
49
49
|
this.showSuccessIcon = true;
|
|
50
50
|
/** Affiche une icône de warning si vrai */
|
|
51
51
|
this.showWarningIcon = true;
|
|
52
|
+
this.handleOtherSelectOpened = (event) => {
|
|
53
|
+
if (event.detail.instance !== this.host && this.isOpen) {
|
|
54
|
+
this.closeDropdown();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
52
57
|
this.handleClickOutside = (event) => {
|
|
53
58
|
var _a, _b;
|
|
54
59
|
if (this.isOpen) {
|
|
@@ -113,10 +118,12 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
113
118
|
}
|
|
114
119
|
componentDidLoad() {
|
|
115
120
|
document.addEventListener('click', this.handleClickOutside);
|
|
121
|
+
document.addEventListener('spw-custom-select-opened', this.handleOtherSelectOpened);
|
|
116
122
|
this.internals.setFormValue(this.getFormValue());
|
|
117
123
|
}
|
|
118
124
|
disconnectedCallback() {
|
|
119
125
|
document.removeEventListener('click', this.handleClickOutside);
|
|
126
|
+
document.removeEventListener('spw-custom-select-opened', this.handleOtherSelectOpened);
|
|
120
127
|
}
|
|
121
128
|
parseOptions(newValue) {
|
|
122
129
|
try {
|
|
@@ -124,12 +131,14 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
124
131
|
this.parsedOptions = newValue.map(option => ({
|
|
125
132
|
value: option.value,
|
|
126
133
|
label: option.label,
|
|
134
|
+
disabled: option.disabled || false,
|
|
127
135
|
}));
|
|
128
136
|
}
|
|
129
137
|
else if (typeof newValue === 'string') {
|
|
130
138
|
this.parsedOptions = JSON.parse(newValue).map(option => ({
|
|
131
139
|
value: option.value,
|
|
132
140
|
label: option.label,
|
|
141
|
+
disabled: option.disabled || false,
|
|
133
142
|
}));
|
|
134
143
|
}
|
|
135
144
|
else {
|
|
@@ -182,12 +191,24 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
182
191
|
event.stopPropagation();
|
|
183
192
|
}
|
|
184
193
|
this.determineDropdownDirection();
|
|
194
|
+
const wasOpen = this.isOpen;
|
|
185
195
|
this.isOpen = !this.isOpen;
|
|
196
|
+
if (this.isOpen && !wasOpen) {
|
|
197
|
+
this.notifyOtherSelects();
|
|
198
|
+
}
|
|
186
199
|
if (!this.isOpen) {
|
|
187
200
|
this.focusedOptionIndex = null;
|
|
188
201
|
}
|
|
189
202
|
}
|
|
190
203
|
}
|
|
204
|
+
notifyOtherSelects() {
|
|
205
|
+
const event = new CustomEvent('spw-custom-select-opened', {
|
|
206
|
+
detail: { instance: this.host },
|
|
207
|
+
bubbles: true,
|
|
208
|
+
composed: true
|
|
209
|
+
});
|
|
210
|
+
document.dispatchEvent(event);
|
|
211
|
+
}
|
|
191
212
|
determineDropdownDirection() {
|
|
192
213
|
const rect = this.selectContainer.getBoundingClientRect();
|
|
193
214
|
const viewportHeight = window.innerHeight;
|
|
@@ -202,6 +223,7 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
202
223
|
this.determineDropdownDirection();
|
|
203
224
|
this.isOpen = true;
|
|
204
225
|
this.focusedOptionIndex = 0;
|
|
226
|
+
this.notifyOtherSelects();
|
|
205
227
|
}
|
|
206
228
|
closeDropdown() {
|
|
207
229
|
this.isOpen = false;
|
|
@@ -212,6 +234,10 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
212
234
|
if (event) {
|
|
213
235
|
event.stopPropagation();
|
|
214
236
|
}
|
|
237
|
+
const option = this.parsedOptions.find(opt => String(opt.value) === String(optionValue));
|
|
238
|
+
if (option === null || option === void 0 ? void 0 : option.disabled) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
215
241
|
if (this.multiple) {
|
|
216
242
|
const index = this.internalValue.findIndex(val => String(val) === String(optionValue));
|
|
217
243
|
if (index > -1) {
|
|
@@ -238,6 +264,7 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
238
264
|
}
|
|
239
265
|
}
|
|
240
266
|
handleKeyDown(event) {
|
|
267
|
+
var _a, _b;
|
|
241
268
|
if (event.target.classList.contains('spw-custom-select__search-input')) {
|
|
242
269
|
return;
|
|
243
270
|
}
|
|
@@ -251,7 +278,11 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
251
278
|
case 'ArrowDown':
|
|
252
279
|
event.preventDefault();
|
|
253
280
|
if (this.isOpen) {
|
|
254
|
-
|
|
281
|
+
let nextIndex = this.focusedOptionIndex === null ? 0 : (this.focusedOptionIndex + 1) % this.parsedOptions.length;
|
|
282
|
+
while (((_a = this.parsedOptions[nextIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && nextIndex !== this.focusedOptionIndex) {
|
|
283
|
+
nextIndex = (nextIndex + 1) % this.parsedOptions.length;
|
|
284
|
+
}
|
|
285
|
+
this.focusedOptionIndex = nextIndex;
|
|
255
286
|
}
|
|
256
287
|
else {
|
|
257
288
|
this.openDropdownWithKeyboard();
|
|
@@ -260,8 +291,11 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
260
291
|
case 'ArrowUp':
|
|
261
292
|
event.preventDefault();
|
|
262
293
|
if (this.isOpen) {
|
|
263
|
-
this.focusedOptionIndex
|
|
264
|
-
|
|
294
|
+
let prevIndex = this.focusedOptionIndex === null ? this.parsedOptions.length - 1 : (this.focusedOptionIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;
|
|
295
|
+
while (((_b = this.parsedOptions[prevIndex]) === null || _b === void 0 ? void 0 : _b.disabled) && prevIndex !== this.focusedOptionIndex) {
|
|
296
|
+
prevIndex = (prevIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;
|
|
297
|
+
}
|
|
298
|
+
this.focusedOptionIndex = prevIndex;
|
|
265
299
|
}
|
|
266
300
|
break;
|
|
267
301
|
case 'Enter':
|
|
@@ -340,6 +374,7 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
340
374
|
this.focusedOptionIndex = 0;
|
|
341
375
|
if (!this.isOpen) {
|
|
342
376
|
this.isOpen = true;
|
|
377
|
+
this.notifyOtherSelects();
|
|
343
378
|
}
|
|
344
379
|
}
|
|
345
380
|
isSearchVisible() {
|
|
@@ -361,17 +396,18 @@ const SpwCustomSelect$1 = /*@__PURE__*/ proxyCustomElement(class SpwCustomSelect
|
|
|
361
396
|
render() {
|
|
362
397
|
const filteredOptions = this.getFilteredOptions();
|
|
363
398
|
const showPlaceholder = this.showPlaceholder();
|
|
364
|
-
return (h("div", { key: '
|
|
399
|
+
return (h("div", { key: 'a2e9fb9f19b299dfde36cc0562ee8d3e82441aae', class: this.elementClass, ref: el => (this.host = el) }, this.label && h("spw-field-label", { key: '624c8188f2a36b66febcfd7c8a2d22e646490d56', label: this.label, name: this.name, required: this.required }), this.assistiveText && (h("spw-field-message", { key: 'd1e74cf86c8b0de5a18a386ef384d747759b99cc', class: "spw-tw-mb-2 -spw-tw-mt-1", variant: "hint", showIcon: false }, this.assistiveText)), h("div", { key: '0f4ae9ca8c745da16f4a6a8af594e81e04889eb9', class: "spw-custom-select__wrapper" }, h("div", { key: 'ed257c48baa566f4480c161435ab2f1affd91ec0', class: "spw-custom-select__container", id: this.name, ref: el => (this.selectContainer = el), onClick: event => this.toggleDropdown(event), onKeyDown: event => this.handleKeyDown(event), tabindex: this.disabled ? -1 : 0 }, h("div", { key: '5006bc09c045d469089dbeab1fb99fdaadf9ae4b', class: "spw-custom-select__selected" }, this.isSearchVisible() && (h("div", { key: '5ea0a83210326adf2f22d700c0c6de204f8efc4a', class: "spw-custom-select__search" }, h("input", { key: 'c4a23018e53464b65323fae714fe669e6cf510cc', class: "spw-custom-select__search-input", placeholder: "Entrez votre recherche", onInput: event => this.handleSearchInput(event), value: this.searchText }))), showPlaceholder && h("span", { key: 'b35cea32fe067f85a90568a67f64e3723f15d2f9' }, this.placeholder), this.multiple && this.internalValue.length > 0 && (h("div", { key: 'ad42651a8e606cc7abb424f167ec4a9b95562290', class: "spw-custom-select__selected-items" }, this.internalValue.map(val => {
|
|
365
400
|
var _a;
|
|
366
401
|
return (h("span", { class: "spw-custom-select__selected-item" }, (_a = this.parsedOptions.find(option => String(option.value) === String(val))) === null || _a === void 0 ? void 0 :
|
|
367
402
|
_a.label, h("spw-icon", { icon: "fa-times", class: "spw-custom-select__deselect-icon", onClick: event => this.selectOption(val, event) })));
|
|
368
|
-
}))), !this.multiple && h("span", { key: '
|
|
403
|
+
}))), !this.multiple && h("span", { key: '6050f92aaa17ef4613559e315f8d1fc95db86638' }, this.getSelectedLabels()))), h("div", { key: 'b0031148a8d7da8d003f0935dfe6e319b8334d3f', class: "spw-custom-select__arrow" }, h("spw-icon", { key: 'd2b3141c4308fe565780794888b763d0bf6ad101', icon: this.isOpen ? 'fa-chevron-up' : 'fa-chevron-down' })), this.isOpen && (h("div", { key: 'ea056a2ec8ef32dac0b12ab4f1b7e232dd3fc609', class: `spw-custom-select__options spw-custom-select__options--${this.dropdownDirection}` }, !!filteredOptions.length && (h("ul", { key: 'fee67a6f3e5f5d4c5d07c9b960f8e07b44974b77' }, filteredOptions.map((option, index) => (h("li", { class: {
|
|
369
404
|
'spw-custom-select__option': true,
|
|
370
405
|
'spw-custom-select__option--selected': this.multiple
|
|
371
406
|
? this.internalValue.some(val => String(val) === String(option.value))
|
|
372
407
|
: option.value === this.internalValue,
|
|
373
408
|
'spw-custom-select__option--focused': index === this.focusedOptionIndex,
|
|
374
|
-
|
|
409
|
+
'spw-custom-select__option--disabled': option.disabled,
|
|
410
|
+
}, onClick: () => this.selectOption(option.value) }, this.multiple && (h("spw-checkbox", { onKeyDown: event => this.handleOptionKeyDown(event, option.value), class: "spw-tw-mr-2", checked: this.internalValue.some(val => String(val) === String(option.value)), disabled: option.disabled })), option.label))))), !filteredOptions.length && h("p", { key: '31ea5a9e76b448f46bf2dc4009a64e575ad3ed85', class: "spw-custom-select__no-results" }, "Pas de r\u00E9sultats pour cette recherche.")))), this.renderErrorMessage(), this.renderHintMessage(), this.renderSuccessMessage(), this.renderWarningMessage()));
|
|
375
411
|
}
|
|
376
412
|
static get formAssociated() { return true; }
|
|
377
413
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"spw-custom-select.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,62NAA62N;;MCQ33NA,iBAAe,iBAAAC,kBAAA,CAAA,MAAA,eAAA,SAAAC,CAAA,CAAA;AAN5B,IAAA,WAAA,GAAA;;;;;;AAcW,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AACvB,QAAA,IAAa,CAAA,aAAA,GAAgD,EAAE;AAC/D,QAAA,IAAkB,CAAA,kBAAA,GAAkB,IAAI;AACxC,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AACvB,QAAA,IAAiB,CAAA,iBAAA,GAAkB,MAAM;AACzC,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK;;AAGF,QAAA,IAAK,CAAA,KAAA,GAA0C,EAAE;;AAEjF,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;;AAElB,QAAA,IAAW,CAAA,WAAA,GAAW,yBAAyB;;AAM/C,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAIzB,QAAA,IAAI,CAAA,IAAA,GAAuB,QAAQ;;AAEnC,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAEzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAIzB,QAAA,IAAK,CAAA,K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C,EACjE,KAAK,EAAC,aAAa,EACnB,OAAO,EAAG,IAAI,CAAC,aAAqC,CAAC,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAA,CACxF,CACjB,EACA,MAAM,CAAC,KAAK,CACV,CACN,CAAC,CACC,CACN,EACA,CAAC,eAAe,CAAC,MAAM,IAAI,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,+BAA+B,EAAA,EAAA,6CAAA,CAA2C,CAC3G,CACP,CACG,EACL,IAAI,CAAC,kBAAkB,EAAE,EACzB,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,CAAC,oBAAoB,EAAE,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SpwCustomSelect","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/spw-custom-select/spw-custom-select.scss?tag=spw-custom-select&encapsulation=shadow","src/components/spw-custom-select/spw-custom-select.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.spw-custom-select {\n position: relative;\n &__container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 40px;\n padding: 0 12px;\n line-height: 40px;\n border-radius: 4px;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n background-color: #fff;\n &:hover {\n outline: 4px solid var(--spw-color-themes-grey-grey-300);\n }\n &:focus-within,\n &:focus-visible {\n outline: 3px solid white;\n outline-offset: 0;\n box-shadow: 0 0 0 6px black;\n }\n .spw-custom-select--disabled & {\n border-color: var(--spw-color-themes-grey-grey-400);\n background: var(--spw-color-themes-grey-grey-100);\n color: var(--spw-color-themes-grey-grey-500);\n cursor: not-allowed;\n &::placeholder {\n color: var(--spw-color-themes-grey-grey-500);\n }\n &:hover,\n &:focus,\n &:focus-visible {\n outline: none;\n }\n }\n .spw-custom-select--is-error & {\n border-color: var(--spw-colors-states-error-error-300);\n }\n .spw-custom-select--large & {\n height: 60px;\n padding: 0 24px;\n line-height: 60px;\n }\n .spw-custom-select--is-opened & {\n height: auto;\n line-height: 1;\n min-height: 40px;\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n }\n }\n\n &__selected {\n flex: 1;\n padding-right: 30px;\n max-width: 100%;\n }\n\n &__selected-item {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n color: var(--spw-color-themes-grey-grey-900);\n border: 1px solid var(--spw-color-themes-grey-grey-900);\n background: var(--spw-color-themes-grey-grey-200);\n line-height: 24px;\n height: 24px;\n padding: 0 8px;\n margin: 4px 6px 2px 0;\n border-radius: 999px;\n font-size: 14px;\n user-select: none;\n }\n\n &__selected-items {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n .spw-custom-select--is-opened & {\n padding-top: 3px;\n padding-bottom: 4px;\n overflow: visible;\n text-overflow: initial;\n text-wrap: initial;\n }\n }\n\n &__arrow {\n position: absolute;\n right: 12px;\n top: 10px;\n font-size: 16px;\n color: var(--spw-color-themes-grey-grey-600);\n pointer-events: none;\n }\n\n &__wrapper {\n position: relative;\n }\n\n &__search {\n .spw-custom-select--is-opened & {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 11;\n width: 100%;\n margin-top: 1px;\n }\n .spw-custom-select--has-value.spw-custom-select--is-opened & {\n top: auto;\n top: 100%;\n margin-top: -3px;\n }\n &-input {\n padding: 0;\n height: 38px;\n line-height: 40px;\n border: none;\n margin: 0;\n width: calc(100% - 30px);\n text-overflow: ellipsis;\n &:focus {\n outline: none;\n }\n .spw-custom-select--is-opened & {\n border-left: 1px solid var(--spw-color-themes-grey-grey-800);\n padding: 0 12px;\n }\n .spw-custom-select--is-opened.spw-custom-select--has-value & {\n border-right: 1px solid var(--spw-color-themes-grey-grey-800);\n width: 100%;\n }\n }\n }\n\n &__options {\n position: absolute;\n width: 100%;\n background-color: #fff;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n border-radius: 0 0 4px 4px;\n max-height: 200px;\n overflow-y: auto;\n z-index: 12;\n\n &--down {\n top: 100%;\n transform: translateY(0);\n }\n\n &--up {\n top: 100%;\n transform: translateY(0);\n }\n\n .spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) & {\n margin-top: 35px;\n }\n }\n\n &__no-results {\n padding: 12px;\n cursor: not-allowed;\n color: var(--spw-color-themes-grey-grey-600);\n }\n\n &__option {\n border-bottom: 1px solid var(--spw-color-themes-grey-grey-900);\n padding: 12px;\n cursor: pointer;\n &:hover {\n background-color: var(--spw-color-themes-grey-grey-200);\n }\n &:last-child {\n border-bottom: none;\n }\n &--selected {\n font-weight: 700;\n }\n }\n\n &__error {\n display: block;\n font-size: 12px;\n color: var(--spw-color-themes-grey-grey-600);\n margin-top: 8px;\n }\n}\n\n.spw-custom-select__option--focused {\n background-color: var(--spw-color-themes-grey-grey-300);\n}\n","import { AttachInternals, Component, Method, Prop, State, Event, EventEmitter, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'spw-custom-select',\n styleUrl: 'spw-custom-select.scss',\n formAssociated: true,\n shadow: true,\n})\nexport class SpwCustomSelect {\n private host: HTMLElement;\n private selectContainer: HTMLElement;\n\n /** Événement émis lorsque la valeur sélectionnée change */\n @Event() valueChanged: EventEmitter<(string | number)[] | string | number>;\n\n @State() internalValue: (string | number)[] | string | number;\n @State() isOpen: boolean = false;\n @State() parsedOptions: { value: string | number; label: string }[] = [];\n @State() focusedOptionIndex: number | null = null;\n @State() searchText: string = '';\n @State() dropdownDirection: 'up' | 'down' = 'down';\n @State() hasSelectedValue: boolean = false;\n\n /** Valeur actuelle sélectionnée dans le composant, peut être une chaîne, un nombre ou un tableau */\n @Prop({ mutable: true, reflect: true }) value: (string | number)[] | string | number = [];\n /** Label associé au champ de sélection personnalisé */\n @Prop() label: string = '';\n /** Placeholder à afficher lorsque aucune option n'est sélectionnée */\n @Prop() placeholder: string = 'Sélectionnez une option';\n /** Indique si le champ est désactivé et donc non interactif */\n @Prop() disabled: boolean;\n /** Nom de l'élément dans les formulaires, utilisé pour associer la valeur */\n @Prop() name: string;\n /** Indique si la sélection est obligatoire dans le formulaire */\n @Prop() required: boolean = false;\n /** Chaîne JSON des options disponibles dans le select (valeur et label) */\n @Prop() items: string | any[];\n /** Taille du select, peut être \"large\" ou \"medium\" */\n @Prop() size: 'large' | 'medium' = 'medium';\n /** Permet la sélection multiple si vrai */\n @Prop() multiple: boolean = false;\n /** Active la fonction de recherche dans la liste des items */\n @Prop() isSearch: boolean = false;\n /** Texte d'assistance à afficher sous le champ */\n @Prop() assistiveText?: string;\n /** Message d'erreur à afficher sous le champ */\n @Prop() error?: string = '';\n /** Message d'indication (hint) à afficher sous le champ */\n @Prop() hint?: string = '';\n /** Message de succès à afficher sous le champ */\n @Prop() success?: string = '';\n /** Message de warning à afficher sous le champ */\n @Prop() warning?: string = '';\n /** Affiche une icône d'erreur si vrai */\n @Prop() showErrorIcon?: boolean = true;\n /** Affiche une icône d'indication si vrai */\n @Prop() showHintIcon?: boolean = true;\n /** Affiche une icône de succès si vrai */\n @Prop() showSuccessIcon?: boolean = true;\n /** Affiche une icône de warning si vrai */\n @Prop() showWarningIcon?: boolean = true;\n\n @AttachInternals() internals: ElementInternals;\n\n componentWillLoad() {\n if (this.multiple) {\n if (typeof this.value === 'string') {\n try {\n this.internalValue = JSON.parse(this.value);\n } catch (e) {\n this.internalValue = [];\n }\n } else if (Array.isArray(this.value)) {\n this.internalValue = this.value;\n } else {\n this.internalValue = [];\n }\n } else {\n this.internalValue = this.value as string | number;\n }\n\n if (this.items) {\n this.parseOptions(this.items);\n }\n this.updateSelectedOption();\n }\n\n @Method()\n async resetSelect() {\n if (this.multiple) {\n this.internalValue = [];\n this.value = [];\n } else {\n this.internalValue = '';\n this.value = '';\n }\n this.searchText = '';\n this.focusedOptionIndex = null;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n this.updateSelectedOption();\n }\n\n formResetCallback() {\n this.resetSelect();\n }\n\n componentDidLoad() {\n document.addEventListener('click', this.handleClickOutside);\n this.internals.setFormValue(this.getFormValue());\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.isOpen) {\n const target = event.composedPath()[0] as Node;\n const isInsideHost = this.host.contains(target);\n const searchField = this.host.shadowRoot?.querySelector('.spw-custom-select__search-input');\n\n const isInsideSearchField = searchField?.contains(target);\n\n if (!isInsideHost && !isInsideSearchField) {\n if (this.multiple) {\n const optionsContainer = this.host.shadowRoot?.querySelector('.spw-custom-select__options');\n if (optionsContainer && optionsContainer.contains(target)) {\n return;\n }\n }\n\n this.closeDropdown();\n }\n }\n };\n\n @Watch('items')\n parseOptions(newValue: string | any[]) {\n try {\n if (Array.isArray(newValue)) {\n this.parsedOptions = newValue.map(option => ({\n value: option.value,\n label: option.label,\n }));\n } else if (typeof newValue === 'string') {\n this.parsedOptions = JSON.parse(newValue).map(option => ({\n value: option.value,\n label: option.label,\n }));\n } else {\n this.parsedOptions = [];\n }\n this.updateSelectedOption();\n } catch (e) {\n this.parsedOptions = [];\n }\n }\n\n @Watch('value')\n valueChangedHandler(newValue: (string | number)[] | string | number) {\n if (this.multiple) {\n this.internalValue = Array.isArray(newValue) ? newValue : [newValue];\n } else {\n this.internalValue = newValue;\n }\n this.updateSelectedOption();\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n }\n\n private updateSelectedOption() {\n this.internals.setFormValue(this.getFormValue());\n\n if (!this.multiple && this.internalValue !== undefined) {\n this.focusedOptionIndex = this.parsedOptions.findIndex(option => String(option.value) === String(this.internalValue));\n } else if (this.multiple && Array.isArray(this.internalValue)) {\n this.internalValue = (this.internalValue as (string | number)[])\n .filter(val => this.parsedOptions.some(option => String(option.value) === String(val)))\n .sort((a, b) => this.parsedOptions.findIndex(option => String(option.value) === String(a)) - this.parsedOptions.findIndex(option => String(option.value) === String(b)));\n }\n }\n\n @Watch('internalValue')\n internalValueChanged() {\n this.hasSelectedValue = Array.isArray(this.internalValue) ? this.internalValue.length > 0 : Boolean(this.internalValue);\n }\n\n private getFormValue(): string | null {\n if (this.multiple) {\n return Array.isArray(this.internalValue) && this.internalValue.length > 0 ? this.internalValue.map(v => String(v)).join(',') : null;\n }\n return this.internalValue ? String(this.internalValue) : null;\n }\n\n private toggleDropdown(event?: MouseEvent) {\n if (!this.disabled) {\n if (event) {\n const target = event.composedPath()[0] as HTMLElement;\n\n if (target.classList.contains('spw-custom-select__search-input')) {\n return;\n }\n\n event.stopPropagation();\n }\n this.determineDropdownDirection();\n this.isOpen = !this.isOpen;\n if (!this.isOpen) {\n this.focusedOptionIndex = null;\n }\n }\n }\n\n private determineDropdownDirection() {\n const rect = this.selectContainer.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (rect.bottom + 200 > viewportHeight && rect.top > 200) {\n this.dropdownDirection = 'up';\n } else {\n this.dropdownDirection = 'down';\n }\n }\n\n private openDropdownWithKeyboard() {\n this.determineDropdownDirection();\n this.isOpen = true;\n this.focusedOptionIndex = 0;\n }\n\n private closeDropdown() {\n this.isOpen = false;\n this.focusedOptionIndex = null;\n this.searchText = '';\n }\n\n private selectOption(optionValue: string | number, event?: MouseEvent) {\n if (event) {\n event.stopPropagation();\n }\n\n if (this.multiple) {\n const index = (this.internalValue as (string | number)[]).findIndex(val => String(val) === String(optionValue));\n if (index > -1) {\n this.internalValue = [...(this.internalValue as (string | number)[]).slice(0, index), ...(this.internalValue as (string | number)[]).slice(index + 1)];\n } else {\n this.internalValue = [...(this.internalValue as (string | number)[]), optionValue];\n }\n this.internalValue = (this.internalValue as (string | number)[]).sort(\n (a, b) => this.parsedOptions.findIndex(option => String(option.value) === String(a)) - this.parsedOptions.findIndex(option => String(option.value) === String(b)),\n );\n } else {\n this.internalValue = optionValue;\n this.closeDropdown();\n }\n\n this.value = this.internalValue;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n this.updateSelectedOption();\n }\n\n private handleOptionKeyDown(event: KeyboardEvent, optionValue: string | number) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(optionValue);\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if ((event.target as HTMLElement).classList.contains('spw-custom-select__search-input')) {\n return;\n }\n switch (event.key) {\n case ' ':\n event.preventDefault();\n if (!this.isOpen) {\n this.openDropdownWithKeyboard();\n }\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.isOpen) {\n this.focusedOptionIndex = this.focusedOptionIndex === null ? 0 : (this.focusedOptionIndex + 1) % this.parsedOptions.length;\n } else {\n this.openDropdownWithKeyboard();\n }\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.isOpen) {\n this.focusedOptionIndex =\n this.focusedOptionIndex === null ? this.parsedOptions.length - 1 : (this.focusedOptionIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (this.isOpen && this.focusedOptionIndex !== null) {\n this.selectOption(this.parsedOptions[this.focusedOptionIndex].value);\n }\n break;\n case 'Escape':\n if (this.isOpen) {\n this.closeDropdown();\n }\n break;\n }\n }\n\n private renderErrorMessage() {\n if (this.error) {\n return (\n <spw-field-message variant=\"error\" showIcon={this.showErrorIcon}>\n {this.error}\n </spw-field-message>\n );\n }\n }\n\n private renderHintMessage() {\n if (this.hint) {\n return (\n <spw-field-message variant=\"hint\" showIcon={this.showHintIcon}>\n {this.hint}\n </spw-field-message>\n );\n }\n }\n\n private renderWarningMessage() {\n if (this.warning) {\n return (\n <spw-field-message variant=\"warning\" showIcon={this.showWarningIcon}>\n {this.warning}\n </spw-field-message>\n );\n }\n }\n\n private renderSuccessMessage() {\n if (this.success) {\n return (\n <spw-field-message variant=\"success\" showIcon={this.showSuccessIcon}>\n {this.success}\n </spw-field-message>\n );\n }\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-custom-select': true,\n [`spw-custom-select--${this.size}`]: true,\n 'spw-custom-select--is-error': !!this.error,\n 'spw-custom-select--disabled': this.disabled,\n 'spw-custom-select--is-opened': this.isOpen,\n 'spw-custom-select--has-value': this.hasSelectedValue,\n 'spw-custom-select--no-value': !this.hasSelectedValue,\n 'spw-custom-select--is-searchable': this.isSearch,\n 'spw-custom-select--not-searchable': !this.isSearch,\n };\n }\n\n private normalizeString(str: string): string {\n return str\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase();\n }\n\n private getSelectedLabels(): string {\n if (this.multiple) {\n return Array.isArray(this.internalValue) && this.internalValue.length > 0\n ? (this.internalValue as (string | number)[])\n .map(val => this.parsedOptions.find(option => String(option.value) === String(val))?.label)\n .filter(Boolean)\n .join(', ')\n : null;\n } else {\n const selectedOption = this.parsedOptions.find(option => String(option.value) === String(this.internalValue));\n return selectedOption ? selectedOption.label : null;\n }\n }\n\n private getFilteredOptions() {\n const normalizedSearchText = this.normalizeString(this.searchText);\n return this.parsedOptions.filter(option => this.normalizeString(option.label).includes(normalizedSearchText));\n }\n\n private handleSearchInput(event: Event) {\n const input = event.target as HTMLInputElement;\n this.searchText = input.value;\n this.focusedOptionIndex = 0;\n\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n private isSearchVisible(): boolean {\n if (!this.isSearch) return false;\n if (!this.hasSelectedValue && !this.isOpen) return true;\n if (this.isSearch && this.isOpen) return true;\n return this.isOpen;\n }\n\n private showPlaceholder(): boolean {\n if (this.isSearch) return false;\n if (this.hasSelectedValue) return false;\n return true;\n }\n\n render() {\n const filteredOptions = this.getFilteredOptions();\n const showPlaceholder = this.showPlaceholder();\n\n return (\n <div class={this.elementClass} ref={el => (this.host = el as HTMLElement)}>\n {this.label && <spw-field-label label={this.label} name={this.name} required={this.required}></spw-field-label>}\n {this.assistiveText && (\n <spw-field-message class=\"spw-tw-mb-2 -spw-tw-mt-1\" variant=\"hint\" showIcon={false}>\n {this.assistiveText}\n </spw-field-message>\n )}\n <div class=\"spw-custom-select__wrapper\">\n <div\n class=\"spw-custom-select__container\"\n id={this.name}\n ref={el => (this.selectContainer = el as HTMLElement)}\n onClick={event => this.toggleDropdown(event)}\n onKeyDown={event => this.handleKeyDown(event)}\n tabindex={this.disabled ? -1 : 0}\n >\n <div class=\"spw-custom-select__selected\">\n {this.isSearchVisible() && (\n <div class=\"spw-custom-select__search\">\n <input class=\"spw-custom-select__search-input\" placeholder=\"Entrez votre recherche\" onInput={event => this.handleSearchInput(event)} value={this.searchText} />\n </div>\n )}\n {showPlaceholder && <span>{this.placeholder}</span>}\n {this.multiple && (this.internalValue as (string | number)[]).length > 0 && (\n <div class=\"spw-custom-select__selected-items\">\n {(this.internalValue as (string | number)[]).map(val => (\n <span class=\"spw-custom-select__selected-item\">\n {this.parsedOptions.find(option => String(option.value) === String(val))?.label}\n <spw-icon icon=\"fa-times\" class=\"spw-custom-select__deselect-icon\" onClick={event => this.selectOption(val, event)}></spw-icon>\n </span>\n ))}\n </div>\n )}\n {!this.multiple && <span>{this.getSelectedLabels()}</span>}\n </div>\n </div>\n <div class=\"spw-custom-select__arrow\">\n <spw-icon icon={this.isOpen ? 'fa-chevron-up' : 'fa-chevron-down'}></spw-icon>\n </div>\n {this.isOpen && (\n <div class={`spw-custom-select__options spw-custom-select__options--${this.dropdownDirection}`}>\n {!!filteredOptions.length && (\n <ul>\n {filteredOptions.map((option, index) => (\n <li\n class={{\n 'spw-custom-select__option': true,\n 'spw-custom-select__option--selected': this.multiple\n ? (this.internalValue as (string | number)[]).some(val => String(val) === String(option.value))\n : option.value === this.internalValue,\n 'spw-custom-select__option--focused': index === this.focusedOptionIndex,\n }}\n onClick={() => this.selectOption(option.value)}\n >\n {this.multiple && (\n <spw-checkbox\n onKeyDown={event => this.handleOptionKeyDown(event, option.value)}\n class=\"spw-tw-mr-2\"\n checked={(this.internalValue as (string | number)[]).some(val => String(val) === String(option.value))}\n ></spw-checkbox>\n )}\n {option.label}\n </li>\n ))}\n </ul>\n )}\n {!filteredOptions.length && <p class=\"spw-custom-select__no-results\">Pas de résultats pour cette recherche.</p>}\n </div>\n )}\n </div>\n {this.renderErrorMessage()}\n {this.renderHintMessage()}\n {this.renderSuccessMessage()}\n {this.renderWarningMessage()}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"spw-custom-select.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,4gOAA4gO;;MCQ1hOA,iBAAe,iBAAAC,kBAAA,CAAA,MAAA,eAAA,SAAAC,CAAA,CAAA;AAN5B,IAAA,WAAA,GAAA;;;;;;AAcW,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AACvB,QAAA,IAAa,CAAA,aAAA,GAAoE,EAAE;AACnF,QAAA,IAAkB,CAAA,kBAAA,GAAkB,IAAI;AACxC,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AACvB,QAAA,IAAiB,CAAA,iBAAA,GAAkB,MAAM;AACzC,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK;;AAGF,QAAA,IAAK,CAAA,KAAA,GAA0C,EAAE;;AAEjF,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;;AAElB,QAAA,IAAW,CAAA,WAAA,GAAW,yBAAyB;;AAM/C,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAIzB,QAAA,IAAI,CAAA,IAAA,GAAuB,QAAQ;;AAEnC,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAEzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAIzB,QAAA,IAAK,CAAA,KAAA,GAAY,EAAE;;AAEnB,QAAA,IAAI,CAAA,IAAA,GAAY,EAAE;;AAElB,QAAA,IAAO,CAAA,OAAA,GAAY,EAAE;;AAErB,QAAA,IAAO,CAAA,OAAA,GAAY,EAAE;;AAEr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","HTMLElement"],"sources":["src/components/spw-custom-select/spw-custom-select.scss?tag=spw-custom-select&encapsulation=shadow","src/components/spw-custom-select/spw-custom-select.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.spw-custom-select {\n position: relative;\n &__container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 40px;\n padding: 0 12px;\n line-height: 40px;\n border-radius: 4px;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n background-color: #fff;\n &:hover {\n outline: 4px solid var(--spw-color-themes-grey-grey-300);\n }\n &:focus-within,\n &:focus-visible {\n outline: 3px solid white;\n outline-offset: 0;\n box-shadow: 0 0 0 6px black;\n }\n .spw-custom-select--disabled & {\n border-color: var(--spw-color-themes-grey-grey-400);\n background: var(--spw-color-themes-grey-grey-100);\n color: var(--spw-color-themes-grey-grey-500);\n cursor: not-allowed;\n &::placeholder {\n color: var(--spw-color-themes-grey-grey-500);\n }\n &:hover,\n &:focus,\n &:focus-visible {\n outline: none;\n }\n }\n .spw-custom-select--is-error & {\n border-color: var(--spw-colors-states-error-error-300);\n }\n .spw-custom-select--large & {\n height: 60px;\n padding: 0 24px;\n line-height: 60px;\n }\n .spw-custom-select--is-opened & {\n height: auto;\n line-height: 1;\n min-height: 40px;\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n }\n }\n\n &__selected {\n flex: 1;\n padding-right: 30px;\n max-width: 100%;\n }\n\n &__selected-item {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n color: var(--spw-color-themes-grey-grey-900);\n border: 1px solid var(--spw-color-themes-grey-grey-900);\n background: var(--spw-color-themes-grey-grey-200);\n line-height: 24px;\n height: 24px;\n padding: 0 8px;\n margin: 4px 6px 2px 0;\n border-radius: 999px;\n font-size: 14px;\n user-select: none;\n }\n\n &__selected-items {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n .spw-custom-select--is-opened & {\n padding-top: 3px;\n padding-bottom: 4px;\n overflow: visible;\n text-overflow: initial;\n text-wrap: initial;\n }\n }\n\n &__arrow {\n position: absolute;\n right: 12px;\n top: 10px;\n font-size: 16px;\n color: var(--spw-color-themes-grey-grey-600);\n pointer-events: none;\n }\n\n &__wrapper {\n position: relative;\n }\n\n &__search {\n .spw-custom-select--is-opened & {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 11;\n width: 100%;\n margin-top: 1px;\n }\n .spw-custom-select--has-value.spw-custom-select--is-opened & {\n top: auto;\n top: 100%;\n margin-top: -3px;\n }\n &-input {\n padding: 0;\n height: 38px;\n line-height: 40px;\n border: none;\n margin: 0;\n width: calc(100% - 30px);\n text-overflow: ellipsis;\n &:focus {\n outline: none;\n }\n .spw-custom-select--is-opened & {\n border-left: 1px solid var(--spw-color-themes-grey-grey-800);\n padding: 0 12px;\n }\n .spw-custom-select--is-opened.spw-custom-select--has-value & {\n border-right: 1px solid var(--spw-color-themes-grey-grey-800);\n width: 100%;\n }\n }\n }\n\n &__options {\n position: absolute;\n width: 100%;\n background-color: #fff;\n border: 1px solid var(--spw-color-themes-grey-grey-800);\n border-radius: 0 0 4px 4px;\n max-height: 200px;\n overflow-y: auto;\n z-index: 12;\n\n &--down {\n top: 100%;\n transform: translateY(0);\n }\n\n &--up {\n top: 100%;\n transform: translateY(0);\n }\n\n .spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) & {\n margin-top: 35px;\n }\n }\n\n &__no-results {\n padding: 12px;\n cursor: not-allowed;\n color: var(--spw-color-themes-grey-grey-600);\n }\n\n &__option {\n border-bottom: 1px solid var(--spw-color-themes-grey-grey-900);\n padding: 12px;\n cursor: pointer;\n &:hover {\n background-color: var(--spw-color-themes-grey-grey-200);\n }\n &:last-child {\n border-bottom: none;\n }\n &--selected {\n font-weight: 700;\n }\n &--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n &:hover {\n background-color: transparent;\n }\n }\n }\n\n &__error {\n display: block;\n font-size: 12px;\n color: var(--spw-color-themes-grey-grey-600);\n margin-top: 8px;\n }\n}\n\n.spw-custom-select__option--focused {\n background-color: var(--spw-color-themes-grey-grey-300);\n}\n","import { AttachInternals, Component, Method, Prop, State, Event, EventEmitter, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'spw-custom-select',\n styleUrl: 'spw-custom-select.scss',\n formAssociated: true,\n shadow: true,\n})\nexport class SpwCustomSelect {\n private host: HTMLElement;\n private selectContainer: HTMLElement;\n\n /** Événement émis lorsque la valeur sélectionnée change */\n @Event() valueChanged: EventEmitter<(string | number)[] | string | number>;\n\n @State() internalValue: (string | number)[] | string | number;\n @State() isOpen: boolean = false;\n @State() parsedOptions: { value: string | number; label: string; disabled?: boolean }[] = [];\n @State() focusedOptionIndex: number | null = null;\n @State() searchText: string = '';\n @State() dropdownDirection: 'up' | 'down' = 'down';\n @State() hasSelectedValue: boolean = false;\n\n /** Valeur actuelle sélectionnée dans le composant, peut être une chaîne, un nombre ou un tableau */\n @Prop({ mutable: true, reflect: true }) value: (string | number)[] | string | number = [];\n /** Label associé au champ de sélection personnalisé */\n @Prop() label: string = '';\n /** Placeholder à afficher lorsque aucune option n'est sélectionnée */\n @Prop() placeholder: string = 'Sélectionnez une option';\n /** Indique si le champ est désactivé et donc non interactif */\n @Prop() disabled: boolean;\n /** Nom de l'élément dans les formulaires, utilisé pour associer la valeur */\n @Prop() name: string;\n /** Indique si la sélection est obligatoire dans le formulaire */\n @Prop() required: boolean = false;\n /** Chaîne JSON des options disponibles dans le select (valeur et label) */\n @Prop() items: string | any[];\n /** Taille du select, peut être \"large\" ou \"medium\" */\n @Prop() size: 'large' | 'medium' = 'medium';\n /** Permet la sélection multiple si vrai */\n @Prop() multiple: boolean = false;\n /** Active la fonction de recherche dans la liste des items */\n @Prop() isSearch: boolean = false;\n /** Texte d'assistance à afficher sous le champ */\n @Prop() assistiveText?: string;\n /** Message d'erreur à afficher sous le champ */\n @Prop() error?: string = '';\n /** Message d'indication (hint) à afficher sous le champ */\n @Prop() hint?: string = '';\n /** Message de succès à afficher sous le champ */\n @Prop() success?: string = '';\n /** Message de warning à afficher sous le champ */\n @Prop() warning?: string = '';\n /** Affiche une icône d'erreur si vrai */\n @Prop() showErrorIcon?: boolean = true;\n /** Affiche une icône d'indication si vrai */\n @Prop() showHintIcon?: boolean = true;\n /** Affiche une icône de succès si vrai */\n @Prop() showSuccessIcon?: boolean = true;\n /** Affiche une icône de warning si vrai */\n @Prop() showWarningIcon?: boolean = true;\n\n @AttachInternals() internals: ElementInternals;\n\n componentWillLoad() {\n if (this.multiple) {\n if (typeof this.value === 'string') {\n try {\n this.internalValue = JSON.parse(this.value);\n } catch (e) {\n this.internalValue = [];\n }\n } else if (Array.isArray(this.value)) {\n this.internalValue = this.value;\n } else {\n this.internalValue = [];\n }\n } else {\n this.internalValue = this.value as string | number;\n }\n\n if (this.items) {\n this.parseOptions(this.items);\n }\n this.updateSelectedOption();\n }\n\n @Method()\n async resetSelect() {\n if (this.multiple) {\n this.internalValue = [];\n this.value = [];\n } else {\n this.internalValue = '';\n this.value = '';\n }\n this.searchText = '';\n this.focusedOptionIndex = null;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n this.updateSelectedOption();\n }\n\n formResetCallback() {\n this.resetSelect();\n }\n\n componentDidLoad() {\n document.addEventListener('click', this.handleClickOutside);\n document.addEventListener('spw-custom-select-opened', this.handleOtherSelectOpened);\n this.internals.setFormValue(this.getFormValue());\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside);\n document.removeEventListener('spw-custom-select-opened', this.handleOtherSelectOpened);\n }\n\n private handleOtherSelectOpened = (event: CustomEvent) => {\n if (event.detail.instance !== this.host && this.isOpen) {\n this.closeDropdown();\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.isOpen) {\n const target = event.composedPath()[0] as Node;\n const isInsideHost = this.host.contains(target);\n const searchField = this.host.shadowRoot?.querySelector('.spw-custom-select__search-input');\n\n const isInsideSearchField = searchField?.contains(target);\n\n if (!isInsideHost && !isInsideSearchField) {\n if (this.multiple) {\n const optionsContainer = this.host.shadowRoot?.querySelector('.spw-custom-select__options');\n if (optionsContainer && optionsContainer.contains(target)) {\n return;\n }\n }\n\n this.closeDropdown();\n }\n }\n };\n\n @Watch('items')\n parseOptions(newValue: string | any[]) {\n try {\n if (Array.isArray(newValue)) {\n this.parsedOptions = newValue.map(option => ({\n value: option.value,\n label: option.label,\n disabled: option.disabled || false,\n }));\n } else if (typeof newValue === 'string') {\n this.parsedOptions = JSON.parse(newValue).map(option => ({\n value: option.value,\n label: option.label,\n disabled: option.disabled || false,\n }));\n } else {\n this.parsedOptions = [];\n }\n this.updateSelectedOption();\n } catch (e) {\n this.parsedOptions = [];\n }\n }\n\n @Watch('value')\n valueChangedHandler(newValue: (string | number)[] | string | number) {\n if (this.multiple) {\n this.internalValue = Array.isArray(newValue) ? newValue : [newValue];\n } else {\n this.internalValue = newValue;\n }\n this.updateSelectedOption();\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n }\n\n private updateSelectedOption() {\n this.internals.setFormValue(this.getFormValue());\n\n if (!this.multiple && this.internalValue !== undefined) {\n this.focusedOptionIndex = this.parsedOptions.findIndex(option => String(option.value) === String(this.internalValue));\n } else if (this.multiple && Array.isArray(this.internalValue)) {\n this.internalValue = (this.internalValue as (string | number)[])\n .filter(val => this.parsedOptions.some(option => String(option.value) === String(val)))\n .sort((a, b) => this.parsedOptions.findIndex(option => String(option.value) === String(a)) - this.parsedOptions.findIndex(option => String(option.value) === String(b)));\n }\n }\n\n @Watch('internalValue')\n internalValueChanged() {\n this.hasSelectedValue = Array.isArray(this.internalValue) ? this.internalValue.length > 0 : Boolean(this.internalValue);\n }\n\n private getFormValue(): string | null {\n if (this.multiple) {\n return Array.isArray(this.internalValue) && this.internalValue.length > 0 ? this.internalValue.map(v => String(v)).join(',') : null;\n }\n return this.internalValue ? String(this.internalValue) : null;\n }\n\n private toggleDropdown(event?: MouseEvent) {\n if (!this.disabled) {\n if (event) {\n const target = event.composedPath()[0] as HTMLElement;\n\n if (target.classList.contains('spw-custom-select__search-input')) {\n return;\n }\n\n event.stopPropagation();\n }\n this.determineDropdownDirection();\n const wasOpen = this.isOpen;\n this.isOpen = !this.isOpen;\n\n if (this.isOpen && !wasOpen) {\n this.notifyOtherSelects();\n }\n\n if (!this.isOpen) {\n this.focusedOptionIndex = null;\n }\n }\n }\n\n private notifyOtherSelects() {\n const event = new CustomEvent('spw-custom-select-opened', {\n detail: { instance: this.host },\n bubbles: true,\n composed: true\n });\n document.dispatchEvent(event);\n }\n\n private determineDropdownDirection() {\n const rect = this.selectContainer.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (rect.bottom + 200 > viewportHeight && rect.top > 200) {\n this.dropdownDirection = 'up';\n } else {\n this.dropdownDirection = 'down';\n }\n }\n\n private openDropdownWithKeyboard() {\n this.determineDropdownDirection();\n this.isOpen = true;\n this.focusedOptionIndex = 0;\n this.notifyOtherSelects();\n }\n\n private closeDropdown() {\n this.isOpen = false;\n this.focusedOptionIndex = null;\n this.searchText = '';\n }\n\n private selectOption(optionValue: string | number, event?: MouseEvent) {\n if (event) {\n event.stopPropagation();\n }\n\n const option = this.parsedOptions.find(opt => String(opt.value) === String(optionValue));\n if (option?.disabled) {\n return;\n }\n\n if (this.multiple) {\n const index = (this.internalValue as (string | number)[]).findIndex(val => String(val) === String(optionValue));\n if (index > -1) {\n this.internalValue = [...(this.internalValue as (string | number)[]).slice(0, index), ...(this.internalValue as (string | number)[]).slice(index + 1)];\n } else {\n this.internalValue = [...(this.internalValue as (string | number)[]), optionValue];\n }\n this.internalValue = (this.internalValue as (string | number)[]).sort(\n (a, b) => this.parsedOptions.findIndex(option => String(option.value) === String(a)) - this.parsedOptions.findIndex(option => String(option.value) === String(b)),\n );\n } else {\n this.internalValue = optionValue;\n this.closeDropdown();\n }\n\n this.value = this.internalValue;\n this.internals.setFormValue(this.getFormValue());\n this.valueChanged.emit(this.internalValue);\n this.updateSelectedOption();\n }\n\n private handleOptionKeyDown(event: KeyboardEvent, optionValue: string | number) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(optionValue);\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if ((event.target as HTMLElement).classList.contains('spw-custom-select__search-input')) {\n return;\n }\n switch (event.key) {\n case ' ':\n event.preventDefault();\n if (!this.isOpen) {\n this.openDropdownWithKeyboard();\n }\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.isOpen) {\n let nextIndex = this.focusedOptionIndex === null ? 0 : (this.focusedOptionIndex + 1) % this.parsedOptions.length;\n while (this.parsedOptions[nextIndex]?.disabled && nextIndex !== this.focusedOptionIndex) {\n nextIndex = (nextIndex + 1) % this.parsedOptions.length;\n }\n this.focusedOptionIndex = nextIndex;\n } else {\n this.openDropdownWithKeyboard();\n }\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.isOpen) {\n let prevIndex = this.focusedOptionIndex === null ? this.parsedOptions.length - 1 : (this.focusedOptionIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;\n while (this.parsedOptions[prevIndex]?.disabled && prevIndex !== this.focusedOptionIndex) {\n prevIndex = (prevIndex - 1 + this.parsedOptions.length) % this.parsedOptions.length;\n }\n this.focusedOptionIndex = prevIndex;\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (this.isOpen && this.focusedOptionIndex !== null) {\n this.selectOption(this.parsedOptions[this.focusedOptionIndex].value);\n }\n break;\n case 'Escape':\n if (this.isOpen) {\n this.closeDropdown();\n }\n break;\n }\n }\n\n private renderErrorMessage() {\n if (this.error) {\n return (\n <spw-field-message variant=\"error\" showIcon={this.showErrorIcon}>\n {this.error}\n </spw-field-message>\n );\n }\n }\n\n private renderHintMessage() {\n if (this.hint) {\n return (\n <spw-field-message variant=\"hint\" showIcon={this.showHintIcon}>\n {this.hint}\n </spw-field-message>\n );\n }\n }\n\n private renderWarningMessage() {\n if (this.warning) {\n return (\n <spw-field-message variant=\"warning\" showIcon={this.showWarningIcon}>\n {this.warning}\n </spw-field-message>\n );\n }\n }\n\n private renderSuccessMessage() {\n if (this.success) {\n return (\n <spw-field-message variant=\"success\" showIcon={this.showSuccessIcon}>\n {this.success}\n </spw-field-message>\n );\n }\n }\n\n private get elementClass(): { [className: string]: boolean } {\n return {\n 'spw-custom-select': true,\n [`spw-custom-select--${this.size}`]: true,\n 'spw-custom-select--is-error': !!this.error,\n 'spw-custom-select--disabled': this.disabled,\n 'spw-custom-select--is-opened': this.isOpen,\n 'spw-custom-select--has-value': this.hasSelectedValue,\n 'spw-custom-select--no-value': !this.hasSelectedValue,\n 'spw-custom-select--is-searchable': this.isSearch,\n 'spw-custom-select--not-searchable': !this.isSearch,\n };\n }\n\n private normalizeString(str: string): string {\n return str\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase();\n }\n\n private getSelectedLabels(): string {\n if (this.multiple) {\n return Array.isArray(this.internalValue) && this.internalValue.length > 0\n ? (this.internalValue as (string | number)[])\n .map(val => this.parsedOptions.find(option => String(option.value) === String(val))?.label)\n .filter(Boolean)\n .join(', ')\n : null;\n } else {\n const selectedOption = this.parsedOptions.find(option => String(option.value) === String(this.internalValue));\n return selectedOption ? selectedOption.label : null;\n }\n }\n\n private getFilteredOptions() {\n const normalizedSearchText = this.normalizeString(this.searchText);\n return this.parsedOptions.filter(option => this.normalizeString(option.label).includes(normalizedSearchText));\n }\n\n private handleSearchInput(event: Event) {\n const input = event.target as HTMLInputElement;\n this.searchText = input.value;\n this.focusedOptionIndex = 0;\n\n if (!this.isOpen) {\n this.isOpen = true;\n this.notifyOtherSelects();\n }\n }\n\n private isSearchVisible(): boolean {\n if (!this.isSearch) return false;\n if (!this.hasSelectedValue && !this.isOpen) return true;\n if (this.isSearch && this.isOpen) return true;\n return this.isOpen;\n }\n\n private showPlaceholder(): boolean {\n if (this.isSearch) return false;\n if (this.hasSelectedValue) return false;\n return true;\n }\n\n render() {\n const filteredOptions = this.getFilteredOptions();\n const showPlaceholder = this.showPlaceholder();\n\n return (\n <div class={this.elementClass} ref={el => (this.host = el as HTMLElement)}>\n {this.label && <spw-field-label label={this.label} name={this.name} required={this.required}></spw-field-label>}\n {this.assistiveText && (\n <spw-field-message class=\"spw-tw-mb-2 -spw-tw-mt-1\" variant=\"hint\" showIcon={false}>\n {this.assistiveText}\n </spw-field-message>\n )}\n <div class=\"spw-custom-select__wrapper\">\n <div\n class=\"spw-custom-select__container\"\n id={this.name}\n ref={el => (this.selectContainer = el as HTMLElement)}\n onClick={event => this.toggleDropdown(event)}\n onKeyDown={event => this.handleKeyDown(event)}\n tabindex={this.disabled ? -1 : 0}\n >\n <div class=\"spw-custom-select__selected\">\n {this.isSearchVisible() && (\n <div class=\"spw-custom-select__search\">\n <input class=\"spw-custom-select__search-input\" placeholder=\"Entrez votre recherche\" onInput={event => this.handleSearchInput(event)} value={this.searchText} />\n </div>\n )}\n {showPlaceholder && <span>{this.placeholder}</span>}\n {this.multiple && (this.internalValue as (string | number)[]).length > 0 && (\n <div class=\"spw-custom-select__selected-items\">\n {(this.internalValue as (string | number)[]).map(val => (\n <span class=\"spw-custom-select__selected-item\">\n {this.parsedOptions.find(option => String(option.value) === String(val))?.label}\n <spw-icon icon=\"fa-times\" class=\"spw-custom-select__deselect-icon\" onClick={event => this.selectOption(val, event)}></spw-icon>\n </span>\n ))}\n </div>\n )}\n {!this.multiple && <span>{this.getSelectedLabels()}</span>}\n </div>\n </div>\n <div class=\"spw-custom-select__arrow\">\n <spw-icon icon={this.isOpen ? 'fa-chevron-up' : 'fa-chevron-down'}></spw-icon>\n </div>\n {this.isOpen && (\n <div class={`spw-custom-select__options spw-custom-select__options--${this.dropdownDirection}`}>\n {!!filteredOptions.length && (\n <ul>\n {filteredOptions.map((option, index) => (\n <li\n class={{\n 'spw-custom-select__option': true,\n 'spw-custom-select__option--selected': this.multiple\n ? (this.internalValue as (string | number)[]).some(val => String(val) === String(option.value))\n : option.value === this.internalValue,\n 'spw-custom-select__option--focused': index === this.focusedOptionIndex,\n 'spw-custom-select__option--disabled': option.disabled,\n }}\n onClick={() => this.selectOption(option.value)}\n >\n {this.multiple && (\n <spw-checkbox\n onKeyDown={event => this.handleOptionKeyDown(event, option.value)}\n class=\"spw-tw-mr-2\"\n checked={(this.internalValue as (string | number)[]).some(val => String(val) === String(option.value))}\n disabled={option.disabled}\n ></spw-checkbox>\n )}\n {option.label}\n </li>\n ))}\n </ul>\n )}\n {!filteredOptions.length && <p class=\"spw-custom-select__no-results\">Pas de résultats pour cette recherche.</p>}\n </div>\n )}\n </div>\n {this.renderErrorMessage()}\n {this.renderHintMessage()}\n {this.renderSuccessMessage()}\n {this.renderWarningMessage()}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -131,8 +131,23 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
131
131
|
this.handleMaskedInput(event);
|
|
132
132
|
};
|
|
133
133
|
this.handleInputFocus = () => {
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (this.disabled)
|
|
135
|
+
return;
|
|
136
|
+
if (!this.datepickerInstance) {
|
|
137
|
+
this.initializeDatepicker();
|
|
138
|
+
}
|
|
139
|
+
if (this.datepickerInstance && typeof this.datepickerInstance.show === 'function') {
|
|
140
|
+
try {
|
|
141
|
+
this.datepickerInstance.show();
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
console.warn("Erreur lors de l'ouverture du datepicker, réinitialisation...", error);
|
|
145
|
+
this.datepickerInstance = null;
|
|
146
|
+
this.initializeDatepicker();
|
|
147
|
+
if (this.datepickerInstance && typeof this.datepickerInstance.show === 'function') {
|
|
148
|
+
this.datepickerInstance.show();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
136
151
|
}
|
|
137
152
|
};
|
|
138
153
|
this.handleKeyDown = (ev) => {
|
|
@@ -207,21 +222,36 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
207
222
|
this.internalValue = start;
|
|
208
223
|
this.lastInputValue = this.internalValue;
|
|
209
224
|
}
|
|
225
|
+
connectedCallback() {
|
|
226
|
+
if (!this.datepickerInstance && this.inputElement) {
|
|
227
|
+
requestAnimationFrame(() => {
|
|
228
|
+
this.initializeDatepicker();
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
210
232
|
componentDidLoad() {
|
|
233
|
+
var _a;
|
|
211
234
|
this.initializeDatepicker();
|
|
212
235
|
if (this.value) {
|
|
213
236
|
const initialDate = new Date(this.value);
|
|
214
237
|
if (!isNaN(initialDate.getTime())) {
|
|
215
|
-
this.datepickerInstance.setDate(initialDate, true);
|
|
216
|
-
this.inputElement
|
|
217
|
-
|
|
238
|
+
(_a = this.datepickerInstance) === null || _a === void 0 ? void 0 : _a.setDate(initialDate, true);
|
|
239
|
+
if (this.inputElement) {
|
|
240
|
+
this.inputElement.value = this.formatDate(initialDate);
|
|
241
|
+
this.internalValue = this.formatDate(initialDate);
|
|
242
|
+
}
|
|
218
243
|
}
|
|
219
244
|
}
|
|
220
245
|
this.internals.setFormValue(this.value ? this.value : null);
|
|
221
246
|
}
|
|
222
247
|
disconnectedCallback() {
|
|
223
248
|
if (this.datepickerInstance && typeof this.datepickerInstance.remove === 'function') {
|
|
224
|
-
|
|
249
|
+
setTimeout(() => {
|
|
250
|
+
if (!this.el.isConnected && this.datepickerInstance) {
|
|
251
|
+
this.datepickerInstance.remove();
|
|
252
|
+
this.datepickerInstance = null;
|
|
253
|
+
}
|
|
254
|
+
}, 100);
|
|
225
255
|
}
|
|
226
256
|
}
|
|
227
257
|
watchValue(newValue) {
|
|
@@ -352,7 +382,6 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
352
382
|
let start = null;
|
|
353
383
|
let end = null;
|
|
354
384
|
siblings.forEach(pickerEl => {
|
|
355
|
-
// Accéder à l'attribut HTML pour déterminer si c'est le début ou la fin
|
|
356
385
|
if (pickerEl.hasAttribute('is-start')) {
|
|
357
386
|
start = pickerEl;
|
|
358
387
|
}
|
|
@@ -372,7 +401,6 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
372
401
|
const startValue = start.value;
|
|
373
402
|
const endValue = end.value;
|
|
374
403
|
if (!startValue || !endValue) {
|
|
375
|
-
// Pas de range complet, supprimer le highlighting
|
|
376
404
|
const allDates = this.datepickerInstance.calendar.querySelectorAll('.qs-square');
|
|
377
405
|
allDates.forEach((dateEl) => {
|
|
378
406
|
dateEl.classList.remove('spw-date-range-start', 'spw-date-range-end', 'spw-date-range-middle');
|
|
@@ -383,34 +411,27 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
383
411
|
const endDate = new Date(endValue);
|
|
384
412
|
if (isNaN(startDate.getTime()) || isNaN(endDate.getTime()))
|
|
385
413
|
return;
|
|
386
|
-
// Highlighter les dates dans le range
|
|
387
414
|
const allDates = this.datepickerInstance.calendar.querySelectorAll('.qs-square:not(.qs-empty)');
|
|
388
415
|
allDates.forEach((dateEl) => {
|
|
389
416
|
const dateNum = parseInt(dateEl.textContent || '0', 10);
|
|
390
417
|
if (!dateNum)
|
|
391
418
|
return;
|
|
392
|
-
// Récupérer le mois/année actuellement affiché
|
|
393
419
|
const currentMonth = this.datepickerInstance.currentMonth;
|
|
394
420
|
const currentYear = this.datepickerInstance.currentYear;
|
|
395
421
|
const cellDate = new Date(currentYear, currentMonth, dateNum);
|
|
396
|
-
// Normaliser les dates pour comparer uniquement jour/mois/année (sans heures)
|
|
397
422
|
const cellDateOnly = new Date(cellDate.getFullYear(), cellDate.getMonth(), cellDate.getDate());
|
|
398
423
|
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
|
|
399
424
|
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
|
400
|
-
// Vérifier si cette date est dans le range
|
|
401
425
|
if (cellDateOnly >= startDateOnly && cellDateOnly <= endDateOnly) {
|
|
402
426
|
if (cellDateOnly.getTime() === startDateOnly.getTime()) {
|
|
403
|
-
// Date de début
|
|
404
427
|
dateEl.classList.add('spw-date-range-start');
|
|
405
428
|
dateEl.classList.remove('spw-date-range-middle', 'spw-date-range-end');
|
|
406
429
|
}
|
|
407
430
|
else if (cellDateOnly.getTime() === endDateOnly.getTime()) {
|
|
408
|
-
// Date de fin
|
|
409
431
|
dateEl.classList.add('spw-date-range-end');
|
|
410
432
|
dateEl.classList.remove('spw-date-range-middle', 'spw-date-range-start');
|
|
411
433
|
}
|
|
412
434
|
else {
|
|
413
|
-
// Date au milieu
|
|
414
435
|
dateEl.classList.add('spw-date-range-middle');
|
|
415
436
|
dateEl.classList.remove('spw-date-range-start', 'spw-date-range-end');
|
|
416
437
|
}
|
|
@@ -540,8 +561,16 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
540
561
|
}
|
|
541
562
|
}
|
|
542
563
|
initializeDatepicker() {
|
|
543
|
-
|
|
544
|
-
|
|
564
|
+
var _a;
|
|
565
|
+
if (!this.inputElement) {
|
|
566
|
+
const shadowInput = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input[type="text"]');
|
|
567
|
+
if (shadowInput) {
|
|
568
|
+
this.inputElement = shadowInput;
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
545
574
|
const options = {
|
|
546
575
|
position: this.position,
|
|
547
576
|
startDay: 1,
|
|
@@ -575,11 +604,9 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
575
604
|
this.internals.setFormValue(isoString);
|
|
576
605
|
this.dateChange.emit({ value: isoString, date: selectedDate });
|
|
577
606
|
this.updateRangeConstraints();
|
|
578
|
-
// Mettre à jour le highlighting visuel du range
|
|
579
607
|
setTimeout(() => {
|
|
580
608
|
var _a, _b;
|
|
581
609
|
this.highlightRangeInCalendar();
|
|
582
|
-
// Mettre aussi à jour le highlighting sur l'autre datepicker s'il est ouvert
|
|
583
610
|
const { start, end } = this.getRangeSiblings();
|
|
584
611
|
const sibling = this.isStart ? end : start;
|
|
585
612
|
if (sibling && sibling.isOpen) {
|
|
@@ -593,7 +620,6 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
593
620
|
setTimeout(() => {
|
|
594
621
|
this.setupCalendarNavigation();
|
|
595
622
|
this.highlightRangeInCalendar();
|
|
596
|
-
// Réappliquer plusieurs fois pour contrer js-datepicker
|
|
597
623
|
setTimeout(() => this.highlightRangeInCalendar(), 50);
|
|
598
624
|
setTimeout(() => this.highlightRangeInCalendar(), 150);
|
|
599
625
|
}, 100);
|
|
@@ -604,9 +630,6 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
604
630
|
},
|
|
605
631
|
};
|
|
606
632
|
if (this.range && this.rangeId) {
|
|
607
|
-
// NOTE: On ne définit PAS options.id car js-datepicker applique alors des contraintes
|
|
608
|
-
// automatiques qui sont inversées. On gère nous-mêmes les contraintes.
|
|
609
|
-
// options.id = this.rangeId;
|
|
610
633
|
const { start, end } = this.getRangeSiblings();
|
|
611
634
|
if (this.isStart) {
|
|
612
635
|
if (end && end.value) {
|
|
@@ -632,7 +655,6 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
632
655
|
options.maxDate = new Date(this.maxDate);
|
|
633
656
|
}
|
|
634
657
|
if (this.datepickerInstance) {
|
|
635
|
-
// js-datepicker utilise remove() pour détruire l'instance
|
|
636
658
|
if (typeof this.datepickerInstance.remove === 'function') {
|
|
637
659
|
this.datepickerInstance.remove();
|
|
638
660
|
}
|
|
@@ -648,9 +670,7 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
648
670
|
this.internalValue = formattedDate;
|
|
649
671
|
this.lastInputValue = formattedDate;
|
|
650
672
|
}
|
|
651
|
-
catch (error) {
|
|
652
|
-
// Si la date n'est pas valide avec les contraintes actuelles, on la laisse vide
|
|
653
|
-
}
|
|
673
|
+
catch (error) { }
|
|
654
674
|
}
|
|
655
675
|
}
|
|
656
676
|
}
|
|
@@ -696,7 +716,7 @@ const SpwDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class SpwDatePicker ext
|
|
|
696
716
|
'spw-date-picker__input--open': this.isOpen,
|
|
697
717
|
};
|
|
698
718
|
const errorMessage = this.error || this.internalError;
|
|
699
|
-
return (h(Host, { key: '
|
|
719
|
+
return (h(Host, { key: 'eb66aebb637564da5d4e3c83cfe76d9d61e12e85' }, h("div", { key: '7984062a8d5c11c6876780431ff8bfd93bd935cc', class: "spw-date-picker" }, this.label && h("spw-field-label", { key: '494b6184491b96597c068dccba20a8f7d588b144', label: this.label, required: this.required }), this.assistiveText && (h("spw-field-message", { key: 'cac9fb61d6af9ddfc648a1483812a72fea20ed2b', class: "spw-tw-mb-2 -spw-tw-mt-1", variant: "hint", showIcon: false }, this.assistiveText)), h("div", { key: 'd54d9d938865e6594c7f58f62941a01014503ee5', class: "spw-date-picker__input-container" }, h("input", { key: 'a5495ee8d28f851e40c8139f1f2ced630f19d016', ref: el => (this.inputElement = el), id: this.uniqueId, type: "text", class: inputClass, value: this.internalValue, placeholder: this.placeholder, disabled: this.disabled, required: this.required, onFocus: this.handleInputFocus, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, "aria-describedby": this.assistiveText || errorMessage ? `${this.uniqueId}-help ${this.uniqueId}-error` : undefined, "aria-invalid": this.hasError }), h("spw-icon", { key: '0737358ffe36b3c05d8a767c7cfdf14832144c85', icon: "fa-calendar", class: "spw-date-picker__icon" })), this.error && (h("spw-field-message", { key: 'da0bf405570f245e40822174b0360537be5de8da', variant: "error", showIcon: this.showErrorIcon }, this.error)), this.hint && (h("spw-field-message", { key: '2f72f9c384714c9687abe5807ce1a42c94247357', variant: "hint", showIcon: this.showHintIcon }, this.hint)), this.success && (h("spw-field-message", { key: 'c6d8902f5c56a696eea582d60f0fc82baade5cf3', variant: "success", showIcon: this.showSuccessIcon }, this.success)), this.warning && (h("spw-field-message", { key: '297c8119472b719c145c10301f4bd37bc6812f35', variant: "warning", showIcon: this.showWarningIcon }, this.warning)))));
|
|
700
720
|
}
|
|
701
721
|
static get formAssociated() { return true; }
|
|
702
722
|
get el() { return this; }
|