legalesign-document-viewer 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-DruwRbfl.js → index-BpMnxZQ4.js} +14 -3
- package/dist/cjs/index-BpMnxZQ4.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{ls-document-options_39.cjs.entry.js → ls-document-options_40.cjs.entry.js} +1548 -21
- package/dist/cjs/ls-document-options_40.cjs.entry.js.map +1 -0
- package/dist/cjs/ls-document-viewer.cjs.js +2 -2
- package/dist/cjs/ls-field-properties-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ls-formfield.cjs.entry.js +1 -1
- package/dist/cjs/ls-number-input_5.cjs.entry.js +1 -1
- package/dist/collection/components/ls-document-options/ls-document-options.js +8 -2
- package/dist/collection/components/ls-document-options/ls-document-options.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/editorCalculator.js +2 -0
- package/dist/collection/components/ls-document-viewer/editorCalculator.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/editorUtils.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js +11 -11
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/validator.js +2 -2
- package/dist/collection/components/ls-document-viewer/validator.js.map +1 -1
- package/dist/collection/components/ls-field-content/ls-field-content.js +6 -2
- package/dist/collection/components/ls-field-content/ls-field-content.js.map +1 -1
- package/dist/collection/components/ls-tooltip/ls-tooltip.css +22 -5
- package/dist/collection/components/ls-tooltip/ls-tooltip.js +59 -34
- package/dist/collection/components/ls-tooltip/ls-tooltip.js.map +1 -1
- package/dist/collection/components/ls-validation-tag/ls-validation-tag.js +11 -2
- package/dist/collection/components/ls-validation-tag/ls-validation-tag.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/ls-document-options.js +1 -1
- package/dist/components/ls-document-viewer.js +97 -89
- package/dist/components/ls-document-viewer.js.map +1 -1
- package/dist/components/ls-editor-field.js +1 -1
- package/dist/components/ls-editor-table.js +1 -1
- package/dist/components/ls-feature-column.js +1 -1
- package/dist/components/ls-field-alignment.js +1 -1
- package/dist/components/ls-field-content.js +1 -1
- package/dist/components/ls-field-dimensions.js +1 -1
- package/dist/components/ls-field-distribute.js +1 -1
- package/dist/components/ls-field-footer.js +1 -1
- package/dist/components/ls-field-format.js +1 -1
- package/dist/components/ls-field-placement.js +1 -1
- package/dist/components/ls-field-properties-advanced.js +1 -1
- package/dist/components/ls-field-properties-autosign.js +1 -1
- package/dist/components/ls-field-properties-container.js +1 -1
- package/dist/components/ls-field-properties-date.js +1 -1
- package/dist/components/ls-field-properties-dropdown.js +12 -12
- package/dist/components/ls-field-properties-email.js +1 -1
- package/dist/components/ls-field-properties-file.js +1 -1
- package/dist/components/ls-field-properties-general.js +1 -1
- package/dist/components/ls-field-properties-image.js +1 -1
- package/dist/components/ls-field-properties-multiple.js +1 -1
- package/dist/components/ls-field-properties-number.js +1 -1
- package/dist/components/ls-field-properties-signature.js +1 -1
- package/dist/components/ls-field-properties-text.js +1 -1
- package/dist/components/ls-field-properties.js +1 -1
- package/dist/components/ls-field-size.js +1 -1
- package/dist/components/ls-field-type-display.js +1 -1
- package/dist/components/ls-formfield.js +7 -7
- package/dist/components/ls-icon.js +1 -1
- package/dist/components/ls-input-wrapper.js +1 -1
- package/dist/components/ls-number-input.js +1 -1
- package/dist/components/ls-page-loader.js +1 -1
- package/dist/components/ls-participant-card.js +1 -1
- package/dist/components/ls-participant-manager.js +1 -1
- package/dist/components/ls-participant-select.js +1 -1
- package/dist/components/ls-props-section.js +1 -1
- package/dist/components/ls-radio-input.js +1 -1
- package/dist/components/ls-select-input.js +1 -1
- package/dist/components/ls-statusbar.js +1 -1
- package/dist/components/ls-text-input.js +1 -1
- package/dist/components/ls-textarea-input.js +1 -1
- package/dist/components/ls-toggle.js +1 -1
- package/dist/components/ls-toolbar.js +1 -1
- package/dist/components/ls-toolbox-field.js +1 -1
- package/dist/components/ls-tooltip.js +1 -1587
- package/dist/components/ls-tooltip.js.map +1 -1
- package/dist/components/ls-validation-tag.js +1 -1
- package/dist/components/{p-CVxA0mrX.js → p-14owczyX.js} +8 -8
- package/dist/components/{p-CVxA0mrX.js.map → p-14owczyX.js.map} +1 -1
- package/dist/components/{p-GJYwAar9.js → p-23iaNjGp.js} +14 -14
- package/dist/components/{p-GJYwAar9.js.map → p-23iaNjGp.js.map} +1 -1
- package/dist/components/{p-D990IL5t.js → p-6LFAGg6D.js} +4 -4
- package/dist/components/{p-D990IL5t.js.map → p-6LFAGg6D.js.map} +1 -1
- package/dist/components/{p-CcUFZYwZ.js → p-9WKoGwO0.js} +4 -4
- package/dist/components/{p-CcUFZYwZ.js.map → p-9WKoGwO0.js.map} +1 -1
- package/dist/components/{p-C0afavmo.js → p-B-K24bnx.js} +27 -27
- package/dist/components/{p-C0afavmo.js.map → p-B-K24bnx.js.map} +1 -1
- package/dist/components/{p-Cfl2rRxL.js → p-B3lY01RV.js} +4 -4
- package/dist/components/{p-Cfl2rRxL.js.map → p-B3lY01RV.js.map} +1 -1
- package/dist/components/{p-HaIHVR-P.js → p-BArjC51C.js} +3 -3
- package/dist/components/{p-HaIHVR-P.js.map → p-BArjC51C.js.map} +1 -1
- package/dist/components/{p-C6cWElQ7.js → p-BKNIuWRw.js} +14 -14
- package/dist/components/{p-C6cWElQ7.js.map → p-BKNIuWRw.js.map} +1 -1
- package/dist/components/{p-BaMR8ksy.js → p-BLUUNyDx.js} +3 -3
- package/dist/components/{p-BaMR8ksy.js.map → p-BLUUNyDx.js.map} +1 -1
- package/dist/components/{p-7V9_3fXA.js → p-BXKYpxgM.js} +4 -4
- package/dist/components/{p-7V9_3fXA.js.map → p-BXKYpxgM.js.map} +1 -1
- package/dist/components/{p-DrWlEpVu.js → p-Ba_8GAK2.js} +4 -4
- package/dist/components/{p-DrWlEpVu.js.map → p-Ba_8GAK2.js.map} +1 -1
- package/dist/components/{p-ClYIDEKN.js → p-BcfP7mSQ.js} +6 -6
- package/dist/components/{p-ClYIDEKN.js.map → p-BcfP7mSQ.js.map} +1 -1
- package/dist/{esm/ls-tooltip.entry.js → components/p-Bt5gnPRz.js} +177 -216
- package/dist/components/p-Bt5gnPRz.js.map +1 -0
- package/dist/components/{p-BWLt02JN.js → p-BvHSBTD8.js} +14 -3
- package/dist/components/p-BvHSBTD8.js.map +1 -0
- package/dist/components/{p-Dp-vgKJq.js → p-Bxutt9rC.js} +4 -4
- package/dist/components/{p-Dp-vgKJq.js.map → p-Bxutt9rC.js.map} +1 -1
- package/dist/components/{p-_dj7MCcU.js → p-C45TaVTh.js} +4 -4
- package/dist/components/{p-_dj7MCcU.js.map → p-C45TaVTh.js.map} +1 -1
- package/dist/components/{p-Dhknldsv.js → p-C4dJ_NrC.js} +12 -12
- package/dist/components/{p-Dhknldsv.js.map → p-C4dJ_NrC.js.map} +1 -1
- package/dist/components/{p-CpiX4Tih.js → p-C6NnNmx5.js} +4 -4
- package/dist/components/{p-CpiX4Tih.js.map → p-C6NnNmx5.js.map} +1 -1
- package/dist/components/{p-wy6ar5D3.js → p-CCE9t160.js} +4 -4
- package/dist/components/{p-wy6ar5D3.js.map → p-CCE9t160.js.map} +1 -1
- package/dist/components/{p-CjciOPPE.js → p-CHN41h9u.js} +14 -14
- package/dist/components/{p-CjciOPPE.js.map → p-CHN41h9u.js.map} +1 -1
- package/dist/components/{p-h3hsXDzk.js → p-CTXoPKrw.js} +4 -4
- package/dist/components/{p-h3hsXDzk.js.map → p-CTXoPKrw.js.map} +1 -1
- package/dist/components/{p-DgMfXwXc.js → p-CZkgAbFI.js} +4 -4
- package/dist/components/{p-DgMfXwXc.js.map → p-CZkgAbFI.js.map} +1 -1
- package/dist/components/{p-C8kySYH4.js → p-CdGtJRZm.js} +3 -3
- package/dist/components/{p-C8kySYH4.js.map → p-CdGtJRZm.js.map} +1 -1
- package/dist/components/{p-Crkl9bKZ.js → p-Co6xLkEu.js} +4 -4
- package/dist/components/{p-Crkl9bKZ.js.map → p-Co6xLkEu.js.map} +1 -1
- package/dist/components/{p-Bg6wsr_z.js → p-Cv4qCy2p.js} +4 -4
- package/dist/components/{p-Bg6wsr_z.js.map → p-Cv4qCy2p.js.map} +1 -1
- package/dist/components/{p-gvEf2mjl.js → p-Cw8qsoOq.js} +4 -4
- package/dist/components/{p-gvEf2mjl.js.map → p-Cw8qsoOq.js.map} +1 -1
- package/dist/components/{p-DOCp-M5v.js → p-CzySwvIU.js} +5 -5
- package/dist/components/{p-DOCp-M5v.js.map → p-CzySwvIU.js.map} +1 -1
- package/dist/components/{p-DORxxjtg.js → p-DE2r5IdM.js} +14 -14
- package/dist/components/{p-DORxxjtg.js.map → p-DE2r5IdM.js.map} +1 -1
- package/dist/components/{p-BPayWH9u.js → p-DM3pnD5z.js} +3 -3
- package/dist/components/{p-BPayWH9u.js.map → p-DM3pnD5z.js.map} +1 -1
- package/dist/components/{p-D5cswwR_.js → p-DUVCAq-W.js} +4 -4
- package/dist/components/{p-D5cswwR_.js.map → p-DUVCAq-W.js.map} +1 -1
- package/dist/components/{p-CCMS_IvP.js → p-DY8RJZmx.js} +14 -14
- package/dist/components/{p-CCMS_IvP.js.map → p-DY8RJZmx.js.map} +1 -1
- package/dist/components/{p-Lx7PwjNC.js → p-Da83lhqi.js} +14 -10
- package/dist/components/p-Da83lhqi.js.map +1 -0
- package/dist/components/{p-5I9rEf1F.js → p-Dprl580c.js} +21 -9
- package/dist/components/p-Dprl580c.js.map +1 -0
- package/dist/components/{p-ChCIuJg0.js → p-DqEap43n.js} +3 -3
- package/dist/components/{p-ChCIuJg0.js.map → p-DqEap43n.js.map} +1 -1
- package/dist/components/{p-DEArdusa.js → p-DqW1sDWy.js} +14 -14
- package/dist/components/{p-DEArdusa.js.map → p-DqW1sDWy.js.map} +1 -1
- package/dist/components/{p-Bsc25fvn.js → p-DxGzQ3Lc.js} +4 -4
- package/dist/components/{p-Bsc25fvn.js.map → p-DxGzQ3Lc.js.map} +1 -1
- package/dist/components/{p-YrxZXlJ1.js → p-DyE9zKT7.js} +14 -6
- package/dist/components/p-DyE9zKT7.js.map +1 -0
- package/dist/components/p-Ovur85Of.js.map +1 -1
- package/dist/components/{p-D0PX7hpQ.js → p-Yrg6B_xb.js} +4 -4
- package/dist/components/{p-D0PX7hpQ.js.map → p-Yrg6B_xb.js.map} +1 -1
- package/dist/components/{p-CwKpqq1h.js → p-gEso0FtC.js} +14 -14
- package/dist/components/{p-CwKpqq1h.js.map → p-gEso0FtC.js.map} +1 -1
- package/dist/components/{p-DmenFbeU.js → p-i5LoDKK3.js} +4 -4
- package/dist/components/{p-DmenFbeU.js.map → p-i5LoDKK3.js.map} +1 -1
- package/dist/components/{p-BpXqwLh3.js → p-iwXLSFLX.js} +4 -4
- package/dist/components/{p-BpXqwLh3.js.map → p-iwXLSFLX.js.map} +1 -1
- package/dist/components/{p-CozH0k34.js → p-o7kGA8FM.js} +5 -5
- package/dist/components/{p-CozH0k34.js.map → p-o7kGA8FM.js.map} +1 -1
- package/dist/components/{p-C4Go47Ak.js → p-ozlIyuZ1.js} +6 -6
- package/dist/components/{p-C4Go47Ak.js.map → p-ozlIyuZ1.js.map} +1 -1
- package/dist/components/{p-BNMjQBPT.js → p-tfo7xItm.js} +14 -14
- package/dist/components/{p-BNMjQBPT.js.map → p-tfo7xItm.js.map} +1 -1
- package/dist/components/{p-DWqgZCMh.js → p-vV0A8m2N.js} +3 -3
- package/dist/components/{p-DWqgZCMh.js.map → p-vV0A8m2N.js.map} +1 -1
- package/dist/esm/{index-CjW5NqdW.js → index-BzcAlD18.js} +14 -3
- package/dist/esm/index-BzcAlD18.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{ls-document-options_39.entry.js → ls-document-options_40.entry.js} +1548 -22
- package/dist/esm/ls-document-options_40.entry.js.map +1 -0
- package/dist/esm/ls-document-viewer.js +3 -3
- package/dist/esm/ls-field-properties-dropdown.entry.js +1 -1
- package/dist/esm/ls-formfield.entry.js +1 -1
- package/dist/esm/ls-number-input_5.entry.js +1 -1
- package/dist/ls-document-viewer/ls-document-viewer.esm.js +1 -1
- package/dist/ls-document-viewer/{p-646325ae.entry.js → p-0b9016eb.entry.js} +2 -2
- package/dist/ls-document-viewer/{p-d2df7881.entry.js → p-3dae15c9.entry.js} +2 -2
- package/dist/ls-document-viewer/p-BzcAlD18.js +3 -0
- package/dist/ls-document-viewer/p-BzcAlD18.js.map +1 -0
- package/dist/ls-document-viewer/{p-d7109cdd.entry.js → p-be7a03ca.entry.js} +2 -2
- package/dist/ls-document-viewer/{p-063541d8.entry.js → p-e45016a5.entry.js} +6 -6
- package/dist/ls-document-viewer/p-e45016a5.entry.js.map +1 -0
- package/dist/types/components/ls-document-options/ls-document-options.d.ts +1 -0
- package/dist/types/components/ls-document-viewer/validator.d.ts +2 -2
- package/dist/types/components/ls-field-content/ls-field-content.d.ts +1 -0
- package/dist/types/components/ls-tooltip/ls-tooltip.d.ts +2 -4
- package/dist/types/components/ls-validation-tag/ls-validation-tag.d.ts +1 -0
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/cjs/index-DruwRbfl.js.map +0 -1
- package/dist/cjs/ls-document-options_39.cjs.entry.js.map +0 -1
- package/dist/cjs/ls-tooltip.cjs.entry.js +0 -1575
- package/dist/cjs/ls-tooltip.cjs.entry.js.map +0 -1
- package/dist/cjs/ls-tooltip.entry.cjs.js.map +0 -1
- package/dist/components/p-5I9rEf1F.js.map +0 -1
- package/dist/components/p-BWLt02JN.js.map +0 -1
- package/dist/components/p-Lx7PwjNC.js.map +0 -1
- package/dist/components/p-YrxZXlJ1.js.map +0 -1
- package/dist/esm/index-CjW5NqdW.js.map +0 -1
- package/dist/esm/ls-document-options_39.entry.js.map +0 -1
- package/dist/esm/ls-tooltip.entry.js.map +0 -1
- package/dist/ls-document-viewer/ls-tooltip.entry.esm.js.map +0 -1
- package/dist/ls-document-viewer/p-063541d8.entry.js.map +0 -1
- package/dist/ls-document-viewer/p-CjW5NqdW.js +0 -3
- package/dist/ls-document-viewer/p-CjW5NqdW.js.map +0 -1
- package/dist/ls-document-viewer/p-fee3434a.entry.js +0 -2
- package/dist/ls-document-viewer/p-fee3434a.entry.js.map +0 -1
- /package/dist/ls-document-viewer/{p-646325ae.entry.js.map → p-0b9016eb.entry.js.map} +0 -0
- /package/dist/ls-document-viewer/{p-d2df7881.entry.js.map → p-3dae15c9.entry.js.map} +0 -0
- /package/dist/ls-document-viewer/{p-d7109cdd.entry.js.map → p-be7a03ca.entry.js.map} +0 -0
package/dist/cjs/{ls-document-options_39.cjs.entry.js → ls-document-options_40.cjs.entry.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BpMnxZQ4.js');
|
|
4
4
|
|
|
5
5
|
const lsDocumentOptionsCss = "*{box-sizing:border-box;margin:0;padding:0}:host{display:block}.ls-editor-infobox{padding:2px 8px 2px 8px}.toolbox-section-title{color:var(--gray-100, #45484d);font-size:1.125rem;font-style:normal;font-weight:500;line-height:1.75rem;}.toolbox-section-description{color:var(--gray-80, #5e6066);font-size:0.75rem;font-style:normal;font-weight:400;line-height:1rem}.template-details{display:flex;flex-direction:column;gap:0.75rem}.template-detail-section{position:relative;display:flex;padding:0.75rem;align-items:center;gap:0.5rem;border-radius:1rem;border:1px solid var(--gray-30, #e0e2e5);background:var(--white, #fff)}.template-detail-section-title{color:var(--gray-80, #6c6e73);font-size:0.875rem;font-style:normal;font-weight:500;line-height:1.25rem;width:100%}.template-detail-section-info{color:var(--gray-70);font-size:0.75rem;font-style:normal;font-weight:400;line-height:1rem;width:100%}.column{display:flex;flex-direction:column;align-items:flex-start}.editButton{position:absolute;top:0.75rem;right:0.75rem;margin:0px;padding:0px;max-height:1.25rem !important;max-width:1.25rem !important;background-color:transparent;border:none;cursor:pointer;color:var(--gray-70, #2134dc)}.editButton:hover{color:var(--gray-80)}p{color:var(--gray-80, #6c6e73);font-family:var(--font-family);font-size:var(--text-sm);font-style:normal;font-weight:400;line-height:var(--text-sm-line-height)}a{color:var(--primary-60, #4456f6);font-size:var(--text-sm);font-style:normal;font-weight:400;line-height:var(--text-sm-line-height);cursor:pointer}a:hover{text-decoration:underline;color:var(--primary-70, #2134dc)}.button-link,.button-link:hover{all:unset}select{appearance:none;height:36px}.input-wrapper{position:relative;width:fit-content}#selectorIcon{position:absolute;top:50%;right:0.675rem;transform:translateY(-50%);pointer-events:none;color:var(--gray-80, #6c6e73)}#selectLeadingIcon{position:absolute;top:50%;left:0.675rem;transform:translateY(-50%);pointer-events:none;color:var(--gray-80, #6c6e73)}.has-leading-icon{padding-left:2.5rem}input,select,textarea{border:1px solid var(--gray-40, #d8d9dc);box-shadow:0 1px 0.125rem rgba(0, 0, 0, 0.05);padding:0.5rem 0.75rem;font-family:var(--font-family);font-size:var(--text-sm);border-radius:0.5rem;color:var(--gray-100, #45484d);font-weight:400}input::placeholder,select::placeholder,textarea::placeholder{color:var(--gray-60, #afb0b2)}input:hover,select:hover,textarea:hover{border-color:var(--gray-50, #c8c9cc);background-color:var(--white, #fff)}input:focus,select:focus,textarea:focus{outline:none;box-shadow:0 0 0 0.25rem var(--primary-40, #79adfc);border-color:var(--primary-60, #4456f6);background-color:var(--white, #fff)}input:active,select:active,textarea:active{border-color:var(--primary-50, #5185ff)}input:disabled,select:disabled,textarea:disabled{cursor:not-allowed;background-color:var(--gray-10, #f7f8fa)}input[type='checkbox']{appearance:none;position:relative;height:1rem;width:1rem;padding:0.25rem;border-radius:var(--radius-sm);border:1px solid #d1d5db;background-color:#ffffff;cursor:pointer}input[type='checkbox']:checked,input[type='checkbox'].indeterminate{background-color:var(--primary-60, #4456f6);border:none}input[type='checkbox']:checked::after{content:'';position:absolute;top:45%;left:50%;transform:translate(-50%, -50%) rotate(-45deg) scale(-1, 1);width:0.5rem;height:0.25rem;border-bottom:0.125rem solid white;border-right:0.125rem solid white}input[type='checkbox'].indeterminate::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.5rem;height:0.125rem;background-color:white}input[type='checkbox']:checked:hover,input[type='checkbox'].indeterminate:hover{background-color:var(--primary-70, #2134dc);border:none}input[type='checkbox']:hover{border:1px solid #9ca3af}input[type='checkbox']:focus,input[type='checkbox']:active{outline:none;box-shadow:0 0 0 0.25rem var(--primary-20, #c7ddff);background-color:#f0f4f8}input[type='checkbox']:disabled{background-color:#f3f4f6;outline:none;cursor:not-allowed}input[type='checkbox']:disabled:checked{background-color:#e5e7eb;border:none;outline:none;cursor:not-allowed}.checkbox-container{display:flex;gap:0.5rem;width:100%}.checkbox-label{color:var(--gray-100, #45484d);font-size:1rem;font-style:normal;font-weight:400;line-height:1rem}.form-label{color:var(--gray-100, #45484d);font-size:1rem;font-style:normal;font-weight:500;line-height:1.5rem}.form-field{display:flex;flex-direction:column;gap:0.25rem;width:100%}.loading-box{display:flex;justify-content:center;align-items:center;width:100%;height:100vh;color:var(--primary-60, #0c7cba)}button{border:0;appearance:button;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-lg);background-color:var(--primary-60, #4456f6);color:white;text-transform:capitalize;min-height:2.25rem;min-width:2.25rem}button.tertiaryGrey{border:1px solid var(--gray-40, #d8d9dc);background-color:white;color:var(--gray-80, #787a80)}button.tertiaryGrey:hover{border:1px solid var(--gray-50, #c8c9cc);background:var(--gray-10, #f7f8fa)}.button-group{display:flex;border-radius:0.5rem;border:1px solid var(--gray-30, #e0e2e5);background:var(--white, #ffffff);overflow:clip}.button-group button{display:flex;background:transparent;border-radius:unset;padding:0.25rem 0.75rem;min-width:2.156rem;min-height:unset;color:var(--gray-80, #6c6e73)}.button-group button:hover{background:var(--gray-10, #f7f8fa)}.button-group>:first-child{border-radius:0.5rem 0 0 0.5rem}.button-group>:last-child{border-radius:0 0.5rem 0.5rem 0}.button-group>:not(:first-child){border-left:1px solid var(--gray-30, #e0e2e5)}";
|
|
6
6
|
|
|
@@ -39,6 +39,7 @@ const LsDocumentOptions = class {
|
|
|
39
39
|
this.mutate.emit(diffs);
|
|
40
40
|
}, delay);
|
|
41
41
|
}
|
|
42
|
+
editNameBtn;
|
|
42
43
|
render() {
|
|
43
44
|
function formatDate(isoString) {
|
|
44
45
|
const date = new Date(isoString);
|
|
@@ -51,7 +52,11 @@ const LsDocumentOptions = class {
|
|
|
51
52
|
}
|
|
52
53
|
return (index.h(index.Host, null, index.h("div", { class: "ls-editor-infobox" }, index.h("h2", { class: "toolbox-section-title" }, "Template Details"), index.h("p", { class: "toolbox-section-description" }, "Details and insights about the Template.")), index.h("div", { class: 'template-details' }, index.h("div", { class: 'template-detail-section column' }, index.h("p", { class: "template-detail-section-title" }, "Name"), index.h("div", { class: "editButton", onClick: () => {
|
|
53
54
|
this.editTitle = !this.editTitle;
|
|
54
|
-
} }, index.h("ls-icon", { name: this.editTitle ? 'check' : 'pencil-alt', size: "18"
|
|
55
|
+
} }, index.h("ls-icon", { name: this.editTitle ? 'check' : 'pencil-alt', size: "18", id: "edit-name-btn", ref: el => {
|
|
56
|
+
if (el && el !== this.editNameBtn) {
|
|
57
|
+
this.editNameBtn = el;
|
|
58
|
+
}
|
|
59
|
+
} }), index.h("ls-tooltip", { referenceElement: this.editNameBtn }, this.editTitle ? 'Save' : 'Edit Name')), this.editTitle ? (index.h("input", { value: this.template?.title, style: { width: '100%' }, onInput: e => {
|
|
55
60
|
e.preventDefault();
|
|
56
61
|
this.alter({ title: e.target.value });
|
|
57
62
|
}, onKeyUp: e => {
|
|
@@ -19881,6 +19886,8 @@ const findIn = (fields, selector, restyle = false, additive = false) => {
|
|
|
19881
19886
|
};
|
|
19882
19887
|
// Used to append new fields (dropped or loaded from template data)
|
|
19883
19888
|
function addField(frame, data) {
|
|
19889
|
+
const fields = this._template.elementConnection.templateElements;
|
|
19890
|
+
this._template = { ...this._template, elementConnection: { ...this._template.elementConnection, templateElements: [...fields, data] } };
|
|
19884
19891
|
const node = document.createElement('ls-editor-field');
|
|
19885
19892
|
node.setAttribute('type', data.formElementType);
|
|
19886
19893
|
node.setAttribute('id', 'ls-field-' + data.id);
|
|
@@ -24762,7 +24769,7 @@ function validate(t) {
|
|
|
24762
24769
|
id: tr.id,
|
|
24763
24770
|
title: 'Missing signature.',
|
|
24764
24771
|
description: `{tr.name} is missing a signature.`,
|
|
24765
|
-
role: tr
|
|
24772
|
+
role: tr,
|
|
24766
24773
|
});
|
|
24767
24774
|
}
|
|
24768
24775
|
});
|
|
@@ -24773,7 +24780,7 @@ function validate(t) {
|
|
|
24773
24780
|
id: element.id,
|
|
24774
24781
|
title: 'Missing options',
|
|
24775
24782
|
description: `Drop down field "${element.label}" is missing options.`,
|
|
24776
|
-
element: element
|
|
24783
|
+
element: element,
|
|
24777
24784
|
});
|
|
24778
24785
|
}
|
|
24779
24786
|
});
|
|
@@ -24956,13 +24963,11 @@ const LsDocumentViewer = class {
|
|
|
24956
24963
|
mutateHandler(event) {
|
|
24957
24964
|
if (this.token && this.adapter)
|
|
24958
24965
|
event.detail.forEach(me => this.adapter.handleEvent(me, this.token).then(result => matchData.bind(this)(result)));
|
|
24959
|
-
this.validationErrors = validate.bind(this)(this._template);
|
|
24960
24966
|
}
|
|
24961
24967
|
// Updates are internal event between LS controls not to be confused with mutate
|
|
24962
24968
|
updateHandler(event) {
|
|
24963
24969
|
if (event.detail)
|
|
24964
24970
|
event.detail.forEach(fx => this.syncChange(fx));
|
|
24965
|
-
this.validationErrors = validate.bind(this)(this._template);
|
|
24966
24971
|
}
|
|
24967
24972
|
// Updates are internal event between LS controls not to be confused with mutate
|
|
24968
24973
|
addParticpantHandler(event) {
|
|
@@ -25109,7 +25114,6 @@ const LsDocumentViewer = class {
|
|
|
25109
25114
|
elementConnection: { ...newTemplate.elementConnection, templateElements: fields },
|
|
25110
25115
|
roles: preparedRoles,
|
|
25111
25116
|
};
|
|
25112
|
-
console.log(this._template);
|
|
25113
25117
|
}
|
|
25114
25118
|
/**
|
|
25115
25119
|
* Render the page based on pageNumber
|
|
@@ -25195,6 +25199,8 @@ const LsDocumentViewer = class {
|
|
|
25195
25199
|
}
|
|
25196
25200
|
else if (update.action === 'delete') {
|
|
25197
25201
|
const fi = this.component.shadowRoot.getElementById('ls-field-' + update.data.id);
|
|
25202
|
+
const fields = this._template.elementConnection.templateElements;
|
|
25203
|
+
this._template = { ...this._template, elementConnection: { ...this._template.elementConnection, templateElements: fields.filter(f => f.id !== update.data.id) } };
|
|
25198
25204
|
this.component.shadowRoot.getElementById('ls-document-frame').removeChild(fi);
|
|
25199
25205
|
this.selected = [];
|
|
25200
25206
|
}
|
|
@@ -25202,6 +25208,7 @@ const LsDocumentViewer = class {
|
|
|
25202
25208
|
console.warn('Unrecognised action, check Legalesign documentation. `create`, `update` and `delete` allowed.');
|
|
25203
25209
|
}
|
|
25204
25210
|
}
|
|
25211
|
+
this.validationErrors = validate.bind(this)(this._template);
|
|
25205
25212
|
}
|
|
25206
25213
|
initViewer() {
|
|
25207
25214
|
// Generate a canvas to draw the background PDF on.
|
|
@@ -25268,7 +25275,7 @@ const LsDocumentViewer = class {
|
|
|
25268
25275
|
});
|
|
25269
25276
|
}
|
|
25270
25277
|
render() {
|
|
25271
|
-
return (index.h(index.Host, { key: '
|
|
25278
|
+
return (index.h(index.Host, { key: '331bbb6ee8979812cac17c61037085c18ffe3ea4' }, index.h(index.h.Fragment, null, this.isLoading && index.h("ls-page-loader", { key: '2fdab395bd9707041e35176bdbcc898e61dcf640' }), index.h("div", { key: '676168eb9b02205325cb53c68bda22783669380c', class: 'validation-tag-wrapper' }, index.h("ls-validation-tag", { key: '62867096f5fda376314bb7915b81e7006d95c492', validationErrors: this.validationErrors })), index.h("div", { key: '898f1dcc9a33dc8fa3181e409364b575bb923904', class: "page-header" }, index.h("p", { key: 'd5d0041f19aa10609d02a81412a46cf0c45376bb', class: "header-text-1" }, "Template Creation"), index.h("p", { key: '08f9eb736cd04e1c4cd867f4882f03d3d1899e39' }, "/"), index.h("p", { key: '039a5d1475d4ee606b8f11cc1f49fcdcfe309d30', class: "header-text-2" }, this._template?.title)), index.h("form", { key: 'c4455c35ff74b2ea43adc7e298c46d7db22dc964', id: "ls-editor-form" }, this.showtoolbox === true ? (index.h("div", { id: "ls-left-box", class: "leftBox" }, index.h("div", { class: !this.selected || this.selected.length === 0 ? 'left-box-inner' : 'hidden' }, index.h("ls-feature-column", { onManage: manager => {
|
|
25272
25279
|
if (manager.detail === 'document') {
|
|
25273
25280
|
var documentManager = this.component.shadowRoot.getElementById('ls-document-options');
|
|
25274
25281
|
documentManager.template = this._template;
|
|
@@ -25282,17 +25289,17 @@ const LsDocumentViewer = class {
|
|
|
25282
25289
|
this.handleSelectedField.bind(this)(event);
|
|
25283
25290
|
} })) : (index.h("ls-toolbox-field", { elementType: "auto sign", formElementType: "auto sign", label: "Auto Sign", defaultHeight: 27, defaultWidth: 120, validation: 3000, icon: "auto-sign", signer: this.signer, onSelected: event => {
|
|
25284
25291
|
this.handleSelectedField.bind(this)(event);
|
|
25285
|
-
} })), index.h("ls-toolbox-field", { elementType: "
|
|
25286
|
-
this.handleSelectedField.bind(this)(event);
|
|
25287
|
-
} }), index.h("ls-toolbox-field", { elementType: "date", formElementType: "date", label: "Date", defaultHeight: 27, defaultWidth: 80, validation: 2, icon: "calender", signer: this.signer, onSelected: event => {
|
|
25292
|
+
} })), index.h("ls-toolbox-field", { elementType: "text", formElementType: "text", label: "Text", defaultHeight: 27, defaultWidth: 100, validation: 0, icon: "text", signer: this.signer, onSelected: event => {
|
|
25288
25293
|
this.handleSelectedField.bind(this)(event);
|
|
25289
25294
|
} }), index.h("ls-toolbox-field", { elementType: "signing date", formElementType: "signing date", label: "Signing Date", defaultHeight: 27, defaultWidth: 120, validation: 30, icon: "auto-date", signer: this.signer, onSelected: event => {
|
|
25290
25295
|
this.handleSelectedField.bind(this)(event);
|
|
25296
|
+
} }), index.h("ls-toolbox-field", { elementType: "date", formElementType: "date", label: "Date", defaultHeight: 27, defaultWidth: 80, validation: 2, icon: "calender", signer: this.signer, onSelected: event => {
|
|
25297
|
+
this.handleSelectedField.bind(this)(event);
|
|
25291
25298
|
} }), index.h("ls-toolbox-field", { elementType: "email", formElementType: "email", label: "Email", defaultHeight: 27, defaultWidth: 120, validation: 1, icon: "at-symbol", signer: this.signer, onSelected: event => {
|
|
25292
25299
|
this.handleSelectedField.bind(this)(event);
|
|
25293
|
-
} }), index.h("ls-toolbox-field", { elementType: "
|
|
25300
|
+
} }), index.h("ls-toolbox-field", { elementType: "initials", formElementType: "initials", label: "Initials", defaultHeight: 27, defaultWidth: 120, validation: 2000, icon: "initials", signer: this.signer, onSelected: event => {
|
|
25294
25301
|
this.handleSelectedField.bind(this)(event);
|
|
25295
|
-
} }), index.h("div", { class:
|
|
25302
|
+
} }), index.h("div", { class: "fields-box" }, index.h("ls-toolbox-field", { elementType: "number", formElementType: "number", label: "Number", defaultHeight: 27, defaultWidth: 80, validation: 50, icon: "hashtag", signer: this.signer, onSelected: event => {
|
|
25296
25303
|
this.handleSelectedField.bind(this)(event);
|
|
25297
25304
|
} }), index.h("ls-toolbox-field", { elementType: "dropdown", formElementType: "dropdown", label: "Dropdown", defaultHeight: 27, defaultWidth: 80, validation: 20, icon: "hashtag", signer: this.signer, onSelected: event => {
|
|
25298
25305
|
this.handleSelectedField.bind(this)(event);
|
|
@@ -25304,10 +25311,10 @@ const LsDocumentViewer = class {
|
|
|
25304
25311
|
this.handleSelectedField.bind(this)(event);
|
|
25305
25312
|
} }), index.h("ls-toolbox-field", { elementType: "file", formElementType: "file", label: "File", defaultHeight: 27, defaultWidth: 120, validation: 74, icon: "upload", signer: this.signer, onSelected: event => {
|
|
25306
25313
|
this.handleSelectedField.bind(this)(event);
|
|
25307
|
-
} }))))
|
|
25314
|
+
} })))), index.h("ls-participant-manager", { id: "ls-participant-manager", class: this.manager === 'participant' ? 'toolbox' : 'hidden', editor: this }), index.h("ls-document-options", { id: "ls-document-options", class: this.manager === 'document' ? 'toolbox' : 'hidden' })), !this.displayTable && (index.h("div", { class: this.selected.length > 0 ? 'field-properties-outer' : 'hidden' }, index.h("div", { class: 'properties-header' }, index.h("div", { class: 'properties-header-icon' }, index.h("ls-icon", { name: "pre-filled-content" })), index.h("h1", { class: 'properties-header-title' }, "Field Properties"), index.h("button", { class: 'tertiaryGrey', onClick: e => {
|
|
25308
25315
|
this.selected = [];
|
|
25309
25316
|
e.preventDefault();
|
|
25310
|
-
} }, index.h("ls-icon", { name: "x", size: "20" }))), index.h("ls-field-properties", { id: "my-field-panel" }), index.h("slot", null))))) : (index.h(index.h.Fragment, null)), index.h("ls-toolbar", { key: '
|
|
25317
|
+
} }, index.h("ls-icon", { name: "x", size: "20" }))), index.h("ls-field-properties", { id: "my-field-panel" }), index.h("slot", null))))) : (index.h(index.h.Fragment, null)), index.h("ls-toolbar", { key: '8c4b8034e7ffed516af95db5f10cf4ada95dcbdb', id: "ls-toolbar", template: this._template, editor: this, groupInfo: this.groupInfo }), index.h("div", { key: 'f387d5bc8389c756ed527b5a3b90f4622b3cc97c', id: "ls-mid-area" }, index.h("div", { key: '670fef66b54c73e52b707fc27e6cd058765c2dd2', class: 'document-frame-wrapper', id: "document-frame-wrapper" }, index.h("div", { key: '2321a7a20cbd67b5e55607bd54b0bfb8fb5c2dc8', id: "ls-document-frame" }, index.h("canvas", { key: '76ec82c4ae65781013f12fa382affd327c1271f2', id: "pdf-canvas", class: this.displayTable || this.isLoading ? 'hidden' : '' }), index.h("ls-editor-table", { key: 'a8ec99154542ae3d0290eb3c33d88e5c96cff78e', editor: this, class: this.displayTable ? '' : 'hidden' }), index.h("div", { key: '74d7d28664675bfe3c0b178f783fcfe155ac4544', id: "ls-box-selector" }))), index.h("ls-statusbar", { key: '44c7a537634f5ea25028942223a850804d0f9639', editor: this }))))));
|
|
25311
25318
|
}
|
|
25312
25319
|
static get watchers() { return {
|
|
25313
25320
|
"mode": ["modeHandler"],
|
|
@@ -25895,10 +25902,14 @@ const LsFieldContent = class {
|
|
|
25895
25902
|
this.update.emit(diffs);
|
|
25896
25903
|
}, delay);
|
|
25897
25904
|
}
|
|
25905
|
+
supportsValue() {
|
|
25906
|
+
const typesWithValue = ["signature", "intials", "image", "file", "signing", "date", "autosign", "regex"];
|
|
25907
|
+
return !typesWithValue.includes(this.dataItem?.elementType);
|
|
25908
|
+
}
|
|
25898
25909
|
render() {
|
|
25899
|
-
return (index.h(index.Host, { key: '
|
|
25910
|
+
return (index.h(index.Host, { key: '20ce159dc4152f65e0b0210eccb2eab973af8241' }, index.h("ls-props-section", { key: 'c9d8025b354e166b16699ac10a7699d6a3780c03', sectionTitle: "Field Type", sectionDescription: "The Field you currently have selected" }, index.h("ls-field-type-display", { key: 'ff03c5571b4b19a22059d34eeea633568635bb9f', fieldType: this.dataItem?.elementType, assignee: this.dataItem?.signer })), index.h("ls-props-section", { key: '1dc8dd9b52e20ca794b8a326250ddf81b6bf9355', sectionTitle: "Required Field", row: true }, index.h("ls-toggle", { key: '1406c81a96e437b9f4757f6bd1654f7508387b61', id: "toggle-required", checked: !this.dataItem?.optional, onValueChange: (ev) => this.alter({ optional: !ev.detail }) })), index.h("ls-props-section", { key: 'e247625d206cf48ce9903f213bc3568d333e7b98', sectionTitle: "Field Label", sectionDescription: "Add a label to clarify the information required from the Recipient." }, index.h("input", { key: '8e94c624afc3af83fc448aed69af434cb9c43e35', value: this.dataItem?.label, placeholder: "eg. Sign Here", onInput: (e) => this.alter({ label: e.target.value }) })), this.supportsValue() && (index.h("ls-props-section", { key: 'b729f4eea9b1a6097f7efbb62178d8684c4fbca4', sectionTitle: "Value", sectionDescription: "A prefilled value that can be altered by the signer." }, index.h("input", { key: 'ac48703e8da2d666c6804ba050483255432bdb7c', value: this.dataItem?.value, placeholder: "e.g. Gordon Smith", onInput: (e) => this.alter({ value: e.target.value }) }))), this.dataItem.validation === 20 && (index.h("ls-props-section", { key: '9226d7ebef28ee13f365eb8d6e756a783550898e', sectionTitle: "Options", sectionDescription: "Define the options available in the dropdown. One option per line." }, index.h("textarea", { key: '0238600016c642bc0b9e3a44c083086bab56c063', value: this.dataItem?.options, placeholder: "Option 1\nOption 2\nOption 3", onInput: (e) => this.alter({ options: e.target.value }) }))), this.showValidationTypes && (index.h("ls-props-section", { key: '4651e3e667c092921f227badbb4286ff1b3c54ef', sectionTitle: "Content Format", sectionDescription: "Select the specific format you want the Recipient to enter." }, index.h("ls-input-wrapper", { key: 'b66ae98ebd1a27180c6099346fad20aafe677e5e', select: true }, index.h("select", { key: 'fec14e36d47672718cf656542c2447abd9358967', onChange: (ev) => this.alter({ validation: parseInt(ev.target.value) }) }, validationTypes
|
|
25900
25911
|
.filter(type => type.formType === this.dataItem?.elementType)
|
|
25901
|
-
.map(type => (index.h("option", { selected: this.dataItem?.validation === type.id, value: type.id }, type.description))))))), index.h("slot", { key: '
|
|
25912
|
+
.map(type => (index.h("option", { selected: this.dataItem?.validation === type.id, value: type.id }, type.description))))))), index.h("slot", { key: '8b96944ac071c6b4041d3389cefe8e4712c984fb' })));
|
|
25902
25913
|
}
|
|
25903
25914
|
};
|
|
25904
25915
|
LsFieldContent.style = lsFieldContentCss;
|
|
@@ -34277,6 +34288,1515 @@ const LsToolboxField = class {
|
|
|
34277
34288
|
};
|
|
34278
34289
|
LsToolboxField.style = lsToolboxFieldCss;
|
|
34279
34290
|
|
|
34291
|
+
/**
|
|
34292
|
+
* Custom positioning reference element.
|
|
34293
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
34294
|
+
*/
|
|
34295
|
+
|
|
34296
|
+
const min = Math.min;
|
|
34297
|
+
const max = Math.max;
|
|
34298
|
+
const round = Math.round;
|
|
34299
|
+
const createCoords = v => ({
|
|
34300
|
+
x: v,
|
|
34301
|
+
y: v
|
|
34302
|
+
});
|
|
34303
|
+
const oppositeSideMap = {
|
|
34304
|
+
left: 'right',
|
|
34305
|
+
right: 'left',
|
|
34306
|
+
bottom: 'top',
|
|
34307
|
+
top: 'bottom'
|
|
34308
|
+
};
|
|
34309
|
+
const oppositeAlignmentMap = {
|
|
34310
|
+
start: 'end',
|
|
34311
|
+
end: 'start'
|
|
34312
|
+
};
|
|
34313
|
+
function clamp(start, value, end) {
|
|
34314
|
+
return max(start, min(value, end));
|
|
34315
|
+
}
|
|
34316
|
+
function evaluate(value, param) {
|
|
34317
|
+
return typeof value === 'function' ? value(param) : value;
|
|
34318
|
+
}
|
|
34319
|
+
function getSide(placement) {
|
|
34320
|
+
return placement.split('-')[0];
|
|
34321
|
+
}
|
|
34322
|
+
function getAlignment(placement) {
|
|
34323
|
+
return placement.split('-')[1];
|
|
34324
|
+
}
|
|
34325
|
+
function getOppositeAxis(axis) {
|
|
34326
|
+
return axis === 'x' ? 'y' : 'x';
|
|
34327
|
+
}
|
|
34328
|
+
function getAxisLength(axis) {
|
|
34329
|
+
return axis === 'y' ? 'height' : 'width';
|
|
34330
|
+
}
|
|
34331
|
+
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
34332
|
+
function getSideAxis(placement) {
|
|
34333
|
+
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
|
34334
|
+
}
|
|
34335
|
+
function getAlignmentAxis(placement) {
|
|
34336
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
34337
|
+
}
|
|
34338
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
34339
|
+
if (rtl === void 0) {
|
|
34340
|
+
rtl = false;
|
|
34341
|
+
}
|
|
34342
|
+
const alignment = getAlignment(placement);
|
|
34343
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
34344
|
+
const length = getAxisLength(alignmentAxis);
|
|
34345
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
34346
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
34347
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
34348
|
+
}
|
|
34349
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
34350
|
+
}
|
|
34351
|
+
function getExpandedPlacements(placement) {
|
|
34352
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
34353
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
34354
|
+
}
|
|
34355
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
34356
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
34357
|
+
}
|
|
34358
|
+
const lrPlacement = ['left', 'right'];
|
|
34359
|
+
const rlPlacement = ['right', 'left'];
|
|
34360
|
+
const tbPlacement = ['top', 'bottom'];
|
|
34361
|
+
const btPlacement = ['bottom', 'top'];
|
|
34362
|
+
function getSideList(side, isStart, rtl) {
|
|
34363
|
+
switch (side) {
|
|
34364
|
+
case 'top':
|
|
34365
|
+
case 'bottom':
|
|
34366
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
34367
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
34368
|
+
case 'left':
|
|
34369
|
+
case 'right':
|
|
34370
|
+
return isStart ? tbPlacement : btPlacement;
|
|
34371
|
+
default:
|
|
34372
|
+
return [];
|
|
34373
|
+
}
|
|
34374
|
+
}
|
|
34375
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
34376
|
+
const alignment = getAlignment(placement);
|
|
34377
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
34378
|
+
if (alignment) {
|
|
34379
|
+
list = list.map(side => side + "-" + alignment);
|
|
34380
|
+
if (flipAlignment) {
|
|
34381
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
34382
|
+
}
|
|
34383
|
+
}
|
|
34384
|
+
return list;
|
|
34385
|
+
}
|
|
34386
|
+
function getOppositePlacement(placement) {
|
|
34387
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
34388
|
+
}
|
|
34389
|
+
function expandPaddingObject(padding) {
|
|
34390
|
+
return {
|
|
34391
|
+
top: 0,
|
|
34392
|
+
right: 0,
|
|
34393
|
+
bottom: 0,
|
|
34394
|
+
left: 0,
|
|
34395
|
+
...padding
|
|
34396
|
+
};
|
|
34397
|
+
}
|
|
34398
|
+
function getPaddingObject(padding) {
|
|
34399
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
34400
|
+
top: padding,
|
|
34401
|
+
right: padding,
|
|
34402
|
+
bottom: padding,
|
|
34403
|
+
left: padding
|
|
34404
|
+
};
|
|
34405
|
+
}
|
|
34406
|
+
function rectToClientRect(rect) {
|
|
34407
|
+
const {
|
|
34408
|
+
x,
|
|
34409
|
+
y,
|
|
34410
|
+
width,
|
|
34411
|
+
height
|
|
34412
|
+
} = rect;
|
|
34413
|
+
return {
|
|
34414
|
+
width,
|
|
34415
|
+
height,
|
|
34416
|
+
top: y,
|
|
34417
|
+
left: x,
|
|
34418
|
+
right: x + width,
|
|
34419
|
+
bottom: y + height,
|
|
34420
|
+
x,
|
|
34421
|
+
y
|
|
34422
|
+
};
|
|
34423
|
+
}
|
|
34424
|
+
|
|
34425
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
34426
|
+
let {
|
|
34427
|
+
reference,
|
|
34428
|
+
floating
|
|
34429
|
+
} = _ref;
|
|
34430
|
+
const sideAxis = getSideAxis(placement);
|
|
34431
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
34432
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
34433
|
+
const side = getSide(placement);
|
|
34434
|
+
const isVertical = sideAxis === 'y';
|
|
34435
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
34436
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
34437
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
34438
|
+
let coords;
|
|
34439
|
+
switch (side) {
|
|
34440
|
+
case 'top':
|
|
34441
|
+
coords = {
|
|
34442
|
+
x: commonX,
|
|
34443
|
+
y: reference.y - floating.height
|
|
34444
|
+
};
|
|
34445
|
+
break;
|
|
34446
|
+
case 'bottom':
|
|
34447
|
+
coords = {
|
|
34448
|
+
x: commonX,
|
|
34449
|
+
y: reference.y + reference.height
|
|
34450
|
+
};
|
|
34451
|
+
break;
|
|
34452
|
+
case 'right':
|
|
34453
|
+
coords = {
|
|
34454
|
+
x: reference.x + reference.width,
|
|
34455
|
+
y: commonY
|
|
34456
|
+
};
|
|
34457
|
+
break;
|
|
34458
|
+
case 'left':
|
|
34459
|
+
coords = {
|
|
34460
|
+
x: reference.x - floating.width,
|
|
34461
|
+
y: commonY
|
|
34462
|
+
};
|
|
34463
|
+
break;
|
|
34464
|
+
default:
|
|
34465
|
+
coords = {
|
|
34466
|
+
x: reference.x,
|
|
34467
|
+
y: reference.y
|
|
34468
|
+
};
|
|
34469
|
+
}
|
|
34470
|
+
switch (getAlignment(placement)) {
|
|
34471
|
+
case 'start':
|
|
34472
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
34473
|
+
break;
|
|
34474
|
+
case 'end':
|
|
34475
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
34476
|
+
break;
|
|
34477
|
+
}
|
|
34478
|
+
return coords;
|
|
34479
|
+
}
|
|
34480
|
+
|
|
34481
|
+
/**
|
|
34482
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
34483
|
+
* next to a given reference element.
|
|
34484
|
+
*
|
|
34485
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
34486
|
+
* write one for the platform you are using Floating UI with.
|
|
34487
|
+
*/
|
|
34488
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
34489
|
+
const {
|
|
34490
|
+
placement = 'bottom',
|
|
34491
|
+
strategy = 'absolute',
|
|
34492
|
+
middleware = [],
|
|
34493
|
+
platform
|
|
34494
|
+
} = config;
|
|
34495
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
34496
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
34497
|
+
let rects = await platform.getElementRects({
|
|
34498
|
+
reference,
|
|
34499
|
+
floating,
|
|
34500
|
+
strategy
|
|
34501
|
+
});
|
|
34502
|
+
let {
|
|
34503
|
+
x,
|
|
34504
|
+
y
|
|
34505
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
34506
|
+
let statefulPlacement = placement;
|
|
34507
|
+
let middlewareData = {};
|
|
34508
|
+
let resetCount = 0;
|
|
34509
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
34510
|
+
const {
|
|
34511
|
+
name,
|
|
34512
|
+
fn
|
|
34513
|
+
} = validMiddleware[i];
|
|
34514
|
+
const {
|
|
34515
|
+
x: nextX,
|
|
34516
|
+
y: nextY,
|
|
34517
|
+
data,
|
|
34518
|
+
reset
|
|
34519
|
+
} = await fn({
|
|
34520
|
+
x,
|
|
34521
|
+
y,
|
|
34522
|
+
initialPlacement: placement,
|
|
34523
|
+
placement: statefulPlacement,
|
|
34524
|
+
strategy,
|
|
34525
|
+
middlewareData,
|
|
34526
|
+
rects,
|
|
34527
|
+
platform,
|
|
34528
|
+
elements: {
|
|
34529
|
+
reference,
|
|
34530
|
+
floating
|
|
34531
|
+
}
|
|
34532
|
+
});
|
|
34533
|
+
x = nextX != null ? nextX : x;
|
|
34534
|
+
y = nextY != null ? nextY : y;
|
|
34535
|
+
middlewareData = {
|
|
34536
|
+
...middlewareData,
|
|
34537
|
+
[name]: {
|
|
34538
|
+
...middlewareData[name],
|
|
34539
|
+
...data
|
|
34540
|
+
}
|
|
34541
|
+
};
|
|
34542
|
+
if (reset && resetCount <= 50) {
|
|
34543
|
+
resetCount++;
|
|
34544
|
+
if (typeof reset === 'object') {
|
|
34545
|
+
if (reset.placement) {
|
|
34546
|
+
statefulPlacement = reset.placement;
|
|
34547
|
+
}
|
|
34548
|
+
if (reset.rects) {
|
|
34549
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
34550
|
+
reference,
|
|
34551
|
+
floating,
|
|
34552
|
+
strategy
|
|
34553
|
+
}) : reset.rects;
|
|
34554
|
+
}
|
|
34555
|
+
({
|
|
34556
|
+
x,
|
|
34557
|
+
y
|
|
34558
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
34559
|
+
}
|
|
34560
|
+
i = -1;
|
|
34561
|
+
}
|
|
34562
|
+
}
|
|
34563
|
+
return {
|
|
34564
|
+
x,
|
|
34565
|
+
y,
|
|
34566
|
+
placement: statefulPlacement,
|
|
34567
|
+
strategy,
|
|
34568
|
+
middlewareData
|
|
34569
|
+
};
|
|
34570
|
+
};
|
|
34571
|
+
|
|
34572
|
+
/**
|
|
34573
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
34574
|
+
* element is overflowing a given clipping boundary on each side.
|
|
34575
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
34576
|
+
* - negative = how many pixels left before it will overflow
|
|
34577
|
+
* - 0 = lies flush with the boundary
|
|
34578
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
34579
|
+
*/
|
|
34580
|
+
async function detectOverflow(state, options) {
|
|
34581
|
+
var _await$platform$isEle;
|
|
34582
|
+
if (options === void 0) {
|
|
34583
|
+
options = {};
|
|
34584
|
+
}
|
|
34585
|
+
const {
|
|
34586
|
+
x,
|
|
34587
|
+
y,
|
|
34588
|
+
platform,
|
|
34589
|
+
rects,
|
|
34590
|
+
elements,
|
|
34591
|
+
strategy
|
|
34592
|
+
} = state;
|
|
34593
|
+
const {
|
|
34594
|
+
boundary = 'clippingAncestors',
|
|
34595
|
+
rootBoundary = 'viewport',
|
|
34596
|
+
elementContext = 'floating',
|
|
34597
|
+
altBoundary = false,
|
|
34598
|
+
padding = 0
|
|
34599
|
+
} = evaluate(options, state);
|
|
34600
|
+
const paddingObject = getPaddingObject(padding);
|
|
34601
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
34602
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
34603
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
34604
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
34605
|
+
boundary,
|
|
34606
|
+
rootBoundary,
|
|
34607
|
+
strategy
|
|
34608
|
+
}));
|
|
34609
|
+
const rect = elementContext === 'floating' ? {
|
|
34610
|
+
x,
|
|
34611
|
+
y,
|
|
34612
|
+
width: rects.floating.width,
|
|
34613
|
+
height: rects.floating.height
|
|
34614
|
+
} : rects.reference;
|
|
34615
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
34616
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
34617
|
+
x: 1,
|
|
34618
|
+
y: 1
|
|
34619
|
+
} : {
|
|
34620
|
+
x: 1,
|
|
34621
|
+
y: 1
|
|
34622
|
+
};
|
|
34623
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
34624
|
+
elements,
|
|
34625
|
+
rect,
|
|
34626
|
+
offsetParent,
|
|
34627
|
+
strategy
|
|
34628
|
+
}) : rect);
|
|
34629
|
+
return {
|
|
34630
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
34631
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
34632
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
34633
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
34634
|
+
};
|
|
34635
|
+
}
|
|
34636
|
+
|
|
34637
|
+
/**
|
|
34638
|
+
* Provides data to position an inner element of the floating element so that it
|
|
34639
|
+
* appears centered to the reference element.
|
|
34640
|
+
* @see https://floating-ui.com/docs/arrow
|
|
34641
|
+
*/
|
|
34642
|
+
const arrow$1 = options => ({
|
|
34643
|
+
name: 'arrow',
|
|
34644
|
+
options,
|
|
34645
|
+
async fn(state) {
|
|
34646
|
+
const {
|
|
34647
|
+
x,
|
|
34648
|
+
y,
|
|
34649
|
+
placement,
|
|
34650
|
+
rects,
|
|
34651
|
+
platform,
|
|
34652
|
+
elements,
|
|
34653
|
+
middlewareData
|
|
34654
|
+
} = state;
|
|
34655
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
34656
|
+
const {
|
|
34657
|
+
element,
|
|
34658
|
+
padding = 0
|
|
34659
|
+
} = evaluate(options, state) || {};
|
|
34660
|
+
if (element == null) {
|
|
34661
|
+
return {};
|
|
34662
|
+
}
|
|
34663
|
+
const paddingObject = getPaddingObject(padding);
|
|
34664
|
+
const coords = {
|
|
34665
|
+
x,
|
|
34666
|
+
y
|
|
34667
|
+
};
|
|
34668
|
+
const axis = getAlignmentAxis(placement);
|
|
34669
|
+
const length = getAxisLength(axis);
|
|
34670
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
34671
|
+
const isYAxis = axis === 'y';
|
|
34672
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
34673
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
34674
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
34675
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
34676
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
34677
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
34678
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
34679
|
+
|
|
34680
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
34681
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
34682
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
34683
|
+
}
|
|
34684
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
34685
|
+
|
|
34686
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
34687
|
+
// centered, modify the padding so that it is centered.
|
|
34688
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
34689
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
34690
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
34691
|
+
|
|
34692
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
34693
|
+
// point is outside the floating element's bounds.
|
|
34694
|
+
const min$1 = minPadding;
|
|
34695
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
34696
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
34697
|
+
const offset = clamp(min$1, center, max);
|
|
34698
|
+
|
|
34699
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
34700
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
34701
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
34702
|
+
// a single reset is performed when this is true.
|
|
34703
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
34704
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
34705
|
+
return {
|
|
34706
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
34707
|
+
data: {
|
|
34708
|
+
[axis]: offset,
|
|
34709
|
+
centerOffset: center - offset - alignmentOffset,
|
|
34710
|
+
...(shouldAddOffset && {
|
|
34711
|
+
alignmentOffset
|
|
34712
|
+
})
|
|
34713
|
+
},
|
|
34714
|
+
reset: shouldAddOffset
|
|
34715
|
+
};
|
|
34716
|
+
}
|
|
34717
|
+
});
|
|
34718
|
+
|
|
34719
|
+
/**
|
|
34720
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
34721
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
34722
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
34723
|
+
* @see https://floating-ui.com/docs/flip
|
|
34724
|
+
*/
|
|
34725
|
+
const flip$1 = function (options) {
|
|
34726
|
+
if (options === void 0) {
|
|
34727
|
+
options = {};
|
|
34728
|
+
}
|
|
34729
|
+
return {
|
|
34730
|
+
name: 'flip',
|
|
34731
|
+
options,
|
|
34732
|
+
async fn(state) {
|
|
34733
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
34734
|
+
const {
|
|
34735
|
+
placement,
|
|
34736
|
+
middlewareData,
|
|
34737
|
+
rects,
|
|
34738
|
+
initialPlacement,
|
|
34739
|
+
platform,
|
|
34740
|
+
elements
|
|
34741
|
+
} = state;
|
|
34742
|
+
const {
|
|
34743
|
+
mainAxis: checkMainAxis = true,
|
|
34744
|
+
crossAxis: checkCrossAxis = true,
|
|
34745
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
34746
|
+
fallbackStrategy = 'bestFit',
|
|
34747
|
+
fallbackAxisSideDirection = 'none',
|
|
34748
|
+
flipAlignment = true,
|
|
34749
|
+
...detectOverflowOptions
|
|
34750
|
+
} = evaluate(options, state);
|
|
34751
|
+
|
|
34752
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
34753
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
34754
|
+
// work.
|
|
34755
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
34756
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
34757
|
+
return {};
|
|
34758
|
+
}
|
|
34759
|
+
const side = getSide(placement);
|
|
34760
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
34761
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
34762
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
34763
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
34764
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
34765
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
34766
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
34767
|
+
}
|
|
34768
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
34769
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
34770
|
+
const overflows = [];
|
|
34771
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
34772
|
+
if (checkMainAxis) {
|
|
34773
|
+
overflows.push(overflow[side]);
|
|
34774
|
+
}
|
|
34775
|
+
if (checkCrossAxis) {
|
|
34776
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
34777
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
34778
|
+
}
|
|
34779
|
+
overflowsData = [...overflowsData, {
|
|
34780
|
+
placement,
|
|
34781
|
+
overflows
|
|
34782
|
+
}];
|
|
34783
|
+
|
|
34784
|
+
// One or more sides is overflowing.
|
|
34785
|
+
if (!overflows.every(side => side <= 0)) {
|
|
34786
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
34787
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
34788
|
+
const nextPlacement = placements[nextIndex];
|
|
34789
|
+
if (nextPlacement) {
|
|
34790
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
34791
|
+
if (!ignoreCrossAxisOverflow ||
|
|
34792
|
+
// We leave the current main axis only if every placement on that axis
|
|
34793
|
+
// overflows the main axis.
|
|
34794
|
+
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
34795
|
+
// Try next placement and re-run the lifecycle.
|
|
34796
|
+
return {
|
|
34797
|
+
data: {
|
|
34798
|
+
index: nextIndex,
|
|
34799
|
+
overflows: overflowsData
|
|
34800
|
+
},
|
|
34801
|
+
reset: {
|
|
34802
|
+
placement: nextPlacement
|
|
34803
|
+
}
|
|
34804
|
+
};
|
|
34805
|
+
}
|
|
34806
|
+
}
|
|
34807
|
+
|
|
34808
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
34809
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
34810
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
34811
|
+
|
|
34812
|
+
// Otherwise fallback.
|
|
34813
|
+
if (!resetPlacement) {
|
|
34814
|
+
switch (fallbackStrategy) {
|
|
34815
|
+
case 'bestFit':
|
|
34816
|
+
{
|
|
34817
|
+
var _overflowsData$filter2;
|
|
34818
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
34819
|
+
if (hasFallbackAxisSideDirection) {
|
|
34820
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
34821
|
+
return currentSideAxis === initialSideAxis ||
|
|
34822
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
34823
|
+
// reading directions favoring greater width.
|
|
34824
|
+
currentSideAxis === 'y';
|
|
34825
|
+
}
|
|
34826
|
+
return true;
|
|
34827
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
34828
|
+
if (placement) {
|
|
34829
|
+
resetPlacement = placement;
|
|
34830
|
+
}
|
|
34831
|
+
break;
|
|
34832
|
+
}
|
|
34833
|
+
case 'initialPlacement':
|
|
34834
|
+
resetPlacement = initialPlacement;
|
|
34835
|
+
break;
|
|
34836
|
+
}
|
|
34837
|
+
}
|
|
34838
|
+
if (placement !== resetPlacement) {
|
|
34839
|
+
return {
|
|
34840
|
+
reset: {
|
|
34841
|
+
placement: resetPlacement
|
|
34842
|
+
}
|
|
34843
|
+
};
|
|
34844
|
+
}
|
|
34845
|
+
}
|
|
34846
|
+
return {};
|
|
34847
|
+
}
|
|
34848
|
+
};
|
|
34849
|
+
};
|
|
34850
|
+
|
|
34851
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
34852
|
+
|
|
34853
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
34854
|
+
// Derivable.
|
|
34855
|
+
|
|
34856
|
+
async function convertValueToCoords(state, options) {
|
|
34857
|
+
const {
|
|
34858
|
+
placement,
|
|
34859
|
+
platform,
|
|
34860
|
+
elements
|
|
34861
|
+
} = state;
|
|
34862
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
34863
|
+
const side = getSide(placement);
|
|
34864
|
+
const alignment = getAlignment(placement);
|
|
34865
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
34866
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
34867
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
34868
|
+
const rawValue = evaluate(options, state);
|
|
34869
|
+
|
|
34870
|
+
// eslint-disable-next-line prefer-const
|
|
34871
|
+
let {
|
|
34872
|
+
mainAxis,
|
|
34873
|
+
crossAxis,
|
|
34874
|
+
alignmentAxis
|
|
34875
|
+
} = typeof rawValue === 'number' ? {
|
|
34876
|
+
mainAxis: rawValue,
|
|
34877
|
+
crossAxis: 0,
|
|
34878
|
+
alignmentAxis: null
|
|
34879
|
+
} : {
|
|
34880
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
34881
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
34882
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
34883
|
+
};
|
|
34884
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
34885
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
34886
|
+
}
|
|
34887
|
+
return isVertical ? {
|
|
34888
|
+
x: crossAxis * crossAxisMulti,
|
|
34889
|
+
y: mainAxis * mainAxisMulti
|
|
34890
|
+
} : {
|
|
34891
|
+
x: mainAxis * mainAxisMulti,
|
|
34892
|
+
y: crossAxis * crossAxisMulti
|
|
34893
|
+
};
|
|
34894
|
+
}
|
|
34895
|
+
|
|
34896
|
+
/**
|
|
34897
|
+
* Modifies the placement by translating the floating element along the
|
|
34898
|
+
* specified axes.
|
|
34899
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
34900
|
+
* object may be passed.
|
|
34901
|
+
* @see https://floating-ui.com/docs/offset
|
|
34902
|
+
*/
|
|
34903
|
+
const offset$1 = function (options) {
|
|
34904
|
+
if (options === void 0) {
|
|
34905
|
+
options = 0;
|
|
34906
|
+
}
|
|
34907
|
+
return {
|
|
34908
|
+
name: 'offset',
|
|
34909
|
+
options,
|
|
34910
|
+
async fn(state) {
|
|
34911
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
34912
|
+
const {
|
|
34913
|
+
x,
|
|
34914
|
+
y,
|
|
34915
|
+
placement,
|
|
34916
|
+
middlewareData
|
|
34917
|
+
} = state;
|
|
34918
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
34919
|
+
|
|
34920
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
34921
|
+
// then we don't need to change the positioning coordinates.
|
|
34922
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
34923
|
+
return {};
|
|
34924
|
+
}
|
|
34925
|
+
return {
|
|
34926
|
+
x: x + diffCoords.x,
|
|
34927
|
+
y: y + diffCoords.y,
|
|
34928
|
+
data: {
|
|
34929
|
+
...diffCoords,
|
|
34930
|
+
placement
|
|
34931
|
+
}
|
|
34932
|
+
};
|
|
34933
|
+
}
|
|
34934
|
+
};
|
|
34935
|
+
};
|
|
34936
|
+
|
|
34937
|
+
/**
|
|
34938
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
34939
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
34940
|
+
* @see https://floating-ui.com/docs/shift
|
|
34941
|
+
*/
|
|
34942
|
+
const shift$1 = function (options) {
|
|
34943
|
+
if (options === void 0) {
|
|
34944
|
+
options = {};
|
|
34945
|
+
}
|
|
34946
|
+
return {
|
|
34947
|
+
name: 'shift',
|
|
34948
|
+
options,
|
|
34949
|
+
async fn(state) {
|
|
34950
|
+
const {
|
|
34951
|
+
x,
|
|
34952
|
+
y,
|
|
34953
|
+
placement
|
|
34954
|
+
} = state;
|
|
34955
|
+
const {
|
|
34956
|
+
mainAxis: checkMainAxis = true,
|
|
34957
|
+
crossAxis: checkCrossAxis = false,
|
|
34958
|
+
limiter = {
|
|
34959
|
+
fn: _ref => {
|
|
34960
|
+
let {
|
|
34961
|
+
x,
|
|
34962
|
+
y
|
|
34963
|
+
} = _ref;
|
|
34964
|
+
return {
|
|
34965
|
+
x,
|
|
34966
|
+
y
|
|
34967
|
+
};
|
|
34968
|
+
}
|
|
34969
|
+
},
|
|
34970
|
+
...detectOverflowOptions
|
|
34971
|
+
} = evaluate(options, state);
|
|
34972
|
+
const coords = {
|
|
34973
|
+
x,
|
|
34974
|
+
y
|
|
34975
|
+
};
|
|
34976
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
34977
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
34978
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
34979
|
+
let mainAxisCoord = coords[mainAxis];
|
|
34980
|
+
let crossAxisCoord = coords[crossAxis];
|
|
34981
|
+
if (checkMainAxis) {
|
|
34982
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
34983
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
34984
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
34985
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
34986
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
34987
|
+
}
|
|
34988
|
+
if (checkCrossAxis) {
|
|
34989
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
34990
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
34991
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
34992
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
34993
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
34994
|
+
}
|
|
34995
|
+
const limitedCoords = limiter.fn({
|
|
34996
|
+
...state,
|
|
34997
|
+
[mainAxis]: mainAxisCoord,
|
|
34998
|
+
[crossAxis]: crossAxisCoord
|
|
34999
|
+
});
|
|
35000
|
+
return {
|
|
35001
|
+
...limitedCoords,
|
|
35002
|
+
data: {
|
|
35003
|
+
x: limitedCoords.x - x,
|
|
35004
|
+
y: limitedCoords.y - y,
|
|
35005
|
+
enabled: {
|
|
35006
|
+
[mainAxis]: checkMainAxis,
|
|
35007
|
+
[crossAxis]: checkCrossAxis
|
|
35008
|
+
}
|
|
35009
|
+
}
|
|
35010
|
+
};
|
|
35011
|
+
}
|
|
35012
|
+
};
|
|
35013
|
+
};
|
|
35014
|
+
|
|
35015
|
+
function hasWindow() {
|
|
35016
|
+
return typeof window !== 'undefined';
|
|
35017
|
+
}
|
|
35018
|
+
function getNodeName(node) {
|
|
35019
|
+
if (isNode(node)) {
|
|
35020
|
+
return (node.nodeName || '').toLowerCase();
|
|
35021
|
+
}
|
|
35022
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
35023
|
+
// returning `#document` an infinite loop won't occur.
|
|
35024
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
35025
|
+
return '#document';
|
|
35026
|
+
}
|
|
35027
|
+
function getWindow(node) {
|
|
35028
|
+
var _node$ownerDocument;
|
|
35029
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
35030
|
+
}
|
|
35031
|
+
function getDocumentElement(node) {
|
|
35032
|
+
var _ref;
|
|
35033
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
35034
|
+
}
|
|
35035
|
+
function isNode(value) {
|
|
35036
|
+
if (!hasWindow()) {
|
|
35037
|
+
return false;
|
|
35038
|
+
}
|
|
35039
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
35040
|
+
}
|
|
35041
|
+
function isElement(value) {
|
|
35042
|
+
if (!hasWindow()) {
|
|
35043
|
+
return false;
|
|
35044
|
+
}
|
|
35045
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
35046
|
+
}
|
|
35047
|
+
function isHTMLElement(value) {
|
|
35048
|
+
if (!hasWindow()) {
|
|
35049
|
+
return false;
|
|
35050
|
+
}
|
|
35051
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
35052
|
+
}
|
|
35053
|
+
function isShadowRoot(value) {
|
|
35054
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
35055
|
+
return false;
|
|
35056
|
+
}
|
|
35057
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
35058
|
+
}
|
|
35059
|
+
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
35060
|
+
function isOverflowElement(element) {
|
|
35061
|
+
const {
|
|
35062
|
+
overflow,
|
|
35063
|
+
overflowX,
|
|
35064
|
+
overflowY,
|
|
35065
|
+
display
|
|
35066
|
+
} = getComputedStyle$1(element);
|
|
35067
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
35068
|
+
}
|
|
35069
|
+
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
35070
|
+
function isTableElement(element) {
|
|
35071
|
+
return tableElements.has(getNodeName(element));
|
|
35072
|
+
}
|
|
35073
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
35074
|
+
function isTopLayer(element) {
|
|
35075
|
+
return topLayerSelectors.some(selector => {
|
|
35076
|
+
try {
|
|
35077
|
+
return element.matches(selector);
|
|
35078
|
+
} catch (_e) {
|
|
35079
|
+
return false;
|
|
35080
|
+
}
|
|
35081
|
+
});
|
|
35082
|
+
}
|
|
35083
|
+
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
35084
|
+
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
35085
|
+
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
35086
|
+
function isContainingBlock(elementOrCss) {
|
|
35087
|
+
const webkit = isWebKit();
|
|
35088
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
35089
|
+
|
|
35090
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
35091
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
35092
|
+
return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
|
|
35093
|
+
}
|
|
35094
|
+
function getContainingBlock(element) {
|
|
35095
|
+
let currentNode = getParentNode(element);
|
|
35096
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
35097
|
+
if (isContainingBlock(currentNode)) {
|
|
35098
|
+
return currentNode;
|
|
35099
|
+
} else if (isTopLayer(currentNode)) {
|
|
35100
|
+
return null;
|
|
35101
|
+
}
|
|
35102
|
+
currentNode = getParentNode(currentNode);
|
|
35103
|
+
}
|
|
35104
|
+
return null;
|
|
35105
|
+
}
|
|
35106
|
+
function isWebKit() {
|
|
35107
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
35108
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
35109
|
+
}
|
|
35110
|
+
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
35111
|
+
function isLastTraversableNode(node) {
|
|
35112
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
35113
|
+
}
|
|
35114
|
+
function getComputedStyle$1(element) {
|
|
35115
|
+
return getWindow(element).getComputedStyle(element);
|
|
35116
|
+
}
|
|
35117
|
+
function getNodeScroll(element) {
|
|
35118
|
+
if (isElement(element)) {
|
|
35119
|
+
return {
|
|
35120
|
+
scrollLeft: element.scrollLeft,
|
|
35121
|
+
scrollTop: element.scrollTop
|
|
35122
|
+
};
|
|
35123
|
+
}
|
|
35124
|
+
return {
|
|
35125
|
+
scrollLeft: element.scrollX,
|
|
35126
|
+
scrollTop: element.scrollY
|
|
35127
|
+
};
|
|
35128
|
+
}
|
|
35129
|
+
function getParentNode(node) {
|
|
35130
|
+
if (getNodeName(node) === 'html') {
|
|
35131
|
+
return node;
|
|
35132
|
+
}
|
|
35133
|
+
const result =
|
|
35134
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
35135
|
+
node.assignedSlot ||
|
|
35136
|
+
// DOM Element detected.
|
|
35137
|
+
node.parentNode ||
|
|
35138
|
+
// ShadowRoot detected.
|
|
35139
|
+
isShadowRoot(node) && node.host ||
|
|
35140
|
+
// Fallback.
|
|
35141
|
+
getDocumentElement(node);
|
|
35142
|
+
return isShadowRoot(result) ? result.host : result;
|
|
35143
|
+
}
|
|
35144
|
+
function getNearestOverflowAncestor(node) {
|
|
35145
|
+
const parentNode = getParentNode(node);
|
|
35146
|
+
if (isLastTraversableNode(parentNode)) {
|
|
35147
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
35148
|
+
}
|
|
35149
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
35150
|
+
return parentNode;
|
|
35151
|
+
}
|
|
35152
|
+
return getNearestOverflowAncestor(parentNode);
|
|
35153
|
+
}
|
|
35154
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
35155
|
+
var _node$ownerDocument2;
|
|
35156
|
+
if (list === void 0) {
|
|
35157
|
+
list = [];
|
|
35158
|
+
}
|
|
35159
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
35160
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
35161
|
+
const win = getWindow(scrollableAncestor);
|
|
35162
|
+
if (isBody) {
|
|
35163
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], []);
|
|
35164
|
+
}
|
|
35165
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
|
|
35166
|
+
}
|
|
35167
|
+
function getFrameElement(win) {
|
|
35168
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
35169
|
+
}
|
|
35170
|
+
|
|
35171
|
+
function getCssDimensions(element) {
|
|
35172
|
+
const css = getComputedStyle$1(element);
|
|
35173
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
35174
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
35175
|
+
let width = parseFloat(css.width) || 0;
|
|
35176
|
+
let height = parseFloat(css.height) || 0;
|
|
35177
|
+
const hasOffset = isHTMLElement(element);
|
|
35178
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
35179
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
35180
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
35181
|
+
if (shouldFallback) {
|
|
35182
|
+
width = offsetWidth;
|
|
35183
|
+
height = offsetHeight;
|
|
35184
|
+
}
|
|
35185
|
+
return {
|
|
35186
|
+
width,
|
|
35187
|
+
height,
|
|
35188
|
+
$: shouldFallback
|
|
35189
|
+
};
|
|
35190
|
+
}
|
|
35191
|
+
|
|
35192
|
+
function unwrapElement(element) {
|
|
35193
|
+
return !isElement(element) ? element.contextElement : element;
|
|
35194
|
+
}
|
|
35195
|
+
|
|
35196
|
+
function getScale(element) {
|
|
35197
|
+
const domElement = unwrapElement(element);
|
|
35198
|
+
if (!isHTMLElement(domElement)) {
|
|
35199
|
+
return createCoords(1);
|
|
35200
|
+
}
|
|
35201
|
+
const rect = domElement.getBoundingClientRect();
|
|
35202
|
+
const {
|
|
35203
|
+
width,
|
|
35204
|
+
height,
|
|
35205
|
+
$
|
|
35206
|
+
} = getCssDimensions(domElement);
|
|
35207
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
35208
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
35209
|
+
|
|
35210
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
35211
|
+
|
|
35212
|
+
if (!x || !Number.isFinite(x)) {
|
|
35213
|
+
x = 1;
|
|
35214
|
+
}
|
|
35215
|
+
if (!y || !Number.isFinite(y)) {
|
|
35216
|
+
y = 1;
|
|
35217
|
+
}
|
|
35218
|
+
return {
|
|
35219
|
+
x,
|
|
35220
|
+
y
|
|
35221
|
+
};
|
|
35222
|
+
}
|
|
35223
|
+
|
|
35224
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
35225
|
+
function getVisualOffsets(element) {
|
|
35226
|
+
const win = getWindow(element);
|
|
35227
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
35228
|
+
return noOffsets;
|
|
35229
|
+
}
|
|
35230
|
+
return {
|
|
35231
|
+
x: win.visualViewport.offsetLeft,
|
|
35232
|
+
y: win.visualViewport.offsetTop
|
|
35233
|
+
};
|
|
35234
|
+
}
|
|
35235
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
35236
|
+
if (isFixed === void 0) {
|
|
35237
|
+
isFixed = false;
|
|
35238
|
+
}
|
|
35239
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
35240
|
+
return false;
|
|
35241
|
+
}
|
|
35242
|
+
return isFixed;
|
|
35243
|
+
}
|
|
35244
|
+
|
|
35245
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
35246
|
+
if (includeScale === void 0) {
|
|
35247
|
+
includeScale = false;
|
|
35248
|
+
}
|
|
35249
|
+
if (isFixedStrategy === void 0) {
|
|
35250
|
+
isFixedStrategy = false;
|
|
35251
|
+
}
|
|
35252
|
+
const clientRect = element.getBoundingClientRect();
|
|
35253
|
+
const domElement = unwrapElement(element);
|
|
35254
|
+
let scale = createCoords(1);
|
|
35255
|
+
if (includeScale) {
|
|
35256
|
+
if (offsetParent) {
|
|
35257
|
+
if (isElement(offsetParent)) {
|
|
35258
|
+
scale = getScale(offsetParent);
|
|
35259
|
+
}
|
|
35260
|
+
} else {
|
|
35261
|
+
scale = getScale(element);
|
|
35262
|
+
}
|
|
35263
|
+
}
|
|
35264
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
35265
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
35266
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
35267
|
+
let width = clientRect.width / scale.x;
|
|
35268
|
+
let height = clientRect.height / scale.y;
|
|
35269
|
+
if (domElement) {
|
|
35270
|
+
const win = getWindow(domElement);
|
|
35271
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
35272
|
+
let currentWin = win;
|
|
35273
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
35274
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
35275
|
+
const iframeScale = getScale(currentIFrame);
|
|
35276
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
35277
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
35278
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
35279
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
35280
|
+
x *= iframeScale.x;
|
|
35281
|
+
y *= iframeScale.y;
|
|
35282
|
+
width *= iframeScale.x;
|
|
35283
|
+
height *= iframeScale.y;
|
|
35284
|
+
x += left;
|
|
35285
|
+
y += top;
|
|
35286
|
+
currentWin = getWindow(currentIFrame);
|
|
35287
|
+
currentIFrame = getFrameElement(currentWin);
|
|
35288
|
+
}
|
|
35289
|
+
}
|
|
35290
|
+
return rectToClientRect({
|
|
35291
|
+
width,
|
|
35292
|
+
height,
|
|
35293
|
+
x,
|
|
35294
|
+
y
|
|
35295
|
+
});
|
|
35296
|
+
}
|
|
35297
|
+
|
|
35298
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
35299
|
+
// incorrect for RTL.
|
|
35300
|
+
function getWindowScrollBarX(element, rect) {
|
|
35301
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
35302
|
+
if (!rect) {
|
|
35303
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
35304
|
+
}
|
|
35305
|
+
return rect.left + leftScroll;
|
|
35306
|
+
}
|
|
35307
|
+
|
|
35308
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
35309
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
35310
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
35311
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
35312
|
+
return {
|
|
35313
|
+
x,
|
|
35314
|
+
y
|
|
35315
|
+
};
|
|
35316
|
+
}
|
|
35317
|
+
|
|
35318
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
35319
|
+
let {
|
|
35320
|
+
elements,
|
|
35321
|
+
rect,
|
|
35322
|
+
offsetParent,
|
|
35323
|
+
strategy
|
|
35324
|
+
} = _ref;
|
|
35325
|
+
const isFixed = strategy === 'fixed';
|
|
35326
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
35327
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
35328
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
35329
|
+
return rect;
|
|
35330
|
+
}
|
|
35331
|
+
let scroll = {
|
|
35332
|
+
scrollLeft: 0,
|
|
35333
|
+
scrollTop: 0
|
|
35334
|
+
};
|
|
35335
|
+
let scale = createCoords(1);
|
|
35336
|
+
const offsets = createCoords(0);
|
|
35337
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
35338
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
35339
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
35340
|
+
scroll = getNodeScroll(offsetParent);
|
|
35341
|
+
}
|
|
35342
|
+
if (isHTMLElement(offsetParent)) {
|
|
35343
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
35344
|
+
scale = getScale(offsetParent);
|
|
35345
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
35346
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
35347
|
+
}
|
|
35348
|
+
}
|
|
35349
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
35350
|
+
return {
|
|
35351
|
+
width: rect.width * scale.x,
|
|
35352
|
+
height: rect.height * scale.y,
|
|
35353
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
35354
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
35355
|
+
};
|
|
35356
|
+
}
|
|
35357
|
+
|
|
35358
|
+
function getClientRects(element) {
|
|
35359
|
+
return Array.from(element.getClientRects());
|
|
35360
|
+
}
|
|
35361
|
+
|
|
35362
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
35363
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
35364
|
+
function getDocumentRect(element) {
|
|
35365
|
+
const html = getDocumentElement(element);
|
|
35366
|
+
const scroll = getNodeScroll(element);
|
|
35367
|
+
const body = element.ownerDocument.body;
|
|
35368
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
35369
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
35370
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
35371
|
+
const y = -scroll.scrollTop;
|
|
35372
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
35373
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
35374
|
+
}
|
|
35375
|
+
return {
|
|
35376
|
+
width,
|
|
35377
|
+
height,
|
|
35378
|
+
x,
|
|
35379
|
+
y
|
|
35380
|
+
};
|
|
35381
|
+
}
|
|
35382
|
+
|
|
35383
|
+
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
35384
|
+
// calculation is affected by unusual styles.
|
|
35385
|
+
// Most scrollbars leave 15-18px of space.
|
|
35386
|
+
const SCROLLBAR_MAX = 25;
|
|
35387
|
+
function getViewportRect(element, strategy) {
|
|
35388
|
+
const win = getWindow(element);
|
|
35389
|
+
const html = getDocumentElement(element);
|
|
35390
|
+
const visualViewport = win.visualViewport;
|
|
35391
|
+
let width = html.clientWidth;
|
|
35392
|
+
let height = html.clientHeight;
|
|
35393
|
+
let x = 0;
|
|
35394
|
+
let y = 0;
|
|
35395
|
+
if (visualViewport) {
|
|
35396
|
+
width = visualViewport.width;
|
|
35397
|
+
height = visualViewport.height;
|
|
35398
|
+
const visualViewportBased = isWebKit();
|
|
35399
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
35400
|
+
x = visualViewport.offsetLeft;
|
|
35401
|
+
y = visualViewport.offsetTop;
|
|
35402
|
+
}
|
|
35403
|
+
}
|
|
35404
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
35405
|
+
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
35406
|
+
// visual width of the <html> but this is not considered in the size
|
|
35407
|
+
// of `html.clientWidth`.
|
|
35408
|
+
if (windowScrollbarX <= 0) {
|
|
35409
|
+
const doc = html.ownerDocument;
|
|
35410
|
+
const body = doc.body;
|
|
35411
|
+
const bodyStyles = getComputedStyle(body);
|
|
35412
|
+
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
35413
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
35414
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
35415
|
+
width -= clippingStableScrollbarWidth;
|
|
35416
|
+
}
|
|
35417
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
35418
|
+
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
35419
|
+
// by the scrollbar amount so there isn't extra space on the right.
|
|
35420
|
+
width += windowScrollbarX;
|
|
35421
|
+
}
|
|
35422
|
+
return {
|
|
35423
|
+
width,
|
|
35424
|
+
height,
|
|
35425
|
+
x,
|
|
35426
|
+
y
|
|
35427
|
+
};
|
|
35428
|
+
}
|
|
35429
|
+
|
|
35430
|
+
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
35431
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
35432
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
35433
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
35434
|
+
const top = clientRect.top + element.clientTop;
|
|
35435
|
+
const left = clientRect.left + element.clientLeft;
|
|
35436
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
35437
|
+
const width = element.clientWidth * scale.x;
|
|
35438
|
+
const height = element.clientHeight * scale.y;
|
|
35439
|
+
const x = left * scale.x;
|
|
35440
|
+
const y = top * scale.y;
|
|
35441
|
+
return {
|
|
35442
|
+
width,
|
|
35443
|
+
height,
|
|
35444
|
+
x,
|
|
35445
|
+
y
|
|
35446
|
+
};
|
|
35447
|
+
}
|
|
35448
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
35449
|
+
let rect;
|
|
35450
|
+
if (clippingAncestor === 'viewport') {
|
|
35451
|
+
rect = getViewportRect(element, strategy);
|
|
35452
|
+
} else if (clippingAncestor === 'document') {
|
|
35453
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
35454
|
+
} else if (isElement(clippingAncestor)) {
|
|
35455
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
35456
|
+
} else {
|
|
35457
|
+
const visualOffsets = getVisualOffsets(element);
|
|
35458
|
+
rect = {
|
|
35459
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
35460
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
35461
|
+
width: clippingAncestor.width,
|
|
35462
|
+
height: clippingAncestor.height
|
|
35463
|
+
};
|
|
35464
|
+
}
|
|
35465
|
+
return rectToClientRect(rect);
|
|
35466
|
+
}
|
|
35467
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
35468
|
+
const parentNode = getParentNode(element);
|
|
35469
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
35470
|
+
return false;
|
|
35471
|
+
}
|
|
35472
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
35473
|
+
}
|
|
35474
|
+
|
|
35475
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
35476
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
35477
|
+
// of the given element up the tree.
|
|
35478
|
+
function getClippingElementAncestors(element, cache) {
|
|
35479
|
+
const cachedResult = cache.get(element);
|
|
35480
|
+
if (cachedResult) {
|
|
35481
|
+
return cachedResult;
|
|
35482
|
+
}
|
|
35483
|
+
let result = getOverflowAncestors(element, []).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
35484
|
+
let currentContainingBlockComputedStyle = null;
|
|
35485
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
35486
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
35487
|
+
|
|
35488
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
35489
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
35490
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
35491
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
35492
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
35493
|
+
currentContainingBlockComputedStyle = null;
|
|
35494
|
+
}
|
|
35495
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
35496
|
+
if (shouldDropCurrentNode) {
|
|
35497
|
+
// Drop non-containing blocks.
|
|
35498
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
35499
|
+
} else {
|
|
35500
|
+
// Record last containing block for next iteration.
|
|
35501
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
35502
|
+
}
|
|
35503
|
+
currentNode = getParentNode(currentNode);
|
|
35504
|
+
}
|
|
35505
|
+
cache.set(element, result);
|
|
35506
|
+
return result;
|
|
35507
|
+
}
|
|
35508
|
+
|
|
35509
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
35510
|
+
// clipping ancestors.
|
|
35511
|
+
function getClippingRect(_ref) {
|
|
35512
|
+
let {
|
|
35513
|
+
element,
|
|
35514
|
+
boundary,
|
|
35515
|
+
rootBoundary,
|
|
35516
|
+
strategy
|
|
35517
|
+
} = _ref;
|
|
35518
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
35519
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
35520
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
35521
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
35522
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
35523
|
+
accRect.top = max(rect.top, accRect.top);
|
|
35524
|
+
accRect.right = min(rect.right, accRect.right);
|
|
35525
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
35526
|
+
accRect.left = max(rect.left, accRect.left);
|
|
35527
|
+
return accRect;
|
|
35528
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
35529
|
+
return {
|
|
35530
|
+
width: clippingRect.right - clippingRect.left,
|
|
35531
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
35532
|
+
x: clippingRect.left,
|
|
35533
|
+
y: clippingRect.top
|
|
35534
|
+
};
|
|
35535
|
+
}
|
|
35536
|
+
|
|
35537
|
+
function getDimensions(element) {
|
|
35538
|
+
const {
|
|
35539
|
+
width,
|
|
35540
|
+
height
|
|
35541
|
+
} = getCssDimensions(element);
|
|
35542
|
+
return {
|
|
35543
|
+
width,
|
|
35544
|
+
height
|
|
35545
|
+
};
|
|
35546
|
+
}
|
|
35547
|
+
|
|
35548
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
35549
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
35550
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
35551
|
+
const isFixed = strategy === 'fixed';
|
|
35552
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
35553
|
+
let scroll = {
|
|
35554
|
+
scrollLeft: 0,
|
|
35555
|
+
scrollTop: 0
|
|
35556
|
+
};
|
|
35557
|
+
const offsets = createCoords(0);
|
|
35558
|
+
|
|
35559
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
35560
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
35561
|
+
function setLeftRTLScrollbarOffset() {
|
|
35562
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
35563
|
+
}
|
|
35564
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
35565
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
35566
|
+
scroll = getNodeScroll(offsetParent);
|
|
35567
|
+
}
|
|
35568
|
+
if (isOffsetParentAnElement) {
|
|
35569
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
35570
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
35571
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
35572
|
+
} else if (documentElement) {
|
|
35573
|
+
setLeftRTLScrollbarOffset();
|
|
35574
|
+
}
|
|
35575
|
+
}
|
|
35576
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
35577
|
+
setLeftRTLScrollbarOffset();
|
|
35578
|
+
}
|
|
35579
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
35580
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
35581
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
35582
|
+
return {
|
|
35583
|
+
x,
|
|
35584
|
+
y,
|
|
35585
|
+
width: rect.width,
|
|
35586
|
+
height: rect.height
|
|
35587
|
+
};
|
|
35588
|
+
}
|
|
35589
|
+
|
|
35590
|
+
function isStaticPositioned(element) {
|
|
35591
|
+
return getComputedStyle$1(element).position === 'static';
|
|
35592
|
+
}
|
|
35593
|
+
|
|
35594
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
35595
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
35596
|
+
return null;
|
|
35597
|
+
}
|
|
35598
|
+
if (polyfill) {
|
|
35599
|
+
return polyfill(element);
|
|
35600
|
+
}
|
|
35601
|
+
let rawOffsetParent = element.offsetParent;
|
|
35602
|
+
|
|
35603
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
35604
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
35605
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
35606
|
+
// non-static.
|
|
35607
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
35608
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
35609
|
+
}
|
|
35610
|
+
return rawOffsetParent;
|
|
35611
|
+
}
|
|
35612
|
+
|
|
35613
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
35614
|
+
// such as table ancestors and cross browser bugs.
|
|
35615
|
+
function getOffsetParent(element, polyfill) {
|
|
35616
|
+
const win = getWindow(element);
|
|
35617
|
+
if (isTopLayer(element)) {
|
|
35618
|
+
return win;
|
|
35619
|
+
}
|
|
35620
|
+
if (!isHTMLElement(element)) {
|
|
35621
|
+
let svgOffsetParent = getParentNode(element);
|
|
35622
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
35623
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
35624
|
+
return svgOffsetParent;
|
|
35625
|
+
}
|
|
35626
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
35627
|
+
}
|
|
35628
|
+
return win;
|
|
35629
|
+
}
|
|
35630
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
35631
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
35632
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
35633
|
+
}
|
|
35634
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
35635
|
+
return win;
|
|
35636
|
+
}
|
|
35637
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
35638
|
+
}
|
|
35639
|
+
|
|
35640
|
+
const getElementRects = async function (data) {
|
|
35641
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
35642
|
+
const getDimensionsFn = this.getDimensions;
|
|
35643
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
35644
|
+
return {
|
|
35645
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
35646
|
+
floating: {
|
|
35647
|
+
x: 0,
|
|
35648
|
+
y: 0,
|
|
35649
|
+
width: floatingDimensions.width,
|
|
35650
|
+
height: floatingDimensions.height
|
|
35651
|
+
}
|
|
35652
|
+
};
|
|
35653
|
+
};
|
|
35654
|
+
|
|
35655
|
+
function isRTL(element) {
|
|
35656
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
35657
|
+
}
|
|
35658
|
+
|
|
35659
|
+
const platform = {
|
|
35660
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
35661
|
+
getDocumentElement,
|
|
35662
|
+
getClippingRect,
|
|
35663
|
+
getOffsetParent,
|
|
35664
|
+
getElementRects,
|
|
35665
|
+
getClientRects,
|
|
35666
|
+
getDimensions,
|
|
35667
|
+
getScale,
|
|
35668
|
+
isElement,
|
|
35669
|
+
isRTL
|
|
35670
|
+
};
|
|
35671
|
+
|
|
35672
|
+
/**
|
|
35673
|
+
* Modifies the placement by translating the floating element along the
|
|
35674
|
+
* specified axes.
|
|
35675
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
35676
|
+
* object may be passed.
|
|
35677
|
+
* @see https://floating-ui.com/docs/offset
|
|
35678
|
+
*/
|
|
35679
|
+
const offset = offset$1;
|
|
35680
|
+
|
|
35681
|
+
/**
|
|
35682
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
35683
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
35684
|
+
* @see https://floating-ui.com/docs/shift
|
|
35685
|
+
*/
|
|
35686
|
+
const shift = shift$1;
|
|
35687
|
+
|
|
35688
|
+
/**
|
|
35689
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
35690
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
35691
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
35692
|
+
* @see https://floating-ui.com/docs/flip
|
|
35693
|
+
*/
|
|
35694
|
+
const flip = flip$1;
|
|
35695
|
+
|
|
35696
|
+
/**
|
|
35697
|
+
* Provides data to position an inner element of the floating element so that it
|
|
35698
|
+
* appears centered to the reference element.
|
|
35699
|
+
* @see https://floating-ui.com/docs/arrow
|
|
35700
|
+
*/
|
|
35701
|
+
const arrow = arrow$1;
|
|
35702
|
+
|
|
35703
|
+
/**
|
|
35704
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
35705
|
+
* next to a given reference element.
|
|
35706
|
+
*/
|
|
35707
|
+
const computePosition = (reference, floating, options) => {
|
|
35708
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
35709
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
35710
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
35711
|
+
const cache = new Map();
|
|
35712
|
+
const mergedOptions = {
|
|
35713
|
+
platform,
|
|
35714
|
+
...options
|
|
35715
|
+
};
|
|
35716
|
+
const platformWithCache = {
|
|
35717
|
+
...mergedOptions.platform,
|
|
35718
|
+
_c: cache
|
|
35719
|
+
};
|
|
35720
|
+
return computePosition$1(reference, floating, {
|
|
35721
|
+
...mergedOptions,
|
|
35722
|
+
platform: platformWithCache
|
|
35723
|
+
});
|
|
35724
|
+
};
|
|
35725
|
+
|
|
35726
|
+
const lsTooltipCss = ".tooltip{display:none;position:absolute;border-radius:0.5rem;background:var(--gray-100, #45484d);color:var(--white, #fff);font-size:0.75rem;font-style:normal;font-weight:400;line-height:1rem;padding:0.5rem 0.75rem;max-width:300px;width:max-content;z-index:1000;box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 -1px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);transition:all 0.2s ease}#arrow{position:absolute;background:var(--gray-100, #45484d);width:0.625rem;height:0.625rem;transform:rotate(45deg);border-radius:0.125rem}";
|
|
35727
|
+
|
|
35728
|
+
const LsTooltip = class {
|
|
35729
|
+
constructor(hostRef) {
|
|
35730
|
+
index.registerInstance(this, hostRef);
|
|
35731
|
+
}
|
|
35732
|
+
get el() { return index.getElement(this); }
|
|
35733
|
+
referenceElement;
|
|
35734
|
+
placement = 'top';
|
|
35735
|
+
tooltipEl;
|
|
35736
|
+
tooltipLocked = false;
|
|
35737
|
+
componentDidLoad() {
|
|
35738
|
+
this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip');
|
|
35739
|
+
const arrowElement = this.el.shadowRoot.querySelector('#arrow'); // use shadowRoot for internal elements
|
|
35740
|
+
if (!this.tooltipEl || !this.referenceElement)
|
|
35741
|
+
return;
|
|
35742
|
+
const update = () => {
|
|
35743
|
+
computePosition(this.referenceElement, this.tooltipEl, {
|
|
35744
|
+
placement: this.placement,
|
|
35745
|
+
middleware: [offset(6), flip(), shift({ padding: 5 }), arrow({ element: arrowElement })],
|
|
35746
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
35747
|
+
Object.assign(this.tooltipEl.style, {
|
|
35748
|
+
left: `${x}px`,
|
|
35749
|
+
top: `${y}px`,
|
|
35750
|
+
});
|
|
35751
|
+
const { x: arrowX, y: arrowY } = middlewareData.arrow || {};
|
|
35752
|
+
const staticSide = {
|
|
35753
|
+
top: 'bottom',
|
|
35754
|
+
right: 'left',
|
|
35755
|
+
bottom: 'top',
|
|
35756
|
+
left: 'right',
|
|
35757
|
+
}[placement.split('-')[0]];
|
|
35758
|
+
Object.assign(arrowElement.style, {
|
|
35759
|
+
left: arrowX != null ? `${arrowX}px` : '',
|
|
35760
|
+
top: arrowY != null ? `${arrowY}px` : '',
|
|
35761
|
+
right: '',
|
|
35762
|
+
bottom: '',
|
|
35763
|
+
[staticSide]: '-4px',
|
|
35764
|
+
});
|
|
35765
|
+
});
|
|
35766
|
+
};
|
|
35767
|
+
const showTooltip = () => {
|
|
35768
|
+
if (this.tooltipLocked)
|
|
35769
|
+
return;
|
|
35770
|
+
this.tooltipEl.style.display = 'block';
|
|
35771
|
+
update();
|
|
35772
|
+
};
|
|
35773
|
+
const hideTooltip = () => {
|
|
35774
|
+
if (this.tooltipLocked)
|
|
35775
|
+
return;
|
|
35776
|
+
this.tooltipEl.style.display = 'none';
|
|
35777
|
+
};
|
|
35778
|
+
[
|
|
35779
|
+
['mouseenter', showTooltip],
|
|
35780
|
+
['mouseleave', hideTooltip],
|
|
35781
|
+
['focus', showTooltip],
|
|
35782
|
+
['blur', hideTooltip],
|
|
35783
|
+
].forEach(([event, listener]) => {
|
|
35784
|
+
this.referenceElement.addEventListener(event, listener);
|
|
35785
|
+
});
|
|
35786
|
+
this.referenceElement.addEventListener('click', () => {
|
|
35787
|
+
hideTooltip();
|
|
35788
|
+
this.tooltipLocked = true;
|
|
35789
|
+
setTimeout(() => {
|
|
35790
|
+
this.tooltipLocked = false;
|
|
35791
|
+
}, 500);
|
|
35792
|
+
});
|
|
35793
|
+
}
|
|
35794
|
+
render() {
|
|
35795
|
+
return (index.h("div", { key: '9daf5991d54ab56094ae8a28203d7b896ce2dd81', class: "tooltip", role: "tooltip" }, index.h("div", { key: 'e483907ce2f3ca0ee927f9b1fc116c3d957a575e', id: "arrow" }), index.h("slot", { key: '176202c5c2d38da7236e6b4519f93cf1d7cc1e87' })));
|
|
35796
|
+
}
|
|
35797
|
+
};
|
|
35798
|
+
LsTooltip.style = lsTooltipCss;
|
|
35799
|
+
|
|
34280
35800
|
const lsValidationTagCss = ":host{position:relative}*{box-sizing:border-box;margin:0}.valid-label{display:flex;padding:2px 0.5rem;justify-content:center;align-items:center;gap:0.25rem;border-radius:1rem;font-size:0.75rem;font-style:normal;font-weight:500;line-height:1.25rem;width:fit-content}.valid{background-color:var(--green-30, #9df5d4);color:var(--green-100, #125241)}.invalid{background:var(--yellow-20, #fff3c2);color:var(--yellow-90, #8a3f0e)}.field-counter{display:flex;padding:0.125rem;justify-content:center;align-items:center;border-radius:1rem;font-size:0.625rem;line-height:0.75rem;font-style:normal;font-weight:500;color:var(--yellow-20, #fff3c2);background:#e17100;min-width:1rem}.field-dropdown{position:absolute;top:2rem;right:0;background:white;display:flex;flex-direction:column;gap:0.75rem;width:20rem;padding:1rem;border-radius:1rem;border:1px solid #e5e7eb;background:#fff;box-shadow:0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);max-height:20rem;overflow-y:auto;flex-direction:column;align-items:flex-start;z-index:1000}.required-field{position:relative;display:flex;width:100%;justify-content:space-between;align-items:center;gap:0.5rem;border-radius:0.75rem;padding:0.5rem 0.5rem 0.5rem 1rem;background:var(--field-background);color:var(--field-text-color);border:1px solid var(--field-border-color);transition:all 0.1s ease-in-out}.required-field:hover{background:var(--field-background-hover);color:var(--field-text-color-hover);border:1px solid var(--field-border-color-hover);box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)}.required-field-items-left{display:flex;gap:0.5rem;align-items:center;width:100%}.required-field-items-left p{font-size:0.875rem;font-style:normal;font-weight:500;line-height:0.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dot{height:0.5rem;width:0.5rem;border-radius:50%}.role-label{display:flex;padding:2px 3px;justify-content:center;align-items:center;border-radius:0.25rem;font-size:0.75rem;font-style:normal;font-weight:400;line-height:1rem;text-transform:capitalize}.dropdown-header h2{color:var(--gray-100, #45484d);font-size:0.875rem;font-style:normal;font-weight:500;line-height:1.25rem;margin-bottom:0.125rem}.dropdown-header p{color:var(--gray-80, #6c6e73);font-size:0.75rem;font-style:normal;font-weight:400;line-height:1rem;}";
|
|
34281
35801
|
|
|
34282
35802
|
const LsValidationTag = class {
|
|
@@ -34286,8 +35806,11 @@ const LsValidationTag = class {
|
|
|
34286
35806
|
status = 'Invalid';
|
|
34287
35807
|
validationErrors = [];
|
|
34288
35808
|
isExpanded = false;
|
|
35809
|
+
validateChange(newValue) {
|
|
35810
|
+
console.log(newValue);
|
|
35811
|
+
}
|
|
34289
35812
|
render() {
|
|
34290
|
-
return (index.h(index.Host, { key: '
|
|
35813
|
+
return (index.h(index.Host, { key: '81f7243eb9ac2099bac672ce98f26e4da6bb8fed' }, index.h("div", { key: '33e7174b2032cc6282f84b26a4f943e1baac6dd9', class: `valid-label ${this.validationErrors.length === 0 ? 'valid' : 'invalid'}`, onClick: this.validationErrors.length && (() => (this.isExpanded = !this.isExpanded)) }, this.validationErrors.length === 0 ? 'Ready to Send' : `Requires Fields`, this.validationErrors.length > 0 && index.h("div", { key: '6b820c6a30a090d656c5a6a06b66c8c3cda8fa2c', class: 'field-counter' }, this.validationErrors.length), this.validationErrors.length > 0 && (index.h("ls-icon", { key: 'b4404382dea2c84c042dd1b330b2f0be823b643e', name: this.isExpanded ? 'chevron-up' : 'chevron-down', style: { cursor: 'pointer', scale: '0.60', margin: '0 -0.25rem' } }))), this.isExpanded && this.validationErrors.length !== 0 && (index.h("div", { key: 'eca209963d0acadbef0764909f15bb4a0350f4c6', class: 'field-dropdown' }, index.h("div", { key: '5a57240e85f7826049b12bda0f2cbfc72599c6b9', class: 'dropdown-header' }, index.h("h2", { key: '34bb3c2fac8a092cc424a4ebdce49137d6dcd384' }, "Signature Fields Required"), index.h("p", { key: 'cedda6d0383cd029efdd33fa7edfcd22c0cf65e2' }, this.validationErrors.length, " ", this.validationErrors.length === 1 ? 'Recipient needs a Signature Field' : 'Recipients need Signature Fields', " placed for them")), this.validationErrors.map((field, idx) => {
|
|
34291
35814
|
const signerIndex = field?.role?.signerIndex ? field?.role?.signerIndex % 100 : null;
|
|
34292
35815
|
const pallette = defaultRolePalette[signerIndex || field?.element?.signer || 0];
|
|
34293
35816
|
return (index.h("div", { key: idx, class: 'required-field', style: {
|
|
@@ -34297,9 +35820,12 @@ const LsValidationTag = class {
|
|
|
34297
35820
|
'--field-text-color': pallette.s70,
|
|
34298
35821
|
'--field-text-color-hover': pallette.s80,
|
|
34299
35822
|
'--field-border-color-hover': pallette.s60,
|
|
34300
|
-
} }, index.h("div", { class: 'required-field-items-left' }, index.h("div", { class: 'dot', style: { background: pallette.s60 } }), field?.role && (index.h("div", { class: 'required-field-items-left' }, index.h("p", { style: { color: pallette.s80 } }, field.role?.name || `Signer ${field?.role?.signerIndex + 1}`), index.h("div", { class: 'role-label', style: { background: pallette.s30, color: pallette.s70 } }, field.role?.roleType.toLowerCase() || `Signer ${field.role?.signerIndex + 1}`))), field?.element && (index.h(index.h.Fragment, null, index.h("p", { style: { color: pallette.s80 } }, field.role?.name || `${field.element.formElementType} ${field?.element?.label + 1}`), index.h("div", { class: 'role-label', style: { background: pallette.s30, color: pallette.s70 } }, field.description))))
|
|
35823
|
+
} }, index.h("div", { class: 'required-field-items-left' }, index.h("div", { class: 'dot', style: { background: pallette.s60 } }), field?.role && (index.h("div", { class: 'required-field-items-left' }, index.h("p", { style: { color: pallette.s80 } }, field.role?.name || `Signer ${field?.role?.signerIndex + 1}`), index.h("div", { class: 'role-label', style: { background: pallette.s30, color: pallette.s70 } }, field.role?.roleType.toLowerCase() || `Signer ${field.role?.signerIndex + 1}`))), field?.element && (index.h(index.h.Fragment, null, index.h("p", { style: { color: pallette.s80 } }, field.role?.name || `${field.element.formElementType} ${field?.element?.label + 1}`), index.h("div", { class: 'role-label', style: { background: pallette.s30, color: pallette.s70 } }, field.description))))));
|
|
34301
35824
|
})))));
|
|
34302
35825
|
}
|
|
35826
|
+
static get watchers() { return {
|
|
35827
|
+
"validationErrors": ["validateChange"]
|
|
35828
|
+
}; }
|
|
34303
35829
|
};
|
|
34304
35830
|
LsValidationTag.style = lsValidationTagCss;
|
|
34305
35831
|
|
|
@@ -34341,7 +35867,8 @@ exports.ls_statusbar = LsStatusbar;
|
|
|
34341
35867
|
exports.ls_toggle = LsToggle;
|
|
34342
35868
|
exports.ls_toolbar = LsToolbar;
|
|
34343
35869
|
exports.ls_toolbox_field = LsToolboxField;
|
|
35870
|
+
exports.ls_tooltip = LsTooltip;
|
|
34344
35871
|
exports.ls_validation_tag = LsValidationTag;
|
|
34345
|
-
//# sourceMappingURL=ls-document-options.ls-document-viewer.ls-editor-field.ls-editor-table.ls-feature-column.ls-field-alignment.ls-field-content.ls-field-dimensions.ls-field-distribute.ls-field-footer.ls-field-format.ls-field-placement.ls-field-properties.ls-field-properties-advanced.ls-field-properties-autosign.ls-field-properties-container.ls-field-properties-date.ls-field-properties-email.ls-field-properties-file.ls-field-properties-general.ls-field-properties-image.ls-field-properties-multiple.ls-field-properties-number.ls-field-properties-signature.ls-field-properties-text.ls-field-size.ls-field-type-display.ls-icon.ls-input-wrapper.ls-page-loader.ls-participant-card.ls-participant-manager.ls-participant-select.ls-props-section.ls-statusbar.ls-toggle.ls-toolbar.ls-toolbox-field.ls-validation-tag.entry.cjs.js.map
|
|
35872
|
+
//# sourceMappingURL=ls-document-options.ls-document-viewer.ls-editor-field.ls-editor-table.ls-feature-column.ls-field-alignment.ls-field-content.ls-field-dimensions.ls-field-distribute.ls-field-footer.ls-field-format.ls-field-placement.ls-field-properties.ls-field-properties-advanced.ls-field-properties-autosign.ls-field-properties-container.ls-field-properties-date.ls-field-properties-email.ls-field-properties-file.ls-field-properties-general.ls-field-properties-image.ls-field-properties-multiple.ls-field-properties-number.ls-field-properties-signature.ls-field-properties-text.ls-field-size.ls-field-type-display.ls-icon.ls-input-wrapper.ls-page-loader.ls-participant-card.ls-participant-manager.ls-participant-select.ls-props-section.ls-statusbar.ls-toggle.ls-toolbar.ls-toolbox-field.ls-tooltip.ls-validation-tag.entry.cjs.js.map
|
|
34346
35873
|
|
|
34347
|
-
//# sourceMappingURL=ls-document-
|
|
35874
|
+
//# sourceMappingURL=ls-document-options_40.cjs.entry.js.map
|