smoothly 0.1.121 → 0.2.4
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_51.cjs.entry.js +127 -65
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/app/style.css +12 -12
- package/dist/collection/components/button/style.css +1 -2
- package/dist/collection/components/calendar/style.css +2 -3
- package/dist/collection/components/input/index.js +68 -8
- package/dist/collection/components/input-date/index.js +1 -1
- package/dist/collection/components/input-date/style.css +2 -3
- package/dist/collection/components/input-date-range/index.js +2 -2
- package/dist/collection/components/input-demo/index.js +2 -1
- package/dist/collection/components/item/style.css +2 -3
- package/dist/collection/components/menu-options/index.js +64 -3
- package/dist/collection/components/option/index.js +35 -1
- package/dist/collection/components/option/style.css +6 -0
- package/dist/collection/components/picker/index.js +149 -11
- package/dist/collection/components/select-demo/index.js +9 -1
- package/dist/collection/components/select-demo/style.css +1 -1
- package/dist/collection/components/selector/style.css +0 -2
- package/dist/collection/components/tab/style.css +3 -4
- package/dist/collection/components/tab-switch/index.js +1 -0
- package/dist/collection/components/tab-switch/style.css +1 -1
- package/dist/collection/components/table/cell/style.css +3 -1
- package/dist/collection/components/table/demo/index.js +38 -32
- package/dist/collection/components/table/expandable/cell/index.js +8 -9
- package/dist/collection/components/table/expandable/cell/style.css +38 -1
- package/dist/collection/components/table/expandable/row/index.js +84 -21
- package/dist/collection/components/table/expandable/row/style.css +35 -4
- package/dist/collection/components/table/header/index.js +22 -2
- package/dist/collection/components/table/header/style.css +5 -3
- package/dist/collection/components/table/index.js +33 -1
- package/dist/collection/components/table/row/index.js +20 -84
- package/dist/collection/components/table/row/style.css +2 -8
- package/dist/collection/components/table/style.css +8 -3
- package/dist/custom-elements/index.js +136 -74
- package/dist/esm/loader.js +1 -1
- package/dist/esm/smoothly-accordion_51.entry.js +127 -65
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/p-a302008c.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/input/index.d.ts +10 -3
- package/dist/types/components/menu-options/index.d.ts +5 -0
- package/dist/types/components/option/index.d.ts +5 -0
- package/dist/types/components/picker/index.d.ts +14 -3
- package/dist/types/components/table/expandable/cell/index.d.ts +2 -2
- package/dist/types/components/table/expandable/row/index.d.ts +9 -4
- package/dist/types/components/table/header/index.d.ts +1 -0
- package/dist/types/components/table/index.d.ts +3 -0
- package/dist/types/components/table/row/index.d.ts +3 -9
- package/dist/types/components.d.ts +31 -7
- package/package.json +2 -2
- package/dist/smoothly/p-f4529a2d.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
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_51.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"]]],[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[1,"smoothly-picker",{"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"optionStyle":[8,"option-style"],"options":[16],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"selectionName":[1025,"selection-name"],"isOpen":[32]},[[0,"optionSelect","
|
|
17
|
+
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_51.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"]]],[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[1,"smoothly-picker",{"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"]]],[6,"smoothly-table-expandable-row",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[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"]]],[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]}],[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]}],[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-header",{"name":[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{"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]}],[6,"smoothly-tab",{"label":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{"selectedElement":[32]},[[0,"expansionOpen","openChanged"]]],[6,"smoothly-table-cell"],[0,"smoothly-tuple",{"tuple":[16]}],[1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537],"divider":[1540],"new":[4]}],[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-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);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -165,7 +165,7 @@ const SmoothlyBacktotop = class {
|
|
|
165
165
|
};
|
|
166
166
|
SmoothlyBacktotop.style = styleCss$E;
|
|
167
167
|
|
|
168
|
-
const styleCss$D = "[type=link].sc-smoothly-button-h{display:inline}.sc-smoothly-button-h:not([type=link]){display:block}.sc-smoothly-button-h{margin:1em;border-style:solid;border-width:1px;border-radius:3px}[hidden].sc-smoothly-button-h{display:none}[disabled].sc-smoothly-button-h{opacity:0.5}a.sc-smoothly-button,button.sc-smoothly-button{border-color:transparent;background-color:transparent;padding:0.2em 0.3em;font-size:110%;font-weight:400}.sc-smoothly-button-h:not([disabled]):hover,.sc-smoothly-button-h:not([disabled]):focus,.sc-smoothly-button-h:not([disabled]):active{border-color:var(--smoothly-button-border)}[type=button].sc-smoothly-button-h>a.sc-smoothly-button{display:block;text-align:center;text-decoration:inherit}[type=button].sc-smoothly-button-h>a.sc-smoothly-button{width:calc(100% - 0.6em)}.sc-smoothly-button-h>button.sc-smoothly-button{width:100%}[expand=fill].sc-smoothly-button-h{width:100%;border-left:none;border-right:none}";
|
|
168
|
+
const styleCss$D = "[type=link].sc-smoothly-button-h{display:inline}.sc-smoothly-button-h:not([type=link]){display:block}.sc-smoothly-button-h{margin:1em;border-style:solid;border-width:1px;border-radius:3px}[hidden].sc-smoothly-button-h{display:none}[disabled].sc-smoothly-button-h{opacity:0.5}a.sc-smoothly-button,button.sc-smoothly-button{display:block;border-color:transparent;background-color:transparent;padding:0.2em 0.3em;font-size:110%;font-weight:400}.sc-smoothly-button-h:not([disabled]):hover,.sc-smoothly-button-h:not([disabled]):focus,.sc-smoothly-button-h:not([disabled]):active{border-color:var(--smoothly-button-border)}[type=button].sc-smoothly-button-h>a.sc-smoothly-button{display:block;text-align:center;text-decoration:inherit}[type=button].sc-smoothly-button-h>a.sc-smoothly-button{width:calc(100% - 0.6em)}.sc-smoothly-button-h>button.sc-smoothly-button{width:100%}[expand=fill].sc-smoothly-button-h{width:100%;border-left:none;border-right:none}";
|
|
169
169
|
|
|
170
170
|
const SmoothlyButton = class {
|
|
171
171
|
constructor(hostRef) {
|
|
@@ -45890,7 +45890,9 @@ const styleCss$t = ".sc-smoothly-input-h{display:block;position:relative;font-we
|
|
|
45890
45890
|
const SmoothlyInput = class {
|
|
45891
45891
|
constructor(hostRef) {
|
|
45892
45892
|
index.registerInstance(this, hostRef);
|
|
45893
|
-
this.
|
|
45893
|
+
this.smoothlyBlur = index.createEvent(this, "smoothlyBlur", 7);
|
|
45894
|
+
this.smoothlyChange = index.createEvent(this, "smoothlyChange", 7);
|
|
45895
|
+
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
45894
45896
|
this.keepFocusOnReRender = false;
|
|
45895
45897
|
this.type = "text";
|
|
45896
45898
|
this.required = false;
|
|
@@ -45899,6 +45901,7 @@ const SmoothlyInput = class {
|
|
|
45899
45901
|
this.maxLength = Number.POSITIVE_INFINITY;
|
|
45900
45902
|
this.autocomplete = true;
|
|
45901
45903
|
this.disabled = false;
|
|
45904
|
+
this.readonly = false;
|
|
45902
45905
|
}
|
|
45903
45906
|
get formatter() {
|
|
45904
45907
|
let result;
|
|
@@ -45924,7 +45927,7 @@ const SmoothlyInput = class {
|
|
|
45924
45927
|
if (value != before) {
|
|
45925
45928
|
if (typeof value == "string")
|
|
45926
45929
|
value = value.trim();
|
|
45927
|
-
this.
|
|
45930
|
+
this.smoothlyInput.emit({ name: this.name, value });
|
|
45928
45931
|
}
|
|
45929
45932
|
}
|
|
45930
45933
|
onCurrency() {
|
|
@@ -45974,8 +45977,14 @@ const SmoothlyInput = class {
|
|
|
45974
45977
|
const after = this.formatter.format(dist.StateEditor.copy(this.formatter.unformat(dist.StateEditor.copy(Object.assign({}, this.state)))));
|
|
45975
45978
|
this.updateBackend(after, this.inputElement);
|
|
45976
45979
|
}
|
|
45977
|
-
onBlur(event) {
|
|
45980
|
+
onBlur(event) {
|
|
45981
|
+
this.smoothlyBlur.emit();
|
|
45982
|
+
if (this.initialValue != this.value)
|
|
45983
|
+
this.smoothlyChange.emit({ name: this.name, value: this.value });
|
|
45984
|
+
this.initialValue = undefined;
|
|
45985
|
+
}
|
|
45978
45986
|
onFocus(event) {
|
|
45987
|
+
this.initialValue = this.value;
|
|
45979
45988
|
const after = this.formatter.format(dist.StateEditor.copy(this.formatter.unformat(dist.StateEditor.copy(Object.assign({}, this.state)))));
|
|
45980
45989
|
if (event.target)
|
|
45981
45990
|
this.updateBackend(after, event.target);
|
|
@@ -46051,8 +46060,10 @@ const SmoothlyInput = class {
|
|
|
46051
46060
|
return value;
|
|
46052
46061
|
}
|
|
46053
46062
|
processKey(event, backend) {
|
|
46054
|
-
|
|
46055
|
-
|
|
46063
|
+
if (!this.readonly) {
|
|
46064
|
+
const after = dist.Action.apply(this.formatter, this.state, event);
|
|
46065
|
+
this.updateBackend(after, backend);
|
|
46066
|
+
}
|
|
46056
46067
|
}
|
|
46057
46068
|
updateBackend(after, backend) {
|
|
46058
46069
|
if (after.value != backend.value)
|
|
@@ -46067,7 +46078,7 @@ const SmoothlyInput = class {
|
|
|
46067
46078
|
}
|
|
46068
46079
|
render() {
|
|
46069
46080
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
46070
|
-
return (index.h(index.Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" }, onclick: () => { var _a; return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus(); } }, index.h("div", null, index.h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), index.h("label", { htmlFor: this.name }, index.h("slot", null)), index.h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }))));
|
|
46081
|
+
return (index.h(index.Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" }, onclick: () => { var _a; return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus(); } }, index.h("div", null, index.h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, readOnly: this.readonly, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), index.h("label", { htmlFor: this.name }, index.h("slot", null)), index.h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }))));
|
|
46071
46082
|
}
|
|
46072
46083
|
static get watchers() { return {
|
|
46073
46084
|
"value": ["valueWatcher"],
|
|
@@ -46080,7 +46091,7 @@ function getLocale() {
|
|
|
46080
46091
|
}
|
|
46081
46092
|
SmoothlyInput.style = styleCss$t;
|
|
46082
46093
|
|
|
46083
|
-
const styleCss$s = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;top:0px;left:0px;right:0px;bottom:0px;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em,
|
|
46094
|
+
const styleCss$s = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;top:0px;left:0px;right:0px;bottom:0px;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em, -0.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}";
|
|
46084
46095
|
|
|
46085
46096
|
const InputDate = class {
|
|
46086
46097
|
constructor(hostRef) {
|
|
@@ -46097,7 +46108,7 @@ const InputDate = class {
|
|
|
46097
46108
|
render() {
|
|
46098
46109
|
var _a;
|
|
46099
46110
|
return [
|
|
46100
|
-
index.h("smoothly-input", { onClick: () => (this.open = !this.open), disabled: this.disabled, type: "date", value: this.value,
|
|
46111
|
+
index.h("smoothly-input", { onClick: () => (this.open = !this.open), disabled: this.disabled, type: "date", value: this.value, onSmoothlyInput: e => (this.value = e.detail.value) }, index.h("slot", null)),
|
|
46101
46112
|
this.open && !this.disabled
|
|
46102
46113
|
? [
|
|
46103
46114
|
index.h("div", { onClick: () => (this.open = false) }),
|
|
@@ -46142,7 +46153,7 @@ const InputDateRange = class {
|
|
|
46142
46153
|
render() {
|
|
46143
46154
|
var _a;
|
|
46144
46155
|
return [
|
|
46145
|
-
index.h("section", { onClick: () => (this.open = !this.open) }, index.h("smoothly-input", { type: "date", value: this.start, showLabel: this.showLabel,
|
|
46156
|
+
index.h("section", { onClick: () => (this.open = !this.open) }, index.h("smoothly-input", { type: "date", value: this.start, showLabel: this.showLabel, onSmoothlyInput: e => (this.start = e.detail.value) }, "from"), index.h("span", null, "\u2013"), index.h("smoothly-input", { type: "date", showLabel: this.showLabel, value: this.end, onSmoothlyInput: e => (this.end = e.detail.value) }, "to")),
|
|
46146
46157
|
this.open ? index.h("div", { onClick: () => (this.open = false) }) : [],
|
|
46147
46158
|
this.open ? (index.h("nav", null, index.h("div", { class: "arrow" }), index.h("smoothly-calendar", { doubleInput: true, value: (_a = this.value) !== null && _a !== void 0 ? _a : dist$2.Date.now(), onValueChanged: event => {
|
|
46148
46159
|
this.value = event.detail;
|
|
@@ -46162,7 +46173,7 @@ const SmoothlyInputDemo = class {
|
|
|
46162
46173
|
}
|
|
46163
46174
|
render() {
|
|
46164
46175
|
return [
|
|
46165
|
-
index.h("form", { action: "done", style: { position: "relative" } }, index.h("header", null, index.h("h5", null, "Address")), index.h("main", null, index.h("smoothly-input", { type: "text", name: "name" }, "Name"), index.h("smoothly-input", { type: "date", name: "date" }, "Date"), index.h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), index.h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), index.h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), index.h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), index.h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), index.h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), index.h("smoothly-radio", { name: "option", value: "1" }, "option 1"), index.h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), index.h("smoothly-radio", { name: "option", value: "3" }, "option 3"), index.h("smoothly-accordion", null, index.h("smoothly-accordion-item", { name: "A", open: true }, index.h("smoothly-radio", { name: "a", value: "1" }, "a 1"), index.h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), index.h("smoothly-radio", { name: "a", value: "3" }, "a 3")), index.h("smoothly-accordion-item", { name: "B" }, index.h("smoothly-radio", { name: "b", value: "1" }, "b 1"), index.h("smoothly-radio", { name: "b", value: "2" }, "b 2"), index.h("smoothly-radio", { name: "b", value: "3" }, "b 3"))), index.h("smoothly-display-amount", { currency: "SEK", amount: "1289.5" }), index.h("smoothly-display-date-time", { datetime: "2019-01-31T20:01:34" }), index.h("smoothly-checkbox", { selectAll: true, intermediate: true }), index.h("smoothly-checkbox", null), index.h("smoothly-checkbox", { disabled: true }), index.h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), index.h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), index.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" } }' }), index.h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), index.h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), index.h("smoothly-input", { type: "password", name: "password" }, "Password"), index.h("smoothly-input", { type: "email", name: "email" }, "Email"), index.h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), index.h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), index.h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), index.h("smoothly-input-date", null, "Date")), index.h("footer", null, index.h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), index.h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
|
|
46176
|
+
index.h("form", { action: "done", style: { position: "relative" } }, index.h("header", null, index.h("h5", null, "Address")), index.h("main", null, index.h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), index.h("smoothly-input", { type: "text", name: "name", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), index.h("smoothly-input", { type: "date", name: "date" }, "Date"), index.h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), index.h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), index.h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), index.h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), index.h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), index.h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), index.h("smoothly-radio", { name: "option", value: "1" }, "option 1"), index.h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), index.h("smoothly-radio", { name: "option", value: "3" }, "option 3"), index.h("smoothly-accordion", null, index.h("smoothly-accordion-item", { name: "A", open: true }, index.h("smoothly-radio", { name: "a", value: "1" }, "a 1"), index.h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), index.h("smoothly-radio", { name: "a", value: "3" }, "a 3")), index.h("smoothly-accordion-item", { name: "B" }, index.h("smoothly-radio", { name: "b", value: "1" }, "b 1"), index.h("smoothly-radio", { name: "b", value: "2" }, "b 2"), index.h("smoothly-radio", { name: "b", value: "3" }, "b 3"))), index.h("smoothly-display-amount", { currency: "SEK", amount: "1289.5" }), index.h("smoothly-display-date-time", { datetime: "2019-01-31T20:01:34" }), index.h("smoothly-checkbox", { selectAll: true, intermediate: true }), index.h("smoothly-checkbox", null), index.h("smoothly-checkbox", { disabled: true }), index.h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), index.h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), index.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" } }' }), index.h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), index.h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), index.h("smoothly-input", { type: "password", name: "password" }, "Password"), index.h("smoothly-input", { type: "email", name: "email" }, "Email"), index.h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), index.h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), index.h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), index.h("smoothly-input-date", null, "Date")), index.h("footer", null, index.h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), index.h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
|
|
46166
46177
|
index.h("smoothly-backtotop", null),
|
|
46167
46178
|
];
|
|
46168
46179
|
}
|
|
@@ -46199,7 +46210,7 @@ const MonthSelector = class {
|
|
|
46199
46210
|
};
|
|
46200
46211
|
MonthSelector.style = styleCss$q;
|
|
46201
46212
|
|
|
46202
|
-
const styleCss$p = "[selected].sc-smoothly-item-h{background-color:rgb(var(--smoothly-primary-shade));color:rgb(var(--smoothly-primary-contrast))}.sc-smoothly-item-h{padding
|
|
46213
|
+
const styleCss$p = "[selected].sc-smoothly-item-h{background-color:rgb(var(--smoothly-primary-shade));color:rgb(var(--smoothly-primary-contrast))}.sc-smoothly-item-h{padding:0.5em;cursor:pointer;background-color:rgb(var(--smoothly-default-shade));color:rgb(var(--smoothly-default-contrast));border:rgb(var(--smoothly-default-shade) solid 1px)}.sc-smoothly-item-h:hover{background-color:rgb(var(--smoothly-primary-color));color:rgb(var(--smoothly-primary-contrast))}";
|
|
46203
46214
|
|
|
46204
46215
|
const Item = class {
|
|
46205
46216
|
constructor(hostRef) {
|
|
@@ -46240,12 +46251,15 @@ const styleCss$o = ":host{max-height:18.75rem;width:85%;max-height:var(--max-men
|
|
|
46240
46251
|
const SmoothlyMenuOptions = class {
|
|
46241
46252
|
constructor(hostRef) {
|
|
46242
46253
|
index.registerInstance(this, hostRef);
|
|
46254
|
+
this.menuEmpty = index.createEvent(this, "menuEmpty", 7);
|
|
46243
46255
|
this.filteredOptions = [];
|
|
46244
46256
|
this.highlightIndex = 0;
|
|
46245
46257
|
this.emptyMenuLabel = "No Options";
|
|
46258
|
+
this.newOptionLabel = "Add:";
|
|
46246
46259
|
this.order = false;
|
|
46247
46260
|
this.options = [];
|
|
46248
46261
|
this.resetHighlightOnOptionsChange = true;
|
|
46262
|
+
this.mutable = false;
|
|
46249
46263
|
}
|
|
46250
46264
|
optionsChangeHandler(newOptions) {
|
|
46251
46265
|
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
@@ -46284,6 +46298,7 @@ const SmoothlyMenuOptions = class {
|
|
|
46284
46298
|
return result;
|
|
46285
46299
|
}
|
|
46286
46300
|
async filterOptions(keyword, excludeValues = []) {
|
|
46301
|
+
this.keyword = keyword;
|
|
46287
46302
|
const keywordLowercase = keyword.toLowerCase();
|
|
46288
46303
|
this.filteredOptions = [];
|
|
46289
46304
|
for (const option of this.options) {
|
|
@@ -46291,6 +46306,7 @@ const SmoothlyMenuOptions = class {
|
|
|
46291
46306
|
const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
|
|
46292
46307
|
isVisible && this.filteredOptions.push(option);
|
|
46293
46308
|
}
|
|
46309
|
+
this.menuEmpty.emit(!this.filteredOptions.length);
|
|
46294
46310
|
this.order && this.sortOptions(keyword);
|
|
46295
46311
|
}
|
|
46296
46312
|
sortOptions(keyword) {
|
|
@@ -46327,7 +46343,7 @@ const SmoothlyMenuOptions = class {
|
|
|
46327
46343
|
}
|
|
46328
46344
|
}
|
|
46329
46345
|
render() {
|
|
46330
|
-
return (index.h(index.Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index$1) => (index.h("smoothly-option", { style: this.optionStyle, ref: el => index$1 == 0 && (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement), value: option.value, name: option.name, divider: option.divider, "data-highlight": this.highlightIndex == index$1 }, option.left ? index.h("div", { slot: "left" }, option.left) : undefined, option.right ? index.h("div", { slot: "right" }, option.right) : undefined)))) : (index.h("div", null, this.emptyMenuLabel))));
|
|
46346
|
+
return (index.h(index.Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index$1) => (index.h("smoothly-option", { style: this.optionStyle, ref: el => index$1 == 0 && (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement), value: option.value, name: option.name, divider: option.divider, "data-highlight": this.highlightIndex == index$1 }, option.left ? index.h("div", { slot: "left" }, option.left) : undefined, option.right ? index.h("div", { slot: "right" }, option.right) : undefined)))) : this.mutable ? (index.h("smoothly-option", { style: this.optionStyle, ref: el => (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement), value: this.keyword, name: this.keyword, "data-highlight": 0, new: true }, index.h("div", { slot: "left" }, index.h("smoothly-icon", { name: "square-outline", size: "small" }), " ", this.newOptionLabel))) : (index.h("div", null, this.emptyMenuLabel))));
|
|
46331
46347
|
}
|
|
46332
46348
|
get element() { return index.getElement(this); }
|
|
46333
46349
|
static get watchers() { return {
|
|
@@ -46418,13 +46434,14 @@ const Notifier = class {
|
|
|
46418
46434
|
};
|
|
46419
46435
|
Notifier.style = styleCss$m;
|
|
46420
46436
|
|
|
46421
|
-
const styleCss$l = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.middle{padding-left:0.5em;flex-shrink:1;width:100%}:host([divider]){margin-bottom:0.5em}::slotted([slot=right]){font-style:italic;white-space:nowrap}:host([divider])::after{position:absolute;height:1px;width:100%;left:0;bottom:-0.25em;content:\"\";background-color:rgba(var(--smoothly-dark-color))}";
|
|
46437
|
+
const styleCss$l = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.middle{padding-left:0.5em;flex-shrink:1;width:100%}:host([divider]){margin-bottom:0.5em}::slotted([slot=right]){font-style:italic;white-space:nowrap}:host([divider])::after{position:absolute;height:1px;width:100%;left:0;bottom:-0.25em;content:\"\";background-color:rgba(var(--smoothly-dark-color))}::slotted([slot=left]){display:flex;align-items:center;gap:1ch}";
|
|
46422
46438
|
|
|
46423
46439
|
const SmoothlyOption = class {
|
|
46424
46440
|
constructor(hostRef) {
|
|
46425
46441
|
index.registerInstance(this, hostRef);
|
|
46426
46442
|
this.optionHover = index.createEvent(this, "optionHover", 7);
|
|
46427
46443
|
this.optionSelect = index.createEvent(this, "optionSelect", 7);
|
|
46444
|
+
this.optionAdd = index.createEvent(this, "optionAdd", 7);
|
|
46428
46445
|
this.dataHighlight = false;
|
|
46429
46446
|
this.divider = false;
|
|
46430
46447
|
}
|
|
@@ -46433,7 +46450,9 @@ const SmoothlyOption = class {
|
|
|
46433
46450
|
}
|
|
46434
46451
|
onSelect(event) {
|
|
46435
46452
|
if (this.value)
|
|
46436
|
-
this.
|
|
46453
|
+
this.new
|
|
46454
|
+
? this.optionAdd.emit({ name: this.name, value: this.value })
|
|
46455
|
+
: this.optionSelect.emit({ name: this.name, value: this.value });
|
|
46437
46456
|
else
|
|
46438
46457
|
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
46439
46458
|
}
|
|
@@ -46450,15 +46469,20 @@ const SmoothlyPicker = class {
|
|
|
46450
46469
|
constructor(hostRef) {
|
|
46451
46470
|
index.registerInstance(this, hostRef);
|
|
46452
46471
|
this.menuClose = index.createEvent(this, "menuClose", 7);
|
|
46472
|
+
this.notice = index.createEvent(this, "notice", 7);
|
|
46453
46473
|
this.keepFocusOnReRender = false;
|
|
46454
46474
|
this.emptyMenuLabel = "No Options";
|
|
46455
46475
|
this.multiple = false;
|
|
46476
|
+
this.mutable = false;
|
|
46456
46477
|
this.options = [];
|
|
46457
46478
|
this.selections = [];
|
|
46458
46479
|
this.selectNoneName = "Select None";
|
|
46480
|
+
this.selectAllName = "Select All";
|
|
46459
46481
|
this.selectionName = "items selected";
|
|
46482
|
+
this.newOptionLabel = "Add:";
|
|
46483
|
+
this.valueValidator = _ => [true, undefined];
|
|
46460
46484
|
}
|
|
46461
|
-
|
|
46485
|
+
isOpenChangeHandler() {
|
|
46462
46486
|
if (this.isOpen == false) {
|
|
46463
46487
|
this.menuClose.emit(this.selections);
|
|
46464
46488
|
}
|
|
@@ -46470,10 +46494,26 @@ const SmoothlyPicker = class {
|
|
|
46470
46494
|
this.keepFocusOnReRender = false;
|
|
46471
46495
|
}
|
|
46472
46496
|
}
|
|
46473
|
-
|
|
46497
|
+
optionSelectHandler(event) {
|
|
46474
46498
|
this.toggle(event.detail);
|
|
46475
46499
|
event.stopPropagation();
|
|
46476
46500
|
}
|
|
46501
|
+
optionAddHandler(event) {
|
|
46502
|
+
if (this.mutable) {
|
|
46503
|
+
const [status, notice] = this.valueValidator(event.detail.value);
|
|
46504
|
+
if (status) {
|
|
46505
|
+
const option = Object.assign({}, event.detail);
|
|
46506
|
+
this.options = [...this.options, option];
|
|
46507
|
+
this.select(option);
|
|
46508
|
+
}
|
|
46509
|
+
notice && this.notice.emit(notice);
|
|
46510
|
+
}
|
|
46511
|
+
event.stopPropagation();
|
|
46512
|
+
}
|
|
46513
|
+
emptyHandler(event) {
|
|
46514
|
+
this.empty = event.detail;
|
|
46515
|
+
event.stopPropagation();
|
|
46516
|
+
}
|
|
46477
46517
|
toggle(option) {
|
|
46478
46518
|
option.value == "select-none"
|
|
46479
46519
|
? this.toggleAll()
|
|
@@ -46508,9 +46548,19 @@ const SmoothlyPicker = class {
|
|
|
46508
46548
|
}
|
|
46509
46549
|
toggleHighlighted() {
|
|
46510
46550
|
var _a;
|
|
46511
|
-
(
|
|
46512
|
-
|
|
46513
|
-
|
|
46551
|
+
if (this.mutable && this.empty) {
|
|
46552
|
+
const [status, notice] = this.valueValidator(this.inputElement.value);
|
|
46553
|
+
if (status) {
|
|
46554
|
+
const option = { name: this.inputElement.value, value: this.inputElement.value };
|
|
46555
|
+
this.options = [...this.options, option];
|
|
46556
|
+
this.select(option);
|
|
46557
|
+
}
|
|
46558
|
+
notice && this.notice.emit(notice);
|
|
46559
|
+
}
|
|
46560
|
+
else
|
|
46561
|
+
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.getHighlighted().then((result) => {
|
|
46562
|
+
result && this.toggle(result);
|
|
46563
|
+
});
|
|
46514
46564
|
}
|
|
46515
46565
|
highlightDefault() {
|
|
46516
46566
|
var _a;
|
|
@@ -46572,7 +46622,7 @@ const SmoothlyPicker = class {
|
|
|
46572
46622
|
? [
|
|
46573
46623
|
{
|
|
46574
46624
|
value: "select-none",
|
|
46575
|
-
name: this.selectNoneName,
|
|
46625
|
+
name: this.selections.length == this.options.length ? this.selectNoneName : this.selectAllName,
|
|
46576
46626
|
left: this.getCheckHtml(this.selections.length == ((_c = this.options) === null || _c === void 0 ? void 0 : _c.length)),
|
|
46577
46627
|
divider: true,
|
|
46578
46628
|
},
|
|
@@ -46582,12 +46632,12 @@ const SmoothlyPicker = class {
|
|
|
46582
46632
|
];
|
|
46583
46633
|
return (index.h(index.Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, index.h("div", null, index.h("smoothly-icon", { class: "search", name: "search-outline", size: "tiny" }), index.h("label", null, this.label), index.h("input", { type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
|
|
46584
46634
|
? this.selections.length.toString() + " " + this.selectionName
|
|
46585
|
-
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), index.h("smoothly-icon", { class: "down", name: "chevron-down", size: "tiny" }), index.h("smoothly-icon", { class: "up", name: "chevron-up", size: "tiny" })), index.h("smoothly-menu-options", { style: { width: "100%" }, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, "max-menu-height": this.maxMenuHeight, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
46635
|
+
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), index.h("smoothly-icon", { class: "down", name: "chevron-down", size: "tiny" }), index.h("smoothly-icon", { class: "up", name: "chevron-up", size: "tiny" })), index.h("smoothly-menu-options", { style: { width: "100%" }, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
46586
46636
|
}
|
|
46587
46637
|
get element() { return index.getElement(this); }
|
|
46588
46638
|
static get watchers() { return {
|
|
46589
|
-
"selections": ["
|
|
46590
|
-
"isOpen": ["
|
|
46639
|
+
"selections": ["isOpenChangeHandler"],
|
|
46640
|
+
"isOpen": ["isOpenChangeHandler"]
|
|
46591
46641
|
}; }
|
|
46592
46642
|
};
|
|
46593
46643
|
SmoothlyPicker.style = styleCss$k;
|
|
@@ -46735,7 +46785,7 @@ const SmoothlySelectDemo = class {
|
|
|
46735
46785
|
{ name: "Scary Kraken", value: "kraken" },
|
|
46736
46786
|
] }),
|
|
46737
46787
|
index.h("br", null),
|
|
46738
|
-
index.h("smoothly-picker", { label: "", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
46788
|
+
index.h("smoothly-picker", { label: "Multiple", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
46739
46789
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
46740
46790
|
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
46741
46791
|
{ name: "Noble Pig", value: "pig" },
|
|
@@ -46749,6 +46799,13 @@ const SmoothlySelectDemo = class {
|
|
|
46749
46799
|
{ name: "Scary Kraken", value: "kraken" },
|
|
46750
46800
|
] }),
|
|
46751
46801
|
index.h("br", null),
|
|
46802
|
+
index.h("smoothly-picker", { label: "Multiple mutable", "max-height": "58px", multiple: true, mutable: true, newOptionLabel: "Invite:", options: [
|
|
46803
|
+
{ name: "john@example.com", value: "john@example.com" },
|
|
46804
|
+
{ name: "jane@example.com", value: "jane@example.com" },
|
|
46805
|
+
{ name: "james@example.com", value: "james@example.com" },
|
|
46806
|
+
{ name: "jessie@example.com", value: "jessie@example.com" },
|
|
46807
|
+
], valueValidator: (email) => email.match(/^\w+@\w+/) ? [true, undefined] : [false, Notice.Notice.failed("Incorrectly formatted email")] }),
|
|
46808
|
+
index.h("br", null),
|
|
46752
46809
|
index.h("smoothly-picker", { label: "Single select", multiple: false, "max-menu-height": "200px", options: [
|
|
46753
46810
|
{ name: "Dog", value: "dog", aliases: ["WOFF"], right: "Woof 🐶" },
|
|
46754
46811
|
{ name: "Cat", value: "cat", aliases: ["moew"] },
|
|
@@ -47041,6 +47098,7 @@ const SmoothlyTabSwitch = class {
|
|
|
47041
47098
|
index.registerInstance(this, hostRef);
|
|
47042
47099
|
}
|
|
47043
47100
|
openChanged(event) {
|
|
47101
|
+
event.stopPropagation();
|
|
47044
47102
|
this.selectedElement = event.target;
|
|
47045
47103
|
this.selectedElement.open = true;
|
|
47046
47104
|
this.element.after(event.detail);
|
|
@@ -47059,11 +47117,15 @@ const SmoothlyTabSwitch = class {
|
|
|
47059
47117
|
};
|
|
47060
47118
|
SmoothlyTabSwitch.style = styleCss$8;
|
|
47061
47119
|
|
|
47062
|
-
const styleCss$7 = ".sc-smoothly-table-h{display:table;text-align:left;border
|
|
47120
|
+
const styleCss$7 = ".sc-smoothly-table-h{display:table;text-align:left;border:1px solid rgb(var(--smoothly-dark-color));width:80%;box-sizing:border-box;background-color:rgb(var(--smoothly-default-color));margin:1rem 9.5%;padding-bottom:0.5rem}.slot-detail.sc-smoothly-table>div.sc-smoothly-table{padding:10rem 0;margin-left:10rem}";
|
|
47063
47121
|
|
|
47064
47122
|
const Table = class {
|
|
47065
47123
|
constructor(hostRef) {
|
|
47066
47124
|
index.registerInstance(this, hostRef);
|
|
47125
|
+
this.loadMore = index.createEvent(this, "loadMore", 7);
|
|
47126
|
+
}
|
|
47127
|
+
handleEvents(event) {
|
|
47128
|
+
event.stopPropagation();
|
|
47067
47129
|
}
|
|
47068
47130
|
render() {
|
|
47069
47131
|
return [index.h("slot", null)];
|
|
@@ -47072,7 +47134,7 @@ const Table = class {
|
|
|
47072
47134
|
};
|
|
47073
47135
|
Table.style = styleCss$7;
|
|
47074
47136
|
|
|
47075
|
-
const styleCss$6 = ".sc-smoothly-table-cell-h{display:table-cell;padding:0.
|
|
47137
|
+
const styleCss$6 = ".sc-smoothly-table-cell-h{display:table-cell;vertical-align:middle;line-height:1.5rem;padding:0.2rem 0 0.2rem 1rem}";
|
|
47076
47138
|
|
|
47077
47139
|
const TableCell = class {
|
|
47078
47140
|
constructor(hostRef) {
|
|
@@ -47092,20 +47154,20 @@ const TableDemo = class {
|
|
|
47092
47154
|
}
|
|
47093
47155
|
render() {
|
|
47094
47156
|
return [
|
|
47095
|
-
index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header A"), index.h("smoothly-table-header", null, "Header B"), index.h("smoothly-table-header", null, "Header C")), index.h("smoothly-table-
|
|
47096
|
-
index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header
|
|
47157
|
+
index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header A"), index.h("smoothly-table-header", null, "Header B"), index.h("smoothly-table-header", null, "Header C"), index.h("smoothly-table-header", null, "Header D"), index.h("smoothly-table-header", null)), index.h("smoothly-table-row", null, index.h("smoothly-table-expandable-cell", null, "normal row (exp.cell)", index.h("div", { slot: "detail" }, "expandable cell 1 content")), index.h("smoothly-table-expandable-cell", null, "expandable cell", index.h("div", { slot: "detail" }, "expandable cell 2 content")), index.h("smoothly-table-expandable-cell", null, "expandable cell", index.h("div", { slot: "detail" }, "expandable cell 3 content")), index.h("smoothly-table-expandable-cell", null, "expandable cell", index.h("div", { slot: "detail" }, "expandable cell 4 content"))), index.h("smoothly-table-row", null, index.h("smoothly-table-cell", null, "normal row (nor.cell)\""), index.h("smoothly-table-cell", null, "normal cell"), index.h("smoothly-table-expandable-cell", null, "expandable cell", index.h("div", { slot: "detail" }, "expandable cell details.")), index.h("smoothly-table-expandable-cell", null, "expandable cell", index.h("div", { slot: "detail" }, "expandable cell details."))), index.h("smoothly-table-expandable-row", null, index.h("smoothly-table-cell", null, "expandable row (nor.cell)"), index.h("smoothly-table-cell", null, "Normal cell"), index.h("smoothly-table-cell", null, "normal cell"), index.h("smoothly-table-cell", null, "Normal cell"), index.h("div", { slot: "detail" }, "expandable row content"))),
|
|
47158
|
+
index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header A"), index.h("smoothly-table-header", null)), index.h("smoothly-table-expandable-row", null, "A Content", index.h("div", { slot: "detail" }, index.h("smoothly-tab-switch", null, index.h("smoothly-tab", { label: "1", open: true }, index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header B"), index.h("smoothly-table-header", null)), index.h("smoothly-table-expandable-row", null, index.h("smoothly-table-cell", null, "B Content")))))))),
|
|
47097
47159
|
];
|
|
47098
47160
|
}
|
|
47099
47161
|
};
|
|
47100
47162
|
TableDemo.style = styleCss$5;
|
|
47101
47163
|
|
|
47102
|
-
const styleCss$4 = ".sc-smoothly-table-expandable-cell-h{display:table-cell;padding:0.
|
|
47164
|
+
const styleCss$4 = ".sc-smoothly-table-expandable-cell-h{display:table-cell;vertical-align:middle;line-height:1.5em;cursor:pointer;padding:0.2em 0 0.2em;border-style:solid solid none solid;border-width:2px;border-color:rgb(var(--smoothly-default-color))}.hide.sc-smoothly-table-expandable-cell{display:none}[open].sc-smoothly-table-expandable-cell-h{position:relative;z-index:3;background-color:rgb(var(--smoothly-default-color));border-style:solid solid none solid;border-width:2px;border-color:rgb(var(--smoothly-dark-color))}.slot-detail.sc-smoothly-table-expandable-cell{position:relative;background-color:rgb(var(--smoothly-default-color));width:104%;left:-2%;border-left-style:solid;border-left-color:rgb(var(--smoothly-tertiary-color));box-shadow:0px 0px 5px 4px rgb(var(--smoothly-dark-color), 0.5);box-sizing:border-box;padding:0.5rem 2%}.sc-smoothly-table-expandable-cell-h smoothly-icon.sc-smoothly-table-expandable-cell{width:0.6rem;height:1rem;float:left;padding-left:0.2rem;padding-right:0.2rem;padding-bottom:0.5rem;transition:transform 0.2s}[open].sc-smoothly-table-expandable-cell-h smoothly-icon.sc-smoothly-table-expandable-cell{transform:rotate(90deg)}";
|
|
47103
47165
|
|
|
47104
47166
|
const TableExpandableCell = class {
|
|
47105
47167
|
constructor(hostRef) {
|
|
47106
47168
|
index.registerInstance(this, hostRef);
|
|
47107
47169
|
this.expansionOpen = index.createEvent(this, "expansionOpen", 7);
|
|
47108
|
-
this.
|
|
47170
|
+
this.expansionLoad = index.createEvent(this, "expansionLoad", 7);
|
|
47109
47171
|
this.align = "left";
|
|
47110
47172
|
}
|
|
47111
47173
|
openChanged(value) {
|
|
@@ -47119,7 +47181,7 @@ const TableExpandableCell = class {
|
|
|
47119
47181
|
this.open = !this.open;
|
|
47120
47182
|
}
|
|
47121
47183
|
componentDidLoad() {
|
|
47122
|
-
this.
|
|
47184
|
+
this.expansionLoad.emit();
|
|
47123
47185
|
}
|
|
47124
47186
|
componentDidRender() {
|
|
47125
47187
|
if (this.beginOpen) {
|
|
@@ -47128,7 +47190,7 @@ const TableExpandableCell = class {
|
|
|
47128
47190
|
}
|
|
47129
47191
|
}
|
|
47130
47192
|
render() {
|
|
47131
|
-
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("tr", { ref: e => (this.expansionElement = e) }, index.h("td", { colSpan:
|
|
47193
|
+
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("smoothly-icon", { name: "chevron-forward", size: "tiny" }), index.h("tr", { ref: e => (this.expansionElement = e) }, index.h("td", { colSpan: 999, class: !this.open ? "hide" : "" }, index.h("div", { class: "slot-detail" }, index.h("slot", { name: "detail" }))))));
|
|
47132
47194
|
}
|
|
47133
47195
|
get element() { return index.getElement(this); }
|
|
47134
47196
|
static get watchers() { return {
|
|
@@ -47137,71 +47199,71 @@ const TableExpandableCell = class {
|
|
|
47137
47199
|
};
|
|
47138
47200
|
TableExpandableCell.style = styleCss$4;
|
|
47139
47201
|
|
|
47140
|
-
const styleCss$3 = ".sc-smoothly-table-expandable-row-h{display:table-row;border:1px solid rgb(var(--smoothly-default-color));cursor:pointer}.sc-smoothly-table-expandable-row
|
|
47202
|
+
const styleCss$3 = ".sc-smoothly-table-expandable-row-h{display:table-row;border:1px solid rgb(var(--smoothly-default-color));cursor:pointer;box-sizing:border-box}.hide.sc-smoothly-table-expandable-row{display:none}.slot-detail.sc-smoothly-table-expandable-row{position:relative;background-color:rgb(var(--smoothly-default-color));width:104%;left:-2%;border-left-style:solid;border-left-color:rgb(var(--smoothly-tertiary-color));box-shadow:0px 0px 5px 2px rgb(var(--smoothly-dark-color), 0.5);box-sizing:border-box;padding:0.5rem 2%}.sc-smoothly-table-expandable-row-h smoothly-icon.sc-smoothly-table-expandable-row{width:0.6rem;height:1rem;float:left;padding-left:0.2rem;padding-right:0.2rem;padding-bottom:0.5rem;transition:transform 0.2s}[open].sc-smoothly-table-expandable-row-h smoothly-icon.sc-smoothly-table-expandable-row{transform:rotate(90deg)}[open].sc-smoothly-table-expandable-row-h smoothly-table-cell.sc-smoothly-table-expandable-row{padding-bottom:0.5rem}[open].sc-smoothly-table-expandable-row-h{position:relative;z-index:3;background-color:rgb(var(--smoothly-default-color));border-style:solid;border-width:5px;box-shadow:inset 2px 0px 0px 0px rgb(var(--smoothly-dark-color)), inset 0px 2px 0px 0px rgb(var(--smoothly-dark-color)), inset -2px 0px 0px 0px rgb(var(--smoothly-dark-color)), inset 0px 0px 0px 2px rgb(var(--smoothly-default-color))}";
|
|
47141
47203
|
|
|
47142
47204
|
const TableExpandableRow = class {
|
|
47143
47205
|
constructor(hostRef) {
|
|
47144
47206
|
index.registerInstance(this, hostRef);
|
|
47145
|
-
this.
|
|
47207
|
+
this.expansionOpen = index.createEvent(this, "expansionOpen", 7);
|
|
47208
|
+
this.align = "left";
|
|
47146
47209
|
}
|
|
47147
|
-
|
|
47148
|
-
this.
|
|
47210
|
+
openChanged(value) {
|
|
47211
|
+
if (this.expansionElement)
|
|
47212
|
+
this.element.after(this.expansionElement);
|
|
47149
47213
|
}
|
|
47150
|
-
|
|
47151
|
-
this.
|
|
47152
|
-
|
|
47153
|
-
|
|
47154
|
-
|
|
47155
|
-
|
|
47156
|
-
|
|
47214
|
+
onClick(e) {
|
|
47215
|
+
this.open = !this.open;
|
|
47216
|
+
e.stopPropagation();
|
|
47217
|
+
}
|
|
47218
|
+
componentDidRender() {
|
|
47219
|
+
this.expansionOpen.emit(this.expansionElement);
|
|
47220
|
+
if (this.expansionElement && this.open)
|
|
47221
|
+
this.element.after(this.expansionElement);
|
|
47157
47222
|
}
|
|
47158
47223
|
render() {
|
|
47159
|
-
return (index.h(index.Host,
|
|
47224
|
+
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("smoothly-table-cell", null, index.h("smoothly-icon", { name: "chevron-forward", size: "tiny" })), index.h("tr", { ref: e => (this.expansionElement = e) }, index.h("td", { colSpan: 999, class: !this.open ? "hide" : "" }, index.h("div", { class: "slot-detail" }, index.h("slot", { name: "detail" }))))));
|
|
47160
47225
|
}
|
|
47161
47226
|
get element() { return index.getElement(this); }
|
|
47227
|
+
static get watchers() { return {
|
|
47228
|
+
"open": ["openChanged"]
|
|
47229
|
+
}; }
|
|
47162
47230
|
};
|
|
47163
47231
|
TableExpandableRow.style = styleCss$3;
|
|
47164
47232
|
|
|
47165
|
-
const styleCss$2 = ".sc-smoothly-table-header-h{display:table-cell;
|
|
47233
|
+
const styleCss$2 = ".sc-smoothly-table-header-h{display:table-cell;line-height:2.5rem;background-color:rgb(var(--smoothly-color-shade));border-bottom:1px solid rgb(var(--smoothly-dark-color));padding-left:1rem;font-weight:bold;margin-bottom:5rem}";
|
|
47166
47234
|
|
|
47167
47235
|
const TableHeader = class {
|
|
47168
47236
|
constructor(hostRef) {
|
|
47169
47237
|
index.registerInstance(this, hostRef);
|
|
47170
47238
|
}
|
|
47171
47239
|
render() {
|
|
47172
|
-
return index.h("slot", null);
|
|
47240
|
+
return (index.h(index.Host, null, index.h("slot", null)));
|
|
47173
47241
|
}
|
|
47174
47242
|
};
|
|
47175
47243
|
TableHeader.style = styleCss$2;
|
|
47176
47244
|
|
|
47177
|
-
const styleCss$1 = ".sc-smoothly-table-row-h{display:table-row;border:1px solid rgb(var(--smoothly-dark-color), 0.5);cursor:
|
|
47245
|
+
const styleCss$1 = ".sc-smoothly-table-row-h{display:table-row;border:1px solid rgb(var(--smoothly-dark-color), 0.5);cursor:default}.hide.sc-smoothly-table-row{display:none}";
|
|
47178
47246
|
|
|
47179
47247
|
const TableRow = class {
|
|
47180
47248
|
constructor(hostRef) {
|
|
47181
47249
|
index.registerInstance(this, hostRef);
|
|
47182
|
-
this.
|
|
47183
|
-
this.align = "left";
|
|
47184
|
-
}
|
|
47185
|
-
openChanged(value) {
|
|
47186
|
-
if (this.expansionElement)
|
|
47187
|
-
this.element.after(this.expansionElement);
|
|
47250
|
+
this.expansions = [];
|
|
47188
47251
|
}
|
|
47189
|
-
|
|
47190
|
-
this.
|
|
47191
|
-
e.stopPropagation();
|
|
47252
|
+
onExpansionLoad(event) {
|
|
47253
|
+
this.expansions.push(event.target);
|
|
47192
47254
|
}
|
|
47193
|
-
|
|
47194
|
-
this.
|
|
47195
|
-
|
|
47196
|
-
|
|
47255
|
+
onExpansionOpen(event) {
|
|
47256
|
+
this.expansions.forEach(cell => {
|
|
47257
|
+
if (cell != event.target)
|
|
47258
|
+
cell.open = false;
|
|
47259
|
+
});
|
|
47260
|
+
if (event.detail)
|
|
47261
|
+
this.element.after(event.detail);
|
|
47197
47262
|
}
|
|
47198
47263
|
render() {
|
|
47199
|
-
return
|
|
47264
|
+
return index.h("slot", null);
|
|
47200
47265
|
}
|
|
47201
47266
|
get element() { return index.getElement(this); }
|
|
47202
|
-
static get watchers() { return {
|
|
47203
|
-
"open": ["openChanged"]
|
|
47204
|
-
}; }
|
|
47205
47267
|
};
|
|
47206
47268
|
TableRow.style = styleCss$1;
|
|
47207
47269
|
|