q2-tecton-elements 1.60.3 → 1.61.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/dist/bundle-report.json +16580 -15448
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-group_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge.cjs.entry.js +82 -0
- package/dist/cjs/q2-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-badge.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-btn.q2-loading.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +432 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-data-table.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +15 -3
- package/dist/cjs/q2-file-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-file-picker.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-grid-area.cjs.entry.js +2 -2
- package/dist/cjs/q2-grid-area.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-grid-area.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +715 -0
- package/dist/cjs/q2-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-icon.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-input.cjs.entry.js +3556 -0
- package/dist/cjs/q2-input.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-input.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-legend.cjs.entry.js +1 -1
- package/dist/cjs/q2-legend.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-legend.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-link.q2-list.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-link_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-link_2.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-meter.cjs.entry.js +109 -0
- package/dist/cjs/q2-meter.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-meter.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-modal.cjs.entry.js +2 -2
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +23 -10
- package/dist/cjs/q2-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pagination.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +36 -12
- package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pill.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-relative-time.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +2 -2
- package/dist/cjs/q2-select.cjs.entry.js +6 -3
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +280 -0
- package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-tab-container.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-tab-pane.cjs.entry.js +34 -0
- package/dist/cjs/q2-tab-pane.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-tab-pane.entry.cjs.js.map +1 -0
- package/dist/cjs/q2-tag.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/{sanitize-html-string-BtI99lfg.js → sanitize-html-string-DPqrzfM9.js} +61 -27
- package/dist/cjs/sanitize-html-string-DPqrzfM9.js.map +1 -0
- package/dist/cjs/sprites-DZZE7UFT.js +22 -0
- package/dist/cjs/sprites-DZZE7UFT.js.map +1 -0
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-data-table/q2-data-table.css +23 -2
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +5 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +33 -2
- package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -1
- package/dist/collection/components/q2-grid-area/q2-grid-area.js +15 -15
- package/dist/collection/components/q2-grid-area/q2-grid-area.js.map +1 -1
- package/dist/collection/components/q2-icon/assets/brand.symbol.svg +1 -1
- package/dist/collection/components/q2-icon/assets/standard.symbol.svg +1 -1
- package/dist/collection/components/q2-legend/q2-legend.css +7 -7
- package/dist/collection/components/q2-link/q2-link.css +3 -3
- package/dist/collection/components/q2-meter/q2-meter.css +230 -0
- package/dist/collection/components/q2-meter/q2-meter.js +384 -0
- package/dist/collection/components/q2-meter/q2-meter.js.map +1 -0
- package/dist/collection/components/q2-modal/q2-modal.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-pagination/q2-pagination.js +29 -15
- package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
- package/dist/collection/components/q2-pill/q2-pill.css +10 -4
- package/dist/collection/components/q2-pill/q2-pill.js +35 -11
- package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-select/q2-select.js +6 -3
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-data-table.js.map +1 -1
- package/dist/components/q2-file-picker.js +16 -3
- package/dist/components/q2-file-picker.js.map +1 -1
- package/dist/components/q2-grid-area.js +8 -8
- package/dist/components/q2-grid-area.js.map +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-legend2.js.map +1 -1
- package/dist/components/q2-link2.js +1 -1
- package/dist/components/q2-link2.js.map +1 -1
- package/dist/components/q2-meter.d.ts +11 -0
- package/dist/components/q2-meter.js +145 -0
- package/dist/components/q2-meter.js.map +1 -0
- package/dist/components/q2-modal.js +1 -1
- package/dist/components/q2-optgroup2.js +1 -1
- package/dist/components/q2-pagination.js +24 -11
- package/dist/components/q2-pagination.js.map +1 -1
- package/dist/components/q2-pill.js +36 -12
- package/dist/components/q2-pill.js.map +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-select2.js +6 -3
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tab-pane.js +1 -1
- package/dist/components/q2-tag.js +1 -1
- package/dist/components/q2-tooltip.js +1 -127
- package/dist/components/q2-tooltip.js.map +1 -1
- package/dist/components/q2-tooltip2.js +132 -0
- package/dist/components/q2-tooltip2.js.map +1 -0
- package/dist/components/sanitize-html-string.js +59 -25
- package/dist/components/sanitize-html-string.js.map +1 -1
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/{index-xCuy-dFb.js → index-LNnzUeDP.js} +3 -3
- package/dist/esm/{index-xCuy-dFb.js.map → index-LNnzUeDP.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-group_2.entry.js +2 -2
- package/dist/esm/q2-action-sheet.entry.js +2 -2
- package/dist/esm/q2-badge.entry.js +80 -0
- package/dist/esm/q2-badge.entry.js.map +1 -0
- package/dist/esm/q2-btn.q2-loading.entry.js.map +1 -0
- package/dist/esm/q2-btn_2.entry.js +429 -0
- package/dist/esm/q2-btn_2.entry.js.map +1 -0
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-context.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-data-table.entry.js.map +1 -1
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-file-picker.entry.js +16 -4
- package/dist/esm/q2-file-picker.entry.js.map +1 -1
- package/dist/esm/q2-grid-area.entry.js +2 -2
- package/dist/esm/q2-grid-area.entry.js.map +1 -1
- package/dist/esm/q2-icon.entry.js +713 -0
- package/dist/esm/q2-icon.entry.js.map +1 -0
- package/dist/esm/q2-input.entry.js +3554 -0
- package/dist/esm/q2-input.entry.js.map +1 -0
- package/dist/esm/q2-item.entry.js +1 -1
- package/dist/esm/q2-legend.entry.js +1 -1
- package/dist/esm/q2-legend.entry.js.map +1 -1
- package/dist/esm/q2-link.q2-list.entry.js.map +1 -1
- package/dist/esm/q2-link_2.entry.js +2 -2
- package/dist/esm/q2-link_2.entry.js.map +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-meter.entry.js +107 -0
- package/dist/esm/q2-meter.entry.js.map +1 -0
- package/dist/esm/q2-modal.entry.js +3 -3
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +2 -2
- package/dist/esm/q2-option-list_2.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +24 -11
- package/dist/esm/q2-pagination.entry.js.map +1 -1
- package/dist/esm/q2-pill.entry.js +37 -13
- package/dist/esm/q2-pill.entry.js.map +1 -1
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-relative-time.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +3 -3
- package/dist/esm/q2-select.entry.js +7 -4
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-tab-container.entry.js +278 -0
- package/dist/esm/q2-tab-container.entry.js.map +1 -0
- package/dist/esm/q2-tab-pane.entry.js +32 -0
- package/dist/esm/q2-tab-pane.entry.js.map +1 -0
- package/dist/esm/q2-tag.entry.js +2 -2
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/{sanitize-html-string-DL0kgllh.js → sanitize-html-string-DOVERJq5.js} +61 -27
- package/dist/esm/sanitize-html-string-DOVERJq5.js.map +1 -0
- package/dist/esm/sprites-jG2RmiwF.js +20 -0
- package/dist/esm/sprites-jG2RmiwF.js.map +1 -0
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/assets/brand.symbol.svg +1 -1
- package/dist/q2-tecton-elements/assets/standard.symbol.svg +1 -1
- package/dist/q2-tecton-elements/{index-xCuy-dFb.js → index-LNnzUeDP.js} +3 -3
- package/dist/q2-tecton-elements/{index-xCuy-dFb.js.map → index-LNnzUeDP.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-action-group_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-badge.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-badge.entry.js +84 -0
- package/dist/q2-tecton-elements/q2-badge.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-btn.q2-loading.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-btn_2.entry.js +453 -0
- package/dist/q2-tecton-elements/q2-btn_2.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-calendar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-context.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-data-table.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-data-table.entry.js +109 -109
- package/dist/q2-tecton-elements/q2-data-table.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-detail.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +112 -93
- package/dist/q2-tecton-elements/q2-file-picker.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-grid-area.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-grid-area.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-grid-area.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-icon.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-icon.entry.js +870 -0
- package/dist/q2-tecton-elements/q2-icon.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-input.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-input.entry.js +3883 -0
- package/dist/q2-tecton-elements/q2-input.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-legend.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-legend.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-legend.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-link.q2-list.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-link_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-meter.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-meter.entry.js +176 -0
- package/dist/q2-tecton-elements/q2-meter.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-modal.entry.js +24 -24
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +43 -33
- package/dist/q2-tecton-elements/q2-pagination.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-pill.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-pill.entry.js +57 -36
- package/dist/q2-tecton-elements/q2-pill.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-radio.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-section.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-select.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-select.entry.js +7 -4
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +19 -19
- package/dist/q2-tecton-elements/q2-stepper.entry.js +13 -13
- package/dist/q2-tecton-elements/q2-tab-container.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tab-container.entry.js +348 -0
- package/dist/q2-tecton-elements/q2-tab-container.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tab-pane.entry.esm.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js +44 -0
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tag.entry.js +57 -57
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
- package/dist/q2-tecton-elements/{sanitize-html-string-DL0kgllh.js → sanitize-html-string-DOVERJq5.js} +314 -282
- package/dist/q2-tecton-elements/sanitize-html-string-DOVERJq5.js.map +1 -0
- package/dist/q2-tecton-elements/sprites-jG2RmiwF.js +18 -0
- package/dist/q2-tecton-elements/sprites-jG2RmiwF.js.map +1 -0
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
- package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +5 -0
- package/dist/types/components/q2-grid-area/q2-grid-area.d.ts +6 -6
- package/dist/types/components/q2-meter/q2-meter.d.ts +70 -0
- package/dist/types/components/q2-pagination/q2-pagination.d.ts +2 -1
- package/dist/types/components/q2-pill/q2-pill.d.ts +8 -1
- package/dist/types/components.d.ts +147 -4
- package/package.json +3 -3
- package/dist/cjs/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.cjs.js.map +0 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js +0 -5074
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +0 -1
- package/dist/cjs/sanitize-html-string-BtI99lfg.js.map +0 -1
- package/dist/esm/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.js.map +0 -1
- package/dist/esm/q2-badge_7.entry.js +0 -5066
- package/dist/esm/q2-badge_7.entry.js.map +0 -1
- package/dist/esm/sanitize-html-string-DL0kgllh.js.map +0 -1
- package/dist/q2-tecton-elements/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.esm.js.map +0 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +0 -5659
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +0 -1
- package/dist/q2-tecton-elements/sanitize-html-string-DL0kgllh.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"q2-tooltip.js","mappings":"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","names":["Q2Tooltip","__stencil_proxyCustomElement"],"sources":["src/components/q2-tooltip/q2-tooltip.scss?tag=q2-tooltip&encapsulation=shadow","src/components/q2-tooltip/q2-tooltip.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n}\n\n:host([block]) {\n display: block;\n}\n\n.tooltip {\n --comp-background: #{var-list(\n --tct-tooltip-background,\n var-prefixer(tooltip-background-color),\n --t-top-a3,\n #0d0d0dd9\n )};\n --comp-offset-default: calc(var(--app-scale-1x, 5px) * -1);\n --comp-offset: #{var-list(var-prefixer(tooltip-offset), --comp-offset-default)};\n --comp-position: #{var-list(var-prefixer(tooltip-position), --app-scale-1x, 5px)};\n --comp-body-offset-default: calc(var(--app-scale-3x, 15px) * -1);\n --comp-body-offset: #{var-list(var-prefixer(tooltip-body-offset), --comp-body-offset-default)};\n --comp-duration: #{var-list(var-prefixer(tooltip-transition-duration), --app-duration-1, 0.2s)};\n --comp-visible-duration: #{var-list(var-prefixer(tooltip-transition-visible-duration), 2s)};\n --comp-delay: #{var-list(var-prefixer(tooltip-transition-delay), 0s)};\n\n display: inline-block;\n position: relative;\n\n &:hover {\n --comp-delay: #{var-list(var-prefixer(tooltip-transition-delay), 1s)};\n\n :host([immediate]:not([immediate='false'])) & {\n --comp-delay: 0s;\n }\n }\n\n // Tooltip arrow\n &:before {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n color: var(--comp-background);\n pointer-events: none;\n content: '';\n border: var-list(var-prefixer(tooltip-arrow-size), --app-scale-1x, 5px) solid transparent;\n }\n\n // Tooltip bubble\n &:after {\n --comp-padding: #{var-list(--app-scale-1x, 5px)} 8px;\n\n position: absolute;\n z-index: 1;\n padding: var-list(var-prefixer(tooltip-padding), --comp-padding);\n font-weight: var-list(var-prefixer(tooltip-font-weight), 600);\n font-size: var-list(var-prefixer(tooltip-font-size), --app-font-size-small, 12px);\n line-height: 1.5;\n color: var-list(var-prefixer(tooltip-color), --app-white, #ffffff);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: var(--comp-background);\n border-radius: var-list(var-prefixer(tooltip-border-radius), --app-border-radius-1, 4px);\n }\n\n &:before,\n &:after {\n display: inline-block;\n visibility: hidden;\n opacity: 0;\n transition: all var(--comp-duration) ease-in-out var(--comp-delay);\n }\n\n :host([block]) & {\n display: block;\n }\n\n // When to show the tooltip\n &:hover,\n &.has-keyboard-focus:focus-within,\n :host([persistent]:not([persistent='false'])) & {\n &:before,\n &:after {\n text-decoration: none;\n visibility: visible;\n opacity: 1;\n }\n }\n\n @keyframes tooltippedFade {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n\n &.has-generic-focus:focus-within {\n &:before,\n &:after {\n visibility: visible;\n opacity: 0;\n transition: none;\n animation-timing-function: ease-in-out;\n animation-fill-mode: forwards;\n animation-name: tooltippedFade, tooltippedFade;\n animation-direction: normal, reverse;\n animation-duration: var(--comp-duration);\n animation-delay: 0ms, calc(var(--comp-visible-duration) + var(--comp-duration));\n }\n }\n &.has-generic-focus-out {\n &:before,\n &:after {\n visibility: visible;\n opacity: 0;\n transition: none;\n animation-timing-function: ease-in-out;\n animation-fill-mode: forwards;\n animation-name: tooltippedFade;\n animation-direction: reverse;\n animation-duration: var(--comp-duration);\n }\n }\n\n :host([multiline]) & {\n &:after {\n width: max-content;\n max-width: var-list(var-prefixer(tooltip-max-width), 200px);\n word-break: break-word;\n word-wrap: normal;\n white-space: pre-line;\n border-collapse: separate;\n text-align: left;\n }\n\n :host([position='s']) &,\n :host([position='n']) & {\n &:after {\n right: auto;\n left: 50%;\n transform: translateX(-50%);\n }\n }\n\n :host([position='w']) &,\n :host([position='e']) & {\n &:after {\n right: 100%;\n }\n }\n\n &:hover,\n &:active,\n &:focus {\n &:after {\n display: table-cell;\n }\n }\n\n &:focus-within {\n &:after {\n display: table-cell;\n }\n }\n }\n\n // Below\n :host([position='s']) &,\n :host([position='se']) &,\n :host([position='sw']) & {\n &:after {\n top: 100%;\n right: 50%;\n margin-top: var(--comp-position);\n }\n\n &:before {\n top: auto;\n right: 50%;\n bottom: var(--comp-offset);\n margin-right: var(--comp-offset);\n border-bottom-color: var(--comp-background);\n }\n }\n\n // Above\n :host([position='n']) &,\n :host([position='ne']) &,\n :host([position='nw']) & {\n &:after {\n right: 50%;\n bottom: 100%;\n margin-bottom: var(--comp-position);\n }\n\n &:before {\n top: var(--comp-offset);\n right: 50%;\n bottom: auto;\n margin-right: var(--comp-offset);\n border-top-color: var(--comp-background);\n }\n }\n\n :host([position='se']) &,\n :host([position='ne']) & {\n &:after {\n right: auto;\n left: 50%;\n margin-left: var(--comp-body-offset);\n }\n }\n\n :host([position='sw']) & {\n &:after {\n margin-right: var(--comp-body-offset);\n }\n }\n\n :host([position='nw']) & {\n &:after {\n margin-right: var(--comp-body-offset);\n }\n }\n\n // Centered\n :host([position='s']) &,\n :host([position='n']) & {\n &:after {\n transform: translateX(50%);\n }\n }\n\n // Left side\n :host([position='w']) & {\n &:after {\n right: 100%;\n bottom: 50%;\n margin-right: var(--comp-position);\n transform: translateY(50%);\n }\n\n &:before {\n top: 50%;\n bottom: 50%;\n left: var(--comp-offset);\n margin-top: var(--comp-offset);\n border-left-color: var(--comp-background);\n }\n }\n\n // Right side\n :host([position='e']) & {\n &:after {\n bottom: 50%;\n left: 100%;\n margin-left: var(--comp-position);\n transform: translateY(50%);\n }\n\n &:before {\n top: 50%;\n right: var(--comp-offset);\n bottom: 50%;\n margin-top: var(--comp-offset);\n border-right-color: var(--comp-background);\n }\n }\n}\n","import { Component, Prop, h, ComponentInterface, Element, Listen, State } from '@stencil/core';\nimport { isEventFromElement, overrideFocus } from 'src/utils';\n\n@Component({ tag: 'q2-tooltip', shadow: true, styleUrl: 'q2-tooltip.scss' })\nexport class Q2Tooltip implements ComponentInterface {\n // #region Own Properties\n\n animationEndCount = 0;\n tooltipElement: HTMLDivElement;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n focusClass: 'has-keyboard-focus' | 'has-generic-focus' | 'has-generic-focus-out';\n\n // #endregion\n // #region Public Property API\n\n /** Displays the element as a block, making it take up the full width of its container. */\n @Prop({ reflect: true })\n block: boolean;\n\n /**\n * Makes the component focusable, thereby putting it in the tab order of the keyboard.\n * @warning\n * This is only meant to be used when the `q2-tooltip` is wrapped around an element that is not focusable (e.g., icons, static text, badges, etc.).\n */\n @Prop({ reflect: true })\n focusable: boolean = false;\n\n /** Whether to show the tooltip immediately upon hover. */\n @Prop({ reflect: true })\n immediate: boolean;\n\n /** text that is displayed when the tooltip is activated. */\n @Prop({ reflect: true })\n label: string;\n\n /** Enables the use of multi-line tooltips with a default `max-width` of `200px`. */\n @Prop({ reflect: true })\n multiline: boolean;\n\n /** Displays the tooltip persistently. */\n @Prop({ reflect: true })\n persistent: boolean;\n\n /** The position of the tooltip based on [cardinal and intercardinal directions](https://en.wikipedia.org/wiki/Cardinal_direction). */\n @Prop({ reflect: true })\n position: 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se' = 'n';\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('focus', { capture: true })\n focusCaptureHandler() {\n this.checkFocusClass();\n }\n\n @Listen('focus')\n focusHandler(event) {\n if (!isEventFromElement(event, this.hostElement)) return;\n if (!this.focusable) return;\n this.tooltipElement.focus();\n }\n\n @Listen('focusout')\n focusOutHandler() {\n if (this.shouldBeVisible) return;\n if (this.focusClass === 'has-generic-focus') this.focusClass = 'has-generic-focus-out';\n else this.focusClass = null;\n }\n\n @Listen('keyup')\n keyUpHandler(event: KeyboardEvent) {\n switch (event.key) {\n case 'Esc':\n case 'Escape':\n this.hideTooltip();\n break;\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get shouldBeVisible() {\n if (this.persistent) return true;\n return this.hostElement.matches(':hover, :focus-within');\n }\n\n animationEndHandler() {\n this.animationEndCount = this.animationEndCount + 1;\n const { focusClass, animationEndCount } = this;\n\n // animationEnd is fired once for :before and once for :after pseudo elements\n // there are multiple animations defined for .has-generic-focus\n // so we need to wait for all of them to finish before we can remove the class\n if (focusClass === 'has-generic-focus-out' || (focusClass === 'has-generic-focus' && animationEndCount === 4)) {\n this.focusClass = null;\n this.animationEndCount = 0;\n }\n }\n\n checkFocusClass() {\n if (!this.shouldBeVisible) return;\n const isKeyboardFocus = !!this.findFocusVisibleElement(document.activeElement);\n this.focusClass = isKeyboardFocus ? 'has-keyboard-focus' : 'has-generic-focus';\n if (isKeyboardFocus) return;\n }\n\n findFocusVisibleElement(element: Element) {\n if (!element) return;\n if (element.shadowRoot) element = this.findFocusVisibleElement(element.shadowRoot.activeElement);\n return element?.matches(':focus-visible') ? element : null;\n }\n\n hideTooltip() {\n if (this.focusClass === 'has-generic-focus') this.focusClass = 'has-generic-focus-out';\n else this.focusClass = null;\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { focusClass } = this;\n const classes = ['tooltip'];\n if (focusClass) classes.push(focusClass);\n\n return this.label ? (\n <div\n tabindex={this.focusable ? 0 : undefined}\n ref={el => (this.tooltipElement = el)}\n class={classes.join(' ')}\n aria-label={this.label}\n onAnimationEnd={() => this.animationEndHandler()}\n role=\"tooltip\"\n test-id=\"tooltipContainer\"\n >\n <slot />\n </div>\n ) : (\n <slot />\n );\n }\n\n // #endregion\n}\n"],"version":3}
|
|
1
|
+
{"file":"q2-tooltip.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { o as overrideFocus, i as isEventFromElement } from './index2.js';
|
|
3
|
+
|
|
4
|
+
const q2TooltipCss = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline-block}:host([block]){display:block}.tooltip{--comp-background:var(--tct-tooltip-background, var(--tct-tooltip-background-color, var(--t-tooltip-background-color, var(--t-top-a3, rgba(13, 13, 13, 0.8509803922)))));--comp-offset-default:calc(var(--app-scale-1x, 5px) * -1);--comp-offset:var(--tct-tooltip-offset, var(--t-tooltip-offset, var(--comp-offset-default)));--comp-position:var(--tct-tooltip-position, var(--t-tooltip-position, var(--app-scale-1x, 5px)));--comp-body-offset-default:calc(var(--app-scale-3x, 15px) * -1);--comp-body-offset:var(--tct-tooltip-body-offset, var(--t-tooltip-body-offset, var(--comp-body-offset-default)));--comp-duration:var(--tct-tooltip-transition-duration, var(--t-tooltip-transition-duration, var(--app-duration-1, 0.2s)));--comp-visible-duration:var(--tct-tooltip-transition-visible-duration, var(--t-tooltip-transition-visible-duration, 2s));--comp-delay:var(--tct-tooltip-transition-delay, var(--t-tooltip-transition-delay, 0s));display:inline-block;position:relative}.tooltip:hover{--comp-delay:var(--tct-tooltip-transition-delay, var(--t-tooltip-transition-delay, 1s))}:host([immediate]:not([immediate=false])) .tooltip:hover{--comp-delay:0s}.tooltip:before{position:absolute;z-index:2;width:0;height:0;color:var(--comp-background);pointer-events:none;content:\"\";border:var(--tct-tooltip-arrow-size, var(--t-tooltip-arrow-size, var(--app-scale-1x, 5px))) solid transparent}.tooltip:after{--comp-padding:var(--app-scale-1x, 5px) 8px;position:absolute;z-index:1;padding:var(--tct-tooltip-padding, var(--t-tooltip-padding, var(--comp-padding)));font-weight:var(--tct-tooltip-font-weight, var(--t-tooltip-font-weight, 600));font-size:var(--tct-tooltip-font-size, var(--t-tooltip-font-size, var(--app-font-size-small, 12px)));line-height:1.5;color:var(--tct-tooltip-color, var(--t-tooltip-color, var(--app-white, #ffffff)));text-align:center;text-decoration:none;text-shadow:none;text-transform:none;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--comp-background);border-radius:var(--tct-tooltip-border-radius, var(--t-tooltip-border-radius, var(--app-border-radius-1, 4px)))}.tooltip:before,.tooltip:after{display:inline-block;visibility:hidden;opacity:0;transition:all var(--comp-duration) ease-in-out var(--comp-delay)}:host([block]) .tooltip{display:block}.tooltip:hover:before,.tooltip:hover:after,.tooltip.has-keyboard-focus:focus-within:before,.tooltip.has-keyboard-focus:focus-within:after,:host([persistent]:not([persistent=false])) .tooltip:before,:host([persistent]:not([persistent=false])) .tooltip:after{text-decoration:none;visibility:visible;opacity:1}@keyframes tooltippedFade{from{opacity:0}to{opacity:1}}.tooltip.has-generic-focus:focus-within:before,.tooltip.has-generic-focus:focus-within:after{visibility:visible;opacity:0;transition:none;animation-timing-function:ease-in-out;animation-fill-mode:forwards;animation-name:tooltippedFade, tooltippedFade;animation-direction:normal, reverse;animation-duration:var(--comp-duration);animation-delay:0ms, calc(var(--comp-visible-duration) + var(--comp-duration))}.tooltip.has-generic-focus-out:before,.tooltip.has-generic-focus-out:after{visibility:visible;opacity:0;transition:none;animation-timing-function:ease-in-out;animation-fill-mode:forwards;animation-name:tooltippedFade;animation-direction:reverse;animation-duration:var(--comp-duration)}:host([multiline]) .tooltip:after{width:max-content;max-width:var(--tct-tooltip-max-width, var(--t-tooltip-max-width, 200px));word-break:break-word;word-wrap:normal;white-space:pre-line;border-collapse:separate;text-align:left}:host([position=s]) :host([multiline]) .tooltip:after,:host([position=n]) :host([multiline]) .tooltip:after{right:auto;left:50%;transform:translateX(-50%)}:host([position=w]) :host([multiline]) .tooltip:after,:host([position=e]) :host([multiline]) .tooltip:after{right:100%}:host([multiline]) .tooltip:hover:after,:host([multiline]) .tooltip:active:after,:host([multiline]) .tooltip:focus:after{display:table-cell}:host([multiline]) .tooltip:focus-within:after{display:table-cell}:host([position=s]) .tooltip:after,:host([position=se]) .tooltip:after,:host([position=sw]) .tooltip:after{top:100%;right:50%;margin-top:var(--comp-position)}:host([position=s]) .tooltip:before,:host([position=se]) .tooltip:before,:host([position=sw]) .tooltip:before{top:auto;right:50%;bottom:var(--comp-offset);margin-right:var(--comp-offset);border-bottom-color:var(--comp-background)}:host([position=n]) .tooltip:after,:host([position=ne]) .tooltip:after,:host([position=nw]) .tooltip:after{right:50%;bottom:100%;margin-bottom:var(--comp-position)}:host([position=n]) .tooltip:before,:host([position=ne]) .tooltip:before,:host([position=nw]) .tooltip:before{top:var(--comp-offset);right:50%;bottom:auto;margin-right:var(--comp-offset);border-top-color:var(--comp-background)}:host([position=se]) .tooltip:after,:host([position=ne]) .tooltip:after{right:auto;left:50%;margin-left:var(--comp-body-offset)}:host([position=sw]) .tooltip:after{margin-right:var(--comp-body-offset)}:host([position=nw]) .tooltip:after{margin-right:var(--comp-body-offset)}:host([position=s]) .tooltip:after,:host([position=n]) .tooltip:after{transform:translateX(50%)}:host([position=w]) .tooltip:after{right:100%;bottom:50%;margin-right:var(--comp-position);transform:translateY(50%)}:host([position=w]) .tooltip:before{top:50%;bottom:50%;left:var(--comp-offset);margin-top:var(--comp-offset);border-left-color:var(--comp-background)}:host([position=e]) .tooltip:after{bottom:50%;left:100%;margin-left:var(--comp-position);transform:translateY(50%)}:host([position=e]) .tooltip:before{top:50%;right:var(--comp-offset);bottom:50%;margin-top:var(--comp-offset);border-right-color:var(--comp-background)}";
|
|
5
|
+
|
|
6
|
+
const Q2Tooltip = /*@__PURE__*/ proxyCustomElement(class Q2Tooltip extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
// #region Own Properties
|
|
12
|
+
this.animationEndCount = 0;
|
|
13
|
+
/**
|
|
14
|
+
* Makes the component focusable, thereby putting it in the tab order of the keyboard.
|
|
15
|
+
* @warning
|
|
16
|
+
* This is only meant to be used when the `q2-tooltip` is wrapped around an element that is not focusable (e.g., icons, static text, badges, etc.).
|
|
17
|
+
*/
|
|
18
|
+
this.focusable = false;
|
|
19
|
+
/** The position of the tooltip based on [cardinal and intercardinal directions](https://en.wikipedia.org/wiki/Cardinal_direction). */
|
|
20
|
+
this.position = 'n';
|
|
21
|
+
}
|
|
22
|
+
// #endregion
|
|
23
|
+
// #region Component Lifecycle Events
|
|
24
|
+
componentDidLoad() {
|
|
25
|
+
overrideFocus(this.hostElement);
|
|
26
|
+
}
|
|
27
|
+
// #endregion
|
|
28
|
+
// #region Listeners
|
|
29
|
+
focusCaptureHandler() {
|
|
30
|
+
this.checkFocusClass();
|
|
31
|
+
}
|
|
32
|
+
focusHandler(event) {
|
|
33
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
34
|
+
return;
|
|
35
|
+
if (!this.focusable)
|
|
36
|
+
return;
|
|
37
|
+
this.tooltipElement.focus();
|
|
38
|
+
}
|
|
39
|
+
focusOutHandler() {
|
|
40
|
+
if (this.shouldBeVisible)
|
|
41
|
+
return;
|
|
42
|
+
if (this.focusClass === 'has-generic-focus')
|
|
43
|
+
this.focusClass = 'has-generic-focus-out';
|
|
44
|
+
else
|
|
45
|
+
this.focusClass = null;
|
|
46
|
+
}
|
|
47
|
+
keyUpHandler(event) {
|
|
48
|
+
switch (event.key) {
|
|
49
|
+
case 'Esc':
|
|
50
|
+
case 'Escape':
|
|
51
|
+
this.hideTooltip();
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// #endregion
|
|
56
|
+
// #region Local Methods
|
|
57
|
+
get shouldBeVisible() {
|
|
58
|
+
if (this.persistent)
|
|
59
|
+
return true;
|
|
60
|
+
return this.hostElement.matches(':hover, :focus-within');
|
|
61
|
+
}
|
|
62
|
+
animationEndHandler() {
|
|
63
|
+
this.animationEndCount = this.animationEndCount + 1;
|
|
64
|
+
const { focusClass, animationEndCount } = this;
|
|
65
|
+
// animationEnd is fired once for :before and once for :after pseudo elements
|
|
66
|
+
// there are multiple animations defined for .has-generic-focus
|
|
67
|
+
// so we need to wait for all of them to finish before we can remove the class
|
|
68
|
+
if (focusClass === 'has-generic-focus-out' || (focusClass === 'has-generic-focus' && animationEndCount === 4)) {
|
|
69
|
+
this.focusClass = null;
|
|
70
|
+
this.animationEndCount = 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
checkFocusClass() {
|
|
74
|
+
if (!this.shouldBeVisible)
|
|
75
|
+
return;
|
|
76
|
+
const isKeyboardFocus = !!this.findFocusVisibleElement(document.activeElement);
|
|
77
|
+
this.focusClass = isKeyboardFocus ? 'has-keyboard-focus' : 'has-generic-focus';
|
|
78
|
+
if (isKeyboardFocus)
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
findFocusVisibleElement(element) {
|
|
82
|
+
if (!element)
|
|
83
|
+
return;
|
|
84
|
+
if (element.shadowRoot)
|
|
85
|
+
element = this.findFocusVisibleElement(element.shadowRoot.activeElement);
|
|
86
|
+
return (element === null || element === void 0 ? void 0 : element.matches(':focus-visible')) ? element : null;
|
|
87
|
+
}
|
|
88
|
+
hideTooltip() {
|
|
89
|
+
if (this.focusClass === 'has-generic-focus')
|
|
90
|
+
this.focusClass = 'has-generic-focus-out';
|
|
91
|
+
else
|
|
92
|
+
this.focusClass = null;
|
|
93
|
+
}
|
|
94
|
+
// #endregion
|
|
95
|
+
// #region Render Methods
|
|
96
|
+
render() {
|
|
97
|
+
const { focusClass } = this;
|
|
98
|
+
const classes = ['tooltip'];
|
|
99
|
+
if (focusClass)
|
|
100
|
+
classes.push(focusClass);
|
|
101
|
+
return this.label ? (h("div", { tabindex: this.focusable ? 0 : undefined, ref: el => (this.tooltipElement = el), class: classes.join(' '), "aria-label": this.label, onAnimationEnd: () => this.animationEndHandler(), role: "tooltip", "test-id": "tooltipContainer" }, h("slot", null))) : (h("slot", null));
|
|
102
|
+
}
|
|
103
|
+
get hostElement() { return this; }
|
|
104
|
+
static get style() { return q2TooltipCss; }
|
|
105
|
+
}, [1, "q2-tooltip", {
|
|
106
|
+
"block": [516],
|
|
107
|
+
"focusable": [516],
|
|
108
|
+
"immediate": [516],
|
|
109
|
+
"label": [513],
|
|
110
|
+
"multiline": [516],
|
|
111
|
+
"persistent": [516],
|
|
112
|
+
"position": [513],
|
|
113
|
+
"focusClass": [32]
|
|
114
|
+
}, [[2, "focus", "focusCaptureHandler"], [0, "focus", "focusHandler"], [0, "focusout", "focusOutHandler"], [0, "keyup", "keyUpHandler"]]]);
|
|
115
|
+
function defineCustomElement() {
|
|
116
|
+
if (typeof customElements === "undefined") {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const components = ["q2-tooltip"];
|
|
120
|
+
components.forEach(tagName => { switch (tagName) {
|
|
121
|
+
case "q2-tooltip":
|
|
122
|
+
if (!customElements.get(tagName)) {
|
|
123
|
+
customElements.define(tagName, Q2Tooltip);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
} });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { Q2Tooltip as Q, defineCustomElement as d };
|
|
130
|
+
//# sourceMappingURL=q2-tooltip2.js.map
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=q2-tooltip2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"q2-tooltip2.js","mappings":"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","names":["__stencil_proxyCustomElement"],"sources":["src/components/q2-tooltip/q2-tooltip.scss?tag=q2-tooltip&encapsulation=shadow","src/components/q2-tooltip/q2-tooltip.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n}\n\n:host([block]) {\n display: block;\n}\n\n.tooltip {\n --comp-background: #{var-list(\n --tct-tooltip-background,\n var-prefixer(tooltip-background-color),\n --t-top-a3,\n #0d0d0dd9\n )};\n --comp-offset-default: calc(var(--app-scale-1x, 5px) * -1);\n --comp-offset: #{var-list(var-prefixer(tooltip-offset), --comp-offset-default)};\n --comp-position: #{var-list(var-prefixer(tooltip-position), --app-scale-1x, 5px)};\n --comp-body-offset-default: calc(var(--app-scale-3x, 15px) * -1);\n --comp-body-offset: #{var-list(var-prefixer(tooltip-body-offset), --comp-body-offset-default)};\n --comp-duration: #{var-list(var-prefixer(tooltip-transition-duration), --app-duration-1, 0.2s)};\n --comp-visible-duration: #{var-list(var-prefixer(tooltip-transition-visible-duration), 2s)};\n --comp-delay: #{var-list(var-prefixer(tooltip-transition-delay), 0s)};\n\n display: inline-block;\n position: relative;\n\n &:hover {\n --comp-delay: #{var-list(var-prefixer(tooltip-transition-delay), 1s)};\n\n :host([immediate]:not([immediate='false'])) & {\n --comp-delay: 0s;\n }\n }\n\n // Tooltip arrow\n &:before {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n color: var(--comp-background);\n pointer-events: none;\n content: '';\n border: var-list(var-prefixer(tooltip-arrow-size), --app-scale-1x, 5px) solid transparent;\n }\n\n // Tooltip bubble\n &:after {\n --comp-padding: #{var-list(--app-scale-1x, 5px)} 8px;\n\n position: absolute;\n z-index: 1;\n padding: var-list(var-prefixer(tooltip-padding), --comp-padding);\n font-weight: var-list(var-prefixer(tooltip-font-weight), 600);\n font-size: var-list(var-prefixer(tooltip-font-size), --app-font-size-small, 12px);\n line-height: 1.5;\n color: var-list(var-prefixer(tooltip-color), --app-white, #ffffff);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: var(--comp-background);\n border-radius: var-list(var-prefixer(tooltip-border-radius), --app-border-radius-1, 4px);\n }\n\n &:before,\n &:after {\n display: inline-block;\n visibility: hidden;\n opacity: 0;\n transition: all var(--comp-duration) ease-in-out var(--comp-delay);\n }\n\n :host([block]) & {\n display: block;\n }\n\n // When to show the tooltip\n &:hover,\n &.has-keyboard-focus:focus-within,\n :host([persistent]:not([persistent='false'])) & {\n &:before,\n &:after {\n text-decoration: none;\n visibility: visible;\n opacity: 1;\n }\n }\n\n @keyframes tooltippedFade {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n\n &.has-generic-focus:focus-within {\n &:before,\n &:after {\n visibility: visible;\n opacity: 0;\n transition: none;\n animation-timing-function: ease-in-out;\n animation-fill-mode: forwards;\n animation-name: tooltippedFade, tooltippedFade;\n animation-direction: normal, reverse;\n animation-duration: var(--comp-duration);\n animation-delay: 0ms, calc(var(--comp-visible-duration) + var(--comp-duration));\n }\n }\n &.has-generic-focus-out {\n &:before,\n &:after {\n visibility: visible;\n opacity: 0;\n transition: none;\n animation-timing-function: ease-in-out;\n animation-fill-mode: forwards;\n animation-name: tooltippedFade;\n animation-direction: reverse;\n animation-duration: var(--comp-duration);\n }\n }\n\n :host([multiline]) & {\n &:after {\n width: max-content;\n max-width: var-list(var-prefixer(tooltip-max-width), 200px);\n word-break: break-word;\n word-wrap: normal;\n white-space: pre-line;\n border-collapse: separate;\n text-align: left;\n }\n\n :host([position='s']) &,\n :host([position='n']) & {\n &:after {\n right: auto;\n left: 50%;\n transform: translateX(-50%);\n }\n }\n\n :host([position='w']) &,\n :host([position='e']) & {\n &:after {\n right: 100%;\n }\n }\n\n &:hover,\n &:active,\n &:focus {\n &:after {\n display: table-cell;\n }\n }\n\n &:focus-within {\n &:after {\n display: table-cell;\n }\n }\n }\n\n // Below\n :host([position='s']) &,\n :host([position='se']) &,\n :host([position='sw']) & {\n &:after {\n top: 100%;\n right: 50%;\n margin-top: var(--comp-position);\n }\n\n &:before {\n top: auto;\n right: 50%;\n bottom: var(--comp-offset);\n margin-right: var(--comp-offset);\n border-bottom-color: var(--comp-background);\n }\n }\n\n // Above\n :host([position='n']) &,\n :host([position='ne']) &,\n :host([position='nw']) & {\n &:after {\n right: 50%;\n bottom: 100%;\n margin-bottom: var(--comp-position);\n }\n\n &:before {\n top: var(--comp-offset);\n right: 50%;\n bottom: auto;\n margin-right: var(--comp-offset);\n border-top-color: var(--comp-background);\n }\n }\n\n :host([position='se']) &,\n :host([position='ne']) & {\n &:after {\n right: auto;\n left: 50%;\n margin-left: var(--comp-body-offset);\n }\n }\n\n :host([position='sw']) & {\n &:after {\n margin-right: var(--comp-body-offset);\n }\n }\n\n :host([position='nw']) & {\n &:after {\n margin-right: var(--comp-body-offset);\n }\n }\n\n // Centered\n :host([position='s']) &,\n :host([position='n']) & {\n &:after {\n transform: translateX(50%);\n }\n }\n\n // Left side\n :host([position='w']) & {\n &:after {\n right: 100%;\n bottom: 50%;\n margin-right: var(--comp-position);\n transform: translateY(50%);\n }\n\n &:before {\n top: 50%;\n bottom: 50%;\n left: var(--comp-offset);\n margin-top: var(--comp-offset);\n border-left-color: var(--comp-background);\n }\n }\n\n // Right side\n :host([position='e']) & {\n &:after {\n bottom: 50%;\n left: 100%;\n margin-left: var(--comp-position);\n transform: translateY(50%);\n }\n\n &:before {\n top: 50%;\n right: var(--comp-offset);\n bottom: 50%;\n margin-top: var(--comp-offset);\n border-right-color: var(--comp-background);\n }\n }\n}\n","import { Component, Prop, h, ComponentInterface, Element, Listen, State } from '@stencil/core';\nimport { isEventFromElement, overrideFocus } from 'src/utils';\n\n@Component({ tag: 'q2-tooltip', shadow: true, styleUrl: 'q2-tooltip.scss' })\nexport class Q2Tooltip implements ComponentInterface {\n // #region Own Properties\n\n animationEndCount = 0;\n tooltipElement: HTMLDivElement;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n focusClass: 'has-keyboard-focus' | 'has-generic-focus' | 'has-generic-focus-out';\n\n // #endregion\n // #region Public Property API\n\n /** Displays the element as a block, making it take up the full width of its container. */\n @Prop({ reflect: true })\n block: boolean;\n\n /**\n * Makes the component focusable, thereby putting it in the tab order of the keyboard.\n * @warning\n * This is only meant to be used when the `q2-tooltip` is wrapped around an element that is not focusable (e.g., icons, static text, badges, etc.).\n */\n @Prop({ reflect: true })\n focusable: boolean = false;\n\n /** Whether to show the tooltip immediately upon hover. */\n @Prop({ reflect: true })\n immediate: boolean;\n\n /** text that is displayed when the tooltip is activated. */\n @Prop({ reflect: true })\n label: string;\n\n /** Enables the use of multi-line tooltips with a default `max-width` of `200px`. */\n @Prop({ reflect: true })\n multiline: boolean;\n\n /** Displays the tooltip persistently. */\n @Prop({ reflect: true })\n persistent: boolean;\n\n /** The position of the tooltip based on [cardinal and intercardinal directions](https://en.wikipedia.org/wiki/Cardinal_direction). */\n @Prop({ reflect: true })\n position: 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se' = 'n';\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('focus', { capture: true })\n focusCaptureHandler() {\n this.checkFocusClass();\n }\n\n @Listen('focus')\n focusHandler(event) {\n if (!isEventFromElement(event, this.hostElement)) return;\n if (!this.focusable) return;\n this.tooltipElement.focus();\n }\n\n @Listen('focusout')\n focusOutHandler() {\n if (this.shouldBeVisible) return;\n if (this.focusClass === 'has-generic-focus') this.focusClass = 'has-generic-focus-out';\n else this.focusClass = null;\n }\n\n @Listen('keyup')\n keyUpHandler(event: KeyboardEvent) {\n switch (event.key) {\n case 'Esc':\n case 'Escape':\n this.hideTooltip();\n break;\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get shouldBeVisible() {\n if (this.persistent) return true;\n return this.hostElement.matches(':hover, :focus-within');\n }\n\n animationEndHandler() {\n this.animationEndCount = this.animationEndCount + 1;\n const { focusClass, animationEndCount } = this;\n\n // animationEnd is fired once for :before and once for :after pseudo elements\n // there are multiple animations defined for .has-generic-focus\n // so we need to wait for all of them to finish before we can remove the class\n if (focusClass === 'has-generic-focus-out' || (focusClass === 'has-generic-focus' && animationEndCount === 4)) {\n this.focusClass = null;\n this.animationEndCount = 0;\n }\n }\n\n checkFocusClass() {\n if (!this.shouldBeVisible) return;\n const isKeyboardFocus = !!this.findFocusVisibleElement(document.activeElement);\n this.focusClass = isKeyboardFocus ? 'has-keyboard-focus' : 'has-generic-focus';\n if (isKeyboardFocus) return;\n }\n\n findFocusVisibleElement(element: Element) {\n if (!element) return;\n if (element.shadowRoot) element = this.findFocusVisibleElement(element.shadowRoot.activeElement);\n return element?.matches(':focus-visible') ? element : null;\n }\n\n hideTooltip() {\n if (this.focusClass === 'has-generic-focus') this.focusClass = 'has-generic-focus-out';\n else this.focusClass = null;\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { focusClass } = this;\n const classes = ['tooltip'];\n if (focusClass) classes.push(focusClass);\n\n return this.label ? (\n <div\n tabindex={this.focusable ? 0 : undefined}\n ref={el => (this.tooltipElement = el)}\n class={classes.join(' ')}\n aria-label={this.label}\n onAnimationEnd={() => this.animationEndHandler()}\n role=\"tooltip\"\n test-id=\"tooltipContainer\"\n >\n <slot />\n </div>\n ) : (\n <slot />\n );\n }\n\n // #endregion\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.
|
|
1
|
+
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
entries,
|
|
@@ -27,12 +27,18 @@ if (!seal) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
if (!apply) {
|
|
30
|
-
apply = function apply(
|
|
31
|
-
|
|
30
|
+
apply = function apply(func, thisArg) {
|
|
31
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
32
|
+
args[_key - 2] = arguments[_key];
|
|
33
|
+
}
|
|
34
|
+
return func.apply(thisArg, args);
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
if (!construct) {
|
|
35
|
-
construct = function construct(Func
|
|
38
|
+
construct = function construct(Func) {
|
|
39
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
40
|
+
args[_key2 - 1] = arguments[_key2];
|
|
41
|
+
}
|
|
36
42
|
return new Func(...args);
|
|
37
43
|
};
|
|
38
44
|
}
|
|
@@ -61,8 +67,8 @@ function unapply(func) {
|
|
|
61
67
|
if (thisArg instanceof RegExp) {
|
|
62
68
|
thisArg.lastIndex = 0;
|
|
63
69
|
}
|
|
64
|
-
for (var
|
|
65
|
-
args[
|
|
70
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
71
|
+
args[_key3 - 1] = arguments[_key3];
|
|
66
72
|
}
|
|
67
73
|
return apply(func, thisArg, args);
|
|
68
74
|
};
|
|
@@ -73,12 +79,12 @@ function unapply(func) {
|
|
|
73
79
|
* @param func - The constructor function to be wrapped and called.
|
|
74
80
|
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
75
81
|
*/
|
|
76
|
-
function unconstruct(
|
|
82
|
+
function unconstruct(Func) {
|
|
77
83
|
return function () {
|
|
78
|
-
for (var
|
|
79
|
-
args[
|
|
84
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
85
|
+
args[_key4] = arguments[_key4];
|
|
80
86
|
}
|
|
81
|
-
return construct(
|
|
87
|
+
return construct(Func, args);
|
|
82
88
|
};
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
@@ -177,8 +183,8 @@ function lookupGetter(object, prop) {
|
|
|
177
183
|
return fallbackValue;
|
|
178
184
|
}
|
|
179
185
|
|
|
180
|
-
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
181
|
-
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
186
|
+
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
187
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
182
188
|
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
183
189
|
// List of SVG elements that are disallowed by default.
|
|
184
190
|
// We still need to know them so that we can do namespace
|
|
@@ -191,8 +197,8 @@ const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mgly
|
|
|
191
197
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
192
198
|
const text = freeze(['#text']);
|
|
193
199
|
|
|
194
|
-
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
195
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
200
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
201
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
196
202
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
197
203
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
198
204
|
|
|
@@ -290,7 +296,7 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
290
296
|
function createDOMPurify() {
|
|
291
297
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
292
298
|
const DOMPurify = root => createDOMPurify(root);
|
|
293
|
-
DOMPurify.version = '3.
|
|
299
|
+
DOMPurify.version = '3.3.0';
|
|
294
300
|
DOMPurify.removed = [];
|
|
295
301
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
296
302
|
// Not running in a browser, provide a factory function
|
|
@@ -401,6 +407,21 @@ function createDOMPurify() {
|
|
|
401
407
|
let FORBID_TAGS = null;
|
|
402
408
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
403
409
|
let FORBID_ATTR = null;
|
|
410
|
+
/* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
|
|
411
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
412
|
+
tagCheck: {
|
|
413
|
+
writable: true,
|
|
414
|
+
configurable: false,
|
|
415
|
+
enumerable: true,
|
|
416
|
+
value: null
|
|
417
|
+
},
|
|
418
|
+
attributeCheck: {
|
|
419
|
+
writable: true,
|
|
420
|
+
configurable: false,
|
|
421
|
+
enumerable: true,
|
|
422
|
+
value: null
|
|
423
|
+
}
|
|
424
|
+
}));
|
|
404
425
|
/* Decide if ARIA attributes are okay */
|
|
405
426
|
let ALLOW_ARIA_ATTR = true;
|
|
406
427
|
/* Decide if custom data attributes are okay */
|
|
@@ -593,16 +614,24 @@ function createDOMPurify() {
|
|
|
593
614
|
}
|
|
594
615
|
/* Merge configuration parameters */
|
|
595
616
|
if (cfg.ADD_TAGS) {
|
|
596
|
-
if (
|
|
597
|
-
|
|
617
|
+
if (typeof cfg.ADD_TAGS === 'function') {
|
|
618
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
619
|
+
} else {
|
|
620
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
621
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
622
|
+
}
|
|
623
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
598
624
|
}
|
|
599
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
600
625
|
}
|
|
601
626
|
if (cfg.ADD_ATTR) {
|
|
602
|
-
if (
|
|
603
|
-
|
|
627
|
+
if (typeof cfg.ADD_ATTR === 'function') {
|
|
628
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
629
|
+
} else {
|
|
630
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
631
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
632
|
+
}
|
|
633
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
604
634
|
}
|
|
605
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
606
635
|
}
|
|
607
636
|
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
608
637
|
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
@@ -910,7 +939,7 @@ function createDOMPurify() {
|
|
|
910
939
|
return true;
|
|
911
940
|
}
|
|
912
941
|
/* Remove element if anything forbids its presence */
|
|
913
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
942
|
+
if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
|
|
914
943
|
/* Check if we have a custom element to handle */
|
|
915
944
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
916
945
|
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
@@ -982,12 +1011,12 @@ function createDOMPurify() {
|
|
|
982
1011
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
983
1012
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
984
1013
|
We don't need to check the value; it's always URI safe. */
|
|
985
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
1014
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
986
1015
|
if (
|
|
987
1016
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
988
1017
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
989
1018
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
990
|
-
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
|
1019
|
+
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||
|
|
991
1020
|
// Alternative, second condition checks if it's an `is`-attribute, AND
|
|
992
1021
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
993
1022
|
lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
|
|
@@ -1066,7 +1095,12 @@ function createDOMPurify() {
|
|
|
1066
1095
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1067
1096
|
}
|
|
1068
1097
|
/* Work around a security issue with comments inside attributes */
|
|
1069
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
1098
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
|
|
1099
|
+
_removeAttribute(name, currentNode);
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
/* Make sure we cannot easily use animated hrefs, even if animations are allowed */
|
|
1103
|
+
if (lcName === 'attributename' && stringMatch(value, 'href')) {
|
|
1070
1104
|
_removeAttribute(name, currentNode);
|
|
1071
1105
|
continue;
|
|
1072
1106
|
}
|