@xplor-education/core-stencil-components 2.0.0 → 3.0.0
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/components/index.js +1 -1
- package/components/index.js.map +1 -1
- package/components/{p-B1W2qj2l.js → p-B3zR7peH.js} +4 -4
- package/components/p-B3zR7peH.js.map +1 -0
- package/components/{p-Ddr35stE.js → p-BRWe4TXp.js} +65 -5
- package/components/p-BRWe4TXp.js.map +1 -0
- package/components/{p-CBSi5kQB.js → p-Bs_ocvfe.js} +7 -3
- package/components/p-Bs_ocvfe.js.map +1 -0
- package/components/{p-CTD6SyTD.js → p-D4jVa8dE.js} +20 -4
- package/components/p-D4jVa8dE.js.map +1 -0
- package/components/{p-x30CgLRv.js → p-DURNLP66.js} +71 -6
- package/components/p-DURNLP66.js.map +1 -0
- package/components/{p-BK_ATKuB.js → p-DxxjL3sU.js} +3 -3
- package/components/{p-BK_ATKuB.js.map → p-DxxjL3sU.js.map} +1 -1
- package/components/xplor-alert-dialog.js +60 -3
- package/components/xplor-alert-dialog.js.map +1 -1
- package/components/xplor-assistant.js +3 -3
- package/components/xplor-assistant.js.map +1 -1
- package/components/xplor-autocomplete.js +15 -9
- package/components/xplor-autocomplete.js.map +1 -1
- package/components/xplor-avatar-and-name.js +1 -1
- package/components/xplor-avatar.js +1 -1
- package/components/xplor-btn-back-to-parent.js +7 -2
- package/components/xplor-btn-back-to-parent.js.map +1 -1
- package/components/xplor-btn-icon.js +3 -2
- package/components/xplor-btn-icon.js.map +1 -1
- package/components/xplor-btn-menu.js +103 -6
- package/components/xplor-btn-menu.js.map +1 -1
- package/components/xplor-btn-tooltip.js +2 -2
- package/components/xplor-button.js +1 -1
- package/components/xplor-chat-widget.js +2 -2
- package/components/xplor-checkbox.js +3 -1
- package/components/xplor-checkbox.js.map +1 -1
- package/components/xplor-combobox.js +20 -10
- package/components/xplor-combobox.js.map +1 -1
- package/components/xplor-datatable.js +10 -4
- package/components/xplor-datatable.js.map +1 -1
- package/components/xplor-date-picker.js +9 -5
- package/components/xplor-date-picker.js.map +1 -1
- package/components/xplor-drag-and-drop-input.js +43 -5
- package/components/xplor-drag-and-drop-input.js.map +1 -1
- package/components/xplor-dropdown.js +1 -1
- package/components/xplor-expansion-panel.js +4 -4
- package/components/xplor-expansion-panel.js.map +1 -1
- package/components/xplor-expansion-panels.js +1 -1
- package/components/xplor-expansion-panels.js.map +1 -1
- package/components/xplor-file-upload.js +2 -2
- package/components/xplor-file-upload.js.map +1 -1
- package/components/xplor-inline-checkbox.js +2 -2
- package/components/xplor-inline-date-picker.js +1 -1
- package/components/xplor-inline-switch.js +1 -1
- package/components/xplor-input-file.js +3 -1
- package/components/xplor-input-file.js.map +1 -1
- package/components/xplor-input-search.js +4 -2
- package/components/xplor-input-search.js.map +1 -1
- package/components/xplor-input-select.js +127 -7
- package/components/xplor-input-select.js.map +1 -1
- package/components/xplor-input-send.js +3 -3
- package/components/xplor-input-send.js.map +1 -1
- package/components/xplor-input-text-area.js +6 -2
- package/components/xplor-input-text-area.js.map +1 -1
- package/components/xplor-input-text-secondary.js +6 -2
- package/components/xplor-input-text-secondary.js.map +1 -1
- package/components/xplor-input-text.js +6 -2
- package/components/xplor-input-text.js.map +1 -1
- package/components/xplor-input-title.js +7 -2
- package/components/xplor-input-title.js.map +1 -1
- package/components/xplor-links.js +5 -2
- package/components/xplor-links.js.map +1 -1
- package/components/xplor-modal-persistent.js +2 -2
- package/components/xplor-modal.js +1 -1
- package/components/xplor-nav-tabs.js +41 -3
- package/components/xplor-nav-tabs.js.map +1 -1
- package/components/xplor-radio-btn.d.ts +11 -0
- package/components/xplor-radio-btn.js +131 -0
- package/components/xplor-radio-btn.js.map +1 -0
- package/components/xplor-section-card.js +2 -2
- package/components/xplor-section-card.js.map +1 -1
- package/components/xplor-section-heading.js +9 -3
- package/components/xplor-section-heading.js.map +1 -1
- package/components/xplor-table.js +14 -9
- package/components/xplor-table.js.map +1 -1
- package/components/xplor-text-bubble.js +2 -2
- package/components/xplor-text-field.js +2 -2
- package/components/xplor-time-picker.js +6 -6
- package/components/xplor-tooltip.js +1 -1
- package/dist/cjs/{index-Bc5o_4vY.js → index-BjAapk2n.js} +5 -5
- package/dist/cjs/index-BjAapk2n.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{xplor-alert-dialog_57.cjs.entry.js → xplor-alert-dialog_58.cjs.entry.js} +747 -108
- package/dist/cjs/xplor-alert-dialog_58.cjs.entry.js.map +1 -0
- package/dist/cjs/xplor-component-library.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/xplor-alert-dialog/xplor-alert-dialog.js +85 -1
- package/dist/collection/components/xplor-alert-dialog/xplor-alert-dialog.js.map +1 -1
- package/dist/collection/components/xplor-assistant/internal/AssistantInput.js +1 -1
- package/dist/collection/components/xplor-assistant/internal/AssistantInput.js.map +1 -1
- package/dist/collection/components/xplor-assistant/xplor-assistant.js +1 -1
- package/dist/collection/components/xplor-assistant/xplor-assistant.js.map +1 -1
- package/dist/collection/components/xplor-autocomplete/xplor-autocomplete.js +33 -9
- package/dist/collection/components/xplor-autocomplete/xplor-autocomplete.js.map +1 -1
- package/dist/collection/components/xplor-avatar/xplor-avatar.js +2 -2
- package/dist/collection/components/xplor-avatar/xplor-avatar.js.map +1 -1
- package/dist/collection/components/xplor-btn-back-to-parent/xplor-btn-back-to-parent.js +25 -1
- package/dist/collection/components/xplor-btn-back-to-parent/xplor-btn-back-to-parent.js.map +1 -1
- package/dist/collection/components/xplor-btn-icon/xplor-btn-icon.js +20 -1
- package/dist/collection/components/xplor-btn-icon/xplor-btn-icon.js.map +1 -1
- package/dist/collection/components/xplor-btn-menu/xplor-btn-menu.js +129 -5
- package/dist/collection/components/xplor-btn-menu/xplor-btn-menu.js.map +1 -1
- package/dist/collection/components/xplor-button/xplor-button.js +42 -1
- package/dist/collection/components/xplor-button/xplor-button.js.map +1 -1
- package/dist/collection/components/xplor-checkbox/xplor-checkbox.js +3 -1
- package/dist/collection/components/xplor-checkbox/xplor-checkbox.js.map +1 -1
- package/dist/collection/components/xplor-combobox/xplor-combobox.js +38 -10
- package/dist/collection/components/xplor-combobox/xplor-combobox.js.map +1 -1
- package/dist/collection/components/xplor-datatable/xplor-datatable.js +10 -4
- package/dist/collection/components/xplor-datatable/xplor-datatable.js.map +1 -1
- package/dist/collection/components/xplor-date-picker/xplor-date-picker.js +8 -4
- package/dist/collection/components/xplor-date-picker/xplor-date-picker.js.map +1 -1
- package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.css +125 -21
- package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.js +79 -4
- package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.js.map +1 -1
- package/dist/collection/components/xplor-dropdown/xplor-dropdown.js +1 -1
- package/dist/collection/components/xplor-expansion-panel/xplor-expansion-panel.js +4 -4
- package/dist/collection/components/xplor-expansion-panel/xplor-expansion-panel.js.map +1 -1
- package/dist/collection/components/xplor-expansion-panels/xplor-expansion-panels.js +1 -1
- package/dist/collection/components/xplor-expansion-panels/xplor-expansion-panels.js.map +1 -1
- package/dist/collection/components/xplor-file-upload/xplor-file-upload.js +2 -2
- package/dist/collection/components/xplor-file-upload/xplor-file-upload.js.map +1 -1
- package/dist/collection/components/xplor-inline-checkbox/xplor-inline-checkbox.js +2 -2
- package/dist/collection/components/xplor-inline-date-picker/xplor-inline-date-picker.js +77 -3
- package/dist/collection/components/xplor-inline-date-picker/xplor-inline-date-picker.js.map +1 -1
- package/dist/collection/components/xplor-inline-switch/xplor-inline-switch.js +1 -1
- package/dist/collection/components/xplor-input-file/xplor-input-file.js +3 -1
- package/dist/collection/components/xplor-input-file/xplor-input-file.js.map +1 -1
- package/dist/collection/components/xplor-input-search/xplor-input-search.js +4 -2
- package/dist/collection/components/xplor-input-search/xplor-input-search.js.map +1 -1
- package/dist/collection/components/xplor-input-select/xplor-input-select.css +1 -6
- package/dist/collection/components/xplor-input-select/xplor-input-select.js +152 -5
- package/dist/collection/components/xplor-input-select/xplor-input-select.js.map +1 -1
- package/dist/collection/components/xplor-input-send/xplor-input-send.js +2 -2
- package/dist/collection/components/xplor-input-send/xplor-input-send.js.map +1 -1
- package/dist/collection/components/xplor-input-text/xplor-input-text.js +6 -2
- package/dist/collection/components/xplor-input-text/xplor-input-text.js.map +1 -1
- package/dist/collection/components/xplor-input-text-area/xplor-input-text-area.js +6 -2
- package/dist/collection/components/xplor-input-text-area/xplor-input-text-area.js.map +1 -1
- package/dist/collection/components/xplor-input-text-secondary/xplor-input-text-secondary.js +6 -2
- package/dist/collection/components/xplor-input-text-secondary/xplor-input-text-secondary.js.map +1 -1
- package/dist/collection/components/xplor-input-title/xplor-input-title.js +25 -1
- package/dist/collection/components/xplor-input-title/xplor-input-title.js.map +1 -1
- package/dist/collection/components/xplor-links/xplor-links.js +25 -1
- package/dist/collection/components/xplor-links/xplor-links.js.map +1 -1
- package/dist/collection/components/xplor-modal/xplor-modal.js +88 -1
- package/dist/collection/components/xplor-modal/xplor-modal.js.map +1 -1
- package/dist/collection/components/xplor-modal-persistent/xplor-modal-persistent.js +1 -1
- package/dist/collection/components/xplor-nav-tabs/xplor-nav-tabs.js +49 -2
- package/dist/collection/components/xplor-nav-tabs/xplor-nav-tabs.js.map +1 -1
- package/dist/collection/components/xplor-radio-btn/xplor-radio-btn.css +386 -0
- package/dist/collection/components/xplor-radio-btn/xplor-radio-btn.js +275 -0
- package/dist/collection/components/xplor-radio-btn/xplor-radio-btn.js.map +1 -0
- package/dist/collection/components/xplor-section-card/xplor-section-card.js +2 -2
- package/dist/collection/components/xplor-section-card/xplor-section-card.js.map +1 -1
- package/dist/collection/components/xplor-section-heading/xplor-section-heading.js +27 -2
- package/dist/collection/components/xplor-section-heading/xplor-section-heading.js.map +1 -1
- package/dist/collection/components/xplor-table/xplor-table.js +14 -9
- package/dist/collection/components/xplor-table/xplor-table.js.map +1 -1
- package/dist/collection/components/xplor-text-bubble/xplor-text-bubble.js +2 -2
- package/dist/collection/components/xplor-text-field/xplor-text-field.js +2 -2
- package/dist/collection/components/xplor-time-picker/xplor-time-picker.js +6 -6
- package/dist/collection/components/xplor-tooltip/xplor-tooltip.js +18 -2
- package/dist/collection/components/xplor-tooltip/xplor-tooltip.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-BHdeGt6k.js → p--zhT6rvJ.js} +4 -4
- package/dist/components/p--zhT6rvJ.js.map +1 -0
- package/dist/components/{p-DKh6y3GY.js → p-04oMLTZR.js} +65 -5
- package/dist/components/p-04oMLTZR.js.map +1 -0
- package/dist/components/{p-DIv_A5Gj.js → p-B5rS_jjI.js} +7 -3
- package/dist/components/p-B5rS_jjI.js.map +1 -0
- package/dist/components/{p-4l9DAhAo.js → p-DbQ6ZNvh.js} +20 -4
- package/dist/components/p-DbQ6ZNvh.js.map +1 -0
- package/dist/components/{p-BIFlTsO8.js → p-Dh0wQJt6.js} +71 -6
- package/dist/components/p-Dh0wQJt6.js.map +1 -0
- package/dist/components/{p-CJGP2_5k.js → p-oOSnPjGy.js} +3 -3
- package/dist/components/{p-CJGP2_5k.js.map → p-oOSnPjGy.js.map} +1 -1
- package/dist/components/xplor-alert-dialog.js +60 -3
- package/dist/components/xplor-alert-dialog.js.map +1 -1
- package/dist/components/xplor-assistant.js +3 -3
- package/dist/components/xplor-assistant.js.map +1 -1
- package/dist/components/xplor-autocomplete.js +15 -9
- package/dist/components/xplor-autocomplete.js.map +1 -1
- package/dist/components/xplor-avatar-and-name.js +1 -1
- package/dist/components/xplor-avatar.js +1 -1
- package/dist/components/xplor-btn-back-to-parent.js +7 -2
- package/dist/components/xplor-btn-back-to-parent.js.map +1 -1
- package/dist/components/xplor-btn-icon.js +3 -2
- package/dist/components/xplor-btn-icon.js.map +1 -1
- package/dist/components/xplor-btn-menu.js +103 -6
- package/dist/components/xplor-btn-menu.js.map +1 -1
- package/dist/components/xplor-btn-tooltip.js +2 -2
- package/dist/components/xplor-button.js +1 -1
- package/dist/components/xplor-chat-widget.js +2 -2
- package/dist/components/xplor-checkbox.js +3 -1
- package/dist/components/xplor-checkbox.js.map +1 -1
- package/dist/components/xplor-combobox.js +20 -10
- package/dist/components/xplor-combobox.js.map +1 -1
- package/dist/components/xplor-datatable.js +10 -4
- package/dist/components/xplor-datatable.js.map +1 -1
- package/dist/components/xplor-date-picker.js +9 -5
- package/dist/components/xplor-date-picker.js.map +1 -1
- package/dist/components/xplor-drag-and-drop-input.js +43 -5
- package/dist/components/xplor-drag-and-drop-input.js.map +1 -1
- package/dist/components/xplor-dropdown.js +1 -1
- package/dist/components/xplor-expansion-panel.js +4 -4
- package/dist/components/xplor-expansion-panel.js.map +1 -1
- package/dist/components/xplor-expansion-panels.js +1 -1
- package/dist/components/xplor-expansion-panels.js.map +1 -1
- package/dist/components/xplor-file-upload.js +2 -2
- package/dist/components/xplor-file-upload.js.map +1 -1
- package/dist/components/xplor-inline-checkbox.js +2 -2
- package/dist/components/xplor-inline-date-picker.js +1 -1
- package/dist/components/xplor-inline-switch.js +1 -1
- package/dist/components/xplor-input-file.js +3 -1
- package/dist/components/xplor-input-file.js.map +1 -1
- package/dist/components/xplor-input-search.js +4 -2
- package/dist/components/xplor-input-search.js.map +1 -1
- package/dist/components/xplor-input-select.js +127 -7
- package/dist/components/xplor-input-select.js.map +1 -1
- package/dist/components/xplor-input-send.js +3 -3
- package/dist/components/xplor-input-send.js.map +1 -1
- package/dist/components/xplor-input-text-area.js +6 -2
- package/dist/components/xplor-input-text-area.js.map +1 -1
- package/dist/components/xplor-input-text-secondary.js +6 -2
- package/dist/components/xplor-input-text-secondary.js.map +1 -1
- package/dist/components/xplor-input-text.js +6 -2
- package/dist/components/xplor-input-text.js.map +1 -1
- package/dist/components/xplor-input-title.js +7 -2
- package/dist/components/xplor-input-title.js.map +1 -1
- package/dist/components/xplor-links.js +5 -2
- package/dist/components/xplor-links.js.map +1 -1
- package/dist/components/xplor-modal-persistent.js +2 -2
- package/dist/components/xplor-modal.js +1 -1
- package/dist/components/xplor-nav-tabs.js +41 -3
- package/dist/components/xplor-nav-tabs.js.map +1 -1
- package/dist/components/xplor-radio-btn.d.ts +11 -0
- package/dist/components/xplor-radio-btn.js +132 -0
- package/dist/components/xplor-radio-btn.js.map +1 -0
- package/dist/components/xplor-section-card.js +2 -2
- package/dist/components/xplor-section-card.js.map +1 -1
- package/dist/components/xplor-section-heading.js +9 -3
- package/dist/components/xplor-section-heading.js.map +1 -1
- package/dist/components/xplor-table.js +14 -9
- package/dist/components/xplor-table.js.map +1 -1
- package/dist/components/xplor-text-bubble.js +2 -2
- package/dist/components/xplor-text-field.js +2 -2
- package/dist/components/xplor-time-picker.js +6 -6
- package/dist/components/xplor-tooltip.js +1 -1
- package/dist/esm/{index-Zkk2NJif.js → index-KRfMjDC2.js} +5 -5
- package/dist/esm/index-KRfMjDC2.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{xplor-alert-dialog_57.entry.js → xplor-alert-dialog_58.entry.js} +747 -109
- package/dist/esm/xplor-alert-dialog_58.entry.js.map +1 -0
- package/dist/esm/xplor-component-library.js +3 -3
- package/dist/hydrate/index.js +798 -120
- package/dist/hydrate/index.mjs +798 -120
- package/dist/types/components/xplor-alert-dialog/xplor-alert-dialog.d.ts +11 -0
- package/dist/types/components/xplor-autocomplete/xplor-autocomplete.d.ts +4 -0
- package/dist/types/components/xplor-btn-back-to-parent/xplor-btn-back-to-parent.d.ts +4 -0
- package/dist/types/components/xplor-btn-icon/xplor-btn-icon.d.ts +4 -0
- package/dist/types/components/xplor-btn-menu/xplor-btn-menu.d.ts +19 -0
- package/dist/types/components/xplor-button/xplor-button.d.ts +4 -0
- package/dist/types/components/xplor-checkbox/xplor-checkbox.d.ts +1 -0
- package/dist/types/components/xplor-combobox/xplor-combobox.d.ts +4 -0
- package/dist/types/components/xplor-date-picker/xplor-date-picker.d.ts +3 -0
- package/dist/types/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.d.ts +11 -0
- package/dist/types/components/xplor-inline-date-picker/xplor-inline-date-picker.d.ts +3 -0
- package/dist/types/components/xplor-input-file/xplor-input-file.d.ts +1 -0
- package/dist/types/components/xplor-input-search/xplor-input-search.d.ts +1 -0
- package/dist/types/components/xplor-input-select/xplor-input-select.d.ts +15 -0
- package/dist/types/components/xplor-input-text/xplor-input-text.d.ts +3 -0
- package/dist/types/components/xplor-input-text-area/xplor-input-text-area.d.ts +3 -0
- package/dist/types/components/xplor-input-text-secondary/xplor-input-text-secondary.d.ts +3 -0
- package/dist/types/components/xplor-input-title/xplor-input-title.d.ts +4 -0
- package/dist/types/components/xplor-links/xplor-links.d.ts +2 -0
- package/dist/types/components/xplor-modal/xplor-modal.d.ts +11 -0
- package/dist/types/components/xplor-nav-tabs/xplor-nav-tabs.d.ts +2 -0
- package/dist/types/components/xplor-radio-btn/xplor-radio-btn.d.ts +35 -0
- package/dist/types/components/xplor-section-heading/xplor-section-heading.d.ts +4 -0
- package/dist/types/components/xplor-tooltip/xplor-tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +230 -2
- package/dist/xplor-component-library/p-0df9ea5d.entry.js +2 -0
- package/dist/xplor-component-library/p-0df9ea5d.entry.js.map +1 -0
- package/dist/xplor-component-library/{p-Zkk2NJif.js → p-KRfMjDC2.js} +3 -3
- package/dist/xplor-component-library/p-KRfMjDC2.js.map +1 -0
- package/dist/xplor-component-library/xplor-component-library.css +1 -1
- package/dist/xplor-component-library/xplor-component-library.esm.js +1 -1
- package/package.json +1 -1
- package/components/p-B1W2qj2l.js.map +0 -1
- package/components/p-CBSi5kQB.js.map +0 -1
- package/components/p-CTD6SyTD.js.map +0 -1
- package/components/p-Ddr35stE.js.map +0 -1
- package/components/p-x30CgLRv.js.map +0 -1
- package/dist/cjs/index-Bc5o_4vY.js.map +0 -1
- package/dist/cjs/xplor-alert-dialog_57.cjs.entry.js.map +0 -1
- package/dist/components/p-4l9DAhAo.js.map +0 -1
- package/dist/components/p-BHdeGt6k.js.map +0 -1
- package/dist/components/p-BIFlTsO8.js.map +0 -1
- package/dist/components/p-DIv_A5Gj.js.map +0 -1
- package/dist/components/p-DKh6y3GY.js.map +0 -1
- package/dist/esm/index-Zkk2NJif.js.map +0 -1
- package/dist/esm/xplor-alert-dialog_57.entry.js.map +0 -1
- package/dist/xplor-component-library/p-25fa8553.entry.js +0 -2
- package/dist/xplor-component-library/p-25fa8553.entry.js.map +0 -1
- package/dist/xplor-component-library/p-Zkk2NJif.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xplor-date-picker.js","sourceRoot":"","sources":["../../../src/components/xplor-date-picker/xplor-date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAOtG,MAAM,OAAO,eAAe;IAL5B;QAQE,yCAAyC;QAChB,UAAK,GAAW,EAAE,CAAC;QAEpC,UAAK,GAAW,EAAE,CAAC;QACnB,gBAAW,GAAW,aAAa,CAAC;QAE5C,wBAAwB;QAChB,SAAI,GAAqB,MAAM,CAAC;QAExC,mDAAmD;QAC3C,cAAS,GAAoB,OAAO,CAAC;QAE7C,4DAA4D;QACpD,YAAO,GAAqB,OAAO,CAAC;QAE5C,yFAAyF;QACjF,eAAU,GAA6B,OAAO,CAAC;QAE/C,QAAG,GAAW,EAAE,CAAC;QACjB,QAAG,GAAW,EAAE,CAAC;QACjB,aAAQ,GAAY,KAAK,CAAC;QAC1B,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,KAAK,CAAC;QAC3B,kBAAa,GAAY,IAAI,CAAC;QAC9B,YAAO,GAAW,OAAO,CAAC;QAC1B,UAAK,GAAW,SAAS,CAAC;QAC1B,sBAAiB,GAAY,IAAI,CAAC;QAClC,UAAK,GAAW,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Element, Listen } from '@stencil/core';\n\n@Component({\n tag: 'xplor-date-picker',\n styleUrl: 'xplor-date-picker.scss',\n scoped: true,\n})\nexport class XplorDatePicker {\n @Element() el: HTMLElement;\n\n /** Selected date in YYYY-MM-DD format */\n @Prop({ mutable: true }) value: string = '';\n\n @Prop() label: string = '';\n @Prop() placeholder: string = 'Select date';\n\n /** 'date' or 'month' */\n @Prop() type: 'date' | 'month' = 'date';\n\n /** For month type: select start or end of month */\n @Prop() monthType: 'start' | 'end' = 'start';\n\n /** 'input' shows text input, 'text' shows clickable text */\n @Prop() display: 'input' | 'text' = 'input';\n\n /** Date display format: 'short' (DD/MM/YYYY), 'long' (1 Jan 2025), 'iso' (YYYY-MM-DD) */\n @Prop() dateFormat: 'short' | 'long' | 'iso' = 'short';\n\n @Prop() min: string = '';\n @Prop() max: string = '';\n @Prop() readonly: boolean = false;\n @Prop() disabled: boolean = false;\n @Prop() clearable: boolean = false;\n @Prop() closeOnSelect: boolean = true;\n @Prop() bgColor: string = 'white';\n @Prop() color: string = '#008480';\n @Prop() startWeekOnSunday: boolean = true;\n @Prop() error: string = '';\n @Prop() hideDetails: boolean | 'auto' = 'auto';\n @Prop() required: boolean = false;\n\n @State() isOpen: boolean = false;\n @State() inputText: string = '';\n @State() dropdownPosition: 'bottom' | 'top' = 'bottom';\n\n @Event() dateChange: EventEmitter<string>;\n @Event() xplorFocus: EventEmitter<FocusEvent>;\n @Event() xplorBlur: EventEmitter<FocusEvent>;\n @Event() xplorClear: EventEmitter<void>;\n\n componentWillLoad() {\n if (this.value) {\n this.inputText = this.formatDateForDisplay(this.value);\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: MouseEvent) {\n const target = event.target as Node;\n if (!this.el.contains(target)) {\n this.isOpen = false;\n }\n }\n\n /** Parse YYYY-MM-DD safely without UTC shift */\n private parseISODate(iso: string): Date | null {\n if (!iso) return null;\n const d = new Date(iso + 'T00:00:00');\n return isNaN(d.getTime()) ? null : d;\n }\n\n private formatDateForDisplay(iso: string): string {\n const date = this.parseISODate(iso);\n if (!date) return iso;\n\n if (this.type === 'month') {\n return new Intl.DateTimeFormat('en-AU', { month: 'long', year: 'numeric' }).format(date);\n }\n\n switch (this.dateFormat) {\n case 'long':\n return new Intl.DateTimeFormat('en-AU', { day: 'numeric', month: 'short', year: 'numeric' }).format(date);\n case 'iso':\n return iso;\n case 'short':\n default:\n return new Intl.DateTimeFormat('en-AU', { day: '2-digit', month: '2-digit', year: 'numeric' }).format(date);\n }\n }\n\n private toISO(date: Date): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n return `${year}-${month}-${day}`;\n }\n\n /** Parse user-typed text into YYYY-MM-DD */\n private parseInputText(text: string): string | null {\n const trimmed = text.trim();\n if (!trimmed) return null;\n\n // Try DD/MM/YYYY\n const slashMatch = trimmed.match(/^(\\d{1,2})[/\\-.](\\d{1,2})[/\\-.](\\d{4})$/);\n if (slashMatch) {\n const day = parseInt(slashMatch[1], 10);\n const month = parseInt(slashMatch[2], 10);\n const year = parseInt(slashMatch[3], 10);\n const d = new Date(year, month - 1, day);\n if (d.getFullYear() === year && d.getMonth() === month - 1 && d.getDate() === day) {\n return this.toISO(d);\n }\n }\n\n // Try YYYY-MM-DD\n const isoMatch = trimmed.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (isoMatch) {\n const year = parseInt(isoMatch[1], 10);\n const month = parseInt(isoMatch[2], 10);\n const day = parseInt(isoMatch[3], 10);\n const d = new Date(year, month - 1, day);\n if (d.getFullYear() === year && d.getMonth() === month - 1 && d.getDate() === day) {\n return this.toISO(d);\n }\n }\n\n // Try natural string via Date.parse\n const d = new Date(trimmed);\n if (!isNaN(d.getTime())) {\n return this.toISO(d);\n }\n\n return null;\n }\n\n private isDateInRange(iso: string): boolean {\n if (!iso) return true;\n if (this.min && iso < this.min) return false;\n if (this.max && iso > this.max) return false;\n return true;\n }\n\n private updateDropdownPosition() {\n const rect = this.el.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n this.dropdownPosition = spaceBelow < 350 ? 'top' : 'bottom';\n }\n\n private toggleDropdown = () => {\n if (this.disabled || this.readonly) return;\n this.updateDropdownPosition();\n this.isOpen = !this.isOpen;\n };\n\n private handleInputFocus = (event: FocusEvent) => {\n this.xplorFocus.emit(event);\n };\n\n private handleInputBlur = (event: FocusEvent) => {\n this.xplorBlur.emit(event);\n // Try to parse typed text\n const parsed = this.parseInputText(this.inputText);\n if (parsed && this.isDateInRange(parsed)) {\n this.value = parsed;\n this.inputText = this.formatDateForDisplay(parsed);\n this.dateChange.emit(parsed);\n } else if (this.value) {\n // Revert to current value display\n this.inputText = this.formatDateForDisplay(this.value);\n } else {\n this.inputText = '';\n }\n };\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.inputText = input.value;\n };\n\n private handleDateSelected = (event: CustomEvent<string>) => {\n event.stopPropagation();\n const iso = event.detail;\n if (!this.isDateInRange(iso)) return;\n\n if (this.type === 'month') {\n const d = this.parseISODate(iso);\n if (d) {\n let finalDate: Date;\n if (this.monthType === 'end') {\n finalDate = new Date(d.getFullYear(), d.getMonth() + 1, 0);\n } else {\n finalDate = new Date(d.getFullYear(), d.getMonth(), 1);\n }\n const finalIso = this.toISO(finalDate);\n this.value = finalIso;\n this.inputText = this.formatDateForDisplay(finalIso);\n this.dateChange.emit(finalIso);\n }\n } else {\n this.value = iso;\n this.inputText = this.formatDateForDisplay(iso);\n this.dateChange.emit(iso);\n }\n\n if (this.closeOnSelect) {\n this.isOpen = false;\n }\n };\n\n private handleClear = (event: Event) => {\n event.stopPropagation();\n this.value = '';\n this.inputText = '';\n this.dateChange.emit('');\n this.xplorClear.emit();\n };\n\n private handleTextClick = () => {\n if (this.disabled || this.readonly) return;\n this.updateDropdownPosition();\n this.isOpen = !this.isOpen;\n };\n\n render() {\n const showDetails = this.hideDetails === false || (this.hideDetails === 'auto' && this.error);\n\n const calendarIcon = (\n <svg class=\"date-picker__icon-svg\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"></rect>\n <line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"></line>\n <line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"></line>\n <line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"></line>\n </svg>\n );\n\n return (\n <Host>\n <div class={{\n 'date-picker': true,\n 'date-picker--disabled': this.disabled,\n 'date-picker--error': !!this.error,\n 'date-picker--open': this.isOpen,\n }}>\n {this.label && (\n <label class=\"date-picker__label\">\n {this.label}\n {this.required && <span class=\"date-picker__required\">*</span>}\n </label>\n )}\n\n {this.display === 'text' ? (\n <div class=\"date-picker__text-display\" onClick={this.handleTextClick}>\n <span class=\"date-picker__text-value\">\n {this.value ? this.formatDateForDisplay(this.value) : this.placeholder}\n </span>\n {calendarIcon}\n </div>\n ) : (\n <div class=\"date-picker__field\">\n <input\n type=\"text\"\n class=\"date-picker__input\"\n value={this.inputText}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n onFocus={this.handleInputFocus}\n onBlur={this.handleInputBlur}\n onInput={this.handleInputChange}\n style={{ backgroundColor: this.bgColor }}\n />\n <div class=\"date-picker__actions\">\n {this.clearable && this.value && !this.disabled && !this.readonly && (\n <button type=\"button\" class=\"date-picker__clear\" onClick={this.handleClear} aria-label=\"Clear\">\n ×\n </button>\n )}\n <button type=\"button\" class=\"date-picker__icon-btn\" onClick={this.toggleDropdown} disabled={this.disabled} aria-label=\"Open calendar\">\n {calendarIcon}\n </button>\n </div>\n </div>\n )}\n\n {showDetails && (\n <div class=\"date-picker__details\">\n {this.error && <div class=\"date-picker__error-message\">{this.error}</div>}\n </div>\n )}\n\n {this.isOpen && (\n <div class={{\n 'date-picker__dropdown': true,\n 'date-picker__dropdown--top': this.dropdownPosition === 'top',\n }}>\n <xplor-inline-date-picker\n selectedDate={this.value}\n min={this.min}\n max={this.max}\n readonly={this.readonly}\n color={this.color}\n startWeekOnSunday={this.startWeekOnSunday}\n onDateSelected={this.handleDateSelected}\n ></xplor-inline-date-picker>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"xplor-date-picker.js","sourceRoot":"","sources":["../../../src/components/xplor-date-picker/xplor-date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEtG,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAO5B,MAAM,OAAO,eAAe;IAL5B;QAQE,yCAAyC;QAChB,UAAK,GAAW,EAAE,CAAC;QAEpC,UAAK,GAAW,EAAE,CAAC;QACnB,gBAAW,GAAW,aAAa,CAAC;QAE5C,wBAAwB;QAChB,SAAI,GAAqB,MAAM,CAAC;QAExC,mDAAmD;QAC3C,cAAS,GAAoB,OAAO,CAAC;QAE7C,4DAA4D;QACpD,YAAO,GAAqB,OAAO,CAAC;QAE5C,yFAAyF;QACjF,eAAU,GAA6B,OAAO,CAAC;QAE/C,QAAG,GAAW,EAAE,CAAC;QACjB,QAAG,GAAW,EAAE,CAAC;QACjB,aAAQ,GAAY,KAAK,CAAC;QAC1B,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,KAAK,CAAC;QAC3B,kBAAa,GAAY,IAAI,CAAC;QAC9B,YAAO,GAAW,OAAO,CAAC;QAC1B,UAAK,GAAW,SAAS,CAAC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K,KAAK;qBAC9D;oBACC,iFACE,YAAY,EAAE,IAAI,CAAC,KAAK,EACxB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,cAAc,EAAE,IAAI,CAAC,kBAAkB,GACb,CACxB,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Element, Listen } from '@stencil/core';\n\nlet datePickerIdCounter = 0;\n\n@Component({\n tag: 'xplor-date-picker',\n styleUrl: 'xplor-date-picker.scss',\n scoped: true,\n})\nexport class XplorDatePicker {\n @Element() el: HTMLElement;\n\n /** Selected date in YYYY-MM-DD format */\n @Prop({ mutable: true }) value: string = '';\n\n @Prop() label: string = '';\n @Prop() placeholder: string = 'Select date';\n\n /** 'date' or 'month' */\n @Prop() type: 'date' | 'month' = 'date';\n\n /** For month type: select start or end of month */\n @Prop() monthType: 'start' | 'end' = 'start';\n\n /** 'input' shows text input, 'text' shows clickable text */\n @Prop() display: 'input' | 'text' = 'input';\n\n /** Date display format: 'short' (DD/MM/YYYY), 'long' (1 Jan 2025), 'iso' (YYYY-MM-DD) */\n @Prop() dateFormat: 'short' | 'long' | 'iso' = 'short';\n\n @Prop() min: string = '';\n @Prop() max: string = '';\n @Prop() readonly: boolean = false;\n @Prop() disabled: boolean = false;\n @Prop() clearable: boolean = false;\n @Prop() closeOnSelect: boolean = true;\n @Prop() bgColor: string = 'white';\n @Prop() color: string = '#008480';\n @Prop() startWeekOnSunday: boolean = true;\n @Prop() error: string = '';\n @Prop() hideDetails: boolean | 'auto' = 'auto';\n @Prop() required: boolean = false;\n\n @State() isOpen: boolean = false;\n @State() inputText: string = '';\n @State() dropdownPosition: 'bottom' | 'top' = 'bottom';\n\n private inputId = `xplor-date-picker-${++datePickerIdCounter}`;\n private labelId = `${this.inputId}-label`;\n private errorId = `${this.inputId}-error`;\n\n @Event() dateChange: EventEmitter<string>;\n @Event() xplorFocus: EventEmitter<FocusEvent>;\n @Event() xplorBlur: EventEmitter<FocusEvent>;\n @Event() xplorClear: EventEmitter<void>;\n\n componentWillLoad() {\n if (this.value) {\n this.inputText = this.formatDateForDisplay(this.value);\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: MouseEvent) {\n const target = event.target as Node;\n if (!this.el.contains(target)) {\n this.isOpen = false;\n }\n }\n\n /** Parse YYYY-MM-DD safely without UTC shift */\n private parseISODate(iso: string): Date | null {\n if (!iso) return null;\n const d = new Date(iso + 'T00:00:00');\n return isNaN(d.getTime()) ? null : d;\n }\n\n private formatDateForDisplay(iso: string): string {\n const date = this.parseISODate(iso);\n if (!date) return iso;\n\n if (this.type === 'month') {\n return new Intl.DateTimeFormat('en-AU', { month: 'long', year: 'numeric' }).format(date);\n }\n\n switch (this.dateFormat) {\n case 'long':\n return new Intl.DateTimeFormat('en-AU', { day: 'numeric', month: 'short', year: 'numeric' }).format(date);\n case 'iso':\n return iso;\n case 'short':\n default:\n return new Intl.DateTimeFormat('en-AU', { day: '2-digit', month: '2-digit', year: 'numeric' }).format(date);\n }\n }\n\n private toISO(date: Date): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n return `${year}-${month}-${day}`;\n }\n\n /** Parse user-typed text into YYYY-MM-DD */\n private parseInputText(text: string): string | null {\n const trimmed = text.trim();\n if (!trimmed) return null;\n\n // Try DD/MM/YYYY\n const slashMatch = trimmed.match(/^(\\d{1,2})[/\\-.](\\d{1,2})[/\\-.](\\d{4})$/);\n if (slashMatch) {\n const day = parseInt(slashMatch[1], 10);\n const month = parseInt(slashMatch[2], 10);\n const year = parseInt(slashMatch[3], 10);\n const d = new Date(year, month - 1, day);\n if (d.getFullYear() === year && d.getMonth() === month - 1 && d.getDate() === day) {\n return this.toISO(d);\n }\n }\n\n // Try YYYY-MM-DD\n const isoMatch = trimmed.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (isoMatch) {\n const year = parseInt(isoMatch[1], 10);\n const month = parseInt(isoMatch[2], 10);\n const day = parseInt(isoMatch[3], 10);\n const d = new Date(year, month - 1, day);\n if (d.getFullYear() === year && d.getMonth() === month - 1 && d.getDate() === day) {\n return this.toISO(d);\n }\n }\n\n // Try natural string via Date.parse\n const d = new Date(trimmed);\n if (!isNaN(d.getTime())) {\n return this.toISO(d);\n }\n\n return null;\n }\n\n private isDateInRange(iso: string): boolean {\n if (!iso) return true;\n if (this.min && iso < this.min) return false;\n if (this.max && iso > this.max) return false;\n return true;\n }\n\n private updateDropdownPosition() {\n const rect = this.el.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n this.dropdownPosition = spaceBelow < 350 ? 'top' : 'bottom';\n }\n\n private toggleDropdown = () => {\n if (this.disabled || this.readonly) return;\n this.updateDropdownPosition();\n this.isOpen = !this.isOpen;\n };\n\n private handleInputFocus = (event: FocusEvent) => {\n this.xplorFocus.emit(event);\n };\n\n private handleInputBlur = (event: FocusEvent) => {\n this.xplorBlur.emit(event);\n // Try to parse typed text\n const parsed = this.parseInputText(this.inputText);\n if (parsed && this.isDateInRange(parsed)) {\n this.value = parsed;\n this.inputText = this.formatDateForDisplay(parsed);\n this.dateChange.emit(parsed);\n } else if (this.value) {\n // Revert to current value display\n this.inputText = this.formatDateForDisplay(this.value);\n } else {\n this.inputText = '';\n }\n };\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.inputText = input.value;\n };\n\n private handleDateSelected = (event: CustomEvent<string>) => {\n event.stopPropagation();\n const iso = event.detail;\n if (!this.isDateInRange(iso)) return;\n\n if (this.type === 'month') {\n const d = this.parseISODate(iso);\n if (d) {\n let finalDate: Date;\n if (this.monthType === 'end') {\n finalDate = new Date(d.getFullYear(), d.getMonth() + 1, 0);\n } else {\n finalDate = new Date(d.getFullYear(), d.getMonth(), 1);\n }\n const finalIso = this.toISO(finalDate);\n this.value = finalIso;\n this.inputText = this.formatDateForDisplay(finalIso);\n this.dateChange.emit(finalIso);\n }\n } else {\n this.value = iso;\n this.inputText = this.formatDateForDisplay(iso);\n this.dateChange.emit(iso);\n }\n\n if (this.closeOnSelect) {\n this.isOpen = false;\n }\n };\n\n private handleClear = (event: Event) => {\n event.stopPropagation();\n this.value = '';\n this.inputText = '';\n this.dateChange.emit('');\n this.xplorClear.emit();\n };\n\n private handleTextClick = () => {\n if (this.disabled || this.readonly) return;\n this.updateDropdownPosition();\n this.isOpen = !this.isOpen;\n };\n\n render() {\n const showDetails = this.hideDetails === false || (this.hideDetails === 'auto' && this.error);\n\n const calendarIcon = (\n <svg class=\"date-picker__icon-svg\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"></rect>\n <line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"></line>\n <line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"></line>\n <line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"></line>\n </svg>\n );\n\n return (\n <Host>\n <div class={{\n 'date-picker': true,\n 'date-picker--disabled': this.disabled,\n 'date-picker--error': !!this.error,\n 'date-picker--open': this.isOpen,\n }}>\n {this.label && (\n <label class=\"date-picker__label\" id={this.labelId} htmlFor={this.inputId}>\n {this.label}\n {this.required && <span class=\"date-picker__required\">*</span>}\n </label>\n )}\n\n {this.display === 'text' ? (\n <div\n class=\"date-picker__text-display\"\n onClick={this.handleTextClick}\n aria-expanded={this.isOpen ? 'true' : 'false'}\n aria-haspopup=\"dialog\"\n role=\"button\"\n tabIndex={0}\n >\n <span class=\"date-picker__text-value\">\n {this.value ? this.formatDateForDisplay(this.value) : this.placeholder}\n </span>\n {calendarIcon}\n </div>\n ) : (\n <div class=\"date-picker__field\">\n <input\n id={this.inputId}\n type=\"text\"\n class=\"date-picker__input\"\n value={this.inputText}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n onFocus={this.handleInputFocus}\n onBlur={this.handleInputBlur}\n onInput={this.handleInputChange}\n style={{ backgroundColor: this.bgColor }}\n aria-expanded={this.isOpen ? 'true' : 'false'}\n aria-haspopup=\"dialog\"\n aria-describedby={this.error ? this.errorId : undefined}\n aria-invalid={this.error ? 'true' : undefined}\n aria-required={this.required ? 'true' : undefined}\n />\n <div class=\"date-picker__actions\">\n {this.clearable && this.value && !this.disabled && !this.readonly && (\n <button type=\"button\" class=\"date-picker__clear\" onClick={this.handleClear} aria-label=\"Clear\">\n ×\n </button>\n )}\n <button type=\"button\" class=\"date-picker__icon-btn\" onClick={this.toggleDropdown} disabled={this.disabled} aria-label=\"Open calendar\">\n {calendarIcon}\n </button>\n </div>\n </div>\n )}\n\n {showDetails && (\n <div class=\"date-picker__details\">\n {this.error && <div class=\"date-picker__error-message\" id={this.errorId}>{this.error}</div>}\n </div>\n )}\n\n {this.isOpen && (\n <div class={{\n 'date-picker__dropdown': true,\n 'date-picker__dropdown--top': this.dropdownPosition === 'top',\n }}>\n <xplor-inline-date-picker\n selectedDate={this.value}\n min={this.min}\n max={this.max}\n readonly={this.readonly}\n color={this.color}\n startWeekOnSunday={this.startWeekOnSunday}\n onDateSelected={this.handleDateSelected}\n ></xplor-inline-date-picker>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1050,7 +1050,7 @@ ul.mdc-list li.mdc-list-item {
|
|
|
1050
1050
|
display: block;
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
|
-
.drag-drop-
|
|
1053
|
+
.drag-drop-zone {
|
|
1054
1054
|
position: relative;
|
|
1055
1055
|
padding-bottom: 2.5rem;
|
|
1056
1056
|
}
|
|
@@ -1060,21 +1060,22 @@ ul.mdc-list li.mdc-list-item {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
1062
1062
|
.drag-drop-card {
|
|
1063
|
-
background-color:
|
|
1063
|
+
background-color: #f5f5f5;
|
|
1064
1064
|
border-radius: 8px;
|
|
1065
|
-
border:
|
|
1066
|
-
min-height:
|
|
1067
|
-
padding: 1rem 1.5rem
|
|
1065
|
+
border: 2px dashed var(--color-secondary);
|
|
1066
|
+
min-height: 160px;
|
|
1067
|
+
padding: 1rem 1.5rem 2rem;
|
|
1068
1068
|
text-align: center;
|
|
1069
1069
|
transition: all 0.2s ease;
|
|
1070
1070
|
cursor: default;
|
|
1071
1071
|
}
|
|
1072
1072
|
.drag-drop-card:hover:not(.drag-drop-card--disabled) {
|
|
1073
1073
|
border-color: var(--color-secondary);
|
|
1074
|
+
background-color: #eeeeee;
|
|
1074
1075
|
}
|
|
1075
1076
|
.drag-drop-card--dragover {
|
|
1076
|
-
border:
|
|
1077
|
-
background-color:
|
|
1077
|
+
border: 2px dashed var(--color-secondary);
|
|
1078
|
+
background-color: #eeeeee;
|
|
1078
1079
|
}
|
|
1079
1080
|
.drag-drop-card--disabled {
|
|
1080
1081
|
opacity: 0.6;
|
|
@@ -1085,22 +1086,22 @@ ul.mdc-list li.mdc-list-item {
|
|
|
1085
1086
|
display: flex;
|
|
1086
1087
|
flex-direction: column;
|
|
1087
1088
|
align-items: center;
|
|
1088
|
-
gap:
|
|
1089
|
-
padding: 0.
|
|
1089
|
+
gap: 0.25rem;
|
|
1090
|
+
padding: 0.25rem 0 0;
|
|
1090
1091
|
}
|
|
1091
1092
|
|
|
1092
1093
|
.drag-drop-card__icon {
|
|
1093
1094
|
color: var(--color-secondary);
|
|
1094
|
-
width:
|
|
1095
|
-
height:
|
|
1095
|
+
width: 40px;
|
|
1096
|
+
height: 40px;
|
|
1096
1097
|
}
|
|
1097
1098
|
|
|
1098
1099
|
.drag-drop-card__title {
|
|
1099
1100
|
color: #000000;
|
|
1100
1101
|
font-family: Inter, sans-serif;
|
|
1101
|
-
font-size:
|
|
1102
|
+
font-size: 18px;
|
|
1102
1103
|
font-weight: 700;
|
|
1103
|
-
line-height:
|
|
1104
|
+
line-height: 24px;
|
|
1104
1105
|
letter-spacing: 0;
|
|
1105
1106
|
margin: 0;
|
|
1106
1107
|
}
|
|
@@ -1122,24 +1123,127 @@ ul.mdc-list li.mdc-list-item {
|
|
|
1122
1123
|
transform: translateX(-50%);
|
|
1123
1124
|
}
|
|
1124
1125
|
|
|
1125
|
-
.
|
|
1126
|
-
margin-top:
|
|
1127
|
-
|
|
1126
|
+
.file-info {
|
|
1127
|
+
margin-top: 1.5rem;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
.file-info__status {
|
|
1128
1131
|
font-family: Inter, sans-serif;
|
|
1129
1132
|
font-size: 14px;
|
|
1130
1133
|
font-weight: 400;
|
|
1131
1134
|
line-height: 20px;
|
|
1132
|
-
|
|
1133
|
-
|
|
1135
|
+
color: #616161;
|
|
1136
|
+
margin: 0 0 0.5rem 0;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
.file-info__card {
|
|
1140
|
+
display: flex;
|
|
1141
|
+
align-items: flex-start;
|
|
1142
|
+
gap: 0.75rem;
|
|
1143
|
+
background-color: #ffffff;
|
|
1144
|
+
border: 1px solid #e0e0e0;
|
|
1145
|
+
border-radius: 8px;
|
|
1146
|
+
padding: 0.75rem 1rem;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
.file-info__icon {
|
|
1150
|
+
flex-shrink: 0;
|
|
1151
|
+
display: flex;
|
|
1152
|
+
align-items: center;
|
|
1153
|
+
justify-content: center;
|
|
1154
|
+
width: 40px;
|
|
1155
|
+
height: 40px;
|
|
1156
|
+
border-radius: 8px;
|
|
1157
|
+
background-color: var(--color-secondary-50, #f3e5f5);
|
|
1158
|
+
color: var(--color-secondary);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
.file-info__details {
|
|
1162
|
+
flex: 1;
|
|
1163
|
+
min-width: 0;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
.file-info__name {
|
|
1167
|
+
font-family: Inter, sans-serif;
|
|
1168
|
+
font-size: 14px;
|
|
1169
|
+
font-weight: 600;
|
|
1170
|
+
line-height: 20px;
|
|
1171
|
+
color: #000000;
|
|
1172
|
+
margin: 0;
|
|
1173
|
+
overflow: hidden;
|
|
1174
|
+
text-overflow: ellipsis;
|
|
1175
|
+
white-space: nowrap;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.file-info__meta {
|
|
1179
|
+
font-family: Inter, sans-serif;
|
|
1180
|
+
font-size: 12px;
|
|
1181
|
+
font-weight: 400;
|
|
1182
|
+
line-height: 18px;
|
|
1183
|
+
color: var(--color-secondary);
|
|
1184
|
+
margin: 0.25rem 0 0 0;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
.file-info__progress-row {
|
|
1188
|
+
display: flex;
|
|
1189
|
+
align-items: center;
|
|
1190
|
+
gap: 0.5rem;
|
|
1191
|
+
margin-top: 0.5rem;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.file-info__progress-bar {
|
|
1195
|
+
flex: 1;
|
|
1196
|
+
height: 6px;
|
|
1197
|
+
background-color: #eeeeee;
|
|
1198
|
+
border-radius: 3px;
|
|
1199
|
+
overflow: hidden;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
.file-info__progress-fill {
|
|
1203
|
+
height: 100%;
|
|
1204
|
+
background-color: var(--color-secondary);
|
|
1205
|
+
border-radius: 3px;
|
|
1206
|
+
transition: width 0.3s ease;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
.file-info__progress-text {
|
|
1210
|
+
font-family: Inter, sans-serif;
|
|
1211
|
+
font-size: 12px;
|
|
1212
|
+
font-weight: 400;
|
|
1213
|
+
line-height: 18px;
|
|
1214
|
+
color: #757575;
|
|
1215
|
+
flex-shrink: 0;
|
|
1216
|
+
min-width: 32px;
|
|
1217
|
+
text-align: right;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
.file-info__remove {
|
|
1221
|
+
flex-shrink: 0;
|
|
1222
|
+
display: flex;
|
|
1223
|
+
align-items: center;
|
|
1224
|
+
justify-content: center;
|
|
1225
|
+
width: 32px;
|
|
1226
|
+
height: 32px;
|
|
1227
|
+
border-radius: 50%;
|
|
1228
|
+
border: none;
|
|
1229
|
+
background-color: #eeeeee;
|
|
1230
|
+
color: #757575;
|
|
1231
|
+
cursor: pointer;
|
|
1232
|
+
padding: 0;
|
|
1233
|
+
transition: background-color 0.2s ease;
|
|
1234
|
+
}
|
|
1235
|
+
.file-info__remove:hover {
|
|
1236
|
+
background-color: #e0e0e0;
|
|
1237
|
+
color: #424242;
|
|
1134
1238
|
}
|
|
1135
1239
|
|
|
1136
1240
|
@media (max-width: 768px) {
|
|
1137
1241
|
.drag-drop-card {
|
|
1138
|
-
min-height:
|
|
1242
|
+
min-height: 140px;
|
|
1139
1243
|
}
|
|
1140
1244
|
.drag-drop-card__title {
|
|
1141
|
-
font-size:
|
|
1142
|
-
line-height:
|
|
1245
|
+
font-size: 16px;
|
|
1246
|
+
line-height: 22px;
|
|
1143
1247
|
}
|
|
1144
1248
|
.drag-drop-card__accepts,
|
|
1145
1249
|
.drag-drop-card__divider {
|
|
@@ -13,11 +13,15 @@ export class XplorDragAndDropInput {
|
|
|
13
13
|
/**
|
|
14
14
|
* Instruction text displayed in the drop zone
|
|
15
15
|
*/
|
|
16
|
-
this.label = 'Drag and drop your
|
|
16
|
+
this.label = 'Drag and drop your files here';
|
|
17
17
|
/**
|
|
18
18
|
* Browse button label text
|
|
19
19
|
*/
|
|
20
20
|
this.browseLabel = 'Browse Files';
|
|
21
|
+
/**
|
|
22
|
+
* Upload progress percentage (0-100). Set to -1 or leave undefined to hide the progress bar.
|
|
23
|
+
*/
|
|
24
|
+
this.progress = -1;
|
|
21
25
|
this.dragover = false;
|
|
22
26
|
this.currentFile = null;
|
|
23
27
|
this.onDrop = (e) => {
|
|
@@ -73,6 +77,34 @@ export class XplorDragAndDropInput {
|
|
|
73
77
|
}
|
|
74
78
|
return accepts;
|
|
75
79
|
};
|
|
80
|
+
this.formatFileSize = (bytes) => {
|
|
81
|
+
if (bytes === 0)
|
|
82
|
+
return '0 Bytes';
|
|
83
|
+
const k = 1024;
|
|
84
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
|
85
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
86
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
|
87
|
+
};
|
|
88
|
+
this.formatDate = (timestamp) => {
|
|
89
|
+
const date = new Date(timestamp);
|
|
90
|
+
const day = date.getDate();
|
|
91
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
92
|
+
const month = months[date.getMonth()];
|
|
93
|
+
const year = date.getFullYear();
|
|
94
|
+
const suffix = (day === 1 || day === 21 || day === 31) ? 'st'
|
|
95
|
+
: (day === 2 || day === 22) ? 'nd'
|
|
96
|
+
: (day === 3 || day === 23) ? 'rd'
|
|
97
|
+
: 'th';
|
|
98
|
+
const hours = date.getHours();
|
|
99
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
100
|
+
const seconds = date.getSeconds().toString().padStart(2, '0');
|
|
101
|
+
const ampm = hours >= 12 ? 'PM' : 'AM';
|
|
102
|
+
const displayHours = hours % 12 || 12;
|
|
103
|
+
return `${day}${suffix} ${month} ${year}, ${displayHours}:${minutes}:${seconds} ${ampm}`;
|
|
104
|
+
};
|
|
105
|
+
this.showProgress = () => {
|
|
106
|
+
return this.progress >= 0 && this.progress <= 100;
|
|
107
|
+
};
|
|
76
108
|
}
|
|
77
109
|
/**
|
|
78
110
|
* Clears the currently selected file
|
|
@@ -85,11 +117,15 @@ export class XplorDragAndDropInput {
|
|
|
85
117
|
this.fileClear.emit();
|
|
86
118
|
}
|
|
87
119
|
render() {
|
|
88
|
-
|
|
120
|
+
const progressValue = Math.min(Math.max(this.progress, 0), 100);
|
|
121
|
+
const dropZoneLabel = this.ariaLabel || `${this.label}. Accepted file types: ${this.getAcceptsLabel()}. Or use the ${this.browseLabel} button.`;
|
|
122
|
+
return (h(Host, { key: '4ca1a26f1c043761a3bcafebf3ccdf57ec17467b' }, h("div", { key: '60c9f55d838820e2d9c087fbb652559944ecfc36', class: "drag-drop-zone" }, h("div", { key: 'f15e206b7f1e1741f5ee96681e000400e72d66b1', class: {
|
|
89
123
|
'drag-drop-card': true,
|
|
90
124
|
'drag-drop-card--dragover': this.dragover,
|
|
91
125
|
'drag-drop-card--disabled': this.disabled,
|
|
92
|
-
}, onDrop: this.onDrop, onDragOver: this.onDragOver, onDragEnter: this.onDragEnter, onDragLeave: this.onDragLeave }, h("div", { key: '
|
|
126
|
+
}, onDrop: this.onDrop, onDragOver: this.onDragOver, onDragEnter: this.onDragEnter, onDragLeave: this.onDragLeave, role: "region", "aria-label": dropZoneLabel }, h("div", { key: '49325fd7ff2d44a045eba593e2cb3708316a5be4', class: "drag-drop-card__content" }, h("svg", { key: '23b8f38df073266201a01ec78a45b1cac924a3e4', class: "drag-drop-card__icon", xmlns: "http://www.w3.org/2000/svg", width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, h("path", { key: 'eb1c750d1657fd578cf15c9bc16d5d1885d703e8', d: "M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z", fill: "currentColor", opacity: "0.3" }), h("path", { key: '04dc16407d2abd999fbef9cc02346d499644f0a7', d: "M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z", fill: "currentColor" })), h("h3", { key: '82c31b56cb5f17445748e0bfb8668caef4ceea59', class: "drag-drop-card__title" }, this.label), h("p", { key: '69f3cf01f58dc8f3e2e13782be2a0274f2925a0d', class: "drag-drop-card__accepts" }, "Accepted file types: ", this.getAcceptsLabel()), h("p", { key: '0a6221601983e61cb4a0afd4a5178377b59b4ce4', class: "drag-drop-card__divider" }, "or"))), h("div", { key: '164c31d1407d492e415a086ae97dc8081a32eccc', class: "drag-drop-card__action" }, h("xplor-button", { key: 'b47c05a246700472cebc32c551096ad17f12da77', text: this.browseLabel, type: this.disabled ? 'disabled' : 'secondary', clickAction: this.openFileDialog, "aria-label": this.browseLabel }))), this.currentFile && (h("div", { key: '6e74d72d3545bc85f91a6d55865743bde26eba78', class: "file-info", "aria-live": "polite" }, this.showProgress() && (h("p", { key: '7884acf7b14ddcd052a11b53131e6fea03c0376d', class: "file-info__status" }, "Uploading ", this.progress === 100 ? '1' : '0', " / 1")), h("div", { key: '980b31adfde06383bdbe9d03f868a9cf907c83f8', class: "file-info__card" }, h("div", { key: 'c9ed4fc96a229e748a461d788ed60a8b7c693f7c', class: "file-info__icon", "aria-hidden": "true" }, h("svg", { key: '1749fafd0495beacdbbf2f89b2cf62c2530101db', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: '1b114d4b5b0f055534ba5f6a476d413600829c74', d: "M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z" }))), h("div", { key: '45608139178d2d821a6aeb39d75b1aa4117ca12a', class: "file-info__details" }, h("p", { key: '66df2443dd4dd310891e30f78ccd007df726afd3', class: "file-info__name" }, this.currentFile.name), h("p", { key: 'f8efc8b19987c88e7ff7de242b7ad3df4ff5962e', class: "file-info__meta" }, this.formatFileSize(this.currentFile.size), this.currentFile.lastModified
|
|
127
|
+
? ` | Last modified: ${this.formatDate(this.currentFile.lastModified)}`
|
|
128
|
+
: ''), this.showProgress() && (h("div", { key: 'eb384d34fcb7908a39bb3dd1520389f8bc35a8fd', class: "file-info__progress-row" }, h("div", { key: 'bbfb481fa86247c231db4c7505009d1a991c85d2', class: "file-info__progress-bar", role: "progressbar", "aria-valuenow": progressValue, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": `Upload progress: ${Math.round(progressValue)}%` }, h("div", { key: '8b93dcc26a1497783c4ef832b75c202e639a04ff', class: "file-info__progress-fill", style: { width: `${progressValue}%` } })), h("span", { key: 'a429605ee278d74660a717bc04765ca21af60f64', class: "file-info__progress-text", "aria-hidden": "true" }, Math.round(this.progress), "%")))), h("button", { key: '5ede3c138b788270b45a053ccf2504a35a5037ed', class: "file-info__remove", onClick: () => this.clearCurrentFile(), "aria-label": `Remove file ${this.currentFile.name}` }, h("svg", { key: '0a5c03471e01b7f59dadaff6c8ea08b746c8c4c2', xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, h("path", { key: '29a950f57d7a7d9aa74262f64fc055d8230e4453', d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12Z" })))))), h("input", { key: '437111b2dbd80a8aaf1a2a4105bc8298431b2b95', id: "drag-drop-file-select", type: "file", disabled: this.disabled, accept: this.accepts, class: "drag-drop-input-hidden", ref: (el) => (this.fileInputEl = el), onChange: this.onFileSelect, "aria-label": `${this.browseLabel} - ${this.label}`, tabindex: -1 })));
|
|
93
129
|
}
|
|
94
130
|
static get is() { return "xplor-drag-and-drop-input"; }
|
|
95
131
|
static get encapsulation() { return "scoped"; }
|
|
@@ -163,7 +199,7 @@ export class XplorDragAndDropInput {
|
|
|
163
199
|
"getter": false,
|
|
164
200
|
"setter": false,
|
|
165
201
|
"reflect": false,
|
|
166
|
-
"defaultValue": "'Drag and drop your
|
|
202
|
+
"defaultValue": "'Drag and drop your files here'"
|
|
167
203
|
},
|
|
168
204
|
"browseLabel": {
|
|
169
205
|
"type": "string",
|
|
@@ -184,6 +220,45 @@ export class XplorDragAndDropInput {
|
|
|
184
220
|
"setter": false,
|
|
185
221
|
"reflect": false,
|
|
186
222
|
"defaultValue": "'Browse Files'"
|
|
223
|
+
},
|
|
224
|
+
"ariaLabel": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"attribute": "aria-label",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "string",
|
|
230
|
+
"resolved": "string",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": false,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "Accessible label for the drop zone area"
|
|
238
|
+
},
|
|
239
|
+
"getter": false,
|
|
240
|
+
"setter": false,
|
|
241
|
+
"reflect": false
|
|
242
|
+
},
|
|
243
|
+
"progress": {
|
|
244
|
+
"type": "number",
|
|
245
|
+
"attribute": "progress",
|
|
246
|
+
"mutable": false,
|
|
247
|
+
"complexType": {
|
|
248
|
+
"original": "number",
|
|
249
|
+
"resolved": "number",
|
|
250
|
+
"references": {}
|
|
251
|
+
},
|
|
252
|
+
"required": false,
|
|
253
|
+
"optional": false,
|
|
254
|
+
"docs": {
|
|
255
|
+
"tags": [],
|
|
256
|
+
"text": "Upload progress percentage (0-100). Set to -1 or leave undefined to hide the progress bar."
|
|
257
|
+
},
|
|
258
|
+
"getter": false,
|
|
259
|
+
"setter": false,
|
|
260
|
+
"reflect": false,
|
|
261
|
+
"defaultValue": "-1"
|
|
187
262
|
}
|
|
188
263
|
};
|
|
189
264
|
}
|
package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xplor-drag-and-drop-input.js","sourceRoot":"","sources":["../../../src/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7F,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAO3C,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QACK,aAAQ,GAAY,KAAK,CAAC;QAElC;;WAEG;QACK,YAAO,GAAW,kBAAkB,CAAC;QAE7C;;WAEG;QACK,UAAK,GAAW,8BAA8B,CAAC;QAEvD;;WAEG;QACK,gBAAW,GAAW,cAAc,CAAC;QAEpC,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAgB,IAAI,CAAC;QA0BjC,WAAM,GAAG,CAAC,CAAY,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Method } from '@stencil/core';\n\nconst DEFAULT_ACCEPT_ALL = '*' + '/' + '*';\n\n@Component({\n tag: 'xplor-drag-and-drop-input',\n styleUrl: 'xplor-drag-and-drop-input.scss',\n scoped: true,\n})\nexport class XplorDragAndDropInput {\n /**\n * Disable the file upload\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Accepted file types (e.g., 'image/png,.pdf')\n */\n @Prop() accepts: string = DEFAULT_ACCEPT_ALL;\n\n /**\n * Instruction text displayed in the drop zone\n */\n @Prop() label: string = 'Drag and drop your file here';\n\n /**\n * Browse button label text\n */\n @Prop() browseLabel: string = 'Browse Files';\n\n @State() dragover: boolean = false;\n @State() currentFile: File | null = null;\n\n /**\n * Emitted when a file is selected via drop or click\n */\n @Event() fileSelect: EventEmitter<File>;\n\n /**\n * Emitted when the current file is cleared\n */\n @Event() fileClear: EventEmitter<void>;\n\n private fileInputEl: HTMLInputElement;\n\n /**\n * Clears the currently selected file\n */\n @Method()\n async clearCurrentFile() {\n this.currentFile = null;\n if (this.fileInputEl) {\n this.fileInputEl.value = '';\n }\n this.fileClear.emit();\n }\n\n private onDrop = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n\n if (this.disabled) return;\n\n const file = e.dataTransfer?.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n };\n\n private onDragOver = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n };\n\n private onFileSelect = (e: Event) => {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n input.value = '';\n };\n\n private openFileDialog = () => {\n if (this.disabled) {\n return;\n }\n\n this.fileInputEl?.click();\n };\n\n private getAcceptsLabel = () => {\n const accepts = this.accepts?.trim();\n if (!accepts || accepts === DEFAULT_ACCEPT_ALL) {\n return '*';\n }\n\n return accepts;\n };\n\n render() {\n return (\n <Host>\n <div class=\"drag-drop-wrapper\">\n <div\n class={{\n 'drag-drop-card': true,\n 'drag-drop-card--dragover': this.dragover,\n 'drag-drop-card--disabled': this.disabled,\n }}\n onDrop={this.onDrop}\n onDragOver={this.onDragOver}\n onDragEnter={this.onDragEnter}\n onDragLeave={this.onDragLeave}\n >\n <div class=\"drag-drop-card__content\">\n <svg\n class=\"drag-drop-card__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"60\"\n height=\"60\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z\"\n fill=\"currentColor\"\n opacity=\"0.3\"\n />\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z\"\n fill=\"currentColor\"\n />\n </svg>\n <h3 class=\"drag-drop-card__title\">{this.label}</h3>\n <p class=\"drag-drop-card__accepts\">Accepted file types: {this.getAcceptsLabel()}</p>\n <p class=\"drag-drop-card__divider\">or</p>\n </div>\n </div>\n\n <div class=\"drag-drop-card__action\">\n <xplor-button\n text={this.browseLabel}\n type={this.disabled ? 'disabled' : 'secondary'}\n clickAction={this.openFileDialog}\n ></xplor-button>\n </div>\n\n {this.currentFile && (\n <div class=\"drag-drop-card__file-info\">\n File Selected: {this.currentFile.name}\n </div>\n )}\n </div>\n\n <input\n id=\"drag-drop-file-select\"\n type=\"file\"\n disabled={this.disabled}\n accept={this.accepts}\n class=\"drag-drop-input-hidden\"\n ref={(el) => (this.fileInputEl = el)}\n onChange={this.onFileSelect}\n />\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"xplor-drag-and-drop-input.js","sourceRoot":"","sources":["../../../src/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7F,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAO3C,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QACK,aAAQ,GAAY,KAAK,CAAC;QAElC;;WAEG;QACK,YAAO,GAAW,kBAAkB,CAAC;QAE7C;;WAEG;QACK,UAAK,GAAW,+BAA+B,CAAC;QAExD;;WAEG;QACK,gBAAW,GAAW,cAAc,CAAC;QAO7C;;WAEG;QACK,aAAQ,GAAW,CAAC,CAAC,CAAC;QAErB,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAgB,IAAI,CAAC;QA0BjC,WAAM,GAAG,CAAC,CAAY,EAAE,EAAE;;YAChC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,MAAM,IAAI,GAAG,MAAA,MAAA,CAAC,CAAC,YAAY,0CAAE,KAAK,0CAAG,CAAC,CAAC,CAAC;YACxC,IAAI,IAAI,EAAE,CAAC;gBACT,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Method } from '@stencil/core';\n\nconst DEFAULT_ACCEPT_ALL = '*' + '/' + '*';\n\n@Component({\n tag: 'xplor-drag-and-drop-input',\n styleUrl: 'xplor-drag-and-drop-input.scss',\n scoped: true,\n})\nexport class XplorDragAndDropInput {\n /**\n * Disable the file upload\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Accepted file types (e.g., 'image/png,.pdf')\n */\n @Prop() accepts: string = DEFAULT_ACCEPT_ALL;\n\n /**\n * Instruction text displayed in the drop zone\n */\n @Prop() label: string = 'Drag and drop your files here';\n\n /**\n * Browse button label text\n */\n @Prop() browseLabel: string = 'Browse Files';\n\n /**\n * Accessible label for the drop zone area\n */\n @Prop() ariaLabel: string;\n\n /**\n * Upload progress percentage (0-100). Set to -1 or leave undefined to hide the progress bar.\n */\n @Prop() progress: number = -1;\n\n @State() dragover: boolean = false;\n @State() currentFile: File | null = null;\n\n /**\n * Emitted when a file is selected via drop or click\n */\n @Event() fileSelect: EventEmitter<File>;\n\n /**\n * Emitted when the current file is cleared\n */\n @Event() fileClear: EventEmitter<void>;\n\n private fileInputEl: HTMLInputElement;\n\n /**\n * Clears the currently selected file\n */\n @Method()\n async clearCurrentFile() {\n this.currentFile = null;\n if (this.fileInputEl) {\n this.fileInputEl.value = '';\n }\n this.fileClear.emit();\n }\n\n private onDrop = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n\n if (this.disabled) return;\n\n const file = e.dataTransfer?.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n };\n\n private onDragOver = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n };\n\n private onFileSelect = (e: Event) => {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n input.value = '';\n };\n\n private openFileDialog = () => {\n if (this.disabled) {\n return;\n }\n\n this.fileInputEl?.click();\n };\n\n private getAcceptsLabel = () => {\n const accepts = this.accepts?.trim();\n if (!accepts || accepts === DEFAULT_ACCEPT_ALL) {\n return '*';\n }\n\n return accepts;\n };\n\n private formatFileSize = (bytes: number): string => {\n if (bytes === 0) return '0 Bytes';\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n };\n\n private formatDate = (timestamp: number): string => {\n const date = new Date(timestamp);\n const day = date.getDate();\n const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n const month = months[date.getMonth()];\n const year = date.getFullYear();\n\n const suffix = (day === 1 || day === 21 || day === 31) ? 'st'\n : (day === 2 || day === 22) ? 'nd'\n : (day === 3 || day === 23) ? 'rd'\n : 'th';\n\n const hours = date.getHours();\n const minutes = date.getMinutes().toString().padStart(2, '0');\n const seconds = date.getSeconds().toString().padStart(2, '0');\n const ampm = hours >= 12 ? 'PM' : 'AM';\n const displayHours = hours % 12 || 12;\n\n return `${day}${suffix} ${month} ${year}, ${displayHours}:${minutes}:${seconds} ${ampm}`;\n };\n\n private showProgress = (): boolean => {\n return this.progress >= 0 && this.progress <= 100;\n };\n\n render() {\n const progressValue = Math.min(Math.max(this.progress, 0), 100);\n const dropZoneLabel = this.ariaLabel || `${this.label}. Accepted file types: ${this.getAcceptsLabel()}. Or use the ${this.browseLabel} button.`;\n\n return (\n <Host>\n <div class=\"drag-drop-zone\">\n <div\n class={{\n 'drag-drop-card': true,\n 'drag-drop-card--dragover': this.dragover,\n 'drag-drop-card--disabled': this.disabled,\n }}\n onDrop={this.onDrop}\n onDragOver={this.onDragOver}\n onDragEnter={this.onDragEnter}\n onDragLeave={this.onDragLeave}\n role=\"region\"\n aria-label={dropZoneLabel}\n >\n <div class=\"drag-drop-card__content\">\n <svg\n class=\"drag-drop-card__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z\"\n fill=\"currentColor\"\n opacity=\"0.3\"\n />\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z\"\n fill=\"currentColor\"\n />\n </svg>\n <h3 class=\"drag-drop-card__title\">{this.label}</h3>\n <p class=\"drag-drop-card__accepts\">Accepted file types: {this.getAcceptsLabel()}</p>\n <p class=\"drag-drop-card__divider\">or</p>\n </div>\n </div>\n\n <div class=\"drag-drop-card__action\">\n <xplor-button\n text={this.browseLabel}\n type={this.disabled ? 'disabled' : 'secondary'}\n clickAction={this.openFileDialog}\n aria-label={this.browseLabel}\n ></xplor-button>\n </div>\n </div>\n\n {this.currentFile && (\n <div class=\"file-info\" aria-live=\"polite\">\n {this.showProgress() && (\n <p class=\"file-info__status\">\n Uploading {this.progress === 100 ? '1' : '0'} / 1\n </p>\n )}\n <div class=\"file-info__card\">\n <div class=\"file-info__icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z\" />\n </svg>\n </div>\n <div class=\"file-info__details\">\n <p class=\"file-info__name\">{this.currentFile.name}</p>\n <p class=\"file-info__meta\">\n {this.formatFileSize(this.currentFile.size)}\n {this.currentFile.lastModified\n ? ` | Last modified: ${this.formatDate(this.currentFile.lastModified)}`\n : ''}\n </p>\n {this.showProgress() && (\n <div class=\"file-info__progress-row\">\n <div\n class=\"file-info__progress-bar\"\n role=\"progressbar\"\n aria-valuenow={progressValue}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={`Upload progress: ${Math.round(progressValue)}%`}\n >\n <div\n class=\"file-info__progress-fill\"\n style={{ width: `${progressValue}%` }}\n ></div>\n </div>\n <span class=\"file-info__progress-text\" aria-hidden=\"true\">{Math.round(this.progress)}%</span>\n </div>\n )}\n </div>\n <button\n class=\"file-info__remove\"\n onClick={() => this.clearCurrentFile()}\n aria-label={`Remove file ${this.currentFile.name}`}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12Z\" />\n </svg>\n </button>\n </div>\n </div>\n )}\n\n <input\n id=\"drag-drop-file-select\"\n type=\"file\"\n disabled={this.disabled}\n accept={this.accepts}\n class=\"drag-drop-input-hidden\"\n ref={(el) => (this.fileInputEl = el)}\n onChange={this.onFileSelect}\n aria-label={`${this.browseLabel} - ${this.label}`}\n tabindex={-1}\n />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class XplorDropdown {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'bfd5bc76c18f4c7882ec47389978338eec81b1d1' }, h("select", { key: '54310c80fdda944ca6d9cc8faaf643e79d4a5f32', class: "xplor-dropdown", onChange: this.handleChange }, this.options.map((option) => (h("option", { value: option, selected: this.selected === option }, option))))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "xplor-dropdown"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -26,16 +26,16 @@ export class XplorExpansionPanel {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: 'f2b19e6a1ad6315341e0840e2c000a1123caa7e0' }, h("div", { key: '1cb9ca368efb2f9e16c64c3987546f3d16981a2b', class: {
|
|
30
30
|
'expansion-panel': true,
|
|
31
31
|
'expansion-panel--open': this.open,
|
|
32
32
|
'expansion-panel--disabled': this.disabled,
|
|
33
|
-
} }, h("button", { key: '
|
|
33
|
+
} }, h("button", { key: '5c2b82b2f13395137413e7f86160ac132c44b7ee', class: "expansion-panel__header", onClick: this.handleToggle, disabled: this.disabled, "aria-expanded": this.open ? 'true' : 'false', "aria-controls": `${this.panelId}-content`, type: "button" }, h("div", { key: 'c1534981f842b0b7d75a6c8135a12fb6f209639c', class: "expansion-panel__header-content" }, h("slot", { key: '01c5a0a1dfacdf730ec82dc0a09916d159d1c016', name: "header" })), h("span", { key: 'f82ea607638e601be6b956f9ad5c6d31d6461ec6', class: {
|
|
34
34
|
'expansion-panel__icon': true,
|
|
35
35
|
'expansion-panel__icon--open': this.open,
|
|
36
|
-
} }, "\u25BC")), h("div", { key: '
|
|
36
|
+
} }, "\u25BC")), h("div", { key: '385abb97450d912cda5fbd3bc5a5e48ea8ce8a0d', class: "expansion-panel__content", id: `${this.panelId}-content`, role: "region", "aria-labelledby": this.panelId, style: {
|
|
37
37
|
maxHeight: this.open ? `${this.contentHeight}px` : '0',
|
|
38
|
-
} }, h("div", { key: '
|
|
38
|
+
} }, h("div", { key: '12c32ef07b6084b8528bf4800101afe0707adf05', class: "expansion-panel__content-inner", ref: (el) => (this.contentEl = el) }, h("slot", { key: 'a18755879b94fc09948ed8128d73cfb3b0639885' }))))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "xplor-expansion-panel"; }
|
|
41
41
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xplor-expansion-panel.js","sourceRoot":"","sources":["../../../src/components/xplor-expansion-panel/xplor-expansion-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9F,IAAI,MAAM,GAAG,CAAC,CAAC;AAOf,MAAM,OAAO,mBAAmB;IALhC;QAQY,aAAQ,GAAY,KAAK,CAAC;QACT,SAAI,GAAY,KAAK,CAAC;QAGtC,kBAAa,GAAW,CAAC,CAAC;QAoB3B,iBAAY,GAAG,GAAG,EAAE;YACxB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAEpE,6BAA6B;YAC7B,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"xpl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AQ;iBAC7C;gBAED,+DACI,KAAK,EAAC,yBAAyB,EAC/B,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,mBACR,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAC5B,GAAG,IAAI,CAAC,OAAO,UAAU,EACxC,IAAI,EAAC,QAAQ;oBAEb,4DAAK,KAAK,EAAC,iCAAiC;wBACxC,6DAAM,IAAI,EAAC,QAAQ,GAAG,CACpB;oBACN,6DACI,KAAK,EAAE;4BACH,uBAAuB,EAAE,IAAI;4BAC7B,6BAA6B,EAAE,IAAI,CAAC,IAAI;yBAC3C,aAGE,CACF;gBACT,4DACI,KAAK,EAAC,0BAA0B,EAChC,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,UAAU,EAC7B,IAAI,EAAC,QAAQ,qBACI,IAAI,CAAC,OAAO,EAC7B,KAAK,EAAE;wBACH,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,GAAG;qBACzD;oBAED,4DACI,KAAK,EAAC,gCAAgC,EACtC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;wBAElC,8DAAQ,CACN,CACJ,CACJ,CACH,CACV,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Element } from '@stencil/core';\n\nlet nextId = 0;\n\n@Component({\n tag: 'xplor-expansion-panel',\n styleUrl: 'xplor-expansion-panel.scss',\n scoped: true,\n})\nexport class XplorExpansionPanel {\n @Element() el: HTMLElement;\n\n @Prop() disabled: boolean = false;\n @Prop({ mutable: true }) open: boolean = false;\n\n @State() panelId: string;\n @State() contentHeight: number = 0;\n\n @Event() xplorPanelToggle: EventEmitter<{ id: string; isOpen: boolean }>;\n\n private contentEl: HTMLDivElement;\n\n componentWillLoad() {\n this.panelId = `panel-${nextId++}`;\n }\n\n componentDidLoad() {\n this.updateContentHeight();\n }\n\n private updateContentHeight() {\n if (this.contentEl) {\n this.contentHeight = this.contentEl.scrollHeight;\n }\n }\n\n private handleToggle = () => {\n if (this.disabled) return;\n\n this.open = !this.open;\n this.xplorPanelToggle.emit({ id: this.panelId, isOpen: this.open });\n\n // Update height after toggle\n setTimeout(() => this.updateContentHeight(), 0);\n };\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'expansion-panel': true,\n 'expansion-panel--open': this.open,\n 'expansion-panel--disabled': this.disabled,\n }}\n >\n <button\n class=\"expansion-panel__header\"\n onClick={this.handleToggle}\n disabled={this.disabled}\n aria-expanded={this.open ? 'true' : 'false'}\n aria-controls={`${this.panelId}-content`}\n type=\"button\"\n >\n <div class=\"expansion-panel__header-content\">\n <slot name=\"header\" />\n </div>\n <span\n class={{\n 'expansion-panel__icon': true,\n 'expansion-panel__icon--open': this.open,\n }}\n >\n ▼\n </span>\n </button>\n <div\n class=\"expansion-panel__content\"\n id={`${this.panelId}-content`}\n role=\"region\"\n aria-labelledby={this.panelId}\n style={{\n maxHeight: this.open ? `${this.contentHeight}px` : '0',\n }}\n >\n <div\n class=\"expansion-panel__content-inner\"\n ref={(el) => (this.contentEl = el)}\n >\n <slot />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -33,7 +33,7 @@ export class XplorExpansionPanels {
|
|
|
33
33
|
this.value = this.multiple ? Array.from(this.openPanels) : Array.from(this.openPanels)[0] || '';
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: 'c55c8eef4f6f134c83f2f8dffcb434401596a095' }, h("div", { key: 'd29c006de658c679ce5cfa2a465b9e5756b8bba5', class: "expansion-panels", "aria-label": "Accordion" }, h("slot", { key: '32560ca5fa3b041e6e1f5f8011df9fef8f50cc6f' }))));
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "xplor-expansion-panels"; }
|
|
39
39
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xplor-expansion-panels.js","sourceRoot":"","sources":["../../../src/components/xplor-expansion-panels/xplor-expansion-panels.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAOxE,MAAM,OAAO,oBAAoB;IALjC;QAM6B,UAAK,GAAsB,EAAE,CAAC;QAC/C,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,IAAI,CAAC,CAAC,6DAA6D;QAEvF,eAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;KAuChD;IArCG,iBAAiB;QACb,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;IAGD,iBAAiB,CAAC,KAAmD;QACjE,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QAEpC,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACpC,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3C,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAChC,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACpG,CAAC;IAED,MAAM;QACF,OAAO,CACH,EAAC,IAAI;YACD,4DAAK,KAAK,EAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"xplor-expansion-panels.js","sourceRoot":"","sources":["../../../src/components/xplor-expansion-panels/xplor-expansion-panels.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAOxE,MAAM,OAAO,oBAAoB;IALjC;QAM6B,UAAK,GAAsB,EAAE,CAAC;QAC/C,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,IAAI,CAAC,CAAC,6DAA6D;QAEvF,eAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;KAuChD;IArCG,iBAAiB;QACb,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;aAAM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;;;;;;;;CACJ","sourcesContent":["import { Component, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'xplor-expansion-panels',\n styleUrl: 'xplor-expansion-panels.scss',\n scoped: true,\n})\nexport class XplorExpansionPanels {\n @Prop({ mutable: true }) value: string | string[] = [];\n @Prop() multiple: boolean = false;\n @Prop() accordion: boolean = true; // accordion mode (only one open at a time when not multiple)\n\n @State() openPanels: Set<string> = new Set();\n\n componentWillLoad() {\n if (Array.isArray(this.value)) {\n this.openPanels = new Set(this.value);\n } else if (this.value) {\n this.openPanels = new Set([this.value]);\n }\n }\n\n @Listen('xplorPanelToggle')\n handlePanelToggle(event: CustomEvent<{ id: string; isOpen: boolean }>) {\n event.stopPropagation();\n const { id, isOpen } = event.detail;\n\n if (isOpen) {\n if (this.multiple) {\n this.openPanels = new Set([...this.openPanels, id]);\n } else {\n this.openPanels = new Set([id]);\n }\n } else {\n const newPanels = new Set(this.openPanels);\n newPanels.delete(id);\n this.openPanels = newPanels;\n }\n\n this.value = this.multiple ? Array.from(this.openPanels) : Array.from(this.openPanels)[0] || '';\n }\n\n render() {\n return (\n <Host>\n <div class=\"expansion-panels\" aria-label=\"Accordion\">\n <slot />\n </div>\n </Host>\n );\n }\n}\n"]}
|