@m3e/core 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +264 -249
- package/dist/index.js +36 -27
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +88 -92
- package/dist/index.min.js.map +1 -1
- package/dist/src/shared/mixins/Labelled.d.ts.map +1 -1
- package/dist/src/shared/primitives/SlideElement.d.ts +2 -3
- package/dist/src/shared/primitives/SlideElement.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -860,19 +860,19 @@ const t$2=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,
|
|
|
860
860
|
* Copyright 2019 Google LLC
|
|
861
861
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
862
862
|
*/
|
|
863
|
-
const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$
|
|
863
|
+
const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$3=t=>new n$3("string"==typeof t?t:t+"",void 0,s$1),S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$3(e)})(t):t;
|
|
864
864
|
|
|
865
865
|
/**
|
|
866
866
|
* @license
|
|
867
867
|
* Copyright 2017 Google LLC
|
|
868
868
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
869
|
-
*/const{is:i$1,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$2,getOwnPropertySymbols:o$
|
|
869
|
+
*/const{is:i$1,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$2,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$2(t),...o$3(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d$1("elementProperties")]=new Map,y[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y}),(a$1.reactiveElementVersions??=[]).push("2.1.1");
|
|
870
870
|
|
|
871
871
|
/**
|
|
872
872
|
* @license
|
|
873
873
|
* Copyright 2017 Google LLC
|
|
874
874
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
875
|
-
*/const o$
|
|
875
|
+
*/const o$2={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$1=(t=o$2,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
|
|
876
876
|
|
|
877
877
|
/**
|
|
878
878
|
* @license
|
|
@@ -887,12 +887,6 @@ const e$2=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"obj
|
|
|
887
887
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
888
888
|
*/function e$1(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$2(n,s,{get(){return o(this)}})}}
|
|
889
889
|
|
|
890
|
-
/**
|
|
891
|
-
* @license
|
|
892
|
-
* Copyright 2021 Google LLC
|
|
893
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
894
|
-
*/function o$2(o){return (e,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return e$2(e,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter((t=>t.matches(s)))}})}}
|
|
895
|
-
|
|
896
890
|
/**
|
|
897
891
|
* Determines whether a value is a `CheckedMixin`.
|
|
898
892
|
* @param {unknown} value The value to test.
|
|
@@ -1963,6 +1957,12 @@ function Labelled(base) {
|
|
|
1963
1957
|
for (const label of this.labels ?? []) {
|
|
1964
1958
|
label.style.userSelect = focusable ? "none" : "";
|
|
1965
1959
|
label.style.cursor = !disabled && focusable ? "pointer" : "";
|
|
1960
|
+
if (!disabled && focusable) {
|
|
1961
|
+
label.style.setProperty("-webkit-tap-highlight-color", "rgba(0, 0, 0, 0)");
|
|
1962
|
+
}
|
|
1963
|
+
else {
|
|
1964
|
+
label.style.removeProperty("-webkit-tap-highlight-color");
|
|
1965
|
+
}
|
|
1966
1966
|
label.style.color = disabled
|
|
1967
1967
|
? `color-mix(in srgb, ${DesignToken.color.onSurface} 38%, transparent)`
|
|
1968
1968
|
: invalid
|
|
@@ -4182,7 +4182,7 @@ M3eScrollContainerElement = __decorate([
|
|
|
4182
4182
|
t$2("m3e-scroll-container")
|
|
4183
4183
|
], M3eScrollContainerElement);
|
|
4184
4184
|
|
|
4185
|
-
var
|
|
4185
|
+
var _M3eSlideElement_instances, _M3eSlideElement_items, _M3eSlideElement_handleSlotChange, _M3eSlideElement_updateItems;
|
|
4186
4186
|
/**
|
|
4187
4187
|
* A carousel-like container used to horizontally cycle through slotted items.
|
|
4188
4188
|
*
|
|
@@ -4205,10 +4205,11 @@ var _M3eSlide_instances, _M3eSlide_updateItems;
|
|
|
4205
4205
|
*
|
|
4206
4206
|
* @cssprop --m3e-slide-animation-duration - The duration of transitions between slotted items.
|
|
4207
4207
|
*/
|
|
4208
|
-
let
|
|
4208
|
+
let M3eSlideElement = class M3eSlideElement extends LitElement {
|
|
4209
4209
|
constructor() {
|
|
4210
4210
|
super(...arguments);
|
|
4211
|
-
|
|
4211
|
+
_M3eSlideElement_instances.add(this);
|
|
4212
|
+
/** @private */ _M3eSlideElement_items.set(this, new Array());
|
|
4212
4213
|
/**
|
|
4213
4214
|
* The zero-based index of the visible item.
|
|
4214
4215
|
* @default null
|
|
@@ -4227,7 +4228,7 @@ let M3eSlide = class M3eSlide extends LitElement {
|
|
|
4227
4228
|
if (this.selectedIndex === null) {
|
|
4228
4229
|
this.classList.toggle("-no-animate", true);
|
|
4229
4230
|
}
|
|
4230
|
-
__classPrivateFieldGet(this,
|
|
4231
|
+
__classPrivateFieldGet(this, _M3eSlideElement_instances, "m", _M3eSlideElement_updateItems).call(this);
|
|
4231
4232
|
if (this.selectedIndex !== null && this.classList.contains("-no-animate")) {
|
|
4232
4233
|
requestAnimationFrame(() => {
|
|
4233
4234
|
if (this.selectedIndex !== null) {
|
|
@@ -4239,21 +4240,32 @@ let M3eSlide = class M3eSlide extends LitElement {
|
|
|
4239
4240
|
}
|
|
4240
4241
|
/** @inheritdoc */
|
|
4241
4242
|
render() {
|
|
4242
|
-
return html `<slot @slotchange="${__classPrivateFieldGet(this,
|
|
4243
|
+
return html `<slot @slotchange="${__classPrivateFieldGet(this, _M3eSlideElement_instances, "m", _M3eSlideElement_handleSlotChange)}"></slot>`;
|
|
4243
4244
|
}
|
|
4244
4245
|
};
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4246
|
+
_M3eSlideElement_items = new WeakMap();
|
|
4247
|
+
_M3eSlideElement_instances = new WeakSet();
|
|
4248
|
+
_M3eSlideElement_handleSlotChange = function _M3eSlideElement_handleSlotChange(e) {
|
|
4249
|
+
const items = [...e.target.assignedElements({ flatten: true })];
|
|
4250
|
+
for (const removed of __classPrivateFieldGet(this, _M3eSlideElement_items, "f").filter((x) => !items.includes(x))) {
|
|
4251
|
+
removed.classList.remove("-before");
|
|
4252
|
+
removed.classList.remove("-after");
|
|
4253
|
+
removed.removeAttribute("inert");
|
|
4254
|
+
}
|
|
4255
|
+
__classPrivateFieldSet(this, _M3eSlideElement_items, items, "f");
|
|
4256
|
+
__classPrivateFieldGet(this, _M3eSlideElement_instances, "m", _M3eSlideElement_updateItems).call(this);
|
|
4257
|
+
};
|
|
4258
|
+
_M3eSlideElement_updateItems = function _M3eSlideElement_updateItems() {
|
|
4259
|
+
const selectedIndex = this.selectedIndex ?? __classPrivateFieldGet(this, _M3eSlideElement_items, "f").length;
|
|
4260
|
+
for (let i = 0; i < __classPrivateFieldGet(this, _M3eSlideElement_items, "f").length; i++) {
|
|
4261
|
+
const item = __classPrivateFieldGet(this, _M3eSlideElement_items, "f")[i];
|
|
4250
4262
|
item.classList.toggle("-before", i < selectedIndex);
|
|
4251
4263
|
item.classList.toggle("-after", i > selectedIndex);
|
|
4252
4264
|
item.toggleAttribute("inert", i !== selectedIndex);
|
|
4253
4265
|
}
|
|
4254
4266
|
};
|
|
4255
4267
|
/** The styles of the element. */
|
|
4256
|
-
|
|
4268
|
+
M3eSlideElement.styles = css `
|
|
4257
4269
|
:host {
|
|
4258
4270
|
display: flex;
|
|
4259
4271
|
position: relative;
|
|
@@ -4290,15 +4302,12 @@ M3eSlide.styles = css `
|
|
|
4290
4302
|
}
|
|
4291
4303
|
}
|
|
4292
4304
|
`;
|
|
4293
|
-
__decorate([
|
|
4294
|
-
o$2({ flatten: true })
|
|
4295
|
-
], M3eSlide.prototype, "_items", void 0);
|
|
4296
4305
|
__decorate([
|
|
4297
4306
|
n$1({ attribute: "selected-index", type: Number, reflect: true })
|
|
4298
|
-
],
|
|
4299
|
-
|
|
4307
|
+
], M3eSlideElement.prototype, "selectedIndex", void 0);
|
|
4308
|
+
M3eSlideElement = __decorate([
|
|
4300
4309
|
t$2("m3e-slide")
|
|
4301
|
-
],
|
|
4310
|
+
], M3eSlideElement);
|
|
4302
4311
|
|
|
4303
4312
|
/**
|
|
4304
4313
|
* Component design tokens that control the `M3eStateLayerElement`.
|
|
@@ -4747,5 +4756,5 @@ M3eTextHighlightElement = M3eTextHighlightElement_1 = __decorate([
|
|
|
4747
4756
|
t$2("m3e-text-highlight")
|
|
4748
4757
|
], M3eTextHighlightElement);
|
|
4749
4758
|
|
|
4750
|
-
export { AttachInternals, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement,
|
|
4759
|
+
export { AttachInternals, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlideElement, M3eStateLayerElement, M3eTextHighlightElement, M3eTextOverflowElement, MutationController, PressedController, ReadOnly, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, Selected, Touched, Vertical, checkOrSelect, debounce, defaultValue, formValue, getTextContent, guid, hasAssignedNodes, hasKeys, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, renderPseudoLink, safeStyleMap, scrollIntoViewIfNeeded, updateLabels, validate };
|
|
4751
4760
|
//# sourceMappingURL=index.js.map
|