smoothly 1.0.0-alpha.172 → 1.0.0-alpha.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/smoothly-app_71.cjs.entry.js +47 -23
- package/dist/cjs/smoothly-app_71.cjs.entry.js.map +1 -1
- package/dist/collection/components/input/select/index.js +46 -22
- package/dist/collection/components/input/select/index.js.map +1 -1
- package/dist/collection/components/input/select/style.css +2 -0
- package/dist/custom-elements/index.js +47 -23
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/smoothly-app_71.entry.js +47 -23
- package/dist/esm/smoothly-app_71.entry.js.map +1 -1
- package/dist/smoothly/{p-41e3ab55.entry.js → p-2b490452.entry.js} +2 -2
- package/dist/smoothly/{p-41e3ab55.entry.js.map → p-2b490452.entry.js.map} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/package.json +1 -1
|
@@ -9629,7 +9629,7 @@ const SmoothlyInputRange = class {
|
|
|
9629
9629
|
};
|
|
9630
9630
|
SmoothlyInputRange.style = styleCss$C;
|
|
9631
9631
|
|
|
9632
|
-
const styleCss$B = ".sc-smoothly-input-select-h{box-sizing:border-box}.sc-smoothly-input-select-h[looks=\"border\"].sc-smoothly-input-select-s>smoothly-picker-menu smoothly-input,[looks=\"border\"].sc-smoothly-input-select-h{border:rgb(var(--text-color, var(--smoothly-color-contrast))) solid 1px}.sc-smoothly-input-select-h[looks=\"line\"].sc-smoothly-input-select-s>smoothly-picker-menu smoothly-input,[looks=\"line\"].sc-smoothly-input-select-h{border-bottom:rgb(var(--text-color, var(--smoothly-color-contrast))) solid 1px}.sc-smoothly-input-select-h[looks=\"grid\"].sc-smoothly-input-select-s>smoothly-picker-menu smoothly-input,[looks=\"grid\"].sc-smoothly-input-select-h{border:rgba(var(--text-color, var(--smoothly-color-contrast)), .5) solid .5px}[looks=\"transparent\"].sc-smoothly-input-select-h{border:none}[looks=\"transparent\"].sc-smoothly-input-select-h:not(:focus-within){background-color:transparent}[looks=\"transparent\"].sc-smoothly-input-select-h:not(:focus-within) input.sc-smoothly-input-select{background:transparent}[looks=\"transparent\"].sc-smoothly-input-select-h:focus-within{outline:1px solid rgb(var(--smoothly-color-contrast))}.sc-smoothly-input-select-h{display:flex;position:relative;background-color:rgb(var(--background-color, var(--smoothly-color-shade)))}.icon.sc-smoothly-input-select-h{width:fit-content;flex-direction:column}.sc-smoothly-input-select-h>main.sc-smoothly-input-select,.sc-smoothly-input-select-h>main.sc-smoothly-input-select>*.sc-smoothly-input-select{height:100%;display:flex;align-items:center}.icon.sc-smoothly-input-select-h>main.sc-smoothly-input-select,.icon.sc-smoothly-input-select-h>main.sc-smoothly-input-select>*.sc-smoothly-input-select{padding:0.5em}.sc-smoothly-input-select-h>div.sc-smoothly-input-select>nav.sc-smoothly-input-select{display:flex;flex-direction:column;position:absolute;z-index:10;height:var(--menu-height, unset);overflow-y:scroll}.sc-smoothly-input-select-h>aside.sc-smoothly-input-select{position:absolute;top:0;left:5em;z-index:10;background-color:rgb(var(--smoothly-tertiary-color));color:rgb(var(--smoothly-tertiary-contrast));height:1.25rem;border-radius:0.3rem;padding:0.3rem;display:flex;align-items:center}.missing.sc-smoothly-input-select-h>aside.sc-smoothly-input-select{background-color:rgb(var(--smoothly-warning-color));color:rgb(var(--smoothly-warning-contrast))}.hidden.sc-smoothly-input-select{display:none}.sc-smoothly-input-select-h>section.sc-smoothly-input-select{position:fixed;top:0px;left:0px;width:100vw;height:100vh;z-index:10}";
|
|
9632
|
+
const styleCss$B = ".sc-smoothly-input-select-h{box-sizing:border-box}.sc-smoothly-input-select-h[looks=\"border\"].sc-smoothly-input-select-s>smoothly-picker-menu smoothly-input,[looks=\"border\"].sc-smoothly-input-select-h{border:rgb(var(--text-color, var(--smoothly-color-contrast))) solid 1px}.sc-smoothly-input-select-h[looks=\"line\"].sc-smoothly-input-select-s>smoothly-picker-menu smoothly-input,[looks=\"line\"].sc-smoothly-input-select-h{border-bottom:rgb(var(--text-color, var(--smoothly-color-contrast))) solid 1px}.sc-smoothly-input-select-h[looks=\"grid\"].sc-smoothly-input-select-s>smoothly-picker-menu smoothly-input,[looks=\"grid\"].sc-smoothly-input-select-h{border:rgba(var(--text-color, var(--smoothly-color-contrast)), .5) solid .5px}[looks=\"transparent\"].sc-smoothly-input-select-h{border:none}[looks=\"transparent\"].sc-smoothly-input-select-h:not(:focus-within){background-color:transparent}[looks=\"transparent\"].sc-smoothly-input-select-h:not(:focus-within) input.sc-smoothly-input-select{background:transparent}[looks=\"transparent\"].sc-smoothly-input-select-h:focus-within{outline:1px solid rgb(var(--smoothly-color-contrast))}.sc-smoothly-input-select-h{display:flex;flex-direction:column;position:relative;background-color:rgb(var(--background-color, var(--smoothly-color-shade)))}.icon.sc-smoothly-input-select-h{width:fit-content;flex-direction:column}.sc-smoothly-input-select-h>main.sc-smoothly-input-select,.sc-smoothly-input-select-h>main.sc-smoothly-input-select>*.sc-smoothly-input-select{height:100%;display:flex;align-items:center;cursor:default}.icon.sc-smoothly-input-select-h>main.sc-smoothly-input-select,.icon.sc-smoothly-input-select-h>main.sc-smoothly-input-select>*.sc-smoothly-input-select{padding:0.5em}.sc-smoothly-input-select-h>div.sc-smoothly-input-select>nav.sc-smoothly-input-select{display:flex;flex-direction:column;position:absolute;z-index:10;height:var(--menu-height, unset);overflow-y:scroll}.sc-smoothly-input-select-h>aside.sc-smoothly-input-select{position:absolute;top:0;left:5em;z-index:10;background-color:rgb(var(--smoothly-tertiary-color));color:rgb(var(--smoothly-tertiary-contrast));height:1.25rem;border-radius:0.3rem;padding:0.3rem;display:flex;align-items:center}.missing.sc-smoothly-input-select-h>aside.sc-smoothly-input-select{background-color:rgb(var(--smoothly-warning-color));color:rgb(var(--smoothly-warning-contrast))}.hidden.sc-smoothly-input-select{display:none}.sc-smoothly-input-select-h>section.sc-smoothly-input-select{position:fixed;top:0px;left:0px;width:100vw;height:100vh;z-index:10}";
|
|
9633
9633
|
|
|
9634
9634
|
const SmoothlyInputSelect = class {
|
|
9635
9635
|
constructor(hostRef) {
|
|
@@ -9695,17 +9695,19 @@ const SmoothlyInputSelect = class {
|
|
|
9695
9695
|
}
|
|
9696
9696
|
onKeyDown(event) {
|
|
9697
9697
|
event.stopPropagation();
|
|
9698
|
-
event.
|
|
9698
|
+
if (event.key != "Tab" && !event.ctrlKey && !event.metaKey)
|
|
9699
|
+
event.preventDefault();
|
|
9699
9700
|
if (this.opened) {
|
|
9700
|
-
let direction = 0;
|
|
9701
9701
|
switch (event.key) {
|
|
9702
9702
|
case "ArrowUp":
|
|
9703
|
-
|
|
9703
|
+
this.move(-1);
|
|
9704
9704
|
break;
|
|
9705
9705
|
case "ArrowDown":
|
|
9706
|
-
|
|
9706
|
+
this.move(1);
|
|
9707
9707
|
break;
|
|
9708
9708
|
case "Escape":
|
|
9709
|
+
if (this.filter == "")
|
|
9710
|
+
this.opened = false;
|
|
9709
9711
|
this.filter = "";
|
|
9710
9712
|
break;
|
|
9711
9713
|
case "Backspace":
|
|
@@ -9713,39 +9715,61 @@ const SmoothlyInputSelect = class {
|
|
|
9713
9715
|
break;
|
|
9714
9716
|
case "Enter":
|
|
9715
9717
|
const result = this.items.find(item => item.marked);
|
|
9716
|
-
if (result === null || result === void 0 ? void 0 : result.value)
|
|
9718
|
+
if (result === null || result === void 0 ? void 0 : result.value)
|
|
9717
9719
|
result.selected = true;
|
|
9718
|
-
}
|
|
9719
9720
|
this.opened = false;
|
|
9720
9721
|
this.filter = "";
|
|
9721
9722
|
break;
|
|
9723
|
+
case "Tab":
|
|
9724
|
+
this.opened = false;
|
|
9725
|
+
break;
|
|
9722
9726
|
default:
|
|
9723
9727
|
if (event.key.length == 1)
|
|
9724
9728
|
this.filter += event.key;
|
|
9725
9729
|
break;
|
|
9726
9730
|
}
|
|
9727
|
-
this.move(direction);
|
|
9728
9731
|
}
|
|
9729
|
-
else
|
|
9730
|
-
|
|
9732
|
+
else {
|
|
9733
|
+
switch (event.key) {
|
|
9734
|
+
case "Enter":
|
|
9735
|
+
case " ":
|
|
9736
|
+
this.opened = true;
|
|
9737
|
+
break;
|
|
9738
|
+
case "ArrowDown":
|
|
9739
|
+
this.opened = true;
|
|
9740
|
+
this.move(0);
|
|
9741
|
+
break;
|
|
9742
|
+
case "ArrowUp":
|
|
9743
|
+
this.opened = true;
|
|
9744
|
+
this.move(-1);
|
|
9745
|
+
break;
|
|
9746
|
+
case "Tab":
|
|
9747
|
+
break;
|
|
9748
|
+
default:
|
|
9749
|
+
this.opened = true;
|
|
9750
|
+
if (event.key.length == 1)
|
|
9751
|
+
this.filter += event.key;
|
|
9752
|
+
break;
|
|
9753
|
+
}
|
|
9754
|
+
}
|
|
9731
9755
|
}
|
|
9732
9756
|
move(direction) {
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9757
|
+
let markedIndex = this.items.findIndex(item => item.marked);
|
|
9758
|
+
if (markedIndex == -1)
|
|
9759
|
+
markedIndex = this.items.findIndex(item => item.selected);
|
|
9760
|
+
if (this.items[markedIndex])
|
|
9761
|
+
this.items[markedIndex].marked = false;
|
|
9762
|
+
if (markedIndex == -1)
|
|
9763
|
+
markedIndex = 0;
|
|
9764
|
+
do {
|
|
9765
|
+
markedIndex = (markedIndex + direction + this.items.length) % this.items.length;
|
|
9766
|
+
} while (this.items[markedIndex].hidden);
|
|
9767
|
+
this.items[markedIndex].marked = true;
|
|
9768
|
+
this.items[markedIndex].focus();
|
|
9745
9769
|
}
|
|
9746
9770
|
render() {
|
|
9747
9771
|
var _a, _b;
|
|
9748
|
-
return (index.h(index.Host, { tabIndex:
|
|
9772
|
+
return (index.h(index.Host, { tabIndex: 0, class: (_a = (this.missing ? "missing" : this.type)) !== null && _a !== void 0 ? _a : "" }, index.h("main", { ref: element => (this.mainElement = element) }, (_b = this.initialPrompt) !== null && _b !== void 0 ? _b : "(none)"), this.filter.length != 0 ? (index.h("aside", { ref: element => (this.aside = element) }, this.filter, index.h("button", { onClick: e => {
|
|
9749
9773
|
e.stopPropagation();
|
|
9750
9774
|
this.filter = "";
|
|
9751
9775
|
} }, index.h("smoothly-icon", { name: "close", size: "small" })))) : undefined, this.opened ? index.h("section", { onClick: () => (this.opened = true) }) : [], index.h("div", { class: this.opened ? "" : "hidden" }, index.h("nav", null, index.h("slot", null)))));
|