bootstrap-vue-next
Version:
BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.
3 lines (2 loc) • 3.87 kB
JavaScript
;const e=require("vue");function t(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}function n(t){return"function"==typeof t?t():e.unref(t)}const o="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const r=Object.prototype.toString,u=()=>{},i=s();function s(){var e,t;return o&&(null==(e=null==window?void 0:window.navigator)?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(null==(t=null==window?void 0:window.navigator)?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(null==window?void 0:window.navigator.userAgent))}function c(e,t){return function(...n){return new Promise(((o,r)=>{Promise.resolve(e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})).then(o).catch(r)}))}}const l=e=>e();const a=/-(\w)/g,f=function(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}((e=>e.replace(a,((e,t)=>t?t.toUpperCase():""))));function p(t,n,o={}){const{eventFilter:r,...u}=o,{eventFilter:i,pause:s,resume:a,isActive:f}=function(t=l){const n=e.ref(!0);return{isActive:e.readonly(n),pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...e)=>{n.value&&t(...e)}}}(r),p=function(t,n,o={}){const{eventFilter:r=l,...u}=o;return e.watch(t,c(r,n),u)}(t,n,{...u,eventFilter:i});return{stop:p,pause:s,resume:a,isActive:f}}exports.camelize=f,exports.increaseWithUnit=function(e,t){var n;if("number"==typeof e)return e+t;const o=(null==(n=e.match(/^-?\d+\.?\d*/))?void 0:n[0])||"",r=e.slice(o.length),u=Number.parseFloat(o)+t;return Number.isNaN(u)?e:u+r},exports.isClient=o,exports.isIOS=i,exports.isObject=e=>"[object Object]"===r.call(e),exports.makeDestructurable=function(e,t){if("undefined"!=typeof Symbol){const n={...e};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let e=0;return{next:()=>({value:t[e++],done:e>t.length})}}}),n}return Object.assign([...t],e)},exports.noop=u,exports.notNullish=e=>null!=e,exports.syncRef=function(e,t,...[n]){const{flush:o="sync",deep:r=!1,immediate:u=!0,direction:i="both",transform:s={}}=n||{},c=[],l="ltr"in s&&s.ltr||(e=>e),a="rtl"in s&&s.rtl||(e=>e);return"both"!==i&&"ltr"!==i||c.push(p(e,(e=>{c.forEach((e=>e.pause())),t.value=l(e),c.forEach((e=>e.resume()))}),{flush:o,deep:r,immediate:u})),"both"!==i&&"rtl"!==i||c.push(p(t,(t=>{c.forEach((e=>e.pause())),e.value=a(t),c.forEach((e=>e.resume()))}),{flush:o,deep:r,immediate:u})),()=>{c.forEach((e=>e.stop()))}},exports.timestamp=()=>+Date.now(),exports.toRef=function(...t){if(1!==t.length)return e.toRef(...t);const n=t[0];return"function"==typeof n?e.readonly(e.customRef((()=>({get:n,set:u})))):e.ref(n)},exports.toValue=n,exports.tryOnMounted=function(t,n=!0,o){e.getCurrentInstance()?e.onMounted(t,o):n?t():e.nextTick(t)},exports.tryOnScopeDispose=t,exports.useDebounceFn=function(e,t=200,o={}){return c(function(e,t={}){let o,r,i=u;const s=e=>{clearTimeout(e),i(),i=u};return u=>{const c=n(e),l=n(t.maxWait);return o&&s(o),c<=0||void 0!==l&&l<=0?(r&&(s(r),r=null),Promise.resolve(u())):new Promise(((e,n)=>{i=t.rejectOnCancel?n:e,l&&!r&&(r=setTimeout((()=>{o&&s(o),r=null,e(u())}),l)),o=setTimeout((()=>{r&&s(r),r=null,e(u())}),c)}))}}(t,o),e)},exports.useIntervalFn=function(r,u=1e3,i={}){const{immediate:s=!0,immediateCallback:c=!1}=i;let l=null;const a=e.ref(!1);function f(){l&&(clearInterval(l),l=null)}function p(){a.value=!1,f()}function d(){const e=n(u);e<=0||(a.value=!0,c&&r(),f(),l=setInterval(r,e))}if(s&&o&&d(),e.isRef(u)||"function"==typeof u){t(e.watch(u,(()=>{a.value&&o&&d()})))}return t(p),{isActive:a,pause:p,resume:d}},exports.useToNumber=function(t,o={}){const{method:r="parseFloat",radix:u,nanToZero:i}=o;return e.computed((()=>{let e=n(t);return"string"==typeof e&&(e=Number[r](e,u)),i&&Number.isNaN(e)&&(e=0),e}))},exports.watchPausable=p;
//# sourceMappingURL=index-BInTFWT4.js.map