@vandeurenglenn/lite-elements 0.3.18
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/exports/banner/banner.d.ts +7 -0
- package/exports/banner.js +68 -0
- package/exports/bundle/banner.js +37 -0
- package/exports/bundle/button.js +144 -0
- package/exports/bundle/card.js +140 -0
- package/exports/bundle/code.js +35 -0
- package/exports/bundle/custom-element-c2e883ba.js +1 -0
- package/exports/bundle/demo-elements.js +1 -0
- package/exports/bundle/demo-icons.js +16 -0
- package/exports/bundle/demo-shell.js +540 -0
- package/exports/bundle/demo.js +457 -0
- package/exports/bundle/dial.js +1 -0
- package/exports/bundle/dialog.js +149 -0
- package/exports/bundle/divider.js +21 -0
- package/exports/bundle/drawer-button.js +18 -0
- package/exports/bundle/drawer-item.js +39 -0
- package/exports/bundle/drawer-layout.js +96 -0
- package/exports/bundle/drawer.js +56 -0
- package/exports/bundle/dropdown-menu.js +59 -0
- package/exports/bundle/dropdown.js +26 -0
- package/exports/bundle/elements.js +1 -0
- package/exports/bundle/elevation.js +56 -0
- package/exports/bundle/hour-field.js +1 -0
- package/exports/bundle/icon-button.js +13 -0
- package/exports/bundle/icon-set.js +5 -0
- package/exports/bundle/icon.js +16 -0
- package/exports/bundle/index-3c006227.js +1 -0
- package/exports/bundle/index.html +590 -0
- package/exports/bundle/input.js +6 -0
- package/exports/bundle/it-d4d177bf.js +1 -0
- package/exports/bundle/list-item.js +43 -0
- package/exports/bundle/list.js +1 -0
- package/exports/bundle/menu.js +13 -0
- package/exports/bundle/menu2.js +1 -0
- package/exports/bundle/minute-field.js +5 -0
- package/exports/bundle/pages.js +43 -0
- package/exports/bundle/pane.js +96 -0
- package/exports/bundle/property-58e28172.js +11 -0
- package/exports/bundle/query-73dacde5.js +1 -0
- package/exports/bundle/rail.js +58 -0
- package/exports/bundle/root.js +8 -0
- package/exports/bundle/scroll-mixin.js +1 -0
- package/exports/bundle/section.js +11 -0
- package/exports/bundle/section2.js +25 -0
- package/exports/bundle/select-mixin.js +1 -0
- package/exports/bundle/selector-mixin.js +1 -0
- package/exports/bundle/selector.js +31 -0
- package/exports/bundle/supporting-pane.js +47 -0
- package/exports/bundle/tab.js +22 -0
- package/exports/bundle/tabs.js +51 -0
- package/exports/bundle/text-field.js +10 -0
- package/exports/bundle/theme.js +1 -0
- package/exports/bundle/themes/default/colors.module.css +180 -0
- package/exports/bundle/themes/default/missing/motion.css +4 -0
- package/exports/bundle/themes/default/missing/shape.css +13 -0
- package/exports/bundle/themes/default/missing/theme.dark.css +5 -0
- package/exports/bundle/themes/default/missing/theme.light.css +5 -0
- package/exports/bundle/themes/default/missing/tokens.css +9 -0
- package/exports/bundle/themes/default/theme.css +10 -0
- package/exports/bundle/themes/default/theme.dark.css +33 -0
- package/exports/bundle/themes/default/theme.light.css +33 -0
- package/exports/bundle/themes/default/tokens.css +256 -0
- package/exports/bundle/themes/default/typography.module.css +150 -0
- package/exports/bundle/time-picker.js +21 -0
- package/exports/bundle/title.js +1 -0
- package/exports/bundle/toggle-button.js +4 -0
- package/exports/bundle/toggle.js +5 -0
- package/exports/bundle/top-app-bar-e6e33a9e.js +114 -0
- package/exports/bundle/top-app-bar.js +1 -0
- package/exports/bundle/types.js +1 -0
- package/exports/bundle/typography.js +156 -0
- package/exports/button.js +227 -0
- package/exports/card/card.d.ts +13 -0
- package/exports/card.js +187 -0
- package/exports/code.js +77 -0
- package/exports/demo-elements.d.ts +9 -0
- package/exports/demo-elements.js +10 -0
- package/exports/demo-icons.js +48 -0
- package/exports/demo-shell.js +648 -0
- package/exports/demo.js +524 -0
- package/exports/dial.js +1 -0
- package/exports/dialog.js +256 -0
- package/exports/divider/divider.d.ts +17 -0
- package/exports/divider.js +54 -0
- package/exports/drawer/drawer-button.d.ts +9 -0
- package/exports/drawer/drawer-layout.d.ts +19 -0
- package/exports/drawer/drawer.d.ts +13 -0
- package/exports/drawer-button.js +83 -0
- package/exports/drawer-item.js +69 -0
- package/exports/drawer-layout.js +209 -0
- package/exports/drawer.js +140 -0
- package/exports/dropdown-menu.js +172 -0
- package/exports/dropdown.js +68 -0
- package/exports/elements.d.ts +63 -0
- package/exports/elements.js +41 -0
- package/exports/elevation/elevation.d.ts +11 -0
- package/exports/elevation.js +97 -0
- package/exports/hour-field.js +1 -0
- package/exports/icon-button.js +59 -0
- package/exports/icon-set.js +52 -0
- package/exports/icon.js +103 -0
- package/exports/input.js +36 -0
- package/exports/list/list.d.ts +1 -0
- package/exports/list-item.js +127 -0
- package/exports/list.js +1 -0
- package/exports/menu.js +68 -0
- package/exports/menu2.js +1 -0
- package/exports/minute-field.js +36 -0
- package/exports/mixins/scroll-mixin.d.ts +13 -0
- package/exports/mixins/select-mixin.d.ts +32 -0
- package/exports/mixins/selector-mixin.d.ts +8 -0
- package/exports/pages.js +88 -0
- package/exports/pane/pane.d.ts +14 -0
- package/exports/pane.js +182 -0
- package/exports/rail/rail.d.ts +9 -0
- package/exports/rail.js +124 -0
- package/exports/root.js +39 -0
- package/exports/scroll-mixin.js +36 -0
- package/exports/section.js +54 -0
- package/exports/section2.js +58 -0
- package/exports/select-mixin.js +139 -0
- package/exports/selector-mixin.js +43 -0
- package/exports/selector.js +63 -0
- package/exports/supporting-pane/supporting-pane.d.ts +12 -0
- package/exports/supporting-pane.js +133 -0
- package/exports/tab.js +47 -0
- package/exports/tabs/menu.d.ts +1 -0
- package/exports/tabs/tab.d.ts +4 -0
- package/exports/tabs/tabs.d.ts +5 -0
- package/exports/tabs.js +80 -0
- package/exports/text-field.js +88 -0
- package/exports/theme/theme.d.ts +15 -0
- package/exports/theme.js +123 -0
- package/exports/themes/default/colors.module.css +180 -0
- package/exports/themes/default/missing/motion.css +4 -0
- package/exports/themes/default/missing/shape.css +13 -0
- package/exports/themes/default/missing/theme.dark.css +5 -0
- package/exports/themes/default/missing/theme.light.css +5 -0
- package/exports/themes/default/missing/tokens.css +9 -0
- package/exports/themes/default/theme.css +10 -0
- package/exports/themes/default/theme.dark.css +33 -0
- package/exports/themes/default/theme.light.css +33 -0
- package/exports/themes/default/tokens.css +256 -0
- package/exports/themes/default/typography.module.css +150 -0
- package/exports/time-picker/dial.d.ts +1 -0
- package/exports/time-picker/hour-field.d.ts +1 -0
- package/exports/time-picker.js +52 -0
- package/exports/title.js +1 -0
- package/exports/toggle/toggle-button.d.ts +13 -0
- package/exports/toggle-button.js +63 -0
- package/exports/toggle.js +78 -0
- package/exports/top-app-bar.js +143 -0
- package/exports/tslib.es6-d3ba6528.js +57 -0
- package/exports/types.d.ts +18 -0
- package/exports/types.js +1 -0
- package/exports/typography/title.d.ts +1 -0
- package/exports/typography.js +206 -0
- package/package.json +256 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LiteElement } from '@vandeurenglenn/lite';
|
|
2
|
+
export declare class SelectBase extends LiteElement {
|
|
3
|
+
#private;
|
|
4
|
+
currentSelected: HTMLElement;
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
get multi(): boolean;
|
|
7
|
+
set multi(value: boolean);
|
|
8
|
+
get defaultSelected(): string | 0;
|
|
9
|
+
set selected(value: string | number | HTMLElement | string[] | HTMLElement[]);
|
|
10
|
+
get selected(): string | number | HTMLElement | string[] | HTMLElement[];
|
|
11
|
+
get slotted(): this | HTMLSlotElement;
|
|
12
|
+
get attrForSelected(): string;
|
|
13
|
+
/**
|
|
14
|
+
* get the attribute used to set selected
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <custom-selector attr-for-selected="select">
|
|
18
|
+
* <li select="1"></li>
|
|
19
|
+
* <li select="2"></li>
|
|
20
|
+
* </custom-selector>
|
|
21
|
+
*/
|
|
22
|
+
set attrForSelected(value: string);
|
|
23
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
24
|
+
/**
|
|
25
|
+
* @param {string|number|HTMLElement} selected
|
|
26
|
+
*/
|
|
27
|
+
select(selected: any): void;
|
|
28
|
+
next(): void;
|
|
29
|
+
previous(): void;
|
|
30
|
+
getIndexFor(element: any): number;
|
|
31
|
+
}
|
|
32
|
+
export declare function SelectMixin<TBase extends CustomElementConstructor>(Base: TBase): typeof SelectBase;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectBase } from './select-mixin.js';
|
|
2
|
+
export declare class SelectorBase extends SelectBase {
|
|
3
|
+
#private;
|
|
4
|
+
constructor();
|
|
5
|
+
connectedCallback(): Promise<void>;
|
|
6
|
+
disconnectedCallback(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function SelectorMixin<TBase extends CustomElementConstructor>(Base: TBase): typeof SelectorBase;
|
package/exports/pages.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { css, html } from '@vandeurenglenn/lite';
|
|
2
|
+
import { SelectBase } from './select-mixin.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @extends HTMLElement
|
|
6
|
+
*/
|
|
7
|
+
class CustomPages extends SelectBase {
|
|
8
|
+
async connectedCallback() {
|
|
9
|
+
super.connectedCallback && (await super.connectedCallback());
|
|
10
|
+
this.slotchange = this.slotchange.bind(this);
|
|
11
|
+
this.shadowRoot.querySelector('slot').addEventListener('slotchange', this.slotchange);
|
|
12
|
+
this.slotchange();
|
|
13
|
+
this.selected = this.defaultSelected;
|
|
14
|
+
}
|
|
15
|
+
isEvenNumber(number) {
|
|
16
|
+
return Boolean(number % 2 === 0);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* set animation class when slot changes
|
|
20
|
+
*/
|
|
21
|
+
slotchange() {
|
|
22
|
+
let call = 0;
|
|
23
|
+
for (const child of this.slotted.assignedNodes()) {
|
|
24
|
+
if (child && child.nodeType === 1) {
|
|
25
|
+
child.style.zIndex = 99 - call;
|
|
26
|
+
if (this.isEvenNumber(call++)) {
|
|
27
|
+
child.classList.add('animate-down');
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
child.classList.add('animate-up');
|
|
31
|
+
}
|
|
32
|
+
this.dispatchEvent(new CustomEvent('child-change', { detail: child }));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
static styles = [
|
|
37
|
+
css `
|
|
38
|
+
:host {
|
|
39
|
+
flex: 1;
|
|
40
|
+
position: relative;
|
|
41
|
+
--primary-background-color: #eceff1;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
::slotted(*) {
|
|
47
|
+
display: flex;
|
|
48
|
+
position: absolute;
|
|
49
|
+
opacity: 0;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
right: 0;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
transition: var(--md-sys-motion-easing-emphasized-accelerate) 200ms opacity,
|
|
56
|
+
var(--md-sys-motion-easing-emphasized-accelerate) 200ms transform;
|
|
57
|
+
/*transform: scale(0.1);*/
|
|
58
|
+
transform-origin: left;
|
|
59
|
+
}
|
|
60
|
+
::slotted(.animate-up) {
|
|
61
|
+
transform: translateY(-120%);
|
|
62
|
+
}
|
|
63
|
+
::slotted(.animate-down) {
|
|
64
|
+
transform: translateY(120%);
|
|
65
|
+
}
|
|
66
|
+
::slotted(.custom-selected) {
|
|
67
|
+
opacity: 1;
|
|
68
|
+
pointer-events: auto;
|
|
69
|
+
transform: translateY(0);
|
|
70
|
+
transition: var(--md-sys-motion-easing-emphasized-decelerate) 500ms width,
|
|
71
|
+
var(--md-sys-motion-easing-emphasized-decelerate) 500ms transform;
|
|
72
|
+
max-height: 100%;
|
|
73
|
+
max-width: 100%;
|
|
74
|
+
}
|
|
75
|
+
`
|
|
76
|
+
];
|
|
77
|
+
render() {
|
|
78
|
+
return html `
|
|
79
|
+
<div class="wrapper">
|
|
80
|
+
<slot></slot>
|
|
81
|
+
</div>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
customElements.define('custom-pages', CustomPages);
|
|
87
|
+
|
|
88
|
+
export { CustomPages };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LiteElement } from '@vandeurenglenn/lite';
|
|
2
|
+
import '../elevation/elevation.js';
|
|
3
|
+
import '../button/button.js';
|
|
4
|
+
import '../icon/icon.js';
|
|
5
|
+
export declare class CustomPane extends LiteElement {
|
|
6
|
+
accessor open: boolean;
|
|
7
|
+
accessor mobile: boolean;
|
|
8
|
+
accessor type: 'modal' | undefined;
|
|
9
|
+
accessor left: boolean;
|
|
10
|
+
accessor right: boolean;
|
|
11
|
+
accessor id: string;
|
|
12
|
+
closePane(event: any): void;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
package/exports/pane.js
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
|
|
2
|
+
import { customElement, property, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
import './elevation.js';
|
|
4
|
+
import './button.js';
|
|
5
|
+
import './icon.js';
|
|
6
|
+
import '@vandeurenglenn/little-pubsub';
|
|
7
|
+
|
|
8
|
+
let CustomPane = (() => {
|
|
9
|
+
let _classDecorators = [customElement('custom-pane')];
|
|
10
|
+
let _classDescriptor;
|
|
11
|
+
let _classExtraInitializers = [];
|
|
12
|
+
let _classThis;
|
|
13
|
+
let _classSuper = LiteElement;
|
|
14
|
+
let _open_decorators;
|
|
15
|
+
let _open_initializers = [];
|
|
16
|
+
let _open_extraInitializers = [];
|
|
17
|
+
let _mobile_decorators;
|
|
18
|
+
let _mobile_initializers = [];
|
|
19
|
+
let _mobile_extraInitializers = [];
|
|
20
|
+
let _type_decorators;
|
|
21
|
+
let _type_initializers = [];
|
|
22
|
+
let _type_extraInitializers = [];
|
|
23
|
+
let _left_decorators;
|
|
24
|
+
let _left_initializers = [];
|
|
25
|
+
let _left_extraInitializers = [];
|
|
26
|
+
let _right_decorators;
|
|
27
|
+
let _right_initializers = [];
|
|
28
|
+
let _right_extraInitializers = [];
|
|
29
|
+
let _id_decorators;
|
|
30
|
+
let _id_initializers = [];
|
|
31
|
+
let _id_extraInitializers = [];
|
|
32
|
+
(class extends _classSuper {
|
|
33
|
+
static { _classThis = this; }
|
|
34
|
+
static {
|
|
35
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
36
|
+
_open_decorators = [property({ type: Boolean, reflect: true })];
|
|
37
|
+
_mobile_decorators = [property({ type: Boolean, reflect: true })];
|
|
38
|
+
_type_decorators = [property({ type: String, reflect: true })];
|
|
39
|
+
_left_decorators = [property({ type: Boolean, reflect: true })];
|
|
40
|
+
_right_decorators = [property({ type: Boolean, reflect: true })];
|
|
41
|
+
_id_decorators = [property({ type: String })];
|
|
42
|
+
__esDecorate(this, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
|
|
43
|
+
__esDecorate(this, null, _mobile_decorators, { kind: "accessor", name: "mobile", static: false, private: false, access: { has: obj => "mobile" in obj, get: obj => obj.mobile, set: (obj, value) => { obj.mobile = value; } }, metadata: _metadata }, _mobile_initializers, _mobile_extraInitializers);
|
|
44
|
+
__esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
45
|
+
__esDecorate(this, null, _left_decorators, { kind: "accessor", name: "left", static: false, private: false, access: { has: obj => "left" in obj, get: obj => obj.left, set: (obj, value) => { obj.left = value; } }, metadata: _metadata }, _left_initializers, _left_extraInitializers);
|
|
46
|
+
__esDecorate(this, null, _right_decorators, { kind: "accessor", name: "right", static: false, private: false, access: { has: obj => "right" in obj, get: obj => obj.right, set: (obj, value) => { obj.right = value; } }, metadata: _metadata }, _right_initializers, _right_extraInitializers);
|
|
47
|
+
__esDecorate(this, null, _id_decorators, { kind: "accessor", name: "id", static: false, private: false, access: { has: obj => "id" in obj, get: obj => obj.id, set: (obj, value) => { obj.id = value; } }, metadata: _metadata }, _id_initializers, _id_extraInitializers);
|
|
48
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
49
|
+
_classThis = _classDescriptor.value;
|
|
50
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
51
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
52
|
+
}
|
|
53
|
+
#open_accessor_storage = __runInitializers(this, _open_initializers, false);
|
|
54
|
+
get open() { return this.#open_accessor_storage; }
|
|
55
|
+
set open(value) { this.#open_accessor_storage = value; }
|
|
56
|
+
#mobile_accessor_storage = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _mobile_initializers, false));
|
|
57
|
+
get mobile() { return this.#mobile_accessor_storage; }
|
|
58
|
+
set mobile(value) { this.#mobile_accessor_storage = value; }
|
|
59
|
+
#type_accessor_storage = (__runInitializers(this, _mobile_extraInitializers), __runInitializers(this, _type_initializers, void 0));
|
|
60
|
+
get type() { return this.#type_accessor_storage; }
|
|
61
|
+
set type(value) { this.#type_accessor_storage = value; }
|
|
62
|
+
#left_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _left_initializers, true));
|
|
63
|
+
get left() { return this.#left_accessor_storage; }
|
|
64
|
+
set left(value) { this.#left_accessor_storage = value; }
|
|
65
|
+
#right_accessor_storage = (__runInitializers(this, _left_extraInitializers), __runInitializers(this, _right_initializers, false));
|
|
66
|
+
get right() { return this.#right_accessor_storage; }
|
|
67
|
+
set right(value) { this.#right_accessor_storage = value; }
|
|
68
|
+
#id_accessor_storage = (__runInitializers(this, _right_extraInitializers), __runInitializers(this, _id_initializers, void 0));
|
|
69
|
+
get id() { return this.#id_accessor_storage; }
|
|
70
|
+
set id(value) { this.#id_accessor_storage = value; }
|
|
71
|
+
closePane(event) {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
this.open = false;
|
|
74
|
+
document.dispatchEvent(new CustomEvent(`custom-pane-close`, { detail: this.id || `${this.left ? 'left' : 'right'}` }));
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return html `<style>
|
|
78
|
+
:host {
|
|
79
|
+
--custom-pane-width: 100%;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
height: 100%;
|
|
83
|
+
background: var(--md-sys-color-surface);
|
|
84
|
+
color: var(--md-sys-color-on-surface);
|
|
85
|
+
position: relative;
|
|
86
|
+
/* border-radius: 12px; */
|
|
87
|
+
|
|
88
|
+
--md-elevation-level: 0;
|
|
89
|
+
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
opacity: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
max-width: var(--custom-pane-width);
|
|
94
|
+
transition: var(--md-sys-motion-easing-emphasized-accelerate) 200ms opacity,
|
|
95
|
+
var(--md-sys-motion-easing-emphasized-accelerate) 200ms transform;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([left]) {
|
|
99
|
+
border-radius: var(--md-sys-shape-corner-large-end);
|
|
100
|
+
transform: translateX(-100%);
|
|
101
|
+
z-index: 1002;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([right]) {
|
|
105
|
+
border-radius: var(--md-sys-shape-corner-large-start);
|
|
106
|
+
transform: translateX(100%);
|
|
107
|
+
z-index: 1001;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([mobile]) {
|
|
111
|
+
inset: 0;
|
|
112
|
+
position: fixed;
|
|
113
|
+
z-index: 1001;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([type='modal']) {
|
|
117
|
+
--md-elevation-level: 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([open]) {
|
|
121
|
+
transform: translateX(0);
|
|
122
|
+
opacity: 1;
|
|
123
|
+
pointer-events: auto;
|
|
124
|
+
transition: var(--md-sys-motion-easing-emphasized-decelerate) 500ms opacity,
|
|
125
|
+
var(--md-sys-motion-easing-emphasized-decelerate) 500ms transform;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([open]) {
|
|
129
|
+
position: relative;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([open][mobile]) {
|
|
133
|
+
position: fixed;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
aside {
|
|
137
|
+
width: 100%;
|
|
138
|
+
height: 100%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.content {
|
|
142
|
+
height: calc(100% - 54px);
|
|
143
|
+
width: 100%;
|
|
144
|
+
overflow-y: auto;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.footer {
|
|
148
|
+
height: 54px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([right]) custom-button {
|
|
152
|
+
transform: rotateZ(180deg);
|
|
153
|
+
}
|
|
154
|
+
</style>
|
|
155
|
+
<custom-elevation></custom-elevation>
|
|
156
|
+
<aside>
|
|
157
|
+
<slot name="header">
|
|
158
|
+
<flex-row center>
|
|
159
|
+
<slot name="headline"></slot>
|
|
160
|
+
<flex-it></flex-it>
|
|
161
|
+
<custom-button @click=${(e) => this.closePane(e)} .id=${this.id}>
|
|
162
|
+
<custom-icon slot="icon">menu_open</custom-icon>
|
|
163
|
+
</custom-button>
|
|
164
|
+
</flex-row>
|
|
165
|
+
</slot>
|
|
166
|
+
<flex-column class="content">
|
|
167
|
+
<slot name="content"></slot>
|
|
168
|
+
</flex-column>
|
|
169
|
+
<flex-row class="footer">
|
|
170
|
+
<slot name="footer"></slot>
|
|
171
|
+
</flex-row>
|
|
172
|
+
</aside> `;
|
|
173
|
+
}
|
|
174
|
+
constructor() {
|
|
175
|
+
super(...arguments);
|
|
176
|
+
__runInitializers(this, _id_extraInitializers);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
return _classThis;
|
|
180
|
+
})();
|
|
181
|
+
|
|
182
|
+
export { CustomPane };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LiteElement } from '@vandeurenglenn/lite';
|
|
2
|
+
import '../pane/pane.js';
|
|
3
|
+
export declare class CustomRail extends LiteElement {
|
|
4
|
+
accessor open: boolean;
|
|
5
|
+
accessor mobile: boolean;
|
|
6
|
+
accessor type: 'modal' | undefined;
|
|
7
|
+
accessor right: boolean;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
}
|
package/exports/rail.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
|
|
2
|
+
import { customElement, property, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
import './pane.js';
|
|
4
|
+
import './elevation.js';
|
|
5
|
+
import './button.js';
|
|
6
|
+
import './icon.js';
|
|
7
|
+
import '@vandeurenglenn/little-pubsub';
|
|
8
|
+
|
|
9
|
+
let CustomRail = (() => {
|
|
10
|
+
let _classDecorators = [customElement('custom-rail')];
|
|
11
|
+
let _classDescriptor;
|
|
12
|
+
let _classExtraInitializers = [];
|
|
13
|
+
let _classThis;
|
|
14
|
+
let _classSuper = LiteElement;
|
|
15
|
+
let _open_decorators;
|
|
16
|
+
let _open_initializers = [];
|
|
17
|
+
let _open_extraInitializers = [];
|
|
18
|
+
let _mobile_decorators;
|
|
19
|
+
let _mobile_initializers = [];
|
|
20
|
+
let _mobile_extraInitializers = [];
|
|
21
|
+
let _type_decorators;
|
|
22
|
+
let _type_initializers = [];
|
|
23
|
+
let _type_extraInitializers = [];
|
|
24
|
+
let _right_decorators;
|
|
25
|
+
let _right_initializers = [];
|
|
26
|
+
let _right_extraInitializers = [];
|
|
27
|
+
(class extends _classSuper {
|
|
28
|
+
static { _classThis = this; }
|
|
29
|
+
static {
|
|
30
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
31
|
+
_open_decorators = [property({ type: Boolean, reflect: true })];
|
|
32
|
+
_mobile_decorators = [property({ type: Boolean, reflect: true })];
|
|
33
|
+
_type_decorators = [property({ type: String, reflect: true })];
|
|
34
|
+
_right_decorators = [property({ type: Boolean })];
|
|
35
|
+
__esDecorate(this, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
|
|
36
|
+
__esDecorate(this, null, _mobile_decorators, { kind: "accessor", name: "mobile", static: false, private: false, access: { has: obj => "mobile" in obj, get: obj => obj.mobile, set: (obj, value) => { obj.mobile = value; } }, metadata: _metadata }, _mobile_initializers, _mobile_extraInitializers);
|
|
37
|
+
__esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
38
|
+
__esDecorate(this, null, _right_decorators, { kind: "accessor", name: "right", static: false, private: false, access: { has: obj => "right" in obj, get: obj => obj.right, set: (obj, value) => { obj.right = value; } }, metadata: _metadata }, _right_initializers, _right_extraInitializers);
|
|
39
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
40
|
+
_classThis = _classDescriptor.value;
|
|
41
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
42
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
43
|
+
}
|
|
44
|
+
#open_accessor_storage = __runInitializers(this, _open_initializers, false);
|
|
45
|
+
get open() { return this.#open_accessor_storage; }
|
|
46
|
+
set open(value) { this.#open_accessor_storage = value; }
|
|
47
|
+
#mobile_accessor_storage = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _mobile_initializers, false));
|
|
48
|
+
get mobile() { return this.#mobile_accessor_storage; }
|
|
49
|
+
set mobile(value) { this.#mobile_accessor_storage = value; }
|
|
50
|
+
#type_accessor_storage = (__runInitializers(this, _mobile_extraInitializers), __runInitializers(this, _type_initializers, void 0));
|
|
51
|
+
get type() { return this.#type_accessor_storage; }
|
|
52
|
+
set type(value) { this.#type_accessor_storage = value; }
|
|
53
|
+
#right_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _right_initializers, false));
|
|
54
|
+
get right() { return this.#right_accessor_storage; }
|
|
55
|
+
set right(value) { this.#right_accessor_storage = value; }
|
|
56
|
+
render() {
|
|
57
|
+
return html `<style>
|
|
58
|
+
:host {
|
|
59
|
+
display: contents;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
custom-pane {
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
padding: 12px 24px;
|
|
65
|
+
height: 100%;
|
|
66
|
+
--custom-pane-width: var(--custom-drawer-with, 320px);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
slot[name='headline']::slotted(*) {
|
|
70
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
71
|
+
font-family: var(--md-sys-typescale-title-small-font-family-name);
|
|
72
|
+
font-style: var(--md-sys-typescale-title-small-font-family-style);
|
|
73
|
+
font-weight: var(--md-sys-typescale-title-small-font-weight);
|
|
74
|
+
font-size: var(--md-sys-typescale-title-small-font-size);
|
|
75
|
+
letter-spacing: var(--md-sys-typescale-title-small-tracking);
|
|
76
|
+
line-height: var(--md-sys-typescale-title-small-height);
|
|
77
|
+
text-transform: var(--md-sys-typescale-title-small-text-transform);
|
|
78
|
+
text-decoration: var(--md-sys-typescale-title-small-text-decoration);
|
|
79
|
+
text-transform: capitalize;
|
|
80
|
+
margin: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
::slotted([slot='footer']) {
|
|
84
|
+
display: block;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
min-height: 48px;
|
|
87
|
+
border-top: 1px solid rgba(0, 0, 0, 0.14);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
::slotted([slot='content']) {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
height: 100%;
|
|
94
|
+
width: 100%;
|
|
95
|
+
overflow-y: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
::slotted(*) {
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
aside {
|
|
103
|
+
width: 100%;
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
106
|
+
|
|
107
|
+
<custom-pane .open=${this.open} .mobile=${this.mobile} .type=${this.type}>
|
|
108
|
+
<slot name="header">
|
|
109
|
+
<slot name="headline" slot="headline"></slot>
|
|
110
|
+
<slot name="menu-button" slot="menu-button"></slot>
|
|
111
|
+
</slot>
|
|
112
|
+
<slot name="content" slot="content"></slot>
|
|
113
|
+
<slot name="footer" slot="footer"></slot>
|
|
114
|
+
</custom-pane> `;
|
|
115
|
+
}
|
|
116
|
+
constructor() {
|
|
117
|
+
super(...arguments);
|
|
118
|
+
__runInitializers(this, _right_extraInitializers);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return _classThis;
|
|
122
|
+
})();
|
|
123
|
+
|
|
124
|
+
export { CustomRail };
|
package/exports/root.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
|
|
2
|
+
import { customElement, css, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
import './theme.js';
|
|
4
|
+
|
|
5
|
+
let CustomRoot = (() => {
|
|
6
|
+
let _classDecorators = [customElement('custom-root')];
|
|
7
|
+
let _classDescriptor;
|
|
8
|
+
let _classExtraInitializers = [];
|
|
9
|
+
let _classThis;
|
|
10
|
+
let _classSuper = LiteElement;
|
|
11
|
+
(class extends _classSuper {
|
|
12
|
+
static { _classThis = this; }
|
|
13
|
+
static {
|
|
14
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
15
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
16
|
+
_classThis = _classDescriptor.value;
|
|
17
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
18
|
+
}
|
|
19
|
+
static styles = [
|
|
20
|
+
css `
|
|
21
|
+
:host {
|
|
22
|
+
display: contents;
|
|
23
|
+
}
|
|
24
|
+
`
|
|
25
|
+
];
|
|
26
|
+
render() {
|
|
27
|
+
return html `
|
|
28
|
+
<custom-theme></custom-theme>
|
|
29
|
+
<slot></slot>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return _classThis;
|
|
37
|
+
})();
|
|
38
|
+
|
|
39
|
+
export { CustomRoot };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const ScrollMixin = (Base) => class ScrollMixin extends Base {
|
|
2
|
+
set scrolling(value) {
|
|
3
|
+
if (value)
|
|
4
|
+
this.setAttribute('scrolling', '');
|
|
5
|
+
else
|
|
6
|
+
this.removeAttribute('scrolling');
|
|
7
|
+
}
|
|
8
|
+
get scrolling() {
|
|
9
|
+
return this.hasAttribute('scrolling');
|
|
10
|
+
}
|
|
11
|
+
scrollElement = this;
|
|
12
|
+
#onscroll = () => {
|
|
13
|
+
if (this.isScrolling)
|
|
14
|
+
clearTimeout(this.isScrolling);
|
|
15
|
+
else
|
|
16
|
+
document.dispatchEvent(new CustomEvent('custom-scroll', { detail: { scrolling: this.scrollTop !== 0 } }));
|
|
17
|
+
this.isScrolling = setTimeout(() => {
|
|
18
|
+
this.scrolling = this.scrollTop !== 0;
|
|
19
|
+
document.dispatchEvent(new CustomEvent('custom-scroll', { detail: { scrolling: this.scrolling } }));
|
|
20
|
+
this.isScrolling = undefined;
|
|
21
|
+
}, this.scrollTimeout);
|
|
22
|
+
};
|
|
23
|
+
async connectedCallback(options = { scrollElement: undefined }) {
|
|
24
|
+
super.connectedCallback && super.connectedCallback();
|
|
25
|
+
await this.updateComplete;
|
|
26
|
+
this.scrollElement = this.shadowRoot.querySelector(options.scrollElement) || this;
|
|
27
|
+
this.scrollTimeout = 100;
|
|
28
|
+
this.scrollElement.addEventListener('scroll', this.#onscroll);
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
super.disconnectedCallback && super.disconnectedCallback();
|
|
32
|
+
this.scrollElement.removeEventListener('scroll', this.#onscroll);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { ScrollMixin };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
|
|
2
|
+
import { customElement, css, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
import './section2.js';
|
|
4
|
+
import './code.js';
|
|
5
|
+
import './scroll-mixin.js';
|
|
6
|
+
import './elevation.js';
|
|
7
|
+
|
|
8
|
+
const replaceHtmlEntities = (str) => str.replace(/(\ <\/(?=[^<\/]*$))/g, '<');
|
|
9
|
+
let DemoSection = (() => {
|
|
10
|
+
let _classDecorators = [customElement('demo-section')];
|
|
11
|
+
let _classDescriptor;
|
|
12
|
+
let _classExtraInitializers = [];
|
|
13
|
+
let _classThis;
|
|
14
|
+
let _classSuper = LiteElement;
|
|
15
|
+
(class extends _classSuper {
|
|
16
|
+
static { _classThis = this; }
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
20
|
+
_classThis = _classDescriptor.value;
|
|
21
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
22
|
+
}
|
|
23
|
+
async connectedCallback() {
|
|
24
|
+
const assignedElements = this.shadowRoot.querySelector('slot').assignedElements();
|
|
25
|
+
for (const element of assignedElements) {
|
|
26
|
+
const code = document.createElement('demo-code');
|
|
27
|
+
code.code = await replaceHtmlEntities(element.outerHTML);
|
|
28
|
+
element.after(code);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
static styles = [
|
|
32
|
+
css `
|
|
33
|
+
:host {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
39
|
+
];
|
|
40
|
+
render() {
|
|
41
|
+
return html `
|
|
42
|
+
<custom-section>
|
|
43
|
+
<slot></slot>
|
|
44
|
+
</custom-section>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
static {
|
|
48
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return _classThis;
|
|
52
|
+
})();
|
|
53
|
+
|
|
54
|
+
export { DemoSection };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
|
|
2
|
+
import { customElement, css, html, LiteElement } from '@vandeurenglenn/lite';
|
|
3
|
+
import { ScrollMixin } from './scroll-mixin.js';
|
|
4
|
+
import './elevation.js';
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
let CustomSection = (() => {
|
|
8
|
+
let _classDecorators = [customElement('custom-section')];
|
|
9
|
+
let _classDescriptor;
|
|
10
|
+
let _classExtraInitializers = [];
|
|
11
|
+
let _classThis;
|
|
12
|
+
let _classSuper = ScrollMixin(LiteElement);
|
|
13
|
+
(class extends _classSuper {
|
|
14
|
+
static { _classThis = this; }
|
|
15
|
+
static {
|
|
16
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
18
|
+
_classThis = _classDescriptor.value;
|
|
19
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
20
|
+
}
|
|
21
|
+
static styles = [
|
|
22
|
+
css `
|
|
23
|
+
:host {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: baseline;
|
|
27
|
+
margin: 16px;
|
|
28
|
+
position: relative;
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
}
|
|
31
|
+
.container {
|
|
32
|
+
align-items: center;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
padding: 12px;
|
|
35
|
+
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
36
|
+
}
|
|
37
|
+
.content {
|
|
38
|
+
max-width: 720px;
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
];
|
|
42
|
+
render() {
|
|
43
|
+
return html `
|
|
44
|
+
<flex-column class="container">
|
|
45
|
+
<flex-column class="content">
|
|
46
|
+
<slot></slot>
|
|
47
|
+
</flex-column>
|
|
48
|
+
</flex-column>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
static {
|
|
52
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return _classThis;
|
|
56
|
+
})();
|
|
57
|
+
|
|
58
|
+
export { CustomSection };
|