smoothly 0.3.2 → 0.3.3
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_52.cjs.entry.js → smoothly-accordion_53.cjs.entry.js} +119 -81
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/display-demo/index.js +18 -1
- package/dist/collection/components/input-demo/index.js +80 -49
- package/dist/collection/components/radio-button/index.js +64 -8
- package/dist/collection/components/radio-button/item/index.js +6 -27
- package/dist/collection/components/radio-button/item/style.css +48 -30
- package/dist/custom-elements/index.js +17 -14
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{smoothly-accordion_52.entry.js → smoothly-accordion_53.entry.js} +119 -82
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/{p-ed84bc93.entry.js → p-e82a3604.entry.js} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/radio-button/index.d.ts +4 -0
- package/dist/types/components/radio-button/item/index.d.ts +1 -2
- package/dist/types/components.d.ts +10 -3
- package/package.json +1 -1
- package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
- package/dist/esm/smoothly-svg.entry.js +0 -37
- package/dist/smoothly/p-8aefcb54.entry.js +0 -1
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-
|
|
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-accordion_53.cjs",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[0,"smoothly-display-demo"],[2,"smoothly-table-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-radio-button-item",{"value":[8],"selected":[1540]}],[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],"toInteger":[4,"to-integer"]}],[2,"smoothly-display-date-time",{"datetime":[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-radio-button",{"value":[1032],"deselectable":[516],"decoration":[513]},[[2,"radioItemSelectInternal","radioSelectHandler"]]],[6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}],[2,"smoothly-skeleton",{"widths":[16],"width":[1025],"color":[1],"period":[2],"distance":[1],"align":[513]}],[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}],[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"]]],[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-spinner",{"active":[516],"size":[513]}],[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
|
});
|
|
@@ -70,6 +70,12 @@ export class SmoothlyDisplayDemo {
|
|
|
70
70
|
h("smoothly-display", { type: "date-time", format: { year: "2-digit", month: "numeric", day: "numeric" }, value: "2022-07-07T00:00+02:00" })),
|
|
71
71
|
h("dd", null,
|
|
72
72
|
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" })),
|
|
73
|
+
h("dt", null, "Deprecated display date time"),
|
|
74
|
+
h("dd", null,
|
|
75
|
+
h("smoothly-display-date-time", { datetime: "2019-01-31T20:01:34" })),
|
|
76
|
+
h("dt", null, "Display amount"),
|
|
77
|
+
h("dd", null,
|
|
78
|
+
h("smoothly-display-amount", { currency: "SEK", amount: "1289.5" })),
|
|
73
79
|
h("dt", null, "Quiet"),
|
|
74
80
|
h("dd", null,
|
|
75
81
|
h("smoothly-quiet", { color: "dark" }, "-"))),
|
|
@@ -98,7 +104,18 @@ export class SmoothlyDisplayDemo {
|
|
|
98
104
|
h("button", { onClick: () => this.noticeWarning(Notice.succeded("This is a test success notice.")) }, "success"),
|
|
99
105
|
h("button", { onClick: () => this.noticeWarning(Notice.failed("This is a test danger notice.")) }, "danger"),
|
|
100
106
|
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"),
|
|
101
|
-
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")
|
|
107
|
+
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"),
|
|
108
|
+
h("div", { style: { position: "relative", height: "10em" } },
|
|
109
|
+
"Large Spinner",
|
|
110
|
+
h("smoothly-spinner", { active: true, size: "large", style: { "--background-color": "255,255,255", "--background-opacity": "0.2", "--spinner-color": "0,130,0", } })),
|
|
111
|
+
h("div", { style: { position: "relative", height: "10em" } },
|
|
112
|
+
"Medium Spinner",
|
|
113
|
+
h("smoothly-spinner", { active: true, size: "medium" })),
|
|
114
|
+
h("div", { style: { position: "relative", height: "10em" } },
|
|
115
|
+
"Small Spinner",
|
|
116
|
+
h("smoothly-spinner", { active: true, size: "small" })),
|
|
117
|
+
h("div", { style: { position: "absolute", left: "500px", top: "150px" } },
|
|
118
|
+
h("smoothly-svg", { url: "https://theme.payfunc.com/intergiro/animated-logo.svg" }))),
|
|
102
119
|
];
|
|
103
120
|
}
|
|
104
121
|
static get is() { return "smoothly-display-demo"; }
|
|
@@ -4,56 +4,87 @@ export class SmoothlyInputDemo {
|
|
|
4
4
|
return [
|
|
5
5
|
h("form", { action: "done", style: { position: "relative" } },
|
|
6
6
|
h("header", null,
|
|
7
|
-
h("h5", null, "
|
|
7
|
+
h("h5", null, "Form")),
|
|
8
8
|
h("main", null,
|
|
9
|
-
h("
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
h("smoothly-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
h("smoothly-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
h("smoothly-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
h("
|
|
33
|
-
h("
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
h("smoothly-radio", {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
h("smoothly-radio", {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
9
|
+
h("fieldset", null,
|
|
10
|
+
h("h2", null, "Smoothly Iput"),
|
|
11
|
+
h("h3", null, "Card"),
|
|
12
|
+
h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"),
|
|
13
|
+
h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
|
|
14
|
+
h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
|
|
15
|
+
h("smoothly-input-date", null),
|
|
16
|
+
h("smoothly-input", { type: "date", name: "date" }, "Date"),
|
|
17
|
+
h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"),
|
|
18
|
+
h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"),
|
|
19
|
+
h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"),
|
|
20
|
+
h("smoothly-input", { type: "card-number", name: "card" }, "Card #"),
|
|
21
|
+
h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"),
|
|
22
|
+
h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"),
|
|
23
|
+
h("h3", null, "Contact"),
|
|
24
|
+
h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"),
|
|
25
|
+
h("smoothly-input", { type: "text", name: "testing" }, "Texttest"),
|
|
26
|
+
h("smoothly-input", { type: "password", name: "password" }, "Password"),
|
|
27
|
+
h("smoothly-input", { type: "email", name: "email" }, "Email"),
|
|
28
|
+
h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"),
|
|
29
|
+
h("smoothly-input", { type: "percent", name: "percent" }, "Percent"),
|
|
30
|
+
h("smoothly-input", { type: "phone", name: "phone" }, "Phone"),
|
|
31
|
+
h("smoothly-input-date", null, "Date")),
|
|
32
|
+
h("fieldset", null,
|
|
33
|
+
h("h2", null, "Smoothly Radio"),
|
|
34
|
+
h("h3", null, "Deselectable Radio List with button"),
|
|
35
|
+
h("smoothly-radio-button", { deselectable: true, decoration: "button" },
|
|
36
|
+
h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" } },
|
|
37
|
+
h("span", null, "Option 1"),
|
|
38
|
+
h("span", { slot: "expansion" }, "Some description.")),
|
|
39
|
+
h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } },
|
|
40
|
+
h("span", null, "Option 2"),
|
|
41
|
+
h("span", { slot: "expansion" }, "Some other description.")),
|
|
42
|
+
h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } },
|
|
43
|
+
h("span", null, "Option 3"))),
|
|
44
|
+
h("h3", null, "Radio List with button"),
|
|
45
|
+
h("smoothly-radio-button", { decoration: "button" },
|
|
46
|
+
h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" } },
|
|
47
|
+
h("span", null, "Option 1"),
|
|
48
|
+
h("span", { slot: "expansion" }, "Some description.")),
|
|
49
|
+
h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } },
|
|
50
|
+
h("span", null, "Option 2"),
|
|
51
|
+
h("span", { slot: "expansion" }, "Some other description.")),
|
|
52
|
+
h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } },
|
|
53
|
+
h("span", null, "Option 3"))),
|
|
54
|
+
h("h3", null, "Radio List without button"),
|
|
55
|
+
h("smoothly-radio-button", null,
|
|
56
|
+
h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" } },
|
|
57
|
+
h("span", null, "Option 1"),
|
|
58
|
+
h("span", { slot: "expansion" }, "Some description.")),
|
|
59
|
+
h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } },
|
|
60
|
+
h("span", null, "Option 2"),
|
|
61
|
+
h("span", { slot: "expansion" }, "Some other description.")),
|
|
62
|
+
h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } },
|
|
63
|
+
h("span", null, "Option 3"))),
|
|
64
|
+
h("smoothly-radio", { name: "option", value: "1" }, "option 1"),
|
|
65
|
+
h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"),
|
|
66
|
+
h("smoothly-radio", { name: "option", value: "3" }, "option 3")),
|
|
67
|
+
h("fieldset", null,
|
|
68
|
+
h("h2", null, "Smoothly Accordion"),
|
|
69
|
+
h("smoothly-accordion", null,
|
|
70
|
+
h("smoothly-accordion-item", { name: "A", open: true },
|
|
71
|
+
h("smoothly-radio", { name: "a", value: "1" }, "a 1"),
|
|
72
|
+
h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"),
|
|
73
|
+
h("smoothly-radio", { name: "a", value: "3" }, "a 3")),
|
|
74
|
+
h("smoothly-accordion-item", { name: "B" },
|
|
75
|
+
h("smoothly-radio", { name: "b", value: "1" }, "b 1"),
|
|
76
|
+
h("smoothly-radio", { name: "b", value: "2" }, "b 2"),
|
|
77
|
+
h("smoothly-radio", { name: "b", value: "3" }, "b 3")))),
|
|
78
|
+
h("fieldset", null,
|
|
79
|
+
h("h2", null, "Smoothly checkbox"),
|
|
80
|
+
h("smoothly-checkbox", { selectAll: true, intermediate: true }),
|
|
81
|
+
h("smoothly-checkbox", null),
|
|
82
|
+
h("smoothly-checkbox", { disabled: true })),
|
|
83
|
+
h("fieldset", null,
|
|
84
|
+
h("h2", null, "Smoothly addresses"),
|
|
85
|
+
h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }),
|
|
86
|
+
h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }),
|
|
87
|
+
h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))),
|
|
57
88
|
h("footer", null,
|
|
58
89
|
h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"),
|
|
59
90
|
h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { Component, h, Host, Listen, Prop } from "@stencil/core";
|
|
1
|
+
import { Component, Event, h, Host, Listen, Prop } from "@stencil/core";
|
|
2
2
|
export class SmoothlyRadioButton {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.decoration = "radio";
|
|
5
|
+
}
|
|
3
6
|
radioSelectHandler(event) {
|
|
4
|
-
var _a;
|
|
5
|
-
(_a = this.active) === null || _a === void 0 ? void 0 : _a.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var _a, _b;
|
|
8
|
+
if (this.deselectable || ((_a = this.active) === null || _a === void 0 ? void 0 : _a.value) != event.detail.value) {
|
|
9
|
+
(_b = this.active) === null || _b === void 0 ? void 0 : _b.select(false);
|
|
10
|
+
this.active = event.detail;
|
|
11
|
+
this.radioButtonSelected.emit((this.value = this.active.selected ? event.detail.value : undefined));
|
|
12
|
+
this.active.select(this.active.selected);
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
15
|
render() {
|
|
11
16
|
return (h(Host, null,
|
|
@@ -36,13 +41,64 @@ export class SmoothlyRadioButton {
|
|
|
36
41
|
},
|
|
37
42
|
"attribute": "value",
|
|
38
43
|
"reflect": false
|
|
44
|
+
},
|
|
45
|
+
"deselectable": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "boolean",
|
|
50
|
+
"resolved": "boolean | undefined",
|
|
51
|
+
"references": {}
|
|
52
|
+
},
|
|
53
|
+
"required": false,
|
|
54
|
+
"optional": true,
|
|
55
|
+
"docs": {
|
|
56
|
+
"tags": [],
|
|
57
|
+
"text": ""
|
|
58
|
+
},
|
|
59
|
+
"attribute": "deselectable",
|
|
60
|
+
"reflect": true
|
|
61
|
+
},
|
|
62
|
+
"decoration": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"mutable": false,
|
|
65
|
+
"complexType": {
|
|
66
|
+
"original": "\"button\" | \"radio\"",
|
|
67
|
+
"resolved": "\"button\" | \"radio\"",
|
|
68
|
+
"references": {}
|
|
69
|
+
},
|
|
70
|
+
"required": false,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": ""
|
|
75
|
+
},
|
|
76
|
+
"attribute": "decoration",
|
|
77
|
+
"reflect": true,
|
|
78
|
+
"defaultValue": "\"radio\""
|
|
39
79
|
}
|
|
40
80
|
}; }
|
|
81
|
+
static get events() { return [{
|
|
82
|
+
"method": "radioButtonSelected",
|
|
83
|
+
"name": "radioButtonSelected",
|
|
84
|
+
"bubbles": true,
|
|
85
|
+
"cancelable": true,
|
|
86
|
+
"composed": true,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": ""
|
|
90
|
+
},
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "any",
|
|
93
|
+
"resolved": "any",
|
|
94
|
+
"references": {}
|
|
95
|
+
}
|
|
96
|
+
}]; }
|
|
41
97
|
static get listeners() { return [{
|
|
42
|
-
"name": "
|
|
98
|
+
"name": "radioItemSelectInternal",
|
|
43
99
|
"method": "radioSelectHandler",
|
|
44
100
|
"target": undefined,
|
|
45
|
-
"capture":
|
|
101
|
+
"capture": true,
|
|
46
102
|
"passive": false
|
|
47
103
|
}]; }
|
|
48
104
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Component, Event, h, Host, Prop } from "@stencil/core";
|
|
2
2
|
export class SmoothlyRadioButtonItem {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.expansion = false;
|
|
5
|
-
}
|
|
6
3
|
componentWillLoad() {
|
|
7
4
|
this.select(this.selected);
|
|
8
5
|
}
|
|
9
6
|
select(selected = false) {
|
|
10
|
-
this.
|
|
7
|
+
this.radioItemSelectInternal.emit({
|
|
11
8
|
value: this.value,
|
|
12
9
|
selected,
|
|
13
10
|
select: s => (this.selected = s),
|
|
@@ -17,9 +14,9 @@ export class SmoothlyRadioButtonItem {
|
|
|
17
14
|
return (h(Host, null,
|
|
18
15
|
h("header", { onClick: () => this.select(!this.selected) },
|
|
19
16
|
h("smoothly-icon", { color: this.selected ? "success" : "medium", fill: "solid", name: this.selected ? "checkmark-circle" : "ellipse-outline", size: "tiny", toolTip: "Select" }),
|
|
20
|
-
h("slot", null)
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
h("slot", null),
|
|
18
|
+
h("slot", { name: "end" })),
|
|
19
|
+
h("slot", { name: "expansion" })));
|
|
23
20
|
}
|
|
24
21
|
static get is() { return "smoothly-radio-button-item"; }
|
|
25
22
|
static get encapsulation() { return "scoped"; }
|
|
@@ -63,29 +60,11 @@ export class SmoothlyRadioButtonItem {
|
|
|
63
60
|
},
|
|
64
61
|
"attribute": "selected",
|
|
65
62
|
"reflect": true
|
|
66
|
-
},
|
|
67
|
-
"expansion": {
|
|
68
|
-
"type": "boolean",
|
|
69
|
-
"mutable": false,
|
|
70
|
-
"complexType": {
|
|
71
|
-
"original": "boolean",
|
|
72
|
-
"resolved": "boolean",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": ""
|
|
80
|
-
},
|
|
81
|
-
"attribute": "expansion",
|
|
82
|
-
"reflect": false,
|
|
83
|
-
"defaultValue": "false"
|
|
84
63
|
}
|
|
85
64
|
}; }
|
|
86
65
|
static get events() { return [{
|
|
87
|
-
"method": "
|
|
88
|
-
"name": "
|
|
66
|
+
"method": "radioItemSelectInternal",
|
|
67
|
+
"name": "radioItemSelectInternal",
|
|
89
68
|
"bubbles": true,
|
|
90
69
|
"cancelable": true,
|
|
91
70
|
"composed": true,
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
|
|
3
|
-
margin-bottom: 0.5rem;
|
|
1
|
+
smoothly-radio-button[decoration=radio] :host > header {
|
|
2
|
+
padding: 0.5rem;
|
|
4
3
|
}
|
|
5
4
|
|
|
6
|
-
:host
|
|
7
|
-
|
|
5
|
+
smoothly-radio-button[decoration=radio] :host > header > smoothly-icon {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
smoothly-radio-button[decoration=radio] :host[selected] > header {
|
|
9
|
+
color: rgb(var(--smoothly-primary-contrast));
|
|
10
|
+
background: rgb(var(--smoothly-primary-color));
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
align-items: center;
|
|
13
|
+
smoothly-radio-button[decoration=radio] ::slotted([slot=expansion])::before {
|
|
14
|
+
content: unset;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
:host > header > smoothly-icon {
|
|
17
|
+
smoothly-radio-button[decoration=button] :host > header > smoothly-icon {
|
|
16
18
|
margin-right: 0.5rem;
|
|
17
19
|
border-radius: 100%;
|
|
18
20
|
font-size: 1.3rem;
|
|
@@ -21,47 +23,63 @@
|
|
|
21
23
|
transition: 0.2s;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
:host[selected] > header > smoothly-icon {
|
|
26
|
+
smoothly-radio-button[decoration=button] :host[selected] > header > smoothly-icon {
|
|
25
27
|
color: rgb(var(--smoothly-success-color));
|
|
26
28
|
background: rgb(var(--smoothly-success-shade));
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
color: rgb(var(--smoothly-light-contrast));
|
|
33
|
-
padding: 0;
|
|
31
|
+
smoothly-radio-button[decoration=button] ::slotted([slot=expansion]) {
|
|
32
|
+
background: rgb(var(--smoothly-primary-color));
|
|
33
|
+
color: rgb(var(--smoothly-primary-contrast));
|
|
34
34
|
border-radius: 5px;
|
|
35
35
|
margin-top: 0.5rem;
|
|
36
|
-
position: relative;
|
|
37
|
-
transition: 0.1s;
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
smoothly-radio-button[decoration=button] ::slotted([slot=expansion])::before {
|
|
41
39
|
content: "\25B2";
|
|
42
40
|
position: absolute;
|
|
43
41
|
top: -0.8rem;
|
|
44
42
|
left: 3rem;
|
|
45
|
-
color: rgb(var(--smoothly-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:host[selected] > aside {
|
|
49
|
-
display: block;
|
|
50
|
-
padding: 0.5rem;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host > aside.hide {
|
|
54
|
-
display: none;
|
|
43
|
+
color: rgb(var(--smoothly-primary-color));
|
|
55
44
|
}
|
|
56
45
|
|
|
57
46
|
@media screen and (min-width: 900px){
|
|
58
|
-
:host > header:hover > smoothly-icon {
|
|
47
|
+
smoothly-radio-button[decoration=button] :host > header:hover > smoothly-icon {
|
|
59
48
|
background: rgb(var(--smoothly-success-color));
|
|
60
49
|
cursor: pointer;
|
|
61
50
|
}
|
|
62
|
-
:host[selected] > header:hover > smoothly-icon {
|
|
51
|
+
smoothly-radio-button[deselectable] :host[selected] > header:hover > smoothly-icon {
|
|
63
52
|
background: rgb(var(--smoothly-warning-shade));
|
|
64
53
|
color: rgb(var(--smoothly-warning-color));
|
|
65
54
|
cursor: pointer;
|
|
66
55
|
}
|
|
67
56
|
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
:host {
|
|
60
|
+
display: block;
|
|
61
|
+
margin-bottom: 0.5rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host:last-child {
|
|
65
|
+
margin-bottom: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host > header {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
::slotted([slot=expansion]) {
|
|
74
|
+
display: none;
|
|
75
|
+
background: rgb(var(--smoothly-primary-tint));
|
|
76
|
+
color: rgb(var(--smoothly-primary-contrast));
|
|
77
|
+
padding: 0;
|
|
78
|
+
position: relative;
|
|
79
|
+
transition: 0.1s;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[selected]::slotted([slot=expansion]) {
|
|
83
|
+
display: block;
|
|
84
|
+
padding: 0.5rem;
|
|
85
|
+
}
|