@opentiny/vue-tooltip
Advanced tools
Comparing version 2.6.7 to 2.7.0
@@ -12,3 +12,3 @@ /** | ||
*/ | ||
import Tooltip from './src/index.vue'; | ||
import Tooltip from './src/index'; | ||
export default Tooltip; |
286
lib/index.js
@@ -1,74 +0,34 @@ | ||
import { renderless, api } from "@opentiny/vue-renderless/tooltip/vue"; | ||
import { defineComponent, $prefix, setup as _setup, createComponent, parseVnode } from "@opentiny/vue-common"; | ||
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { | ||
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; | ||
if (render) { | ||
options.render = render; | ||
options.staticRenderFns = staticRenderFns; | ||
options._compiled = true; | ||
} | ||
if (functionalTemplate) { | ||
options.functional = true; | ||
} | ||
if (scopeId) { | ||
options._scopeId = "data-v-" + scopeId; | ||
} | ||
var hook; | ||
if (moduleIdentifier) { | ||
hook = function hook2(context) { | ||
context = context || // cached call | ||
this.$vnode && this.$vnode.ssrContext || // stateful | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") { | ||
context = __VUE_SSR_CONTEXT__; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
if (injectStyles) { | ||
injectStyles.call(this, context); | ||
} | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; | ||
options._ssrRegister = hook; | ||
} else if (injectStyles) { | ||
hook = shadowMode ? function() { | ||
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot); | ||
} : injectStyles; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
options._injectStyles = hook; | ||
var originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context); | ||
return originalRender(h, context); | ||
}; | ||
} else { | ||
var existing = options.beforeCreate; | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
} | ||
return { | ||
exports: scriptExports, | ||
options | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
import "@opentiny/vue-theme/tooltip/index.css"; | ||
var __vue2_script = defineComponent({ | ||
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common"; | ||
import PcTemplate from "./pc.js"; | ||
import MobileFirstTemplate from "./mobile-first.js"; | ||
var template = function template2(mode) { | ||
if ("pc" === (process.env.TINY_MODE || mode)) { | ||
return PcTemplate; | ||
} | ||
if ("mobile-first" === (process.env.TINY_MODE || mode)) { | ||
return MobileFirstTemplate; | ||
} | ||
return PcTemplate; | ||
}; | ||
var Tooltip = defineComponent({ | ||
name: $prefix + "Tooltip", | ||
componentName: "Tooltip", | ||
props: { | ||
visible: { | ||
type: String, | ||
default: function _default() { | ||
return "always"; | ||
}, | ||
validator: function validator(value) { | ||
return ["always", "auto"].includes(value); | ||
} | ||
}, | ||
props: _extends({}, $props, { | ||
adjustArrow: { | ||
type: Boolean, | ||
default: function _default2() { | ||
default: function _default() { | ||
return false; | ||
@@ -79,3 +39,3 @@ } | ||
type: Boolean, | ||
default: function _default3() { | ||
default: function _default2() { | ||
return true; | ||
@@ -86,3 +46,3 @@ } | ||
type: Number, | ||
default: function _default4() { | ||
default: function _default3() { | ||
return 0; | ||
@@ -93,12 +53,6 @@ } | ||
type: Number, | ||
default: function _default5() { | ||
default: function _default4() { | ||
return 5; | ||
} | ||
}, | ||
closeDelay: { | ||
type: Number, | ||
default: function _default6() { | ||
return 300; | ||
} | ||
}, | ||
content: { | ||
@@ -110,11 +64,5 @@ type: String | ||
}, | ||
effect: { | ||
type: String, | ||
default: function _default7() { | ||
return "dark"; | ||
} | ||
}, | ||
enterable: { | ||
type: Boolean, | ||
default: function _default8() { | ||
default: function _default5() { | ||
return true; | ||
@@ -125,3 +73,3 @@ } | ||
type: Number, | ||
default: function _default9() { | ||
default: function _default6() { | ||
return 0; | ||
@@ -137,15 +85,27 @@ } | ||
offset: { | ||
default: function _default10() { | ||
default: function _default7() { | ||
return 0; | ||
} | ||
}, | ||
effect: { | ||
type: String, | ||
default: function _default8() { | ||
return "dark"; | ||
} | ||
}, | ||
openDelay: { | ||
type: Number, | ||
default: function _default11() { | ||
default: function _default9() { | ||
return 0; | ||
} | ||
}, | ||
closeDelay: { | ||
type: Number, | ||
default: function _default10() { | ||
return 100; | ||
} | ||
}, | ||
placement: { | ||
type: String, | ||
default: function _default12() { | ||
default: function _default11() { | ||
return "bottom"; | ||
@@ -159,3 +119,3 @@ } | ||
popperOptions: { | ||
default: function _default13() { | ||
default: function _default12() { | ||
return { | ||
@@ -176,3 +136,3 @@ gpuAcceleration: false, | ||
type: Number, | ||
default: function _default14() { | ||
default: function _default13() { | ||
return 0; | ||
@@ -183,3 +143,3 @@ } | ||
type: [Boolean, String], | ||
default: function _default15() { | ||
default: function _default14() { | ||
return true; | ||
@@ -190,3 +150,3 @@ } | ||
type: String, | ||
default: function _default16() { | ||
default: function _default15() { | ||
return "tiny-fade-in-linear"; | ||
@@ -197,3 +157,3 @@ } | ||
type: String, | ||
validator: function validator2(value) { | ||
validator: function validator(value) { | ||
return Boolean(~["normal", "warning", "error", "info", "success"].indexOf(value)); | ||
@@ -204,3 +164,3 @@ } | ||
type: Boolean, | ||
default: function _default17() { | ||
default: function _default16() { | ||
return true; | ||
@@ -211,150 +171,16 @@ } | ||
type: String, | ||
default: function _default18() { | ||
default: function _default17() { | ||
return "next"; | ||
} | ||
} | ||
}, | ||
}), | ||
setup: function setup(props, context) { | ||
return _setup({ | ||
return $setup({ | ||
props, | ||
context, | ||
renderless, | ||
api, | ||
mono: true | ||
template | ||
}); | ||
}, | ||
render: function render() { | ||
var _this = this; | ||
var h = arguments[0]; | ||
var getContent = function getContent2(vm) { | ||
var slotContent = vm.slots.content && vm.slots.content(); | ||
if (slotContent) { | ||
return slotContent; | ||
} | ||
var attrContent; | ||
if (vm.renderContent) { | ||
attrContent = vm.renderContent(h, vm.content); | ||
} else if (vm.pre) { | ||
attrContent = vm.content ? h("pre", vm.content) : null; | ||
} else { | ||
attrContent = vm.content; | ||
} | ||
return attrContent; | ||
}; | ||
Object.prototype.hasOwnProperty.call(this, "popperVM") || this.d({ | ||
popperVM: { | ||
get: function get() { | ||
return ( | ||
// 使用适配器里的createComponent创建一个新的vue的vnode节点为一个新组件,挂载到el下面去 | ||
createComponent({ | ||
el: document.createElement("div"), | ||
component: { | ||
render: function render2() { | ||
var content = getContent(_this); | ||
var propsData = { | ||
attrs: { | ||
name: _this.transition | ||
}, | ||
on: { | ||
"after-leave": _this.doDestroy | ||
} | ||
}; | ||
var typeClass = "is-" + (_this.type || _this.effect); | ||
var _mouseenter = function mouseenter() { | ||
return _this.setExpectedState(true); | ||
}; | ||
var _mouseleave = function mouseleave() { | ||
_this.setExpectedState(false); | ||
_this.debounceClose(); | ||
}; | ||
_this.$nextTick(function() { | ||
return _this.updatePopper(); | ||
}); | ||
return h("transition", propsData, [h("div", { | ||
"ref": "popper", | ||
"attrs": { | ||
"id": _this.state.tooltipId, | ||
"appendToBody": _this.appendToBody, | ||
"role": "tooltip", | ||
"aria-hidden": _this.disabled || !_this.state.showPopper ? "true" : "false" | ||
}, | ||
"directives": [{ | ||
name: "show", | ||
value: !_this.disabled && _this.state.showPopper && content | ||
}], | ||
"class": ["tiny-tooltip", "tiny-tooltip__popper", typeClass, _this.popperClass], | ||
"on": { | ||
"mouseenter": function mouseenter() { | ||
return _mouseenter(); | ||
}, | ||
"mouseleave": function mouseleave() { | ||
return _mouseleave(); | ||
} | ||
} | ||
}, [content])]); | ||
} | ||
} | ||
}) | ||
); | ||
} | ||
} | ||
}); | ||
var stringifyClassObj = function stringifyClassObj2(classObj) { | ||
return Object.keys(classObj).filter(function(key) { | ||
return classObj[key]; | ||
}).join(" "); | ||
}; | ||
var stringifyClassArr = function stringifyClassArr2(classArr) { | ||
return classArr.filter(function(item) { | ||
return item; | ||
}).map(function(item) { | ||
return typeof item === "string" ? item.trim() : typeof item === "object" ? stringifyClassObj(item) : ""; | ||
}).join(" "); | ||
}; | ||
var addTooltipClass = function addTooltipClass2(bindClass) { | ||
var className = ""; | ||
if (bindClass) { | ||
if (typeof bindClass === "string") { | ||
className = bindClass.trim(); | ||
} else if (Array.isArray(bindClass)) { | ||
className = stringifyClassArr(bindClass); | ||
} else if (typeof bindClass === "object") { | ||
className = stringifyClassObj(bindClass); | ||
} | ||
} | ||
return "tiny-tooltip " + className.replace(/\btiny-tooltip\b/g, "").trim(); | ||
}; | ||
var getFirstElement = function getFirstElement2() { | ||
var slots = _this.slots.default && _this.slots.default(); | ||
if (!Array.isArray(slots)) | ||
return null; | ||
var element = null; | ||
for (var index = 0; index < slots.length; index++) { | ||
var vnode = parseVnode(slots[index]); | ||
if (vnode && vnode.type) { | ||
element = vnode; | ||
} | ||
} | ||
return element; | ||
}; | ||
var firstElement = getFirstElement(); | ||
if (!firstElement) | ||
return null; | ||
var data = firstElement.data || firstElement.props || (firstElement.props = {}); | ||
data.class = addTooltipClass(data.class); | ||
return firstElement; | ||
} | ||
}); | ||
var __vue2_render, __vue2_staticRenderFns; | ||
var __cssModules = {}; | ||
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles, null, null, null); | ||
function __vue2_injectStyles(context) { | ||
for (var o in __cssModules) { | ||
this[o] = __cssModules[o]; | ||
} | ||
} | ||
var Tooltip = /* @__PURE__ */ function() { | ||
return __component__.exports; | ||
}(); | ||
var version = "3.7.0"; | ||
var version = "2.7.0"; | ||
Tooltip.model = { | ||
@@ -361,0 +187,0 @@ prop: "modelValue", |
{ | ||
"name": "@opentiny/vue-tooltip", | ||
"version": "2.6.7", | ||
"version": "2.7.0", | ||
"description": "", | ||
"main": "./lib/index.js", | ||
"module": "./lib/index.js", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@opentiny/vue-renderless": "~3.6.6", | ||
"@opentiny/vue-common": "~2.6.7" | ||
"@opentiny/vue-renderless": "~3.9.0", | ||
"@opentiny/vue-common": "~2.7.0" | ||
}, | ||
@@ -10,0 +12,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40742
10
1400
3
1
+ Added@opentiny/vue-common@2.7.0(transitive)
+ Added@opentiny/vue-locale@2.7.0(transitive)
+ Added@opentiny/vue-renderless@3.9.3(transitive)
+ Added@opentiny/vue-theme@3.9.4(transitive)
+ Added@opentiny/vue-theme-mobile@3.9.0(transitive)
+ Addedtailwind-merge@1.14.0(transitive)
- Removed@babel/helper-string-parser@7.24.8(transitive)
- Removed@babel/helper-validator-identifier@7.24.7(transitive)
- Removed@babel/parser@7.25.6(transitive)
- Removed@babel/types@7.25.6(transitive)
- Removed@opentiny/vue-common@2.6.7(transitive)
- Removed@opentiny/vue-locale@2.6.7(transitive)
- Removed@opentiny/vue-renderless@3.6.8(transitive)
- Removed@opentiny/vue-theme@3.6.7(transitive)
- Removed@opentiny/vue-theme-mobile@3.6.6(transitive)
- Removed@vue/compiler-sfc@2.7.16(transitive)
- Removed@vue/composition-api@1.2.4(transitive)
- Removedcsstype@3.1.3(transitive)
- Removednanoid@3.3.7(transitive)
- Removedpicocolors@1.1.0(transitive)
- Removedpostcss@8.4.45(transitive)
- Removedprettier@2.8.8(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedto-fast-properties@2.0.0(transitive)
- Removedtslib@2.7.0(transitive)
- Removedvue@2.7.16(transitive)
Updated@opentiny/vue-common@~2.7.0