@internetarchive/elements 1.8.0 → 1.9.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/README.md +25 -1
- package/dist/src/elements/ia-audio-element/ia-audio-element.js +1 -1
- package/dist/src/elements/ia-audio-element/ia-audio-element.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.js.map +1 -1
- package/dist/src/elements/ia-button/ia-button.js +1 -1
- package/dist/src/elements/ia-button/ia-button.js.map +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +2 -2
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +2 -2
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +2 -2
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/icons.js +1 -1
- package/dist/src/elements/ia-donation-form/icons.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +1 -1
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js +1 -1
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts +7 -2
- package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.js +13 -9
- package/dist/src/elements/ia-dropdown/ia-dropdown.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.js +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.js.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js +2 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js.map +1 -1
- package/dist/src/elements/ia-icon/ia-icon.js +1 -1
- package/dist/src/elements/ia-icon/ia-icon.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js +2 -2
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/image-viewer-gestures.js +1 -1
- package/dist/src/elements/ia-image-viewer/image-viewer-gestures.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js +2 -2
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js +2 -2
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js +2 -2
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js +3 -2
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js +2 -2
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js +2 -2
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js +2 -2
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js.map +1 -1
- package/dist/src/elements/ia-otp-form/ia-otp-form.js +1 -1
- package/dist/src/elements/ia-otp-form/ia-otp-form.js.map +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.js +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.js.map +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.js +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.js +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review.js +1 -1
- package/dist/src/elements/ia-reviews/ia-review.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.js +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js.map +1 -1
- package/dist/src/elements/ia-sr-only-text/ia-sr-only-text.js +1 -1
- package/dist/src/elements/ia-sr-only-text/ia-sr-only-text.js.map +1 -1
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.js +2 -2
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.js.map +1 -1
- package/dist/src/elements/ia-topnav/data/menus.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/data/menus.js +5 -1
- package/dist/src/elements/ia-topnav/data/menus.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-user-menu.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-user-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-entry.js +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-entry.js.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js.map +1 -1
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js +1 -1
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js.map +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js.map +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js.map +1 -1
- package/dist/src/elements/modal-manager/modal-manager.js +1 -1
- package/dist/src/elements/modal-manager/modal-manager.js.map +1 -1
- package/dist/src/labs/ia-snow/ia-snow.js +2 -2
- package/dist/src/labs/ia-snow/ia-snow.js.map +1 -1
- package/dist/src/locales/es.d.ts +1 -0
- package/dist/src/locales/es.d.ts.map +1 -1
- package/dist/src/locales/es.js +1 -0
- package/dist/src/locales/es.js.map +1 -1
- package/dist/src/locales/fr.d.ts +1 -0
- package/dist/src/locales/fr.d.ts.map +1 -1
- package/dist/src/locales/fr.js +1 -0
- package/dist/src/locales/fr.js.map +1 -1
- package/dist/src/utils/custom-element.d.ts.map +1 -0
- package/dist/src/utils/custom-element.js.map +1 -0
- package/dist/src/utils/download-url/download-url.d.ts +21 -0
- package/dist/src/utils/download-url/download-url.d.ts.map +1 -0
- package/dist/src/utils/download-url/download-url.js +30 -0
- package/dist/src/utils/download-url/download-url.js.map +1 -0
- package/dist/src/utils/icon-box.d.ts.map +1 -0
- package/dist/src/utils/icon-box.js.map +1 -0
- package/dist/src/utils/lazy-load-template.d.ts.map +1 -0
- package/dist/src/utils/lazy-load-template.js.map +1 -0
- package/dist/src/utils/prefers-reduced-motion.d.ts.map +1 -0
- package/dist/src/utils/prefers-reduced-motion.js.map +1 -0
- package/eslint/index.mjs +20 -0
- package/eslint/no-hand-built-download-url.mjs +33 -0
- package/package.json +5 -1
- package/dist/src/util/custom-element.d.ts.map +0 -1
- package/dist/src/util/custom-element.js.map +0 -1
- package/dist/src/util/icon-box.d.ts.map +0 -1
- package/dist/src/util/icon-box.js.map +0 -1
- package/dist/src/util/lazy-load-template.d.ts.map +0 -1
- package/dist/src/util/lazy-load-template.js.map +0 -1
- package/dist/src/util/prefers-reduced-motion.d.ts.map +0 -1
- package/dist/src/util/prefers-reduced-motion.js.map +0 -1
- /package/dist/src/{util → utils}/custom-element.d.ts +0 -0
- /package/dist/src/{util → utils}/custom-element.js +0 -0
- /package/dist/src/{util → utils}/icon-box.d.ts +0 -0
- /package/dist/src/{util → utils}/icon-box.js +0 -0
- /package/dist/src/{util → utils}/lazy-load-template.d.ts +0 -0
- /package/dist/src/{util → utils}/lazy-load-template.js +0 -0
- /package/dist/src/{util → utils}/prefers-reduced-motion.d.ts +0 -0
- /package/dist/src/{util → utils}/prefers-reduced-motion.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-feature-feedback.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/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,qBAAqB,CAAC;IACpC,SAAS,EAAE;GACC,iBAAiB,CA6xB7B","sourcesContent":["import {\n html,\n css,\n LitElement,\n nothing,\n CSSResultGroup,\n PropertyValues,\n TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport { localized, msg } from '@lit/localize';\n\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { RecaptchaManagerInterface } from '@src/services/recaptcha-manager/recaptcha-manager';\nimport type { RecaptchaWidgetInterface } from '@src/services/recaptcha-manager/recaptcha-widget';\nimport type { FeatureFeedbackServiceInterface } from './feature-feedback-service';\nimport type {\n FeatureFeedbackDisplayMode,\n FeatureFeedbackError,\n Vote,\n} from './models';\n\nimport { thumbsUp } from './assets/img/thumb-up';\nimport { thumbsDown } from './assets/img/thumb-down';\n\n@customElement('ia-feature-feedback')\n@localized()\nexport class IAFeatureFeedback\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({ type: String }) featureIdentifier?: string;\n\n /**\n * The prompt text shown beside the vote buttons\n * (default 'Do you find this feature useful?', localized).\n */\n @property({ type: String }) prompt?: string;\n\n /**\n * The text on the button in `button` display mode (default 'Beta', localized).\n */\n @property({ type: String }) buttonText?: string;\n\n /**\n * - `button` renders a single button with the provided button text (or default 'Beta').\n * Clicking the button opens the popup.\n * - `vote-prompt` renders the provided prompt text alongside two up/down vote buttons and\n * a \"Leave a comment\" button.\n * Clicking either vote button immediately submits feedback without a comment.\n * Clicking the comment button instead opens the popup.\n */\n @property({ type: String }) displayMode: FeatureFeedbackDisplayMode =\n 'button';\n\n @property({ type: Object }) recaptchaManager?: RecaptchaManagerInterface;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Boolean }) disabled?: boolean;\n\n @property({ type: Object })\n featureFeedbackService?: FeatureFeedbackServiceInterface;\n\n @state() private isOpen = false;\n\n @state() private processing = false;\n\n @state() private popupTopX = 0;\n\n @state() private popupTopY = 0;\n\n @state() private vote?: Vote;\n\n @state() private voteSubmitted = false;\n\n @state() private error?: FeatureFeedbackError;\n\n @state() private voteNeedsChoosing = false;\n\n @state() private recaptchaWidget?: RecaptchaWidgetInterface;\n\n @query('#container') private container!: HTMLDivElement;\n\n @query('#popup') private popup!: HTMLDivElement;\n\n @query('#comments') private comments!: HTMLTextAreaElement;\n\n private boundEscapeListener!: (this: Document, ev: KeyboardEvent) => void;\n\n private boundScrollListener!: (this: Document, ev: Event) => void;\n\n render() {\n return html`\n <div id=\"container\">\n ${this.displayMode === 'vote-prompt'\n ? this.votePromptDisplay\n : this.singleButtonDisplay}\n </div>\n `;\n }\n\n firstUpdated(): void {\n this.boundEscapeListener = this.handleEscape.bind(this);\n this.boundScrollListener = this.handleScroll.bind(this);\n }\n\n updated(changed: PropertyValues): void {\n if (changed.has('vote') && this.vote) {\n this.error = undefined;\n this.voteNeedsChoosing = false;\n }\n if (changed.has('resizeObserver')) {\n const oldObserver = changed.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.disconnectResizeObserver(oldObserver);\n }\n }\n\n handleResize() {\n if (!this.isOpen) return;\n this.positionPopup();\n }\n\n handleScroll() {\n if (!this.isOpen) return;\n this.positionPopup();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEscapeListener();\n this.stopScrollObserver();\n this.disconnectResizeObserver(this.resizeObserver);\n }\n\n private resizingElement = document.body;\n\n private disconnectResizeObserver(observer?: SharedResizeObserverInterface) {\n const observerToRemove = observer ?? this.resizeObserver;\n observerToRemove?.removeObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n private setupResizeObserver() {\n if (!this.resizeObserver) return;\n this.resizeObserver.addObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n private async setupRecaptcha() {\n if (!this.recaptchaManager) return;\n this.recaptchaWidget = await this.recaptchaManager.getRecaptchaWidget();\n }\n\n private resetState() {\n this.vote = undefined;\n this.voteSubmitted = false;\n this.error = undefined;\n this.voteNeedsChoosing = false;\n this.comments.value = '';\n }\n\n private async showPopup() {\n if (this.voteSubmitted && this.displayMode === 'button') return;\n\n this.setupResizeObserver();\n this.setupScrollObserver();\n this.setupEscapeListener();\n this.positionPopup();\n this.isOpen = true;\n await this.setupRecaptcha();\n }\n\n private closePopup() {\n this.disconnectResizeObserver();\n this.stopScrollObserver();\n this.removeEscapeListener();\n this.isOpen = false;\n }\n\n private positionPopup() {\n const containerRect = this.container.getBoundingClientRect();\n const popupRect = this.popup.getBoundingClientRect();\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const windowCenterX = windowWidth / 2;\n const windowCenterY = windowHeight / 2;\n if (containerRect.left < windowCenterX) {\n this.popupTopX = containerRect.right - 20;\n } else {\n this.popupTopX = containerRect.left + 20 - popupRect.width;\n }\n this.popupTopX = Math.max(0, this.popupTopX);\n if (this.popupTopX + popupRect.width > windowWidth) {\n this.popupTopX = windowWidth - popupRect.width;\n }\n\n if (containerRect.top < windowCenterY) {\n this.popupTopY = containerRect.bottom - 10;\n } else {\n this.popupTopY = containerRect.top + 10 - popupRect.height;\n }\n }\n\n private handleEscape(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n this.cancel(e);\n }\n }\n\n private setupEscapeListener() {\n document.addEventListener('keyup', this.boundEscapeListener);\n }\n\n private removeEscapeListener() {\n document.removeEventListener('keyup', this.boundEscapeListener);\n }\n\n private setupScrollObserver() {\n document.addEventListener('scroll', this.boundScrollListener);\n }\n\n private stopScrollObserver() {\n document.removeEventListener('scroll', this.boundScrollListener);\n }\n\n /**\n * Template for the feedback widget in the `button` display mode.\n */\n private get singleButtonDisplay(): TemplateResult {\n return html`\n <button\n id=\"beta-button\"\n @click=${this.showPopup}\n tabindex=\"0\"\n ?disabled=${this.disabled}\n >\n <span id=\"button-text\">${this.buttonText ?? msg('Beta')}</span>\n <span\n class=\"beta-button-thumb upvote-button ${this.voteSubmitted\n ? this.upvoteButtonClass\n : ''}\"\n >${thumbsUp}</span\n >\n <span\n class=\"beta-button-thumb downvote-button ${this.voteSubmitted\n ? this.downvoteButtonClass\n : ''}\"\n id=\"beta-button-thumb-down\"\n >${thumbsDown}</span\n >\n </button>\n ${this.popupTemplate}\n `;\n }\n\n /**\n * Template for the feedback widget in the `vote-prompt` display mode.\n */\n private get votePromptDisplay(): TemplateResult {\n return html`\n <form\n @submit=${this.submit}\n ?disabled=${this.processing || this.voteSubmitted}\n >\n <div class=\"prompt\">\n <span class=\"prompt-text\">${this.promptText}</span>\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.upvoteSelected}\n @keyup=${this.upvoteKeypressed}\n class=\"vote-button upvote-button ${this.upvoteButtonClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"up\"\n @click=${this.upvoteButtonSelected}\n ?checked=${this.upvoteSelected}\n />\n ${thumbsUp}\n </label>\n\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.downvoteSelected}\n @keyup=${this.downvoteKeypressed}\n class=\"vote-button downvote-button ${this.downvoteButtonClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"down\"\n @click=${this.downvoteButtonSelected}\n ?checked=${this.downvoteSelected}\n />\n ${thumbsDown}\n </label>\n <button id=\"comment-button\" type=\"button\" @click=${this.showPopup}>\n ${msg('Leave a comment')}\n </button>\n </div>\n </form>\n ${this.popupTemplate}\n `;\n }\n\n /**\n * Template for the popup menu that appears when the feedback button(s) are clicked.\n */\n private get popupTemplate() {\n return html`\n <div\n id=\"popup-background\"\n class=${this.isOpen ? 'open' : 'closed'}\n @click=${this.backgroundClicked}\n @keyup=${this.backgroundClicked}\n >\n <div\n id=\"popup\"\n style=\"left: ${this.popupTopX}px; top: ${this.popupTopY}px\"\n >\n <form\n @submit=${this.submit}\n id=\"form\"\n ?disabled=${this.processing || this.voteSubmitted}\n >\n <div class=\"prompt\">\n <div class=\"prompt-text\">${this.promptText}</div>\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.upvoteSelected}\n @click=${this.upvoteButtonSelected}\n @keyup=${this.upvoteKeypressed}\n class=\"vote-button upvote-button ${this\n .upvoteButtonClass} ${this.chooseVoteErrorClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"up\"\n @click=${this.upvoteButtonSelected}\n ?checked=${this.upvoteSelected}\n />\n ${thumbsUp}\n </label>\n\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.downvoteSelected}\n @click=${this.downvoteButtonSelected}\n @keyup=${this.downvoteKeypressed}\n class=\"vote-button downvote-button ${this\n .downvoteButtonClass} ${this.chooseVoteErrorClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"down\"\n @click=${this.downvoteButtonSelected}\n ?checked=${this.downvoteSelected}\n />\n ${thumbsDown}\n </label>\n </div>\n <div>\n <textarea\n placeholder=${msg('Comments (optional)')}\n id=\"comments\"\n tabindex=\"0\"\n ?disabled=${this.processing}\n ></textarea>\n </div>\n ${this.errorTemplate}\n <div id=\"actions\">\n <button\n @click=${this.cancel}\n id=\"cancel-button\"\n class=\"cta-button\"\n tabindex=\"0\"\n ?disabled=${this.processing}\n >\n ${msg('Cancel')}\n </button>\n <input\n type=\"submit\"\n id=\"submit-button\"\n class=\"cta-button\"\n .value=${this.processing\n ? msg('Submitting...')\n : msg('Submit feedback')}\n tabindex=\"0\"\n ?disabled=${this.processing}\n />\n </div>\n </form>\n </div>\n </div>\n `;\n }\n\n /**\n * Template for the current error message, if any.\n */\n private get errorTemplate(): TemplateResult | typeof nothing {\n const { error } = this;\n if (!error) return nothing;\n const message =\n error.kind === 'noVote'\n ? msg('Please select a vote.')\n : msg('There was an error submitting your feedback.');\n const detail =\n error.kind === 'submitFailed' && error.detail !== undefined\n ? html`<br />${msg('Error: ')}${error.detail}`\n : nothing;\n return html`<div id=\"error\">${message}${detail}</div>`;\n }\n\n private get promptText(): string {\n return this.prompt ?? msg('Do you find this feature useful?');\n }\n\n private get upvoteSelected() {\n return this.vote === 'up';\n }\n\n private get downvoteSelected() {\n return this.vote === 'down';\n }\n\n private upvoteKeypressed(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') {\n this.upvoteButtonSelected();\n }\n }\n\n private downvoteKeypressed(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') {\n this.downvoteButtonSelected();\n }\n }\n\n private upvoteButtonSelected() {\n if (this.processing || this.voteSubmitted) return;\n this.vote = this.vote === 'up' ? undefined : 'up';\n this.handleButtonSelection();\n }\n\n private downvoteButtonSelected() {\n if (this.processing || this.voteSubmitted) return;\n this.vote = this.vote === 'down' ? undefined : 'down';\n this.handleButtonSelection();\n }\n\n private async handleButtonSelection() {\n // If a button is pressed _outside_ the popup, it should take effect immediately\n if (!this.isOpen) {\n await this.setupRecaptcha();\n this.submit();\n }\n }\n\n private get chooseVoteErrorClass(): string {\n return this.voteNeedsChoosing ? 'error' : '';\n }\n\n private get upvoteButtonClass(): string {\n switch (this.vote) {\n case 'up':\n return 'selected';\n case 'down':\n return 'unselected';\n default:\n return 'noselection';\n }\n }\n\n private get downvoteButtonClass(): string {\n switch (this.vote) {\n case 'up':\n return 'unselected';\n case 'down':\n return 'selected';\n default:\n return 'noselection';\n }\n }\n\n private backgroundClicked(e: MouseEvent) {\n if (!(e.target instanceof Node)) return;\n if (this.popup?.contains(e.target)) return;\n this.cancel(e);\n }\n\n private cancel(e: Event) {\n e.preventDefault();\n this.closePopup();\n if (!this.voteSubmitted) this.resetState();\n }\n\n private async submit(e?: Event) {\n e?.preventDefault();\n\n if (!this.vote) {\n this.voteNeedsChoosing = true;\n this.error = { kind: 'noVote' };\n return;\n }\n\n if (!this.featureIdentifier) {\n throw new Error('featureIdentifier is required');\n }\n\n if (!this.featureFeedbackService) {\n throw new Error('featureFeedbackService is required');\n }\n\n if (!this.recaptchaWidget) {\n throw new Error('recaptchaWidget is required');\n }\n\n const popupWasOpen = this.isOpen;\n this.processing = true;\n\n try {\n const token = await this.recaptchaWidget.execute();\n const response = await this.featureFeedbackService.submitFeedback({\n featureIdentifier: this.featureIdentifier,\n vote: this.vote,\n comments: this.comments.value,\n recaptchaToken: token,\n });\n\n if (response.success) {\n this.voteSubmitted = true;\n if (popupWasOpen) this.closePopup();\n } else {\n this.error = { kind: 'submitFailed' };\n }\n } catch (err) {\n this.error = {\n kind: 'submitFailed',\n detail: err instanceof Error ? err.message : String(err),\n };\n }\n\n this.processing = false;\n }\n\n static get styles(): CSSResultGroup {\n const blueColor = css`var(--featureFeedbackBlueColor, #194880)`;\n const darkGrayColor = css`var(--featureFeedbackDarkGrayColor, #767676)`;\n const darkGrayColorSvgFilter = css`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`;\n\n const backdropZindex = css`var(--featureFeedbackBackdropZindex, 5)`;\n const modalZindex = css`var(--featureFeedbackModalZindex, 6)`;\n\n const popupBorderColor = css`var(--featureFeedbackPopupBorderColor, ${blueColor})`;\n const submitButtonColor = css`var(--featureFeedbackSubmitButtonColor, ${blueColor})`;\n const betaButtonBorderColor = css`var(--featureFeedbackBetaButtonBorderColor, ${blueColor})`;\n const betaButtonTextColor = css`var(--featureFeedbackBetaButtonTextColor, ${blueColor})`;\n const betaButtonBackground = css`var(--featureFeedbackBetaButtonBackground, none)`;\n const betaButtonSvgFilter = css`var(--featureFeedbackBetaButtonSvgFilter, ${darkGrayColorSvgFilter})`;\n\n const cancelButtonColor = css`var(--featureFeedbackCancelButtonColor, #515151)`;\n const popupBlockerColor = css`var(--featureFeedbackPopupBlockerColor, rgba(255, 255, 255, 0.3))`;\n\n const popupBackgroundColor = css`var(--featureFeedbackPopupBackgroundColor, #F5F5F7)`;\n\n const promptFontWeight = css`var(--featureFeedbackPromptFontWeight, bold)`;\n const promptFontSize = css`var(--featureFeedbackPromptFontSize, 1.4rem)`;\n\n const commentButtonFontWeight = css`var(--featureFeedbackCommentButtonFontWeight, normal)`;\n const commentButtonFontSize = css`var(--featureFeedbackCommentButtonFontWeight, 1.4rem)`;\n\n const defaultColor = css`var(--defaultColor, ${darkGrayColor});`;\n const defaultColorSvgFilter = css`var(--defaultColorSvgFilter, ${darkGrayColorSvgFilter});`;\n\n const upvoteColor = css`var(--upvoteColor, #23765D);`;\n const upvoteColorSvgFilter = css`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%));`;\n\n const downvoteColor = css`var(--downvoteColor, #720D11);`;\n const downvoteColorSvgFilter = css`var(--downvoteColorSvgFilter, invert(5%) sepia(81%) saturate(5874%) hue-rotate(352deg) brightness(105%) contrast(95%));`;\n\n const unselectedColor = css`var(--unselectedColor, #CCCCCC);`;\n const unselectedColorSvgFilter = css`var(--unselectedColorSvgFilter, invert(100%) sepia(0%) saturate(107%) hue-rotate(138deg) brightness(89%) contrast(77%));`;\n\n return css`\n #container {\n display: inline-block;\n }\n\n #beta-button {\n font-size: 12px;\n font-weight: bold;\n font-style: italic;\n color: ${betaButtonTextColor};\n background: ${betaButtonBackground};\n border: 1px solid ${betaButtonBorderColor};\n border-radius: 4px;\n padding: 1px 5px;\n }\n\n .beta-button-thumb svg {\n height: 10px;\n width: 10px;\n filter: ${betaButtonSvgFilter};\n }\n\n .beta-button-thumb.unselected svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n #error {\n color: red;\n font-size: 14px;\n text-align: center;\n font-weight: bold;\n }\n\n #popup-background {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ${backdropZindex};\n background-color: ${popupBlockerColor};\n overflow: hidden;\n }\n\n #popup-background.closed {\n visibility: hidden;\n top: -100%;\n left: -100%;\n }\n\n #popup {\n position: absolute;\n padding: 10px;\n background-color: ${popupBackgroundColor};\n border: 1px ${popupBorderColor} solid;\n border-radius: 5px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);\n z-index: ${modalZindex};\n max-width: 300px;\n margin-left: 10px;\n margin-right: 10px;\n }\n\n button,\n input,\n a,\n textarea {\n font-family: inherit;\n }\n\n button,\n input[type='submit'] {\n background: none;\n cursor: pointer;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n }\n\n button:disabled,\n input[type='submit']:disabled {\n cursor: default;\n opacity: 0.5;\n }\n\n #form > div {\n margin-bottom: 10px;\n }\n\n #form > div:last-child {\n margin-bottom: 0;\n }\n\n .prompt {\n display: flex;\n align-items: center;\n font-size: ${promptFontSize};\n font-weight: ${promptFontWeight};\n }\n\n .prompt > label {\n flex: none;\n cursor: pointer;\n }\n\n .prompt-text {\n text-align: left;\n }\n\n #comments {\n width: 100%;\n height: 50px;\n background-color: #ffffff;\n border: 1px #2c2c2c solid;\n border-radius: 4px;\n padding: 7px;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n resize: none;\n }\n\n #comments::placeholder {\n color: #767676;\n }\n\n #actions {\n display: flex;\n justify-content: center;\n }\n\n .cta-button {\n color: white;\n font-size: 14px;\n border-radius: 4px;\n height: 30px;\n margin: 0;\n }\n\n #cancel-button {\n background-color: ${cancelButtonColor};\n }\n\n #submit-button {\n background-color: ${submitButtonColor};\n margin-left: 10px;\n }\n\n .vote-button {\n background-color: #ffffff;\n border: 1px solid #767676;\n border-radius: 2px;\n padding: 0;\n width: 25px;\n height: 25px;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-left: 10px;\n }\n\n .vote-button svg {\n width: 15px;\n height: 15px;\n }\n\n .vote-button input {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n }\n\n .vote-button.noselection {\n border-color: ${defaultColor};\n }\n\n .vote-button.noselection svg {\n filter: ${defaultColorSvgFilter};\n }\n\n .vote-button.unselected {\n border-color: ${unselectedColor};\n }\n\n .vote-button.unselected svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n .upvote-button.selected {\n border-color: ${upvoteColor};\n }\n\n .upvote-button.selected svg {\n filter: ${upvoteColorSvgFilter};\n }\n\n .downvote-button.selected {\n border-color: ${downvoteColor};\n }\n\n .downvote-button.selected svg {\n filter: ${downvoteColorSvgFilter};\n }\n\n .vote-button.error {\n box-shadow: 0 0 4px red;\n }\n\n form[disabled] .vote-button.unselected {\n cursor: not-allowed;\n }\n\n #comment-button {\n color: var(--ia-theme-link-color, #4b64ff);\n font-weight: ${commentButtonFontWeight};\n font-size: ${commentButtonFontSize};\n }\n #comment-button:not([disabled]):hover,\n #comment-button:not([disabled]):active {\n text-decoration: underline;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback': IAFeatureFeedback;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-feature-feedback.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAe/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI9C,IAAM,iBAAiB,GAAvB,MAAM,iBACX,SAAQ,UAAU;IADb;;QAiBL;;;;;;;WAOG;QACyB,gBAAW,GACrC,QAAQ,CAAC;QAWM,WAAM,GAAG,KAAK,CAAC;QAEf,eAAU,GAAG,KAAK,CAAC;QAEnB,cAAS,GAAG,CAAC,CAAC;QAEd,cAAS,GAAG,CAAC,CAAC;QAId,kBAAa,GAAG,KAAK,CAAC;QAItB,s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AoB;AAGhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAC8B;AAExC;IAAhB,KAAK,EAAE;iDAAwB;AAEf;IAAhB,KAAK,EAAE;qDAA4B;AAEnB;IAAhB,KAAK,EAAE;oDAAuB;AAEd;IAAhB,KAAK,EAAE;oDAAuB;AAEd;IAAhB,KAAK,EAAE;+CAAqB;AAEZ;IAAhB,KAAK,EAAE;wDAA+B;AAEtB;IAAhB,KAAK,EAAE;gDAAsC;AAE7B;IAAhB,KAAK,EAAE;4DAAmC;AAE1B;IAAhB,KAAK,EAAE;0DAAoD;AAE/B;IAA5B,KAAK,CAAC,YAAY,CAAC;oDAAoC;AAE/B;IAAxB,KAAK,CAAC,QAAQ,CAAC;gDAAgC;AAEpB;IAA3B,KAAK,CAAC,WAAW,CAAC;mDAAwC;AA3DhD,iBAAiB;IAF7B,aAAa,CAAC,qBAAqB,CAAC;IACpC,SAAS,EAAE;GACC,iBAAiB,CA6xB7B","sourcesContent":["import {\n html,\n css,\n LitElement,\n nothing,\n CSSResultGroup,\n PropertyValues,\n TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { localized, msg } from '@lit/localize';\n\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { RecaptchaManagerInterface } from '@src/services/recaptcha-manager/recaptcha-manager';\nimport type { RecaptchaWidgetInterface } from '@src/services/recaptcha-manager/recaptcha-widget';\nimport type { FeatureFeedbackServiceInterface } from './feature-feedback-service';\nimport type {\n FeatureFeedbackDisplayMode,\n FeatureFeedbackError,\n Vote,\n} from './models';\n\nimport { thumbsUp } from './assets/img/thumb-up';\nimport { thumbsDown } from './assets/img/thumb-down';\n\n@customElement('ia-feature-feedback')\n@localized()\nexport class IAFeatureFeedback\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({ type: String }) featureIdentifier?: string;\n\n /**\n * The prompt text shown beside the vote buttons\n * (default 'Do you find this feature useful?', localized).\n */\n @property({ type: String }) prompt?: string;\n\n /**\n * The text on the button in `button` display mode (default 'Beta', localized).\n */\n @property({ type: String }) buttonText?: string;\n\n /**\n * - `button` renders a single button with the provided button text (or default 'Beta').\n * Clicking the button opens the popup.\n * - `vote-prompt` renders the provided prompt text alongside two up/down vote buttons and\n * a \"Leave a comment\" button.\n * Clicking either vote button immediately submits feedback without a comment.\n * Clicking the comment button instead opens the popup.\n */\n @property({ type: String }) displayMode: FeatureFeedbackDisplayMode =\n 'button';\n\n @property({ type: Object }) recaptchaManager?: RecaptchaManagerInterface;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Boolean }) disabled?: boolean;\n\n @property({ type: Object })\n featureFeedbackService?: FeatureFeedbackServiceInterface;\n\n @state() private isOpen = false;\n\n @state() private processing = false;\n\n @state() private popupTopX = 0;\n\n @state() private popupTopY = 0;\n\n @state() private vote?: Vote;\n\n @state() private voteSubmitted = false;\n\n @state() private error?: FeatureFeedbackError;\n\n @state() private voteNeedsChoosing = false;\n\n @state() private recaptchaWidget?: RecaptchaWidgetInterface;\n\n @query('#container') private container!: HTMLDivElement;\n\n @query('#popup') private popup!: HTMLDivElement;\n\n @query('#comments') private comments!: HTMLTextAreaElement;\n\n private boundEscapeListener!: (this: Document, ev: KeyboardEvent) => void;\n\n private boundScrollListener!: (this: Document, ev: Event) => void;\n\n render() {\n return html`\n <div id=\"container\">\n ${this.displayMode === 'vote-prompt'\n ? this.votePromptDisplay\n : this.singleButtonDisplay}\n </div>\n `;\n }\n\n firstUpdated(): void {\n this.boundEscapeListener = this.handleEscape.bind(this);\n this.boundScrollListener = this.handleScroll.bind(this);\n }\n\n updated(changed: PropertyValues): void {\n if (changed.has('vote') && this.vote) {\n this.error = undefined;\n this.voteNeedsChoosing = false;\n }\n if (changed.has('resizeObserver')) {\n const oldObserver = changed.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.disconnectResizeObserver(oldObserver);\n }\n }\n\n handleResize() {\n if (!this.isOpen) return;\n this.positionPopup();\n }\n\n handleScroll() {\n if (!this.isOpen) return;\n this.positionPopup();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEscapeListener();\n this.stopScrollObserver();\n this.disconnectResizeObserver(this.resizeObserver);\n }\n\n private resizingElement = document.body;\n\n private disconnectResizeObserver(observer?: SharedResizeObserverInterface) {\n const observerToRemove = observer ?? this.resizeObserver;\n observerToRemove?.removeObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n private setupResizeObserver() {\n if (!this.resizeObserver) return;\n this.resizeObserver.addObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n private async setupRecaptcha() {\n if (!this.recaptchaManager) return;\n this.recaptchaWidget = await this.recaptchaManager.getRecaptchaWidget();\n }\n\n private resetState() {\n this.vote = undefined;\n this.voteSubmitted = false;\n this.error = undefined;\n this.voteNeedsChoosing = false;\n this.comments.value = '';\n }\n\n private async showPopup() {\n if (this.voteSubmitted && this.displayMode === 'button') return;\n\n this.setupResizeObserver();\n this.setupScrollObserver();\n this.setupEscapeListener();\n this.positionPopup();\n this.isOpen = true;\n await this.setupRecaptcha();\n }\n\n private closePopup() {\n this.disconnectResizeObserver();\n this.stopScrollObserver();\n this.removeEscapeListener();\n this.isOpen = false;\n }\n\n private positionPopup() {\n const containerRect = this.container.getBoundingClientRect();\n const popupRect = this.popup.getBoundingClientRect();\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const windowCenterX = windowWidth / 2;\n const windowCenterY = windowHeight / 2;\n if (containerRect.left < windowCenterX) {\n this.popupTopX = containerRect.right - 20;\n } else {\n this.popupTopX = containerRect.left + 20 - popupRect.width;\n }\n this.popupTopX = Math.max(0, this.popupTopX);\n if (this.popupTopX + popupRect.width > windowWidth) {\n this.popupTopX = windowWidth - popupRect.width;\n }\n\n if (containerRect.top < windowCenterY) {\n this.popupTopY = containerRect.bottom - 10;\n } else {\n this.popupTopY = containerRect.top + 10 - popupRect.height;\n }\n }\n\n private handleEscape(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n this.cancel(e);\n }\n }\n\n private setupEscapeListener() {\n document.addEventListener('keyup', this.boundEscapeListener);\n }\n\n private removeEscapeListener() {\n document.removeEventListener('keyup', this.boundEscapeListener);\n }\n\n private setupScrollObserver() {\n document.addEventListener('scroll', this.boundScrollListener);\n }\n\n private stopScrollObserver() {\n document.removeEventListener('scroll', this.boundScrollListener);\n }\n\n /**\n * Template for the feedback widget in the `button` display mode.\n */\n private get singleButtonDisplay(): TemplateResult {\n return html`\n <button\n id=\"beta-button\"\n @click=${this.showPopup}\n tabindex=\"0\"\n ?disabled=${this.disabled}\n >\n <span id=\"button-text\">${this.buttonText ?? msg('Beta')}</span>\n <span\n class=\"beta-button-thumb upvote-button ${this.voteSubmitted\n ? this.upvoteButtonClass\n : ''}\"\n >${thumbsUp}</span\n >\n <span\n class=\"beta-button-thumb downvote-button ${this.voteSubmitted\n ? this.downvoteButtonClass\n : ''}\"\n id=\"beta-button-thumb-down\"\n >${thumbsDown}</span\n >\n </button>\n ${this.popupTemplate}\n `;\n }\n\n /**\n * Template for the feedback widget in the `vote-prompt` display mode.\n */\n private get votePromptDisplay(): TemplateResult {\n return html`\n <form\n @submit=${this.submit}\n ?disabled=${this.processing || this.voteSubmitted}\n >\n <div class=\"prompt\">\n <span class=\"prompt-text\">${this.promptText}</span>\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.upvoteSelected}\n @keyup=${this.upvoteKeypressed}\n class=\"vote-button upvote-button ${this.upvoteButtonClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"up\"\n @click=${this.upvoteButtonSelected}\n ?checked=${this.upvoteSelected}\n />\n ${thumbsUp}\n </label>\n\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.downvoteSelected}\n @keyup=${this.downvoteKeypressed}\n class=\"vote-button downvote-button ${this.downvoteButtonClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"down\"\n @click=${this.downvoteButtonSelected}\n ?checked=${this.downvoteSelected}\n />\n ${thumbsDown}\n </label>\n <button id=\"comment-button\" type=\"button\" @click=${this.showPopup}>\n ${msg('Leave a comment')}\n </button>\n </div>\n </form>\n ${this.popupTemplate}\n `;\n }\n\n /**\n * Template for the popup menu that appears when the feedback button(s) are clicked.\n */\n private get popupTemplate() {\n return html`\n <div\n id=\"popup-background\"\n class=${this.isOpen ? 'open' : 'closed'}\n @click=${this.backgroundClicked}\n @keyup=${this.backgroundClicked}\n >\n <div\n id=\"popup\"\n style=\"left: ${this.popupTopX}px; top: ${this.popupTopY}px\"\n >\n <form\n @submit=${this.submit}\n id=\"form\"\n ?disabled=${this.processing || this.voteSubmitted}\n >\n <div class=\"prompt\">\n <div class=\"prompt-text\">${this.promptText}</div>\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.upvoteSelected}\n @click=${this.upvoteButtonSelected}\n @keyup=${this.upvoteKeypressed}\n class=\"vote-button upvote-button ${this\n .upvoteButtonClass} ${this.chooseVoteErrorClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"up\"\n @click=${this.upvoteButtonSelected}\n ?checked=${this.upvoteSelected}\n />\n ${thumbsUp}\n </label>\n\n <label\n tabindex=\"0\"\n role=\"button\"\n aria-pressed=${this.downvoteSelected}\n @click=${this.downvoteButtonSelected}\n @keyup=${this.downvoteKeypressed}\n class=\"vote-button downvote-button ${this\n .downvoteButtonClass} ${this.chooseVoteErrorClass}\"\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"down\"\n @click=${this.downvoteButtonSelected}\n ?checked=${this.downvoteSelected}\n />\n ${thumbsDown}\n </label>\n </div>\n <div>\n <textarea\n placeholder=${msg('Comments (optional)')}\n id=\"comments\"\n tabindex=\"0\"\n ?disabled=${this.processing}\n ></textarea>\n </div>\n ${this.errorTemplate}\n <div id=\"actions\">\n <button\n @click=${this.cancel}\n id=\"cancel-button\"\n class=\"cta-button\"\n tabindex=\"0\"\n ?disabled=${this.processing}\n >\n ${msg('Cancel')}\n </button>\n <input\n type=\"submit\"\n id=\"submit-button\"\n class=\"cta-button\"\n .value=${this.processing\n ? msg('Submitting...')\n : msg('Submit feedback')}\n tabindex=\"0\"\n ?disabled=${this.processing}\n />\n </div>\n </form>\n </div>\n </div>\n `;\n }\n\n /**\n * Template for the current error message, if any.\n */\n private get errorTemplate(): TemplateResult | typeof nothing {\n const { error } = this;\n if (!error) return nothing;\n const message =\n error.kind === 'noVote'\n ? msg('Please select a vote.')\n : msg('There was an error submitting your feedback.');\n const detail =\n error.kind === 'submitFailed' && error.detail !== undefined\n ? html`<br />${msg('Error: ')}${error.detail}`\n : nothing;\n return html`<div id=\"error\">${message}${detail}</div>`;\n }\n\n private get promptText(): string {\n return this.prompt ?? msg('Do you find this feature useful?');\n }\n\n private get upvoteSelected() {\n return this.vote === 'up';\n }\n\n private get downvoteSelected() {\n return this.vote === 'down';\n }\n\n private upvoteKeypressed(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') {\n this.upvoteButtonSelected();\n }\n }\n\n private downvoteKeypressed(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') {\n this.downvoteButtonSelected();\n }\n }\n\n private upvoteButtonSelected() {\n if (this.processing || this.voteSubmitted) return;\n this.vote = this.vote === 'up' ? undefined : 'up';\n this.handleButtonSelection();\n }\n\n private downvoteButtonSelected() {\n if (this.processing || this.voteSubmitted) return;\n this.vote = this.vote === 'down' ? undefined : 'down';\n this.handleButtonSelection();\n }\n\n private async handleButtonSelection() {\n // If a button is pressed _outside_ the popup, it should take effect immediately\n if (!this.isOpen) {\n await this.setupRecaptcha();\n this.submit();\n }\n }\n\n private get chooseVoteErrorClass(): string {\n return this.voteNeedsChoosing ? 'error' : '';\n }\n\n private get upvoteButtonClass(): string {\n switch (this.vote) {\n case 'up':\n return 'selected';\n case 'down':\n return 'unselected';\n default:\n return 'noselection';\n }\n }\n\n private get downvoteButtonClass(): string {\n switch (this.vote) {\n case 'up':\n return 'unselected';\n case 'down':\n return 'selected';\n default:\n return 'noselection';\n }\n }\n\n private backgroundClicked(e: MouseEvent) {\n if (!(e.target instanceof Node)) return;\n if (this.popup?.contains(e.target)) return;\n this.cancel(e);\n }\n\n private cancel(e: Event) {\n e.preventDefault();\n this.closePopup();\n if (!this.voteSubmitted) this.resetState();\n }\n\n private async submit(e?: Event) {\n e?.preventDefault();\n\n if (!this.vote) {\n this.voteNeedsChoosing = true;\n this.error = { kind: 'noVote' };\n return;\n }\n\n if (!this.featureIdentifier) {\n throw new Error('featureIdentifier is required');\n }\n\n if (!this.featureFeedbackService) {\n throw new Error('featureFeedbackService is required');\n }\n\n if (!this.recaptchaWidget) {\n throw new Error('recaptchaWidget is required');\n }\n\n const popupWasOpen = this.isOpen;\n this.processing = true;\n\n try {\n const token = await this.recaptchaWidget.execute();\n const response = await this.featureFeedbackService.submitFeedback({\n featureIdentifier: this.featureIdentifier,\n vote: this.vote,\n comments: this.comments.value,\n recaptchaToken: token,\n });\n\n if (response.success) {\n this.voteSubmitted = true;\n if (popupWasOpen) this.closePopup();\n } else {\n this.error = { kind: 'submitFailed' };\n }\n } catch (err) {\n this.error = {\n kind: 'submitFailed',\n detail: err instanceof Error ? err.message : String(err),\n };\n }\n\n this.processing = false;\n }\n\n static get styles(): CSSResultGroup {\n const blueColor = css`var(--featureFeedbackBlueColor, #194880)`;\n const darkGrayColor = css`var(--featureFeedbackDarkGrayColor, #767676)`;\n const darkGrayColorSvgFilter = css`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`;\n\n const backdropZindex = css`var(--featureFeedbackBackdropZindex, 5)`;\n const modalZindex = css`var(--featureFeedbackModalZindex, 6)`;\n\n const popupBorderColor = css`var(--featureFeedbackPopupBorderColor, ${blueColor})`;\n const submitButtonColor = css`var(--featureFeedbackSubmitButtonColor, ${blueColor})`;\n const betaButtonBorderColor = css`var(--featureFeedbackBetaButtonBorderColor, ${blueColor})`;\n const betaButtonTextColor = css`var(--featureFeedbackBetaButtonTextColor, ${blueColor})`;\n const betaButtonBackground = css`var(--featureFeedbackBetaButtonBackground, none)`;\n const betaButtonSvgFilter = css`var(--featureFeedbackBetaButtonSvgFilter, ${darkGrayColorSvgFilter})`;\n\n const cancelButtonColor = css`var(--featureFeedbackCancelButtonColor, #515151)`;\n const popupBlockerColor = css`var(--featureFeedbackPopupBlockerColor, rgba(255, 255, 255, 0.3))`;\n\n const popupBackgroundColor = css`var(--featureFeedbackPopupBackgroundColor, #F5F5F7)`;\n\n const promptFontWeight = css`var(--featureFeedbackPromptFontWeight, bold)`;\n const promptFontSize = css`var(--featureFeedbackPromptFontSize, 1.4rem)`;\n\n const commentButtonFontWeight = css`var(--featureFeedbackCommentButtonFontWeight, normal)`;\n const commentButtonFontSize = css`var(--featureFeedbackCommentButtonFontWeight, 1.4rem)`;\n\n const defaultColor = css`var(--defaultColor, ${darkGrayColor});`;\n const defaultColorSvgFilter = css`var(--defaultColorSvgFilter, ${darkGrayColorSvgFilter});`;\n\n const upvoteColor = css`var(--upvoteColor, #23765D);`;\n const upvoteColorSvgFilter = css`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%));`;\n\n const downvoteColor = css`var(--downvoteColor, #720D11);`;\n const downvoteColorSvgFilter = css`var(--downvoteColorSvgFilter, invert(5%) sepia(81%) saturate(5874%) hue-rotate(352deg) brightness(105%) contrast(95%));`;\n\n const unselectedColor = css`var(--unselectedColor, #CCCCCC);`;\n const unselectedColorSvgFilter = css`var(--unselectedColorSvgFilter, invert(100%) sepia(0%) saturate(107%) hue-rotate(138deg) brightness(89%) contrast(77%));`;\n\n return css`\n #container {\n display: inline-block;\n }\n\n #beta-button {\n font-size: 12px;\n font-weight: bold;\n font-style: italic;\n color: ${betaButtonTextColor};\n background: ${betaButtonBackground};\n border: 1px solid ${betaButtonBorderColor};\n border-radius: 4px;\n padding: 1px 5px;\n }\n\n .beta-button-thumb svg {\n height: 10px;\n width: 10px;\n filter: ${betaButtonSvgFilter};\n }\n\n .beta-button-thumb.unselected svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n #error {\n color: red;\n font-size: 14px;\n text-align: center;\n font-weight: bold;\n }\n\n #popup-background {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ${backdropZindex};\n background-color: ${popupBlockerColor};\n overflow: hidden;\n }\n\n #popup-background.closed {\n visibility: hidden;\n top: -100%;\n left: -100%;\n }\n\n #popup {\n position: absolute;\n padding: 10px;\n background-color: ${popupBackgroundColor};\n border: 1px ${popupBorderColor} solid;\n border-radius: 5px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);\n z-index: ${modalZindex};\n max-width: 300px;\n margin-left: 10px;\n margin-right: 10px;\n }\n\n button,\n input,\n a,\n textarea {\n font-family: inherit;\n }\n\n button,\n input[type='submit'] {\n background: none;\n cursor: pointer;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n }\n\n button:disabled,\n input[type='submit']:disabled {\n cursor: default;\n opacity: 0.5;\n }\n\n #form > div {\n margin-bottom: 10px;\n }\n\n #form > div:last-child {\n margin-bottom: 0;\n }\n\n .prompt {\n display: flex;\n align-items: center;\n font-size: ${promptFontSize};\n font-weight: ${promptFontWeight};\n }\n\n .prompt > label {\n flex: none;\n cursor: pointer;\n }\n\n .prompt-text {\n text-align: left;\n }\n\n #comments {\n width: 100%;\n height: 50px;\n background-color: #ffffff;\n border: 1px #2c2c2c solid;\n border-radius: 4px;\n padding: 7px;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n resize: none;\n }\n\n #comments::placeholder {\n color: #767676;\n }\n\n #actions {\n display: flex;\n justify-content: center;\n }\n\n .cta-button {\n color: white;\n font-size: 14px;\n border-radius: 4px;\n height: 30px;\n margin: 0;\n }\n\n #cancel-button {\n background-color: ${cancelButtonColor};\n }\n\n #submit-button {\n background-color: ${submitButtonColor};\n margin-left: 10px;\n }\n\n .vote-button {\n background-color: #ffffff;\n border: 1px solid #767676;\n border-radius: 2px;\n padding: 0;\n width: 25px;\n height: 25px;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-left: 10px;\n }\n\n .vote-button svg {\n width: 15px;\n height: 15px;\n }\n\n .vote-button input {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n }\n\n .vote-button.noselection {\n border-color: ${defaultColor};\n }\n\n .vote-button.noselection svg {\n filter: ${defaultColorSvgFilter};\n }\n\n .vote-button.unselected {\n border-color: ${unselectedColor};\n }\n\n .vote-button.unselected svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n .upvote-button.selected {\n border-color: ${upvoteColor};\n }\n\n .upvote-button.selected svg {\n filter: ${upvoteColorSvgFilter};\n }\n\n .downvote-button.selected {\n border-color: ${downvoteColor};\n }\n\n .downvote-button.selected svg {\n filter: ${downvoteColorSvgFilter};\n }\n\n .vote-button.error {\n box-shadow: 0 0 4px red;\n }\n\n form[disabled] .vote-button.unselected {\n cursor: not-allowed;\n }\n\n #comment-button {\n color: var(--ia-theme-link-color, #4b64ff);\n font-weight: ${commentButtonFontWeight};\n font-size: ${commentButtonFontSize};\n }\n #comment-button:not([disabled]):hover,\n #comment-button:not([disabled]):active {\n text-decoration: underline;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback': IAFeatureFeedback;\n }\n}\n"]}
|
|
@@ -8,7 +8,7 @@ import { property, state, query } from 'lit/decorators.js';
|
|
|
8
8
|
import { live } from 'lit/directives/live.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
|
-
import { customElement } from '../../
|
|
11
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
12
12
|
dayjs.extend(customParseFormat);
|
|
13
13
|
dayjs.extend(fixFirstCenturyYears);
|
|
14
14
|
// these values can be overridden via the component's HTML (camelCased) attributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-histogram-date-range.js","sourceRoot":"","sources":["../../../../src/elements/ia-histogram-date-range/ia-histogram-date-range.ts"],"names":[],"mappings":";AAAA,OAAO,uDAAuD,CAAC;AAC/D,OAAO,KAAK,MAAM,WAAW,CAAC;AAC9B,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,GAAG,GAGJ,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAQzD,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAkBnC,kFAAkF;AAClF,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,aA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AElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gEAA4B;AAa5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAA2C;AAM1C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAA8B;AAgB7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA8C;AAGxD;IAAhB,KAAK,EAAE;6DAA6B;AACpB;IAAhB,KAAK,EAAE;6DAA6B;AACpB;IAAhB,KAAK,EAAE;6DAA0C;AACjC;IAAhB,KAAK,EAAE;gEAAqC;AAC5B;IAAhB,KAAK,EAAE;yDAA6B;AACpB;IAAhB,KAAK,EAAE;wDAA4B;AAET;IAA1B,KAAK,CAAC,UAAU,CAAC;sDAAmC;AA8OzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAE1B;AAO4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAE3B;AAQW;IAAX,QAAQ,EAAE;2DAEV;AAsBW;IAAX,QAAQ,EAAE;2DAEV;AAvVU,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAgmChC","sourcesContent":["import '@src/elements/ia-status-indicator/ia-status-indicator';\nimport dayjs from 'dayjs/esm';\nimport customParseFormat from 'dayjs/esm/plugin/customParseFormat';\nimport fixFirstCenturyYears from './plugins/fix-first-century-years';\nimport {\n css,\n html,\n LitElement,\n nothing,\n PropertyValues,\n svg,\n SVGTemplateResult,\n TemplateResult,\n} from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { live } from 'lit/directives/live.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { customElement } from '@src/util/custom-element';\nimport type {\n BarScalingFunction,\n BarScalingOption,\n BarScalingPreset,\n BinSnappingInterval,\n} from './models';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(fixFirstCenturyYears);\n\ntype SliderId = 'slider-min' | 'slider-max';\n\ninterface HistogramItem {\n value: number;\n height: number;\n binStart: string;\n binEnd: string;\n tooltip: string;\n}\n\ninterface BarDataset extends DOMStringMap {\n numItems: string;\n binStart: string;\n binEnd: string;\n}\n\n// these values can be overridden via the component's HTML (camelCased) attributes\nconst WIDTH = 180;\nconst HEIGHT = 40;\nconst SLIDER_WIDTH = 10;\nconst TOOLTIP_WIDTH = 125;\nconst TOOLTIP_HEIGHT = 30;\nconst DATE_FORMAT = 'YYYY';\nconst MISSING_DATA = 'no data';\nconst UPDATE_DEBOUNCE_DELAY_MS = 0;\nconst TOOLTIP_LABEL = 'item';\n\n// this constant is not set up to be overridden\nconst SLIDER_CORNER_SIZE = 4;\n\n/**\n * Map from bar scaling preset options to the corresponding function they represent\n */\nconst BAR_SCALING_PRESET_FNS: Record<BarScalingPreset, BarScalingFunction> = {\n linear: (binValue: number) => binValue,\n logarithmic: (binValue: number) => Math.log1p(binValue),\n};\n\n// these CSS custom props can be overridden from the HTML that is invoking this component\nconst sliderColor = css`var(--histogramDateRangeSliderColor, #4B65FE)`;\nconst selectedRangeColor = css`var(--histogramDateRangeSelectedRangeColor, #DBE0FF)`;\nconst barIncludedFill = css`var(--histogramDateRangeBarIncludedFill, #2C2C2C)`;\nconst activityIndicatorColor = css`var(--histogramDateRangeActivityIndicator, #2C2C2C)`;\nconst barExcludedFill = css`var(--histogramDateRangeBarExcludedFill, #CCCCCC)`;\nconst inputRowMargin = css`var(--histogramDateRangeInputRowMargin, 0)`;\nconst inputBorder = css`var(--histogramDateRangeInputBorder, 0.5px solid #2C2C2C)`;\nconst inputWidth = css`var(--histogramDateRangeInputWidth, 35px)`;\nconst inputFontSize = css`var(--histogramDateRangeInputFontSize, 1.2rem)`;\nconst inputFontFamily = css`var(--histogramDateRangeInputFontFamily, sans-serif)`;\nconst tooltipBackgroundColor = css`var(--histogramDateRangeTooltipBackgroundColor, #2C2C2C)`;\nconst tooltipTextColor = css`var(--histogramDateRangeTooltipTextColor, #FFFFFF)`;\nconst tooltipFontSize = css`var(--histogramDateRangeTooltipFontSize, 1.1rem)`;\nconst tooltipFontFamily = css`var(--histogramDateRangeTooltipFontFamily, sans-serif)`;\n\n@customElement('ia-histogram-date-range')\nexport class IAHistogramDateRange extends LitElement {\n // public reactive properties that can be set via HTML attributes\n @property({ type: Number }) width = WIDTH;\n @property({ type: Number }) height = HEIGHT;\n @property({ type: Number }) sliderWidth = SLIDER_WIDTH;\n @property({ type: Number }) tooltipWidth = TOOLTIP_WIDTH;\n @property({ type: Number }) tooltipHeight = TOOLTIP_HEIGHT;\n @property({ type: Number }) updateDelay = UPDATE_DEBOUNCE_DELAY_MS;\n @property({ type: String }) dateFormat = DATE_FORMAT;\n @property({ type: String }) missingDataMessage = MISSING_DATA;\n @property({ type: String }) minDate = '';\n @property({ type: String }) maxDate = '';\n @property({ type: Boolean }) disabled = false;\n @property({ type: Array }) bins: number[] = [];\n /** If true, update events will not be canceled by the date inputs receiving focus */\n @property({ type: Boolean }) updateWhileFocused = false;\n\n /**\n * What interval bins should be snapped to for determining their time ranges.\n * - `none` (default): Bins should each represent an identical duration of time,\n * without regard for the actual dates represented.\n * - `month`: Bins should each represent one or more full, non-overlapping months.\n * The bin ranges will be \"snapped\" to the nearest month boundaries, which can\n * result in bins that represent different amounts of time, particularly if the\n * provided bins do not evenly divide the provided date range, or if the months\n * represented are of different lengths.\n * - `year`: Same as `month`, but snapping to year boundaries instead of months.\n */\n @property({ type: String }) binSnapping: BinSnappingInterval = 'none';\n\n /**\n * What label to use on tooltips to identify the type of data being represented.\n * Defaults to `'item(s)'`.\n */\n @property({ type: String }) tooltipLabel = TOOLTIP_LABEL;\n\n /**\n * A function or preset value indicating how the height of each bar relates to its\n * corresponding bin value. Current presets available are 'logarithmic' and 'linear',\n * but a custom function may be provided instead if other behavior is desired.\n *\n * The default scaling (`'logarithmic'`) uses the logarithm of each bin value, yielding\n * more prominent bars for smaller values. This ensures that even when the difference\n * between the min & max values is large, small values are unlikely to completely disappear\n * visually. However, the cost is that bars have less noticeable variation among values of\n * a similar magnitude, and their heights are not a direct representation of the bin values.\n *\n * The `'linear'` preset option instead sizes the bars in linear proportion to their bin\n * values.\n */\n @property({ type: String }) barScaling: BarScalingOption = 'logarithmic';\n\n // internal reactive properties not exposed as attributes\n @state() private _tooltipOffsetX = 0;\n @state() private _tooltipOffsetY = 0;\n @state() private _tooltipContent?: TemplateResult;\n @state() private _tooltipDateFormat?: string;\n @state() private _isDragging = false;\n @state() private _isLoading = false;\n\n @query('#tooltip') private _tooltip!: HTMLDivElement;\n\n // non-reactive properties (changes don't auto-trigger re-rendering)\n private _minSelectedDate = '';\n private _maxSelectedDate = '';\n private _minDateMS = 0;\n private _maxDateMS = 0;\n private _dragOffset = 0;\n private _histWidth = 0;\n private _binWidth = 0;\n private _currentSlider?: SVGRectElement;\n private _histData: HistogramItem[] = [];\n private _emitUpdatedEventTimer?: ReturnType<typeof setTimeout>;\n private _previousDateRange = '';\n private _updateDeferredWhileFocused = false;\n\n updated(): void {\n // The UA only hides a closed popover where showPopover() exists. Without\n // it the tooltip would sit on the page whenever it isn't being shown, so\n // hide it the one way that works either way. Not just on first render:\n // the tooltip isn't in the DOM at all until there's data to draw.\n if (this._tooltip && !this._tooltipContent) {\n this._tooltip.hidden = true;\n }\n }\n\n disconnectedCallback(): void {\n this.removeListeners();\n super.disconnectedCallback();\n }\n\n willUpdate(changedProps: PropertyValues): void {\n // check for changes that would affect bin data calculations\n if (\n changedProps.has('bins') ||\n changedProps.has('minDate') ||\n changedProps.has('maxDate') ||\n changedProps.has('minSelectedDate') ||\n changedProps.has('maxSelectedDate') ||\n changedProps.has('width') ||\n changedProps.has('height') ||\n changedProps.has('binSnapping') ||\n changedProps.has('barScaling')\n ) {\n this.handleDataUpdate();\n }\n }\n\n /**\n * Set private properties that depend on the attribute bin data\n *\n * We're caching these values and not using getters to avoid recalculating all\n * of the hist data every time the user drags a slider or hovers over a bar\n * creating a tooltip.\n */\n private handleDataUpdate(): void {\n if (!this.hasBinData) {\n return;\n }\n this._histWidth = this.width - this.sliderWidth * 2;\n\n this._minDateMS = this.snapTimestamp(this.getMSFromString(this.minDate));\n // NB: The max date string, converted as-is to ms, represents the *start* of the\n // final date interval; we want the *end*, so we add any snap interval/offset.\n this._maxDateMS =\n this.snapTimestamp(\n this.getMSFromString(this.maxDate) + this.snapInterval,\n ) + this.snapEndOffset;\n\n this._binWidth = this._histWidth / this._numBins;\n this._histData = this.calculateHistData();\n this.minSelectedDate = this.minSelectedDate\n ? this.minSelectedDate\n : this.minDate;\n this.maxSelectedDate = this.maxSelectedDate\n ? this.maxSelectedDate\n : this.maxDate;\n }\n\n /**\n * Rounds the given timestamp to the next full second.\n */\n private snapToNextSecond(timestamp: number): number {\n return Math.ceil(timestamp / 1000) * 1000;\n }\n\n /**\n * Rounds the given timestamp to the (approximate) nearest start of a month,\n * such that dates up to and including the 15th of the month are rounded down,\n * while dates past the 15th are rounded up.\n */\n private snapToMonth(timestamp: number): number {\n const d = dayjs(timestamp);\n const monthsToAdd = d.date() < 16 ? 0 : 1;\n const snapped = d\n .add(monthsToAdd, 'month')\n .date(1)\n .hour(0)\n .minute(0)\n .second(0)\n .millisecond(0); // First millisecond of the month\n return snapped.valueOf();\n }\n\n /**\n * Rounds the given timestamp to the (approximate) nearest start of a year,\n * such that dates up to the end of June are rounded down, while dates in\n * July or later are rounded up.\n */\n private snapToYear(timestamp: number): number {\n const d = dayjs(timestamp);\n const yearsToAdd = d.month() < 6 ? 0 : 1;\n const snapped = d\n .add(yearsToAdd, 'year')\n .month(0)\n .date(1)\n .hour(0)\n .minute(0)\n .second(0)\n .millisecond(0); // First millisecond of the year\n return snapped.valueOf();\n }\n\n /**\n * Rounds the given timestamp according to the `binSnapping` property.\n * Default is simply to snap to the nearest full second.\n */\n private snapTimestamp(timestamp: number): number {\n switch (this.binSnapping) {\n case 'year':\n return this.snapToYear(timestamp);\n case 'month':\n return this.snapToMonth(timestamp);\n case 'none':\n default:\n // We still align it to second boundaries to resolve minor discrepancies\n return this.snapToNextSecond(timestamp);\n }\n }\n\n /**\n * Function to scale bin values, whether from a preset or a provided custom function.\n */\n private get barScalingFunction(): BarScalingFunction {\n if (typeof this.barScaling === 'string') {\n return BAR_SCALING_PRESET_FNS[this.barScaling];\n }\n\n return this.barScaling;\n }\n\n private calculateHistData(): HistogramItem[] {\n const { bins, height, dateRangeMS, _numBins, _minDateMS } = this;\n const minValue = Math.min(...this.bins);\n const maxValue = Math.max(...this.bins);\n // if there is no difference between the min and max values, use a range of\n // 1 because log scaling will fail if the range is 0\n const valueRange =\n minValue === maxValue ? 1 : this.barScalingFunction(maxValue);\n const valueScale = height / valueRange;\n const dateScale = dateRangeMS / _numBins;\n\n return bins.map((v: number, i: number) => {\n const binStartMS = this.snapTimestamp(i * dateScale + _minDateMS);\n const binStart = this.formatDate(binStartMS);\n\n const binEndMS =\n this.snapTimestamp((i + 1) * dateScale + _minDateMS) +\n this.snapEndOffset;\n const binEnd = this.formatDate(binEndMS);\n\n const tooltipStart = this.formatDate(binStartMS, this.tooltipDateFormat);\n const tooltipEnd = this.formatDate(binEndMS, this.tooltipDateFormat);\n // If start/end are the same, just render a single value\n const tooltip =\n tooltipStart === tooltipEnd\n ? tooltipStart\n : `${tooltipStart} - ${tooltipEnd}`;\n\n return {\n value: v,\n // apply the configured scaling function to the bin value before determining bar height\n height: Math.floor(this.barScalingFunction(v) * valueScale),\n binStart,\n binEnd,\n tooltip,\n };\n });\n }\n\n private get hasBinData(): boolean {\n return this._numBins > 0;\n }\n\n private get _numBins(): number {\n if (!this.bins || !this.bins.length) {\n return 0;\n }\n return this.bins.length;\n }\n\n private get histogramLeftEdgeX(): number {\n return this.sliderWidth;\n }\n\n private get histogramRightEdgeX(): number {\n return this.width - this.sliderWidth;\n }\n\n /**\n * Approximate size in ms of the interval to which bins are snapped.\n */\n private get snapInterval(): number {\n const yearMS = 31_536_000_000; // A 365-day approximation of ms in a year\n const monthMS = 2_592_000_000; // A 30-day approximation of ms in a month\n switch (this.binSnapping) {\n case 'year':\n return yearMS;\n case 'month':\n return monthMS;\n case 'none':\n default:\n return 0;\n }\n }\n\n /**\n * Offset added to the end of each bin to ensure disjoint intervals,\n * depending on whether snapping is enabled and there are multiple bins.\n */\n private get snapEndOffset(): number {\n return this.binSnapping !== 'none' && this._numBins > 1 ? -1 : 0;\n }\n\n /**\n * Optional date format to use for tooltips only.\n * Falls back to `dateFormat` if not provided.\n */\n @property({ type: String }) get tooltipDateFormat(): string {\n return this._tooltipDateFormat ?? this.dateFormat;\n }\n\n set tooltipDateFormat(value: string) {\n this._tooltipDateFormat = value;\n }\n\n /** component's loading (and disabled) state */\n @property({ type: Boolean }) get loading(): boolean {\n return this._isLoading;\n }\n\n set loading(value: boolean) {\n this.disabled = value;\n this._isLoading = value;\n }\n\n /** formatted minimum date of selected date range */\n @property() get minSelectedDate(): string {\n return this.formatDate(this.getMSFromString(this._minSelectedDate));\n }\n\n /** updates minSelectedDate if new date is valid */\n set minSelectedDate(rawDate: string) {\n if (!this._minSelectedDate) {\n // because the values needed to calculate valid max/min values are not\n // available during the lit init when it's populating properties from\n // attributes, fall back to just the raw date if nothing is already set\n this._minSelectedDate = rawDate;\n return;\n }\n const proposedDateMS = this.getMSFromString(rawDate);\n const isValidDate = !Number.isNaN(proposedDateMS);\n const isNotTooRecent =\n proposedDateMS <= this.getMSFromString(this.maxSelectedDate);\n if (isValidDate && isNotTooRecent) {\n this._minSelectedDate = this.formatDate(proposedDateMS);\n }\n this.requestUpdate();\n }\n\n /** formatted maximum date of selected date range */\n @property() get maxSelectedDate(): string {\n return this.formatDate(this.getMSFromString(this._maxSelectedDate));\n }\n\n /** updates maxSelectedDate if new date is valid */\n set maxSelectedDate(rawDate: string) {\n if (!this._maxSelectedDate) {\n // because the values needed to calculate valid max/min values are not\n // available during the lit init when it's populating properties from\n // attributes, fall back to just the raw date if nothing is already set\n this._maxSelectedDate = rawDate;\n return;\n }\n const proposedDateMS = this.getMSFromString(rawDate);\n const isValidDate = !Number.isNaN(proposedDateMS);\n const isNotTooOld =\n proposedDateMS >= this.getMSFromString(this.minSelectedDate);\n if (isValidDate && isNotTooOld) {\n this._maxSelectedDate = this.formatDate(proposedDateMS);\n }\n this.requestUpdate();\n }\n\n /** horizontal position of min date slider */\n get minSliderX(): number {\n const x = this.translateDateToPosition(this.minSelectedDate);\n return this.validMinSliderX(x);\n }\n\n /** horizontal position of max date slider */\n get maxSliderX(): number {\n const maxSelectedDateMS = this.snapTimestamp(\n this.getMSFromString(this.maxSelectedDate) + this.snapInterval,\n );\n const x = this.translateDateToPosition(this.formatDate(maxSelectedDateMS));\n return this.validMaxSliderX(x);\n }\n\n private get dateRangeMS(): number {\n return this._maxDateMS - this._minDateMS;\n }\n\n private showTooltip(e: PointerEvent): void {\n if (this._isDragging || this.disabled) {\n return;\n }\n\n const target = e.currentTarget as SVGRectElement;\n const x = target.x.baseVal.value + this.sliderWidth / 2;\n const dataset = target.dataset as BarDataset;\n const itemsText = `${this.tooltipLabel}${\n dataset.numItems !== '1' ? 's' : ''\n }`;\n const formattedNumItems = Number(dataset.numItems).toLocaleString();\n\n const tooltipPadding = 2;\n const bufferHeight = 9;\n const heightAboveHistogram = bufferHeight + this.tooltipHeight;\n const histogramBounds = this.getBoundingClientRect();\n const barX = histogramBounds.x + x;\n const histogramY = histogramBounds.y;\n\n // Center the tooltip horizontally along the bar\n this._tooltipOffsetX =\n barX -\n tooltipPadding +\n (this._binWidth - this.sliderWidth - this.tooltipWidth) / 2 +\n window.scrollX;\n // Place the tooltip (with arrow) just above the top of the histogram bars\n this._tooltipOffsetY = histogramY - heightAboveHistogram + window.scrollY;\n\n this._tooltipContent = html`\n ${formattedNumItems} ${itemsText}<br />\n ${dataset.tooltip}\n `;\n this._tooltip.hidden = false;\n this._tooltip.showPopover?.();\n }\n\n private hideTooltip(): void {\n this._tooltipContent = undefined;\n this._tooltip.hidden = true;\n this._tooltip.hidePopover?.();\n }\n\n // use arrow functions (rather than standard JS class instance methods) so\n // that `this` is bound to the histogramDateRange object and not the event\n // target. for more info see\n // https://lit-element.polymer-project.org/guide/events#using-this-in-event-listeners\n private drag = (e: PointerEvent): void => {\n // prevent selecting text or other ranges while dragging, especially in Safari\n e.preventDefault();\n if (this.disabled) {\n return;\n }\n this.setDragOffset(e);\n this._isDragging = true;\n this.addListeners();\n this.cancelPendingUpdateEvent();\n };\n\n private drop = (): void => {\n if (this._isDragging) {\n this.removeListeners();\n this.beginEmitUpdateProcess();\n }\n this._isDragging = false;\n };\n\n /**\n * Adjust the date range based on slider movement\n *\n * @param e PointerEvent from the slider being moved\n */\n private move = (e: PointerEvent): void => {\n const histogramClientX = this.getBoundingClientRect().x;\n const newX = e.clientX - histogramClientX - this._dragOffset;\n const slider = this._currentSlider as SVGRectElement;\n if ((slider.id as SliderId) === 'slider-min') {\n this.minSelectedDate = this.translatePositionToDate(\n this.validMinSliderX(newX),\n );\n } else {\n this.maxSelectedDate = this.translatePositionToDate(\n this.validMaxSliderX(newX),\n );\n if (this.getMSFromString(this.maxSelectedDate) > this._maxDateMS) {\n this.maxSelectedDate = this.maxDate;\n }\n }\n };\n\n /**\n * Constrain a proposed value for the minimum (left) slider\n *\n * If the value is less than the leftmost valid position, then set it to the\n * left edge of the histogram (ie the slider width). If the value is greater\n * than the rightmost valid position (the position of the max slider), then\n * set it to the position of the max slider\n */\n private validMinSliderX(newX: number): number {\n // allow the left slider to go right only to the right slider, even if the\n // max selected date is out of range\n const rightLimit = Math.min(\n this.translateDateToPosition(this.maxSelectedDate),\n this.histogramRightEdgeX,\n );\n newX = this.clamp(newX, this.histogramLeftEdgeX, rightLimit);\n const isInvalid =\n Number.isNaN(newX) || rightLimit < this.histogramLeftEdgeX;\n return isInvalid ? this.histogramLeftEdgeX : newX;\n }\n\n /**\n * Constrain a proposed value for the maximum (right) slider\n *\n * If the value is greater than the rightmost valid position, then set it to\n * the right edge of the histogram (ie histogram width - slider width). If the\n * value is less than the leftmost valid position (the position of the min\n * slider), then set it to the position of the min slider\n */\n private validMaxSliderX(newX: number): number {\n // allow the right slider to go left only to the left slider, even if the\n // min selected date is out of range\n const leftLimit = Math.max(\n this.histogramLeftEdgeX,\n this.translateDateToPosition(this.minSelectedDate),\n );\n newX = this.clamp(newX, leftLimit, this.histogramRightEdgeX);\n const isInvalid =\n Number.isNaN(newX) || leftLimit > this.histogramRightEdgeX;\n return isInvalid ? this.histogramRightEdgeX : newX;\n }\n\n private addListeners(): void {\n window.addEventListener('pointermove', this.move);\n window.addEventListener('pointerup', this.drop);\n window.addEventListener('pointercancel', this.drop);\n }\n\n private removeListeners(): void {\n window.removeEventListener('pointermove', this.move);\n window.removeEventListener('pointerup', this.drop);\n window.removeEventListener('pointercancel', this.drop);\n }\n\n /**\n * start a timer to emit an update event. this timer can be canceled (and the\n * event not emitted) if user drags a slider or focuses a date input within\n * the update delay\n */\n private beginEmitUpdateProcess(): void {\n this.cancelPendingUpdateEvent();\n this._updateDeferredWhileFocused = false;\n this._emitUpdatedEventTimer = setTimeout(() => {\n // the timer has run, so there is no longer a pending event to cancel\n this._emitUpdatedEventTimer = undefined;\n if (this.currentDateRangeString === this._previousDateRange) {\n // don't emit duplicate event if no change since last emitted event\n return;\n }\n this._previousDateRange = this.currentDateRangeString;\n const options = {\n detail: {\n minDate: this.minSelectedDate,\n maxDate: this.maxSelectedDate,\n },\n bubbles: true,\n composed: true,\n };\n this.dispatchEvent(new CustomEvent('histogramDateRangeUpdated', options));\n }, this.updateDelay);\n }\n\n /** @returns whether there was a pending update event to cancel */\n private cancelPendingUpdateEvent(): boolean {\n if (this._emitUpdatedEventTimer === undefined) {\n return false;\n }\n clearTimeout(this._emitUpdatedEventTimer);\n this._emitUpdatedEventTimer = undefined;\n return true;\n }\n\n /**\n * find position of pointer in relation to the current slider\n */\n private setDragOffset(e: PointerEvent): void {\n this._currentSlider = e.currentTarget as SVGRectElement;\n const sliderX =\n (this._currentSlider.id as SliderId) === 'slider-min'\n ? this.minSliderX\n : this.maxSliderX;\n const histogramClientX = this.getBoundingClientRect().x;\n this._dragOffset = e.clientX - histogramClientX - sliderX;\n }\n\n /**\n * @param x horizontal position of slider\n * @returns string representation of date\n */\n private translatePositionToDate(x: number): string {\n // Snap to the nearest second, fixing the case where input like 1/1/2010\n // would get translated to 12/31/2009 due to slight discrepancies from\n // pixel boundaries and floating point error.\n const milliseconds = this.snapToNextSecond(\n ((x - this.sliderWidth) * this.dateRangeMS) / this._histWidth,\n );\n return this.formatDate(this._minDateMS + milliseconds);\n }\n\n /**\n * Returns slider x-position corresponding to given date\n *\n * @param date\n * @returns x-position of slider\n */\n private translateDateToPosition(date: string): number {\n const milliseconds = this.getMSFromString(date);\n return (\n this.sliderWidth +\n ((milliseconds - this._minDateMS) * this._histWidth) / this.dateRangeMS\n );\n }\n\n /** ensure that the returned value is between minValue and maxValue */\n private clamp(x: number, minValue: number, maxValue: number): number {\n return Math.min(Math.max(x, minValue), maxValue);\n }\n\n private handleInputFocus(): void {\n if (!this.updateWhileFocused) {\n // Tabbing from one date input to the other lands focus here in between\n // the first input's blur and any chance for its update to be emitted.\n // Remember that so the second input's blur can pick it back up, rather\n // than the typed date never being reported at all.\n this._updateDeferredWhileFocused = this.cancelPendingUpdateEvent();\n }\n }\n\n private handleMinDateInput(e: Event): void {\n const target = e.currentTarget as HTMLInputElement;\n const isChanged = target.value !== this.minSelectedDate;\n if (isChanged) {\n this.minSelectedDate = target.value;\n }\n if (isChanged || this._updateDeferredWhileFocused) {\n this.beginEmitUpdateProcess();\n }\n }\n\n private handleMaxDateInput(e: Event): void {\n const target = e.currentTarget as HTMLInputElement;\n const isChanged = target.value !== this.maxSelectedDate;\n if (isChanged) {\n this.maxSelectedDate = target.value;\n }\n if (isChanged || this._updateDeferredWhileFocused) {\n this.beginEmitUpdateProcess();\n }\n }\n\n private handleKeyUp(e: KeyboardEvent): void {\n if (e.key === 'Enter') {\n const target = e.currentTarget as HTMLInputElement;\n target.blur();\n if (target.id === 'date-min') {\n this.handleMinDateInput(e);\n } else if (target.id === 'date-max') {\n this.handleMaxDateInput(e);\n }\n }\n }\n\n private get currentDateRangeString(): string {\n return `${this.minSelectedDate}:${this.maxSelectedDate}`;\n }\n\n private getMSFromString(date: unknown): number {\n // It's possible that `date` is not a string in certain situations.\n // For instance if you use LitElement bindings and the date is `2000`,\n // it will be treated as a number instead of a string. This just makes sure\n // we're dealing with a string.\n const stringified = typeof date === 'string' ? date : String(date);\n const digitGroupCount = (stringified.split(/(\\d+)/).length - 1) / 2;\n if (digitGroupCount === 1) {\n // if there's just a single set of digits, assume it's a year\n const dateObj = new Date(0, 0); // start at January 1, 1900\n dateObj.setFullYear(Number(stringified)); // override year\n return dateObj.getTime(); // get time in milliseconds\n }\n return dayjs(stringified, [this.dateFormat, DATE_FORMAT]).valueOf();\n }\n\n /**\n * expand or narrow the selected range by moving the slider nearest the\n * clicked bar to the outer edge of the clicked bar\n *\n * @param e Event click event from a histogram bar\n */\n private handleBarClick(e: Event): void {\n const dataset = (e.currentTarget as SVGRectElement).dataset as BarDataset;\n // use the midpoint of the width of the clicked bar to determine which is\n // the nearest slider\n const clickPosition =\n (this.getMSFromString(dataset.binStart) +\n this.getMSFromString(dataset.binEnd)) /\n 2;\n const distanceFromMinSlider = Math.abs(\n clickPosition - this.getMSFromString(this.minSelectedDate),\n );\n const distanceFromMaxSlider = Math.abs(\n clickPosition - this.getMSFromString(this.maxSelectedDate),\n );\n // update the selected range by moving the nearer slider\n if (distanceFromMinSlider < distanceFromMaxSlider) {\n this.minSelectedDate = dataset.binStart;\n } else {\n this.maxSelectedDate = dataset.binEnd;\n }\n this.beginEmitUpdateProcess();\n }\n\n private get minSliderTemplate(): SVGTemplateResult {\n // width/height in pixels of curved part of the sliders (like\n // border-radius); used as part of a SVG quadratic curve. see\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands\n const cs = SLIDER_CORNER_SIZE;\n\n const sliderShape = `\n M${this.minSliderX},0\n h-${this.sliderWidth - cs}\n q-${cs},0 -${cs},${cs}\n v${this.height - cs * 2}\n q0,${cs} ${cs},${cs}\n h${this.sliderWidth - cs}\n `;\n return this.generateSliderSVG(this.minSliderX, 'slider-min', sliderShape);\n }\n\n private get maxSliderTemplate(): SVGTemplateResult {\n const cs = SLIDER_CORNER_SIZE;\n const sliderShape = `\n M${this.maxSliderX},0\n h${this.sliderWidth - cs}\n q${cs},0 ${cs},${cs}\n v${this.height - cs * 2}\n q0,${cs} -${cs},${cs}\n h-${this.sliderWidth - cs}\n `;\n return this.generateSliderSVG(this.maxSliderX, 'slider-max', sliderShape);\n }\n\n private generateSliderSVG(\n sliderPositionX: number,\n id: SliderId,\n sliderShape: string,\n ): SVGTemplateResult {\n // whether the curved part of the slider is facing towards the left (1), ie\n // minimum, or facing towards the right (-1), ie maximum\n const k = id === 'slider-min' ? 1 : -1;\n\n const sliderClasses = classMap({\n slider: true,\n draggable: !this.disabled,\n dragging: this._isDragging,\n });\n\n return svg`\n <svg\n id=${id}\n class=${sliderClasses}\n @pointerdown=${this.drag}\n >\n <path d=\"${sliderShape} z\" fill=\"${sliderColor}\" />\n <rect\n x=\"${\n sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.4 * k\n }\"\n y=\"${this.height / 3}\"\n width=\"1\"\n height=\"${this.height / 3}\"\n fill=\"white\"\n />\n <rect\n x=\"${\n sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.6 * k\n }\"\n y=\"${this.height / 3}\"\n width=\"1\"\n height=\"${this.height / 3}\"\n fill=\"white\"\n />\n </svg>\n `;\n }\n\n get selectedRangeTemplate(): SVGTemplateResult {\n return svg`\n <rect\n x=\"${this.minSliderX}\"\n y=\"0\"\n width=\"${this.maxSliderX - this.minSliderX}\"\n height=\"${this.height}\"\n fill=\"${selectedRangeColor}\"\n />`;\n }\n\n get histogramTemplate(): SVGTemplateResult[] {\n const xScale = this._histWidth / this._numBins;\n const barWidth = xScale - 1;\n let x = this.sliderWidth; // start at the left edge of the histogram\n\n return this._histData.map((data) => {\n const { minSelectedDate, maxSelectedDate } = this;\n const barHeight = data.height;\n\n const binIsBeforeMin = this.isBefore(data.binEnd, minSelectedDate);\n const binIsAfterMax = this.isAfter(data.binStart, maxSelectedDate);\n const barFill =\n binIsBeforeMin || binIsAfterMax ? barExcludedFill : barIncludedFill;\n\n // the stroke-dasharray style below creates a transparent border around the\n // right edge of the bar, which prevents user from encountering a gap\n // between adjacent bars (eg when viewing the tooltips or when trying to\n // extend the range by clicking on a bar)\n const barStyle = `stroke-dasharray: 0 ${barWidth} ${barHeight} ${barWidth} 0 ${barHeight}`;\n\n const bar = svg`\n <rect\n class=\"bar-pointer-target\"\n x=${x}\n y=\"0\"\n width=${barWidth}\n height=${this.height}\n @pointerenter=${this.showTooltip}\n @pointerleave=${this.hideTooltip}\n @click=${this.handleBarClick}\n fill=\"transparent\"\n data-num-items=${data.value}\n data-bin-start=${data.binStart}\n data-bin-end=${data.binEnd}\n data-tooltip=${data.tooltip}\n />\n <rect\n class=\"bar\"\n style=${barStyle}\n x=${x}\n y=${this.height - barHeight}\n width=${barWidth}\n height=${barHeight}\n fill=${barFill}\n />`;\n x += xScale;\n return bar;\n });\n }\n\n /** Whether the first arg represents a date strictly before the second arg */\n private isBefore(date1: string, date2: string): boolean {\n const date1MS = this.getMSFromString(date1);\n const date2MS = this.getMSFromString(date2);\n return date1MS < date2MS;\n }\n\n /** Whether the first arg represents a date strictly after the second arg */\n private isAfter(date1: string, date2: string): boolean {\n const date1MS = this.getMSFromString(date1);\n const date2MS = this.getMSFromString(date2);\n return date1MS > date2MS;\n }\n\n private formatDate(dateMS: number, format: string = this.dateFormat): string {\n if (Number.isNaN(dateMS)) {\n return '';\n }\n const date = dayjs(dateMS);\n if (date.year() < 1000) {\n // years before 1000 don't play well with dayjs custom formatting, so work around dayjs\n // by setting the year to a sentinel value and then replacing it instead.\n // this is a bit hacky but it does the trick for essentially all reasonable cases\n // until such time as we replace dayjs.\n const tmpDate = date.year(199999);\n return tmpDate.format(format).replace(/199999/g, date.year().toString());\n }\n return date.format(format);\n }\n\n /**\n * NOTE: we are relying on the lit `live` directive in the template to\n * ensure that the change to minSelectedDate is noticed and the input value\n * gets properly re-rendered. see\n * https://lit.dev/docs/templates/directives/#live\n */\n get minInputTemplate(): TemplateResult {\n return html`\n <input\n id=\"date-min\"\n placeholder=${this.dateFormat}\n type=\"text\"\n @focus=${this.handleInputFocus}\n @blur=${this.handleMinDateInput}\n @keyup=${this.handleKeyUp}\n .value=${live(this.minSelectedDate)}\n ?disabled=${this.disabled}\n />\n `;\n }\n\n get maxInputTemplate(): TemplateResult {\n return html`\n <input\n id=\"date-max\"\n placeholder=${this.dateFormat}\n type=\"text\"\n @focus=${this.handleInputFocus}\n @blur=${this.handleMaxDateInput}\n @keyup=${this.handleKeyUp}\n .value=${live(this.maxSelectedDate)}\n ?disabled=${this.disabled}\n />\n `;\n }\n\n get minLabelTemplate(): TemplateResult {\n return html`<label for=\"date-min\" class=\"sr-only\">Minimum date:</label>`;\n }\n\n get maxLabelTemplate(): TemplateResult {\n return html`<label for=\"date-max\" class=\"sr-only\">Maximum date:</label>`;\n }\n\n get tooltipTemplate(): TemplateResult {\n const styles = styleMap({\n width: `${this.tooltipWidth}px`,\n height: `${this.tooltipHeight}px`,\n top: `${this._tooltipOffsetY}px`,\n left: `${this._tooltipOffsetX}px`,\n });\n\n return html`\n <div id=\"tooltip\" style=${styles} popover>${this._tooltipContent}</div>\n `;\n }\n\n private get histogramAccessibilityTemplate(): TemplateResult {\n let rangeText: string = '';\n if (this.minSelectedDate && this.maxSelectedDate) {\n rangeText = ` from ${this.minSelectedDate} to ${this.maxSelectedDate}`;\n } else if (this.minSelectedDate) {\n rangeText = ` from ${this.minSelectedDate}`;\n } else if (this.maxSelectedDate) {\n rangeText = ` up to ${this.maxSelectedDate}`;\n }\n\n const titleText = `Filter results for dates${rangeText}`;\n const descText = `This histogram shows the distribution of dates${rangeText}`;\n\n return html`<title id=\"histogram-title\">${titleText}</title\n ><desc id=\"histogram-desc\">${descText}</desc>`;\n }\n\n private get noDataTemplate(): TemplateResult {\n return html`\n <div class=\"missing-data-message\">${this.missingDataMessage}</div>\n `;\n }\n\n private get activityIndicatorTemplate(): TemplateResult | typeof nothing {\n if (!this.loading) {\n return nothing;\n }\n return html`\n <ia-status-indicator mode=\"loading\" ?hideDots=${true}>\n </ia-status-indicator>\n `;\n }\n\n static styles = css`\n .missing-data-message {\n text-align: center;\n }\n #container {\n margin: 0;\n touch-action: none;\n position: relative;\n }\n .disabled {\n opacity: 0.3;\n }\n ia-status-indicator {\n position: absolute;\n left: calc(50% - 10px);\n top: 10px;\n --icon-width: 20px;\n --loading-ring-color--: ${activityIndicatorColor};\n }\n\n /* prevent selection from interfering with tooltip, especially on mobile */\n /* https://stackoverflow.com/a/4407335/1163042 */\n .noselect {\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* current Chrome, Edge, Opera and Firefox */\n }\n .bar,\n .bar-pointer-target {\n /* create a transparent border around the hist bars to prevent \"gaps\" and\n flickering when moving around between bars. this also helps with handling\n clicks on the bars, preventing users from being able to click in between\n bars */\n stroke: rgba(0, 0, 0, 0);\n /* ensure transparent stroke wide enough to cover gap between bars */\n stroke-width: 2px;\n }\n .bar {\n /* ensure the bar's pointer target receives events, not the bar itself */\n pointer-events: none;\n }\n .bar-pointer-target:hover + .bar {\n /* highlight currently hovered bar */\n fill-opacity: 0.7;\n }\n .disabled .bar-pointer-target:hover + .bar {\n /* ensure no visual hover interaction when disabled */\n fill-opacity: 1;\n }\n /****** histogram ********/\n #tooltip {\n position: absolute;\n background: ${tooltipBackgroundColor};\n margin: 0;\n border: 0;\n color: ${tooltipTextColor};\n text-align: center;\n border-radius: 3px;\n padding: 2px;\n font-size: ${tooltipFontSize};\n font-family: ${tooltipFontFamily};\n touch-action: none;\n pointer-events: none;\n overflow: visible;\n }\n #tooltip:after {\n content: '';\n position: absolute;\n margin-left: -5px;\n top: 100%;\n left: 50%;\n /* arrow */\n border: 5px solid ${tooltipTextColor};\n border-color: ${tooltipBackgroundColor} transparent transparent\n transparent;\n }\n /****** slider ********/\n .slider {\n shape-rendering: crispEdges; /* So the slider doesn't get blurry if dragged between pixels */\n }\n .draggable:hover {\n cursor: grab;\n }\n .dragging {\n cursor: grabbing !important;\n }\n /****** inputs ********/\n #inputs {\n display: flex;\n justify-content: center;\n margin: ${inputRowMargin};\n }\n #inputs .dash {\n position: relative;\n bottom: -1px;\n align-self: center; /* Otherwise the dash sticks to the top while the inputs grow */\n }\n input {\n width: ${inputWidth};\n margin: 0 3px;\n border: ${inputBorder};\n border-radius: 2px !important;\n text-align: center;\n font-size: ${inputFontSize};\n font-family: ${inputFontFamily};\n }\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n }\n `;\n\n render(): TemplateResult {\n if (!this.hasBinData) {\n return this.noDataTemplate;\n }\n return html`\n <div\n id=\"container\"\n class=\"\n noselect\n ${this._isDragging ? 'dragging' : ''}\n \"\n style=\"width: ${this.width}px\"\n >\n ${this.activityIndicatorTemplate} ${this.tooltipTemplate}\n <div\n class=\"inner-container\n ${this.disabled ? 'disabled' : ''}\"\n >\n <svg\n width=\"${this.width}\"\n height=\"${this.height}\"\n aria-labelledby=\"histogram-title histogram-desc\"\n @pointerleave=\"${this.drop}\"\n >\n ${this.histogramAccessibilityTemplate} ${this.selectedRangeTemplate}\n <svg id=\"histogram\">${this.histogramTemplate}</svg>\n ${this.minSliderTemplate} ${this.maxSliderTemplate}\n </svg>\n <div id=\"inputs\">\n ${this.minLabelTemplate} ${this.minInputTemplate}\n <div class=\"dash\">-</div>\n ${this.maxLabelTemplate} ${this.maxInputTemplate}\n <slot name=\"inputs-right-side\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-histogram-date-range': IAHistogramDateRange;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-histogram-date-range.js","sourceRoot":"","sources":["../../../../src/elements/ia-histogram-date-range/ia-histogram-date-range.ts"],"names":[],"mappings":";AAAA,OAAO,uDAAuD,CAAC;AAC/D,OAAO,KAAK,MAAM,WAAW,CAAC;AAC9B,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,GAAG,GAGJ,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAQ1D,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAkBnC,kFAAkF;AAClF,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,YAAY,GAAG,SAAS,CAA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AQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAqB;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gEAA4B;AAa5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAA2C;AAM1C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAA8B;AAgB7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA8C;AAGxD;IAAhB,KAAK,EAAE;6DAA6B;AACpB;IAAhB,KAAK,EAAE;6DAA6B;AACpB;IAAhB,KAAK,EAAE;6DAA0C;AACjC;IAAhB,KAAK,EAAE;gEAAqC;AAC5B;IAAhB,KAAK,EAAE;yDAA6B;AACpB;IAAhB,KAAK,EAAE;wDAA4B;AAET;IAA1B,KAAK,CAAC,UAAU,CAAC;sDAAmC;AA8OzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAE1B;AAO4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAE3B;AAQW;IAAX,QAAQ,EAAE;2DAEV;AAsBW;IAAX,QAAQ,EAAE;2DAEV;AAvVU,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAgmChC","sourcesContent":["import '@src/elements/ia-status-indicator/ia-status-indicator';\nimport dayjs from 'dayjs/esm';\nimport customParseFormat from 'dayjs/esm/plugin/customParseFormat';\nimport fixFirstCenturyYears from './plugins/fix-first-century-years';\nimport {\n css,\n html,\n LitElement,\n nothing,\n PropertyValues,\n svg,\n SVGTemplateResult,\n TemplateResult,\n} from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { live } from 'lit/directives/live.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { customElement } from '@src/utils/custom-element';\nimport type {\n BarScalingFunction,\n BarScalingOption,\n BarScalingPreset,\n BinSnappingInterval,\n} from './models';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(fixFirstCenturyYears);\n\ntype SliderId = 'slider-min' | 'slider-max';\n\ninterface HistogramItem {\n value: number;\n height: number;\n binStart: string;\n binEnd: string;\n tooltip: string;\n}\n\ninterface BarDataset extends DOMStringMap {\n numItems: string;\n binStart: string;\n binEnd: string;\n}\n\n// these values can be overridden via the component's HTML (camelCased) attributes\nconst WIDTH = 180;\nconst HEIGHT = 40;\nconst SLIDER_WIDTH = 10;\nconst TOOLTIP_WIDTH = 125;\nconst TOOLTIP_HEIGHT = 30;\nconst DATE_FORMAT = 'YYYY';\nconst MISSING_DATA = 'no data';\nconst UPDATE_DEBOUNCE_DELAY_MS = 0;\nconst TOOLTIP_LABEL = 'item';\n\n// this constant is not set up to be overridden\nconst SLIDER_CORNER_SIZE = 4;\n\n/**\n * Map from bar scaling preset options to the corresponding function they represent\n */\nconst BAR_SCALING_PRESET_FNS: Record<BarScalingPreset, BarScalingFunction> = {\n linear: (binValue: number) => binValue,\n logarithmic: (binValue: number) => Math.log1p(binValue),\n};\n\n// these CSS custom props can be overridden from the HTML that is invoking this component\nconst sliderColor = css`var(--histogramDateRangeSliderColor, #4B65FE)`;\nconst selectedRangeColor = css`var(--histogramDateRangeSelectedRangeColor, #DBE0FF)`;\nconst barIncludedFill = css`var(--histogramDateRangeBarIncludedFill, #2C2C2C)`;\nconst activityIndicatorColor = css`var(--histogramDateRangeActivityIndicator, #2C2C2C)`;\nconst barExcludedFill = css`var(--histogramDateRangeBarExcludedFill, #CCCCCC)`;\nconst inputRowMargin = css`var(--histogramDateRangeInputRowMargin, 0)`;\nconst inputBorder = css`var(--histogramDateRangeInputBorder, 0.5px solid #2C2C2C)`;\nconst inputWidth = css`var(--histogramDateRangeInputWidth, 35px)`;\nconst inputFontSize = css`var(--histogramDateRangeInputFontSize, 1.2rem)`;\nconst inputFontFamily = css`var(--histogramDateRangeInputFontFamily, sans-serif)`;\nconst tooltipBackgroundColor = css`var(--histogramDateRangeTooltipBackgroundColor, #2C2C2C)`;\nconst tooltipTextColor = css`var(--histogramDateRangeTooltipTextColor, #FFFFFF)`;\nconst tooltipFontSize = css`var(--histogramDateRangeTooltipFontSize, 1.1rem)`;\nconst tooltipFontFamily = css`var(--histogramDateRangeTooltipFontFamily, sans-serif)`;\n\n@customElement('ia-histogram-date-range')\nexport class IAHistogramDateRange extends LitElement {\n // public reactive properties that can be set via HTML attributes\n @property({ type: Number }) width = WIDTH;\n @property({ type: Number }) height = HEIGHT;\n @property({ type: Number }) sliderWidth = SLIDER_WIDTH;\n @property({ type: Number }) tooltipWidth = TOOLTIP_WIDTH;\n @property({ type: Number }) tooltipHeight = TOOLTIP_HEIGHT;\n @property({ type: Number }) updateDelay = UPDATE_DEBOUNCE_DELAY_MS;\n @property({ type: String }) dateFormat = DATE_FORMAT;\n @property({ type: String }) missingDataMessage = MISSING_DATA;\n @property({ type: String }) minDate = '';\n @property({ type: String }) maxDate = '';\n @property({ type: Boolean }) disabled = false;\n @property({ type: Array }) bins: number[] = [];\n /** If true, update events will not be canceled by the date inputs receiving focus */\n @property({ type: Boolean }) updateWhileFocused = false;\n\n /**\n * What interval bins should be snapped to for determining their time ranges.\n * - `none` (default): Bins should each represent an identical duration of time,\n * without regard for the actual dates represented.\n * - `month`: Bins should each represent one or more full, non-overlapping months.\n * The bin ranges will be \"snapped\" to the nearest month boundaries, which can\n * result in bins that represent different amounts of time, particularly if the\n * provided bins do not evenly divide the provided date range, or if the months\n * represented are of different lengths.\n * - `year`: Same as `month`, but snapping to year boundaries instead of months.\n */\n @property({ type: String }) binSnapping: BinSnappingInterval = 'none';\n\n /**\n * What label to use on tooltips to identify the type of data being represented.\n * Defaults to `'item(s)'`.\n */\n @property({ type: String }) tooltipLabel = TOOLTIP_LABEL;\n\n /**\n * A function or preset value indicating how the height of each bar relates to its\n * corresponding bin value. Current presets available are 'logarithmic' and 'linear',\n * but a custom function may be provided instead if other behavior is desired.\n *\n * The default scaling (`'logarithmic'`) uses the logarithm of each bin value, yielding\n * more prominent bars for smaller values. This ensures that even when the difference\n * between the min & max values is large, small values are unlikely to completely disappear\n * visually. However, the cost is that bars have less noticeable variation among values of\n * a similar magnitude, and their heights are not a direct representation of the bin values.\n *\n * The `'linear'` preset option instead sizes the bars in linear proportion to their bin\n * values.\n */\n @property({ type: String }) barScaling: BarScalingOption = 'logarithmic';\n\n // internal reactive properties not exposed as attributes\n @state() private _tooltipOffsetX = 0;\n @state() private _tooltipOffsetY = 0;\n @state() private _tooltipContent?: TemplateResult;\n @state() private _tooltipDateFormat?: string;\n @state() private _isDragging = false;\n @state() private _isLoading = false;\n\n @query('#tooltip') private _tooltip!: HTMLDivElement;\n\n // non-reactive properties (changes don't auto-trigger re-rendering)\n private _minSelectedDate = '';\n private _maxSelectedDate = '';\n private _minDateMS = 0;\n private _maxDateMS = 0;\n private _dragOffset = 0;\n private _histWidth = 0;\n private _binWidth = 0;\n private _currentSlider?: SVGRectElement;\n private _histData: HistogramItem[] = [];\n private _emitUpdatedEventTimer?: ReturnType<typeof setTimeout>;\n private _previousDateRange = '';\n private _updateDeferredWhileFocused = false;\n\n updated(): void {\n // The UA only hides a closed popover where showPopover() exists. Without\n // it the tooltip would sit on the page whenever it isn't being shown, so\n // hide it the one way that works either way. Not just on first render:\n // the tooltip isn't in the DOM at all until there's data to draw.\n if (this._tooltip && !this._tooltipContent) {\n this._tooltip.hidden = true;\n }\n }\n\n disconnectedCallback(): void {\n this.removeListeners();\n super.disconnectedCallback();\n }\n\n willUpdate(changedProps: PropertyValues): void {\n // check for changes that would affect bin data calculations\n if (\n changedProps.has('bins') ||\n changedProps.has('minDate') ||\n changedProps.has('maxDate') ||\n changedProps.has('minSelectedDate') ||\n changedProps.has('maxSelectedDate') ||\n changedProps.has('width') ||\n changedProps.has('height') ||\n changedProps.has('binSnapping') ||\n changedProps.has('barScaling')\n ) {\n this.handleDataUpdate();\n }\n }\n\n /**\n * Set private properties that depend on the attribute bin data\n *\n * We're caching these values and not using getters to avoid recalculating all\n * of the hist data every time the user drags a slider or hovers over a bar\n * creating a tooltip.\n */\n private handleDataUpdate(): void {\n if (!this.hasBinData) {\n return;\n }\n this._histWidth = this.width - this.sliderWidth * 2;\n\n this._minDateMS = this.snapTimestamp(this.getMSFromString(this.minDate));\n // NB: The max date string, converted as-is to ms, represents the *start* of the\n // final date interval; we want the *end*, so we add any snap interval/offset.\n this._maxDateMS =\n this.snapTimestamp(\n this.getMSFromString(this.maxDate) + this.snapInterval,\n ) + this.snapEndOffset;\n\n this._binWidth = this._histWidth / this._numBins;\n this._histData = this.calculateHistData();\n this.minSelectedDate = this.minSelectedDate\n ? this.minSelectedDate\n : this.minDate;\n this.maxSelectedDate = this.maxSelectedDate\n ? this.maxSelectedDate\n : this.maxDate;\n }\n\n /**\n * Rounds the given timestamp to the next full second.\n */\n private snapToNextSecond(timestamp: number): number {\n return Math.ceil(timestamp / 1000) * 1000;\n }\n\n /**\n * Rounds the given timestamp to the (approximate) nearest start of a month,\n * such that dates up to and including the 15th of the month are rounded down,\n * while dates past the 15th are rounded up.\n */\n private snapToMonth(timestamp: number): number {\n const d = dayjs(timestamp);\n const monthsToAdd = d.date() < 16 ? 0 : 1;\n const snapped = d\n .add(monthsToAdd, 'month')\n .date(1)\n .hour(0)\n .minute(0)\n .second(0)\n .millisecond(0); // First millisecond of the month\n return snapped.valueOf();\n }\n\n /**\n * Rounds the given timestamp to the (approximate) nearest start of a year,\n * such that dates up to the end of June are rounded down, while dates in\n * July or later are rounded up.\n */\n private snapToYear(timestamp: number): number {\n const d = dayjs(timestamp);\n const yearsToAdd = d.month() < 6 ? 0 : 1;\n const snapped = d\n .add(yearsToAdd, 'year')\n .month(0)\n .date(1)\n .hour(0)\n .minute(0)\n .second(0)\n .millisecond(0); // First millisecond of the year\n return snapped.valueOf();\n }\n\n /**\n * Rounds the given timestamp according to the `binSnapping` property.\n * Default is simply to snap to the nearest full second.\n */\n private snapTimestamp(timestamp: number): number {\n switch (this.binSnapping) {\n case 'year':\n return this.snapToYear(timestamp);\n case 'month':\n return this.snapToMonth(timestamp);\n case 'none':\n default:\n // We still align it to second boundaries to resolve minor discrepancies\n return this.snapToNextSecond(timestamp);\n }\n }\n\n /**\n * Function to scale bin values, whether from a preset or a provided custom function.\n */\n private get barScalingFunction(): BarScalingFunction {\n if (typeof this.barScaling === 'string') {\n return BAR_SCALING_PRESET_FNS[this.barScaling];\n }\n\n return this.barScaling;\n }\n\n private calculateHistData(): HistogramItem[] {\n const { bins, height, dateRangeMS, _numBins, _minDateMS } = this;\n const minValue = Math.min(...this.bins);\n const maxValue = Math.max(...this.bins);\n // if there is no difference between the min and max values, use a range of\n // 1 because log scaling will fail if the range is 0\n const valueRange =\n minValue === maxValue ? 1 : this.barScalingFunction(maxValue);\n const valueScale = height / valueRange;\n const dateScale = dateRangeMS / _numBins;\n\n return bins.map((v: number, i: number) => {\n const binStartMS = this.snapTimestamp(i * dateScale + _minDateMS);\n const binStart = this.formatDate(binStartMS);\n\n const binEndMS =\n this.snapTimestamp((i + 1) * dateScale + _minDateMS) +\n this.snapEndOffset;\n const binEnd = this.formatDate(binEndMS);\n\n const tooltipStart = this.formatDate(binStartMS, this.tooltipDateFormat);\n const tooltipEnd = this.formatDate(binEndMS, this.tooltipDateFormat);\n // If start/end are the same, just render a single value\n const tooltip =\n tooltipStart === tooltipEnd\n ? tooltipStart\n : `${tooltipStart} - ${tooltipEnd}`;\n\n return {\n value: v,\n // apply the configured scaling function to the bin value before determining bar height\n height: Math.floor(this.barScalingFunction(v) * valueScale),\n binStart,\n binEnd,\n tooltip,\n };\n });\n }\n\n private get hasBinData(): boolean {\n return this._numBins > 0;\n }\n\n private get _numBins(): number {\n if (!this.bins || !this.bins.length) {\n return 0;\n }\n return this.bins.length;\n }\n\n private get histogramLeftEdgeX(): number {\n return this.sliderWidth;\n }\n\n private get histogramRightEdgeX(): number {\n return this.width - this.sliderWidth;\n }\n\n /**\n * Approximate size in ms of the interval to which bins are snapped.\n */\n private get snapInterval(): number {\n const yearMS = 31_536_000_000; // A 365-day approximation of ms in a year\n const monthMS = 2_592_000_000; // A 30-day approximation of ms in a month\n switch (this.binSnapping) {\n case 'year':\n return yearMS;\n case 'month':\n return monthMS;\n case 'none':\n default:\n return 0;\n }\n }\n\n /**\n * Offset added to the end of each bin to ensure disjoint intervals,\n * depending on whether snapping is enabled and there are multiple bins.\n */\n private get snapEndOffset(): number {\n return this.binSnapping !== 'none' && this._numBins > 1 ? -1 : 0;\n }\n\n /**\n * Optional date format to use for tooltips only.\n * Falls back to `dateFormat` if not provided.\n */\n @property({ type: String }) get tooltipDateFormat(): string {\n return this._tooltipDateFormat ?? this.dateFormat;\n }\n\n set tooltipDateFormat(value: string) {\n this._tooltipDateFormat = value;\n }\n\n /** component's loading (and disabled) state */\n @property({ type: Boolean }) get loading(): boolean {\n return this._isLoading;\n }\n\n set loading(value: boolean) {\n this.disabled = value;\n this._isLoading = value;\n }\n\n /** formatted minimum date of selected date range */\n @property() get minSelectedDate(): string {\n return this.formatDate(this.getMSFromString(this._minSelectedDate));\n }\n\n /** updates minSelectedDate if new date is valid */\n set minSelectedDate(rawDate: string) {\n if (!this._minSelectedDate) {\n // because the values needed to calculate valid max/min values are not\n // available during the lit init when it's populating properties from\n // attributes, fall back to just the raw date if nothing is already set\n this._minSelectedDate = rawDate;\n return;\n }\n const proposedDateMS = this.getMSFromString(rawDate);\n const isValidDate = !Number.isNaN(proposedDateMS);\n const isNotTooRecent =\n proposedDateMS <= this.getMSFromString(this.maxSelectedDate);\n if (isValidDate && isNotTooRecent) {\n this._minSelectedDate = this.formatDate(proposedDateMS);\n }\n this.requestUpdate();\n }\n\n /** formatted maximum date of selected date range */\n @property() get maxSelectedDate(): string {\n return this.formatDate(this.getMSFromString(this._maxSelectedDate));\n }\n\n /** updates maxSelectedDate if new date is valid */\n set maxSelectedDate(rawDate: string) {\n if (!this._maxSelectedDate) {\n // because the values needed to calculate valid max/min values are not\n // available during the lit init when it's populating properties from\n // attributes, fall back to just the raw date if nothing is already set\n this._maxSelectedDate = rawDate;\n return;\n }\n const proposedDateMS = this.getMSFromString(rawDate);\n const isValidDate = !Number.isNaN(proposedDateMS);\n const isNotTooOld =\n proposedDateMS >= this.getMSFromString(this.minSelectedDate);\n if (isValidDate && isNotTooOld) {\n this._maxSelectedDate = this.formatDate(proposedDateMS);\n }\n this.requestUpdate();\n }\n\n /** horizontal position of min date slider */\n get minSliderX(): number {\n const x = this.translateDateToPosition(this.minSelectedDate);\n return this.validMinSliderX(x);\n }\n\n /** horizontal position of max date slider */\n get maxSliderX(): number {\n const maxSelectedDateMS = this.snapTimestamp(\n this.getMSFromString(this.maxSelectedDate) + this.snapInterval,\n );\n const x = this.translateDateToPosition(this.formatDate(maxSelectedDateMS));\n return this.validMaxSliderX(x);\n }\n\n private get dateRangeMS(): number {\n return this._maxDateMS - this._minDateMS;\n }\n\n private showTooltip(e: PointerEvent): void {\n if (this._isDragging || this.disabled) {\n return;\n }\n\n const target = e.currentTarget as SVGRectElement;\n const x = target.x.baseVal.value + this.sliderWidth / 2;\n const dataset = target.dataset as BarDataset;\n const itemsText = `${this.tooltipLabel}${\n dataset.numItems !== '1' ? 's' : ''\n }`;\n const formattedNumItems = Number(dataset.numItems).toLocaleString();\n\n const tooltipPadding = 2;\n const bufferHeight = 9;\n const heightAboveHistogram = bufferHeight + this.tooltipHeight;\n const histogramBounds = this.getBoundingClientRect();\n const barX = histogramBounds.x + x;\n const histogramY = histogramBounds.y;\n\n // Center the tooltip horizontally along the bar\n this._tooltipOffsetX =\n barX -\n tooltipPadding +\n (this._binWidth - this.sliderWidth - this.tooltipWidth) / 2 +\n window.scrollX;\n // Place the tooltip (with arrow) just above the top of the histogram bars\n this._tooltipOffsetY = histogramY - heightAboveHistogram + window.scrollY;\n\n this._tooltipContent = html`\n ${formattedNumItems} ${itemsText}<br />\n ${dataset.tooltip}\n `;\n this._tooltip.hidden = false;\n this._tooltip.showPopover?.();\n }\n\n private hideTooltip(): void {\n this._tooltipContent = undefined;\n this._tooltip.hidden = true;\n this._tooltip.hidePopover?.();\n }\n\n // use arrow functions (rather than standard JS class instance methods) so\n // that `this` is bound to the histogramDateRange object and not the event\n // target. for more info see\n // https://lit-element.polymer-project.org/guide/events#using-this-in-event-listeners\n private drag = (e: PointerEvent): void => {\n // prevent selecting text or other ranges while dragging, especially in Safari\n e.preventDefault();\n if (this.disabled) {\n return;\n }\n this.setDragOffset(e);\n this._isDragging = true;\n this.addListeners();\n this.cancelPendingUpdateEvent();\n };\n\n private drop = (): void => {\n if (this._isDragging) {\n this.removeListeners();\n this.beginEmitUpdateProcess();\n }\n this._isDragging = false;\n };\n\n /**\n * Adjust the date range based on slider movement\n *\n * @param e PointerEvent from the slider being moved\n */\n private move = (e: PointerEvent): void => {\n const histogramClientX = this.getBoundingClientRect().x;\n const newX = e.clientX - histogramClientX - this._dragOffset;\n const slider = this._currentSlider as SVGRectElement;\n if ((slider.id as SliderId) === 'slider-min') {\n this.minSelectedDate = this.translatePositionToDate(\n this.validMinSliderX(newX),\n );\n } else {\n this.maxSelectedDate = this.translatePositionToDate(\n this.validMaxSliderX(newX),\n );\n if (this.getMSFromString(this.maxSelectedDate) > this._maxDateMS) {\n this.maxSelectedDate = this.maxDate;\n }\n }\n };\n\n /**\n * Constrain a proposed value for the minimum (left) slider\n *\n * If the value is less than the leftmost valid position, then set it to the\n * left edge of the histogram (ie the slider width). If the value is greater\n * than the rightmost valid position (the position of the max slider), then\n * set it to the position of the max slider\n */\n private validMinSliderX(newX: number): number {\n // allow the left slider to go right only to the right slider, even if the\n // max selected date is out of range\n const rightLimit = Math.min(\n this.translateDateToPosition(this.maxSelectedDate),\n this.histogramRightEdgeX,\n );\n newX = this.clamp(newX, this.histogramLeftEdgeX, rightLimit);\n const isInvalid =\n Number.isNaN(newX) || rightLimit < this.histogramLeftEdgeX;\n return isInvalid ? this.histogramLeftEdgeX : newX;\n }\n\n /**\n * Constrain a proposed value for the maximum (right) slider\n *\n * If the value is greater than the rightmost valid position, then set it to\n * the right edge of the histogram (ie histogram width - slider width). If the\n * value is less than the leftmost valid position (the position of the min\n * slider), then set it to the position of the min slider\n */\n private validMaxSliderX(newX: number): number {\n // allow the right slider to go left only to the left slider, even if the\n // min selected date is out of range\n const leftLimit = Math.max(\n this.histogramLeftEdgeX,\n this.translateDateToPosition(this.minSelectedDate),\n );\n newX = this.clamp(newX, leftLimit, this.histogramRightEdgeX);\n const isInvalid =\n Number.isNaN(newX) || leftLimit > this.histogramRightEdgeX;\n return isInvalid ? this.histogramRightEdgeX : newX;\n }\n\n private addListeners(): void {\n window.addEventListener('pointermove', this.move);\n window.addEventListener('pointerup', this.drop);\n window.addEventListener('pointercancel', this.drop);\n }\n\n private removeListeners(): void {\n window.removeEventListener('pointermove', this.move);\n window.removeEventListener('pointerup', this.drop);\n window.removeEventListener('pointercancel', this.drop);\n }\n\n /**\n * start a timer to emit an update event. this timer can be canceled (and the\n * event not emitted) if user drags a slider or focuses a date input within\n * the update delay\n */\n private beginEmitUpdateProcess(): void {\n this.cancelPendingUpdateEvent();\n this._updateDeferredWhileFocused = false;\n this._emitUpdatedEventTimer = setTimeout(() => {\n // the timer has run, so there is no longer a pending event to cancel\n this._emitUpdatedEventTimer = undefined;\n if (this.currentDateRangeString === this._previousDateRange) {\n // don't emit duplicate event if no change since last emitted event\n return;\n }\n this._previousDateRange = this.currentDateRangeString;\n const options = {\n detail: {\n minDate: this.minSelectedDate,\n maxDate: this.maxSelectedDate,\n },\n bubbles: true,\n composed: true,\n };\n this.dispatchEvent(new CustomEvent('histogramDateRangeUpdated', options));\n }, this.updateDelay);\n }\n\n /** @returns whether there was a pending update event to cancel */\n private cancelPendingUpdateEvent(): boolean {\n if (this._emitUpdatedEventTimer === undefined) {\n return false;\n }\n clearTimeout(this._emitUpdatedEventTimer);\n this._emitUpdatedEventTimer = undefined;\n return true;\n }\n\n /**\n * find position of pointer in relation to the current slider\n */\n private setDragOffset(e: PointerEvent): void {\n this._currentSlider = e.currentTarget as SVGRectElement;\n const sliderX =\n (this._currentSlider.id as SliderId) === 'slider-min'\n ? this.minSliderX\n : this.maxSliderX;\n const histogramClientX = this.getBoundingClientRect().x;\n this._dragOffset = e.clientX - histogramClientX - sliderX;\n }\n\n /**\n * @param x horizontal position of slider\n * @returns string representation of date\n */\n private translatePositionToDate(x: number): string {\n // Snap to the nearest second, fixing the case where input like 1/1/2010\n // would get translated to 12/31/2009 due to slight discrepancies from\n // pixel boundaries and floating point error.\n const milliseconds = this.snapToNextSecond(\n ((x - this.sliderWidth) * this.dateRangeMS) / this._histWidth,\n );\n return this.formatDate(this._minDateMS + milliseconds);\n }\n\n /**\n * Returns slider x-position corresponding to given date\n *\n * @param date\n * @returns x-position of slider\n */\n private translateDateToPosition(date: string): number {\n const milliseconds = this.getMSFromString(date);\n return (\n this.sliderWidth +\n ((milliseconds - this._minDateMS) * this._histWidth) / this.dateRangeMS\n );\n }\n\n /** ensure that the returned value is between minValue and maxValue */\n private clamp(x: number, minValue: number, maxValue: number): number {\n return Math.min(Math.max(x, minValue), maxValue);\n }\n\n private handleInputFocus(): void {\n if (!this.updateWhileFocused) {\n // Tabbing from one date input to the other lands focus here in between\n // the first input's blur and any chance for its update to be emitted.\n // Remember that so the second input's blur can pick it back up, rather\n // than the typed date never being reported at all.\n this._updateDeferredWhileFocused = this.cancelPendingUpdateEvent();\n }\n }\n\n private handleMinDateInput(e: Event): void {\n const target = e.currentTarget as HTMLInputElement;\n const isChanged = target.value !== this.minSelectedDate;\n if (isChanged) {\n this.minSelectedDate = target.value;\n }\n if (isChanged || this._updateDeferredWhileFocused) {\n this.beginEmitUpdateProcess();\n }\n }\n\n private handleMaxDateInput(e: Event): void {\n const target = e.currentTarget as HTMLInputElement;\n const isChanged = target.value !== this.maxSelectedDate;\n if (isChanged) {\n this.maxSelectedDate = target.value;\n }\n if (isChanged || this._updateDeferredWhileFocused) {\n this.beginEmitUpdateProcess();\n }\n }\n\n private handleKeyUp(e: KeyboardEvent): void {\n if (e.key === 'Enter') {\n const target = e.currentTarget as HTMLInputElement;\n target.blur();\n if (target.id === 'date-min') {\n this.handleMinDateInput(e);\n } else if (target.id === 'date-max') {\n this.handleMaxDateInput(e);\n }\n }\n }\n\n private get currentDateRangeString(): string {\n return `${this.minSelectedDate}:${this.maxSelectedDate}`;\n }\n\n private getMSFromString(date: unknown): number {\n // It's possible that `date` is not a string in certain situations.\n // For instance if you use LitElement bindings and the date is `2000`,\n // it will be treated as a number instead of a string. This just makes sure\n // we're dealing with a string.\n const stringified = typeof date === 'string' ? date : String(date);\n const digitGroupCount = (stringified.split(/(\\d+)/).length - 1) / 2;\n if (digitGroupCount === 1) {\n // if there's just a single set of digits, assume it's a year\n const dateObj = new Date(0, 0); // start at January 1, 1900\n dateObj.setFullYear(Number(stringified)); // override year\n return dateObj.getTime(); // get time in milliseconds\n }\n return dayjs(stringified, [this.dateFormat, DATE_FORMAT]).valueOf();\n }\n\n /**\n * expand or narrow the selected range by moving the slider nearest the\n * clicked bar to the outer edge of the clicked bar\n *\n * @param e Event click event from a histogram bar\n */\n private handleBarClick(e: Event): void {\n const dataset = (e.currentTarget as SVGRectElement).dataset as BarDataset;\n // use the midpoint of the width of the clicked bar to determine which is\n // the nearest slider\n const clickPosition =\n (this.getMSFromString(dataset.binStart) +\n this.getMSFromString(dataset.binEnd)) /\n 2;\n const distanceFromMinSlider = Math.abs(\n clickPosition - this.getMSFromString(this.minSelectedDate),\n );\n const distanceFromMaxSlider = Math.abs(\n clickPosition - this.getMSFromString(this.maxSelectedDate),\n );\n // update the selected range by moving the nearer slider\n if (distanceFromMinSlider < distanceFromMaxSlider) {\n this.minSelectedDate = dataset.binStart;\n } else {\n this.maxSelectedDate = dataset.binEnd;\n }\n this.beginEmitUpdateProcess();\n }\n\n private get minSliderTemplate(): SVGTemplateResult {\n // width/height in pixels of curved part of the sliders (like\n // border-radius); used as part of a SVG quadratic curve. see\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands\n const cs = SLIDER_CORNER_SIZE;\n\n const sliderShape = `\n M${this.minSliderX},0\n h-${this.sliderWidth - cs}\n q-${cs},0 -${cs},${cs}\n v${this.height - cs * 2}\n q0,${cs} ${cs},${cs}\n h${this.sliderWidth - cs}\n `;\n return this.generateSliderSVG(this.minSliderX, 'slider-min', sliderShape);\n }\n\n private get maxSliderTemplate(): SVGTemplateResult {\n const cs = SLIDER_CORNER_SIZE;\n const sliderShape = `\n M${this.maxSliderX},0\n h${this.sliderWidth - cs}\n q${cs},0 ${cs},${cs}\n v${this.height - cs * 2}\n q0,${cs} -${cs},${cs}\n h-${this.sliderWidth - cs}\n `;\n return this.generateSliderSVG(this.maxSliderX, 'slider-max', sliderShape);\n }\n\n private generateSliderSVG(\n sliderPositionX: number,\n id: SliderId,\n sliderShape: string,\n ): SVGTemplateResult {\n // whether the curved part of the slider is facing towards the left (1), ie\n // minimum, or facing towards the right (-1), ie maximum\n const k = id === 'slider-min' ? 1 : -1;\n\n const sliderClasses = classMap({\n slider: true,\n draggable: !this.disabled,\n dragging: this._isDragging,\n });\n\n return svg`\n <svg\n id=${id}\n class=${sliderClasses}\n @pointerdown=${this.drag}\n >\n <path d=\"${sliderShape} z\" fill=\"${sliderColor}\" />\n <rect\n x=\"${\n sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.4 * k\n }\"\n y=\"${this.height / 3}\"\n width=\"1\"\n height=\"${this.height / 3}\"\n fill=\"white\"\n />\n <rect\n x=\"${\n sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.6 * k\n }\"\n y=\"${this.height / 3}\"\n width=\"1\"\n height=\"${this.height / 3}\"\n fill=\"white\"\n />\n </svg>\n `;\n }\n\n get selectedRangeTemplate(): SVGTemplateResult {\n return svg`\n <rect\n x=\"${this.minSliderX}\"\n y=\"0\"\n width=\"${this.maxSliderX - this.minSliderX}\"\n height=\"${this.height}\"\n fill=\"${selectedRangeColor}\"\n />`;\n }\n\n get histogramTemplate(): SVGTemplateResult[] {\n const xScale = this._histWidth / this._numBins;\n const barWidth = xScale - 1;\n let x = this.sliderWidth; // start at the left edge of the histogram\n\n return this._histData.map((data) => {\n const { minSelectedDate, maxSelectedDate } = this;\n const barHeight = data.height;\n\n const binIsBeforeMin = this.isBefore(data.binEnd, minSelectedDate);\n const binIsAfterMax = this.isAfter(data.binStart, maxSelectedDate);\n const barFill =\n binIsBeforeMin || binIsAfterMax ? barExcludedFill : barIncludedFill;\n\n // the stroke-dasharray style below creates a transparent border around the\n // right edge of the bar, which prevents user from encountering a gap\n // between adjacent bars (eg when viewing the tooltips or when trying to\n // extend the range by clicking on a bar)\n const barStyle = `stroke-dasharray: 0 ${barWidth} ${barHeight} ${barWidth} 0 ${barHeight}`;\n\n const bar = svg`\n <rect\n class=\"bar-pointer-target\"\n x=${x}\n y=\"0\"\n width=${barWidth}\n height=${this.height}\n @pointerenter=${this.showTooltip}\n @pointerleave=${this.hideTooltip}\n @click=${this.handleBarClick}\n fill=\"transparent\"\n data-num-items=${data.value}\n data-bin-start=${data.binStart}\n data-bin-end=${data.binEnd}\n data-tooltip=${data.tooltip}\n />\n <rect\n class=\"bar\"\n style=${barStyle}\n x=${x}\n y=${this.height - barHeight}\n width=${barWidth}\n height=${barHeight}\n fill=${barFill}\n />`;\n x += xScale;\n return bar;\n });\n }\n\n /** Whether the first arg represents a date strictly before the second arg */\n private isBefore(date1: string, date2: string): boolean {\n const date1MS = this.getMSFromString(date1);\n const date2MS = this.getMSFromString(date2);\n return date1MS < date2MS;\n }\n\n /** Whether the first arg represents a date strictly after the second arg */\n private isAfter(date1: string, date2: string): boolean {\n const date1MS = this.getMSFromString(date1);\n const date2MS = this.getMSFromString(date2);\n return date1MS > date2MS;\n }\n\n private formatDate(dateMS: number, format: string = this.dateFormat): string {\n if (Number.isNaN(dateMS)) {\n return '';\n }\n const date = dayjs(dateMS);\n if (date.year() < 1000) {\n // years before 1000 don't play well with dayjs custom formatting, so work around dayjs\n // by setting the year to a sentinel value and then replacing it instead.\n // this is a bit hacky but it does the trick for essentially all reasonable cases\n // until such time as we replace dayjs.\n const tmpDate = date.year(199999);\n return tmpDate.format(format).replace(/199999/g, date.year().toString());\n }\n return date.format(format);\n }\n\n /**\n * NOTE: we are relying on the lit `live` directive in the template to\n * ensure that the change to minSelectedDate is noticed and the input value\n * gets properly re-rendered. see\n * https://lit.dev/docs/templates/directives/#live\n */\n get minInputTemplate(): TemplateResult {\n return html`\n <input\n id=\"date-min\"\n placeholder=${this.dateFormat}\n type=\"text\"\n @focus=${this.handleInputFocus}\n @blur=${this.handleMinDateInput}\n @keyup=${this.handleKeyUp}\n .value=${live(this.minSelectedDate)}\n ?disabled=${this.disabled}\n />\n `;\n }\n\n get maxInputTemplate(): TemplateResult {\n return html`\n <input\n id=\"date-max\"\n placeholder=${this.dateFormat}\n type=\"text\"\n @focus=${this.handleInputFocus}\n @blur=${this.handleMaxDateInput}\n @keyup=${this.handleKeyUp}\n .value=${live(this.maxSelectedDate)}\n ?disabled=${this.disabled}\n />\n `;\n }\n\n get minLabelTemplate(): TemplateResult {\n return html`<label for=\"date-min\" class=\"sr-only\">Minimum date:</label>`;\n }\n\n get maxLabelTemplate(): TemplateResult {\n return html`<label for=\"date-max\" class=\"sr-only\">Maximum date:</label>`;\n }\n\n get tooltipTemplate(): TemplateResult {\n const styles = styleMap({\n width: `${this.tooltipWidth}px`,\n height: `${this.tooltipHeight}px`,\n top: `${this._tooltipOffsetY}px`,\n left: `${this._tooltipOffsetX}px`,\n });\n\n return html`\n <div id=\"tooltip\" style=${styles} popover>${this._tooltipContent}</div>\n `;\n }\n\n private get histogramAccessibilityTemplate(): TemplateResult {\n let rangeText: string = '';\n if (this.minSelectedDate && this.maxSelectedDate) {\n rangeText = ` from ${this.minSelectedDate} to ${this.maxSelectedDate}`;\n } else if (this.minSelectedDate) {\n rangeText = ` from ${this.minSelectedDate}`;\n } else if (this.maxSelectedDate) {\n rangeText = ` up to ${this.maxSelectedDate}`;\n }\n\n const titleText = `Filter results for dates${rangeText}`;\n const descText = `This histogram shows the distribution of dates${rangeText}`;\n\n return html`<title id=\"histogram-title\">${titleText}</title\n ><desc id=\"histogram-desc\">${descText}</desc>`;\n }\n\n private get noDataTemplate(): TemplateResult {\n return html`\n <div class=\"missing-data-message\">${this.missingDataMessage}</div>\n `;\n }\n\n private get activityIndicatorTemplate(): TemplateResult | typeof nothing {\n if (!this.loading) {\n return nothing;\n }\n return html`\n <ia-status-indicator mode=\"loading\" ?hideDots=${true}>\n </ia-status-indicator>\n `;\n }\n\n static styles = css`\n .missing-data-message {\n text-align: center;\n }\n #container {\n margin: 0;\n touch-action: none;\n position: relative;\n }\n .disabled {\n opacity: 0.3;\n }\n ia-status-indicator {\n position: absolute;\n left: calc(50% - 10px);\n top: 10px;\n --icon-width: 20px;\n --loading-ring-color--: ${activityIndicatorColor};\n }\n\n /* prevent selection from interfering with tooltip, especially on mobile */\n /* https://stackoverflow.com/a/4407335/1163042 */\n .noselect {\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* current Chrome, Edge, Opera and Firefox */\n }\n .bar,\n .bar-pointer-target {\n /* create a transparent border around the hist bars to prevent \"gaps\" and\n flickering when moving around between bars. this also helps with handling\n clicks on the bars, preventing users from being able to click in between\n bars */\n stroke: rgba(0, 0, 0, 0);\n /* ensure transparent stroke wide enough to cover gap between bars */\n stroke-width: 2px;\n }\n .bar {\n /* ensure the bar's pointer target receives events, not the bar itself */\n pointer-events: none;\n }\n .bar-pointer-target:hover + .bar {\n /* highlight currently hovered bar */\n fill-opacity: 0.7;\n }\n .disabled .bar-pointer-target:hover + .bar {\n /* ensure no visual hover interaction when disabled */\n fill-opacity: 1;\n }\n /****** histogram ********/\n #tooltip {\n position: absolute;\n background: ${tooltipBackgroundColor};\n margin: 0;\n border: 0;\n color: ${tooltipTextColor};\n text-align: center;\n border-radius: 3px;\n padding: 2px;\n font-size: ${tooltipFontSize};\n font-family: ${tooltipFontFamily};\n touch-action: none;\n pointer-events: none;\n overflow: visible;\n }\n #tooltip:after {\n content: '';\n position: absolute;\n margin-left: -5px;\n top: 100%;\n left: 50%;\n /* arrow */\n border: 5px solid ${tooltipTextColor};\n border-color: ${tooltipBackgroundColor} transparent transparent\n transparent;\n }\n /****** slider ********/\n .slider {\n shape-rendering: crispEdges; /* So the slider doesn't get blurry if dragged between pixels */\n }\n .draggable:hover {\n cursor: grab;\n }\n .dragging {\n cursor: grabbing !important;\n }\n /****** inputs ********/\n #inputs {\n display: flex;\n justify-content: center;\n margin: ${inputRowMargin};\n }\n #inputs .dash {\n position: relative;\n bottom: -1px;\n align-self: center; /* Otherwise the dash sticks to the top while the inputs grow */\n }\n input {\n width: ${inputWidth};\n margin: 0 3px;\n border: ${inputBorder};\n border-radius: 2px !important;\n text-align: center;\n font-size: ${inputFontSize};\n font-family: ${inputFontFamily};\n }\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n }\n `;\n\n render(): TemplateResult {\n if (!this.hasBinData) {\n return this.noDataTemplate;\n }\n return html`\n <div\n id=\"container\"\n class=\"\n noselect\n ${this._isDragging ? 'dragging' : ''}\n \"\n style=\"width: ${this.width}px\"\n >\n ${this.activityIndicatorTemplate} ${this.tooltipTemplate}\n <div\n class=\"inner-container\n ${this.disabled ? 'disabled' : ''}\"\n >\n <svg\n width=\"${this.width}\"\n height=\"${this.height}\"\n aria-labelledby=\"histogram-title histogram-desc\"\n @pointerleave=\"${this.drop}\"\n >\n ${this.histogramAccessibilityTemplate} ${this.selectedRangeTemplate}\n <svg id=\"histogram\">${this.histogramTemplate}</svg>\n ${this.minSliderTemplate} ${this.maxSliderTemplate}\n </svg>\n <div id=\"inputs\">\n ${this.minLabelTemplate} ${this.minInputTemplate}\n <div class=\"dash\">-</div>\n ${this.maxLabelTemplate} ${this.maxInputTemplate}\n <slot name=\"inputs-right-side\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-histogram-date-range': IAHistogramDateRange;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, LitElement, css, nothing } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { customElement } from '../../
|
|
4
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
5
5
|
import themeStyles from '../../themes/theme-styles.js';
|
|
6
6
|
/**
|
|
7
7
|
* Percent-encodes the characters that could end the quoted url() string or the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-icon.js","sourceRoot":"","sources":["../../../../src/elements/ia-icon/ia-icon.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ia-icon.js","sourceRoot":"","sources":["../../../../src/elements/ia-icon/ia-icon.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;GAGG;AACH,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,GAAG,CAAC,OAAO,CAChB,cAAc,EACd,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CACvE,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QACL,yBAAyB;QACG,QAAG,GAAW,EAAE,CAAC;IA0D/C,CAAC;IAxDC,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,OAAO,OAAO,CAAC;QAC9B,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAA;;;;kCAImB,UAAU;;mDAEO,IAAI,CAAC,GAAG;KACtD,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,WAAW;YACX,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA1D6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAAkB;AAFlC,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CA4DlB","sourcesContent":["import type { TemplateResult, CSSResultGroup } from 'lit';\nimport { html, LitElement, css, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\n\nimport themeStyles from '@src/themes/theme-styles';\n\n/**\n * Percent-encodes the characters that could end the quoted url() string or the\n * inline style declaration it sits in, so any source stays a single url().\n */\nconst CSS_URL_UNSAFE = /['\"\\\\()\\n\\r\\f]/g;\nfunction encodeForCssUrl(src: string): string {\n return src.replace(\n CSS_URL_UNSAFE,\n (char) =>\n `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(2, '0')}`,\n );\n}\n\n/**\n * Renders an icon from the given source, inheriting the surrounding text\n * color by default. Set --ia-theme-icon-color to give it a color of its own.\n *\n * Icons are square, sized by --ia-theme-icon-width, and --ia-theme-icon-height\n * sets the height on its own if a non-square icon is needed.\n *\n * Browsers that support masking render the icon as a masked element so it can\n * take on the current color, with --ia-theme-icon-transition available to animate\n * color changes. The rest fall back to a plain image, which --ia-theme-icon-filter\n * can recolor.\n */\n@customElement('ia-icon')\nexport class IAIcon extends LitElement {\n /* Source for the icon */\n @property({ type: String }) src: string = '';\n\n render(): TemplateResult | typeof nothing {\n if (!this.src) return nothing;\n const encodedSrc = encodeForCssUrl(this.src);\n\n return html`\n <div\n class=\"icon masked\"\n part=\"icon\"\n style=\"mask-image: url('${encodedSrc}')\"\n ></div>\n <img class=\"icon fallback\" part=\"icon\" src=${this.src} alt=\"\" />\n `;\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --icon-height--: var(--icon-height);\n --icon-width--: var(--icon-width);\n --icon-color--: var(--icon-color);\n --icon-filter--: var(--icon-filter);\n --icon-transition--: var(--icon-transition);\n }\n\n .icon {\n height: var(--icon-height--);\n width: var(--icon-width--);\n filter: var(--icon-filter--);\n }\n\n .icon.masked {\n display: none;\n }\n\n /* Icons inherit font color when possible */\n @supports (mask-image: url()) and (background: currentColor) {\n .icon.masked {\n display: block;\n mask-repeat: no-repeat;\n /* Scale the icon to fit the box, whatever its aspect ratio */\n mask-size: contain;\n mask-position: center;\n background: var(--icon-color--);\n filter: none;\n transition: var(--icon-transition--);\n }\n\n .icon.fallback {\n display: none;\n }\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-icon': IAIcon;\n }\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { css, html, LitElement, nothing, } from 'lit';
|
|
3
3
|
import { property, query, state } from 'lit/decorators.js';
|
|
4
|
-
import { customElement } from '../../
|
|
4
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
6
|
import { keyed } from 'lit/directives/keyed.js';
|
|
7
7
|
import { localized, msg, str } from '@lit/localize';
|
|
8
8
|
import themeStyles from '../../themes/theme-styles.js';
|
|
9
|
-
import { prefersReducedMotion } from '../../
|
|
9
|
+
import { prefersReducedMotion } from '../../utils/prefers-reduced-motion.js';
|
|
10
10
|
import { ImageViewerGestures } from './image-viewer-gestures.js';
|
|
11
11
|
import './ia-imgview-slide.js';
|
|
12
12
|
import './ia-imgview-controls.js';
|