spell-ui 0.8.15 → 0.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-components.md +4 -2
- package/README-runtime.md +26 -1
- package/README.md +2 -1
- package/dist/SliderScale-DunjyaDW.js +67 -0
- package/dist/SliderScale-DunjyaDW.js.map +1 -0
- package/dist/{ThemeDraft-CyX3YA_L.js → ThemeDraft-spaNC2dD.js} +2 -2
- package/dist/{ThemeDraft-CyX3YA_L.js.map → ThemeDraft-spaNC2dD.js.map} +1 -1
- package/dist/{UIInput-B3K0w4ow.js → UIInput-8s1aiaw1.js} +2 -2
- package/dist/UIInput-8s1aiaw1.js.map +1 -0
- package/dist/{UIRuntime-DCv4sy30.js → UIRuntime-BaokNnwk.js} +900 -158
- package/dist/UIRuntime-BaokNnwk.js.map +1 -0
- package/dist/_spell-element/UIComponent.d.ts +7 -0
- package/dist/_spell-element/elements.types.d.ts +6 -0
- package/dist/_spell-element/vocabulary.types.d.ts +27 -0
- package/dist/_util/dom.d.ts +7 -0
- package/dist/components/components.es.d.ts +1 -0
- package/dist/components/ui-dial/DialArc.d.ts +43 -0
- package/dist/components/ui-dial/UIDial.d.ts +263 -0
- package/dist/components/ui-dial/UIDial.en.d.ts +149 -0
- package/dist/components/ui-dial/UIDial.es.d.ts +25 -0
- package/dist/components/ui-dial/UIDial.fallback.d.ts +167 -0
- package/dist/components/ui-dial/UIDial.types.d.ts +11 -0
- package/dist/components/ui-dial/index.d.ts +3 -0
- package/dist/components/ui-graph/UIGraph.d.ts +17 -0
- package/dist/components/ui-graph/UIGraph.en.d.ts +17 -0
- package/dist/components/ui-graph/UIGraph.es.d.ts +6 -0
- package/dist/components/ui-input/UIInput.d.ts +46 -3
- package/dist/components/ui-input/UIInput.en.d.ts +6 -1
- package/dist/components/ui-input/UIInput.es.d.ts +1 -0
- package/dist/components/ui-input/UIInput.fallback.d.ts +6 -1
- package/dist/components/ui-json/UIJson.d.ts +5 -4
- package/dist/components/ui-modal/ChoiceRows.d.ts +61 -0
- package/dist/components/ui-modal/ModalDialogs.d.ts +15 -1
- package/dist/components/ui-modal/UIModal.d.ts +6 -2
- package/dist/components/ui-modal/UIModal.en.d.ts +6 -2
- package/dist/components/ui-modal/UIModal.es.d.ts +1 -0
- package/dist/components/ui-page-layout/UIPageLayout.d.ts +141 -8
- package/dist/components/ui-page-layout/UIPageLayout.en.d.ts +51 -2
- package/dist/components/ui-page-layout/UIPageLayout.es.d.ts +3 -0
- package/dist/components/ui-property-editor/UIProperty.d.ts +2 -2
- package/dist/components/ui-site-links/UISiteLinks.d.ts +124 -0
- package/dist/components/ui-site-links/UISiteLinks.en.d.ts +60 -0
- package/dist/components/ui-site-links/UISiteLinks.es.d.ts +26 -0
- package/dist/components/ui-site-links/index.d.ts +1 -0
- package/dist/components/ui-site-nav-button/UISiteNavButton.d.ts +12 -5
- package/dist/components/ui-site-nav-button/UISiteNavButton.en.d.ts +32 -12
- package/dist/components/ui-site-nav-button/UISiteNavButton.es.d.ts +3 -0
- package/dist/components/ui-site-tabs/UISiteTabs.d.ts +13 -0
- package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +9 -0
- package/dist/components/ui-slider/SliderScale.d.ts +26 -2
- package/dist/components/ui-slider/UISlider.d.ts +0 -2
- package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
- package/dist/components/ui-toc/TocIndex.d.ts +16 -1
- package/dist/components/ui-toc/UIToc.d.ts +27 -3
- package/dist/components/ui-toc/UIToc.en.d.ts +1 -1
- package/dist/components/ui-toc/UIToc.types.d.ts +5 -0
- package/dist/components/ui-tree/UITree.d.ts +38 -2
- package/dist/components/ui-tree/UITree.en.d.ts +9 -0
- package/dist/components/ui-tree/UITree.es.d.ts +4 -0
- package/dist/components/ui-uploader/UIUploader.d.ts +721 -0
- package/dist/components/ui-uploader/UIUploader.en.d.ts +394 -0
- package/dist/components/ui-uploader/UIUploader.es.d.ts +112 -0
- package/dist/components/ui-uploader/index.d.ts +1 -0
- package/dist/{components.es-DilRG1VO.js → components.es-jY2nBwuP.js} +249 -65
- package/dist/components.es-jY2nBwuP.js.map +1 -0
- package/dist/core.js +605 -571
- package/dist/core.js.map +1 -1
- package/dist/docs-components/docs-components.types.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +101 -97
- package/dist/jsx.d.ts +1138 -21
- package/dist/runtime/DataTooltips.d.ts +10 -0
- package/dist/runtime/Modals.d.ts +7 -2
- package/dist/runtime/Styles.d.ts +7 -1
- package/dist/runtime/UIRuntime.d.ts +6 -0
- package/dist/runtime/runtime.types.d.ts +26 -1
- package/dist/sound-library/back.ogg +0 -0
- package/dist/sound-library/beep.ogg +0 -0
- package/dist/sound-library/bell.ogg +0 -0
- package/dist/sound-library/big-punch.ogg +0 -0
- package/dist/sound-library/bong.ogg +0 -0
- package/dist/sound-library/book-close.ogg +0 -0
- package/dist/sound-library/book-down.ogg +0 -0
- package/dist/sound-library/book-open.ogg +0 -0
- package/dist/sound-library/card-fan-2.ogg +0 -0
- package/dist/sound-library/card-fan.ogg +0 -0
- package/dist/sound-library/card-place-2.ogg +0 -0
- package/dist/sound-library/card-place-3.ogg +0 -0
- package/dist/sound-library/card-place.ogg +0 -0
- package/dist/sound-library/card-shove-2.ogg +0 -0
- package/dist/sound-library/card-shove.ogg +0 -0
- package/dist/sound-library/card-slide-2.ogg +0 -0
- package/dist/sound-library/card-slide-3.ogg +0 -0
- package/dist/sound-library/card-slide-4.ogg +0 -0
- package/dist/sound-library/card-slide.ogg +0 -0
- package/dist/sound-library/chip-down-2.ogg +0 -0
- package/dist/sound-library/chip-down.ogg +0 -0
- package/dist/sound-library/chips-collide.ogg +0 -0
- package/dist/sound-library/chips-handle.ogg +0 -0
- package/dist/sound-library/chips-stack-2.ogg +0 -0
- package/dist/sound-library/chips-stack.ogg +0 -0
- package/dist/sound-library/chop.ogg +0 -0
- package/dist/sound-library/click-2.ogg +0 -0
- package/dist/sound-library/click-3.ogg +0 -0
- package/dist/sound-library/click.ogg +0 -0
- package/dist/sound-library/close.ogg +0 -0
- package/dist/sound-library/cloth.ogg +0 -0
- package/dist/sound-library/coins-2.ogg +0 -0
- package/dist/sound-library/coins.ogg +0 -0
- package/dist/sound-library/confirm-2.ogg +0 -0
- package/dist/sound-library/confirm.ogg +0 -0
- package/dist/sound-library/creak.ogg +0 -0
- package/dist/sound-library/deck-open.ogg +0 -0
- package/dist/sound-library/deck-take-out.ogg +0 -0
- package/dist/sound-library/dice-grab.ogg +0 -0
- package/dist/sound-library/dice-shake-2.ogg +0 -0
- package/dist/sound-library/dice-shake.ogg +0 -0
- package/dist/sound-library/dice-throw-2.ogg +0 -0
- package/dist/sound-library/dice-throw.ogg +0 -0
- package/dist/sound-library/die-throw-2.ogg +0 -0
- package/dist/sound-library/die-throw.ogg +0 -0
- package/dist/sound-library/door-close.ogg +0 -0
- package/dist/sound-library/door-open.ogg +0 -0
- package/dist/sound-library/drop.ogg +0 -0
- package/dist/sound-library/error-2.ogg +0 -0
- package/dist/sound-library/error.ogg +0 -0
- package/dist/sound-library/fail.ogg +0 -0
- package/dist/sound-library/fall.ogg +0 -0
- package/dist/sound-library/glass-break.ogg +0 -0
- package/dist/sound-library/glass-clink.ogg +0 -0
- package/dist/sound-library/glass-tap.ogg +0 -0
- package/dist/sound-library/glass.ogg +0 -0
- package/dist/sound-library/glitch.ogg +0 -0
- package/dist/sound-library/grow.ogg +0 -0
- package/dist/sound-library/high-up.ogg +0 -0
- package/dist/sound-library/hover-2.ogg +0 -0
- package/dist/sound-library/hover.ogg +0 -0
- package/dist/sound-library/jingle-2.ogg +0 -0
- package/dist/sound-library/jingle-3.ogg +0 -0
- package/dist/sound-library/jingle-4.ogg +0 -0
- package/dist/sound-library/jingle.ogg +0 -0
- package/dist/sound-library/jump.ogg +0 -0
- package/dist/sound-library/knife-draw.ogg +0 -0
- package/dist/sound-library/knife-slice.ogg +0 -0
- package/dist/sound-library/laser-2.ogg +0 -0
- package/dist/sound-library/laser.ogg +0 -0
- package/dist/sound-library/latch.ogg +0 -0
- package/dist/sound-library/level-up.ogg +0 -0
- package/dist/sound-library/lose-2.ogg +0 -0
- package/dist/sound-library/lose-3.ogg +0 -0
- package/dist/sound-library/lose-4.ogg +0 -0
- package/dist/sound-library/lose.ogg +0 -0
- package/dist/sound-library/low-down.ogg +0 -0
- package/dist/sound-library/metal-clang.ogg +0 -0
- package/dist/sound-library/metal-click.ogg +0 -0
- package/dist/sound-library/metal-crash.ogg +0 -0
- package/dist/sound-library/metal-tap.ogg +0 -0
- package/dist/sound-library/mouse-click.ogg +0 -0
- package/dist/sound-library/mouse-release.ogg +0 -0
- package/dist/sound-library/open.ogg +0 -0
- package/dist/sound-library/orchestra-hit-2.ogg +0 -0
- package/dist/sound-library/orchestra-hit.ogg +0 -0
- package/dist/sound-library/page-turn-2.ogg +0 -0
- package/dist/sound-library/page-turn.ogg +0 -0
- package/dist/sound-library/pickaxe.ogg +0 -0
- package/dist/sound-library/piece-down-2.ogg +0 -0
- package/dist/sound-library/piece-down-3.ogg +0 -0
- package/dist/sound-library/piece-down.ogg +0 -0
- package/dist/sound-library/piece-take-2.ogg +0 -0
- package/dist/sound-library/piece-take.ogg +0 -0
- package/dist/sound-library/piece-tap-2.ogg +0 -0
- package/dist/sound-library/piece-tap.ogg +0 -0
- package/dist/sound-library/plank.ogg +0 -0
- package/dist/sound-library/plate.ogg +0 -0
- package/dist/sound-library/pluck.ogg +0 -0
- package/dist/sound-library/pot.ogg +0 -0
- package/dist/sound-library/power-up-2.ogg +0 -0
- package/dist/sound-library/power-up-3.ogg +0 -0
- package/dist/sound-library/power-up.ogg +0 -0
- package/dist/sound-library/punch.ogg +0 -0
- package/dist/sound-library/question.ogg +0 -0
- package/dist/sound-library/rise.ogg +0 -0
- package/dist/sound-library/scratch.ogg +0 -0
- package/dist/sound-library/scroll.ogg +0 -0
- package/dist/sound-library/select-2.ogg +0 -0
- package/dist/sound-library/select.ogg +0 -0
- package/dist/sound-library/shrink.ogg +0 -0
- package/dist/sound-library/shuffle.ogg +0 -0
- package/dist/sound-library/soft-thud-2.ogg +0 -0
- package/dist/sound-library/soft-thud.ogg +0 -0
- package/dist/sound-library/space-junk.ogg +0 -0
- package/dist/sound-library/step-2.ogg +0 -0
- package/dist/sound-library/step-on-carpet.ogg +0 -0
- package/dist/sound-library/step-on-grass.ogg +0 -0
- package/dist/sound-library/step-on-snow.ogg +0 -0
- package/dist/sound-library/step-on-stone.ogg +0 -0
- package/dist/sound-library/step-on-wood.ogg +0 -0
- package/dist/sound-library/step.ogg +0 -0
- package/dist/sound-library/switch-2.ogg +0 -0
- package/dist/sound-library/switch.ogg +0 -0
- package/dist/sound-library/tap-2.ogg +0 -0
- package/dist/sound-library/tap.ogg +0 -0
- package/dist/sound-library/three-tones.ogg +0 -0
- package/dist/sound-library/tick-2.ogg +0 -0
- package/dist/sound-library/tick.ogg +0 -0
- package/dist/sound-library/tin.ogg +0 -0
- package/dist/sound-library/toggle-2.ogg +0 -0
- package/dist/sound-library/toggle.ogg +0 -0
- package/dist/sound-library/two-tones.ogg +0 -0
- package/dist/sound-library/win-2.ogg +0 -0
- package/dist/sound-library/win-3.ogg +0 -0
- package/dist/sound-library/win-4.ogg +0 -0
- package/dist/sound-library/win.ogg +0 -0
- package/dist/sound-library/wood-thud.ogg +0 -0
- package/dist/sound-library/zap.ogg +0 -0
- package/dist/sounds/BuiltInSounds.d.ts +41 -0
- package/dist/sounds/index.d.ts +9 -0
- package/dist/sounds/sounds.types.d.ts +22 -0
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-dial.editor-CjjdKi5L.js +5 -0
- package/dist/ui-dial.editor-CjjdKi5L.js.map +1 -0
- package/dist/ui-dial.js +467 -0
- package/dist/ui-dial.js.map +1 -0
- package/dist/ui-graph.js +22 -0
- package/dist/ui-graph.js.map +1 -1
- package/dist/{ui-input.editor-budoNoB0.js → ui-input.editor-D11iRgXR.js} +2 -2
- package/dist/ui-input.editor-D11iRgXR.js.map +1 -0
- package/dist/ui-input.js +84 -54
- package/dist/ui-input.js.map +1 -1
- package/dist/ui-json.js +8 -8
- package/dist/ui-json.js.map +1 -1
- package/dist/ui-modal.js +183 -97
- package/dist/ui-modal.js.map +1 -1
- package/dist/ui-page-layout.editor-IgDEveUY.js +5 -0
- package/dist/ui-page-layout.editor-IgDEveUY.js.map +1 -0
- package/dist/ui-page-layout.js +217 -72
- package/dist/ui-page-layout.js.map +1 -1
- package/dist/ui-popup.js +34 -34
- package/dist/ui-popup.js.map +1 -1
- package/dist/ui-property-editor.js +7 -4
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-root.js +71 -5
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-search.js +1 -1
- package/dist/ui-section.js +97 -96
- package/dist/ui-section.js.map +1 -1
- package/dist/ui-site-links.editor-BME3sw5H.js +5 -0
- package/dist/ui-site-links.editor-BME3sw5H.js.map +1 -0
- package/dist/ui-site-links.js +150 -0
- package/dist/ui-site-links.js.map +1 -0
- package/dist/ui-site-nav-button.editor-ChY4xe1U.js +5 -0
- package/dist/ui-site-nav-button.editor-ChY4xe1U.js.map +1 -0
- package/dist/ui-site-nav-button.js +57 -18
- package/dist/ui-site-nav-button.js.map +1 -1
- package/dist/{ui-site-tabs.editor-DDvQfH6S.js → ui-site-tabs.editor-CdMIw4jw.js} +2 -2
- package/dist/ui-site-tabs.editor-CdMIw4jw.js.map +1 -0
- package/dist/ui-site-tabs.js +30 -14
- package/dist/ui-site-tabs.js.map +1 -1
- package/dist/ui-slider.js +75 -124
- package/dist/ui-slider.js.map +1 -1
- package/dist/ui-statistic.js +1 -0
- package/dist/ui-statistic.js.map +1 -1
- package/dist/ui-theme-editor.js +2 -2
- package/dist/{ui-theme-menu-BZYUMrHe.js → ui-theme-menu-BEBu6dyq.js} +3 -3
- package/dist/{ui-theme-menu-BZYUMrHe.js.map → ui-theme-menu-BEBu6dyq.js.map} +1 -1
- package/dist/ui-toc.js +159 -122
- package/dist/ui-toc.js.map +1 -1
- package/dist/ui-tree.js +142 -87
- package/dist/ui-tree.js.map +1 -1
- package/dist/ui-uploader.editor-DrE80KjL.js +5 -0
- package/dist/ui-uploader.editor-DrE80KjL.js.map +1 -0
- package/dist/ui-uploader.js +1442 -0
- package/dist/ui-uploader.js.map +1 -0
- package/dist/vocabulary/hooks.generated.d.ts +7 -0
- package/package.json +1 -1
- package/dist/UIInput-B3K0w4ow.js.map +0 -1
- package/dist/UIRuntime-DCv4sy30.js.map +0 -1
- package/dist/components.es-DilRG1VO.js.map +0 -1
- package/dist/ui-input.editor-budoNoB0.js.map +0 -1
- package/dist/ui-page-layout.editor-xtQW0FZk.js +0 -5
- package/dist/ui-page-layout.editor-xtQW0FZk.js.map +0 -1
- package/dist/ui-site-nav-button.editor-6J-zJLtZ.js +0 -5
- package/dist/ui-site-nav-button.editor-6J-zJLtZ.js.map +0 -1
- package/dist/ui-site-tabs.editor-DDvQfH6S.js.map +0 -1
package/dist/ui-slider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-slider.js","names":["_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","__name","E.clamp","class={INNER}","this","ref={(element) => this.inner = element}","<div\n ref={(element) => this.inner = element}\n class={INNER}\n role={this.range ? \"group\" : void 0}\n aria-label={this.range ? this.labels.accessibleName : void 0}\n style={this.innerStyle}\n {...this.staticMark(\"group\")}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n >\n <div class={TRACK} part={this.partForName(\"track\")} />\n <div class={TRACK_FILL} part={this.partForName(\"track-fill\")} />\n {this.thumb(FIRST)}\n <Show when={this.range}>{this.thumb(SECOND)}</Show>\n </div>","<Show when={this.range}>{this.thumb(SECOND)}</Show>","<Show when={this.labeled || this.ticked}>\n <ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>\n </Show>","<Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>","part={this.partForName(\"labels\")}","<ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>","<div class={this.rootClass} part={this.partForName(\"slider\")}>\n <div\n ref={(element) => this.inner = element}\n class={INNER}\n role={this.range ? \"group\" : void 0}\n aria-label={this.range ? this.labels.accessibleName : void 0}\n style={this.innerStyle}\n {...this.staticMark(\"group\")}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n >\n <div class={TRACK} part={this.partForName(\"track\")} />\n <div class={TRACK_FILL} part={this.partForName(\"track-fill\")} />\n {this.thumb(FIRST)}\n <Show when={this.range}>{this.thumb(SECOND)}</Show>\n </div>\n <Show when={this.labeled || this.ticked}>\n <ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>\n </Show>\n {isServer && this.staticValues()}\n </div>","part={this.partForName(\"slider\")}","class={TRACK}","part={this.partForName(\"track\")}","class={TRACK_FILL}","part={this.partForName(\"track-fill\")}","class={thumb === SECOND ? SECOND_THUMB : THUMB}","role=\"slider\"","onKeyDown={(event) => this.onKeyDown(thumb, event)}","<div\n class={thumb === SECOND ? SECOND_THUMB : THUMB}\n part={this.partForName(\"thumb\")}\n role=\"slider\"\n tabindex={this.isDisabled ? void 0 : 0}\n style={{ [AT]: String(this.ratio(thumb)) }}\n aria-valuemin={this.bounds(thumb)[0]}\n aria-valuemax={this.bounds(thumb)[1]}\n aria-valuenow={this.thumbValue(thumb)}\n aria-valuetext={this.valueText(this.thumbValue(thumb))}\n aria-label={this.thumbName(thumb)}\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-disabled={this.isDisabled ? \"true\" : void 0}\n aria-readonly={this.readonly ? \"true\" : void 0}\n {...this.staticMark(thumb)}\n onKeyDown={(event) => this.onKeyDown(thumb, event)}\n />","<For each={Array.isArray(value) ? value : [value]} keyed={false}>\n {(each) => <input type=\"hidden\" name={name} value={String(each())} disabled={this.isDisabled} />}\n </For>","keyed={false}","disabled={this.isDisabled}","part={this.partForName(\"label\")}","style={{ [AT]: String(scale().ratio(value())) }}","<li\n class={full() ? UIT.LABEL : HALF_TICK_LABEL}\n part={this.partForName(\"label\")}\n style={{ [AT]: String(scale().ratio(value())) }}\n >\n {full() && this.labeled ? this.valueText(value()) : \"\"}\n </li>","F.FormComponent","E.proto","E.protoMerged","E.controlled","E.derived","E.untracked","E.state","E.onChange","E.cssState","E.clamp","E.WHITESPACE","_$readShallow","_$setAttribute","UIT.STATIC_CONTROL","UIT.LABEL","UIT.Key","__name","sliderCSS","FormControlAttributes","Key","__decoratorStart","LABEL","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","STATIC_CONTROL","__privateAdd","FormControlStates","sliderVocabulary","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_SliderFallback","NativeFallback","proto","domElement","min","max","isRange","starts","index","input","THUMB_NAMES","event","ROOT_PART","first","second","originalEvent","detail","name","values","value","fallback","SliderFallback","text","key","SliderScale","step","tickStep","clamped","clamp","snapped","span","ratio","unit","steps","length","spacing","intervals","gap","distance","factor","decimals","UISlider_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_keySteps_dec","_onKeyDown_dec","_nearest_dec","_pointerRatio_dec","_drag_dec","_onPointerUp_dec","_onPointerDown_dec","_glideRatio_dec","_isDragging_dec","_draggedThumb_dec","_measure_dec","_onLabeledChanged_dec","_trackLength_dec","_detail_dec","_move_dec","_scale_dec","_end_dec","_value_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_value","_end","_trackLength","_draggedThumb","_glideRatio","_UISlider","FormComponent","protoMerged","controlled","derived","untracked","state","onChange","cssState","target","THUMB_SELECTOR","thumb","SECOND_CLASS","SECOND","FIRST","end","afterSolidUpdate","scale","labels","label","UI","low","high","next","VERTICAL","REVERSED","WHITESPACE","Converters","labeled","observer","vertical","inner","FROM","TO","_self$","_el$","_el$2","_el$3","_el$4","_el$5","_el$6","_el$8","_el$9","spread","INNER","ref","element","insert","createComponent","Show","_el$7","Repeat","effect","readShallow","LABELS","className","_p$","t","setAttribute","isServer","TRACK","TRACK_FILL","i","n","isFill","glideRatio","_self$2","_el$10","SECOND_THUMB","THUMB","AT","_self$3","For","_el$11","each","full","LABEL_DISTANCE","_self$4","_el$12","_c$","memo","HALF_TICK_LABEL","style","a","id","box","reversed","size","offset","current","arrowUp","arrowDown","arrowLeft","arrowRight","pageUp","PAGE_MULTIPLIER","pageDown","UISlider"],"sources":["../src/components/ui-slider/UISlider.en.ts","../src/components/ui-slider/UISlider.fallback.ts","../src/components/ui-slider/SliderScale.ts","../src/components/ui-slider/UISlider.tsx","../src/components/ui-slider/index.ts"],"sourcesContent":["/**\n * Every name `<ui-slider>` uses: tag, attributes (kind + allowed values), events, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-slider color=\"blue\" labeled ticked range align=\"bottom\">` =>\n * `ui blue labeled range ticked bottom aligned slider`.\n * - `value` and `end` are Fomantic's `start` / `end` settings: the (first) thumb, and a `range`'s second thumb.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-slider>`\n * A slider: one thumb, or two for a `range`, on a track, with optional step labels and ticks.\n ****************/\nexport const sliderVocabulary = {\n tag: \"ui-slider\",\n icon: \"sliders horizontal\",\n snippet: \"<ui-slider></ui-slider>\",\n formControl: true,\n topics: [\"inputs\", \"forms\", \"controls\", \"modules\"],\n aka: [\"range\", \"range slider\", \"volume\", \"scrubber\", \"track bar\"],\n skeleton: \"16 x 1.25\",\n noun: \"slider\",\n partOfSpeech: \"action\",\n description: \"A slider lets people select values within a range.\",\n attributes: [\n { name: \"size\", group: \"appearance\", kind: \"size\", description: \"Size of track and thumbs, `mini` ... `massive`.\" },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue of the filled track (and of `basic` thumbs).\"\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"basic\"],\n classes: {},\n replaces: [{ from: \"basic\", value: \"basic\" }],\n description: \"`basic`: thumbs in the fill colour instead of white. Old name: `basic`.\"\n },\n {\n name: \"disabled\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Can't be used: dimmed, not focusable, left out of the form.\"\n },\n {\n ...UIT.FormControlAttributes.readonly,\n description: \"Shows its value but can't be changed; still focusable and submitted.\"\n },\n {\n name: \"hover\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Thumbs show only while the slider is hovered or focused.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"For dark backgrounds.\" },\n { name: \"labeled\", group: \"appearance\", kind: \"keyOnly\", description: \"Labels along the track, at the steps.\" },\n {\n name: \"range\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Two thumbs: `value` .. `end`. The form gets two entries under `name`.\"\n },\n {\n name: \"smooth\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Thumbs follow the pointer smoothly; values still snap.\"\n },\n {\n name: \"ticked\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description:\n \"A tick at every step (or `tick-step`): through the track with `labeled`; alone, a short tick under the \" +\n \"track, no numbers (as a native range's tick marks).\"\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"multiple\",\n values: [\"vertical\", \"reversed\"],\n classes: {},\n replaces: [\n { from: \"vertical\", value: \"vertical\" },\n { from: \"reversed\", value: \"reversed\" }\n ],\n description:\n \"Which way it runs, several words at once: `vertical` (upright, filling the host's height, min at the \" +\n \"top), `reversed` (from the right, or upright from the bottom). Old names: `vertical`, `reversed`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"valueAndKey\",\n key: \"aligned\",\n values: [\"bottom\", \"right\"],\n replaces: [\"aligned\"],\n description:\n \"With `labeled`: labels `bottom` (below the track) or, `vertical`, `right` of it. Old name: `aligned`.\"\n },\n { name: \"min\", group: \"form\", kind: \"number\", default: 0, description: \"Lowest value.\" },\n {\n name: \"max\",\n group: \"form\",\n kind: \"number\",\n default: 20,\n description: \"Highest value (Fomantic's default: 20).\"\n },\n {\n name: \"step\",\n group: \"form\",\n kind: \"number\",\n default: 1,\n description: \"Values snap to multiples of it from `min`; `0`: any.\"\n },\n {\n name: \"tick-step\",\n group: \"appearance\",\n kind: \"number\",\n description:\n \"Labels and ticks every this much from `min` (e.g. `20` on `0` ... `200`), instead of every `step`; \" +\n \"values still snap to `step`.\"\n },\n {\n name: \"value\",\n group: \"form\",\n kind: \"number\",\n reflect: false,\n description:\n \"The (first) thumb's value, default `min`. Attribute: the starting (and reset) value; property: the live one.\"\n },\n {\n name: \"end\",\n group: \"appearance\",\n kind: \"number\",\n reflect: false,\n description: \"`range`: the second thumb's value, default `max`. Attribute / property as `value`.\"\n },\n {\n name: \"step-labels\",\n group: \"appearance\",\n kind: \"json\",\n description: 'Label per step, from `min` (e.g. `[\"XS\", \"S\", \"M\"]`), also the spoken value; default the numbers.'\n },\n UIT.FormControlAttributes.name,\n UIT.FormControlAttributes.parameter,\n {\n ...UIT.FormControlAttributes.required,\n description:\n \"Form validation: a value must be chosen, by the page (`value`, a range's `end`) or by moving a thumb. \" +\n \"Unset, the thumb rests at `min` but counts as no value (`valueMissing`).\"\n }\n ],\n events: [\n {\n name: \"ui-moved\",\n detail: \"{ value: number, end?: number, originalEvent?: Event }\",\n description: \"A thumb moved (each drag step or key). A handler that re-sets `value` / `end` wins.\"\n },\n {\n name: \"ui-changed\",\n detail: \"{ value: number, end?: number, originalEvent?: Event }\",\n description: \"A change was committed: on a key, or when a drag ends somewhere new.\"\n }\n ],\n slots: [],\n parts: [\n { name: \"slider\", description: \"The root box.\" },\n { name: \"track\", description: \"The empty track.\" },\n { name: \"track-fill\", description: \"The filled part of the track.\" },\n { name: \"thumb\", description: \"A thumb (`role=slider`).\" },\n { name: \"labels\", description: \"The list of step labels.\" },\n { name: \"label\", description: \"One step label (and its tick).\" }\n ],\n states: [\n { name: \"disabled\", description: \"Can't be used.\" },\n { name: \"dragging\", description: \"A thumb is being dragged.\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required`), once a person has interacted.\" }\n ],\n texts: [\n { key: \"sliderMinimum\", text: \"Minimum\", description: \"Name of a range's first thumb.\" },\n { key: \"sliderMaximum\", text: \"Maximum\", description: \"Name of a range's second thumb.\" }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\nimport { sliderVocabulary } from \"./UISlider.en\"\nimport { DEFAULT_MAX, DEFAULT_MIN, DEFAULT_STEP } from \"./UISlider.types\"\n\n/****************\n * ### `SliderFallback`\n * The native fallback of `<ui-slider>`: what it shows when its component breaks,\n * so the value(s) are still chosen and submitted with the form.\n *\n * - Its shadow DOM: native `<input type=\"range\" part=\"thumb\">`s in the root\n * (`<div class=\"ui … slider\" part=\"slider\">`): one, or two for a `range` (named \"Minimum\" / \"Maximum\",\n * each bounding the other only on change).\n * - Still a form control. `input` / `change`:\n * - set the DOM element's form value (a range: two entries under `name`)\n * - set `domElement.value` / `domElement.end`\n * - send a composed `ui-input` / `ui-changed`.\n * - Its starting values are the DOM element's `value` / `end` PROPERTIES, else the attributes;\n * `min` / `max` / `step` default to Fomantic's 0 / 20 / 1.\n * - Named by the DOM element's `aria-*` (copied onto each input).\n ****************/\nexport class SliderFallback extends E.NativeFallback<typeof sliderVocabulary> {\n @E.proto static vocabulary = sliderVocabulary\n @E.proto static degraded = [\n \"Fomantic's track, fill and thumbs (the browser's range inputs instead), `labeled` / `ticked` labels\",\n \"a range's thumbs don't block each other while dragging, `vertical` / `reversed` layout, `smooth`\",\n \"`step-labels` (numbers are spoken), vetoing by re-setting `value`, form reset, translated thumb names\"\n ]\n\n /** The native inputs, once built, for `sync()`. */\n private inputs: HTMLInputElement[] = []\n\n protected override build() {\n const domElement = this.domElement as SliderDOMElement\n const min = this.number(\"min\", DEFAULT_MIN)\n const max = Math.max(min, this.number(\"max\", DEFAULT_MAX))\n const isRange = this.flag(\"range\")\n const starts = [domElement.value ?? this.number(\"value\", min), domElement.end ?? this.number(\"end\", max)]\n for (let index = 0; index < (isRange ? 2 : 1); index++) {\n const input = this.create(\"input\", {\n type: \"range\",\n min: String(min),\n max: String(max),\n step: String(this.number(\"step\", DEFAULT_STEP) || \"any\"),\n disabled: this.flag(\"disabled\"),\n \"aria-readonly\": this.flag(\"readonly\") ? \"true\" : undefined\n })\n this.decorate(input, \"thumb\")\n if (isRange) input.setAttribute(\"aria-label\", THUMB_NAMES[index]!)\n input.value = String(starts[index])\n this.listen(input, \"input\", (event) => this.changed(event, \"ui-moved\"))\n this.listen(input, \"change\", (event) => this.changed(event, \"ui-changed\"))\n this.listen(input, \"keydown\", (event: KeyboardEvent) => {\n if (this.flag(\"readonly\")) event.preventDefault()\n })\n this.listen(input, \"pointerdown\", (event) => {\n if (this.flag(\"readonly\")) event.preventDefault()\n })\n this.inputs.push(input)\n }\n // the root takes no `aria-*`: the inputs carry the DOM element's name\n return [this.create(\"div\", { class: this.classes(), part: ROOT_PART }, ...this.inputs)]\n }\n\n /** An input moved: keep a range in order, update the DOM element, send event `name`. */\n private changed(originalEvent: Event, name: E.EventName<typeof sliderVocabulary>) {\n const [first, second] = this.inputs\n if (second && Number(first!.value) > Number(second.value)) {\n if (originalEvent.target === first) first!.value = second.value\n else second.value = first!.value\n }\n const domElement = this.domElement as SliderDOMElement\n domElement.value = Number(first!.value)\n if (second) domElement.end = Number(second.value)\n this.sync()\n const detail = second\n ? { value: domElement.value, end: domElement.end, originalEvent }\n : { value: domElement.value, originalEvent }\n this.send(name, detail)\n }\n\n /** The value, or a range's two; a range input is never invalid, so no validity. */\n protected override sync() {\n const values = this.inputs.map((input) => input.value)\n this.syncForm({ value: values.length < 2 ? values[0] : values })\n }\n\n /** The DOM element's attribute `name` as a number, else `fallback`. */\n private number(name: E.AttributeNameOf<typeof sliderVocabulary>, fallback: number): number {\n const value = Number(this.attr(name) ?? Number.NaN)\n return Number.isFinite(value) ? value : fallback\n }\n}\n\n/** What the fallback reads and writes of the DOM element: all optional, the element may not have upgraded. */\ntype SliderDOMElement = HTMLElement & {\n /** the (first) thumb's value, once set as a property */\n value?: number\n /** a range's second thumb's value, once set as a property */\n end?: number\n}\n\n/** The root's part. */\nconst ROOT_PART = \"slider\"\n\n/** A range's thumb names, in English: a failed render can't count on the runtime's translations. */\nconst THUMB_NAMES = ([\"sliderMinimum\", \"sliderMaximum\"] as const).map(\n (key) => sliderVocabulary.texts.find((text) => text.key === key)!.text\n)\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `SliderScale`\n * The number line of a slider: `min` ... `max` in `step`s -- snapping, ratios along the track, and which steps get\n * a label. Pure arithmetic (no DOM; of the core, only `E.clamp()`), so it's tested on its own.\n * - Snapping keeps to the step grid from `min`, like a native `<input type=range>`: a `max` off the grid is never\n * reached (the last step below it is). `step` `0` allows any value.\n * - Floating point: results are rounded to the step's own decimals, so `0.1` steps give `0.3`, not\n * `0.30000000000000004`.\n * - Exported from the family barrel: an app can snap values the same way.\n ****************/\nexport class SliderScale {\n /** Lowest value. */\n readonly min: number\n\n /** Highest value (never below `min`). */\n readonly max: number\n\n /** Step; `0` ~== any value. */\n readonly step: number\n\n /** Distance between labels (and ticks): `tickStep`, else `step`; `0` ~== one per unit. */\n readonly tickStep: number\n\n /** Decimal places of `step` / `tickStep`, for rounding. */\n private readonly decimals: number\n\n constructor({ min, max, step, tickStep }: SliderScaleProps) {\n this.min = Number.isFinite(min) ? min : 0\n this.max = Number.isFinite(max) ? Math.max(this.min, max) : this.min\n this.step = Number.isFinite(step) && step > 0 ? step : 0\n this.tickStep = tickStep !== undefined && Number.isFinite(tickStep) && tickStep > 0 ? tickStep : this.step\n this.decimals = Math.max(\n SliderScale.decimalsOf(this.step),\n SliderScale.decimalsOf(this.tickStep),\n SliderScale.decimalsOf(this.min)\n )\n }\n\n /** `value` on the grid, within `min` ... `max`. */\n snap(value: number): number {\n const { min, max, step } = this\n if (!Number.isFinite(value)) return min\n const clamped = E.clamp(value, min, max)\n if (!step) return clamped\n let snapped = min + Math.round((clamped - min) / step) * step\n if (snapped > max) snapped -= step\n return this.round(snapped)\n }\n\n /** Where `value` lies along the track, `0` ... `1`. */\n ratio(value: number): number {\n const span = this.max - this.min\n return span ? E.clamp((value - this.min) / span, 0, 1) : 0\n }\n\n /** The snapped value at `ratio` (`0` ... `1`) along the track. */\n valueAt(ratio: number): number {\n return this.snap(this.min + E.clamp(ratio, 0, 1) * (this.max - this.min))\n }\n\n /** `value` moved by `steps` steps (a percent of the span when `step` is `0`), snapped. */\n move(value: number, steps: number): number {\n const unit = this.step || (this.max - this.min) / 100\n return this.snap(value + steps * unit)\n }\n\n /** Number of intervals between labels: one per `tickStep` (per unit, with no step). */\n get intervals(): number {\n return Math.max(1, Math.round((this.max - this.min) / (this.tickStep || 1)))\n }\n\n /** Value of label `index`. */\n labelValue(index: number): number {\n return this.round(Math.min(this.max, this.min + index * (this.tickStep || 1)))\n }\n\n /**\n * Show every `gap()`-th label in full, so neighbours are at least `distance` px apart on a `length` px track\n * (Fomantic's `autoAdjustLabels` / `labelDistance`); the rest become half ticks.\n * - A gap divides the intervals evenly when it can; unmeasured (`length` `0`), every label shows.\n */\n gap(length: number, distance: number): number {\n const { intervals } = this\n if (length <= 0) return 1\n const spacing = length / intervals\n for (let gap = 1; gap <= intervals; gap++) {\n if (spacing * gap >= distance && intervals % gap === 0) return gap\n }\n return intervals\n }\n\n /** `value` rounded to the scale's decimals. */\n private round(value: number): number {\n const factor = 10 ** this.decimals\n return Math.round(value * factor) / factor\n }\n\n /** Decimal places written in `value`. Static: pure, and read in the constructor. */\n private static decimalsOf(value: number): number {\n const [, decimals = \"\"] = String(value).split(\".\")\n return decimals.length\n }\n}\n\n/** Constructor props for `SliderScale`. */\nexport type SliderScaleProps = {\n /** lowest value; not finite ~== `0` */\n min: number\n /** highest value; not finite, or below `min`, ~== `min` */\n max: number\n /** step; not finite, or `<= 0`, ~== any value */\n step: number\n /** labels / ticks every this much; absent or `<= 0` ~== every step */\n tickStep?: number\n}\n","import { For, Repeat, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { sliderVocabulary } from \"./UISlider.en\"\nimport { SliderFallback } from \"./UISlider.fallback\"\nimport { SliderScale } from \"./SliderScale\"\nimport { DEFAULT_MAX, DEFAULT_MIN, DEFAULT_STEP } from \"./UISlider.types\"\n\nimport sliderCSS from \"./UISlider.css?inline\"\n\n/****************\n * ### `UISlider`\n * The component behind `<ui-slider>`: a slider, to choose a number (or, with `range`, two) by dragging a thumb.\n *\n * - Its shadow DOM, in Fomantic's markup:\n * `<div class=\"ui … slider\" part=\"slider\">` around `<div class=\"inner\">` (the track, its fill, one or two `thumb`s)\n * and, when `labeled` or `ticked`, `<ul class=\"auto labels\">`\n * (empty labels when only `ticked`: the sheet draws their ticks).\n * - Labels come every `tick-step` (default `step`).\n *\n * - The thumbs are APG sliders (`role=slider`, `aria-value*`, `aria-orientation`):\n * no native element has two thumbs, or Fomantic's parts.\n * - A `range`'s thumbs are \"Minimum\" / \"Maximum\", inside a `group` named for the DOM element,\n * and each bounds the other (`preventCrossover`).\n * - The labels are `aria-hidden`: the thumbs speak their values.\n *\n * - Keys (on a thumb):\n * - arrows step in the direction they point,\n * as Fomantic's (so a `reversed` or `vertical` slider's arrows follow the thumb, not \"right / up increases\")\n * - PageUp / PageDown take 2 steps (Fomantic's `pageMultiplier`)\n * - Home / End go to the thumb's lowest / highest value\n * - each key sends `ui-input`, then `ui-changed`.\n * - Pointer: pressing the track moves the nearest thumb there, and dragging follows (pointer capture).\n * - `ui-input` for each new value, `ui-changed` once when the drag ends somewhere new.\n * - `smooth` lets the thumb glide between steps.\n *\n * - `value` / `end` are controlled (`@controlled`): a `ui-input` handler that sets them again wins.\n * The ATTRIBUTES are the starting (and reset) values.\n * - Positions are CSS:\n * - the component writes ratios:\n * `--_slider-at` per thumb and label, `--_slider-from` / `--_slider-to` on the inner box\n * - `UISlider.css` places everything, `reversed` / `vertical` included\n * - A form control: it submits `value`.\n * - A `range` submits TWO entries under `name` (`FormData.getAll(name)` ~== `[value, end]`),\n * per `FormComponent`'s multi-value convention.\n * - It restores a saved state (back / forward cache, autofill).\n * - `required`: met once something sets a value (the page, a person, a restored state);\n * until then the thumb rests at `min`, but the slider counts as empty.\n ****************/\nexport class UISlider extends F.FormComponent<typeof sliderVocabulary> {\n @E.proto static vocabulary = sliderVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { slider: sliderCSS },\n Fallback: SliderFallback\n } satisfies Partial<E.ElementSetup>\n\n /** The inner box: track, fill, thumbs. */\n private inner?: HTMLElement\n\n ////////////////\n // ## Values\n ////////////////\n\n /** `value`: set by the page, or moved; `min` until either. */\n @E.controlled(\"value\") accessor value: number | undefined = undefined\n\n /** `end`: set by the page, or moved; `max` until either. */\n @E.controlled(\"end\") accessor end: number | undefined = undefined\n\n /** The number line. */\n @E.derived\n get scale(): SliderScale {\n return new SliderScale({\n min: this.min ?? DEFAULT_MIN,\n max: this.max ?? DEFAULT_MAX,\n step: this.step ?? DEFAULT_STEP,\n tickStep: this.tickStep\n })\n }\n\n /** The (first) thumb's value, snapped, and at most `snappedEnd` in a range. */\n get snappedValue(): number {\n const scale = this.scale\n const value = scale.snap(Number(this.value ?? scale.min))\n return this.range ? Math.min(value, this.snappedEnd) : value\n }\n\n /** A range's second thumb's value, snapped; `max` for a single thumb. */\n get snappedEnd(): number {\n const scale = this.scale\n return scale.snap(Number(this.end ?? scale.max))\n }\n\n /** Value of `thumb`; tracked. */\n thumbValue(thumb: Thumb): number {\n return thumb === SECOND ? this.snappedEnd : this.snappedValue\n }\n\n /** Lowest / highest value `thumb` may take: a range's thumbs bound each other; tracked. */\n bounds(thumb: Thumb): readonly [number, number] {\n const { min, max } = this.scale\n if (!this.range) return [min, max]\n return thumb === SECOND ? [this.snappedValue, max] : [min, this.snappedEnd]\n }\n\n /** Text for `value`: its `step-labels` entry, else the number in the page's format. */\n valueText(value: number): string {\n const labels = this.stepLabels\n const scale = this.scale\n if (Array.isArray(labels)) {\n const label: unknown = labels[Math.round((value - scale.min) / (scale.step || 1))]\n if (typeof label === \"string\" || typeof label === \"number\") return String(label)\n }\n return UI.i18n.formatNumber(value)\n }\n\n /**\n * Move `thumb` to `value` (within its bounds) as a person would:\n * send `ui-input`, then set the DOM element's property, unless a handler set it first.\n * - Returns true when the value changed.\n */\n @E.untracked\n private move(thumb: Thumb, value: number, originalEvent: Event): boolean {\n const [low, high] = this.bounds(thumb)\n const next = E.clamp(value, low, high)\n if (next === this.thumbValue(thumb)) return false\n return this.requestChange(thumb === SECOND ? \"end\" : \"value\", next, () =>\n this.send(\"ui-moved\", this.detail(thumb, next, originalEvent))\n )\n }\n\n /** Event detail with `thumb` at `next`: `{ value, end?, originalEvent }`. */\n @E.untracked\n private detail(thumb: Thumb | undefined, next: number | undefined, originalEvent: Event) {\n const value = thumb === FIRST && next !== undefined ? next : this.snappedValue\n if (!this.range) return { value, originalEvent }\n const end = thumb === SECOND && next !== undefined ? next : this.snappedEnd\n return { value, end, originalEvent }\n }\n\n ////////////////\n // ## Direction\n ////////////////\n\n /** `direction` holds `vertical`: upright, min at the top. */\n get isVertical(): boolean {\n return this.directionWords.includes(VERTICAL)\n }\n\n /** `direction` holds `reversed`: from the right, or upright from the bottom. */\n get isReversed(): boolean {\n return this.directionWords.includes(REVERSED)\n }\n\n /** The words of `direction`. */\n private get directionWords(): string[] {\n return String(this.direction ?? \"\").split(E.WHITESPACE)\n }\n\n ////////////////\n // ## Disabled\n ////////////////\n\n /** Can a person change it? */\n get isInteractive(): boolean {\n return !this.isDisabled && !this.readonly\n }\n\n ////////////////\n // ## Form\n ////////////////\n\n get formValue(): E.FieldValue {\n return this.range ? [String(this.snappedValue), String(this.snappedEnd)] : String(this.snappedValue)\n }\n\n /**\n * Empty while no value was ever set (`value`, nor a range's `end`): `required` then fails.\n * - The thumb resting at `min` is a default, not a choice; `formValue` still submits it.\n */\n protected get validationValue(): E.FieldValue {\n const isUnset = this.value === undefined && (!this.range || this.end === undefined)\n return isUnset ? undefined : this.formValue\n }\n\n /** Back to the `value` / `end` ATTRIBUTES. */\n onFormReset() {\n this.value = E.Converters.number(this.attributes.value)\n this.end = E.Converters.number(this.attributes.end)\n }\n\n /** A saved state: one value, or a range's two entries. `null`: DOM API `formStateRestoreCallback()`'s. */\n onFormStateRestore(state: File | string | FormData | null) {\n const values =\n state instanceof FormData ? [...state.values()].map(String) : typeof state === \"string\" ? [state] : []\n if (values[0] !== undefined) this.value = Number(values[0])\n if (values[1] !== undefined) this.end = Number(values[1])\n }\n\n ////////////////\n // ## Track and labels\n ////////////////\n\n /** The length of the track in px, for label spacing; `0` until measured. */\n @E.state accessor trackLength = 0\n\n /** While `labeled`: measure the track (label spacing) whenever the element resizes; returns its stop. */\n @E.onChange(\"labeled\")\n protected onLabeledChanged(labeled: boolean | undefined) {\n if (!labeled) return undefined\n const observer = new ResizeObserver(() => this.measure())\n observer.observe(this.domElement)\n return () => observer.disconnect()\n }\n\n /**\n * Track length from the DOM element's box (always there, unlike the inner box before the first render):\n * its size less the slider's padding and a thumb, read from the rendered root when there is one.\n */\n @E.untracked\n private measure() {\n const vertical = this.isVertical\n const inner = this.inner\n const length = inner?.isConnected\n ? vertical\n ? inner.clientHeight\n : inner.clientWidth\n : vertical\n ? this.domElement.clientHeight\n : this.domElement.clientWidth\n this.trackLength = length\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /**\n * The inner box's inline tokens: the selected range's two ends, as ratios.\n */\n private get innerStyle(): Record<string, string> {\n return { [FROM]: String(this.ratio(FIRST, { isFill: true })), [TO]: String(this.ratio(SECOND, { isFill: true })) }\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"slider\")}>\n <div\n ref={(element) => (this.inner = element)}\n class={INNER}\n role={this.range ? \"group\" : undefined}\n aria-label={this.range ? this.labels.accessibleName : undefined}\n style={this.innerStyle}\n {...this.staticMark(\"group\")}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n >\n <div class={TRACK} part={this.partForName(\"track\")} />\n <div class={TRACK_FILL} part={this.partForName(\"track-fill\")} />\n {this.thumb(FIRST)}\n <Show when={this.range}>{this.thumb(SECOND)}</Show>\n </div>\n <Show when={this.labeled || this.ticked}>\n <ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>\n </Show>\n {isServer && this.staticValues()}\n </div>\n )\n }\n\n /**\n * Where `thumb` is drawn, `0` ... `1`: its value's ratio, or the pointer while gliding (`smooth`).\n * - `isFill`: an end of the track fill instead, where a single thumb's fill starts at `0`.\n */\n private ratio(thumb: Thumb, { isFill = false }: { isFill?: boolean } = {}): number {\n if (isFill && thumb === FIRST && !this.range) return 0\n if (isFill && thumb === SECOND && !this.range) thumb = FIRST\n const glideRatio = this.glideRatio\n if (glideRatio !== undefined && this.draggedThumb === thumb) return glideRatio\n return this.scale.ratio(this.thumbValue(thumb))\n }\n\n /** Thumb `thumb`: an APG slider. */\n private thumb(thumb: Thumb): JSX.Element {\n return (\n <div\n class={thumb === SECOND ? SECOND_THUMB : THUMB}\n part={this.partForName(\"thumb\")}\n role=\"slider\"\n tabindex={this.isDisabled ? undefined : 0}\n style={{ [AT]: String(this.ratio(thumb)) }}\n aria-valuemin={this.bounds(thumb)[0]}\n aria-valuemax={this.bounds(thumb)[1]}\n aria-valuenow={this.thumbValue(thumb)}\n aria-valuetext={this.valueText(this.thumbValue(thumb))}\n aria-label={this.thumbName(thumb)}\n aria-orientation={this.isVertical ? \"vertical\" : undefined}\n aria-disabled={this.isDisabled ? \"true\" : undefined}\n aria-readonly={this.readonly ? \"true\" : undefined}\n {...this.staticMark(thumb)}\n onKeyDown={(event) => this.onKeyDown(thumb, event)}\n />\n )\n }\n\n /**\n * Server render only (`spell/ui/static`): the `STATIC_CONTROL` mark on `target`,\n * when the DOM element's name belongs to it (a single slider's thumb, a range's group).\n * - `{}` in a browser.\n */\n private staticMark(target: Thumb | \"group\"): Record<string, unknown> {\n if (!isServer) return {}\n const isNamed = target === \"group\" ? this.range : target === FIRST && !this.range\n return isNamed ? { [UIT.STATIC_CONTROL]: \"\" } : {}\n }\n\n /**\n * Server render only (`spell/ui/static`): the value as hidden inputs (two for a `range`),\n * so a static form submits it without script.\n * - In a browser the DOM element submits (`ElementInternals`).\n */\n private staticValues(): JSX.Element {\n const name = this.name\n if (!name) return undefined\n const value = this.formValue\n return (\n <For each={Array.isArray(value) ? value : [value]} keyed={false}>\n {(each) => <input type=\"hidden\" name={name} value={String(each())} disabled={this.isDisabled} />}\n </For>\n )\n }\n\n /**\n * A single thumb is named for the DOM element;\n * a range's are \"Minimum\" / \"Maximum\" (the group has the DOM element's name).\n */\n private thumbName(thumb: Thumb): string | undefined {\n if (!this.range) return this.labels.accessibleName\n return this.translationForKey(thumb === SECOND ? \"sliderMaximum\" : \"sliderMinimum\")\n }\n\n /**\n * Step label `index`: its text (or a half tick, where labels would crowd), at its ratio.\n * - `ticked` without `labeled`: an empty label, every one full (no text to crowd); the sheet draws its tick.\n */\n private label(index: number): JSX.Element {\n const scale = () => this.scale\n const value = () => scale().labelValue(index)\n const full = () =>\n !this.labeled || index % scale().gap(this.trackLength, LABEL_DISTANCE) === 0 || index === scale().intervals\n return (\n <li\n class={full() ? UIT.LABEL : HALF_TICK_LABEL}\n part={this.partForName(\"label\")}\n style={{ [AT]: String(scale().ratio(value())) }}\n >\n {full() && this.labeled ? this.valueText(value()) : \"\"}\n </li>\n )\n }\n\n ////////////////\n // ## Dragging\n ////////////////\n\n /** Thumb being dragged, if any. */\n @E.state accessor draggedThumb: Thumb | undefined = undefined\n\n /** A thumb is being dragged. */\n @E.cssState(\"dragging\")\n get isDragging(): boolean {\n return this.draggedThumb !== undefined\n }\n\n /** `smooth` drag: where the dragged thumb is drawn, `0` ... `1`. */\n @E.state accessor glideRatio: number | undefined = undefined\n\n /** Values when the current drag began, to tell whether it changed anything. */\n private valuesAtDragStart?: readonly [number, number]\n\n /** Press on the track or a thumb: that thumb (else the nearest) jumps to the pointer and is dragged. */\n @E.untracked\n private readonly onPointerDown = (event: PointerEvent) => {\n if (event.button !== 0 || !this.isInteractive || !this.inner) return\n event.preventDefault()\n const ratio = this.pointerRatio(event)\n // the pressed element itself: delegated handlers may see a retargeted `event.target`\n const target = (event.composedPath()[0] as Element).closest?.(THUMB_SELECTOR)\n const thumb = target ? (target.classList.contains(SECOND_CLASS) ? SECOND : FIRST) : this.nearest(ratio)\n this.capture(event.pointerId)\n this.valuesAtDragStart = [this.snappedValue, this.snappedEnd] as const\n this.draggedThumb = thumb\n this.inner.querySelectorAll<HTMLElement>(THUMB_SELECTOR)[thumb]?.focus()\n if (!target) this.drag(thumb, ratio, event)\n }\n\n /** Drag: follow the pointer. */\n private readonly onPointerMove = (event: PointerEvent) => {\n const thumb = this.draggedThumb\n if (thumb === undefined) return\n this.drag(thumb, this.pointerRatio(event), event)\n }\n\n /** Release: `ui-changed` when the drag moved anything. */\n @E.untracked\n private readonly onPointerUp = (event: PointerEvent) => {\n if (this.draggedThumb === undefined) return\n this.draggedThumb = undefined\n if (this.inner?.hasPointerCapture(event.pointerId)) this.inner.releasePointerCapture(event.pointerId)\n this.glideRatio = undefined\n const [value, end] = this.valuesAtDragStart ?? []\n this.valuesAtDragStart = undefined\n E.afterSolidUpdate(() => {\n if (this.snappedValue !== value || this.snappedEnd !== end) {\n this.send(\"ui-changed\", this.detail(undefined, undefined, event))\n }\n })\n }\n\n /**\n * Route pointer `id`'s moves to the inner box until release.\n * - A pointer with no pressed button (a synthetic event) can't be captured:\n * moves then only arrive while over it.\n */\n private capture(id: number) {\n try {\n this.inner?.setPointerCapture(id)\n } catch {\n // not an active pointer\n }\n }\n\n /** Move `thumb` to the value at `ratio`; a `smooth` slider draws it at the pointer meanwhile. */\n @E.untracked\n private drag(thumb: Thumb, ratio: number, event: Event) {\n const scale = this.scale\n if (this.smooth) {\n const [low, high] = this.bounds(thumb)\n this.glideRatio = E.clamp(ratio, scale.ratio(low), scale.ratio(high))\n }\n this.move(thumb, scale.valueAt(ratio), event)\n }\n\n /** The pointer's position along the track, `0` (min) ... `1` (max). */\n @E.untracked\n private pointerRatio(event: PointerEvent): number {\n const inner = this.inner!\n const box = inner.getBoundingClientRect()\n const thumb = inner.querySelector<HTMLElement>(THUMB_SELECTOR)\n const [vertical, reversed] = [this.isVertical, this.isReversed]\n const size = vertical ? (thumb?.offsetHeight ?? 0) : (thumb?.offsetWidth ?? 0)\n const length = (vertical ? box.height : box.width) - size\n const offset = (vertical ? event.clientY - box.top : event.clientX - box.left) - size / 2\n const ratio = length > 0 ? E.clamp(offset / length, 0, 1) : 0\n return reversed ? 1 - ratio : ratio\n }\n\n /** The thumb nearest `ratio`; a tie goes to the one that can move that way. */\n @E.untracked\n private nearest(ratio: number): Thumb {\n if (!this.range) return FIRST\n const scale = this.scale\n const first = Math.abs(ratio - scale.ratio(this.snappedValue))\n const second = Math.abs(ratio - scale.ratio(this.snappedEnd))\n if (first === second) return ratio > scale.ratio(this.snappedValue) ? SECOND : FIRST\n return first < second ? FIRST : SECOND\n }\n\n ////////////////\n // ## Keys and clicks\n ////////////////\n\n /** Keys on a thumb, see the class doc. */\n @E.untracked\n private onKeyDown(thumb: Thumb, event: KeyboardEvent) {\n const scale = this.scale\n const current = this.thumbValue(thumb)\n let next: number | undefined\n const steps = this.keySteps(event.key)\n if (steps) next = scale.move(current, steps)\n else if (event.key === UIT.Key.home) next = this.bounds(thumb)[0]\n else if (event.key === UIT.Key.end) next = this.bounds(thumb)[1]\n if (next === undefined) return\n event.preventDefault()\n if (!this.isInteractive) return\n const value = next\n if (this.move(thumb, value, event)) this.send(\"ui-changed\", this.detail(thumb, value, event))\n }\n\n /** Steps key `key` takes: arrows the way they point (Fomantic's `keyMovement`), pages 2; `0` for other keys. */\n @E.untracked\n private keySteps(key: string): number {\n const [vertical, reversed] = [this.isVertical, this.isReversed]\n // the value grows downward on a vertical slider (min at the top) and leftward on a reversed horizontal one\n const { arrowUp, arrowDown, arrowLeft, arrowRight, pageUp, pageDown } = UIT.Key\n const grows = vertical ? (reversed ? arrowUp : arrowDown) : reversed ? arrowLeft : arrowRight\n const shrinks = vertical ? (reversed ? arrowDown : arrowUp) : reversed ? arrowRight : arrowLeft\n if (key === grows || (!vertical && key === arrowUp) || (vertical && key === arrowRight)) return 1\n if (key === shrinks || (!vertical && key === arrowDown) || (vertical && key === arrowLeft)) return -1\n if (key === pageUp) return PAGE_MULTIPLIER\n if (key === pageDown) return -PAGE_MULTIPLIER\n return 0\n }\n\n /** A click aimed at the DOM element itself (its `<label for>`) focuses the first thumb. */\n protected activateControl() {\n this.inner?.querySelector<HTMLElement>(THUMB_SELECTOR)?.focus()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UISlider extends E.AttributeValues<typeof sliderVocabulary> {}\n\n/** A thumb: the first (`value`) or, in a range, the second (`end`); also its index among the thumbs. */\ntype Thumb = 0 | 1\n\n/** The first thumb. */\nconst FIRST: Thumb = 0\n\n/** A range's second thumb. */\nconst SECOND: Thumb = 1\n\n/** Fomantic's `labelDistance`: least px between full labels. */\nconst LABEL_DISTANCE = 100\n\n/** Fomantic's `pageMultiplier`: steps per PageUp / PageDown. */\nconst PAGE_MULTIPLIER = 2\n\n/** Class of the inner box: track, fill, thumbs. */\nconst INNER = \"inner\"\n\n/** Class of the track. */\nconst TRACK = \"track\"\n\n/** Class of the track's selected stretch. */\nconst TRACK_FILL = \"track-fill\"\n\n/** Class of a thumb. */\nconst THUMB = \"thumb\"\n\n/** A thumb, as a selector. */\nconst THUMB_SELECTOR = `.${THUMB}`\n\n/** Class word of a range's second thumb. */\nconst SECOND_CLASS = \"second\"\n\n/** Classes of a range's second thumb. */\nconst SECOND_THUMB = `${SECOND_CLASS} ${THUMB}`\n\n/** Classes of the labels' list. */\nconst LABELS = \"auto labels\"\n\n/** Classes of a label too crowded to show in full: a half tick. */\nconst HALF_TICK_LABEL = \"halftick label\"\n\n/** `direction`'s words. */\nconst VERTICAL = \"vertical\"\nconst REVERSED = \"reversed\"\n\n/** Custom property `UISlider.css` places a thumb or label by: its ratio along the track. */\nconst AT = \"--_slider-at\"\n\n/** Custom property of the fill's start ratio. */\nconst FROM = \"--_slider-from\"\n\n/** Custom property of the fill's end ratio. */\nconst TO = \"--_slider-to\"\n","/**\n * The slider family: defines `<ui-slider>`, and exports its component.\n * - Also the `slider` lib entry (`spell/ui/ui-slider`), measured in `notes/report.md`.\n * - SIDE EFFECT: importing it defines the tag.\n * - NOTE: `SliderScale` (the number line) is exported too: an app can snap values the same way.\n */\n\nimport { UISlider } from \"./UISlider\"\nimport { SliderScale } from \"./SliderScale\"\n\nUISlider.define()\n\nexport { UISlider, SliderScale }\n"],"mappings":";;;;;;AAgBA,IAAa8D,IAAmB;CAC9B,KAAK;CACL,MAAM;CACN,SAAS;CACT,aAAa;CACb,QAAQ;EAAC;EAAU;EAAS;EAAY;CAAS;CACjD,KAAK;EAAC;EAAS;EAAgB;EAAU;EAAY;CAAW;CAChE,UAAU;CACV,MAAM;CACN,cAAc;CACd,aAAa;CACb,YAAY;EACV;GAAE,MAAM;GAAQ,OAAO;GAAc,MAAM;GAAQ,aAAa;EAAkD;EAClH;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;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}
|
|
1
|
+
{"version":3,"file":"ui-slider.js","names":["_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","__name","class={INNER}","this","ref={(element) => this.inner = element}","<div\n ref={(element) => this.inner = element}\n class={INNER}\n role={this.range ? \"group\" : void 0}\n aria-label={this.range ? this.labels.accessibleName : void 0}\n style={this.innerStyle}\n {...this.staticMark(\"group\")}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n >\n <div class={TRACK} part={this.partForName(\"track\")} />\n <div class={TRACK_FILL} part={this.partForName(\"track-fill\")} />\n {this.thumb(FIRST)}\n <Show when={this.range}>{this.thumb(SECOND)}</Show>\n </div>","<Show when={this.range}>{this.thumb(SECOND)}</Show>","<Show when={this.labeled || this.ticked}>\n <ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>\n </Show>","<Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>","part={this.partForName(\"labels\")}","<ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>","<div class={this.rootClass} part={this.partForName(\"slider\")}>\n <div\n ref={(element) => this.inner = element}\n class={INNER}\n role={this.range ? \"group\" : void 0}\n aria-label={this.range ? this.labels.accessibleName : void 0}\n style={this.innerStyle}\n {...this.staticMark(\"group\")}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n >\n <div class={TRACK} part={this.partForName(\"track\")} />\n <div class={TRACK_FILL} part={this.partForName(\"track-fill\")} />\n {this.thumb(FIRST)}\n <Show when={this.range}>{this.thumb(SECOND)}</Show>\n </div>\n <Show when={this.labeled || this.ticked}>\n <ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>\n </Show>\n {isServer && this.staticValues()}\n </div>","part={this.partForName(\"slider\")}","class={TRACK}","part={this.partForName(\"track\")}","class={TRACK_FILL}","part={this.partForName(\"track-fill\")}","class={thumb === SECOND ? SECOND_THUMB : THUMB}","role=\"slider\"","onKeyDown={(event) => this.onKeyDown(thumb, event)}","<div\n class={thumb === SECOND ? SECOND_THUMB : THUMB}\n part={this.partForName(\"thumb\")}\n role=\"slider\"\n tabindex={this.isDisabled ? void 0 : 0}\n style={{ [AT]: String(this.ratio(thumb)) }}\n aria-valuemin={this.bounds(thumb)[0]}\n aria-valuemax={this.bounds(thumb)[1]}\n aria-valuenow={this.thumbValue(thumb)}\n aria-valuetext={this.valueText(this.thumbValue(thumb))}\n aria-label={this.thumbName(thumb)}\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-disabled={this.isDisabled ? \"true\" : void 0}\n aria-readonly={this.readonly ? \"true\" : void 0}\n {...this.staticMark(thumb)}\n onKeyDown={(event) => this.onKeyDown(thumb, event)}\n />","<For each={Array.isArray(value) ? value : [value]} keyed={false}>\n {(each) => <input type=\"hidden\" name={name} value={String(each())} disabled={this.isDisabled} />}\n </For>","keyed={false}","disabled={this.isDisabled}","part={this.partForName(\"label\")}","style={{ [AT]: String(scale().ratio(value())) }}","<li\n class={full() ? UIT.LABEL : HALF_TICK_LABEL}\n part={this.partForName(\"label\")}\n style={{ [AT]: String(scale().ratio(value())) }}\n >\n {full() && this.labeled ? this.valueText(value()) : \"\"}\n </li>","F.FormComponent","E.proto","E.protoMerged","E.controlled","E.derived","E.untracked","E.state","E.onChange","E.cssState","E.clamp","E.WHITESPACE","_$readShallow","_$setAttribute","UIT.STATIC_CONTROL","UIT.LABEL","__name","sliderCSS","FormControlAttributes","__decoratorStart","LABEL","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","STATIC_CONTROL","__privateAdd","FormControlStates","SliderScale","sliderVocabulary","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_SliderFallback","NativeFallback","proto","domElement","min","max","isRange","starts","index","input","THUMB_NAMES","event","ROOT_PART","first","second","originalEvent","detail","name","values","value","fallback","SliderFallback","text","key","UISlider_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_onKeyDown_dec","_nearest_dec","_pointerRatio_dec","_drag_dec","_onPointerUp_dec","_onPointerDown_dec","_glideRatio_dec","_isDragging_dec","_draggedThumb_dec","_measure_dec","_onLabeledChanged_dec","_trackLength_dec","_detail_dec","_move_dec","_scale_dec","_end_dec","_value_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_value","_end","_trackLength","_draggedThumb","_glideRatio","_UISlider","FormComponent","protoMerged","controlled","derived","untracked","state","onChange","cssState","ratio","target","THUMB_SELECTOR","thumb","SECOND_CLASS","SECOND","FIRST","end","afterSolidUpdate","scale","labels","label","UI","low","high","next","clamp","VERTICAL","REVERSED","WHITESPACE","Converters","labeled","observer","vertical","inner","length","FROM","TO","_self$","_el$","_el$2","_el$3","_el$4","_el$5","_el$6","_el$8","_el$9","spread","INNER","ref","element","insert","createComponent","Show","_el$7","Repeat","effect","readShallow","LABELS","className","_p$","t","setAttribute","isServer","TRACK","TRACK_FILL","i","n","isFill","glideRatio","_self$2","_el$10","SECOND_THUMB","THUMB","AT","_self$3","For","_el$11","each","full","LABEL_DISTANCE","_self$4","_el$12","_c$","memo","HALF_TICK_LABEL","style","a","id","box","reversed","size","offset","UISlider"],"sources":["../src/components/ui-slider/UISlider.en.ts","../src/components/ui-slider/UISlider.fallback.ts","../src/components/ui-slider/UISlider.tsx","../src/components/ui-slider/index.ts"],"sourcesContent":["/**\n * Every name `<ui-slider>` uses: tag, attributes (kind + allowed values), events, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-slider color=\"blue\" labeled ticked range align=\"bottom\">` =>\n * `ui blue labeled range ticked bottom aligned slider`.\n * - `value` and `end` are Fomantic's `start` / `end` settings: the (first) thumb, and a `range`'s second thumb.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-slider>`\n * A slider: one thumb, or two for a `range`, on a track, with optional step labels and ticks.\n ****************/\nexport const sliderVocabulary = {\n tag: \"ui-slider\",\n icon: \"sliders horizontal\",\n snippet: \"<ui-slider></ui-slider>\",\n formControl: true,\n topics: [\"inputs\", \"forms\", \"controls\", \"modules\"],\n aka: [\"range\", \"range slider\", \"volume\", \"scrubber\", \"track bar\"],\n skeleton: \"16 x 1.25\",\n noun: \"slider\",\n partOfSpeech: \"action\",\n description: \"A slider lets people select values within a range.\",\n attributes: [\n { name: \"size\", group: \"appearance\", kind: \"size\", description: \"Size of track and thumbs, `mini` ... `massive`.\" },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue of the filled track (and of `basic` thumbs).\"\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"basic\"],\n classes: {},\n replaces: [{ from: \"basic\", value: \"basic\" }],\n description: \"`basic`: thumbs in the fill colour instead of white. Old name: `basic`.\"\n },\n {\n name: \"disabled\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Can't be used: dimmed, not focusable, left out of the form.\"\n },\n {\n ...UIT.FormControlAttributes.readonly,\n description: \"Shows its value but can't be changed; still focusable and submitted.\"\n },\n {\n name: \"hover\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Thumbs show only while the slider is hovered or focused.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"For dark backgrounds.\" },\n { name: \"labeled\", group: \"appearance\", kind: \"keyOnly\", description: \"Labels along the track, at the steps.\" },\n {\n name: \"range\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Two thumbs: `value` .. `end`. The form gets two entries under `name`.\"\n },\n {\n name: \"smooth\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Thumbs follow the pointer smoothly; values still snap.\"\n },\n {\n name: \"ticked\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description:\n \"A tick at every step (or `tick-step`): through the track with `labeled`; alone, a short tick under the \" +\n \"track, no numbers (as a native range's tick marks).\"\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"multiple\",\n values: [\"vertical\", \"reversed\"],\n classes: {},\n replaces: [\n { from: \"vertical\", value: \"vertical\" },\n { from: \"reversed\", value: \"reversed\" }\n ],\n description:\n \"Which way it runs, several words at once: `vertical` (upright, filling the host's height, min at the \" +\n \"top), `reversed` (from the right, or upright from the bottom). Old names: `vertical`, `reversed`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"valueAndKey\",\n key: \"aligned\",\n values: [\"bottom\", \"right\"],\n replaces: [\"aligned\"],\n description:\n \"With `labeled`: labels `bottom` (below the track) or, `vertical`, `right` of it. Old name: `aligned`.\"\n },\n { name: \"min\", group: \"form\", kind: \"number\", default: 0, description: \"Lowest value.\" },\n {\n name: \"max\",\n group: \"form\",\n kind: \"number\",\n default: 20,\n description: \"Highest value (Fomantic's default: 20).\"\n },\n {\n name: \"step\",\n group: \"form\",\n kind: \"number\",\n default: 1,\n description: \"Values snap to multiples of it from `min`; `0`: any.\"\n },\n {\n name: \"tick-step\",\n group: \"appearance\",\n kind: \"number\",\n description:\n \"Labels and ticks every this much from `min` (e.g. `20` on `0` ... `200`), instead of every `step`; \" +\n \"values still snap to `step`.\"\n },\n {\n name: \"value\",\n group: \"form\",\n kind: \"number\",\n reflect: false,\n description:\n \"The (first) thumb's value, default `min`. Attribute: the starting (and reset) value; property: the live one.\"\n },\n {\n name: \"end\",\n group: \"appearance\",\n kind: \"number\",\n reflect: false,\n description: \"`range`: the second thumb's value, default `max`. Attribute / property as `value`.\"\n },\n {\n name: \"step-labels\",\n group: \"appearance\",\n kind: \"json\",\n description: 'Label per step, from `min` (e.g. `[\"XS\", \"S\", \"M\"]`), also the spoken value; default the numbers.'\n },\n UIT.FormControlAttributes.name,\n UIT.FormControlAttributes.parameter,\n {\n ...UIT.FormControlAttributes.required,\n description:\n \"Form validation: a value must be chosen, by the page (`value`, a range's `end`) or by moving a thumb. \" +\n \"Unset, the thumb rests at `min` but counts as no value (`valueMissing`).\"\n }\n ],\n events: [\n {\n name: \"ui-moved\",\n detail: \"{ value: number, end?: number, originalEvent?: Event }\",\n description: \"A thumb moved (each drag step or key). A handler that re-sets `value` / `end` wins.\"\n },\n {\n name: \"ui-changed\",\n detail: \"{ value: number, end?: number, originalEvent?: Event }\",\n description: \"A change was committed: on a key, or when a drag ends somewhere new.\"\n }\n ],\n slots: [],\n parts: [\n { name: \"slider\", description: \"The root box.\" },\n { name: \"track\", description: \"The empty track.\" },\n { name: \"track-fill\", description: \"The filled part of the track.\" },\n { name: \"thumb\", description: \"A thumb (`role=slider`).\" },\n { name: \"labels\", description: \"The list of step labels.\" },\n { name: \"label\", description: \"One step label (and its tick).\" }\n ],\n states: [\n { name: \"disabled\", description: \"Can't be used.\" },\n { name: \"dragging\", description: \"A thumb is being dragged.\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required`), once a person has interacted.\" }\n ],\n texts: [\n { key: \"sliderMinimum\", text: \"Minimum\", description: \"Name of a range's first thumb.\" },\n { key: \"sliderMaximum\", text: \"Maximum\", description: \"Name of a range's second thumb.\" }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\nimport { sliderVocabulary } from \"./UISlider.en\"\nimport { DEFAULT_MAX, DEFAULT_MIN, DEFAULT_STEP } from \"./UISlider.types\"\n\n/****************\n * ### `SliderFallback`\n * The native fallback of `<ui-slider>`: what it shows when its component breaks,\n * so the value(s) are still chosen and submitted with the form.\n *\n * - Its shadow DOM: native `<input type=\"range\" part=\"thumb\">`s in the root\n * (`<div class=\"ui … slider\" part=\"slider\">`): one, or two for a `range` (named \"Minimum\" / \"Maximum\",\n * each bounding the other only on change).\n * - Still a form control. `input` / `change`:\n * - set the DOM element's form value (a range: two entries under `name`)\n * - set `domElement.value` / `domElement.end`\n * - send a composed `ui-input` / `ui-changed`.\n * - Its starting values are the DOM element's `value` / `end` PROPERTIES, else the attributes;\n * `min` / `max` / `step` default to Fomantic's 0 / 20 / 1.\n * - Named by the DOM element's `aria-*` (copied onto each input).\n ****************/\nexport class SliderFallback extends E.NativeFallback<typeof sliderVocabulary> {\n @E.proto static vocabulary = sliderVocabulary\n @E.proto static degraded = [\n \"Fomantic's track, fill and thumbs (the browser's range inputs instead), `labeled` / `ticked` labels\",\n \"a range's thumbs don't block each other while dragging, `vertical` / `reversed` layout, `smooth`\",\n \"`step-labels` (numbers are spoken), vetoing by re-setting `value`, form reset, translated thumb names\"\n ]\n\n /** The native inputs, once built, for `sync()`. */\n private inputs: HTMLInputElement[] = []\n\n protected override build() {\n const domElement = this.domElement as SliderDOMElement\n const min = this.number(\"min\", DEFAULT_MIN)\n const max = Math.max(min, this.number(\"max\", DEFAULT_MAX))\n const isRange = this.flag(\"range\")\n const starts = [domElement.value ?? this.number(\"value\", min), domElement.end ?? this.number(\"end\", max)]\n for (let index = 0; index < (isRange ? 2 : 1); index++) {\n const input = this.create(\"input\", {\n type: \"range\",\n min: String(min),\n max: String(max),\n step: String(this.number(\"step\", DEFAULT_STEP) || \"any\"),\n disabled: this.flag(\"disabled\"),\n \"aria-readonly\": this.flag(\"readonly\") ? \"true\" : undefined\n })\n this.decorate(input, \"thumb\")\n if (isRange) input.setAttribute(\"aria-label\", THUMB_NAMES[index]!)\n input.value = String(starts[index])\n this.listen(input, \"input\", (event) => this.changed(event, \"ui-moved\"))\n this.listen(input, \"change\", (event) => this.changed(event, \"ui-changed\"))\n this.listen(input, \"keydown\", (event: KeyboardEvent) => {\n if (this.flag(\"readonly\")) event.preventDefault()\n })\n this.listen(input, \"pointerdown\", (event) => {\n if (this.flag(\"readonly\")) event.preventDefault()\n })\n this.inputs.push(input)\n }\n // the root takes no `aria-*`: the inputs carry the DOM element's name\n return [this.create(\"div\", { class: this.classes(), part: ROOT_PART }, ...this.inputs)]\n }\n\n /** An input moved: keep a range in order, update the DOM element, send event `name`. */\n private changed(originalEvent: Event, name: E.EventName<typeof sliderVocabulary>) {\n const [first, second] = this.inputs\n if (second && Number(first!.value) > Number(second.value)) {\n if (originalEvent.target === first) first!.value = second.value\n else second.value = first!.value\n }\n const domElement = this.domElement as SliderDOMElement\n domElement.value = Number(first!.value)\n if (second) domElement.end = Number(second.value)\n this.sync()\n const detail = second\n ? { value: domElement.value, end: domElement.end, originalEvent }\n : { value: domElement.value, originalEvent }\n this.send(name, detail)\n }\n\n /** The value, or a range's two; a range input is never invalid, so no validity. */\n protected override sync() {\n const values = this.inputs.map((input) => input.value)\n this.syncForm({ value: values.length < 2 ? values[0] : values })\n }\n\n /** The DOM element's attribute `name` as a number, else `fallback`. */\n private number(name: E.AttributeNameOf<typeof sliderVocabulary>, fallback: number): number {\n const value = Number(this.attr(name) ?? Number.NaN)\n return Number.isFinite(value) ? value : fallback\n }\n}\n\n/** What the fallback reads and writes of the DOM element: all optional, the element may not have upgraded. */\ntype SliderDOMElement = HTMLElement & {\n /** the (first) thumb's value, once set as a property */\n value?: number\n /** a range's second thumb's value, once set as a property */\n end?: number\n}\n\n/** The root's part. */\nconst ROOT_PART = \"slider\"\n\n/** A range's thumb names, in English: a failed render can't count on the runtime's translations. */\nconst THUMB_NAMES = ([\"sliderMinimum\", \"sliderMaximum\"] as const).map(\n (key) => sliderVocabulary.texts.find((text) => text.key === key)!.text\n)\n","import { For, Repeat, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { sliderVocabulary } from \"./UISlider.en\"\nimport { SliderFallback } from \"./UISlider.fallback\"\nimport { SliderScale } from \"./SliderScale\"\nimport { DEFAULT_MAX, DEFAULT_MIN, DEFAULT_STEP } from \"./UISlider.types\"\n\nimport sliderCSS from \"./UISlider.css?inline\"\n\n/****************\n * ### `UISlider`\n * The component behind `<ui-slider>`: a slider, to choose a number (or, with `range`, two) by dragging a thumb.\n *\n * - Its shadow DOM, in Fomantic's markup:\n * `<div class=\"ui … slider\" part=\"slider\">` around `<div class=\"inner\">` (the track, its fill, one or two `thumb`s)\n * and, when `labeled` or `ticked`, `<ul class=\"auto labels\">`\n * (empty labels when only `ticked`: the sheet draws their ticks).\n * - Labels come every `tick-step` (default `step`).\n *\n * - The thumbs are APG sliders (`role=slider`, `aria-value*`, `aria-orientation`):\n * no native element has two thumbs, or Fomantic's parts.\n * - A `range`'s thumbs are \"Minimum\" / \"Maximum\", inside a `group` named for the DOM element,\n * and each bounds the other (`preventCrossover`).\n * - The labels are `aria-hidden`: the thumbs speak their values.\n *\n * - Keys (on a thumb):\n * - arrows step in the direction they point,\n * as Fomantic's (so a `reversed` or `vertical` slider's arrows follow the thumb, not \"right / up increases\")\n * - PageUp / PageDown take 2 steps (Fomantic's `pageMultiplier`)\n * - Home / End go to the thumb's lowest / highest value\n * - each key sends `ui-input`, then `ui-changed`.\n * - Pointer: pressing the track moves the nearest thumb there, and dragging follows (pointer capture).\n * - `ui-input` for each new value, `ui-changed` once when the drag ends somewhere new.\n * - `smooth` lets the thumb glide between steps.\n *\n * - `value` / `end` are controlled (`@controlled`): a `ui-input` handler that sets them again wins.\n * The ATTRIBUTES are the starting (and reset) values.\n * - Positions are CSS:\n * - the component writes ratios:\n * `--_slider-at` per thumb and label, `--_slider-from` / `--_slider-to` on the inner box\n * - `UISlider.css` places everything, `reversed` / `vertical` included\n * - A form control: it submits `value`.\n * - A `range` submits TWO entries under `name` (`FormData.getAll(name)` ~== `[value, end]`),\n * per `FormComponent`'s multi-value convention.\n * - It restores a saved state (back / forward cache, autofill).\n * - `required`: met once something sets a value (the page, a person, a restored state);\n * until then the thumb rests at `min`, but the slider counts as empty.\n ****************/\nexport class UISlider extends F.FormComponent<typeof sliderVocabulary> {\n @E.proto static vocabulary = sliderVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { slider: sliderCSS },\n Fallback: SliderFallback\n } satisfies Partial<E.ElementSetup>\n\n /** The inner box: track, fill, thumbs. */\n private inner?: HTMLElement\n\n ////////////////\n // ## Values\n ////////////////\n\n /** `value`: set by the page, or moved; `min` until either. */\n @E.controlled(\"value\") accessor value: number | undefined = undefined\n\n /** `end`: set by the page, or moved; `max` until either. */\n @E.controlled(\"end\") accessor end: number | undefined = undefined\n\n /** The number line. */\n @E.derived\n get scale(): SliderScale {\n return new SliderScale({\n min: this.min ?? DEFAULT_MIN,\n max: this.max ?? DEFAULT_MAX,\n step: this.step ?? DEFAULT_STEP,\n tickStep: this.tickStep\n })\n }\n\n /** The (first) thumb's value, snapped, and at most `snappedEnd` in a range. */\n get snappedValue(): number {\n const scale = this.scale\n const value = scale.snap(Number(this.value ?? scale.min))\n return this.range ? Math.min(value, this.snappedEnd) : value\n }\n\n /** A range's second thumb's value, snapped; `max` for a single thumb. */\n get snappedEnd(): number {\n const scale = this.scale\n return scale.snap(Number(this.end ?? scale.max))\n }\n\n /** Value of `thumb`; tracked. */\n thumbValue(thumb: Thumb): number {\n return thumb === SECOND ? this.snappedEnd : this.snappedValue\n }\n\n /** Lowest / highest value `thumb` may take: a range's thumbs bound each other; tracked. */\n bounds(thumb: Thumb): readonly [number, number] {\n const { min, max } = this.scale\n if (!this.range) return [min, max]\n return thumb === SECOND ? [this.snappedValue, max] : [min, this.snappedEnd]\n }\n\n /** Text for `value`: its `step-labels` entry, else the number in the page's format. */\n valueText(value: number): string {\n const labels = this.stepLabels\n const scale = this.scale\n if (Array.isArray(labels)) {\n const label: unknown = labels[Math.round((value - scale.min) / (scale.step || 1))]\n if (typeof label === \"string\" || typeof label === \"number\") return String(label)\n }\n return UI.i18n.formatNumber(value)\n }\n\n /**\n * Move `thumb` to `value` (within its bounds) as a person would:\n * send `ui-input`, then set the DOM element's property, unless a handler set it first.\n * - Returns true when the value changed.\n */\n @E.untracked\n private move(thumb: Thumb, value: number, originalEvent: Event): boolean {\n const [low, high] = this.bounds(thumb)\n const next = E.clamp(value, low, high)\n if (next === this.thumbValue(thumb)) return false\n return this.requestChange(thumb === SECOND ? \"end\" : \"value\", next, () =>\n this.send(\"ui-moved\", this.detail(thumb, next, originalEvent))\n )\n }\n\n /** Event detail with `thumb` at `next`: `{ value, end?, originalEvent }`. */\n @E.untracked\n private detail(thumb: Thumb | undefined, next: number | undefined, originalEvent: Event) {\n const value = thumb === FIRST && next !== undefined ? next : this.snappedValue\n if (!this.range) return { value, originalEvent }\n const end = thumb === SECOND && next !== undefined ? next : this.snappedEnd\n return { value, end, originalEvent }\n }\n\n ////////////////\n // ## Direction\n ////////////////\n\n /** `direction` holds `vertical`: upright, min at the top. */\n get isVertical(): boolean {\n return this.directionWords.includes(VERTICAL)\n }\n\n /** `direction` holds `reversed`: from the right, or upright from the bottom. */\n get isReversed(): boolean {\n return this.directionWords.includes(REVERSED)\n }\n\n /** The words of `direction`. */\n private get directionWords(): string[] {\n return String(this.direction ?? \"\").split(E.WHITESPACE)\n }\n\n ////////////////\n // ## Disabled\n ////////////////\n\n /** Can a person change it? */\n get isInteractive(): boolean {\n return !this.isDisabled && !this.readonly\n }\n\n ////////////////\n // ## Form\n ////////////////\n\n get formValue(): E.FieldValue {\n return this.range ? [String(this.snappedValue), String(this.snappedEnd)] : String(this.snappedValue)\n }\n\n /**\n * Empty while no value was ever set (`value`, nor a range's `end`): `required` then fails.\n * - The thumb resting at `min` is a default, not a choice; `formValue` still submits it.\n */\n protected get validationValue(): E.FieldValue {\n const isUnset = this.value === undefined && (!this.range || this.end === undefined)\n return isUnset ? undefined : this.formValue\n }\n\n /** Back to the `value` / `end` ATTRIBUTES. */\n onFormReset() {\n this.value = E.Converters.number(this.attributes.value)\n this.end = E.Converters.number(this.attributes.end)\n }\n\n /** A saved state: one value, or a range's two entries. `null`: DOM API `formStateRestoreCallback()`'s. */\n onFormStateRestore(state: File | string | FormData | null) {\n const values =\n state instanceof FormData ? [...state.values()].map(String) : typeof state === \"string\" ? [state] : []\n if (values[0] !== undefined) this.value = Number(values[0])\n if (values[1] !== undefined) this.end = Number(values[1])\n }\n\n ////////////////\n // ## Track and labels\n ////////////////\n\n /** The length of the track in px, for label spacing; `0` until measured. */\n @E.state accessor trackLength = 0\n\n /** While `labeled`: measure the track (label spacing) whenever the element resizes; returns its stop. */\n @E.onChange(\"labeled\")\n protected onLabeledChanged(labeled: boolean | undefined) {\n if (!labeled) return undefined\n const observer = new ResizeObserver(() => this.measure())\n observer.observe(this.domElement)\n return () => observer.disconnect()\n }\n\n /**\n * Track length from the DOM element's box (always there, unlike the inner box before the first render):\n * its size less the slider's padding and a thumb, read from the rendered root when there is one.\n */\n @E.untracked\n private measure() {\n const vertical = this.isVertical\n const inner = this.inner\n const length = inner?.isConnected\n ? vertical\n ? inner.clientHeight\n : inner.clientWidth\n : vertical\n ? this.domElement.clientHeight\n : this.domElement.clientWidth\n this.trackLength = length\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /**\n * The inner box's inline tokens: the selected range's two ends, as ratios.\n */\n private get innerStyle(): Record<string, string> {\n return { [FROM]: String(this.ratio(FIRST, { isFill: true })), [TO]: String(this.ratio(SECOND, { isFill: true })) }\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"slider\")}>\n <div\n ref={(element) => (this.inner = element)}\n class={INNER}\n role={this.range ? \"group\" : undefined}\n aria-label={this.range ? this.labels.accessibleName : undefined}\n style={this.innerStyle}\n {...this.staticMark(\"group\")}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n >\n <div class={TRACK} part={this.partForName(\"track\")} />\n <div class={TRACK_FILL} part={this.partForName(\"track-fill\")} />\n {this.thumb(FIRST)}\n <Show when={this.range}>{this.thumb(SECOND)}</Show>\n </div>\n <Show when={this.labeled || this.ticked}>\n <ul class={LABELS} part={this.partForName(\"labels\")} aria-hidden=\"true\">\n <Repeat count={this.scale.intervals + 1}>{(index) => this.label(index)}</Repeat>\n </ul>\n </Show>\n {isServer && this.staticValues()}\n </div>\n )\n }\n\n /**\n * Where `thumb` is drawn, `0` ... `1`: its value's ratio, or the pointer while gliding (`smooth`).\n * - `isFill`: an end of the track fill instead, where a single thumb's fill starts at `0`.\n */\n private ratio(thumb: Thumb, { isFill = false }: { isFill?: boolean } = {}): number {\n if (isFill && thumb === FIRST && !this.range) return 0\n if (isFill && thumb === SECOND && !this.range) thumb = FIRST\n const glideRatio = this.glideRatio\n if (glideRatio !== undefined && this.draggedThumb === thumb) return glideRatio\n return this.scale.ratio(this.thumbValue(thumb))\n }\n\n /** Thumb `thumb`: an APG slider. */\n private thumb(thumb: Thumb): JSX.Element {\n return (\n <div\n class={thumb === SECOND ? SECOND_THUMB : THUMB}\n part={this.partForName(\"thumb\")}\n role=\"slider\"\n tabindex={this.isDisabled ? undefined : 0}\n style={{ [AT]: String(this.ratio(thumb)) }}\n aria-valuemin={this.bounds(thumb)[0]}\n aria-valuemax={this.bounds(thumb)[1]}\n aria-valuenow={this.thumbValue(thumb)}\n aria-valuetext={this.valueText(this.thumbValue(thumb))}\n aria-label={this.thumbName(thumb)}\n aria-orientation={this.isVertical ? \"vertical\" : undefined}\n aria-disabled={this.isDisabled ? \"true\" : undefined}\n aria-readonly={this.readonly ? \"true\" : undefined}\n {...this.staticMark(thumb)}\n onKeyDown={(event) => this.onKeyDown(thumb, event)}\n />\n )\n }\n\n /**\n * Server render only (`spell/ui/static`): the `STATIC_CONTROL` mark on `target`,\n * when the DOM element's name belongs to it (a single slider's thumb, a range's group).\n * - `{}` in a browser.\n */\n private staticMark(target: Thumb | \"group\"): Record<string, unknown> {\n if (!isServer) return {}\n const isNamed = target === \"group\" ? this.range : target === FIRST && !this.range\n return isNamed ? { [UIT.STATIC_CONTROL]: \"\" } : {}\n }\n\n /**\n * Server render only (`spell/ui/static`): the value as hidden inputs (two for a `range`),\n * so a static form submits it without script.\n * - In a browser the DOM element submits (`ElementInternals`).\n */\n private staticValues(): JSX.Element {\n const name = this.name\n if (!name) return undefined\n const value = this.formValue\n return (\n <For each={Array.isArray(value) ? value : [value]} keyed={false}>\n {(each) => <input type=\"hidden\" name={name} value={String(each())} disabled={this.isDisabled} />}\n </For>\n )\n }\n\n /**\n * A single thumb is named for the DOM element;\n * a range's are \"Minimum\" / \"Maximum\" (the group has the DOM element's name).\n */\n private thumbName(thumb: Thumb): string | undefined {\n if (!this.range) return this.labels.accessibleName\n return this.translationForKey(thumb === SECOND ? \"sliderMaximum\" : \"sliderMinimum\")\n }\n\n /**\n * Step label `index`: its text (or a half tick, where labels would crowd), at its ratio.\n * - `ticked` without `labeled`: an empty label, every one full (no text to crowd); the sheet draws its tick.\n */\n private label(index: number): JSX.Element {\n const scale = () => this.scale\n const value = () => scale().labelValue(index)\n const full = () =>\n !this.labeled || index % scale().gap(this.trackLength, LABEL_DISTANCE) === 0 || index === scale().intervals\n return (\n <li\n class={full() ? UIT.LABEL : HALF_TICK_LABEL}\n part={this.partForName(\"label\")}\n style={{ [AT]: String(scale().ratio(value())) }}\n >\n {full() && this.labeled ? this.valueText(value()) : \"\"}\n </li>\n )\n }\n\n ////////////////\n // ## Dragging\n ////////////////\n\n /** Thumb being dragged, if any. */\n @E.state accessor draggedThumb: Thumb | undefined = undefined\n\n /** A thumb is being dragged. */\n @E.cssState(\"dragging\")\n get isDragging(): boolean {\n return this.draggedThumb !== undefined\n }\n\n /** `smooth` drag: where the dragged thumb is drawn, `0` ... `1`. */\n @E.state accessor glideRatio: number | undefined = undefined\n\n /** Values when the current drag began, to tell whether it changed anything. */\n private valuesAtDragStart?: readonly [number, number]\n\n /** Press on the track or a thumb: that thumb (else the nearest) jumps to the pointer and is dragged. */\n @E.untracked\n private readonly onPointerDown = (event: PointerEvent) => {\n if (event.button !== 0 || !this.isInteractive || !this.inner) return\n event.preventDefault()\n const ratio = this.pointerRatio(event)\n // the pressed element itself: delegated handlers may see a retargeted `event.target`\n const target = (event.composedPath()[0] as Element).closest?.(THUMB_SELECTOR)\n const thumb = target ? (target.classList.contains(SECOND_CLASS) ? SECOND : FIRST) : this.nearest(ratio)\n this.capture(event.pointerId)\n this.valuesAtDragStart = [this.snappedValue, this.snappedEnd] as const\n this.draggedThumb = thumb\n this.inner.querySelectorAll<HTMLElement>(THUMB_SELECTOR)[thumb]?.focus()\n if (!target) this.drag(thumb, ratio, event)\n }\n\n /** Drag: follow the pointer. */\n private readonly onPointerMove = (event: PointerEvent) => {\n const thumb = this.draggedThumb\n if (thumb === undefined) return\n this.drag(thumb, this.pointerRatio(event), event)\n }\n\n /** Release: `ui-changed` when the drag moved anything. */\n @E.untracked\n private readonly onPointerUp = (event: PointerEvent) => {\n if (this.draggedThumb === undefined) return\n this.draggedThumb = undefined\n if (this.inner?.hasPointerCapture(event.pointerId)) this.inner.releasePointerCapture(event.pointerId)\n this.glideRatio = undefined\n const [value, end] = this.valuesAtDragStart ?? []\n this.valuesAtDragStart = undefined\n E.afterSolidUpdate(() => {\n if (this.snappedValue !== value || this.snappedEnd !== end) {\n this.send(\"ui-changed\", this.detail(undefined, undefined, event))\n }\n })\n }\n\n /**\n * Route pointer `id`'s moves to the inner box until release.\n * - A pointer with no pressed button (a synthetic event) can't be captured:\n * moves then only arrive while over it.\n */\n private capture(id: number) {\n try {\n this.inner?.setPointerCapture(id)\n } catch {\n // not an active pointer\n }\n }\n\n /** Move `thumb` to the value at `ratio`; a `smooth` slider draws it at the pointer meanwhile. */\n @E.untracked\n private drag(thumb: Thumb, ratio: number, event: Event) {\n const scale = this.scale\n if (this.smooth) {\n const [low, high] = this.bounds(thumb)\n this.glideRatio = E.clamp(ratio, scale.ratio(low), scale.ratio(high))\n }\n this.move(thumb, scale.valueAt(ratio), event)\n }\n\n /** The pointer's position along the track, `0` (min) ... `1` (max). */\n @E.untracked\n private pointerRatio(event: PointerEvent): number {\n const inner = this.inner!\n const box = inner.getBoundingClientRect()\n const thumb = inner.querySelector<HTMLElement>(THUMB_SELECTOR)\n const [vertical, reversed] = [this.isVertical, this.isReversed]\n const size = vertical ? (thumb?.offsetHeight ?? 0) : (thumb?.offsetWidth ?? 0)\n const length = (vertical ? box.height : box.width) - size\n const offset = (vertical ? event.clientY - box.top : event.clientX - box.left) - size / 2\n const ratio = length > 0 ? E.clamp(offset / length, 0, 1) : 0\n return reversed ? 1 - ratio : ratio\n }\n\n /** The thumb nearest `ratio`; a tie goes to the one that can move that way. */\n @E.untracked\n private nearest(ratio: number): Thumb {\n if (!this.range) return FIRST\n const scale = this.scale\n const first = Math.abs(ratio - scale.ratio(this.snappedValue))\n const second = Math.abs(ratio - scale.ratio(this.snappedEnd))\n if (first === second) return ratio > scale.ratio(this.snappedValue) ? SECOND : FIRST\n return first < second ? FIRST : SECOND\n }\n\n ////////////////\n // ## Keys and clicks\n ////////////////\n\n /** Keys on a thumb, see the class doc. */\n @E.untracked\n private onKeyDown(thumb: Thumb, event: KeyboardEvent) {\n const [low, high] = this.bounds(thumb)\n const next = this.scale.valueForKey(event.key, this.thumbValue(thumb), {\n low,\n high,\n vertical: this.isVertical,\n reversed: this.isReversed\n })\n if (next === undefined) return\n event.preventDefault()\n if (!this.isInteractive) return\n if (this.move(thumb, next, event)) this.send(\"ui-changed\", this.detail(thumb, next, event))\n }\n\n /** A click aimed at the DOM element itself (its `<label for>`) focuses the first thumb. */\n protected activateControl() {\n this.inner?.querySelector<HTMLElement>(THUMB_SELECTOR)?.focus()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UISlider extends E.AttributeValues<typeof sliderVocabulary> {}\n\n/** A thumb: the first (`value`) or, in a range, the second (`end`); also its index among the thumbs. */\ntype Thumb = 0 | 1\n\n/** The first thumb. */\nconst FIRST: Thumb = 0\n\n/** A range's second thumb. */\nconst SECOND: Thumb = 1\n\n/** Fomantic's `labelDistance`: least px between full labels. */\nconst LABEL_DISTANCE = 100\n\n/** Class of the inner box: track, fill, thumbs. */\nconst INNER = \"inner\"\n\n/** Class of the track. */\nconst TRACK = \"track\"\n\n/** Class of the track's selected stretch. */\nconst TRACK_FILL = \"track-fill\"\n\n/** Class of a thumb. */\nconst THUMB = \"thumb\"\n\n/** A thumb, as a selector. */\nconst THUMB_SELECTOR = `.${THUMB}`\n\n/** Class word of a range's second thumb. */\nconst SECOND_CLASS = \"second\"\n\n/** Classes of a range's second thumb. */\nconst SECOND_THUMB = `${SECOND_CLASS} ${THUMB}`\n\n/** Classes of the labels' list. */\nconst LABELS = \"auto labels\"\n\n/** Classes of a label too crowded to show in full: a half tick. */\nconst HALF_TICK_LABEL = \"halftick label\"\n\n/** `direction`'s words. */\nconst VERTICAL = \"vertical\"\nconst REVERSED = \"reversed\"\n\n/** Custom property `UISlider.css` places a thumb or label by: its ratio along the track. */\nconst AT = \"--_slider-at\"\n\n/** Custom property of the fill's start ratio. */\nconst FROM = \"--_slider-from\"\n\n/** Custom property of the fill's end ratio. */\nconst TO = \"--_slider-to\"\n","/**\n * The slider family: defines `<ui-slider>`, and exports its component.\n * - Also the `slider` lib entry (`spell/ui/ui-slider`), measured in `notes/report.md`.\n * - SIDE EFFECT: importing it defines the tag.\n * - NOTE: `SliderScale` (the number line) is exported too: an app can snap values the same way.\n */\n\nimport { UISlider } from \"./UISlider\"\nimport { SliderScale } from \"./SliderScale\"\n\nUISlider.define()\n\nexport { UISlider, SliderScale }\n"],"mappings":";;;;;;;AAgBA,IAAa4D,IAAmB;CAC9B,KAAK;CACL,MAAM;CACN,SAAS;CACT,aAAa;CACb,QAAQ;EAAC;EAAU;EAAS;EAAY;CAAS;CACjD,KAAK;EAAC;EAAS;EAAgB;EAAU;EAAY;CAAW;CAChE,UAAU;CACV,MAAM;CACN,cAAc;CACd,aAAa;CACb,YAAY;EACV;GAAE,MAAM;GAAQ,OAAO;GAAc,MAAM;GAAQ,aAAa;EAAkD;EAClH;GACE,MAAM;GACN,OAAO;GACP,MA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,EAAA8D,GAAA,GAAQ,WADRnB,GA7ZWyB,CAAA,GA6aXpE,EAAA8D,GAAA,GAAQ,aADRpB,GA5aW0B,CAAA,GACFpE,EAAA8D,GAAA,IAAO,cAAhBF,IADWQ,CAAA,GAEIpE,EAAA8D,GAAA,IAAO,gBAAtBH,IAFWS,CAAA,GAiVXpE,EAAA8D,GAAA,GAAiB,iBADjBf,GAhVWqB,CAAA,GAwWXpE,EAAA8D,GAAA,GAAiB,eADjBhB,GAvWWsB,CAAA,GAANnE,GAAA6D,GAAMM,CAAA,GAA0D3E,EAAA2E,GAAA,UAAA,GAC5DtE,EADEsE,GACK,cAAalE,EAApB4D,GAAA,IADEM,GACkB7D,CAAA,CAAA,GAApBL,EAAA4D,GAAA,IADEM,CAAA,GAEItE,EAFJsE,GAEW,gBAAelE,EAAtB4D,GAAA,IAFJM,GAE0B;CACnC,aAAa,EAAE,QAAQ1E,GAAU;CACjC,UAAUuC;AACZ,CAAA,CAAA,GAHe/B,EAAA4D,GAAA,IAFJM,CAAA;AAAN,IAAM4F,IAAN5F,GAwcDe,IAAe,GAGfD,IAAgB,GAGhBiE,KAAiB,KAGjBhC,KAAQ,SAGRgB,KAAQ,SAGRC,KAAa,cAGbQ,IAAQ,SAGR7D,IAAiB,IAAI6D,KAGrB3D,KAAe,UAGf0D,KAAe,GAAG1D,GAAY,GAAI2D,KAGlCf,KAAS,eAGT2B,KAAkB,kBAGlB1D,KAAW,YACXC,KAAW,YAGX8C,KAAK,gBAGLtC,KAAO,kBAGPC,KAAK;;AC/hBXwD,EAAS,OAAO"}
|
package/dist/ui-statistic.js
CHANGED
package/dist/ui-statistic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-statistic.js","names":["<Show when={this.value}>\n <div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>\n </Show>","this","part={this.partForName(\"value\")}","<div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>","<div class={this.rootClass} part={this.partForName(\"statistic\")}>\n <Show when={this.value}>\n <div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>\n </Show>\n <slot />\n <Show when={this.label}>\n <div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>\n </Show>\n </div>","<Show when={this.label}>\n <div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>\n </Show>","part={this.partForName(\"label\")}","<div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>","part={this.partForName(\"statistic\")}","_tmpl$","_elementSetup_dec","_vocabulary_dec","_a","_init","E.UIComponent","E.proto","E.protoMerged","E.cssState","E.derived","_$setAttribute","_$getOwner","UIT.LABEL","UIT.TEXT","__name","statisticCSS","UIT.StackWithValues","this","part={this.partForName(\"group\")}","<div class={this.rootClass} part={this.partForName(\"group\")}>\n <slot />\n </div>","E.UIComponent","E.proto","E.protoMerged","E.cssState","_$getOwner","_$setAttribute","__name","statisticCSS","__decoratorStart","LABEL","__publicField","__name$1","TEXT","__decorateElement","__decoratorMetadata","__runInitializers","StackClasses","StackWithValues","getOwner$1","statisticVocabulary","UIStatistic_default","_tmpl$$1","_tmpl$2","_valueClasses_dec","_isStatistic_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_UIStatistic","UIComponent","proto","protoMerged","cssState","derived","_self$","_el$","_el$3","_el$5","insert","createComponent","Show","_el$2","effect","readShallow","className","_p$","t","setAttribute","_el$4","value","VALUE","noun","PartComponent","UIStatistic","statisticsVocabulary","_tmpl$","_isSpaced_dec","_isStatistics_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIStatistics","UIStatistics"],"sources":["../src/components/ui-statistic/UIStatistic.en.ts","../src/components/ui-statistic/UIStatistic.tsx","../src/components/ui-statistic/UIStatistics.en.ts","../src/components/ui-statistic/UIStatistics.tsx","../src/components/ui-statistic/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-statistic>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-statistic size=\"large\" color=\"red\" direction=\"horizontal\">` => `ui large red horizontal statistic`;\n * `<ui-statistics widths=\"3\" stackable>` => `ui stackable three statistics`. `UIStatistic.css` keys on those words.\n * - Content is the GENERIC parts, owned by the statistic (`ownsParts`): `<ui-value>` (Fomantic's `.value`) and\n * `<ui-label>` (Fomantic's `.label`). There is NO separate label part tag: a `<ui-label>` inside a statistic\n * already renders as that statistic's `.label` part (`UILabel`, `:state(in-statistic)`), so the one word \"label\"\n * keeps meaning one element, and a `<ui-label-part>` / `<ui-caption>` would only be a second spelling of it.\n * - Shorthand: `value` / `label` render the same two parts inside the statistic's own shadow root,\n * the value BEFORE the slot and the label AFTER it, so either pairs with a slotted part;\n * slotted parts keep their order, so a `<ui-label>` before a `<ui-value>` is Fomantic's top label.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `statisticVocabulary`\n * The names of `<ui-statistic>`, a statistic: `<div class=\"ui ... statistic\" part=\"statistic\">` holding the `value`\n * shorthand, the slot and the `label` shorthand.\n ****************/\nexport const statisticVocabulary = {\n tag: \"ui-statistic\",\n icon: \"chart bar outline\",\n topics: [\"data display\", \"text\", \"views\"],\n aka: [\"stat\", \"kpi\", \"metric\", \"counter\", \"number display\"],\n skeleton: \"inline 6 x 4\",\n noun: \"statistic\",\n partOfSpeech: \"property\",\n plural: \"statistics\",\n description: \"A statistic emphasizes the current value of an attribute.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size of the value, `mini` ... `massive`; `medium` is the default.\"\n },\n { name: \"color\", group: \"appearance\", kind: \"color\", description: \"Hue of the value.\" },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\"],\n replaces: [{ from: \"horizontal\", value: \"horizontal\" }],\n description: \"`horizontal`: value and label on one line. Its old name was `horizontal`.\"\n },\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"For dark backgrounds: the dark scheme, a white value.\"\n },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Takes the full width of its container.\" },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n description: \"Shorthand for a `<ui-value>`: the number (or word) shown.\"\n },\n {\n name: \"text\",\n group: \"name\",\n kind: \"boolean\",\n description: \"The `value` shorthand is a WORD (`text value`): smaller, bold, at least two lines tall.\"\n },\n { name: \"label\", group: \"name\", kind: \"string\", description: \"Shorthand for the label below the value.\" }\n ],\n events: [],\n slots: [{ name: \"\", description: \"`<ui-value>` and `<ui-label>` parts, in display order.\" }],\n parts: [\n { name: \"statistic\", description: \"The statistic box.\" },\n { name: \"value\", description: \"The `value` shorthand.\" },\n { name: \"label\", description: \"The `label` shorthand.\" }\n ],\n states: [\n {\n name: \"statistic\",\n description:\n \"ALWAYS set: `UIStatistic.css` spaces a statistic after another by it (a shadow root can't see its host's sibling).\"\n },\n { name: \"inverted\", description: \"For dark backgrounds.\" }\n ],\n texts: [],\n ownsParts: [\"value\", \"label\"]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\nimport { statisticVocabulary } from \"./UIStatistic.en\"\n\nimport statisticCSS from \"./UIStatistic.css?inline\"\n\n/****************\n * ### `UIStatistic`\n * The component behind `<ui-statistic>`: a number with a label.\n * Its shadow DOM:\n * `<div class=\"ui … statistic\" part=\"statistic\">` holding the `value` shorthand, the slot, then the `label` shorthand,\n * so either shorthand can pair with a slotted part and still read value over label.\n *\n * - It OWNS the `value` and `label` parts (`ownsParts`):\n * a slotted `<ui-value>` or `<ui-label>` finds it through `PartContext`,\n * sets `:state(in-statistic)` and styles itself from `UIParts.css`,\n * reading the owner tokens `UIStatistic.css` declares on the root (layout, value sizes, `--ui-inverted`).\n * `define()` registers it as their owner.\n *\n * - The shorthands are the SAME parts, drawn in this shadow root:\n * `<div class=\"value in-statistic\">` and `<div class=\"label in-statistic\">`,\n * the static part classes `UIParts.css` keys on (they ARE children of this root),\n * which is why this component adopts `UIParts.css` too (`E.PartComponent`'s `elementSetup.styleSheets`).\n * - `text` makes the value shorthand a word value.\n *\n * - No role: a statistic is text; the page names a group of them where it matters\n * (a heading, `aria-label` on a region).\n ****************/\nexport class UIStatistic extends E.UIComponent<typeof statisticVocabulary> {\n @E.proto static vocabulary = statisticVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { statistic: statisticCSS, ...E.PartComponent.prototype.elementSetup.styleSheets },\n cssStates: [\"inverted\"],\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** Always `:state(statistic)`. */\n @E.cssState(\"statistic\")\n get isStatistic(): boolean {\n return true\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"statistic\")}>\n <Show when={this.value}>\n <div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>\n </Show>\n <slot />\n <Show when={this.label}>\n <div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>\n </Show>\n </div>\n )\n }\n\n /** Classes of the value shorthand: `[text] value in-statistic`. */\n @E.derived\n private get valueClasses(): string {\n const value = this.staticPart(VALUE)\n return this.text ? `${UIT.TEXT} ${value}` : value\n }\n\n /** Classes of a shorthand: the part noun and the static owner class, e.g. `label in-statistic`. */\n private staticPart(noun: string): string {\n return `${noun} ${UIT.PART_STATIC_CLASS_PREFIX}${this.vocabulary.noun}`\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIStatistic extends E.AttributeValues<typeof statisticVocabulary> {}\n\n/** The `value` shorthand: its attribute, part noun and class word. */\nconst VALUE = \"value\"\n","/**\n * The English vocabulary of `<ui-statistics>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-statistic size=\"large\" color=\"red\" direction=\"horizontal\">` => `ui large red horizontal statistic`;\n * `<ui-statistics widths=\"3\" stackable>` => `ui stackable three statistics`. `UIStatistic.css` keys on those words.\n * - Content is the GENERIC parts, owned by the statistic (`ownsParts`): `<ui-value>` (Fomantic's `.value`) and\n * `<ui-label>` (Fomantic's `.label`). There is NO separate label part tag: a `<ui-label>` inside a statistic\n * already renders as that statistic's `.label` part (`UILabel`, `:state(in-statistic)`), so the one word \"label\"\n * keeps meaning one element, and a `<ui-label-part>` / `<ui-caption>` would only be a second spelling of it.\n * - Shorthand: `value` / `label` render the same two parts inside the statistic's own shadow root,\n * the value BEFORE the slot and the label AFTER it, so either pairs with a slotted part;\n * slotted parts keep their order, so a `<ui-label>` before a `<ui-value>` is Fomantic's top label.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `statisticsVocabulary`\n * The names of `<ui-statistics>`, a group of statistics sharing one look: `<div class=\"ui ...\n * statistics\" part=\"group\">`.\n ****************/\nexport const statisticsVocabulary = {\n tag: \"ui-statistics\",\n icon: \"chart bar\",\n topics: [\"data display\", \"layout\", \"views\"],\n aka: [\"stats\", \"kpis\", \"metrics\", \"dashboard numbers\"],\n noun: \"statistics\",\n partOfSpeech: \"structure\",\n description: \"A group of statistics.\",\n attributes: [\n { name: \"size\", group: \"appearance\", kind: \"size\", description: \"Size of every statistic in the group.\" },\n { name: \"color\", group: \"appearance\", kind: \"color\", description: \"Hue of every value in the group.\" },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\"],\n replaces: [{ from: \"horizontal\", value: \"horizontal\" }],\n description:\n \"`horizontal`: statistics stacked, each with its label beside its value. Its old name was `horizontal`.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"Every statistic for dark backgrounds.\" },\n {\n name: \"stackable\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n \"Below 768px of the group's width (or the screen's: `stack-with`), one statistic per row, full width.\"\n },\n {\n name: \"stack-with\",\n group: \"layout\",\n kind: \"enum\",\n values: UIT.StackWithValues,\n description:\n \"What `stackable` measures: `container` (the default) -- the group's own width; `page` -- the \" +\n \"screen's, as in Fomantic. Unset: the page-wide `--ui-stack-with` token decides (`<ui-root \" +\n \"stack-with>`).\"\n },\n {\n name: \"equal\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n \"Every statistic the same width, from the statistics themselves (no count): one row, an equal share of \" +\n \"it each (the group spans its row). Not with `horizontal` (a column).\"\n },\n {\n name: \"widths\",\n group: \"appearance\",\n kind: \"width\",\n widthClass: \"\",\n values: [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"],\n description:\n 'Older, count-based alias of `equal`: divides each row evenly between N statistics (`widths=\"3\"` => ' +\n \"`three statistics`), wrapping after N.\"\n }\n ],\n events: [],\n slots: [{ name: \"\", description: \"`<ui-statistic>`s.\" }],\n parts: [{ name: \"group\", description: \"The group box.\" }],\n states: [\n { name: \"statistics\", description: \"ALWAYS set: the group's host is a block and the `ui-statistics` container.\" },\n {\n name: \"spaced\",\n description:\n \"Set unless `horizontal` or `widths`: the group keeps Fomantic's 1em top margin, which the HOST carries (so it collapses with the content above).\"\n }\n ],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\nimport { statisticsVocabulary } from \"./UIStatistics.en\"\n\nimport statisticCSS from \"./UIStatistic.css?inline\"\n\n/****************\n * ### `UIStatistics`\n * The component behind `<ui-statistics>`:\n * a group of statistics sharing one look, `<div class=\"ui … statistics\" part=\"group\"><slot></slot></div>`.\n *\n * - `UIStatistic.css` hands the group's size, colour, layout, count and stacking to its statistics\n * through inherited private tokens.\n * - The DOM element is a block and the size container `stackable` answers to (`:state(statistics)`);\n * with `stack-with=\"page\"` (a private class before the noun), the screen is.\n ****************/\nexport class UIStatistics extends E.UIComponent<typeof statisticsVocabulary> {\n @E.proto static vocabulary = statisticsVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { statistic: statisticCSS },\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** Always `:state(statistics)`: the size container `stackable` answers to. */\n @E.cssState(\"statistics\")\n get isStatistics(): boolean {\n return true\n }\n\n /**\n * Spaced, unless `horizontal` or `widths`, whose roots have no top margin.\n * - Why: the DOM element is a size container (its own formatting context),\n * so the group's top margin sits on the DOM ELEMENT, to collapse with the content above\n * as class grammar's does (`UIStatistic.css`).\n */\n @E.cssState(\"spaced\")\n get isSpaced(): boolean {\n return !this.direction && !this.widths\n }\n\n /** `stack-with`'s class (`UIT.StackClasses`). */\n protected get extraClass(): string | undefined {\n return UIT.StackClasses.classFor(this.stackWith)\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"group\")}>\n <slot />\n </div>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIStatistics extends E.AttributeValues<typeof statisticsVocabulary> {}\n","/**\n * The statistic family: defines `<ui-statistic>` and `<ui-statistics>`,\n * and exports their components, `UIStatistic` and `UIStatistics`.\n * - SIDE EFFECT: importing it defines the tags.\n * - Also the library's `spell/ui/ui-statistic` entry (its size is in `notes/report.md`).\n * - NOTE: the value and label are the generic parts (`<ui-value>`, `<ui-label>`):\n * load `spell/ui/ui-parts` and `spell/ui/ui-label` for slotted ones; the `value` / `label` shorthands need\n * neither.\n */\n\nimport { UIStatistic } from \"./UIStatistic\"\nimport { UIStatistics } from \"./UIStatistics\"\n\nUIStatistic.define()\nUIStatistics.define()\n\nexport { UIStatistic, UIStatistics }\n"],"mappings":";;;;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AI,eAAwB;EAC1B,OAAO;CACT;CASA,IAAI,WAAoB;EACtB,OAAO,CAAC,KAAK,aAAa,CAAC,KAAK;CAClC;CAGA,IAAc,aAAiC;EAC7C,OAAA9C,EAAwB,SAAS,KAAK,SAAS;CACjD;CAEA,SAAsB;EACpB,IAAAmB,IAAA;EACE,IAAAC,IAAAoB,EAAC,GACCd,IAAAN,EAAA;EAFJ,OAEU,EAAA,UAAAhC,EAAA,GADHuC,S;GAAO9C,GAAAA,EAAAA,EAAK,SAAA;GAAWC,GAAMD,EAAK,YAAY,OAAO;EAAzC,KAAZ,EAAA,GAAA,QAAA,MAAA;GAAuB,AAAXgD,EAAAT,GAAA,GAAAU,GAAA,CAAA,GAAWC,MAAAD,GAAA,KAAAzC,EAAA+B,GAAA,QAAAW,CAA8B;EAAzC,CAAA,GAAjBhD;CAIJ;AACF;AApCO,IAAAS,EAAAqD,CAAA,GASLhD,EAAAiD,GAAA,GAAI,gBADJJ,GARWK,CAAA,GAoBXlD,EAAAiD,GAAA,GAAI,YADJL,GAnBWM,CAAA,GACFlD,EAAAiD,GAAA,IAAO,cAAhBF,GADWG,CAAA,GAEIlD,EAAAiD,GAAA,IAAO,gBAAtBH,GAFWI,CAAA,GAANjD,EAAAgD,GAAMC,CAAA,GAAgEzD,EAAAyD,GAAA,cAAA,GAClErD,EADEqD,GACK,cAAahD,EAApB+C,GAAA,GADEC,GACkBR,CAAA,CAAA,GAApBxC,EAAA+C,GAAA,IADEC,CAAA,GAEIrD,EAFJqD,GAEW,gBAAehD,EAAtB+C,GAAA,IAFJC,GAE0B;CACnC,aAAa,EAAE,WAAWxD,EAAa;CACvC,gBAAgB;AAClB,CAAA,CAAA,GAHeQ,EAAA+C,GAAA,IAFJC,CAAA;AAAN,IAAMC,IAAND;ACJPT,EAAY,OAAO,GACnBU,EAAa,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-statistic.js","names":["<Show when={this.value}>\n <div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>\n </Show>","this","part={this.partForName(\"value\")}","<div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>","<div class={this.rootClass} part={this.partForName(\"statistic\")}>\n <Show when={this.value}>\n <div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>\n </Show>\n <slot />\n <Show when={this.label}>\n <div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>\n </Show>\n </div>","<Show when={this.label}>\n <div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>\n </Show>","part={this.partForName(\"label\")}","<div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>","part={this.partForName(\"statistic\")}","_tmpl$","_elementSetup_dec","_vocabulary_dec","_a","_init","E.UIComponent","E.proto","E.protoMerged","E.cssState","E.derived","_$setAttribute","_$getOwner","UIT.LABEL","UIT.TEXT","__name","statisticCSS","UIT.StackWithValues","this","part={this.partForName(\"group\")}","<div class={this.rootClass} part={this.partForName(\"group\")}>\n <slot />\n </div>","E.UIComponent","E.proto","E.protoMerged","E.cssState","_$getOwner","_$setAttribute","__name","statisticCSS","__decoratorStart","LABEL","__publicField","__name$1","TEXT","__decorateElement","__decoratorMetadata","__runInitializers","StackClasses","StackWithValues","getOwner$1","statisticVocabulary","UIStatistic_default","_tmpl$$1","_tmpl$2","_valueClasses_dec","_isStatistic_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_UIStatistic","UIComponent","proto","protoMerged","cssState","derived","_self$","_el$","_el$3","_el$5","insert","createComponent","Show","_el$2","effect","readShallow","className","_p$","t","setAttribute","_el$4","value","VALUE","noun","PartComponent","UIStatistic","statisticsVocabulary","_tmpl$","_isSpaced_dec","_isStatistics_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIStatistics","UIStatistics"],"sources":["../src/components/ui-statistic/UIStatistic.en.ts","../src/components/ui-statistic/UIStatistic.tsx","../src/components/ui-statistic/UIStatistics.en.ts","../src/components/ui-statistic/UIStatistics.tsx","../src/components/ui-statistic/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-statistic>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-statistic size=\"large\" color=\"red\" direction=\"horizontal\">` => `ui large red horizontal statistic`;\n * `<ui-statistics widths=\"3\" stackable>` => `ui stackable three statistics`. `UIStatistic.css` keys on those words.\n * - Content is the GENERIC parts, owned by the statistic (`ownsParts`): `<ui-value>` (Fomantic's `.value`) and\n * `<ui-label>` (Fomantic's `.label`). There is NO separate label part tag: a `<ui-label>` inside a statistic\n * already renders as that statistic's `.label` part (`UILabel`, `:state(in-statistic)`), so the one word \"label\"\n * keeps meaning one element, and a `<ui-label-part>` / `<ui-caption>` would only be a second spelling of it.\n * - Shorthand: `value` / `label` render the same two parts inside the statistic's own shadow root,\n * the value BEFORE the slot and the label AFTER it, so either pairs with a slotted part;\n * slotted parts keep their order, so a `<ui-label>` before a `<ui-value>` is Fomantic's top label.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `statisticVocabulary`\n * The names of `<ui-statistic>`, a statistic: `<div class=\"ui ... statistic\" part=\"statistic\">` holding the `value`\n * shorthand, the slot and the `label` shorthand.\n ****************/\nexport const statisticVocabulary = {\n tag: \"ui-statistic\",\n icon: \"chart bar outline\",\n topics: [\"data display\", \"text\", \"views\"],\n aka: [\"stat\", \"kpi\", \"metric\", \"counter\", \"number display\"],\n skeleton: \"inline 6 x 4\",\n noun: \"statistic\",\n partOfSpeech: \"property\",\n plural: \"statistics\",\n description: \"A statistic emphasizes the current value of an attribute.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size of the value, `mini` ... `massive`; `medium` is the default.\"\n },\n { name: \"color\", group: \"appearance\", kind: \"color\", description: \"Hue of the value.\" },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\"],\n replaces: [{ from: \"horizontal\", value: \"horizontal\" }],\n description: \"`horizontal`: value and label on one line. Its old name was `horizontal`.\"\n },\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"For dark backgrounds: the dark scheme, a white value.\"\n },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Takes the full width of its container.\" },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n canBeNumber: true,\n description: \"Shorthand for a `<ui-value>`: the number (or word) shown.\"\n },\n {\n name: \"text\",\n group: \"name\",\n kind: \"boolean\",\n description: \"The `value` shorthand is a WORD (`text value`): smaller, bold, at least two lines tall.\"\n },\n { name: \"label\", group: \"name\", kind: \"string\", description: \"Shorthand for the label below the value.\" }\n ],\n events: [],\n slots: [{ name: \"\", description: \"`<ui-value>` and `<ui-label>` parts, in display order.\" }],\n parts: [\n { name: \"statistic\", description: \"The statistic box.\" },\n { name: \"value\", description: \"The `value` shorthand.\" },\n { name: \"label\", description: \"The `label` shorthand.\" }\n ],\n states: [\n {\n name: \"statistic\",\n description:\n \"ALWAYS set: `UIStatistic.css` spaces a statistic after another by it (a shadow root can't see its host's sibling).\"\n },\n { name: \"inverted\", description: \"For dark backgrounds.\" }\n ],\n texts: [],\n ownsParts: [\"value\", \"label\"]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\nimport { statisticVocabulary } from \"./UIStatistic.en\"\n\nimport statisticCSS from \"./UIStatistic.css?inline\"\n\n/****************\n * ### `UIStatistic`\n * The component behind `<ui-statistic>`: a number with a label.\n * Its shadow DOM:\n * `<div class=\"ui … statistic\" part=\"statistic\">` holding the `value` shorthand, the slot, then the `label` shorthand,\n * so either shorthand can pair with a slotted part and still read value over label.\n *\n * - It OWNS the `value` and `label` parts (`ownsParts`):\n * a slotted `<ui-value>` or `<ui-label>` finds it through `PartContext`,\n * sets `:state(in-statistic)` and styles itself from `UIParts.css`,\n * reading the owner tokens `UIStatistic.css` declares on the root (layout, value sizes, `--ui-inverted`).\n * `define()` registers it as their owner.\n *\n * - The shorthands are the SAME parts, drawn in this shadow root:\n * `<div class=\"value in-statistic\">` and `<div class=\"label in-statistic\">`,\n * the static part classes `UIParts.css` keys on (they ARE children of this root),\n * which is why this component adopts `UIParts.css` too (`E.PartComponent`'s `elementSetup.styleSheets`).\n * - `text` makes the value shorthand a word value.\n *\n * - No role: a statistic is text; the page names a group of them where it matters\n * (a heading, `aria-label` on a region).\n ****************/\nexport class UIStatistic extends E.UIComponent<typeof statisticVocabulary> {\n @E.proto static vocabulary = statisticVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { statistic: statisticCSS, ...E.PartComponent.prototype.elementSetup.styleSheets },\n cssStates: [\"inverted\"],\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** Always `:state(statistic)`. */\n @E.cssState(\"statistic\")\n get isStatistic(): boolean {\n return true\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"statistic\")}>\n <Show when={this.value}>\n <div class={this.valueClasses} part={this.partForName(\"value\")}>\n {this.value}\n </div>\n </Show>\n <slot />\n <Show when={this.label}>\n <div class={this.staticPart(UIT.LABEL)} part={this.partForName(\"label\")}>\n {this.label}\n </div>\n </Show>\n </div>\n )\n }\n\n /** Classes of the value shorthand: `[text] value in-statistic`. */\n @E.derived\n private get valueClasses(): string {\n const value = this.staticPart(VALUE)\n return this.text ? `${UIT.TEXT} ${value}` : value\n }\n\n /** Classes of a shorthand: the part noun and the static owner class, e.g. `label in-statistic`. */\n private staticPart(noun: string): string {\n return `${noun} ${UIT.PART_STATIC_CLASS_PREFIX}${this.vocabulary.noun}`\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIStatistic extends E.AttributeValues<typeof statisticVocabulary> {}\n\n/** The `value` shorthand: its attribute, part noun and class word. */\nconst VALUE = \"value\"\n","/**\n * The English vocabulary of `<ui-statistics>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-statistic size=\"large\" color=\"red\" direction=\"horizontal\">` => `ui large red horizontal statistic`;\n * `<ui-statistics widths=\"3\" stackable>` => `ui stackable three statistics`. `UIStatistic.css` keys on those words.\n * - Content is the GENERIC parts, owned by the statistic (`ownsParts`): `<ui-value>` (Fomantic's `.value`) and\n * `<ui-label>` (Fomantic's `.label`). There is NO separate label part tag: a `<ui-label>` inside a statistic\n * already renders as that statistic's `.label` part (`UILabel`, `:state(in-statistic)`), so the one word \"label\"\n * keeps meaning one element, and a `<ui-label-part>` / `<ui-caption>` would only be a second spelling of it.\n * - Shorthand: `value` / `label` render the same two parts inside the statistic's own shadow root,\n * the value BEFORE the slot and the label AFTER it, so either pairs with a slotted part;\n * slotted parts keep their order, so a `<ui-label>` before a `<ui-value>` is Fomantic's top label.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `statisticsVocabulary`\n * The names of `<ui-statistics>`, a group of statistics sharing one look: `<div class=\"ui ...\n * statistics\" part=\"group\">`.\n ****************/\nexport const statisticsVocabulary = {\n tag: \"ui-statistics\",\n icon: \"chart bar\",\n topics: [\"data display\", \"layout\", \"views\"],\n aka: [\"stats\", \"kpis\", \"metrics\", \"dashboard numbers\"],\n noun: \"statistics\",\n partOfSpeech: \"structure\",\n description: \"A group of statistics.\",\n attributes: [\n { name: \"size\", group: \"appearance\", kind: \"size\", description: \"Size of every statistic in the group.\" },\n { name: \"color\", group: \"appearance\", kind: \"color\", description: \"Hue of every value in the group.\" },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\"],\n replaces: [{ from: \"horizontal\", value: \"horizontal\" }],\n description:\n \"`horizontal`: statistics stacked, each with its label beside its value. Its old name was `horizontal`.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"Every statistic for dark backgrounds.\" },\n {\n name: \"stackable\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n \"Below 768px of the group's width (or the screen's: `stack-with`), one statistic per row, full width.\"\n },\n {\n name: \"stack-with\",\n group: \"layout\",\n kind: \"enum\",\n values: UIT.StackWithValues,\n description:\n \"What `stackable` measures: `container` (the default) -- the group's own width; `page` -- the \" +\n \"screen's, as in Fomantic. Unset: the page-wide `--ui-stack-with` token decides (`<ui-root \" +\n \"stack-with>`).\"\n },\n {\n name: \"equal\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n \"Every statistic the same width, from the statistics themselves (no count): one row, an equal share of \" +\n \"it each (the group spans its row). Not with `horizontal` (a column).\"\n },\n {\n name: \"widths\",\n group: \"appearance\",\n kind: \"width\",\n widthClass: \"\",\n values: [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"],\n description:\n 'Older, count-based alias of `equal`: divides each row evenly between N statistics (`widths=\"3\"` => ' +\n \"`three statistics`), wrapping after N.\"\n }\n ],\n events: [],\n slots: [{ name: \"\", description: \"`<ui-statistic>`s.\" }],\n parts: [{ name: \"group\", description: \"The group box.\" }],\n states: [\n { name: \"statistics\", description: \"ALWAYS set: the group's host is a block and the `ui-statistics` container.\" },\n {\n name: \"spaced\",\n description:\n \"Set unless `horizontal` or `widths`: the group keeps Fomantic's 1em top margin, which the HOST carries (so it collapses with the content above).\"\n }\n ],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\nimport { statisticsVocabulary } from \"./UIStatistics.en\"\n\nimport statisticCSS from \"./UIStatistic.css?inline\"\n\n/****************\n * ### `UIStatistics`\n * The component behind `<ui-statistics>`:\n * a group of statistics sharing one look, `<div class=\"ui … statistics\" part=\"group\"><slot></slot></div>`.\n *\n * - `UIStatistic.css` hands the group's size, colour, layout, count and stacking to its statistics\n * through inherited private tokens.\n * - The DOM element is a block and the size container `stackable` answers to (`:state(statistics)`);\n * with `stack-with=\"page\"` (a private class before the noun), the screen is.\n ****************/\nexport class UIStatistics extends E.UIComponent<typeof statisticsVocabulary> {\n @E.proto static vocabulary = statisticsVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { statistic: statisticCSS },\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** Always `:state(statistics)`: the size container `stackable` answers to. */\n @E.cssState(\"statistics\")\n get isStatistics(): boolean {\n return true\n }\n\n /**\n * Spaced, unless `horizontal` or `widths`, whose roots have no top margin.\n * - Why: the DOM element is a size container (its own formatting context),\n * so the group's top margin sits on the DOM ELEMENT, to collapse with the content above\n * as class grammar's does (`UIStatistic.css`).\n */\n @E.cssState(\"spaced\")\n get isSpaced(): boolean {\n return !this.direction && !this.widths\n }\n\n /** `stack-with`'s class (`UIT.StackClasses`). */\n protected get extraClass(): string | undefined {\n return UIT.StackClasses.classFor(this.stackWith)\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"group\")}>\n <slot />\n </div>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIStatistics extends E.AttributeValues<typeof statisticsVocabulary> {}\n","/**\n * The statistic family: defines `<ui-statistic>` and `<ui-statistics>`,\n * and exports their components, `UIStatistic` and `UIStatistics`.\n * - SIDE EFFECT: importing it defines the tags.\n * - Also the library's `spell/ui/ui-statistic` entry (its size is in `notes/report.md`).\n * - NOTE: the value and label are the generic parts (`<ui-value>`, `<ui-label>`):\n * load `spell/ui/ui-parts` and `spell/ui/ui-label` for slotted ones; the `value` / `label` shorthands need\n * neither.\n */\n\nimport { UIStatistic } from \"./UIStatistic\"\nimport { UIStatistics } from \"./UIStatistics\"\n\nUIStatistic.define()\nUIStatistics.define()\n\nexport { UIStatistic, UIStatistics }\n"],"mappings":";;;;;AAuBA,IAAagD,IAAsB;CACjC,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAgB;EAAQ;CAAO;CACxC,KAAK;EAAC;EAAQ;EAAO;EAAU;EAAW;CAAgB;CAC1D,UAAU;CACV,MAAM;CACN,cAAc;CACd,QAAQ;CACR,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAS,OAAO;GAAc,MAAM;GAAS,aAAa;EAAoB;EACtF;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ,CAAC,YAAY;GACrB,UAAU,CAAC;IAAE,MAAM;IAAc,OAAO;GAAa,CAAC;GACtD,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAS,OAAO;GAAU,MAAM;GAAW,aAAa;EAAyC;EACzG;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;GACb,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAS,OAAO;GAAQ,MAAM;GAAU,aAAa;EAA2C;CAC1G;CACA,QAAQ,CAAC;CACT,OAAO,CAAC;EAAE,MAAM;EAAI,aAAa;CAAyD,CAAC;CAC3F,OAAO;EACL;GAAE,MAAM;GAAa,aAAa;EAAqB;EACvD;GAAE,MAAM;GAAS,aAAa;EAAyB;EACvD;GAAE,MAAM;GAAS,aAAa;EAAyB;CACzD;CACA,QAAQ,CACN;EACE,MAAM;EACN,aACE;CACJ,GACA;EAAE,MAAM;EAAY,aAAa;CAAwB,CAC3D;CACA,OAAO,CAAC;CACR,WAAW,CAAC,SAAS,OAAO;AAC9B,G,qoNCxFAI,GAAAC,GAAA3C,GAAAC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O,GACnBU,EAAa,OAAO"}
|
package/dist/ui-theme-editor.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as e } from "./rolldown-runtime-c6e9CmGy.js";
|
|
2
2
|
import { At as t, ClipboardCopy as n, DOMElement as r, Dt as i, Et as a, Gt as o, Jt as s, Kt as c, Ot as l, UI as u, UIComponent as d, Ut as f, Warnings as p, Wt as m, Yt as h, after as g, afterSolidUpdate as ee, cssState as _, derived as v, jt as y, kt as te, lazy as ne, onChange as b, once as re, proto as ie, protoMerged as ae, qt as x, soon as oe, state as S, untracked as C, whileConnected as se } from "./core.js";
|
|
3
3
|
import { t as w } from "./PrefStore-Di83C0bY.js";
|
|
4
|
-
import { i as ce, r as T, t as E } from "./ThemeDraft-
|
|
5
|
-
import { a as le, c as ue, d as de, f as fe, i as pe, l as me, o as he, s as D, u as ge } from "./ui-theme-menu-
|
|
4
|
+
import { i as ce, r as T, t as E } from "./ThemeDraft-spaNC2dD.js";
|
|
5
|
+
import { a as le, c as ue, d as de, f as fe, i as pe, l as me, o as he, s as D, u as ge } from "./ui-theme-menu-BEBu6dyq.js";
|
|
6
6
|
import "./ui-property-editor.js";
|
|
7
7
|
import "./ui-input.js";
|
|
8
8
|
import "./ui-select.js";
|
|
@@ -440,7 +440,7 @@ var H = class _ThemePreference {
|
|
|
440
440
|
_ThemePreference.isWearingMine && (_ThemePreference.isWearingMine = !1, I.putOnPage(""));
|
|
441
441
|
let { tint: i } = _ThemePreference.chosen;
|
|
442
442
|
if (_ThemePreference.worn || !i) return t.apply(_ThemePreference.worn ?? e);
|
|
443
|
-
let { ThemeDraft: a } = await import("./ThemeDraft-
|
|
443
|
+
let { ThemeDraft: a } = await import("./ThemeDraft-spaNC2dD.js").then((e) => e.n);
|
|
444
444
|
await t.apply(e, { tint: a.tintCss(e, i) });
|
|
445
445
|
}
|
|
446
446
|
static async applyAddressed(e, t) {
|
|
@@ -992,7 +992,7 @@ var He = "@layer ui.components.hue-dropdown.content{.hue-dot{box-sizing:border-b
|
|
|
992
992
|
description: "A tint's name: the colour's."
|
|
993
993
|
}
|
|
994
994
|
]
|
|
995
|
-
}, at = "@layer ui.components.theme-menu.types{:host{vertical-align:middle;display:inline-block}.ui.themes{--_ui-theme-menu-gap:var(--ui-theme-menu-gap,.25em);--_ui-theme-menu-button-size:var(--ui-theme-menu-button-size,1.75em);--_ui-theme-menu-overlay-width:var(--ui-theme-menu-overlay-width,17em);--_ui-theme-menu-overlay-radius:var(--ui-theme-menu-overlay-radius,14px);--_theme-menu-row-radius:calc(var(--_ui-theme-menu-overlay-radius) - 1px - .375em);--_ui-theme-menu-swap-duration:var(--ui-theme-menu-swap-duration,.28s);--_ui-theme-menu-inverted-ink:var(--ui-theme-menu-inverted-ink,oklch(100% 0 0));align-items:center;gap:var(--_ui-theme-menu-gap);font-size:calc(var(--ui-font-size) * var(--ui-scale,1));flex-wrap:wrap;display:inline-flex}}@layer ui.components.theme-menu.content{.panel>.tints{margin:0 .5em .25em}.tints-header{padding:.25em .75em .5em}.tints-header>.heading{padding-inline:0}[part~=theme]{flex:0 auto;min-width:0}.button{box-sizing:border-box;width:var(--_ui-theme-menu-button-size);height:var(--_ui-theme-menu-button-size);color:var(--ui-text-muted);font:inherit;cursor:var(--ui-control-cursor);-webkit-tap-highlight-color:transparent;background:0 0;border:0;border-radius:50%;flex:none;place-items:center;margin:0;padding:0;line-height:1;display:inline-grid;position:relative}.button:hover{background:color-mix(in oklab, currentColor 10%, transparent);color:var(--ui-text-color)}.button:focus-visible{outline:var(--ui-focus-width,2px) solid var(--ui-focus-color);outline-offset:var(--ui-focus-offset,2px)}.button:active{scale:.94}.glyph{pointer-events:none;grid-area:1/1;place-items:center;width:1em;height:1em;font-size:1em;display:grid}.scheme .glyph{opacity:0;filter:blur(4px);scale:.25}.light.button .light.glyph,.dark.button .dark.glyph{opacity:1;filter:blur();scale:1}.overlay::part(popup){box-sizing:border-box;width:var(--_ui-theme-menu-overlay-width);border:1px solid var(--ui-border-color);border-radius:var(--_ui-theme-menu-overlay-radius);background:var(--ui-surface);max-width:calc(100vw - 16px);box-shadow:var(--ui-shadow-floating);color:var(--ui-text-color);font-size:calc(var(--ui-font-size) * .875);transform-origin:100% 0;padding:.375em;line-height:1.3}.panel{flex-direction:column;gap:1px;display:flex}.heading,.menu>.header{color:var(--ui-text-muted);font-family:var(--ui-font-family-mono,ui-monospace, monospace);letter-spacing:.08em;text-transform:uppercase;padding:.5em .75em .375em;font-size:.75em;font-weight:500}.menu>.header{padding-top:.25em}.menu{overscroll-behavior:contain;scrollbar-width:thin;flex-direction:column;gap:1px;max-height:min(24em,55vh);display:flex;overflow-y:auto}.divider{background:var(--ui-border-color);flex:none;height:1px;margin:.375em .5em}.panel>.bench,.panel>slot::slotted(*){box-sizing:border-box;border-radius:var(--_theme-menu-row-radius);width:100%;color:inherit;font:inherit;text-align:start;cursor:var(--ui-control-cursor);background:0 0;border:0;grid-template-columns:1.125em minmax(0,1fr);align-items:center;column-gap:.5em;margin:0;padding:.5em .625em;display:grid}.panel:not(:has(>.bench))>slot::slotted(:first-child){background-image:linear-gradient(var(--ui-border-color), var(--ui-border-color));background-position:top;background-repeat:no-repeat;background-size:calc(100% - 1em) 1px;margin-block-start:.375em;padding-block-start:.875em}.panel>.bench{text-decoration:none}.panel>.bench>ui-icon{--ui-icon-width:1.125em;--ui-icon-distance:0}.panel>.bench:hover,.panel>slot::slotted(:hover){background-color:var(--ui-surface-muted)}.panel>.schemes{margin:0 0 .125em;display:flex}.option{box-sizing:border-box;border-radius:var(--_theme-menu-row-radius);width:100%;color:inherit;font:inherit;text-align:start;cursor:var(--ui-control-cursor);background:0 0;border:0;grid-template-columns:1.125em minmax(0,1fr);align-items:center;column-gap:.5em;margin:0;padding:.5em .625em;display:grid}.option:hover{background:var(--ui-surface-muted)}.option:focus-visible{outline:2px solid var(--ui-focus-color);outline-offset:-2px}.option>.check{color:var(--ui-primary-text);opacity:0;place-items:center;font-size:.857em;display:grid}.option:has(>.description)>.check{grid-row:1/span 2}.option>.name{text-overflow:ellipsis;white-space:nowrap;grid-column:2;font-weight:500;overflow:hidden}.option>.description{color:var(--ui-text-muted);grid-column:2;font-size:.857em}[part~=tip].muted{display:none}}@layer ui.components.theme-menu.variations{.ui.inverted.themes .button{color:oklch(from var(--_ui-theme-menu-inverted-ink) l c h / .8)}.ui.inverted.themes .button:hover{background:oklch(from var(--_ui-theme-menu-inverted-ink) l c h / .14);color:var(--_ui-theme-menu-inverted-ink)}:host(:state(menu)){display:block}:host(:state(menu)) .ui.themes{font-size:inherit;line-height:1.3;display:block}[part~=theme].compact{--ui-button-background:transparent;--ui-button-background-hover:color-mix(in oklab, currentColor 10%, transparent);--ui-button-background-down:color-mix(in oklab, currentColor 16%, transparent);--ui-button-color:var(--ui-text-muted);--ui-button-color-hover:var(--ui-text-color);--ui-button-padding-block:.55em;--ui-button-padding-inline:.55em;--ui-button-radius:50%;--ui-button-box-shadow:none}[part~=theme].compact::part(icon){display:none}}@layer ui.components.theme-menu.states{.option.checked{background:color-mix(in oklch, var(--ui-primary) 10%, transparent)}.option.checked:hover{background:color-mix(in oklch, var(--ui-primary) 15%, transparent)}.option.checked>.check{opacity:1}.option.checked>.name{color:var(--ui-primary-text)}@media (prefers-reduced-motion:no-preference){.scheme .glyph{transition:opacity var(--_ui-theme-menu-swap-duration) var(--ui-ease-out,ease-out), scale var(--_ui-theme-menu-swap-duration) var(--ui-ease-out,ease-out), filter var(--_ui-theme-menu-swap-duration) var(--ui-ease-out,ease-out)!important}.button{transition:background-color var(--ui-duration-fast,.1s) ease-out, box-shadow var(--ui-duration-fast,.1s) ease-out, color var(--ui-duration-fast,.1s) ease-out, scale var(--ui-duration-fast,.1s) ease-out}.option{transition:background-color var(--ui-duration-fast,.1s) ease-out}}}", ot = /* @__PURE__ */ N("<div><!><!><!><!>"), st = /* @__PURE__ */ N("<button type=button>"), ct = /* @__PURE__ */ N("<ui-popup inverted>", 1), lt = /* @__PURE__ */ N("<span aria-hidden=true><ui-icon padding=none>", 1), ut = /* @__PURE__ */ N("<button type=button><span aria-hidden=true><ui-icon padding=none>", 1), dt = /* @__PURE__ */ N("<ui-popup open-on=click appearance=basic position=\"bottom right\">", 1), ft = /* @__PURE__ */ N("<div role=separator>"), pt = /* @__PURE__ */ N("<a rel=noopener><ui-icon aria-hidden=true padding=none></ui-icon><span>", 1), mt = /* @__PURE__ */ N("<div><div role=separator></div><div></div><div></div><!><!><slot>"), ht = /* @__PURE__ */ N("<div>"), gt = /* @__PURE__ */ N("<ui-menu interactive equal>", 1), q = /* @__PURE__ */ N("<ui-item>", 1), _t = /* @__PURE__ */ N("<span>"), vt = /* @__PURE__ */ N("<button type=button><span aria-hidden=true><ui-icon padding=none></ui-icon></span><span>", 1), yt = /* @__PURE__ */ N("<ui-icon aria-hidden=true>", 1), bt = /* @__PURE__ */ N("<ui-item kind=divider>", 1), xt = /* @__PURE__ */ N("<ui-dropdown floating scrolling button><div slot=header></div><span slot=trigger></span><!><!>", 1), St, Ct, wt, Tt, Et, Dt, Ot, kt, At, jt, Mt, Nt, Pt, Ft, J, Y, It, Lt, Rt, zt, Bt, X = class _UIThemeMenu extends (J = l, Ft = [ae], Pt = [oe], Nt = [v], Mt = [v], jt = [h("dark")], At = [h("following")], kt = [ce], Ot = [v], Dt = [ne], Et = [ne({ equals: isSameEntries })], Tt = [h("menu")], wt = [h("open"), v], Ct = [v], St = [se], J) {
|
|
995
|
+
}, at = "@layer ui.components.theme-menu.types{:host{vertical-align:middle;align-self:center;display:inline-block}.ui.themes{--_ui-theme-menu-gap:var(--ui-theme-menu-gap,.25em);--_ui-theme-menu-button-size:var(--ui-theme-menu-button-size,1.75em);--_ui-theme-menu-overlay-width:var(--ui-theme-menu-overlay-width,17em);--_ui-theme-menu-overlay-radius:var(--ui-theme-menu-overlay-radius,14px);--_theme-menu-row-radius:calc(var(--_ui-theme-menu-overlay-radius) - 1px - .375em);--_ui-theme-menu-swap-duration:var(--ui-theme-menu-swap-duration,.28s);--_ui-theme-menu-inverted-ink:var(--ui-theme-menu-inverted-ink,oklch(100% 0 0));align-items:center;gap:var(--_ui-theme-menu-gap);font-size:calc(var(--ui-font-size) * var(--ui-scale,1));flex-wrap:wrap;display:inline-flex}}@layer ui.components.theme-menu.content{.panel>.tints{margin:0 .5em .25em}.tints-header{padding:.25em .75em .5em}.tints-header>.heading{padding-inline:0}[part~=theme]{flex:0 auto;min-width:0}.button{box-sizing:border-box;width:var(--_ui-theme-menu-button-size);height:var(--_ui-theme-menu-button-size);color:var(--ui-text-muted);font:inherit;cursor:var(--ui-control-cursor);-webkit-tap-highlight-color:transparent;background:0 0;border:0;border-radius:50%;flex:none;place-items:center;margin:0;padding:0;line-height:1;display:inline-grid;position:relative}.button:hover{background:color-mix(in oklab, currentColor 10%, transparent);color:var(--ui-text-color)}.button:focus-visible{outline:var(--ui-focus-width,2px) solid var(--ui-focus-color);outline-offset:var(--ui-focus-offset,2px)}.button:active{scale:.94}.glyph{pointer-events:none;grid-area:1/1;place-items:center;width:1em;height:1em;font-size:1em;display:grid}.scheme .glyph{opacity:0;filter:blur(4px);scale:.25}.light.button .light.glyph,.dark.button .dark.glyph{opacity:1;filter:blur();scale:1}.overlay::part(popup){box-sizing:border-box;width:var(--_ui-theme-menu-overlay-width);border:1px solid var(--ui-border-color);border-radius:var(--_ui-theme-menu-overlay-radius);background:var(--ui-surface);max-width:calc(100vw - 16px);box-shadow:var(--ui-shadow-floating);color:var(--ui-text-color);font-size:calc(var(--ui-font-size) * .875);transform-origin:100% 0;padding:.375em;line-height:1.3}.panel{flex-direction:column;gap:1px;display:flex}.heading,.menu>.header{color:var(--ui-text-muted);font-family:var(--ui-font-family-mono,ui-monospace, monospace);letter-spacing:.08em;text-transform:uppercase;padding:.5em .75em .375em;font-size:.75em;font-weight:500}.menu>.header{padding-top:.25em}.menu{overscroll-behavior:contain;scrollbar-width:thin;flex-direction:column;gap:1px;max-height:min(24em,55vh);display:flex;overflow-y:auto}.divider{background:var(--ui-border-color);flex:none;height:1px;margin:.375em .5em}.panel>.bench,.panel>slot::slotted(*){box-sizing:border-box;border-radius:var(--_theme-menu-row-radius);width:100%;color:inherit;font:inherit;text-align:start;cursor:var(--ui-control-cursor);background:0 0;border:0;grid-template-columns:1.125em minmax(0,1fr);align-items:center;column-gap:.5em;margin:0;padding:.5em .625em;display:grid}.panel:not(:has(>.bench))>slot::slotted(:first-child){background-image:linear-gradient(var(--ui-border-color), var(--ui-border-color));background-position:top;background-repeat:no-repeat;background-size:calc(100% - 1em) 1px;margin-block-start:.375em;padding-block-start:.875em}.panel>.bench{text-decoration:none}.panel>.bench>ui-icon{--ui-icon-width:1.125em;--ui-icon-distance:0}.panel>.bench:hover,.panel>slot::slotted(:hover){background-color:var(--ui-surface-muted)}.panel>.schemes{margin:0 0 .125em;display:flex}.option{box-sizing:border-box;border-radius:var(--_theme-menu-row-radius);width:100%;color:inherit;font:inherit;text-align:start;cursor:var(--ui-control-cursor);background:0 0;border:0;grid-template-columns:1.125em minmax(0,1fr);align-items:center;column-gap:.5em;margin:0;padding:.5em .625em;display:grid}.option:hover{background:var(--ui-surface-muted)}.option:focus-visible{outline:2px solid var(--ui-focus-color);outline-offset:-2px}.option>.check{color:var(--ui-primary-text);opacity:0;place-items:center;font-size:.857em;display:grid}.option:has(>.description)>.check{grid-row:1/span 2}.option>.name{text-overflow:ellipsis;white-space:nowrap;grid-column:2;font-weight:500;overflow:hidden}.option>.description{color:var(--ui-text-muted);grid-column:2;font-size:.857em}[part~=tip].muted{display:none}}@layer ui.components.theme-menu.variations{.ui.inverted.themes .button{color:oklch(from var(--_ui-theme-menu-inverted-ink) l c h / .8)}.ui.inverted.themes .button:hover{background:oklch(from var(--_ui-theme-menu-inverted-ink) l c h / .14);color:var(--_ui-theme-menu-inverted-ink)}:host(:state(menu)){display:block}:host(:state(menu)) .ui.themes{font-size:inherit;line-height:1.3;display:block}[part~=theme].compact{--ui-button-background:transparent;--ui-button-background-hover:color-mix(in oklab, currentColor 10%, transparent);--ui-button-background-down:color-mix(in oklab, currentColor 16%, transparent);--ui-button-color:var(--ui-text-muted);--ui-button-color-hover:var(--ui-text-color);--ui-button-padding-block:.55em;--ui-button-padding-inline:.55em;--ui-button-radius:50%;--ui-button-box-shadow:none}[part~=theme].compact::part(icon){display:none}}@layer ui.components.theme-menu.states{.option.checked{background:color-mix(in oklch, var(--ui-primary) 10%, transparent)}.option.checked:hover{background:color-mix(in oklch, var(--ui-primary) 15%, transparent)}.option.checked>.check{opacity:1}.option.checked>.name{color:var(--ui-primary-text)}@media (prefers-reduced-motion:no-preference){.scheme .glyph{transition:opacity var(--_ui-theme-menu-swap-duration) var(--ui-ease-out,ease-out), scale var(--_ui-theme-menu-swap-duration) var(--ui-ease-out,ease-out), filter var(--_ui-theme-menu-swap-duration) var(--ui-ease-out,ease-out)!important}.button{transition:background-color var(--ui-duration-fast,.1s) ease-out, box-shadow var(--ui-duration-fast,.1s) ease-out, color var(--ui-duration-fast,.1s) ease-out, scale var(--ui-duration-fast,.1s) ease-out}.option{transition:background-color var(--ui-duration-fast,.1s) ease-out}}}", ot = /* @__PURE__ */ N("<div><!><!><!><!>"), st = /* @__PURE__ */ N("<button type=button>"), ct = /* @__PURE__ */ N("<ui-popup inverted>", 1), lt = /* @__PURE__ */ N("<span aria-hidden=true><ui-icon padding=none>", 1), ut = /* @__PURE__ */ N("<button type=button><span aria-hidden=true><ui-icon padding=none>", 1), dt = /* @__PURE__ */ N("<ui-popup open-on=click appearance=basic position=\"bottom right\">", 1), ft = /* @__PURE__ */ N("<div role=separator>"), pt = /* @__PURE__ */ N("<a rel=noopener><ui-icon aria-hidden=true padding=none></ui-icon><span>", 1), mt = /* @__PURE__ */ N("<div><div role=separator></div><div></div><div></div><!><!><slot>"), ht = /* @__PURE__ */ N("<div>"), gt = /* @__PURE__ */ N("<ui-menu interactive equal>", 1), q = /* @__PURE__ */ N("<ui-item>", 1), _t = /* @__PURE__ */ N("<span>"), vt = /* @__PURE__ */ N("<button type=button><span aria-hidden=true><ui-icon padding=none></ui-icon></span><span>", 1), yt = /* @__PURE__ */ N("<ui-icon aria-hidden=true>", 1), bt = /* @__PURE__ */ N("<ui-item kind=divider>", 1), xt = /* @__PURE__ */ N("<ui-dropdown floating scrolling button><div slot=header></div><span slot=trigger></span><!><!>", 1), St, Ct, wt, Tt, Et, Dt, Ot, kt, At, jt, Mt, Nt, Pt, Ft, J, Y, It, Lt, Rt, zt, Bt, X = class _UIThemeMenu extends (J = l, Ft = [ae], Pt = [oe], Nt = [v], Mt = [v], jt = [h("dark")], At = [h("following")], kt = [ce], Ot = [v], Dt = [ne], Et = [ne({ equals: isSameEntries })], Tt = [h("menu")], wt = [h("open"), v], Ct = [v], St = [se], J) {
|
|
996
996
|
constructor() {
|
|
997
997
|
super(...arguments), p(Y, 5, this), _(this, It, p(Y, 8, this, k ? an : U.chosen)), p(Y, 11, this), _(this, Lt, p(Y, 12, this, k ? "light" : U.osScheme())), p(Y, 15, this), _(this, Rt, p(Y, 16, this, k ? [] : I.list)), p(Y, 19, this), o(this, "texts", /* @__PURE__ */ s((e, t) => this.translationForKey(e, t), "texts")), _(this, zt, p(Y, 20, this, !1)), p(Y, 23, this), _(this, Bt, p(Y, 24, this)), p(Y, 27, this);
|
|
998
998
|
}
|
|
@@ -1494,4 +1494,4 @@ var kn = /* @__PURE__ */ e({
|
|
|
1494
1494
|
Z.define();
|
|
1495
1495
|
export { W as a, Te as c, ke as d, Oe as f, Qe as i, we as l, Z as n, U as o, De as p, ThemeMenu as r, I as s, kn as t, Ee as u };
|
|
1496
1496
|
|
|
1497
|
-
//# sourceMappingURL=ui-theme-menu-
|
|
1497
|
+
//# sourceMappingURL=ui-theme-menu-BEBu6dyq.js.map
|