@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.
Files changed (158) hide show
  1. package/exports/banner/banner.d.ts +7 -0
  2. package/exports/banner.js +68 -0
  3. package/exports/bundle/banner.js +37 -0
  4. package/exports/bundle/button.js +144 -0
  5. package/exports/bundle/card.js +140 -0
  6. package/exports/bundle/code.js +35 -0
  7. package/exports/bundle/custom-element-c2e883ba.js +1 -0
  8. package/exports/bundle/demo-elements.js +1 -0
  9. package/exports/bundle/demo-icons.js +16 -0
  10. package/exports/bundle/demo-shell.js +540 -0
  11. package/exports/bundle/demo.js +457 -0
  12. package/exports/bundle/dial.js +1 -0
  13. package/exports/bundle/dialog.js +149 -0
  14. package/exports/bundle/divider.js +21 -0
  15. package/exports/bundle/drawer-button.js +18 -0
  16. package/exports/bundle/drawer-item.js +39 -0
  17. package/exports/bundle/drawer-layout.js +96 -0
  18. package/exports/bundle/drawer.js +56 -0
  19. package/exports/bundle/dropdown-menu.js +59 -0
  20. package/exports/bundle/dropdown.js +26 -0
  21. package/exports/bundle/elements.js +1 -0
  22. package/exports/bundle/elevation.js +56 -0
  23. package/exports/bundle/hour-field.js +1 -0
  24. package/exports/bundle/icon-button.js +13 -0
  25. package/exports/bundle/icon-set.js +5 -0
  26. package/exports/bundle/icon.js +16 -0
  27. package/exports/bundle/index-3c006227.js +1 -0
  28. package/exports/bundle/index.html +590 -0
  29. package/exports/bundle/input.js +6 -0
  30. package/exports/bundle/it-d4d177bf.js +1 -0
  31. package/exports/bundle/list-item.js +43 -0
  32. package/exports/bundle/list.js +1 -0
  33. package/exports/bundle/menu.js +13 -0
  34. package/exports/bundle/menu2.js +1 -0
  35. package/exports/bundle/minute-field.js +5 -0
  36. package/exports/bundle/pages.js +43 -0
  37. package/exports/bundle/pane.js +96 -0
  38. package/exports/bundle/property-58e28172.js +11 -0
  39. package/exports/bundle/query-73dacde5.js +1 -0
  40. package/exports/bundle/rail.js +58 -0
  41. package/exports/bundle/root.js +8 -0
  42. package/exports/bundle/scroll-mixin.js +1 -0
  43. package/exports/bundle/section.js +11 -0
  44. package/exports/bundle/section2.js +25 -0
  45. package/exports/bundle/select-mixin.js +1 -0
  46. package/exports/bundle/selector-mixin.js +1 -0
  47. package/exports/bundle/selector.js +31 -0
  48. package/exports/bundle/supporting-pane.js +47 -0
  49. package/exports/bundle/tab.js +22 -0
  50. package/exports/bundle/tabs.js +51 -0
  51. package/exports/bundle/text-field.js +10 -0
  52. package/exports/bundle/theme.js +1 -0
  53. package/exports/bundle/themes/default/colors.module.css +180 -0
  54. package/exports/bundle/themes/default/missing/motion.css +4 -0
  55. package/exports/bundle/themes/default/missing/shape.css +13 -0
  56. package/exports/bundle/themes/default/missing/theme.dark.css +5 -0
  57. package/exports/bundle/themes/default/missing/theme.light.css +5 -0
  58. package/exports/bundle/themes/default/missing/tokens.css +9 -0
  59. package/exports/bundle/themes/default/theme.css +10 -0
  60. package/exports/bundle/themes/default/theme.dark.css +33 -0
  61. package/exports/bundle/themes/default/theme.light.css +33 -0
  62. package/exports/bundle/themes/default/tokens.css +256 -0
  63. package/exports/bundle/themes/default/typography.module.css +150 -0
  64. package/exports/bundle/time-picker.js +21 -0
  65. package/exports/bundle/title.js +1 -0
  66. package/exports/bundle/toggle-button.js +4 -0
  67. package/exports/bundle/toggle.js +5 -0
  68. package/exports/bundle/top-app-bar-e6e33a9e.js +114 -0
  69. package/exports/bundle/top-app-bar.js +1 -0
  70. package/exports/bundle/types.js +1 -0
  71. package/exports/bundle/typography.js +156 -0
  72. package/exports/button.js +227 -0
  73. package/exports/card/card.d.ts +13 -0
  74. package/exports/card.js +187 -0
  75. package/exports/code.js +77 -0
  76. package/exports/demo-elements.d.ts +9 -0
  77. package/exports/demo-elements.js +10 -0
  78. package/exports/demo-icons.js +48 -0
  79. package/exports/demo-shell.js +648 -0
  80. package/exports/demo.js +524 -0
  81. package/exports/dial.js +1 -0
  82. package/exports/dialog.js +256 -0
  83. package/exports/divider/divider.d.ts +17 -0
  84. package/exports/divider.js +54 -0
  85. package/exports/drawer/drawer-button.d.ts +9 -0
  86. package/exports/drawer/drawer-layout.d.ts +19 -0
  87. package/exports/drawer/drawer.d.ts +13 -0
  88. package/exports/drawer-button.js +83 -0
  89. package/exports/drawer-item.js +69 -0
  90. package/exports/drawer-layout.js +209 -0
  91. package/exports/drawer.js +140 -0
  92. package/exports/dropdown-menu.js +172 -0
  93. package/exports/dropdown.js +68 -0
  94. package/exports/elements.d.ts +63 -0
  95. package/exports/elements.js +41 -0
  96. package/exports/elevation/elevation.d.ts +11 -0
  97. package/exports/elevation.js +97 -0
  98. package/exports/hour-field.js +1 -0
  99. package/exports/icon-button.js +59 -0
  100. package/exports/icon-set.js +52 -0
  101. package/exports/icon.js +103 -0
  102. package/exports/input.js +36 -0
  103. package/exports/list/list.d.ts +1 -0
  104. package/exports/list-item.js +127 -0
  105. package/exports/list.js +1 -0
  106. package/exports/menu.js +68 -0
  107. package/exports/menu2.js +1 -0
  108. package/exports/minute-field.js +36 -0
  109. package/exports/mixins/scroll-mixin.d.ts +13 -0
  110. package/exports/mixins/select-mixin.d.ts +32 -0
  111. package/exports/mixins/selector-mixin.d.ts +8 -0
  112. package/exports/pages.js +88 -0
  113. package/exports/pane/pane.d.ts +14 -0
  114. package/exports/pane.js +182 -0
  115. package/exports/rail/rail.d.ts +9 -0
  116. package/exports/rail.js +124 -0
  117. package/exports/root.js +39 -0
  118. package/exports/scroll-mixin.js +36 -0
  119. package/exports/section.js +54 -0
  120. package/exports/section2.js +58 -0
  121. package/exports/select-mixin.js +139 -0
  122. package/exports/selector-mixin.js +43 -0
  123. package/exports/selector.js +63 -0
  124. package/exports/supporting-pane/supporting-pane.d.ts +12 -0
  125. package/exports/supporting-pane.js +133 -0
  126. package/exports/tab.js +47 -0
  127. package/exports/tabs/menu.d.ts +1 -0
  128. package/exports/tabs/tab.d.ts +4 -0
  129. package/exports/tabs/tabs.d.ts +5 -0
  130. package/exports/tabs.js +80 -0
  131. package/exports/text-field.js +88 -0
  132. package/exports/theme/theme.d.ts +15 -0
  133. package/exports/theme.js +123 -0
  134. package/exports/themes/default/colors.module.css +180 -0
  135. package/exports/themes/default/missing/motion.css +4 -0
  136. package/exports/themes/default/missing/shape.css +13 -0
  137. package/exports/themes/default/missing/theme.dark.css +5 -0
  138. package/exports/themes/default/missing/theme.light.css +5 -0
  139. package/exports/themes/default/missing/tokens.css +9 -0
  140. package/exports/themes/default/theme.css +10 -0
  141. package/exports/themes/default/theme.dark.css +33 -0
  142. package/exports/themes/default/theme.light.css +33 -0
  143. package/exports/themes/default/tokens.css +256 -0
  144. package/exports/themes/default/typography.module.css +150 -0
  145. package/exports/time-picker/dial.d.ts +1 -0
  146. package/exports/time-picker/hour-field.d.ts +1 -0
  147. package/exports/time-picker.js +52 -0
  148. package/exports/title.js +1 -0
  149. package/exports/toggle/toggle-button.d.ts +13 -0
  150. package/exports/toggle-button.js +63 -0
  151. package/exports/toggle.js +78 -0
  152. package/exports/top-app-bar.js +143 -0
  153. package/exports/tslib.es6-d3ba6528.js +57 -0
  154. package/exports/types.d.ts +18 -0
  155. package/exports/types.js +1 -0
  156. package/exports/typography/title.d.ts +1 -0
  157. package/exports/typography.js +206 -0
  158. package/package.json +256 -0
