@aurelia-mdc-web/all 9.3.5-au2 → 9.3.7-au2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icon-button/mdc-icon-button.js +11 -16
- package/dist/icon-button/mdc-icon-button.js.map +1 -1
- package/dist/lookup/mdc-lookup.html +36 -27
- package/dist/types/icon-button/mdc-icon-button.d.ts +0 -2
- package/package.json +2 -2
- package/src/icon-button/mdc-icon-button.ts +69 -69
- package/src/lookup/mdc-lookup.html +36 -27
|
@@ -20,9 +20,6 @@ let MdcIconButton = (() => {
|
|
|
20
20
|
let _icon_decorators;
|
|
21
21
|
let _icon_initializers = [];
|
|
22
22
|
let _icon_extraInitializers = [];
|
|
23
|
-
let _href_decorators;
|
|
24
|
-
let _href_initializers = [];
|
|
25
|
-
let _href_extraInitializers = [];
|
|
26
23
|
let _touch_decorators;
|
|
27
24
|
let _touch_initializers = [];
|
|
28
25
|
let _touch_extraInitializers = [];
|
|
@@ -32,11 +29,9 @@ let MdcIconButton = (() => {
|
|
|
32
29
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
33
30
|
_on_decorators = [bindable({ set: booleanAttr, mode: BindingMode.twoWay })];
|
|
34
31
|
_icon_decorators = [bindable()];
|
|
35
|
-
_href_decorators = [bindable()];
|
|
36
32
|
_touch_decorators = [bindable({ set: booleanAttr, mode: BindingMode.twoWay })];
|
|
37
33
|
__esDecorate(null, null, _on_decorators, { kind: "field", name: "on", static: false, private: false, access: { has: obj => "on" in obj, get: obj => obj.on, set: (obj, value) => { obj.on = value; } }, metadata: _metadata }, _on_initializers, _on_extraInitializers);
|
|
38
34
|
__esDecorate(null, null, _icon_decorators, { kind: "field", name: "icon", static: false, private: false, access: { has: obj => "icon" in obj, get: obj => obj.icon, set: (obj, value) => { obj.icon = value; } }, metadata: _metadata }, _icon_initializers, _icon_extraInitializers);
|
|
39
|
-
__esDecorate(null, null, _href_decorators, { kind: "field", name: "href", static: false, private: false, access: { has: obj => "href" in obj, get: obj => obj.href, set: (obj, value) => { obj.href = value; } }, metadata: _metadata }, _href_initializers, _href_extraInitializers);
|
|
40
35
|
__esDecorate(null, null, _touch_decorators, { kind: "field", name: "touch", static: false, private: false, access: { has: obj => "touch" in obj, get: obj => obj.touch, set: (obj, value) => { obj.touch = value; } }, metadata: _metadata }, _touch_initializers, _touch_extraInitializers);
|
|
41
36
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
42
37
|
MdcIconButton = _classThis = _classDescriptor.value;
|
|
@@ -48,21 +43,21 @@ let MdcIconButton = (() => {
|
|
|
48
43
|
/** Optional. Set a Material icon as a non-toggle icon. */
|
|
49
44
|
icon = (__runInitializers(this, _on_extraInitializers), __runInitializers(this, _icon_initializers, void 0));
|
|
50
45
|
// this is necessary for the route-href to work
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
46
|
+
// @bindable()
|
|
47
|
+
// href: string;
|
|
48
|
+
// hrefChanged() {
|
|
49
|
+
// if (this.href) {
|
|
50
|
+
// this.root.setAttribute('href', this.href);
|
|
51
|
+
// } else {
|
|
52
|
+
// this.root.removeAttribute('href');
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
60
55
|
/**
|
|
61
56
|
* Set the component touch target to 48 x 48 px
|
|
62
57
|
*/
|
|
63
|
-
touch = (__runInitializers(this,
|
|
58
|
+
touch = (__runInitializers(this, _icon_extraInitializers), __runInitializers(this, _touch_initializers, void 0));
|
|
64
59
|
attached() {
|
|
65
|
-
this.hrefChanged();
|
|
60
|
+
// this.hrefChanged();
|
|
66
61
|
if (this.root.querySelector('mdc-icon-button-icon')) {
|
|
67
62
|
this.foundation = this.getDefaultFoundation();
|
|
68
63
|
this.foundation.init();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdc-icon-button.js","sourceRoot":"","sources":["../../src/icon-button/mdc-icon-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAA8D,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC3I,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAElD;;;;GAIG;IAGU,aAAa;4BAFzB,MAAM,CAAC,OAAO,CAAC,EACf,aAAa,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;;;;sBAClB,YAAY
|
|
1
|
+
{"version":3,"file":"mdc-icon-button.js","sourceRoot":"","sources":["../../src/icon-button/mdc-icon-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAA8D,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC3I,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAElD;;;;GAIG;IAGU,aAAa;4BAFzB,MAAM,CAAC,OAAO,CAAC,EACf,aAAa,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;;;;sBAClB,YAAY;;;;;;;;;;6BAApB,SAAQ,WAA2C;;;;8BAE3E,QAAQ,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;gCAIxD,QAAQ,EAAE;iCAiBV,QAAQ,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;YApBzD,wJAAA,EAAE,6BAAF,EAAE,+EAAU;YAIZ,8JAAA,IAAI,6BAAJ,IAAI,mFAAS;YAiBb,iKAAA,KAAK,6BAAL,KAAK,qFAAU;YAxBjB,6KAwDC;;;YAxDY,uDAAa;;QACxB,kDAAkD;QAElD,EAAE,qDAAU;QAEZ,0DAA0D;QAE1D,IAAI,yGAAS;QAEb,+CAA+C;QAC/C,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAClB,qBAAqB;QACrB,iDAAiD;QACjD,aAAa;QACb,yCAAyC;QACzC,MAAM;QACN,IAAI;QAEJ;;WAEG;QAEH,KAAK,4GAAU;QAEf,QAAQ;YACN,sBAAsB;YACtB,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,CAAC;gBACpD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC9C,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YACzB,CAAC;QACH,CAAC;QAED,WAAW;YACT,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,oBAAoB;YAClB,sGAAsG;YACtG,yGAAyG;YACzG,MAAM,OAAO,GAA+B;gBAC1C,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;gBAC3D,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAChE,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE;oBACxB,IAAI,CAAC,IAAI,CAAiC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;oBACzE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;gBACzB,CAAC;gBACD,WAAW,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;gBACjE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;gBACvD,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,SAAS,CAAC;aAC9E,CAAC;YACF,OAAO,IAAI,6BAA6B,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;;;;;;;;SAtDU,aAAa","sourcesContent":["import { customElement, inject, BindingMode, bindable } from 'aurelia';\nimport { MDCIconButtonToggleFoundation, MDCIconButtonToggleAdapter, MDCIconButtonToggleEventDetail, strings } from '@material/icon-button';\nimport { MdcComponent, booleanAttr } from '../base';\nimport template from './mdc-icon-button.html?raw';\n\n/**\n * @selector button[mdc-icon-button]\n * @selector a[mdc-icon-button]\n * @selector mdc-icon-button\n */\n@inject(Element)\n@customElement({ name: 'mdc-icon-button', template })\nexport class MdcIconButton extends MdcComponent<MDCIconButtonToggleFoundation> {\n /** Sets the toggle state to the provided value */\n @bindable({ set: booleanAttr, mode: BindingMode.twoWay })\n on: boolean;\n\n /** Optional. Set a Material icon as a non-toggle icon. */\n @bindable()\n icon: string;\n\n // this is necessary for the route-href to work\n // @bindable()\n // href: string;\n // hrefChanged() {\n // if (this.href) {\n // this.root.setAttribute('href', this.href);\n // } else {\n // this.root.removeAttribute('href');\n // }\n // }\n\n /**\n * Set the component touch target to 48 x 48 px\n */\n @bindable({ set: booleanAttr, mode: BindingMode.twoWay })\n touch: boolean;\n\n attached() {\n // this.hrefChanged();\n if (this.root.querySelector('mdc-icon-button-icon')) {\n this.foundation = this.getDefaultFoundation();\n this.foundation.init();\n }\n }\n\n handleClick() {\n this.foundation?.handleClick();\n return true;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCIconButtonToggleAdapter = {\n addClass: (className) => this.root.classList.add(className),\n hasClass: (className) => this.root.classList.contains(className),\n notifyChange: (evtData) => {\n this.emit<MDCIconButtonToggleEventDetail>(strings.CHANGE_EVENT, evtData);\n this.on = evtData.isOn;\n },\n removeClass: (className) => this.root.classList.remove(className),\n getAttr: (attrName) => this.root.getAttribute(attrName),\n setAttr: (attrName, attrValue) => this.root.setAttribute(attrName, attrValue),\n };\n return new MDCIconButtonToggleFoundation(adapter);\n }\n\n}\n"]}
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
<template class="mdc-lookup">
|
|
2
|
-
<mdc-menu component.ref="menu" mdcmenu:selected.trigger="handleMenuItemAction($event)" anchor-corner="BOTTOM_LEFT"
|
|
3
|
-
anchor.bind="input" hoist-to-body.bind="hoistToBody" class="${menuClass}" select-on-tab.bind="selectOnTab" stay-open
|
|
4
|
-
mdc-menu-surface.ref="menuSurface" keydown.trigger="handleMenuKeydown($event)">
|
|
5
|
-
<mdc-list role="menu" wrap-focus>
|
|
6
|
-
|
|
7
|
-
<au-slot if.bind="searching" name="searching">
|
|
8
|
-
<mdc-list-item two-line.bind="twoLine">${
|
|
9
|
-
</au-slot>
|
|
10
|
-
|
|
11
|
-
<au-slot if.bind="errorMessage" name="error">
|
|
12
|
-
<mdc-list-item two-line.bind="twoLine">${errorMessage}</mdc-list-item>
|
|
13
|
-
</au-slot>
|
|
14
|
-
|
|
15
|
-
<au-slot if.bind="optionsArray && !optionsArray.length" name="not-found">
|
|
16
|
-
<mdc-list-item two-line.bind="twoLine">
|
|
17
|
-
${
|
|
18
|
-
</mdc-list-item>
|
|
19
|
-
</au-slot>
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<template class="mdc-lookup">
|
|
2
|
+
<mdc-menu component.ref="menu" mdcmenu:selected.trigger="handleMenuItemAction($event)" anchor-corner="BOTTOM_LEFT"
|
|
3
|
+
anchor.bind="input" hoist-to-body.bind="hoistToBody" class="${menuClass}" select-on-tab.bind="selectOnTab" stay-open
|
|
4
|
+
mdc-menu-surface.ref="menuSurface" keydown.trigger="handleMenuKeydown($event)">
|
|
5
|
+
<mdc-list role="menu" wrap-focus>
|
|
6
|
+
|
|
7
|
+
<au-slot if.bind="searching" name="searching">
|
|
8
|
+
<mdc-list-item two-line.bind="twoLine">${configuration.lookup.searchingMessage}</mdc-list-item>
|
|
9
|
+
</au-slot>
|
|
10
|
+
|
|
11
|
+
<au-slot if.bind="errorMessage" name="error">
|
|
12
|
+
<mdc-list-item two-line.bind="twoLine">${errorMessage}</mdc-list-item>
|
|
13
|
+
</au-slot>
|
|
14
|
+
|
|
15
|
+
<au-slot if.bind="optionsArray && !optionsArray.length" name="not-found">
|
|
16
|
+
<mdc-list-item two-line.bind="twoLine">
|
|
17
|
+
${configuration.lookup.notFoundMessage}
|
|
18
|
+
</mdc-list-item>
|
|
19
|
+
</au-slot>
|
|
20
|
+
|
|
21
|
+
<div if.bind="!virtual && optionsArray.length">
|
|
22
|
+
<mdc-list-item role="menuitem" repeat.for="option of optionsArray" value.bind="option"
|
|
23
|
+
tabindex="-1" two-line.bind="twoLine">
|
|
24
|
+
<au-slot name="option">${getDisplay(option)}</au-slot>
|
|
25
|
+
</mdc-list-item>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div if.bind="virtual && optionsArray.length">
|
|
29
|
+
<mdc-list-item role="menuitem" virtual-repeat.for="option of optionsArray" value.bind="option" tabindex="-1"
|
|
30
|
+
two-line.bind="twoLine">
|
|
31
|
+
<au-slot name="option">${getDisplay(option)}</au-slot>
|
|
32
|
+
</mdc-list-item>
|
|
33
|
+
</div>
|
|
34
|
+
</mdc-list>
|
|
35
|
+
</mdc-menu>
|
|
36
|
+
</template>
|
|
@@ -10,8 +10,6 @@ export declare class MdcIconButton extends MdcComponent<MDCIconButtonToggleFound
|
|
|
10
10
|
on: boolean;
|
|
11
11
|
/** Optional. Set a Material icon as a non-toggle icon. */
|
|
12
12
|
icon: string;
|
|
13
|
-
href: string;
|
|
14
|
-
hrefChanged(): void;
|
|
15
13
|
/**
|
|
16
14
|
* Set the component touch target to 48 x 48 px
|
|
17
15
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurelia-mdc-web/all",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.7-au2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@material/tooltip": "^14.0.0",
|
|
91
91
|
"@material/top-app-bar": "^14.0.0",
|
|
92
92
|
"@material/typography": "^14.0.0",
|
|
93
|
-
"aurelia": "2.0.0-beta.
|
|
93
|
+
"aurelia": "2.0.0-beta.25",
|
|
94
94
|
"rxjs": "^7.8.2",
|
|
95
95
|
"tslib": "^2.8.1"
|
|
96
96
|
}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { customElement, inject, BindingMode, bindable } from 'aurelia';
|
|
2
|
-
import { MDCIconButtonToggleFoundation, MDCIconButtonToggleAdapter, MDCIconButtonToggleEventDetail, strings } from '@material/icon-button';
|
|
3
|
-
import { MdcComponent, booleanAttr } from '../base';
|
|
4
|
-
import template from './mdc-icon-button.html?raw';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @selector button[mdc-icon-button]
|
|
8
|
-
* @selector a[mdc-icon-button]
|
|
9
|
-
* @selector mdc-icon-button
|
|
10
|
-
*/
|
|
11
|
-
@inject(Element)
|
|
12
|
-
@customElement({ name: 'mdc-icon-button', template })
|
|
13
|
-
export class MdcIconButton extends MdcComponent<MDCIconButtonToggleFoundation> {
|
|
14
|
-
/** Sets the toggle state to the provided value */
|
|
15
|
-
@bindable({ set: booleanAttr, mode: BindingMode.twoWay })
|
|
16
|
-
on: boolean;
|
|
17
|
-
|
|
18
|
-
/** Optional. Set a Material icon as a non-toggle icon. */
|
|
19
|
-
@bindable()
|
|
20
|
-
icon: string;
|
|
21
|
-
|
|
22
|
-
// this is necessary for the route-href to work
|
|
23
|
-
@bindable()
|
|
24
|
-
href: string;
|
|
25
|
-
hrefChanged() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Set the component touch target to 48 x 48 px
|
|
35
|
-
*/
|
|
36
|
-
@bindable({ set: booleanAttr, mode: BindingMode.twoWay })
|
|
37
|
-
touch: boolean;
|
|
38
|
-
|
|
39
|
-
attached() {
|
|
40
|
-
this.hrefChanged();
|
|
41
|
-
if (this.root.querySelector('mdc-icon-button-icon')) {
|
|
42
|
-
this.foundation = this.getDefaultFoundation();
|
|
43
|
-
this.foundation.init();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
handleClick() {
|
|
48
|
-
this.foundation?.handleClick();
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
getDefaultFoundation() {
|
|
53
|
-
// DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
|
|
54
|
-
// To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
|
|
55
|
-
const adapter: MDCIconButtonToggleAdapter = {
|
|
56
|
-
addClass: (className) => this.root.classList.add(className),
|
|
57
|
-
hasClass: (className) => this.root.classList.contains(className),
|
|
58
|
-
notifyChange: (evtData) => {
|
|
59
|
-
this.emit<MDCIconButtonToggleEventDetail>(strings.CHANGE_EVENT, evtData);
|
|
60
|
-
this.on = evtData.isOn;
|
|
61
|
-
},
|
|
62
|
-
removeClass: (className) => this.root.classList.remove(className),
|
|
63
|
-
getAttr: (attrName) => this.root.getAttribute(attrName),
|
|
64
|
-
setAttr: (attrName, attrValue) => this.root.setAttribute(attrName, attrValue),
|
|
65
|
-
};
|
|
66
|
-
return new MDCIconButtonToggleFoundation(adapter);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}
|
|
1
|
+
import { customElement, inject, BindingMode, bindable } from 'aurelia';
|
|
2
|
+
import { MDCIconButtonToggleFoundation, MDCIconButtonToggleAdapter, MDCIconButtonToggleEventDetail, strings } from '@material/icon-button';
|
|
3
|
+
import { MdcComponent, booleanAttr } from '../base';
|
|
4
|
+
import template from './mdc-icon-button.html?raw';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @selector button[mdc-icon-button]
|
|
8
|
+
* @selector a[mdc-icon-button]
|
|
9
|
+
* @selector mdc-icon-button
|
|
10
|
+
*/
|
|
11
|
+
@inject(Element)
|
|
12
|
+
@customElement({ name: 'mdc-icon-button', template })
|
|
13
|
+
export class MdcIconButton extends MdcComponent<MDCIconButtonToggleFoundation> {
|
|
14
|
+
/** Sets the toggle state to the provided value */
|
|
15
|
+
@bindable({ set: booleanAttr, mode: BindingMode.twoWay })
|
|
16
|
+
on: boolean;
|
|
17
|
+
|
|
18
|
+
/** Optional. Set a Material icon as a non-toggle icon. */
|
|
19
|
+
@bindable()
|
|
20
|
+
icon: string;
|
|
21
|
+
|
|
22
|
+
// this is necessary for the route-href to work
|
|
23
|
+
// @bindable()
|
|
24
|
+
// href: string;
|
|
25
|
+
// hrefChanged() {
|
|
26
|
+
// if (this.href) {
|
|
27
|
+
// this.root.setAttribute('href', this.href);
|
|
28
|
+
// } else {
|
|
29
|
+
// this.root.removeAttribute('href');
|
|
30
|
+
// }
|
|
31
|
+
// }
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Set the component touch target to 48 x 48 px
|
|
35
|
+
*/
|
|
36
|
+
@bindable({ set: booleanAttr, mode: BindingMode.twoWay })
|
|
37
|
+
touch: boolean;
|
|
38
|
+
|
|
39
|
+
attached() {
|
|
40
|
+
// this.hrefChanged();
|
|
41
|
+
if (this.root.querySelector('mdc-icon-button-icon')) {
|
|
42
|
+
this.foundation = this.getDefaultFoundation();
|
|
43
|
+
this.foundation.init();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
handleClick() {
|
|
48
|
+
this.foundation?.handleClick();
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getDefaultFoundation() {
|
|
53
|
+
// DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
|
|
54
|
+
// To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
|
|
55
|
+
const adapter: MDCIconButtonToggleAdapter = {
|
|
56
|
+
addClass: (className) => this.root.classList.add(className),
|
|
57
|
+
hasClass: (className) => this.root.classList.contains(className),
|
|
58
|
+
notifyChange: (evtData) => {
|
|
59
|
+
this.emit<MDCIconButtonToggleEventDetail>(strings.CHANGE_EVENT, evtData);
|
|
60
|
+
this.on = evtData.isOn;
|
|
61
|
+
},
|
|
62
|
+
removeClass: (className) => this.root.classList.remove(className),
|
|
63
|
+
getAttr: (attrName) => this.root.getAttribute(attrName),
|
|
64
|
+
setAttr: (attrName, attrValue) => this.root.setAttribute(attrName, attrValue),
|
|
65
|
+
};
|
|
66
|
+
return new MDCIconButtonToggleFoundation(adapter);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
<template class="mdc-lookup">
|
|
2
|
-
<mdc-menu component.ref="menu" mdcmenu:selected.trigger="handleMenuItemAction($event)" anchor-corner="BOTTOM_LEFT"
|
|
3
|
-
anchor.bind="input" hoist-to-body.bind="hoistToBody" class="${menuClass}" select-on-tab.bind="selectOnTab" stay-open
|
|
4
|
-
mdc-menu-surface.ref="menuSurface" keydown.trigger="handleMenuKeydown($event)">
|
|
5
|
-
<mdc-list role="menu" wrap-focus>
|
|
6
|
-
|
|
7
|
-
<au-slot if.bind="searching" name="searching">
|
|
8
|
-
<mdc-list-item two-line.bind="twoLine">${
|
|
9
|
-
</au-slot>
|
|
10
|
-
|
|
11
|
-
<au-slot if.bind="errorMessage" name="error">
|
|
12
|
-
<mdc-list-item two-line.bind="twoLine">${errorMessage}</mdc-list-item>
|
|
13
|
-
</au-slot>
|
|
14
|
-
|
|
15
|
-
<au-slot if.bind="optionsArray && !optionsArray.length" name="not-found">
|
|
16
|
-
<mdc-list-item two-line.bind="twoLine">
|
|
17
|
-
${
|
|
18
|
-
</mdc-list-item>
|
|
19
|
-
</au-slot>
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<template class="mdc-lookup">
|
|
2
|
+
<mdc-menu component.ref="menu" mdcmenu:selected.trigger="handleMenuItemAction($event)" anchor-corner="BOTTOM_LEFT"
|
|
3
|
+
anchor.bind="input" hoist-to-body.bind="hoistToBody" class="${menuClass}" select-on-tab.bind="selectOnTab" stay-open
|
|
4
|
+
mdc-menu-surface.ref="menuSurface" keydown.trigger="handleMenuKeydown($event)">
|
|
5
|
+
<mdc-list role="menu" wrap-focus>
|
|
6
|
+
|
|
7
|
+
<au-slot if.bind="searching" name="searching">
|
|
8
|
+
<mdc-list-item two-line.bind="twoLine">${configuration.lookup.searchingMessage}</mdc-list-item>
|
|
9
|
+
</au-slot>
|
|
10
|
+
|
|
11
|
+
<au-slot if.bind="errorMessage" name="error">
|
|
12
|
+
<mdc-list-item two-line.bind="twoLine">${errorMessage}</mdc-list-item>
|
|
13
|
+
</au-slot>
|
|
14
|
+
|
|
15
|
+
<au-slot if.bind="optionsArray && !optionsArray.length" name="not-found">
|
|
16
|
+
<mdc-list-item two-line.bind="twoLine">
|
|
17
|
+
${configuration.lookup.notFoundMessage}
|
|
18
|
+
</mdc-list-item>
|
|
19
|
+
</au-slot>
|
|
20
|
+
|
|
21
|
+
<div if.bind="!virtual && optionsArray.length">
|
|
22
|
+
<mdc-list-item role="menuitem" repeat.for="option of optionsArray" value.bind="option"
|
|
23
|
+
tabindex="-1" two-line.bind="twoLine">
|
|
24
|
+
<au-slot name="option">${getDisplay(option)}</au-slot>
|
|
25
|
+
</mdc-list-item>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div if.bind="virtual && optionsArray.length">
|
|
29
|
+
<mdc-list-item role="menuitem" virtual-repeat.for="option of optionsArray" value.bind="option" tabindex="-1"
|
|
30
|
+
two-line.bind="twoLine">
|
|
31
|
+
<au-slot name="option">${getDisplay(option)}</au-slot>
|
|
32
|
+
</mdc-list-item>
|
|
33
|
+
</div>
|
|
34
|
+
</mdc-list>
|
|
35
|
+
</mdc-menu>
|
|
36
|
+
</template>
|