smoothly 0.2.2 → 0.2.5
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 +71 -25
- package/dist/cjs/smoothly.cjs.js +1 -1
- 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/tab/style.css +7 -11
- package/dist/collection/components/tab-switch/style.css +2 -1
- package/dist/collection/components/table/cell/style.css +2 -2
- package/dist/collection/components/table/demo/index.js +11 -9
- package/dist/collection/components/table/expandable/cell/index.js +3 -2
- package/dist/collection/components/table/expandable/cell/style.css +22 -26
- package/dist/collection/components/table/expandable/row/index.js +1 -1
- package/dist/collection/components/table/expandable/row/style.css +26 -25
- package/dist/collection/components/table/header/style.css +0 -1
- package/dist/collection/components/table/row/style.css +1 -1
- package/dist/collection/components/table/style.css +3 -8
- package/dist/custom-elements/index.js +74 -28
- package/dist/esm/loader.js +1 -1
- package/dist/esm/smoothly-accordion_51.entry.js +71 -25
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/{p-9d6a20c4.entry.js → p-332b1c90.entry.js} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- 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.d.ts +17 -0
- package/package.json +1 -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"],"
|
|
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"]]],[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]}],[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-cell"],[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"]]],[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
|
|
|
@@ -46251,12 +46251,15 @@ const styleCss$o = ":host{max-height:18.75rem;width:85%;max-height:var(--max-men
|
|
|
46251
46251
|
const SmoothlyMenuOptions = class {
|
|
46252
46252
|
constructor(hostRef) {
|
|
46253
46253
|
index.registerInstance(this, hostRef);
|
|
46254
|
+
this.menuEmpty = index.createEvent(this, "menuEmpty", 7);
|
|
46254
46255
|
this.filteredOptions = [];
|
|
46255
46256
|
this.highlightIndex = 0;
|
|
46256
46257
|
this.emptyMenuLabel = "No Options";
|
|
46258
|
+
this.newOptionLabel = "Add:";
|
|
46257
46259
|
this.order = false;
|
|
46258
46260
|
this.options = [];
|
|
46259
46261
|
this.resetHighlightOnOptionsChange = true;
|
|
46262
|
+
this.mutable = false;
|
|
46260
46263
|
}
|
|
46261
46264
|
optionsChangeHandler(newOptions) {
|
|
46262
46265
|
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
@@ -46295,6 +46298,7 @@ const SmoothlyMenuOptions = class {
|
|
|
46295
46298
|
return result;
|
|
46296
46299
|
}
|
|
46297
46300
|
async filterOptions(keyword, excludeValues = []) {
|
|
46301
|
+
this.keyword = keyword;
|
|
46298
46302
|
const keywordLowercase = keyword.toLowerCase();
|
|
46299
46303
|
this.filteredOptions = [];
|
|
46300
46304
|
for (const option of this.options) {
|
|
@@ -46302,6 +46306,7 @@ const SmoothlyMenuOptions = class {
|
|
|
46302
46306
|
const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
|
|
46303
46307
|
isVisible && this.filteredOptions.push(option);
|
|
46304
46308
|
}
|
|
46309
|
+
this.menuEmpty.emit(!this.filteredOptions.length);
|
|
46305
46310
|
this.order && this.sortOptions(keyword);
|
|
46306
46311
|
}
|
|
46307
46312
|
sortOptions(keyword) {
|
|
@@ -46338,7 +46343,7 @@ const SmoothlyMenuOptions = class {
|
|
|
46338
46343
|
}
|
|
46339
46344
|
}
|
|
46340
46345
|
render() {
|
|
46341
|
-
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))));
|
|
46342
46347
|
}
|
|
46343
46348
|
get element() { return index.getElement(this); }
|
|
46344
46349
|
static get watchers() { return {
|
|
@@ -46429,13 +46434,14 @@ const Notifier = class {
|
|
|
46429
46434
|
};
|
|
46430
46435
|
Notifier.style = styleCss$m;
|
|
46431
46436
|
|
|
46432
|
-
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}";
|
|
46433
46438
|
|
|
46434
46439
|
const SmoothlyOption = class {
|
|
46435
46440
|
constructor(hostRef) {
|
|
46436
46441
|
index.registerInstance(this, hostRef);
|
|
46437
46442
|
this.optionHover = index.createEvent(this, "optionHover", 7);
|
|
46438
46443
|
this.optionSelect = index.createEvent(this, "optionSelect", 7);
|
|
46444
|
+
this.optionAdd = index.createEvent(this, "optionAdd", 7);
|
|
46439
46445
|
this.dataHighlight = false;
|
|
46440
46446
|
this.divider = false;
|
|
46441
46447
|
}
|
|
@@ -46444,7 +46450,9 @@ const SmoothlyOption = class {
|
|
|
46444
46450
|
}
|
|
46445
46451
|
onSelect(event) {
|
|
46446
46452
|
if (this.value)
|
|
46447
|
-
this.
|
|
46453
|
+
this.new
|
|
46454
|
+
? this.optionAdd.emit({ name: this.name, value: this.value })
|
|
46455
|
+
: this.optionSelect.emit({ name: this.name, value: this.value });
|
|
46448
46456
|
else
|
|
46449
46457
|
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
46450
46458
|
}
|
|
@@ -46461,15 +46469,20 @@ const SmoothlyPicker = class {
|
|
|
46461
46469
|
constructor(hostRef) {
|
|
46462
46470
|
index.registerInstance(this, hostRef);
|
|
46463
46471
|
this.menuClose = index.createEvent(this, "menuClose", 7);
|
|
46472
|
+
this.notice = index.createEvent(this, "notice", 7);
|
|
46464
46473
|
this.keepFocusOnReRender = false;
|
|
46465
46474
|
this.emptyMenuLabel = "No Options";
|
|
46466
46475
|
this.multiple = false;
|
|
46476
|
+
this.mutable = false;
|
|
46467
46477
|
this.options = [];
|
|
46468
46478
|
this.selections = [];
|
|
46469
46479
|
this.selectNoneName = "Select None";
|
|
46480
|
+
this.selectAllName = "Select All";
|
|
46470
46481
|
this.selectionName = "items selected";
|
|
46482
|
+
this.newOptionLabel = "Add:";
|
|
46483
|
+
this.valueValidator = _ => [true, undefined];
|
|
46471
46484
|
}
|
|
46472
|
-
|
|
46485
|
+
isOpenChangeHandler() {
|
|
46473
46486
|
if (this.isOpen == false) {
|
|
46474
46487
|
this.menuClose.emit(this.selections);
|
|
46475
46488
|
}
|
|
@@ -46481,10 +46494,26 @@ const SmoothlyPicker = class {
|
|
|
46481
46494
|
this.keepFocusOnReRender = false;
|
|
46482
46495
|
}
|
|
46483
46496
|
}
|
|
46484
|
-
|
|
46497
|
+
optionSelectHandler(event) {
|
|
46485
46498
|
this.toggle(event.detail);
|
|
46486
46499
|
event.stopPropagation();
|
|
46487
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
|
+
}
|
|
46488
46517
|
toggle(option) {
|
|
46489
46518
|
option.value == "select-none"
|
|
46490
46519
|
? this.toggleAll()
|
|
@@ -46519,9 +46548,19 @@ const SmoothlyPicker = class {
|
|
|
46519
46548
|
}
|
|
46520
46549
|
toggleHighlighted() {
|
|
46521
46550
|
var _a;
|
|
46522
|
-
(
|
|
46523
|
-
|
|
46524
|
-
|
|
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
|
+
});
|
|
46525
46564
|
}
|
|
46526
46565
|
highlightDefault() {
|
|
46527
46566
|
var _a;
|
|
@@ -46583,7 +46622,7 @@ const SmoothlyPicker = class {
|
|
|
46583
46622
|
? [
|
|
46584
46623
|
{
|
|
46585
46624
|
value: "select-none",
|
|
46586
|
-
name: this.selectNoneName,
|
|
46625
|
+
name: this.selections.length == this.options.length ? this.selectNoneName : this.selectAllName,
|
|
46587
46626
|
left: this.getCheckHtml(this.selections.length == ((_c = this.options) === null || _c === void 0 ? void 0 : _c.length)),
|
|
46588
46627
|
divider: true,
|
|
46589
46628
|
},
|
|
@@ -46593,12 +46632,12 @@ const SmoothlyPicker = class {
|
|
|
46593
46632
|
];
|
|
46594
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
|
|
46595
46634
|
? this.selections.length.toString() + " " + this.selectionName
|
|
46596
|
-
: 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 })));
|
|
46597
46636
|
}
|
|
46598
46637
|
get element() { return index.getElement(this); }
|
|
46599
46638
|
static get watchers() { return {
|
|
46600
|
-
"selections": ["
|
|
46601
|
-
"isOpen": ["
|
|
46639
|
+
"selections": ["isOpenChangeHandler"],
|
|
46640
|
+
"isOpen": ["isOpenChangeHandler"]
|
|
46602
46641
|
}; }
|
|
46603
46642
|
};
|
|
46604
46643
|
SmoothlyPicker.style = styleCss$k;
|
|
@@ -46746,7 +46785,7 @@ const SmoothlySelectDemo = class {
|
|
|
46746
46785
|
{ name: "Scary Kraken", value: "kraken" },
|
|
46747
46786
|
] }),
|
|
46748
46787
|
index.h("br", null),
|
|
46749
|
-
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: [
|
|
46750
46789
|
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
46751
46790
|
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
46752
46791
|
{ name: "Noble Pig", value: "pig" },
|
|
@@ -46760,6 +46799,13 @@ const SmoothlySelectDemo = class {
|
|
|
46760
46799
|
{ name: "Scary Kraken", value: "kraken" },
|
|
46761
46800
|
] }),
|
|
46762
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),
|
|
46763
46809
|
index.h("smoothly-picker", { label: "Single select", multiple: false, "max-menu-height": "200px", options: [
|
|
46764
46810
|
{ name: "Dog", value: "dog", aliases: ["WOFF"], right: "Woof 🐶" },
|
|
46765
46811
|
{ name: "Cat", value: "cat", aliases: ["moew"] },
|
|
@@ -47015,7 +47061,7 @@ const SmoothlySvg = class {
|
|
|
47015
47061
|
};
|
|
47016
47062
|
SmoothlySvg.style = styleCss$a;
|
|
47017
47063
|
|
|
47018
|
-
const styleCss$9 = "
|
|
47064
|
+
const styleCss$9 = "[open].sc-smoothly-tab-h{border-bottom:3px solid rgb(var(--smoothly-primary-color));box-sizing:border-box;margin-bottom:-3px}.hide.sc-smoothly-tab{display:none}label.sc-smoothly-tab{display:block;padding:.5rem;background-color:transparent;width:auto}";
|
|
47019
47065
|
|
|
47020
47066
|
const SmoothlyTab = class {
|
|
47021
47067
|
constructor(hostRef) {
|
|
@@ -47045,7 +47091,7 @@ const SmoothlyTab = class {
|
|
|
47045
47091
|
};
|
|
47046
47092
|
SmoothlyTab.style = styleCss$9;
|
|
47047
47093
|
|
|
47048
|
-
const styleCss$8 = ".sc-smoothly-tab-switch-h{display:flex;flex-direction:row;
|
|
47094
|
+
const styleCss$8 = ".sc-smoothly-tab-switch-h{display:flex;flex-direction:row;justify-content:space-around;border-bottom:3px solid rgb(var(--smoothly-default-shade))}";
|
|
47049
47095
|
|
|
47050
47096
|
const SmoothlyTabSwitch = class {
|
|
47051
47097
|
constructor(hostRef) {
|
|
@@ -47071,7 +47117,7 @@ const SmoothlyTabSwitch = class {
|
|
|
47071
47117
|
};
|
|
47072
47118
|
SmoothlyTabSwitch.style = styleCss$8;
|
|
47073
47119
|
|
|
47074
|
-
const styleCss$7 = ".sc-smoothly-table-h{display:table;
|
|
47120
|
+
const styleCss$7 = ".sc-smoothly-table-h{display:table;border-collapse:collapse;border:1px solid rgb(var(--smoothly-dark-color));width:var(--table-width, 80%);box-sizing:border-box;background-color:rgb(var(--smoothly-default-color));margin:auto}";
|
|
47075
47121
|
|
|
47076
47122
|
const Table = class {
|
|
47077
47123
|
constructor(hostRef) {
|
|
@@ -47088,7 +47134,7 @@ const Table = class {
|
|
|
47088
47134
|
};
|
|
47089
47135
|
Table.style = styleCss$7;
|
|
47090
47136
|
|
|
47091
|
-
const styleCss$6 = ".sc-smoothly-table-cell-h{display:table-cell;
|
|
47137
|
+
const styleCss$6 = ".sc-smoothly-table-cell-h{display:table-cell;line-height:1.5rem;white-space:nowrap;padding:0.3rem 0 0.3rem 1rem}";
|
|
47092
47138
|
|
|
47093
47139
|
const TableCell = class {
|
|
47094
47140
|
constructor(hostRef) {
|
|
@@ -47108,14 +47154,14 @@ const TableDemo = class {
|
|
|
47108
47154
|
}
|
|
47109
47155
|
render() {
|
|
47110
47156
|
return [
|
|
47111
|
-
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")
|
|
47112
|
-
index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header A"), index.h("smoothly-table-
|
|
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-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-expandable-row", null, index.h("smoothly-table-cell", null, "A Content"), index.h("div", { slot: "detail" }, index.h("smoothly-tab-switch", null, index.h("smoothly-tab", { label: "innertable 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-expandable-row", null, "B Content"))), index.h("smoothly-tab", { label: "innertable 2" }, index.h("smoothly-table", null, index.h("smoothly-table-row", null, index.h("smoothly-table-header", null, "Header C")), index.h("smoothly-table-expandable-row", null, index.h("smoothly-table-cell", null, "C Content")))))))),
|
|
47113
47159
|
];
|
|
47114
47160
|
}
|
|
47115
47161
|
};
|
|
47116
47162
|
TableDemo.style = styleCss$5;
|
|
47117
47163
|
|
|
47118
|
-
const styleCss$4 = ".sc-smoothly-table-expandable-cell-h{display:table-cell;
|
|
47164
|
+
const styleCss$4 = ".sc-smoothly-table-expandable-cell-h{display:table-cell;padding:0.3rem 0 0.3rem 0;cursor:pointer;line-height:1.5rem}[open].sc-smoothly-table-expandable-cell-h{position:relative;z-index:3;background-color:rgb(var(--smoothly-default-color));border:2px solid rgb(var(--smoothly-dark-color));border-bottom:none}.sc-smoothly-table-expandable-cell-h smoothly-icon.sc-smoothly-table-expandable-cell{width:0.6rem;float:left;padding:0 0.3rem;transition:transform 0.2s}[open].sc-smoothly-table-expandable-cell-h smoothly-icon.sc-smoothly-table-expandable-cell{transform:rotate(90deg)}aside.sc-smoothly-table-expandable-cell{display:flex}.hide.sc-smoothly-table-expandable-cell{display:none}.slot-detail.sc-smoothly-table-expandable-cell{position:relative;background-color:rgb(var(--smoothly-default-color));width:104%;left:-2%;border-left:2px solid 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%}";
|
|
47119
47165
|
|
|
47120
47166
|
const TableExpandableCell = class {
|
|
47121
47167
|
constructor(hostRef) {
|
|
@@ -47144,7 +47190,7 @@ const TableExpandableCell = class {
|
|
|
47144
47190
|
}
|
|
47145
47191
|
}
|
|
47146
47192
|
render() {
|
|
47147
|
-
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("
|
|
47193
|
+
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("aside", null, index.h("smoothly-icon", { name: "chevron-forward", size: "tiny" }), index.h("slot", null)), 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" }))))));
|
|
47148
47194
|
}
|
|
47149
47195
|
get element() { return index.getElement(this); }
|
|
47150
47196
|
static get watchers() { return {
|
|
@@ -47153,7 +47199,7 @@ const TableExpandableCell = class {
|
|
|
47153
47199
|
};
|
|
47154
47200
|
TableExpandableCell.style = styleCss$4;
|
|
47155
47201
|
|
|
47156
|
-
const styleCss$3 = ".sc-smoothly-table-expandable-row-h{display:table-row
|
|
47202
|
+
const styleCss$3 = ".sc-smoothly-table-expandable-row-h{display:table-row-group;cursor:pointer;line-height:1.5rem}[open].sc-smoothly-table-expandable-row-h{position:relative;z-index:3;background-color:rgb(var(--smoothly-default-color));border:2px solid rgb(var(--smoothly-dark-color));border-bottom:none}.sc-smoothly-table-expandable-row-h smoothly-icon.sc-smoothly-table-expandable-row{width:0.6rem;height:1rem;position:absolute;right:1rem;top:-1.8rem;transition:transform 0.2s}[open].sc-smoothly-table-expandable-row-h smoothly-icon.sc-smoothly-table-expandable-row{transform:rotate(90deg)}aside.sc-smoothly-table-expandable-row{display:table-row;position:relative}.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 4px 2px rgb(var(--smoothly-dark-color));box-sizing:border-box;padding:0.5rem 2%}";
|
|
47157
47203
|
|
|
47158
47204
|
const TableExpandableRow = class {
|
|
47159
47205
|
constructor(hostRef) {
|
|
@@ -47175,7 +47221,7 @@ const TableExpandableRow = class {
|
|
|
47175
47221
|
this.element.after(this.expansionElement);
|
|
47176
47222
|
}
|
|
47177
47223
|
render() {
|
|
47178
|
-
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("
|
|
47224
|
+
return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("aside", 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" }))))));
|
|
47179
47225
|
}
|
|
47180
47226
|
get element() { return index.getElement(this); }
|
|
47181
47227
|
static get watchers() { return {
|
|
@@ -47184,7 +47230,7 @@ const TableExpandableRow = class {
|
|
|
47184
47230
|
};
|
|
47185
47231
|
TableExpandableRow.style = styleCss$3;
|
|
47186
47232
|
|
|
47187
|
-
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
|
|
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}";
|
|
47188
47234
|
|
|
47189
47235
|
const TableHeader = class {
|
|
47190
47236
|
constructor(hostRef) {
|
|
@@ -47196,7 +47242,7 @@ const TableHeader = class {
|
|
|
47196
47242
|
};
|
|
47197
47243
|
TableHeader.style = styleCss$2;
|
|
47198
47244
|
|
|
47199
|
-
const styleCss$1 = ".sc-smoothly-table-row-h{display:table-row;
|
|
47245
|
+
const styleCss$1 = ".sc-smoothly-table-row-h{display:table-row;cursor:default;line-height:1.5rem}.hide.sc-smoothly-table-row{display:none}";
|
|
47200
47246
|
|
|
47201
47247
|
const TableRow = class {
|
|
47202
47248
|
constructor(hostRef) {
|
package/dist/cjs/smoothly.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["smoothly-google-font.cjs",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-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"],"
|
|
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_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"]]],[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]}],[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-cell"],[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"]]],[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);
|
|
19
19
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Component, Element, h, Host, Listen, Method, Prop, State, Watch } from "@stencil/core";
|
|
1
|
+
import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from "@stencil/core";
|
|
2
2
|
export class SmoothlyMenuOptions {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.filteredOptions = [];
|
|
5
5
|
this.highlightIndex = 0;
|
|
6
6
|
this.emptyMenuLabel = "No Options";
|
|
7
|
+
this.newOptionLabel = "Add:";
|
|
7
8
|
this.order = false;
|
|
8
9
|
this.options = [];
|
|
9
10
|
this.resetHighlightOnOptionsChange = true;
|
|
11
|
+
this.mutable = false;
|
|
10
12
|
}
|
|
11
13
|
optionsChangeHandler(newOptions) {
|
|
12
14
|
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
@@ -45,6 +47,7 @@ export class SmoothlyMenuOptions {
|
|
|
45
47
|
return result;
|
|
46
48
|
}
|
|
47
49
|
async filterOptions(keyword, excludeValues = []) {
|
|
50
|
+
this.keyword = keyword;
|
|
48
51
|
const keywordLowercase = keyword.toLowerCase();
|
|
49
52
|
this.filteredOptions = [];
|
|
50
53
|
for (const option of this.options) {
|
|
@@ -52,6 +55,7 @@ export class SmoothlyMenuOptions {
|
|
|
52
55
|
const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
|
|
53
56
|
isVisible && this.filteredOptions.push(option);
|
|
54
57
|
}
|
|
58
|
+
this.menuEmpty.emit(!this.filteredOptions.length);
|
|
55
59
|
this.order && this.sortOptions(keyword);
|
|
56
60
|
}
|
|
57
61
|
sortOptions(keyword) {
|
|
@@ -90,7 +94,11 @@ export class SmoothlyMenuOptions {
|
|
|
90
94
|
render() {
|
|
91
95
|
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle, ref: el => index == 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 },
|
|
92
96
|
option.left ? h("div", { slot: "left" }, option.left) : undefined,
|
|
93
|
-
option.right ? h("div", { slot: "right" }, option.right) : undefined)))) : (h("
|
|
97
|
+
option.right ? h("div", { slot: "right" }, option.right) : undefined)))) : this.mutable ? (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 },
|
|
98
|
+
h("div", { slot: "left" },
|
|
99
|
+
h("smoothly-icon", { name: "square-outline", size: "small" }),
|
|
100
|
+
" ",
|
|
101
|
+
this.newOptionLabel))) : (h("div", null, this.emptyMenuLabel))));
|
|
94
102
|
}
|
|
95
103
|
static get is() { return "smoothly-menu-options"; }
|
|
96
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -119,6 +127,24 @@ export class SmoothlyMenuOptions {
|
|
|
119
127
|
"reflect": false,
|
|
120
128
|
"defaultValue": "\"No Options\""
|
|
121
129
|
},
|
|
130
|
+
"newOptionLabel": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "string",
|
|
135
|
+
"resolved": "string",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": ""
|
|
143
|
+
},
|
|
144
|
+
"attribute": "new-option-label",
|
|
145
|
+
"reflect": false,
|
|
146
|
+
"defaultValue": "\"Add:\""
|
|
147
|
+
},
|
|
122
148
|
"maxMenuHeight": {
|
|
123
149
|
"type": "string",
|
|
124
150
|
"mutable": false,
|
|
@@ -209,12 +235,47 @@ export class SmoothlyMenuOptions {
|
|
|
209
235
|
"attribute": "reset-highlight-on-options-change",
|
|
210
236
|
"reflect": false,
|
|
211
237
|
"defaultValue": "true"
|
|
238
|
+
},
|
|
239
|
+
"mutable": {
|
|
240
|
+
"type": "boolean",
|
|
241
|
+
"mutable": false,
|
|
242
|
+
"complexType": {
|
|
243
|
+
"original": "boolean",
|
|
244
|
+
"resolved": "boolean",
|
|
245
|
+
"references": {}
|
|
246
|
+
},
|
|
247
|
+
"required": false,
|
|
248
|
+
"optional": false,
|
|
249
|
+
"docs": {
|
|
250
|
+
"tags": [],
|
|
251
|
+
"text": ""
|
|
252
|
+
},
|
|
253
|
+
"attribute": "mutable",
|
|
254
|
+
"reflect": false,
|
|
255
|
+
"defaultValue": "false"
|
|
212
256
|
}
|
|
213
257
|
}; }
|
|
214
258
|
static get states() { return {
|
|
215
259
|
"filteredOptions": {},
|
|
216
|
-
"highlightIndex": {}
|
|
260
|
+
"highlightIndex": {},
|
|
261
|
+
"keyword": {}
|
|
217
262
|
}; }
|
|
263
|
+
static get events() { return [{
|
|
264
|
+
"method": "menuEmpty",
|
|
265
|
+
"name": "menuEmpty",
|
|
266
|
+
"bubbles": true,
|
|
267
|
+
"cancelable": true,
|
|
268
|
+
"composed": true,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": ""
|
|
272
|
+
},
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "boolean",
|
|
275
|
+
"resolved": "boolean",
|
|
276
|
+
"references": {}
|
|
277
|
+
}
|
|
278
|
+
}]; }
|
|
218
279
|
static get methods() { return {
|
|
219
280
|
"moveHighlight": {
|
|
220
281
|
"complexType": {
|
|
@@ -9,7 +9,9 @@ export class SmoothlyOption {
|
|
|
9
9
|
}
|
|
10
10
|
onSelect(event) {
|
|
11
11
|
if (this.value)
|
|
12
|
-
this.
|
|
12
|
+
this.new
|
|
13
|
+
? this.optionAdd.emit({ name: this.name, value: this.value })
|
|
14
|
+
: this.optionSelect.emit({ name: this.name, value: this.value });
|
|
13
15
|
else
|
|
14
16
|
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
15
17
|
}
|
|
@@ -114,6 +116,23 @@ export class SmoothlyOption {
|
|
|
114
116
|
"attribute": "divider",
|
|
115
117
|
"reflect": true,
|
|
116
118
|
"defaultValue": "false"
|
|
119
|
+
},
|
|
120
|
+
"new": {
|
|
121
|
+
"type": "boolean",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "boolean",
|
|
125
|
+
"resolved": "boolean | undefined",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": true,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": ""
|
|
133
|
+
},
|
|
134
|
+
"attribute": "new",
|
|
135
|
+
"reflect": false
|
|
117
136
|
}
|
|
118
137
|
}; }
|
|
119
138
|
static get events() { return [{
|
|
@@ -146,6 +165,21 @@ export class SmoothlyOption {
|
|
|
146
165
|
"resolved": "{ value: any; name: string; }",
|
|
147
166
|
"references": {}
|
|
148
167
|
}
|
|
168
|
+
}, {
|
|
169
|
+
"method": "optionAdd",
|
|
170
|
+
"name": "optionAdd",
|
|
171
|
+
"bubbles": true,
|
|
172
|
+
"cancelable": true,
|
|
173
|
+
"composed": true,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": ""
|
|
177
|
+
},
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "{ name: string; value: string }",
|
|
180
|
+
"resolved": "{ name: string; value: string; }",
|
|
181
|
+
"references": {}
|
|
182
|
+
}
|
|
149
183
|
}]; }
|
|
150
184
|
static get elementRef() { return "element"; }
|
|
151
185
|
}
|