@vandeurenglenn/lite-elements 0.3.34 → 0.3.36

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 (77) hide show
  1. package/exports/bundle/banner.js +1 -1
  2. package/exports/bundle/button.js +1 -1
  3. package/exports/bundle/card.js +1 -1
  4. package/exports/bundle/code.js +1 -1
  5. package/exports/bundle/{column-D2XB0lDz.js → column-CNOGwAhj.js} +1 -1
  6. package/exports/bundle/demo-elements.js +1 -1
  7. package/exports/bundle/demo-icons.js +2 -2
  8. package/exports/bundle/demo-shell.js +1 -1
  9. package/exports/bundle/demo.js +1 -1
  10. package/exports/bundle/dialog.js +7 -7
  11. package/exports/bundle/divider.js +1 -1
  12. package/exports/bundle/drawer-button.js +2 -6
  13. package/exports/bundle/drawer-item.js +1 -1
  14. package/exports/bundle/drawer-layout.js +1 -1
  15. package/exports/bundle/drawer.js +2 -2
  16. package/exports/bundle/dropdown-menu.js +2 -2
  17. package/exports/bundle/dropdown.js +1 -1
  18. package/exports/bundle/elements.js +1 -1
  19. package/exports/bundle/elevation.js +1 -1
  20. package/exports/bundle/fab.js +146 -0
  21. package/exports/bundle/icon-button.js +3 -3
  22. package/exports/bundle/icon-set.js +1 -1
  23. package/exports/bundle/icon.js +2 -2
  24. package/exports/bundle/input.js +1 -1
  25. package/exports/bundle/list-item.js +1 -1
  26. package/exports/bundle/menu.js +1 -1
  27. package/exports/bundle/minute-field.js +1 -1
  28. package/exports/bundle/notification.js +3 -3
  29. package/exports/bundle/notifications.js +1 -1
  30. package/exports/bundle/pages.js +1 -1
  31. package/exports/bundle/pane.js +4 -5
  32. package/exports/bundle/property-BhmaXNYq.js +39 -0
  33. package/exports/bundle/property-D-Y1CFIF.js +11 -0
  34. package/exports/bundle/rail.js +1 -1
  35. package/exports/bundle/root.js +1 -1
  36. package/exports/bundle/row-BHK6Zell.js +28 -0
  37. package/exports/bundle/section.js +1 -1
  38. package/exports/bundle/section2.js +1 -1
  39. package/exports/bundle/select-mixin.js +1 -1
  40. package/exports/bundle/selector-mixin.js +1 -1
  41. package/exports/bundle/selector.js +1 -1
  42. package/exports/bundle/summary-mirror.js +1 -1
  43. package/exports/bundle/summary.js +1 -1
  44. package/exports/bundle/supporting-pane.js +2 -2
  45. package/exports/bundle/tab.js +1 -1
  46. package/exports/bundle/tabs.js +1 -1
  47. package/exports/bundle/text-field.js +1 -1
  48. package/exports/bundle/theme.js +1 -1
  49. package/exports/bundle/time-picker.js +1 -1
  50. package/exports/bundle/toggle-button.js +1 -1
  51. package/exports/bundle/toggle.js +1 -1
  52. package/exports/bundle/top-app-bar.js +4 -4
  53. package/exports/bundle/typography.js +1 -1
  54. package/exports/bundle/upload-file.js +1 -1
  55. package/exports/bundle/upload-image.js +142 -147
  56. package/exports/dialog.js +6 -6
  57. package/exports/drawer/drawer-button.d.ts +1 -2
  58. package/exports/drawer-button.js +4 -7
  59. package/exports/drawer-layout.js +1 -0
  60. package/exports/drawer.js +1 -0
  61. package/exports/dropdown-menu.js +1 -1
  62. package/exports/fab/fab.d.ts +7 -0
  63. package/exports/fab.js +189 -0
  64. package/exports/icon/icon.d.ts +1 -1
  65. package/exports/icon.js +2 -2
  66. package/exports/notifications.js +1 -0
  67. package/exports/pane/pane.d.ts +1 -1
  68. package/exports/pane.js +5 -5
  69. package/exports/rail.js +1 -0
  70. package/exports/supporting-pane.js +1 -0
  71. package/exports/theme/theme.d.ts +2 -1
  72. package/exports/theme.js +20 -12
  73. package/package.json +10 -2
  74. package/exports/bundle/index-B3uz3f8C.js +0 -1
  75. package/exports/bundle/property-Do5-bKhz.js +0 -11
  76. package/exports/bundle/property-DyuvULjI.js +0 -44
  77. package/exports/bundle/row-DNgwBcX5.js +0 -33
