smoothly 0.2.10 → 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/{Notice-a540b9fb.js → index-2a011313.js} +380 -4
- package/dist/cjs/index.cjs.js +9 -372
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{smoothly-accordion_51.cjs.entry.js → smoothly-accordion_50.cjs.entry.js} +127 -135
- package/dist/cjs/smoothly-svg.cjs.entry.js +41 -0
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/App.js +9 -4
- package/dist/collection/components/app-demo/index.js +20 -10
- package/dist/collection/components/display-demo/index.js +16 -12
- package/dist/collection/components/input-date/index.js +18 -1
- package/dist/collection/components/input-demo/index.js +3 -1
- 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/room/index.js +7 -3
- package/dist/collection/components/select-demo/index.js +4 -4
- package/dist/collection/components/skeleton/index.js +1 -1
- package/dist/collection/components/submit/Data.js +12 -0
- package/dist/collection/components/submit/index.js +10 -4
- package/dist/collection/index.js +1 -1
- package/dist/collection/model/{OptionType.js → Option.js} +0 -0
- package/dist/custom-elements/index.js +75 -43
- package/dist/esm/{Notice-4d3fbaaf.js → index-1d438ba2.js} +380 -5
- package/dist/esm/index.js +2 -372
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{smoothly-accordion_51.entry.js → smoothly-accordion_50.entry.js} +127 -134
- package/dist/esm/smoothly-svg.entry.js +37 -0
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/p-71443887.entry.js +1 -0
- package/dist/smoothly/p-76e88859.js +1 -0
- package/dist/smoothly/p-8aefcb54.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/App.d.ts +1 -0
- package/dist/types/components/input-date/index.d.ts +1 -0
- 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/room/index.d.ts +1 -1
- package/dist/types/components/submit/Data.d.ts +7 -0
- package/dist/types/components/submit/index.d.ts +2 -3
- package/dist/types/components.d.ts +26 -14
- package/dist/types/index.d.ts +2 -2
- 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-d8a81a07.js +0 -1
- package/dist/smoothly/p-fbcf1356.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",
|
|
@@ -43,9 +43,13 @@ export class SmoothlyRoom {
|
|
|
43
43
|
"type": "string",
|
|
44
44
|
"mutable": false,
|
|
45
45
|
"complexType": {
|
|
46
|
-
"original": "string",
|
|
47
|
-
"resolved": "string",
|
|
48
|
-
"references": {
|
|
46
|
+
"original": "string | RegExp",
|
|
47
|
+
"resolved": "RegExp | string",
|
|
48
|
+
"references": {
|
|
49
|
+
"RegExp": {
|
|
50
|
+
"location": "global"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
49
53
|
},
|
|
50
54
|
"required": false,
|
|
51
55
|
"optional": false,
|
|
@@ -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" },
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var Data;
|
|
2
|
+
(function (Data) {
|
|
3
|
+
function set(data, [head, ...tail], value) {
|
|
4
|
+
const current = data[head];
|
|
5
|
+
return Object.assign(Object.assign({}, data), { [head]: !tail.length ? value : set(typeof current == "object" ? current : {}, tail, value) });
|
|
6
|
+
}
|
|
7
|
+
Data.set = set;
|
|
8
|
+
function deepen(data) {
|
|
9
|
+
return Object.entries(data).reduce((result, [name, value]) => set(result, name.split("."), value), {});
|
|
10
|
+
}
|
|
11
|
+
Data.deepen = deepen;
|
|
12
|
+
})(Data || (Data = {}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component, Event, h, Listen, Method, Prop } from "@stencil/core";
|
|
2
|
+
import { Data } from "./Data";
|
|
2
3
|
export class SmoothlySubmit {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.disabled = false;
|
|
@@ -26,7 +27,7 @@ export class SmoothlySubmit {
|
|
|
26
27
|
result[element.name] = element.value;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
this.submitEvent.emit(result);
|
|
30
|
+
this.submitEvent.emit(Data.deepen(result));
|
|
30
31
|
this.processing = false;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -182,9 +183,14 @@ export class SmoothlySubmit {
|
|
|
182
183
|
"text": ""
|
|
183
184
|
},
|
|
184
185
|
"complexType": {
|
|
185
|
-
"original": "
|
|
186
|
-
"resolved": "{ [
|
|
187
|
-
"references": {
|
|
186
|
+
"original": "Data",
|
|
187
|
+
"resolved": "{ [name: string]: string | Data; }",
|
|
188
|
+
"references": {
|
|
189
|
+
"Data": {
|
|
190
|
+
"location": "import",
|
|
191
|
+
"path": "./Data"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
188
194
|
}
|
|
189
195
|
}]; }
|
|
190
196
|
static get methods() { return {
|
package/dist/collection/index.js
CHANGED
|
File without changes
|