smoothly 0.1.112 → 0.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Notice-9c2b52b7.js → Notice-839702d8.js} +34 -26
- package/dist/cjs/{Trigger-74bd1ee8.js → Trigger-cf376531.js} +55 -146
- package/dist/cjs/{index-41a36ce2.js → index-1c61bdd3.js} +27 -1
- package/dist/cjs/index.cjs.js +20 -8
- package/dist/cjs/loader.cjs.js +3 -19
- package/dist/cjs/{smoothly-accordion_50.cjs.entry.js → smoothly-accordion_51.cjs.entry.js} +7694 -1487
- package/dist/cjs/smoothly-google-font.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-reorder.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +5 -5
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +5 -5
- package/dist/cjs/smoothly.cjs.js +5 -113
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/app-demo/index.js +6 -1
- package/dist/collection/components/button/index.js +168 -0
- package/dist/collection/components/button/style.css +49 -0
- package/dist/collection/components/input/style.css +2 -2
- package/dist/collection/components/picker/index.js +10 -6
- package/dist/collection/components/trigger/style.css +3 -3
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +7781 -2970
- package/dist/esm/{Notice-4131b4e0.js → Notice-608b552c.js} +34 -26
- package/dist/esm/{Trigger-d7b181ec.js → Trigger-365408f0.js} +55 -146
- package/dist/esm/{index-dcb2b612.js → index-a3737440.js} +27 -1
- package/dist/esm/index.js +17 -4
- package/dist/esm/loader.js +3 -19
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{smoothly-accordion_50.entry.js → smoothly-accordion_51.entry.js} +7694 -1488
- package/dist/esm/smoothly-google-font.entry.js +2 -2
- package/dist/esm/smoothly-radio-group.entry.js +2 -2
- package/dist/esm/smoothly-reorder.entry.js +2 -2
- package/dist/esm/smoothly-trigger-sink.entry.js +3 -3
- package/dist/esm/smoothly-trigger-source.entry.js +3 -3
- package/dist/esm/smoothly.js +5 -113
- package/dist/smoothly/index.esm.js +1 -376
- package/dist/smoothly/p-0215b4da.entry.js +1 -0
- package/dist/smoothly/{p-074a0448.js → p-0cba3e3d.js} +1 -1
- package/dist/smoothly/p-18a1063c.entry.js +1 -0
- package/dist/smoothly/p-6ca0d36c.js +1 -0
- package/dist/smoothly/p-6f009ac9.entry.js +1 -0
- package/dist/smoothly/p-7a30d9b8.js +1 -0
- package/dist/smoothly/p-8ae38136.entry.js +1 -0
- package/dist/smoothly/p-993534fa.entry.js +1 -0
- package/dist/smoothly/p-eec1c703.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -125
- package/dist/types/components/button/index.d.ts +11 -0
- package/dist/types/components.d.ts +27 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/package.json +18 -18
- package/dist/cjs/App-339acc9b.js +0 -647
- package/dist/cjs/_commonjsHelpers-10109b76.js +0 -48
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-88cc6900.js +0 -6
- package/dist/cjs/dom-95afd968.js +0 -75
- package/dist/cjs/generate-f9a36f25.js +0 -66
- package/dist/cjs/index-138c41c2.js +0 -3066
- package/dist/cjs/index-40d009d5.js +0 -1354
- package/dist/cjs/index-ac32385c.js +0 -18850
- package/dist/cjs/index-d66869d7.js +0 -1672
- package/dist/cjs/shadow-css-71d0f821.js +0 -391
- package/dist/cjs/smoothly-accordion-item.cjs.entry.js +0 -54
- package/dist/cjs/smoothly-accordion.cjs.entry.js +0 -55
- package/dist/cjs/smoothly-app-demo.cjs.entry.js +0 -29
- package/dist/cjs/smoothly-app.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-backtotop.cjs.entry.js +0 -37
- package/dist/cjs/smoothly-calendar.cjs.entry.js +0 -95
- package/dist/cjs/smoothly-checkbox.cjs.entry.js +0 -18671
- package/dist/cjs/smoothly-dialog-demo.cjs.entry.js +0 -16
- package/dist/cjs/smoothly-dialog.cjs.entry.js +0 -38
- package/dist/cjs/smoothly-display-amount.cjs.entry.js +0 -59
- package/dist/cjs/smoothly-display-date-time.cjs.entry.js +0 -20
- package/dist/cjs/smoothly-display-demo.cjs.entry.js +0 -25
- package/dist/cjs/smoothly-display.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-frame.cjs.entry.js +0 -50
- package/dist/cjs/smoothly-icon-demo.cjs.entry.js +0 -491
- package/dist/cjs/smoothly-icon.cjs.entry.js +0 -52
- package/dist/cjs/smoothly-input-date-range.cjs.entry.js +0 -50
- package/dist/cjs/smoothly-input-date.cjs.entry.js +0 -44
- package/dist/cjs/smoothly-input-demo.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-input-month.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-input.cjs.entry.js +0 -202
- package/dist/cjs/smoothly-item.cjs.entry.js +0 -43
- package/dist/cjs/smoothly-menu-options.cjs.entry.js +0 -108
- package/dist/cjs/smoothly-notification.cjs.entry.js +0 -67
- package/dist/cjs/smoothly-notifier.cjs.entry.js +0 -29
- package/dist/cjs/smoothly-option.cjs.entry.js +0 -33
- package/dist/cjs/smoothly-picker.cjs.entry.js +0 -151
- package/dist/cjs/smoothly-popup.cjs.entry.js +0 -38
- package/dist/cjs/smoothly-quiet.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-radio.cjs.entry.js +0 -28
- package/dist/cjs/smoothly-room.cjs.entry.js +0 -16
- package/dist/cjs/smoothly-select-demo.cjs.entry.js +0 -86
- package/dist/cjs/smoothly-select.cjs.entry.js +0 -31
- package/dist/cjs/smoothly-selector.cjs.entry.js +0 -119
- package/dist/cjs/smoothly-skeleton.cjs.entry.js +0 -27
- package/dist/cjs/smoothly-spinner.cjs.entry.js +0 -24
- package/dist/cjs/smoothly-submit.cjs.entry.js +0 -60
- package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-tab-switch.cjs.entry.js +0 -32
- package/dist/cjs/smoothly-tab.cjs.entry.js +0 -37
- package/dist/cjs/smoothly-table-cell.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-table-demo.cjs.entry.js +0 -22
- package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +0 -45
- package/dist/cjs/smoothly-table-expandable-row.cjs.entry.js +0 -32
- package/dist/cjs/smoothly-table-header.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-table-row.cjs.entry.js +0 -38
- package/dist/cjs/smoothly-table.cjs.entry.js +0 -26
- package/dist/cjs/smoothly-trigger.cjs.entry.js +0 -36
- package/dist/cjs/smoothly-tuple.cjs.entry.js +0 -16
- package/dist/cjs/smoothly-urlencoded.cjs.entry.js +0 -19
- package/dist/esm/App-22187759.js +0 -645
- package/dist/esm/_commonjsHelpers-8fe71198.js +0 -44
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-c64026cd.js +0 -4
- package/dist/esm/dom-a712b575.js +0 -73
- package/dist/esm/generate-50b98474.js +0 -61
- package/dist/esm/index-02a70ac1.js +0 -3027
- package/dist/esm/index-401c6ce3.js +0 -1670
- package/dist/esm/index-a5a08f46.js +0 -18848
- package/dist/esm/index-c8b5d468.js +0 -1349
- package/dist/esm/shadow-css-1e16431b.js +0 -389
- package/dist/esm/smoothly-accordion-item.entry.js +0 -50
- package/dist/esm/smoothly-accordion.entry.js +0 -51
- package/dist/esm/smoothly-app-demo.entry.js +0 -25
- package/dist/esm/smoothly-app.entry.js +0 -15
- package/dist/esm/smoothly-backtotop.entry.js +0 -33
- package/dist/esm/smoothly-calendar.entry.js +0 -91
- package/dist/esm/smoothly-checkbox.entry.js +0 -18667
- package/dist/esm/smoothly-dialog-demo.entry.js +0 -12
- package/dist/esm/smoothly-dialog.entry.js +0 -34
- package/dist/esm/smoothly-display-amount.entry.js +0 -55
- package/dist/esm/smoothly-display-date-time.entry.js +0 -16
- package/dist/esm/smoothly-display-demo.entry.js +0 -21
- package/dist/esm/smoothly-display.entry.js +0 -37
- package/dist/esm/smoothly-frame.entry.js +0 -46
- package/dist/esm/smoothly-icon-demo.entry.js +0 -487
- package/dist/esm/smoothly-icon.entry.js +0 -48
- package/dist/esm/smoothly-input-date-range.entry.js +0 -46
- package/dist/esm/smoothly-input-date.entry.js +0 -40
- package/dist/esm/smoothly-input-demo.entry.js +0 -15
- package/dist/esm/smoothly-input-month.entry.js +0 -37
- package/dist/esm/smoothly-input.entry.js +0 -198
- package/dist/esm/smoothly-item.entry.js +0 -39
- package/dist/esm/smoothly-menu-options.entry.js +0 -104
- package/dist/esm/smoothly-notification.entry.js +0 -63
- package/dist/esm/smoothly-notifier.entry.js +0 -25
- package/dist/esm/smoothly-option.entry.js +0 -29
- package/dist/esm/smoothly-picker.entry.js +0 -147
- package/dist/esm/smoothly-popup.entry.js +0 -34
- package/dist/esm/smoothly-quiet.entry.js +0 -15
- package/dist/esm/smoothly-radio.entry.js +0 -24
- package/dist/esm/smoothly-room.entry.js +0 -12
- package/dist/esm/smoothly-select-demo.entry.js +0 -82
- package/dist/esm/smoothly-select.entry.js +0 -27
- package/dist/esm/smoothly-selector.entry.js +0 -115
- package/dist/esm/smoothly-skeleton.entry.js +0 -23
- package/dist/esm/smoothly-spinner.entry.js +0 -20
- package/dist/esm/smoothly-submit.entry.js +0 -56
- package/dist/esm/smoothly-svg.entry.js +0 -37
- package/dist/esm/smoothly-tab-switch.entry.js +0 -28
- package/dist/esm/smoothly-tab.entry.js +0 -33
- package/dist/esm/smoothly-table-cell.entry.js +0 -15
- package/dist/esm/smoothly-table-demo.entry.js +0 -18
- package/dist/esm/smoothly-table-expandable-cell.entry.js +0 -41
- package/dist/esm/smoothly-table-expandable-row.entry.js +0 -28
- package/dist/esm/smoothly-table-header.entry.js +0 -37
- package/dist/esm/smoothly-table-row.entry.js +0 -34
- package/dist/esm/smoothly-table.entry.js +0 -22
- package/dist/esm/smoothly-trigger.entry.js +0 -32
- package/dist/esm/smoothly-tuple.entry.js +0 -12
- package/dist/esm/smoothly-urlencoded.entry.js +0 -15
- package/dist/smoothly/App-22187759.js +0 -645
- package/dist/smoothly/GoogleFont-8474516b.js +0 -21
- package/dist/smoothly/_commonjsHelpers-8fe71198.js +0 -44
- package/dist/smoothly/app-globals-0f993ce5.js +0 -3
- package/dist/smoothly/css-shim-c64026cd.js +0 -4
- package/dist/smoothly/dom-a712b575.js +0 -73
- package/dist/smoothly/generate-50b98474.js +0 -61
- package/dist/smoothly/index-02a70ac1.js +0 -3027
- package/dist/smoothly/index-401c6ce3.js +0 -1670
- package/dist/smoothly/index-a5a08f46.js +0 -18848
- package/dist/smoothly/index-c8b5d468.js +0 -1349
- package/dist/smoothly/p-0c1e9588.entry.js +0 -1
- package/dist/smoothly/p-14232157.entry.js +0 -1
- package/dist/smoothly/p-19518931.js +0 -1
- package/dist/smoothly/p-22d4d5a7.entry.js +0 -1
- package/dist/smoothly/p-2cda1784.js +0 -1
- package/dist/smoothly/p-436cd558.entry.js +0 -1
- package/dist/smoothly/p-9fa3ab06.entry.js +0 -1
- package/dist/smoothly/p-b8a3e273.entry.js +0 -1
- package/dist/smoothly/shadow-css-1e16431b.js +0 -389
- package/dist/smoothly/smoothly-accordion-item.entry.js +0 -50
- package/dist/smoothly/smoothly-accordion.entry.js +0 -51
- package/dist/smoothly/smoothly-app-demo.entry.js +0 -25
- package/dist/smoothly/smoothly-app.entry.js +0 -15
- package/dist/smoothly/smoothly-backtotop.entry.js +0 -33
- package/dist/smoothly/smoothly-calendar.entry.js +0 -91
- package/dist/smoothly/smoothly-checkbox.entry.js +0 -18667
- package/dist/smoothly/smoothly-dialog-demo.entry.js +0 -12
- package/dist/smoothly/smoothly-dialog.entry.js +0 -34
- package/dist/smoothly/smoothly-display-amount.entry.js +0 -55
- package/dist/smoothly/smoothly-display-date-time.entry.js +0 -16
- package/dist/smoothly/smoothly-display-demo.entry.js +0 -21
- package/dist/smoothly/smoothly-display.entry.js +0 -37
- package/dist/smoothly/smoothly-frame.entry.js +0 -46
- package/dist/smoothly/smoothly-google-font.entry.js +0 -13
- package/dist/smoothly/smoothly-icon-demo.entry.js +0 -487
- package/dist/smoothly/smoothly-icon.entry.js +0 -48
- package/dist/smoothly/smoothly-input-date-range.entry.js +0 -46
- package/dist/smoothly/smoothly-input-date.entry.js +0 -40
- package/dist/smoothly/smoothly-input-demo.entry.js +0 -15
- package/dist/smoothly/smoothly-input-month.entry.js +0 -37
- package/dist/smoothly/smoothly-input.entry.js +0 -198
- package/dist/smoothly/smoothly-item.entry.js +0 -39
- package/dist/smoothly/smoothly-menu-options.entry.js +0 -104
- package/dist/smoothly/smoothly-notification.entry.js +0 -63
- package/dist/smoothly/smoothly-notifier.entry.js +0 -25
- package/dist/smoothly/smoothly-option.entry.js +0 -29
- package/dist/smoothly/smoothly-picker.entry.js +0 -147
- package/dist/smoothly/smoothly-popup.entry.js +0 -34
- package/dist/smoothly/smoothly-quiet.entry.js +0 -15
- package/dist/smoothly/smoothly-radio-group.entry.js +0 -16
- package/dist/smoothly/smoothly-radio.entry.js +0 -24
- package/dist/smoothly/smoothly-reorder.entry.js +0 -99
- package/dist/smoothly/smoothly-room.entry.js +0 -12
- package/dist/smoothly/smoothly-select-demo.entry.js +0 -82
- package/dist/smoothly/smoothly-select.entry.js +0 -27
- package/dist/smoothly/smoothly-selector.entry.js +0 -115
- package/dist/smoothly/smoothly-skeleton.entry.js +0 -23
- package/dist/smoothly/smoothly-spinner.entry.js +0 -20
- package/dist/smoothly/smoothly-submit.entry.js +0 -56
- package/dist/smoothly/smoothly-svg.entry.js +0 -37
- package/dist/smoothly/smoothly-tab-switch.entry.js +0 -28
- package/dist/smoothly/smoothly-tab.entry.js +0 -33
- package/dist/smoothly/smoothly-table-cell.entry.js +0 -15
- package/dist/smoothly/smoothly-table-demo.entry.js +0 -18
- package/dist/smoothly/smoothly-table-expandable-cell.entry.js +0 -41
- package/dist/smoothly/smoothly-table-expandable-row.entry.js +0 -28
- package/dist/smoothly/smoothly-table-header.entry.js +0 -37
- package/dist/smoothly/smoothly-table-row.entry.js +0 -34
- package/dist/smoothly/smoothly-table.entry.js +0 -22
- package/dist/smoothly/smoothly-trigger-sink.entry.js +0 -29
- package/dist/smoothly/smoothly-trigger-source.entry.js +0 -28
- package/dist/smoothly/smoothly-trigger.entry.js +0 -32
- package/dist/smoothly/smoothly-tuple.entry.js +0 -12
- package/dist/smoothly/smoothly-urlencoded.entry.js +0 -15
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, k as Host } from './index-02a70ac1.js';
|
|
2
|
-
import { d as dist$1 } from './index-a5a08f46.js';
|
|
3
|
-
import { d as dist } from './index-401c6ce3.js';
|
|
4
|
-
import './_commonjsHelpers-8fe71198.js';
|
|
5
|
-
|
|
6
|
-
const styleCss = ".sc-smoothly-input-h{display:block;position:relative;font-weight:var(--smoothly-font-weight);padding:var(--padding);overflow:hidden;background-color:rgb(var(--background-color));color:rgb(var(--text-color, var(--smoothly-default-contrast)))}[hidden].sc-smoothly-input-h{display:none}.sc-smoothly-input-h>div.sc-smoothly-input{position:relative;width:100%;height:100%}label.sc-smoothly-input{position:absolute;left:0.4em;top:0.6em;color:rgb(var(--text-color, var(--smoothly-default-contrast)));opacity:0.8;user-select:none;cursor:inherit;transition:transform 0.1s;transform-origin:top left;transition-timing-function:ease}.sc-smoothly-input-h:not([show-label]) label.sc-smoothly-input{display:none}.sc-smoothly-input-h:not([show-label]) input.sc-smoothly-input{padding:0.6em 0.2em 0.6em 0.2em}input.sc-smoothly-input{padding:1em 0.2em 0.2em 0.2em;box-sizing:border-box;width:100%;height:100%;background:none;border:0;z-index:1;position:relative;font-size:1rem;font-family:var(--smoothly-font-family);background-color:rgb(var(--background-color))}smoothly-icon.sc-smoothly-input{display:none;position:absolute;right:0.2em;top:0.6em}input.sc-smoothly-input:invalid+label.sc-smoothly-input+smoothly-icon.sc-smoothly-input{display:block}.sc-smoothly-input-h>div.sc-smoothly-input>label.sc-smoothly-input{z-index:1;pointer-events:none}.has-value.sc-smoothly-input-h>div.sc-smoothly-input>label.sc-smoothly-input,.sc-smoothly-input-h:focus-within>div.sc-smoothly-input>label.sc-smoothly-input{top:0.4em;transform:scale(0.6)}input.sc-smoothly-input:focus{outline:none}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill:hover,input.sc-smoothly-input:-webkit-autofill:focus,input.sc-smoothly-input:-webkit-autofill:active{box-shadow:0 0 0 40em rgb(var(--background-color)) inset;-webkit-box-shadow:0 0 0 40em rgb(var(--background-color)) inset}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill+label.sc-smoothly-input{-webkit-text-fill-color:rgb(var(--text-color, var(--smoothly-default-contrast)))}";
|
|
7
|
-
|
|
8
|
-
let SmoothlyInput = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.smoothlyChanged = createEvent(this, "smoothlyChanged", 7);
|
|
12
|
-
this.keepFocusOnReRender = false;
|
|
13
|
-
this.type = "text";
|
|
14
|
-
this.required = false;
|
|
15
|
-
this.minLength = 0;
|
|
16
|
-
this.showLabel = true;
|
|
17
|
-
this.maxLength = Number.POSITIVE_INFINITY;
|
|
18
|
-
this.autocomplete = true;
|
|
19
|
-
this.disabled = false;
|
|
20
|
-
}
|
|
21
|
-
get formatter() {
|
|
22
|
-
let result;
|
|
23
|
-
switch (this.type) {
|
|
24
|
-
case "price":
|
|
25
|
-
result = dist.get("price", this.currency);
|
|
26
|
-
break;
|
|
27
|
-
default:
|
|
28
|
-
result = dist.get(this.type, getLocale());
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
return result || dist.get("text");
|
|
32
|
-
}
|
|
33
|
-
newState(state) {
|
|
34
|
-
const formatter = this.formatter;
|
|
35
|
-
return formatter.format(dist.StateEditor.copy(formatter.unformat(dist.StateEditor.copy(state))));
|
|
36
|
-
}
|
|
37
|
-
valueWatcher(value, before) {
|
|
38
|
-
if (this.lastValue != value) {
|
|
39
|
-
this.lastValue = value;
|
|
40
|
-
this.state = Object.assign(Object.assign({}, this.state), { value: this.newState({ value: this.formatter.toString(value), selection: this.state.selection }).value });
|
|
41
|
-
}
|
|
42
|
-
if (value != before)
|
|
43
|
-
this.smoothlyChanged.emit({ name: this.name, value });
|
|
44
|
-
}
|
|
45
|
-
onCurrency() {
|
|
46
|
-
this.state = Object.assign(Object.assign({}, this.state), { value: this.newState({ value: this.formatter.toString(this.value), selection: this.state.selection }).value, pattern: this.newState({ value: this.formatter.toString(this.value), selection: this.state.selection }).pattern });
|
|
47
|
-
}
|
|
48
|
-
componentWillLoad() {
|
|
49
|
-
const value = this.formatter.toString(this.value) || "";
|
|
50
|
-
const start = value.length;
|
|
51
|
-
this.state = this.newState({
|
|
52
|
-
value,
|
|
53
|
-
selection: { start, end: start, direction: "none" },
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
componentDidRender() {
|
|
57
|
-
if (this.keepFocusOnReRender) {
|
|
58
|
-
this.inputElement.focus();
|
|
59
|
-
this.keepFocusOnReRender = false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async getFormData(name) {
|
|
63
|
-
const result = {};
|
|
64
|
-
const form = document.forms.namedItem(name);
|
|
65
|
-
if (form) {
|
|
66
|
-
const elements = form.elements;
|
|
67
|
-
for (let i = 0; i < elements.length; i++) {
|
|
68
|
-
const element = elements.item(i);
|
|
69
|
-
if (this.hasNameAndValue(element) && element.name)
|
|
70
|
-
result[element.name] = element.value;
|
|
71
|
-
}
|
|
72
|
-
const smoothlyInputs = form.getElementsByTagName("smoothly-input");
|
|
73
|
-
for (let i = 0; i < smoothlyInputs.length; i++) {
|
|
74
|
-
const element = smoothlyInputs.item(i);
|
|
75
|
-
if (this.hasNameAndValue(element) && element.name)
|
|
76
|
-
result[element.name] = element.value;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return result;
|
|
80
|
-
}
|
|
81
|
-
hasNameAndValue(element) {
|
|
82
|
-
return (typeof element.name == "string" && typeof element.value == "string");
|
|
83
|
-
}
|
|
84
|
-
async setKeepFocusOnReRender(keepFocus) {
|
|
85
|
-
this.keepFocusOnReRender = keepFocus;
|
|
86
|
-
}
|
|
87
|
-
async setSelectionRange(start, end, direction) {
|
|
88
|
-
this.state = this.newState(Object.assign(Object.assign({}, this.state), { selection: { start, end, direction: direction != undefined ? direction : this.state.selection.direction } }));
|
|
89
|
-
const after = this.formatter.format(dist.StateEditor.copy(this.formatter.unformat(dist.StateEditor.copy(Object.assign({}, this.state)))));
|
|
90
|
-
this.updateBackend(after, this.inputElement);
|
|
91
|
-
}
|
|
92
|
-
onBlur(event) { }
|
|
93
|
-
onFocus(event) {
|
|
94
|
-
const after = this.formatter.format(dist.StateEditor.copy(this.formatter.unformat(dist.StateEditor.copy(Object.assign({}, this.state)))));
|
|
95
|
-
if (event.target)
|
|
96
|
-
this.updateBackend(after, event.target);
|
|
97
|
-
}
|
|
98
|
-
onClick(event) {
|
|
99
|
-
const backend = event.target;
|
|
100
|
-
this.state = Object.assign(Object.assign({}, this.state), { value: backend.value, selection: {
|
|
101
|
-
start: backend.selectionStart != undefined ? backend.selectionStart : backend.value.length,
|
|
102
|
-
end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
|
|
103
|
-
direction: backend.selectionDirection ? backend.selectionDirection : "none",
|
|
104
|
-
} });
|
|
105
|
-
const after = this.newState(Object.assign({}, this.state));
|
|
106
|
-
this.updateBackend(after, backend);
|
|
107
|
-
}
|
|
108
|
-
onKeyDown(event) {
|
|
109
|
-
if (event.key && !(event.key == "Unidentified")) {
|
|
110
|
-
const backend = event.target;
|
|
111
|
-
this.state = Object.assign(Object.assign({}, this.state), { value: backend.value, selection: {
|
|
112
|
-
start: backend.selectionStart != undefined ? backend.selectionStart : backend.value.length,
|
|
113
|
-
end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
|
|
114
|
-
direction: backend.selectionDirection ? backend.selectionDirection : "none",
|
|
115
|
-
} });
|
|
116
|
-
if ((!((event.ctrlKey || event.metaKey) && (event.key == "v" || event.key == "c")) && event.key.length == 1) ||
|
|
117
|
-
event.key == "ArrowLeft" ||
|
|
118
|
-
event.key == "ArrowRight" ||
|
|
119
|
-
event.key == "Delete" ||
|
|
120
|
-
event.key == "Backspace" ||
|
|
121
|
-
event.key == "Home" ||
|
|
122
|
-
event.key == "End") {
|
|
123
|
-
event.preventDefault();
|
|
124
|
-
this.processKey(event, backend);
|
|
125
|
-
}
|
|
126
|
-
else if (event.key == "ArrowUp" || event.key == "ArrowDown")
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
onPaste(event) {
|
|
131
|
-
event.preventDefault();
|
|
132
|
-
let pasted = event.clipboardData ? event.clipboardData.getData("text") : "";
|
|
133
|
-
const backend = event.target;
|
|
134
|
-
pasted = this.expiresAutocompleteFix(backend, pasted);
|
|
135
|
-
for (const letter of pasted)
|
|
136
|
-
this.processKey({ key: letter }, backend);
|
|
137
|
-
}
|
|
138
|
-
onInput(event) {
|
|
139
|
-
var _a;
|
|
140
|
-
if (event.inputType == "insertReplacementText") {
|
|
141
|
-
this.processKey({ key: "a", ctrlKey: true }, event.target);
|
|
142
|
-
[...((_a = event.data) !== null && _a !== void 0 ? _a : "")].forEach(c => this.processKey({ key: c }, event.target));
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
const backend = event.target;
|
|
146
|
-
let data = backend.value;
|
|
147
|
-
if (data) {
|
|
148
|
-
event.preventDefault();
|
|
149
|
-
this.processKey({ key: "a", ctrlKey: true }, backend);
|
|
150
|
-
data = this.expiresAutocompleteFix(backend, data);
|
|
151
|
-
for (const letter of data)
|
|
152
|
-
this.processKey({ key: letter }, backend);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
expiresAutocompleteFix(backend, value) {
|
|
157
|
-
var _a;
|
|
158
|
-
if (((_a = backend.attributes.getNamedItem("autocomplete")) === null || _a === void 0 ? void 0 : _a.value) == "cc-exp")
|
|
159
|
-
value = value.match(/^20\d\d[.\D]*\d\d$/)
|
|
160
|
-
? value.substring(value.length - 2, value.length) + value.substring(2, 4)
|
|
161
|
-
: value.match(/^(1[3-9]|[2-9]\d)[.\D]*\d\d$/)
|
|
162
|
-
? value.substring(value.length - 2, value.length) + value.substring(0, 2)
|
|
163
|
-
: value.match(/^\d\d[.\D]*20\d\d$/)
|
|
164
|
-
? value.substring(0, 2) + value.substring(value.length - 2, value.length)
|
|
165
|
-
: value;
|
|
166
|
-
return value;
|
|
167
|
-
}
|
|
168
|
-
processKey(event, backend) {
|
|
169
|
-
const after = dist.Action.apply(this.formatter, this.state, event);
|
|
170
|
-
this.updateBackend(after, backend);
|
|
171
|
-
}
|
|
172
|
-
updateBackend(after, backend) {
|
|
173
|
-
if (after.value != backend.value)
|
|
174
|
-
backend.value = after.value;
|
|
175
|
-
if (backend.selectionStart != undefined && after.selection.start != backend.selectionStart)
|
|
176
|
-
backend.selectionStart = after.selection.start;
|
|
177
|
-
if (backend.selectionEnd != undefined && after.selection.end != backend.selectionEnd)
|
|
178
|
-
backend.selectionEnd = after.selection.end;
|
|
179
|
-
backend.selectionDirection = after.selection.direction ? after.selection.direction : backend.selectionDirection;
|
|
180
|
-
this.state = after;
|
|
181
|
-
this.value = this.lastValue = this.formatter.fromString(this.formatter.unformat(dist.StateEditor.copy(Object.assign({}, this.state))).value);
|
|
182
|
-
}
|
|
183
|
-
render() {
|
|
184
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
185
|
-
return (h(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(); } }, h("div", null, 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) }), h("label", { htmlFor: this.name }, h("slot", null)), h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }))));
|
|
186
|
-
}
|
|
187
|
-
static get watchers() { return {
|
|
188
|
-
"value": ["valueWatcher"],
|
|
189
|
-
"currency": ["onCurrency"]
|
|
190
|
-
}; }
|
|
191
|
-
};
|
|
192
|
-
function getLocale() {
|
|
193
|
-
const result = navigator.language;
|
|
194
|
-
return dist$1.Locale.is(result) ? result : dist$1.Language.is(result) ? dist$1.Locale.toLocale(result) : undefined;
|
|
195
|
-
}
|
|
196
|
-
SmoothlyInput.style = styleCss;
|
|
197
|
-
|
|
198
|
-
export { SmoothlyInput as smoothly_input };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = "[selected].sc-smoothly-item-h{background-color:rgb(var(--smoothly-primary-shade));color:rgb(var(--smoothly-primary-contrast))}.sc-smoothly-item-h{padding:.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))}";
|
|
4
|
-
|
|
5
|
-
let Item = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.itemSelected = createEvent(this, "itemSelected", 7);
|
|
9
|
-
}
|
|
10
|
-
onSelectedChanged(value, old) {
|
|
11
|
-
if (value && !old)
|
|
12
|
-
this.itemSelected.emit();
|
|
13
|
-
}
|
|
14
|
-
onClick() {
|
|
15
|
-
this.selected = true;
|
|
16
|
-
this.itemSelected.emit();
|
|
17
|
-
}
|
|
18
|
-
componentDidLoad() {
|
|
19
|
-
if (this.selected)
|
|
20
|
-
this.itemSelected.emit();
|
|
21
|
-
}
|
|
22
|
-
async filter(filter) {
|
|
23
|
-
const result = !(this.element.hidden = filter
|
|
24
|
-
? !((typeof this.value === "string" ? this.value : JSON.stringify(this.value)).toLowerCase().includes(filter) ||
|
|
25
|
-
this.element.innerText.toLowerCase().includes(filter))
|
|
26
|
-
: false);
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
return h("slot", null);
|
|
31
|
-
}
|
|
32
|
-
get element() { return getElement(this); }
|
|
33
|
-
static get watchers() { return {
|
|
34
|
-
"selected": ["onSelectedChanged"]
|
|
35
|
-
}; }
|
|
36
|
-
};
|
|
37
|
-
Item.style = styleCss;
|
|
38
|
-
|
|
39
|
-
export { Item as smoothly_item };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, k as Host, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ":host{max-height:300px;width:85%;max-height:var(--max-menu-height);box-sizing:border-box;background-color:rgb(var(--smoothly-default-color));border-radius:0.25em;color:rgb(var(--smoothly-primary-color));stroke:rgb(var(--smoothly-primary-color));fill:rgb(var(--smoothly-primary-color));box-shadow:0px 2px 24px rgba(64, 60, 57, 0.08), inset 0px 0px 1px rgba(64, 60, 57, 0.4);overflow-y:auto;cursor:pointer}:host:first-child{margin:10em}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyMenuOptions = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.filteredOptions = [];
|
|
9
|
-
this.highlightIndex = 0;
|
|
10
|
-
this.emptyMenuLabel = "No Options";
|
|
11
|
-
this.order = false;
|
|
12
|
-
this.options = [];
|
|
13
|
-
this.resetHighlightOnOptionsChange = true;
|
|
14
|
-
}
|
|
15
|
-
optionsChangeHandler(newOptions) {
|
|
16
|
-
this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
|
|
17
|
-
}
|
|
18
|
-
optionHoverHandler(event) {
|
|
19
|
-
if (event.detail.value)
|
|
20
|
-
this.setHighlight(event.detail.value);
|
|
21
|
-
event.stopPropagation();
|
|
22
|
-
}
|
|
23
|
-
async moveHighlight(step) {
|
|
24
|
-
if (this.filteredOptions.length > 0)
|
|
25
|
-
this.setHighlight((this.highlightIndex + step + this.filteredOptions.length) % this.filteredOptions.length, true);
|
|
26
|
-
}
|
|
27
|
-
async setHighlight(newIndex, scrollToHighlight = false) {
|
|
28
|
-
if (typeof newIndex == "number") {
|
|
29
|
-
this.highlightIndex = newIndex;
|
|
30
|
-
scrollToHighlight && this.scrollTo(this.highlightIndex);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const value = newIndex;
|
|
34
|
-
let isHighlightSet = false;
|
|
35
|
-
this.filteredOptions.forEach((option, index) => {
|
|
36
|
-
const highlight = option.value == value;
|
|
37
|
-
this.highlightIndex = highlight ? index : this.highlightIndex;
|
|
38
|
-
highlight && scrollToHighlight && this.scrollTo(index);
|
|
39
|
-
isHighlightSet = highlight ? true : isHighlightSet;
|
|
40
|
-
});
|
|
41
|
-
if (!isHighlightSet)
|
|
42
|
-
this.setHighlight(0, true);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
async getHighlighted() {
|
|
46
|
-
let result = undefined;
|
|
47
|
-
if (this.highlightIndex != undefined && this.filteredOptions.length > 0)
|
|
48
|
-
result = this.filteredOptions[this.highlightIndex];
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
async filterOptions(keyword, excludeValues = []) {
|
|
52
|
-
const keywordLowercase = keyword.toLowerCase();
|
|
53
|
-
this.filteredOptions = [];
|
|
54
|
-
for (const option of this.options) {
|
|
55
|
-
const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
|
|
56
|
-
const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
|
|
57
|
-
isVisible && this.filteredOptions.push(option);
|
|
58
|
-
}
|
|
59
|
-
this.order && this.sortOptions(keyword);
|
|
60
|
-
}
|
|
61
|
-
sortOptions(keyword) {
|
|
62
|
-
const keywordLowercase = keyword.toLowerCase();
|
|
63
|
-
this.filteredOptions.sort((a, b) => {
|
|
64
|
-
return this.getPriorityScore(a, keywordLowercase) - this.getPriorityScore(b, keywordLowercase);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
getPriorityScore(option, keywordLowercase) {
|
|
68
|
-
let result = Number.MAX_SAFE_INTEGER;
|
|
69
|
-
const name = option.name;
|
|
70
|
-
const aliases = option.aliases ? option.aliases.join(" ") : "";
|
|
71
|
-
const names = `${name ? name : ""} ${aliases ? aliases : ""}`.toLowerCase();
|
|
72
|
-
if (name) {
|
|
73
|
-
result = names.split(" ").reduce((minIndex, word) => {
|
|
74
|
-
const index = word.indexOf(keywordLowercase);
|
|
75
|
-
return index != -1 && index < minIndex ? index : minIndex;
|
|
76
|
-
}, Number.MAX_SAFE_INTEGER);
|
|
77
|
-
}
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
scrollTo(optionIndex) {
|
|
81
|
-
var _a;
|
|
82
|
-
const optionHeight = (_a = this.firstOptionsElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
|
|
83
|
-
if (optionHeight) {
|
|
84
|
-
const menuHeight = this.element.getBoundingClientRect().height;
|
|
85
|
-
const scrollPosition = this.element.scrollTop;
|
|
86
|
-
const optionPosition = optionIndex * optionHeight;
|
|
87
|
-
const numOptionsInMenu = Math.floor(menuHeight / optionHeight);
|
|
88
|
-
if (optionPosition - optionHeight / 2 < scrollPosition)
|
|
89
|
-
this.element.scrollTo({ top: (optionIndex - 1) * optionHeight });
|
|
90
|
-
else if (scrollPosition < optionPosition + optionHeight - menuHeight)
|
|
91
|
-
this.element.scrollTo({ top: (optionIndex + 1 - numOptionsInMenu) * optionHeight });
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
render() {
|
|
95
|
-
return (h(Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("smoothly-option", { style: this.optionStyle, 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 }, option.left ? h("div", { slot: "left" }, option.left) : undefined, option.right ? h("div", { slot: "right" }, option.right) : undefined)))) : (h("div", null, this.emptyMenuLabel))));
|
|
96
|
-
}
|
|
97
|
-
get element() { return getElement(this); }
|
|
98
|
-
static get watchers() { return {
|
|
99
|
-
"options": ["optionsChangeHandler"]
|
|
100
|
-
}; }
|
|
101
|
-
};
|
|
102
|
-
SmoothlyMenuOptions.style = styleCss;
|
|
103
|
-
|
|
104
|
-
export { SmoothlyMenuOptions as smoothly_menu_options };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, k as Host } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ".sc-smoothly-notification-h{display:block;min-width:32.6%;min-height:3em;border-radius:5px;margin:0.5em}[hidden].sc-smoothly-notification-h{display:none}smoothly-trigger.sc-smoothly-notification{float:right;text-align:right;margin-right:0.2em}";
|
|
4
|
-
|
|
5
|
-
let Notification = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.remove = createEvent(this, "remove", 7);
|
|
9
|
-
this.tick = {};
|
|
10
|
-
this.listener = notice => {
|
|
11
|
-
console.log("changed: ", notice);
|
|
12
|
-
if (notice.state == "closed")
|
|
13
|
-
this.remove.emit(notice);
|
|
14
|
-
else
|
|
15
|
-
this.tick = {};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
get color() {
|
|
19
|
-
let result;
|
|
20
|
-
switch (this.notice.state) {
|
|
21
|
-
case "delayed":
|
|
22
|
-
case "warning":
|
|
23
|
-
result = "warning";
|
|
24
|
-
break;
|
|
25
|
-
case "success":
|
|
26
|
-
result = "success";
|
|
27
|
-
break;
|
|
28
|
-
case "executing":
|
|
29
|
-
result = "light";
|
|
30
|
-
break;
|
|
31
|
-
case "failed":
|
|
32
|
-
result = "danger";
|
|
33
|
-
break;
|
|
34
|
-
default:
|
|
35
|
-
result = "light";
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
onTrigger(event) {
|
|
41
|
-
if (event.detail.name == "close") {
|
|
42
|
-
event.stopPropagation();
|
|
43
|
-
this.notice.close();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
onUpdatedNotice(newValue, oldValue) {
|
|
47
|
-
if (oldValue)
|
|
48
|
-
oldValue.unlisten(this.listener);
|
|
49
|
-
newValue.listen(this.listener);
|
|
50
|
-
}
|
|
51
|
-
componentDidLoad() {
|
|
52
|
-
this.onUpdatedNotice(this.notice);
|
|
53
|
-
}
|
|
54
|
-
render() {
|
|
55
|
-
return (h(Host, { color: this.color, fill: "solid" }, h("smoothly-trigger", { fill: "clear", name: "close" }, h("smoothly-icon", { name: "close-circle-outline" })), h("p", null, this.notice.message)));
|
|
56
|
-
}
|
|
57
|
-
static get watchers() { return {
|
|
58
|
-
"notice": ["onUpdatedNotice"]
|
|
59
|
-
}; }
|
|
60
|
-
};
|
|
61
|
-
Notification.style = styleCss;
|
|
62
|
-
|
|
63
|
-
export { Notification as smoothly_notification };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ".sc-smoothly-notifier-h{display:block}[hidden].sc-smoothly-notifier-h{display:none}.sc-smoothly-notifier-h>aside.sc-smoothly-notifier{display:flex;flex-wrap:wrap-reverse;align-content:stretch;justify-content:flex-start;position:fixed;bottom:3em;left:0;text-align:center;width:100%;z-index:100}";
|
|
4
|
-
|
|
5
|
-
let Notifier = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.notices = [];
|
|
9
|
-
}
|
|
10
|
-
onNotice(event) {
|
|
11
|
-
this.notices = [...this.notices, event.detail];
|
|
12
|
-
}
|
|
13
|
-
onRemove(event) {
|
|
14
|
-
this.notices = [...this.notices.filter(n => n != event.detail)];
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
return [
|
|
18
|
-
h("slot", null),
|
|
19
|
-
h("aside", null, this.notices.map(n => (h("smoothly-notification", { notice: n })))),
|
|
20
|
-
];
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
Notifier.style = styleCss;
|
|
24
|
-
|
|
25
|
-
export { Notifier as smoothly_notifier };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, k as Host, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ":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))}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyOption = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.optionHover = createEvent(this, "optionHover", 7);
|
|
9
|
-
this.optionSelect = createEvent(this, "optionSelect", 7);
|
|
10
|
-
this.dataHighlight = false;
|
|
11
|
-
this.divider = false;
|
|
12
|
-
}
|
|
13
|
-
onHover(event) {
|
|
14
|
-
this.optionHover.emit({ name: this.name, value: this.value });
|
|
15
|
-
}
|
|
16
|
-
onSelect(event) {
|
|
17
|
-
if (this.value)
|
|
18
|
-
this.optionSelect.emit({ name: this.name, value: this.value });
|
|
19
|
-
else
|
|
20
|
-
throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
return (h(Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) }, h("slot", { name: "left" }), h("div", { class: "middle" }, this.name), h("slot", { name: "right" })));
|
|
24
|
-
}
|
|
25
|
-
get element() { return getElement(this); }
|
|
26
|
-
};
|
|
27
|
-
SmoothlyOption.style = styleCss;
|
|
28
|
-
|
|
29
|
-
export { SmoothlyOption as smoothly_option };
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, k as Host, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ":host{--background-color:var(--smoothly-default-color), 1;--color:var(--smoothly-secondary-contrast);--border-color:var(--smoothly-default-shade), 1;--border-highlight-color:var(--smoothly-secondary-contrast), 1;--label-color:var(--smoothly-secondary-contrast), 0.8;--selected-item-border-radius:0.25rem;--selected-item-background-color:var(--smoothly-secondary-color), 1;--selected-item-color:255, 255, 255, 1}:host{display:block;position:relative;background-color:rgba(var(--background-color));width:100%;cursor:pointer;--intergiro-transition:border-color 200ms cubic-bezier(0.645, 0.045, 0.355, 1);transition:var(--intergiro-transition);border:1px solid rgb(var(--border-color));margin:1px;height:40px;border-radius:0.25rem}:host(:focus-within){border-color:rgb(var(--smoothly-primary-shade));border-width:2px;margin:0px}:host>div{display:flex;background-color:transparent;min-height:40px;align-items:center;align-self:center;border:none;max-height:var(--max-height)}:host>div .icons>smoothly-icon{flex-shrink:0;padding-left:0.6em;stroke:rgba(var(--color), 0.4);fill:rgba(var(--color), 0.4);width:1.5em !important;height:1.5em !important}:host>div .icons>smoothly-icon:hover{fill:rgba(var(--color), 1)}:host>div input{width:100%;background-color:transparent;outline:none;border:none;cursor:pointer;color:rgb(var(--color));padding:0 0.6em;font-family:var(--smoothly-font-family);font-size:1.05em}:host>div input::placeholder{opacity:1;text-overflow:ellipsis}:host([is-open])>div input{color:rgb(var(--smoothly-medium-color))}:host(:not(:focus-within)[multiple]) ul>li:last-child{position:absolute;pointer-events:none}:host([label=\"\"]) ul,:host:not([label]) ul,:host([label-setting=hide]) ul{padding-top:0.1em;padding-bottom:0.1em}label{padding-left:0.6em;white-space:nowrap;color:rgba(var(--label-color));transition:var(--intergiro-transition);font-family:var(--smoothly-font-family);pointer-events:none;transform-origin:left}:host([has-selection]) label{display:var(--label-display)}:host([has-selection]) label,:host(:focus-within) label{display:none}:host(:hover) smoothly-icon[data-arrow],:host(:focus-within) smoothly-icon[data-arrow]{stroke:rgba(var(--color), 1)}:host smoothly-icon[data-arrow]{pointer-events:none}:host smoothly-icon{flex-shrink:0;width:1em;height:1em}:host(:not([is-open])) smoothly-icon.up,:host([is-open]) smoothly-icon.down{display:none}smoothly-icon.search{display:flex;align-self:center;padding-left:0.8em}smoothly-icon.up,smoothly-icon.down{display:flex;align-self:center;padding-right:0.8em;stroke:rgb(var(--smoothly-primary-shade))}:host smoothly-menu-options{margin-top:0.5em;padding-top:0.5em;padding-bottom:0.5em;position:absolute;z-index:1}:host(:not([is-open]))>smoothly-menu-options{display:none}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyPicker = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.menuClose = createEvent(this, "menuClose", 7);
|
|
9
|
-
this.keepFocusOnReRender = false;
|
|
10
|
-
this.emptyMenuLabel = "No Options";
|
|
11
|
-
this.multiple = false;
|
|
12
|
-
this.options = [];
|
|
13
|
-
this.selections = [];
|
|
14
|
-
this.selectNoneName = "Select None";
|
|
15
|
-
this.selectionName = "items selected";
|
|
16
|
-
}
|
|
17
|
-
isOpenChangeHander() {
|
|
18
|
-
if (this.isOpen == false) {
|
|
19
|
-
this.menuClose.emit(this.selections);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
componentDidRender() {
|
|
23
|
-
this.filterOptions();
|
|
24
|
-
if (this.keepFocusOnReRender) {
|
|
25
|
-
this.inputElement.focus();
|
|
26
|
-
this.keepFocusOnReRender = false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
optionSelectHander(event) {
|
|
30
|
-
this.toggle(event.detail);
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
}
|
|
33
|
-
toggle(option) {
|
|
34
|
-
option.value == "select-none"
|
|
35
|
-
? this.toggleAll()
|
|
36
|
-
: this.selections.map(s => s.value).includes(option.value)
|
|
37
|
-
? this.unselect(option)
|
|
38
|
-
: this.select(option);
|
|
39
|
-
}
|
|
40
|
-
toggleAll() {
|
|
41
|
-
var _a;
|
|
42
|
-
this.selections = this.selections.length == ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) ? [] : this.options;
|
|
43
|
-
this.inputElement.focus();
|
|
44
|
-
this.keepFocusOnReRender = true;
|
|
45
|
-
}
|
|
46
|
-
unselect(selection) {
|
|
47
|
-
const index = this.selections.map(selection => selection.value).indexOf(selection.value);
|
|
48
|
-
if (index != -1) {
|
|
49
|
-
this.selections = [
|
|
50
|
-
...this.selections.slice(0, index),
|
|
51
|
-
...this.selections.slice(index + 1, this.selections.length),
|
|
52
|
-
];
|
|
53
|
-
this.keepFocusOnReRender = true;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
select(selection) {
|
|
57
|
-
const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
|
|
58
|
-
if (isNewSelection)
|
|
59
|
-
this.selections = this.multiple ? [...this.selections, selection] : [selection];
|
|
60
|
-
this.inputElement.value = "";
|
|
61
|
-
this.filterOptions();
|
|
62
|
-
this.keepFocusOnReRender = true;
|
|
63
|
-
this.isOpen = this.multiple;
|
|
64
|
-
}
|
|
65
|
-
toggleHighlighted() {
|
|
66
|
-
var _a;
|
|
67
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.getHighlighted().then((result) => {
|
|
68
|
-
result && this.toggle(result);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
highlightDefault() {
|
|
72
|
-
var _a;
|
|
73
|
-
this.filterOptions();
|
|
74
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.setHighlight(this.multiple || this.selections.length == 0 ? 0 : this.selections[0].value);
|
|
75
|
-
}
|
|
76
|
-
filterOptions() {
|
|
77
|
-
var _a;
|
|
78
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.filterOptions(this.inputElement.value, []);
|
|
79
|
-
}
|
|
80
|
-
onInput(event) {
|
|
81
|
-
this.isOpen = this.inputElement.value != "" ? true : this.isOpen;
|
|
82
|
-
this.highlightDefault();
|
|
83
|
-
}
|
|
84
|
-
onKeyDown(event) {
|
|
85
|
-
var _a;
|
|
86
|
-
if (event.key == "ArrowUp" || event.key == "ArrowDown") {
|
|
87
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.moveHighlight(event.key == "ArrowUp" ? -1 : 1);
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
}
|
|
90
|
-
else if (event.key == "Enter" && this.isOpen)
|
|
91
|
-
this.toggleHighlighted();
|
|
92
|
-
else if (event.key == "Escape") {
|
|
93
|
-
this.inputElement.value = "";
|
|
94
|
-
this.isOpen = false;
|
|
95
|
-
this.filterOptions();
|
|
96
|
-
}
|
|
97
|
-
else if (event.key == " " && this.inputElement.value == "") {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
this.isOpen = true;
|
|
100
|
-
this.filterOptions();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
onClick() {
|
|
104
|
-
this.isOpen = !this.isOpen;
|
|
105
|
-
this.inputElement.focus();
|
|
106
|
-
this.highlightDefault();
|
|
107
|
-
this.filterOptions();
|
|
108
|
-
}
|
|
109
|
-
onBlur() {
|
|
110
|
-
this.inputElement.value = "";
|
|
111
|
-
this.isOpen = false;
|
|
112
|
-
this.filterOptions();
|
|
113
|
-
}
|
|
114
|
-
getCheckHtml(checked) {
|
|
115
|
-
return checked ? (h("smoothly-icon", { name: "checkbox", size: "small" })) : (h("smoothly-icon", { name: "square-outline", size: "small" }));
|
|
116
|
-
}
|
|
117
|
-
render() {
|
|
118
|
-
var _a, _b, _c, _d;
|
|
119
|
-
const cssVariables = {
|
|
120
|
-
"--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
|
|
121
|
-
"--label-display": this.labelSetting == "hide" ? "none" : "absolute",
|
|
122
|
-
};
|
|
123
|
-
(_b = this.options) === null || _b === void 0 ? void 0 : _b.forEach(o => {
|
|
124
|
-
o.left = this.getCheckHtml(this.selections.map(s => s.value).includes(o.value));
|
|
125
|
-
});
|
|
126
|
-
const options = [
|
|
127
|
-
{
|
|
128
|
-
value: "select-none",
|
|
129
|
-
name: this.selectNoneName,
|
|
130
|
-
left: this.getCheckHtml(this.selections.length == ((_c = this.options) === null || _c === void 0 ? void 0 : _c.length)),
|
|
131
|
-
divider: true,
|
|
132
|
-
},
|
|
133
|
-
...((_d = this.options) !== null && _d !== void 0 ? _d : []),
|
|
134
|
-
];
|
|
135
|
-
return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { class: "search", name: "search-outline", size: "tiny" }), h("label", null, this.label), h("input", { type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
|
|
136
|
-
? this.selections.length.toString() + " " + this.selectionName
|
|
137
|
-
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { class: "up", name: "chevron-up", size: "tiny" })), 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 })));
|
|
138
|
-
}
|
|
139
|
-
get element() { return getElement(this); }
|
|
140
|
-
static get watchers() { return {
|
|
141
|
-
"selections": ["isOpenChangeHander"],
|
|
142
|
-
"isOpen": ["isOpenChangeHander"]
|
|
143
|
-
}; }
|
|
144
|
-
};
|
|
145
|
-
SmoothlyPicker.style = styleCss;
|
|
146
|
-
|
|
147
|
-
export { SmoothlyPicker as smoothly_picker };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, k as Host } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ".sc-smoothly-popup-h{display:inline-flex;position:relative}[hidden].sc-smoothly-popup-h{display:none}.sc-smoothly-popup-h:not([visible]) aside.sc-smoothly-popup{display:none}.sc-smoothly-popup-h aside.sc-smoothly-popup{display:inline;position:absolute;padding:0.3em;left:var(--left);right:var(--right);background-color:rgb(238, 238, 238);border-color:rgb(238, 238, 238);border-style:solid;border-width:0.1em;border-radius:0.6em;z-index:3}[direction=down].sc-smoothly-popup-h aside.sc-smoothly-popup{top:2.2em;box-shadow:6px 5px 9px -9px black, 5px 6px 9px -9px black}[direction=up].sc-smoothly-popup-h aside.sc-smoothly-popup{bottom:2.2em;box-shadow:-6px -5px 9px -9px black, -5px -6px 9px -9px black}.sc-smoothly-popup-h:not([visible]) .background.sc-smoothly-popup{display:none}.sc-smoothly-popup-h .background.sc-smoothly-popup{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:2}.sc-smoothly-popup-h:not([visible]) .arrow.sc-smoothly-popup{display:none}.sc-smoothly-popup-h .arrow.sc-smoothly-popup{background-color:rgb(238, 238, 238);border-color:rgb(238, 238, 238);z-index:2;content:\"\";position:absolute;width:12px;height:12px;transform:rotate(45deg);left:calc(var(--left) + 1em);right:calc(var(--right) + 1em)}[direction=down].sc-smoothly-popup-h .arrow.sc-smoothly-popup{top:2em;border-top-style:solid;border-top-width:1px;border-left-style:solid;border-left-width:1px}[direction=up].sc-smoothly-popup-h .arrow.sc-smoothly-popup{bottom:2em;border-bottom-style:solid;border-bottom-width:1px;border-right-style:solid;border-right-width:1px}.sc-smoothly-popup-h .pointer.sc-smoothly-popup{cursor:pointer}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyPopup = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.popup = createEvent(this, "popup", 7);
|
|
9
|
-
this.visible = false;
|
|
10
|
-
this.direction = "down";
|
|
11
|
-
this.cssVariables = { "--left": "0.1em" };
|
|
12
|
-
}
|
|
13
|
-
onClick() {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15
|
-
if (this.visible == false) {
|
|
16
|
-
(_a = this.aside) === null || _a === void 0 ? void 0 : _a.style.setProperty("display", "block");
|
|
17
|
-
this.cssVariables =
|
|
18
|
-
((_c = (_b = this.aside) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().right) !== null && _c !== void 0 ? _c : 0) >= window.innerWidth
|
|
19
|
-
? { "--right": "0.1em" }
|
|
20
|
-
: ((_e = (_d = this.aside) === null || _d === void 0 ? void 0 : _d.getBoundingClientRect().left) !== null && _e !== void 0 ? _e : 0) < 0
|
|
21
|
-
? { "--left": "0.1em" }
|
|
22
|
-
: this.cssVariables;
|
|
23
|
-
(_f = this.aside) === null || _f === void 0 ? void 0 : _f.style.removeProperty("display");
|
|
24
|
-
}
|
|
25
|
-
this.visible = !this.visible;
|
|
26
|
-
this.popup.emit(this.visible);
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return (h(Host, { style: Object.assign({}, this.cssVariables) }, h("content", { class: "pointer", onClick: () => this.onClick() }, h("slot", null)), h("div", { class: "background", onClick: () => this.onClick() }), h("div", { class: "arrow", onClick: () => this.onClick() }), h("aside", { ref: el => (this.aside = el) }, h("slot", { name: "popup" }))));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
SmoothlyPopup.style = styleCss;
|
|
33
|
-
|
|
34
|
-
export { SmoothlyPopup as smoothly_popup };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, k as Host } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ".sc-smoothly-quiet-h{opacity:0.5}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyQuiet = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return (h(Host, { color: this.color }, h("slot", null)));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
SmoothlyQuiet.style = styleCss;
|
|
14
|
-
|
|
15
|
-
export { SmoothlyQuiet as smoothly_quiet };
|