smoothly 0.2.8 → 0.2.11
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/{Trigger-cf376531.js → Trigger-3443997e.js} +92 -55
- package/dist/cjs/{Notice-839702d8.js → index-2a011313.js} +381 -5
- package/dist/cjs/{index-1c61bdd3.js → index-3efe2a41.js} +18 -11
- package/dist/cjs/index.cjs.js +11 -374
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{smoothly-accordion_51.cjs.entry.js → smoothly-accordion_50.cjs.entry.js} +522 -13123
- package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-reorder.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-svg.cjs.entry.js +41 -0
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -2
- package/dist/cjs/smoothly.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/App.js +9 -4
- package/dist/collection/components/app-demo/index.js +10 -0
- package/dist/collection/components/display/index.js +27 -2
- package/dist/collection/components/display-date-time/index.js +3 -0
- 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/room/index.js +7 -3
- 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/{demo → model}/Listenable.js +11 -6
- package/dist/custom-elements/index.js +566 -13090
- package/dist/esm/{Trigger-365408f0.js → Trigger-327e506e.js} +92 -55
- package/dist/esm/{Notice-608b552c.js → index-1d438ba2.js} +381 -6
- package/dist/esm/{index-a3737440.js → index-4d9efff8.js} +18 -11
- package/dist/esm/index.js +5 -375
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{smoothly-accordion_51.entry.js → smoothly-accordion_50.entry.js} +522 -13122
- package/dist/esm/smoothly-google-font.entry.js +1 -1
- package/dist/esm/smoothly-radio-group.entry.js +1 -1
- package/dist/esm/smoothly-reorder.entry.js +1 -1
- package/dist/esm/smoothly-svg.entry.js +37 -0
- package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
- package/dist/esm/smoothly-trigger-source.entry.js +2 -2
- package/dist/esm/smoothly.js +3 -3
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/p-191ee4b8.js +2 -0
- package/dist/smoothly/p-76e88859.js +1 -0
- package/dist/smoothly/{p-0215b4da.entry.js → p-7a5eda51.entry.js} +1 -1
- package/dist/smoothly/p-8aefcb54.entry.js +1 -0
- package/dist/smoothly/{p-eec1c703.entry.js → p-8e4e941e.entry.js} +1 -1
- package/dist/smoothly/{p-993534fa.entry.js → p-919ae3e8.entry.js} +1 -1
- package/dist/smoothly/p-956089d5.entry.js +1 -0
- package/dist/smoothly/{p-6f009ac9.entry.js → p-9bc77fba.entry.js} +1 -1
- package/dist/smoothly/p-b1c579b3.js +1 -0
- package/dist/smoothly/{p-8ae38136.entry.js → p-d5d4832d.entry.js} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/App.d.ts +1 -0
- package/dist/types/components/display/index.d.ts +2 -1
- package/dist/types/components/display-date-time/index.d.ts +3 -1
- package/dist/types/components/input-date/index.d.ts +1 -0
- 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 +153 -44
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model/Listenable.d.ts +10 -0
- package/package.json +14 -37
- package/dist/collection/demo/State.js +0 -40
- package/dist/smoothly/p-0cba3e3d.js +0 -1
- package/dist/smoothly/p-6ca0d36c.js +0 -1
- package/dist/smoothly/p-7a30d9b8.js +0 -1
- package/dist/smoothly/p-9d825b5a.entry.js +0 -1
- package/dist/types/demo/Listenable.d.ts +0 -6
- package/dist/types/demo/State.d.ts +0 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3efe2a41.js');
|
|
6
6
|
|
|
7
7
|
const styleCss = "smoothly-radio-group{display:flex;position:relative;color:none !important;background:none !important;margin:0.5em 0}smoothly-radio-group[hidden]{display:none}smoothly-radio-group[orientation=vertical] *:not(:first-of-type)>input[type=radio]~label{border-top:none}smoothly-radio-group:not([orientation=vertical]) *:not(:first-of-type)>input[type=radio]~label{border-left:none}smoothly-radio-group[orientation=vertical]{flex-direction:column}smoothly-radio-group[orientation=vertical] :first-of-type>input[type=radio]~label{border-radius:4px 4px 0 0}smoothly-radio-group[orientation=vertical] :last-of-type>input[type=radio]~label{border-radius:0 0 4px 4px}smoothly-radio-group:not([orientation=vertical]){flex-direction:row}smoothly-radio-group:not([orientation=vertical]) :first-of-type>input[type=radio]~label{border-radius:4px 0 0 4px}smoothly-radio-group:not([orientation=vertical]) :last-of-type>input[type=radio]~label{border-radius:0 4px 4px 0}";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3efe2a41.js');
|
|
6
6
|
|
|
7
7
|
const styleCss = "smoothly-reorder>*{cursor:move;transition:transform 0.3s}smoothly-reorder>*.dragging{transition:none;box-shadow:0 0 10px rgba(var(--smoothly-dark-color));z-index:1;user-select:none}";
|
|
8
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;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const Trigger = require('./Trigger-
|
|
5
|
+
const index = require('./index-3efe2a41.js');
|
|
6
|
+
const Trigger = require('./Trigger-3443997e.js');
|
|
7
7
|
require('./GoogleFont-6c4f0da1.js');
|
|
8
8
|
|
|
9
9
|
const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const Trigger = require('./Trigger-
|
|
5
|
+
const index = require('./index-3efe2a41.js');
|
|
6
|
+
const Trigger = require('./Trigger-3443997e.js');
|
|
7
7
|
require('./GoogleFont-6c4f0da1.js');
|
|
8
8
|
|
|
9
9
|
const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
|
package/dist/cjs/smoothly.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-3efe2a41.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('smoothly.cjs.js', document.baseURI).href));
|
|
@@ -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"]]],[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[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":[16],"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,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[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-quiet",{"color":[1]}],[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":[1],"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",{"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],"new":[4]}],[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-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,6 +25,15 @@ 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: [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Component, h, Prop } from "@stencil/core";
|
|
2
|
-
import { Language, Locale } from "isoly";
|
|
2
|
+
import { DateTime, Language, Locale } from "isoly";
|
|
3
3
|
import { format, get } from "tidily";
|
|
4
4
|
export class SmoothlyDisplay {
|
|
5
5
|
render() {
|
|
6
|
-
var _a;
|
|
6
|
+
var _a, _b;
|
|
7
7
|
let result;
|
|
8
8
|
const type = this.type;
|
|
9
9
|
switch (type) {
|
|
@@ -25,6 +25,11 @@ export class SmoothlyDisplay {
|
|
|
25
25
|
case "date":
|
|
26
26
|
result = (_a = get(this.type, getLocale())) === null || _a === void 0 ? void 0 : _a.toString(this.value);
|
|
27
27
|
break;
|
|
28
|
+
case "date-time":
|
|
29
|
+
result = this.format
|
|
30
|
+
? DateTime.localize(this.value, this.format, getLocale())
|
|
31
|
+
: (_b = get(this.type, getLocale())) === null || _b === void 0 ? void 0 : _b.toString(this.value);
|
|
32
|
+
break;
|
|
28
33
|
}
|
|
29
34
|
return result;
|
|
30
35
|
}
|
|
@@ -119,6 +124,26 @@ export class SmoothlyDisplay {
|
|
|
119
124
|
},
|
|
120
125
|
"attribute": "country",
|
|
121
126
|
"reflect": false
|
|
127
|
+
},
|
|
128
|
+
"format": {
|
|
129
|
+
"type": "unknown",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "DateTime.Format",
|
|
133
|
+
"resolved": "DateTimeFormatOptions | undefined",
|
|
134
|
+
"references": {
|
|
135
|
+
"DateTime": {
|
|
136
|
+
"location": "import",
|
|
137
|
+
"path": "isoly"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"required": false,
|
|
142
|
+
"optional": true,
|
|
143
|
+
"docs": {
|
|
144
|
+
"tags": [],
|
|
145
|
+
"text": ""
|
|
146
|
+
}
|
|
122
147
|
}
|
|
123
148
|
}; }
|
|
124
149
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Component, Prop } from "@stencil/core";
|
|
2
2
|
export class SmoothlyDisplayDateTime {
|
|
3
|
+
componentWillLoad() {
|
|
4
|
+
console.warn('Component <smoothly-display-date-time> is deprecated, use <smoothly-display type="date-time">.');
|
|
5
|
+
}
|
|
3
6
|
render() {
|
|
4
7
|
const datetime = this.datetime.split("T");
|
|
5
8
|
return [datetime[0], " ", datetime[1]];
|
|
@@ -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"),
|
|
@@ -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,
|
|
@@ -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
|
@@ -8,10 +8,15 @@ export class Listenable {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
_Listenable_listeners.set(this, {});
|
|
10
10
|
}
|
|
11
|
-
listen(
|
|
11
|
+
listen(property, listener) {
|
|
12
12
|
var _a, _b;
|
|
13
|
-
(_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[
|
|
14
|
-
listener(this[
|
|
13
|
+
(_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
|
|
14
|
+
listener(this[property]);
|
|
15
|
+
}
|
|
16
|
+
unlisten(property, listener) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
|
|
19
|
+
index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
|
|
15
20
|
}
|
|
16
21
|
static load(backend) {
|
|
17
22
|
const result = new Listenable();
|
|
@@ -21,10 +26,10 @@ export class Listenable {
|
|
|
21
26
|
get() {
|
|
22
27
|
return backend[property];
|
|
23
28
|
},
|
|
24
|
-
set(
|
|
29
|
+
set(value) {
|
|
25
30
|
var _a;
|
|
26
|
-
backend[property] =
|
|
27
|
-
(_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.forEach(
|
|
31
|
+
backend[property] = value;
|
|
32
|
+
(_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(value));
|
|
28
33
|
},
|
|
29
34
|
});
|
|
30
35
|
}
|