@covalent/components 8.0.0 → 8.1.0-beta.1
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/_commonjsHelpers-2367a3a2.js +1 -0
- package/_commonjsHelpers-de2741aa.mjs +28 -0
- package/action-ribbon.mjs +2 -2
- package/alert.mjs +2 -2
- package/app-shell/app-shell.d.ts +2 -0
- package/app-shell/app-shell.d.ts.map +1 -1
- package/app-shell.js +1 -1
- package/app-shell.mjs +22 -12
- package/button.mjs +3 -3
- package/check-list-item.js +8 -6
- package/check-list-item.mjs +34 -28
- package/checkbox.mjs +4 -4
- package/chip-13877bb8.mjs +3116 -0
- package/chip-3c12a33d.js +493 -0
- package/chip-set.js +76 -0
- package/chip-set.mjs +532 -0
- package/chip.js +1 -0
- package/chip.mjs +12 -0
- package/circular-progress.mjs +1 -1
- package/code-snippet.js +13 -1
- package/code-snippet.mjs +12252 -7
- package/{dialog-3ca1b701.mjs → dialog-3444dd4d.mjs} +8 -8
- package/dialog.mjs +2 -2
- package/drawer.mjs +2 -2
- package/empty-state.js +1 -1
- package/empty-state.mjs +3 -3
- package/expansion-panel-item.js +25 -0
- package/expansion-panel-item.mjs +107 -0
- package/expansion-panel.js +7 -0
- package/expansion-panel.mjs +59 -0
- package/{form-element-ffcf59ff.mjs → form-element-7353b3c4.mjs} +1 -1
- package/formfield.js +80 -0
- package/formfield.mjs +277 -0
- package/{foundation-39dc72d2.mjs → foundation-eff81c1e.mjs} +1 -1
- package/icon-button.mjs +2 -2
- package/icon-check-toggle.mjs +4 -4
- package/icon-radio-toggle.mjs +4 -4
- package/icon.mjs +2 -2
- package/index.js +1 -568
- package/index.mjs +113 -3728
- package/linear-progress.mjs +4 -4
- package/list/check-list-item.d.ts.map +1 -1
- package/list/radio-list-item.d.ts.map +1 -1
- package/{mwc-list-item.css-b0009fc7.mjs → list-item-1fc0d619.mjs} +3 -1
- package/{mwc-list-item.css-25adc0c4.js → list-item-209613bf.js} +2 -1
- package/list-item.js +7 -1
- package/list-item.mjs +29 -8
- package/list.js +1 -1
- package/list.mjs +5 -5
- package/menu.mjs +5 -5
- package/{mwc-checkbox-base-f10fd709.mjs → mwc-checkbox-base-afeeff16.mjs} +3 -3
- package/{mwc-drawer-base-135de8a5.mjs → mwc-drawer-base-0c2b4060.mjs} +1 -1
- package/{mwc-icon-bf656cf5.mjs → mwc-icon-28b10c70.mjs} +1 -1
- package/{mwc-line-ripple-directive-b24a914e.mjs → mwc-line-ripple-directive-315e996d.mjs} +1 -1
- package/{mwc-list-base-76e37212.mjs → mwc-list-base-8aa5bfd8.mjs} +2 -2
- package/{mwc-list-item-base-fe4398c3.mjs → mwc-list-item-base-bf1a075b.mjs} +2 -2
- package/{mwc-menu-base-c4bc88ea.mjs → mwc-menu-base-872420a4.mjs} +2 -2
- package/{mwc-radio-base-a374fbd9.mjs → mwc-radio-base-18a887dd.mjs} +3 -3
- package/{mwc-slider.css-8b6f275c.mjs → mwc-slider.css-03537082.mjs} +3 -3
- package/{mwc-tab-base-be0c887f.mjs → mwc-tab-base-cd1570e4.mjs} +2 -2
- package/{mwc-top-app-bar-base-55da3fe4.mjs → mwc-top-app-bar-base-c7380903.mjs} +1 -1
- package/nav-list-item.js +2 -2
- package/nav-list-item.mjs +29 -29
- package/package.json +16 -1
- package/radio-list-item.js +8 -6
- package/radio-list-item.mjs +36 -30
- package/radio.mjs +4 -4
- package/{ripple-handlers-f37f21cf.mjs → ripple-handlers-38a43e50.mjs} +1 -1
- package/select.mjs +8 -8
- package/side-sheet.mjs +2 -2
- package/slider-range.mjs +4 -4
- package/slider.mjs +8 -8
- package/snackbar.mjs +1 -1
- package/style.css +1 -1
- package/switch.mjs +3 -3
- package/tab-bar.mjs +3 -3
- package/tab.mjs +3 -3
- package/textarea.mjs +4 -4
- package/textfield/textfield.d.ts +1 -0
- package/textfield/textfield.d.ts.map +1 -1
- package/{textfield-63d1859a.mjs → textfield-a2e37241.mjs} +3 -3
- package/textfield.js +1 -1
- package/textfield.mjs +7 -4
- package/toolbar.mjs +2 -2
- package/tooltip.mjs +1 -1
- package/top-app-bar-fixed.mjs +2 -2
- package/top-app-bar.mjs +2 -2
- package/tree-list-item.mjs +2 -2
- package/{tslib.es6-f3e988cd.mjs → tslib.es6-226581a4.mjs} +5 -5
- package/code-snippet-2137b11c.js +0 -13
- package/code-snippet-ccca324f.mjs +0 -12278
- package/list-item-04b6ffa1.js +0 -8
- package/list-item-1c4f9e23.mjs +0 -32
package/chip-set.js
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("./query-assigned-elements-f623705d.js"),p=require("./chip-3c12a33d.js"),d=require("./tslib.es6-98719205.js"),g=require("./property-57f6f6fe.js"),F=require("./query-680f1868.js");require("./utils-a8190a39.js");require("./class-map-b5efe8da.js");require("./_commonjsHelpers-2367a3a2.js");/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2016 Google Inc.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
10
|
+
* furnished to do so, subject to the following conditions:
|
11
|
+
*
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
13
|
+
* all copies or substantial portions of the Software.
|
14
|
+
*
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
* THE SOFTWARE.
|
22
|
+
*/var x;(function(a){a.ARIA_MULTISELECTABLE="aria-multiselectable"})(x||(x={}));var b;(function(a){a.CHIP="mdc-evolution-chip"})(b||(b={}));var v;(function(a){a.INTERACTION="MDCChipSet:interaction",a.REMOVAL="MDCChipSet:removal",a.SELECTION="MDCChipSet:selection"})(v||(v={}));/**
|
23
|
+
* @license
|
24
|
+
* Copyright 2020 Google Inc.
|
25
|
+
*
|
26
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
27
|
+
* of this software and associated documentation files (the "Software"), to deal
|
28
|
+
* in the Software without restriction, including without limitation the rights
|
29
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
30
|
+
* copies of the Software, and to permit persons to whom the Software is
|
31
|
+
* furnished to do so, subject to the following conditions:
|
32
|
+
*
|
33
|
+
* The above copyright notice and this permission notice shall be included in
|
34
|
+
* all copies or substantial portions of the Software.
|
35
|
+
*
|
36
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
37
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
38
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
39
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
40
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
41
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
42
|
+
* THE SOFTWARE.
|
43
|
+
*/var C;(function(a){a[a.INCREMENT=0]="INCREMENT",a[a.DECREMENT=1]="DECREMENT"})(C||(C={}));var S=function(a){d.__extends(i,a);function i(e){return a.call(this,d.__assign(d.__assign({},i.defaultAdapter),e))||this}return Object.defineProperty(i,"defaultAdapter",{get:function(){return{announceMessage:function(){},emitEvent:function(){},getAttribute:function(){return null},getChipActionsAtIndex:function(){return[]},getChipCount:function(){return 0},getChipIdAtIndex:function(){return""},getChipIndexById:function(){return 0},isChipFocusableAtIndex:function(){return!1},isChipSelectableAtIndex:function(){return!1},isChipSelectedAtIndex:function(){return!1},removeChipAtIndex:function(){},setChipFocusAtIndex:function(){},setChipSelectedAtIndex:function(){},startChipAnimationAtIndex:function(){}}},enumerable:!1,configurable:!0}),i.prototype.handleChipAnimation=function(e){var t=e.detail,r=t.chipID,n=t.animation,o=t.isComplete,h=t.addedAnnouncement,s=t.removedAnnouncement,c=this.adapter.getChipIndexById(r);if(n===p.MDCChipAnimation.EXIT&&o){s&&this.adapter.announceMessage(s),this.removeAfterAnimation(c,r);return}if(n===p.MDCChipAnimation.ENTER&&o&&h){this.adapter.announceMessage(h);return}},i.prototype.handleChipInteraction=function(e){var t=e.detail,r=t.source,n=t.chipID,o=t.isSelectable,h=t.isSelected,s=t.shouldRemove,c=this.adapter.getChipIndexById(n);if(s){this.removeChip(c);return}this.focusChip(c,r,p.MDCChipActionFocusBehavior.FOCUSABLE),this.adapter.emitEvent(v.INTERACTION,{chipIndex:c,chipID:n}),o&&this.setSelection(c,r,!h)},i.prototype.handleChipNavigation=function(e){var t=e.detail,r=t.chipID,n=t.key,o=t.isRTL,h=t.source,s=this.adapter.getChipIndexById(r),c=n===p.KEY.ARROW_RIGHT&&!o||n===p.KEY.ARROW_LEFT&&o;if(c){this.focusNextChipFrom(s+1);return}var u=n===p.KEY.ARROW_LEFT&&!o||n===p.KEY.ARROW_RIGHT&&o;if(u){this.focusPrevChipFrom(s-1);return}if(n===p.KEY.ARROW_DOWN){this.focusNextChipFrom(s+1,h);return}if(n===p.KEY.ARROW_UP){this.focusPrevChipFrom(s-1,h);return}if(n===p.KEY.HOME){this.focusNextChipFrom(0,h);return}if(n===p.KEY.END){this.focusPrevChipFrom(this.adapter.getChipCount()-1,h);return}},i.prototype.getSelectedChipIndexes=function(){for(var e,t,r=new Set,n=this.adapter.getChipCount(),o=0;o<n;o++){var h=this.adapter.getChipActionsAtIndex(o);try{for(var s=(e=void 0,d.__values(h)),c=s.next();!c.done;c=s.next()){var u=c.value;this.adapter.isChipSelectedAtIndex(o,u)&&r.add(o)}}catch(l){e={error:l}}finally{try{c&&!c.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}}return r},i.prototype.setChipSelected=function(e,t,r){this.adapter.isChipSelectableAtIndex(e,t)&&this.setSelection(e,t,r)},i.prototype.isChipSelected=function(e,t){return this.adapter.isChipSelectedAtIndex(e,t)},i.prototype.removeChip=function(e){e>=this.adapter.getChipCount()||e<0||(this.adapter.startChipAnimationAtIndex(e,p.MDCChipAnimation.EXIT),this.adapter.emitEvent(v.REMOVAL,{chipID:this.adapter.getChipIdAtIndex(e),chipIndex:e,isComplete:!1}))},i.prototype.addChip=function(e){e>=this.adapter.getChipCount()||e<0||this.adapter.startChipAnimationAtIndex(e,p.MDCChipAnimation.ENTER)},i.prototype.focusNextChipFrom=function(e,t){for(var r=this.adapter.getChipCount(),n=e;n<r;n++){var o=this.getFocusableAction(n,C.INCREMENT,t);if(o){this.focusChip(n,o,p.MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);return}}},i.prototype.focusPrevChipFrom=function(e,t){for(var r=e;r>-1;r--){var n=this.getFocusableAction(r,C.DECREMENT,t);if(n){this.focusChip(r,n,p.MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);return}}},i.prototype.getFocusableAction=function(e,t,r){var n=this.adapter.getChipActionsAtIndex(e);return t===C.DECREMENT&&n.reverse(),r?this.getMatchingFocusableAction(e,n,r):this.getFirstFocusableAction(e,n)},i.prototype.getFirstFocusableAction=function(e,t){var r,n;try{for(var o=d.__values(t),h=o.next();!h.done;h=o.next()){var s=h.value;if(this.adapter.isChipFocusableAtIndex(e,s))return s}}catch(c){r={error:c}}finally{try{h&&!h.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null},i.prototype.getMatchingFocusableAction=function(e,t,r){var n,o,h=null;try{for(var s=d.__values(t),c=s.next();!c.done;c=s.next()){var u=c.value;if(this.adapter.isChipFocusableAtIndex(e,u)&&(h=u),h===r)return h}}catch(l){n={error:l}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return h},i.prototype.focusChip=function(e,t,r){var n,o;this.adapter.setChipFocusAtIndex(e,t,r);for(var h=this.adapter.getChipCount(),s=0;s<h;s++){var c=this.adapter.getChipActionsAtIndex(s);try{for(var u=(n=void 0,d.__values(c)),l=u.next();!l.done;l=u.next()){var A=l.value;A===t&&s===e||this.adapter.setChipFocusAtIndex(s,A,p.MDCChipActionFocusBehavior.NOT_FOCUSABLE)}}catch(E){n={error:E}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}}},i.prototype.supportsMultiSelect=function(){return this.adapter.getAttribute(x.ARIA_MULTISELECTABLE)==="true"},i.prototype.setSelection=function(e,t,r){var n,o;if(this.adapter.setChipSelectedAtIndex(e,t,r),this.adapter.emitEvent(v.SELECTION,{chipID:this.adapter.getChipIdAtIndex(e),chipIndex:e,isSelected:r}),!this.supportsMultiSelect())for(var h=this.adapter.getChipCount(),s=0;s<h;s++){var c=this.adapter.getChipActionsAtIndex(s);try{for(var u=(n=void 0,d.__values(c)),l=u.next();!l.done;l=u.next()){var A=l.value;A===t&&s===e||this.adapter.setChipSelectedAtIndex(s,A,!1)}}catch(E){n={error:E}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}}},i.prototype.removeAfterAnimation=function(e,t){this.adapter.removeChipAtIndex(e),this.adapter.emitEvent(v.REMOVAL,{chipIndex:e,isComplete:!0,chipID:t});var r=this.adapter.getChipCount();r<=0||this.focusNearestFocusableAction(e)},i.prototype.focusNearestFocusableAction=function(e){for(var t=this.adapter.getChipCount(),r=e,n=e;r>-1||n<t;){var o=this.getNearestFocusableAction(r,n,p.MDCChipActionType.TRAILING);if(o){this.focusChip(o.index,o.action,p.MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);return}r--,n++}},i.prototype.getNearestFocusableAction=function(e,t,r){var n=this.getFocusableAction(e,C.DECREMENT,r);if(n)return{index:e,action:n};if(t===e)return null;var o=this.getFocusableAction(t,C.INCREMENT,r);return o?{index:t,action:o}:null},i}(p.MDCFoundation);/**
|
44
|
+
* @license
|
45
|
+
* Copyright 2020 Google Inc.
|
46
|
+
*
|
47
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
48
|
+
* of this software and associated documentation files (the "Software"), to deal
|
49
|
+
* in the Software without restriction, including without limitation the rights
|
50
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
51
|
+
* copies of the Software, and to permit persons to whom the Software is
|
52
|
+
* furnished to do so, subject to the following conditions:
|
53
|
+
*
|
54
|
+
* The above copyright notice and this permission notice shall be included in
|
55
|
+
* all copies or substantial portions of the Software.
|
56
|
+
*
|
57
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
58
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
59
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
60
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
61
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
62
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
63
|
+
* THE SOFTWARE.
|
64
|
+
*/var y;(function(a){a.POLITE="polite",a.ASSERTIVE="assertive"})(y||(y={}));var N="data-mdc-dom-announce";function R(a,i){M.getInstance().say(a,i)}var M=function(){function a(){this.liveRegions=new Map}return a.getInstance=function(){return a.instance||(a.instance=new a),a.instance},a.prototype.say=function(i,e){var t,r,n=(t=e==null?void 0:e.priority)!==null&&t!==void 0?t:y.POLITE,o=(r=e==null?void 0:e.ownerDocument)!==null&&r!==void 0?r:document,h=this.getLiveRegion(n,o);h.textContent="",setTimeout(function(){h.textContent=i,o.addEventListener("click",s)},1);function s(){h.textContent="",o.removeEventListener("click",s)}},a.prototype.getLiveRegion=function(i,e){var t=this.liveRegions.get(e);t||(t=new Map,this.liveRegions.set(e,t));var r=t.get(i);if(r&&e.body.contains(r))return r;var n=this.createLiveRegion(i,e);return t.set(i,n),n},a.prototype.createLiveRegion=function(i,e){var t=e.createElement("div");return t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.height="1px",t.style.overflow="hidden",t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live",i),t.setAttribute(N,"true"),e.body.appendChild(t),t},a}(),D=Object.defineProperty,T=Object.getOwnPropertyDescriptor,I=(a,i,e,t)=>{for(var r=t>1?void 0:t?T(i,e):i,n=a.length-1,o;n>=0;n--)(o=a[n])&&(r=(t?o(i,e,r):o(r))||r);return t&&r&&D(i,e,r),r};class f extends m.s{constructor(){super(...arguments),this.selectable=!1,this.multi=!1,this.label="",this.activeIndex=0,this._previousActiveIndex=-1,this.chips=[]}render(){return m.x`<span
|
65
|
+
class="mdc-evolution-chip-set"
|
66
|
+
role="${this.selectable||this.multi?"listbox":"grid"}"
|
67
|
+
aria-label="${this.label}"
|
68
|
+
aria-multiselectable="${this.multi}"
|
69
|
+
>
|
70
|
+
<span class="mdc-evolution-chip-set__chips" role="presentation">
|
71
|
+
<slot></slot>
|
72
|
+
</span>
|
73
|
+
</span>`}async updated(i){super.updated(i),await this.updateComplete,this.activeIndex!=this._previousActiveIndex&&this.mdcFoundation.setChipSelected(this.activeIndex,p.MDCChipActionType.PRIMARY,!0)}firstUpdated(i){var r;super.firstUpdated(i);const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=(e==null?void 0:e.assignedElements().filter(n=>n instanceof p.CovalentChip))??[];for(let n=0;n<t.length;n++){const o=t[n];this.chips.push(o)}this.mdcFoundation!==void 0&&this.mdcFoundation.destroy(),this.mdcFoundation=new S(this.createAdapter()),this.mdcFoundation.init()}connectedCallback(){super.connectedCallback(),this.addEventListener(p.MDCChipEvents.ANIMATION,this._handleChipAnimation),this.addEventListener(p.MDCChipEvents.INTERACTION,this._handleChipInteraction),this.addEventListener(p.MDCChipEvents.NAVIGATION,this._handleChipNavigation)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(p.MDCChipEvents.ANIMATION,this._handleChipAnimation),this.removeEventListener(p.MDCChipEvents.INTERACTION,this._handleChipInteraction),this.removeEventListener(p.MDCChipEvents.NAVIGATION,this._handleChipNavigation)}createAdapter(){return{announceMessage:R,emitEvent:(i,e)=>this.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:e})),getAttribute:i=>this.mdcRoot.getAttribute(i),getChipActionsAtIndex:i=>this.chips[i].getActions(),getChipCount:()=>this.chips.length,getChipIdAtIndex:i=>this.chips[i].getElementID(),getChipIndexById:i=>this.chips.findIndex(e=>e.getElementID()===i),isChipFocusableAtIndex:(i,e)=>this.chips[i].isActionFocusable(e),isChipSelectableAtIndex:(i,e)=>this.chips[i].isActionSelectable(e),isChipSelectedAtIndex:(i,e)=>this.chips[i].isActionSelected(e),removeChipAtIndex:i=>this.chips[i].remove(),setChipFocusAtIndex:(i,e,t)=>this.chips[i].setActionFocus(e,t),setChipSelectedAtIndex:(i,e,t)=>this.chips[i].setActionSelected(e,t),startChipAnimationAtIndex:(i,e)=>this.chips[i].startAnimation(e)}}_handleChipAnimation(i){this.mdcFoundation.handleChipAnimation(i)}_handleChipInteraction(i){this.mdcFoundation.handleChipInteraction(i)}_handleChipNavigation(i){this.mdcFoundation.handleChipNavigation(i)}}I([F.i(".mdc-evolution-chip-set")],f.prototype,"mdcRoot",2);I([g.n({type:Boolean,reflect:!0})],f.prototype,"selectable",2);I([g.n({type:Boolean,reflect:!0})],f.prototype,"multi",2);I([g.n()],f.prototype,"label",2);I([g.n({type:Number})],f.prototype,"activeIndex",2);const O=`.mdc-evolution-chip-set{display:flex}.mdc-evolution-chip-set:focus{outline:none}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mdc-evolution-chip-set--overflow .mdc-evolution-chip-set__chips{flex-flow:nowrap}.mdc-evolution-chip-set .mdc-evolution-chip-set__chips{margin-left:-8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip-set__chips,.mdc-evolution-chip-set .mdc-evolution-chip-set__chips[dir=rtl]{margin-left:0;margin-right:-8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-left:8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip,.mdc-evolution-chip-set .mdc-evolution-chip[dir=rtl]{margin-left:0;margin-right:8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-top:4px;margin-bottom:4px}::slotted(cv-chip){margin:4px 0 4px 8px}[dir=rtl] ::slotted(cv-chip),::slotted(cv-chip[dir=rtl]){margin-left:0;margin-right:8px}
|
74
|
+
`;var L=Object.defineProperty,_=Object.getOwnPropertyDescriptor,w=(a,i,e,t)=>{for(var r=t>1?void 0:t?_(i,e):i,n=a.length-1,o;n>=0;n--)(o=a[n])&&(r=(t?o(i,e,r):o(r))||r);return t&&r&&L(i,e,r),r};exports.CovalentChipSet=class extends f{};exports.CovalentChipSet.styles=[m.i`
|
75
|
+
${m.r(O)}
|
76
|
+
`];exports.CovalentChipSet=w([m.e("cv-chip-set")],exports.CovalentChipSet);const B=exports.CovalentChipSet;exports.default=B;
|
package/chip-set.mjs
ADDED
@@ -0,0 +1,532 @@
|
|
1
|
+
import { s as M, x as D, i as O, r as L, e as _ } from "./query-assigned-elements-4a39219d.mjs";
|
2
|
+
import { M as E, a as m, K as l, b as T, c as w, C as P, d as v } from "./chip-13877bb8.mjs";
|
3
|
+
import { _ as B, a as F, c as I } from "./tslib.es6-226581a4.mjs";
|
4
|
+
import { n as y } from "./property-9b6ea53b.mjs";
|
5
|
+
import { i as U } from "./query-d843aa92.mjs";
|
6
|
+
import "./utils-2932417c.mjs";
|
7
|
+
import "./class-map-4b94b017.mjs";
|
8
|
+
import "./_commonjsHelpers-de2741aa.mjs";
|
9
|
+
/**
|
10
|
+
* @license
|
11
|
+
* Copyright 2016 Google Inc.
|
12
|
+
*
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
17
|
+
* copies of the Software, and to permit persons to whom the Software is
|
18
|
+
* furnished to do so, subject to the following conditions:
|
19
|
+
*
|
20
|
+
* The above copyright notice and this permission notice shall be included in
|
21
|
+
* all copies or substantial portions of the Software.
|
22
|
+
*
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
26
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
27
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
29
|
+
* THE SOFTWARE.
|
30
|
+
*/
|
31
|
+
var N;
|
32
|
+
(function(a) {
|
33
|
+
a.ARIA_MULTISELECTABLE = "aria-multiselectable";
|
34
|
+
})(N || (N = {}));
|
35
|
+
var S;
|
36
|
+
(function(a) {
|
37
|
+
a.CHIP = "mdc-evolution-chip";
|
38
|
+
})(S || (S = {}));
|
39
|
+
var f;
|
40
|
+
(function(a) {
|
41
|
+
a.INTERACTION = "MDCChipSet:interaction", a.REMOVAL = "MDCChipSet:removal", a.SELECTION = "MDCChipSet:selection";
|
42
|
+
})(f || (f = {}));
|
43
|
+
/**
|
44
|
+
* @license
|
45
|
+
* Copyright 2020 Google Inc.
|
46
|
+
*
|
47
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
48
|
+
* of this software and associated documentation files (the "Software"), to deal
|
49
|
+
* in the Software without restriction, including without limitation the rights
|
50
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
51
|
+
* copies of the Software, and to permit persons to whom the Software is
|
52
|
+
* furnished to do so, subject to the following conditions:
|
53
|
+
*
|
54
|
+
* The above copyright notice and this permission notice shall be included in
|
55
|
+
* all copies or substantial portions of the Software.
|
56
|
+
*
|
57
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
58
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
59
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
60
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
61
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
62
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
63
|
+
* THE SOFTWARE.
|
64
|
+
*/
|
65
|
+
var d;
|
66
|
+
(function(a) {
|
67
|
+
a[a.INCREMENT = 0] = "INCREMENT", a[a.DECREMENT = 1] = "DECREMENT";
|
68
|
+
})(d || (d = {}));
|
69
|
+
var $ = (
|
70
|
+
/** @class */
|
71
|
+
function(a) {
|
72
|
+
B(i, a);
|
73
|
+
function i(t) {
|
74
|
+
return a.call(this, F(F({}, i.defaultAdapter), t)) || this;
|
75
|
+
}
|
76
|
+
return Object.defineProperty(i, "defaultAdapter", {
|
77
|
+
get: function() {
|
78
|
+
return {
|
79
|
+
announceMessage: function() {
|
80
|
+
},
|
81
|
+
emitEvent: function() {
|
82
|
+
},
|
83
|
+
getAttribute: function() {
|
84
|
+
return null;
|
85
|
+
},
|
86
|
+
getChipActionsAtIndex: function() {
|
87
|
+
return [];
|
88
|
+
},
|
89
|
+
getChipCount: function() {
|
90
|
+
return 0;
|
91
|
+
},
|
92
|
+
getChipIdAtIndex: function() {
|
93
|
+
return "";
|
94
|
+
},
|
95
|
+
getChipIndexById: function() {
|
96
|
+
return 0;
|
97
|
+
},
|
98
|
+
isChipFocusableAtIndex: function() {
|
99
|
+
return !1;
|
100
|
+
},
|
101
|
+
isChipSelectableAtIndex: function() {
|
102
|
+
return !1;
|
103
|
+
},
|
104
|
+
isChipSelectedAtIndex: function() {
|
105
|
+
return !1;
|
106
|
+
},
|
107
|
+
removeChipAtIndex: function() {
|
108
|
+
},
|
109
|
+
setChipFocusAtIndex: function() {
|
110
|
+
},
|
111
|
+
setChipSelectedAtIndex: function() {
|
112
|
+
},
|
113
|
+
startChipAnimationAtIndex: function() {
|
114
|
+
}
|
115
|
+
};
|
116
|
+
},
|
117
|
+
enumerable: !1,
|
118
|
+
configurable: !0
|
119
|
+
}), i.prototype.handleChipAnimation = function(t) {
|
120
|
+
var e = t.detail, r = e.chipID, n = e.animation, o = e.isComplete, h = e.addedAnnouncement, s = e.removedAnnouncement, p = this.adapter.getChipIndexById(r);
|
121
|
+
if (n === E.EXIT && o) {
|
122
|
+
s && this.adapter.announceMessage(s), this.removeAfterAnimation(p, r);
|
123
|
+
return;
|
124
|
+
}
|
125
|
+
if (n === E.ENTER && o && h) {
|
126
|
+
this.adapter.announceMessage(h);
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
}, i.prototype.handleChipInteraction = function(t) {
|
130
|
+
var e = t.detail, r = e.source, n = e.chipID, o = e.isSelectable, h = e.isSelected, s = e.shouldRemove, p = this.adapter.getChipIndexById(n);
|
131
|
+
if (s) {
|
132
|
+
this.removeChip(p);
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
this.focusChip(p, r, m.FOCUSABLE), this.adapter.emitEvent(f.INTERACTION, {
|
136
|
+
chipIndex: p,
|
137
|
+
chipID: n
|
138
|
+
}), o && this.setSelection(p, r, !h);
|
139
|
+
}, i.prototype.handleChipNavigation = function(t) {
|
140
|
+
var e = t.detail, r = e.chipID, n = e.key, o = e.isRTL, h = e.source, s = this.adapter.getChipIndexById(r), p = n === l.ARROW_RIGHT && !o || n === l.ARROW_LEFT && o;
|
141
|
+
if (p) {
|
142
|
+
this.focusNextChipFrom(s + 1);
|
143
|
+
return;
|
144
|
+
}
|
145
|
+
var c = n === l.ARROW_LEFT && !o || n === l.ARROW_RIGHT && o;
|
146
|
+
if (c) {
|
147
|
+
this.focusPrevChipFrom(s - 1);
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
if (n === l.ARROW_DOWN) {
|
151
|
+
this.focusNextChipFrom(s + 1, h);
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
if (n === l.ARROW_UP) {
|
155
|
+
this.focusPrevChipFrom(s - 1, h);
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
if (n === l.HOME) {
|
159
|
+
this.focusNextChipFrom(0, h);
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
if (n === l.END) {
|
163
|
+
this.focusPrevChipFrom(this.adapter.getChipCount() - 1, h);
|
164
|
+
return;
|
165
|
+
}
|
166
|
+
}, i.prototype.getSelectedChipIndexes = function() {
|
167
|
+
for (var t, e, r = /* @__PURE__ */ new Set(), n = this.adapter.getChipCount(), o = 0; o < n; o++) {
|
168
|
+
var h = this.adapter.getChipActionsAtIndex(o);
|
169
|
+
try {
|
170
|
+
for (var s = (t = void 0, I(h)), p = s.next(); !p.done; p = s.next()) {
|
171
|
+
var c = p.value;
|
172
|
+
this.adapter.isChipSelectedAtIndex(o, c) && r.add(o);
|
173
|
+
}
|
174
|
+
} catch (u) {
|
175
|
+
t = { error: u };
|
176
|
+
} finally {
|
177
|
+
try {
|
178
|
+
p && !p.done && (e = s.return) && e.call(s);
|
179
|
+
} finally {
|
180
|
+
if (t)
|
181
|
+
throw t.error;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
return r;
|
186
|
+
}, i.prototype.setChipSelected = function(t, e, r) {
|
187
|
+
this.adapter.isChipSelectableAtIndex(t, e) && this.setSelection(t, e, r);
|
188
|
+
}, i.prototype.isChipSelected = function(t, e) {
|
189
|
+
return this.adapter.isChipSelectedAtIndex(t, e);
|
190
|
+
}, i.prototype.removeChip = function(t) {
|
191
|
+
t >= this.adapter.getChipCount() || t < 0 || (this.adapter.startChipAnimationAtIndex(t, E.EXIT), this.adapter.emitEvent(f.REMOVAL, {
|
192
|
+
chipID: this.adapter.getChipIdAtIndex(t),
|
193
|
+
chipIndex: t,
|
194
|
+
isComplete: !1
|
195
|
+
}));
|
196
|
+
}, i.prototype.addChip = function(t) {
|
197
|
+
t >= this.adapter.getChipCount() || t < 0 || this.adapter.startChipAnimationAtIndex(t, E.ENTER);
|
198
|
+
}, i.prototype.focusNextChipFrom = function(t, e) {
|
199
|
+
for (var r = this.adapter.getChipCount(), n = t; n < r; n++) {
|
200
|
+
var o = this.getFocusableAction(n, d.INCREMENT, e);
|
201
|
+
if (o) {
|
202
|
+
this.focusChip(n, o, m.FOCUSABLE_AND_FOCUSED);
|
203
|
+
return;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
}, i.prototype.focusPrevChipFrom = function(t, e) {
|
207
|
+
for (var r = t; r > -1; r--) {
|
208
|
+
var n = this.getFocusableAction(r, d.DECREMENT, e);
|
209
|
+
if (n) {
|
210
|
+
this.focusChip(r, n, m.FOCUSABLE_AND_FOCUSED);
|
211
|
+
return;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}, i.prototype.getFocusableAction = function(t, e, r) {
|
215
|
+
var n = this.adapter.getChipActionsAtIndex(t);
|
216
|
+
return e === d.DECREMENT && n.reverse(), r ? this.getMatchingFocusableAction(t, n, r) : this.getFirstFocusableAction(t, n);
|
217
|
+
}, i.prototype.getFirstFocusableAction = function(t, e) {
|
218
|
+
var r, n;
|
219
|
+
try {
|
220
|
+
for (var o = I(e), h = o.next(); !h.done; h = o.next()) {
|
221
|
+
var s = h.value;
|
222
|
+
if (this.adapter.isChipFocusableAtIndex(t, s))
|
223
|
+
return s;
|
224
|
+
}
|
225
|
+
} catch (p) {
|
226
|
+
r = { error: p };
|
227
|
+
} finally {
|
228
|
+
try {
|
229
|
+
h && !h.done && (n = o.return) && n.call(o);
|
230
|
+
} finally {
|
231
|
+
if (r)
|
232
|
+
throw r.error;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
return null;
|
236
|
+
}, i.prototype.getMatchingFocusableAction = function(t, e, r) {
|
237
|
+
var n, o, h = null;
|
238
|
+
try {
|
239
|
+
for (var s = I(e), p = s.next(); !p.done; p = s.next()) {
|
240
|
+
var c = p.value;
|
241
|
+
if (this.adapter.isChipFocusableAtIndex(t, c) && (h = c), h === r)
|
242
|
+
return h;
|
243
|
+
}
|
244
|
+
} catch (u) {
|
245
|
+
n = { error: u };
|
246
|
+
} finally {
|
247
|
+
try {
|
248
|
+
p && !p.done && (o = s.return) && o.call(s);
|
249
|
+
} finally {
|
250
|
+
if (n)
|
251
|
+
throw n.error;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
return h;
|
255
|
+
}, i.prototype.focusChip = function(t, e, r) {
|
256
|
+
var n, o;
|
257
|
+
this.adapter.setChipFocusAtIndex(t, e, r);
|
258
|
+
for (var h = this.adapter.getChipCount(), s = 0; s < h; s++) {
|
259
|
+
var p = this.adapter.getChipActionsAtIndex(s);
|
260
|
+
try {
|
261
|
+
for (var c = (n = void 0, I(p)), u = c.next(); !u.done; u = c.next()) {
|
262
|
+
var A = u.value;
|
263
|
+
A === e && s === t || this.adapter.setChipFocusAtIndex(s, A, m.NOT_FOCUSABLE);
|
264
|
+
}
|
265
|
+
} catch (b) {
|
266
|
+
n = { error: b };
|
267
|
+
} finally {
|
268
|
+
try {
|
269
|
+
u && !u.done && (o = c.return) && o.call(c);
|
270
|
+
} finally {
|
271
|
+
if (n)
|
272
|
+
throw n.error;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
}
|
276
|
+
}, i.prototype.supportsMultiSelect = function() {
|
277
|
+
return this.adapter.getAttribute(N.ARIA_MULTISELECTABLE) === "true";
|
278
|
+
}, i.prototype.setSelection = function(t, e, r) {
|
279
|
+
var n, o;
|
280
|
+
if (this.adapter.setChipSelectedAtIndex(t, e, r), this.adapter.emitEvent(f.SELECTION, {
|
281
|
+
chipID: this.adapter.getChipIdAtIndex(t),
|
282
|
+
chipIndex: t,
|
283
|
+
isSelected: r
|
284
|
+
}), !this.supportsMultiSelect())
|
285
|
+
for (var h = this.adapter.getChipCount(), s = 0; s < h; s++) {
|
286
|
+
var p = this.adapter.getChipActionsAtIndex(s);
|
287
|
+
try {
|
288
|
+
for (var c = (n = void 0, I(p)), u = c.next(); !u.done; u = c.next()) {
|
289
|
+
var A = u.value;
|
290
|
+
A === e && s === t || this.adapter.setChipSelectedAtIndex(s, A, !1);
|
291
|
+
}
|
292
|
+
} catch (b) {
|
293
|
+
n = { error: b };
|
294
|
+
} finally {
|
295
|
+
try {
|
296
|
+
u && !u.done && (o = c.return) && o.call(c);
|
297
|
+
} finally {
|
298
|
+
if (n)
|
299
|
+
throw n.error;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
}, i.prototype.removeAfterAnimation = function(t, e) {
|
304
|
+
this.adapter.removeChipAtIndex(t), this.adapter.emitEvent(f.REMOVAL, {
|
305
|
+
chipIndex: t,
|
306
|
+
isComplete: !0,
|
307
|
+
chipID: e
|
308
|
+
});
|
309
|
+
var r = this.adapter.getChipCount();
|
310
|
+
r <= 0 || this.focusNearestFocusableAction(t);
|
311
|
+
}, i.prototype.focusNearestFocusableAction = function(t) {
|
312
|
+
for (var e = this.adapter.getChipCount(), r = t, n = t; r > -1 || n < e; ) {
|
313
|
+
var o = this.getNearestFocusableAction(r, n, T.TRAILING);
|
314
|
+
if (o) {
|
315
|
+
this.focusChip(o.index, o.action, m.FOCUSABLE_AND_FOCUSED);
|
316
|
+
return;
|
317
|
+
}
|
318
|
+
r--, n++;
|
319
|
+
}
|
320
|
+
}, i.prototype.getNearestFocusableAction = function(t, e, r) {
|
321
|
+
var n = this.getFocusableAction(t, d.DECREMENT, r);
|
322
|
+
if (n)
|
323
|
+
return {
|
324
|
+
index: t,
|
325
|
+
action: n
|
326
|
+
};
|
327
|
+
if (e === t)
|
328
|
+
return null;
|
329
|
+
var o = this.getFocusableAction(e, d.INCREMENT, r);
|
330
|
+
return o ? {
|
331
|
+
index: e,
|
332
|
+
action: o
|
333
|
+
} : null;
|
334
|
+
}, i;
|
335
|
+
}(w)
|
336
|
+
);
|
337
|
+
/**
|
338
|
+
* @license
|
339
|
+
* Copyright 2020 Google Inc.
|
340
|
+
*
|
341
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
342
|
+
* of this software and associated documentation files (the "Software"), to deal
|
343
|
+
* in the Software without restriction, including without limitation the rights
|
344
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
345
|
+
* copies of the Software, and to permit persons to whom the Software is
|
346
|
+
* furnished to do so, subject to the following conditions:
|
347
|
+
*
|
348
|
+
* The above copyright notice and this permission notice shall be included in
|
349
|
+
* all copies or substantial portions of the Software.
|
350
|
+
*
|
351
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
352
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
353
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
354
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
355
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
356
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
357
|
+
* THE SOFTWARE.
|
358
|
+
*/
|
359
|
+
var R;
|
360
|
+
(function(a) {
|
361
|
+
a.POLITE = "polite", a.ASSERTIVE = "assertive";
|
362
|
+
})(R || (R = {}));
|
363
|
+
var W = "data-mdc-dom-announce";
|
364
|
+
function V(a, i) {
|
365
|
+
j.getInstance().say(a, i);
|
366
|
+
}
|
367
|
+
var j = (
|
368
|
+
/** @class */
|
369
|
+
function() {
|
370
|
+
function a() {
|
371
|
+
this.liveRegions = /* @__PURE__ */ new Map();
|
372
|
+
}
|
373
|
+
return a.getInstance = function() {
|
374
|
+
return a.instance || (a.instance = new a()), a.instance;
|
375
|
+
}, a.prototype.say = function(i, t) {
|
376
|
+
var e, r, n = (e = t == null ? void 0 : t.priority) !== null && e !== void 0 ? e : R.POLITE, o = (r = t == null ? void 0 : t.ownerDocument) !== null && r !== void 0 ? r : document, h = this.getLiveRegion(n, o);
|
377
|
+
h.textContent = "", setTimeout(function() {
|
378
|
+
h.textContent = i, o.addEventListener("click", s);
|
379
|
+
}, 1);
|
380
|
+
function s() {
|
381
|
+
h.textContent = "", o.removeEventListener("click", s);
|
382
|
+
}
|
383
|
+
}, a.prototype.getLiveRegion = function(i, t) {
|
384
|
+
var e = this.liveRegions.get(t);
|
385
|
+
e || (e = /* @__PURE__ */ new Map(), this.liveRegions.set(t, e));
|
386
|
+
var r = e.get(i);
|
387
|
+
if (r && t.body.contains(r))
|
388
|
+
return r;
|
389
|
+
var n = this.createLiveRegion(i, t);
|
390
|
+
return e.set(i, n), n;
|
391
|
+
}, a.prototype.createLiveRegion = function(i, t) {
|
392
|
+
var e = t.createElement("div");
|
393
|
+
return e.style.position = "absolute", e.style.top = "-9999px", e.style.left = "-9999px", e.style.height = "1px", e.style.overflow = "hidden", e.setAttribute("aria-atomic", "true"), e.setAttribute("aria-live", i), e.setAttribute(W, "true"), t.body.appendChild(e), e;
|
394
|
+
}, a;
|
395
|
+
}()
|
396
|
+
), G = Object.defineProperty, H = Object.getOwnPropertyDescriptor, g = (a, i, t, e) => {
|
397
|
+
for (var r = e > 1 ? void 0 : e ? H(i, t) : i, n = a.length - 1, o; n >= 0; n--)
|
398
|
+
(o = a[n]) && (r = (e ? o(i, t, r) : o(r)) || r);
|
399
|
+
return e && r && G(i, t, r), r;
|
400
|
+
};
|
401
|
+
class C extends M {
|
402
|
+
constructor() {
|
403
|
+
super(...arguments), this.selectable = !1, this.multi = !1, this.label = "", this.activeIndex = 0, this._previousActiveIndex = -1, this.chips = [];
|
404
|
+
}
|
405
|
+
render() {
|
406
|
+
return D`<span
|
407
|
+
class="mdc-evolution-chip-set"
|
408
|
+
role="${this.selectable || this.multi ? "listbox" : "grid"}"
|
409
|
+
aria-label="${this.label}"
|
410
|
+
aria-multiselectable="${this.multi}"
|
411
|
+
>
|
412
|
+
<span class="mdc-evolution-chip-set__chips" role="presentation">
|
413
|
+
<slot></slot>
|
414
|
+
</span>
|
415
|
+
</span>`;
|
416
|
+
}
|
417
|
+
async updated(i) {
|
418
|
+
super.updated(i), await this.updateComplete, this.activeIndex != this._previousActiveIndex && this.mdcFoundation.setChipSelected(
|
419
|
+
this.activeIndex,
|
420
|
+
T.PRIMARY,
|
421
|
+
!0
|
422
|
+
);
|
423
|
+
}
|
424
|
+
firstUpdated(i) {
|
425
|
+
var r;
|
426
|
+
super.firstUpdated(i);
|
427
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot"), e = (t == null ? void 0 : t.assignedElements().filter((n) => n instanceof P)) ?? [];
|
428
|
+
for (let n = 0; n < e.length; n++) {
|
429
|
+
const o = e[n];
|
430
|
+
this.chips.push(o);
|
431
|
+
}
|
432
|
+
this.mdcFoundation !== void 0 && this.mdcFoundation.destroy(), this.mdcFoundation = new $(this.createAdapter()), this.mdcFoundation.init();
|
433
|
+
}
|
434
|
+
connectedCallback() {
|
435
|
+
super.connectedCallback(), this.addEventListener(v.ANIMATION, this._handleChipAnimation), this.addEventListener(
|
436
|
+
v.INTERACTION,
|
437
|
+
this._handleChipInteraction
|
438
|
+
), this.addEventListener(v.NAVIGATION, this._handleChipNavigation);
|
439
|
+
}
|
440
|
+
disconnectedCallback() {
|
441
|
+
super.disconnectedCallback(), this.removeEventListener(
|
442
|
+
v.ANIMATION,
|
443
|
+
this._handleChipAnimation
|
444
|
+
), this.removeEventListener(
|
445
|
+
v.INTERACTION,
|
446
|
+
this._handleChipInteraction
|
447
|
+
), this.removeEventListener(
|
448
|
+
v.NAVIGATION,
|
449
|
+
this._handleChipNavigation
|
450
|
+
);
|
451
|
+
}
|
452
|
+
createAdapter() {
|
453
|
+
return {
|
454
|
+
/** Announces the message via an aria-live region */
|
455
|
+
announceMessage: V,
|
456
|
+
/** Emits the given event with the given detail. */
|
457
|
+
emitEvent: (i, t) => this.dispatchEvent(
|
458
|
+
new CustomEvent(i, { bubbles: !0, detail: t })
|
459
|
+
),
|
460
|
+
/** Returns the value for the given attribute, if it exists. */
|
461
|
+
getAttribute: (i) => this.mdcRoot.getAttribute(i),
|
462
|
+
/** Returns the actions provided by the child chip at the given index. */
|
463
|
+
getChipActionsAtIndex: (i) => this.chips[i].getActions(),
|
464
|
+
/** Returns the number of child chips. */
|
465
|
+
getChipCount: () => this.chips.length,
|
466
|
+
/** Returns the ID of the chip at the given index. */
|
467
|
+
getChipIdAtIndex: (i) => this.chips[i].getElementID(),
|
468
|
+
/** Returns the index of the child chip with the matching ID. */
|
469
|
+
getChipIndexById: (i) => this.chips.findIndex((t) => t.getElementID() === i),
|
470
|
+
/** Proxies to the MDCChip#isActionFocusable method. */
|
471
|
+
isChipFocusableAtIndex: (i, t) => this.chips[i].isActionFocusable(t),
|
472
|
+
/** Proxies to the MDCChip#isActionSelectable method. */
|
473
|
+
isChipSelectableAtIndex: (i, t) => this.chips[i].isActionSelectable(t),
|
474
|
+
/** Proxies to the MDCChip#isActionSelected method. */
|
475
|
+
isChipSelectedAtIndex: (i, t) => this.chips[i].isActionSelected(t),
|
476
|
+
/** Removes the chip at the given index. */
|
477
|
+
removeChipAtIndex: (i) => this.chips[i].remove(),
|
478
|
+
/** Proxies to the MDCChip#setActionFocus method. */
|
479
|
+
setChipFocusAtIndex: (i, t, e) => this.chips[i].setActionFocus(t, e),
|
480
|
+
/** Proxies to the MDCChip#setActionSelected method. */
|
481
|
+
setChipSelectedAtIndex: (i, t, e) => this.chips[i].setActionSelected(t, e),
|
482
|
+
/** Starts the chip animation at the given index. */
|
483
|
+
startChipAnimationAtIndex: (i, t) => this.chips[i].startAnimation(t)
|
484
|
+
};
|
485
|
+
}
|
486
|
+
_handleChipAnimation(i) {
|
487
|
+
this.mdcFoundation.handleChipAnimation(i);
|
488
|
+
}
|
489
|
+
_handleChipInteraction(i) {
|
490
|
+
this.mdcFoundation.handleChipInteraction(i);
|
491
|
+
}
|
492
|
+
_handleChipNavigation(i) {
|
493
|
+
this.mdcFoundation.handleChipNavigation(i);
|
494
|
+
}
|
495
|
+
}
|
496
|
+
g([
|
497
|
+
U(".mdc-evolution-chip-set")
|
498
|
+
], C.prototype, "mdcRoot", 2);
|
499
|
+
g([
|
500
|
+
y({ type: Boolean, reflect: !0 })
|
501
|
+
], C.prototype, "selectable", 2);
|
502
|
+
g([
|
503
|
+
y({ type: Boolean, reflect: !0 })
|
504
|
+
], C.prototype, "multi", 2);
|
505
|
+
g([
|
506
|
+
y()
|
507
|
+
], C.prototype, "label", 2);
|
508
|
+
g([
|
509
|
+
y({ type: Number })
|
510
|
+
], C.prototype, "activeIndex", 2);
|
511
|
+
const K = `.mdc-evolution-chip-set{display:flex}.mdc-evolution-chip-set:focus{outline:none}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mdc-evolution-chip-set--overflow .mdc-evolution-chip-set__chips{flex-flow:nowrap}.mdc-evolution-chip-set .mdc-evolution-chip-set__chips{margin-left:-8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip-set__chips,.mdc-evolution-chip-set .mdc-evolution-chip-set__chips[dir=rtl]{margin-left:0;margin-right:-8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-left:8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip,.mdc-evolution-chip-set .mdc-evolution-chip[dir=rtl]{margin-left:0;margin-right:8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-top:4px;margin-bottom:4px}::slotted(cv-chip){margin:4px 0 4px 8px}[dir=rtl] ::slotted(cv-chip),::slotted(cv-chip[dir=rtl]){margin-left:0;margin-right:8px}
|
512
|
+
`;
|
513
|
+
var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, q = (a, i, t, e) => {
|
514
|
+
for (var r = e > 1 ? void 0 : e ? Y(i, t) : i, n = a.length - 1, o; n >= 0; n--)
|
515
|
+
(o = a[n]) && (r = (e ? o(i, t, r) : o(r)) || r);
|
516
|
+
return e && r && X(i, t, r), r;
|
517
|
+
};
|
518
|
+
let x = class extends C {
|
519
|
+
};
|
520
|
+
x.styles = [
|
521
|
+
O`
|
522
|
+
${L(K)}
|
523
|
+
`
|
524
|
+
];
|
525
|
+
x = q([
|
526
|
+
_("cv-chip-set")
|
527
|
+
], x);
|
528
|
+
const nt = x;
|
529
|
+
export {
|
530
|
+
x as CovalentChipSet,
|
531
|
+
nt as default
|
532
|
+
};
|
package/chip.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./query-assigned-elements-f623705d.js");const e=require("./chip-3c12a33d.js");require("./utils-a8190a39.js");require("./tslib.es6-98719205.js");require("./property-57f6f6fe.js");require("./query-680f1868.js");require("./class-map-b5efe8da.js");require("./_commonjsHelpers-2367a3a2.js");Object.defineProperty(exports,"CovalentChip",{enumerable:!0,get:()=>e.CovalentChip});exports.default=e.CovalentChip$1;
|
package/chip.mjs
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import "./query-assigned-elements-4a39219d.mjs";
|
2
|
+
import { C as f, e as l } from "./chip-13877bb8.mjs";
|
3
|
+
import "./utils-2932417c.mjs";
|
4
|
+
import "./tslib.es6-226581a4.mjs";
|
5
|
+
import "./property-9b6ea53b.mjs";
|
6
|
+
import "./query-d843aa92.mjs";
|
7
|
+
import "./class-map-4b94b017.mjs";
|
8
|
+
import "./_commonjsHelpers-de2741aa.mjs";
|
9
|
+
export {
|
10
|
+
f as CovalentChip,
|
11
|
+
l as default
|
12
|
+
};
|
package/circular-progress.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { b as o } from "./tslib.es6-226581a4.mjs";
|
2
2
|
import { a as g } from "./aria-property-fa2717fe.mjs";
|
3
3
|
import { s as u, x as d, i as h, e as f } from "./query-assigned-elements-4a39219d.mjs";
|
4
4
|
import { n } from "./property-9b6ea53b.mjs";
|