@@ -0,0 +1,139 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+
3
+ class SelectBase extends LiteElement {
4
+ #selected;
5
+ currentSelected;
6
+ connectedCallback() {
7
+ this.selected = this.defaultSelected;
8
+ }
9
+ get multi() {
10
+ return this.hasAttribute('multi');
11
+ }
12
+ set multi(value) {
13
+ value ? this.setAttribute('multi', '') : this.removeAttribute('multi');
14
+ }
15
+ get defaultSelected() {
16
+ return this.getAttribute('default-selected') || 0;
17
+ }
18
+ set selected(value) {
19
+ this.#selected = value;
20
+ this.#requestSelectedUpdate();
21
+ }
22
+ get selected() {
23
+ return this.#selected;
24
+ }
25
+ get slotted() {
26
+ if (this.shadowRoot)
27
+ return this.shadowRoot.querySelector('slot');
28
+ return this;
29
+ }
30
+ get #assignedNodes() {
31
+ const nodes = 'assignedNodes' in this.slotted ? this.slotted.assignedNodes() : this.children;
32
+ const arr = [];
33
+ for (var i = 0; i < nodes.length; i++) {
34
+ const node = nodes[i];
35
+ if (node.nodeType === 1)
36
+ arr.push(node);
37
+ }
38
+ return arr;
39
+ }
40
+ get attrForSelected() {
41
+ return this.getAttribute('attr-for-selected') || 'name';
42
+ }
43
+ /**
44
+ * get the attribute used to set selected
45
+ *
46
+ * @example
47
+ * <custom-selector attr-for-selected="select">
48
+ * <li select="1"></li>
49
+ * <li select="2"></li>
50
+ * </custom-selector>
51
+ */
52
+ set attrForSelected(value) {
53
+ this.setAttribute('attr-for-selected', value);
54
+ }
55
+ attributeChangedCallback(name, oldValue, newValue) {
56
+ if (oldValue !== newValue) {
57
+ // check if value is number
58
+ if (!isNaN(newValue)) {
59
+ newValue = Number(newValue);
60
+ }
61
+ this[name] = newValue;
62
+ }
63
+ }
64
+ /**
65
+ * @param {string|number|HTMLElement} selected
66
+ */
67
+ select(selected) {
68
+ if (selected)
69
+ this.selected = selected;
70
+ // TODO: fix selectedobservers
71
+ if (this.multi)
72
+ this.#requestSelectedUpdate();
73
+ }
74
+ next() {
75
+ const index = this.getIndexFor(this.currentSelected);
76
+ if (index !== -1 &&
77
+ index >= 0 &&
78
+ this.#assignedNodes.length > index &&
79
+ index + 1 <= this.#assignedNodes.length - 1) {
80
+ this.selected = this.#assignedNodes[index + 1];
81
+ }
82
+ }
83
+ previous() {
84
+ const index = this.getIndexFor(this.currentSelected);
85
+ if (index !== -1 && index >= 0 && this.#assignedNodes.length > index && index - 1 >= 0) {
86
+ this.selected = this.#assignedNodes[index - 1];
87
+ }
88
+ }
89
+ getIndexFor(element) {
90
+ return this.#assignedNodes.indexOf(element || this.selected);
91
+ }
92
+ #updateSelected(selected, currentSelected) {
93
+ selected.classList.add('custom-selected');
94
+ if (currentSelected && currentSelected !== selected) {
95
+ currentSelected.classList.remove('custom-selected');
96
+ }
97
+ this.currentSelected = selected;
98
+ }
99
+ #updateMultiSelected(selected) {
100
+ for (const child of this.#assignedNodes) {
101
+ if (selected.includes(child.getAttribute(this.attrForSelected))) {
102
+ child.classList.add('custom-selected');
103
+ }
104
+ else {
105
+ child.classList.remove('custom-selected');
106
+ }
107
+ }
108
+ }
109
+ #updateStringSelected(selected) {
110
+ for (const child of this.#assignedNodes) {
111
+ if (child.getAttribute(this.attrForSelected) === selected) {
112
+ return this.#updateSelected(child, this.currentSelected);
113
+ }
114
+ }
115
+ }
116
+ #requestSelectedUpdate() {
117
+ if (this.selected === undefined) {
118
+ this.currentSelected && this.currentSelected.classList.remove('custom-selected');
119
+ return;
120
+ }
121
+ const type = typeof this.selected;
122
+ if (Array.isArray(this.selected))
123
+ return this.#updateMultiSelected(this.selected);
124
+ if (type === 'object')
125
+ return this.#updateSelected(this.selected, this.currentSelected);
126
+ if (type === 'string')
127
+ return this.#updateStringSelected(this.selected);
128
+ // set selected by index
129
+ const child = this.#assignedNodes[this.selected];
130
+ if (child)
131
+ this.#updateSelected(child, this.currentSelected);
132
+ // remove selected even when nothing found, better to return nothing
133
+ }
134
+ }
135
+ function SelectMixin(Base) {
136
+ return SelectBase;
137
+ }
138
+
139
+ export { SelectBase, SelectMixin };
@@ -0,0 +1,43 @@
1
+ import { SelectBase } from './select-mixin.js';
2
+ import '@vandeurenglenn/lite';
3
+
4
+ class SelectorBase extends SelectBase {
5
+ constructor() {
6
+ super();
7
+ }
8
+ async connectedCallback() {
9
+ super.connectedCallback && (await super.connectedCallback());
10
+ // this.updateComplete && await this.updateComplete
11
+ this.slotted.addEventListener('click', this.#onClick.bind(this));
12
+ }
13
+ disconnectedCallback() {
14
+ super.disconnectedCallback && super.disconnectedCallback();
15
+ this.slotted.removeEventListener('click', this.#onClick.bind(this));
16
+ }
17
+ #onClick(event) {
18
+ const target = event.composedPath()[0];
19
+ if (target.localName === this.localName) {
20
+ // was just a click in the host element so we don't need todo anything
21
+ return;
22
+ }
23
+ const selected = target.getAttribute(this.attrForSelected) || target;
24
+ if (this.multi) {
25
+ const selectedArray = Array.isArray(this.selected) ? this.selected : [];
26
+ const index = selectedArray.indexOf(selected);
27
+ if (index === -1)
28
+ selectedArray.push(selected);
29
+ else
30
+ selectedArray.splice(index, 1);
31
+ // trigger observer
32
+ this.selected = selectedArray;
33
+ }
34
+ else
35
+ this.selected = selected;
36
+ this.dispatchEvent(new CustomEvent('selected', { detail: selected }));
37
+ }
38
+ }
39
+ function SelectorMixin(Base) {
40
+ return SelectorBase;
41
+ }
42
+
43
+ export { SelectorBase, SelectorMixin };
@@ -0,0 +1,63 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
2
+ import { customElement, css, html } from '@vandeurenglenn/lite';
3
+ import { SelectorBase } from './selector-mixin.js';
4
+ import './select-mixin.js';
5
+
6
+ let CustomSelector = (() => {
7
+ let _classDecorators = [customElement('custom-selector')];
8
+ let _classDescriptor;
9
+ let _classExtraInitializers = [];
10
+ let _classThis;
11
+ let _classSuper = SelectorBase;
12
+ (class extends _classSuper {
13
+ static { _classThis = this; }
14
+ static {
15
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
16
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
17
+ _classThis = _classDescriptor.value;
18
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
19
+ }
20
+ static styles = [
21
+ css `
22
+ :host {
23
+ display: flex;
24
+ flex-direction: column;
25
+ width: 100%;
26
+ height: 100%;
27
+ overflow-y: auto;
28
+ }
29
+
30
+ ::slotted(.custom-selected:not([non-interactive])) {
31
+ background: var(--md-sys-color-secondary-container);
32
+ color: var(--md-sys-color-on-secondary-container);
33
+ }
34
+
35
+ ::slotted(*) {
36
+ color: var(--md-sys-color-on-surface-variant);
37
+ font-family: var(--md-sys-typescale-label-large-font-family-name);
38
+ font-style: var(--md-sys-typescale-label-large-font-family-style);
39
+ font-weight: var(--md-sys-typescale-label-large-font-weight);
40
+ font-size: var(--md-sys-typescale-label-large-font-size);
41
+ letter-spacing: var(--md-sys-typescale-label-large-tracking);
42
+ line-height: var(--md-sys-typescale-label-large-height);
43
+ text-transform: var(--md-sys-typescale-label-large-text-transform);
44
+ text-decoration: var(--md-sys-typescale-label-large-text-decoration);
45
+ }
46
+
47
+ ::slotted(:not(.custom-selected):not([non-interactive]):hover) {
48
+ background: var(--md-sys-color-secondary-container-hover);
49
+ color: var(--md-sys-color-on-secondary-container);
50
+ }
51
+ `
52
+ ];
53
+ render() {
54
+ return html `<slot></slot>`;
55
+ }
56
+ static {
57
+ __runInitializers(_classThis, _classExtraInitializers);
58
+ }
59
+ });
60
+ return _classThis;
61
+ })();
62
+
63
+ export { CustomSelector };
@@ -0,0 +1,12 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ import './../pane/pane.js';
3
+ export declare class CustomSupportingPane extends LiteElement {
4
+ accessor open: boolean;
5
+ accessor variant: 'compact' | 'medium' | 'expanded';
6
+ accessor left: boolean;
7
+ accessor id: string;
8
+ accessor supporting: any;
9
+ onPaneClose({ detail }: CustomEvent): void;
10
+ connectedCallback(): void;
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ }
@@ -0,0 +1,133 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
2
+ import { customElement, property, query, 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 CustomSupportingPane = (() => {
10
+ let _classDecorators = [customElement('custom-supporting-pane')];
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 _variant_decorators;
19
+ let _variant_initializers = [];
20
+ let _variant_extraInitializers = [];
21
+ let _left_decorators;
22
+ let _left_initializers = [];
23
+ let _left_extraInitializers = [];
24
+ let _id_decorators;
25
+ let _id_initializers = [];
26
+ let _id_extraInitializers = [];
27
+ let _supporting_decorators;
28
+ let _supporting_initializers = [];
29
+ let _supporting_extraInitializers = [];
30
+ (class extends _classSuper {
31
+ static { _classThis = this; }
32
+ static {
33
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
34
+ _open_decorators = [property({ type: Boolean, reflect: true })];
35
+ _variant_decorators = [property({ type: String, reflect: true })];
36
+ _left_decorators = [property({ type: Boolean, reflect: true })];
37
+ _id_decorators = [property({ type: String })];
38
+ _supporting_decorators = [query('.support')];
39
+ __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);
40
+ __esDecorate(this, null, _variant_decorators, { kind: "accessor", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
41
+ __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);
42
+ __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);
43
+ __esDecorate(this, null, _supporting_decorators, { kind: "accessor", name: "supporting", static: false, private: false, access: { has: obj => "supporting" in obj, get: obj => obj.supporting, set: (obj, value) => { obj.supporting = value; } }, metadata: _metadata }, _supporting_initializers, _supporting_extraInitializers);
44
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
45
+ _classThis = _classDescriptor.value;
46
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
47
+ __runInitializers(_classThis, _classExtraInitializers);
48
+ }
49
+ #open_accessor_storage = __runInitializers(this, _open_initializers, false);
50
+ get open() { return this.#open_accessor_storage; }
51
+ set open(value) { this.#open_accessor_storage = value; }
52
+ #variant_accessor_storage = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _variant_initializers, 'expanded'));
53
+ get variant() { return this.#variant_accessor_storage; }
54
+ set variant(value) { this.#variant_accessor_storage = value; }
55
+ #left_accessor_storage = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _left_initializers, false));
56
+ get left() { return this.#left_accessor_storage; }
57
+ set left(value) { this.#left_accessor_storage = value; }
58
+ #id_accessor_storage = (__runInitializers(this, _left_extraInitializers), __runInitializers(this, _id_initializers, void 0));
59
+ get id() { return this.#id_accessor_storage; }
60
+ set id(value) { this.#id_accessor_storage = value; }
61
+ #supporting_accessor_storage = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _supporting_initializers, void 0));
62
+ get supporting() { return this.#supporting_accessor_storage; }
63
+ set supporting(value) { this.#supporting_accessor_storage = value; }
64
+ onPaneClose({ detail }) {
65
+ if (this.id === detail) {
66
+ this.open = false;
67
+ }
68
+ }
69
+ connectedCallback() {
70
+ document.addEventListener('custom-pane-close', this.onPaneClose.bind(this));
71
+ document.addEventListener('custom-pane-open', ({ detail }) => {
72
+ if (this.id === detail)
73
+ this.open = true;
74
+ });
75
+ }
76
+ render() {
77
+ return html `<style>
78
+ :host {
79
+ display: flex;
80
+ flex-direction: column;
81
+ height: 100%;
82
+ background: var(--md-sys-color-surface);
83
+ color: var(--md-sys-color-on-surface);
84
+ width: 100%;
85
+ position: relative;
86
+ --supporting-pane-width: 360px;
87
+ }
88
+ .support {
89
+ position: absolute;
90
+ right: 0;
91
+ }
92
+
93
+ :host([left]) {
94
+ left: 0;
95
+ right: none;
96
+ }
97
+ :host([variant='expanded']) .support {
98
+ --custom-pane-width: var(--supporting-pane-width);
99
+ }
100
+ :host([variant='expanded']) {
101
+ flex-direction: row;
102
+ }
103
+
104
+ :host([variant='compact']) .support {
105
+ position: absolute;
106
+ flex-direction: row;
107
+ }
108
+ main {
109
+ width: 100%;
110
+ }
111
+ :host([open]) main {
112
+ width: calc(100% - var(--supporting-pane-width));
113
+ }
114
+ </style>
115
+ <main>
116
+ <slot></slot>
117
+ </main>
118
+ <custom-pane class="support" ?open=${this.open} ?right=${!this.left} .id=${this.id}>
119
+ <slot name="supporting">
120
+ <slot name="supporting-header" slot="header"></slot>
121
+ <slot name="supporting-content"></slot>
122
+ </slot>
123
+ </custom-pane>`;
124
+ }
125
+ constructor() {
126
+ super(...arguments);
127
+ __runInitializers(this, _supporting_extraInitializers);
128
+ }
129
+ });
130
+ return _classThis;
131
+ })();
132
+
133
+ export { CustomSupportingPane };
package/exports/tab.js ADDED
@@ -0,0 +1,47 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
2
+ import { customElement, html, LiteElement } from '@vandeurenglenn/lite';
3
+
4
+ let CustomTab = (() => {
5
+ let _classDecorators = [customElement('custom-tab')];
6
+ let _classDescriptor;
7
+ let _classExtraInitializers = [];
8
+ let _classThis;
9
+ let _classSuper = LiteElement;
10
+ (class extends _classSuper {
11
+ static { _classThis = this; }
12
+ static {
13
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
14
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
15
+ _classThis = _classDescriptor.value;
16
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
17
+ __runInitializers(_classThis, _classExtraInitializers);
18
+ }
19
+ render() {
20
+ return html `
21
+ <style>
22
+ :host {
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ gap: 8px;
27
+ height: 40px;
28
+ padding: 0 12px;
29
+ box-sizing: border-box;
30
+ width: auto;
31
+ font: var(--_supporting-text-type);
32
+ cursor: pointer;
33
+ white-space: nowrap;
34
+ }
35
+
36
+ slot {
37
+ pointer-events: none;
38
+ }
39
+ </style>
40
+ <slot></slot>
41
+ `;
42
+ }
43
+ });
44
+ return _classThis;
45
+ })();
46
+
47
+ export { CustomTab };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ export declare class CustomTab extends LiteElement {
3
+ render(): import("lit-html").TemplateResult<1>;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { SelectorBase } from '../mixins/selector-mixin.js';
2
+ import './tab.js';
3
+ export declare class CustomTabs extends SelectorBase {
4
+ render(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,80 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
2
+ import { customElement, html } from '@vandeurenglenn/lite';
3
+ import { SelectorBase } from './selector-mixin.js';
4
+ import './tab.js';
5
+ import './select-mixin.js';
6
+
7
+ let CustomTabs = (() => {
8
+ let _classDecorators = [customElement('custom-tabs')];
9
+ let _classDescriptor;
10
+ let _classExtraInitializers = [];
11
+ let _classThis;
12
+ let _classSuper = SelectorBase;
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
+ __runInitializers(_classThis, _classExtraInitializers);
21
+ }
22
+ // TODO: make scrollable
23
+ render() {
24
+ return html `
25
+ <style>
26
+ :host {
27
+ --custom-tabs-background: var(---md-sys-color-surface);
28
+ --selected-color: var(--md-sys-color-primary);
29
+ --selected-tab-color: var(--md-sys-color-primary);
30
+ --custom-tabs-shape: var(--md-sys-shape-corner-none);
31
+ --inactive-color: var(--md-sys-color-on-surface-variant);
32
+ display: flex;
33
+ flex-direction: row;
34
+ min-height: var(--custom-tabs-height, 64px);
35
+ overflow-x: auto;
36
+ background: var(--custom-tabs-background);
37
+ border-radius: var(--custom-tabs-shape);
38
+ }
39
+ ::slotted(*) {
40
+ color: var(--inactive-color);
41
+ }
42
+ ::slotted(.custom-selected) {
43
+ color: var(--selected-color);
44
+ border-bottom: 2px solid var(--selected-tab-color);
45
+ }
46
+
47
+ :host([round]) ::slotted(*) {
48
+ gap: 0;
49
+ }
50
+
51
+ :host([round]) ::slotted(.custom-selected) {
52
+ --md-sys-color-on-surface: var(--md-sys-color-on-tertiary);
53
+ color: var(--md-sys-color-on-tertiary);
54
+ background: var(--md-sys-color-tertiary);
55
+ border: none;
56
+ border-radius: var(--md-sys-shape-corner-extra-large);
57
+ }
58
+ ::-webkit-scrollbar {
59
+ width: 6px;
60
+ border-radius: 12px;
61
+ }
62
+ ::-webkit-scrollbar-track {
63
+ background: #f1f1f1;
64
+ }
65
+ ::-webkit-scrollbar-thumb {
66
+ background: #888;
67
+ border-radius: 12px;
68
+ }
69
+ ::-webkit-scrollbar-thumb:hover {
70
+ background: #555;
71
+ }
72
+ </style>
73
+ <slot></slot>
74
+ `;
75
+ }
76
+ });
77
+ return _classThis;
78
+ })();
79
+
80
+ export { CustomTabs };
@@ -0,0 +1,88 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-d3ba6528.js';
2
+ import { customElement, query, property, css, html, LiteElement } from '@vandeurenglenn/lite';
3
+
4
+ let TextField = (() => {
5
+ let _classDecorators = [customElement('text-field')];
6
+ let _classDescriptor;
7
+ let _classExtraInitializers = [];
8
+ let _classThis;
9
+ let _classSuper = LiteElement;
10
+ let _leadingIconSlot_decorators;
11
+ let _leadingIconSlot_initializers = [];
12
+ let _leadingIconSlot_extraInitializers = [];
13
+ let _trailingIconSlot_decorators;
14
+ let _trailingIconSlot_initializers = [];
15
+ let _trailingIconSlot_extraInitializers = [];
16
+ let _hasLeadingIcon_decorators;
17
+ let _hasLeadingIcon_initializers = [];
18
+ let _hasLeadingIcon_extraInitializers = [];
19
+ let _hasTrailingIcon_decorators;
20
+ let _hasTrailingIcon_initializers = [];
21
+ let _hasTrailingIcon_extraInitializers = [];
22
+ (class extends _classSuper {
23
+ static { _classThis = this; }
24
+ static {
25
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
26
+ _leadingIconSlot_decorators = [query('slot[name="leading-icon"]')];
27
+ _trailingIconSlot_decorators = [query('slot[name="trailing-icon"]')];
28
+ _hasLeadingIcon_decorators = [property({ type: Boolean, reflect: true, attribute: 'has-leading-icon' })];
29
+ _hasTrailingIcon_decorators = [property({ type: Boolean, reflect: true, attribute: 'has-trailing-icon' })];
30
+ __esDecorate(this, null, _leadingIconSlot_decorators, { kind: "accessor", name: "leadingIconSlot", static: false, private: false, access: { has: obj => "leadingIconSlot" in obj, get: obj => obj.leadingIconSlot, set: (obj, value) => { obj.leadingIconSlot = value; } }, metadata: _metadata }, _leadingIconSlot_initializers, _leadingIconSlot_extraInitializers);
31
+ __esDecorate(this, null, _trailingIconSlot_decorators, { kind: "accessor", name: "trailingIconSlot", static: false, private: false, access: { has: obj => "trailingIconSlot" in obj, get: obj => obj.trailingIconSlot, set: (obj, value) => { obj.trailingIconSlot = value; } }, metadata: _metadata }, _trailingIconSlot_initializers, _trailingIconSlot_extraInitializers);
32
+ __esDecorate(this, null, _hasLeadingIcon_decorators, { kind: "accessor", name: "hasLeadingIcon", static: false, private: false, access: { has: obj => "hasLeadingIcon" in obj, get: obj => obj.hasLeadingIcon, set: (obj, value) => { obj.hasLeadingIcon = value; } }, metadata: _metadata }, _hasLeadingIcon_initializers, _hasLeadingIcon_extraInitializers);
33
+ __esDecorate(this, null, _hasTrailingIcon_decorators, { kind: "accessor", name: "hasTrailingIcon", static: false, private: false, access: { has: obj => "hasTrailingIcon" in obj, get: obj => obj.hasTrailingIcon, set: (obj, value) => { obj.hasTrailingIcon = value; } }, metadata: _metadata }, _hasTrailingIcon_initializers, _hasTrailingIcon_extraInitializers);
34
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
35
+ _classThis = _classDescriptor.value;
36
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
37
+ }
38
+ #leadingIconSlot_accessor_storage = __runInitializers(this, _leadingIconSlot_initializers, void 0);
39
+ get leadingIconSlot() { return this.#leadingIconSlot_accessor_storage; }
40
+ set leadingIconSlot(value) { this.#leadingIconSlot_accessor_storage = value; }
41
+ #trailingIconSlot_accessor_storage = (__runInitializers(this, _leadingIconSlot_extraInitializers), __runInitializers(this, _trailingIconSlot_initializers, void 0));
42
+ get trailingIconSlot() { return this.#trailingIconSlot_accessor_storage; }
43
+ set trailingIconSlot(value) { this.#trailingIconSlot_accessor_storage = value; }
44
+ #hasLeadingIcon_accessor_storage = (__runInitializers(this, _trailingIconSlot_extraInitializers), __runInitializers(this, _hasLeadingIcon_initializers, void 0));
45
+ get hasLeadingIcon() { return this.#hasLeadingIcon_accessor_storage; }
46
+ set hasLeadingIcon(value) { this.#hasLeadingIcon_accessor_storage = value; }
47
+ #hasTrailingIcon_accessor_storage = (__runInitializers(this, _hasLeadingIcon_extraInitializers), __runInitializers(this, _hasTrailingIcon_initializers, void 0));
48
+ get hasTrailingIcon() { return this.#hasTrailingIcon_accessor_storage; }
49
+ set hasTrailingIcon(value) { this.#hasTrailingIcon_accessor_storage = value; }
50
+ #leadingIconSlotChange = (__runInitializers(this, _hasTrailingIcon_extraInitializers), () => {
51
+ if (this.leadingIconSlot.assignedElements.length > 0)
52
+ this.hasLeadingIcon = true;
53
+ else
54
+ this.hasLeadingIcon = false;
55
+ });
56
+ #trailingIconSlotChange = () => {
57
+ if (this.trailingIconSlot.assignedElements.length > 0)
58
+ this.hasTrailingIcon = true;
59
+ else
60
+ this.hasTrailingIcon = false;
61
+ };
62
+ connectedCallback() {
63
+ this.leadingIconSlot.addEventListener('slotchange', this.#leadingIconSlotChange);
64
+ this.trailingIconSlot.addEventListener('slotchange', this.#trailingIconSlotChange);
65
+ }
66
+ static styles = [
67
+ css `
68
+ :host {
69
+ display: block;
70
+ }
71
+ .label {
72
+ }
73
+
74
+ :host([has-leading-icon]) {
75
+ }
76
+ `
77
+ ];
78
+ render() {
79
+ return html ` <slot name="leading-icon"></slot> `;
80
+ }
81
+ static {
82
+ __runInitializers(_classThis, _classExtraInitializers);
83
+ }
84
+ });
85
+ return _classThis;
86
+ })();
87
+
88
+ export { TextField };
@@ -0,0 +1,15 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ export declare class CustomTheme extends LiteElement {
3
+ #private;
4
+ accessor loadFont: boolean;
5
+ accessor narrowTrigger: string;
6
+ accessor narrow: boolean;
7
+ constructor();
8
+ set language(value: string);
9
+ get language(): string;
10
+ /**
11
+ * loads given path and converst (when needed) to css variables
12
+ * @param {string} path
13
+ */
14
+ load(path: string): Promise<void>;
15
+ }