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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3efe2a41.js');
|
|
6
|
+
|
|
7
|
+
const styleCss = ".sc-smoothly-svg-h{display:block;min-width:var(--size-width);min-height:var(--size-height);background-color:rgb(var(--color))}object.sc-smoothly-svg{min-width:var(--size-width);min-height:var(--size-height);background-color:rgb(var(--color))}";
|
|
8
|
+
|
|
9
|
+
const SmoothlySvg = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.defaultSizes = {
|
|
13
|
+
large: { height: "50rem", width: "50rem" },
|
|
14
|
+
medium: { height: "30rem", width: "30rem" },
|
|
15
|
+
small: { height: "10rem", width: "10rem" },
|
|
16
|
+
tiny: { height: "5rem", width: "5rem" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const height = this.size
|
|
21
|
+
? typeof this.size == "object"
|
|
22
|
+
? this.size.height
|
|
23
|
+
: this.defaultSizes[this.size].height
|
|
24
|
+
: "10rem";
|
|
25
|
+
const width = this.size
|
|
26
|
+
? typeof this.size == "object"
|
|
27
|
+
? this.size.width
|
|
28
|
+
: this.defaultSizes[this.size].width
|
|
29
|
+
: "10rem";
|
|
30
|
+
return (index.h(index.Host, { style: {
|
|
31
|
+
"min-height": height,
|
|
32
|
+
"min-width": width,
|
|
33
|
+
"--size-height": height,
|
|
34
|
+
"--size-width": width,
|
|
35
|
+
"--color": this.color,
|
|
36
|
+
} }, index.h("object", { height: height, width: width, type: "image/svg+xml", data: this.url })));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
SmoothlySvg.style = styleCss;
|
|
40
|
+
|
|
41
|
+
exports.smoothly_svg = SmoothlySvg;
|
package/dist/cjs/smoothly.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["smoothly-google-font.cjs",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-
|
|
18
|
+
return index.bootstrapLazy([["smoothly-google-font.cjs",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-svg.cjs",[[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-accordion_50.cjs",[[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);
|
|
19
19
|
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { createRouter, href, Route } from "stencil-router-v2";
|
|
3
3
|
const Router = createRouter();
|
|
4
|
+
export function redirect(url) {
|
|
5
|
+
const destination = resolve(url);
|
|
6
|
+
destination ? Router.push(destination) : (window.location.href = url);
|
|
7
|
+
}
|
|
4
8
|
export const App = (attributes, nodes, utils) => {
|
|
5
9
|
var _a;
|
|
6
10
|
const emptyNode = Object.entries(nodes[0]).reduce((r, entry) => {
|
|
@@ -16,7 +20,7 @@ export const App = (attributes, nodes, utils) => {
|
|
|
16
20
|
function childToNode(child) {
|
|
17
21
|
return utils.map([emptyNode], c => (Object.assign(Object.assign({}, c), child)))[0];
|
|
18
22
|
}
|
|
19
|
-
const children = nodes.map(
|
|
23
|
+
const children = nodes.map(node => (Object.assign(Object.assign({}, nodeToChild(node)), { node })));
|
|
20
24
|
return (h("smoothly-app", null,
|
|
21
25
|
h("header", null,
|
|
22
26
|
h("h1", null,
|
|
@@ -25,7 +29,7 @@ export const App = (attributes, nodes, utils) => {
|
|
|
25
29
|
h("ul", null, utils
|
|
26
30
|
.map([
|
|
27
31
|
...children.filter(child => { var _a; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.slot) == "nav-start"; }),
|
|
28
|
-
...children.filter(child => { var _a, _b; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.label) && ((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path); }),
|
|
32
|
+
...children.filter(child => { var _a, _b, _c; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.label) && ((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path) && typeof ((_c = child.vattrs) === null || _c === void 0 ? void 0 : _c.path) == "string"; }),
|
|
29
33
|
...children.filter(child => { var _a; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.slot) == "nav-end"; }),
|
|
30
34
|
].map(child => child.node), child => {
|
|
31
35
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -59,8 +63,9 @@ export const App = (attributes, nodes, utils) => {
|
|
|
59
63
|
h(Router.Switch, null, children
|
|
60
64
|
.filter(child => { var _a; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.path) != undefined; })
|
|
61
65
|
.map(child => {
|
|
62
|
-
var _a, _b, _c, _d, _e
|
|
63
|
-
|
|
66
|
+
var _a, _b, _c, _d, _e;
|
|
67
|
+
const path = typeof ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.path) == "string" ? resolve((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path) : (_c = child.vattrs) === null || _c === void 0 ? void 0 : _c.path;
|
|
68
|
+
return ((_d = child.vattrs) === null || _d === void 0 ? void 0 : _d.to) ? (h(Route, { path: path, to: (_e = child.vattrs) === null || _e === void 0 ? void 0 : _e.to })) : (h(Route, { path: path }, child.node));
|
|
64
69
|
})))));
|
|
65
70
|
};
|
|
66
71
|
function resolve(url) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component, h, Prop } from "@stencil/core";
|
|
2
|
+
import { redirect } from "../../index";
|
|
2
3
|
import { App } from "../App";
|
|
3
4
|
export class SmoothlyAppDemo {
|
|
4
5
|
render() {
|
|
@@ -24,20 +25,29 @@ export class SmoothlyAppDemo {
|
|
|
24
25
|
h("smoothly-select-demo", null)),
|
|
25
26
|
h("smoothly-room", { path: "icon", label: "Icon" },
|
|
26
27
|
h("smoothly-icon-demo", null)),
|
|
28
|
+
h("smoothly-room", { path: "/redirect", label: "Redirect" },
|
|
29
|
+
h("smoothly-button", { style: { "max-width": "300px" }, onClick: () => {
|
|
30
|
+
redirect("/routing/pathParameter1");
|
|
31
|
+
} }, "Internal"),
|
|
32
|
+
h("smoothly-button", { style: { "max-width": "300px" }, onClick: () => {
|
|
33
|
+
redirect("https://google.com");
|
|
34
|
+
} }, "External")),
|
|
35
|
+
h("smoothly-room", { path: /^\/routing\/\w+\/?/, label: "No effect" },
|
|
36
|
+
h("h2", null, "Regex routing")),
|
|
27
37
|
h("smoothly-room", { path: "old", label: "Old", to: "select" }),
|
|
28
38
|
h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } },
|
|
29
39
|
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: [
|
|
30
40
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
31
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"],
|
|
32
|
-
{ name: "Noble Pig", value: "pig",
|
|
33
|
-
{ name: "Turtle Wax", value: "turtle"
|
|
34
|
-
{ name: "Spider Man", value: "spider"
|
|
35
|
-
{ name: "Phoenix Order Long Wooord", value: "phoenix"
|
|
36
|
-
{ name: "Horse Back", value: "horse"
|
|
37
|
-
{ name: "Unicorn Horn", value: "unicorn"
|
|
38
|
-
{ name: "Talking Parrot Parrot", value: "parrot"
|
|
39
|
-
{ name: "Hidden Dragon", value: "dragon"
|
|
40
|
-
{ name: "Scary Kraken", value: "kraken"
|
|
41
|
+
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], hint: "moew 🐈" },
|
|
42
|
+
{ name: "Noble Pig", value: "pig", hint: "🐷" },
|
|
43
|
+
{ name: "Turtle Wax", value: "turtle" },
|
|
44
|
+
{ name: "Spider Man", value: "spider" },
|
|
45
|
+
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
46
|
+
{ name: "Horse Back", value: "horse" },
|
|
47
|
+
{ name: "Unicorn Horn", value: "unicorn" },
|
|
48
|
+
{ name: "Talking Parrot Parrot", value: "parrot" },
|
|
49
|
+
{ name: "Hidden Dragon", value: "dragon" },
|
|
50
|
+
{ name: "Scary Kraken", value: "kraken" },
|
|
41
51
|
] })),
|
|
42
52
|
h("smoothly-trigger", { slot: "header", type: "link", name: "logout" },
|
|
43
53
|
h("smoothly-icon", { toolTip: "Log out", name: "log-out", size: "medium" }))));
|
|
@@ -46,6 +46,21 @@ export class SmoothlyDisplayDemo {
|
|
|
46
46
|
h("dt", null, "date"),
|
|
47
47
|
h("dd", null,
|
|
48
48
|
h("smoothly-display", { type: "date", value: "2022-07-07" })),
|
|
49
|
+
h("dt", null, "date time"),
|
|
50
|
+
h("dd", null,
|
|
51
|
+
h("smoothly-display", { type: "date-time", format: { year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }, value: "2022-07-07T02:02:02Z" })),
|
|
52
|
+
h("dd", null,
|
|
53
|
+
h("smoothly-display", { type: "date-time", format: { year: "2-digit", month: "long", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit" }, value: "2022-07-07T02:02:02Z" })),
|
|
54
|
+
h("dd", null,
|
|
55
|
+
h("smoothly-display", { type: "date-time", format: { year: "numeric", month: "2-digit", day: "2-digit", hour: "numeric", minute: "numeric", second: "numeric" }, value: "2022-07-07T12:22:24Z" })),
|
|
56
|
+
h("dd", null,
|
|
57
|
+
h("smoothly-display", { type: "date-time", format: { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }, value: "2022-07-07T12:22:24Z" })),
|
|
58
|
+
h("dd", null,
|
|
59
|
+
h("smoothly-display", { type: "date-time", format: { year: "numeric", month: "short", day: "numeric" }, value: "2022-07-07T00:00+02:00" })),
|
|
60
|
+
h("dd", null,
|
|
61
|
+
h("smoothly-display", { type: "date-time", format: { year: "2-digit", month: "numeric", day: "numeric" }, value: "2022-07-07T00:00+02:00" })),
|
|
62
|
+
h("dd", null,
|
|
63
|
+
h("smoothly-display", { type: "date-time", format: { year: "2-digit", month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZone: "+01:00" }, value: "2022-07-07T12:15Z" })),
|
|
49
64
|
h("dt", null, "Quiet"),
|
|
50
65
|
h("dd", null,
|
|
51
66
|
h("smoothly-quiet", { color: "dark" }, "-"))),
|
|
@@ -74,18 +89,7 @@ export class SmoothlyDisplayDemo {
|
|
|
74
89
|
h("button", { onClick: () => this.noticeWarning(Notice.succeded("This is a test success notice.")) }, "success"),
|
|
75
90
|
h("button", { onClick: () => this.noticeWarning(Notice.failed("This is a test danger notice.")) }, "danger"),
|
|
76
91
|
h("button", { onClick: () => this.noticeWarning(Notice.execute("This is a test execute notice.", () => new Promise(resolve => window.setTimeout(() => resolve([true, "This went great"]), 3000)))) }, "execute"),
|
|
77
|
-
h("button", { onClick: () => this.noticeWarning(Notice.delay("This is a test delay notice.", () => new Promise(resolve => window.setTimeout(() => resolve([true, "This went great"]), 3000)))) }, "delay"),
|
|
78
|
-
h("div", { style: { position: "relative", height: "10em" } },
|
|
79
|
-
"Large Spinner",
|
|
80
|
-
h("smoothly-spinner", { active: true, size: "large", style: { "--background-color": "255,255,255", "--background-opacity": "0.2", "--spinner-color": "0,130,0", } })),
|
|
81
|
-
h("div", { style: { position: "relative", height: "10em" } },
|
|
82
|
-
"Medium Spinner",
|
|
83
|
-
h("smoothly-spinner", { active: true, size: "medium" })),
|
|
84
|
-
h("div", { style: { position: "relative", height: "10em" } },
|
|
85
|
-
"Small Spinner",
|
|
86
|
-
h("smoothly-spinner", { active: true, size: "small" })),
|
|
87
|
-
h("div", { style: { position: "absolute", left: "500px", top: "150px" } },
|
|
88
|
-
h("smoothly-svg", { url: "https://theme.payfunc.com/intergiro/animated-logo.svg" }))),
|
|
92
|
+
h("button", { onClick: () => this.noticeWarning(Notice.delay("This is a test delay notice.", () => new Promise(resolve => window.setTimeout(() => resolve([true, "This went great"]), 3000)))) }, "delay")),
|
|
89
93
|
];
|
|
90
94
|
}
|
|
91
95
|
static get is() { return "smoothly-display-demo"; }
|
|
@@ -11,7 +11,7 @@ export class InputDate {
|
|
|
11
11
|
render() {
|
|
12
12
|
var _a;
|
|
13
13
|
return [
|
|
14
|
-
h("smoothly-input", { onClick: () => (this.open = !this.open), disabled: this.disabled, type: "date", value: this.value, onSmoothlyInput: e => (this.value = e.detail.value) },
|
|
14
|
+
h("smoothly-input", { name: this.name, onClick: () => (this.open = !this.open), disabled: this.disabled, type: "date", value: this.value, onSmoothlyInput: e => (this.value = e.detail.value) },
|
|
15
15
|
h("slot", null)),
|
|
16
16
|
this.open && !this.disabled
|
|
17
17
|
? [
|
|
@@ -35,6 +35,23 @@ export class InputDate {
|
|
|
35
35
|
"$": ["style.css"]
|
|
36
36
|
}; }
|
|
37
37
|
static get properties() { return {
|
|
38
|
+
"name": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"mutable": false,
|
|
41
|
+
"complexType": {
|
|
42
|
+
"original": "string",
|
|
43
|
+
"resolved": "string",
|
|
44
|
+
"references": {}
|
|
45
|
+
},
|
|
46
|
+
"required": false,
|
|
47
|
+
"optional": false,
|
|
48
|
+
"docs": {
|
|
49
|
+
"tags": [],
|
|
50
|
+
"text": ""
|
|
51
|
+
},
|
|
52
|
+
"attribute": "name",
|
|
53
|
+
"reflect": true
|
|
54
|
+
},
|
|
38
55
|
"value": {
|
|
39
56
|
"type": "string",
|
|
40
57
|
"mutable": true,
|
|
@@ -7,7 +7,9 @@ export class SmoothlyInputDemo {
|
|
|
7
7
|
h("h5", null, "Address")),
|
|
8
8
|
h("main", null,
|
|
9
9
|
h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"),
|
|
10
|
-
h("smoothly-input", { type: "text", name: "name", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
|
|
10
|
+
h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
|
|
11
|
+
h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
|
|
12
|
+
h("smoothly-input-date", null),
|
|
11
13
|
h("smoothly-input", { type: "date", name: "date" }, "Date"),
|
|
12
14
|
h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"),
|
|
13
15
|
h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"),
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from "@stencil/core";
|
|
2
2
|
export class SmoothlyMenuOptions {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.optionElements = [];
|
|
4
5
|
this.filteredOptions = [];
|
|
5
6
|
this.highlightIndex = 0;
|
|
7
|
+
this.toggle = false;
|
|
6
8
|
this.emptyMenuLabel = "No Options";
|
|
7
9
|
this.newOptionLabel = "Add:";
|
|
8
10
|
this.order = false;
|
|
@@ -10,7 +12,7 @@ export class SmoothlyMenuOptions {
|
|
|
10
12
|
this.resetHighlightOnOptionsChange = true;
|
|
11
13
|
this.mutable = false;
|
|
12
14
|
}
|
|
13
|
-
optionsChangeHandler(
|
|
15
|
+
optionsChangeHandler() {
|
|
14
16
|
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
15
17
|
}
|
|
16
18
|
optionHoverHandler(event) {
|
|
@@ -92,9 +94,10 @@ export class SmoothlyMenuOptions {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
render() {
|
|
95
|
-
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle,
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
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 => {
|
|
98
|
+
index == 0 && (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement);
|
|
99
|
+
el && (this.optionElements[index] = el);
|
|
100
|
+
}, 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 },
|
|
98
101
|
h("div", { slot: "left" },
|
|
99
102
|
h("smoothly-icon", { name: "square-outline", size: "small" }),
|
|
100
103
|
" ",
|
|
@@ -109,6 +112,24 @@ export class SmoothlyMenuOptions {
|
|
|
109
112
|
"$": ["style.css"]
|
|
110
113
|
}; }
|
|
111
114
|
static get properties() { return {
|
|
115
|
+
"toggle": {
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "boolean",
|
|
120
|
+
"resolved": "boolean",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
},
|
|
129
|
+
"attribute": "toggle",
|
|
130
|
+
"reflect": false,
|
|
131
|
+
"defaultValue": "false"
|
|
132
|
+
},
|
|
112
133
|
"emptyMenuLabel": {
|
|
113
134
|
"type": "string",
|
|
114
135
|
"mutable": true,
|
|
@@ -201,10 +222,10 @@ export class SmoothlyMenuOptions {
|
|
|
201
222
|
"type": "unknown",
|
|
202
223
|
"mutable": true,
|
|
203
224
|
"complexType": {
|
|
204
|
-
"original": "
|
|
205
|
-
"resolved": "
|
|
225
|
+
"original": "Option[]",
|
|
226
|
+
"resolved": "Option[]",
|
|
206
227
|
"references": {
|
|
207
|
-
"
|
|
228
|
+
"Option": {
|
|
208
229
|
"location": "import",
|
|
209
230
|
"path": "../../model"
|
|
210
231
|
}
|
|
@@ -320,18 +341,18 @@ export class SmoothlyMenuOptions {
|
|
|
320
341
|
},
|
|
321
342
|
"getHighlighted": {
|
|
322
343
|
"complexType": {
|
|
323
|
-
"signature": "() => Promise<
|
|
344
|
+
"signature": "() => Promise<Option | undefined>",
|
|
324
345
|
"parameters": [],
|
|
325
346
|
"references": {
|
|
326
347
|
"Promise": {
|
|
327
348
|
"location": "global"
|
|
328
349
|
},
|
|
329
|
-
"
|
|
350
|
+
"Option": {
|
|
330
351
|
"location": "import",
|
|
331
352
|
"path": "../../model"
|
|
332
353
|
}
|
|
333
354
|
},
|
|
334
|
-
"return": "Promise<
|
|
355
|
+
"return": "Promise<Option | undefined>"
|
|
335
356
|
},
|
|
336
357
|
"docs": {
|
|
337
358
|
"text": "",
|
|
@@ -3,28 +3,35 @@ export class SmoothlyOption {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
this.dataHighlight = false;
|
|
5
5
|
this.divider = false;
|
|
6
|
+
this.toggle = false;
|
|
7
|
+
this.checked = false;
|
|
6
8
|
}
|
|
7
9
|
onHover(event) {
|
|
8
10
|
this.optionHover.emit({ name: this.name, value: this.value });
|
|
9
11
|
}
|
|
10
12
|
onSelect(event) {
|
|
11
|
-
if (this.value)
|
|
13
|
+
if (this.value) {
|
|
12
14
|
this.new
|
|
13
15
|
? this.optionAdd.emit({ name: this.name, value: this.value })
|
|
14
|
-
: this.
|
|
16
|
+
: !this.toggle || (this.toggle && !this.checked)
|
|
17
|
+
? this.optionSelect.emit({ name: this.name, value: this.value })
|
|
18
|
+
: this.optionUnselect.emit({ name: this.name, value: this.value });
|
|
19
|
+
this.toggle && (this.checked = !this.checked);
|
|
20
|
+
}
|
|
15
21
|
else
|
|
16
22
|
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
17
23
|
}
|
|
18
24
|
render() {
|
|
19
25
|
return (h(Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) },
|
|
20
|
-
h("
|
|
21
|
-
h("div", { class: "
|
|
22
|
-
h("
|
|
26
|
+
this.toggle && h("smoothly-icon", { name: this.checked ? "checkbox" : "square-outline" }),
|
|
27
|
+
h("div", { class: "name" }, this.name),
|
|
28
|
+
h("smoothly-quiet", null,
|
|
29
|
+
h("slot", { name: "hint" }))));
|
|
23
30
|
}
|
|
24
31
|
static get is() { return "smoothly-option"; }
|
|
25
32
|
static get encapsulation() { return "shadow"; }
|
|
26
33
|
static get originalStyleUrls() { return {
|
|
27
|
-
"$": ["style.
|
|
34
|
+
"$": ["style.css"]
|
|
28
35
|
}; }
|
|
29
36
|
static get styleUrls() { return {
|
|
30
37
|
"$": ["style.css"]
|
|
@@ -117,6 +124,23 @@ export class SmoothlyOption {
|
|
|
117
124
|
"reflect": true,
|
|
118
125
|
"defaultValue": "false"
|
|
119
126
|
},
|
|
127
|
+
"checkbox": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "boolean",
|
|
132
|
+
"resolved": "boolean",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": ""
|
|
140
|
+
},
|
|
141
|
+
"attribute": "checkbox",
|
|
142
|
+
"reflect": false
|
|
143
|
+
},
|
|
120
144
|
"new": {
|
|
121
145
|
"type": "boolean",
|
|
122
146
|
"mutable": false,
|
|
@@ -133,6 +157,42 @@ export class SmoothlyOption {
|
|
|
133
157
|
},
|
|
134
158
|
"attribute": "new",
|
|
135
159
|
"reflect": false
|
|
160
|
+
},
|
|
161
|
+
"toggle": {
|
|
162
|
+
"type": "boolean",
|
|
163
|
+
"mutable": false,
|
|
164
|
+
"complexType": {
|
|
165
|
+
"original": "boolean",
|
|
166
|
+
"resolved": "boolean",
|
|
167
|
+
"references": {}
|
|
168
|
+
},
|
|
169
|
+
"required": false,
|
|
170
|
+
"optional": false,
|
|
171
|
+
"docs": {
|
|
172
|
+
"tags": [],
|
|
173
|
+
"text": ""
|
|
174
|
+
},
|
|
175
|
+
"attribute": "toggle",
|
|
176
|
+
"reflect": false,
|
|
177
|
+
"defaultValue": "false"
|
|
178
|
+
},
|
|
179
|
+
"checked": {
|
|
180
|
+
"type": "boolean",
|
|
181
|
+
"mutable": true,
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "boolean",
|
|
184
|
+
"resolved": "boolean",
|
|
185
|
+
"references": {}
|
|
186
|
+
},
|
|
187
|
+
"required": false,
|
|
188
|
+
"optional": false,
|
|
189
|
+
"docs": {
|
|
190
|
+
"tags": [],
|
|
191
|
+
"text": ""
|
|
192
|
+
},
|
|
193
|
+
"attribute": "checked",
|
|
194
|
+
"reflect": false,
|
|
195
|
+
"defaultValue": "false"
|
|
136
196
|
}
|
|
137
197
|
}; }
|
|
138
198
|
static get events() { return [{
|
|
@@ -165,6 +225,21 @@ export class SmoothlyOption {
|
|
|
165
225
|
"resolved": "{ value: any; name: string; }",
|
|
166
226
|
"references": {}
|
|
167
227
|
}
|
|
228
|
+
}, {
|
|
229
|
+
"method": "optionUnselect",
|
|
230
|
+
"name": "optionUnselect",
|
|
231
|
+
"bubbles": true,
|
|
232
|
+
"cancelable": true,
|
|
233
|
+
"composed": true,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": ""
|
|
237
|
+
},
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "{ value: any; name: string }",
|
|
240
|
+
"resolved": "{ value: any; name: string; }",
|
|
241
|
+
"references": {}
|
|
242
|
+
}
|
|
168
243
|
}, {
|
|
169
244
|
"method": "optionAdd",
|
|
170
245
|
"name": "optionAdd",
|
|
@@ -1,46 +1,42 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: flex-start;
|
|
6
|
+
padding: 0.7em 1em;
|
|
7
|
+
margin-left: 1px;
|
|
8
|
+
margin-right: 1px;
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
position: relative;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
:host([data-highlight]) {
|
|
14
|
-
|
|
13
|
+
background-color: rgb(var(--smoothly-default-shade));
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
width: 100%;
|
|
15
|
+
:host > div.name {
|
|
16
|
+
padding-left: 0.5em;
|
|
17
|
+
flex-shrink: 1;
|
|
18
|
+
width: 100%;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
:host([divider]) {
|
|
24
|
-
|
|
21
|
+
margin-bottom: 0.5em;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
::slotted([slot=right]) {
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
font-style: italic;
|
|
25
|
+
white-space: nowrap;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
:host([divider])::after {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
position: absolute;
|
|
29
|
+
height: 1px;
|
|
30
|
+
width: 100%;
|
|
31
|
+
left: 0;
|
|
32
|
+
bottom: -0.25em;
|
|
33
|
+
content: "";
|
|
34
|
+
background-color: rgba(var(--smoothly-dark-color));
|
|
35
|
+
}
|
|
36
|
+
::slotted([slot=hint]) {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 1ch;
|
|
40
|
+
font-style: italic;
|
|
41
|
+
white-space: nowrap;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
::slotted([slot=left]) {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
gap: 1ch;
|
|
46
|
-
}
|