legalesign-document-viewer 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{ls-document-options_35.cjs.entry.js → ls-document-options_36.cjs.entry.js} +501 -128
- package/dist/cjs/ls-document-options_36.cjs.entry.js.map +1 -0
- package/dist/cjs/ls-document-viewer.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ls-document-viewer/adapter/LsDocumentAdapter.js +1 -1
- package/dist/collection/components/ls-document-viewer/adapter/LsDocumentAdapter.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/adapter/groupActions.js +96 -0
- package/dist/collection/components/ls-document-viewer/adapter/groupActions.js.map +1 -0
- package/dist/collection/components/ls-document-viewer/adapter/templateActions.js +7 -1
- package/dist/collection/components/ls-document-viewer/adapter/templateActions.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/defaultFieldIcons.js +19 -0
- package/dist/collection/components/ls-document-viewer/defaultFieldIcons.js.map +1 -0
- package/dist/collection/components/ls-document-viewer/defaultPalette.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/editorCalculator.js +2 -2
- package/dist/collection/components/ls-document-viewer/editorCalculator.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/editorUtils.js +31 -5
- package/dist/collection/components/ls-document-viewer/editorUtils.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.css +11 -1
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js +16 -11
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js.map +1 -1
- package/dist/collection/components/ls-editor-field/ls-editor-field.js +6 -4
- package/dist/collection/components/ls-editor-field/ls-editor-field.js.map +1 -1
- package/dist/collection/components/ls-field-alignment/ls-field-alignment.css +98 -28
- package/dist/collection/components/ls-field-alignment/ls-field-alignment.js +26 -20
- package/dist/collection/components/ls-field-alignment/ls-field-alignment.js.map +1 -1
- package/dist/collection/components/ls-field-dimensions/ls-field-dimensions.js +1 -1
- package/dist/collection/components/ls-field-dimensions/ls-field-dimensions.js.map +1 -1
- package/dist/collection/components/ls-field-distribute/ls-field-distribute.css +100 -33
- package/dist/collection/components/ls-field-distribute/ls-field-distribute.js +21 -15
- package/dist/collection/components/ls-field-distribute/ls-field-distribute.js.map +1 -1
- package/dist/collection/components/ls-field-footer/ls-field-footer.css +55 -0
- package/dist/collection/components/ls-field-footer/ls-field-footer.js +107 -0
- package/dist/collection/components/ls-field-footer/ls-field-footer.js.map +1 -0
- package/dist/collection/components/ls-field-format/ls-field-format.js +10 -10
- package/dist/collection/components/ls-field-placement/ls-field-placement.css +27 -9
- package/dist/collection/components/ls-field-placement/ls-field-placement.js +1 -1
- package/dist/collection/components/ls-field-placement/ls-field-placement.js.map +1 -1
- package/dist/collection/components/ls-field-properties/ls-field-properties.css +1 -0
- package/dist/collection/components/ls-field-properties/ls-field-properties.js +1 -1
- package/dist/collection/components/ls-field-properties-autosign/ls-field-properties-autosign.js +1 -1
- package/dist/collection/components/ls-field-properties-date/ls-field-properties-date.css +173 -10
- package/dist/collection/components/ls-field-properties-date/ls-field-properties-date.js +36 -1
- package/dist/collection/components/ls-field-properties-date/ls-field-properties-date.js.map +1 -1
- package/dist/collection/components/ls-field-properties-email/ls-field-properties-email.css +178 -4
- package/dist/collection/components/ls-field-properties-email/ls-field-properties-email.js +36 -1
- package/dist/collection/components/ls-field-properties-email/ls-field-properties-email.js.map +1 -1
- package/dist/collection/components/ls-field-properties-file/ls-field-properties-file.css +178 -3
- package/dist/collection/components/ls-field-properties-file/ls-field-properties-file.js +36 -1
- package/dist/collection/components/ls-field-properties-file/ls-field-properties-file.js.map +1 -1
- package/dist/collection/components/ls-field-properties-general/ls-field-properties-general.css +173 -10
- package/dist/collection/components/ls-field-properties-general/ls-field-properties-general.js +34 -1
- package/dist/collection/components/ls-field-properties-general/ls-field-properties-general.js.map +1 -1
- package/dist/collection/components/ls-field-properties-image/ls-field-properties-image.css +178 -3
- package/dist/collection/components/ls-field-properties-image/ls-field-properties-image.js +36 -1
- package/dist/collection/components/ls-field-properties-image/ls-field-properties-image.js.map +1 -1
- package/dist/collection/components/ls-field-properties-multiple/ls-field-properties-multiple.css +179 -3
- package/dist/collection/components/ls-field-properties-multiple/ls-field-properties-multiple.js +55 -1
- package/dist/collection/components/ls-field-properties-multiple/ls-field-properties-multiple.js.map +1 -1
- package/dist/collection/components/ls-field-properties-number/ls-field-properties-number.css +178 -3
- package/dist/collection/components/ls-field-properties-number/ls-field-properties-number.js +36 -1
- package/dist/collection/components/ls-field-properties-number/ls-field-properties-number.js.map +1 -1
- package/dist/collection/components/ls-field-properties-signature/ls-field-properties-signature.css +40 -4
- package/dist/collection/components/ls-field-properties-signature/ls-field-properties-signature.js +18 -3
- package/dist/collection/components/ls-field-properties-signature/ls-field-properties-signature.js.map +1 -1
- package/dist/collection/components/ls-field-properties-text/ls-field-properties-text.css +177 -3
- package/dist/collection/components/ls-field-properties-text/ls-field-properties-text.js +36 -1
- package/dist/collection/components/ls-field-properties-text/ls-field-properties-text.js.map +1 -1
- package/dist/collection/components/ls-field-size/ls-field-size.css +102 -27
- package/dist/collection/components/ls-field-size/ls-field-size.js +2 -2
- package/dist/collection/components/ls-field-size/ls-field-size.js.map +1 -1
- package/dist/collection/components/ls-formfield/inputs/ls-number-input/ls-number-input.js +3 -3
- package/dist/collection/components/ls-formfield/inputs/ls-radio-input/ls-radio-input.js +2 -2
- package/dist/collection/components/ls-formfield/inputs/ls-select-input/ls-select-input.js +3 -3
- package/dist/collection/components/ls-formfield/inputs/ls-text-input/ls-text-input.js +3 -3
- package/dist/collection/components/ls-formfield/inputs/ls-textarea-input/ls-textarea-input.js +3 -3
- package/dist/collection/components/ls-formfield/ls-formfield.js +5 -5
- package/dist/collection/components/ls-icon/icons.js +20 -0
- package/dist/collection/components/ls-icon/icons.js.map +1 -1
- package/dist/collection/components/ls-icon/ls-icon.js +2 -2
- package/dist/collection/components/ls-participant-manager/ls-participant-manager.js +10 -6
- package/dist/collection/components/ls-participant-manager/ls-participant-manager.js.map +1 -1
- package/dist/collection/components/ls-participant-select/ls-participant-select.css +4 -6
- package/dist/collection/components/ls-participant-select/ls-participant-select.js +22 -6
- package/dist/collection/components/ls-participant-select/ls-participant-select.js.map +1 -1
- package/dist/collection/components/ls-statusbar/ls-statusbar.js +3 -3
- package/dist/collection/components/ls-toggle/ls-toggle.js +1 -1
- package/dist/collection/components/ls-toolbar/ls-toolbar.js +1 -1
- package/dist/collection/components/ls-toolbar/ls-toolbar.js.map +1 -1
- package/dist/collection/components/ls-toolbox-field/ls-toolbox-field.css +3 -4
- package/dist/collection/components/ls-toolbox-field/ls-toolbox-field.js +26 -2
- package/dist/collection/components/ls-toolbox-field/ls-toolbox-field.js.map +1 -1
- package/dist/collection/types/Icon.js +1 -0
- package/dist/collection/types/Icon.js.map +1 -1
- package/dist/components/ls-document-options.js +1 -1
- package/dist/components/ls-document-viewer.js +169 -58
- package/dist/components/ls-document-viewer.js.map +1 -1
- package/dist/components/ls-editor-field.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-dimensions.js +1 -1
- package/dist/components/ls-field-distribute.js +1 -1
- package/dist/components/ls-field-footer.d.ts +11 -0
- package/dist/components/ls-field-footer.js +9 -0
- package/dist/components/ls-field-footer.js.map +1 -0
- package/dist/components/ls-field-format.js +1 -1
- package/dist/components/ls-field-placement.js +1 -1
- package/dist/components/ls-field-properties-autosign.js +1 -1
- package/dist/components/ls-field-properties-date.js +1 -1
- 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-formfield.js +1 -1
- package/dist/components/ls-icon.js +1 -1
- package/dist/components/ls-number-input.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-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/p-8Yvey07o.js +57 -0
- package/dist/components/p-8Yvey07o.js.map +1 -0
- package/dist/components/{p-Cs6tf1FE.js → p-9Z-GK0Bd.js} +3 -3
- package/dist/components/{p-Cs6tf1FE.js.map → p-9Z-GK0Bd.js.map} +1 -1
- package/dist/components/{p-DtHDNV_x.js → p-BFSBsh85.js} +24 -3
- package/dist/components/p-BFSBsh85.js.map +1 -0
- package/dist/components/p-BLkddRKK.js +77 -0
- package/dist/components/p-BLkddRKK.js.map +1 -0
- package/dist/components/{p-D2smwTu5.js → p-BM-Xo6D5.js} +7 -7
- package/dist/components/{p-D2smwTu5.js.map → p-BM-Xo6D5.js.map} +1 -1
- package/dist/components/{p-CjicL5jA.js → p-BPk0SaUp.js} +34 -8
- package/dist/components/p-BPk0SaUp.js.map +1 -0
- package/dist/components/p-BVXVFpxy.js +130 -0
- package/dist/components/p-BVXVFpxy.js.map +1 -0
- package/dist/components/{p-D7KC-w81.js → p-BdJAlep4.js} +10 -10
- package/dist/components/{p-D7KC-w81.js.map → p-BdJAlep4.js.map} +1 -1
- package/dist/components/{p-CpK4mw5O.js → p-BuX-_d2U.js} +3 -3
- package/dist/components/{p-CpK4mw5O.js.map → p-BuX-_d2U.js.map} +1 -1
- package/dist/components/{p-DTWaVEKo.js → p-BwymH8px.js} +53 -29
- package/dist/components/p-BwymH8px.js.map +1 -0
- package/dist/components/p-C00GqV9f.js.map +1 -1
- package/dist/components/{p-py-rQZsT.js → p-C9d-OiqW.js} +4 -4
- package/dist/components/p-C9d-OiqW.js.map +1 -0
- package/dist/components/p-CNDZcJZC.js +77 -0
- package/dist/components/p-CNDZcJZC.js.map +1 -0
- package/dist/components/p-CQr7nmKb.js +59 -0
- package/dist/components/p-CQr7nmKb.js.map +1 -0
- package/dist/components/p-CdEexh_g.js +84 -0
- package/dist/components/p-CdEexh_g.js.map +1 -0
- package/dist/components/{p-IGbuOsUA.js → p-CdL5cKO8.js} +4 -4
- package/dist/components/{p-IGbuOsUA.js.map → p-CdL5cKO8.js.map} +1 -1
- package/dist/components/p-ChfFmzMa.js +138 -0
- package/dist/components/p-ChfFmzMa.js.map +1 -0
- package/dist/components/{p-CnIzN0a9.js → p-CiKsFis4.js} +5 -5
- package/dist/components/{p-CnIzN0a9.js.map → p-CiKsFis4.js.map} +1 -1
- package/dist/components/{p-BlTHDG0s.js → p-CixKuBuL.js} +13 -13
- package/dist/components/{p-BlTHDG0s.js.map → p-CixKuBuL.js.map} +1 -1
- package/dist/components/{p-D1o9mMCC.js → p-CoH616os.js} +7 -25
- package/dist/components/p-CoH616os.js.map +1 -0
- package/dist/components/p-Cotorbsf.js +72 -0
- package/dist/components/p-Cotorbsf.js.map +1 -0
- package/dist/components/{p-GHcj9VUq.js → p-DIeSYRR1.js} +4 -4
- package/dist/components/{p-GHcj9VUq.js.map → p-DIeSYRR1.js.map} +1 -1
- package/dist/components/{p-D3p38qOI.js → p-DKOj6SYm.js} +4 -4
- package/dist/components/{p-D3p38qOI.js.map → p-DKOj6SYm.js.map} +1 -1
- package/dist/components/{p-D3GPRslH.js → p-DLF5DiJI.js} +10 -10
- package/dist/components/{p-D3GPRslH.js.map → p-DLF5DiJI.js.map} +1 -1
- package/dist/components/p-DOULSSR_.js +115 -0
- package/dist/components/p-DOULSSR_.js.map +1 -0
- package/dist/components/{p-CEGQ-SIb.js → p-Dc4pAKEn.js} +4 -4
- package/dist/components/{p-CEGQ-SIb.js.map → p-Dc4pAKEn.js.map} +1 -1
- package/dist/components/{p-RoGGAmRf.js → p-DeaQdy4U.js} +4 -4
- package/dist/components/{p-RoGGAmRf.js.map → p-DeaQdy4U.js.map} +1 -1
- package/dist/components/{p-8QmwtD0L.js → p-DkIrni0i.js} +9 -7
- package/dist/components/p-DkIrni0i.js.map +1 -0
- package/dist/components/p-DlVSEuX7.js +77 -0
- package/dist/components/p-DlVSEuX7.js.map +1 -0
- package/dist/components/p-DsRfjAri.js +77 -0
- package/dist/components/p-DsRfjAri.js.map +1 -0
- package/dist/components/p-DxZasSi4.js +91 -0
- package/dist/components/p-DxZasSi4.js.map +1 -0
- package/dist/components/p-TVDCAFDo.js +77 -0
- package/dist/components/p-TVDCAFDo.js.map +1 -0
- package/dist/components/{p-B9qKX3S0.js → p-V-QJ5j_K.js} +13 -9
- package/dist/components/p-V-QJ5j_K.js.map +1 -0
- package/dist/components/p-eh-K0ick.js +77 -0
- package/dist/components/p-eh-K0ick.js.map +1 -0
- package/dist/components/p-rAwrmsb9.js +75 -0
- package/dist/components/p-rAwrmsb9.js.map +1 -0
- package/dist/components/p-vll2Fgrb.js +160 -0
- package/dist/components/p-vll2Fgrb.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{ls-document-options_35.entry.js → ls-document-options_36.entry.js} +501 -129
- package/dist/esm/ls-document-options_36.entry.js.map +1 -0
- package/dist/esm/ls-document-viewer.js +1 -1
- package/dist/ls-document-viewer/defaultPalette-C00GqV9f.js.map +1 -1
- package/dist/ls-document-viewer/editorUtils-CHIJ1jsX.js +196 -0
- package/dist/ls-document-viewer/editorUtils-CHIJ1jsX.js.map +1 -0
- package/dist/ls-document-viewer/editorUtils-DsvPQaAu.js +197 -0
- package/dist/ls-document-viewer/editorUtils-DsvPQaAu.js.map +1 -0
- package/dist/ls-document-viewer/ls-document-viewer.entry.js +120 -15
- package/dist/ls-document-viewer/ls-document-viewer.esm.js +1 -1
- package/dist/ls-document-viewer/ls-editor-field.entry.js +133 -0
- package/dist/ls-document-viewer/ls-field-properties-date.entry.js +34 -0
- package/dist/ls-document-viewer/ls-field-properties-email.entry.js +34 -0
- package/dist/ls-document-viewer/ls-field-properties-file.entry.js +34 -0
- package/dist/ls-document-viewer/ls-field-properties-general.entry.js +32 -0
- package/dist/ls-document-viewer/ls-field-properties-image.entry.js +34 -0
- package/dist/ls-document-viewer/ls-field-properties-number.entry.js +34 -0
- package/dist/ls-document-viewer/ls-field-properties-text.entry.js +34 -0
- package/dist/ls-document-viewer/ls-statusbar.entry.js +57 -0
- package/dist/ls-document-viewer/{p-85c0f6fa.entry.js → p-022e8e6d.entry.js} +21 -6
- package/dist/ls-document-viewer/p-022e8e6d.entry.js.map +1 -0
- package/dist/types/components/ls-document-viewer/adapter/LsDocumentAdapter.d.ts +1 -0
- package/dist/types/components/ls-document-viewer/adapter/groupActions.d.ts +2 -0
- package/dist/types/components/ls-document-viewer/defaultFieldIcons.d.ts +5 -0
- package/dist/types/components/ls-document-viewer/editorUtils.d.ts +6 -1
- package/dist/types/components/ls-document-viewer/ls-document-viewer.d.ts +2 -0
- package/dist/types/components/ls-field-footer/ls-field-footer.d.ts +14 -0
- package/dist/types/components/ls-field-properties-date/ls-field-properties-date.d.ts +2 -0
- package/dist/types/components/ls-field-properties-email/ls-field-properties-email.d.ts +2 -0
- package/dist/types/components/ls-field-properties-file/ls-field-properties-file.d.ts +2 -0
- package/dist/types/components/ls-field-properties-general/ls-field-properties-general.d.ts +2 -0
- package/dist/types/components/ls-field-properties-image/ls-field-properties-image.d.ts +2 -0
- package/dist/types/components/ls-field-properties-multiple/ls-field-properties-multiple.d.ts +14 -0
- package/dist/types/components/ls-field-properties-number/ls-field-properties-number.d.ts +2 -0
- package/dist/types/components/ls-field-properties-signature/ls-field-properties-signature.d.ts +5 -0
- package/dist/types/components/ls-field-properties-text/ls-field-properties-text.d.ts +2 -0
- package/dist/types/components/ls-participant-select/ls-participant-select.d.ts +2 -0
- package/dist/types/components/ls-toolbox-field/ls-toolbox-field.d.ts +4 -0
- package/dist/types/components.d.ts +119 -0
- package/dist/types/types/Icon.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/ls-document-options_35.cjs.entry.js.map +0 -1
- package/dist/components/p-8QmwtD0L.js.map +0 -1
- package/dist/components/p-B1Q1LddX.js +0 -49
- package/dist/components/p-B1Q1LddX.js.map +0 -1
- package/dist/components/p-B1X25Dz_.js +0 -49
- package/dist/components/p-B1X25Dz_.js.map +0 -1
- package/dist/components/p-B9qKX3S0.js.map +0 -1
- package/dist/components/p-BI9SKPKN.js +0 -51
- package/dist/components/p-BI9SKPKN.js.map +0 -1
- package/dist/components/p-BNKSb1yR.js +0 -49
- package/dist/components/p-BNKSb1yR.js.map +0 -1
- package/dist/components/p-BxXqIouU.js +0 -49
- package/dist/components/p-BxXqIouU.js.map +0 -1
- package/dist/components/p-C93Q3D_9.js +0 -49
- package/dist/components/p-C93Q3D_9.js.map +0 -1
- package/dist/components/p-CF583nkL.js +0 -99
- package/dist/components/p-CF583nkL.js.map +0 -1
- package/dist/components/p-CTraMHE_.js +0 -49
- package/dist/components/p-CTraMHE_.js.map +0 -1
- package/dist/components/p-CgRZ91kw.js +0 -124
- package/dist/components/p-CgRZ91kw.js.map +0 -1
- package/dist/components/p-CjicL5jA.js.map +0 -1
- package/dist/components/p-Ct78kJaE.js +0 -49
- package/dist/components/p-Ct78kJaE.js.map +0 -1
- package/dist/components/p-D1o9mMCC.js.map +0 -1
- package/dist/components/p-D4wPRNKc.js +0 -86
- package/dist/components/p-D4wPRNKc.js.map +0 -1
- package/dist/components/p-DC7lKZUf.js +0 -49
- package/dist/components/p-DC7lKZUf.js.map +0 -1
- package/dist/components/p-DTWaVEKo.js.map +0 -1
- package/dist/components/p-DtHDNV_x.js.map +0 -1
- package/dist/components/p-Dxupmj0q.js +0 -63
- package/dist/components/p-Dxupmj0q.js.map +0 -1
- package/dist/components/p-RFw2Bsri.js +0 -72
- package/dist/components/p-RFw2Bsri.js.map +0 -1
- package/dist/components/p-pHw5Xziq.js +0 -154
- package/dist/components/p-pHw5Xziq.js.map +0 -1
- package/dist/components/p-py-rQZsT.js.map +0 -1
- package/dist/esm/ls-document-options_35.entry.js.map +0 -1
- package/dist/ls-document-viewer/editorUtils-DbS95k5h.js.map +0 -1
- package/dist/ls-document-viewer/ls-document-viewer.entry.esm.js.map +0 -1
- package/dist/ls-document-viewer/ls-document-viewer.entry.js.map +0 -1
- package/dist/ls-document-viewer/p-85c0f6fa.entry.js.map +0 -1
|
@@ -1,22 +1,74 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
display:
|
|
3
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
width: 100%;
|
|
6
|
+
position: relative;
|
|
4
7
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
border: 0;
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
margin: 0;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.field-set {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 1rem;
|
|
18
|
+
width: 100%;
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
.ls-field-properties-section {
|
|
22
|
+
display: flex;
|
|
23
|
+
position: relative;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.row {
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.multi-button-group-row {
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: 0.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ls-field-properties-section-text {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: 0.25rem;
|
|
43
|
+
padding: 0.25rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ls-field-properties-section-title {
|
|
47
|
+
color: var(--gray-90, #5e6066);
|
|
48
|
+
font-size: 1rem;
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
line-height: 1.25rem; /* 142.857% */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ls-field-properties-section-description {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
color: var(--gray-80, #6c6e73);
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
font-size: 0.75rem;
|
|
59
|
+
font-style: normal;
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
line-height: 0.75rem; /* 120% */
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.input-row {
|
|
65
|
+
display: flex;
|
|
66
|
+
gap: 0.5rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.input-row .input-wrapper input {
|
|
70
|
+
width: 9.313rem;
|
|
71
|
+
max-width: 9.313rem;
|
|
20
72
|
}
|
|
21
73
|
|
|
22
74
|
/* Global Styles */
|
|
@@ -56,7 +108,7 @@ select {
|
|
|
56
108
|
|
|
57
109
|
.input-wrapper {
|
|
58
110
|
position: relative;
|
|
59
|
-
width:
|
|
111
|
+
width: 100%;
|
|
60
112
|
}
|
|
61
113
|
|
|
62
114
|
#selectorIcon {
|
|
@@ -77,6 +129,16 @@ select {
|
|
|
77
129
|
color: var(--gray-80, #6c6e73);
|
|
78
130
|
}
|
|
79
131
|
|
|
132
|
+
#selectLeadingIconDisabled {
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 50%;
|
|
135
|
+
left: 0.675rem;
|
|
136
|
+
transform: translateY(-50%);
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
color: var(--gray-50, #d8d9dc);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
80
142
|
.has-leading-icon {
|
|
81
143
|
padding-left: 2.5rem;
|
|
82
144
|
}
|
|
@@ -100,25 +162,25 @@ textarea::placeholder {
|
|
|
100
162
|
color: var(--gray-60, #afb0b2);
|
|
101
163
|
}
|
|
102
164
|
|
|
103
|
-
input:hover,
|
|
104
|
-
select:hover,
|
|
105
|
-
textarea:hover {
|
|
165
|
+
input:hover:not(:disabled),
|
|
166
|
+
select:hover:not(:disabled),
|
|
167
|
+
textarea:hover:not(:disabled) {
|
|
106
168
|
border-color: var(--gray-50, #c8c9cc);
|
|
107
169
|
background-color: var(--white, #fff);
|
|
108
170
|
}
|
|
109
171
|
|
|
110
|
-
input:focus,
|
|
111
|
-
select:focus,
|
|
112
|
-
textarea:focus {
|
|
172
|
+
input:focus:not(:disabled),
|
|
173
|
+
select:focus:not(:disabled),
|
|
174
|
+
textarea:focus:not(:disabled) {
|
|
113
175
|
outline: none;
|
|
114
176
|
box-shadow: 0 0 0 0.25rem var(--primary-40, #79adfc);
|
|
115
177
|
border-color: var(--primary-60, #4456f6);
|
|
116
178
|
background-color: var(--white, #fff);
|
|
117
179
|
}
|
|
118
180
|
|
|
119
|
-
input:active,
|
|
120
|
-
select:active,
|
|
121
|
-
textarea:active {
|
|
181
|
+
input:active:not(:disabled),
|
|
182
|
+
select:active:not(:disabled),
|
|
183
|
+
textarea:active:not(:disabled) {
|
|
122
184
|
border-color: var(--primary-50, #5185ff);
|
|
123
185
|
}
|
|
124
186
|
|
|
@@ -127,6 +189,8 @@ select:disabled,
|
|
|
127
189
|
textarea:disabled {
|
|
128
190
|
cursor: not-allowed;
|
|
129
191
|
background-color: var(--gray-10, #f7f8fa);
|
|
192
|
+
color: var(--gray-50, #d8d9dc);
|
|
193
|
+
box-shadow: none;
|
|
130
194
|
}
|
|
131
195
|
|
|
132
196
|
input[type='checkbox'] {
|
|
@@ -270,18 +334,25 @@ button.tertiaryGrey:hover {
|
|
|
270
334
|
border: 1px solid var(--gray-30, #e0e2e5);
|
|
271
335
|
background: var(--white, #ffffff);
|
|
272
336
|
overflow: clip;
|
|
337
|
+
width: 100%;
|
|
273
338
|
}
|
|
274
339
|
|
|
275
340
|
.button-group button {
|
|
276
341
|
display: flex;
|
|
342
|
+
width: 100%;
|
|
277
343
|
background: transparent;
|
|
278
344
|
border-radius: unset;
|
|
279
345
|
padding: 0.25rem 0.75rem;
|
|
280
346
|
min-width: 2.156rem;
|
|
281
|
-
min-height: unset;
|
|
282
347
|
color: var(--gray-80, #6c6e73);
|
|
283
348
|
}
|
|
284
349
|
|
|
350
|
+
.button-group button:disabled {
|
|
351
|
+
background: var(--gray-10, #f7f8fa);
|
|
352
|
+
cursor: not-allowed;
|
|
353
|
+
color: var(--gray-50, #d8d9dc);
|
|
354
|
+
}
|
|
355
|
+
|
|
285
356
|
.button-group button:hover {
|
|
286
357
|
background: var(--gray-10, #f7f8fa);
|
|
287
358
|
}
|
|
@@ -297,4 +368,3 @@ button.tertiaryGrey:hover {
|
|
|
297
368
|
.button-group > :not(:first-child) {
|
|
298
369
|
border-left: 1px solid var(--gray-30, #e0e2e5);
|
|
299
370
|
}
|
|
300
|
-
|
|
@@ -8,7 +8,7 @@ export class LsFieldAlignment {
|
|
|
8
8
|
alter(diff) {
|
|
9
9
|
console.log(diff);
|
|
10
10
|
const diffs = this.dataItem.map(c => {
|
|
11
|
-
return { action:
|
|
11
|
+
return { action: 'update', data: { ...c, ...diff } };
|
|
12
12
|
});
|
|
13
13
|
this.dataItem = diffs.map(d => d.data);
|
|
14
14
|
this.mutate.emit(diffs);
|
|
@@ -16,18 +16,19 @@ export class LsFieldAlignment {
|
|
|
16
16
|
}
|
|
17
17
|
right() {
|
|
18
18
|
const rightmost = this.dataItem.reduce((rightmost, current) => {
|
|
19
|
-
return
|
|
19
|
+
return current.left + current.width < rightmost ? rightmost : current.left + current.width;
|
|
20
20
|
}, 0);
|
|
21
21
|
console.log(rightmost);
|
|
22
|
-
const diffs = this.dataItem.map(
|
|
22
|
+
const diffs = this.dataItem.map(c => {
|
|
23
23
|
const newLeft = rightmost - c.width;
|
|
24
24
|
return {
|
|
25
|
-
action:
|
|
25
|
+
action: 'update',
|
|
26
|
+
data: {
|
|
26
27
|
...c,
|
|
27
28
|
left: newLeft,
|
|
28
29
|
ax: newLeft,
|
|
29
|
-
bx: newLeft + c.width
|
|
30
|
-
}
|
|
30
|
+
bx: newLeft + c.width,
|
|
31
|
+
},
|
|
31
32
|
};
|
|
32
33
|
});
|
|
33
34
|
this.dataItem = diffs.map(d => d.data);
|
|
@@ -42,15 +43,16 @@ export class LsFieldAlignment {
|
|
|
42
43
|
console.log(addcentres);
|
|
43
44
|
const cp = addcentres / this.dataItem.length;
|
|
44
45
|
console.log('centerposition', cp);
|
|
45
|
-
const diffs = this.dataItem.map(
|
|
46
|
+
const diffs = this.dataItem.map(c => {
|
|
46
47
|
const newLeft = c.left + (cp - (c.left + c.width / 2));
|
|
47
48
|
return {
|
|
48
|
-
action:
|
|
49
|
+
action: 'update',
|
|
50
|
+
data: {
|
|
49
51
|
...c,
|
|
50
52
|
left: newLeft,
|
|
51
53
|
ax: newLeft,
|
|
52
|
-
bx: newLeft + c.width
|
|
53
|
-
}
|
|
54
|
+
bx: newLeft + c.width,
|
|
55
|
+
},
|
|
54
56
|
};
|
|
55
57
|
});
|
|
56
58
|
console.log(diffs);
|
|
@@ -76,15 +78,16 @@ export class LsFieldAlignment {
|
|
|
76
78
|
return total + (current.top + current.height / 2);
|
|
77
79
|
}, 0);
|
|
78
80
|
const cp = addmiddles / this.dataItem.length;
|
|
79
|
-
const diffs = this.dataItem.map(
|
|
81
|
+
const diffs = this.dataItem.map(c => {
|
|
80
82
|
const newTop = c.top + (cp - (c.top + c.height / 2));
|
|
81
83
|
return {
|
|
82
|
-
action:
|
|
84
|
+
action: 'update',
|
|
85
|
+
data: {
|
|
83
86
|
...c,
|
|
84
87
|
top: newTop,
|
|
85
88
|
ay: newTop,
|
|
86
|
-
by: newTop + c.height
|
|
87
|
-
}
|
|
89
|
+
by: newTop + c.height,
|
|
90
|
+
},
|
|
88
91
|
};
|
|
89
92
|
});
|
|
90
93
|
this.dataItem = diffs.map(d => d.data);
|
|
@@ -93,17 +96,18 @@ export class LsFieldAlignment {
|
|
|
93
96
|
}
|
|
94
97
|
bottom() {
|
|
95
98
|
const lowest = this.dataItem.reduce((acc, current) => {
|
|
96
|
-
return acc >
|
|
99
|
+
return acc > current.top + current.height ? acc : current.top + current.height;
|
|
97
100
|
}, 0);
|
|
98
|
-
const diffs = this.dataItem.map(
|
|
101
|
+
const diffs = this.dataItem.map(c => {
|
|
99
102
|
const newTop = lowest - c.height;
|
|
100
103
|
return {
|
|
101
|
-
action:
|
|
104
|
+
action: 'update',
|
|
105
|
+
data: {
|
|
102
106
|
...c,
|
|
103
107
|
top: newTop,
|
|
104
108
|
ay: newTop,
|
|
105
|
-
by: newTop + c.height
|
|
106
|
-
}
|
|
109
|
+
by: newTop + c.height,
|
|
110
|
+
},
|
|
107
111
|
};
|
|
108
112
|
});
|
|
109
113
|
this.dataItem = diffs.map(d => d.data);
|
|
@@ -111,7 +115,9 @@ export class LsFieldAlignment {
|
|
|
111
115
|
this.update.emit(diffs);
|
|
112
116
|
}
|
|
113
117
|
render() {
|
|
114
|
-
return (h(Host, { key: '
|
|
118
|
+
return (h(Host, { key: '18c2511fb41da7dbae34231108af7a0553ddd5e9' }, h("div", { key: '914df99828f9994f8398fe3cf1de0db1e8bb8bc0', class: 'ls-field-properties-section' }, h("div", { key: 'eb2a2ead947b5ccb161da1fb711ba0aecd4f1f1e', class: 'ls-field-properties-section-text' }, h("p", { key: 'eedf0321ec75bb9670e926a2951fd85cd02196f7', class: 'ls-field-properties-section-title' }, "Alignment"), h("p", { key: '87ebbfeb998ce91a216b624332dc70019cd7a899', class: 'ls-field-properties-section-description' }, "Align your Fields relative to the page or multi-select and align then to each other.")), h("div", { key: '6fb940d7a554c6750eda85dced92a3e762ef5481', class: 'multi-button-group-row' }, h("div", { key: '0dae4f26f528c7797148101e5552856680d707b0', class: 'button-group' }, h("button", { key: '0184ce8b491fc9ac2775d10dd18402239352d8b4', onClick: () => this.left(), "aria-label": "Align selected fields vertically about their left edge.", "data-tooltip-id": "le-tooltip", "data-tooltip-content": "Shift + Select multiple fields to access this control", "data-tooltip-place": "top" }, h("ls-icon", { key: '2dd926828e25e526bdbbfe8f42a82ccf2f1d4383', name: "field-alignment-left" })), h("button", { key: 'a6115447dee38c833bd63c7bf773b8cd33645749', onClick: () => this.center(), "aria-label": "Align selected fields vertically about their centre.", "data-tooltip-id": "le-tooltip", "data-tooltip-content": "Shift + Select multiple fields to access this control", "data-tooltip-place": "top" }, h("ls-icon", { key: '1d54aa128a5ae7353e2f976b5985f4523fccdc7b', name: "field-alignment-centre" })), h("button", { key: 'd61a31635f469007f65c1314c6f3404bfb7894f4', onClick: () => {
|
|
119
|
+
this.right();
|
|
120
|
+
}, "aria-label": "Align selected fields vertically about their right edge.", "data-tooltip-id": "le-tooltip", "data-tooltip-content": "Shift + Select multiple fields to access this control", "data-tooltip-place": "top" }, h("ls-icon", { key: '6401e05b124c616922b7f5542d41de506fa1ae04', name: "field-alignment-right" }))), h("div", { key: '5a924ac1d3d04a626ffb8a19f95c4ee7c7a78d5b', class: 'button-group' }, h("button", { key: '3b03cbc294b1fae5e19465077880ad347c0b5251', onClick: () => this.top(), "aria-label": "Align selected fields by their top.", "data-tooltip-id": "le-tooltip", "data-tooltip-content": "Shift + Select multiple fields to access this control", "data-tooltip-place": "top" }, h("ls-icon", { key: 'c16889d194be3d2b5f6dedb0a9db55902b125eef', name: "field-alignment-top" })), h("button", { key: '50e776898be6e43c642d666e76ef139f62ad014e', onClick: () => this.middle(), "aria-label": "Align selected fields by their middles.", "data-tooltip-id": "le-tooltip", "data-tooltip-content": "Shift + Select multiple fields to access this control", "data-tooltip-place": "top" }, h("ls-icon", { key: '4d1b4051bc6eafb28ef20d96f1f7abf70cbc2338', name: "field-alignment-middle" })), h("button", { key: '405eca6c636b9e4fef7223bd0882f3b52d54166b', onClick: () => this.bottom(), "aria-label": "Align selected fields by their bottoms.", "data-tooltip-id": "le-tooltip", "data-tooltip-content": "Shift + Select multiple fields to access this control", "data-tooltip-place": "top" }, h("ls-icon", { key: 'e4e82550d98afdacaa79cccef417128940e6d148', name: "field-alignment-bottom" }))))), h("slot", { key: '34964508c02209a6ccea4855cfec5d94078471ea' })));
|
|
115
121
|
}
|
|
116
122
|
static get is() { return "ls-field-alignment"; }
|
|
117
123
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls-field-alignment.js","sourceRoot":"","sources":["../../../src/components/ls-field-alignment/ls-field-alignment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAS9E,MAAM,OAAO,gBAAgB;IACF,QAAQ,CAAiB;IAK/C,MAAM,CAAgC;IAMtC,MAAM,CAAgC;IAGzC,0CAA0C;IAC1C,6CAA6C;IAC7C,KAAK,CAAC,IAAY;QAChB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAEjB,MAAM,KAAK,GAAoB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACnD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,EAAkB,EAAE,CAAA;QACtE,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAqB,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM,CAA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,EAAC,wBAAwB,GAAG,CAAS;gBACtD,+DACE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC5B,KAAK,EAAC,iBAAiB,gBACZ,yCAAyC,qBACpC,YAAY,0BACP,uDAAuD,wBACzD,KAAK;oBAExB,gEAAS,IAAI,EAAC,wBAAwB,GAAG,CAClC,CACL;YAGR,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter } from '@stencil/core';\nimport { LSApiElement, LSMutateEvent } from '../../components';\n\n\n@Component({\n tag: 'ls-field-alignment',\n styleUrl: 'ls-field-alignment.css',\n shadow: true,\n})\nexport class LsFieldAlignment {\n @Prop({ mutable: true }) dataItem: LSApiElement[];\n @Event({\n bubbles: true,\n cancelable: true,\n composed: true\n }) mutate: EventEmitter<LSMutateEvent[]>;\n\n @Event({\n bubbles: true,\n cancelable: true,\n composed: true\n }) update: EventEmitter<LSMutateEvent[]>;\n\n\n // Send one or more mutations up the chain\n // The source of the chain fires the mutation\n alter(diff: object) {\n console.log(diff)\n\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n return { action: \"update\", data: { ...c, ...diff } as LSApiElement }\n })\n\n this.dataItem = diffs.map(d => d.data as LSApiElement)\n this.mutate.emit(diffs)\n this.update.emit(diffs)\n }\n\n right() {\n const rightmost = this.dataItem.reduce((rightmost, current) => {\n\n return (current.left + current.width) < rightmost ? rightmost : (current.left + current.width)\n }, 0);\n\n console.log(rightmost)\n\n const diffs: LSMutateEvent[] = this.dataItem.map((c) => {\n const newLeft = rightmost - c.width\n\n return {\n action: \"update\", data: {\n ...c,\n left: newLeft,\n ax: newLeft,\n bx: newLeft + c.width\n } as LSApiElement\n }\n })\n\n this.dataItem = diffs.map(d => d.data as LSApiElement)\n this.mutate.emit(diffs)\n this.update.emit(diffs)\n }\n\n center() {\n const addcentres = this.dataItem.reduce((total, current) => {\n console.log(total + (current.left + current.width / 2))\n return total + (current.left + current.width / 2)\n }, 0);\n console.log(addcentres)\n\n const cp = addcentres / this.dataItem.length\n console.log('centerposition', cp)\n\n const diffs: LSMutateEvent[] = this.dataItem.map((c) => {\n\n const newLeft = c.left + (cp - (c.left + c.width / 2))\n return {\n action: \"update\", data: {\n ...c,\n left: newLeft,\n ax: newLeft,\n bx: newLeft + c.width\n } as LSApiElement\n }\n })\n console.log(diffs)\n this.dataItem = diffs.map(d => d.data as LSApiElement)\n this.mutate.emit(diffs)\n this.update.emit(diffs)\n }\n\n top() {\n const topmost = this.dataItem.reduce((most, current) => {\n return current.top < most ? most : current.top\n }, 0);\n\n this.alter({ top: topmost })\n }\n\n\n left() {\n const leftmost = this.dataItem.reduce((least, current) => {\n return current.left < least ? current.left : least\n }, this.dataItem[0].left);\n\n this.alter({ left: leftmost })\n }\n\n\n middle() {\n const addmiddles = this.dataItem.reduce((total, current) => {\n console.log(total + (current.top + current.height / 2))\n return total + (current.top + current.height / 2)\n }, 0);\n\n const cp = addmiddles / this.dataItem.length\n\n const diffs: LSMutateEvent[] = this.dataItem.map((c) => {\n\n const newTop = c.top + (cp - (c.top + c.height / 2))\n return {\n action: \"update\", data: {\n ...c,\n top: newTop,\n ay: newTop,\n by: newTop + c.height\n } as LSApiElement\n }\n })\n this.dataItem = diffs.map(d => d.data as LSApiElement)\n this.mutate.emit(diffs)\n this.update.emit(diffs)\n }\n\n bottom() {\n const lowest = this.dataItem.reduce((acc, current) => {\n return acc > (current.top + current.height) ? acc : (current.top + current.height)\n }, 0);\n\n const diffs: LSMutateEvent[] = this.dataItem.map((c) => {\n\n const newTop = lowest - c.height\n return {\n action: \"update\", data: {\n ...c,\n top: newTop,\n ay: newTop,\n by: newTop + c.height\n } as LSApiElement\n }\n })\n this.dataItem = diffs.map(d => d.data as LSApiElement)\n this.mutate.emit(diffs)\n this.update.emit(diffs)\n }\n\n render() {\n return (\n <Host>\n \n <div>\n <button\n onClick={() => this.left()}\n class='ls-round-button'\n aria-label=\"Align selected fields vertically about their left edge.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-left\" /></button>\n <button\n onClick={() => this.center()}\n class='ls-round-button'\n aria-label=\"Align selected fields vertically about their centre.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-centre\" /></button>\n <button\n onClick={() => { this.right() }}\n aria-label=\"Align selected fields vertically about their right edge.\"\n class='ls-round-button'\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-right\" />\n </button>\n\n <button\n onClick={() => this.top()}\n class='ls-round-button'\n aria-label=\"Align selected fields by their top.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-top\" />\n </button>\n <button\n onClick={() => this.middle()}\n class='ls-round-button'\n aria-label=\"Align selected fields by their middles.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-middle\" /></button>\n <button\n onClick={() => this.bottom()}\n class='ls-round-button'\n aria-label=\"Align selected fields by their bottoms.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-bottom\" />\n </button>\n </div>\n \n\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ls-field-alignment.js","sourceRoot":"","sources":["../../../src/components/ls-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IAAI,EAAC,sBAAsB,GAAW,CACxC;wBACT,+DACE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,gBACjB,sDAAsD,qBACjD,YAAY,0BACP,uDAAuD,wBACzD,KAAK;4BAExB,gEAAS,IAAI,EAAC,wBAAwB,GAAW,CAC1C;wBACT,+DACE,OAAO,EAAE,GAAG,EAAE;gCACZ,IAAI,CAAC,KAAK,EAAE,CAAC;4BACf,CAAC,gBACU,0DAA0D,qBACrD,YAAY,0BACP,uDAAuD,wBACzD,KAAK;4BAExB,gEAAS,IAAI,EAAC,uBAAuB,GAAW,CACzC,CACL;oBACN,4DAAK,KAAK,EAAE,cAAc;wBACxB,+DACE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,gBACd,qCAAqC,qBAChC,YAAY,0BACP,uDAAuD,wBACzD,KAAK;4BAExB,gEAAS,IAAI,EAAC,qBAAqB,GAAW,CACvC;wBACT,+DACE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,gBACjB,yCAAyC,qBACpC,YAAY,0BACP,uDAAuD,wBACzD,KAAK;4BAExB,gEAAS,IAAI,EAAC,wBAAwB,GAAW,CAC1C;wBACT,+DACE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,gBACjB,yCAAyC,qBACpC,YAAY,0BACP,uDAAuD,wBACzD,KAAK;4BAExB,gEAAS,IAAI,EAAC,wBAAwB,GAAW,CAC1C,CACL,CACF,CACF;YAEN,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter } from '@stencil/core';\nimport { LSApiElement, LSMutateEvent } from '../../components';\n\n@Component({\n tag: 'ls-field-alignment',\n styleUrl: 'ls-field-alignment.css',\n shadow: true,\n})\nexport class LsFieldAlignment {\n @Prop({ mutable: true }) dataItem: LSApiElement[];\n @Event({\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n mutate: EventEmitter<LSMutateEvent[]>;\n\n @Event({\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n update: EventEmitter<LSMutateEvent[]>;\n\n // Send one or more mutations up the chain\n // The source of the chain fires the mutation\n alter(diff: object) {\n console.log(diff);\n\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n return { action: 'update', data: { ...c, ...diff } as LSApiElement };\n });\n\n this.dataItem = diffs.map(d => d.data as LSApiElement);\n this.mutate.emit(diffs);\n this.update.emit(diffs);\n }\n\n right() {\n const rightmost = this.dataItem.reduce((rightmost, current) => {\n return current.left + current.width < rightmost ? rightmost : current.left + current.width;\n }, 0);\n\n console.log(rightmost);\n\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n const newLeft = rightmost - c.width;\n\n return {\n action: 'update',\n data: {\n ...c,\n left: newLeft,\n ax: newLeft,\n bx: newLeft + c.width,\n } as LSApiElement,\n };\n });\n\n this.dataItem = diffs.map(d => d.data as LSApiElement);\n this.mutate.emit(diffs);\n this.update.emit(diffs);\n }\n\n center() {\n const addcentres = this.dataItem.reduce((total, current) => {\n console.log(total + (current.left + current.width / 2));\n return total + (current.left + current.width / 2);\n }, 0);\n console.log(addcentres);\n\n const cp = addcentres / this.dataItem.length;\n console.log('centerposition', cp);\n\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n const newLeft = c.left + (cp - (c.left + c.width / 2));\n return {\n action: 'update',\n data: {\n ...c,\n left: newLeft,\n ax: newLeft,\n bx: newLeft + c.width,\n } as LSApiElement,\n };\n });\n console.log(diffs);\n this.dataItem = diffs.map(d => d.data as LSApiElement);\n this.mutate.emit(diffs);\n this.update.emit(diffs);\n }\n\n top() {\n const topmost = this.dataItem.reduce((most, current) => {\n return current.top < most ? most : current.top;\n }, 0);\n\n this.alter({ top: topmost });\n }\n\n left() {\n const leftmost = this.dataItem.reduce((least, current) => {\n return current.left < least ? current.left : least;\n }, this.dataItem[0].left);\n\n this.alter({ left: leftmost });\n }\n\n middle() {\n const addmiddles = this.dataItem.reduce((total, current) => {\n console.log(total + (current.top + current.height / 2));\n return total + (current.top + current.height / 2);\n }, 0);\n\n const cp = addmiddles / this.dataItem.length;\n\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n const newTop = c.top + (cp - (c.top + c.height / 2));\n return {\n action: 'update',\n data: {\n ...c,\n top: newTop,\n ay: newTop,\n by: newTop + c.height,\n } as LSApiElement,\n };\n });\n this.dataItem = diffs.map(d => d.data as LSApiElement);\n this.mutate.emit(diffs);\n this.update.emit(diffs);\n }\n\n bottom() {\n const lowest = this.dataItem.reduce((acc, current) => {\n return acc > current.top + current.height ? acc : current.top + current.height;\n }, 0);\n\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n const newTop = lowest - c.height;\n return {\n action: 'update',\n data: {\n ...c,\n top: newTop,\n ay: newTop,\n by: newTop + c.height,\n } as LSApiElement,\n };\n });\n this.dataItem = diffs.map(d => d.data as LSApiElement);\n this.mutate.emit(diffs);\n this.update.emit(diffs);\n }\n\n render() {\n return (\n <Host>\n <div class={'ls-field-properties-section'}>\n <div class={'ls-field-properties-section-text'}>\n <p class={'ls-field-properties-section-title'}>Alignment</p>\n <p class={'ls-field-properties-section-description'}>Align your Fields relative to the page or multi-select and align then to each other.</p>\n </div>\n <div class={'multi-button-group-row'}>\n <div class={'button-group'}>\n <button\n onClick={() => this.left()}\n aria-label=\"Align selected fields vertically about their left edge.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-left\"></ls-icon>\n </button>\n <button\n onClick={() => this.center()}\n aria-label=\"Align selected fields vertically about their centre.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-centre\"></ls-icon>\n </button>\n <button\n onClick={() => {\n this.right();\n }}\n aria-label=\"Align selected fields vertically about their right edge.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-right\"></ls-icon>\n </button>\n </div>\n <div class={'button-group'}>\n <button\n onClick={() => this.top()}\n aria-label=\"Align selected fields by their top.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-top\"></ls-icon>\n </button>\n <button\n onClick={() => this.middle()}\n aria-label=\"Align selected fields by their middles.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-middle\"></ls-icon>\n </button>\n <button\n onClick={() => this.bottom()}\n aria-label=\"Align selected fields by their bottoms.\"\n data-tooltip-id=\"le-tooltip\"\n data-tooltip-content=\"Shift + Select multiple fields to access this control\"\n data-tooltip-place=\"top\"\n >\n <ls-icon name=\"field-alignment-bottom\"></ls-icon>\n </button>\n </div>\n </div>\n </div>\n\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -29,7 +29,7 @@ export class LsFieldDimensions {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: '056c4e012cde64ce461fb954f393cc5eb264c4f1' }, this.isMultiple(this.dataItem) && (h("div", { key: '2cd01260598ea4f6cd7b40dffd502c6a642007c6', class: 'ls-field-properties-section' }, h("div", { key: 'e843fa2769ecb1889677ad85e87a79d1dc8b03f6', class: 'ls-field-properties-section-text' }, h("p", { key: '140e8ffaea2a163387345041f2039b68c8393012', class: 'ls-field-properties-section-title' }, "Height and Width"), h("p", { key: 'abef468582e2e7829f869a14539c22f1db839169', class: 'ls-field-properties-section-description' }, "Define the height and width of one or multiple fields")), h("div", { key: 'dd5819291b738c8866f84d88d85f1f1d78c4987e', class: 'input-row' }, h("div", { key: '87d5c1913299a43e1cbd093e2c579591bdc80327', class: 'input-wrapper' }, h("ls-icon", { key: '861a92289f7383ab6773bca9b2e240332e720a04', id: "selectLeadingIcon", name: "field-match-width" }), h("input", { key: 'aa1fc66abfa15670e682d39304178f91f3e9d05d', class: 'has-leading-icon', aria: "field-width", id: "field-width", onChange: e => this.alter({ width: e.target.value }) })), h("div", { key: '3c4293cae6df7fb0447c670e32f7fd4f2bcedfee', class: 'input-wrapper' }, h("ls-icon", { key: '4042d2ce39b5aa40e712673651ab82ee4c0e1ff2', id: "selectLeadingIcon", name: "field-match-height" }), h("input", { key: 'd944e7c0f95b6351e655d8230128a160c5aca6b8', class: 'has-leading-icon', aria: "field-height", id: "field-height", onChange: e => this.alter({ height: e.target.value }) }))))), this.isSingle(this.dataItem) && (h("div", { key: '09932bc4e2e6cc4f2595f481889d1e9dccaa31b6', class: 'field-set' }, h("div", { key: 'a0d3fdf6312d4952292f81214817b85319749795', class: 'ls-field-properties-section' }, h("div", { key: '048272dea7043f05209e3319a3f4095607232641', class: 'ls-field-properties-section-text' }, h("p", { key: '692142057d98b1192a8a3fedb8ba807fb0ef27a4', class: 'ls-field-properties-section-title' }, "Height and Width"), h("p", { key: 'd1d6b5ca74514d475e957c35b3554a215057f6ec', class: 'ls-field-properties-section-description' }, "Define the height and width of one or multiple fields")), h("div", { key: '3fc79c753561607272fc2a66a7a230160f4d1e58', class: 'input-row' }, h("div", { key: '6f0b824e7da82930e25759a617d8309c89c9a376', class: 'input-wrapper' }, h("ls-icon", { key: '73182488cca3bb85fc8ae40496e36beac68ec295', id: "selectLeadingIcon", name: "field-match-width" }), h("input", { key: '6fbaaeeaeae6d3b688725a2285d58ef0ac1e8219', type: "number", class: 'has-leading-icon', aria: "field-width", id: "field-width", value: this.dataItem?.width, onChange: e => this.alter({ width: e.target.value }) })), h("div", { key: 'f85adcc366ccb56ce1f25eba32c6ea4ed3947f67', class: 'input-wrapper' }, h("ls-icon", { key: '78c2d0da09465b932728c3a6ed1d3b14895f3687', id: "selectLeadingIcon", name: "field-match-height" }), h("input", { key: 'f43725d395b60b393d7989b22198ffbfb8abed15', type: "number", class: 'has-leading-icon', aria: "field-height", id: "field-height", value: this.dataItem?.height, onChange: e => this.alter({ height: e.target.value }) })))), h("div", { key: '678e33f56594bde997a4d679fcf1d03672f9af44', class: 'ls-field-properties-section' }, h("div", { key: '3365548c87c4ac6f02c74fcf8b1780ebda03d4c4', class: 'ls-field-properties-section-text' }, h("p", { key: 'ce7c9653b7ddaf6b256a4cb4bef3cbe3bcddd65a', class: 'ls-field-properties-section-title' }, "Scale and Resize"), h("p", { key: '13b174384f825593dc13d22ce6eb3ebb0b7eb954', class: 'ls-field-properties-section-description' }, "Multi-select fields and match their dimensions")), h("div", { key: 'c26db33451376140452a9d0722bae531e84a3382', class: 'button-group' }, h("button", { key: '8e1a002ea92227d531dd4d5f6760f4cb83866dd3', disabled: true }, h("ls-icon", { key: 'b11fb135a1183a4e5de10942852d3bc34f52f532', name: "field-scale" })), h("button", { key: '9a8a2aa33fd2ee14abb40e099e666f9f37137e25', disabled: true }, h("ls-icon", { key: '5fc371d3a123cc4848eb5514f90a6b6b61056e50', name: "field-match-width" })), h("button", { key: '1ec86eddacbbaa6061777562997634dd760d0fac', disabled: true }, h("ls-icon", { key: 'e2d3e787115ee66f61eda48d22be2d063beaac7e', name: "field-match-height" }))))))));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "ls-field-dimensions"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls-field-dimensions.js","sourceRoot":"","sources":["../../../src/components/ls-field-dimensions/ls-field-dimensions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAA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C,KAAK,CAAC,EAAE,MAAM,EAAG,CAAC,CAAC,MAA2B,CAAC,KAAK,EAAE,CAAC,GAC3E,CACE,CACF,CACF;gBAEN,4DAAK,KAAK,EAAE,6BAA6B;oBACvC,4DAAK,KAAK,EAAE,kCAAkC;wBAC5C,0DAAG,KAAK,EAAE,mCAAmC,uBAAsB;wBACnE,0DAAG,KAAK,EAAE,yCAAyC,qDAAoD,CACnG;oBACN,4DAAK,KAAK,EAAE,cAAc;wBACxB,+DAAQ,QAAQ;4BACd,gEAAS,IAAI,EAAC,aAAa,GAAW,CAC/B;wBACT,+DAAQ,QAAQ;4BACd,gEAAS,IAAI,EAAC,mBAAmB,GAAW,CACrC;wBACT,+DAAQ,QAAQ;4BACd,gEAAS,IAAI,EAAC,oBAAoB,GAAW,CACtC,CACL,CACF,CACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter } from '@stencil/core';\nimport { LSApiElement, LSMutateEvent } from '../../components';\n\n@Component({\n tag: 'ls-field-dimensions',\n styleUrl: 'ls-field-dimensions.css',\n shadow: true,\n})\nexport class LsFieldDimensions {\n @Prop({ mutable: true }) dataItem: LSApiElement | LSApiElement[];\n\n @Event({\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n mutate: EventEmitter<LSMutateEvent[]>;\n\n @Event({\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n update: EventEmitter<LSMutateEvent[]>;\n\n isSingle(dt: LSApiElement | LSApiElement[]): dt is LSApiElement {\n return (dt as LSApiElement[]).length === undefined;\n }\n\n isMultiple(dt: LSApiElement | LSApiElement[]): dt is LSApiElement[] {\n return typeof (dt as LSApiElement[]).length === 'number';\n }\n\n // Send one or more mutations up the chain\n // The source of the chain fires the mutation\n alter(diff: object) {\n console.log(diff);\n if (this.isMultiple(this.dataItem)) {\n const diffs: LSMutateEvent[] = this.dataItem.map(c => {\n return { action: 'update', data: { ...c, ...diff } as LSApiElement };\n });\n\n this.dataItem = diffs.map(d => d.data as LSApiElement);\n this.mutate.emit(diffs);\n this.update.emit(diffs);\n } else {\n const singleDiff = { action: 'update', data: { ...this.dataItem, ...diff } as LSApiElement } as LSMutateEvent;\n this.dataItem = singleDiff.data as LSApiElement;\n this.mutate.emit([singleDiff]);\n this.update.emit([singleDiff]);\n }\n }\n\n render() {\n return (\n <Host>\n {this.isMultiple(this.dataItem) && (\n <div class={'ls-field-properties-section'}>\n <div class={'ls-field-properties-section-text'}>\n <p class={'ls-field-properties-section-title'}>Height and Width</p>\n <p class={'ls-field-properties-section-description'}>Define the height and width of one or multiple fields</p>\n </div>\n <div class={'input-row'}>\n <div class={'input-wrapper'}>\n <ls-icon id=\"selectLeadingIcon\" name=\"field-match-width\"></ls-icon>\n <input class={'has-leading-icon'} aria=\"field-width\" id=\"field-width\" onChange={e => this.alter({ width: (e.target as HTMLInputElement).value })} />\n </div>\n <div class={'input-wrapper'}>\n <ls-icon id=\"selectLeadingIcon\" name=\"field-match-height\"></ls-icon>\n <input class={'has-leading-icon'} aria=\"field-height\" id=\"field-height\" onChange={e => this.alter({ height: (e.target as HTMLInputElement).value })} />\n </div>\n </div>\n\n {/* <div>\n Top: <input value={''} onChange={e => this.alter({ top: (e.target as HTMLInputElement).value })} width=\"30\" />\n </div>\n <div>\n Left: <input value={''} onChange={e => this.alter({ left: (e.target as HTMLInputElement).value })} width=\"30\" />\n </div> */}\n </div>\n )}\n {this.isSingle(this.dataItem) && (\n <div class={'field-set'}>\n <div class={'ls-field-properties-section'}>\n <div class={'ls-field-properties-section-text'}>\n <p class={'ls-field-properties-section-title'}>Height and Width</p>\n <p class={'ls-field-properties-section-description'}>Define the height and width of one or multiple fields</p>\n </div>\n <div class={'input-row'}>\n <div class={'input-wrapper'}>\n <ls-icon id=\"selectLeadingIcon\" name=\"field-match-width\"></ls-icon>\n <input\n type=\"number\"\n class={'has-leading-icon'}\n aria=\"field-width\"\n id=\"field-width\"\n value={this.dataItem?.width}\n onChange={e => this.alter({ width: (e.target as HTMLInputElement).value })}\n />\n </div>\n <div class={'input-wrapper'}>\n <ls-icon id=\"selectLeadingIcon\" name=\"field-match-height\"></ls-icon>\n <input\n type=\"number\"\n class={'has-leading-icon'}\n aria=\"field-height\"\n id=\"field-height\"\n value={this.dataItem?.height}\n onChange={e => this.alter({ height: (e.target as HTMLInputElement).value })}\n />\n </div>\n </div>\n </div>\n\n <div class={'ls-field-properties-section'}>\n <div class={'ls-field-properties-section-text'}>\n <p class={'ls-field-properties-section-title'}>Scale and Resize</p>\n <p class={'ls-field-properties-section-description'}>Multi-select fields and match their dimensions</p>\n </div>\n <div class={'button-group'}>\n <button disabled>\n <ls-icon name=\"field-scale\"></ls-icon>\n </button>\n <button disabled>\n <ls-icon name=\"field-match-width\"></ls-icon>\n </button>\n <button disabled>\n <ls-icon name=\"field-match-height\"></ls-icon>\n </button>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|