拿掉 build files

This commit is contained in:
2022-07-18 16:33:23 +08:00
parent 41e2287bcb
commit 3707f158a3
31953 changed files with 0 additions and 4411796 deletions
-63
View File
@@ -1,63 +0,0 @@
function defaultConditional() {
return true;
}
function directive(e, el, binding) {
const handler = typeof binding.value === 'function' ? binding.value : binding.value.handler;
const isActive = typeof binding.value === 'object' && binding.value.closeConditional || defaultConditional; // The include element callbacks below can be expensive
// so we should avoid calling them when we're not active.
// Explicitly check for false to allow fallback compatibility
// with non-toggleable components
if (!e || isActive(e) === false) return; // If click was triggered programmaticaly (domEl.click()) then
// it shouldn't be treated as click-outside
// Chrome/Firefox support isTrusted property
// IE/Edge support pointerType property (empty if not triggered
// by pointing device)
if ('isTrusted' in e && !e.isTrusted || 'pointerType' in e && !e.pointerType) return; // Check if additional elements were passed to be included in check
// (click must be outside all included elements, if any)
const elements = (typeof binding.value === 'object' && binding.value.include || (() => []))(); // Add the root element for the component this directive was defined on
elements.push(el); // Check if it's a click outside our elements, and then if our callback returns true.
// Non-toggleable components should take action in their callback and return falsy.
// Toggleable can return true if it wants to deactivate.
// Note that, because we're in the capture phase, this callback will occur before
// the bubbling click event on any outside elements.
!elements.some(el => el.contains(e.target)) && setTimeout(() => {
isActive(e) && handler && handler(e);
}, 0);
}
export const ClickOutside = {
// [data-app] may not be found
// if using bind, inserted makes
// sure that the root element is
// available, iOS does not support
// clicks on body
inserted(el, binding) {
const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document
// or body, this is the entire purpose of the v-app
// component and [data-app], stop removing this
const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests
app.addEventListener('click', onClick, true);
el._clickOutside = onClick;
},
unbind(el) {
if (!el._clickOutside) return;
const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests
app && app.removeEventListener('click', el._clickOutside, true);
delete el._clickOutside;
}
};
export default ClickOutside;
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/directives/click-outside/index.ts"],"names":[],"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AAiD;AACvD,UAAM,OAAO,GAAI,CAAD,IAAc,SAAS,CAAC,CAAD,EAAoB,EAApB,EAAwB,OAAxB,CAAvC,CADuD,CAEvD;AACA;AACA;;;AACA,UAAM,GAAG,GAAG,QAAQ,CAAC,aAAT,CAAuB,YAAvB,KACV,QAAQ,CAAC,IADX,CALuD,CAMvC;;AAChB,IAAA,GAAG,CAAC,gBAAJ,CAAqB,OAArB,EAA8B,OAA9B,EAAuC,IAAvC;AACA,IAAA,EAAE,CAAC,aAAH,GAAmB,OAAnB;AACD,GAfyB;;AAiB1B,EAAA,MAAM,CAAE,EAAF,EAAiB;AACrB,QAAI,CAAC,EAAE,CAAC,aAAR,EAAuB;AAEvB,UAAM,GAAG,GAAG,QAAQ,CAAC,aAAT,CAAuB,YAAvB,KACV,QAAQ,CAAC,IADX,CAHqB,CAIL;;AAChB,IAAA,GAAG,IAAI,GAAG,CAAC,mBAAJ,CAAwB,OAAxB,EAAiC,EAAE,CAAC,aAApC,EAAmD,IAAnD,CAAP;AACA,WAAO,EAAE,CAAC,aAAV;AACD;;AAxByB,CAArB;AA2BP,eAAe,YAAf","sourcesContent":["import { VNodeDirective } from 'vue/types/vnode'\n\ninterface ClickOutsideBindingArgs {\n handler: (e: Event) => void\n closeConditional?: (e: Event) => boolean\n include?: () => HTMLElement[]\n}\n\ninterface ClickOutsideDirective extends VNodeDirective {\n value?: ((e: Event) => void) | ClickOutsideBindingArgs\n}\n\nfunction defaultConditional () {\n return true\n}\n\nfunction directive (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective): void {\n const handler = typeof binding.value === 'function' ? binding.value : binding.value!.handler\n\n const isActive = (typeof binding.value === 'object' && binding.value.closeConditional) || defaultConditional\n\n // The include element callbacks below can be expensive\n // so we should avoid calling them when we're not active.\n // Explicitly check for false to allow fallback compatibility\n // with non-toggleable components\n if (!e || isActive(e) === false) return\n\n // If click was triggered programmaticaly (domEl.click()) then\n // it shouldn't be treated as click-outside\n // Chrome/Firefox support isTrusted property\n // IE/Edge support pointerType property (empty if not triggered\n // by pointing device)\n if (('isTrusted' in e && !e.isTrusted) ||\n ('pointerType' in e && !e.pointerType)\n ) return\n\n // Check if additional elements were passed to be included in check\n // (click must be outside all included elements, if any)\n const elements = ((typeof binding.value === 'object' && binding.value.include) || (() => []))()\n // Add the root element for the component this directive was defined on\n elements.push(el)\n\n // Check if it's a click outside our elements, and then if our callback returns true.\n // Non-toggleable components should take action in their callback and return falsy.\n // Toggleable can return true if it wants to deactivate.\n // Note that, because we're in the capture phase, this callback will occur before\n // the bubbling click event on any outside elements.\n !elements.some(el => el.contains(e.target as Node)) && setTimeout(() => {\n isActive(e) && handler && handler(e)\n }, 0)\n}\n\nexport const ClickOutside = {\n // [data-app] may not be found\n // if using bind, inserted makes\n // sure that the root element is\n // available, iOS does not support\n // clicks on body\n inserted (el: HTMLElement, binding: ClickOutsideDirective) {\n const onClick = (e: Event) => directive(e as PointerEvent, el, binding)\n // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n const app = document.querySelector('[data-app]') ||\n document.body // This is only for unit tests\n app.addEventListener('click', onClick, true)\n el._clickOutside = onClick\n },\n\n unbind (el: HTMLElement) {\n if (!el._clickOutside) return\n\n const app = document.querySelector('[data-app]') ||\n document.body // This is only for unit tests\n app && app.removeEventListener('click', el._clickOutside, true)\n delete el._clickOutside\n },\n}\n\nexport default ClickOutside\n"],"sourceRoot":"","file":"index.js"}