@sparkle-learning/core 0.0.32 → 0.0.33
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/PrivateRoute-482697a6.js +35 -0
- package/dist/cjs/{PrivateRoute-043bb7d3.js → auth.service-f878f6ab.js} +0 -30
- package/dist/cjs/dom-utils-b8befdd5.js +63 -0
- package/dist/cjs/header-mobile-collapse_2.cjs.entry.js +112 -0
- package/dist/cjs/index-07e8aa51.js +3071 -0
- package/dist/cjs/index.cjs.js +6 -5
- package/dist/cjs/injectHistory-77d41284.js +9 -0
- package/dist/cjs/ion-avatar.cjs.entry.js +25 -0
- package/dist/cjs/ion-button_3.cjs.entry.js +383 -0
- package/dist/cjs/ion-card_2.cjs.entry.js +93 -0
- package/dist/cjs/ion-checkbox_4.cjs.entry.js +370 -0
- package/dist/cjs/ion-col_3.cjs.entry.js +155 -0
- package/dist/cjs/ion-icon_2.cjs.entry.js +397 -0
- package/dist/cjs/ion-input_2.cjs.entry.js +316 -0
- package/dist/cjs/ion-label_2.cjs.entry.js +126 -0
- package/dist/cjs/ion-range.cjs.entry.js +445 -0
- package/dist/cjs/ion-spinner.cjs.entry.js +64 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/match-path-84c9f7ca.js +511 -0
- package/dist/cjs/sparkle-card_3.cjs.entry.js +91 -0
- package/dist/cjs/sparkle-core.cjs.js +1 -1
- package/dist/cjs/sparkle-course-root.cjs.entry.js +145 -0
- package/dist/cjs/sparkle-dropdown.cjs.entry.js +61 -0
- package/dist/cjs/{header-mobile-collapse_61.cjs.entry.js → sparkle-export-lessons_6.cjs.entry.js} +8863 -17662
- package/dist/cjs/sparkle-facilitator-header_19.cjs.entry.js +2129 -0
- package/dist/cjs/sparkle-feedback.cjs.entry.js +2 -1
- package/dist/cjs/sparkle-goal-progress.cjs.entry.js +19 -0
- package/dist/cjs/sparkle-gww-item.cjs.entry.js +74 -0
- package/dist/cjs/sparkle-intro.cjs.entry.js +26 -0
- package/dist/cjs/sparkle-menu-toggle_3.cjs.entry.js +236 -0
- package/dist/cjs/sparkle-validation-error.cjs.entry.js +21 -0
- package/dist/cjs/stencil-route-link.cjs.entry.js +77 -0
- package/dist/cjs/stencil-router-redirect.cjs.entry.js +32 -0
- package/dist/cjs/student.service-7af424fe.js +61 -0
- package/dist/cjs/user.store-3d29139d.js +21 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sparkle-intro/sparkle-intro.css +16 -0
- package/dist/collection/components/sparkle-intro/sparkle-intro.js +35 -0
- package/dist/esm/PrivateRoute-f59ba6b5.js +33 -0
- package/dist/esm/{animation-b306f6c2.js → animation-7b083379.js} +1 -1
- package/dist/esm/{PrivateRoute-b9937c45.js → auth.service-7ab0ac58.js} +3 -32
- package/dist/esm/{auth.store-3ed2389e.js → auth.store-98fad96d.js} +2 -2
- package/dist/esm/dom-utils-8e73e88b.js +55 -0
- package/dist/esm/{facilitator.service-ec0a9739.js → facilitator.service-1524bf89.js} +1 -1
- package/dist/esm/{feed.service-33b83cb7.js → feed.service-4900fc62.js} +2 -2
- package/dist/esm/{framework-delegate-3bc58c27.js → framework-delegate-518bd233.js} +1 -1
- package/dist/esm/header-mobile-collapse_2.entry.js +107 -0
- package/dist/esm/{helpers-39367fe1.js → helpers-9d0930de.js} +1 -1
- package/dist/esm/{icons-61dec176.js → icons-05b6ce86.js} +1 -1
- package/dist/esm/{index-c26d8655.js → index-8de9446b.js} +3 -3
- package/dist/esm/index-c92f99d4.js +3067 -0
- package/dist/esm/{index-dc61f152.js → index-ea26196a.js} +1 -1
- package/dist/esm/{index-9594837e.js → index-fa5e93c5.js} +2 -2
- package/dist/esm/{index.es-97dd8174.js → index.es-89cff481.js} +3 -3
- package/dist/esm/index.js +5 -4
- package/dist/esm/injectHistory-52d0c7eb.js +7 -0
- package/dist/esm/{input-shims-cc98ea92.js → input-shims-7f04e044.js} +1 -1
- package/dist/esm/ion-accordion.entry.js +2 -2
- package/dist/esm/ion-action-sheet_4.entry.js +5 -5
- package/dist/esm/ion-app.entry.js +3 -3
- package/dist/esm/ion-avatar.entry.js +21 -0
- package/dist/esm/ion-back-button.entry.js +2 -2
- package/dist/esm/ion-breadcrumb.entry.js +2 -2
- package/dist/esm/ion-button_3.entry.js +377 -0
- package/dist/esm/ion-card_2.entry.js +88 -0
- package/dist/esm/ion-checkbox_4.entry.js +363 -0
- package/dist/esm/ion-col_3.entry.js +149 -0
- package/dist/esm/ion-content_2.entry.js +1 -1
- package/dist/esm/ion-datetime.entry.js +2 -2
- package/dist/esm/ion-fab-button.entry.js +1 -1
- package/dist/esm/ion-footer.entry.js +1 -1
- package/dist/esm/ion-icon_2.entry.js +392 -0
- package/dist/esm/ion-img.entry.js +1 -1
- package/dist/esm/ion-infinite-scroll.entry.js +1 -1
- package/dist/esm/ion-input_2.entry.js +311 -0
- package/dist/esm/ion-item-options.entry.js +1 -1
- package/dist/esm/ion-item-sliding.entry.js +1 -1
- package/dist/esm/ion-label_2.entry.js +121 -0
- package/dist/esm/ion-loading.entry.js +3 -3
- package/dist/esm/ion-menu-button.entry.js +5 -5
- package/dist/esm/ion-menu-toggle.entry.js +4 -4
- package/dist/esm/ion-menu.entry.js +4 -4
- package/dist/esm/ion-modal.entry.js +5 -5
- package/dist/esm/ion-nav.entry.js +4 -4
- package/dist/esm/ion-picker-column-internal_2.entry.js +1 -1
- package/dist/esm/ion-picker-column.entry.js +1 -1
- package/dist/esm/ion-picker.entry.js +3 -3
- package/dist/esm/ion-progress-bar.entry.js +1 -1
- package/dist/esm/ion-range.entry.js +441 -0
- package/dist/esm/ion-refresher-content.entry.js +1 -1
- package/dist/esm/ion-refresher.entry.js +2 -2
- package/dist/esm/ion-reorder-group.entry.js +1 -1
- package/dist/esm/ion-reorder.entry.js +1 -1
- package/dist/esm/ion-router-outlet.entry.js +4 -4
- package/dist/esm/ion-router.entry.js +1 -1
- package/dist/esm/ion-searchbar.entry.js +2 -2
- package/dist/esm/ion-segment-button.entry.js +1 -1
- package/dist/esm/ion-segment.entry.js +1 -1
- package/dist/esm/ion-select_2.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +1 -1
- package/dist/esm/ion-spinner.entry.js +60 -0
- package/dist/esm/ion-tab.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +3 -3
- package/dist/esm/ion-toggle.entry.js +1 -1
- package/dist/esm/ion-virtual-scroll.entry.js +1 -1
- package/dist/esm/{ios.transition-b4ca8a33.js → ios.transition-db4f4ca6.js} +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/match-path-36fdf5c7.js +499 -0
- package/dist/esm/{md.transition-ca5e0322.js → md.transition-8294b503.js} +3 -3
- package/dist/esm/{menu-toggle-util-7fa22c2f.js → menu-toggle-util-06adade3.js} +1 -1
- package/dist/esm/{overlays-34cfa9e0.js → overlays-5c777f10.js} +2 -2
- package/dist/esm/{purify-ffce2b4c.js → purify-eb68cf1d.js} +1 -1
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-card_3.entry.js +85 -0
- package/dist/esm/sparkle-code.entry.js +1 -1
- package/dist/esm/sparkle-core.js +1 -1
- package/dist/esm/sparkle-course-root.entry.js +141 -0
- package/dist/esm/sparkle-dropdown.entry.js +57 -0
- package/dist/esm/{header-mobile-collapse_61.entry.js → sparkle-export-lessons_6.entry.js} +8858 -17602
- package/dist/esm/sparkle-facilitator-header_19.entry.js +2107 -0
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +4 -4
- package/dist/esm/sparkle-feedback.entry.js +5 -4
- package/dist/esm/sparkle-goal-form.entry.js +5 -5
- package/dist/esm/sparkle-goal-progress.entry.js +15 -0
- package/dist/esm/sparkle-gww-item.entry.js +70 -0
- package/dist/esm/sparkle-intro.entry.js +22 -0
- package/dist/esm/sparkle-menu-collapsible.entry.js +1 -1
- package/dist/esm/sparkle-menu-toggle_3.entry.js +230 -0
- package/dist/esm/sparkle-validation-error.entry.js +17 -0
- package/dist/esm/{status-tap-6351a0cb.js → status-tap-e8c0c752.js} +1 -1
- package/dist/esm/stencil-route-link.entry.js +73 -0
- package/dist/esm/stencil-router-redirect.entry.js +28 -0
- package/dist/esm/{student.service-29b688ba.js → student.service-c2f44f3a.js} +3 -18
- package/dist/esm/{swipe-back-34251834.js → swipe-back-9a3b2cdd.js} +1 -1
- package/dist/esm/{tap-click-13f1fb0d.js → tap-click-cca25060.js} +1 -1
- package/dist/esm/user.store-e6ff7558.js +19 -0
- package/dist/esm/{util-6ef753e9.js → util-a831d09d.js} +1 -1
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-021fde3c.entry.js +1 -0
- package/dist/sparkle-core/p-034306e2.js +1 -0
- package/dist/sparkle-core/{p-6c90bde6.entry.js → p-034aa29f.entry.js} +1 -1
- package/dist/sparkle-core/p-06c0cce3.entry.js +1 -0
- package/dist/sparkle-core/{p-9cfdeb18.entry.js → p-08923b40.entry.js} +1 -1
- package/dist/sparkle-core/{p-513794b0.js → p-0ad99881.js} +1 -1
- package/dist/sparkle-core/{p-95004267.entry.js → p-11234d0f.entry.js} +1 -1
- package/dist/sparkle-core/{p-9a17f2ad.js → p-1133fcbd.js} +2 -2
- package/dist/sparkle-core/{p-faa912d7.entry.js → p-1551190a.entry.js} +1 -1
- package/dist/sparkle-core/p-1728ead7.js +1 -0
- package/dist/sparkle-core/{p-ae1f145d.entry.js → p-1e8c22e0.entry.js} +1 -1
- package/dist/sparkle-core/p-232cc3bc.js +1 -0
- package/dist/sparkle-core/{p-289a35ed.entry.js → p-28950db0.entry.js} +1 -1
- package/dist/sparkle-core/p-2af82cc1.entry.js +1 -0
- package/dist/sparkle-core/p-2bd4c60e.js +1 -0
- package/dist/sparkle-core/p-2f437793.entry.js +348 -0
- package/dist/sparkle-core/p-330ccc7c.entry.js +1 -0
- package/dist/sparkle-core/{p-838fa86d.entry.js → p-337f92b0.entry.js} +1 -1
- package/dist/sparkle-core/{p-857f3696.entry.js → p-35c5c110.entry.js} +1 -1
- package/dist/sparkle-core/p-3ff617d5.js +1 -0
- package/dist/sparkle-core/{p-9c1772c3.js → p-401feeb0.js} +1 -1
- package/dist/sparkle-core/{p-5a3d0e6b.js → p-4028676b.js} +1 -1
- package/dist/sparkle-core/{p-1cef8572.js → p-41124baa.js} +1 -1
- package/dist/sparkle-core/{p-0187adef.entry.js → p-41af3793.entry.js} +1 -1
- package/dist/sparkle-core/p-43a7391b.entry.js +1 -0
- package/dist/sparkle-core/{p-855ca600.js → p-44c23f72.js} +1 -1
- package/dist/sparkle-core/{p-c1376096.entry.js → p-4550e10f.entry.js} +1 -1
- package/dist/sparkle-core/{p-660e0742.js → p-4a72626a.js} +1 -1
- package/dist/sparkle-core/{p-e1cba44b.entry.js → p-4ba57978.entry.js} +1 -1
- package/dist/sparkle-core/{p-935e7cfc.js → p-4bd4dab2.js} +1 -1
- package/dist/sparkle-core/{p-d5b05ece.entry.js → p-4ef4b8bd.entry.js} +1 -1
- package/dist/sparkle-core/{p-55ae49e1.js → p-4f144efa.js} +1 -1
- package/dist/sparkle-core/{p-713590fc.js → p-52d4715a.js} +1 -1
- package/dist/sparkle-core/{p-bca0e465.entry.js → p-52f1d1ca.entry.js} +1 -1
- package/dist/sparkle-core/{p-7e61973d.entry.js → p-5a98d42e.entry.js} +1 -1
- package/dist/sparkle-core/{p-99b43ee1.entry.js → p-5e4ec238.entry.js} +1 -1
- package/dist/sparkle-core/{p-e6b66cef.entry.js → p-5ec7fd67.entry.js} +1 -1
- package/dist/sparkle-core/p-618f6f82.entry.js +1 -0
- package/dist/sparkle-core/p-65ca1fb2.entry.js +1 -0
- package/dist/sparkle-core/{p-a080e768.entry.js → p-663fafa9.entry.js} +1 -1
- package/dist/sparkle-core/p-67f71099.entry.js +4 -0
- package/dist/sparkle-core/{p-6e88764b.entry.js → p-6a16b9ef.entry.js} +2 -2
- package/dist/sparkle-core/p-6b6a8f0a.entry.js +1 -0
- package/dist/sparkle-core/p-6c5b5ea2.entry.js +1 -0
- package/dist/sparkle-core/{p-941eaa3a.entry.js → p-6ebf52fb.entry.js} +1 -1
- package/dist/sparkle-core/p-6f45db93.js +1 -0
- package/dist/sparkle-core/p-74106ca8.entry.js +1 -0
- package/dist/sparkle-core/{p-6fbe3ca3.entry.js → p-7568dcab.entry.js} +1 -1
- package/dist/sparkle-core/p-7703bae9.entry.js +1 -0
- package/dist/sparkle-core/p-77c23496.entry.js +1 -0
- package/dist/sparkle-core/p-79606a41.entry.js +1 -0
- package/dist/sparkle-core/p-7976e88c.entry.js +1 -0
- package/dist/sparkle-core/p-7c1f59ec.js +1 -0
- package/dist/sparkle-core/p-7de0a22b.entry.js +1 -0
- package/dist/sparkle-core/p-848fe770.entry.js +1 -0
- package/dist/sparkle-core/{p-cbbeed67.entry.js → p-85429b12.entry.js} +1 -1
- package/dist/sparkle-core/{p-64e72f8f.js → p-86d099f1.js} +2 -2
- package/dist/sparkle-core/{p-389500fd.js → p-87549bb7.js} +2 -2
- package/dist/sparkle-core/{p-1b78dea1.entry.js → p-8c470e28.entry.js} +1 -1
- package/dist/sparkle-core/{p-50aac721.entry.js → p-90466494.entry.js} +1 -1
- package/dist/sparkle-core/p-954c89c2.entry.js +1 -0
- package/dist/sparkle-core/{p-f4001fdf.js → p-95d01c4c.js} +1 -1
- package/dist/sparkle-core/{p-6ee40949.js → p-987c64eb.js} +1 -1
- package/dist/sparkle-core/{p-1af044f7.js → p-a7832a51.js} +1 -1
- package/dist/sparkle-core/p-a89dea80.entry.js +1 -0
- package/dist/sparkle-core/p-aef8aa31.entry.js +1 -0
- package/dist/sparkle-core/{p-6c6145cd.js → p-b17dd6df.js} +2 -2
- package/dist/sparkle-core/{p-5ff6416d.entry.js → p-b21d0d9f.entry.js} +1 -1
- package/dist/sparkle-core/p-b7dafaae.entry.js +1 -0
- package/dist/sparkle-core/{p-c3986a52.entry.js → p-bd062288.entry.js} +1 -1
- package/dist/sparkle-core/{p-c1279cc9.entry.js → p-beb401e3.entry.js} +1 -1
- package/dist/sparkle-core/p-bef34cfe.entry.js +1 -0
- package/dist/sparkle-core/{p-6bf07a28.js → p-c1c59771.js} +1 -1
- package/dist/sparkle-core/p-c4104929.entry.js +1 -0
- package/dist/sparkle-core/{p-173d5461.entry.js → p-c748f64e.entry.js} +1 -1
- package/dist/sparkle-core/{p-d4a435f8.entry.js → p-c753207f.entry.js} +1 -1
- package/dist/sparkle-core/{p-18e62133.entry.js → p-c8ae9e47.entry.js} +1 -1
- package/dist/sparkle-core/p-c8ed0575.js +1 -0
- package/dist/sparkle-core/{p-8fe2e51f.entry.js → p-c96b24bd.entry.js} +2 -2
- package/dist/sparkle-core/p-ce13171b.entry.js +1 -0
- package/dist/sparkle-core/{p-5c9aa1f9.entry.js → p-d00f550b.entry.js} +1 -1
- package/dist/sparkle-core/p-d394eed1.entry.js +1 -0
- package/dist/sparkle-core/p-d48e95c1.entry.js +1 -0
- package/dist/sparkle-core/p-d4b1a14a.entry.js +1 -0
- package/dist/sparkle-core/{p-b81e20fe.entry.js → p-d56efeac.entry.js} +1 -1
- package/dist/sparkle-core/{p-932bfb69.entry.js → p-d59a5984.entry.js} +1 -1
- package/dist/sparkle-core/p-d8aff730.entry.js +1 -0
- package/dist/sparkle-core/{p-5d2e54ee.entry.js → p-da8921d0.entry.js} +1 -1
- package/dist/sparkle-core/{p-a1cab0f3.js → p-e08059b6.js} +2 -2
- package/dist/sparkle-core/{p-5598650a.entry.js → p-ec4d22e3.entry.js} +1 -1
- package/dist/sparkle-core/{p-eb70a23c.entry.js → p-ed3eed72.entry.js} +1 -1
- package/dist/sparkle-core/{p-a7cc0052.entry.js → p-ee0717e1.entry.js} +1 -1
- package/dist/sparkle-core/p-ef2dace6.js +4 -0
- package/dist/sparkle-core/{p-2ee6a5f9.entry.js → p-f1106984.entry.js} +1 -1
- package/dist/sparkle-core/p-f61ca75c.entry.js +1 -0
- package/dist/sparkle-core/{p-e225581a.js → p-f6bafe1d.js} +1 -1
- package/dist/sparkle-core/{p-1df05176.js → p-ff4d6858.js} +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/sparkle-intro/sparkle-intro.d.ts +7 -0
- package/dist/types/components.d.ts +13 -0
- package/package.json +1 -1
- package/dist/cjs/student.service-744c3155.js +0 -77
- package/dist/sparkle-core/p-03189863.js +0 -1
- package/dist/sparkle-core/p-0f899097.entry.js +0 -352
- package/dist/sparkle-core/p-1339830f.entry.js +0 -1
- package/dist/sparkle-core/p-145e40f5.entry.js +0 -1
- package/dist/sparkle-core/p-547b70c6.entry.js +0 -1
- package/dist/sparkle-core/p-6bbabb80.entry.js +0 -1
- package/dist/sparkle-core/p-950effe7.entry.js +0 -1
- package/dist/sparkle-core/p-d8d3524a.js +0 -1
- package/dist/sparkle-core/p-e0fced48.entry.js +0 -1
- package/dist/sparkle-core/p-e72d4450.js +0 -4
- package/dist/sparkle-core/p-fc933591.entry.js +0 -1
@@ -0,0 +1,445 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-bae2a754.js');
|
6
|
+
const ionicGlobal = require('./ionic-global-878073d1.js');
|
7
|
+
const helpers = require('./helpers-7e28976c.js');
|
8
|
+
const dir = require('./dir-5af5259a.js');
|
9
|
+
const theme = require('./theme-4252ac15.js');
|
10
|
+
|
11
|
+
const rangeIosCss = ":host{--knob-handle-size:calc(var(--knob-size) * 2);display:flex;position:relative;flex:3;align-items:center;font-family:var(--ion-font-family, inherit);user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:grab;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;box-sizing:border-box}.range-knob-handle{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}[dir=rtl] .range-knob-handle,:host-context([dir=rtl]) .range-knob-handle{left:unset;right:unset;right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.range-knob-handle{margin-left:unset;-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2)}}[dir=rtl] .range-knob-handle,:host-context([dir=rtl]) .range-knob-handle{left:unset}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar{border-radius:var(--bar-border-radius);left:0;top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}[dir=rtl] .range-bar,:host-context([dir=rtl]) .range-bar{left:unset;right:unset;right:0}[dir=rtl] .range-bar,:host-context([dir=rtl]) .range-bar{left:unset}.range-knob{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}[dir=rtl] .range-knob,:host-context([dir=rtl]) .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}[dir=rtl] .range-knob,:host-context([dir=rtl]) .range-knob{left:unset}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host(.in-item) ::slotted(ion-label){align-self:center}:host{--knob-border-radius:50%;--knob-background:#ffffff;--knob-box-shadow:0 3px 1px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.13), 0 0 0 1px rgba(0, 0, 0, 0.02);--knob-size:28px;--bar-height:2px;--bar-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:0;--height:42px;padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-tick-active{background:var(--ion-color-base)}::slotted([slot=start]){margin-left:0;margin-right:16px;margin-top:0;margin-bottom:0}@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:16px;margin-inline-end:16px}}::slotted([slot=end]){margin-left:16px;margin-right:0;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}}:host(.range-has-pin){padding-top:20px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-tick{margin-left:-1px;border-radius:0;position:absolute;top:18px;width:2px;height:8px;background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1);pointer-events:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.range-tick{margin-left:unset;-webkit-margin-start:-1px;margin-inline-start:-1px}}.range-tick-active{background:var(--bar-background-active)}.range-pin{transform:translate3d(0, 28px, 0) scale(0.01);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;display:inline-block;position:relative;top:-20px;min-width:28px;transition:transform 120ms ease;background:transparent;color:var(--ion-text-color, #000);font-size:12px;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.range-pin{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.range-knob-pressed .range-pin{transform:translate3d(0, 0, 0) scale(1)}:host(.range-disabled){opacity:0.5}";
|
12
|
+
|
13
|
+
const rangeMdCss = ":host{--knob-handle-size:calc(var(--knob-size) * 2);display:flex;position:relative;flex:3;align-items:center;font-family:var(--ion-font-family, inherit);user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:grab;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;box-sizing:border-box}.range-knob-handle{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}[dir=rtl] .range-knob-handle,:host-context([dir=rtl]) .range-knob-handle{left:unset;right:unset;right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.range-knob-handle{margin-left:unset;-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2)}}[dir=rtl] .range-knob-handle,:host-context([dir=rtl]) .range-knob-handle{left:unset}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar{border-radius:var(--bar-border-radius);left:0;top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}[dir=rtl] .range-bar,:host-context([dir=rtl]) .range-bar{left:unset;right:unset;right:0}[dir=rtl] .range-bar,:host-context([dir=rtl]) .range-bar{left:unset}.range-knob{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}[dir=rtl] .range-knob,:host-context([dir=rtl]) .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}[dir=rtl] .range-knob,:host-context([dir=rtl]) .range-knob{left:unset}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host(.in-item) ::slotted(ion-label){align-self:center}:host{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.26);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:0;--height:42px;--pin-background:var(--ion-color-primary, #3880ff);--pin-color:var(--ion-color-primary-contrast, #fff);padding-left:14px;padding-right:14px;padding-top:8px;padding-bottom:8px;font-size:12px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:14px;padding-inline-start:14px;-webkit-padding-end:14px;padding-inline-end:14px}}:host(.ion-color) .range-bar{background:rgba(var(--ion-color-base-rgb), 0.26)}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-knob,:host(.ion-color) .range-pin,:host(.ion-color) .range-pin::before,:host(.ion-color) .range-tick{background:var(--ion-color-base);color:var(--ion-color-contrast)}::slotted([slot=start]){margin-left:0;margin-right:14px;margin-top:0;margin-bottom:0}@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:14px;margin-inline-end:14px}}::slotted([slot=end]){margin-left:14px;margin-right:0;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:14px;margin-inline-start:14px;-webkit-margin-end:0;margin-inline-end:0}}:host(.range-has-pin){padding-top:28px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-knob{transform:scale(0.67);transition-duration:120ms;transition-property:transform, background-color, border;transition-timing-function:ease;z-index:2}.range-tick{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick-active{background:transparent}.range-pin{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;border-radius:50%;transform:translate3d(0, 0, 0) scale(0.01);display:inline-block;position:relative;min-width:28px;height:28px;transition:transform 120ms ease, background 120ms ease;background:var(--pin-background);color:var(--pin-color);text-align:center}.range-pin::before{left:50%;top:3px;margin-left:-13px;border-radius:50% 50% 50% 0;position:absolute;width:26px;height:26px;transform:rotate(-45deg);transition:background 120ms ease;background:var(--pin-background);content:\"\";z-index:-1}[dir=rtl] .range-pin::before,:host-context([dir=rtl]) .range-pin::before{left:unset;right:unset;right:50%}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.range-pin::before{margin-left:unset;-webkit-margin-start:-13px;margin-inline-start:-13px}}[dir=rtl] .range-pin::before,:host-context([dir=rtl]) .range-pin::before{left:unset}.range-knob-pressed .range-pin{transform:translate3d(0, -24px, 0) scale(1)}:host(:not(.range-has-pin)) .range-knob-pressed .range-knob{transform:scale(1)}:host(.range-disabled) .range-bar-active,:host(.range-disabled) .range-bar,:host(.range-disabled) .range-tick{background-color:var(--ion-color-step-250, #bfbfbf)}:host(.range-disabled) .range-knob{transform:scale(0.55);outline:5px solid #fff;background-color:var(--ion-color-step-250, #bfbfbf)}";
|
14
|
+
|
15
|
+
const Range = class {
|
16
|
+
constructor(hostRef) {
|
17
|
+
index.registerInstance(this, hostRef);
|
18
|
+
this.ionChange = index.createEvent(this, "ionChange", 7);
|
19
|
+
this.ionStyle = index.createEvent(this, "ionStyle", 7);
|
20
|
+
this.ionFocus = index.createEvent(this, "ionFocus", 7);
|
21
|
+
this.ionBlur = index.createEvent(this, "ionBlur", 7);
|
22
|
+
this.didLoad = false;
|
23
|
+
this.noUpdate = false;
|
24
|
+
this.hasFocus = false;
|
25
|
+
this.inheritedAttributes = {};
|
26
|
+
this.ratioA = 0;
|
27
|
+
this.ratioB = 0;
|
28
|
+
/**
|
29
|
+
* How long, in milliseconds, to wait to trigger the
|
30
|
+
* `ionChange` event after each change in the range value.
|
31
|
+
* This also impacts form bindings such as `ngModel` or `v-model`.
|
32
|
+
*/
|
33
|
+
this.debounce = 0;
|
34
|
+
// TODO: In Ionic Framework v6 this should initialize to this.rangeId like the other form components do.
|
35
|
+
/**
|
36
|
+
* The name of the control, which is submitted with the form data.
|
37
|
+
*/
|
38
|
+
this.name = '';
|
39
|
+
/**
|
40
|
+
* Show two knobs.
|
41
|
+
*/
|
42
|
+
this.dualKnobs = false;
|
43
|
+
/**
|
44
|
+
* Minimum integer value of the range.
|
45
|
+
*/
|
46
|
+
this.min = 0;
|
47
|
+
/**
|
48
|
+
* Maximum integer value of the range.
|
49
|
+
*/
|
50
|
+
this.max = 100;
|
51
|
+
/**
|
52
|
+
* If `true`, a pin with integer value is shown when the knob
|
53
|
+
* is pressed.
|
54
|
+
*/
|
55
|
+
this.pin = false;
|
56
|
+
/**
|
57
|
+
* A callback used to format the pin text.
|
58
|
+
* By default the pin text is set to `Math.round(value)`.
|
59
|
+
*/
|
60
|
+
this.pinFormatter = (value) => Math.round(value);
|
61
|
+
/**
|
62
|
+
* If `true`, the knob snaps to tick marks evenly spaced based
|
63
|
+
* on the step property value.
|
64
|
+
*/
|
65
|
+
this.snaps = false;
|
66
|
+
/**
|
67
|
+
* Specifies the value granularity.
|
68
|
+
*/
|
69
|
+
this.step = 1;
|
70
|
+
/**
|
71
|
+
* If `true`, tick marks are displayed based on the step value.
|
72
|
+
* Only applies when `snaps` is `true`.
|
73
|
+
*/
|
74
|
+
this.ticks = true;
|
75
|
+
/**
|
76
|
+
* If `true`, the user cannot interact with the range.
|
77
|
+
*/
|
78
|
+
this.disabled = false;
|
79
|
+
/**
|
80
|
+
* the value of the range.
|
81
|
+
*/
|
82
|
+
this.value = 0;
|
83
|
+
this.clampBounds = (value) => {
|
84
|
+
return helpers.clamp(this.min, value, this.max);
|
85
|
+
};
|
86
|
+
this.ensureValueInBounds = (value) => {
|
87
|
+
if (this.dualKnobs) {
|
88
|
+
return {
|
89
|
+
lower: this.clampBounds(value.lower),
|
90
|
+
upper: this.clampBounds(value.upper)
|
91
|
+
};
|
92
|
+
}
|
93
|
+
else {
|
94
|
+
return this.clampBounds(value);
|
95
|
+
}
|
96
|
+
};
|
97
|
+
this.setupGesture = async () => {
|
98
|
+
const rangeSlider = this.rangeSlider;
|
99
|
+
if (rangeSlider) {
|
100
|
+
this.gesture = (await Promise.resolve().then(function () { return require('./index-43642662.js'); })).createGesture({
|
101
|
+
el: rangeSlider,
|
102
|
+
gestureName: 'range',
|
103
|
+
gesturePriority: 100,
|
104
|
+
threshold: 0,
|
105
|
+
onStart: ev => this.onStart(ev),
|
106
|
+
onMove: ev => this.onMove(ev),
|
107
|
+
onEnd: ev => this.onEnd(ev),
|
108
|
+
});
|
109
|
+
this.gesture.enable(!this.disabled);
|
110
|
+
}
|
111
|
+
};
|
112
|
+
this.handleKeyboard = (knob, isIncrease) => {
|
113
|
+
let step = this.step;
|
114
|
+
step = step > 0 ? step : 1;
|
115
|
+
step = step / (this.max - this.min);
|
116
|
+
if (!isIncrease) {
|
117
|
+
step *= -1;
|
118
|
+
}
|
119
|
+
if (knob === 'A') {
|
120
|
+
this.ratioA = helpers.clamp(0, this.ratioA + step, 1);
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
this.ratioB = helpers.clamp(0, this.ratioB + step, 1);
|
124
|
+
}
|
125
|
+
this.updateValue();
|
126
|
+
};
|
127
|
+
this.onBlur = () => {
|
128
|
+
if (this.hasFocus) {
|
129
|
+
this.hasFocus = false;
|
130
|
+
this.ionBlur.emit();
|
131
|
+
this.emitStyle();
|
132
|
+
}
|
133
|
+
};
|
134
|
+
this.onFocus = () => {
|
135
|
+
if (!this.hasFocus) {
|
136
|
+
this.hasFocus = true;
|
137
|
+
this.ionFocus.emit();
|
138
|
+
this.emitStyle();
|
139
|
+
}
|
140
|
+
};
|
141
|
+
}
|
142
|
+
debounceChanged() {
|
143
|
+
this.ionChange = helpers.debounceEvent(this.ionChange, this.debounce);
|
144
|
+
}
|
145
|
+
minChanged() {
|
146
|
+
if (!this.noUpdate) {
|
147
|
+
this.updateRatio();
|
148
|
+
}
|
149
|
+
}
|
150
|
+
maxChanged() {
|
151
|
+
if (!this.noUpdate) {
|
152
|
+
this.updateRatio();
|
153
|
+
}
|
154
|
+
}
|
155
|
+
disabledChanged() {
|
156
|
+
if (this.gesture) {
|
157
|
+
this.gesture.enable(!this.disabled);
|
158
|
+
}
|
159
|
+
this.emitStyle();
|
160
|
+
}
|
161
|
+
valueChanged(value) {
|
162
|
+
if (!this.noUpdate) {
|
163
|
+
this.updateRatio();
|
164
|
+
}
|
165
|
+
value = this.ensureValueInBounds(value);
|
166
|
+
this.ionChange.emit({ value });
|
167
|
+
}
|
168
|
+
componentWillLoad() {
|
169
|
+
/**
|
170
|
+
* If user has custom ID set then we should
|
171
|
+
* not assign the default incrementing ID.
|
172
|
+
*/
|
173
|
+
this.rangeId = (this.el.hasAttribute('id')) ? this.el.getAttribute('id') : `ion-r-${rangeIds++}`;
|
174
|
+
this.inheritedAttributes = helpers.inheritAttributes(this.el, ['aria-label']);
|
175
|
+
}
|
176
|
+
componentDidLoad() {
|
177
|
+
this.setupGesture();
|
178
|
+
this.didLoad = true;
|
179
|
+
}
|
180
|
+
connectedCallback() {
|
181
|
+
this.updateRatio();
|
182
|
+
this.debounceChanged();
|
183
|
+
this.disabledChanged();
|
184
|
+
/**
|
185
|
+
* If we have not yet rendered
|
186
|
+
* ion-range, then rangeSlider is not defined.
|
187
|
+
* But if we are moving ion-range via appendChild,
|
188
|
+
* then rangeSlider will be defined.
|
189
|
+
*/
|
190
|
+
if (this.didLoad) {
|
191
|
+
this.setupGesture();
|
192
|
+
}
|
193
|
+
}
|
194
|
+
disconnectedCallback() {
|
195
|
+
if (this.gesture) {
|
196
|
+
this.gesture.destroy();
|
197
|
+
this.gesture = undefined;
|
198
|
+
}
|
199
|
+
}
|
200
|
+
getValue() {
|
201
|
+
const value = this.value || 0;
|
202
|
+
if (this.dualKnobs) {
|
203
|
+
if (typeof value === 'object') {
|
204
|
+
return value;
|
205
|
+
}
|
206
|
+
return {
|
207
|
+
lower: 0,
|
208
|
+
upper: value
|
209
|
+
};
|
210
|
+
}
|
211
|
+
else {
|
212
|
+
if (typeof value === 'object') {
|
213
|
+
return value.upper;
|
214
|
+
}
|
215
|
+
return value;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
emitStyle() {
|
219
|
+
this.ionStyle.emit({
|
220
|
+
'interactive': true,
|
221
|
+
'interactive-disabled': this.disabled
|
222
|
+
});
|
223
|
+
}
|
224
|
+
onStart(detail) {
|
225
|
+
const rect = this.rect = this.rangeSlider.getBoundingClientRect();
|
226
|
+
const currentX = detail.currentX;
|
227
|
+
// figure out which knob they started closer to
|
228
|
+
let ratio = helpers.clamp(0, (currentX - rect.left) / rect.width, 1);
|
229
|
+
if (dir.isRTL(this.el)) {
|
230
|
+
ratio = 1 - ratio;
|
231
|
+
}
|
232
|
+
this.pressedKnob =
|
233
|
+
!this.dualKnobs ||
|
234
|
+
Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio)
|
235
|
+
? 'A'
|
236
|
+
: 'B';
|
237
|
+
this.setFocus(this.pressedKnob);
|
238
|
+
// update the active knob's position
|
239
|
+
this.update(currentX);
|
240
|
+
}
|
241
|
+
onMove(detail) {
|
242
|
+
this.update(detail.currentX);
|
243
|
+
}
|
244
|
+
onEnd(detail) {
|
245
|
+
this.update(detail.currentX);
|
246
|
+
this.pressedKnob = undefined;
|
247
|
+
}
|
248
|
+
update(currentX) {
|
249
|
+
// figure out where the pointer is currently at
|
250
|
+
// update the knob being interacted with
|
251
|
+
const rect = this.rect;
|
252
|
+
let ratio = helpers.clamp(0, (currentX - rect.left) / rect.width, 1);
|
253
|
+
if (dir.isRTL(this.el)) {
|
254
|
+
ratio = 1 - ratio;
|
255
|
+
}
|
256
|
+
if (this.snaps) {
|
257
|
+
// snaps the ratio to the current value
|
258
|
+
ratio = valueToRatio(ratioToValue(ratio, this.min, this.max, this.step), this.min, this.max);
|
259
|
+
}
|
260
|
+
// update which knob is pressed
|
261
|
+
if (this.pressedKnob === 'A') {
|
262
|
+
this.ratioA = ratio;
|
263
|
+
}
|
264
|
+
else {
|
265
|
+
this.ratioB = ratio;
|
266
|
+
}
|
267
|
+
// Update input value
|
268
|
+
this.updateValue();
|
269
|
+
}
|
270
|
+
get valA() {
|
271
|
+
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
272
|
+
}
|
273
|
+
get valB() {
|
274
|
+
return ratioToValue(this.ratioB, this.min, this.max, this.step);
|
275
|
+
}
|
276
|
+
get ratioLower() {
|
277
|
+
if (this.dualKnobs) {
|
278
|
+
return Math.min(this.ratioA, this.ratioB);
|
279
|
+
}
|
280
|
+
return 0;
|
281
|
+
}
|
282
|
+
get ratioUpper() {
|
283
|
+
if (this.dualKnobs) {
|
284
|
+
return Math.max(this.ratioA, this.ratioB);
|
285
|
+
}
|
286
|
+
return this.ratioA;
|
287
|
+
}
|
288
|
+
updateRatio() {
|
289
|
+
const value = this.getValue();
|
290
|
+
const { min, max } = this;
|
291
|
+
if (this.dualKnobs) {
|
292
|
+
this.ratioA = valueToRatio(value.lower, min, max);
|
293
|
+
this.ratioB = valueToRatio(value.upper, min, max);
|
294
|
+
}
|
295
|
+
else {
|
296
|
+
this.ratioA = valueToRatio(value, min, max);
|
297
|
+
}
|
298
|
+
}
|
299
|
+
updateValue() {
|
300
|
+
this.noUpdate = true;
|
301
|
+
const { valA, valB } = this;
|
302
|
+
this.value = !this.dualKnobs
|
303
|
+
? valA
|
304
|
+
: {
|
305
|
+
lower: Math.min(valA, valB),
|
306
|
+
upper: Math.max(valA, valB)
|
307
|
+
};
|
308
|
+
this.noUpdate = false;
|
309
|
+
}
|
310
|
+
setFocus(knob) {
|
311
|
+
if (this.el.shadowRoot) {
|
312
|
+
const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
|
313
|
+
if (knobEl) {
|
314
|
+
knobEl.focus();
|
315
|
+
}
|
316
|
+
}
|
317
|
+
}
|
318
|
+
render() {
|
319
|
+
const { min, max, step, el, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, inheritedAttributes, rangeId, pinFormatter } = this;
|
320
|
+
/**
|
321
|
+
* Look for external label, ion-label, or aria-labelledby.
|
322
|
+
* If none, see if user placed an aria-label on the host
|
323
|
+
* and use that instead.
|
324
|
+
*/
|
325
|
+
let { labelText } = helpers.getAriaLabel(el, rangeId);
|
326
|
+
if (labelText === undefined || labelText === null) {
|
327
|
+
labelText = inheritedAttributes['aria-label'];
|
328
|
+
}
|
329
|
+
const mode = ionicGlobal.getIonMode(this);
|
330
|
+
const barStart = `${ratioLower * 100}%`;
|
331
|
+
const barEnd = `${100 - ratioUpper * 100}%`;
|
332
|
+
const rtl = dir.isRTL(this.el);
|
333
|
+
const start = rtl ? 'right' : 'left';
|
334
|
+
const end = rtl ? 'left' : 'right';
|
335
|
+
const tickStyle = (tick) => {
|
336
|
+
return {
|
337
|
+
[start]: tick[start]
|
338
|
+
};
|
339
|
+
};
|
340
|
+
const barStyle = {
|
341
|
+
[start]: barStart,
|
342
|
+
[end]: barEnd
|
343
|
+
};
|
344
|
+
const ticks = [];
|
345
|
+
if (this.snaps && this.ticks) {
|
346
|
+
for (let value = min; value <= max; value += step) {
|
347
|
+
const ratio = valueToRatio(value, min, max);
|
348
|
+
const tick = {
|
349
|
+
ratio,
|
350
|
+
active: ratio >= ratioLower && ratio <= ratioUpper,
|
351
|
+
};
|
352
|
+
tick[start] = `${ratio * 100}%`;
|
353
|
+
ticks.push(tick);
|
354
|
+
}
|
355
|
+
}
|
356
|
+
helpers.renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
357
|
+
return (index.h(index.Host, { onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: theme.createColorClasses(this.color, {
|
358
|
+
[mode]: true,
|
359
|
+
'in-item': theme.hostContext('ion-item', el),
|
360
|
+
'range-disabled': disabled,
|
361
|
+
'range-pressed': pressedKnob !== undefined,
|
362
|
+
'range-has-pin': pin
|
363
|
+
}) }, index.h("slot", { name: "start" }), index.h("div", { class: "range-slider", ref: rangeEl => this.rangeSlider = rangeEl }, ticks.map(tick => (index.h("div", { style: tickStyle(tick), role: "presentation", class: {
|
364
|
+
'range-tick': true,
|
365
|
+
'range-tick-active': tick.active
|
366
|
+
}, part: tick.active ? 'tick-active' : 'tick' }))), index.h("div", { class: "range-bar", role: "presentation", part: "bar" }), index.h("div", { class: "range-bar range-bar-active", role: "presentation", style: barStyle, part: "bar-active" }), renderKnob(rtl, {
|
367
|
+
knob: 'A',
|
368
|
+
pressed: pressedKnob === 'A',
|
369
|
+
value: this.valA,
|
370
|
+
ratio: this.ratioA,
|
371
|
+
pin,
|
372
|
+
pinFormatter,
|
373
|
+
disabled,
|
374
|
+
handleKeyboard,
|
375
|
+
min,
|
376
|
+
max,
|
377
|
+
labelText
|
378
|
+
}), this.dualKnobs && renderKnob(rtl, {
|
379
|
+
knob: 'B',
|
380
|
+
pressed: pressedKnob === 'B',
|
381
|
+
value: this.valB,
|
382
|
+
ratio: this.ratioB,
|
383
|
+
pin,
|
384
|
+
pinFormatter,
|
385
|
+
disabled,
|
386
|
+
handleKeyboard,
|
387
|
+
min,
|
388
|
+
max,
|
389
|
+
labelText
|
390
|
+
})), index.h("slot", { name: "end" })));
|
391
|
+
}
|
392
|
+
get el() { return index.getElement(this); }
|
393
|
+
static get watchers() { return {
|
394
|
+
"debounce": ["debounceChanged"],
|
395
|
+
"min": ["minChanged"],
|
396
|
+
"max": ["maxChanged"],
|
397
|
+
"disabled": ["disabledChanged"],
|
398
|
+
"value": ["valueChanged"]
|
399
|
+
}; }
|
400
|
+
};
|
401
|
+
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, labelText, pinFormatter }) => {
|
402
|
+
const start = rtl ? 'right' : 'left';
|
403
|
+
const knobStyle = () => {
|
404
|
+
const style = {};
|
405
|
+
style[start] = `${ratio * 100}%`;
|
406
|
+
return style;
|
407
|
+
};
|
408
|
+
return (index.h("div", { onKeyDown: (ev) => {
|
409
|
+
const key = ev.key;
|
410
|
+
if (key === 'ArrowLeft' || key === 'ArrowDown') {
|
411
|
+
handleKeyboard(knob, false);
|
412
|
+
ev.preventDefault();
|
413
|
+
ev.stopPropagation();
|
414
|
+
}
|
415
|
+
else if (key === 'ArrowRight' || key === 'ArrowUp') {
|
416
|
+
handleKeyboard(knob, true);
|
417
|
+
ev.preventDefault();
|
418
|
+
ev.stopPropagation();
|
419
|
+
}
|
420
|
+
}, class: {
|
421
|
+
'range-knob-handle': true,
|
422
|
+
'range-knob-a': knob === 'A',
|
423
|
+
'range-knob-b': knob === 'B',
|
424
|
+
'range-knob-pressed': pressed,
|
425
|
+
'range-knob-min': value === min,
|
426
|
+
'range-knob-max': value === max
|
427
|
+
}, style: knobStyle(), role: "slider", tabindex: disabled ? -1 : 0, "aria-label": labelText, "aria-valuemin": min, "aria-valuemax": max, "aria-disabled": disabled ? 'true' : null, "aria-valuenow": value }, pin && index.h("div", { class: "range-pin", role: "presentation", part: "pin" }, pinFormatter(value)), index.h("div", { class: "range-knob", role: "presentation", part: "knob" })));
|
428
|
+
};
|
429
|
+
const ratioToValue = (ratio, min, max, step) => {
|
430
|
+
let value = (max - min) * ratio;
|
431
|
+
if (step > 0) {
|
432
|
+
value = Math.round(value / step) * step + min;
|
433
|
+
}
|
434
|
+
return helpers.clamp(min, value, max);
|
435
|
+
};
|
436
|
+
const valueToRatio = (value, min, max) => {
|
437
|
+
return helpers.clamp(0, (value - min) / (max - min), 1);
|
438
|
+
};
|
439
|
+
let rangeIds = 0;
|
440
|
+
Range.style = {
|
441
|
+
ios: rangeIosCss,
|
442
|
+
md: rangeMdCss
|
443
|
+
};
|
444
|
+
|
445
|
+
exports.ion_range = Range;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-bae2a754.js');
|
6
|
+
const ionicGlobal = require('./ionic-global-878073d1.js');
|
7
|
+
const theme = require('./theme-4252ac15.js');
|
8
|
+
const spinnerConfigs = require('./spinner-configs-6f6b7ef0.js');
|
9
|
+
|
10
|
+
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{left:0;top:0;transform-origin:center;position:absolute;width:100%;height:100%;transform:translateZ(0)}[dir=rtl] svg,:host-context([dir=rtl]) svg{left:unset;right:unset;right: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}}";
|
11
|
+
|
12
|
+
const Spinner = class {
|
13
|
+
constructor(hostRef) {
|
14
|
+
index.registerInstance(this, hostRef);
|
15
|
+
/**
|
16
|
+
* If `true`, the spinner's animation will be paused.
|
17
|
+
*/
|
18
|
+
this.paused = false;
|
19
|
+
}
|
20
|
+
getName() {
|
21
|
+
const spinnerName = this.name || ionicGlobal.config.get('spinner');
|
22
|
+
const mode = ionicGlobal.getIonMode(this);
|
23
|
+
if (spinnerName) {
|
24
|
+
return spinnerName;
|
25
|
+
}
|
26
|
+
return (mode === 'ios') ? 'lines' : 'circular';
|
27
|
+
}
|
28
|
+
render() {
|
29
|
+
const self = this;
|
30
|
+
const mode = ionicGlobal.getIonMode(self);
|
31
|
+
const spinnerName = self.getName();
|
32
|
+
const spinner = spinnerConfigs.SPINNERS[spinnerName] || spinnerConfigs.SPINNERS['lines'];
|
33
|
+
const duration = (typeof self.duration === 'number' && self.duration > 10 ? self.duration : spinner.dur);
|
34
|
+
const svgs = [];
|
35
|
+
if (spinner.circles !== undefined) {
|
36
|
+
for (let i = 0; i < spinner.circles; i++) {
|
37
|
+
svgs.push(buildCircle(spinner, duration, i, spinner.circles));
|
38
|
+
}
|
39
|
+
}
|
40
|
+
else if (spinner.lines !== undefined) {
|
41
|
+
for (let i = 0; i < spinner.lines; i++) {
|
42
|
+
svgs.push(buildLine(spinner, duration, i, spinner.lines));
|
43
|
+
}
|
44
|
+
}
|
45
|
+
return (index.h(index.Host, { class: theme.createColorClasses(self.color, {
|
46
|
+
[mode]: true,
|
47
|
+
[`spinner-${spinnerName}`]: true,
|
48
|
+
'spinner-paused': self.paused || ionicGlobal.config.getBoolean('_testing')
|
49
|
+
}), role: "progressbar", style: spinner.elmDuration ? { animationDuration: duration + 'ms' } : {} }, svgs));
|
50
|
+
}
|
51
|
+
};
|
52
|
+
const buildCircle = (spinner, duration, index$1, total) => {
|
53
|
+
const data = spinner.fn(duration, index$1, total);
|
54
|
+
data.style['animation-duration'] = duration + 'ms';
|
55
|
+
return (index.h("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, index.h("circle", { transform: data.transform || 'translate(32,32)', cx: data.cx, cy: data.cy, r: data.r, style: spinner.elmDuration ? { animationDuration: duration + 'ms' } : {} })));
|
56
|
+
};
|
57
|
+
const buildLine = (spinner, duration, index$1, total) => {
|
58
|
+
const data = spinner.fn(duration, index$1, total);
|
59
|
+
data.style['animation-duration'] = duration + 'ms';
|
60
|
+
return (index.h("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, index.h("line", { transform: "translate(32,32)", y1: data.y1, y2: data.y2 })));
|
61
|
+
};
|
62
|
+
Spinner.style = spinnerCss;
|
63
|
+
|
64
|
+
exports.ion_spinner = Spinner;
|