@internetarchive/elements 1.4.1-webdev-9540.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.js +32 -0
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.d.ts +3 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.js +24 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.js +17 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.js +23 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.d.ts +3 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js +167 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.d.ts +3 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js +102 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.d.ts +33 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.js +33 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.d.ts +9 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.js +9 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.js +54 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.d.ts +17 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.js +17 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.d.ts +31 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.js +79 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.d.ts +65 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.js +231 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.d.ts +35 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.js +140 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.d.ts +78 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.js +372 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.d.ts +42 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.js +75 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.d.ts +72 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.js +392 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.d.ts +59 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.js +134 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.d.ts +58 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.js +135 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.d.ts +73 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.js +143 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.d.ts +18 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.js +26 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.d.ts +19 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.js +25 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.js.map +1 -0
- package/dist/src/elements/ia-book-actions/globals.d.ts +38 -0
- package/dist/src/elements/ia-book-actions/globals.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/globals.js +6 -0
- package/dist/src/elements/ia-book-actions/globals.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.d.ts +97 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js +308 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.d.ts +14 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js +58 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.d.ts +13 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js +45 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.d.ts +20 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js +92 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.d.ts +41 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js +86 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts +270 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.js +1156 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.js.map +1 -0
- package/dist/src/elements/ia-book-actions/models.d.ts +206 -0
- package/dist/src/elements/ia-book-actions/models.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/models.js +2 -0
- package/dist/src/elements/ia-book-actions/models.js.map +1 -0
- package/dist/src/elements/ia-button/ia-button.d.ts.map +1 -1
- package/dist/src/elements/ia-button/ia-button.js +11 -14
- package/dist/src/elements/ia-button/ia-button.js.map +1 -1
- package/dist/src/elements/ia-donation-form/analytics.d.ts +12 -0
- package/dist/src/elements/ia-donation-form/analytics.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/analytics.js +2 -0
- package/dist/src/elements/ia-donation-form/analytics.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js +4 -3
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js.map +1 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts +118 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js +194 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.d.ts +24 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.js +78 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.d.ts +44 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.js +116 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.d.ts +24 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.js +74 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.d.ts +47 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.js +212 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.d.ts +30 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.js +77 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.d.ts +80 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.js +72 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.d.ts +2 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.js +2 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.d.ts +3 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.js +254 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts +68 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +489 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.d.ts +26 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +165 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts +39 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +212 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.d.ts +31 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js +93 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts +33 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +379 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.d.ts +11 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js +59 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.d.ts +10 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js +75 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts +111 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +522 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts +95 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +523 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -0
- package/dist/src/elements/ia-donation-form/icons.d.ts +13 -0
- package/dist/src/elements/ia-donation-form/icons.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/icons.js +21 -0
- package/dist/src/elements/ia-donation-form/icons.js.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.d.ts +27 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +195 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.d.ts +7 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js +63 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.d.ts +28 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +313 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.d.ts +2 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.js +8 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.d.ts +2 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.js +4 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.d.ts +54 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.js +79 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.d.ts +99 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js +224 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.d.ts +41 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js +61 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.d.ts +141 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +447 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.d.ts +273 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js +879 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.d.ts +100 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +779 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.d.ts +34 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.js +21 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.d.ts +11 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.js +11 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.d.ts +5 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.js +6 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/models.d.ts +109 -0
- package/dist/src/elements/ia-feature-feedback/models.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/models.js +31 -0
- package/dist/src/elements/ia-feature-feedback/models.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.d.ts +29 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.js +32 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.js.map +1 -0
- package/dist/src/elements/ia-topnav/dropdown-menu.d.ts +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.d.ts +1 -1
- package/dist/src/locales/es.d.ts +31 -0
- package/dist/src/locales/es.d.ts.map +1 -1
- package/dist/src/locales/es.js +31 -0
- package/dist/src/locales/es.js.map +1 -1
- package/dist/src/services/item-metadata/item-metadata.d.ts +1 -0
- package/dist/src/services/item-metadata/item-metadata.d.ts.map +1 -1
- package/dist/src/services/item-metadata/item-metadata.js +1 -0
- package/dist/src/services/item-metadata/item-metadata.js.map +1 -1
- package/dist/src/services/item-metadata/models/task.d.ts +5 -0
- package/dist/src/services/item-metadata/models/task.d.ts.map +1 -1
- package/dist/src/services/item-metadata/models/task.js +10 -1
- package/dist/src/services/item-metadata/models/task.js.map +1 -1
- package/dist/src/services/metadata-service/backend/default-metadata-backend.d.ts +10 -0
- package/dist/src/services/metadata-service/backend/default-metadata-backend.d.ts.map +1 -1
- package/dist/src/services/metadata-service/backend/default-metadata-backend.js +36 -1
- package/dist/src/services/metadata-service/backend/default-metadata-backend.js.map +1 -1
- package/dist/src/services/metadata-service/backend/metadata-backend-interface.d.ts +14 -0
- package/dist/src/services/metadata-service/backend/metadata-backend-interface.d.ts.map +1 -1
- package/dist/src/services/metadata-service/backend/metadata-backend-interface.js.map +1 -1
- package/dist/src/services/metadata-service/index.d.ts +5 -3
- package/dist/src/services/metadata-service/index.d.ts.map +1 -1
- package/dist/src/services/metadata-service/index.js +2 -1
- package/dist/src/services/metadata-service/index.js.map +1 -1
- package/dist/src/services/metadata-service/metadata-patch.d.ts +22 -0
- package/dist/src/services/metadata-service/metadata-patch.d.ts.map +1 -0
- package/dist/src/services/metadata-service/metadata-patch.js +37 -0
- package/dist/src/services/metadata-service/metadata-patch.js.map +1 -0
- package/dist/src/services/metadata-service/metadata-service-error.d.ts +2 -0
- package/dist/src/services/metadata-service/metadata-service-error.d.ts.map +1 -1
- package/dist/src/services/metadata-service/metadata-service-error.js +2 -0
- package/dist/src/services/metadata-service/metadata-service-error.js.map +1 -1
- package/dist/src/services/metadata-service/metadata-service-interface.d.ts +42 -0
- package/dist/src/services/metadata-service/metadata-service-interface.d.ts.map +1 -1
- package/dist/src/services/metadata-service/metadata-service-interface.js.map +1 -1
- package/dist/src/services/metadata-service/metadata-service.d.ts +6 -1
- package/dist/src/services/metadata-service/metadata-service.d.ts.map +1 -1
- package/dist/src/services/metadata-service/metadata-service.js +26 -0
- package/dist/src/services/metadata-service/metadata-service.js.map +1 -1
- package/dist/src/services/metadata-service/responses/metadata-response.d.ts +5 -1
- package/dist/src/services/metadata-service/responses/metadata-response.d.ts.map +1 -1
- package/dist/src/services/metadata-service/responses/metadata-response.js +6 -1
- package/dist/src/services/metadata-service/responses/metadata-response.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, nothing, } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { customElement } from '../../util/custom-element.js';
|
|
6
|
+
import ActionsHandler from './core/services/actions-handler/actions-handler.js';
|
|
7
|
+
import buttonBaseStyle from './assets/styles/ia-button.js';
|
|
8
|
+
import CollapsibleActionGroupStyle from './assets/styles/collapsible-action-group.js';
|
|
9
|
+
import { tabletContainerWidth } from './core/config/constants.js';
|
|
10
|
+
import { purchaseIcon } from './assets/data/purchase.js';
|
|
11
|
+
import { dropdownOpened, dropdownClosed } from './assets/data/dropdown-arrow.js';
|
|
12
|
+
let IABookActionsCollapsibleActionGroup = class IABookActionsCollapsibleActionGroup extends ActionsHandler {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.userid = '';
|
|
16
|
+
this.identifier = '';
|
|
17
|
+
this.primaryActions = [];
|
|
18
|
+
this.secondaryActions = [];
|
|
19
|
+
this.primaryColor = '';
|
|
20
|
+
this.dropdownState = 'close';
|
|
21
|
+
this.width = 0;
|
|
22
|
+
this.hasAdminAccess = false;
|
|
23
|
+
this.dropdownArrow = dropdownClosed;
|
|
24
|
+
this.disabled = false;
|
|
25
|
+
this.returnUrl = '';
|
|
26
|
+
this.autoRenew = false;
|
|
27
|
+
this.loanRenewType = '';
|
|
28
|
+
this.autoReturn = false;
|
|
29
|
+
this.returnNow = false;
|
|
30
|
+
/** The image shown while an action is in progress. */
|
|
31
|
+
this.loaderIcon = 'https://archive.org/upload/images/tree/loading.gif';
|
|
32
|
+
this.initialButton = false;
|
|
33
|
+
}
|
|
34
|
+
updated(changed) {
|
|
35
|
+
if ((changed.has('width') || changed.has('disabled')) &&
|
|
36
|
+
this.isBelowTabletContainer) {
|
|
37
|
+
this.resetActions();
|
|
38
|
+
}
|
|
39
|
+
if (changed.has('autoRenew') && this.autoRenew) {
|
|
40
|
+
this.dispatchLoanEvent('autoRenew', { renewType: this.loanRenewType });
|
|
41
|
+
}
|
|
42
|
+
const requestingAutoreturn = changed.has('autoReturn') && this.autoReturn;
|
|
43
|
+
if (requestingAutoreturn) {
|
|
44
|
+
this.dispatchLoanEvent('autoReturn');
|
|
45
|
+
}
|
|
46
|
+
if (changed.has('returnNow') && this.returnNow && !requestingAutoreturn) {
|
|
47
|
+
this.dispatchLoanEvent('returnNow', { borrowType: 'browse' });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* dispatch event when book is auto auto-renewed / auto-returned / returned
|
|
52
|
+
* listen these events in actions-handler.ts to execute ajax call on petabox.
|
|
53
|
+
* @see ActionsHandler
|
|
54
|
+
*
|
|
55
|
+
* @param event - autoRenew|autoReturn|returnNow
|
|
56
|
+
*/
|
|
57
|
+
dispatchLoanEvent(event, detail) {
|
|
58
|
+
this.dispatchEvent(new CustomEvent(event, { detail }));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* merge primaryActions and secondaryActions into dropdown
|
|
62
|
+
*/
|
|
63
|
+
resetActions() {
|
|
64
|
+
// concat primaryActions and secondaryActions to draw in dropdown list
|
|
65
|
+
if (this.primaryActions.length) {
|
|
66
|
+
this.primaryActions = this.primaryActions.concat(this.secondaryActions);
|
|
67
|
+
this.primaryColor = this.primaryActions[0].className;
|
|
68
|
+
if (this.hasAdminAccess) {
|
|
69
|
+
this.sortActionButtonOrder();
|
|
70
|
+
}
|
|
71
|
+
// remove secondaryActions
|
|
72
|
+
this.secondaryActions = [];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* re-sort primaryActions action list to show dropdown-only/mobile mode
|
|
77
|
+
*/
|
|
78
|
+
sortActionButtonOrder() {
|
|
79
|
+
let fromIndex = 1;
|
|
80
|
+
const toIndex = 0;
|
|
81
|
+
if (this.secondaryActions.length === 2) {
|
|
82
|
+
fromIndex = 2;
|
|
83
|
+
}
|
|
84
|
+
fromIndex = this.primaryActions.length - fromIndex;
|
|
85
|
+
const element = this.primaryActions[fromIndex];
|
|
86
|
+
const current = this.primaryActions;
|
|
87
|
+
current.splice(fromIndex, 1);
|
|
88
|
+
current.splice(toIndex, 0, element);
|
|
89
|
+
this.primaryActions = current;
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return html `
|
|
93
|
+
<div
|
|
94
|
+
class="${classMap({
|
|
95
|
+
actiongroup: true,
|
|
96
|
+
disabled: this.disabled,
|
|
97
|
+
})}"
|
|
98
|
+
>
|
|
99
|
+
${this.getLoaderIcon}
|
|
100
|
+
<section class="action-buttons primary">
|
|
101
|
+
${this.renderPrimaryActions}
|
|
102
|
+
</section>
|
|
103
|
+
<section class="action-buttons secondary">
|
|
104
|
+
${this.renderSecondaryActions}
|
|
105
|
+
</section>
|
|
106
|
+
</div>
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
109
|
+
get renderPrimaryActions() {
|
|
110
|
+
if (this.primaryActions.length === 0)
|
|
111
|
+
return nothing;
|
|
112
|
+
if (this.dropdownState === 'close') {
|
|
113
|
+
this.primaryColor = this.primaryActions[0].className;
|
|
114
|
+
}
|
|
115
|
+
// If its single action, let just not show dropdown list
|
|
116
|
+
if (this.primaryActions.length === 1) {
|
|
117
|
+
return this.initialActionTemplate;
|
|
118
|
+
}
|
|
119
|
+
return html `
|
|
120
|
+
${this.initialActionTemplate}
|
|
121
|
+
<button
|
|
122
|
+
class="ia-button ${this.primaryColor} down-arrow"
|
|
123
|
+
@click=${this.toggleDropdown}
|
|
124
|
+
>
|
|
125
|
+
${this.dropdownArrow}
|
|
126
|
+
</button>
|
|
127
|
+
|
|
128
|
+
<ul class="dropdown-content ${this.dropdownState}">
|
|
129
|
+
${this.getPrimaryItems}
|
|
130
|
+
</ul>
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
get renderSecondaryActions() {
|
|
134
|
+
if (!this.secondaryActions.length)
|
|
135
|
+
return nothing;
|
|
136
|
+
return this.secondaryActions.map((action) => this.renderActionButton(action));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Render action as a link for secondary actions like admin, printdisability links.
|
|
140
|
+
* @param action
|
|
141
|
+
* @param initialButton
|
|
142
|
+
*/
|
|
143
|
+
renderActionLink(action, initialButton = false) {
|
|
144
|
+
return html `<span class="${this.getDeviceType} ${action.className}">
|
|
145
|
+
<a
|
|
146
|
+
class="ia-button ${action.className} ${initialButton ? 'initial' : ''}"
|
|
147
|
+
href="${action.url}"
|
|
148
|
+
target=${action.target}
|
|
149
|
+
@click=${() => {
|
|
150
|
+
this.clickHandler(action.id, action.analyticsEvent, action?.borrowType);
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
${action.id === 'purchaseBook' ? purchaseIcon : ''} ${action.text}
|
|
154
|
+
<small>${action.subText}</small>
|
|
155
|
+
</a>
|
|
156
|
+
</span>`;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Render action as a button for primary actions like browse, borrow, join waitlist etc...
|
|
160
|
+
* @param action
|
|
161
|
+
* @param initialButton
|
|
162
|
+
*/
|
|
163
|
+
renderActionButton(action, initialButton = false) {
|
|
164
|
+
if (action.url)
|
|
165
|
+
return this.renderActionLink(action, initialButton);
|
|
166
|
+
const { analyticsEvent } = action;
|
|
167
|
+
return html `<button
|
|
168
|
+
class="ia-button ${action.className} ${initialButton ? 'initial' : ''}"
|
|
169
|
+
@click=${() => {
|
|
170
|
+
this.clickHandler(action.id, analyticsEvent, action?.borrowType);
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
${action.text}
|
|
174
|
+
</button>`;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Dispatches click events when patron clicks on action buttons
|
|
178
|
+
* @param eventName actions like 'browseBook', 'borrowBook' etc...
|
|
179
|
+
* @param gaEvent contains analytics event action and category
|
|
180
|
+
* @param borrowType browse|borrow
|
|
181
|
+
* @fires CollapsibleActionGroup#{eventName} - (will be browseBook, borrowBook etc...)
|
|
182
|
+
*/
|
|
183
|
+
clickHandler(eventName, gaEvent, borrowType = '') {
|
|
184
|
+
this.dropdownState = 'close';
|
|
185
|
+
this.dropdownArrow = dropdownClosed;
|
|
186
|
+
if (!gaEvent || !eventName)
|
|
187
|
+
return;
|
|
188
|
+
const { category, action } = gaEvent;
|
|
189
|
+
this.dispatchEvent(new CustomEvent(eventName, {
|
|
190
|
+
detail: {
|
|
191
|
+
event: { category, action },
|
|
192
|
+
borrowType,
|
|
193
|
+
},
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* get first primary action to render just before dropdown button
|
|
198
|
+
*/
|
|
199
|
+
get initialActionTemplate() {
|
|
200
|
+
this.initialButton = false;
|
|
201
|
+
if (this.primaryActions.length > 1) {
|
|
202
|
+
this.initialButton = true;
|
|
203
|
+
}
|
|
204
|
+
return this.renderActionButton(this.primaryActions[0], this.initialButton);
|
|
205
|
+
}
|
|
206
|
+
get getPrimaryItems() {
|
|
207
|
+
return this.primaryActions
|
|
208
|
+
.slice(1)
|
|
209
|
+
.map((action) => html `<li>${this.renderActionButton(action, this.initialButton)}</li>`);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* get loader icon when task is in-progress
|
|
213
|
+
*/
|
|
214
|
+
get getLoaderIcon() {
|
|
215
|
+
return html `<img
|
|
216
|
+
class="${classMap({
|
|
217
|
+
actionloader: true,
|
|
218
|
+
disabled: this.disabled,
|
|
219
|
+
})}"
|
|
220
|
+
alt=""
|
|
221
|
+
src="${this.loaderIcon}"
|
|
222
|
+
/>`;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* check if device is below tablet
|
|
226
|
+
*/
|
|
227
|
+
get isBelowTabletContainer() {
|
|
228
|
+
return this.width <= tabletContainerWidth;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* get device type as per container width
|
|
232
|
+
* @returns mobile | desktop
|
|
233
|
+
*/
|
|
234
|
+
get getDeviceType() {
|
|
235
|
+
return this.isBelowTabletContainer ? 'mobile' : 'desktop';
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* toggle dropdown and its icon state
|
|
239
|
+
*/
|
|
240
|
+
toggleDropdown() {
|
|
241
|
+
if (this.dropdownState === 'open') {
|
|
242
|
+
this.dropdownState = 'close';
|
|
243
|
+
this.dropdownArrow = dropdownClosed;
|
|
244
|
+
this.primaryColor = this.primaryActions[0].className;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
this.dropdownState = 'open';
|
|
248
|
+
this.dropdownArrow = dropdownOpened;
|
|
249
|
+
this.primaryColor = 'dark';
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
static get styles() {
|
|
253
|
+
return [buttonBaseStyle, CollapsibleActionGroupStyle];
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
__decorate([
|
|
257
|
+
property({ type: String })
|
|
258
|
+
], IABookActionsCollapsibleActionGroup.prototype, "userid", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
property({ type: String })
|
|
261
|
+
], IABookActionsCollapsibleActionGroup.prototype, "identifier", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property({ type: Array })
|
|
264
|
+
], IABookActionsCollapsibleActionGroup.prototype, "primaryActions", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
property({ type: Array })
|
|
267
|
+
], IABookActionsCollapsibleActionGroup.prototype, "secondaryActions", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
property({ type: String })
|
|
270
|
+
], IABookActionsCollapsibleActionGroup.prototype, "primaryColor", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
property({ type: String })
|
|
273
|
+
], IABookActionsCollapsibleActionGroup.prototype, "dropdownState", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ type: Number })
|
|
276
|
+
], IABookActionsCollapsibleActionGroup.prototype, "width", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property({ type: Boolean })
|
|
279
|
+
], IABookActionsCollapsibleActionGroup.prototype, "hasAdminAccess", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ attribute: false })
|
|
282
|
+
], IABookActionsCollapsibleActionGroup.prototype, "dropdownArrow", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ type: Boolean })
|
|
285
|
+
], IABookActionsCollapsibleActionGroup.prototype, "disabled", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
property({ type: String })
|
|
288
|
+
], IABookActionsCollapsibleActionGroup.prototype, "returnUrl", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
property({ type: Boolean })
|
|
291
|
+
], IABookActionsCollapsibleActionGroup.prototype, "autoRenew", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: String })
|
|
294
|
+
], IABookActionsCollapsibleActionGroup.prototype, "loanRenewType", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
property({ type: Boolean })
|
|
297
|
+
], IABookActionsCollapsibleActionGroup.prototype, "autoReturn", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
property({ type: Boolean })
|
|
300
|
+
], IABookActionsCollapsibleActionGroup.prototype, "returnNow", void 0);
|
|
301
|
+
__decorate([
|
|
302
|
+
property({ type: String })
|
|
303
|
+
], IABookActionsCollapsibleActionGroup.prototype, "loaderIcon", void 0);
|
|
304
|
+
IABookActionsCollapsibleActionGroup = __decorate([
|
|
305
|
+
customElement('ia-book-actions-collapsible-action-group')
|
|
306
|
+
], IABookActionsCollapsibleActionGroup);
|
|
307
|
+
export { IABookActionsCollapsibleActionGroup };
|
|
308
|
+
//# sourceMappingURL=ia-book-actions-collapsible-action-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-collapsible-action-group.js","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAE7E,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,2BAA2B,MAAM,0CAA0C,CAAC;AAEnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AASvE,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,cAAc;IAAhE;;QACuB,WAAM,GAAG,EAAE,CAAC;QAEZ,eAAU,GAAG,EAAE,CAAC;QAEjB,mBAAc,GAAmB,EAAE,CAAC;QAEpC,qBAAgB,GAAmB,EAAE,CAAC;QAErC,iBAAY,GAA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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0EAAoB;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uEAAoB;AAEnB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sEAAmB;AAGnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAC4B;AAlC5C,mCAAmC;IAD/C,aAAa,CAAC,0CAA0C,CAAC;GAC7C,mCAAmC,CAqT/C","sourcesContent":["import {\n html,\n nothing,\n type CSSResultGroup,\n type PropertyValues,\n type TemplateResult,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement } from '@src/util/custom-element';\n\nimport ActionsHandler from './core/services/actions-handler/actions-handler';\n\nimport buttonBaseStyle from './assets/styles/ia-button';\nimport CollapsibleActionGroupStyle from './assets/styles/collapsible-action-group';\n\nimport { tabletContainerWidth } from './core/config/constants';\nimport { purchaseIcon } from './assets/data/purchase';\nimport { dropdownOpened, dropdownClosed } from './assets/data/dropdown-arrow';\nimport type {\n ActionClickDetail,\n ActionConfig,\n AnalyticsEvent,\n BorrowType,\n} from './models';\n\n@customElement('ia-book-actions-collapsible-action-group')\nexport class IABookActionsCollapsibleActionGroup extends ActionsHandler {\n @property({ type: String }) userid = '';\n\n @property({ type: String }) identifier = '';\n\n @property({ type: Array }) primaryActions: ActionConfig[] = [];\n\n @property({ type: Array }) secondaryActions: ActionConfig[] = [];\n\n @property({ type: String }) primaryColor = '';\n\n @property({ type: String }) dropdownState: 'open' | 'close' = 'close';\n\n @property({ type: Number }) width = 0;\n\n @property({ type: Boolean }) hasAdminAccess = false;\n\n @property({ attribute: false }) dropdownArrow: TemplateResult =\n dropdownClosed;\n\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: String }) returnUrl = '';\n\n @property({ type: Boolean }) autoRenew = false;\n\n @property({ type: String }) loanRenewType = '';\n\n @property({ type: Boolean }) autoReturn = false;\n\n @property({ type: Boolean }) returnNow = false;\n\n /** The image shown while an action is in progress. */\n @property({ type: String }) loaderIcon =\n 'https://archive.org/upload/images/tree/loading.gif';\n\n /** Set by the parent element. */\n borrowType?: BorrowType | null;\n\n initialButton = false;\n\n updated(changed: PropertyValues<this>): void {\n if (\n (changed.has('width') || changed.has('disabled')) &&\n this.isBelowTabletContainer\n ) {\n this.resetActions();\n }\n\n if (changed.has('autoRenew') && this.autoRenew) {\n this.dispatchLoanEvent('autoRenew', { renewType: this.loanRenewType });\n }\n\n const requestingAutoreturn = changed.has('autoReturn') && this.autoReturn;\n if (requestingAutoreturn) {\n this.dispatchLoanEvent('autoReturn');\n }\n\n if (changed.has('returnNow') && this.returnNow && !requestingAutoreturn) {\n this.dispatchLoanEvent('returnNow', { borrowType: 'browse' });\n }\n }\n\n /**\n * dispatch event when book is auto auto-renewed / auto-returned / returned\n * listen these events in actions-handler.ts to execute ajax call on petabox.\n * @see ActionsHandler\n *\n * @param event - autoRenew|autoReturn|returnNow\n */\n dispatchLoanEvent(\n event: 'autoRenew' | 'autoReturn' | 'returnNow',\n detail?: { renewType?: string; borrowType?: string },\n ): void {\n this.dispatchEvent(new CustomEvent(event, { detail }));\n }\n\n /**\n * merge primaryActions and secondaryActions into dropdown\n */\n resetActions(): void {\n // concat primaryActions and secondaryActions to draw in dropdown list\n if (this.primaryActions.length) {\n this.primaryActions = this.primaryActions.concat(this.secondaryActions);\n\n this.primaryColor = this.primaryActions[0].className;\n\n if (this.hasAdminAccess) {\n this.sortActionButtonOrder();\n }\n\n // remove secondaryActions\n this.secondaryActions = [];\n }\n }\n\n /**\n * re-sort primaryActions action list to show dropdown-only/mobile mode\n */\n sortActionButtonOrder(): void {\n let fromIndex = 1;\n const toIndex = 0;\n if (this.secondaryActions.length === 2) {\n fromIndex = 2;\n }\n\n fromIndex = this.primaryActions.length - fromIndex;\n\n const element = this.primaryActions[fromIndex];\n const current = this.primaryActions;\n\n current.splice(fromIndex, 1);\n current.splice(toIndex, 0, element);\n\n this.primaryActions = current;\n }\n\n render() {\n return html`\n <div\n class=\"${classMap({\n actiongroup: true,\n disabled: this.disabled,\n })}\"\n >\n ${this.getLoaderIcon}\n <section class=\"action-buttons primary\">\n ${this.renderPrimaryActions}\n </section>\n <section class=\"action-buttons secondary\">\n ${this.renderSecondaryActions}\n </section>\n </div>\n `;\n }\n\n get renderPrimaryActions() {\n if (this.primaryActions.length === 0) return nothing;\n\n if (this.dropdownState === 'close') {\n this.primaryColor = this.primaryActions[0].className;\n }\n\n // If its single action, let just not show dropdown list\n if (this.primaryActions.length === 1) {\n return this.initialActionTemplate;\n }\n\n return html`\n ${this.initialActionTemplate}\n <button\n class=\"ia-button ${this.primaryColor} down-arrow\"\n @click=${this.toggleDropdown}\n >\n ${this.dropdownArrow}\n </button>\n\n <ul class=\"dropdown-content ${this.dropdownState}\">\n ${this.getPrimaryItems}\n </ul>\n `;\n }\n\n get renderSecondaryActions() {\n if (!this.secondaryActions.length) return nothing;\n\n return this.secondaryActions.map((action) =>\n this.renderActionButton(action),\n );\n }\n\n /**\n * Render action as a link for secondary actions like admin, printdisability links.\n * @param action\n * @param initialButton\n */\n renderActionLink(action: ActionConfig, initialButton = false) {\n return html`<span class=\"${this.getDeviceType} ${action.className}\">\n <a\n class=\"ia-button ${action.className} ${initialButton ? 'initial' : ''}\"\n href=\"${action.url}\"\n target=${action.target}\n @click=${() => {\n this.clickHandler(\n action.id,\n action.analyticsEvent,\n action?.borrowType,\n );\n }}\n >\n ${action.id === 'purchaseBook' ? purchaseIcon : ''} ${action.text}\n <small>${action.subText}</small>\n </a>\n </span>`;\n }\n\n /**\n * Render action as a button for primary actions like browse, borrow, join waitlist etc...\n * @param action\n * @param initialButton\n */\n renderActionButton(action: ActionConfig, initialButton = false) {\n if (action.url) return this.renderActionLink(action, initialButton);\n const { analyticsEvent } = action;\n return html`<button\n class=\"ia-button ${action.className} ${initialButton ? 'initial' : ''}\"\n @click=${() => {\n this.clickHandler(action.id, analyticsEvent, action?.borrowType);\n }}\n >\n ${action.text}\n </button>`;\n }\n\n /**\n * Dispatches click events when patron clicks on action buttons\n * @param eventName actions like 'browseBook', 'borrowBook' etc...\n * @param gaEvent contains analytics event action and category\n * @param borrowType browse|borrow\n * @fires CollapsibleActionGroup#{eventName} - (will be browseBook, borrowBook etc...)\n */\n clickHandler(\n eventName: string,\n gaEvent?: AnalyticsEvent,\n borrowType = '',\n ): void {\n this.dropdownState = 'close';\n this.dropdownArrow = dropdownClosed;\n\n if (!gaEvent || !eventName) return;\n const { category, action } = gaEvent;\n this.dispatchEvent(\n new CustomEvent<ActionClickDetail>(eventName, {\n detail: {\n event: { category, action },\n borrowType,\n },\n }),\n );\n }\n\n /**\n * get first primary action to render just before dropdown button\n */\n get initialActionTemplate() {\n this.initialButton = false;\n if (this.primaryActions.length > 1) {\n this.initialButton = true;\n }\n\n return this.renderActionButton(this.primaryActions[0], this.initialButton);\n }\n\n get getPrimaryItems() {\n return this.primaryActions\n .slice(1)\n .map(\n (action) =>\n html`<li>${this.renderActionButton(action, this.initialButton)}</li>`,\n );\n }\n\n /**\n * get loader icon when task is in-progress\n */\n get getLoaderIcon() {\n return html`<img\n class=\"${classMap({\n actionloader: true,\n disabled: this.disabled,\n })}\"\n alt=\"\"\n src=\"${this.loaderIcon}\"\n />`;\n }\n\n /**\n * check if device is below tablet\n */\n get isBelowTabletContainer(): boolean {\n return this.width <= tabletContainerWidth;\n }\n\n /**\n * get device type as per container width\n * @returns mobile | desktop\n */\n get getDeviceType(): 'mobile' | 'desktop' {\n return this.isBelowTabletContainer ? 'mobile' : 'desktop';\n }\n\n /**\n * toggle dropdown and its icon state\n */\n toggleDropdown(): void {\n if (this.dropdownState === 'open') {\n this.dropdownState = 'close';\n this.dropdownArrow = dropdownClosed;\n this.primaryColor = this.primaryActions[0].className;\n } else {\n this.dropdownState = 'open';\n this.dropdownArrow = dropdownOpened;\n this.primaryColor = 'dark';\n }\n }\n\n static get styles(): CSSResultGroup {\n return [buttonBaseStyle, CollapsibleActionGroupStyle];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-book-actions-collapsible-action-group': IABookActionsCollapsibleActionGroup;\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement, type CSSResultGroup } from 'lit';
|
|
2
|
+
import '@internetarchive/icon-info/icon-info.js';
|
|
3
|
+
export declare class IABookActionsInfoIcon extends LitElement {
|
|
4
|
+
iconClass: string;
|
|
5
|
+
helpURL: string;
|
|
6
|
+
render(): import("lit").TemplateResult<1>;
|
|
7
|
+
static get styles(): CSSResultGroup;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
'ia-book-actions-info-icon': IABookActionsInfoIcon;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ia-book-actions-info-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-info-icon.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-info-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIjE,OAAO,yCAAyC,CAAC;AAEjD,qBAEa,qBAAsB,SAAQ,UAAU;IACvB,SAAS,SAAM;IAE3C,OAAO,SAAsE;IAE7E,MAAM;IAcN,MAAM,KAAK,MAAM,IAAI,cAAc,CAsBlC;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,2BAA2B,EAAE,qBAAqB,CAAC;KACpD;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { localized, msg } from '@lit/localize';
|
|
5
|
+
import { customElement } from '../../util/custom-element.js';
|
|
6
|
+
import '@internetarchive/icon-info/icon-info.js';
|
|
7
|
+
let IABookActionsInfoIcon = class IABookActionsInfoIcon extends LitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.iconClass = '';
|
|
11
|
+
this.helpURL = 'https://help.archive.org/help/borrowing-from-the-lending-library';
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return html `
|
|
15
|
+
<a
|
|
16
|
+
class="more-info-icon ${this.iconClass}"
|
|
17
|
+
href=${this.helpURL}
|
|
18
|
+
target="_blank"
|
|
19
|
+
title=${msg('Get more info on borrowing from The Lending Library')}
|
|
20
|
+
data-event-click-tracking="BookReader|BrowsableMoreInfo"
|
|
21
|
+
>
|
|
22
|
+
<ia-icon-info></ia-icon-info>
|
|
23
|
+
</a>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
static get styles() {
|
|
27
|
+
return css `
|
|
28
|
+
ia-icon-info {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
width: 18px;
|
|
31
|
+
height: 20px;
|
|
32
|
+
vertical-align: middle;
|
|
33
|
+
--iconFillColor: white;
|
|
34
|
+
}
|
|
35
|
+
.more-info-icon img {
|
|
36
|
+
width: 24px;
|
|
37
|
+
height: 24px;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
background: white;
|
|
40
|
+
}
|
|
41
|
+
.hidden {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
.visible {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ type: String })
|
|
52
|
+
], IABookActionsInfoIcon.prototype, "iconClass", void 0);
|
|
53
|
+
IABookActionsInfoIcon = __decorate([
|
|
54
|
+
customElement('ia-book-actions-info-icon'),
|
|
55
|
+
localized()
|
|
56
|
+
], IABookActionsInfoIcon);
|
|
57
|
+
export { IABookActionsInfoIcon };
|
|
58
|
+
//# sourceMappingURL=ia-book-actions-info-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-info-icon.js","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-info-icon.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,yCAAyC,CAAC;AAI1C,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAA9C;;QACuB,cAAS,GAAG,EAAE,CAAC;QAE3C,YAAO,GAAG,kEAAkE,CAAC;IAuC/E,CAAC;IArCC,MAAM;QACJ,OAAO,IAAI,CAAA;;gCAEiB,IAAI,CAAC,SAAS;eAC/B,IAAI,CAAC,OAAO;;gBAEX,GAAG,CAAC,qDAAqD,CAAC;;;;;KAKrE,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KAoBT,CAAC;IACJ,CAAC;CACF,CAAA;AAzC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAgB;AADhC,qBAAqB;IAFjC,aAAa,CAAC,2BAA2B,CAAC;IAC1C,SAAS,EAAE;GACC,qBAAqB,CA0CjC","sourcesContent":["import { css, html, LitElement, type CSSResultGroup } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { localized, msg } from '@lit/localize';\nimport { customElement } from '@src/util/custom-element';\nimport '@internetarchive/icon-info/icon-info.js';\n\n@customElement('ia-book-actions-info-icon')\n@localized()\nexport class IABookActionsInfoIcon extends LitElement {\n @property({ type: String }) iconClass = '';\n\n helpURL = 'https://help.archive.org/help/borrowing-from-the-lending-library';\n\n render() {\n return html`\n <a\n class=\"more-info-icon ${this.iconClass}\"\n href=${this.helpURL}\n target=\"_blank\"\n title=${msg('Get more info on borrowing from The Lending Library')}\n data-event-click-tracking=\"BookReader|BrowsableMoreInfo\"\n >\n <ia-icon-info></ia-icon-info>\n </a>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n ia-icon-info {\n display: inline-block;\n width: 18px;\n height: 20px;\n vertical-align: middle;\n --iconFillColor: white;\n }\n .more-info-icon img {\n width: 24px;\n height: 24px;\n vertical-align: middle;\n background: white;\n }\n .hidden {\n display: none;\n }\n .visible {\n display: inline-block;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-book-actions-info-icon': IABookActionsInfoIcon;\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement, type CSSResultGroup } from 'lit';
|
|
2
|
+
export declare class IABookActionsTextGroup extends LitElement {
|
|
3
|
+
texts: string;
|
|
4
|
+
textClass: string;
|
|
5
|
+
render(): import("lit").TemplateResult<1>;
|
|
6
|
+
static get styles(): CSSResultGroup;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'ia-book-actions-text-group': IABookActionsTextGroup;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ia-book-actions-text-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-text-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-text-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIjE,qBACa,sBAAuB,SAAQ,UAAU;IACxB,KAAK,SAAM;IAEX,SAAS,SAAM;IAE3C,MAAM;IAMN,MAAM,KAAK,MAAM,IAAI,cAAc,CAiBlC;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,sBAAsB,CAAC;KACtD;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { customElement } from '../../util/custom-element.js';
|
|
5
|
+
let IABookActionsTextGroup = class IABookActionsTextGroup extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.texts = '';
|
|
9
|
+
this.textClass = '';
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return html `
|
|
13
|
+
<span class="variable-texts ${this.textClass}">${this.texts}</span>
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
static get styles() {
|
|
17
|
+
return css `
|
|
18
|
+
:host {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
}
|
|
21
|
+
.variable-texts {
|
|
22
|
+
margin-right: 10px;
|
|
23
|
+
vertical-align: middle;
|
|
24
|
+
font-size: 1.7rem;
|
|
25
|
+
}
|
|
26
|
+
.hidden {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
.visible {
|
|
30
|
+
display: inline-block;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
property({ type: String })
|
|
37
|
+
], IABookActionsTextGroup.prototype, "texts", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ type: String })
|
|
40
|
+
], IABookActionsTextGroup.prototype, "textClass", void 0);
|
|
41
|
+
IABookActionsTextGroup = __decorate([
|
|
42
|
+
customElement('ia-book-actions-text-group')
|
|
43
|
+
], IABookActionsTextGroup);
|
|
44
|
+
export { IABookActionsTextGroup };
|
|
45
|
+
//# sourceMappingURL=ia-book-actions-text-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-text-group.js","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-text-group.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGlD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IAA/C;;QACuB,UAAK,GAAG,EAAE,CAAC;QAEX,cAAS,GAAG,EAAE,CAAC;IA0B7C,CAAC;IAxBC,MAAM;QACJ,OAAO,IAAI,CAAA;oCACqB,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,KAAK;KAC5D,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;KAeT,CAAC;IACJ,CAAC;CACF,CAAA;AA5B6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAY;AAEX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAgB;AAHhC,sBAAsB;IADlC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,sBAAsB,CA6BlC","sourcesContent":["import { css, html, LitElement, type CSSResultGroup } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\n\n@customElement('ia-book-actions-text-group')\nexport class IABookActionsTextGroup extends LitElement {\n @property({ type: String }) texts = '';\n\n @property({ type: String }) textClass = '';\n\n render() {\n return html`\n <span class=\"variable-texts ${this.textClass}\">${this.texts}</span>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n :host {\n display: inline-block;\n }\n .variable-texts {\n margin-right: 10px;\n vertical-align: middle;\n font-size: 1.7rem;\n }\n .hidden {\n display: none;\n }\n .visible {\n display: inline-block;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-book-actions-text-group': IABookActionsTextGroup;\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement, type CSSResultGroup } from 'lit';
|
|
2
|
+
export declare class IABookActionsTimerCountdown extends LitElement {
|
|
3
|
+
secondsLeftOnLoan: number;
|
|
4
|
+
displayTime: boolean;
|
|
5
|
+
get minutesLeftOnLoan(): string;
|
|
6
|
+
/**
|
|
7
|
+
* get remaining time with timeunit, always in the plural
|
|
8
|
+
*
|
|
9
|
+
* @return string - minutes left
|
|
10
|
+
*/
|
|
11
|
+
get remainingTime(): string;
|
|
12
|
+
render(): import("lit").TemplateResult<1>;
|
|
13
|
+
static get styles(): CSSResultGroup;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'ia-book-actions-timer-countdown': IABookActionsTimerCountdown;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ia-book-actions-timer-countdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-timer-countdown.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-timer-countdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIjE,qBACa,2BAA4B,SAAQ,UAAU;IAC7B,iBAAiB,SAAK;IAErB,WAAW,UAAS;IAEjD,IAAI,iBAAiB,IAAI,MAAM,CAW9B;IAED;;;;OAIG;IACH,IAAI,aAAa,IAAI,MAAM,CAK1B;IAED,MAAM;IAkBN,MAAM,KAAK,MAAM,IAAI,cAAc,CA+BlC;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iCAAiC,EAAE,2BAA2B,CAAC;KAChE;CACF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { customElement } from '../../util/custom-element.js';
|
|
5
|
+
let IABookActionsTimerCountdown = class IABookActionsTimerCountdown extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.secondsLeftOnLoan = 0;
|
|
9
|
+
this.displayTime = false;
|
|
10
|
+
}
|
|
11
|
+
get minutesLeftOnLoan() {
|
|
12
|
+
// convert time from second to minute
|
|
13
|
+
const timeLeft = Math.ceil(Math.round(this.secondsLeftOnLoan) / 60);
|
|
14
|
+
if (timeLeft < 10) {
|
|
15
|
+
return `0:0${timeLeft}`;
|
|
16
|
+
}
|
|
17
|
+
if (timeLeft === 60) {
|
|
18
|
+
return `1:00`;
|
|
19
|
+
}
|
|
20
|
+
return `0:${timeLeft}`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* get remaining time with timeunit, always in the plural
|
|
24
|
+
*
|
|
25
|
+
* @return string - minutes left
|
|
26
|
+
*/
|
|
27
|
+
get remainingTime() {
|
|
28
|
+
const unitOfTime = 'minute';
|
|
29
|
+
const timeLeft = this.minutesLeftOnLoan;
|
|
30
|
+
return `${timeLeft} ${unitOfTime}s`;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const viewClass = this.displayTime ? 'view' : 'hide';
|
|
34
|
+
return html `
|
|
35
|
+
<button
|
|
36
|
+
id="timer-counter"
|
|
37
|
+
class=${viewClass}
|
|
38
|
+
@click=${() => {
|
|
39
|
+
this.displayTime = !this.displayTime;
|
|
40
|
+
}}
|
|
41
|
+
role="timer"
|
|
42
|
+
>
|
|
43
|
+
<span>${this.minutesLeftOnLoan} - </span>
|
|
44
|
+
<span class="second">${Number(this.secondsLeftOnLoan)}</span>
|
|
45
|
+
<span class="sr-only">${this.remainingTime} left</span>
|
|
46
|
+
</button>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
static get styles() {
|
|
50
|
+
return css `
|
|
51
|
+
:host {
|
|
52
|
+
right: 0;
|
|
53
|
+
margin-right: 10px;
|
|
54
|
+
position: absolute;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sr-only {
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: -9999px;
|
|
60
|
+
width: 1px;
|
|
61
|
+
height: 1px;
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
border: none;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button#timer-counter {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hide {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.show {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: Number })
|
|
84
|
+
], IABookActionsTimerCountdown.prototype, "secondsLeftOnLoan", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ type: Boolean })
|
|
87
|
+
], IABookActionsTimerCountdown.prototype, "displayTime", void 0);
|
|
88
|
+
IABookActionsTimerCountdown = __decorate([
|
|
89
|
+
customElement('ia-book-actions-timer-countdown')
|
|
90
|
+
], IABookActionsTimerCountdown);
|
|
91
|
+
export { IABookActionsTimerCountdown };
|
|
92
|
+
//# sourceMappingURL=ia-book-actions-timer-countdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-book-actions-timer-countdown.js","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions-timer-countdown.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EA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AAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BT,CAAC;IACJ,CAAC;CACF,CAAA;AA/E6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAAuB;AAErB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gEAAqB;AAHtC,2BAA2B;IADvC,aAAa,CAAC,iCAAiC,CAAC;GACpC,2BAA2B,CAgFvC","sourcesContent":["import { css, html, LitElement, type CSSResultGroup } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\n\n@customElement('ia-book-actions-timer-countdown')\nexport class IABookActionsTimerCountdown extends LitElement {\n @property({ type: Number }) secondsLeftOnLoan = 0;\n\n @property({ type: Boolean }) displayTime = false;\n\n get minutesLeftOnLoan(): string {\n // convert time from second to minute\n const timeLeft = Math.ceil(Math.round(this.secondsLeftOnLoan) / 60);\n\n if (timeLeft < 10) {\n return `0:0${timeLeft}`;\n }\n if (timeLeft === 60) {\n return `1:00`;\n }\n return `0:${timeLeft}`;\n }\n\n /**\n * get remaining time with timeunit, always in the plural\n *\n * @return string - minutes left\n */\n get remainingTime(): string {\n const unitOfTime = 'minute';\n const timeLeft = this.minutesLeftOnLoan;\n\n return `${timeLeft} ${unitOfTime}s`;\n }\n\n render() {\n const viewClass = this.displayTime ? 'view' : 'hide';\n return html`\n <button\n id=\"timer-counter\"\n class=${viewClass}\n @click=${() => {\n this.displayTime = !this.displayTime;\n }}\n role=\"timer\"\n >\n <span>${this.minutesLeftOnLoan} - </span>\n <span class=\"second\">${Number(this.secondsLeftOnLoan)}</span>\n <span class=\"sr-only\">${this.remainingTime} left</span>\n </button>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n :host {\n right: 0;\n margin-right: 10px;\n position: absolute;\n }\n\n .sr-only {\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n margin: 0;\n padding: 0;\n border: none;\n overflow: hidden;\n }\n\n button#timer-counter {\n cursor: pointer;\n }\n\n .hide {\n opacity: 0;\n }\n\n .show {\n opacity: 1;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-book-actions-timer-countdown': IABookActionsTimerCountdown;\n }\n}\n"]}
|