package/exports/dialog.js CHANGED
@@ -215,14 +215,14 @@ let CustomDialog = (() => {
215
215
  <custom-elevation level=${this.fullscreen ? 0 : 3}></custom-elevation>
216
216
  <slot name="hero-icon"></slot>
217
217
  <slot name="supporting-text"></slot>
218
- <slot name="header">
219
- <flex-row class="header" center></flex-row>
218
+ <slot name="header">
219
+ <flex-row class="header" center>
220
220
  <flex-row center style="width: 100%">
221
221
  <slot name="header-start">
222
222
  ${this.fullscreen
223
223
  ? html `<custom-button @click=${this._close}
224
- ><custom-icon slot="icon">close</custom-icon></custom-button
225
- >`
224
+ ><custom-icon slot="icon">close</custom-icon></custom-button
225
+ >`
226
226
  : ''}
227
227
  </slot>
228
228
  <slot name="title"></slot>
@@ -232,8 +232,8 @@ let CustomDialog = (() => {
232
232
  ${this.fullscreen
233
233
  ? ''
234
234
  : html `<custom-button @click=${this._close}
235
- ><custom-icon slot="icon">close</custom-icon></custom-button
236
- >`}
235
+ ><custom-icon slot="icon">close</custom-icon></custom-button
236
+ >`}
237
237
  </slot>
238
238
  </flex-row>
239
239
  </flex-row>
@@ -1,6 +1,5 @@
1
1
  import { LiteElement } from '@vandeurenglenn/lite';
2
- import '../icon/icon.js';
3
- import '../button/button.js';
2
+ import '../button/icon-button.js';
4
3
  export declare class CustomDrawerButton extends LiteElement {
5
4
  accessor mobile: boolean;
6
5
  accessor drawerOpen: boolean;
@@ -1,9 +1,10 @@
1
1
  import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
2
  import { customElement, property, css, html, LiteElement } from '@vandeurenglenn/lite';
3
- import './icon.js';
3
+ import './icon-button.js';
4
4
  import './button.js';
5
- import '@vandeurenglenn/little-pubsub';
6
5
  import './elevation.js';
6
+ import './icon.js';
7
+ import '@vandeurenglenn/little-pubsub';
7
8
 
8
9
  let CustomDrawerButton = (() => {
9
10
  let _classDecorators = [customElement('custom-drawer-button')];
@@ -63,11 +64,7 @@ let CustomDrawerButton = (() => {
63
64
  `
64
65
  ];
65
66
  render() {
66
- return html `
67
- <custom-button @click=${() => this.openPane()}>
68
- <custom-icon slot="icon">menu</custom-icon>
69
- </custom-button>
70
- `;
67
+ return html ` <custom-icon-button @click=${() => this.openPane()} icon="menu"> </custom-icon-button> `;
71
68
  }
72
69
  constructor() {
73
70
  super(...arguments);
@@ -8,6 +8,7 @@ import '@vandeurenglenn/flex-elements/column.js';
8
8
  import './elevation.js';
9
9
  import './button.js';
10
10
  import './pane.js';
11
+ import './icon-button.js';
11
12
  import './icon.js';
12
13
  import '@vandeurenglenn/little-pubsub';
13
14
  import '@vandeurenglenn/flex-elements/it.js';
package/exports/drawer.js CHANGED
@@ -3,6 +3,7 @@ import { customElement, property, html, LiteElement } from '@vandeurenglenn/lite
3
3
  import './elevation.js';
4
4
  import './button.js';
5
5
  import './pane.js';
6
+ import './icon-button.js';
6
7
  import './icon.js';
7
8
  import '@vandeurenglenn/little-pubsub';
8
9
 
@@ -151,7 +151,7 @@ let CustomDropdownMenu = (() => {
151
151
  <span class="scrim" @click=${this._scrimClick}></span>
152
152
 
153
153
  <custom-button part="button" @click=${() => (this.open = !this.open)}>
154
- <custom-icon slot="icon" icon=${this.icon}>more_vert</custom-icon>
154
+ <custom-icon slot="icon" .icon=${this.icon}></custom-icon>
155
155
  </custom-button>
156
156
 
157
157
  <custom-dropdown part="dropdown" .open=${this.open} ?right=${this.right} ?bottom=${this.bottom}>
@@ -0,0 +1,7 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ import '../elevation/elevation.js';
3
+ export declare class CustomButton extends LiteElement {
4
+ accessor type: 'normal' | 'extended';
5
+ static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ }
package/exports/fab.js ADDED
@@ -0,0 +1,189 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
+ import { customElement, property, css, html, LiteElement } from '@vandeurenglenn/lite';
3
+ import './elevation.js';
4
+
5
+ let CustomButton = (() => {
6
+ let _classDecorators = [customElement('custom-fab')];
7
+ let _classDescriptor;
8
+ let _classExtraInitializers = [];
9
+ let _classThis;
10
+ let _classSuper = LiteElement;
11
+ let _type_decorators;
12
+ let _type_initializers = [];
13
+ let _type_extraInitializers = [];
14
+ (class extends _classSuper {
15
+ static { _classThis = this; }
16
+ static {
17
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
18
+ _type_decorators = [property({ attribute: 'type', reflect: true })];
19
+ __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);
20
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
21
+ _classThis = _classDescriptor.value;
22
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
23
+ }
24
+ #type_accessor_storage = __runInitializers(this, _type_initializers, 'normal');
25
+ get type() { return this.#type_accessor_storage; }
26
+ set type(value) { this.#type_accessor_storage = value; }
27
+ static styles = [
28
+ css `
29
+ :host {
30
+ color: var(--custom-fab-color, --md-sys-color-on-background);
31
+ display: flex;
32
+
33
+ height: 56px;
34
+ width: 56px;
35
+ border-radius: var(--md-sys-shape-corner-extra-large);
36
+ position: relative;
37
+ pointer-events: auto;
38
+ cursor: pointer;
39
+ box-sizing: border-box;
40
+ padding: 16px;
41
+
42
+ --elevation-level: 0;
43
+ }
44
+
45
+ button {
46
+ box-sizing: border-box;
47
+ border: none;
48
+ background: transparent;
49
+ color: inherit;
50
+ align-items: center;
51
+ justify-content: center;
52
+ user-select: none;
53
+ outline: none;
54
+ cursor: pointer;
55
+ border-radius: inherit;
56
+ padding: none;
57
+ width: inherit;
58
+ height: inherit;
59
+ display: flex;
60
+ pointer-events: none;
61
+ }
62
+
63
+ ::slotted(*) {
64
+ font-family: var(--md-sys-typescale-label-large-font-family-name);
65
+ font-style: var(--md-sys-typescale-label-large-font-family-style);
66
+ font-weight: var(--md-sys-typescale-label-large-font-weight);
67
+ font-size: var(--md-sys-typescale-label-large-font-size);
68
+ letter-spacing: var(--md-sys-typescale-label-large-tracking);
69
+ line-height: var(--md-sys-typescale-label-large-height);
70
+ text-transform: var(--md-sys-typescale-label-large-text-transform);
71
+ text-decoration: var(--md-sys-typescale-label-large-text-decoration);
72
+ }
73
+
74
+ :host([type='filled']),
75
+ :host([type='filled']) ::slotted(*) {
76
+ color: var(--md-sys-color-on-primary);
77
+ fill: var(--md-sys-color-on-primary);
78
+ background: var(--md-sys-color-primary);
79
+ }
80
+
81
+ :host([type='outlined']),
82
+ :host([type='outlined']) ::slotted(*) {
83
+ color: var(--md-sys-color-on-surface);
84
+ fill: var(--md-sys-color-on-surface);
85
+ background: var(--md-sys-color-surface);
86
+ border: solid 1px;
87
+ border-color: var(--md-sys-color-outline);
88
+ }
89
+
90
+ :host([type='elevated']),
91
+ :host([type='elevated']) ::slotted(*) {
92
+ color: var(--md-sys-color-primary);
93
+ fill: var(--md-sys-color-primary);
94
+ background: var(--md-sys-color-surface-container-low);
95
+ }
96
+
97
+ :host([type='tertiary']),
98
+ :host([type='tertiary']) ::slotted(*) {
99
+ background: var(--md-sys-color-tertiary);
100
+ color: var(--md-sys-color-on-tertiary);
101
+ fill: var(--md-sys-color-on-tertiary);
102
+ }
103
+
104
+ :host([type='tonal']),
105
+ :host([type='tonal']) ::slotted(*) {
106
+ background: var(--md-sys-color-secondary-container);
107
+ color: var(--md-sys-color-on-seconday-container);
108
+ fill: var(--md-sys-color-on-seconday-container);
109
+ }
110
+
111
+ custom-elevation {
112
+ --md-elevation-level: var(--elevation-level);
113
+ }
114
+
115
+ custom-elevation {
116
+ --elevation-level: 1;
117
+ }
118
+
119
+ :host([type='normal']) button {
120
+ align-items: center;
121
+ justify-content: center;
122
+ }
123
+
124
+ :host([type='extended']) button {
125
+ align-items: center;
126
+ }
127
+
128
+ :host([type='extended']) {
129
+ min-width: 80px;
130
+ width: fit-content;
131
+ }
132
+
133
+ :not([name='icon']) ::slotted(*) {
134
+ margin-left: 24px;
135
+ margin-right: 24px;
136
+ }
137
+
138
+ :host([has-icon][has-label]) .label {
139
+ padding-left: 8px;
140
+ padding-right: 24px;
141
+ }
142
+ :host([has-icon][has-label]) slot[name='icon']::slotted(*) {
143
+ padding-left: 16px;
144
+ }
145
+
146
+ :host([disabled]) .label,
147
+ :host([disabled]) slot[name='icon']::slotted(*) {
148
+ opacity: 0.38;
149
+ }
150
+
151
+ ::slotted(*) {
152
+ pointer-events: none;
153
+ }
154
+
155
+ :host(:focus),
156
+ :host(:hover) {
157
+ --elevation-level: 2;
158
+ }
159
+
160
+ :host(:active) {
161
+ --elevation-level: 0;
162
+ }
163
+
164
+ button * {
165
+ pointer-events: none;
166
+ }
167
+ `
168
+ ];
169
+ render() {
170
+ return html `
171
+ <button>
172
+ <custom-elevation></custom-elevation>
173
+ <slot name="icon"></slot>
174
+ <slot></slot>
175
+ </button>
176
+ `;
177
+ }
178
+ constructor() {
179
+ super(...arguments);
180
+ __runInitializers(this, _type_extraInitializers);
181
+ }
182
+ static {
183
+ __runInitializers(_classThis, _classExtraInitializers);
184
+ }
185
+ });
186
+ return _classThis;
187
+ })();
188
+
189
+ export { CustomButton };
@@ -1,7 +1,7 @@
1
1
  import { LiteElement } from '@vandeurenglenn/lite';
2
2
  export declare class CustomIcon extends LiteElement {
3
3
  accessor host: any;
4
- accessor icon: string;
4
+ accessor icon: any;
5
5
  accessor setName: any;
6
6
  accessor _icon: any;
7
7
  onChange(propertyKey: any, value: any): void;
package/exports/icon.js CHANGED
@@ -26,7 +26,7 @@ let CustomIcon = (() => {
26
26
  static {
27
27
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
28
28
  _host_decorators = [property()];
29
- _icon_decorators = [property({ attribute: 'icon' })];
29
+ _icon_decorators = [property({ attribute: true, reflect: true })];
30
30
  _setName_decorators = [property()];
31
31
  __icon_decorators = [property()];
32
32
  __esDecorate(this, null, _host_decorators, { kind: "accessor", name: "host", static: false, private: false, access: { has: obj => "host" in obj, get: obj => obj.host, set: (obj, value) => { obj.host = value; } }, metadata: _metadata }, _host_initializers, _host_extraInitializers);
@@ -40,7 +40,7 @@ let CustomIcon = (() => {
40
40
  #host_accessor_storage = __runInitializers(this, _host_initializers, void 0);
41
41
  get host() { return this.#host_accessor_storage; }
42
42
  set host(value) { this.#host_accessor_storage = value; }
43
- #icon_accessor_storage = (__runInitializers(this, _host_extraInitializers), __runInitializers(this, _icon_initializers, this.innerHTML));
43
+ #icon_accessor_storage = (__runInitializers(this, _host_extraInitializers), __runInitializers(this, _icon_initializers, void 0));
44
44
  get icon() { return this.#icon_accessor_storage; }
45
45
  set icon(value) { this.#icon_accessor_storage = value; }
46
46
  #setName_accessor_storage = (__runInitializers(this, _icon_extraInitializers), __runInitializers(this, _setName_initializers, void 0));
@@ -9,6 +9,7 @@ import 'lit/decorators.js';
9
9
  import '@vandeurenglenn/flex-elements/column.js';
10
10
  import '@vandeurenglenn/little-pubsub';
11
11
  import './elevation.js';
12
+ import './icon-button.js';
12
13
  import './button.js';
13
14
 
14
15
  let CustomNotifications = (() => {
@@ -1,6 +1,6 @@
1
1
  import { LiteElement } from '@vandeurenglenn/lite';
2
2
  import '../elevation/elevation.js';
3
- import '../button/button.js';
3
+ import '../button/icon-button.js';
4
4
  import '../icon/icon.js';
5
5
  export declare class CustomPane extends LiteElement {
6
6
  accessor open: boolean;
package/exports/pane.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
2
  import { customElement, property, html, LiteElement } from '@vandeurenglenn/lite';
3
3
  import './elevation.js';
4
- import './button.js';
4
+ import './icon-button.js';
5
5
  import './icon.js';
6
+ import './button.js';
6
7
  import '@vandeurenglenn/little-pubsub';
7
8
 
8
9
  let CustomPane = (() => {
@@ -148,7 +149,7 @@ let CustomPane = (() => {
148
149
  height: 54px;
149
150
  }
150
151
 
151
- :host([right]) custom-button {
152
+ :host([right]) custom-icon-button {
152
153
  transform: rotateZ(180deg);
153
154
  }
154
155
  </style>
@@ -158,9 +159,8 @@ let CustomPane = (() => {
158
159
  <flex-row center>
159
160
  <slot name="headline"></slot>
160
161
  <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>
162
+ <custom-icon-button @click=${(e) => this.closePane(e)} .id=${this.id} icon="menu_open">
163
+ </custom-icon-button>
164
164
  </flex-row>
165
165
  </slot>
166
166
  <flex-column class="content">
package/exports/rail.js CHANGED
@@ -2,6 +2,7 @@ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.
2
2
  import { customElement, property, html, LiteElement } from '@vandeurenglenn/lite';
3
3
  import './pane.js';
4
4
  import './elevation.js';
5
+ import './icon-button.js';
5
6
  import './button.js';
6
7
  import './icon.js';
7
8
  import '@vandeurenglenn/little-pubsub';
@@ -2,6 +2,7 @@ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.
2
2
  import { customElement, property, query, html, LiteElement } from '@vandeurenglenn/lite';
3
3
  import './pane.js';
4
4
  import './elevation.js';
5
+ import './icon-button.js';
5
6
  import './button.js';
6
7
  import './icon.js';
7
8
  import '@vandeurenglenn/little-pubsub';
@@ -3,8 +3,9 @@ export declare class CustomTheme extends LiteElement {
3
3
  #private;
4
4
  accessor loadFont: boolean;
5
5
  accessor loadSymbols: boolean;
6
- accessor narrowTrigger: string;
6
+ accessor mobileTrigger: string;
7
7
  accessor narrow: boolean;
8
+ onChange(propertyKey: string, value: any): void;
8
9
  connectedCallback(): void;
9
10
  set language(value: string);
10
11
  get language(): string;
package/exports/theme.js CHANGED
@@ -14,9 +14,9 @@ let CustomTheme = (() => {
14
14
  let _loadSymbols_decorators;
15
15
  let _loadSymbols_initializers = [];
16
16
  let _loadSymbols_extraInitializers = [];
17
- let _narrowTrigger_decorators;
18
- let _narrowTrigger_initializers = [];
19
- let _narrowTrigger_extraInitializers = [];
17
+ let _mobileTrigger_decorators;
18
+ let _mobileTrigger_initializers = [];
19
+ let _mobileTrigger_extraInitializers = [];
20
20
  let _narrow_decorators;
21
21
  let _narrow_initializers = [];
22
22
  let _narrow_extraInitializers = [];
@@ -26,27 +26,28 @@ let CustomTheme = (() => {
26
26
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
27
27
  _loadFont_decorators = [property({ type: Boolean, attribute: 'load-font' })];
28
28
  _loadSymbols_decorators = [property({ type: Boolean, attribute: 'load-symbols' })];
29
- _narrowTrigger_decorators = [property({ type: String, attribute: 'mobile-trigger' })];
29
+ _mobileTrigger_decorators = [property({ type: String, attribute: 'mobile-trigger' })];
30
30
  _narrow_decorators = [property({ type: Boolean })];
31
31
  __esDecorate(this, null, _loadFont_decorators, { kind: "accessor", name: "loadFont", static: false, private: false, access: { has: obj => "loadFont" in obj, get: obj => obj.loadFont, set: (obj, value) => { obj.loadFont = value; } }, metadata: _metadata }, _loadFont_initializers, _loadFont_extraInitializers);
32
32
  __esDecorate(this, null, _loadSymbols_decorators, { kind: "accessor", name: "loadSymbols", static: false, private: false, access: { has: obj => "loadSymbols" in obj, get: obj => obj.loadSymbols, set: (obj, value) => { obj.loadSymbols = value; } }, metadata: _metadata }, _loadSymbols_initializers, _loadSymbols_extraInitializers);
33
- __esDecorate(this, null, _narrowTrigger_decorators, { kind: "accessor", name: "narrowTrigger", static: false, private: false, access: { has: obj => "narrowTrigger" in obj, get: obj => obj.narrowTrigger, set: (obj, value) => { obj.narrowTrigger = value; } }, metadata: _metadata }, _narrowTrigger_initializers, _narrowTrigger_extraInitializers);
33
+ __esDecorate(this, null, _mobileTrigger_decorators, { kind: "accessor", name: "mobileTrigger", static: false, private: false, access: { has: obj => "mobileTrigger" in obj, get: obj => obj.mobileTrigger, set: (obj, value) => { obj.mobileTrigger = value; } }, metadata: _metadata }, _mobileTrigger_initializers, _mobileTrigger_extraInitializers);
34
34
  __esDecorate(this, null, _narrow_decorators, { kind: "accessor", name: "narrow", static: false, private: false, access: { has: obj => "narrow" in obj, get: obj => obj.narrow, set: (obj, value) => { obj.narrow = value; } }, metadata: _metadata }, _narrow_initializers, _narrow_extraInitializers);
35
35
  __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
36
36
  _classThis = _classDescriptor.value;
37
37
  if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
38
38
  __runInitializers(_classThis, _classExtraInitializers);
39
39
  }
40
+ #mediaListener;
40
41
  #loadFont_accessor_storage = __runInitializers(this, _loadFont_initializers, true);
41
42
  get loadFont() { return this.#loadFont_accessor_storage; }
42
43
  set loadFont(value) { this.#loadFont_accessor_storage = value; }
43
44
  #loadSymbols_accessor_storage = (__runInitializers(this, _loadFont_extraInitializers), __runInitializers(this, _loadSymbols_initializers, true));
44
45
  get loadSymbols() { return this.#loadSymbols_accessor_storage; }
45
46
  set loadSymbols(value) { this.#loadSymbols_accessor_storage = value; }
46
- #narrowTrigger_accessor_storage = (__runInitializers(this, _loadSymbols_extraInitializers), __runInitializers(this, _narrowTrigger_initializers, '(max-width: 860px)'));
47
- get narrowTrigger() { return this.#narrowTrigger_accessor_storage; }
48
- set narrowTrigger(value) { this.#narrowTrigger_accessor_storage = value; }
49
- #narrow_accessor_storage = (__runInitializers(this, _narrowTrigger_extraInitializers), __runInitializers(this, _narrow_initializers, void 0));
47
+ #mobileTrigger_accessor_storage = (__runInitializers(this, _loadSymbols_extraInitializers), __runInitializers(this, _mobileTrigger_initializers, '(max-width: 860px)'));
48
+ get mobileTrigger() { return this.#mobileTrigger_accessor_storage; }
49
+ set mobileTrigger(value) { this.#mobileTrigger_accessor_storage = value; }
50
+ #narrow_accessor_storage = (__runInitializers(this, _mobileTrigger_extraInitializers), __runInitializers(this, _narrow_initializers, void 0));
50
51
  get narrow() { return this.#narrow_accessor_storage; }
51
52
  set narrow(value) { this.#narrow_accessor_storage = value; }
52
53
  #loadLink(href, rel, attributes) {
@@ -67,10 +68,17 @@ let CustomTheme = (() => {
67
68
  }
68
69
  return link;
69
70
  }
71
+ onChange(propertyKey, value) {
72
+ if (propertyKey === 'mobileTrigger') {
73
+ this.#setupMediaListener();
74
+ }
75
+ }
76
+ #setupMediaListener() {
77
+ this.#mediaListener = matchMedia(this.mobileTrigger);
78
+ this.#mediaListener.onchange = this.#mediaQueryChange;
79
+ this.#mediaQueryChange({ matches: this.#mediaListener.matches });
80
+ }
70
81
  connectedCallback() {
71
- const media = matchMedia('(max-width: 860px)');
72
- media.onchange = this.#mediaQueryChange;
73
- this.#mediaQueryChange({ matches: media.matches });
74
82
  // this.load('./themes/default/tokens.js')
75
83
  this.load('./themes/default/theme.css');
76
84
  const style = document.createElement('style');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vandeurenglenn/lite-elements",
3
- "version": "0.3.34",
3
+ "version": "0.3.36",
4
4
  "description": "set of lite elements following Material Design 3 spec",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "@material-symbols/svg-400": "^0.17.0",
22
22
  "@material/web": "^1.3.0",
23
23
  "@vandeurenglenn/flex-elements": "^1.2.5",
24
- "@vandeurenglenn/lite": "^0.2.33",
24
+ "@vandeurenglenn/lite": "^0.2.37",
25
25
  "custom-element-decorator": "^0.6.0"
26
26
  },
27
27
  "devDependencies": {
@@ -209,6 +209,14 @@
209
209
  "import": "./exports/elevation.js",
210
210
  "types": "./exports/elevation/elevation.d.ts"
211
211
  },
212
+ "./fab": {
213
+ "import": "./exports/fab.js",
214
+ "types": "./exports/fab/fab.d.ts"
215
+ },
216
+ "./fab.js": {
217
+ "import": "./exports/fab.js",
218
+ "types": "./exports/fab/fab.d.ts"
219
+ },
212
220
  "./file-reader-mixin": {
213
221
  "import": "./exports/file-reader-mixin.js",
214
222
  "types": "./exports/mixins/file-reader-mixin.d.ts"
@@ -1 +0,0 @@
1
- class LittlePubSub{subscribers={};verbose;constructor(s){this.verbose=s}_handleContext(s,e){return void 0===e&&(e=s),e}hasSubscribers(s){return!!this.subscribers[s]}subscribe(s,e,r){this.hasSubscribers(s)||(this.subscribers[s]={handlers:[],value:void 0}),r=this._handleContext(e,r),this.subscribers[s].handlers.push(e.bind(r))}unsubscribe(s,e,r){if(!this.hasSubscribers(s))return;r=this._handleContext(e,r);const i=this.subscribers[s].handlers.indexOf(e.bind(r));this.subscribers[s].handlers.splice(i),0===this.subscribers[s].handlers.length&&delete this.subscribers[s]}publish(s,e,r){this.hasSubscribers(s)||(this.subscribers[s]={handlers:[]});const i=this.subscribers[s]?.value;if(this.verbose||r||i!==e){this.subscribers[s].value=e;for(const r of this.subscribers[s].handlers)r(e,i)}}publishVerbose(s,e){this.publish(s,e,!0)}once(s){return new Promise((e=>{const r=i=>{e(i),this.unsubscribe(s,r)};this.subscribe(s,r)}))}}export{LittlePubSub as L};
@@ -1,11 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",r=`lit$${(Math.random()+"").slice(9)}$`,n="?"+r,o=`<${n}>`,h=document,l=()=>h.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u=Array.isArray,c="[ \t\n\f\r]",d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,b=/-->/g,p=/>/g,$=RegExp(`>|${c}(?:([^\\s"'>=/]+)(${c}*=${c}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),_=/'/g,A=/"/g,g=/^(?:script|style|textarea|title)$/i,v=(t,...e)=>({_$litType$:1,strings:t,values:e}),m=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),f=new WeakMap,S=h.createTreeWalker(h,129);function x(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const T=(t,e)=>{const s=t.length-1,n=[];let h,l=2===e?"<svg>":"",a=d;for(let e=0;e<s;e++){const s=t[e];let u,c,v=-1,m=0;for(;m<s.length&&(a.lastIndex=m,c=a.exec(s),null!==c);)m=a.lastIndex,a===d?"!--"===c[1]?a=b:void 0!==c[1]?a=p:void 0!==c[2]?(g.test(c[2])&&(h=RegExp("</"+c[2],"g")),a=$):void 0!==c[3]&&(a=$):a===$?">"===c[0]?(a=h??d,v=-1):void 0===c[1]?v=-2:(v=a.lastIndex-c[2].length,u=c[1],a=void 0===c[3]?$:'"'===c[3]?A:_):a===A||a===_?a=$:a===b||a===p?a=d:(a=$,h=void 0);const y=a===$&&t[e+1].startsWith("/>")?" ":"";l+=a===d?s+o:v>=0?(n.push(u),s.slice(0,v)+i+s.slice(v)+r+y):s+r+(-2===v?e:y)}return[x(t,l+(t[s]||"<?>")+(2===e?"</svg>":"")),n]};class N{constructor({strings:t,_$litType$:s},o){let h;this.parts=[];let a=0,u=0;const c=t.length-1,d=this.parts,[b,p]=T(t,s);if(this.el=N.createElement(b,o),S.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=S.nextNode())&&d.length<c;){if(1===h.nodeType){if(h.hasAttributes())for(const t of h.getAttributeNames())if(t.endsWith(i)){const e=p[u++],s=h.getAttribute(t).split(r),i=/([.?@])?(.*)/.exec(e);d.push({type:1,index:a,name:i[2],strings:s,ctor:"."===i[1]?M:"?"===i[1]?E:"@"===i[1]?I:R}),h.removeAttribute(t)}else t.startsWith(r)&&(d.push({type:6,index:a}),h.removeAttribute(t));if(g.test(h.tagName)){const t=h.textContent.split(r),s=t.length-1;if(s>0){h.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)h.append(t[e],l()),S.nextNode(),d.push({type:2,index:++a});h.append(t[s],l())}}}else if(8===h.nodeType)if(h.data===n)d.push({type:2,index:a});else{let t=-1;for(;-1!==(t=h.data.indexOf(r,t+1));)d.push({type:7,index:a}),t+=r.length-1}a++}}static createElement(t,e){const s=h.createElement("template");return s.innerHTML=t,s}}function H(t,e,s=t,i){if(e===m)return e;let r=void 0!==i?s._$Co?.[i]:s._$Cl;const n=a(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(t),r._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=r:s._$Cl=r),void 0!==r&&(e=H(t,r._$AS(t,e.values),r,i)),e}class C{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??h).importNode(e,!0);S.currentNode=i;let r=S.nextNode(),n=0,o=0,l=s[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new w(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new U(r,this,t)),this._$AV.push(e),l=s[++o]}n!==l?.index&&(r=S.nextNode(),n++)}return S.currentNode=h,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=H(this,t,e),a(t)?t===y||null==t||""===t?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==m&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>u(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==y&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(h.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(x(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new C(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=f.get(t.strings);return void 0===e&&f.set(t.strings,e=new N(t)),e}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new w(this.S(l()),this.S(l()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const r=this.strings;let n=!1;if(void 0===r)t=H(this,t,e,0),n=!a(t)||t!==this._$AH&&t!==m,n&&(this._$AH=t);else{const i=t;let o,h;for(t=r[0],o=0;o<r.length-1;o++)h=H(this,i[s+o],e,o),h===m&&(h=this._$AH[o]),n||=!a(h)||h!==this._$AH[o],h===y?t=y:t!==y&&(t+=(h??"")+r[o+1]),this._$AH[o]=h}n&&!i&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class M extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}}class E extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}}class I extends R{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=H(this,t,e,0)??y)===m)return;const s=this._$AH,i=t===y&&s!==y||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==y&&(s===y||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}}const k=t.litHtmlPolyfillSupport;k?.(N,w),(t.litHtmlVersions??=[]).push("3.1.2");const W=globalThis,B=W.ShadowRoot&&(void 0===W.ShadyCSS||W.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,P=Symbol(),j=new WeakMap;
7
- /**
8
- * @license
9
- * Copyright 2019 Google LLC
10
- * SPDX-License-Identifier: BSD-3-Clause
11
- */class O{constructor(t,e,s){if(this._$cssResult$=!0,s!==P)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(B&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=j.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&j.set(e,t))}return t}toString(){return this.cssText}}const L=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new O(s,t,P)};Symbol.metadata??=Symbol("metadata");class D extends HTMLElement{static get observedAttributes(){return this[Symbol.metadata]?.observedAttributes?.values()??[]}attributeChangedCallback(t,e,s){this[t]=s}constructor(){super(),this.renderedOnce=!1,this.rendered=new Promise((t=>{this.renderResolve=t})),this.attachShadow({mode:"open"});const t=customElements.get(this.localName);this.shadowRoot.adoptedStyleSheets=t.styles?t.styles.map((t=>t.styleSheet??t)):[],this.requestRender()}render(){return v`<slot></slot>`}requestRender(){((t,e,s)=>{const i=e;let r=i._$litPart$;if(void 0===r){const t=null;i._$litPart$=r=new w(e.insertBefore(l(),t),t,void 0,{})}r._$AI(t)})(this.render(),this.shadowRoot),this.renderedOnce||(this.renderResolve(!0),this.renderedOnce=!0,this.firstRender&&this.firstRender())}}globalThis.pubsub=globalThis.pubsub||new class{subscribers={};verbose;constructor(t){this.verbose=t}_handleContext(t,e){return void 0===e&&(e=t),e}hasSubscribers(t){return!!this.subscribers[t]}subscribe(t,e,s){this.hasSubscribers(t)||(this.subscribers[t]={handlers:[],value:void 0}),s=this._handleContext(e,s),this.subscribers[t].handlers.push(e.bind(s))}unsubscribe(t,e,s){if(!this.hasSubscribers(t))return;s=this._handleContext(e,s);const i=this.subscribers[t].handlers.indexOf(e.bind(s));this.subscribers[t].handlers.splice(i),0===this.subscribers[t].handlers.length&&delete this.subscribers[t]}publish(t,e,s){this.hasSubscribers(t)||(this.subscribers[t]={handlers:[]});const i=this.subscribers[t]?.value;if(this.verbose||s||i!==e){this.subscribers[t].value=e;for(const s of this.subscribers[t].handlers)s(e,i)}}publishVerbose(t,e){this.publish(t,e,!0)}once(t){return new Promise((e=>{const s=i=>{e(i),this.unsubscribe(t,s)};this.subscribe(t,s)}))}};const V={type:String,reflect:!1,renders:!0,batchDelay:50,temporaryRender:10},q=(t,e)=>{let s=t;return e===Boolean?s=Boolean("true"===t):e===Number?s=Number(t):e===Uint8Array?s=new Uint8Array(t.split(",")):e!==Array&&e!==Object&&e!==WeakMap&&e!==Map&&e!==Uint8Array||(s=JSON.parse(t),e===Map&&(s=new Map(t)),e===WeakMap&&(s=new WeakMap(t))),s},z=t=>{t={...V,...t};let e=0;return function(s,{kind:i,name:r,addInitializer:n,access:o,metadata:h}){const{type:l,reflect:a,attribute:u,renders:c,batches:d,batchDelay:b,consumer:p,provider:$,temporaryRender:_}=t,A=String(r),g=u&&"string"==typeof u?u:A,v=l===Boolean,m=p||"boolean"==typeof t.consumes?g:t.consumes,y=$||"boolean"==typeof t.provides?g:t.provides;if(t.provider&&console.warn(`${A}: 'options.provider' is deprecated, use options.provides instead`),t.consumer&&console.warn(`${A}: 'options.consumer' is deprecated, used options.consumes instead`),n((async function(){"accessor"!==i&&console.warn(`${this.localName}: @property(${t}) ${A} ${i} is not supported`),(u||a)&&(h||(h={}),h.observedAttributes||(h.observedAttributes=new Map),h.observedAttributes.set(A,g)),m&&globalThis.pubsub.subscribe(m,(async t=>{this[r]=t}))})),"accessor"===i)return{get(){return f.call(this)},set(t){return S.call(this,t)},init(t){return this.hasAttribute(g)&&(t=v?this.hasAttribute(g):q(this.getAttribute(g),l)),void 0!==t&&S.call(this,t),m&&globalThis.pubsub.subscribers?.[m]?.value&&S.call(this,globalThis.pubsub.subscribers[m].value),this[r]}};function f(){const t=a||u?v?this.hasAttribute(g):q(this.getAttribute(g),l):this[`__${A}`]?this[`__${A}`]:this[`_${A}`];return m&&!this[`__${A}`]&&globalThis.pubsub.subscribers?.[m]?.value?(t!==globalThis.pubsub.subscribers[m].value&&S.call(this,globalThis.pubsub.subscribers[m].value),globalThis.pubsub.subscribers[m].value):t}async function S(t){if(y&&globalThis.pubsub.publish(y,t),this[`_${A}`]!==t){this.willChange&&(this[`__${A}`]=await this.willChange(r,t)),a||u?v?t||this[`__${A}`]?this.setAttribute(g,""):this.removeAttribute(g):t||this[`__${A}`]?this.setAttribute(g,((t,e)=>{let s=e;if(t===Boolean||t===Number||t===Uint8Array)return e.toString();if(t===Array||t===Object||t===WeakMap||t===Map||t===Uint8Array){let i;t!==Map&&t!==WeakMap||(i=Object(e).entries()),s=JSON.stringify(i)}return s})(l,this[`__${A}`]??t)):this.removeAttribute(g):this[`_${A}`]=t;const s=()=>{e=0,this.requestRender&&c&&this.requestRender(),this.onChange&&this.onChange(r,this[`__${A}`]??t)};d?(e===_&&s(),this[`_${A}_timeout`]&&clearTimeout(this[`_${A}_timeout`]),this[`_${A}_timeout`]=setTimeout(s,b)):s()}}}};export{D,L as j,z as t,v};