@sparkle-learning/core 0.0.35 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{header-mobile-collapse_2.cjs.entry.js → header-mobile-collapse.cjs.entry.js} +0 -22
- package/dist/cjs/ion-avatar.cjs.entry.js +25 -0
- package/dist/cjs/ion-button.cjs.entry.js +129 -0
- package/dist/cjs/ion-card-title.cjs.entry.js +30 -0
- package/dist/cjs/ion-card_2.cjs.entry.js +91 -0
- package/dist/cjs/ion-icon_13.cjs.entry.js +1505 -0
- package/dist/cjs/ion-input_2.cjs.entry.js +313 -0
- package/dist/cjs/ion-label_2.cjs.entry.js +126 -0
- package/dist/cjs/ion-spinner.cjs.entry.js +64 -0
- package/dist/cjs/ion-textarea.cjs.entry.js +248 -0
- package/dist/cjs/ion-toggle.cjs.entry.js +177 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sparkle-core.cjs.js +1 -1
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +120 -0
- package/dist/cjs/{sparkle-quiz.cjs.entry.js → sparkle-quiz-v1.cjs.entry.js} +4 -4
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +30 -28
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz.css → sparkle-quiz/sparkle-quiz.css} +0 -0
- package/dist/collection/components/sparkle-quiz/sparkle-quiz/sparkle-quiz.js +327 -0
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-v1.css +48 -0
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz.js → sparkle-quiz-v1.js} +4 -4
- package/dist/esm/{PrivateRoute-530ef873.js → PrivateRoute-7b526801.js} +2 -2
- package/dist/esm/{active-router-9843e205.js → active-router-fc9e4e06.js} +1 -1
- package/dist/esm/{animation-d98d3e81.js → animation-e0716b39.js} +1 -1
- package/dist/esm/{app-globals-08edc964.js → app-globals-3f0347b0.js} +1 -1
- package/dist/esm/{auth.service-79389d86.js → auth.service-9fb86455.js} +3 -3
- package/dist/esm/{auth.store-b812b34b.js → auth.store-633e8414.js} +1 -1
- package/dist/esm/compass-svg.entry.js +1 -1
- package/dist/esm/context-consumer.entry.js +1 -1
- package/dist/esm/course-select.entry.js +1 -1
- package/dist/esm/{dom-utils-8e73e88b.js → dom-utils-109a7d75.js} +1 -1
- package/dist/esm/{facilitator.service-7babc526.js → facilitator.service-8fd435bf.js} +2 -2
- package/dist/esm/{feed.service-80fbe79d.js → feed.service-ace049e5.js} +2 -2
- package/dist/esm/{framework-delegate-9b329182.js → framework-delegate-e4f8013b.js} +1 -1
- package/dist/esm/{haptic-3a76a65c.js → haptic-522f76f2.js} +1 -1
- package/dist/esm/{header-mobile-collapse_2.entry.js → header-mobile-collapse.entry.js} +3 -24
- package/dist/esm/{helpers-94a5855b.js → helpers-03073fe4.js} +1 -1
- package/dist/esm/{httpService-b2b7a1ad.js → httpService-61864992.js} +2 -2
- package/dist/esm/{icons-16f1a80b.js → icons-90b957ab.js} +1 -1
- package/dist/esm/{index-c23a1826.js → index-37004831.js} +2 -2
- package/dist/esm/{index-4ec6b9c2.js → index-4044fde9.js} +1 -1
- package/dist/esm/{index-230a26c9.js → index-a2d2941d.js} +1 -1
- package/dist/esm/{index-478745be.js → index-b4b4e503.js} +4 -4
- package/dist/esm/{index-9db08224.js → index-c04b9ed5.js} +1 -1
- package/dist/esm/{index-95307148.js → index-dedabca0.js} +3 -3
- package/dist/esm/{index-ab1c6a9f.js → index-f9b9ba5d.js} +2 -2
- package/dist/esm/{index.es-1c3b1ef3.js → index.es-283fbd2e.js} +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/{injectHistory-4bfff188.js → injectHistory-968f626d.js} +1 -1
- package/dist/esm/{input-shims-ce5c01df.js → input-shims-cc3720a0.js} +2 -2
- package/dist/esm/ion-accordion-group.entry.js +2 -2
- package/dist/esm/ion-accordion.entry.js +4 -4
- package/dist/esm/ion-action-sheet_4.entry.js +8 -8
- package/dist/esm/ion-app.entry.js +5 -5
- package/dist/esm/ion-avatar.entry.js +21 -0
- package/dist/esm/ion-back-button.entry.js +4 -4
- package/dist/esm/ion-backdrop.entry.js +2 -2
- package/dist/esm/ion-badge.entry.js +2 -2
- package/dist/esm/ion-breadcrumb.entry.js +4 -4
- package/dist/esm/ion-breadcrumbs.entry.js +2 -2
- package/dist/esm/ion-button.entry.js +125 -0
- package/dist/esm/ion-buttons_3.entry.js +2 -2
- package/dist/esm/ion-card-header.entry.js +2 -2
- package/dist/esm/ion-card-subtitle.entry.js +2 -2
- package/dist/esm/ion-card-title.entry.js +26 -0
- package/dist/esm/ion-card_2.entry.js +86 -0
- package/dist/esm/ion-checkbox_4.entry.js +3 -3
- package/dist/esm/ion-chip.entry.js +2 -2
- package/dist/esm/ion-col_3.entry.js +2 -2
- package/dist/esm/ion-content_2.entry.js +4 -4
- package/dist/esm/ion-datetime-button.entry.js +3 -3
- package/dist/esm/ion-datetime.entry.js +4 -4
- package/dist/esm/ion-fab-button.entry.js +4 -4
- package/dist/esm/ion-fab-list.entry.js +2 -2
- package/dist/esm/ion-fab.entry.js +2 -2
- package/dist/esm/ion-footer.entry.js +4 -4
- package/dist/esm/ion-icon_13.entry.js +1489 -0
- package/dist/esm/ion-img.entry.js +3 -3
- package/dist/esm/ion-infinite-scroll-content.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll.entry.js +4 -4
- package/dist/esm/ion-input_2.entry.js +308 -0
- package/dist/esm/ion-item-divider.entry.js +2 -2
- package/dist/esm/ion-item-group.entry.js +2 -2
- package/dist/esm/ion-item-option.entry.js +2 -2
- package/dist/esm/ion-item-options.entry.js +3 -3
- package/dist/esm/ion-item-sliding.entry.js +4 -4
- package/dist/esm/ion-label_2.entry.js +121 -0
- package/dist/esm/ion-loading.entry.js +5 -5
- package/dist/esm/ion-menu-button.entry.js +7 -7
- package/dist/esm/ion-menu-toggle.entry.js +6 -6
- package/dist/esm/ion-menu.entry.js +6 -6
- package/dist/esm/ion-modal.entry.js +8 -8
- package/dist/esm/ion-nav-link.entry.js +1 -1
- package/dist/esm/ion-nav.entry.js +6 -6
- package/dist/esm/ion-picker-column-internal_2.entry.js +4 -4
- package/dist/esm/ion-picker-column.entry.js +4 -4
- package/dist/esm/ion-picker.entry.js +5 -5
- package/dist/esm/ion-progress-bar.entry.js +3 -3
- package/dist/esm/ion-refresher-content.entry.js +3 -3
- package/dist/esm/ion-refresher.entry.js +6 -6
- package/dist/esm/ion-reorder-group.entry.js +5 -5
- package/dist/esm/ion-reorder.entry.js +3 -3
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +2 -2
- package/dist/esm/ion-router-outlet.entry.js +6 -6
- package/dist/esm/ion-router.entry.js +2 -2
- package/dist/esm/ion-searchbar.entry.js +4 -4
- package/dist/esm/ion-segment-button.entry.js +3 -3
- package/dist/esm/ion-segment.entry.js +3 -3
- package/dist/esm/ion-select_2.entry.js +4 -4
- package/dist/esm/ion-skeleton-text.entry.js +2 -2
- package/dist/esm/ion-slide.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +3 -3
- package/dist/esm/ion-spinner.entry.js +60 -0
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar.entry.js +2 -2
- package/dist/esm/ion-tab-button.entry.js +2 -2
- package/dist/esm/ion-tab.entry.js +3 -3
- package/dist/esm/ion-tabs.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +244 -0
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +5 -5
- package/dist/esm/ion-toggle.entry.js +173 -0
- package/dist/esm/ion-virtual-scroll.entry.js +2 -2
- package/dist/esm/{ionic-global-293e882b.js → ionic-global-4903e23e.js} +1 -1
- package/dist/esm/{ios.transition-7cd34deb.js → ios.transition-3a6179bb.js} +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{md.transition-2589a5b1.js → md.transition-cff16bf3.js} +4 -4
- package/dist/esm/{menu-toggle-util-f92ba2f0.js → menu-toggle-util-59241733.js} +1 -1
- package/dist/esm/{overlays-dfa730c8.js → overlays-bdd9344a.js} +2 -2
- package/dist/esm/{purify-79af871f.js → purify-7085b248.js} +1 -1
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-card_3.entry.js +2 -2
- package/dist/esm/sparkle-character-intro.entry.js +1 -1
- package/dist/esm/sparkle-code.entry.js +2 -2
- package/dist/esm/sparkle-compass-post.entry.js +1 -1
- package/dist/esm/sparkle-compass.entry.js +1 -1
- package/dist/esm/sparkle-core.js +4 -4
- package/dist/esm/sparkle-course-root.entry.js +11 -11
- package/dist/esm/sparkle-dropdown.entry.js +2 -2
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/sparkle-export-lessons_6.entry.js +11 -11
- package/dist/esm/sparkle-facilitator-header_19.entry.js +17 -17
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +7 -7
- package/dist/esm/sparkle-feed-post.entry.js +116 -0
- package/dist/esm/sparkle-feedback.entry.js +8 -8
- package/dist/esm/sparkle-goal-form.entry.js +7 -7
- package/dist/esm/sparkle-goal-progress.entry.js +1 -1
- package/dist/esm/sparkle-gww-comment-list.entry.js +1 -1
- package/dist/esm/sparkle-gww-graph.entry.js +1 -1
- package/dist/esm/sparkle-gww-item.entry.js +4 -4
- package/dist/esm/sparkle-intro.entry.js +1 -1
- package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- package/dist/esm/sparkle-menu-toggle_3.entry.js +3 -3
- package/dist/esm/sparkle-modal-image.entry.js +1 -1
- package/dist/esm/sparkle-notfound-page.entry.js +1 -1
- package/dist/esm/sparkle-overlay.entry.js +1 -1
- package/dist/esm/sparkle-poll.entry.js +1 -1
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/{sparkle-quiz.entry.js → sparkle-quiz-v1.entry.js} +5 -5
- package/dist/esm/sparkle-select.entry.js +1 -1
- package/dist/esm/sparkle-sidebar.entry.js +1 -1
- package/dist/esm/sparkle-tab.entry.js +1 -1
- package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
- package/dist/esm/sparkle-tabs.entry.js +1 -1
- package/dist/esm/sparkle-validation-error.entry.js +1 -1
- package/dist/esm/sparkle-youtube.entry.js +1 -1
- package/dist/esm/{status-tap-79b6199d.js → status-tap-463d0f87.js} +3 -3
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/stencil-router-redirect.entry.js +2 -2
- package/dist/esm/{student.service-0caed0f4.js → student.service-e6eb1f99.js} +2 -2
- package/dist/esm/{swipe-back-ad7a0361.js → swipe-back-f8765ac9.js} +1 -1
- package/dist/esm/{user.store-8477642a.js → user.store-b8645067.js} +1 -1
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-0147266a.js +1 -0
- package/dist/sparkle-core/{p-4c9e010d.entry.js → p-014b5707.entry.js} +1 -1
- package/dist/sparkle-core/p-03585916.js +1 -0
- package/dist/sparkle-core/{p-9ef14088.entry.js → p-04c7b276.entry.js} +1 -1
- package/dist/sparkle-core/{p-4af496a8.entry.js → p-06642405.entry.js} +1 -1
- package/dist/sparkle-core/{p-0b92326d.entry.js → p-06c7d0f2.entry.js} +1 -1
- package/dist/sparkle-core/p-08d97c59.entry.js +1 -0
- package/dist/sparkle-core/p-0bb0cf41.entry.js +1 -0
- package/dist/sparkle-core/{p-136b93d5.entry.js → p-0c0f8acd.entry.js} +1 -1
- package/dist/sparkle-core/p-0ea2518d.entry.js +1 -0
- package/dist/sparkle-core/{p-fe3a7bca.js → p-1019ebc3.js} +1 -1
- package/dist/sparkle-core/p-162bff1a.entry.js +1 -0
- package/dist/sparkle-core/{p-27075abe.js → p-17eb4633.js} +1 -1
- package/dist/sparkle-core/p-1b1ba156.entry.js +1 -0
- package/dist/sparkle-core/{p-b00d0a47.entry.js → p-1e4782af.entry.js} +1 -1
- package/dist/sparkle-core/{p-c8ad5a5b.entry.js → p-1f0b3ff9.entry.js} +2 -2
- package/dist/sparkle-core/{p-3ef53ebf.entry.js → p-214d1229.entry.js} +1 -1
- package/dist/sparkle-core/p-25e556cc.entry.js +1 -0
- package/dist/sparkle-core/{p-bae8cd7d.entry.js → p-27fbabc3.entry.js} +1 -1
- package/dist/sparkle-core/{p-e6d39f6e.entry.js → p-285ab4ed.entry.js} +1 -1
- package/dist/sparkle-core/{p-d220a642.entry.js → p-2ba70507.entry.js} +1 -1
- package/dist/sparkle-core/{p-5a3de051.entry.js → p-2d4a5ddf.entry.js} +2 -2
- package/dist/sparkle-core/p-2d9659e2.entry.js +1 -0
- package/dist/sparkle-core/p-2e035338.entry.js +1 -0
- package/dist/sparkle-core/{p-c9f474d0.js → p-2e2b813c.js} +1 -1
- package/dist/sparkle-core/{p-df5efe0d.entry.js → p-2f10208d.entry.js} +1 -1
- package/dist/sparkle-core/p-2fba9a3a.entry.js +1 -0
- package/dist/sparkle-core/p-317037de.entry.js +1 -0
- package/dist/sparkle-core/p-32762a44.entry.js +1 -0
- package/dist/sparkle-core/p-32f4e565.entry.js +1 -0
- package/dist/sparkle-core/{p-23d713e2.js → p-340754ed.js} +1 -1
- package/dist/sparkle-core/{p-7b21bd70.entry.js → p-352677e6.entry.js} +1 -1
- package/dist/sparkle-core/p-370609ba.entry.js +1 -0
- package/dist/sparkle-core/{p-fea20ec2.entry.js → p-38b7cf68.entry.js} +1 -1
- package/dist/sparkle-core/{p-c5eb4404.entry.js → p-3963e02b.entry.js} +1 -1
- package/dist/sparkle-core/p-3bc68dd0.js +1 -0
- package/dist/sparkle-core/p-3c133235.entry.js +1 -0
- package/dist/sparkle-core/{p-308517b3.js → p-3f85e1ca.js} +2 -2
- package/dist/sparkle-core/p-4053ecdb.entry.js +1 -0
- package/dist/sparkle-core/{p-1394cbb8.js → p-405f7c58.js} +2 -2
- package/dist/sparkle-core/{p-d6a3a639.entry.js → p-4320dac0.entry.js} +1 -1
- package/dist/sparkle-core/p-44f813b7.entry.js +1 -0
- package/dist/sparkle-core/p-46869031.entry.js +1 -0
- package/dist/sparkle-core/{p-17aef6f9.js → p-4a5f2b2b.js} +1 -1
- package/dist/sparkle-core/p-4ae75caa.entry.js +1 -0
- package/dist/sparkle-core/{p-a05871e6.js → p-4c6a7e52.js} +1 -1
- package/dist/sparkle-core/{p-d6637b48.entry.js → p-5096739e.entry.js} +1 -1
- package/dist/sparkle-core/p-5322c920.entry.js +1 -0
- package/dist/sparkle-core/p-539bf742.js +4 -0
- package/dist/sparkle-core/{p-2bd4c60e.js → p-53bcbd1d.js} +1 -1
- package/dist/sparkle-core/{p-11ed6b7f.entry.js → p-54ada5e3.entry.js} +1 -1
- package/dist/sparkle-core/{p-5979f253.entry.js → p-5519d283.entry.js} +1 -1
- package/dist/sparkle-core/p-554da5b8.entry.js +1 -0
- package/dist/sparkle-core/{p-8d630960.js → p-56a2e8a2.js} +1 -1
- package/dist/sparkle-core/{p-d0d0e5e5.entry.js → p-5893bbe5.entry.js} +1 -1
- package/dist/sparkle-core/{p-b8ba8164.entry.js → p-594a6982.entry.js} +1 -1
- package/dist/sparkle-core/{p-34ebfc8a.entry.js → p-5c435d5a.entry.js} +1 -1
- package/dist/sparkle-core/p-5da2d95a.entry.js +1 -0
- package/dist/sparkle-core/{p-1c2aee9c.js → p-5fc26938.js} +1 -1
- package/dist/sparkle-core/{p-16b7974e.entry.js → p-601397df.entry.js} +1 -1
- package/dist/sparkle-core/{p-dff8325e.js → p-604a7987.js} +1 -1
- package/dist/sparkle-core/{p-58f74119.entry.js → p-616941c6.entry.js} +1 -1
- package/dist/sparkle-core/{p-fe214d79.entry.js → p-6316d124.entry.js} +1 -1
- package/dist/sparkle-core/p-63f69cdc.entry.js +1 -0
- package/dist/sparkle-core/p-63f71ada.entry.js +1 -0
- package/dist/sparkle-core/p-64e814b9.entry.js +1 -0
- package/dist/sparkle-core/{p-0c603495.entry.js → p-66a85393.entry.js} +1 -1
- package/dist/sparkle-core/{p-ea4a9f0d.entry.js → p-69487d90.entry.js} +1 -1
- package/dist/sparkle-core/p-6b05a1d3.entry.js +1 -0
- package/dist/sparkle-core/{p-9dc42d70.entry.js → p-6c894fa2.entry.js} +1 -1
- package/dist/sparkle-core/p-6ea246fe.js +4 -0
- package/dist/sparkle-core/p-6ed0236e.entry.js +1 -0
- package/dist/sparkle-core/{p-34d93a39.entry.js → p-6f0545b3.entry.js} +1 -1
- package/dist/sparkle-core/{p-8cbe019a.entry.js → p-727e1c28.entry.js} +1 -1
- package/dist/sparkle-core/p-81714d94.entry.js +1 -0
- package/dist/sparkle-core/{p-3d2c0e24.entry.js → p-82ad4e7c.entry.js} +2 -2
- package/dist/sparkle-core/p-859563db.entry.js +1 -0
- package/dist/sparkle-core/p-865f36a8.entry.js +1 -0
- package/dist/sparkle-core/{p-01743e3e.js → p-871106e0.js} +1 -1
- package/dist/sparkle-core/p-8a41b502.entry.js +1 -0
- package/dist/sparkle-core/p-8c74cbb6.entry.js +1 -0
- package/dist/sparkle-core/p-91accfc1.js +1 -0
- package/dist/sparkle-core/p-93e74f1b.entry.js +1 -0
- package/dist/sparkle-core/{p-6ae9c743.entry.js → p-975b99ee.entry.js} +1 -1
- package/dist/sparkle-core/p-99ee9919.js +1 -0
- package/dist/sparkle-core/{p-3fd92216.entry.js → p-9e309b3e.entry.js} +1 -1
- package/dist/sparkle-core/p-9e7fee8f.entry.js +1 -0
- package/dist/sparkle-core/{p-280e938d.js → p-a019ad0c.js} +1 -1
- package/dist/sparkle-core/{p-06af1bc8.entry.js → p-a2638250.entry.js} +1 -1
- package/dist/sparkle-core/{p-e1743d82.entry.js → p-a2ebcf0a.entry.js} +1 -1
- package/dist/sparkle-core/p-a5c5da9a.entry.js +1 -0
- package/dist/sparkle-core/{p-966817ec.js → p-a85598ad.js} +1 -1
- package/dist/sparkle-core/p-a8a77bec.entry.js +1 -0
- package/dist/sparkle-core/{p-ba775d8e.entry.js → p-a98d7ebe.entry.js} +1 -1
- package/dist/sparkle-core/{p-ed3dfd89.js → p-ad102371.js} +2 -2
- package/dist/sparkle-core/{p-bd2c8e30.entry.js → p-b236d258.entry.js} +2 -2
- package/dist/sparkle-core/{p-0127a61a.entry.js → p-b4b01fa2.entry.js} +1 -1
- package/dist/sparkle-core/{p-9a383065.entry.js → p-b4bc8b02.entry.js} +2 -2
- package/dist/sparkle-core/{p-767c9db8.entry.js → p-b5ec8fb0.entry.js} +1 -1
- package/dist/sparkle-core/{p-0798d46a.entry.js → p-b83444c7.entry.js} +1 -1
- package/dist/sparkle-core/{p-fde96f7c.js → p-b9933822.js} +1 -1
- package/dist/sparkle-core/p-b9b1d4da.entry.js +1 -0
- package/dist/sparkle-core/{p-3810777d.js → p-be28346b.js} +1 -1
- package/dist/sparkle-core/{p-3c752205.entry.js → p-c278db5f.entry.js} +1 -1
- package/dist/sparkle-core/p-c2990b24.entry.js +1 -0
- package/dist/sparkle-core/{p-a6c1a55a.entry.js → p-c2bbaf55.entry.js} +1 -1
- package/dist/sparkle-core/{p-16c81890.entry.js → p-c4af184b.entry.js} +1 -1
- package/dist/sparkle-core/p-c71cbbf7.entry.js +1 -0
- package/dist/sparkle-core/p-c8c73fa7.js +4 -0
- package/dist/sparkle-core/p-c8fe45df.entry.js +1 -0
- package/dist/sparkle-core/{p-7b3d1457.js → p-c9cd4ff1.js} +1 -1
- package/dist/sparkle-core/{p-a19b42f0.js → p-ca4c8a10.js} +1 -1
- package/dist/sparkle-core/p-cab3da3c.entry.js +1 -0
- package/dist/sparkle-core/p-cc518c36.entry.js +1 -0
- package/dist/sparkle-core/p-cd832fbf.entry.js +1 -0
- package/dist/sparkle-core/{p-085eb951.entry.js → p-ce94efdb.entry.js} +1 -1
- package/dist/sparkle-core/p-cffd4817.entry.js +1 -0
- package/dist/sparkle-core/{p-e09de7ac.js → p-d0ac5f17.js} +1 -1
- package/dist/sparkle-core/{p-9cd95e7e.entry.js → p-d0adf726.entry.js} +1 -1
- package/dist/sparkle-core/p-d1fcbfc2.js +4 -0
- package/dist/sparkle-core/p-d20e4fcf.entry.js +1 -0
- package/dist/sparkle-core/p-d24e53ab.entry.js +1 -0
- package/dist/sparkle-core/p-d288e6c1.entry.js +1 -0
- package/dist/sparkle-core/p-d432d3ac.entry.js +1 -0
- package/dist/sparkle-core/{p-785f1879.entry.js → p-d601810e.entry.js} +1 -1
- package/dist/sparkle-core/{p-ea7d7a3b.js → p-d81a0680.js} +1 -1
- package/dist/sparkle-core/{p-58389020.entry.js → p-d969f7d0.entry.js} +3 -3
- package/dist/sparkle-core/p-dabc80c4.entry.js +1 -0
- package/dist/sparkle-core/{p-351b82a8.entry.js → p-db8387eb.entry.js} +1 -1
- package/dist/sparkle-core/{p-4e0502b8.entry.js → p-dca90a55.entry.js} +1 -1
- package/dist/sparkle-core/{p-506f3c5f.js → p-dd2e7f84.js} +2 -2
- package/dist/sparkle-core/p-e0429a19.entry.js +1 -0
- package/dist/sparkle-core/{p-d5b8302f.entry.js → p-e249aebf.entry.js} +1 -1
- package/dist/sparkle-core/p-e3e36ce9.entry.js +1 -0
- package/dist/sparkle-core/{p-fdb9a613.entry.js → p-e421d638.entry.js} +1 -1
- package/dist/sparkle-core/p-e65c72cc.entry.js +1 -0
- package/dist/sparkle-core/{p-b2827978.entry.js → p-e7066c64.entry.js} +1 -1
- package/dist/sparkle-core/{p-4338e1e3.js → p-e7568d4b.js} +1 -1
- package/dist/sparkle-core/{p-efe37368.entry.js → p-e8988989.entry.js} +1 -1
- package/dist/sparkle-core/{p-6a337ad1.entry.js → p-ea962e1b.entry.js} +1 -1
- package/dist/sparkle-core/p-eb40a191.entry.js +1 -0
- package/dist/sparkle-core/{p-bb575dba.entry.js → p-ecdea569.entry.js} +1 -1
- package/dist/sparkle-core/p-ed9f48c4.entry.js +1 -0
- package/dist/sparkle-core/{p-6a5ace01.js → p-ee1e0eb4.js} +1 -1
- package/dist/sparkle-core/{p-a111c567.entry.js → p-ef6c2352.entry.js} +1 -1
- package/dist/sparkle-core/p-f0cf4a8f.entry.js +1 -0
- package/dist/sparkle-core/{p-defeaa5c.entry.js → p-f4b0b6a4.entry.js} +1 -1
- package/dist/sparkle-core/{p-1701723e.entry.js → p-fc965b88.entry.js} +1 -1
- package/dist/sparkle-core/p-fd8d0738.entry.js +4 -0
- package/dist/sparkle-core/{p-63d8a5b7.entry.js → p-fda95b6e.entry.js} +1 -1
- package/dist/sparkle-core/{p-9b4979b5.entry.js → p-fde382f0.entry.js} +1 -1
- package/dist/sparkle-core/{p-3eb56165.entry.js → p-fe6dc976.entry.js} +1 -1
- package/dist/sparkle-core/{p-f63a13d8.entry.js → p-ff0e0d4e.entry.js} +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/sparkle-quiz/sparkle-quiz/sparkle-quiz.d.ts +42 -0
- package/dist/types/components/sparkle-quiz/sparkle-quiz-v1.d.ts +41 -0
- package/dist/types/components/sparkle-quiz/sparkle-quiz.d.ts +36 -36
- package/dist/types/components.d.ts +37 -1
- package/package.json +1 -1
- package/dist/cjs/ion-avatar_16.cjs.entry.js +0 -1907
- package/dist/cjs/ion-range.cjs.entry.js +0 -515
- package/dist/cjs/ion-text.cjs.entry.js +0 -24
- package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +0 -117
- package/dist/cjs/stencil-route-link.cjs.entry.js +0 -77
- package/dist/esm/ion-avatar_16.entry.js +0 -1888
- package/dist/esm/ion-range.entry.js +0 -511
- package/dist/esm/ion-text.entry.js +0 -20
- package/dist/esm/sparkle-quiz-feedback_5.entry.js +0 -109
- package/dist/esm/stencil-route-link.entry.js +0 -73
- package/dist/sparkle-core/p-0d7cceaa.entry.js +0 -1
- package/dist/sparkle-core/p-0d813026.entry.js +0 -1
- package/dist/sparkle-core/p-122427b7.entry.js +0 -1
- package/dist/sparkle-core/p-12c4f45c.entry.js +0 -1
- package/dist/sparkle-core/p-14340143.entry.js +0 -4
- package/dist/sparkle-core/p-14a06a91.entry.js +0 -1
- package/dist/sparkle-core/p-180857a2.entry.js +0 -1
- package/dist/sparkle-core/p-1acc7870.entry.js +0 -1
- package/dist/sparkle-core/p-1cd4c3cc.entry.js +0 -1
- package/dist/sparkle-core/p-21d9833d.js +0 -1
- package/dist/sparkle-core/p-25c13612.entry.js +0 -1
- package/dist/sparkle-core/p-2699868a.entry.js +0 -1
- package/dist/sparkle-core/p-2c89a6c2.entry.js +0 -1
- package/dist/sparkle-core/p-3227afcb.entry.js +0 -1
- package/dist/sparkle-core/p-363a2d6d.js +0 -4
- package/dist/sparkle-core/p-36c48760.entry.js +0 -1
- package/dist/sparkle-core/p-384911d7.entry.js +0 -1
- package/dist/sparkle-core/p-3b618eda.entry.js +0 -1
- package/dist/sparkle-core/p-442eadcf.entry.js +0 -1
- package/dist/sparkle-core/p-4d0dfbc9.js +0 -1
- package/dist/sparkle-core/p-524a6174.entry.js +0 -1
- package/dist/sparkle-core/p-53aac9d7.entry.js +0 -1
- package/dist/sparkle-core/p-56700a40.entry.js +0 -1
- package/dist/sparkle-core/p-5722be24.entry.js +0 -1
- package/dist/sparkle-core/p-5a850731.entry.js +0 -1
- package/dist/sparkle-core/p-5dcf33fb.entry.js +0 -1
- package/dist/sparkle-core/p-5e8fa1ac.entry.js +0 -1
- package/dist/sparkle-core/p-5ef50959.js +0 -1
- package/dist/sparkle-core/p-615b8f64.entry.js +0 -1
- package/dist/sparkle-core/p-76206f80.entry.js +0 -1
- package/dist/sparkle-core/p-76a6e202.entry.js +0 -1
- package/dist/sparkle-core/p-788735b9.entry.js +0 -1
- package/dist/sparkle-core/p-8e42e634.entry.js +0 -1
- package/dist/sparkle-core/p-8e56f9ee.entry.js +0 -1
- package/dist/sparkle-core/p-8ed0cefb.entry.js +0 -1
- package/dist/sparkle-core/p-9484e34b.entry.js +0 -1
- package/dist/sparkle-core/p-969e98e5.entry.js +0 -1
- package/dist/sparkle-core/p-98f3925b.js +0 -4
- package/dist/sparkle-core/p-99231c00.js +0 -4
- package/dist/sparkle-core/p-9eea81f2.js +0 -1
- package/dist/sparkle-core/p-a2f7c751.entry.js +0 -1
- package/dist/sparkle-core/p-a458b415.entry.js +0 -1
- package/dist/sparkle-core/p-ab3a8f5e.entry.js +0 -1
- package/dist/sparkle-core/p-ac0e4d8c.entry.js +0 -1
- package/dist/sparkle-core/p-bb3e3482.entry.js +0 -1
- package/dist/sparkle-core/p-c48352cf.js +0 -4
- package/dist/sparkle-core/p-ca0edc9b.entry.js +0 -1
- package/dist/sparkle-core/p-cb04b18a.entry.js +0 -1
- package/dist/sparkle-core/p-d38a2511.entry.js +0 -1
- package/dist/sparkle-core/p-d5ba8e80.entry.js +0 -1
- package/dist/sparkle-core/p-d6788642.entry.js +0 -1
- package/dist/sparkle-core/p-d86f8633.entry.js +0 -1
- package/dist/sparkle-core/p-df5cfa7f.entry.js +0 -1
- package/dist/sparkle-core/p-e28a106d.entry.js +0 -1
- package/dist/sparkle-core/p-e566c0b3.entry.js +0 -1
- package/dist/sparkle-core/p-f187d129.entry.js +0 -1
- package/dist/sparkle-core/p-f5e7bfa5.js +0 -1
- package/dist/sparkle-core/p-ff26d891.entry.js +0 -1
@@ -1,1888 +0,0 @@
|
|
1
|
-
import { c as getAssetPath, r as registerInstance, h, H as Host, e as createEvent, i as getElement, f as forceUpdate, j as readTask, w as writeTask } from './index-9db08224.js';
|
2
|
-
import { g as getIonMode$1, c as config } from './ionic-global-293e882b.js';
|
3
|
-
import { h as hasShadowDom, i as inheritAriaAttributes, d as debounceEvent, b as inheritAttributes$1, e as findItemLabel, j as raf, k as getAriaLabel, l as renderHiddenInput } from './helpers-94a5855b.js';
|
4
|
-
import { o as openURL, c as createColorClasses$1, h as hostContext } from './theme-7ef00c83.js';
|
5
|
-
import { c as chevronForward, a as checkmarkOutline, r as removeOutline, e as ellipseOutline } from './index-4ec6b9c2.js';
|
6
|
-
import { p as printIonError } from './index-dad75b83.js';
|
7
|
-
import { S as SPINNERS } from './spinner-configs-a37e628a.js';
|
8
|
-
import { h as hapticSelection } from './haptic-3a76a65c.js';
|
9
|
-
import { i as isRTL } from './dir-03012648.js';
|
10
|
-
import { E as EnvironmentConfigService } from './environment-config.service-2b5d692b.js';
|
11
|
-
import './auth.store-b812b34b.js';
|
12
|
-
|
13
|
-
let CACHED_MAP;
|
14
|
-
const getIconMap = () => {
|
15
|
-
if (typeof window === 'undefined') {
|
16
|
-
return new Map();
|
17
|
-
}
|
18
|
-
else {
|
19
|
-
if (!CACHED_MAP) {
|
20
|
-
const win = window;
|
21
|
-
win.Ionicons = win.Ionicons || {};
|
22
|
-
CACHED_MAP = win.Ionicons.map = win.Ionicons.map || new Map();
|
23
|
-
}
|
24
|
-
return CACHED_MAP;
|
25
|
-
}
|
26
|
-
};
|
27
|
-
const getUrl = (i) => {
|
28
|
-
let url = getSrc(i.src);
|
29
|
-
if (url) {
|
30
|
-
return url;
|
31
|
-
}
|
32
|
-
url = getName(i.name, i.icon, i.mode, i.ios, i.md);
|
33
|
-
if (url) {
|
34
|
-
return getNamedUrl(url);
|
35
|
-
}
|
36
|
-
if (i.icon) {
|
37
|
-
url = getSrc(i.icon);
|
38
|
-
if (url) {
|
39
|
-
return url;
|
40
|
-
}
|
41
|
-
url = getSrc(i.icon[i.mode]);
|
42
|
-
if (url) {
|
43
|
-
return url;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
return null;
|
47
|
-
};
|
48
|
-
const getNamedUrl = (iconName) => {
|
49
|
-
const url = getIconMap().get(iconName);
|
50
|
-
if (url) {
|
51
|
-
return url;
|
52
|
-
}
|
53
|
-
return getAssetPath(`svg/${iconName}.svg`);
|
54
|
-
};
|
55
|
-
const getName = (iconName, icon, mode, ios, md) => {
|
56
|
-
// default to "md" if somehow the mode wasn't set
|
57
|
-
mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
|
58
|
-
// if an icon was passed in using the ios or md attributes
|
59
|
-
// set the iconName to whatever was passed in
|
60
|
-
if (ios && mode === 'ios') {
|
61
|
-
iconName = toLower(ios);
|
62
|
-
}
|
63
|
-
else if (md && mode === 'md') {
|
64
|
-
iconName = toLower(md);
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
if (!iconName && icon && !isSrc(icon)) {
|
68
|
-
iconName = icon;
|
69
|
-
}
|
70
|
-
if (isStr(iconName)) {
|
71
|
-
iconName = toLower(iconName);
|
72
|
-
}
|
73
|
-
}
|
74
|
-
if (!isStr(iconName) || iconName.trim() === '') {
|
75
|
-
return null;
|
76
|
-
}
|
77
|
-
// only allow alpha characters and dash
|
78
|
-
const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
79
|
-
if (invalidChars !== '') {
|
80
|
-
return null;
|
81
|
-
}
|
82
|
-
return iconName;
|
83
|
-
};
|
84
|
-
const getSrc = (src) => {
|
85
|
-
if (isStr(src)) {
|
86
|
-
src = src.trim();
|
87
|
-
if (isSrc(src)) {
|
88
|
-
return src;
|
89
|
-
}
|
90
|
-
}
|
91
|
-
return null;
|
92
|
-
};
|
93
|
-
const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
94
|
-
const isStr = (val) => typeof val === 'string';
|
95
|
-
const toLower = (val) => val.toLowerCase();
|
96
|
-
/**
|
97
|
-
* Elements inside of web components sometimes need to inherit global attributes
|
98
|
-
* set on the host. For example, the inner input in `ion-input` should inherit
|
99
|
-
* the `title` attribute that developers set directly on `ion-input`. This
|
100
|
-
* helper function should be called in componentWillLoad and assigned to a variable
|
101
|
-
* that is later used in the render function.
|
102
|
-
*
|
103
|
-
* This does not need to be reactive as changing attributes on the host element
|
104
|
-
* does not trigger a re-render.
|
105
|
-
*/
|
106
|
-
const inheritAttributes = (el, attributes = []) => {
|
107
|
-
const attributeObject = {};
|
108
|
-
attributes.forEach(attr => {
|
109
|
-
if (el.hasAttribute(attr)) {
|
110
|
-
const value = el.getAttribute(attr);
|
111
|
-
if (value !== null) {
|
112
|
-
attributeObject[attr] = el.getAttribute(attr);
|
113
|
-
}
|
114
|
-
el.removeAttribute(attr);
|
115
|
-
}
|
116
|
-
});
|
117
|
-
return attributeObject;
|
118
|
-
};
|
119
|
-
|
120
|
-
const avatarIosCss = ":host{border-radius:var(--border-radius);display:block}::slotted(ion-img),::slotted(img){border-radius:var(--border-radius);width:100%;height:100%;object-fit:cover;overflow:hidden}:host{--border-radius:50%;width:48px;height:48px}";
|
121
|
-
|
122
|
-
const avatarMdCss = ":host{border-radius:var(--border-radius);display:block}::slotted(ion-img),::slotted(img){border-radius:var(--border-radius);width:100%;height:100%;object-fit:cover;overflow:hidden}:host{--border-radius:50%;width:64px;height:64px}";
|
123
|
-
|
124
|
-
const Avatar = class {
|
125
|
-
constructor(hostRef) {
|
126
|
-
registerInstance(this, hostRef);
|
127
|
-
}
|
128
|
-
render() {
|
129
|
-
return (h(Host, { class: getIonMode$1(this) }, h("slot", null)));
|
130
|
-
}
|
131
|
-
};
|
132
|
-
Avatar.style = {
|
133
|
-
ios: avatarIosCss,
|
134
|
-
md: avatarMdCss
|
135
|
-
};
|
136
|
-
|
137
|
-
const buttonIosCss = ":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color, opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-0.03em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1}:host(.button-outline){--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary, #3880ff);--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;--color-activated:var(--ion-color-primary-contrast, #fff)}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;font-size:17px;font-weight:normal;letter-spacing:0}:host(.button-large){--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-strong){font-weight:600}:host(.button-clear.ion-activated){opacity:0.4}:host(.button-outline.ion-activated.ion-color) .button-native{color:var(--ion-color-contrast)}:host(.button-outline.ion-activated.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}:host(.button-outline.ion-focused.ion-color) .button-native,:host(.button-clear.ion-focused.ion-color) .button-native{color:var(--ion-color-base)}:host(.button-outline.ion-focused.ion-color) .button-native::after,:host(.button-clear.ion-focused.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.button-clear:hover),:host(.button-outline:hover){opacity:0.6}:host(.button-clear.ion-color:hover) .button-native,:host(.button-outline.ion-color:hover) .button-native{color:var(--ion-color-base)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:transparent}:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}:host(:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native::after{background:#fff;opacity:0.1}}";
|
138
|
-
|
139
|
-
const buttonMdCss = ":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),\n background-color 15ms linear,\n color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:transparent;--background-hover:var(--ion-color-primary-contrast, #fff);--background-focused:var(--ion-color-primary-contrast, #fff);--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}:host(.button-solid.ion-activated){--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12)}:host(.button-outline){--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-outline.ion-activated.ion-color) .button-native{background:transparent}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-large){--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-strong){font-weight:bold}::slotted(ion-icon[slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color.ion-focused) .button-native::after,:host(.button-outline.ion-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}";
|
140
|
-
|
141
|
-
const Button = class {
|
142
|
-
constructor(hostRef) {
|
143
|
-
registerInstance(this, hostRef);
|
144
|
-
this.ionFocus = createEvent(this, "ionFocus", 7);
|
145
|
-
this.ionBlur = createEvent(this, "ionBlur", 7);
|
146
|
-
this.inItem = false;
|
147
|
-
this.inListHeader = false;
|
148
|
-
this.inToolbar = false;
|
149
|
-
this.inheritedAttributes = {};
|
150
|
-
/**
|
151
|
-
* The type of button.
|
152
|
-
*/
|
153
|
-
this.buttonType = 'button';
|
154
|
-
/**
|
155
|
-
* If `true`, the user cannot interact with the button.
|
156
|
-
*/
|
157
|
-
this.disabled = false;
|
158
|
-
/**
|
159
|
-
* When using a router, it specifies the transition direction when navigating to
|
160
|
-
* another page using `href`.
|
161
|
-
*/
|
162
|
-
this.routerDirection = 'forward';
|
163
|
-
/**
|
164
|
-
* If `true`, activates a button with a heavier font weight.
|
165
|
-
*/
|
166
|
-
this.strong = false;
|
167
|
-
/**
|
168
|
-
* The type of the button.
|
169
|
-
*/
|
170
|
-
this.type = 'button';
|
171
|
-
this.handleClick = (ev) => {
|
172
|
-
if (this.type === 'button') {
|
173
|
-
openURL(this.href, ev, this.routerDirection, this.routerAnimation);
|
174
|
-
}
|
175
|
-
else if (hasShadowDom(this.el)) {
|
176
|
-
// this button wants to specifically submit a form
|
177
|
-
// climb up the dom to see if we're in a <form>
|
178
|
-
// and if so, then use JS to submit it
|
179
|
-
const form = this.el.closest('form');
|
180
|
-
if (form) {
|
181
|
-
ev.preventDefault();
|
182
|
-
const fakeButton = document.createElement('button');
|
183
|
-
fakeButton.type = this.type;
|
184
|
-
fakeButton.style.display = 'none';
|
185
|
-
form.appendChild(fakeButton);
|
186
|
-
fakeButton.click();
|
187
|
-
fakeButton.remove();
|
188
|
-
}
|
189
|
-
}
|
190
|
-
};
|
191
|
-
this.onFocus = () => {
|
192
|
-
this.ionFocus.emit();
|
193
|
-
};
|
194
|
-
this.onBlur = () => {
|
195
|
-
this.ionBlur.emit();
|
196
|
-
};
|
197
|
-
}
|
198
|
-
componentWillLoad() {
|
199
|
-
this.inToolbar = !!this.el.closest('ion-buttons');
|
200
|
-
this.inListHeader = !!this.el.closest('ion-list-header');
|
201
|
-
this.inItem = !!this.el.closest('ion-item') || !!this.el.closest('ion-item-divider');
|
202
|
-
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
203
|
-
}
|
204
|
-
get hasIconOnly() {
|
205
|
-
return !!this.el.querySelector('[slot="icon-only"]');
|
206
|
-
}
|
207
|
-
get rippleType() {
|
208
|
-
const hasClearFill = this.fill === undefined || this.fill === 'clear';
|
209
|
-
// If the button is in a toolbar, has a clear fill (which is the default)
|
210
|
-
// and only has an icon we use the unbounded "circular" ripple effect
|
211
|
-
if (hasClearFill && this.hasIconOnly && this.inToolbar) {
|
212
|
-
return 'unbounded';
|
213
|
-
}
|
214
|
-
return 'bounded';
|
215
|
-
}
|
216
|
-
render() {
|
217
|
-
const mode = getIonMode$1(this);
|
218
|
-
const { buttonType, type, disabled, rel, target, size, href, color, expand, hasIconOnly, shape, strong, inheritedAttributes, } = this;
|
219
|
-
const finalSize = size === undefined && this.inItem ? 'small' : size;
|
220
|
-
const TagType = href === undefined ? 'button' : 'a';
|
221
|
-
const attrs = TagType === 'button'
|
222
|
-
? { type }
|
223
|
-
: {
|
224
|
-
download: this.download,
|
225
|
-
href,
|
226
|
-
rel,
|
227
|
-
target,
|
228
|
-
};
|
229
|
-
let fill = this.fill;
|
230
|
-
if (fill === undefined) {
|
231
|
-
fill = this.inToolbar || this.inListHeader ? 'clear' : 'solid';
|
232
|
-
}
|
233
|
-
return (h(Host, { onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: createColorClasses$1(color, {
|
234
|
-
[mode]: true,
|
235
|
-
[buttonType]: true,
|
236
|
-
[`${buttonType}-${expand}`]: expand !== undefined,
|
237
|
-
[`${buttonType}-${finalSize}`]: finalSize !== undefined,
|
238
|
-
[`${buttonType}-${shape}`]: shape !== undefined,
|
239
|
-
[`${buttonType}-${fill}`]: true,
|
240
|
-
[`${buttonType}-strong`]: strong,
|
241
|
-
'in-toolbar': hostContext('ion-toolbar', this.el),
|
242
|
-
'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
243
|
-
'button-has-icon-only': hasIconOnly,
|
244
|
-
'button-disabled': disabled,
|
245
|
-
'ion-activatable': true,
|
246
|
-
'ion-focusable': true,
|
247
|
-
}) }, h(TagType, Object.assign({}, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }, inheritedAttributes), h("span", { class: "button-inner" }, h("slot", { name: "icon-only" }), h("slot", { name: "start" }), h("slot", null), h("slot", { name: "end" })), mode === 'md' && h("ion-ripple-effect", { type: this.rippleType }))));
|
248
|
-
}
|
249
|
-
get el() { return getElement(this); }
|
250
|
-
};
|
251
|
-
Button.style = {
|
252
|
-
ios: buttonIosCss,
|
253
|
-
md: buttonMdCss
|
254
|
-
};
|
255
|
-
|
256
|
-
const cardIosCss = ":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-600, #666666)));margin-left:16px;margin-right:16px;margin-top:24px;margin-bottom:24px;border-radius:8px;transform:translateZ(0);transition:transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);font-size:14px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}:host(.ion-activated){transform:scale3d(0.97, 0.97, 1)}";
|
257
|
-
|
258
|
-
const cardMdCss = ":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-550, #737373)));margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;border-radius:4px;font-size:14px;box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}";
|
259
|
-
|
260
|
-
const Card = class {
|
261
|
-
constructor(hostRef) {
|
262
|
-
registerInstance(this, hostRef);
|
263
|
-
/**
|
264
|
-
* If `true`, a button tag will be rendered and the card will be tappable.
|
265
|
-
*/
|
266
|
-
this.button = false;
|
267
|
-
/**
|
268
|
-
* The type of the button. Only used when an `onclick` or `button` property is present.
|
269
|
-
*/
|
270
|
-
this.type = 'button';
|
271
|
-
/**
|
272
|
-
* If `true`, the user cannot interact with the card.
|
273
|
-
*/
|
274
|
-
this.disabled = false;
|
275
|
-
/**
|
276
|
-
* When using a router, it specifies the transition direction when navigating to
|
277
|
-
* another page using `href`.
|
278
|
-
*/
|
279
|
-
this.routerDirection = 'forward';
|
280
|
-
}
|
281
|
-
isClickable() {
|
282
|
-
return this.href !== undefined || this.button;
|
283
|
-
}
|
284
|
-
renderCard(mode) {
|
285
|
-
const clickable = this.isClickable();
|
286
|
-
if (!clickable) {
|
287
|
-
return [h("slot", null)];
|
288
|
-
}
|
289
|
-
const { href, routerAnimation, routerDirection } = this;
|
290
|
-
const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div';
|
291
|
-
const attrs = TagType === 'button'
|
292
|
-
? { type: this.type }
|
293
|
-
: {
|
294
|
-
download: this.download,
|
295
|
-
href: this.href,
|
296
|
-
rel: this.rel,
|
297
|
-
target: this.target,
|
298
|
-
};
|
299
|
-
return (h(TagType, Object.assign({}, attrs, { class: "card-native", part: "native", disabled: this.disabled, onClick: (ev) => openURL(href, ev, routerDirection, routerAnimation) }), h("slot", null), clickable && mode === 'md' && h("ion-ripple-effect", null)));
|
300
|
-
}
|
301
|
-
render() {
|
302
|
-
const mode = getIonMode$1(this);
|
303
|
-
return (h(Host, { class: createColorClasses$1(this.color, {
|
304
|
-
[mode]: true,
|
305
|
-
'card-disabled': this.disabled,
|
306
|
-
'ion-activatable': this.isClickable(),
|
307
|
-
}) }, this.renderCard(mode)));
|
308
|
-
}
|
309
|
-
};
|
310
|
-
Card.style = {
|
311
|
-
ios: cardIosCss,
|
312
|
-
md: cardMdCss
|
313
|
-
};
|
314
|
-
|
315
|
-
const cardContentIosCss = "ion-card-content{display:block;position:relative}.card-content-ios{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:16px;line-height:1.4}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}.card-content-ios h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-ios h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-ios h3,.card-content-ios h4,.card-content-ios h5,.card-content-ios h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-ios p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px}ion-card-header+.card-content-ios{padding-top:0}";
|
316
|
-
|
317
|
-
const cardContentMdCss = "ion-card-content{display:block;position:relative}.card-content-md{padding-left:16px;padding-right:16px;padding-top:13px;padding-bottom:13px;font-size:14px;line-height:1.5}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.card-content-md h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-md h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-md h3,.card-content-md h4,.card-content-md h5,.card-content-md h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-md p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:1.5}ion-card-header+.card-content-md{padding-top:0}";
|
318
|
-
|
319
|
-
const CardContent = class {
|
320
|
-
constructor(hostRef) {
|
321
|
-
registerInstance(this, hostRef);
|
322
|
-
}
|
323
|
-
render() {
|
324
|
-
const mode = getIonMode$1(this);
|
325
|
-
return (h(Host, { class: {
|
326
|
-
[mode]: true,
|
327
|
-
// Used internally for styling
|
328
|
-
[`card-content-${mode}`]: true,
|
329
|
-
} }));
|
330
|
-
}
|
331
|
-
};
|
332
|
-
CardContent.style = {
|
333
|
-
ios: cardContentIosCss,
|
334
|
-
md: cardContentMdCss
|
335
|
-
};
|
336
|
-
|
337
|
-
const cardTitleIosCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}";
|
338
|
-
|
339
|
-
const cardTitleMdCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}";
|
340
|
-
|
341
|
-
const CardTitle = class {
|
342
|
-
constructor(hostRef) {
|
343
|
-
registerInstance(this, hostRef);
|
344
|
-
}
|
345
|
-
render() {
|
346
|
-
const mode = getIonMode$1(this);
|
347
|
-
return (h(Host, { role: "heading", "aria-level": "2", class: createColorClasses$1(this.color, {
|
348
|
-
'ion-inherit-color': true,
|
349
|
-
[mode]: true,
|
350
|
-
}) }, h("slot", null)));
|
351
|
-
}
|
352
|
-
};
|
353
|
-
CardTitle.style = {
|
354
|
-
ios: cardTitleIosCss,
|
355
|
-
md: cardTitleMdCss
|
356
|
-
};
|
357
|
-
|
358
|
-
const validateContent = (svgContent) => {
|
359
|
-
const div = document.createElement('div');
|
360
|
-
div.innerHTML = svgContent;
|
361
|
-
// setup this way to ensure it works on our buddy IE
|
362
|
-
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
363
|
-
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
364
|
-
div.removeChild(div.childNodes[i]);
|
365
|
-
}
|
366
|
-
}
|
367
|
-
// must only have 1 root element
|
368
|
-
const svgElm = div.firstElementChild;
|
369
|
-
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
370
|
-
const svgClass = svgElm.getAttribute('class') || '';
|
371
|
-
svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
|
372
|
-
// root element must be an svg
|
373
|
-
// lets double check we've got valid elements
|
374
|
-
// do not allow scripts
|
375
|
-
if (isValid(svgElm)) {
|
376
|
-
return div.innerHTML;
|
377
|
-
}
|
378
|
-
}
|
379
|
-
return '';
|
380
|
-
};
|
381
|
-
const isValid = (elm) => {
|
382
|
-
if (elm.nodeType === 1) {
|
383
|
-
if (elm.nodeName.toLowerCase() === 'script') {
|
384
|
-
return false;
|
385
|
-
}
|
386
|
-
for (let i = 0; i < elm.attributes.length; i++) {
|
387
|
-
const val = elm.attributes[i].value;
|
388
|
-
if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {
|
389
|
-
return false;
|
390
|
-
}
|
391
|
-
}
|
392
|
-
for (let i = 0; i < elm.childNodes.length; i++) {
|
393
|
-
if (!isValid(elm.childNodes[i])) {
|
394
|
-
return false;
|
395
|
-
}
|
396
|
-
}
|
397
|
-
}
|
398
|
-
return true;
|
399
|
-
};
|
400
|
-
|
401
|
-
const ioniconContent = new Map();
|
402
|
-
const requests = new Map();
|
403
|
-
const getSvgContent = (url, sanitize) => {
|
404
|
-
// see if we already have a request for this url
|
405
|
-
let req = requests.get(url);
|
406
|
-
if (!req) {
|
407
|
-
if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
|
408
|
-
// we don't already have a request
|
409
|
-
req = fetch(url).then((rsp) => {
|
410
|
-
if (rsp.ok) {
|
411
|
-
return rsp.text().then((svgContent) => {
|
412
|
-
if (svgContent && sanitize !== false) {
|
413
|
-
svgContent = validateContent(svgContent);
|
414
|
-
}
|
415
|
-
ioniconContent.set(url, svgContent || '');
|
416
|
-
});
|
417
|
-
}
|
418
|
-
ioniconContent.set(url, '');
|
419
|
-
});
|
420
|
-
// cache for the same requests
|
421
|
-
requests.set(url, req);
|
422
|
-
}
|
423
|
-
else {
|
424
|
-
// set to empty for ssr scenarios and resolve promise
|
425
|
-
ioniconContent.set(url, '');
|
426
|
-
return Promise.resolve();
|
427
|
-
}
|
428
|
-
}
|
429
|
-
return req;
|
430
|
-
};
|
431
|
-
|
432
|
-
const iconCss = ":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host(.icon-small){font-size:18px !important}:host(.icon-large){font-size:32px !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";
|
433
|
-
|
434
|
-
const Icon = class {
|
435
|
-
constructor(hostRef) {
|
436
|
-
registerInstance(this, hostRef);
|
437
|
-
this.iconName = null;
|
438
|
-
this.inheritedAttributes = {};
|
439
|
-
this.isVisible = false;
|
440
|
-
/**
|
441
|
-
* The mode determines which platform styles to use.
|
442
|
-
*/
|
443
|
-
this.mode = getIonMode();
|
444
|
-
/**
|
445
|
-
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
|
446
|
-
* Default, `false`.
|
447
|
-
*/
|
448
|
-
this.lazy = false;
|
449
|
-
/**
|
450
|
-
* When set to `false`, SVG content that is HTTP fetched will not be checked
|
451
|
-
* if the response SVG content has any `<script>` elements, or any attributes
|
452
|
-
* that start with `on`, such as `onclick`.
|
453
|
-
* @default true
|
454
|
-
*/
|
455
|
-
this.sanitize = true;
|
456
|
-
this.hasAriaHidden = () => {
|
457
|
-
const { el } = this;
|
458
|
-
return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
|
459
|
-
};
|
460
|
-
}
|
461
|
-
componentWillLoad() {
|
462
|
-
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
463
|
-
}
|
464
|
-
connectedCallback() {
|
465
|
-
// purposely do not return the promise here because loading
|
466
|
-
// the svg file should not hold up loading the app
|
467
|
-
// only load the svg if it's visible
|
468
|
-
this.waitUntilVisible(this.el, '50px', () => {
|
469
|
-
this.isVisible = true;
|
470
|
-
this.loadIcon();
|
471
|
-
});
|
472
|
-
}
|
473
|
-
disconnectedCallback() {
|
474
|
-
if (this.io) {
|
475
|
-
this.io.disconnect();
|
476
|
-
this.io = undefined;
|
477
|
-
}
|
478
|
-
}
|
479
|
-
waitUntilVisible(el, rootMargin, cb) {
|
480
|
-
if (this.lazy && typeof window !== 'undefined' && window.IntersectionObserver) {
|
481
|
-
const io = (this.io = new window.IntersectionObserver((data) => {
|
482
|
-
if (data[0].isIntersecting) {
|
483
|
-
io.disconnect();
|
484
|
-
this.io = undefined;
|
485
|
-
cb();
|
486
|
-
}
|
487
|
-
}, { rootMargin }));
|
488
|
-
io.observe(el);
|
489
|
-
}
|
490
|
-
else {
|
491
|
-
// browser doesn't support IntersectionObserver
|
492
|
-
// so just fallback to always show it
|
493
|
-
cb();
|
494
|
-
}
|
495
|
-
}
|
496
|
-
loadIcon() {
|
497
|
-
if (this.isVisible) {
|
498
|
-
const url = getUrl(this);
|
499
|
-
if (url) {
|
500
|
-
if (ioniconContent.has(url)) {
|
501
|
-
// sync if it's already loaded
|
502
|
-
this.svgContent = ioniconContent.get(url);
|
503
|
-
}
|
504
|
-
else {
|
505
|
-
// async if it hasn't been loaded
|
506
|
-
getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(url)));
|
507
|
-
}
|
508
|
-
}
|
509
|
-
}
|
510
|
-
const label = this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
|
511
|
-
/**
|
512
|
-
* Come up with a default label
|
513
|
-
* in case user does not provide their own.
|
514
|
-
*/
|
515
|
-
if (label) {
|
516
|
-
this.ariaLabel = label.replace(/\-/g, ' ');
|
517
|
-
}
|
518
|
-
}
|
519
|
-
render() {
|
520
|
-
const { iconName, ariaLabel, inheritedAttributes } = this;
|
521
|
-
const mode = this.mode || 'md';
|
522
|
-
const flipRtl = this.flipRtl ||
|
523
|
-
(iconName &&
|
524
|
-
(iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) &&
|
525
|
-
this.flipRtl !== false);
|
526
|
-
/**
|
527
|
-
* Only set the aria-label if a) we have generated
|
528
|
-
* one for the icon and if aria-hidden is not set to "true".
|
529
|
-
* If developer wants to set their own aria-label, then
|
530
|
-
* inheritedAttributes down below will override whatever
|
531
|
-
* default label we have set.
|
532
|
-
*/
|
533
|
-
return (h(Host, Object.assign({ "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': !!flipRtl && this.el.ownerDocument.dir === 'rtl' }) }, inheritedAttributes), this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
|
534
|
-
}
|
535
|
-
static get assetsDirs() { return ["svg"]; }
|
536
|
-
get el() { return getElement(this); }
|
537
|
-
static get watchers() { return {
|
538
|
-
"name": ["loadIcon"],
|
539
|
-
"src": ["loadIcon"],
|
540
|
-
"icon": ["loadIcon"]
|
541
|
-
}; }
|
542
|
-
};
|
543
|
-
const getIonMode = () => (typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
|
544
|
-
const createColorClasses = (color) => {
|
545
|
-
return color
|
546
|
-
? {
|
547
|
-
'ion-color': true,
|
548
|
-
[`ion-color-${color}`]: true,
|
549
|
-
}
|
550
|
-
: null;
|
551
|
-
};
|
552
|
-
Icon.style = iconCss;
|
553
|
-
|
554
|
-
const inputIosCss = ".sc-ion-input-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--background:transparent;--color:initial;display:flex;position:relative;flex:1;align-items:center;width:100%;padding:0 !important;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);z-index:2}ion-item.sc-ion-input-ios-h:not(.item-label),ion-item:not(.item-label) .sc-ion-input-ios-h{--padding-start:0}.ion-color.sc-ion-input-ios-h{color:var(--ion-color-base)}.native-input.sc-ion-input-ios{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:inline-block;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-input.sc-ion-input-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-input.sc-ion-input-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-ios:-webkit-autofill{background-color:transparent}.native-input.sc-ion-input-ios:invalid{box-shadow:none}.native-input.sc-ion-input-ios::-ms-clear{display:none}.native-input[disabled].sc-ion-input-ios{opacity:0.4}.cloned-input.sc-ion-input-ios{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-input-ios .cloned-input.sc-ion-input-ios,[dir=rtl].sc-ion-input-ios-h .cloned-input.sc-ion-input-ios,[dir=rtl] .sc-ion-input-ios-h .cloned-input.sc-ion-input-ios{left:unset;right:unset;right:0}.input-clear-icon.sc-ion-input-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;background-position:center;border:0;outline:none;background-color:transparent;background-repeat:no-repeat;visibility:hidden;appearance:none}.input-clear-icon.sc-ion-input-ios:focus{opacity:0.5}.has-value.sc-ion-input-ios-h .input-clear-icon.sc-ion-input-ios{visibility:visible}.has-focus.sc-ion-input-ios-h{pointer-events:none}.has-focus.sc-ion-input-ios-h input.sc-ion-input-ios,.has-focus.sc-ion-input-ios-h a.sc-ion-input-ios,.has-focus.sc-ion-input-ios-h button.sc-ion-input-ios{pointer-events:auto}.item-label-floating.item-has-placeholder.sc-ion-input-ios-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-input-ios-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-input-ios-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-input-ios-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-input-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:0;font-size:inherit}.item-label-stacked.sc-ion-input-ios-h,.item-label-stacked .sc-ion-input-ios-h,.item-label-floating.sc-ion-input-ios-h,.item-label-floating .sc-ion-input-ios-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}.input-clear-icon.sc-ion-input-ios{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'><path%20fill='var(--ion-color-step-600,%20%23666666)'%20d='M403.1,108.9c-81.2-81.2-212.9-81.2-294.2,0s-81.2,212.9,0,294.2c81.2,81.2,212.9,81.2,294.2,0S484.3,190.1,403.1,108.9z%20M352,340.2L340.2,352l-84.4-84.2l-84,83.8L160,339.8l84-83.8l-84-83.8l11.8-11.8l84,83.8l84.4-84.2l11.8,11.8L267.6,256L352,340.2z'/></svg>\");width:30px;height:30px;background-size:18px}";
|
555
|
-
|
556
|
-
const inputMdCss = ".sc-ion-input-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--background:transparent;--color:initial;display:flex;position:relative;flex:1;align-items:center;width:100%;padding:0 !important;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);z-index:2}ion-item.sc-ion-input-md-h:not(.item-label),ion-item:not(.item-label) .sc-ion-input-md-h{--padding-start:0}.ion-color.sc-ion-input-md-h{color:var(--ion-color-base)}.native-input.sc-ion-input-md{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:inline-block;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-input.sc-ion-input-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-input.sc-ion-input-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md:-webkit-autofill{background-color:transparent}.native-input.sc-ion-input-md:invalid{box-shadow:none}.native-input.sc-ion-input-md::-ms-clear{display:none}.native-input[disabled].sc-ion-input-md{opacity:0.4}.cloned-input.sc-ion-input-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-input-md .cloned-input.sc-ion-input-md,[dir=rtl].sc-ion-input-md-h .cloned-input.sc-ion-input-md,[dir=rtl] .sc-ion-input-md-h .cloned-input.sc-ion-input-md{left:unset;right:unset;right:0}.input-clear-icon.sc-ion-input-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;background-position:center;border:0;outline:none;background-color:transparent;background-repeat:no-repeat;visibility:hidden;appearance:none}.input-clear-icon.sc-ion-input-md:focus{opacity:0.5}.has-value.sc-ion-input-md-h .input-clear-icon.sc-ion-input-md{visibility:visible}.has-focus.sc-ion-input-md-h{pointer-events:none}.has-focus.sc-ion-input-md-h input.sc-ion-input-md,.has-focus.sc-ion-input-md-h a.sc-ion-input-md,.has-focus.sc-ion-input-md-h button.sc-ion-input-md{pointer-events:auto}.item-label-floating.item-has-placeholder.sc-ion-input-md-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-input-md-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-input-md-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-input-md-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-input-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:10px;--padding-start:8px;font-size:inherit}.item-label-stacked.sc-ion-input-md-h,.item-label-stacked .sc-ion-input-md-h,.item-label-floating.sc-ion-input-md-h,.item-label-floating .sc-ion-input-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}.input-clear-icon.sc-ion-input-md{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'><polygon%20fill='var(--ion-color-step-600,%20%23666666)'%20points='405,136.798%20375.202,107%20256,226.202%20136.798,107%20107,136.798%20226.202,256%20107,375.202%20136.798,405%20256,285.798%20375.202,405%20405,375.202%20285.798,256'/></svg>\");width:30px;height:30px;background-size:22px}";
|
557
|
-
|
558
|
-
const Input = class {
|
559
|
-
constructor(hostRef) {
|
560
|
-
registerInstance(this, hostRef);
|
561
|
-
this.ionInput = createEvent(this, "ionInput", 7);
|
562
|
-
this.ionChange = createEvent(this, "ionChange", 7);
|
563
|
-
this.ionBlur = createEvent(this, "ionBlur", 7);
|
564
|
-
this.ionFocus = createEvent(this, "ionFocus", 7);
|
565
|
-
this.ionStyle = createEvent(this, "ionStyle", 7);
|
566
|
-
this.inputId = `ion-input-${inputIds++}`;
|
567
|
-
this.didBlurAfterEdit = false;
|
568
|
-
this.inheritedAttributes = {};
|
569
|
-
this.isComposing = false;
|
570
|
-
/**
|
571
|
-
* This is required for a WebKit bug which requires us to
|
572
|
-
* blur and focus an input to properly focus the input in
|
573
|
-
* an item with delegatesFocus. It will no longer be needed
|
574
|
-
* with iOS 14.
|
575
|
-
*
|
576
|
-
* @internal
|
577
|
-
*/
|
578
|
-
this.fireFocusEvents = true;
|
579
|
-
this.hasFocus = false;
|
580
|
-
/**
|
581
|
-
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
582
|
-
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
583
|
-
*/
|
584
|
-
this.autocapitalize = 'off';
|
585
|
-
/**
|
586
|
-
* Indicates whether the value of the control can be automatically completed by the browser.
|
587
|
-
*/
|
588
|
-
this.autocomplete = 'off';
|
589
|
-
/**
|
590
|
-
* Whether auto correction should be enabled when the user is entering/editing the text value.
|
591
|
-
*/
|
592
|
-
this.autocorrect = 'off';
|
593
|
-
/**
|
594
|
-
* This Boolean attribute lets you specify that a form control should have input focus when the page loads.
|
595
|
-
*/
|
596
|
-
this.autofocus = false;
|
597
|
-
/**
|
598
|
-
* If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.
|
599
|
-
*/
|
600
|
-
this.clearInput = false;
|
601
|
-
/**
|
602
|
-
* Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
|
603
|
-
*/
|
604
|
-
this.debounce = 0;
|
605
|
-
/**
|
606
|
-
* If `true`, the user cannot interact with the input.
|
607
|
-
*/
|
608
|
-
this.disabled = false;
|
609
|
-
/**
|
610
|
-
* The name of the control, which is submitted with the form data.
|
611
|
-
*/
|
612
|
-
this.name = this.inputId;
|
613
|
-
/**
|
614
|
-
* If `true`, the user cannot modify the value.
|
615
|
-
*/
|
616
|
-
this.readonly = false;
|
617
|
-
/**
|
618
|
-
* If `true`, the user must fill in a value before submitting a form.
|
619
|
-
*/
|
620
|
-
this.required = false;
|
621
|
-
/**
|
622
|
-
* If `true`, the element will have its spelling and grammar checked.
|
623
|
-
*/
|
624
|
-
this.spellcheck = false;
|
625
|
-
/**
|
626
|
-
* The type of control to display. The default type is text.
|
627
|
-
*/
|
628
|
-
this.type = 'text';
|
629
|
-
/**
|
630
|
-
* The value of the input.
|
631
|
-
*/
|
632
|
-
this.value = '';
|
633
|
-
this.onInput = (ev) => {
|
634
|
-
const input = ev.target;
|
635
|
-
if (input) {
|
636
|
-
this.value = input.value || '';
|
637
|
-
}
|
638
|
-
this.ionInput.emit(ev);
|
639
|
-
};
|
640
|
-
this.onBlur = (ev) => {
|
641
|
-
this.hasFocus = false;
|
642
|
-
this.focusChanged();
|
643
|
-
this.emitStyle();
|
644
|
-
if (this.fireFocusEvents) {
|
645
|
-
this.ionBlur.emit(ev);
|
646
|
-
}
|
647
|
-
};
|
648
|
-
this.onFocus = (ev) => {
|
649
|
-
this.hasFocus = true;
|
650
|
-
this.focusChanged();
|
651
|
-
this.emitStyle();
|
652
|
-
if (this.fireFocusEvents) {
|
653
|
-
this.ionFocus.emit(ev);
|
654
|
-
}
|
655
|
-
};
|
656
|
-
this.onKeydown = (ev) => {
|
657
|
-
if (this.shouldClearOnEdit()) {
|
658
|
-
// Did the input value change after it was blurred and edited?
|
659
|
-
// Do not clear if user is hitting Enter to submit form
|
660
|
-
if (this.didBlurAfterEdit && this.hasValue() && ev.key !== 'Enter') {
|
661
|
-
// Clear the input
|
662
|
-
this.clearTextInput();
|
663
|
-
}
|
664
|
-
// Reset the flag
|
665
|
-
this.didBlurAfterEdit = false;
|
666
|
-
}
|
667
|
-
};
|
668
|
-
this.onCompositionStart = () => {
|
669
|
-
this.isComposing = true;
|
670
|
-
};
|
671
|
-
this.onCompositionEnd = () => {
|
672
|
-
this.isComposing = false;
|
673
|
-
};
|
674
|
-
this.clearTextOnEnter = (ev) => {
|
675
|
-
if (ev.key === 'Enter') {
|
676
|
-
this.clearTextInput(ev);
|
677
|
-
}
|
678
|
-
};
|
679
|
-
this.clearTextInput = (ev) => {
|
680
|
-
if (this.clearInput && !this.readonly && !this.disabled && ev) {
|
681
|
-
ev.preventDefault();
|
682
|
-
ev.stopPropagation();
|
683
|
-
// Attempt to focus input again after pressing clear button
|
684
|
-
this.setFocus();
|
685
|
-
}
|
686
|
-
this.value = '';
|
687
|
-
/**
|
688
|
-
* This is needed for clearOnEdit
|
689
|
-
* Otherwise the value will not be cleared
|
690
|
-
* if user is inside the input
|
691
|
-
*/
|
692
|
-
if (this.nativeInput) {
|
693
|
-
this.nativeInput.value = '';
|
694
|
-
}
|
695
|
-
};
|
696
|
-
}
|
697
|
-
debounceChanged() {
|
698
|
-
this.ionChange = debounceEvent(this.ionChange, this.debounce);
|
699
|
-
}
|
700
|
-
disabledChanged() {
|
701
|
-
this.emitStyle();
|
702
|
-
}
|
703
|
-
/**
|
704
|
-
* Update the item classes when the placeholder changes
|
705
|
-
*/
|
706
|
-
placeholderChanged() {
|
707
|
-
this.emitStyle();
|
708
|
-
}
|
709
|
-
/**
|
710
|
-
* Update the native input element when the value changes
|
711
|
-
*/
|
712
|
-
valueChanged() {
|
713
|
-
const nativeInput = this.nativeInput;
|
714
|
-
const value = this.getValue();
|
715
|
-
if (nativeInput && nativeInput.value !== value && !this.isComposing) {
|
716
|
-
/**
|
717
|
-
* Assigning the native input's value on attribute
|
718
|
-
* value change, allows `ionInput` implementations
|
719
|
-
* to override the control's value.
|
720
|
-
*
|
721
|
-
* Used for patterns such as input trimming (removing whitespace),
|
722
|
-
* or input masking.
|
723
|
-
*/
|
724
|
-
nativeInput.value = value;
|
725
|
-
}
|
726
|
-
this.emitStyle();
|
727
|
-
this.ionChange.emit({ value: this.value == null ? this.value : this.value.toString() });
|
728
|
-
}
|
729
|
-
componentWillLoad() {
|
730
|
-
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes$1(this.el, ['tabindex', 'title']));
|
731
|
-
}
|
732
|
-
connectedCallback() {
|
733
|
-
this.emitStyle();
|
734
|
-
this.debounceChanged();
|
735
|
-
{
|
736
|
-
document.dispatchEvent(new CustomEvent('ionInputDidLoad', {
|
737
|
-
detail: this.el,
|
738
|
-
}));
|
739
|
-
}
|
740
|
-
}
|
741
|
-
componentDidLoad() {
|
742
|
-
const nativeInput = this.nativeInput;
|
743
|
-
if (nativeInput) {
|
744
|
-
// TODO: FW-729 Update to JSX bindings when Stencil resolves bug with:
|
745
|
-
// https://github.com/ionic-team/stencil/issues/3235
|
746
|
-
nativeInput.addEventListener('compositionstart', this.onCompositionStart);
|
747
|
-
nativeInput.addEventListener('compositionend', this.onCompositionEnd);
|
748
|
-
}
|
749
|
-
}
|
750
|
-
disconnectedCallback() {
|
751
|
-
{
|
752
|
-
document.dispatchEvent(new CustomEvent('ionInputDidUnload', {
|
753
|
-
detail: this.el,
|
754
|
-
}));
|
755
|
-
}
|
756
|
-
const nativeInput = this.nativeInput;
|
757
|
-
if (nativeInput) {
|
758
|
-
nativeInput.removeEventListener('compositionstart', this.onCompositionStart);
|
759
|
-
nativeInput.removeEventListener('compositionEnd', this.onCompositionEnd);
|
760
|
-
}
|
761
|
-
}
|
762
|
-
/**
|
763
|
-
* Sets focus on the native `input` in `ion-input`. Use this method instead of the global
|
764
|
-
* `input.focus()`.
|
765
|
-
*/
|
766
|
-
async setFocus() {
|
767
|
-
if (this.nativeInput) {
|
768
|
-
this.nativeInput.focus();
|
769
|
-
}
|
770
|
-
}
|
771
|
-
/**
|
772
|
-
* Sets blur on the native `input` in `ion-input`. Use this method instead of the global
|
773
|
-
* `input.blur()`.
|
774
|
-
* @internal
|
775
|
-
*/
|
776
|
-
async setBlur() {
|
777
|
-
if (this.nativeInput) {
|
778
|
-
this.nativeInput.blur();
|
779
|
-
}
|
780
|
-
}
|
781
|
-
/**
|
782
|
-
* Returns the native `<input>` element used under the hood.
|
783
|
-
*/
|
784
|
-
getInputElement() {
|
785
|
-
return Promise.resolve(this.nativeInput);
|
786
|
-
}
|
787
|
-
shouldClearOnEdit() {
|
788
|
-
const { type, clearOnEdit } = this;
|
789
|
-
return clearOnEdit === undefined ? type === 'password' : clearOnEdit;
|
790
|
-
}
|
791
|
-
getValue() {
|
792
|
-
return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();
|
793
|
-
}
|
794
|
-
emitStyle() {
|
795
|
-
this.ionStyle.emit({
|
796
|
-
interactive: true,
|
797
|
-
input: true,
|
798
|
-
'has-placeholder': this.placeholder !== undefined,
|
799
|
-
'has-value': this.hasValue(),
|
800
|
-
'has-focus': this.hasFocus,
|
801
|
-
'interactive-disabled': this.disabled,
|
802
|
-
});
|
803
|
-
}
|
804
|
-
focusChanged() {
|
805
|
-
// If clearOnEdit is enabled and the input blurred but has a value, set a flag
|
806
|
-
if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {
|
807
|
-
this.didBlurAfterEdit = true;
|
808
|
-
}
|
809
|
-
}
|
810
|
-
hasValue() {
|
811
|
-
return this.getValue().length > 0;
|
812
|
-
}
|
813
|
-
render() {
|
814
|
-
const mode = getIonMode$1(this);
|
815
|
-
const value = this.getValue();
|
816
|
-
const labelId = this.inputId + '-lbl';
|
817
|
-
const label = findItemLabel(this.el);
|
818
|
-
if (label) {
|
819
|
-
label.id = labelId;
|
820
|
-
}
|
821
|
-
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
822
|
-
[mode]: true,
|
823
|
-
'has-value': this.hasValue(),
|
824
|
-
'has-focus': this.hasFocus,
|
825
|
-
}) }, h("input", Object.assign({ class: "native-input", ref: (input) => (this.nativeInput = input), "aria-labelledby": label ? labelId : null, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown }, this.inheritedAttributes)), this.clearInput && !this.readonly && !this.disabled && (h("button", { "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: this.clearTextInput, onKeyDown: this.clearTextOnEnter }))));
|
826
|
-
}
|
827
|
-
get el() { return getElement(this); }
|
828
|
-
static get watchers() { return {
|
829
|
-
"debounce": ["debounceChanged"],
|
830
|
-
"disabled": ["disabledChanged"],
|
831
|
-
"placeholder": ["placeholderChanged"],
|
832
|
-
"value": ["valueChanged"]
|
833
|
-
}; }
|
834
|
-
};
|
835
|
-
let inputIds = 0;
|
836
|
-
Input.style = {
|
837
|
-
ios: inputIosCss,
|
838
|
-
md: inputMdCss
|
839
|
-
};
|
840
|
-
|
841
|
-
const itemIosCss = ":host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native,:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-bottom{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--inner-padding-end);padding-top:0;padding-bottom:0;display:flex;justify-content:space-between}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-bottom{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--inner-padding-end);padding-inline-end:var(--inner-padding-end)}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;top:0;bottom:0;border-radius:inherit;position:absolute;width:100%;height:100%;transform:scaleX(0);transition:transform 200ms, border-bottom-width 200ms;z-index:2;box-sizing:border-box;pointer-events:none}:host(.item-interactive.item-has-focus) .item-native{caret-color:var(--highlight-background)}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=helper]){display:none}::slotted([slot=error]){display:none;color:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=error]){display:block}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted([slot=helper]),::slotted([slot=error]),.item-counter{padding-top:5px;font-size:12px;z-index:1}.item-counter{margin-left:auto;color:var(--ion-color-step-550, #737373);white-space:nowrap;padding-inline-start:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-counter{margin-left:unset;-webkit-margin-start:auto;margin-inline-start:auto}}@media (prefers-reduced-motion: reduce){.item-highlight,.item-inner-highlight{transition:none}}:host{--min-height:44px;--transition:background-color 200ms linear, opacity 200ms linear;--padding-start:20px;--inner-padding-end:10px;--inner-border-width:0px 0px 0.55px 0px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:#000;--background-focused:#000;--background-hover:currentColor;--background-activated-opacity:.12;--background-focused-opacity:.15;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--color:var(--ion-item-color, var(--ion-text-color, #000));--highlight-height:0px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);--bottom-padding-start:0px;font-size:17px}:host(.ion-activated){--transition:none}:host(.ion-color.ion-focused) .item-native::after{background:#000;opacity:0.15}:host(.ion-color.ion-activated) .item-native::after{background:#000;opacity:0.12}:host(.item-interactive){--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-full){--border-width:0px 0px 0.55px 0px;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0px 0px 0.55px 0px;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0px;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0px;--show-inset-highlight:0}.item-highlight,.item-inner-highlight{transition:none}:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus) .item-highlight{border-top:none;border-right:none;border-left:none}::slotted([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}::slotted([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}::slotted(.button-small){--padding-top:0px;--padding-bottom:0px;--padding-start:.5em;--padding-end:.5em;height:24px;font-size:13px}::slotted(ion-avatar){width:36px;height:36px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:0px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0px;margin-inline-start:0px}}::slotted(ion-label){margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.item-label-floating),:host(.item-label-stacked){--min-height:68px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:0}";
|
842
|
-
|
843
|
-
const itemMdCss = ":host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native,:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-bottom{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--inner-padding-end);padding-top:0;padding-bottom:0;display:flex;justify-content:space-between}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-bottom{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--inner-padding-end);padding-inline-end:var(--inner-padding-end)}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;top:0;bottom:0;border-radius:inherit;position:absolute;width:100%;height:100%;transform:scaleX(0);transition:transform 200ms, border-bottom-width 200ms;z-index:2;box-sizing:border-box;pointer-events:none}:host(.item-interactive.item-has-focus) .item-native{caret-color:var(--highlight-background)}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=helper]){display:none}::slotted([slot=error]){display:none;color:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=error]){display:block}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted([slot=helper]),::slotted([slot=error]),.item-counter{padding-top:5px;font-size:12px;z-index:1}.item-counter{margin-left:auto;color:var(--ion-color-step-550, #737373);white-space:nowrap;padding-inline-start:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-counter{margin-left:unset;-webkit-margin-start:auto;margin-inline-start:auto}}@media (prefers-reduced-motion: reduce){.item-highlight,.item-inner-highlight{transition:none}}:host{--min-height:48px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--color:var(--ion-item-color, var(--ion-text-color, #000));--transition:opacity 15ms linear, background-color 15ms linear;--padding-start:16px;--inner-padding-end:16px;--inner-border-width:0 0 1px 0;--highlight-height:1px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:16px;font-weight:normal;text-transform:none}:host(.item-fill-outline){--highlight-height:2px}:host(.item-fill-none.item-interactive.ion-focus) .item-highlight,:host(.item-fill-none.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-none.item-interactive.ion-touched.ion-invalid) .item-highlight{transform:scaleX(1);border-width:0 0 var(--full-highlight-height) 0;border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-none.item-interactive.ion-focus) .item-native,:host(.item-fill-none.item-interactive.item-has-focus) .item-native,:host(.item-fill-none.item-interactive.ion-touched.ion-invalid) .item-native{border-bottom-color:var(--highlight-background)}:host(.item-fill-outline.item-interactive.ion-focus) .item-highlight,:host(.item-fill-outline.item-interactive.item-has-focus) .item-highlight{transform:scaleX(1)}:host(.item-fill-outline.item-interactive.ion-focus) .item-highlight,:host(.item-fill-outline.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-outline.item-interactive.ion-touched.ion-invalid) .item-highlight{border-width:var(--full-highlight-height);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-outline.item-interactive.ion-touched.ion-invalid) .item-native{border-color:var(--highlight-background)}:host(.item-fill-solid.item-interactive.ion-focus) .item-highlight,:host(.item-fill-solid.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-solid.item-interactive.ion-touched.ion-invalid) .item-highlight{transform:scaleX(1);border-width:0 0 var(--full-highlight-height) 0;border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-solid.item-interactive.ion-focus) .item-native,:host(.item-fill-solid.item-interactive.item-has-focus) .item-native,:host(.item-fill-solid.item-interactive.ion-touched.ion-invalid) .item-native{border-bottom-color:var(--highlight-background)}:host(.ion-color.ion-activated) .item-native::after{background:transparent}:host(.item-has-focus) .item-native{caret-color:var(--highlight-color-focused)}:host(.item-interactive){--border-width:0 0 1px 0;--inner-border-width:0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-full){--border-width:0 0 1px 0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0 0 1px 0;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0;--show-inset-highlight:0}:host(.item-fill-outline) .item-highlight{--position-offset:calc(-1 * var(--border-width));left:var(--position-offset);top:var(--position-offset);width:calc(100% + 2 * var(--border-width));height:calc(100% + 2 * var(--border-width));transition:none}:host-context([dir=rtl]):host(.item-fill-outline) .item-highlight,:host-context([dir=rtl]).item-fill-outline .item-highlight{left:unset;right:unset;right:var(--position-offset)}:host(.item-fill-outline.ion-focused) .item-native,:host(.item-fill-outline.item-has-focus) .item-native{border-color:transparent}:host(.item-multi-line) ::slotted([slot=start]),:host(.item-multi-line) ::slotted([slot=end]){margin-top:16px;margin-bottom:16px;align-self:flex-start}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}:host(.item-fill-solid) ::slotted(ion-icon[slot=start]),:host(.item-fill-outline) ::slotted(ion-icon[slot=start]){margin-right:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-fill-solid) ::slotted(ion-icon[slot=start]),:host(.item-fill-outline) ::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]:not([slot=helper]):not([slot=error])){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:10px;margin-bottom:10px}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:8px}:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}::slotted(.button-small){--padding-top:0;--padding-bottom:0;--padding-start:.6em;--padding-end:.6em;height:25px;font-size:12px}:host(.item-label-floating),:host(.item-label-stacked){--min-height:55px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0}:host(.ion-focused:not(.ion-color)) ::slotted(.label-stacked),:host(.ion-focused:not(.ion-color)) ::slotted(.label-floating),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating){color:var(--ion-color-primary, #3880ff)}:host(.ion-color){--highlight-color-focused:var(--ion-color-contrast)}:host(.item-label-color){--highlight-color-focused:var(--ion-color-base)}:host(.item-fill-solid.ion-color),:host(.item-fill-outline.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.item-fill-solid){--background:var(--ion-color-step-50, #f2f2f2);--background-hover:var(--ion-color-step-100, #e6e6e6);--background-focused:var(--ion-color-step-150, #d9d9d9);--border-width:0 0 1px 0;--inner-border-width:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.item-fill-solid),:host-context([dir=rtl]).item-fill-solid{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.item-fill-solid) .item-native{--border-color:var(--ion-color-step-500, gray)}:host(.item-fill-solid.ion-focused) .item-native,:host(.item-fill-solid.item-has-focus) .item-native{--background:var(--background-focused)}:host(.item-fill-solid.item-shape-round){border-top-left-radius:16px;border-top-right-radius:16px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.item-fill-solid.item-shape-round),:host-context([dir=rtl]).item-fill-solid.item-shape-round{border-top-left-radius:16px;border-top-right-radius:16px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (any-hover: hover){:host(.item-fill-solid:hover) .item-native{--background:var(--background-hover);--border-color:var(--ion-color-step-750, #404040)}}:host(.item-fill-outline){--ripple-color:transparent;--background-focused:transparent;--background-hover:transparent;--border-color:var(--ion-color-step-500, gray);--border-width:1px;border:none;overflow:visible}:host(.item-fill-outline) .item-native{--native-padding-left:16px;border-radius:4px}:host(.item-fill-outline.item-shape-round) .item-native{--inner-padding-start:16px;border-radius:28px}:host(.item-fill-outline.item-shape-round) .item-bottom{padding-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-fill-outline.item-shape-round) .item-bottom{padding-left:unset;-webkit-padding-start:32px;padding-inline-start:32px}}:host(.item-fill-outline.item-label-floating.ion-focused) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.ion-focused) .item-native ::slotted(ion-textarea:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-focus) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-focus) .item-native ::slotted(ion-textarea:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-value) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-value) .item-native ::slotted(ion-textarea:not(:first-child)){transform:translateY(-14px)}@media (any-hover: hover){:host(.item-fill-outline:hover) .item-native{--border-color:var(--ion-color-step-750, #404040)}}.item-counter{letter-spacing:0.0333333333em}";
|
844
|
-
|
845
|
-
const Item = class {
|
846
|
-
constructor(hostRef) {
|
847
|
-
registerInstance(this, hostRef);
|
848
|
-
this.labelColorStyles = {};
|
849
|
-
this.itemStyles = new Map();
|
850
|
-
this.multipleInputs = false;
|
851
|
-
this.focusable = true;
|
852
|
-
/**
|
853
|
-
* If `true`, a button tag will be rendered and the item will be tappable.
|
854
|
-
*/
|
855
|
-
this.button = false;
|
856
|
-
/**
|
857
|
-
* The icon to use when `detail` is set to `true`.
|
858
|
-
*/
|
859
|
-
this.detailIcon = chevronForward;
|
860
|
-
/**
|
861
|
-
* If `true`, the user cannot interact with the item.
|
862
|
-
*/
|
863
|
-
this.disabled = false;
|
864
|
-
/**
|
865
|
-
* If `true`, a character counter will display the ratio of characters used and the total character limit. Only applies when the `maxlength` property is set on the inner `ion-input` or `ion-textarea`.
|
866
|
-
*/
|
867
|
-
this.counter = false;
|
868
|
-
/**
|
869
|
-
* When using a router, it specifies the transition direction when navigating to
|
870
|
-
* another page using `href`.
|
871
|
-
*/
|
872
|
-
this.routerDirection = 'forward';
|
873
|
-
/**
|
874
|
-
* The type of the button. Only used when an `onclick` or `button` property is present.
|
875
|
-
*/
|
876
|
-
this.type = 'button';
|
877
|
-
}
|
878
|
-
counterFormatterChanged() {
|
879
|
-
this.updateCounterOutput(this.getFirstInput());
|
880
|
-
}
|
881
|
-
handleIonChange(ev) {
|
882
|
-
if (this.counter && ev.target === this.getFirstInput()) {
|
883
|
-
this.updateCounterOutput(ev.target);
|
884
|
-
}
|
885
|
-
}
|
886
|
-
labelColorChanged(ev) {
|
887
|
-
const { color } = this;
|
888
|
-
// There will be a conflict with item color if
|
889
|
-
// we apply the label color to item, so we ignore
|
890
|
-
// the label color if the user sets a color on item
|
891
|
-
if (color === undefined) {
|
892
|
-
this.labelColorStyles = ev.detail;
|
893
|
-
}
|
894
|
-
}
|
895
|
-
itemStyle(ev) {
|
896
|
-
ev.stopPropagation();
|
897
|
-
const tagName = ev.target.tagName;
|
898
|
-
const updatedStyles = ev.detail;
|
899
|
-
const newStyles = {};
|
900
|
-
const childStyles = this.itemStyles.get(tagName) || {};
|
901
|
-
let hasStyleChange = false;
|
902
|
-
Object.keys(updatedStyles).forEach((key) => {
|
903
|
-
if (updatedStyles[key]) {
|
904
|
-
const itemKey = `item-${key}`;
|
905
|
-
if (!childStyles[itemKey]) {
|
906
|
-
hasStyleChange = true;
|
907
|
-
}
|
908
|
-
newStyles[itemKey] = true;
|
909
|
-
}
|
910
|
-
});
|
911
|
-
if (!hasStyleChange && Object.keys(newStyles).length !== Object.keys(childStyles).length) {
|
912
|
-
hasStyleChange = true;
|
913
|
-
}
|
914
|
-
if (hasStyleChange) {
|
915
|
-
this.itemStyles.set(tagName, newStyles);
|
916
|
-
forceUpdate(this);
|
917
|
-
}
|
918
|
-
}
|
919
|
-
connectedCallback() {
|
920
|
-
if (this.counter) {
|
921
|
-
this.updateCounterOutput(this.getFirstInput());
|
922
|
-
}
|
923
|
-
this.hasStartEl();
|
924
|
-
}
|
925
|
-
componentDidUpdate() {
|
926
|
-
// Do not use @Listen here to avoid making all items
|
927
|
-
// appear as clickable to screen readers
|
928
|
-
// https://github.com/ionic-team/ionic-framework/issues/22011
|
929
|
-
const input = this.getFirstInput();
|
930
|
-
if (input && !this.clickListener) {
|
931
|
-
this.clickListener = (ev) => this.delegateFocus(ev, input);
|
932
|
-
this.el.addEventListener('click', this.clickListener);
|
933
|
-
}
|
934
|
-
}
|
935
|
-
disconnectedCallback() {
|
936
|
-
const input = this.getFirstInput();
|
937
|
-
if (input && this.clickListener) {
|
938
|
-
this.el.removeEventListener('click', this.clickListener);
|
939
|
-
this.clickListener = undefined;
|
940
|
-
}
|
941
|
-
}
|
942
|
-
componentDidLoad() {
|
943
|
-
raf(() => {
|
944
|
-
this.setMultipleInputs();
|
945
|
-
this.focusable = this.isFocusable();
|
946
|
-
});
|
947
|
-
}
|
948
|
-
// If the item contains multiple clickable elements and/or inputs, then the item
|
949
|
-
// should not have a clickable input cover over the entire item to prevent
|
950
|
-
// interfering with their individual click events
|
951
|
-
setMultipleInputs() {
|
952
|
-
// The following elements have a clickable cover that is relative to the entire item
|
953
|
-
const covers = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
|
954
|
-
// The following elements can accept focus alongside the previous elements
|
955
|
-
// therefore if these elements are also a child of item, we don't want the
|
956
|
-
// input cover on top of those interfering with their clicks
|
957
|
-
const inputs = this.el.querySelectorAll('ion-input, ion-range, ion-searchbar, ion-segment, ion-textarea, ion-toggle');
|
958
|
-
// The following elements should also stay clickable when an input with cover is present
|
959
|
-
const clickables = this.el.querySelectorAll('ion-anchor, ion-button, a, button');
|
960
|
-
// Check for multiple inputs to change the position of the input cover to relative
|
961
|
-
// for all of the covered inputs above
|
962
|
-
this.multipleInputs =
|
963
|
-
covers.length + inputs.length > 1 ||
|
964
|
-
covers.length + clickables.length > 1 ||
|
965
|
-
(covers.length > 0 && this.isClickable());
|
966
|
-
}
|
967
|
-
// If the item contains an input including a checkbox, datetime, select, or radio
|
968
|
-
// then the item will have a clickable input cover that covers the item
|
969
|
-
// that should get the hover, focused and activated states UNLESS it has multiple
|
970
|
-
// inputs, then those need to individually get each click
|
971
|
-
hasCover() {
|
972
|
-
const inputs = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
|
973
|
-
return inputs.length === 1 && !this.multipleInputs;
|
974
|
-
}
|
975
|
-
// If the item has an href or button property it will render a native
|
976
|
-
// anchor or button that is clickable
|
977
|
-
isClickable() {
|
978
|
-
return this.href !== undefined || this.button;
|
979
|
-
}
|
980
|
-
canActivate() {
|
981
|
-
return this.isClickable() || this.hasCover();
|
982
|
-
}
|
983
|
-
isFocusable() {
|
984
|
-
const focusableChild = this.el.querySelector('.ion-focusable');
|
985
|
-
return this.canActivate() || focusableChild !== null;
|
986
|
-
}
|
987
|
-
getFirstInput() {
|
988
|
-
const inputs = this.el.querySelectorAll('ion-input, ion-textarea');
|
989
|
-
return inputs[0];
|
990
|
-
}
|
991
|
-
// This is needed for WebKit due to a delegatesFocus bug where
|
992
|
-
// clicking on the left padding of an item is not focusing the input
|
993
|
-
// but is opening the keyboard. It will no longer be needed with
|
994
|
-
// iOS 14.
|
995
|
-
delegateFocus(ev, input) {
|
996
|
-
const clickedItem = ev.target.tagName === 'ION-ITEM';
|
997
|
-
let firstActive = false;
|
998
|
-
// If the first input is the same as the active element we need
|
999
|
-
// to focus the first input again, but if the active element
|
1000
|
-
// is another input inside of the item we shouldn't switch focus
|
1001
|
-
if (document.activeElement) {
|
1002
|
-
firstActive = input.querySelector('input, textarea') === document.activeElement;
|
1003
|
-
}
|
1004
|
-
// Only focus the first input if we clicked on an ion-item
|
1005
|
-
// and the first input exists
|
1006
|
-
if (clickedItem && (firstActive || !this.multipleInputs)) {
|
1007
|
-
input.fireFocusEvents = false;
|
1008
|
-
input.setBlur();
|
1009
|
-
input.setFocus();
|
1010
|
-
raf(() => {
|
1011
|
-
input.fireFocusEvents = true;
|
1012
|
-
});
|
1013
|
-
}
|
1014
|
-
}
|
1015
|
-
updateCounterOutput(inputEl) {
|
1016
|
-
var _a, _b;
|
1017
|
-
const { counter, counterFormatter, defaultCounterFormatter } = this;
|
1018
|
-
if (counter && !this.multipleInputs && (inputEl === null || inputEl === void 0 ? void 0 : inputEl.maxlength) !== undefined) {
|
1019
|
-
const length = (_b = (_a = inputEl === null || inputEl === void 0 ? void 0 : inputEl.value) === null || _a === void 0 ? void 0 : _a.toString().length) !== null && _b !== void 0 ? _b : 0;
|
1020
|
-
if (counterFormatter === undefined) {
|
1021
|
-
this.counterString = defaultCounterFormatter(length, inputEl.maxlength);
|
1022
|
-
}
|
1023
|
-
else {
|
1024
|
-
try {
|
1025
|
-
this.counterString = counterFormatter(length, inputEl.maxlength);
|
1026
|
-
}
|
1027
|
-
catch (e) {
|
1028
|
-
printIonError('Exception in provided `counterFormatter`.', e);
|
1029
|
-
// Fallback to the default counter formatter when an exception happens
|
1030
|
-
this.counterString = defaultCounterFormatter(length, inputEl.maxlength);
|
1031
|
-
}
|
1032
|
-
}
|
1033
|
-
}
|
1034
|
-
}
|
1035
|
-
defaultCounterFormatter(length, maxlength) {
|
1036
|
-
return `${length} / ${maxlength}`;
|
1037
|
-
}
|
1038
|
-
hasStartEl() {
|
1039
|
-
const startEl = this.el.querySelector('[slot="start"]');
|
1040
|
-
if (startEl !== null) {
|
1041
|
-
this.el.classList.add('item-has-start-slot');
|
1042
|
-
}
|
1043
|
-
}
|
1044
|
-
render() {
|
1045
|
-
const { counterString, detail, detailIcon, download, fill, labelColorStyles, lines, disabled, href, rel, shape, target, routerAnimation, routerDirection, } = this;
|
1046
|
-
const childStyles = {};
|
1047
|
-
const mode = getIonMode$1(this);
|
1048
|
-
const clickable = this.isClickable();
|
1049
|
-
const canActivate = this.canActivate();
|
1050
|
-
const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div';
|
1051
|
-
const attrs = TagType === 'button'
|
1052
|
-
? { type: this.type }
|
1053
|
-
: {
|
1054
|
-
download,
|
1055
|
-
href,
|
1056
|
-
rel,
|
1057
|
-
target,
|
1058
|
-
};
|
1059
|
-
// Only set onClick if the item is clickable to prevent screen
|
1060
|
-
// readers from reading all items as clickable
|
1061
|
-
const clickFn = clickable
|
1062
|
-
? {
|
1063
|
-
onClick: (ev) => {
|
1064
|
-
openURL(href, ev, routerDirection, routerAnimation);
|
1065
|
-
},
|
1066
|
-
}
|
1067
|
-
: {};
|
1068
|
-
const showDetail = detail !== undefined ? detail : mode === 'ios' && clickable;
|
1069
|
-
this.itemStyles.forEach((value) => {
|
1070
|
-
Object.assign(childStyles, value);
|
1071
|
-
});
|
1072
|
-
const ariaDisabled = disabled || childStyles['item-interactive-disabled'] ? 'true' : null;
|
1073
|
-
const fillValue = fill || 'none';
|
1074
|
-
const inList = hostContext('ion-list', this.el);
|
1075
|
-
return (h(Host, { "aria-disabled": ariaDisabled, class: Object.assign(Object.assign(Object.assign({}, childStyles), labelColorStyles), createColorClasses$1(this.color, {
|
1076
|
-
item: true,
|
1077
|
-
[mode]: true,
|
1078
|
-
[`item-lines-${lines}`]: lines !== undefined,
|
1079
|
-
[`item-fill-${fillValue}`]: true,
|
1080
|
-
[`item-shape-${shape}`]: shape !== undefined,
|
1081
|
-
'item-disabled': disabled,
|
1082
|
-
'in-list': inList,
|
1083
|
-
'item-multiple-inputs': this.multipleInputs,
|
1084
|
-
'ion-activatable': canActivate,
|
1085
|
-
'ion-focusable': this.focusable,
|
1086
|
-
'item-rtl': document.dir === 'rtl',
|
1087
|
-
})), role: inList ? 'listitem' : null }, h(TagType, Object.assign({}, attrs, { class: "item-native", part: "native", disabled: disabled }, clickFn), h("slot", { name: "start" }), h("div", { class: "item-inner" }, h("div", { class: "input-wrapper" }, h("slot", null)), h("slot", { name: "end" }), showDetail && (h("ion-icon", { icon: detailIcon, lazy: false, class: "item-detail-icon", part: "detail-icon", "aria-hidden": "true", "flip-rtl": detailIcon === chevronForward })), h("div", { class: "item-inner-highlight" })), canActivate && mode === 'md' && h("ion-ripple-effect", null), h("div", { class: "item-highlight" })), h("div", { class: "item-bottom" }, h("slot", { name: "error" }), h("slot", { name: "helper" }), counterString && h("ion-note", { class: "item-counter" }, counterString))));
|
1088
|
-
}
|
1089
|
-
static get delegatesFocus() { return true; }
|
1090
|
-
get el() { return getElement(this); }
|
1091
|
-
static get watchers() { return {
|
1092
|
-
"counterFormatter": ["counterFormatterChanged"]
|
1093
|
-
}; }
|
1094
|
-
};
|
1095
|
-
Item.style = {
|
1096
|
-
ios: itemIosCss,
|
1097
|
-
md: itemMdCss
|
1098
|
-
};
|
1099
|
-
|
1100
|
-
const labelIosCss = ".item.sc-ion-label-ios-h,.item .sc-ion-label-ios-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-ios-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{white-space:normal}.item-interactive-disabled.sc-ion-label-ios-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-ios-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-ios-h,.item-input .sc-ion-label-ios-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-ios-h,.item-textarea .sc-ion-label-ios-h{align-self:baseline}.label-fixed.sc-ion-label-ios-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-ios-h,.label-floating.sc-ion-label-ios-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-ios-h{transition:none}.sc-ion-label-ios-s h1,.sc-ion-label-ios-s h2,.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{font-size:14px;line-height:1.5}.label-stacked.sc-ion-label-ios-h{margin-bottom:4px;font-size:14px}.label-floating.sc-ion-label-ios-h{margin-bottom:0;transform:translate(0, 29px);transform-origin:left top;transition:transform 150ms ease-in-out}[dir=rtl].sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl] .sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl].label-floating.sc-ion-label-ios-h,[dir=rtl] .label-floating.sc-ion-label-ios-h{transform-origin:right top}.item-textarea.label-floating.sc-ion-label-ios-h,.item-textarea .label-floating.sc-ion-label-ios-h{transform:translate(0, 28px)}.item-has-focus.label-floating.sc-ion-label-ios-h,.item-has-focus .label-floating.sc-ion-label-ios-h,.item-has-placeholder.sc-ion-label-ios-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-ios-h,.item-has-value.label-floating.sc-ion-label-ios-h,.item-has-value .label-floating.sc-ion-label-ios-h{transform:scale(0.82)}.sc-ion-label-ios-s h1{margin-left:0;margin-right:0;margin-top:3px;margin-bottom:2px;font-size:22px;font-weight:normal}.sc-ion-label-ios-s h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-ios-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}.sc-ion-label-ios-s>p{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4)}.sc-ion-label-ios-h.in-item-color.sc-ion-label-ios-s>p{color:inherit}.sc-ion-label-ios-s h2:last-child,.sc-ion-label-ios-s h3:last-child,.sc-ion-label-ios-s h4:last-child,.sc-ion-label-ios-s h5:last-child,.sc-ion-label-ios-s h6:last-child,.sc-ion-label-ios-s p:last-child{margin-bottom:0}";
|
1101
|
-
|
1102
|
-
const labelMdCss = ".item.sc-ion-label-md-h,.item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-md-h,.item-input .sc-ion-label-md-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h,.item-textarea .sc-ion-label-md-h{align-self:baseline}.label-fixed.sc-ion-label-md-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{transition:none}.sc-ion-label-md-s h1,.sc-ion-label-md-s h2,.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;transform-origin:top left}.label-stacked.label-rtl.sc-ion-label-md-h,.label-floating.label-rtl.sc-ion-label-md-h{transform-origin:top right}.label-stacked.sc-ion-label-md-h{transform:translateY(50%) scale(0.75);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.label-floating.sc-ion-label-md-h{transform:translateY(96%);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.ion-focused.label-floating.sc-ion-label-md-h,.ion-focused .label-floating.sc-ion-label-md-h,.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h,.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-has-value.label-floating.sc-ion-label-md-h,.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(50%) scale(0.75)}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(-6px) scale(0.75);position:relative;max-width:min-content;background-color:var(--ion-item-background, var(--ion-background-color, #fff));overflow:visible;z-index:3}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::after,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::before,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::after,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::after{position:absolute;width:4px;height:100%;background-color:var(--ion-item-background, var(--ion-background-color, #fff));content:\"\"}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::before,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::before{left:calc(-1 * 4px)}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::after,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::after,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::after{right:calc(-1 * 4px)}.item-fill-outline.ion-focused.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.ion-focused.item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).item-has-start-slot.label-floating,.item-fill-outline.item-has-placeholder:not(.item-input).item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot .label-floating.sc-ion-label-md-h{transform:translateX(-32px) translateY(-6px) scale(0.75)}.item-fill-outline.ion-focused.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.ion-focused.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).item-has-start-slot.label-floating.label-rtl,.item-fill-outline.item-has-placeholder:not(.item-input).item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h{transform:translateX(calc(-1 * -32px)) translateY(-6px) scale(0.75)}.ion-focused.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-focused .label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-primary, #3880ff)}.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-contrast)}.item-fill-solid.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-base)}.ion-invalid.ion-touched.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--highlight-color-invalid)}.sc-ion-label-md-s h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.sc-ion-label-md-s h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-md-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s>p{color:var(--ion-color-step-600, #666666)}.sc-ion-label-md-h.in-item-color.sc-ion-label-md-s>p{color:inherit}";
|
1103
|
-
|
1104
|
-
const Label = class {
|
1105
|
-
constructor(hostRef) {
|
1106
|
-
registerInstance(this, hostRef);
|
1107
|
-
this.ionColor = createEvent(this, "ionColor", 7);
|
1108
|
-
this.ionStyle = createEvent(this, "ionStyle", 7);
|
1109
|
-
this.inRange = false;
|
1110
|
-
this.noAnimate = false;
|
1111
|
-
}
|
1112
|
-
componentWillLoad() {
|
1113
|
-
this.inRange = !!this.el.closest('ion-range');
|
1114
|
-
this.noAnimate = this.position === 'floating';
|
1115
|
-
this.emitStyle();
|
1116
|
-
this.emitColor();
|
1117
|
-
}
|
1118
|
-
componentDidLoad() {
|
1119
|
-
if (this.noAnimate) {
|
1120
|
-
setTimeout(() => {
|
1121
|
-
this.noAnimate = false;
|
1122
|
-
}, 1000);
|
1123
|
-
}
|
1124
|
-
}
|
1125
|
-
colorChanged() {
|
1126
|
-
this.emitColor();
|
1127
|
-
}
|
1128
|
-
positionChanged() {
|
1129
|
-
this.emitStyle();
|
1130
|
-
}
|
1131
|
-
emitColor() {
|
1132
|
-
const { color } = this;
|
1133
|
-
this.ionColor.emit({
|
1134
|
-
'item-label-color': color !== undefined,
|
1135
|
-
[`ion-color-${color}`]: color !== undefined,
|
1136
|
-
});
|
1137
|
-
}
|
1138
|
-
emitStyle() {
|
1139
|
-
const { inRange, position } = this;
|
1140
|
-
// If the label is inside of a range we don't want
|
1141
|
-
// to override the classes added by the label that
|
1142
|
-
// is a direct child of the item
|
1143
|
-
if (!inRange) {
|
1144
|
-
this.ionStyle.emit({
|
1145
|
-
label: true,
|
1146
|
-
[`label-${position}`]: position !== undefined,
|
1147
|
-
});
|
1148
|
-
}
|
1149
|
-
}
|
1150
|
-
render() {
|
1151
|
-
const position = this.position;
|
1152
|
-
const mode = getIonMode$1(this);
|
1153
|
-
return (h(Host, { class: createColorClasses$1(this.color, {
|
1154
|
-
[mode]: true,
|
1155
|
-
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
1156
|
-
[`label-${position}`]: position !== undefined,
|
1157
|
-
[`label-no-animate`]: this.noAnimate,
|
1158
|
-
'label-rtl': document.dir === 'rtl',
|
1159
|
-
}) }));
|
1160
|
-
}
|
1161
|
-
get el() { return getElement(this); }
|
1162
|
-
static get watchers() { return {
|
1163
|
-
"color": ["colorChanged"],
|
1164
|
-
"position": ["positionChanged"]
|
1165
|
-
}; }
|
1166
|
-
};
|
1167
|
-
Label.style = {
|
1168
|
-
ios: labelIosCss,
|
1169
|
-
md: labelMdCss
|
1170
|
-
};
|
1171
|
-
|
1172
|
-
const listIosCss = "ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-ios{background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-ios.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-ios.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-ios.list-inset ion-item{--border-width:0 0 1px 0;--inner-border-width:0}.list-ios.list-inset ion-item:last-child{--border-width:0;--inner-border-width:0}.list-ios.list-inset+ion-list.list-inset{margin-top:0}.list-ios-lines-none .item{--border-width:0;--inner-border-width:0}.list-ios-lines-full .item,.list-ios .item-lines-full{--border-width:0 0 0.55px 0}.list-ios-lines-full .item{--inner-border-width:0}.list-ios-lines-inset .item,.list-ios .item-lines-inset{--inner-border-width:0 0 0.55px 0}.list-ios .item-lines-inset{--border-width:0}.list-ios .item-lines-full{--inner-border-width:0}.list-ios .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
1173
|
-
|
1174
|
-
const listMdCss = "ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-md>.input:last-child::after{left:0}[dir=rtl] .list-md>.input:last-child::after,:host-context([dir=rtl]) .list-md>.input:last-child::after{left:unset;right:unset;right:0}.list-md.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-md.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-md.list-inset ion-item:first-child{--border-radius:2px 2px 0 0;--border-width:0 0 1px 0}.list-md.list-inset ion-item:last-child{--border-radius:0 0 2px, 2px;--border-width:0}.list-md.list-inset .item-interactive{--padding-start:0;--padding-end:0}.list-md.list-inset+ion-list.list-inset{margin-top:0}.list-md-lines-none .item{--border-width:0;--inner-border-width:0}.list-md-lines-full .item,.list-md .item-lines-full{--border-width:0 0 1px 0}.list-md-lines-full .item{--inner-border-width:0}.list-md-lines-inset .item,.list-md .item-lines-inset{--inner-border-width:0 0 1px 0}.list-md .item-lines-inset{--border-width:0}.list-md .item-lines-full{--inner-border-width:0}.list-md .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
1175
|
-
|
1176
|
-
const List = class {
|
1177
|
-
constructor(hostRef) {
|
1178
|
-
registerInstance(this, hostRef);
|
1179
|
-
/**
|
1180
|
-
* If `true`, the list will have margin around it and rounded corners.
|
1181
|
-
*/
|
1182
|
-
this.inset = false;
|
1183
|
-
}
|
1184
|
-
/**
|
1185
|
-
* If `ion-item-sliding` are used inside the list, this method closes
|
1186
|
-
* any open sliding item.
|
1187
|
-
*
|
1188
|
-
* Returns `true` if an actual `ion-item-sliding` is closed.
|
1189
|
-
*/
|
1190
|
-
async closeSlidingItems() {
|
1191
|
-
const item = this.el.querySelector('ion-item-sliding');
|
1192
|
-
if (item === null || item === void 0 ? void 0 : item.closeOpened) {
|
1193
|
-
return item.closeOpened();
|
1194
|
-
}
|
1195
|
-
return false;
|
1196
|
-
}
|
1197
|
-
render() {
|
1198
|
-
const mode = getIonMode$1(this);
|
1199
|
-
const { lines, inset } = this;
|
1200
|
-
return (h(Host, { role: "list", class: {
|
1201
|
-
[mode]: true,
|
1202
|
-
// Used internally for styling
|
1203
|
-
[`list-${mode}`]: true,
|
1204
|
-
'list-inset': inset,
|
1205
|
-
[`list-lines-${lines}`]: lines !== undefined,
|
1206
|
-
[`list-${mode}-lines-${lines}`]: lines !== undefined,
|
1207
|
-
} }));
|
1208
|
-
}
|
1209
|
-
get el() { return getElement(this); }
|
1210
|
-
};
|
1211
|
-
List.style = {
|
1212
|
-
ios: listIosCss,
|
1213
|
-
md: listMdCss
|
1214
|
-
};
|
1215
|
-
|
1216
|
-
const noteIosCss = ":host{color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-350, #a6a6a6)}";
|
1217
|
-
|
1218
|
-
const noteMdCss = ":host{color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-600, #666666);font-size:14px}";
|
1219
|
-
|
1220
|
-
const Note = class {
|
1221
|
-
constructor(hostRef) {
|
1222
|
-
registerInstance(this, hostRef);
|
1223
|
-
}
|
1224
|
-
render() {
|
1225
|
-
const mode = getIonMode$1(this);
|
1226
|
-
return (h(Host, { class: createColorClasses$1(this.color, {
|
1227
|
-
[mode]: true,
|
1228
|
-
}) }, h("slot", null)));
|
1229
|
-
}
|
1230
|
-
};
|
1231
|
-
Note.style = {
|
1232
|
-
ios: noteIosCss,
|
1233
|
-
md: noteMdCss
|
1234
|
-
};
|
1235
|
-
|
1236
|
-
const rippleEffectCss = ":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{transform:translate(var(--translate-end)) scale(var(--final-scale, 1));animation:150ms fadeOutAnimation forwards}@keyframes rippleAnimation{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(1)}to{transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes fadeInAnimation{from{animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeOutAnimation{from{animation-timing-function:linear;opacity:0.16}to{opacity:0}}";
|
1237
|
-
|
1238
|
-
const RippleEffect = class {
|
1239
|
-
constructor(hostRef) {
|
1240
|
-
registerInstance(this, hostRef);
|
1241
|
-
/**
|
1242
|
-
* Sets the type of ripple-effect:
|
1243
|
-
*
|
1244
|
-
* - `bounded`: the ripple effect expands from the user's click position
|
1245
|
-
* - `unbounded`: the ripple effect expands from the center of the button and overflows the container.
|
1246
|
-
*
|
1247
|
-
* NOTE: Surfaces for bounded ripples should have the overflow property set to hidden,
|
1248
|
-
* while surfaces for unbounded ripples should have it set to visible.
|
1249
|
-
*/
|
1250
|
-
this.type = 'bounded';
|
1251
|
-
}
|
1252
|
-
/**
|
1253
|
-
* Adds the ripple effect to the parent element.
|
1254
|
-
*
|
1255
|
-
* @param x The horizontal coordinate of where the ripple should start.
|
1256
|
-
* @param y The vertical coordinate of where the ripple should start.
|
1257
|
-
*/
|
1258
|
-
async addRipple(x, y) {
|
1259
|
-
return new Promise((resolve) => {
|
1260
|
-
readTask(() => {
|
1261
|
-
const rect = this.el.getBoundingClientRect();
|
1262
|
-
const width = rect.width;
|
1263
|
-
const height = rect.height;
|
1264
|
-
const hypotenuse = Math.sqrt(width * width + height * height);
|
1265
|
-
const maxDim = Math.max(height, width);
|
1266
|
-
const maxRadius = this.unbounded ? maxDim : hypotenuse + PADDING;
|
1267
|
-
const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);
|
1268
|
-
const finalScale = maxRadius / initialSize;
|
1269
|
-
let posX = x - rect.left;
|
1270
|
-
let posY = y - rect.top;
|
1271
|
-
if (this.unbounded) {
|
1272
|
-
posX = width * 0.5;
|
1273
|
-
posY = height * 0.5;
|
1274
|
-
}
|
1275
|
-
const styleX = posX - initialSize * 0.5;
|
1276
|
-
const styleY = posY - initialSize * 0.5;
|
1277
|
-
const moveX = width * 0.5 - posX;
|
1278
|
-
const moveY = height * 0.5 - posY;
|
1279
|
-
writeTask(() => {
|
1280
|
-
const div = document.createElement('div');
|
1281
|
-
div.classList.add('ripple-effect');
|
1282
|
-
const style = div.style;
|
1283
|
-
style.top = styleY + 'px';
|
1284
|
-
style.left = styleX + 'px';
|
1285
|
-
style.width = style.height = initialSize + 'px';
|
1286
|
-
style.setProperty('--final-scale', `${finalScale}`);
|
1287
|
-
style.setProperty('--translate-end', `${moveX}px, ${moveY}px`);
|
1288
|
-
const container = this.el.shadowRoot || this.el;
|
1289
|
-
container.appendChild(div);
|
1290
|
-
setTimeout(() => {
|
1291
|
-
resolve(() => {
|
1292
|
-
removeRipple(div);
|
1293
|
-
});
|
1294
|
-
}, 225 + 100);
|
1295
|
-
});
|
1296
|
-
});
|
1297
|
-
});
|
1298
|
-
}
|
1299
|
-
get unbounded() {
|
1300
|
-
return this.type === 'unbounded';
|
1301
|
-
}
|
1302
|
-
render() {
|
1303
|
-
const mode = getIonMode$1(this);
|
1304
|
-
return (h(Host, { role: "presentation", class: {
|
1305
|
-
[mode]: true,
|
1306
|
-
unbounded: this.unbounded,
|
1307
|
-
} }));
|
1308
|
-
}
|
1309
|
-
get el() { return getElement(this); }
|
1310
|
-
};
|
1311
|
-
const removeRipple = (ripple) => {
|
1312
|
-
ripple.classList.add('fade-out');
|
1313
|
-
setTimeout(() => {
|
1314
|
-
ripple.remove();
|
1315
|
-
}, 200);
|
1316
|
-
};
|
1317
|
-
const PADDING = 10;
|
1318
|
-
const INITIAL_ORIGIN_SCALE = 0.5;
|
1319
|
-
RippleEffect.style = rippleEffectCss;
|
1320
|
-
|
1321
|
-
const spinnerCss = ":host{display:inline-block;position:relative;width:28px;height:28px;color:var(--color);user-select:none}:host(.ion-color){color:var(--ion-color-base)}svg{transform-origin:center;position:absolute;top:0;left:0;width:100%;height:100%;transform:translateZ(0)}[dir=rtl] svg,:host-context([dir=rtl]) svg{transform-origin:calc(100% - center)}:host(.spinner-lines) line,:host(.spinner-lines-small) line{stroke-width:7px}:host(.spinner-lines-sharp) line,:host(.spinner-lines-sharp-small) line{stroke-width:4px}:host(.spinner-lines) line,:host(.spinner-lines-small) line,:host(.spinner-lines-sharp) line,:host(.spinner-lines-sharp-small) line{stroke-linecap:round;stroke:currentColor}:host(.spinner-lines) svg,:host(.spinner-lines-small) svg,:host(.spinner-lines-sharp) svg,:host(.spinner-lines-sharp-small) svg{animation:spinner-fade-out 1s linear infinite}:host(.spinner-bubbles) svg{animation:spinner-scale-out 1s linear infinite;fill:currentColor}:host(.spinner-circles) svg{animation:spinner-fade-out 1s linear infinite;fill:currentColor}:host(.spinner-crescent) circle{fill:transparent;stroke-width:4px;stroke-dasharray:128px;stroke-dashoffset:82px;stroke:currentColor}:host(.spinner-crescent) svg{animation:spinner-rotate 1s linear infinite}:host(.spinner-dots) circle{stroke-width:0;fill:currentColor}:host(.spinner-dots) svg{animation:spinner-dots 1s linear infinite}:host(.spinner-circular) svg{animation:spinner-circular linear infinite}:host(.spinner-circular) circle{animation:spinner-circular-inner ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px, 200px;stroke-dashoffset:0px;stroke-width:5.6;fill:none}:host(.spinner-paused),:host(.spinner-paused) svg,:host(.spinner-paused) circle{animation-play-state:paused}@keyframes spinner-fade-out{0%{opacity:1}100%{opacity:0}}@keyframes spinner-scale-out{0%{transform:scale(1, 1)}100%{transform:scale(0, 0)}}@keyframes spinner-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes spinner-dots{0%{transform:scale(1, 1);opacity:0.9}50%{transform:scale(0.4, 0.4);opacity:0.3}100%{transform:scale(1, 1);opacity:0.9}}@keyframes spinner-circular{100%{transform:rotate(360deg)}}@keyframes spinner-circular-inner{0%{stroke-dasharray:1px, 200px;stroke-dashoffset:0px}50%{stroke-dasharray:100px, 200px;stroke-dashoffset:-15px}100%{stroke-dasharray:100px, 200px;stroke-dashoffset:-125px}}";
|
1322
|
-
|
1323
|
-
const Spinner = class {
|
1324
|
-
constructor(hostRef) {
|
1325
|
-
registerInstance(this, hostRef);
|
1326
|
-
/**
|
1327
|
-
* If `true`, the spinner's animation will be paused.
|
1328
|
-
*/
|
1329
|
-
this.paused = false;
|
1330
|
-
}
|
1331
|
-
getName() {
|
1332
|
-
const spinnerName = this.name || config.get('spinner');
|
1333
|
-
const mode = getIonMode$1(this);
|
1334
|
-
if (spinnerName) {
|
1335
|
-
return spinnerName;
|
1336
|
-
}
|
1337
|
-
return mode === 'ios' ? 'lines' : 'circular';
|
1338
|
-
}
|
1339
|
-
render() {
|
1340
|
-
const self = this;
|
1341
|
-
const mode = getIonMode$1(self);
|
1342
|
-
const spinnerName = self.getName();
|
1343
|
-
const spinner = SPINNERS[spinnerName] || SPINNERS['lines'];
|
1344
|
-
const duration = typeof self.duration === 'number' && self.duration > 10 ? self.duration : spinner.dur;
|
1345
|
-
const svgs = [];
|
1346
|
-
if (spinner.circles !== undefined) {
|
1347
|
-
for (let i = 0; i < spinner.circles; i++) {
|
1348
|
-
svgs.push(buildCircle(spinner, duration, i, spinner.circles));
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
else if (spinner.lines !== undefined) {
|
1352
|
-
for (let i = 0; i < spinner.lines; i++) {
|
1353
|
-
svgs.push(buildLine(spinner, duration, i, spinner.lines));
|
1354
|
-
}
|
1355
|
-
}
|
1356
|
-
return (h(Host, { class: createColorClasses$1(self.color, {
|
1357
|
-
[mode]: true,
|
1358
|
-
[`spinner-${spinnerName}`]: true,
|
1359
|
-
'spinner-paused': self.paused || config.getBoolean('_testing'),
|
1360
|
-
}), role: "progressbar", style: spinner.elmDuration ? { animationDuration: duration + 'ms' } : {} }, svgs));
|
1361
|
-
}
|
1362
|
-
};
|
1363
|
-
const buildCircle = (spinner, duration, index, total) => {
|
1364
|
-
const data = spinner.fn(duration, index, total);
|
1365
|
-
data.style['animation-duration'] = duration + 'ms';
|
1366
|
-
return (h("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, h("circle", { transform: data.transform || 'translate(32,32)', cx: data.cx, cy: data.cy, r: data.r, style: spinner.elmDuration ? { animationDuration: duration + 'ms' } : {} })));
|
1367
|
-
};
|
1368
|
-
const buildLine = (spinner, duration, index, total) => {
|
1369
|
-
const data = spinner.fn(duration, index, total);
|
1370
|
-
data.style['animation-duration'] = duration + 'ms';
|
1371
|
-
return (h("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, h("line", { transform: "translate(32,32)", y1: data.y1, y2: data.y2 })));
|
1372
|
-
};
|
1373
|
-
Spinner.style = spinnerCss;
|
1374
|
-
|
1375
|
-
const textareaIosCss = ".sc-ion-textarea-ios-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;box-sizing:border-box}.ion-color.sc-ion-textarea-ios-h{background:initial}.ion-color.sc-ion-textarea-ios-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-ios-h,ion-item .sc-ion-textarea-ios-h{align-self:baseline}ion-item.sc-ion-textarea-ios-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-ios-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-ios{display:grid;min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.textarea-wrapper.sc-ion-textarea-ios::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-textarea.sc-ion-textarea-ios,.textarea-wrapper.sc-ion-textarea-ios::after{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;grid-area:1/1/2/2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-ios,.textarea-wrapper.sc-ion-textarea-ios::after{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-ios{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;resize:none;appearance:none;overflow:hidden}.native-textarea.sc-ion-textarea-ios::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-ios{opacity:0.4}.cloned-input.sc-ion-textarea-ios{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-ios .cloned-input.sc-ion-textarea-ios,[dir=rtl].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios,[dir=rtl] .sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{left:unset;right:unset;right:0}[auto-grow].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{height:100%}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-ios-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-ios-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-ios-h,.item-label-stacked .sc-ion-textarea-ios-h,.item-label-floating.sc-ion-textarea-ios-h,.item-label-floating .sc-ion-textarea-ios-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}";
|
1376
|
-
|
1377
|
-
const textareaMdCss = ".sc-ion-textarea-md-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;box-sizing:border-box}.ion-color.sc-ion-textarea-md-h{background:initial}.ion-color.sc-ion-textarea-md-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-md-h,ion-item .sc-ion-textarea-md-h{align-self:baseline}ion-item.sc-ion-textarea-md-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-md-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-md{display:grid;min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.textarea-wrapper.sc-ion-textarea-md::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-textarea.sc-ion-textarea-md,.textarea-wrapper.sc-ion-textarea-md::after{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;grid-area:1/1/2/2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-md,.textarea-wrapper.sc-ion-textarea-md::after{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-md{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;resize:none;appearance:none;overflow:hidden}.native-textarea.sc-ion-textarea-md::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-md{opacity:0.4}.cloned-input.sc-ion-textarea-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-md .cloned-input.sc-ion-textarea-md,[dir=rtl].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md,[dir=rtl] .sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{left:unset;right:unset;right:0}[auto-grow].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{height:100%}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-md-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-md-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:8px;margin-left:0;margin-right:0;margin-top:8px;margin-bottom:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-md-h,.item-label-stacked .sc-ion-textarea-md-h,.item-label-floating.sc-ion-textarea-md-h,.item-label-floating .sc-ion-textarea-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}";
|
1378
|
-
|
1379
|
-
const Textarea = class {
|
1380
|
-
constructor(hostRef) {
|
1381
|
-
registerInstance(this, hostRef);
|
1382
|
-
this.ionChange = createEvent(this, "ionChange", 7);
|
1383
|
-
this.ionInput = createEvent(this, "ionInput", 7);
|
1384
|
-
this.ionStyle = createEvent(this, "ionStyle", 7);
|
1385
|
-
this.ionBlur = createEvent(this, "ionBlur", 7);
|
1386
|
-
this.ionFocus = createEvent(this, "ionFocus", 7);
|
1387
|
-
this.inputId = `ion-textarea-${textareaIds++}`;
|
1388
|
-
this.didBlurAfterEdit = false;
|
1389
|
-
this.inheritedAttributes = {};
|
1390
|
-
/**
|
1391
|
-
* This is required for a WebKit bug which requires us to
|
1392
|
-
* blur and focus an input to properly focus the input in
|
1393
|
-
* an item with delegatesFocus. It will no longer be needed
|
1394
|
-
* with iOS 14.
|
1395
|
-
*
|
1396
|
-
* @internal
|
1397
|
-
*/
|
1398
|
-
this.fireFocusEvents = true;
|
1399
|
-
this.hasFocus = false;
|
1400
|
-
/**
|
1401
|
-
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
1402
|
-
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
1403
|
-
*/
|
1404
|
-
this.autocapitalize = 'none';
|
1405
|
-
/**
|
1406
|
-
* This Boolean attribute lets you specify that a form control should have input focus when the page loads.
|
1407
|
-
*/
|
1408
|
-
this.autofocus = false;
|
1409
|
-
/**
|
1410
|
-
* If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `"password"`, `false` for all other types.
|
1411
|
-
*/
|
1412
|
-
this.clearOnEdit = false;
|
1413
|
-
/**
|
1414
|
-
* Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
|
1415
|
-
*/
|
1416
|
-
this.debounce = 0;
|
1417
|
-
/**
|
1418
|
-
* If `true`, the user cannot interact with the textarea.
|
1419
|
-
*/
|
1420
|
-
this.disabled = false;
|
1421
|
-
/**
|
1422
|
-
* The name of the control, which is submitted with the form data.
|
1423
|
-
*/
|
1424
|
-
this.name = this.inputId;
|
1425
|
-
/**
|
1426
|
-
* If `true`, the user cannot modify the value.
|
1427
|
-
*/
|
1428
|
-
this.readonly = false;
|
1429
|
-
/**
|
1430
|
-
* If `true`, the user must fill in a value before submitting a form.
|
1431
|
-
*/
|
1432
|
-
this.required = false;
|
1433
|
-
/**
|
1434
|
-
* If `true`, the element will have its spelling and grammar checked.
|
1435
|
-
*/
|
1436
|
-
this.spellcheck = false;
|
1437
|
-
/**
|
1438
|
-
* If `true`, the textarea container will grow and shrink based
|
1439
|
-
* on the contents of the textarea.
|
1440
|
-
*/
|
1441
|
-
this.autoGrow = false;
|
1442
|
-
/**
|
1443
|
-
* The value of the textarea.
|
1444
|
-
*/
|
1445
|
-
this.value = '';
|
1446
|
-
this.onInput = (ev) => {
|
1447
|
-
if (this.nativeInput) {
|
1448
|
-
this.value = this.nativeInput.value;
|
1449
|
-
}
|
1450
|
-
this.emitStyle();
|
1451
|
-
this.ionInput.emit(ev);
|
1452
|
-
};
|
1453
|
-
this.onFocus = (ev) => {
|
1454
|
-
this.hasFocus = true;
|
1455
|
-
this.focusChange();
|
1456
|
-
if (this.fireFocusEvents) {
|
1457
|
-
this.ionFocus.emit(ev);
|
1458
|
-
}
|
1459
|
-
};
|
1460
|
-
this.onBlur = (ev) => {
|
1461
|
-
this.hasFocus = false;
|
1462
|
-
this.focusChange();
|
1463
|
-
if (this.fireFocusEvents) {
|
1464
|
-
this.ionBlur.emit(ev);
|
1465
|
-
}
|
1466
|
-
};
|
1467
|
-
this.onKeyDown = () => {
|
1468
|
-
this.checkClearOnEdit();
|
1469
|
-
};
|
1470
|
-
}
|
1471
|
-
debounceChanged() {
|
1472
|
-
this.ionChange = debounceEvent(this.ionChange, this.debounce);
|
1473
|
-
}
|
1474
|
-
disabledChanged() {
|
1475
|
-
this.emitStyle();
|
1476
|
-
}
|
1477
|
-
/**
|
1478
|
-
* Update the native input element when the value changes
|
1479
|
-
*/
|
1480
|
-
valueChanged() {
|
1481
|
-
const nativeInput = this.nativeInput;
|
1482
|
-
const value = this.getValue();
|
1483
|
-
if (nativeInput && nativeInput.value !== value) {
|
1484
|
-
nativeInput.value = value;
|
1485
|
-
}
|
1486
|
-
this.runAutoGrow();
|
1487
|
-
this.emitStyle();
|
1488
|
-
this.ionChange.emit({ value });
|
1489
|
-
}
|
1490
|
-
connectedCallback() {
|
1491
|
-
this.emitStyle();
|
1492
|
-
this.debounceChanged();
|
1493
|
-
{
|
1494
|
-
document.dispatchEvent(new CustomEvent('ionInputDidLoad', {
|
1495
|
-
detail: this.el,
|
1496
|
-
}));
|
1497
|
-
}
|
1498
|
-
}
|
1499
|
-
disconnectedCallback() {
|
1500
|
-
{
|
1501
|
-
document.dispatchEvent(new CustomEvent('ionInputDidUnload', {
|
1502
|
-
detail: this.el,
|
1503
|
-
}));
|
1504
|
-
}
|
1505
|
-
}
|
1506
|
-
componentWillLoad() {
|
1507
|
-
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes$1(this.el, ['title']));
|
1508
|
-
}
|
1509
|
-
componentDidLoad() {
|
1510
|
-
this.runAutoGrow();
|
1511
|
-
}
|
1512
|
-
/**
|
1513
|
-
* Sets focus on the native `textarea` in `ion-textarea`. Use this method instead of the global
|
1514
|
-
* `textarea.focus()`.
|
1515
|
-
*/
|
1516
|
-
async setFocus() {
|
1517
|
-
if (this.nativeInput) {
|
1518
|
-
this.nativeInput.focus();
|
1519
|
-
}
|
1520
|
-
}
|
1521
|
-
/**
|
1522
|
-
* Sets blur on the native `textarea` in `ion-textarea`. Use this method instead of the global
|
1523
|
-
* `textarea.blur()`.
|
1524
|
-
* @internal
|
1525
|
-
*/
|
1526
|
-
async setBlur() {
|
1527
|
-
if (this.nativeInput) {
|
1528
|
-
this.nativeInput.blur();
|
1529
|
-
}
|
1530
|
-
}
|
1531
|
-
/**
|
1532
|
-
* Returns the native `<textarea>` element used under the hood.
|
1533
|
-
*/
|
1534
|
-
getInputElement() {
|
1535
|
-
return Promise.resolve(this.nativeInput);
|
1536
|
-
}
|
1537
|
-
emitStyle() {
|
1538
|
-
this.ionStyle.emit({
|
1539
|
-
interactive: true,
|
1540
|
-
textarea: true,
|
1541
|
-
input: true,
|
1542
|
-
'interactive-disabled': this.disabled,
|
1543
|
-
'has-placeholder': this.placeholder !== undefined,
|
1544
|
-
'has-value': this.hasValue(),
|
1545
|
-
'has-focus': this.hasFocus,
|
1546
|
-
});
|
1547
|
-
}
|
1548
|
-
runAutoGrow() {
|
1549
|
-
if (this.nativeInput && this.autoGrow) {
|
1550
|
-
writeTask(() => {
|
1551
|
-
var _a;
|
1552
|
-
if (this.textareaWrapper) {
|
1553
|
-
// Replicated value is an attribute to be used in the stylesheet
|
1554
|
-
// to set the inner contents of a pseudo element.
|
1555
|
-
this.textareaWrapper.dataset.replicatedValue = (_a = this.value) !== null && _a !== void 0 ? _a : '';
|
1556
|
-
}
|
1557
|
-
});
|
1558
|
-
}
|
1559
|
-
}
|
1560
|
-
/**
|
1561
|
-
* Check if we need to clear the text input if clearOnEdit is enabled
|
1562
|
-
*/
|
1563
|
-
checkClearOnEdit() {
|
1564
|
-
if (!this.clearOnEdit) {
|
1565
|
-
return;
|
1566
|
-
}
|
1567
|
-
// Did the input value change after it was blurred and edited?
|
1568
|
-
if (this.didBlurAfterEdit && this.hasValue()) {
|
1569
|
-
// Clear the input
|
1570
|
-
this.value = '';
|
1571
|
-
}
|
1572
|
-
// Reset the flag
|
1573
|
-
this.didBlurAfterEdit = false;
|
1574
|
-
}
|
1575
|
-
focusChange() {
|
1576
|
-
// If clearOnEdit is enabled and the input blurred but has a value, set a flag
|
1577
|
-
if (this.clearOnEdit && !this.hasFocus && this.hasValue()) {
|
1578
|
-
this.didBlurAfterEdit = true;
|
1579
|
-
}
|
1580
|
-
this.emitStyle();
|
1581
|
-
}
|
1582
|
-
hasValue() {
|
1583
|
-
return this.getValue() !== '';
|
1584
|
-
}
|
1585
|
-
getValue() {
|
1586
|
-
return this.value || '';
|
1587
|
-
}
|
1588
|
-
render() {
|
1589
|
-
const mode = getIonMode$1(this);
|
1590
|
-
const value = this.getValue();
|
1591
|
-
const labelId = this.inputId + '-lbl';
|
1592
|
-
const label = findItemLabel(this.el);
|
1593
|
-
if (label) {
|
1594
|
-
label.id = labelId;
|
1595
|
-
}
|
1596
|
-
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
1597
|
-
[mode]: true,
|
1598
|
-
}) }, h("div", { class: "textarea-wrapper", ref: (el) => (this.textareaWrapper = el) }, h("textarea", Object.assign({ class: "native-textarea", "aria-labelledby": label ? labelId : null, ref: (el) => (this.nativeInput = el), autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown }, this.inheritedAttributes), value))));
|
1599
|
-
}
|
1600
|
-
get el() { return getElement(this); }
|
1601
|
-
static get watchers() { return {
|
1602
|
-
"debounce": ["debounceChanged"],
|
1603
|
-
"disabled": ["disabledChanged"],
|
1604
|
-
"value": ["valueChanged"]
|
1605
|
-
}; }
|
1606
|
-
};
|
1607
|
-
let textareaIds = 0;
|
1608
|
-
Textarea.style = {
|
1609
|
-
ios: textareaIosCss,
|
1610
|
-
md: textareaMdCss
|
1611
|
-
};
|
1612
|
-
|
1613
|
-
const toggleIosCss = ":host{box-sizing:content-box !important;display:inline-block;position:relative;outline:none;contain:content;cursor:pointer;touch-action:none;user-select:none;z-index:2}:host(.ion-focused) input{border:2px solid #5e9ed6}:host(.toggle-disabled){pointer-events:none}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;appearance:none;outline:none;display:flex;align-items:center;opacity:0;pointer-events:none}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.toggle-icon-wrapper{display:flex;position:relative;align-items:center;width:100%;height:100%;transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--background);pointer-events:none;overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--background-checked)}.toggle-inner{left:var(--handle-spacing);border-radius:var(--handle-border-radius);position:absolute;width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);transition:var(--handle-transition);background:var(--handle-background);box-shadow:var(--handle-box-shadow);contain:strict}[dir=rtl] .toggle-inner,:host-context([dir=rtl]) .toggle-inner{left:unset;right:unset;right:var(--handle-spacing)}:host(.toggle-checked) .toggle-icon-wrapper{transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-icon-wrapper,:host-context([dir=rtl]).toggle-checked .toggle-icon-wrapper{transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);background:var(--handle-background-checked)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner,:host-context([dir=rtl]).toggle-checked .toggle-inner{transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.088);--background-checked:var(--ion-color-primary, #3880ff);--border-radius:16px;--handle-background:#ffffff;--handle-background-checked:#ffffff;--handle-border-radius:25.5px;--handle-box-shadow:0 3px 12px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.1);--handle-height:calc(32px - (2px * 2));--handle-max-height:calc(100% - var(--handle-spacing) * 2);--handle-width:calc(32px - (2px * 2));--handle-spacing:2px;--handle-transition:transform 300ms, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms, right 110ms ease-in-out 80ms;width:51px;height:32px;contain:strict;overflow:hidden}:host(.ion-color.toggle-checked) .toggle-icon{background:var(--ion-color-base)}:host(.toggle-activated) .toggle-switch-icon{opacity:0}.toggle-icon{transform:translate3d(0, 0, 0);transition:background-color 300ms}.toggle-inner{will-change:transform}.toggle-switch-icon{position:absolute;top:50%;width:11px;height:11px;transform:translateY(-50%);transition:opacity 300ms, color 300ms}.toggle-switch-icon{right:6px;position:absolute;color:var(--ion-color-dark)}[dir=rtl] .toggle-switch-icon,:host-context([dir=rtl]) .toggle-switch-icon{right:initial;left:6px;}:host(.toggle-checked) .toggle-switch-icon.toggle-switch-icon-checked{color:var(--ion-color-contrast, #fff)}:host(.toggle-checked) .toggle-switch-icon:not(.toggle-switch-icon-checked){opacity:0}.toggle-switch-icon-checked{right:initial;left:4px;position:absolute;width:15px;height:15px;transform:translateY(-50%) rotate(90deg)}[dir=rtl] .toggle-switch-icon-checked,:host-context([dir=rtl]) .toggle-switch-icon-checked{right:4px}:host(.toggle-activated) .toggle-icon::before,:host(.toggle-checked) .toggle-icon::before{transform:scale3d(0, 0, 0)}:host(.toggle-activated.toggle-checked) .toggle-inner::before{transform:scale3d(0, 0, 0)}:host(.toggle-activated) .toggle-inner{width:calc(var(--handle-width) + 6px)}:host(.toggle-activated.toggle-checked) .toggle-icon-wrapper{transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0)}:host-context([dir=rtl]):host(.toggle-activated.toggle-checked) .toggle-icon-wrapper,:host-context([dir=rtl]).toggle-activated.toggle-checked .toggle-icon-wrapper{transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0)}:host(.toggle-disabled){opacity:0.3}:host(.in-item[slot]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:20px;padding-right:10px;padding-top:6px;padding-bottom:5px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item[slot]){padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:10px;padding-inline-end:10px}}:host(.in-item[slot=start]){padding-left:0;padding-right:16px;padding-top:6px;padding-bottom:5px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){padding-left:unset;padding-right:unset;-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:16px;padding-inline-end:16px}}";
|
1614
|
-
|
1615
|
-
const toggleMdCss = ":host{box-sizing:content-box !important;display:inline-block;position:relative;outline:none;contain:content;cursor:pointer;touch-action:none;user-select:none;z-index:2}:host(.ion-focused) input{border:2px solid #5e9ed6}:host(.toggle-disabled){pointer-events:none}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;appearance:none;outline:none;display:flex;align-items:center;opacity:0;pointer-events:none}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.toggle-icon-wrapper{display:flex;position:relative;align-items:center;width:100%;height:100%;transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--background);pointer-events:none;overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--background-checked)}.toggle-inner{left:var(--handle-spacing);border-radius:var(--handle-border-radius);position:absolute;width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);transition:var(--handle-transition);background:var(--handle-background);box-shadow:var(--handle-box-shadow);contain:strict}[dir=rtl] .toggle-inner,:host-context([dir=rtl]) .toggle-inner{left:unset;right:unset;right:var(--handle-spacing)}:host(.toggle-checked) .toggle-icon-wrapper{transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-icon-wrapper,:host-context([dir=rtl]).toggle-checked .toggle-icon-wrapper{transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);background:var(--handle-background-checked)}:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner,:host-context([dir=rtl]).toggle-checked .toggle-inner{transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.39);--background-checked:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.5);--border-radius:14px;--handle-background:#ffffff;--handle-background-checked:var(--ion-color-primary, #3880ff);--handle-border-radius:50%;--handle-box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--handle-width:20px;--handle-height:20px;--handle-max-height:calc(100% + 6px);--handle-spacing:0;--handle-transition:transform 160ms cubic-bezier(0.4, 0, 0.2, 1), background-color 160ms cubic-bezier(0.4, 0, 0.2, 1);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;width:36px;height:14px;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host(.ion-color.toggle-checked) .toggle-icon{background:rgba(var(--ion-color-base-rgb), 0.5)}:host(.ion-color.toggle-checked) .toggle-inner{background:var(--ion-color-base)}:host(.toggle-checked) .toggle-inner{color:var(--ion-color-contrast, #fff)}.toggle-icon{transition:background-color 160ms}.toggle-inner{will-change:background-color, transform;display:flex;align-items:center;justify-content:center;color:#000}.toggle-inner .toggle-switch-icon{padding-left:1px;padding-right:1px;padding-top:1px;padding-bottom:1px;width:100%;height:100%}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toggle-inner .toggle-switch-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:1px;padding-inline-start:1px;-webkit-padding-end:1px;padding-inline-end:1px}}:host(.toggle-disabled){opacity:0.3}:host(.in-item[slot]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:16px;padding-right:0;padding-top:12px;padding-bottom:12px;cursor:pointer}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item[slot]){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:0;padding-inline-end:0}}:host(.in-item[slot=start]){padding-left:2px;padding-right:18px;padding-top:12px;padding-bottom:12px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:18px;padding-inline-end:18px}}";
|
1616
|
-
|
1617
|
-
const Toggle = class {
|
1618
|
-
constructor(hostRef) {
|
1619
|
-
registerInstance(this, hostRef);
|
1620
|
-
this.ionChange = createEvent(this, "ionChange", 7);
|
1621
|
-
this.ionFocus = createEvent(this, "ionFocus", 7);
|
1622
|
-
this.ionBlur = createEvent(this, "ionBlur", 7);
|
1623
|
-
this.ionStyle = createEvent(this, "ionStyle", 7);
|
1624
|
-
this.inputId = `ion-tg-${toggleIds++}`;
|
1625
|
-
this.lastDrag = 0;
|
1626
|
-
this.activated = false;
|
1627
|
-
/**
|
1628
|
-
* The name of the control, which is submitted with the form data.
|
1629
|
-
*/
|
1630
|
-
this.name = this.inputId;
|
1631
|
-
/**
|
1632
|
-
* If `true`, the toggle is selected.
|
1633
|
-
*/
|
1634
|
-
this.checked = false;
|
1635
|
-
/**
|
1636
|
-
* If `true`, the user cannot interact with the toggle.
|
1637
|
-
*/
|
1638
|
-
this.disabled = false;
|
1639
|
-
/**
|
1640
|
-
* The value of the toggle does not mean if it's checked or not, use the `checked`
|
1641
|
-
* property for that.
|
1642
|
-
*
|
1643
|
-
* The value of a toggle is analogous to the value of a `<input type="checkbox">`,
|
1644
|
-
* it's only used when the toggle participates in a native `<form>`.
|
1645
|
-
*/
|
1646
|
-
this.value = 'on';
|
1647
|
-
/**
|
1648
|
-
* Enables the on/off accessibility switch labels within the toggle.
|
1649
|
-
*/
|
1650
|
-
this.enableOnOffLabels = undefined;
|
1651
|
-
this.onClick = (ev) => {
|
1652
|
-
ev.preventDefault();
|
1653
|
-
if (this.lastDrag + 300 < Date.now()) {
|
1654
|
-
this.checked = !this.checked;
|
1655
|
-
}
|
1656
|
-
};
|
1657
|
-
this.onFocus = () => {
|
1658
|
-
this.ionFocus.emit();
|
1659
|
-
};
|
1660
|
-
this.onBlur = () => {
|
1661
|
-
this.ionBlur.emit();
|
1662
|
-
};
|
1663
|
-
this.getSwitchLabelIcon = (mode, checked) => {
|
1664
|
-
if (mode === 'md') {
|
1665
|
-
return checked ? checkmarkOutline : removeOutline;
|
1666
|
-
}
|
1667
|
-
return checked ? removeOutline : ellipseOutline;
|
1668
|
-
};
|
1669
|
-
}
|
1670
|
-
checkedChanged(isChecked) {
|
1671
|
-
this.ionChange.emit({
|
1672
|
-
checked: isChecked,
|
1673
|
-
value: this.value,
|
1674
|
-
});
|
1675
|
-
}
|
1676
|
-
disabledChanged() {
|
1677
|
-
this.emitStyle();
|
1678
|
-
if (this.gesture) {
|
1679
|
-
this.gesture.enable(!this.disabled);
|
1680
|
-
}
|
1681
|
-
}
|
1682
|
-
async connectedCallback() {
|
1683
|
-
this.gesture = (await import('./index-21661af2.js')).createGesture({
|
1684
|
-
el: this.el,
|
1685
|
-
gestureName: 'toggle',
|
1686
|
-
gesturePriority: 100,
|
1687
|
-
threshold: 5,
|
1688
|
-
passive: false,
|
1689
|
-
onStart: () => this.onStart(),
|
1690
|
-
onMove: (ev) => this.onMove(ev),
|
1691
|
-
onEnd: (ev) => this.onEnd(ev),
|
1692
|
-
});
|
1693
|
-
this.disabledChanged();
|
1694
|
-
}
|
1695
|
-
disconnectedCallback() {
|
1696
|
-
if (this.gesture) {
|
1697
|
-
this.gesture.destroy();
|
1698
|
-
this.gesture = undefined;
|
1699
|
-
}
|
1700
|
-
}
|
1701
|
-
componentWillLoad() {
|
1702
|
-
this.emitStyle();
|
1703
|
-
}
|
1704
|
-
emitStyle() {
|
1705
|
-
this.ionStyle.emit({
|
1706
|
-
'interactive-disabled': this.disabled,
|
1707
|
-
});
|
1708
|
-
}
|
1709
|
-
onStart() {
|
1710
|
-
this.activated = true;
|
1711
|
-
// touch-action does not work in iOS
|
1712
|
-
this.setFocus();
|
1713
|
-
}
|
1714
|
-
onMove(detail) {
|
1715
|
-
if (shouldToggle(isRTL(this.el), this.checked, detail.deltaX, -10)) {
|
1716
|
-
this.checked = !this.checked;
|
1717
|
-
hapticSelection();
|
1718
|
-
}
|
1719
|
-
}
|
1720
|
-
onEnd(ev) {
|
1721
|
-
this.activated = false;
|
1722
|
-
this.lastDrag = Date.now();
|
1723
|
-
ev.event.preventDefault();
|
1724
|
-
ev.event.stopImmediatePropagation();
|
1725
|
-
}
|
1726
|
-
getValue() {
|
1727
|
-
return this.value || '';
|
1728
|
-
}
|
1729
|
-
setFocus() {
|
1730
|
-
if (this.focusEl) {
|
1731
|
-
this.focusEl.focus();
|
1732
|
-
}
|
1733
|
-
}
|
1734
|
-
renderOnOffSwitchLabels(mode, checked) {
|
1735
|
-
const icon = this.getSwitchLabelIcon(mode, checked);
|
1736
|
-
return (h("ion-icon", { class: {
|
1737
|
-
'toggle-switch-icon': true,
|
1738
|
-
'toggle-switch-icon-checked': checked,
|
1739
|
-
}, icon: icon }));
|
1740
|
-
}
|
1741
|
-
render() {
|
1742
|
-
const { activated, color, checked, disabled, el, inputId, name, enableOnOffLabels } = this;
|
1743
|
-
const mode = getIonMode$1(this);
|
1744
|
-
const { label, labelId, labelText } = getAriaLabel(el, inputId);
|
1745
|
-
const value = this.getValue();
|
1746
|
-
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
1747
|
-
return (h(Host, { onClick: this.onClick, "aria-labelledby": label ? labelId : null, "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, role: "switch", class: createColorClasses$1(color, {
|
1748
|
-
[mode]: true,
|
1749
|
-
'in-item': hostContext('ion-item', el),
|
1750
|
-
'toggle-activated': activated,
|
1751
|
-
'toggle-checked': checked,
|
1752
|
-
'toggle-disabled': disabled,
|
1753
|
-
interactive: true,
|
1754
|
-
}) }, h("div", { class: "toggle-icon", part: "track" }, enableOnOffLabels &&
|
1755
|
-
mode === 'ios' && [this.renderOnOffSwitchLabels(mode, true), this.renderOnOffSwitchLabels(mode, false)], h("div", { class: "toggle-icon-wrapper" }, h("div", { class: "toggle-inner", part: "handle" }, enableOnOffLabels && mode === 'md' && this.renderOnOffSwitchLabels(mode, checked)))), h("label", { htmlFor: inputId }, labelText), h("input", { type: "checkbox", role: "switch", "aria-checked": `${checked}`, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl) })));
|
1756
|
-
}
|
1757
|
-
get el() { return getElement(this); }
|
1758
|
-
static get watchers() { return {
|
1759
|
-
"checked": ["checkedChanged"],
|
1760
|
-
"disabled": ["disabledChanged"]
|
1761
|
-
}; }
|
1762
|
-
};
|
1763
|
-
const shouldToggle = (rtl, checked, deltaX, margin) => {
|
1764
|
-
if (checked) {
|
1765
|
-
return (!rtl && margin > deltaX) || (rtl && -margin < deltaX);
|
1766
|
-
}
|
1767
|
-
else {
|
1768
|
-
return (!rtl && -margin < deltaX) || (rtl && margin > deltaX);
|
1769
|
-
}
|
1770
|
-
};
|
1771
|
-
let toggleIds = 0;
|
1772
|
-
Toggle.style = {
|
1773
|
-
ios: toggleIosCss,
|
1774
|
-
md: toggleMdCss
|
1775
|
-
};
|
1776
|
-
|
1777
|
-
const sparkleFeedPostCss = ":host{display:block}.post-footer{display:flex;justify-content:space-between}.error{color:red}.success{color:green}.uploaded-image{display:block;max-height:140px;width:auto !important}";
|
1778
|
-
|
1779
|
-
const SparkleFeedPost = class {
|
1780
|
-
constructor(hostRef) {
|
1781
|
-
registerInstance(this, hostRef);
|
1782
|
-
}
|
1783
|
-
// @Prop({ connect: 'ion-toast-controller' })
|
1784
|
-
// toastCtrl: HTMLIonToastControllerElement;
|
1785
|
-
componentDidLoad() {
|
1786
|
-
this.postText = this.textValue;
|
1787
|
-
}
|
1788
|
-
setText(text) {
|
1789
|
-
this.postText = text;
|
1790
|
-
}
|
1791
|
-
// async postToFeed() {
|
1792
|
-
// const sparkleConfig: EnvironmentSparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
|
1793
|
-
// const tocData = await AssetsService.getInstance().loadJsonFile<ICourse>(sparkleConfig.tocPath);
|
1794
|
-
// var model = {
|
1795
|
-
// CourseId: tocData.id,
|
1796
|
-
// MiniAppId: SparkleGlobal.MY_GOALS_APP_ID,
|
1797
|
-
// PostText: MyGoalTemplate(this.name.value, this.goalUpdateText.value, this.progress),
|
1798
|
-
// PostTextJSON: MyGoalTemplateJSON(this.name.value, this.goalUpdateText.value, this.progress),
|
1799
|
-
// IsPublic: this.public,
|
1800
|
-
// ExternalResourceUrl: "",
|
1801
|
-
// }
|
1802
|
-
// const result = await FeedService.getInstance().createPost(model);
|
1803
|
-
// if (result.Succeeded) {
|
1804
|
-
// //show success toast
|
1805
|
-
// }
|
1806
|
-
// }
|
1807
|
-
isAuthenticated() {
|
1808
|
-
try {
|
1809
|
-
var sparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
|
1810
|
-
if (!!sparkleConfig && !!sparkleConfig.auth && !!sparkleConfig.auth.getToken()) {
|
1811
|
-
return true;
|
1812
|
-
}
|
1813
|
-
}
|
1814
|
-
catch (_a) {
|
1815
|
-
return false;
|
1816
|
-
}
|
1817
|
-
}
|
1818
|
-
submitPost() {
|
1819
|
-
this.errorMessage = '';
|
1820
|
-
this.successMessage = '';
|
1821
|
-
//let formData = new FormData(this.el.querySelector("form")) as any;
|
1822
|
-
//var postText = this.el.getElementsByClassName("PostText")[0] as HTMLInputElement;
|
1823
|
-
this.el.getElementsByClassName('PostExternalUrl')[0];
|
1824
|
-
this.el.getElementsByClassName('IsPublic')[0];
|
1825
|
-
// this.dataSvc.saveData(data, '/api/class/feed').subscribe(
|
1826
|
-
// x => {
|
1827
|
-
// this.successMessage = 'Posted Successfully.';
|
1828
|
-
// // this.presentToast('Success');
|
1829
|
-
// },
|
1830
|
-
// error => {
|
1831
|
-
// this.errorMessage = 'There is an error while posting.';
|
1832
|
-
// // this.presentToast('There is an error');
|
1833
|
-
// },
|
1834
|
-
// );
|
1835
|
-
//TODO can we return data from the dataSvc so we know if it's successful and can update the form? (Perhaps replace it with the post itself?)
|
1836
|
-
// if (this.assignmentName) {
|
1837
|
-
// data.AssignmentData = JSON.stringify({ text: data.PostText, url: data.ExternalResourceUrl });
|
1838
|
-
// this.dataSvc.saveData(data, '/api/student/assignment-response').subscribe(
|
1839
|
-
// x => {
|
1840
|
-
// this.successMessage = 'Posted Successfully.';
|
1841
|
-
// // this.presentToast('Success');
|
1842
|
-
// },
|
1843
|
-
// error => {
|
1844
|
-
// this.errorMessage = 'There is an error while posting.';
|
1845
|
-
// // this.presentToast('There is an error');
|
1846
|
-
// },
|
1847
|
-
// );
|
1848
|
-
// }
|
1849
|
-
}
|
1850
|
-
uploadImage(evt) {
|
1851
|
-
// this.uploadImageLoading = true;
|
1852
|
-
// var files = evt.target.files;
|
1853
|
-
// this.dataSvc.uploadImage(files, '/api/mediaitems/upload').subscribe(
|
1854
|
-
// x => {
|
1855
|
-
// this.uploadImageLoading = false;
|
1856
|
-
// this.uploadedImage = x.length > 0 ? x[0].FullImageUrl : '';
|
1857
|
-
// this.externalResourceUrl = x.length > 0 ? x[0].FullImageUrl : '';
|
1858
|
-
// //this.successMessage = 'Posted Successfully.'
|
1859
|
-
// // this.presentToast('Success');
|
1860
|
-
// },
|
1861
|
-
// error => {
|
1862
|
-
// this.uploadImageLoading = false;
|
1863
|
-
// this.errorMessage = 'There is an error while uploading an image.';
|
1864
|
-
// },
|
1865
|
-
// );
|
1866
|
-
}
|
1867
|
-
selectFile() {
|
1868
|
-
var fileInput = document.getElementById('fileInput');
|
1869
|
-
fileInput.click();
|
1870
|
-
}
|
1871
|
-
renderUserInfo() {
|
1872
|
-
var tokenInfo = { Token: null, ProfileImageUrl: null };
|
1873
|
-
if (tokenInfo != null && tokenInfo.Token) {
|
1874
|
-
return (h("ion-avatar", { class: "header-avatar", slot: "end" }, h("img", { src: "/assets/img/avatar.png" })));
|
1875
|
-
}
|
1876
|
-
else {
|
1877
|
-
return (h("ion-button", { slot: "end", href: "/login" }, "Login to Post"));
|
1878
|
-
}
|
1879
|
-
}
|
1880
|
-
render() {
|
1881
|
-
const userInfo = this.renderUserInfo();
|
1882
|
-
return (h("ion-card", null, h("ion-item", { class: "header" }, h("ion-card-title", null, "Bulletin Board"), userInfo), h("ion-card-content", null, h("form", null, h("ion-list", null, h("ion-item", { lines: "none" }, h("ion-label", null, "Public"), h("ion-toggle", { class: "IsPublic", slot: "end", color: "primary", name: "IsPublic" })), h("ion-item", { class: "padding" }, h("ion-textarea", { class: "PostText", required: true, placeholder: "Post Text", name: "PostText", value: this.postText })), h("ion-item", { class: "padding" }, h("ion-input", { class: "PostExternalUrl", required: true, type: "text", placeholder: "URL", name: "ExternalResourceUrl", value: this.externalResourceUrl })), this.uploadedImage ? (h("ion-item", { class: "padding" }, h("img", { class: "uploaded-image", src: this.uploadedImage }))) : (''), h("ion-item", { lines: "none" }, h("input", { type: "file", id: "fileInput", onChange: evt => this.uploadImage(evt), style: { display: 'none' }, accept: "image/*" }), this.uploadImageLoading ? h("ion-spinner", { color: "primary" }) : '', h("ion-button", { slot: "start", onClick: evt => this.selectFile() }, h("ion-icon", { name: "add" }), "Upload Image")), h("ion-item", { class: "post-footer", lines: "none" }, h("div", null, h("div", { class: "error" }, this.errorMessage), h("div", { class: "success" }, this.successMessage)), h("ion-button", { slot: "end", size: "default", onClick: evt => this.submitPost(), disabled: !this.isAuthenticated() }, "Post")))))));
|
1883
|
-
}
|
1884
|
-
get el() { return getElement(this); }
|
1885
|
-
};
|
1886
|
-
SparkleFeedPost.style = sparkleFeedPostCss;
|
1887
|
-
|
1888
|
-
export { Avatar as ion_avatar, Button as ion_button, Card as ion_card, CardContent as ion_card_content, CardTitle as ion_card_title, Icon as ion_icon, Input as ion_input, Item as ion_item, Label as ion_label, List as ion_list, Note as ion_note, RippleEffect as ion_ripple_effect, Spinner as ion_spinner, Textarea as ion_textarea, Toggle as ion_toggle, SparkleFeedPost as sparkle_feed_post };
|