smoothly 0.1.114 → 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} +7689 -1483
- 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/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 +7776 -2966
- 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} +7689 -1484
- 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 +17 -17
- 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-36da3c23.js +0 -1673
- package/dist/cjs/index-40d009d5.js +0 -1354
- package/dist/cjs/index-ac32385c.js +0 -18850
- 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-a5a08f46.js +0 -18848
- package/dist/esm/index-c8b5d468.js +0 -1349
- package/dist/esm/index-d1360bcf.js +0 -1671
- 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-a5a08f46.js +0 -18848
- package/dist/smoothly/index-c8b5d468.js +0 -1349
- package/dist/smoothly/index-d1360bcf.js +0 -1671
- package/dist/smoothly/p-0bad2c46.entry.js +0 -1
- 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-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,151 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
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}";
|
|
8
|
-
|
|
9
|
-
let SmoothlyPicker = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.menuClose = index.createEvent(this, "menuClose", 7);
|
|
13
|
-
this.keepFocusOnReRender = false;
|
|
14
|
-
this.emptyMenuLabel = "No Options";
|
|
15
|
-
this.multiple = false;
|
|
16
|
-
this.options = [];
|
|
17
|
-
this.selections = [];
|
|
18
|
-
this.selectNoneName = "Select None";
|
|
19
|
-
this.selectionName = "items selected";
|
|
20
|
-
}
|
|
21
|
-
isOpenChangeHander() {
|
|
22
|
-
if (this.isOpen == false) {
|
|
23
|
-
this.menuClose.emit(this.selections);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
componentDidRender() {
|
|
27
|
-
this.filterOptions();
|
|
28
|
-
if (this.keepFocusOnReRender) {
|
|
29
|
-
this.inputElement.focus();
|
|
30
|
-
this.keepFocusOnReRender = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
optionSelectHander(event) {
|
|
34
|
-
this.toggle(event.detail);
|
|
35
|
-
event.stopPropagation();
|
|
36
|
-
}
|
|
37
|
-
toggle(option) {
|
|
38
|
-
option.value == "select-none"
|
|
39
|
-
? this.toggleAll()
|
|
40
|
-
: this.selections.map(s => s.value).includes(option.value)
|
|
41
|
-
? this.unselect(option)
|
|
42
|
-
: this.select(option);
|
|
43
|
-
}
|
|
44
|
-
toggleAll() {
|
|
45
|
-
var _a;
|
|
46
|
-
this.selections = this.selections.length == ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) ? [] : this.options;
|
|
47
|
-
this.inputElement.focus();
|
|
48
|
-
this.keepFocusOnReRender = true;
|
|
49
|
-
}
|
|
50
|
-
unselect(selection) {
|
|
51
|
-
const index = this.selections.map(selection => selection.value).indexOf(selection.value);
|
|
52
|
-
if (index != -1) {
|
|
53
|
-
this.selections = [
|
|
54
|
-
...this.selections.slice(0, index),
|
|
55
|
-
...this.selections.slice(index + 1, this.selections.length),
|
|
56
|
-
];
|
|
57
|
-
this.keepFocusOnReRender = true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
select(selection) {
|
|
61
|
-
const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
|
|
62
|
-
if (isNewSelection)
|
|
63
|
-
this.selections = this.multiple ? [...this.selections, selection] : [selection];
|
|
64
|
-
this.inputElement.value = "";
|
|
65
|
-
this.filterOptions();
|
|
66
|
-
this.keepFocusOnReRender = true;
|
|
67
|
-
this.isOpen = this.multiple;
|
|
68
|
-
}
|
|
69
|
-
toggleHighlighted() {
|
|
70
|
-
var _a;
|
|
71
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.getHighlighted().then((result) => {
|
|
72
|
-
result && this.toggle(result);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
highlightDefault() {
|
|
76
|
-
var _a;
|
|
77
|
-
this.filterOptions();
|
|
78
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.setHighlight(this.multiple || this.selections.length == 0 ? 0 : this.selections[0].value);
|
|
79
|
-
}
|
|
80
|
-
filterOptions() {
|
|
81
|
-
var _a;
|
|
82
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.filterOptions(this.inputElement.value, []);
|
|
83
|
-
}
|
|
84
|
-
onInput(event) {
|
|
85
|
-
this.isOpen = this.inputElement.value != "" ? true : this.isOpen;
|
|
86
|
-
this.highlightDefault();
|
|
87
|
-
}
|
|
88
|
-
onKeyDown(event) {
|
|
89
|
-
var _a;
|
|
90
|
-
if (event.key == "ArrowUp" || event.key == "ArrowDown") {
|
|
91
|
-
(_a = this.menuElement) === null || _a === void 0 ? void 0 : _a.moveHighlight(event.key == "ArrowUp" ? -1 : 1);
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
}
|
|
94
|
-
else if (event.key == "Enter" && this.isOpen)
|
|
95
|
-
this.toggleHighlighted();
|
|
96
|
-
else if (event.key == "Escape") {
|
|
97
|
-
this.inputElement.value = "";
|
|
98
|
-
this.isOpen = false;
|
|
99
|
-
this.filterOptions();
|
|
100
|
-
}
|
|
101
|
-
else if (event.key == " " && this.inputElement.value == "") {
|
|
102
|
-
event.preventDefault();
|
|
103
|
-
this.isOpen = true;
|
|
104
|
-
this.filterOptions();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
onClick() {
|
|
108
|
-
this.isOpen = !this.isOpen;
|
|
109
|
-
this.inputElement.focus();
|
|
110
|
-
this.highlightDefault();
|
|
111
|
-
this.filterOptions();
|
|
112
|
-
}
|
|
113
|
-
onBlur() {
|
|
114
|
-
this.inputElement.value = "";
|
|
115
|
-
this.isOpen = false;
|
|
116
|
-
this.filterOptions();
|
|
117
|
-
}
|
|
118
|
-
getCheckHtml(checked) {
|
|
119
|
-
return checked ? (index.h("smoothly-icon", { name: "checkbox", size: "small" })) : (index.h("smoothly-icon", { name: "square-outline", size: "small" }));
|
|
120
|
-
}
|
|
121
|
-
render() {
|
|
122
|
-
var _a, _b, _c, _d;
|
|
123
|
-
const cssVariables = {
|
|
124
|
-
"--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
|
|
125
|
-
"--label-display": this.labelSetting == "hide" ? "none" : "absolute",
|
|
126
|
-
};
|
|
127
|
-
(_b = this.options) === null || _b === void 0 ? void 0 : _b.forEach(o => {
|
|
128
|
-
o.left = this.getCheckHtml(this.selections.map(s => s.value).includes(o.value));
|
|
129
|
-
});
|
|
130
|
-
const options = [
|
|
131
|
-
{
|
|
132
|
-
value: "select-none",
|
|
133
|
-
name: this.selectNoneName,
|
|
134
|
-
left: this.getCheckHtml(this.selections.length == ((_c = this.options) === null || _c === void 0 ? void 0 : _c.length)),
|
|
135
|
-
divider: true,
|
|
136
|
-
},
|
|
137
|
-
...((_d = this.options) !== null && _d !== void 0 ? _d : []),
|
|
138
|
-
];
|
|
139
|
-
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
|
|
140
|
-
? this.selections.length.toString() + " " + this.selectionName
|
|
141
|
-
: 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 })));
|
|
142
|
-
}
|
|
143
|
-
get element() { return index.getElement(this); }
|
|
144
|
-
static get watchers() { return {
|
|
145
|
-
"selections": ["isOpenChangeHander"],
|
|
146
|
-
"isOpen": ["isOpenChangeHander"]
|
|
147
|
-
}; }
|
|
148
|
-
};
|
|
149
|
-
SmoothlyPicker.style = styleCss;
|
|
150
|
-
|
|
151
|
-
exports.smoothly_picker = SmoothlyPicker;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
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}";
|
|
8
|
-
|
|
9
|
-
let SmoothlyPopup = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.popup = index.createEvent(this, "popup", 7);
|
|
13
|
-
this.visible = false;
|
|
14
|
-
this.direction = "down";
|
|
15
|
-
this.cssVariables = { "--left": "0.1em" };
|
|
16
|
-
}
|
|
17
|
-
onClick() {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f;
|
|
19
|
-
if (this.visible == false) {
|
|
20
|
-
(_a = this.aside) === null || _a === void 0 ? void 0 : _a.style.setProperty("display", "block");
|
|
21
|
-
this.cssVariables =
|
|
22
|
-
((_c = (_b = this.aside) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().right) !== null && _c !== void 0 ? _c : 0) >= window.innerWidth
|
|
23
|
-
? { "--right": "0.1em" }
|
|
24
|
-
: ((_e = (_d = this.aside) === null || _d === void 0 ? void 0 : _d.getBoundingClientRect().left) !== null && _e !== void 0 ? _e : 0) < 0
|
|
25
|
-
? { "--left": "0.1em" }
|
|
26
|
-
: this.cssVariables;
|
|
27
|
-
(_f = this.aside) === null || _f === void 0 ? void 0 : _f.style.removeProperty("display");
|
|
28
|
-
}
|
|
29
|
-
this.visible = !this.visible;
|
|
30
|
-
this.popup.emit(this.visible);
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
return (index.h(index.Host, { style: Object.assign({}, this.cssVariables) }, index.h("content", { class: "pointer", onClick: () => this.onClick() }, index.h("slot", null)), index.h("div", { class: "background", onClick: () => this.onClick() }), index.h("div", { class: "arrow", onClick: () => this.onClick() }), index.h("aside", { ref: el => (this.aside = el) }, index.h("slot", { name: "popup" }))));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
SmoothlyPopup.style = styleCss;
|
|
37
|
-
|
|
38
|
-
exports.smoothly_popup = SmoothlyPopup;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-quiet-h{opacity:0.5}";
|
|
8
|
-
|
|
9
|
-
let SmoothlyQuiet = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
}
|
|
13
|
-
render() {
|
|
14
|
-
return (index.h(index.Host, { color: this.color }, index.h("slot", null)));
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
SmoothlyQuiet.style = styleCss;
|
|
18
|
-
|
|
19
|
-
exports.smoothly_quiet = SmoothlyQuiet;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-radio-h{display:block;position:relative}[hidden].sc-smoothly-radio-h{display:none}label.sc-smoothly-radio{display:block;width:calc(100% - 2 * 0.4em);padding:0.2em 0.4em 0.2em 0.4em}input[type=radio].sc-smoothly-radio{position:absolute;left:0;top:0;width:calc(100%);height:100%;margin:0;appearance:none;-webkit-appearance:none}input[type=radio].sc-smoothly-radio~label.sc-smoothly-radio{border:1px solid rgb(var(--smoothly-default-color));color:rgba(var(--smoothly-default-contrast), 0.5);background:rgb(var(--smoothly-default-color))}input[type=radio].sc-smoothly-radio:checked~label.sc-smoothly-radio{background-color:rgb(var(--smoothly-default-shade));color:rgb(var(--smoothly-default-contrast))}";
|
|
8
|
-
|
|
9
|
-
let SmoothlyRadio = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.smoothlySelected = index.createEvent(this, "smoothlySelected", 7);
|
|
13
|
-
}
|
|
14
|
-
async onInput(e) {
|
|
15
|
-
if (e.target && e.target.value && (this.checked = e.target.checked))
|
|
16
|
-
this.smoothlySelected.emit({ name: this.name, value: this.value });
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return [
|
|
21
|
-
index.h("input", { type: "radio", name: this.name, id: this.value, tabindex: this.tabIndex, checked: this.checked, value: this.value, onChange: e => this.onInput(e) }),
|
|
22
|
-
index.h("label", { htmlFor: this.value }, index.h("slot", null)),
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
SmoothlyRadio.style = styleCss;
|
|
27
|
-
|
|
28
|
-
exports.smoothly_radio = SmoothlyRadio;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
let SmoothlyRoom = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
index.registerInstance(this, hostRef);
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return index.h("slot", null);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.smoothly_room = SmoothlyRoom;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-select-demo-h{display:block}[hidden].sc-smoothly-select-demo-h{display:none}button.sc-smoothly-select-demo:focus{outline:none}smoothly-selector.sc-smoothly-select-demo{outline:none}";
|
|
8
|
-
|
|
9
|
-
let SmoothlySelectDemo = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.currencies = ["SEK", "EUR"];
|
|
13
|
-
this.currency = "SEK";
|
|
14
|
-
}
|
|
15
|
-
alertf() {
|
|
16
|
-
var _a;
|
|
17
|
-
console.log(this.quantityElement);
|
|
18
|
-
alert((_a = this.quantityElement) === null || _a === void 0 ? void 0 : _a.value);
|
|
19
|
-
}
|
|
20
|
-
handleSelectionChanged(event) {
|
|
21
|
-
console.log("selectionChanged", event.detail);
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
return [
|
|
25
|
-
index.h("smoothly-select", { identifier: "currency" }, this.currencies.map(option => this.currency == option ? (index.h("option", { value: option, selected: true }, option)) : (index.h("option", { value: option }, option)))),
|
|
26
|
-
index.h("smoothly-select", { identifier: "language" }, index.h("optgroup", { label: "Nordic" }, index.h("option", { value: "sv" }, "Swedish"), index.h("option", { value: "da", selected: true }, "Danish"), index.h("option", { value: "no" }, "Norwegian")), index.h("optgroup", { label: "Other" }, index.h("option", { value: "en" }, "English"))),
|
|
27
|
-
index.h("smoothly-select", { identifier: "quantity", ref: e => (this.quantityElement = e) }, index.h("option", { value: "1" }, "1"), index.h("option", { value: "2" }, "2"), index.h("option", { value: "3" }, "3")),
|
|
28
|
-
index.h("smoothly-input-date", null, "Date"),
|
|
29
|
-
index.h("smoothly-input-date", { value: "2021-10-28", max: "2021-12-30", min: "2021-10-10" }, "Date"),
|
|
30
|
-
index.h("smoothly-input-date-range", { start: "2022-10-28", end: "2022-11-27", min: "2021-10-10", max: "2022-12-30" }),
|
|
31
|
-
index.h("smoothly-input-date-range", { start: "2022-10-28", end: "2022-11-27", min: "2021-10-10", max: "2022-12-30", showLabel: false, style: {
|
|
32
|
-
"--background": "rgb(var(--smoothly-dark-shade))",
|
|
33
|
-
"--border-radius": "4px",
|
|
34
|
-
"--padding": "0 0.75em",
|
|
35
|
-
"--input-width": "6rem",
|
|
36
|
-
} }),
|
|
37
|
-
index.h("smoothly-selector", null, index.h("smoothly-item", { value: "1" }, "January"), index.h("smoothly-item", { value: "2" }, "February"), index.h("smoothly-item", { value: "3" }, "March"), index.h("smoothly-item", { value: "4" }, "April"), index.h("smoothly-item", { value: "5" }, "May"), index.h("smoothly-item", { value: "6" }, "June"), index.h("smoothly-item", { value: "7" }, "July"), index.h("smoothly-item", { value: "8" }, "August"), index.h("smoothly-item", { value: "9" }, "September"), index.h("smoothly-item", { value: "10" }, "October"), index.h("smoothly-item", { value: "11" }, "November"), index.h("smoothly-item", { value: "12" }, "December")),
|
|
38
|
-
index.h("button", { onClick: () => this.alertf() }, "press here"),
|
|
39
|
-
index.h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
40
|
-
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
41
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
42
|
-
{ name: "Noble Pig", value: "pig" },
|
|
43
|
-
{ name: "Turtle Wax", value: "turtle" },
|
|
44
|
-
{ name: "Spider Man", value: "spider" },
|
|
45
|
-
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
46
|
-
{ name: "Horse Back", value: "horse" },
|
|
47
|
-
{ name: "Unicorn Horn", value: "unicorn" },
|
|
48
|
-
{ name: "Talking Parrot Parrot", value: "parrot" },
|
|
49
|
-
{ name: "Hidden Dragon", value: "dragon" },
|
|
50
|
-
{ name: "Scary Kraken", value: "kraken" },
|
|
51
|
-
] }),
|
|
52
|
-
index.h("br", null),
|
|
53
|
-
index.h("smoothly-picker", { label: "", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
54
|
-
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
55
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"] },
|
|
56
|
-
{ name: "Noble Pig", value: "pig" },
|
|
57
|
-
{ name: "Turtle Wax", value: "turtle" },
|
|
58
|
-
{ name: "Spider Man", value: "spider" },
|
|
59
|
-
{ name: "Phoenix Order Long Wooord", value: "phoenix" },
|
|
60
|
-
{ name: "Horse Back", value: "horse" },
|
|
61
|
-
{ name: "Unicorn Horn", value: "unicorn" },
|
|
62
|
-
{ name: "Talking Parrot Parrot", value: "parrot" },
|
|
63
|
-
{ name: "Hidden Dragon", value: "dragon" },
|
|
64
|
-
{ name: "Scary Kraken", value: "kraken" },
|
|
65
|
-
] }),
|
|
66
|
-
index.h("br", null),
|
|
67
|
-
index.h("smoothly-picker", { label: "Single select", multiple: false, "max-menu-height": "200px", options: [
|
|
68
|
-
{ name: "Dog", value: "dog", aliases: ["WOFF"], right: "Woof 🐶" },
|
|
69
|
-
{ name: "Cat", value: "cat", aliases: ["moew"] },
|
|
70
|
-
{ name: "Pig", value: "pig" },
|
|
71
|
-
{ name: "Turtle", value: "turtle" },
|
|
72
|
-
{ name: "Spider", value: "spider" },
|
|
73
|
-
{ name: "Phoenix", value: "phoenix" },
|
|
74
|
-
{ name: "Horse", value: "horse" },
|
|
75
|
-
{ name: "Unicorn", value: "unicorn" },
|
|
76
|
-
{ name: "Parrot", value: "parrot" },
|
|
77
|
-
{ name: "Dragon", value: "dragon" },
|
|
78
|
-
{ name: "Kraken", value: "kraken" },
|
|
79
|
-
] }),
|
|
80
|
-
index.h("smoothly-tab-switch", null, index.h("smoothly-tab", { label: "test1", open: true }, "Hello world!"), index.h("smoothly-tab", { label: "test2" }, "this is a test message!"), index.h("smoothly-tab", { label: "test3" }, "this is a test message again!")),
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
SmoothlySelectDemo.style = styleCss;
|
|
85
|
-
|
|
86
|
-
exports.smoothly_select_demo = SmoothlySelectDemo;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-select-h{display:block}[hidden].sc-smoothly-select-h{display:none}select.sc-smoothly-select{min-width:1.5em;padding-top:0.5em;border:none;-webkit-appearance:none;background-color:rgb(var(--smoothly-color));padding:0.3em}select.sc-smoothly-select>option.sc-smoothly-select{background-color:inherit}select.sc-smoothly-select:focus{outline:none}";
|
|
8
|
-
|
|
9
|
-
let SmoothlySelect = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.selectionChanged = index.createEvent(this, "selectionChanged", 7);
|
|
13
|
-
}
|
|
14
|
-
optionSelected() {
|
|
15
|
-
if (this.selectElement)
|
|
16
|
-
this.selectionChanged.emit({ identifier: this.identifier, value: (this.value = this.selectElement.value) });
|
|
17
|
-
}
|
|
18
|
-
componentDidLoad() {
|
|
19
|
-
var _a;
|
|
20
|
-
if (this.selectElement)
|
|
21
|
-
this.value = (_a = this.selectElement) === null || _a === void 0 ? void 0 : _a.value;
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
return [
|
|
25
|
-
index.h("select", { ref: e => (this.selectElement = e), id: this.identifier, onChange: () => this.optionSelected(), style: { background: this.background } }, index.h("slot", null)),
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
SmoothlySelect.style = styleCss;
|
|
30
|
-
|
|
31
|
-
exports.smoothly_select = SmoothlySelect;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-selector-h{position:relative;height:100%}.sc-smoothly-selector-h>main.sc-smoothly-selector,.sc-smoothly-selector-h>main.sc-smoothly-selector>*.sc-smoothly-selector{height:100%;display:flex;align-items:center}.sc-smoothly-selector-h>div.sc-smoothly-selector>nav.sc-smoothly-selector{display:flex;flex-direction:column;position:absolute;z-index:10}.sc-smoothly-selector-h>aside.sc-smoothly-selector{position:absolute;top:0;left:5em;z-index:10;background-color:rgb(var(--smoothly-tertiary-color));color:rgb(var(--smoothly-tertiary-contrast));height:20px;border-radius:5px;padding:5px;display:flex;align-items:center}.missing.sc-smoothly-selector-h>aside.sc-smoothly-selector{background-color:rgb(var(--smoothly-warning-color));color:rgb(var(--smoothly-warning-contast))}.hidden.sc-smoothly-selector{display:none}.sc-smoothly-selector-h>section.sc-smoothly-selector{position:fixed;top:0px;left:0px;width:100vw;height:100vh;z-index:10}";
|
|
8
|
-
|
|
9
|
-
let Selector = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.selected = index.createEvent(this, "selected", 7);
|
|
13
|
-
this.opened = false;
|
|
14
|
-
this.items = [];
|
|
15
|
-
this.missing = false;
|
|
16
|
-
this.filter = "";
|
|
17
|
-
}
|
|
18
|
-
onSelectedChange(value, old) {
|
|
19
|
-
if (old)
|
|
20
|
-
old.selected = false;
|
|
21
|
-
this.selected.emit(value === null || value === void 0 ? void 0 : value.value);
|
|
22
|
-
}
|
|
23
|
-
async onFilterChange(value) {
|
|
24
|
-
value = value.toLowerCase();
|
|
25
|
-
if (!(await Promise.all(this.items.map(item => item.filter(value)))).some(r => r)) {
|
|
26
|
-
this.missing = true;
|
|
27
|
-
this.items.forEach(el => el.filter(""));
|
|
28
|
-
}
|
|
29
|
-
else
|
|
30
|
-
this.missing = false;
|
|
31
|
-
}
|
|
32
|
-
onClick(event) {
|
|
33
|
-
event.stopPropagation();
|
|
34
|
-
this.opened = !this.opened;
|
|
35
|
-
}
|
|
36
|
-
onItemSelected(event) {
|
|
37
|
-
this.selectedElement = event.target;
|
|
38
|
-
if (this.mainElement)
|
|
39
|
-
this.mainElement.innerHTML = this.selectedElement.innerHTML;
|
|
40
|
-
}
|
|
41
|
-
onKeyDown(event) {
|
|
42
|
-
event.stopPropagation();
|
|
43
|
-
if (this.opened) {
|
|
44
|
-
let direction = 0;
|
|
45
|
-
switch (event.key) {
|
|
46
|
-
case "ArrowUp":
|
|
47
|
-
direction = -1;
|
|
48
|
-
break;
|
|
49
|
-
case "ArrowDown":
|
|
50
|
-
direction = 1;
|
|
51
|
-
break;
|
|
52
|
-
case "Escape":
|
|
53
|
-
this.filter = "";
|
|
54
|
-
break;
|
|
55
|
-
case "Backspace":
|
|
56
|
-
this.filter = this.filter.slice(0, -1);
|
|
57
|
-
break;
|
|
58
|
-
case "Enter":
|
|
59
|
-
this.items.forEach(element => {
|
|
60
|
-
if (!element.hidden) {
|
|
61
|
-
this.selected.emit(element.value);
|
|
62
|
-
if (this.mainElement && this.selectedElement)
|
|
63
|
-
this.mainElement.innerHTML = this.selectedElement.innerHTML;
|
|
64
|
-
this.opened = false;
|
|
65
|
-
this.filter = "";
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
if (event.key.length == 1)
|
|
71
|
-
this.filter += event.key;
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
this.move(direction);
|
|
75
|
-
}
|
|
76
|
-
else if (event.key == "Enter")
|
|
77
|
-
this.opened = true;
|
|
78
|
-
}
|
|
79
|
-
move(direction) {
|
|
80
|
-
if (direction) {
|
|
81
|
-
let selectedIndex = this.items.findIndex(item => item == this.selectedElement);
|
|
82
|
-
console.log("selectedindex", selectedIndex);
|
|
83
|
-
do {
|
|
84
|
-
selectedIndex = (selectedIndex + direction + this.items.length) % this.items.length;
|
|
85
|
-
} while (this.items[selectedIndex].hidden);
|
|
86
|
-
this.selectedElement = this.items[selectedIndex];
|
|
87
|
-
this.selectedElement.selected = true;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
render() {
|
|
91
|
-
return (index.h(index.Host, { tabIndex: 2, class: this.missing ? "missing" : "" }, index.h("main", { ref: element => (this.mainElement = element) }, "(none)"), this.filter.length != 0 ? (index.h("aside", { ref: element => (this.aside = element) }, this.filter, index.h("button", { onClick: e => {
|
|
92
|
-
e.stopPropagation();
|
|
93
|
-
this.filter = "";
|
|
94
|
-
} }, index.h("smoothly-icon", { name: "close", size: "small" })))) : undefined, this.opened ? index.h("section", { onClick: () => (this.opened = true) }) : [], index.h("div", { class: this.opened ? "" : "hidden" }, index.h("nav", null, index.h("slot", null)))));
|
|
95
|
-
}
|
|
96
|
-
componentDidRender() {
|
|
97
|
-
const items = [];
|
|
98
|
-
const children = this.element.querySelectorAll("div > nav > smoothly-item");
|
|
99
|
-
for (let i = 0; i < children.length; i++) {
|
|
100
|
-
const node = children.item(i);
|
|
101
|
-
if (isItem(node))
|
|
102
|
-
items.push(node);
|
|
103
|
-
}
|
|
104
|
-
this.items = items;
|
|
105
|
-
}
|
|
106
|
-
get element() { return index.getElement(this); }
|
|
107
|
-
static get watchers() { return {
|
|
108
|
-
"selectedElement": ["onSelectedChange"],
|
|
109
|
-
"filter": ["onFilterChange"]
|
|
110
|
-
}; }
|
|
111
|
-
};
|
|
112
|
-
function isItem(value) {
|
|
113
|
-
return (typeof value == "object" &&
|
|
114
|
-
(typeof value.selected == "boolean" || value.selected == undefined) &&
|
|
115
|
-
typeof value.filter == "function");
|
|
116
|
-
}
|
|
117
|
-
Selector.style = styleCss;
|
|
118
|
-
|
|
119
|
-
exports.smoothly_selector = Selector;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-skeleton-h{display:block;height:1rem}.sc-smoothly-skeleton-h::before{content:\"\";display:block;width:var(--width);height:100%;border-radius:0.4rem;background-image:linear-gradient(90deg, rgb(var(--color, var(--smoothly-dark-color))) 0, transparent 2.5rem, rgb(var(--color, var(--smoothly-dark-color))) 5rem);background-size:calc(var(--distance) + 5rem);animation-duration:var(--period, 1.6s);animation-iteration-count:infinite;animation-timing-function:linear;animation-name:shine-lines-left}@keyframes shine-lines-left{0%{background-position:-5rem}40%,100%{background-position:var(--distance)}}[align=center].sc-smoothly-skeleton-h::before{margin:0 auto;animation-name:shine-lines-center}@keyframes shine-lines-center{0%{background-position:calc((var(--width) - var(--distance)) / 2 - 5rem)}40%,100%{background-position:calc(var(--width) + (var(--distance) - var(--width)) / 2)}}[align=right].sc-smoothly-skeleton-h::before{margin:0;margin-left:auto;animation-name:shine-lines-right}@keyframes shine-lines-right{0%{background-position:calc(var(--width) - var(--distance) - 5rem)}40%,100%{background-position:var(--width)}}";
|
|
8
|
-
|
|
9
|
-
let SmoothlySkeleton = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.widths = ["8rem", "9rem", "10rem"];
|
|
13
|
-
this.align = "left";
|
|
14
|
-
}
|
|
15
|
-
componentWillLoad() {
|
|
16
|
-
var _a;
|
|
17
|
-
this.width = (_a = this.width) !== null && _a !== void 0 ? _a : this.widths[Math.floor(Math.random() * this.widths.length)];
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
var _a;
|
|
21
|
-
const cssVariables = Object.assign(Object.assign({ "--width": this.width, "--distance": (_a = this.distance) !== null && _a !== void 0 ? _a : "10rem" }, (this.color ? { "--color": this.color } : undefined)), (this.period ? { "--period": this.period + "s" } : undefined));
|
|
22
|
-
return index.h(index.Host, { style: cssVariables });
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
SmoothlySkeleton.style = styleCss;
|
|
26
|
-
|
|
27
|
-
exports.smoothly_skeleton = SmoothlySkeleton;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-spinner-h:not([active]){display:none}[hidden].sc-smoothly-spinner-h{display:none}.sc-smoothly-spinner-h{display:block;stroke:rgb(var(--spinner-color, var(--smoothly-primary-tint)));position:absolute;inset:0;width:100%;height:100%;background-color:rgba(var(--background-color, var(--smoothly-default-color)), var(--background-opacity, var(--smoothly-semitransparent, 0.8)))}.sc-smoothly-spinner-h svg.sc-smoothly-spinner{position:absolute;left:calc(50% - var(--size) / 2);top:calc(50% - var(--size) / 2);width:var(--size);animation:SPIN-SVG 1.4s linear infinite}.sc-smoothly-spinner-h svg.sc-smoothly-spinner circle.sc-smoothly-spinner{transform-origin:center;animation:SPIN-CIRCLE 1.4s ease-in-out infinite;stroke-dasharray:187;stroke-dashoffset:0}@keyframes SPIN-SVG{0%{transform:rotate(0deg)}100%{transform:rotate(270deg)}}@keyframes SPIN-CIRCLE{0%{stroke-dashoffset:187}50%{stroke-dashoffset:46.75;transform:rotate(135deg)}100%{stroke-dashoffset:187;transform:rotate(450deg)}}";
|
|
8
|
-
|
|
9
|
-
let SmoothlySpinner = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.size = "large";
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
const strokeWidth = this.size == "large" ? 6 : this.size == "medium" ? 8 : 12;
|
|
16
|
-
return (index.h(index.Host, { style: {
|
|
17
|
-
"--color": `var(--spinner-color)`,
|
|
18
|
-
"--size": this.size == "large" ? "5em" : this.size == "medium" ? "3em" : "1.2em",
|
|
19
|
-
} }, index.h("svg", { class: "spinner", viewBox: `0 0 ${60 + strokeWidth} ${60 + strokeWidth}`, xmlns: "http://www.w3.org/2000/svg" }, index.h("circle", { class: "path", fill: "none", "stroke-width": strokeWidth, "stroke-linecap": "round", cx: `${30 + strokeWidth / 2}`, cy: `${30 + strokeWidth / 2}`, r: "30" }))));
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
SmoothlySpinner.style = styleCss;
|
|
23
|
-
|
|
24
|
-
exports.smoothly_spinner = SmoothlySpinner;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-138c41c2.js');
|
|
6
|
-
|
|
7
|
-
const styleCss = ".sc-smoothly-submit-h{display:block;border-width:1px;border-style:solid;border-radius:3px}[hidden].sc-smoothly-submit-h{display:none}[disabled].sc-smoothly-submit-h{opacity:0.5}button.sc-smoothly-submit{padding:0.2em 0.3em;font-size:110%;font-weight:400}[processing].sc-smoothly-submit-h{border-color:rgb(var(--smoothly-light-color))}[processing].sc-smoothly-submit-h>button.sc-smoothly-submit{color:rgb(var(--smoothly-light-contrast));background:rgb(var(--smoothly-light-color))}.sc-smoothly-submit-h:not([processing]):not([disabled]):hover,.sc-smoothly-submit-h:not([processing]):not([disabled]):focus,.sc-smoothly-submit-h:not([processing]):not([disabled]):active{border-color:rgb(var(--smoothly-submit-border))}[expand=fill].sc-smoothly-submit-h>button.sc-smoothly-submit,[expand=block].sc-smoothly-submit-h>button.sc-smoothly-submit{width:100%}[expand=fill].sc-smoothly-submit-h{border-left:none;border-right:none}";
|
|
8
|
-
|
|
9
|
-
let SmoothlySubmit = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.submitEvent = index.createEvent(this, "submit", 7);
|
|
13
|
-
this.disabled = false;
|
|
14
|
-
}
|
|
15
|
-
get form() {
|
|
16
|
-
return (this.button && this.button.form) || undefined;
|
|
17
|
-
}
|
|
18
|
-
async handleSubmit(event) {
|
|
19
|
-
if (!this.processing) {
|
|
20
|
-
this.processing = true;
|
|
21
|
-
if (this.prevent)
|
|
22
|
-
event.preventDefault();
|
|
23
|
-
const result = {};
|
|
24
|
-
if (this.form) {
|
|
25
|
-
const elements = this.form.elements;
|
|
26
|
-
for (let i = 0; i < elements.length; i++) {
|
|
27
|
-
const element = elements.item(i);
|
|
28
|
-
if (hasNameAndValue(element) && element.name)
|
|
29
|
-
result[element.name] = element.value;
|
|
30
|
-
}
|
|
31
|
-
const smoothlyInputs = this.form.getElementsByTagName("smoothly-input");
|
|
32
|
-
for (let i = 0; i < smoothlyInputs.length; i++) {
|
|
33
|
-
const element = smoothlyInputs.item(i);
|
|
34
|
-
if (hasNameAndValue(element) && element.name)
|
|
35
|
-
result[element.name] = element.value;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
this.submitEvent.emit(result);
|
|
39
|
-
this.processing = false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
async submit() {
|
|
43
|
-
let result;
|
|
44
|
-
if ((result = !!this.form))
|
|
45
|
-
this.form.submit();
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
render() {
|
|
49
|
-
return [
|
|
50
|
-
index.h("smoothly-spinner", { active: this.processing }),
|
|
51
|
-
index.h("button", { type: "submit", disabled: this.disabled || this.processing, ref: (element) => (this.button = element) }, index.h("slot", null)),
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
function hasNameAndValue(element) {
|
|
56
|
-
return (typeof element.name == "string" && typeof element.value == "string");
|
|
57
|
-
}
|
|
58
|
-
SmoothlySubmit.style = styleCss;
|
|
59
|
-
|
|
60
|
-
exports.smoothly_submit = SmoothlySubmit;
|