smoothly 0.2.11 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/smoothly-accordion_50.cjs.entry.js +38 -28
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/app-demo/index.js +10 -10
- package/dist/collection/components/menu-options/index.js +31 -10
- package/dist/collection/components/option/index.js +81 -6
- package/dist/collection/components/option/style.css +31 -35
- package/dist/collection/components/picker/index.js +26 -21
- package/dist/collection/components/select-demo/index.js +4 -4
- package/dist/collection/components/skeleton/index.js +1 -1
- package/dist/collection/model/{OptionType.js → Option.js} +0 -0
- package/dist/custom-elements/index.js +42 -32
- package/dist/esm/loader.js +1 -1
- package/dist/esm/smoothly-accordion_50.entry.js +38 -28
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/p-71443887.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/menu-options/index.d.ts +10 -6
- package/dist/types/components/option/index.d.ts +7 -0
- package/dist/types/components/picker/index.d.ts +11 -10
- package/dist/types/components.d.ts +20 -11
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model/Option.d.ts +7 -0
- package/dist/types/model/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/smoothly/p-956089d5.entry.js +0 -1
- package/dist/types/model/OptionType.d.ts +0 -8
|
@@ -4,6 +4,7 @@ export class SmoothlyPicker {
|
|
|
4
4
|
this.keepFocusOnReRender = false;
|
|
5
5
|
this.disabled = false;
|
|
6
6
|
this.readonly = false;
|
|
7
|
+
this.maxMenuHeight = "inherit";
|
|
7
8
|
this.emptyMenuLabel = "No Options";
|
|
8
9
|
this.multiple = false;
|
|
9
10
|
this.mutable = false;
|
|
@@ -140,17 +141,14 @@ export class SmoothlyPicker {
|
|
|
140
141
|
this.isOpen = false;
|
|
141
142
|
this.filterOptions();
|
|
142
143
|
}
|
|
143
|
-
getCheckHtml(checked) {
|
|
144
|
-
return checked ? (h("smoothly-icon", { name: "checkbox", size: "small" })) : (h("smoothly-icon", { name: "square-outline", size: "small" }));
|
|
145
|
-
}
|
|
146
144
|
render() {
|
|
147
|
-
var _a, _b, _c
|
|
145
|
+
var _a, _b, _c;
|
|
148
146
|
const cssVariables = {
|
|
149
147
|
"--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
|
|
150
148
|
"--label-display": this.labelSetting == "hide" ? "none" : "absolute",
|
|
151
149
|
};
|
|
152
150
|
(_b = this.options) === null || _b === void 0 ? void 0 : _b.forEach(o => {
|
|
153
|
-
o.
|
|
151
|
+
o.checked = this.selections.map(s => s.value).includes(o.value);
|
|
154
152
|
});
|
|
155
153
|
const options = [
|
|
156
154
|
...(this.multiple
|
|
@@ -158,12 +156,12 @@ export class SmoothlyPicker {
|
|
|
158
156
|
{
|
|
159
157
|
value: "select-none",
|
|
160
158
|
name: this.selections.length == this.options.length ? this.selectNoneName : this.selectAllName,
|
|
161
|
-
|
|
159
|
+
checked: this.selections.length == this.options.length,
|
|
162
160
|
divider: true,
|
|
163
161
|
},
|
|
164
162
|
]
|
|
165
163
|
: []),
|
|
166
|
-
...((
|
|
164
|
+
...((_c = this.options) !== null && _c !== void 0 ? _c : []),
|
|
167
165
|
];
|
|
168
166
|
return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() },
|
|
169
167
|
h("div", null,
|
|
@@ -174,7 +172,7 @@ export class SmoothlyPicker {
|
|
|
174
172
|
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }),
|
|
175
173
|
h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }),
|
|
176
174
|
h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })),
|
|
177
|
-
h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
175
|
+
h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
178
176
|
}
|
|
179
177
|
static get is() { return "smoothly-picker"; }
|
|
180
178
|
static get encapsulation() { return "shadow"; }
|
|
@@ -225,8 +223,8 @@ export class SmoothlyPicker {
|
|
|
225
223
|
"type": "string",
|
|
226
224
|
"mutable": false,
|
|
227
225
|
"complexType": {
|
|
228
|
-
"original": "
|
|
229
|
-
"resolved": "
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
230
228
|
"references": {}
|
|
231
229
|
},
|
|
232
230
|
"required": false,
|
|
@@ -236,7 +234,8 @@ export class SmoothlyPicker {
|
|
|
236
234
|
"text": ""
|
|
237
235
|
},
|
|
238
236
|
"attribute": "max-menu-height",
|
|
239
|
-
"reflect": false
|
|
237
|
+
"reflect": false,
|
|
238
|
+
"defaultValue": "\"inherit\""
|
|
240
239
|
},
|
|
241
240
|
"maxHeight": {
|
|
242
241
|
"type": "string",
|
|
@@ -328,12 +327,12 @@ export class SmoothlyPicker {
|
|
|
328
327
|
},
|
|
329
328
|
"options": {
|
|
330
329
|
"type": "unknown",
|
|
331
|
-
"mutable":
|
|
330
|
+
"mutable": true,
|
|
332
331
|
"complexType": {
|
|
333
|
-
"original": "
|
|
334
|
-
"resolved": "
|
|
332
|
+
"original": "(Option & { checked?: boolean })[]",
|
|
333
|
+
"resolved": "(Option & { checked?: boolean | undefined; })[]",
|
|
335
334
|
"references": {
|
|
336
|
-
"
|
|
335
|
+
"Option": {
|
|
337
336
|
"location": "import",
|
|
338
337
|
"path": "../../model"
|
|
339
338
|
}
|
|
@@ -385,10 +384,10 @@ export class SmoothlyPicker {
|
|
|
385
384
|
"type": "unknown",
|
|
386
385
|
"mutable": true,
|
|
387
386
|
"complexType": {
|
|
388
|
-
"original": "
|
|
389
|
-
"resolved": "
|
|
387
|
+
"original": "Option[]",
|
|
388
|
+
"resolved": "Option[]",
|
|
390
389
|
"references": {
|
|
391
|
-
"
|
|
390
|
+
"Option": {
|
|
392
391
|
"location": "import",
|
|
393
392
|
"path": "../../model"
|
|
394
393
|
}
|
|
@@ -511,10 +510,10 @@ export class SmoothlyPicker {
|
|
|
511
510
|
"text": ""
|
|
512
511
|
},
|
|
513
512
|
"complexType": {
|
|
514
|
-
"original": "
|
|
515
|
-
"resolved": "
|
|
513
|
+
"original": "Option[]",
|
|
514
|
+
"resolved": "Option[]",
|
|
516
515
|
"references": {
|
|
517
|
-
"
|
|
516
|
+
"Option": {
|
|
518
517
|
"location": "import",
|
|
519
518
|
"path": "../../model"
|
|
520
519
|
}
|
|
@@ -552,6 +551,12 @@ export class SmoothlyPicker {
|
|
|
552
551
|
"target": undefined,
|
|
553
552
|
"capture": false,
|
|
554
553
|
"passive": false
|
|
554
|
+
}, {
|
|
555
|
+
"name": "optionUnselect",
|
|
556
|
+
"method": "optionSelectHandler",
|
|
557
|
+
"target": undefined,
|
|
558
|
+
"capture": false,
|
|
559
|
+
"passive": false
|
|
555
560
|
}, {
|
|
556
561
|
"name": "optionAdd",
|
|
557
562
|
"method": "optionAddHandler",
|
|
@@ -50,11 +50,11 @@ export class SmoothlySelectDemo {
|
|
|
50
50
|
h("smoothly-item", { value: "11" }, "November"),
|
|
51
51
|
h("smoothly-item", { value: "12" }, "December")),
|
|
52
52
|
h("button", { onClick: () => this.alertf() }, "press here"),
|
|
53
|
-
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
53
|
+
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", maxMenuHeight: "20rem", multiple: true, options: [
|
|
54
54
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
55
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
55
|
+
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew" },
|
|
56
56
|
{ name: "Noble Pig", value: "pig" },
|
|
57
|
-
{ name: "Turtle Wax", value: "turtle" },
|
|
57
|
+
{ name: "Turtle Wax", value: "turtle", hint: "slow" },
|
|
58
58
|
{ name: "Spider Man", value: "spider" },
|
|
59
59
|
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
60
60
|
{ name: "Horse Back", value: "horse" },
|
|
@@ -86,7 +86,7 @@ export class SmoothlySelectDemo {
|
|
|
86
86
|
], valueValidator: (email) => email.match(/^\w+@\w+/) ? [true, undefined] : [false, Notice.failed("Incorrectly formatted email")] }),
|
|
87
87
|
h("br", null),
|
|
88
88
|
h("smoothly-picker", { label: "Single select", multiple: false, "max-menu-height": "200px", options: [
|
|
89
|
-
{ name: "Dog", value: "dog", aliases: ["WOFF"],
|
|
89
|
+
{ name: "Dog", value: "dog", aliases: ["WOFF"], hint: "Woof 🐶" },
|
|
90
90
|
{ name: "Cat", value: "cat", aliases: ["moew"] },
|
|
91
91
|
{ name: "Pig", value: "pig" },
|
|
92
92
|
{ name: "Turtle", value: "turtle" },
|
|
File without changes
|
|
@@ -1716,16 +1716,16 @@ const SmoothlyAppDemo$1 = class extends HTMLElement {
|
|
|
1716
1716
|
redirect("https://google.com");
|
|
1717
1717
|
} }, "External")), h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" }, h("h2", null, "Regex routing")), h("smoothly-room", { path: "old", label: "Old", to: "select" }), h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
|
|
1718
1718
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
1719
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"],
|
|
1720
|
-
{ name: "Noble Pig", value: "pig",
|
|
1721
|
-
{ name: "Turtle Wax", value: "turtle"
|
|
1722
|
-
{ name: "Spider Man", value: "spider"
|
|
1723
|
-
{ name: "Phoenix Order Long Wooord", value: "phoenix"
|
|
1724
|
-
{ name: "Horse Back", value: "horse"
|
|
1725
|
-
{ name: "Unicorn Horn", value: "unicorn"
|
|
1726
|
-
{ name: "Talking Parrot Parrot", value: "parrot"
|
|
1727
|
-
{ name: "Hidden Dragon", value: "dragon"
|
|
1728
|
-
{ name: "Scary Kraken", value: "kraken"
|
|
1719
|
+
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
|
|
1720
|
+
{ name: "Noble Pig", value: "pig", hint: "🐷" },
|
|
1721
|
+
{ name: "Turtle Wax", value: "turtle" },
|
|
1722
|
+
{ name: "Spider Man", value: "spider" },
|
|
1723
|
+
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
1724
|
+
{ name: "Horse Back", value: "horse" },
|
|
1725
|
+
{ name: "Unicorn Horn", value: "unicorn" },
|
|
1726
|
+
{ name: "Talking Parrot Parrot", value: "parrot" },
|
|
1727
|
+
{ name: "Hidden Dragon", value: "dragon" },
|
|
1728
|
+
{ name: "Scary Kraken", value: "kraken" },
|
|
1729
1729
|
] })), h("smoothly-trigger", { slot: "header", type: "link", name: "logout" }, h("smoothly-icon", { toolTip: "Log out", name: "log-out", size: "medium" }))));
|
|
1730
1730
|
}
|
|
1731
1731
|
};
|
|
@@ -35295,8 +35295,10 @@ const SmoothlyMenuOptions$1 = class extends HTMLElement {
|
|
|
35295
35295
|
this.__registerHost();
|
|
35296
35296
|
this.__attachShadow();
|
|
35297
35297
|
this.menuEmpty = createEvent(this, "menuEmpty", 7);
|
|
35298
|
+
this.optionElements = [];
|
|
35298
35299
|
this.filteredOptions = [];
|
|
35299
35300
|
this.highlightIndex = 0;
|
|
35301
|
+
this.toggle = false;
|
|
35300
35302
|
this.emptyMenuLabel = "No Options";
|
|
35301
35303
|
this.newOptionLabel = "Add:";
|
|
35302
35304
|
this.order = false;
|
|
@@ -35304,7 +35306,7 @@ const SmoothlyMenuOptions$1 = class extends HTMLElement {
|
|
|
35304
35306
|
this.resetHighlightOnOptionsChange = true;
|
|
35305
35307
|
this.mutable = false;
|
|
35306
35308
|
}
|
|
35307
|
-
optionsChangeHandler(
|
|
35309
|
+
optionsChangeHandler() {
|
|
35308
35310
|
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
35309
35311
|
}
|
|
35310
35312
|
optionHoverHandler(event) {
|
|
@@ -35386,7 +35388,10 @@ const SmoothlyMenuOptions$1 = class extends HTMLElement {
|
|
|
35386
35388
|
}
|
|
35387
35389
|
}
|
|
35388
35390
|
render() {
|
|
35389
|
-
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle,
|
|
35391
|
+
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle, toggle: this.toggle, ref: el => {
|
|
35392
|
+
index == 0 && (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement);
|
|
35393
|
+
el && (this.optionElements[index] = el);
|
|
35394
|
+
}, checked: option.checked, value: option.value, name: option.name, divider: option.divider, "data-highlight": this.highlightIndex == index }, option.hint ? h("div", { slot: "hint" }, option.hint) : undefined)))) : this.mutable ? (h("smoothly-option", { style: this.optionStyle, value: this.keyword, name: this.keyword, "data-highlight": 0, new: true }, h("div", { slot: "left" }, h("smoothly-icon", { name: "square-outline", size: "small" }), " ", this.newOptionLabel))) : (h("div", null, this.emptyMenuLabel))));
|
|
35390
35395
|
}
|
|
35391
35396
|
get element() { return this; }
|
|
35392
35397
|
static get watchers() { return {
|
|
@@ -35479,7 +35484,7 @@ const Notifier = class extends HTMLElement {
|
|
|
35479
35484
|
static get style() { return styleCss$q; }
|
|
35480
35485
|
};
|
|
35481
35486
|
|
|
35482
|
-
const styleCss$p = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.
|
|
35487
|
+
const styleCss$p = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.name{padding-left:0.5em;flex-shrink:1;width:100%}:host([divider]){margin-bottom:0.5em}::slotted([slot=right]){font-style:italic;white-space:nowrap}:host([divider])::after{position:absolute;height:1px;width:100%;left:0;bottom:-0.25em;content:\"\";background-color:rgba(var(--smoothly-dark-color))}::slotted([slot=hint]){display:flex;align-items:center;gap:1ch;font-style:italic;white-space:nowrap}";
|
|
35483
35488
|
|
|
35484
35489
|
const SmoothlyOption$1 = class extends HTMLElement {
|
|
35485
35490
|
constructor() {
|
|
@@ -35488,23 +35493,30 @@ const SmoothlyOption$1 = class extends HTMLElement {
|
|
|
35488
35493
|
this.__attachShadow();
|
|
35489
35494
|
this.optionHover = createEvent(this, "optionHover", 7);
|
|
35490
35495
|
this.optionSelect = createEvent(this, "optionSelect", 7);
|
|
35496
|
+
this.optionUnselect = createEvent(this, "optionUnselect", 7);
|
|
35491
35497
|
this.optionAdd = createEvent(this, "optionAdd", 7);
|
|
35492
35498
|
this.dataHighlight = false;
|
|
35493
35499
|
this.divider = false;
|
|
35500
|
+
this.toggle = false;
|
|
35501
|
+
this.checked = false;
|
|
35494
35502
|
}
|
|
35495
35503
|
onHover(event) {
|
|
35496
35504
|
this.optionHover.emit({ name: this.name, value: this.value });
|
|
35497
35505
|
}
|
|
35498
35506
|
onSelect(event) {
|
|
35499
|
-
if (this.value)
|
|
35507
|
+
if (this.value) {
|
|
35500
35508
|
this.new
|
|
35501
35509
|
? this.optionAdd.emit({ name: this.name, value: this.value })
|
|
35502
|
-
: this.
|
|
35510
|
+
: !this.toggle || (this.toggle && !this.checked)
|
|
35511
|
+
? this.optionSelect.emit({ name: this.name, value: this.value })
|
|
35512
|
+
: this.optionUnselect.emit({ name: this.name, value: this.value });
|
|
35513
|
+
this.toggle && (this.checked = !this.checked);
|
|
35514
|
+
}
|
|
35503
35515
|
else
|
|
35504
35516
|
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
35505
35517
|
}
|
|
35506
35518
|
render() {
|
|
35507
|
-
return (h(Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) }, h("
|
|
35519
|
+
return (h(Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) }, this.toggle && h("smoothly-icon", { name: this.checked ? "checkbox" : "square-outline" }), h("div", { class: "name" }, this.name), h("smoothly-quiet", null, h("slot", { name: "hint" }))));
|
|
35508
35520
|
}
|
|
35509
35521
|
get element() { return this; }
|
|
35510
35522
|
static get style() { return styleCss$p; }
|
|
@@ -35522,6 +35534,7 @@ const SmoothlyPicker$1 = class extends HTMLElement {
|
|
|
35522
35534
|
this.keepFocusOnReRender = false;
|
|
35523
35535
|
this.disabled = false;
|
|
35524
35536
|
this.readonly = false;
|
|
35537
|
+
this.maxMenuHeight = "inherit";
|
|
35525
35538
|
this.emptyMenuLabel = "No Options";
|
|
35526
35539
|
this.multiple = false;
|
|
35527
35540
|
this.mutable = false;
|
|
@@ -35658,17 +35671,14 @@ const SmoothlyPicker$1 = class extends HTMLElement {
|
|
|
35658
35671
|
this.isOpen = false;
|
|
35659
35672
|
this.filterOptions();
|
|
35660
35673
|
}
|
|
35661
|
-
getCheckHtml(checked) {
|
|
35662
|
-
return checked ? (h("smoothly-icon", { name: "checkbox", size: "small" })) : (h("smoothly-icon", { name: "square-outline", size: "small" }));
|
|
35663
|
-
}
|
|
35664
35674
|
render() {
|
|
35665
|
-
var _a, _b, _c
|
|
35675
|
+
var _a, _b, _c;
|
|
35666
35676
|
const cssVariables = {
|
|
35667
35677
|
"--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
|
|
35668
35678
|
"--label-display": this.labelSetting == "hide" ? "none" : "absolute",
|
|
35669
35679
|
};
|
|
35670
35680
|
(_b = this.options) === null || _b === void 0 ? void 0 : _b.forEach(o => {
|
|
35671
|
-
o.
|
|
35681
|
+
o.checked = this.selections.map(s => s.value).includes(o.value);
|
|
35672
35682
|
});
|
|
35673
35683
|
const options = [
|
|
35674
35684
|
...(this.multiple
|
|
@@ -35676,16 +35686,16 @@ const SmoothlyPicker$1 = class extends HTMLElement {
|
|
|
35676
35686
|
{
|
|
35677
35687
|
value: "select-none",
|
|
35678
35688
|
name: this.selections.length == this.options.length ? this.selectNoneName : this.selectAllName,
|
|
35679
|
-
|
|
35689
|
+
checked: this.selections.length == this.options.length,
|
|
35680
35690
|
divider: true,
|
|
35681
35691
|
},
|
|
35682
35692
|
]
|
|
35683
35693
|
: []),
|
|
35684
|
-
...((
|
|
35694
|
+
...((_c = this.options) !== null && _c !== void 0 ? _c : []),
|
|
35685
35695
|
];
|
|
35686
35696
|
return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
|
|
35687
35697
|
? this.selections.length.toString() + " " + this.selectionName
|
|
35688
|
-
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
35698
|
+
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
35689
35699
|
}
|
|
35690
35700
|
get element() { return this; }
|
|
35691
35701
|
static get watchers() { return {
|
|
@@ -35940,11 +35950,11 @@ const SmoothlySelectDemo$1 = class extends HTMLElement {
|
|
|
35940
35950
|
} }),
|
|
35941
35951
|
h("smoothly-selector", null, h("smoothly-item", { value: "1" }, "January"), h("smoothly-item", { value: "2" }, "February"), h("smoothly-item", { value: "3" }, "March"), h("smoothly-item", { value: "4" }, "April"), h("smoothly-item", { value: "5" }, "May"), h("smoothly-item", { value: "6" }, "June"), h("smoothly-item", { value: "7" }, "July"), h("smoothly-item", { value: "8" }, "August"), h("smoothly-item", { value: "9" }, "September"), h("smoothly-item", { value: "10" }, "October"), h("smoothly-item", { value: "11" }, "November"), h("smoothly-item", { value: "12" }, "December")),
|
|
35942
35952
|
h("button", { onClick: () => this.alertf() }, "press here"),
|
|
35943
|
-
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
35953
|
+
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", maxMenuHeight: "20rem", multiple: true, options: [
|
|
35944
35954
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
35945
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
35955
|
+
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew" },
|
|
35946
35956
|
{ name: "Noble Pig", value: "pig" },
|
|
35947
|
-
{ name: "Turtle Wax", value: "turtle" },
|
|
35957
|
+
{ name: "Turtle Wax", value: "turtle", hint: "slow" },
|
|
35948
35958
|
{ name: "Spider Man", value: "spider" },
|
|
35949
35959
|
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
35950
35960
|
{ name: "Horse Back", value: "horse" },
|
|
@@ -35976,7 +35986,7 @@ const SmoothlySelectDemo$1 = class extends HTMLElement {
|
|
|
35976
35986
|
], valueValidator: (email) => email.match(/^\w+@\w+/) ? [true, undefined] : [false, Notice.failed("Incorrectly formatted email")] }),
|
|
35977
35987
|
h("br", null),
|
|
35978
35988
|
h("smoothly-picker", { label: "Single select", multiple: false, "max-menu-height": "200px", options: [
|
|
35979
|
-
{ name: "Dog", value: "dog", aliases: ["WOFF"],
|
|
35989
|
+
{ name: "Dog", value: "dog", aliases: ["WOFF"], hint: "Woof 🐶" },
|
|
35980
35990
|
{ name: "Cat", value: "cat", aliases: ["moew"] },
|
|
35981
35991
|
{ name: "Pig", value: "pig" },
|
|
35982
35992
|
{ name: "Turtle", value: "turtle" },
|
|
@@ -36592,11 +36602,11 @@ const SmoothlyInputDateRange = /*@__PURE__*/proxyCustomElement(InputDateRange, [
|
|
|
36592
36602
|
const SmoothlyInputDemo = /*@__PURE__*/proxyCustomElement(SmoothlyInputDemo$1, [0,"smoothly-input-demo"]);
|
|
36593
36603
|
const SmoothlyInputMonth = /*@__PURE__*/proxyCustomElement(MonthSelector, [2,"smoothly-input-month",{"value":[1025]}]);
|
|
36594
36604
|
const SmoothlyItem = /*@__PURE__*/proxyCustomElement(Item, [6,"smoothly-item",{"value":[8],"selected":[1540]},[[0,"click","onClick"]]]);
|
|
36595
|
-
const SmoothlyMenuOptions = /*@__PURE__*/proxyCustomElement(SmoothlyMenuOptions$1, [1,"smoothly-menu-options",{"emptyMenuLabel":[1025,"empty-menu-label"],"newOptionLabel":[1,"new-option-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"mutable":[4],"filteredOptions":[32],"highlightIndex":[32],"keyword":[32]},[[0,"optionHover","optionHoverHandler"]]]);
|
|
36605
|
+
const SmoothlyMenuOptions = /*@__PURE__*/proxyCustomElement(SmoothlyMenuOptions$1, [1,"smoothly-menu-options",{"toggle":[4],"emptyMenuLabel":[1025,"empty-menu-label"],"newOptionLabel":[1,"new-option-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"mutable":[4],"filteredOptions":[32],"highlightIndex":[32],"keyword":[32]},[[0,"optionHover","optionHoverHandler"]]]);
|
|
36596
36606
|
const SmoothlyNotification = /*@__PURE__*/proxyCustomElement(Notification, [2,"smoothly-notification",{"notice":[16],"tick":[32]},[[0,"trigger","onTrigger"]]]);
|
|
36597
36607
|
const SmoothlyNotifier = /*@__PURE__*/proxyCustomElement(Notifier, [6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]]);
|
|
36598
|
-
const SmoothlyOption = /*@__PURE__*/proxyCustomElement(SmoothlyOption$1, [1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537],"divider":[1540],"new":[4]}]);
|
|
36599
|
-
const SmoothlyPicker = /*@__PURE__*/proxyCustomElement(SmoothlyPicker$1, [1,"smoothly-picker",{"disabled":[516],"readonly":[516],"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"mutable":[4],"optionStyle":[8,"option-style"],"options":[
|
|
36608
|
+
const SmoothlyOption = /*@__PURE__*/proxyCustomElement(SmoothlyOption$1, [1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537],"divider":[1540],"checkbox":[4],"new":[4],"toggle":[4],"checked":[1028]}]);
|
|
36609
|
+
const SmoothlyPicker = /*@__PURE__*/proxyCustomElement(SmoothlyPicker$1, [1,"smoothly-picker",{"disabled":[516],"readonly":[516],"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"mutable":[4],"optionStyle":[8,"option-style"],"options":[1040],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"selectAllName":[1025,"select-all-name"],"selectionName":[1025,"selection-name"],"newOptionLabel":[1025,"new-option-label"],"valueValidator":[16],"isOpen":[32],"empty":[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionUnselect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]]);
|
|
36600
36610
|
const SmoothlyPopup = /*@__PURE__*/proxyCustomElement(SmoothlyPopup$1, [6,"smoothly-popup",{"visible":[1540],"direction":[1537],"cssVariables":[32]}]);
|
|
36601
36611
|
const SmoothlyQuiet = /*@__PURE__*/proxyCustomElement(SmoothlyQuiet$1, [6,"smoothly-quiet",{"color":[1]}]);
|
|
36602
36612
|
const SmoothlyRadio = /*@__PURE__*/proxyCustomElement(SmoothlyRadio$1, [6,"smoothly-radio",{"name":[1],"value":[1],"checked":[1540],"tabIndex":[2,"tab-index"]}]);
|
|
@@ -36606,7 +36616,7 @@ const SmoothlyRoom = /*@__PURE__*/proxyCustomElement(SmoothlyRoom$1, [4,"smoothl
|
|
|
36606
36616
|
const SmoothlySelect = /*@__PURE__*/proxyCustomElement(SmoothlySelect$1, [6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}]);
|
|
36607
36617
|
const SmoothlySelectDemo = /*@__PURE__*/proxyCustomElement(SmoothlySelectDemo$1, [2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]]);
|
|
36608
36618
|
const SmoothlySelector = /*@__PURE__*/proxyCustomElement(Selector, [6,"smoothly-selector",{"opened":[32],"selectedElement":[32],"missing":[32],"filter":[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]]);
|
|
36609
|
-
const SmoothlySkeleton = /*@__PURE__*/proxyCustomElement(SmoothlySkeleton$1, [2,"smoothly-skeleton",{"widths":[16],"width":[
|
|
36619
|
+
const SmoothlySkeleton = /*@__PURE__*/proxyCustomElement(SmoothlySkeleton$1, [2,"smoothly-skeleton",{"widths":[16],"width":[1025],"color":[1],"period":[2],"distance":[1],"align":[513]}]);
|
|
36610
36620
|
const SmoothlySpinner = /*@__PURE__*/proxyCustomElement(SmoothlySpinner$1, [2,"smoothly-spinner",{"active":[516],"size":[513]}]);
|
|
36611
36621
|
const SmoothlySubmit = /*@__PURE__*/proxyCustomElement(SmoothlySubmit$1, [6,"smoothly-submit",{"processing":[1540],"color":[513],"expand":[513],"fill":[513],"disabled":[516],"prevent":[4]},[[0,"click","handleSubmit"]]]);
|
|
36612
36622
|
const SmoothlySvg = /*@__PURE__*/proxyCustomElement(SmoothlySvg$1, [2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}]);
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["smoothly-google-font",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder",[[0,"smoothly-reorder"]]],["smoothly-svg",[[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}]]],["smoothly-trigger-sink",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-accordion_50",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[2,"smoothly-table-demo"],[0,"smoothly-display-demo"],[4,"smoothly-app",{"color":[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"link":[1],"download":[4]}],[4,"smoothly-room",{"label":[1],"icon":[1],"path":[1],"to":[1]}],[2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"open":[1028],"showLabel":[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[
|
|
13
|
+
return bootstrapLazy([["smoothly-google-font",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder",[[0,"smoothly-reorder"]]],["smoothly-svg",[[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}]]],["smoothly-trigger-sink",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-accordion_50",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[2,"smoothly-table-demo"],[0,"smoothly-display-demo"],[4,"smoothly-app",{"color":[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"link":[1],"download":[4]}],[4,"smoothly-room",{"label":[1],"icon":[1],"path":[1],"to":[1]}],[2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"open":[1028],"showLabel":[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[1,"smoothly-picker",{"disabled":[516],"readonly":[516],"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"mutable":[4],"optionStyle":[8,"option-style"],"options":[1040],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"selectAllName":[1025,"select-all-name"],"selectionName":[1025,"selection-name"],"newOptionLabel":[1025,"new-option-label"],"valueValidator":[16],"isOpen":[32],"empty":[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionUnselect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[6,"smoothly-dialog",{"color":[513],"open":[1540],"closable":[516],"header":[513]},[[0,"trigger","TriggerListener"]]],[2,"smoothly-backtotop",{"opacity":[1],"bottom":[1],"right":[1],"visible":[32]}],[2,"smoothly-checkbox",{"selectAll":[4,"select-all"],"size":[1],"intermediate":[1540],"selected":[1540],"disabled":[1540],"t":[32]}],[6,"smoothly-submit",{"processing":[1540],"color":[513],"expand":[513],"fill":[513],"disabled":[516],"prevent":[4],"submit":[64]},[[0,"click","handleSubmit"]]],[6,"smoothly-table-expandable-cell",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-table-expandable-row",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[0,"smoothly-urlencoded",{"data":[1]}],[6,"smoothly-accordion",{"value":[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]],[6,"smoothly-accordion-item",{"name":[1],"brand":[1],"open":[1540]}],[2,"smoothly-display",{"type":[1],"value":[8],"currency":[1],"country":[1],"format":[16]}],[2,"smoothly-display-amount",{"amount":[8],"currency":[1]}],[2,"smoothly-frame",{"url":[1],"name":[1],"origin":[1],"send":[64]}],[6,"smoothly-popup",{"visible":[1540],"direction":[1537],"cssVariables":[32]}],[6,"smoothly-radio",{"name":[1],"value":[1],"checked":[1540],"tabIndex":[2,"tab-index"]}],[6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}],[2,"smoothly-skeleton",{"widths":[16],"width":[1025],"color":[1],"period":[2],"distance":[1],"align":[513]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-cell"],[6,"smoothly-table-header",{"name":[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{"name":[513],"value":[1025],"open":[1028],"max":[1025],"min":[1025],"disabled":[1028]},[[0,"dateSet","dateSetHandler"]]],[1,"smoothly-menu-options",{"toggle":[4],"emptyMenuLabel":[1025,"empty-menu-label"],"newOptionLabel":[1,"new-option-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"mutable":[4],"filteredOptions":[32],"highlightIndex":[32],"keyword":[32],"moveHighlight":[64],"setHighlight":[64],"getHighlighted":[64],"filterOptions":[64]},[[0,"optionHover","optionHoverHandler"]]],[2,"smoothly-notification",{"notice":[16],"tick":[32]},[[0,"trigger","onTrigger"]]],[2,"smoothly-display-date-time",{"datetime":[1]}],[2,"smoothly-spinner",{"active":[516],"size":[513]}],[6,"smoothly-tab",{"label":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{"selectedElement":[32]},[[0,"expansionOpen","openChanged"]]],[0,"smoothly-tuple",{"tuple":[16]}],[1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537],"divider":[1540],"checkbox":[4],"new":[4],"toggle":[4],"checked":[1028]}],[2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"doubleInput":[516,"double-input"],"firstSelected":[32]}],[6,"smoothly-input",{"name":[513],"value":[1032],"type":[513],"required":[1540],"minLength":[1026,"min-length"],"showLabel":[516,"show-label"],"maxLength":[1026,"max-length"],"autocomplete":[1028],"pattern":[1040],"placeholder":[1025],"disabled":[1028],"readonly":[1028],"currency":[513],"initialValue":[32],"getFormData":[64],"setKeepFocusOnReRender":[64],"setSelectionRange":[64]}],[2,"smoothly-input-month",{"value":[1025]}],[6,"smoothly-quiet",{"color":[1]}],[6,"smoothly-selector",{"opened":[32],"selectedElement":[32],"missing":[32],"filter":[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]],[6,"smoothly-item",{"value":[8],"selected":[1540],"filter":[64]},[[0,"click","onClick"]]],[6,"smoothly-trigger",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"name":[1],"value":[8]},[[0,"click","onClick"]]],[2,"smoothly-icon",{"color":[513],"fill":[513],"name":[1],"size":[513],"toolTip":[1,"tool-tip"],"document":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -121,16 +121,16 @@ const SmoothlyAppDemo = class {
|
|
|
121
121
|
redirect("https://google.com");
|
|
122
122
|
} }, "External")), h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" }, h("h2", null, "Regex routing")), h("smoothly-room", { path: "old", label: "Old", to: "select" }), h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
|
|
123
123
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
124
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"],
|
|
125
|
-
{ name: "Noble Pig", value: "pig",
|
|
126
|
-
{ name: "Turtle Wax", value: "turtle"
|
|
127
|
-
{ name: "Spider Man", value: "spider"
|
|
128
|
-
{ name: "Phoenix Order Long Wooord", value: "phoenix"
|
|
129
|
-
{ name: "Horse Back", value: "horse"
|
|
130
|
-
{ name: "Unicorn Horn", value: "unicorn"
|
|
131
|
-
{ name: "Talking Parrot Parrot", value: "parrot"
|
|
132
|
-
{ name: "Hidden Dragon", value: "dragon"
|
|
133
|
-
{ name: "Scary Kraken", value: "kraken"
|
|
124
|
+
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
|
|
125
|
+
{ name: "Noble Pig", value: "pig", hint: "🐷" },
|
|
126
|
+
{ name: "Turtle Wax", value: "turtle" },
|
|
127
|
+
{ name: "Spider Man", value: "spider" },
|
|
128
|
+
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
129
|
+
{ name: "Horse Back", value: "horse" },
|
|
130
|
+
{ name: "Unicorn Horn", value: "unicorn" },
|
|
131
|
+
{ name: "Talking Parrot Parrot", value: "parrot" },
|
|
132
|
+
{ name: "Hidden Dragon", value: "dragon" },
|
|
133
|
+
{ name: "Scary Kraken", value: "kraken" },
|
|
134
134
|
] })), h("smoothly-trigger", { slot: "header", type: "link", name: "logout" }, h("smoothly-icon", { toolTip: "Log out", name: "log-out", size: "medium" }))));
|
|
135
135
|
}
|
|
136
136
|
};
|
|
@@ -33669,8 +33669,10 @@ const SmoothlyMenuOptions = class {
|
|
|
33669
33669
|
constructor(hostRef) {
|
|
33670
33670
|
registerInstance(this, hostRef);
|
|
33671
33671
|
this.menuEmpty = createEvent(this, "menuEmpty", 7);
|
|
33672
|
+
this.optionElements = [];
|
|
33672
33673
|
this.filteredOptions = [];
|
|
33673
33674
|
this.highlightIndex = 0;
|
|
33675
|
+
this.toggle = false;
|
|
33674
33676
|
this.emptyMenuLabel = "No Options";
|
|
33675
33677
|
this.newOptionLabel = "Add:";
|
|
33676
33678
|
this.order = false;
|
|
@@ -33678,7 +33680,7 @@ const SmoothlyMenuOptions = class {
|
|
|
33678
33680
|
this.resetHighlightOnOptionsChange = true;
|
|
33679
33681
|
this.mutable = false;
|
|
33680
33682
|
}
|
|
33681
|
-
optionsChangeHandler(
|
|
33683
|
+
optionsChangeHandler() {
|
|
33682
33684
|
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
33683
33685
|
}
|
|
33684
33686
|
optionHoverHandler(event) {
|
|
@@ -33760,7 +33762,10 @@ const SmoothlyMenuOptions = class {
|
|
|
33760
33762
|
}
|
|
33761
33763
|
}
|
|
33762
33764
|
render() {
|
|
33763
|
-
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle,
|
|
33765
|
+
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle, toggle: this.toggle, ref: el => {
|
|
33766
|
+
index == 0 && (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement);
|
|
33767
|
+
el && (this.optionElements[index] = el);
|
|
33768
|
+
}, checked: option.checked, value: option.value, name: option.name, divider: option.divider, "data-highlight": this.highlightIndex == index }, option.hint ? h("div", { slot: "hint" }, option.hint) : undefined)))) : this.mutable ? (h("smoothly-option", { style: this.optionStyle, value: this.keyword, name: this.keyword, "data-highlight": 0, new: true }, h("div", { slot: "left" }, h("smoothly-icon", { name: "square-outline", size: "small" }), " ", this.newOptionLabel))) : (h("div", null, this.emptyMenuLabel))));
|
|
33764
33769
|
}
|
|
33765
33770
|
get element() { return getElement(this); }
|
|
33766
33771
|
static get watchers() { return {
|
|
@@ -33851,30 +33856,37 @@ const Notifier = class {
|
|
|
33851
33856
|
};
|
|
33852
33857
|
Notifier.style = styleCss$l;
|
|
33853
33858
|
|
|
33854
|
-
const styleCss$k = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.
|
|
33859
|
+
const styleCss$k = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.name{padding-left:0.5em;flex-shrink:1;width:100%}:host([divider]){margin-bottom:0.5em}::slotted([slot=right]){font-style:italic;white-space:nowrap}:host([divider])::after{position:absolute;height:1px;width:100%;left:0;bottom:-0.25em;content:\"\";background-color:rgba(var(--smoothly-dark-color))}::slotted([slot=hint]){display:flex;align-items:center;gap:1ch;font-style:italic;white-space:nowrap}";
|
|
33855
33860
|
|
|
33856
33861
|
const SmoothlyOption = class {
|
|
33857
33862
|
constructor(hostRef) {
|
|
33858
33863
|
registerInstance(this, hostRef);
|
|
33859
33864
|
this.optionHover = createEvent(this, "optionHover", 7);
|
|
33860
33865
|
this.optionSelect = createEvent(this, "optionSelect", 7);
|
|
33866
|
+
this.optionUnselect = createEvent(this, "optionUnselect", 7);
|
|
33861
33867
|
this.optionAdd = createEvent(this, "optionAdd", 7);
|
|
33862
33868
|
this.dataHighlight = false;
|
|
33863
33869
|
this.divider = false;
|
|
33870
|
+
this.toggle = false;
|
|
33871
|
+
this.checked = false;
|
|
33864
33872
|
}
|
|
33865
33873
|
onHover(event) {
|
|
33866
33874
|
this.optionHover.emit({ name: this.name, value: this.value });
|
|
33867
33875
|
}
|
|
33868
33876
|
onSelect(event) {
|
|
33869
|
-
if (this.value)
|
|
33877
|
+
if (this.value) {
|
|
33870
33878
|
this.new
|
|
33871
33879
|
? this.optionAdd.emit({ name: this.name, value: this.value })
|
|
33872
|
-
: this.
|
|
33880
|
+
: !this.toggle || (this.toggle && !this.checked)
|
|
33881
|
+
? this.optionSelect.emit({ name: this.name, value: this.value })
|
|
33882
|
+
: this.optionUnselect.emit({ name: this.name, value: this.value });
|
|
33883
|
+
this.toggle && (this.checked = !this.checked);
|
|
33884
|
+
}
|
|
33873
33885
|
else
|
|
33874
33886
|
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
33875
33887
|
}
|
|
33876
33888
|
render() {
|
|
33877
|
-
return (h(Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) }, h("
|
|
33889
|
+
return (h(Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) }, this.toggle && h("smoothly-icon", { name: this.checked ? "checkbox" : "square-outline" }), h("div", { class: "name" }, this.name), h("smoothly-quiet", null, h("slot", { name: "hint" }))));
|
|
33878
33890
|
}
|
|
33879
33891
|
get element() { return getElement(this); }
|
|
33880
33892
|
};
|
|
@@ -33890,6 +33902,7 @@ const SmoothlyPicker = class {
|
|
|
33890
33902
|
this.keepFocusOnReRender = false;
|
|
33891
33903
|
this.disabled = false;
|
|
33892
33904
|
this.readonly = false;
|
|
33905
|
+
this.maxMenuHeight = "inherit";
|
|
33893
33906
|
this.emptyMenuLabel = "No Options";
|
|
33894
33907
|
this.multiple = false;
|
|
33895
33908
|
this.mutable = false;
|
|
@@ -34026,17 +34039,14 @@ const SmoothlyPicker = class {
|
|
|
34026
34039
|
this.isOpen = false;
|
|
34027
34040
|
this.filterOptions();
|
|
34028
34041
|
}
|
|
34029
|
-
getCheckHtml(checked) {
|
|
34030
|
-
return checked ? (h("smoothly-icon", { name: "checkbox", size: "small" })) : (h("smoothly-icon", { name: "square-outline", size: "small" }));
|
|
34031
|
-
}
|
|
34032
34042
|
render() {
|
|
34033
|
-
var _a, _b, _c
|
|
34043
|
+
var _a, _b, _c;
|
|
34034
34044
|
const cssVariables = {
|
|
34035
34045
|
"--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
|
|
34036
34046
|
"--label-display": this.labelSetting == "hide" ? "none" : "absolute",
|
|
34037
34047
|
};
|
|
34038
34048
|
(_b = this.options) === null || _b === void 0 ? void 0 : _b.forEach(o => {
|
|
34039
|
-
o.
|
|
34049
|
+
o.checked = this.selections.map(s => s.value).includes(o.value);
|
|
34040
34050
|
});
|
|
34041
34051
|
const options = [
|
|
34042
34052
|
...(this.multiple
|
|
@@ -34044,16 +34054,16 @@ const SmoothlyPicker = class {
|
|
|
34044
34054
|
{
|
|
34045
34055
|
value: "select-none",
|
|
34046
34056
|
name: this.selections.length == this.options.length ? this.selectNoneName : this.selectAllName,
|
|
34047
|
-
|
|
34057
|
+
checked: this.selections.length == this.options.length,
|
|
34048
34058
|
divider: true,
|
|
34049
34059
|
},
|
|
34050
34060
|
]
|
|
34051
34061
|
: []),
|
|
34052
|
-
...((
|
|
34062
|
+
...((_c = this.options) !== null && _c !== void 0 ? _c : []),
|
|
34053
34063
|
];
|
|
34054
34064
|
return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
|
|
34055
34065
|
? this.selections.length.toString() + " " + this.selectionName
|
|
34056
|
-
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
34066
|
+
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
34057
34067
|
}
|
|
34058
34068
|
get element() { return getElement(this); }
|
|
34059
34069
|
static get watchers() { return {
|
|
@@ -34191,11 +34201,11 @@ const SmoothlySelectDemo = class {
|
|
|
34191
34201
|
} }),
|
|
34192
34202
|
h("smoothly-selector", null, h("smoothly-item", { value: "1" }, "January"), h("smoothly-item", { value: "2" }, "February"), h("smoothly-item", { value: "3" }, "March"), h("smoothly-item", { value: "4" }, "April"), h("smoothly-item", { value: "5" }, "May"), h("smoothly-item", { value: "6" }, "June"), h("smoothly-item", { value: "7" }, "July"), h("smoothly-item", { value: "8" }, "August"), h("smoothly-item", { value: "9" }, "September"), h("smoothly-item", { value: "10" }, "October"), h("smoothly-item", { value: "11" }, "November"), h("smoothly-item", { value: "12" }, "December")),
|
|
34193
34203
|
h("button", { onClick: () => this.alertf() }, "press here"),
|
|
34194
|
-
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
34204
|
+
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", maxMenuHeight: "20rem", multiple: true, options: [
|
|
34195
34205
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
34196
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
34206
|
+
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew" },
|
|
34197
34207
|
{ name: "Noble Pig", value: "pig" },
|
|
34198
|
-
{ name: "Turtle Wax", value: "turtle" },
|
|
34208
|
+
{ name: "Turtle Wax", value: "turtle", hint: "slow" },
|
|
34199
34209
|
{ name: "Spider Man", value: "spider" },
|
|
34200
34210
|
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
34201
34211
|
{ name: "Horse Back", value: "horse" },
|
|
@@ -34227,7 +34237,7 @@ const SmoothlySelectDemo = class {
|
|
|
34227
34237
|
], valueValidator: (email) => email.match(/^\w+@\w+/) ? [true, undefined] : [false, Notice.failed("Incorrectly formatted email")] }),
|
|
34228
34238
|
h("br", null),
|
|
34229
34239
|
h("smoothly-picker", { label: "Single select", multiple: false, "max-menu-height": "200px", options: [
|
|
34230
|
-
{ name: "Dog", value: "dog", aliases: ["WOFF"],
|
|
34240
|
+
{ name: "Dog", value: "dog", aliases: ["WOFF"], hint: "Woof 🐶" },
|
|
34231
34241
|
{ name: "Cat", value: "cat", aliases: ["moew"] },
|
|
34232
34242
|
{ name: "Pig", value: "pig" },
|
|
34233
34243
|
{ name: "Turtle", value: "turtle" },
|