@universal-material/web 3.0.56 → 3.0.58
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/button/button.styles.d.ts.map +1 -1
- package/button/button.styles.js +5 -1
- package/button/button.styles.js.map +1 -1
- package/button/fab.styles.d.ts.map +1 -1
- package/button/fab.styles.js +5 -1
- package/button/fab.styles.js.map +1 -1
- package/button/icon-button.styles.d.ts.map +1 -1
- package/button/icon-button.styles.js +5 -1
- package/button/icon-button.styles.js.map +1 -1
- package/chip/chip.styles.d.ts.map +1 -1
- package/chip/chip.styles.js +5 -1
- package/chip/chip.styles.js.map +1 -1
- package/chip-field/chip-field.d.ts +1 -2
- package/chip-field/chip-field.d.ts.map +1 -1
- package/chip-field/chip-field.js +20 -16
- package/chip-field/chip-field.js.map +1 -1
- package/chip-field/chip-field.styles.d.ts.map +1 -1
- package/chip-field/chip-field.styles.js +10 -9
- package/chip-field/chip-field.styles.js.map +1 -1
- package/css/universal-material.css +2 -1
- package/css/universal-material.min.css +2 -2
- package/custom-elements.json +2525 -1071
- package/field/field-base.d.ts +52 -0
- package/field/field-base.d.ts.map +1 -0
- package/field/field-base.js +172 -0
- package/field/field-base.js.map +1 -0
- package/field/{field.styles.d.ts → field-base.styles.d.ts} +1 -1
- package/field/field-base.styles.d.ts.map +1 -0
- package/field/{field.styles.js → field-base.styles.js} +61 -61
- package/field/field-base.styles.js.map +1 -0
- package/field/field-defaults-context.d.ts +5 -0
- package/field/field-defaults-context.d.ts.map +1 -0
- package/field/field-defaults-context.js +3 -0
- package/field/field-defaults-context.js.map +1 -0
- package/field/field-defaults.d.ts +5 -0
- package/field/field-defaults.d.ts.map +1 -0
- package/field/field-defaults.js +2 -0
- package/field/field-defaults.js.map +1 -0
- package/field/field-variant.d.ts +2 -0
- package/field/field-variant.d.ts.map +1 -0
- package/field/field-variant.js +2 -0
- package/field/field-variant.js.map +1 -0
- package/field/field.d.ts +3 -47
- package/field/field.d.ts.map +1 -1
- package/field/field.js +6 -146
- package/field/field.js.map +1 -1
- package/menu/menu-item.d.ts +6 -0
- package/menu/menu-item.d.ts.map +1 -1
- package/menu/menu-item.js +31 -0
- package/menu/menu-item.js.map +1 -1
- package/menu/menu-item.styles.d.ts.map +1 -1
- package/menu/menu-item.styles.js +7 -6
- package/menu/menu-item.styles.js.map +1 -1
- package/navigation/drawer-item.styles.d.ts.map +1 -1
- package/navigation/drawer-item.styles.js +5 -1
- package/navigation/drawer-item.styles.js.map +1 -1
- package/package.json +3 -2
- package/scss/layout/_container.scss +1 -0
- package/shared/base.styles.d.ts.map +1 -1
- package/shared/base.styles.js +5 -1
- package/shared/base.styles.js.map +1 -1
- package/shared/button-wrapper.d.ts +1 -1
- package/shared/button-wrapper.d.ts.map +1 -1
- package/shared/button-wrapper.js.map +1 -1
- package/shared/text-field-base/text-field-base.d.ts +3 -15
- package/shared/text-field-base/text-field-base.d.ts.map +1 -1
- package/shared/text-field-base/text-field-base.js +6 -66
- package/shared/text-field-base/text-field-base.js.map +1 -1
- package/text-field/text-field.d.ts +1 -2
- package/text-field/text-field.d.ts.map +1 -1
- package/text-field/text-field.js +4 -8
- package/text-field/text-field.js.map +1 -1
- package/typeahead/typeahead.d.ts +5 -0
- package/typeahead/typeahead.d.ts.map +1 -1
- package/typeahead/typeahead.js +53 -7
- package/typeahead/typeahead.js.map +1 -1
- package/typeahead/typeahead.styles.js +1 -1
- package/typeahead/typeahead.styles.js.map +1 -1
- package/field/field.styles.d.ts.map +0 -1
- package/field/field.styles.js.map +0 -1
package/field/field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field/field.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field/field.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,qBACa,OAAQ,SAAQ,WAAW;IAEX,SAAS,UAAS;IAE7C,OAAO,CAAC,OAAO,CAAiC;IAEvC,iBAAiB;IAUjB,oBAAoB;IAM7B,OAAO,CAAC,kBAAkB,CAIzB;cAEkB,aAAa;CAGjC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,OAAO,CAAC;KACpB;CACF"}
|
package/field/field.js
CHANGED
|
@@ -4,91 +4,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html
|
|
8
|
-
import { customElement, property
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { config } from '../config.js';
|
|
12
|
-
let UmField = class UmField extends LitElement {
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { UmFieldBase } from './field-base.js';
|
|
10
|
+
let UmField = class UmField extends UmFieldBase {
|
|
13
11
|
constructor() {
|
|
14
12
|
super(...arguments);
|
|
15
|
-
this.variant = config.fields.defaultAppearance;
|
|
16
|
-
this.empty = false;
|
|
17
13
|
this.autoEmpty = false;
|
|
18
|
-
this.disabled = false;
|
|
19
|
-
this.invalid = false;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the field has a leading icon or not
|
|
22
|
-
*
|
|
23
|
-
* _Note:_ Readonly
|
|
24
|
-
*/
|
|
25
|
-
this.hasLeadingIcon = false;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the field has a trailing icon or not
|
|
28
|
-
*
|
|
29
|
-
* _Note:_ Readonly
|
|
30
|
-
*/
|
|
31
|
-
this.hasTrailingIcon = false;
|
|
32
|
-
/**
|
|
33
|
-
* Whether the field has an error text or not
|
|
34
|
-
*
|
|
35
|
-
* _Note:_ Readonly
|
|
36
|
-
*/
|
|
37
|
-
this.hasErrorText = false;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the field has a counter or not
|
|
40
|
-
*
|
|
41
|
-
* _Note:_ Readonly
|
|
42
|
-
*/
|
|
43
|
-
this.hasCounter = false;
|
|
44
14
|
this.control = null;
|
|
45
|
-
this.labelSizeObserver = null;
|
|
46
15
|
this.handleControlInput = () => {
|
|
47
16
|
if (this.autoEmpty) {
|
|
48
17
|
this.empty = !this.control?.value;
|
|
49
18
|
}
|
|
50
19
|
};
|
|
51
20
|
}
|
|
52
|
-
render() {
|
|
53
|
-
return html `
|
|
54
|
-
<div class="field">
|
|
55
|
-
<slot
|
|
56
|
-
class="icon leading-icon"
|
|
57
|
-
name="leading-icon"
|
|
58
|
-
@slotchange="${this.handleLeadingIconSlotChange}">
|
|
59
|
-
</slot>
|
|
60
|
-
<slot class="label" name="label"></slot>
|
|
61
|
-
<div class="input-wrapper" part="wrapper">
|
|
62
|
-
<slot name="prefix"></slot>
|
|
63
|
-
<slot class="input"></slot>
|
|
64
|
-
<slot name="suffix"></slot>
|
|
65
|
-
</div>
|
|
66
|
-
<slot
|
|
67
|
-
class="icon trailing-icon"
|
|
68
|
-
name="trailing-icon"
|
|
69
|
-
@slotchange="${this.handleTrailingIconSlotChange}">
|
|
70
|
-
</slot>
|
|
71
|
-
</div>
|
|
72
|
-
<div class="supporting-text">
|
|
73
|
-
<slot
|
|
74
|
-
class="error-text"
|
|
75
|
-
name="error-text"
|
|
76
|
-
@slotchange="${this.handleErrorTextSlotChange}"></slot>
|
|
77
|
-
<slot class="supporting-text-slot" name="supporting-text" id="supporting-text"></slot>
|
|
78
|
-
<slot
|
|
79
|
-
class="counter"
|
|
80
|
-
name="counter"
|
|
81
|
-
@slotchange="${this.handleCounterSlotChange}"></slot>
|
|
82
|
-
</div>
|
|
83
|
-
`;
|
|
84
|
-
}
|
|
85
|
-
firstUpdated(changedProperties) {
|
|
86
|
-
super.firstUpdated(changedProperties);
|
|
87
|
-
this.hasLeadingIcon = !!this.assignedLeadingIcons.length;
|
|
88
|
-
this.labelSizeObserver = new ResizeObserver(() => this.setLabelWidthProperties());
|
|
89
|
-
this.labelSizeObserver.observe(this.label);
|
|
90
|
-
this.setLabelWidthProperties();
|
|
91
|
-
}
|
|
92
21
|
connectedCallback() {
|
|
93
22
|
super.connectedCallback();
|
|
94
23
|
this.control = this.querySelector('input, select, button, textarea');
|
|
@@ -101,83 +30,14 @@ let UmField = class UmField extends LitElement {
|
|
|
101
30
|
super.disconnectedCallback();
|
|
102
31
|
this.control?.removeEventListener('input', this.handleControlInput);
|
|
103
32
|
this.control = null;
|
|
104
|
-
this.labelSizeObserver.disconnect();
|
|
105
|
-
this.labelSizeObserver = null;
|
|
106
|
-
}
|
|
107
|
-
handleLeadingIconSlotChange() {
|
|
108
|
-
this.label.style.transition = 'none';
|
|
109
|
-
this.hasLeadingIcon = this.assignedLeadingIcons.length > 0;
|
|
110
|
-
setTimeout(() => {
|
|
111
|
-
this.label.style.transition = '';
|
|
112
|
-
});
|
|
113
33
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
handleErrorTextSlotChange() {
|
|
118
|
-
this.hasErrorText = this.assignedErrorTexts.length > 0;
|
|
119
|
-
}
|
|
120
|
-
handleCounterSlotChange() {
|
|
121
|
-
this.hasCounter = this.assignedCounters.length > 0;
|
|
122
|
-
}
|
|
123
|
-
setLabelWidthProperties() {
|
|
124
|
-
const width = this.label.offsetWidth;
|
|
125
|
-
this.style.setProperty('--u-field-label-width', `${width}px`);
|
|
126
|
-
this.style.setProperty('--u-field-label-half-width', `${width / 2}px`);
|
|
127
|
-
if (!width) {
|
|
128
|
-
this.field.classList.add('no-label');
|
|
129
|
-
}
|
|
34
|
+
renderControl() {
|
|
35
|
+
return html `<slot></slot>`;
|
|
130
36
|
}
|
|
131
37
|
};
|
|
132
|
-
UmField.styles = [baseStyles, styles];
|
|
133
|
-
__decorate([
|
|
134
|
-
property({ reflect: true })
|
|
135
|
-
], UmField.prototype, "variant", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
property({ type: Boolean, reflect: true })
|
|
138
|
-
], UmField.prototype, "empty", void 0);
|
|
139
38
|
__decorate([
|
|
140
39
|
property({ type: Boolean })
|
|
141
40
|
], UmField.prototype, "autoEmpty", void 0);
|
|
142
|
-
__decorate([
|
|
143
|
-
property({ type: Boolean, reflect: true })
|
|
144
|
-
], UmField.prototype, "disabled", void 0);
|
|
145
|
-
__decorate([
|
|
146
|
-
property({ type: Boolean, reflect: true })
|
|
147
|
-
], UmField.prototype, "invalid", void 0);
|
|
148
|
-
__decorate([
|
|
149
|
-
property({ type: Boolean, attribute: 'has-leading-icon', reflect: true })
|
|
150
|
-
], UmField.prototype, "hasLeadingIcon", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
property({ type: Boolean, attribute: 'has-trailing-icon', reflect: true })
|
|
153
|
-
], UmField.prototype, "hasTrailingIcon", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
property({ type: Boolean, attribute: 'has-error-text', reflect: true })
|
|
156
|
-
], UmField.prototype, "hasErrorText", void 0);
|
|
157
|
-
__decorate([
|
|
158
|
-
property({ type: Boolean, attribute: 'has-counter', reflect: true })
|
|
159
|
-
], UmField.prototype, "hasCounter", void 0);
|
|
160
|
-
__decorate([
|
|
161
|
-
queryAssignedElements({ slot: 'leading-icon', flatten: true })
|
|
162
|
-
], UmField.prototype, "assignedLeadingIcons", void 0);
|
|
163
|
-
__decorate([
|
|
164
|
-
queryAssignedElements({ slot: 'trailing-icon', flatten: true })
|
|
165
|
-
], UmField.prototype, "assignedTrailingIcons", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
queryAssignedElements({ slot: 'error-text', flatten: true })
|
|
168
|
-
], UmField.prototype, "assignedErrorTexts", void 0);
|
|
169
|
-
__decorate([
|
|
170
|
-
queryAssignedElements({ slot: 'counter', flatten: true })
|
|
171
|
-
], UmField.prototype, "assignedCounters", void 0);
|
|
172
|
-
__decorate([
|
|
173
|
-
query('.counter')
|
|
174
|
-
], UmField.prototype, "counter", void 0);
|
|
175
|
-
__decorate([
|
|
176
|
-
query('.label')
|
|
177
|
-
], UmField.prototype, "label", void 0);
|
|
178
|
-
__decorate([
|
|
179
|
-
query('.field')
|
|
180
|
-
], UmField.prototype, "field", void 0);
|
|
181
41
|
UmField = __decorate([
|
|
182
42
|
customElement('u-field')
|
|
183
43
|
], UmField);
|
package/field/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/field/field.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/field/field.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGvC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QAEsB,cAAS,GAAG,KAAK,CAAC;QAErC,YAAO,GAA4B,IAAI,CAAC;QAkBxC,uBAAkB,GAAG,GAAG,EAAE;YAChC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;YACpC,CAAC;QACH,CAAC,CAAA;IAKH,CAAC;IAzBU,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,GAA4B,IAAI,CAAC,aAAa,CAAC,iCAAiC,CAAC,CAAC;QAC9F,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEjE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;QACpC,CAAC;IACH,CAAC;IAEQ,oBAAoB;QAC3B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAQkB,aAAa;QAC9B,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;CACF,CAAA;AA7B4B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAmB;AAFlC,OAAO;IADnB,aAAa,CAAC,SAAS,CAAC;GACZ,OAAO,CA+BnB","sourcesContent":["import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { UmFieldBase } from './field-base.js';\n\n@customElement('u-field')\nexport class UmField extends UmFieldBase {\n\n @property({type: Boolean}) autoEmpty = false;\n\n private control: HTMLInputElement | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this.control = <HTMLInputElement | null>this.querySelector('input, select, button, textarea');\n this.control?.addEventListener('input', this.handleControlInput);\n\n if (this.autoEmpty) {\n this.empty = !this.control?.value;\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.control?.removeEventListener('input', this.handleControlInput);\n this.control = null;\n }\n\n private handleControlInput = () => {\n if (this.autoEmpty) {\n this.empty = !this.control?.value;\n }\n }\n\n protected override renderControl() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-field': UmField;\n }\n}\n"]}
|
package/menu/menu-item.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { HTMLTemplateResult } from 'lit';
|
|
2
2
|
import { UmButtonWrapper } from '../shared/button-wrapper.js';
|
|
3
3
|
export declare class UmMenuItem extends UmButtonWrapper {
|
|
4
|
+
#private;
|
|
4
5
|
static styles: import("lit").CSSResult[];
|
|
6
|
+
/**
|
|
7
|
+
* Force show focus ring
|
|
8
|
+
*/
|
|
9
|
+
get active(): boolean;
|
|
10
|
+
set active(active: boolean);
|
|
5
11
|
/**
|
|
6
12
|
* Whether the drawer item has icon or not
|
|
7
13
|
*
|
package/menu/menu-item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAM/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBACa,UAAW,SAAQ,eAAe
|
|
1
|
+
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAM/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBACa,UAAW,SAAQ,eAAe;;IAE7C,OAAgB,MAAM,4BAGpB;IAIF;;OAEG;IACH,IACI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EASzB;IAED;;;;OAIG;IAC8D,OAAO,UAAS;IAEjF;;;;OAIG;IAC+D,QAAQ,UAAS;IAGnF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAEtC,SAAS,SAAc;IAEvB,iBAAiB;cAKP,aAAa,IAAI,kBAAkB;IAYtD,OAAO,CAAC,oBAAoB;CAG7B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
package/menu/menu-item.js
CHANGED
|
@@ -4,6 +4,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
+
};
|
|
18
|
+
var _UmMenuItem_active;
|
|
7
19
|
import { html } from 'lit';
|
|
8
20
|
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
21
|
import { styles as baseStyles } from '../shared/base.styles.js';
|
|
@@ -12,6 +24,7 @@ import { UmButtonWrapper } from '../shared/button-wrapper.js';
|
|
|
12
24
|
let UmMenuItem = class UmMenuItem extends UmButtonWrapper {
|
|
13
25
|
constructor() {
|
|
14
26
|
super(...arguments);
|
|
27
|
+
_UmMenuItem_active.set(this, false);
|
|
15
28
|
/**
|
|
16
29
|
* Whether the drawer item has icon or not
|
|
17
30
|
*
|
|
@@ -26,6 +39,20 @@ let UmMenuItem = class UmMenuItem extends UmButtonWrapper {
|
|
|
26
39
|
this.hasBadge = false;
|
|
27
40
|
this.innerRole = 'menuitem';
|
|
28
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Force show focus ring
|
|
44
|
+
*/
|
|
45
|
+
get active() {
|
|
46
|
+
return __classPrivateFieldGet(this, _UmMenuItem_active, "f");
|
|
47
|
+
}
|
|
48
|
+
set active(active) {
|
|
49
|
+
__classPrivateFieldSet(this, _UmMenuItem_active, active, "f");
|
|
50
|
+
if (active) {
|
|
51
|
+
this.classList.add('force-focus-ring');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.classList.remove('force-focus-ring');
|
|
55
|
+
}
|
|
29
56
|
connectedCallback() {
|
|
30
57
|
super.connectedCallback();
|
|
31
58
|
this.role = 'presentation';
|
|
@@ -45,10 +72,14 @@ let UmMenuItem = class UmMenuItem extends UmButtonWrapper {
|
|
|
45
72
|
this.hasIcon = this.assignedIcons.length > 0;
|
|
46
73
|
}
|
|
47
74
|
};
|
|
75
|
+
_UmMenuItem_active = new WeakMap();
|
|
48
76
|
UmMenuItem.styles = [
|
|
49
77
|
baseStyles,
|
|
50
78
|
styles
|
|
51
79
|
];
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: Boolean, reflect: true })
|
|
82
|
+
], UmMenuItem.prototype, "active", null);
|
|
52
83
|
__decorate([
|
|
53
84
|
property({ type: Boolean, attribute: 'has-icon', reflect: true })
|
|
54
85
|
], UmMenuItem.prototype, "hasIcon", void 0);
|
package/menu/menu-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,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GxC;AAiBgE;IAAhE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAiB;AAOf;IAAjE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAkB;AAGlE;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACN;AA1CpC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAkEtB","sourcesContent":["\nimport { html, HTMLTemplateResult } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { styles } from './menu-item.styles.js';\n\nimport { UmButtonWrapper } from '../shared/button-wrapper.js';\n\n@customElement('u-menu-item')\nexport class UmMenuItem extends UmButtonWrapper {\n\n static override styles = [\n baseStyles,\n styles\n ];\n\n #active = false;\n\n /**\n * Force show focus ring\n */\n @property({type: Boolean, reflect: true})\n get active(): boolean {\n return this.#active;\n }\n set active(active: boolean) {\n this.#active = active;\n\n if (active) {\n this.classList.add('force-focus-ring');\n return;\n }\n\n this.classList.remove('force-focus-ring');\n }\n\n /**\n * Whether the drawer item has icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon = false;\n\n /**\n * Whether the drawer item has badge or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-badge', reflect: true}) hasBadge = false;\n\n @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly assignedIcons!: HTMLElement[];\n\n override innerRole = 'menuitem';\n\n override connectedCallback() {\n super.connectedCallback();\n this.role = 'presentation';\n }\n\n protected override renderContent(): HTMLTemplateResult {\n return html`\n <div class=\"icon\">\n <slot\n name=\"icon\"\n aria-hidden=\"true\"\n @slotchange=\"${this.handleIconSlotChange}\"></slot>\n </div>\n <span class=\"label\" id=\"text\"><slot></slot></span>\n `;\n }\n\n private handleIconSlotChange() {\n this.hasIcon = this.assignedIcons.length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-menu-item': UmMenuItem;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.styles.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"menu-item.styles.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAwHlB,CAAC"}
|
package/menu/menu-item.styles.js
CHANGED
|
@@ -2,16 +2,20 @@ import { css } from 'lit';
|
|
|
2
2
|
export const styles = css `
|
|
3
3
|
:host,
|
|
4
4
|
* {
|
|
5
|
+
--_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);
|
|
6
|
+
--_focus-ring-border-radius: var(--u-focus-ring-border-radius, inherit);
|
|
5
7
|
font-family: var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
6
8
|
box-sizing: border-box;
|
|
7
9
|
outline: 0;
|
|
8
10
|
}
|
|
9
11
|
|
|
12
|
+
:host(.force-focus-ring) .focus-ring,
|
|
10
13
|
.focus-ring:focus-visible {
|
|
11
14
|
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
12
15
|
animation: u-focus-pulse 500ms ease;
|
|
13
16
|
animation-fill-mode: forwards;
|
|
14
|
-
|
|
17
|
+
border-radius: var(--_focus-ring-border-radius);
|
|
18
|
+
outline-offset: var(--_focus-ring-outline-offset);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@keyframes u-focus-pulse {
|
|
@@ -89,6 +93,8 @@ export const styles = css `
|
|
|
89
93
|
display: block;
|
|
90
94
|
--_menu-item-icon-size: var(--u-menu-item-icon-size, 1.125rem);
|
|
91
95
|
--_menu-item-padding: var(--u-menu-item-padding, 12px);
|
|
96
|
+
--u-focus-ring-outline-offset: -4px;
|
|
97
|
+
--u-focus-ring-border-radius: var(--u-spacing-extra-small, 4px);
|
|
92
98
|
height: var(--u-menu-item-height, 56px);
|
|
93
99
|
padding-inline: var(--_menu-item-padding);
|
|
94
100
|
color: var(--u-menu-item-label-color, var(--u-color-on-surface, rgb(29, 27, 32)));
|
|
@@ -113,10 +119,5 @@ export const styles = css `
|
|
|
113
119
|
.content {
|
|
114
120
|
justify-content: flex-start;
|
|
115
121
|
}
|
|
116
|
-
|
|
117
|
-
.button:focus-visible {
|
|
118
|
-
outline-offset: -4px;
|
|
119
|
-
border-radius: var(--u-spacing-extra-small, 4px);
|
|
120
|
-
}
|
|
121
122
|
`;
|
|
122
123
|
//# sourceMappingURL=menu-item.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.styles.js","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"menu-item.styles.js","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n * {\n --_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);\n --_focus-ring-border-radius: var(--u-focus-ring-border-radius, inherit);\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n box-sizing: border-box;\n outline: 0;\n }\n\n :host(.force-focus-ring) .focus-ring,\n .focus-ring:focus-visible {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n animation: u-focus-pulse 500ms ease;\n animation-fill-mode: forwards;\n border-radius: var(--_focus-ring-border-radius);\n outline-offset: var(--_focus-ring-outline-offset);\n }\n\n @keyframes u-focus-pulse {\n 0% {\n outline: 0 solid var(--_color-primary);\n }\n 50% {\n outline: 6px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n :host {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n -webkit-tap-highlight-color: transparent;\n --u-elevation-level: 0;\n position: relative;\n display: inline-block;\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n appearance: none !important;\n }\n\n :host([disabled]) {\n --u-elevation-level: 0 !important;\n background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;\n color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;\n }\n\n :host([disabled]) .button {\n cursor: default;\n }\n\n * {\n color: inherit;\n }\n\n u-elevation {\n z-index: -1;\n }\n\n .button {\n cursor: pointer;\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n width: 100%;\n height: 100%;\n font-family: inherit;\n border-radius: inherit;\n color: inherit;\n border: none;\n margin: 0;\n padding: 0;\n text-align: center;\n white-space: nowrap;\n background: transparent;\n user-select: none;\n text-decoration: none;\n outline: 0;\n z-index: 0;\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n border-radius: inherit;\n width: 100%;\n height: 100%;\n }\n\n :host {\n display: block;\n --_menu-item-icon-size: var(--u-menu-item-icon-size, 1.125rem);\n --_menu-item-padding: var(--u-menu-item-padding, 12px);\n --u-focus-ring-outline-offset: -4px;\n --u-focus-ring-border-radius: var(--u-spacing-extra-small, 4px);\n height: var(--u-menu-item-height, 56px);\n padding-inline: var(--_menu-item-padding);\n color: var(--u-menu-item-label-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-menu-item-label-line-height, var(--u-label-l-line-height, 1.25rem));\n font-size: var(--u-menu-item-label-font-size, var(--u-label-l-font-size, 0.875rem));\n letter-spacing: var(--u-menu-item-label-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-menu-item-label-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));\n }\n\n :host(:not([has-icon])) .icon {\n display: none;\n }\n\n .icon {\n font-size: var(--_menu-item-icon-size);\n line-height: var(--_menu-item-icon-size);\n margin-inline-end: var(--u-menu-item-icon-margin, 12px);\n color: var(--u-menu-item-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n .content {\n justify-content: flex-start;\n }\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-item.styles.d.ts","sourceRoot":"","sources":["../../src/navigation/drawer-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"drawer-item.styles.d.ts","sourceRoot":"","sources":["../../src/navigation/drawer-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAoIlB,CAAC"}
|
|
@@ -2,16 +2,20 @@ import { css } from 'lit';
|
|
|
2
2
|
export const styles = css `
|
|
3
3
|
:host,
|
|
4
4
|
* {
|
|
5
|
+
--_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);
|
|
6
|
+
--_focus-ring-border-radius: var(--u-focus-ring-border-radius, inherit);
|
|
5
7
|
font-family: var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
6
8
|
box-sizing: border-box;
|
|
7
9
|
outline: 0;
|
|
8
10
|
}
|
|
9
11
|
|
|
12
|
+
:host(.force-focus-ring) .focus-ring,
|
|
10
13
|
.focus-ring:focus-visible {
|
|
11
14
|
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
12
15
|
animation: u-focus-pulse 500ms ease;
|
|
13
16
|
animation-fill-mode: forwards;
|
|
14
|
-
|
|
17
|
+
border-radius: var(--_focus-ring-border-radius);
|
|
18
|
+
outline-offset: var(--_focus-ring-outline-offset);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@keyframes u-focus-pulse {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-item.styles.js","sourceRoot":"","sources":["../../src/navigation/drawer-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"drawer-item.styles.js","sourceRoot":"","sources":["../../src/navigation/drawer-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoIzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n * {\n --_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);\n --_focus-ring-border-radius: var(--u-focus-ring-border-radius, inherit);\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n box-sizing: border-box;\n outline: 0;\n }\n\n :host(.force-focus-ring) .focus-ring,\n .focus-ring:focus-visible {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n animation: u-focus-pulse 500ms ease;\n animation-fill-mode: forwards;\n border-radius: var(--_focus-ring-border-radius);\n outline-offset: var(--_focus-ring-outline-offset);\n }\n\n @keyframes u-focus-pulse {\n 0% {\n outline: 0 solid var(--_color-primary);\n }\n 50% {\n outline: 6px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n :host {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n -webkit-tap-highlight-color: transparent;\n --u-elevation-level: 0;\n position: relative;\n display: inline-block;\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n appearance: none !important;\n }\n\n :host([disabled]) {\n --u-elevation-level: 0 !important;\n background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;\n color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;\n }\n\n :host([disabled]) .button {\n cursor: default;\n }\n\n * {\n color: inherit;\n }\n\n u-elevation {\n z-index: -1;\n }\n\n .button {\n cursor: pointer;\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n width: 100%;\n height: 100%;\n font-family: inherit;\n border-radius: inherit;\n color: inherit;\n border: none;\n margin: 0;\n padding: 0;\n text-align: center;\n white-space: nowrap;\n background: transparent;\n user-select: none;\n text-decoration: none;\n outline: 0;\n z-index: 0;\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n border-radius: inherit;\n width: 100%;\n height: 100%;\n }\n\n :host {\n display: block;\n --_drawer-item-icon-size: var(--u-drawer-item-icon-size, 1.125rem);\n --_drawer-item-padding: var(--u-drawer-item-padding, 16px);\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-drawer-item-line-height, var(--u-label-l-line-height, 1.25rem));\n font-size: var(--u-drawer-item-font-size, var(--u-label-l-font-size, 0.875rem));\n letter-spacing: var(--u-drawer-item-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-drawer-item-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));\n height: var(--u-drawer-item-height, 56px);\n padding-inline: var(--_drawer-item-padding);\n margin-inline: calc(var(--_drawer-item-padding) * -1);\n border-radius: var(--u-drawer-item-shape-corner, var(--u-shape-corner-full, 9999px));\n color: var(--u-drawer-item-label-inactive-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n :host([active]) {\n color: var(--u-drawer-item-label-active-color, var(--_color-primary));\n }\n\n :host(:not([has-icon])) .icon,\n :host(:not([has-badge])) .badge {\n display: none;\n }\n\n .icon {\n font-size: var(--_drawer-item-icon-size);\n line-height: var(--_drawer-item-icon-size);\n margin-inline-end: var(--u-drawer-item-icon-margin, 16px);\n }\n\n .badge {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-inline-start: auto;\n padding-inline: var(--u-drawer-item-badge-padding, 12px 8px);\n }\n\n .content {\n justify-content: flex-start;\n }\n`;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@universal-material/web",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.58",
|
|
4
4
|
"description": "Material web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -56,9 +56,10 @@
|
|
|
56
56
|
"@angular/platform-browser": "^17.3.4",
|
|
57
57
|
"@angular/platform-browser-dynamic": "^17.3.4",
|
|
58
58
|
"@angular/router": "^17.3.4",
|
|
59
|
+
"@lit/context": "^1.1.1",
|
|
59
60
|
"@material/material-color-utilities": "^0.2.7",
|
|
60
61
|
"highlight.js": "^11.9.0",
|
|
61
|
-
"lit": "^3.
|
|
62
|
+
"lit": "^3.1.3",
|
|
62
63
|
"ngx-highlightjs": "^11.0.0-beta.1",
|
|
63
64
|
"ngx-markdown": "^17.2.0",
|
|
64
65
|
"rxjs": "~7.8.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.styles.d.ts","sourceRoot":"","sources":["../../src/shared/base.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"base.styles.d.ts","sourceRoot":"","sources":["../../src/shared/base.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA8BlB,CAAC"}
|
package/shared/base.styles.js
CHANGED
|
@@ -2,16 +2,20 @@ import { css } from 'lit';
|
|
|
2
2
|
export const styles = css `
|
|
3
3
|
:host,
|
|
4
4
|
* {
|
|
5
|
+
--_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);
|
|
6
|
+
--_focus-ring-border-radius: var(--u-focus-ring-border-radius, inherit);
|
|
5
7
|
font-family: var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
6
8
|
box-sizing: border-box;
|
|
7
9
|
outline: 0;
|
|
8
10
|
}
|
|
9
11
|
|
|
12
|
+
:host(.force-focus-ring) .focus-ring,
|
|
10
13
|
.focus-ring:focus-visible {
|
|
11
14
|
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
12
15
|
animation: u-focus-pulse 500ms ease;
|
|
13
16
|
animation-fill-mode: forwards;
|
|
14
|
-
|
|
17
|
+
border-radius: var(--_focus-ring-border-radius);
|
|
18
|
+
outline-offset: var(--_focus-ring-outline-offset);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@keyframes u-focus-pulse {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.styles.js","sourceRoot":"","sources":["../../src/shared/base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"base.styles.js","sourceRoot":"","sources":["../../src/shared/base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n * {\n --_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);\n --_focus-ring-border-radius: var(--u-focus-ring-border-radius, inherit);\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n box-sizing: border-box;\n outline: 0;\n }\n\n :host(.force-focus-ring) .focus-ring,\n .focus-ring:focus-visible {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n animation: u-focus-pulse 500ms ease;\n animation-fill-mode: forwards;\n border-radius: var(--_focus-ring-border-radius);\n outline-offset: var(--_focus-ring-outline-offset);\n }\n\n @keyframes u-focus-pulse {\n 0% {\n outline: 0 solid var(--_color-primary);\n }\n 50% {\n outline: 6px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n`;\n"]}
|
|
@@ -18,7 +18,7 @@ export declare abstract class UmButtonWrapper extends LitElement {
|
|
|
18
18
|
*/
|
|
19
19
|
target: string | undefined;
|
|
20
20
|
name: string | undefined;
|
|
21
|
-
|
|
21
|
+
readonly buttonElement: HTMLElement;
|
|
22
22
|
private readonly ripple;
|
|
23
23
|
protected innerRole: string | null;
|
|
24
24
|
get pathname(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-wrapper.d.ts","sourceRoot":"","sources":["../../src/shared/button-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAMpE,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC;AAE7B,8BAAsB,eAAgB,SAAQ,UAAU;;IAEtD;;OAEG;IACuC,QAAQ,UAAS;IAElD,YAAY,UAAQ;IAE7B;;OAEG;IACS,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC;;;OAGG;IACS,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnB,
|
|
1
|
+
{"version":3,"file":"button-wrapper.d.ts","sourceRoot":"","sources":["../../src/shared/button-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAMpE,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC;AAE7B,8BAAsB,eAAgB,SAAQ,UAAU;;IAEtD;;OAEG;IACuC,QAAQ,UAAS;IAElD,YAAY,UAAQ;IAE7B;;OAEG;IACS,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC;;;OAGG;IACS,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnB,QAAQ,CAAC,aAAa,EAAG,WAAW,CAAC;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEtD,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1C,IAAI,QAAQ,IAAI,MAAM,CAErB;cAEkB,MAAM,IAAI,kBAAkB;IAM/C,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,UAAU;IAiBlB,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,kBAAkB;IAE7C,iBAAiB;IAMjB,oBAAoB;IAMpB,KAAK;IAIL,IAAI;IAKb,SAAS,CAAC,YAAY,IAAI,MAAM,GAAG,IAAI;IAIvC,OAAO,CAAC,iBAAiB;IA8BzB,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;CAGxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-wrapper.js","sourceRoot":"","sources":["../../src/shared/button-wrapper.ts"],"names":[],"mappings":";;;;;;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Element, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport { UmRipple } from '../ripple/ripple.js';\nimport { redispatchEvent } from './redispatch-event.js';\n\nimport '../elevation/elevation.js';\nimport '../ripple/ripple.js';\n\nexport abstract class UmButtonWrapper extends LitElement {\n\n /**\n * Whether the button is disabled or not.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n @state() renderRipple = true;\n\n /**\n * The URL that the link button points to.\n */\n @property() href: string | undefined;\n\n /**\n * Where to display the linked `href` URL for a link button. Common options\n * include `_blank` to open in a new tab.\n */\n @property() target: string | undefined;\n\n @property() name: string | undefined;\n\n @query('.button') readonly buttonElement!: HTMLElement;\n @query('u-ripple') private readonly ripple!: UmRipple;\n\n protected innerRole: string | null = null;\n\n get pathname(): string {\n return (<HTMLAnchorElement>this.buttonElement)?.pathname\n }\n\n protected override render(): HTMLTemplateResult {\n return typeof this.href === 'string'\n ? this.renderLink()\n : this.renderButton();\n }\n\n private renderButton() {\n return html`\n <button\n id=\"button\"\n class=\"button focus-ring\"\n ?disabled=${this.disabled}\n aria-label=${this.getAriaLabel() || nothing}\n aria-labelledby=\"${this.getAriaLabel() ? nothing : 'text'}\"\n .role=${this.innerRole}\n type=\"button\"\n @click=${this.#innerClickHandler}>\n <u-ripple ?disabled=${this.disabled || !this.renderRipple}></u-ripple>\n <u-elevation></u-elevation>\n </button>\n <div class=\"content\">${this.renderContent()}</div>`;\n }\n\n private renderLink() {\n return html`<a\n id=\"link\"\n class=\"button\"\n href=${this.disabled ? nothing : this.href}\n aria-disabled=${this.disabled || nothing}\n aria-label=${this.ariaLabel || nothing}\n aria-labelledby=\"${this.ariaLabel ? nothing : 'text'}\"\n .role=${this.innerRole}\n target=${this.target || nothing}\n @click=${this.#innerClickHandler}>\n <u-elevation></u-elevation>\n <u-ripple ?disabled=${this.disabled || !this.renderRipple}></u-ripple>\n </a>\n <div class=\"content\">${this.renderContent()}</div>`;\n }\n\n protected abstract renderContent(): HTMLTemplateResult;\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('focus', this.innerFocusHandler)\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('focus', this.innerFocusHandler);\n }\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n\n this.buttonElement?.blur();\n }\n\n protected getAriaLabel(): string | null {\n return this.ariaLabel;\n }\n\n private innerFocusHandler(): void {\n const tabIndexAttributeValue = this.getAttribute('tabindex');\n\n if (tabIndexAttributeValue !== \"0\") {\n return;\n }\n \n this.removeAttribute('tabindex');\n setTimeout(() => this.buttonElement?.focus());\n }\n\n #innerClickHandler(event: MouseEvent): void {\n \n if (this.disabled) {\n return;\n }\n\n const preventDefault = !redispatchEvent(this, event);\n\n if (preventDefault) {\n return;\n }\n\n if (!(<PointerEvent>event).pointerType) {\n this.ripple.createRipple();\n }\n\n this.handleClick(event);\n }\n\n protected handleClick(_: UIEvent): void {\n\n }\n}\n"]}
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import { CSSResultGroup } from '@lit/reactive-element/css-tag';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import '../../field/field.js';
|
|
5
|
-
export declare abstract class UmTextFieldBase extends LitElement {
|
|
2
|
+
import { UmFieldBase } from '../../field/field-base.js';
|
|
3
|
+
export declare abstract class UmTextFieldBase extends UmFieldBase {
|
|
6
4
|
static readonly formAssociated = true;
|
|
7
5
|
static styles: CSSResultGroup;
|
|
8
6
|
static shadowRootOptions: ShadowRootInit;
|
|
9
|
-
|
|
10
|
-
label: string | undefined;
|
|
11
|
-
counter: string | undefined;
|
|
7
|
+
empty: boolean;
|
|
12
8
|
placeholder: string | undefined;
|
|
13
|
-
supportingText: string | undefined;
|
|
14
|
-
errorText: string | undefined;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
invalid: boolean;
|
|
17
|
-
field: UmField;
|
|
18
9
|
get form(): HTMLFormElement | null;
|
|
19
|
-
get empty(): boolean;
|
|
20
10
|
protected readonly elementInternals: ElementInternals;
|
|
21
11
|
constructor();
|
|
22
|
-
protected render(): HTMLTemplateResult;
|
|
23
|
-
protected abstract renderContent(): HTMLTemplateResult;
|
|
24
12
|
}
|
|
25
13
|
//# sourceMappingURL=text-field-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field-base.d.ts","sourceRoot":"","sources":["../../../src/shared/text-field-base/text-field-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"text-field-base.d.ts","sourceRoot":"","sources":["../../../src/shared/text-field-base/text-field-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAM/D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,8BAAsB,eAAgB,SAAQ,WAAW;IACvD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC,OAAgB,MAAM,EAAE,cAAc,CAAgC;IAEtE,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAEO,KAAK,UAAQ;IAEK,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3D,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAED,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;;CAMvD"}
|