monobill-mintui 0.6.650 → 0.6.651
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/bin/component-dependencies.json +4 -1
- package/dist/components/chunks/ScrollFade-Br6QSd_-.js +1 -0
- package/dist/components/chunks/ScrollFade-DIKawLYD.js +82 -0
- package/dist/components/chunks/input-BhptfvVH.js +1 -0
- package/dist/components/chunks/{input-CYv5hraJ.js → input-CdsHKiuL.js} +14 -7
- package/dist/components/chunks/{popover-DB1OaYVe.js → popover-BRi53qYL.js} +54 -14
- package/dist/components/chunks/popover-PNIdAt8C.js +1 -0
- package/dist/components/chunks/table-odOvGji2.js +1 -0
- package/dist/components/chunks/{table-DRdsVUJL.js → table-ty0Sgdpv.js} +7 -6
- package/dist/components/date-picker/browser.js +2 -2
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +2 -2
- package/dist/components/input/browser.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/navigation/browser.js +1 -1
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/popover/Popover.d.ts.map +1 -1
- package/dist/components/popover/browser.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/resource-table/ResourceTable.d.ts +1 -0
- package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
- package/dist/components/resource-table/browser.js +22 -22
- package/dist/components/resource-table/index.cjs +2 -2
- package/dist/components/resource-table/index.js +22 -22
- package/dist/components/scroll-fade/ScrollFade.d.ts +15 -0
- package/dist/components/scroll-fade/ScrollFade.d.ts.map +1 -0
- package/dist/components/scroll-fade/browser.js +16 -0
- package/dist/components/scroll-fade/index.cjs +1 -0
- package/dist/components/scroll-fade/index.d.ts +6 -0
- package/dist/components/scroll-fade/index.d.ts.map +1 -0
- package/dist/components/scroll-fade/index.js +4 -0
- package/dist/components/search/browser.js +1 -1
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/select/NativeSelect.d.ts +38 -0
- package/dist/components/select/NativeSelect.d.ts.map +1 -0
- package/dist/components/select/Select.d.ts +36 -29
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/browser.js +313 -19
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.d.ts +3 -2
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +313 -19
- package/dist/components/side-navigation/SideNavigation.d.ts +1 -0
- package/dist/components/side-navigation/SideNavigation.d.ts.map +1 -1
- package/dist/components/side-navigation/browser.js +24 -23
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +24 -23
- package/dist/components/table/Table.d.ts +1 -0
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/browser.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/tags/browser.js +1 -1
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +1 -1
- package/dist/components/time-picker/browser.js +2 -2
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -2
- package/dist/components/tree/Tree.d.ts +2 -0
- package/dist/components/tree/Tree.d.ts.map +1 -1
- package/dist/components/tree/browser.js +14 -6
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +14 -6
- package/dist/index.cjs +4 -4
- package/dist/index.css +12 -8
- package/dist/index.d.ts +2 -1
- package/dist/index.js +605 -185
- package/dist/modal.css +1 -1
- package/dist/navigation-search.json +8 -1
- package/dist/navigation.css +1 -1
- package/dist/off-canvas.css +1 -1
- package/dist/popover.css +1 -1
- package/dist/scroll-fade.css +3 -0
- package/dist/select.css +1 -1
- package/dist/side-navigation.css +1 -1
- package/dist/theme.css +2 -2
- package/package.json +10 -1
- package/dist/components/chunks/caret-up-DzrY-bTy.js +0 -1
- package/dist/components/chunks/caret-up-ZK3v_oWQ.js +0 -9
- package/dist/components/chunks/input-Du8C2LW8.js +0 -1
- package/dist/components/chunks/popover-CNZ5u-MA.js +0 -1
- package/dist/components/chunks/table-2-0iNQJy.js +0 -1
- /package/dist/components/chunks/{caret-down-DJvCrCjc.js → caret-down-BU-Ee_JS.js} +0 -0
- /package/dist/components/chunks/{caret-down-DGeJj0xv.js → caret-down-DRrCYUv0.js} +0 -0
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"popover",
|
|
93
93
|
"stack"
|
|
94
94
|
],
|
|
95
|
+
"scroll-fade": [],
|
|
95
96
|
"search": [
|
|
96
97
|
"icon",
|
|
97
98
|
"chip",
|
|
@@ -100,7 +101,9 @@
|
|
|
100
101
|
"spinner"
|
|
101
102
|
],
|
|
102
103
|
"select": [
|
|
103
|
-
"icon"
|
|
104
|
+
"icon",
|
|
105
|
+
"popover",
|
|
106
|
+
"stack"
|
|
104
107
|
],
|
|
105
108
|
"side-navigation": [
|
|
106
109
|
"icon",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./register-element-tCL_F1YI.js`);function t(e,t=`vertical`,n=`1.5rem`){let r=null,i=null,a=0,o=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(()=>{let r=t===`vertical`||t===`both`,i=t===`horizontal`||t===`both`,a=r&&e.scrollTop>1,o=r&&e.scrollTop+e.clientHeight<e.scrollHeight-1,s=i&&e.scrollLeft>1,c=i&&e.scrollLeft+e.clientWidth<e.scrollWidth-1,l=getComputedStyle(e),u=Number.parseFloat(l.borderTopWidth)||0,d=Number.parseFloat(l.borderRightWidth)||0,f=Number.parseFloat(l.borderBottomWidth)||0,p=Number.parseFloat(l.borderLeftWidth)||0;e.dataset.mintScrollFadeTop=String(a),e.dataset.mintScrollFadeBottom=String(o),e.dataset.mintScrollFadeLeft=String(s),e.dataset.mintScrollFadeRight=String(c),e.style.setProperty(`--mint-scroll-fade-size`,n),e.style.setProperty(`--mint-scroll-fade-top-size`,a?n:`0px`),e.style.setProperty(`--mint-scroll-fade-bottom-size`,o?n:`0px`),e.style.setProperty(`--mint-scroll-fade-left-size`,s?n:`0px`),e.style.setProperty(`--mint-scroll-fade-right-size`,c?n:`0px`);let m=[];if(r){let e=[`#000 0`];a&&e.push(`transparent ${u}px`,`#000 calc(var(--mint-scroll-fade-top-size) + ${u}px)`),o?e.push(`#000 calc(100% - var(--mint-scroll-fade-bottom-size) - ${f}px)`,`transparent calc(100% - ${f}px)`,`#000 100%`):e.push(`#000 100%`),m.push(`linear-gradient(to bottom, ${e.join(`, `)})`)}if(i){let e=[`#000 0`];s&&e.push(`transparent ${p}px`,`#000 calc(var(--mint-scroll-fade-left-size) + ${p}px)`),c?e.push(`#000 calc(100% - var(--mint-scroll-fade-right-size) - ${d}px)`,`transparent calc(100% - ${d}px)`,`#000 100%`):e.push(`#000 100%`),m.push(`linear-gradient(to right, ${e.join(`, `)})`)}let h=a||o||s||c?m.join(`, `):`none`;e.style.maskImage=h,e.style.webkitMaskImage=h,e.style.maskClip=`border-box`,e.style.webkitMaskClip=`border`,m.length>1?(e.style.maskComposite=`intersect`,e.style.webkitMaskComposite=`source-in`):(e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`))})};return e.addEventListener(`scroll`,o,{passive:!0}),typeof ResizeObserver<`u`&&(r=new ResizeObserver(o),r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild)),typeof MutationObserver<`u`&&(i=new MutationObserver(o),i.observe(e,{childList:!0,subtree:!0,characterData:!0})),o(),()=>{e.removeEventListener(`scroll`,o),r?.disconnect(),i?.disconnect(),cancelAnimationFrame(a);for(let t of[`mintScrollFadeTop`,`mintScrollFadeBottom`,`mintScrollFadeLeft`,`mintScrollFadeRight`])delete e.dataset[t];e.style.maskImage=``,e.style.webkitMaskImage=``,e.style.maskClip=``,e.style.webkitMaskClip=``,e.style.removeProperty(`--mint-scroll-fade-size`),e.style.removeProperty(`--mint-scroll-fade-top-size`),e.style.removeProperty(`--mint-scroll-fade-bottom-size`),e.style.removeProperty(`--mint-scroll-fade-left-size`),e.style.removeProperty(`--mint-scroll-fade-right-size`),e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`)}}var n=class extends HTMLElement{constructor(...e){super(...e),this._disposeFade=null,this._target=null,this._contentObserver=null}static get observedAttributes(){return[`axis`,`fade-size`,`target`]}connectedCallback(){this._attachFade(),this._contentObserver=new MutationObserver(()=>this._attachFade()),this._contentObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){this._contentObserver?.disconnect(),this._contentObserver=null,this._disposeFade?.(),this._disposeFade=null,this._target=null,this.removeAttribute(`data-wraps-scrollport`)}attributeChangedCallback(){this.isConnected&&this._attachFade()}_attachFade(){let e=this.getAttribute(`target`),n=null;if(e)try{n=this.querySelector(e)}catch{n=null}let r=n||Array.from(this.querySelectorAll(`*`)).find(e=>{let t=getComputedStyle(e);return/(auto|scroll)/.test(`${t.overflowY} ${t.overflowX}`)})||this;if(r===this._target)return;this._disposeFade?.(),this._target=r,this.toggleAttribute(`data-wraps-scrollport`,r!==this);let i=this.getAttribute(`axis`)||`vertical`;this._disposeFade=t(r,[`vertical`,`horizontal`,`both`].includes(i)?i:`vertical`,this.getAttribute(`fade-size`)||`1.5rem`)}};customElements.get(`mint-scroll-fade`)||e.t(`mint-scroll-fade`,n),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { t as e } from "./register-element-BFYmIynH.js";
|
|
2
|
+
//#region src/components/scroll-fade/ScrollFade.ts
|
|
3
|
+
function t(e, t = "vertical", n = "1.5rem") {
|
|
4
|
+
let r = null, i = null, a = 0, o = () => {
|
|
5
|
+
cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
6
|
+
let r = t === "vertical" || t === "both", i = t === "horizontal" || t === "both", a = r && e.scrollTop > 1, o = r && e.scrollTop + e.clientHeight < e.scrollHeight - 1, s = i && e.scrollLeft > 1, c = i && e.scrollLeft + e.clientWidth < e.scrollWidth - 1, l = getComputedStyle(e), u = Number.parseFloat(l.borderTopWidth) || 0, d = Number.parseFloat(l.borderRightWidth) || 0, f = Number.parseFloat(l.borderBottomWidth) || 0, p = Number.parseFloat(l.borderLeftWidth) || 0;
|
|
7
|
+
e.dataset.mintScrollFadeTop = String(a), e.dataset.mintScrollFadeBottom = String(o), e.dataset.mintScrollFadeLeft = String(s), e.dataset.mintScrollFadeRight = String(c), e.style.setProperty("--mint-scroll-fade-size", n), e.style.setProperty("--mint-scroll-fade-top-size", a ? n : "0px"), e.style.setProperty("--mint-scroll-fade-bottom-size", o ? n : "0px"), e.style.setProperty("--mint-scroll-fade-left-size", s ? n : "0px"), e.style.setProperty("--mint-scroll-fade-right-size", c ? n : "0px");
|
|
8
|
+
let m = [];
|
|
9
|
+
if (r) {
|
|
10
|
+
let e = ["#000 0"];
|
|
11
|
+
a && e.push(`transparent ${u}px`, `#000 calc(var(--mint-scroll-fade-top-size) + ${u}px)`), o ? e.push(`#000 calc(100% - var(--mint-scroll-fade-bottom-size) - ${f}px)`, `transparent calc(100% - ${f}px)`, "#000 100%") : e.push("#000 100%"), m.push(`linear-gradient(to bottom, ${e.join(", ")})`);
|
|
12
|
+
}
|
|
13
|
+
if (i) {
|
|
14
|
+
let e = ["#000 0"];
|
|
15
|
+
s && e.push(`transparent ${p}px`, `#000 calc(var(--mint-scroll-fade-left-size) + ${p}px)`), c ? e.push(`#000 calc(100% - var(--mint-scroll-fade-right-size) - ${d}px)`, `transparent calc(100% - ${d}px)`, "#000 100%") : e.push("#000 100%"), m.push(`linear-gradient(to right, ${e.join(", ")})`);
|
|
16
|
+
}
|
|
17
|
+
let h = a || o || s || c ? m.join(", ") : "none";
|
|
18
|
+
e.style.maskImage = h, e.style.webkitMaskImage = h, e.style.maskClip = "border-box", e.style.webkitMaskClip = "border", m.length > 1 ? (e.style.maskComposite = "intersect", e.style.webkitMaskComposite = "source-in") : (e.style.removeProperty("mask-composite"), e.style.removeProperty("-webkit-mask-composite"));
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
return e.addEventListener("scroll", o, { passive: !0 }), typeof ResizeObserver < "u" && (r = new ResizeObserver(o), r.observe(e), e.firstElementChild && r.observe(e.firstElementChild)), typeof MutationObserver < "u" && (i = new MutationObserver(o), i.observe(e, {
|
|
22
|
+
childList: !0,
|
|
23
|
+
subtree: !0,
|
|
24
|
+
characterData: !0
|
|
25
|
+
})), o(), () => {
|
|
26
|
+
e.removeEventListener("scroll", o), r?.disconnect(), i?.disconnect(), cancelAnimationFrame(a);
|
|
27
|
+
for (let t of [
|
|
28
|
+
"mintScrollFadeTop",
|
|
29
|
+
"mintScrollFadeBottom",
|
|
30
|
+
"mintScrollFadeLeft",
|
|
31
|
+
"mintScrollFadeRight"
|
|
32
|
+
]) delete e.dataset[t];
|
|
33
|
+
e.style.maskImage = "", e.style.webkitMaskImage = "", e.style.maskClip = "", e.style.webkitMaskClip = "", e.style.removeProperty("--mint-scroll-fade-size"), e.style.removeProperty("--mint-scroll-fade-top-size"), e.style.removeProperty("--mint-scroll-fade-bottom-size"), e.style.removeProperty("--mint-scroll-fade-left-size"), e.style.removeProperty("--mint-scroll-fade-right-size"), e.style.removeProperty("mask-composite"), e.style.removeProperty("-webkit-mask-composite");
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var n = class extends HTMLElement {
|
|
37
|
+
constructor(...e) {
|
|
38
|
+
super(...e), this._disposeFade = null, this._target = null, this._contentObserver = null;
|
|
39
|
+
}
|
|
40
|
+
static get observedAttributes() {
|
|
41
|
+
return [
|
|
42
|
+
"axis",
|
|
43
|
+
"fade-size",
|
|
44
|
+
"target"
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
this._attachFade(), this._contentObserver = new MutationObserver(() => this._attachFade()), this._contentObserver.observe(this, {
|
|
49
|
+
childList: !0,
|
|
50
|
+
subtree: !0
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
this._contentObserver?.disconnect(), this._contentObserver = null, this._disposeFade?.(), this._disposeFade = null, this._target = null, this.removeAttribute("data-wraps-scrollport");
|
|
55
|
+
}
|
|
56
|
+
attributeChangedCallback() {
|
|
57
|
+
this.isConnected && this._attachFade();
|
|
58
|
+
}
|
|
59
|
+
_attachFade() {
|
|
60
|
+
let e = this.getAttribute("target"), n = null;
|
|
61
|
+
if (e) try {
|
|
62
|
+
n = this.querySelector(e);
|
|
63
|
+
} catch {
|
|
64
|
+
n = null;
|
|
65
|
+
}
|
|
66
|
+
let r = n || Array.from(this.querySelectorAll("*")).find((e) => {
|
|
67
|
+
let t = getComputedStyle(e);
|
|
68
|
+
return /(auto|scroll)/.test(`${t.overflowY} ${t.overflowX}`);
|
|
69
|
+
}) || this;
|
|
70
|
+
if (r === this._target) return;
|
|
71
|
+
this._disposeFade?.(), this._target = r, this.toggleAttribute("data-wraps-scrollport", r !== this);
|
|
72
|
+
let i = this.getAttribute("axis") || "vertical";
|
|
73
|
+
this._disposeFade = t(r, [
|
|
74
|
+
"vertical",
|
|
75
|
+
"horizontal",
|
|
76
|
+
"both"
|
|
77
|
+
].includes(i) ? i : "vertical", this.getAttribute("fade-size") || "1.5rem");
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
customElements.get("mint-scroll-fade") || e("mint-scroll-fade", n);
|
|
81
|
+
//#endregion
|
|
82
|
+
export { t as n, n as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./icon-rvYvpQ_h.js`),t=require(`./register-element-tCL_F1YI.js`);require(`./icon-CG0Dhtew.js`),require(`./caret-down-DRrCYUv0.js`),e.a({name:`caret-up`,viewBox:`0 0 24 24`,path:`M5 15l7-7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`type`,`placeholder`,`value`,`disabled`,`id`,`name`,`required`,`readonly`,`rows`,`icon`,`label`,`info`,`error`,`error-message`,`loading`,`aria-label`,`aria-labelledby`,`aria-describedby`]}constructor(){super(),this._input=null,this._textarea=null,this._element=null,this._wrapper=null,this._icon=null,this._prependSlotContainer=null,this._appendSlotContainer=null,this._colorPicker=null,this._colorTextInput=null,this._colorContainer=null,this._colorPickerWrapper=null,this._numberSpinnerContainer=null,this._numberIncrementButton=null,this._numberDecrementButton=null,this._contentObserver=null,this._focusHandler=null,this._a11yId=``,this._blurHandler=null,this._clickHandler=null,this._clickOutsideHandler=null,this._renderFrame=null}connectedCallback(){this.classList.add(`mint-input-host`),this.render(),this._observeContentMutations()}disconnectedCallback(){this.removeEventListeners(),this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){if(t!==n){if(e===`error`||e===`error-message`){this._renderErrorState(),this._syncControlAccessibility(),this._element&&(this._element.className=this.getInputClasses()),this._colorTextInput&&(this._colorTextInput.className=this.getInputClasses());return}if(e===`loading`){this.render();return}this.render()}}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}getType(){return this.getAttribute(`type`)||`text`}getRows(){let e=this.getAttribute(`rows`);return e?parseInt(e,10):3}_getNormalizedType(){let e=this.getType();return e===`datetime`?`datetime-local`:e===`money`?`text`:e===`textarea`?`textarea`:e}_isTextarea(){return this.getType()===`textarea`}_isMoney(){return this.getType()===`money`}_isColor(){return this.getType()===`color`}_isNumber(){return this.getType()===`number`}getPlaceholder(){return this.getAttribute(`placeholder`)||``}getValue(){return this._isColor()?this._colorTextInput?this._colorTextInput.value:this._colorPicker?this._colorPicker.value:this.getAttribute(`value`)||`#000000`:this._element?this._element.value:this.getAttribute(`value`)||``}set value(e){try{this._isColor()?(this._colorPicker&&(this._colorPicker.value=e||`#000000`),this._colorTextInput&&(this._colorTextInput.value=e||`#000000`)):this._element&&(this._element.value=e),e?this.setAttribute(`value`,e):this.removeAttribute(`value`)}catch{}}get value(){try{return this.getValue()||``}catch{return``}}isDisabled(){return this.getAttribute(`disabled`)===`true`}isReadonly(){return this.getAttribute(`readonly`)===`true`}isRequired(){return this.getAttribute(`required`)===`true`}hasError(){return this.getAttribute(`error`)===`true`}getErrorMessage(){return this.getAttribute(`error-message`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getIcon(){return this.getAttribute(`icon`)||``}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getInputClasses(){let e=this._isTextarea(),t=!!this.getIcon(),n=this.querySelector(`[slot="prepend"]`)!==null,r=this.querySelector(`[slot="append"]`)!==null,i=this._isColor(),a=this._isNumber(),o=this.hasError();return[`mint-input-control`,e&&`is-textarea`,t&&`has-icon`,i&&`is-color`,n&&`has-prepend`,r&&`has-append`,a&&`is-number`,o&&`has-error`].filter(Boolean).join(` `)}_syncSlotAdornments(e,t){if(!this._wrapper||e||this._isColor()){this._prependSlotContainer&&=(this._prependSlotContainer.remove(),null),this._appendSlotContainer&&=(this._appendSlotContainer.remove(),null);return}this._prependSlotContainer||(this._prependSlotContainer=document.createElement(`div`),this._prependSlotContainer.className=`mint-input-adornment mint-input-prepend-slot`,this._wrapper.appendChild(this._prependSlotContainer)),this._appendSlotContainer||(this._appendSlotContainer=document.createElement(`div`),this._appendSlotContainer.className=`mint-input-adornment mint-input-append-slot`,this._wrapper.appendChild(this._appendSlotContainer)),this._prependSlotContainer.classList.toggle(`has-icon-offset`,t);let n=Array.from(this.querySelectorAll(`[slot="prepend"]`)),r=Array.from(this.querySelectorAll(`[slot="append"]`));this._prependSlotContainer.replaceChildren(),this._appendSlotContainer.replaceChildren(),n.forEach(e=>this._prependSlotContainer.appendChild(e)),r.forEach(e=>this._appendSlotContainer.appendChild(e)),this._prependSlotContainer.classList.toggle(`is-hidden`,n.length===0),this._appendSlotContainer.classList.toggle(`is-hidden`,r.length===0)}isLoading(){return this.getAttribute(`loading`)===`true`}render(){this.getType();let e=this._getNormalizedType(),t=this._isTextarea(),n=this._isMoney(),r=this._isColor(),i=this.getPlaceholder(),a=this.isDisabled(),o=this.isReadonly(),s=this.isRequired(),c=this.getId(),l=this.getName(),u=this.getAttribute(`value`)||(r?`#000000`:``),d=this.getRows(),f=this.getIcon(),p=this.getLabel(),m=this.getInfo(),h=this.isLoading();if(r&&this._renderSkeleton(h),r){this._input&&=(this._input.remove(),null),this._textarea&&=(this._textarea.remove(),null),this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`mint-input-wrapper`,this.appendChild(this._wrapper)),this._colorContainer&&=(this._colorContainer.remove(),null),this._colorPickerWrapper&&!r&&(this._colorPickerWrapper.remove(),this._colorPickerWrapper=null),this._colorPickerWrapper||(this._colorPickerWrapper=document.createElement(`div`),this._colorPickerWrapper.className=`mint-color-picker-wrapper`,this._wrapper.appendChild(this._colorPickerWrapper),this._colorPicker=document.createElement(`input`),this._colorPicker.type=`color`,this._colorPicker.className=`mint-color-picker`,this._colorPickerWrapper.appendChild(this._colorPicker),this._focusHandler=e=>{this._colorPickerWrapper&&this._colorPicker&&this._colorPicker.matches(`:focus-visible`)&&requestAnimationFrame(()=>{this._colorPicker&&this._colorPicker.matches(`:focus-visible`)&&this._colorPickerWrapper?.classList.add(`is-focused`)})},this._blurHandler=()=>{this._colorPickerWrapper&&this._colorPickerWrapper.classList.remove(`is-focused`)},this._colorPicker.addEventListener(`focus`,this._focusHandler),this._colorPicker.addEventListener(`blur`,this._blurHandler),this._colorPicker.addEventListener(`input`,()=>{let e=this._colorPicker?.value||`#000000`;this._colorTextInput&&(this._colorTextInput.value=e),this.setAttribute(`value`,e),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,cancelable:!0}))}),this._colorPicker.addEventListener(`change`,()=>{let e=this._colorPicker?.value||`#000000`;this.setAttribute(`value`,e),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:e},bubbles:!0,cancelable:!0}))})),this._colorTextInput||(this._colorTextInput=document.createElement(`input`),this._colorTextInput.type=`text`,this._colorTextInput.className=this.getInputClasses(),this._colorTextInput.placeholder=i||`#000000`,this._colorTextInput.pattern=`^#[0-9A-Fa-f]{6}$`,this._wrapper.appendChild(this._colorTextInput),this._colorTextInput.addEventListener(`input`,()=>{let e=this._colorTextInput?.value||``;/^#[0-9A-Fa-f]{6}$/.test(e)&&(this._colorPicker&&(this._colorPicker.value=e),this.setAttribute(`value`,e),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,cancelable:!0})))}),this._colorTextInput.addEventListener(`blur`,()=>{let e=this._colorTextInput?.value||``;/^#[0-9A-Fa-f]{6}$/.test(e)?(this._colorPicker&&(this._colorPicker.value=e),this.setAttribute(`value`,e)):this._colorPicker&&this._colorTextInput&&(this._colorTextInput.value=this._colorPicker.value),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this._colorPicker?.value||`#000000`},bubbles:!0,cancelable:!0}))}));let e=u||`#000000`;if(this._colorPicker&&this._colorPicker.value!==e&&(this._colorPicker.value=e),this._colorTextInput&&this._colorTextInput.value!==e&&(this._colorTextInput.value=e),this._colorPicker&&(this._colorPicker.disabled=a),this._colorPickerWrapper&&(a?this._colorPickerWrapper.classList.add(`is-disabled`):this._colorPickerWrapper.classList.remove(`is-disabled`)),this._colorTextInput&&(this._colorTextInput.disabled=a,this._colorTextInput.readOnly=o,this._colorTextInput.required=s),this._colorTextInput){let e=this._colorTextInput;c?e.id=c:e.removeAttribute(`id`),l?e.name=l:e.removeAttribute(`name`),e.setAttribute(`aria-invalid`,this.hasError()?`true`:`false`),this._element=e}this._renderErrorState();let t=this.querySelector(`.mint-input-label-container`);if(p||m){t||(t=document.createElement(`div`),t.className=`mint-input-label-container`,this._wrapper&&this._wrapper.parentElement===this?this.insertBefore(t,this._wrapper):this.insertBefore(t,this.firstChild));let e=t.querySelector(`.mint-input-label`);if(p){e||(e=document.createElement(`label`),e.className=`mint-input-label`,t.insertBefore(e,t.firstChild)),e.textContent=p;let n=c||this._colorTextInput?.id;if(n)e.setAttribute(`for`,n);else{let t=`mint-input-${Math.random().toString(36).substr(2,9)}`;this._colorTextInput&&(this._colorTextInput.id=t),e.setAttribute(`for`,t)}a?e.classList.add(`is-disabled`):e.classList.remove(`is-disabled`)}else e&&e.remove();let n=t.querySelector(`.mint-input-info`);m?(n||(n=document.createElement(`span`),n.className=`mint-input-info`,t.appendChild(n)),n.textContent=m,a?n.classList.add(`is-disabled`):n.classList.remove(`is-disabled`)):n&&n.remove()}else t&&t.remove();return}if(this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`mint-input-wrapper`,this.appendChild(this._wrapper)),this._colorContainer&&(this._colorContainer.remove(),this._colorContainer=null,this._colorPicker=null,this._colorTextInput=null),this._colorPickerWrapper&&!r&&(this._colorPickerWrapper.remove(),this._colorPickerWrapper=null,this._colorPicker=null,this._colorTextInput=null),f&&!t?this._icon?this._icon.setAttribute(`name`,f):(this._icon=document.createElement(`mint-icon`),this._icon.setAttribute(`name`,f),this._icon.className=`mint-input-icon`,this._wrapper.appendChild(this._icon)):this._icon&&=(this._icon.remove(),null),this._syncSlotAdornments(t,!!f),this._isNumber()&&!t){if(!this._numberSpinnerContainer){this._numberSpinnerContainer=document.createElement(`div`),this._numberSpinnerContainer.className=`mint-input-spinner`,this._wrapper.appendChild(this._numberSpinnerContainer),this._numberIncrementButton=document.createElement(`button`),this._numberIncrementButton.type=`button`,this._numberIncrementButton.className=`mint-input-spinner-button`;let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`caret-up`),e.className=`mint-input-spinner-icon`,this._numberIncrementButton.appendChild(e),this._numberSpinnerContainer.appendChild(this._numberIncrementButton),this._numberDecrementButton=document.createElement(`button`),this._numberDecrementButton.type=`button`,this._numberDecrementButton.className=`mint-input-spinner-button`;let t=document.createElement(`mint-icon`);t.setAttribute(`name`,`caret-down`),t.className=`mint-input-spinner-icon`,this._numberDecrementButton.appendChild(t),this._numberSpinnerContainer.appendChild(this._numberDecrementButton),this._numberIncrementButton.addEventListener(`click`,e=>{if(e.preventDefault(),e.stopPropagation(),this._input&&!this._input.disabled&&!this._input.readOnly){let e=parseFloat(this._input.value)||0,t=parseFloat(this._input.step)||1,n=this._input.min?parseFloat(this._input.min):void 0,r=this._input.max?parseFloat(this._input.max):void 0,i=e+t;r!==void 0&&i>r&&(i=r),n!==void 0&&i<n&&(i=n),this._input.value=i.toString(),this.setAttribute(`value`,i.toString()),this._input.dispatchEvent(new Event(`input`,{bubbles:!0})),this._input.dispatchEvent(new Event(`change`,{bubbles:!0}))}}),this._numberDecrementButton.addEventListener(`click`,e=>{if(e.preventDefault(),e.stopPropagation(),this._input&&!this._input.disabled&&!this._input.readOnly){let e=parseFloat(this._input.value)||0,t=parseFloat(this._input.step)||1,n=this._input.min?parseFloat(this._input.min):void 0,r=this._input.max?parseFloat(this._input.max):void 0,i=e-t;n!==void 0&&i<n&&(i=n),r!==void 0&&i>r&&(i=r),this._input.value=i.toString(),this.setAttribute(`value`,i.toString()),this._input.dispatchEvent(new Event(`input`,{bubbles:!0})),this._input.dispatchEvent(new Event(`change`,{bubbles:!0}))}})}this._numberIncrementButton&&(this._numberIncrementButton.disabled=a||o),this._numberDecrementButton&&(this._numberDecrementButton.disabled=a||o)}else this._numberSpinnerContainer&&(this._numberSpinnerContainer.remove(),this._numberSpinnerContainer=null,this._numberIncrementButton=null,this._numberDecrementButton=null);if(t){if(this._input&&=(this._input.remove(),null),this._textarea||(this._textarea=document.createElement(`textarea`),this._element=this._textarea,this._wrapper.appendChild(this._textarea),this.setupEventListeners()),this._element=this._textarea,this._textarea.placeholder=i,this._textarea.disabled=a,this._textarea.readOnly=o,this._textarea.required=s,this._textarea.rows=d,this._textarea.setAttribute(`aria-invalid`,this.hasError()?`true`:`false`),u!==this._textarea.value&&(this._textarea.value=u),c?this._textarea.id=c:this._textarea.removeAttribute(`id`),l?this._textarea.name=l:this._textarea.removeAttribute(`name`),this._textarea.className=this.getInputClasses(),this.firstChild&&this.firstChild!==this._wrapper&&this.firstChild.nodeType===Node.TEXT_NODE){let e=this.firstChild.textContent;e&&!this._textarea.value&&(this._textarea.value=e.trim()),this.removeChild(this.firstChild)}}else if(this._textarea&&=(this._textarea.remove(),null),this._input||(this._input=document.createElement(`input`),this._element=this._input,this._wrapper.appendChild(this._input),this.setupEventListeners()),this._element=this._input,this._input.type=e,this._input.placeholder=i,this._input.disabled=a,this._input.readOnly=o,this._input.required=s,this._input.setAttribute(`aria-invalid`,this.hasError()?`true`:`false`),n?(this._input.inputMode=`decimal`,this._input.pattern=`[0-9]*\\.?[0-9]*`):(this._input.removeAttribute(`inputmode`),this._input.removeAttribute(`pattern`)),u!==this._input.value&&(this._input.value=u),c?this._input.id=c:this._input.removeAttribute(`id`),l?this._input.name=l:this._input.removeAttribute(`name`),this._input.className=this.getInputClasses(),this.firstChild&&this.firstChild!==this._wrapper&&this.firstChild.nodeType===Node.TEXT_NODE){let e=this.firstChild.textContent;e&&!this._input.value&&(this._input.value=e.trim()),this.removeChild(this.firstChild)}let g=this.querySelector(`.mint-input-label-container`);if(p||m){g||(g=document.createElement(`div`),g.className=`mint-input-label-container`,this._wrapper&&this._wrapper.parentElement===this?this.insertBefore(g,this._wrapper):this.insertBefore(g,this.firstChild));let e=g.querySelector(`.mint-input-label`);if(p){e||(e=document.createElement(`label`),e.className=`mint-input-label`,g.insertBefore(e,g.firstChild)),e.textContent=p;let t=c||this._element?.id||this._colorTextInput?.id||this._input?.id||this._textarea?.id;if(t)e.setAttribute(`for`,t);else{let t=`mint-input-${Math.random().toString(36).substr(2,9)}`;this._element?this._element.id=t:this._colorTextInput?this._colorTextInput.id=t:this._input?this._input.id=t:this._textarea&&(this._textarea.id=t),e.setAttribute(`for`,t)}a?e.classList.add(`is-disabled`):e.classList.remove(`is-disabled`)}else e&&e.remove();let t=g.querySelector(`.mint-input-info`);m?(t||(t=document.createElement(`span`),t.className=`mint-input-info`,g.appendChild(t)),t.textContent=m,a?t.classList.add(`is-disabled`):t.classList.remove(`is-disabled`)):t&&t.remove()}else g&&g.remove();this._syncSlotAdornments(t,!!f),this._renderErrorState(),this._syncControlAccessibility(),this._renderSkeleton(h)}_renderErrorState(){let e=this.hasError(),t=this.getErrorMessage(),n=this.querySelector(`.mint-input-error`);e&&t?(n||(n=document.createElement(`div`),n.className=`mint-input-error`,this.appendChild(n)),n.textContent=t):n&&n.remove()}_syncControlAccessibility(){let e=this._element;if(!e)return;this._a11yId||=this.getId()||`mint-input-${Math.random().toString(36).slice(2,10)}`;let t=this.getAttribute(`aria-label`)?.trim(),n=!!this.querySelector(`.mint-input-label`);t?e.setAttribute(`aria-label`,t):!n&&this.getAttribute(`placeholder`)?.trim()?e.setAttribute(`aria-label`,this.getAttribute(`placeholder`).trim()):e.removeAttribute(`aria-label`);let r=this.querySelector(`.mint-input-info`),i=this.querySelector(`.mint-input-error`),a=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean);r&&(r.id=`${this._a11yId}-info`,a.push(r.id)),i&&(i.id=`${this._a11yId}-error`,a.push(i.id)),e.setAttribute(`aria-invalid`,String(this.hasError())),a.length?e.setAttribute(`aria-describedby`,Array.from(new Set(a)).join(` `)):e.removeAttribute(`aria-describedby`);let o=this.getAttribute(`aria-labelledby`)?.trim();o?e.setAttribute(`aria-labelledby`,o):e.removeAttribute(`aria-labelledby`)}setupEventListeners(){this._element&&(this._element.addEventListener(`input`,()=>{let e=this._element?.value||``;e?this.setAttribute(`value`,e):this.removeAttribute(`value`);let t=new Event(`input`,{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(t),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,cancelable:!0,composed:!0}))}),this._element.addEventListener(`blur`,()=>{let e=this._element?.value||``;e?this.setAttribute(`value`,e):this.removeAttribute(`value`),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:e},bubbles:!0,cancelable:!0}))}))}removeEventListeners(){this._colorPicker&&(this._focusHandler&&=(this._colorPicker.removeEventListener(`focus`,this._focusHandler),null),this._blurHandler&&=(this._colorPicker.removeEventListener(`blur`,this._blurHandler),null))}focus(){this._isColor()&&this._colorTextInput?this._colorTextInput.focus():this._element?.focus()}blur(){this._isColor()&&this._colorTextInput?this._colorTextInput.blur():this._element?.blur()}_renderSkeleton(e){this.classList.toggle(`is-loading`,e);let t=this.querySelector(`.mint-input-skeleton-container`),n=this._wrapper||this.querySelector(`.mint-input-wrapper`);if(e){t||(t=document.createElement(`div`),t.className=`mint-input-skeleton-container`,n?(n.classList.add(`mint-input-positioned`),n.appendChild(t)):(this.classList.add(`mint-input-positioned`),this.appendChild(t)));let e=t.querySelector(`.mint-input-skeleton`);e||(e=document.createElement(`div`),e.className=`mint-input-skeleton`,t.appendChild(e)),e.parentElement||t.appendChild(e)}}};customElements.get(`mint-input`)||t.t(`mint-input`,n),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import "./icon-Cxv9k3CY.js";
|
|
2
|
-
import { t
|
|
1
|
+
import { a as e } from "./icon-Cxv9k3CY.js";
|
|
2
|
+
import { t } from "./register-element-BFYmIynH.js";
|
|
3
3
|
import "./icon-DMa6Oo80.js";
|
|
4
|
-
import "./caret-
|
|
5
|
-
|
|
4
|
+
import "./caret-down-BU-Ee_JS.js";
|
|
5
|
+
e({
|
|
6
|
+
name: "caret-up",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
path: "M5 15l7-7 7 7",
|
|
9
|
+
strokeLinecap: "round",
|
|
10
|
+
strokeLinejoin: "round"
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
6
13
|
//#region src/components/input/Input.ts
|
|
7
|
-
var
|
|
14
|
+
var n = class extends HTMLElement {
|
|
8
15
|
static get observedAttributes() {
|
|
9
16
|
return [
|
|
10
17
|
"type",
|
|
@@ -329,6 +336,6 @@ var t = class extends HTMLElement {
|
|
|
329
336
|
}
|
|
330
337
|
}
|
|
331
338
|
};
|
|
332
|
-
customElements.get("mint-input") ||
|
|
339
|
+
customElements.get("mint-input") || t("mint-input", n);
|
|
333
340
|
//#endregion
|
|
334
|
-
export { t };
|
|
341
|
+
export { n as t };
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { t as e } from "./register-element-BFYmIynH.js";
|
|
2
|
+
import { n as t } from "./ScrollFade-DIKawLYD.js";
|
|
2
3
|
//#region src/components/popover/Popover.js
|
|
3
|
-
var
|
|
4
|
+
var n = new Set([
|
|
4
5
|
"up",
|
|
5
6
|
"down",
|
|
6
7
|
"left",
|
|
7
8
|
"right"
|
|
8
|
-
])
|
|
9
|
+
]);
|
|
10
|
+
function r(e) {
|
|
11
|
+
let t = e.getBoundingClientRect(), n = Math.max(0, t.top), r = Math.min(window.innerWidth, t.right), i = Math.min(window.innerHeight, t.bottom), a = Math.max(0, t.left);
|
|
12
|
+
for (let t = e.parentElement; t && t !== document.body; t = t.parentElement) {
|
|
13
|
+
let e = getComputedStyle(t), o = t.getBoundingClientRect();
|
|
14
|
+
/(auto|scroll|hidden|clip)/.test(e.overflowY) && (n = Math.max(n, o.top), i = Math.min(i, o.bottom)), /(auto|scroll|hidden|clip)/.test(e.overflowX) && (a = Math.max(a, o.left), r = Math.min(r, o.right));
|
|
15
|
+
}
|
|
16
|
+
return i > n && r > a;
|
|
17
|
+
}
|
|
18
|
+
var i = class extends HTMLElement {
|
|
9
19
|
static get observedAttributes() {
|
|
10
20
|
return [
|
|
11
21
|
"direction",
|
|
@@ -13,26 +23,29 @@ var t = new Set([
|
|
|
13
23
|
"trigger-id",
|
|
14
24
|
"trigger-toggle",
|
|
15
25
|
"trigger-align",
|
|
26
|
+
"align-selected",
|
|
16
27
|
"padding",
|
|
17
28
|
"hover",
|
|
18
29
|
"distance"
|
|
19
30
|
];
|
|
20
31
|
}
|
|
21
32
|
constructor() {
|
|
22
|
-
super(), this._trigger = null, this._triggerLookupTimer = null, this._clickHandler = null, this._hoverEnterHandler = null, this._hoverLeaveHandler = null, this._outsideHandler = null, this._escapeHandler = null, this._positionHandler = null, this._scrollHandler = null, this._resizeObserver = null, this._hoverCloseTimer = null, this._closeAnimationTimer = null, this._blobAnimation = null;
|
|
33
|
+
super(), this._trigger = null, this._triggerLookupTimer = null, this._clickHandler = null, this._hoverEnterHandler = null, this._hoverLeaveHandler = null, this._outsideHandler = null, this._escapeHandler = null, this._positionHandler = null, this._scrollHandler = null, this._resizeObserver = null, this._hoverCloseTimer = null, this._closeAnimationTimer = null, this._blobAnimation = null, this._disposeScrollFade = null;
|
|
23
34
|
}
|
|
24
35
|
connectedCallback() {
|
|
25
|
-
this.render(), this.
|
|
36
|
+
this.render(), this._disposeScrollFade?.();
|
|
37
|
+
let e = this.classList.contains("mint-select-popover") ? this.querySelector(".mint-select-options") : this;
|
|
38
|
+
this._disposeScrollFade = t(e || this, e ? "vertical" : "both"), this._setupTrigger();
|
|
26
39
|
}
|
|
27
40
|
disconnectedCallback() {
|
|
28
|
-
this._removeTrigger(), this._removeOpenListeners(), clearTimeout(this._hoverCloseTimer), clearTimeout(this._closeAnimationTimer), this._blobAnimation?.cancel();
|
|
41
|
+
this._removeTrigger(), this._removeOpenListeners(), this._disposeScrollFade?.(), this._disposeScrollFade = null, clearTimeout(this._hoverCloseTimer), clearTimeout(this._closeAnimationTimer), this._blobAnimation?.cancel();
|
|
29
42
|
}
|
|
30
43
|
attributeChangedCallback(e, t, n) {
|
|
31
44
|
t === n || !this.isConnected || ((e === "trigger-id" || e === "trigger-toggle" || e === "hover") && this._setupTrigger(), this.render());
|
|
32
45
|
}
|
|
33
46
|
getDirection() {
|
|
34
47
|
let e = this.getAttribute("direction") || "down";
|
|
35
|
-
return
|
|
48
|
+
return n.has(e) ? e : "down";
|
|
36
49
|
}
|
|
37
50
|
getTriggerId() {
|
|
38
51
|
return this.getAttribute("trigger-id") || "";
|
|
@@ -92,10 +105,19 @@ var t = new Set([
|
|
|
92
105
|
}, this._scrollHandler = (e) => {
|
|
93
106
|
if (!this.isOpen()) return;
|
|
94
107
|
let t = e.target;
|
|
95
|
-
t instanceof Node && (t === this || this.contains(t))
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
if (!(t instanceof Node && (t === this || this.contains(t)))) {
|
|
109
|
+
if (this.classList.contains("mint-select-popover")) {
|
|
110
|
+
!this._trigger || !r(this._trigger) ? this.close() : this._position({
|
|
111
|
+
allowViewportFlip: !1,
|
|
112
|
+
clampToViewport: !1
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this._position({
|
|
117
|
+
allowViewportFlip: !1,
|
|
118
|
+
clampToViewport: !1
|
|
119
|
+
});
|
|
120
|
+
}
|
|
99
121
|
}, typeof ResizeObserver < "u" && this._trigger) {
|
|
100
122
|
this._resizeObserver = new ResizeObserver(() => {
|
|
101
123
|
this.isOpen() && this._position();
|
|
@@ -118,8 +140,26 @@ var t = new Set([
|
|
|
118
140
|
height: this.offsetHeight
|
|
119
141
|
}, o = this._distancePx(), s = e ? this.getDirection() : this.dataset.direction || this.getDirection(), c = 0, l = 0, u = this.getAttribute("trigger-align") || "center";
|
|
120
142
|
if (s === "down" || s === "up") {
|
|
121
|
-
let
|
|
122
|
-
e && s === "down" &&
|
|
143
|
+
let n = i.bottom + o, r = i.top - a.height - o;
|
|
144
|
+
e && s === "down" && n + a.height > innerHeight - 12 && r >= 12 ? s = "up" : e && s === "up" && r < 12 && n + a.height <= innerHeight - 12 && (s = "down");
|
|
145
|
+
let d = this.hasAttribute("align-selected") ? this.querySelector("[role=\"option\"][aria-selected=\"true\"]") : null;
|
|
146
|
+
if (d) {
|
|
147
|
+
let e = d.closest("[role=\"listbox\"]"), n = Number.parseFloat(getComputedStyle(this).maxHeight);
|
|
148
|
+
Math.min(Number.isFinite(n) ? n : innerHeight - 24, innerHeight - 24);
|
|
149
|
+
let r = this.scrollHeight > this.clientHeight + 1;
|
|
150
|
+
e && (e.style.paddingBlock = "0px");
|
|
151
|
+
let o = d.offsetTop + d.offsetHeight / 2, s = i.top + i.height / 2, c = this.offsetHeight, f;
|
|
152
|
+
if (f = s - o, r && f < 12) {
|
|
153
|
+
f = 12;
|
|
154
|
+
let e = s - f, t = Math.max(0, this.scrollHeight - this.clientHeight);
|
|
155
|
+
this.scrollTop = Math.max(0, Math.min(t, o - e));
|
|
156
|
+
} else f = Math.max(12, Math.min(f, innerHeight - c - 12));
|
|
157
|
+
l = u === "start" ? i.left : u === "end" ? i.right - a.width : i.left + (i.width - a.width) / 2;
|
|
158
|
+
let p = t ? Math.max(12, Math.min(l, innerWidth - a.width - 12)) : l;
|
|
159
|
+
this.style.top = `${f}px`, this.style.left = `${p}px`, this.dataset.direction = "down", this.style.setProperty("--mint-popover-origin-x", `${i.left + i.width / 2 - p}px`), this.style.setProperty("--mint-popover-origin-y", `${s - f}px`);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
c = s === "down" ? n : r, l = u === "start" ? i.left : u === "end" ? i.right - a.width : i.left + (i.width - a.width) / 2;
|
|
123
163
|
} else {
|
|
124
164
|
let t = i.right + o, n = i.left - a.width - o;
|
|
125
165
|
e && s === "right" && t + a.width > innerWidth - 12 && n >= 12 ? s = "left" : e && s === "left" && n < 12 && t + a.width <= innerWidth - 12 && (s = "right"), l = s === "right" ? t : n, c = u === "start" ? i.top : u === "end" ? i.bottom - a.height : i.top + (i.height - a.height) / 2;
|
|
@@ -185,6 +225,6 @@ var t = new Set([
|
|
|
185
225
|
} else this.dataset.state = "closed";
|
|
186
226
|
}
|
|
187
227
|
};
|
|
188
|
-
typeof customElements < "u" && !customElements.get("mint-popover") && e("mint-popover",
|
|
228
|
+
typeof customElements < "u" && !customElements.get("mint-popover") && e("mint-popover", i);
|
|
189
229
|
//#endregion
|
|
190
|
-
export {
|
|
230
|
+
export { i as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./register-element-tCL_F1YI.js`),t=require(`./ScrollFade-Br6QSd_-.js`);var n=new Set([`up`,`down`,`left`,`right`]);function r(e){let t=e.getBoundingClientRect(),n=Math.max(0,t.top),r=Math.min(window.innerWidth,t.right),i=Math.min(window.innerHeight,t.bottom),a=Math.max(0,t.left);for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){let e=getComputedStyle(t),o=t.getBoundingClientRect();/(auto|scroll|hidden|clip)/.test(e.overflowY)&&(n=Math.max(n,o.top),i=Math.min(i,o.bottom)),/(auto|scroll|hidden|clip)/.test(e.overflowX)&&(a=Math.max(a,o.left),r=Math.min(r,o.right))}return i>n&&r>a}var i=class extends HTMLElement{static get observedAttributes(){return[`direction`,`open`,`trigger-id`,`trigger-toggle`,`trigger-align`,`align-selected`,`padding`,`hover`,`distance`]}constructor(){super(),this._trigger=null,this._triggerLookupTimer=null,this._clickHandler=null,this._hoverEnterHandler=null,this._hoverLeaveHandler=null,this._outsideHandler=null,this._escapeHandler=null,this._positionHandler=null,this._scrollHandler=null,this._resizeObserver=null,this._hoverCloseTimer=null,this._closeAnimationTimer=null,this._blobAnimation=null,this._disposeScrollFade=null}connectedCallback(){this.render(),this._disposeScrollFade?.();let e=this.classList.contains(`mint-select-popover`)?this.querySelector(`.mint-select-options`):this;this._disposeScrollFade=t.n(e||this,e?`vertical`:`both`),this._setupTrigger()}disconnectedCallback(){this._removeTrigger(),this._removeOpenListeners(),this._disposeScrollFade?.(),this._disposeScrollFade=null,clearTimeout(this._hoverCloseTimer),clearTimeout(this._closeAnimationTimer),this._blobAnimation?.cancel()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||((e===`trigger-id`||e===`trigger-toggle`||e===`hover`)&&this._setupTrigger(),this.render())}getDirection(){let e=this.getAttribute(`direction`)||`down`;return n.has(e)?e:`down`}getTriggerId(){return this.getAttribute(`trigger-id`)||``}isOpen(){return this.hasAttribute(`open`)&&this.getAttribute(`open`)!==`false`}isHoverEnabled(){return this.hasAttribute(`hover`)&&this.getAttribute(`hover`)!==`false`}isTriggerToggleEnabled(){return this.getAttribute(`trigger-toggle`)!==`false`}open(){this.setAttribute(`open`,`true`)}close(){this.removeAttribute(`open`)}_removeTrigger(){clearTimeout(this._triggerLookupTimer),this._triggerLookupTimer=null,this._trigger&&(this._clickHandler&&this._trigger.removeEventListener(`click`,this._clickHandler),this._hoverEnterHandler&&this._trigger.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this._trigger.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._hoverEnterHandler&&this.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._trigger.removeAttribute(`aria-haspopup`),this._trigger.removeAttribute(`aria-expanded`),this._trigger=null,this._clickHandler=this._hoverEnterHandler=this._hoverLeaveHandler=null)}_setupTrigger(){this._removeTrigger();let e=this.getTriggerId();if(e){if(this._trigger=document.getElementById(e),!this._trigger){this._triggerLookupTimer=setTimeout(()=>{this.isConnected&&this.getTriggerId()===e&&!this._trigger&&this._setupTrigger()},40);return}this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,String(this.isOpen())),this.isTriggerToggleEnabled()&&(this._clickHandler=e=>{this._trigger?.tagName===`A`&&e.preventDefault(),this.isOpen()?this.close():this.open()},this._trigger.addEventListener(`click`,this._clickHandler)),this.isHoverEnabled()&&(this._hoverEnterHandler=()=>{clearTimeout(this._hoverCloseTimer),this.open()},this._hoverLeaveHandler=()=>this._scheduleHoverClose(),this._trigger.addEventListener(`mouseenter`,this._hoverEnterHandler),this._trigger.addEventListener(`mouseleave`,this._hoverLeaveHandler),this.addEventListener(`mouseenter`,this._hoverEnterHandler),this.addEventListener(`mouseleave`,this._hoverLeaveHandler))}}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{!this._trigger?.matches(`:hover`)&&!this.matches(`:hover`)&&this.close()},140)}_removeOpenListeners(){this._outsideHandler&&document.removeEventListener(`click`,this._outsideHandler),this._escapeHandler&&document.removeEventListener(`keydown`,this._escapeHandler),this._positionHandler&&window.removeEventListener(`resize`,this._positionHandler),this._scrollHandler&&window.removeEventListener(`scroll`,this._scrollHandler,!0),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._outsideHandler=this._escapeHandler=this._positionHandler=this._scrollHandler=null}_setOpenListeners(){if(!this._outsideHandler){if(this._outsideHandler=e=>{let t=e.composedPath();t.includes(this)||t.includes(this._trigger)||(e.target instanceof Element?e.target:null)?.closest(`[data-keep-popover-open]`)||this.close()},this._escapeHandler=e=>{e.key===`Escape`&&(this.close(),this._trigger?.focus?.())},this._positionHandler=()=>{this.isOpen()&&this._position()},this._scrollHandler=e=>{if(!this.isOpen())return;let t=e.target;if(!(t instanceof Node&&(t===this||this.contains(t)))){if(this.classList.contains(`mint-select-popover`)){!this._trigger||!r(this._trigger)?this.close():this._position({allowViewportFlip:!1,clampToViewport:!1});return}this._position({allowViewportFlip:!1,clampToViewport:!1})}},typeof ResizeObserver<`u`&&this._trigger){this._resizeObserver=new ResizeObserver(()=>{this.isOpen()&&this._position()}),this._resizeObserver.observe(this);let e=this._trigger,t=0;for(;e&&e!==document.documentElement&&t<8;)this._resizeObserver.observe(e),e=e.parentElement,t+=1}setTimeout(()=>{this.isOpen()&&this._outsideHandler&&document.addEventListener(`click`,this._outsideHandler)},0),document.addEventListener(`keydown`,this._escapeHandler),window.addEventListener(`resize`,this._positionHandler),window.addEventListener(`scroll`,this._scrollHandler,!0)}}_position({allowViewportFlip:e=!0,clampToViewport:t=!0}={}){let n=document.getElementById(this.getTriggerId());n&&n!==this._trigger&&this._setupTrigger();let r=n||this._trigger;if(!r)return;let i=r.getBoundingClientRect(),a={width:this.offsetWidth,height:this.offsetHeight},o=this._distancePx(),s=e?this.getDirection():this.dataset.direction||this.getDirection(),c=0,l=0,u=this.getAttribute(`trigger-align`)||`center`;if(s===`down`||s===`up`){let n=i.bottom+o,r=i.top-a.height-o;e&&s===`down`&&n+a.height>innerHeight-12&&r>=12?s=`up`:e&&s===`up`&&r<12&&n+a.height<=innerHeight-12&&(s=`down`);let d=this.hasAttribute(`align-selected`)?this.querySelector(`[role="option"][aria-selected="true"]`):null;if(d){let e=d.closest(`[role="listbox"]`),n=Number.parseFloat(getComputedStyle(this).maxHeight);Math.min(Number.isFinite(n)?n:innerHeight-24,innerHeight-24);let r=this.scrollHeight>this.clientHeight+1;e&&(e.style.paddingBlock=`0px`);let o=d.offsetTop+d.offsetHeight/2,s=i.top+i.height/2,c=this.offsetHeight,f;if(f=s-o,r&&f<12){f=12;let e=s-f,t=Math.max(0,this.scrollHeight-this.clientHeight);this.scrollTop=Math.max(0,Math.min(t,o-e))}else f=Math.max(12,Math.min(f,innerHeight-c-12));l=u===`start`?i.left:u===`end`?i.right-a.width:i.left+(i.width-a.width)/2;let p=t?Math.max(12,Math.min(l,innerWidth-a.width-12)):l;this.style.top=`${f}px`,this.style.left=`${p}px`,this.dataset.direction=`down`,this.style.setProperty(`--mint-popover-origin-x`,`${i.left+i.width/2-p}px`),this.style.setProperty(`--mint-popover-origin-y`,`${s-f}px`);return}c=s===`down`?n:r,l=u===`start`?i.left:u===`end`?i.right-a.width:i.left+(i.width-a.width)/2}else{let t=i.right+o,n=i.left-a.width-o;e&&s===`right`&&t+a.width>innerWidth-12&&n>=12?s=`left`:e&&s===`left`&&n<12&&t+a.width<=innerWidth-12&&(s=`right`),l=s===`right`?t:n,c=u===`start`?i.top:u===`end`?i.bottom-a.height:i.top+(i.height-a.height)/2}let d=t?Math.max(12,Math.min(c,innerHeight-a.height-12)):c,f=t?Math.max(12,Math.min(l,innerWidth-a.width-12)):l;this.style.top=`${d}px`,this.style.left=`${f}px`,this.dataset.direction=s,this.style.setProperty(`--mint-popover-origin-x`,`${i.left+i.width/2-f}px`),this.style.setProperty(`--mint-popover-origin-y`,`${i.top+i.height/2-d}px`)}_distancePx(){let e=(this.getAttribute(`distance`)||`8px`).trim(),t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`rem`)?t*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Math.max(0,t):8}_animateBlob(e){if(this._blobAnimation?.cancel(),this._blobAnimation=null,typeof this.animate!=`function`)return 0;let t=getComputedStyle(this).borderRadius||`.75rem`;if(matchMedia(`(prefers-reduced-motion: reduce)`).matches)return 0;let n=e?380:280,r=[{transform:`scale(.035, .035)`,borderRadius:`50%`,opacity:.94,offset:0},{transform:`scale(.3, .42)`,borderRadius:`50%`,opacity:1,offset:.58},{transform:`scale(1.035, .96)`,borderRadius:`1rem`,offset:.9},{transform:`scale(1)`,borderRadius:t,offset:1}],i=e?r:[...r].reverse().map(({offset:e,...t})=>({...t,offset:1-e}));return this._blobAnimation=this.animate(i,{duration:n,easing:e?`cubic-bezier(.2, .8, .2, 1)`:`cubic-bezier(.4, 0, .8, .2)`,fill:`both`}),n}render(){let e=this.isOpen(),t=this.hasAttribute(`data-open`)||this.dataset.state===`closing`,n=this.hasAttribute(`data-open`);if(this.toggleAttribute(`data-open`,e),this.setAttribute(`aria-hidden`,String(!e)),this._trigger&&this._trigger.setAttribute(`aria-expanded`,String(e)),e){clearTimeout(this._closeAnimationTimer);let e=!n||this.dataset.state===`closing`;e&&(this._blobAnimation?.cancel(),this._blobAnimation=null),this.dataset.state=`open`,this._setOpenListeners(),this._position(),e&&this._animateBlob(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>{this.isOpen()&&this._position()}))}else if(this._removeOpenListeners(),t){this.dataset.state=`closing`;let e=this._animateBlob(!1);e?this._closeAnimationTimer=setTimeout(()=>{this.dataset.state===`closing`&&(this._blobAnimation?.cancel(),this._blobAnimation=null,this.dataset.state=`closed`)},e):this.dataset.state=`closed`}else this.dataset.state=`closed`}};typeof customElements<`u`&&!customElements.get(`mint-popover`)&&e.t(`mint-popover`,i),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./register-element-tCL_F1YI.js`),t=require(`./ScrollFade-Br6QSd_-.js`);var n=class extends HTMLElement{constructor(...e){super(...e),this._observer=null,this._disposeScrollFade=null}connectedCallback(){this.classList.add(`mint-table-host`),this._disposeScrollFade=t.n(this,`both`),this._observeChanges(),this._applyStyles(),requestAnimationFrame(()=>{this._applyStyles(),setTimeout(()=>this._applyStyles(),0)})}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._disposeScrollFade?.(),this._disposeScrollFade=null}_observeChanges(){this._observer=new MutationObserver(()=>this._applyStyles()),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!1})}_applyStyles(){this._observer?.disconnect();let e=Array.from(this.querySelectorAll(`table`));if(e.length===0){this._observer&&this._observeChanges();return}e.forEach(e=>{let t=!!e.closest(`[id^="mint-rt-vscroll-"]`)||!!e.closest(`mint-resource-table[data-mint-rt-fixed-header]`);e.classList.add(`mint-table-native`),e.classList.toggle(`mint-table-pinned-layout`,t)});let t=e.find(e=>e.querySelector(`thead`))??e[0],n=e.find(e=>e.querySelector(`tbody`))??e[0],r=t.querySelector(`thead`);r&&r.querySelectorAll(`th`).forEach(e=>{let t=e.querySelector(`mint-icon`),n=t?.getAttribute(`name`)||``,r=e.hasAttribute(`data-mint-rt-sortable`)||t!==null&&n!==`ellipsis`;e.classList.toggle(`mint-table-sortable`,r);let i=e.closest(`table`),a=i?.closest(`mint-resource-table`),o=!!i?.closest(`[id^="mint-rt-vscroll-"]`)||!!a?.hasAttribute(`data-mint-rt-fixed-header`);e.classList.toggle(`mint-table-pinned-header`,o)});let i=n.querySelector(`tbody`);if(i){let e=Array.from(i.querySelectorAll(`tr`)),t=!!n.closest(`[id^="mint-rt-vscroll-"]`)||!!n.closest(`mint-resource-table`)?.hasAttribute(`data-mint-rt-fixed-header`),r=e.findIndex(e=>e.getAttribute(`data-mint-rt-spacer`)===`bottom`);e.forEach((n,i)=>{let a=n.hasAttribute(`data-mint-rt-spacer`),o=n.hasAttribute(`data-row-clickable`);n.classList.toggle(`mint-table-spacer`,a),n.classList.toggle(`mint-table-clickable`,o&&!a),n.classList.toggle(`mint-table-row-bordered`,!a&&!t&&i!==e.length-1),Array.from(n.querySelectorAll(`td`)).forEach(o=>{let s=n.hasAttribute(`data-mint-rt-last-row`),c=r===-1&&i===e.length-1;o.classList.toggle(`mint-table-cell-bordered`,t&&!a&&!s&&!c),this._restoreCell(o)})})}n.querySelectorAll(`tfoot td`).forEach(e=>this._restoreCell(e)),this._observer&&this._observeChanges()}_restoreCell(e){if(e.dataset.mtProcessed!==`true`)return;let t={};Array.from(e.attributes).forEach(e=>{e.name.startsWith(`data-`)&&e.name!==`data-original`&&e.name!==`data-mt-processed`&&(t[e.name]=e.value)});let n=e.getAttribute(`data-original`)||``;e.dataset.mtProcessed=``,e.innerHTML=n,Object.entries(t).forEach(([t,n])=>e.setAttribute(t,n))}};customElements.get(`mint-table`)||e.t(`mint-table`,n),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { t as e } from "./register-element-BFYmIynH.js";
|
|
2
|
+
import { n as t } from "./ScrollFade-DIKawLYD.js";
|
|
2
3
|
//#region src/components/table/Table.ts
|
|
3
|
-
var
|
|
4
|
+
var n = class extends HTMLElement {
|
|
4
5
|
constructor(...e) {
|
|
5
|
-
super(...e), this._observer = null;
|
|
6
|
+
super(...e), this._observer = null, this._disposeScrollFade = null;
|
|
6
7
|
}
|
|
7
8
|
connectedCallback() {
|
|
8
|
-
this.classList.add("mint-table-host"), this._observeChanges(), this._applyStyles(), requestAnimationFrame(() => {
|
|
9
|
+
this.classList.add("mint-table-host"), this._disposeScrollFade = t(this, "both"), this._observeChanges(), this._applyStyles(), requestAnimationFrame(() => {
|
|
9
10
|
this._applyStyles(), setTimeout(() => this._applyStyles(), 0);
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
disconnectedCallback() {
|
|
13
|
-
this._observer?.disconnect(), this._observer = null;
|
|
14
|
+
this._observer?.disconnect(), this._observer = null, this._disposeScrollFade?.(), this._disposeScrollFade = null;
|
|
14
15
|
}
|
|
15
16
|
_observeChanges() {
|
|
16
17
|
this._observer = new MutationObserver(() => this._applyStyles()), this._observer.observe(this, {
|
|
@@ -60,6 +61,6 @@ var t = class extends HTMLElement {
|
|
|
60
61
|
e.dataset.mtProcessed = "", e.innerHTML = n, Object.entries(t).forEach(([t, n]) => e.setAttribute(t, n));
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
customElements.get("mint-table") || e("mint-table",
|
|
64
|
+
customElements.get("mint-table") || e("mint-table", n);
|
|
64
65
|
//#endregion
|
|
65
|
-
export { t };
|
|
66
|
+
export { n as t };
|
|
@@ -20,8 +20,8 @@ import { a as e } from "../chunks/icon-Cxv9k3CY.js";
|
|
|
20
20
|
import { t } from "../chunks/register-element-BFYmIynH.js";
|
|
21
21
|
import "../chunks/icon-DMa6Oo80.js";
|
|
22
22
|
import "../chunks/caret-right-Bh7uMg-Y.js";
|
|
23
|
-
import "../chunks/input-
|
|
24
|
-
import "../chunks/popover-
|
|
23
|
+
import "../chunks/input-CdsHKiuL.js";
|
|
24
|
+
import "../chunks/popover-BRi53qYL.js";
|
|
25
25
|
e({
|
|
26
26
|
name: "calendar",
|
|
27
27
|
viewBox: "0 0 24 24",
|