@covalent/components 6.2.1 → 6.2.2
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/action-ribbon.js +6 -6
- package/action-ribbon.mjs +34 -29
- package/alert.js +6 -6
- package/alert.mjs +18 -13
- package/app-shell.js +8 -8
- package/app-shell.mjs +9 -3
- package/base-element.mjs +5 -0
- package/button.js +9 -9
- package/button.mjs +23 -14
- package/card.js +8 -8
- package/card.mjs +17 -15
- package/check-list-item.js +9 -9
- package/check-list-item.mjs +20 -11
- package/checkbox.js +2 -2
- package/checkbox.mjs +26 -17
- package/circular-progress.js +29 -29
- package/circular-progress.mjs +13 -9
- package/class-map.mjs +9 -0
- package/code-snippet.js +9 -9
- package/code-snippet.mjs +10 -7
- package/dialog.js +1 -1
- package/dialog.mjs +14 -14
- package/dialog2.mjs +55 -49
- package/directive-helpers.mjs +1 -1
- package/drawer.js +3 -3
- package/drawer.mjs +13 -7
- package/empty-state.js +5 -5
- package/empty-state.mjs +5 -3
- package/event-options.mjs +5 -0
- package/form-element.mjs +2 -2
- package/foundation.mjs +2 -2
- package/icon-button.js +8 -8
- package/icon-button.mjs +23 -14
- package/icon-check-toggle.js +9 -9
- package/icon-check-toggle.mjs +15 -6
- package/icon-radio-toggle.js +5 -5
- package/icon-radio-toggle.mjs +30 -21
- package/icon.js +2 -2
- package/icon.mjs +8 -7
- package/if-defined.mjs +1 -1
- package/index.js +1 -1
- package/index.mjs +100 -90
- package/linear-progress.js +12 -12
- package/linear-progress.mjs +23 -17
- package/list-expansion.js +8 -8
- package/list-expansion.mjs +38 -29
- package/list-item.js +1 -1
- package/list-item.mjs +6 -6
- package/list-item2.mjs +16 -15
- package/list.js +1 -1
- package/list.mjs +2 -2
- package/list2.mjs +6 -5
- package/menu.js +2 -2
- package/menu.mjs +25 -16
- package/mwc-checkbox-base.mjs +6 -6
- package/mwc-checkbox.css.mjs +2 -2
- package/mwc-drawer-base.mjs +11 -11
- package/mwc-icon.mjs +3 -3
- package/mwc-line-ripple-directive.mjs +16 -16
- package/mwc-list-base.mjs +25 -25
- package/mwc-list-item-base.mjs +11 -11
- package/mwc-list-item.css.mjs +3 -3
- package/mwc-menu-base.mjs +20 -20
- package/mwc-radio-base.mjs +11 -11
- package/mwc-radio.css.mjs +2 -2
- package/mwc-slider.css.mjs +20 -20
- package/mwc-tab-base.mjs +22 -22
- package/mwc-top-app-bar-base.mjs +10 -10
- package/nav-list-item.js +10 -10
- package/nav-list-item.mjs +32 -24
- package/package.json +1 -1
- package/property.mjs +5 -0
- package/query-assigned-elements.mjs +33 -0
- package/query-assigned-nodes.mjs +5 -0
- package/query.mjs +5 -0
- package/radio-list-item.js +10 -10
- package/radio-list-item.mjs +27 -18
- package/radio.js +2 -2
- package/radio.mjs +22 -13
- package/ripple-handlers.mjs +104 -2
- package/select.js +28 -28
- package/select.mjs +25 -15
- package/side-sheet.js +4 -4
- package/side-sheet.mjs +12 -6
- package/slider-range.js +7 -7
- package/slider-range.mjs +69 -61
- package/slider.js +3 -3
- package/slider.mjs +26 -18
- package/snackbar.js +15 -15
- package/snackbar.mjs +26 -20
- package/state.mjs +5 -0
- package/status-header-item.js +4 -4
- package/status-header-item.mjs +14 -13
- package/status-header.js +6 -6
- package/status-header.mjs +9 -7
- package/style-map.mjs +5 -0
- package/switch.js +18 -18
- package/switch.mjs +30 -21
- package/tab-bar.js +21 -21
- package/tab-bar.mjs +22 -13
- package/tab.js +3 -3
- package/tab.mjs +13 -4
- package/text-lockup.js +5 -5
- package/text-lockup.mjs +8 -6
- package/textarea.js +14 -14
- package/textarea.mjs +23 -15
- package/textfield.js +3 -3
- package/textfield.mjs +39 -39
- package/textfield2.mjs +26 -19
- package/toolbar.js +3 -3
- package/toolbar.mjs +9 -3
- package/tooltip.js +12 -12
- package/tooltip.mjs +12 -8
- package/top-app-bar-fixed.js +5 -5
- package/top-app-bar-fixed.mjs +29 -23
- package/top-app-bar.js +3 -3
- package/top-app-bar.mjs +2 -2
- package/top-app-bar2.mjs +1 -1
- package/tree-list-item.js +8 -8
- package/tree-list-item.mjs +5 -3
- package/tree-list.js +3 -3
- package/tree-list.mjs +4 -4
- package/tslib.es6.mjs +1 -0
- package/typography.js +4 -4
- package/typography.mjs +12 -11
- package/utils.mjs +5 -0
- package/mwc-ripple.mjs +0 -175
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";const o=require("./
|
1
|
+
"use strict";const o=require("./tslib.es6.mjs"),c=require("./query-assigned-elements.mjs"),m=require("./base-element.mjs"),p=require("./property.mjs"),h=require("./query.mjs"),i=require("./class-map.mjs");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2016 Google Inc.
|
4
4
|
*
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
21
|
* THE SOFTWARE.
|
22
|
-
*/var
|
22
|
+
*/var b=function(){function t(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();/**
|
23
23
|
* @license
|
24
24
|
* Copyright 2018 Google Inc.
|
25
25
|
*
|
@@ -40,7 +40,7 @@
|
|
40
40
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
41
41
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
42
42
|
* THE SOFTWARE.
|
43
|
-
*/var
|
43
|
+
*/var g={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},u={NOTCH_ELEMENT_PADDING:8},_={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"};/**
|
44
44
|
* @license
|
45
45
|
* Copyright 2017 Google Inc.
|
46
46
|
*
|
@@ -61,26 +61,26 @@
|
|
61
61
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
62
62
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
63
63
|
* THE SOFTWARE.
|
64
|
-
*/var
|
64
|
+
*/var E=function(t){o.__extends(e,t);function e(n){return t.call(this,o.__assign(o.__assign({},e.defaultAdapter),n))||this}return Object.defineProperty(e,"strings",{get:function(){return g},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return _},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return u},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!1,configurable:!0}),e.prototype.notch=function(n){var r=e.cssClasses.OUTLINE_NOTCHED;n>0&&(n+=u.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(n),this.adapter.addClass(r)},e.prototype.closeNotch=function(){var n=e.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(n),this.adapter.removeNotchWidthProperty()},e}(b);/**
|
65
65
|
* @license
|
66
66
|
* Copyright 2019 Google LLC
|
67
67
|
* SPDX-License-Identifier: Apache-2.0
|
68
|
-
*/class
|
68
|
+
*/class s extends m.BaseElement{constructor(){super(...arguments),this.mdcFoundationClass=E,this.width=0,this.open=!1,this.lastOpen=this.open}createAdapter(){return{addClass:e=>this.mdcRoot.classList.add(e),removeClass:e=>this.mdcRoot.classList.remove(e),setNotchWidthProperty:e=>this.notchElement.style.setProperty("width",`${e}px`),removeNotchWidthProperty:()=>this.notchElement.style.removeProperty("width")}}openOrClose(e,n){this.mdcFoundation&&(e&&n!==void 0?this.mdcFoundation.notch(n):this.mdcFoundation.closeNotch())}render(){this.openOrClose(this.open,this.width);const e=i.o({"mdc-notched-outline--notched":this.open});return c.y`
|
69
69
|
<span class="mdc-notched-outline ${e}">
|
70
70
|
<span class="mdc-notched-outline__leading"></span>
|
71
71
|
<span class="mdc-notched-outline__notch">
|
72
72
|
<slot></slot>
|
73
73
|
</span>
|
74
74
|
<span class="mdc-notched-outline__trailing"></span>
|
75
|
-
</span>`}}o.__decorate([
|
75
|
+
</span>`}}o.__decorate([h.i(".mdc-notched-outline")],s.prototype,"mdcRoot",void 0);o.__decorate([p.e({type:Number})],s.prototype,"width",void 0);o.__decorate([p.e({type:Boolean,reflect:!0})],s.prototype,"open",void 0);o.__decorate([h.i(".mdc-notched-outline__notch")],s.prototype,"notchElement",void 0);/**
|
76
76
|
* @license
|
77
77
|
* Copyright 2021 Google LLC
|
78
78
|
* SPDX-LIcense-Identifier: Apache-2.0
|
79
|
-
*/const
|
79
|
+
*/const v=c.i`.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}:host{display:block;position:absolute;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] :host,:host([dir=rtl]){text-align:right}::slotted(.mdc-floating-label){display:inline-block;position:relative;top:17px;bottom:auto;max-width:100%}::slotted(.mdc-floating-label--float-above){text-overflow:clip}.mdc-notched-outline--upgraded ::slotted(.mdc-floating-label--float-above){max-width:calc(100% / 0.75)}.mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__leading,.mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-color:var(--mdc-notched-outline-border-color, var(--mdc-theme-primary, #6200ee));border-width:1px;border-width:var(--mdc-notched-outline-stroke-width, 1px)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0;padding-top:var(--mdc-notched-outline-notch-offset, 0)}`;/**
|
80
80
|
* @license
|
81
81
|
* Copyright 2019 Google LLC
|
82
82
|
* SPDX-License-Identifier: Apache-2.0
|
83
|
-
*/let
|
83
|
+
*/let l=class extends s{};l.styles=[v];l=o.__decorate([c.e("mwc-notched-outline")],l);/**
|
84
84
|
* @license
|
85
85
|
* Copyright 2016 Google Inc.
|
86
86
|
*
|
@@ -101,7 +101,7 @@
|
|
101
101
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
102
102
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
103
103
|
* THE SOFTWARE.
|
104
|
-
*/var
|
104
|
+
*/var y=function(){function t(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();/**
|
105
105
|
* @license
|
106
106
|
* Copyright 2016 Google Inc.
|
107
107
|
*
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
123
123
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
124
124
|
* THE SOFTWARE.
|
125
|
-
*/var
|
125
|
+
*/var L={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"};/**
|
126
126
|
* @license
|
127
127
|
* Copyright 2016 Google Inc.
|
128
128
|
*
|
@@ -143,11 +143,11 @@
|
|
143
143
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
144
144
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
145
145
|
* THE SOFTWARE.
|
146
|
-
*/var
|
146
|
+
*/var C=function(t){o.__extends(e,t);function e(n){var r=t.call(this,o.__assign(o.__assign({},e.defaultAdapter),n))||this;return r.shakeAnimationEndHandler=function(){r.handleShakeAnimationEnd()},r}return Object.defineProperty(e,"cssClasses",{get:function(){return L},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler)},e.prototype.getWidth=function(){return this.adapter.getWidth()},e.prototype.shake=function(n){var r=e.cssClasses.LABEL_SHAKE;n?this.adapter.addClass(r):this.adapter.removeClass(r)},e.prototype.float=function(n){var r=e.cssClasses,d=r.LABEL_FLOAT_ABOVE,f=r.LABEL_SHAKE;n?this.adapter.addClass(d):(this.adapter.removeClass(d),this.adapter.removeClass(f))},e.prototype.setRequired=function(n){var r=e.cssClasses.LABEL_REQUIRED;n?this.adapter.addClass(r):this.adapter.removeClass(r)},e.prototype.handleShakeAnimationEnd=function(){var n=e.cssClasses.LABEL_SHAKE;this.adapter.removeClass(n)},e}(y);/**
|
147
147
|
* @license
|
148
148
|
* Copyright 2018 Google LLC
|
149
149
|
* SPDX-License-Identifier: Apache-2.0
|
150
|
-
*/const
|
150
|
+
*/const x=t=>({addClass:e=>t.classList.add(e),removeClass:e=>t.classList.remove(e),getWidth:()=>t.scrollWidth,registerInteractionHandler:(e,n)=>{t.addEventListener(e,n)},deregisterInteractionHandler:(e,n)=>{t.removeEventListener(e,n)}});class A extends i.i{constructor(e){switch(super(e),this.foundation=null,this.previousPart=null,e.type){case i.t.ATTRIBUTE:case i.t.PROPERTY:break;default:throw new Error("FloatingLabel directive only support attribute and property parts")}}update(e,[n]){if(e!==this.previousPart){this.foundation&&this.foundation.destroy(),this.previousPart=e;const r=e.element;r.classList.add("mdc-floating-label");const d=x(r);this.foundation=new C(d),this.foundation.init()}return this.render(n)}render(e){return this.foundation}}const P=i.e(A);/**
|
151
151
|
* @license
|
152
152
|
* Copyright 2016 Google Inc.
|
153
153
|
*
|
@@ -168,7 +168,7 @@
|
|
168
168
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
169
169
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
170
170
|
* THE SOFTWARE.
|
171
|
-
*/var
|
171
|
+
*/var O=function(){function t(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();/**
|
172
172
|
* @license
|
173
173
|
* Copyright 2018 Google Inc.
|
174
174
|
*
|
@@ -189,7 +189,7 @@
|
|
189
189
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
190
190
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
191
191
|
* THE SOFTWARE.
|
192
|
-
*/var
|
192
|
+
*/var a={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"};/**
|
193
193
|
* @license
|
194
194
|
* Copyright 2018 Google Inc.
|
195
195
|
*
|
@@ -210,8 +210,8 @@
|
|
210
210
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
211
211
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
212
212
|
* THE SOFTWARE.
|
213
|
-
*/var
|
213
|
+
*/var N=function(t){o.__extends(e,t);function e(n){var r=t.call(this,o.__assign(o.__assign({},e.defaultAdapter),n))||this;return r.transitionEndHandler=function(d){r.handleTransitionEnd(d)},r}return Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler)},e.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler)},e.prototype.activate=function(){this.adapter.removeClass(a.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(a.LINE_RIPPLE_ACTIVE)},e.prototype.setRippleCenter=function(n){this.adapter.setStyle("transform-origin",n+"px center")},e.prototype.deactivate=function(){this.adapter.addClass(a.LINE_RIPPLE_DEACTIVATING)},e.prototype.handleTransitionEnd=function(n){var r=this.adapter.hasClass(a.LINE_RIPPLE_DEACTIVATING);n.propertyName==="opacity"&&r&&(this.adapter.removeClass(a.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(a.LINE_RIPPLE_DEACTIVATING))},e}(O);/**
|
214
214
|
* @license
|
215
215
|
* Copyright 2019 Google LLC
|
216
216
|
* SPDX-License-Identifier: Apache-2.0
|
217
|
-
*/const
|
217
|
+
*/const I=t=>({addClass:e=>t.classList.add(e),removeClass:e=>t.classList.remove(e),hasClass:e=>t.classList.contains(e),setStyle:(e,n)=>t.style.setProperty(e,n),registerEventHandler:(e,n)=>{t.addEventListener(e,n)},deregisterEventHandler:(e,n)=>{t.removeEventListener(e,n)}});class T extends i.i{constructor(e){switch(super(e),this.previousPart=null,this.foundation=null,e.type){case i.t.ATTRIBUTE:case i.t.PROPERTY:return;default:throw new Error("LineRipple only support attribute and property parts.")}}update(e,n){if(this.previousPart!==e){this.foundation&&this.foundation.destroy(),this.previousPart=e;const r=e.element;r.classList.add("mdc-line-ripple");const d=I(r);this.foundation=new N(d),this.foundation.init()}return this.render()}render(){return this.foundation}}const D=i.e(T);exports.floatingLabel=P;exports.lineRipple=D;
|
package/mwc-list-base.mjs
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
"use strict";const
|
1
|
+
"use strict";const p=require("./tslib.es6.mjs"),O=require("./query-assigned-elements.mjs"),B=require("./mwc-list-item-base.mjs"),H=require("./base-element.mjs"),L=require("./observer.mjs"),F=require("./utils.mjs"),I=require("./property.mjs"),K=require("./query.mjs"),W=require("./query-assigned-nodes.mjs"),k=require("./if-defined.mjs");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2021 Google LLC
|
4
4
|
* SPDX-LIcense-Identifier: Apache-2.0
|
5
|
-
*/const
|
5
|
+
*/const V=O.i`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit)}[dir=rtl] .mdc-deprecated-list-item__meta,.mdc-deprecated-list-item__meta[dir=rtl]{margin-left:0;margin-right:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-deprecated-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-deprecated-list-item__text ::slotted([for]),.mdc-deprecated-list-item__text[for]{pointer-events:none}.mdc-deprecated-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-deprecated-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-deprecated-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-deprecated-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-deprecated-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-deprecated-list--dense .mdc-deprecated-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-deprecated-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__secondary-text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-deprecated-list-item__secondary-text ::slotted(*){color:rgba(0, 0, 0, 0.54);color:var(--mdc-theme-text-secondary-on-background, rgba(0, 0, 0, 0.54))}.mdc-deprecated-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-icon-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-group__subheader ::slotted(*){color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 40px);height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px) !important}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 16px)}[dir=rtl] :host([graphic=avatar]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=medium]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=large]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=avatar]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=medium]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=large]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=control]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 16px);margin-right:0}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 24px);height:var(--mdc-list-item-graphic-size, 24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 32px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px) !important}[dir=rtl] :host([graphic=icon]) .mdc-deprecated-list-item__graphic,:host([graphic=icon]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=medium]:not([twoLine])),:host([graphic=large]:not([twoLine])){height:72px}:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 56px);height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic.multi,:host([graphic=large]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(*),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px) !important}:host([graphic=large]){padding-left:0px}`;/**
|
6
6
|
* @license
|
7
7
|
* Copyright 2020 Google LLC
|
8
8
|
* SPDX-License-Identifier: Apache-2.0
|
9
|
-
*/let
|
9
|
+
*/let N=class extends B.ListItemBase{};N.styles=[V];N=p.__decorate([O.e("mwc-list-item")],N);/**
|
10
10
|
* @license
|
11
11
|
* Copyright 2016 Google Inc.
|
12
12
|
*
|
@@ -27,7 +27,7 @@
|
|
27
27
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
28
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
29
29
|
* THE SOFTWARE.
|
30
|
-
*/var
|
30
|
+
*/var X=function(){function r(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(r,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.destroy=function(){},r}();/**
|
31
31
|
* @license
|
32
32
|
* Copyright 2020 Google Inc.
|
33
33
|
*
|
@@ -48,7 +48,7 @@
|
|
48
48
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
49
49
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
50
50
|
* THE SOFTWARE.
|
51
|
-
*/var
|
51
|
+
*/var n={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape",TAB:"Tab"},c=new Set;c.add(n.BACKSPACE);c.add(n.ENTER);c.add(n.SPACEBAR);c.add(n.PAGE_UP);c.add(n.PAGE_DOWN);c.add(n.END);c.add(n.HOME);c.add(n.ARROW_LEFT);c.add(n.ARROW_UP);c.add(n.ARROW_RIGHT);c.add(n.ARROW_DOWN);c.add(n.DELETE);c.add(n.ESCAPE);c.add(n.TAB);var h={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27,TAB:9},l=new Map;l.set(h.BACKSPACE,n.BACKSPACE);l.set(h.ENTER,n.ENTER);l.set(h.SPACEBAR,n.SPACEBAR);l.set(h.PAGE_UP,n.PAGE_UP);l.set(h.PAGE_DOWN,n.PAGE_DOWN);l.set(h.END,n.END);l.set(h.HOME,n.HOME);l.set(h.ARROW_LEFT,n.ARROW_LEFT);l.set(h.ARROW_UP,n.ARROW_UP);l.set(h.ARROW_RIGHT,n.ARROW_RIGHT);l.set(h.ARROW_DOWN,n.ARROW_DOWN);l.set(h.DELETE,n.DELETE);l.set(h.ESCAPE,n.ESCAPE);l.set(h.TAB,n.TAB);var S=new Set;S.add(n.PAGE_UP);S.add(n.PAGE_DOWN);S.add(n.END);S.add(n.HOME);S.add(n.ARROW_LEFT);S.add(n.ARROW_UP);S.add(n.ARROW_RIGHT);S.add(n.ARROW_DOWN);function A(r){var e=r.key;if(c.has(e))return e;var t=l.get(r.keyCode);return t||n.UNKNOWN}/**
|
52
52
|
* @license
|
53
53
|
* Copyright 2018 Google Inc.
|
54
54
|
*
|
@@ -69,34 +69,34 @@
|
|
69
69
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
70
70
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
71
71
|
* THE SOFTWARE.
|
72
|
-
*/var
|
73
|
-
.`+
|
74
|
-
.`+
|
75
|
-
.`+v[
|
76
|
-
.`+v[
|
72
|
+
*/var x,E,a={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"};x={},x[""+a.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",x[""+a.LIST_ITEM_CLASS]="mdc-list-item",x[""+a.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",x[""+a.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",x[""+a.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",x[""+a.ROOT]="mdc-list";var v=(E={},E[""+a.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",E[""+a.LIST_ITEM_CLASS]="mdc-deprecated-list-item",E[""+a.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",E[""+a.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",E[""+a.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",E[""+a.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",E[""+a.ROOT]="mdc-deprecated-list",E),C={ACTION_EVENT:"MDCList:action",SELECTION_CHANGE_EVENT:"MDCList:selectionChange",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:`
|
73
|
+
.`+a.LIST_ITEM_CLASS+` button:not(:disabled),
|
74
|
+
.`+a.LIST_ITEM_CLASS+` a,
|
75
|
+
.`+v[a.LIST_ITEM_CLASS]+` button:not(:disabled),
|
76
|
+
.`+v[a.LIST_ITEM_CLASS]+` a
|
77
77
|
`,DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:`
|
78
|
-
.`+
|
79
|
-
.`+
|
80
|
-
.`+
|
81
|
-
.`+
|
82
|
-
.`+v[
|
83
|
-
.`+v[
|
84
|
-
.`+v[
|
85
|
-
.`+v[
|
86
|
-
`,RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},
|
78
|
+
.`+a.LIST_ITEM_CLASS+` button:not(:disabled),
|
79
|
+
.`+a.LIST_ITEM_CLASS+` a,
|
80
|
+
.`+a.LIST_ITEM_CLASS+` input[type="radio"]:not(:disabled),
|
81
|
+
.`+a.LIST_ITEM_CLASS+` input[type="checkbox"]:not(:disabled),
|
82
|
+
.`+v[a.LIST_ITEM_CLASS]+` button:not(:disabled),
|
83
|
+
.`+v[a.LIST_ITEM_CLASS]+` a,
|
84
|
+
.`+v[a.LIST_ITEM_CLASS]+` input[type="radio"]:not(:disabled),
|
85
|
+
.`+v[a.LIST_ITEM_CLASS]+` input[type="checkbox"]:not(:disabled)
|
86
|
+
`,RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},m={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};/**
|
87
87
|
* @license
|
88
88
|
* Copyright 2020 Google LLC
|
89
89
|
* SPDX-License-Identifier: Apache-2.0
|
90
|
-
*/const
|
90
|
+
*/const M=(r,e)=>r-e,G=(r,e)=>{const t=Array.from(r),i=Array.from(e),s={added:[],removed:[]},d=t.sort(M),o=i.sort(M);let _=0,b=0;for(;_<d.length||b<o.length;){const f=d[_],g=o[b];if(f===g){_++,b++;continue}if(f!==void 0&&(g===void 0||f<g)){s.removed.push(f),_++;continue}if(g!==void 0&&(f===void 0||g<f)){s.added.push(g),b++;continue}}return s},q=["input","button","textarea","select"];function R(r){return r instanceof Set}const D=r=>{const e=r===m.UNSET_INDEX?new Set:r;return R(e)?new Set(e):new Set([e])};class P extends X{constructor(e){super(Object.assign(Object.assign({},P.defaultAdapter),e)),this.isMulti_=!1,this.wrapFocus_=!1,this.isVertical_=!0,this.selectedIndex_=m.UNSET_INDEX,this.focusedItemIndex_=m.UNSET_INDEX,this.useActivatedClass_=!1,this.ariaCurrentAttrValue_=null}static get strings(){return C}static get numbers(){return m}static get defaultAdapter(){return{focusItemAtIndex:()=>{},getFocusedElementIndex:()=>0,getListItemCount:()=>0,isFocusInsideList:()=>!1,isRootFocused:()=>!1,notifyAction:()=>{},notifySelected:()=>{},getSelectedStateForElementIndex:()=>!1,setDisabledStateForElementIndex:()=>{},getDisabledStateForElementIndex:()=>!1,setSelectedStateForElementIndex:()=>{},setActivatedStateForElementIndex:()=>{},setTabIndexForElementIndex:()=>{},setAttributeForElementIndex:()=>{},getAttributeForElementIndex:()=>null}}setWrapFocus(e){this.wrapFocus_=e}setMulti(e){this.isMulti_=e;const t=this.selectedIndex_;if(e){if(!R(t)){const i=t===m.UNSET_INDEX;this.selectedIndex_=i?new Set:new Set([t])}}else if(R(t))if(t.size){const i=Array.from(t).sort(M);this.selectedIndex_=i[0]}else this.selectedIndex_=m.UNSET_INDEX}setVerticalOrientation(e){this.isVertical_=e}setUseActivatedClass(e){this.useActivatedClass_=e}getSelectedIndex(){return this.selectedIndex_}setSelectedIndex(e){this.isIndexValid_(e)&&(this.isMulti_?this.setMultiSelectionAtIndex_(D(e)):this.setSingleSelectionAtIndex_(e))}handleFocusIn(e,t){t>=0&&this.adapter.setTabIndexForElementIndex(t,0)}handleFocusOut(e,t){t>=0&&this.adapter.setTabIndexForElementIndex(t,-1),setTimeout(()=>{this.adapter.isFocusInsideList()||this.setTabindexToFirstSelectedItem_()},0)}handleKeydown(e,t,i){const s=A(e)==="ArrowLeft",d=A(e)==="ArrowUp",o=A(e)==="ArrowRight",_=A(e)==="ArrowDown",b=A(e)==="Home",f=A(e)==="End",g=A(e)==="Enter",z=A(e)==="Spacebar";if(this.adapter.isRootFocused()){d||f?(e.preventDefault(),this.focusLastElement()):(_||b)&&(e.preventDefault(),this.focusFirstElement());return}let T=this.adapter.getFocusedElementIndex();if(T===-1&&(T=i,T<0))return;let y;if(this.isVertical_&&_||!this.isVertical_&&o)this.preventDefaultEvent(e),y=this.focusNextElement(T);else if(this.isVertical_&&d||!this.isVertical_&&s)this.preventDefaultEvent(e),y=this.focusPrevElement(T);else if(b)this.preventDefaultEvent(e),y=this.focusFirstElement();else if(f)this.preventDefaultEvent(e),y=this.focusLastElement();else if((g||z)&&t){const U=e.target;if(U&&U.tagName==="A"&&g)return;this.preventDefaultEvent(e),this.setSelectedIndexOnAction_(T,!0)}this.focusedItemIndex_=T,y!==void 0&&(this.setTabindexAtIndex_(y),this.focusedItemIndex_=y)}handleSingleSelection(e,t,i){e!==m.UNSET_INDEX&&(this.setSelectedIndexOnAction_(e,t,i),this.setTabindexAtIndex_(e),this.focusedItemIndex_=e)}focusNextElement(e){const t=this.adapter.getListItemCount();let i=e+1;if(i>=t)if(this.wrapFocus_)i=0;else return e;return this.adapter.focusItemAtIndex(i),i}focusPrevElement(e){let t=e-1;if(t<0)if(this.wrapFocus_)t=this.adapter.getListItemCount()-1;else return e;return this.adapter.focusItemAtIndex(t),t}focusFirstElement(){return this.adapter.focusItemAtIndex(0),0}focusLastElement(){const e=this.adapter.getListItemCount()-1;return this.adapter.focusItemAtIndex(e),e}setEnabled(e,t){this.isIndexValid_(e)&&this.adapter.setDisabledStateForElementIndex(e,!t)}preventDefaultEvent(e){const i=`${e.target.tagName}`.toLowerCase();q.indexOf(i)===-1&&e.preventDefault()}setSingleSelectionAtIndex_(e,t=!0){this.selectedIndex_!==e&&(this.selectedIndex_!==m.UNSET_INDEX&&(this.adapter.setSelectedStateForElementIndex(this.selectedIndex_,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(this.selectedIndex_,!1)),t&&this.adapter.setSelectedStateForElementIndex(e,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(e,!0),this.setAriaForSingleSelectionAtIndex_(e),this.selectedIndex_=e,this.adapter.notifySelected(e))}setMultiSelectionAtIndex_(e,t=!0){const i=D(this.selectedIndex_),s=G(i,e);if(!(!s.removed.length&&!s.added.length)){for(const d of s.removed)t&&this.adapter.setSelectedStateForElementIndex(d,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(d,!1);for(const d of s.added)t&&this.adapter.setSelectedStateForElementIndex(d,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(d,!0);this.selectedIndex_=e,this.adapter.notifySelected(e,s)}}setAriaForSingleSelectionAtIndex_(e){this.selectedIndex_===m.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(e,C.ARIA_CURRENT));const t=this.ariaCurrentAttrValue_!==null,i=t?C.ARIA_CURRENT:C.ARIA_SELECTED;this.selectedIndex_!==m.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false");const s=t?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(e,i,s)}setTabindexAtIndex_(e){this.focusedItemIndex_===m.UNSET_INDEX&&e!==0?this.adapter.setTabIndexForElementIndex(0,-1):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==e&&this.adapter.setTabIndexForElementIndex(this.focusedItemIndex_,-1),this.adapter.setTabIndexForElementIndex(e,0)}setTabindexToFirstSelectedItem_(){let e=0;typeof this.selectedIndex_=="number"&&this.selectedIndex_!==m.UNSET_INDEX?e=this.selectedIndex_:R(this.selectedIndex_)&&this.selectedIndex_.size>0&&(e=Math.min(...this.selectedIndex_)),this.setTabindexAtIndex_(e)}isIndexValid_(e){if(e instanceof Set){if(!this.isMulti_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");if(e.size===0)return!0;{let t=!1;for(const i of e)if(t=this.isIndexInRange_(i),t)break;return t}}else if(typeof e=="number"){if(this.isMulti_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return e===m.UNSET_INDEX||this.isIndexInRange_(e)}else return!1}isIndexInRange_(e){const t=this.adapter.getListItemCount();return e>=0&&e<t}setSelectedIndexOnAction_(e,t,i){if(this.adapter.getDisabledStateForElementIndex(e))return;let s=e;this.isMulti_&&(s=new Set([e])),this.isIndexValid_(s)&&(this.isMulti_?this.toggleMultiAtIndex(e,i,t):t||i?this.setSingleSelectionAtIndex_(e,t):this.selectedIndex_===e&&this.setSingleSelectionAtIndex_(m.UNSET_INDEX),t&&this.adapter.notifyAction(e))}toggleMultiAtIndex(e,t,i=!0){let s=!1;t===void 0?s=!this.adapter.getSelectedStateForElementIndex(e):s=t;const d=D(this.selectedIndex_);s?d.add(e):d.delete(e),this.setMultiSelectionAtIndex_(d,i)}}/**
|
91
91
|
* @license
|
92
92
|
* Copyright 2020 Google LLC
|
93
93
|
* SPDX-License-Identifier: Apache-2.0
|
94
|
-
*/function
|
94
|
+
*/function $(r,e=50){let t;return function(i=!0){clearTimeout(t),t=setTimeout(()=>{r(i)},e)}}const w=r=>r.hasAttribute("mwc-list-item");function j(){const r=this.itemsReadyResolver;this.itemsReady=new Promise(e=>this.itemsReadyResolver=e),r()}class u extends H.BaseElement{constructor(){super(),this.mdcAdapter=null,this.mdcFoundationClass=P,this.activatable=!1,this.multi=!1,this.wrapFocus=!1,this.itemRoles=null,this.innerRole=null,this.innerAriaLabel=null,this.rootTabbable=!1,this.previousTabindex=null,this.noninteractive=!1,this.itemsReadyResolver=()=>{},this.itemsReady=Promise.resolve([]),this.items_=[];const e=$(this.layout.bind(this));this.debouncedLayout=(t=!0)=>{j.call(this),e(t)}}async getUpdateComplete(){const e=await super.getUpdateComplete();return await this.itemsReady,e}get items(){return this.items_}updateItems(){var e;const t=(e=this.assignedElements)!==null&&e!==void 0?e:[],i=[];for(const o of t)w(o)&&(i.push(o),o._managingList=this),o.hasAttribute("divider")&&!o.hasAttribute("role")&&o.setAttribute("role","separator");this.items_=i;const s=new Set;if(this.items_.forEach((o,_)=>{this.itemRoles?o.setAttribute("role",this.itemRoles):o.removeAttribute("role"),o.selected&&s.add(_)}),this.multi)this.select(s);else{const o=s.size?s.entries().next().value[1]:-1;this.select(o)}const d=new Event("items-updated",{bubbles:!0,composed:!0});this.dispatchEvent(d)}get selected(){const e=this.index;if(!R(e))return e===-1?null:this.items[e];const t=[];for(const i of e)t.push(this.items[i]);return t}get index(){return this.mdcFoundation?this.mdcFoundation.getSelectedIndex():-1}render(){const e=this.innerRole===null?void 0:this.innerRole,t=this.innerAriaLabel===null?void 0:this.innerAriaLabel,i=this.rootTabbable?"0":"-1";return O.y`
|
95
95
|
<!-- @ts-ignore -->
|
96
96
|
<ul
|
97
97
|
tabindex=${i}
|
98
|
-
role="${
|
99
|
-
aria-label="${
|
98
|
+
role="${k.l(e)}"
|
99
|
+
aria-label="${k.l(t)}"
|
100
100
|
class="mdc-deprecated-list"
|
101
101
|
@keydown=${this.onKeydown}
|
102
102
|
@focusin=${this.onFocusIn}
|
@@ -106,6 +106,6 @@
|
|
106
106
|
<slot></slot>
|
107
107
|
${this.renderPlaceholder()}
|
108
108
|
</ul>
|
109
|
-
`}renderPlaceholder(){var e;const t=(e=this.assignedElements)!==null&&e!==void 0?e:[];return this.emptyMessage!==void 0&&t.length===0?
|
109
|
+
`}renderPlaceholder(){var e;const t=(e=this.assignedElements)!==null&&e!==void 0?e:[];return this.emptyMessage!==void 0&&t.length===0?O.y`
|
110
110
|
<mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
|
111
|
-
`:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e);this.mdcFoundation.handleFocusIn(e,t)}}onFocusOut(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e);this.mdcFoundation.handleFocusOut(e,t)}}onKeydown(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e),i=e.target,s=
|
111
|
+
`:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e);this.mdcFoundation.handleFocusIn(e,t)}}onFocusOut(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e);this.mdcFoundation.handleFocusOut(e,t)}}onKeydown(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e),i=e.target,s=w(i);this.mdcFoundation.handleKeydown(e,s,t)}}onRequestSelected(e){if(this.mdcFoundation){let t=this.getIndexOfTarget(e);if(t===-1&&(this.layout(),t=this.getIndexOfTarget(e),t===-1)||this.items[t].disabled)return;const s=e.detail.selected,d=e.detail.source;this.mdcFoundation.handleSingleSelection(t,d==="interaction",s),e.stopPropagation()}}getIndexOfTarget(e){const t=this.items,i=e.composedPath();for(const s of i){let d=-1;if(F.isNodeElement(s)&&w(s)&&(d=t.indexOf(s)),d!==-1)return d}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(e,t)=>{if(!this.mdcRoot)return"";const s=this.items[e];return s?s.getAttribute(t):""},setAttributeForElementIndex:(e,t,i)=>{if(!this.mdcRoot)return;const s=this.items[e];s&&s.setAttribute(t,i)},focusItemAtIndex:e=>{const t=this.items[e];t&&t.focus()},setTabIndexForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.tabindex=t)},notifyAction:e=>{const t={bubbles:!0,composed:!0};t.detail={index:e};const i=new CustomEvent("action",t);this.dispatchEvent(i)},notifySelected:(e,t)=>{const i={bubbles:!0,composed:!0};i.detail={index:e,diff:t};const s=new CustomEvent("selected",i);this.dispatchEvent(s)},isFocusInsideList:()=>F.doesElementContainFocus(this),isRootFocused:()=>{const e=this.mdcRoot;return e.getRootNode().activeElement===e},setDisabledStateForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.disabled=t)},getDisabledStateForElementIndex:e=>{const t=this.items[e];return t?t.disabled:!1},setSelectedStateForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.selected=t)},getSelectedStateForElementIndex:e=>{const t=this.items[e];return t?t.selected:!1},setActivatedStateForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.activated=t)}},this.mdcAdapter}selectUi(e,t=!1){const i=this.items[e];i&&(i.selected=!0,i.activated=t)}deselectUi(e){const t=this.items[e];t&&(t.selected=!1,t.activated=!1)}select(e){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(e)}toggle(e,t){this.multi&&this.mdcFoundation.toggleMultiAtIndex(e,t)}onListItemConnected(e){const t=e.target;this.layout(this.items.indexOf(t)===-1)}layout(e=!0){e&&this.updateItems();const t=this.items[0];for(const i of this.items)i.tabindex=-1;t&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=t):t.tabindex=0),this.itemsReadyResolver()}getFocusedItemIndex(){if(!this.mdcRoot||!this.items.length)return-1;const e=F.deepActiveElementPath();if(!e.length)return-1;for(let t=e.length-1;t>=0;t--){const i=e[t];if(w(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(e){for(const t of this.items)if(t.tabindex===0){t.tabindex=-1;break}this.items[e].tabindex=0,this.items[e].focus()}focus(){const e=this.mdcRoot;e&&e.focus()}blur(){const e=this.mdcRoot;e&&e.blur()}}p.__decorate([I.e({type:String})],u.prototype,"emptyMessage",void 0);p.__decorate([K.i(".mdc-deprecated-list")],u.prototype,"mdcRoot",void 0);p.__decorate([W.o("",!0,"*")],u.prototype,"assignedElements",void 0);p.__decorate([W.o("",!0,'[tabindex="0"]')],u.prototype,"tabbableElements",void 0);p.__decorate([I.e({type:Boolean}),L.observer(function(r){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(r)})],u.prototype,"activatable",void 0);p.__decorate([I.e({type:Boolean}),L.observer(function(r,e){this.mdcFoundation&&this.mdcFoundation.setMulti(r),e!==void 0&&this.layout()})],u.prototype,"multi",void 0);p.__decorate([I.e({type:Boolean}),L.observer(function(r){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(r)})],u.prototype,"wrapFocus",void 0);p.__decorate([I.e({type:String}),L.observer(function(r,e){e!==void 0&&this.updateItems()})],u.prototype,"itemRoles",void 0);p.__decorate([I.e({type:String})],u.prototype,"innerRole",void 0);p.__decorate([I.e({type:String})],u.prototype,"innerAriaLabel",void 0);p.__decorate([I.e({type:Boolean})],u.prototype,"rootTabbable",void 0);p.__decorate([I.e({type:Boolean,reflect:!0}),L.observer(function(r){var e,t;if(r){const i=(t=(e=this.tabbableElements)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:null;this.previousTabindex=i,i&&i.setAttribute("tabindex","-1")}else!r&&this.previousTabindex&&(this.previousTabindex.setAttribute("tabindex","0"),this.previousTabindex=null)})],u.prototype,"noninteractive",void 0);exports.ListBase=u;
|
package/mwc-list-item-base.mjs
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
"use strict";const
|
1
|
+
"use strict";const s=require("./tslib.es6.mjs"),c=require("./ripple-handlers.mjs"),l=require("./observer.mjs"),r=require("./query-assigned-elements.mjs"),n=require("./property.mjs"),d=require("./state.mjs"),p=require("./query.mjs"),h=require("./class-map.mjs");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2020 Google LLC
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/class
|
5
|
+
*/class t extends r.s{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new c.RippleHandlers(()=>(this.shouldRenderRipple=!0,this.ripple)),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:e=>{const i=e.type;this.onDown(i==="mousedown"?"mouseup":"touchend",e)}}]}get text(){const e=this.textContent;return e?e.trim():""}render(){const e=this.renderText(),i=this.graphic?this.renderGraphic():r.y``,o=this.hasMeta?this.renderMeta():r.y``;return r.y`
|
6
6
|
${this.renderRipple()}
|
7
7
|
${i}
|
8
|
-
${
|
9
|
-
${
|
8
|
+
${e}
|
9
|
+
${o}`}renderRipple(){return this.shouldRenderRipple?r.y`
|
10
10
|
<mwc-ripple
|
11
11
|
.activated=${this.activated}>
|
12
|
-
</mwc-ripple>`:this.activated?
|
13
|
-
<span class="mdc-deprecated-list-item__graphic material-icons ${
|
12
|
+
</mwc-ripple>`:this.activated?r.y`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const e={multi:this.multipleGraphics};return r.y`
|
13
|
+
<span class="mdc-deprecated-list-item__graphic material-icons ${h.o(e)}">
|
14
14
|
<slot name="graphic"></slot>
|
15
|
-
</span>`}renderMeta(){return
|
15
|
+
</span>`}renderMeta(){return r.y`
|
16
16
|
<span class="mdc-deprecated-list-item__meta material-icons">
|
17
17
|
<slot name="meta"></slot>
|
18
|
-
</span>`}renderText(){const
|
18
|
+
</span>`}renderText(){const e=this.twoline?this.renderTwoline():this.renderSingleLine();return r.y`
|
19
19
|
<span class="mdc-deprecated-list-item__text">
|
20
|
-
${
|
21
|
-
</span>`}renderSingleLine(){return
|
20
|
+
${e}
|
21
|
+
</span>`}renderSingleLine(){return r.y`<slot></slot>`}renderTwoline(){return r.y`
|
22
22
|
<span class="mdc-deprecated-list-item__primary-text">
|
23
23
|
<slot></slot>
|
24
24
|
</span>
|
25
25
|
<span class="mdc-deprecated-list-item__secondary-text">
|
26
26
|
<slot name="secondary"></slot>
|
27
27
|
</span>
|
28
|
-
`}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(
|
28
|
+
`}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(e,i){const o=()=>{window.removeEventListener(e,o),this.rippleHandlers.endPress()};window.addEventListener(e,o),this.rippleHandlers.startPress(i)}fireRequestSelected(e,i){if(this.noninteractive)return;const o=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:i,selected:e}});this.dispatchEvent(o)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const e of this.listeners)for(const i of e.eventNames)e.target.addEventListener(i,e.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const e of this.listeners)for(const i of e.eventNames)e.target.removeEventListener(i,e.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const e=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(e)}}s.__decorate([p.i("slot")],t.prototype,"slotElement",void 0);s.__decorate([c.e("mwc-ripple")],t.prototype,"ripple",void 0);s.__decorate([n.e({type:String})],t.prototype,"value",void 0);s.__decorate([n.e({type:String,reflect:!0})],t.prototype,"group",void 0);s.__decorate([n.e({type:Number,reflect:!0})],t.prototype,"tabindex",void 0);s.__decorate([n.e({type:Boolean,reflect:!0}),l.observer(function(a){a?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")})],t.prototype,"disabled",void 0);s.__decorate([n.e({type:Boolean,reflect:!0})],t.prototype,"twoline",void 0);s.__decorate([n.e({type:Boolean,reflect:!0})],t.prototype,"activated",void 0);s.__decorate([n.e({type:String,reflect:!0})],t.prototype,"graphic",void 0);s.__decorate([n.e({type:Boolean})],t.prototype,"multipleGraphics",void 0);s.__decorate([n.e({type:Boolean})],t.prototype,"hasMeta",void 0);s.__decorate([n.e({type:Boolean,reflect:!0}),l.observer(function(a){a?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")})],t.prototype,"noninteractive",void 0);s.__decorate([n.e({type:Boolean,reflect:!0}),l.observer(function(a){const e=this.getAttribute("role"),i=e==="gridcell"||e==="option"||e==="row"||e==="tab";if(i&&a?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged){this._firstChanged=!1;return}this._skipPropRequest||this.fireRequestSelected(a,"property")})],t.prototype,"selected",void 0);s.__decorate([d.t()],t.prototype,"shouldRenderRipple",void 0);s.__decorate([d.t()],t.prototype,"_managingList",void 0);exports.ListItemBase=t;
|
package/mwc-list-item.css.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
"use strict";const t=require("./
|
1
|
+
"use strict";const t=require("./query-assigned-elements.mjs");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2021 Google LLC
|
4
4
|
* SPDX-LIcense-Identifier: Apache-2.0
|
5
|
-
*/const e=t.i
|
5
|
+
*/const e=t.i`:host(:not([twoline])){height:56px}:host(:not([left])) .mdc-deprecated-list-item__meta{height:40px;width:40px}`;/**
|
6
6
|
* @license
|
7
7
|
* Copyright 2021 Google LLC
|
8
8
|
* SPDX-LIcense-Identifier: Apache-2.0
|
9
|
-
*/const i=t.i
|
9
|
+
*/const i=t.i`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit)}[dir=rtl] .mdc-deprecated-list-item__meta,.mdc-deprecated-list-item__meta[dir=rtl]{margin-left:0;margin-right:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-deprecated-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-deprecated-list-item__text ::slotted([for]),.mdc-deprecated-list-item__text[for]{pointer-events:none}.mdc-deprecated-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-deprecated-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-deprecated-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-deprecated-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-deprecated-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-deprecated-list--dense .mdc-deprecated-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-deprecated-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__secondary-text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-deprecated-list-item__secondary-text ::slotted(*){color:rgba(0, 0, 0, 0.54);color:var(--mdc-theme-text-secondary-on-background, rgba(0, 0, 0, 0.54))}.mdc-deprecated-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-icon-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-group__subheader ::slotted(*){color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 40px);height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px) !important}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 16px)}[dir=rtl] :host([graphic=avatar]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=medium]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=large]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=avatar]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=medium]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=large]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=control]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 16px);margin-right:0}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 24px);height:var(--mdc-list-item-graphic-size, 24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 32px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px) !important}[dir=rtl] :host([graphic=icon]) .mdc-deprecated-list-item__graphic,:host([graphic=icon]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=medium]:not([twoLine])),:host([graphic=large]:not([twoLine])){height:72px}:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 56px);height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic.multi,:host([graphic=large]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(*),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px) !important}:host([graphic=large]){padding-left:0px}`;exports.styles=i;exports.styles$1=e;
|