@opentiny/vue-dialog-box
Advanced tools
Comparing version 2.6.0 to 2.6.1-alpha.0
165
lib/index.js
@@ -1,64 +0,33 @@ | ||
import { $prefix, $props, $setup } from '@opentiny/vue-common'; | ||
import PCTemplate from './pc'; | ||
import MobileTemplate from './mobile'; | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
enumerableOnly && (symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
})), keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
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]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = null != arguments[i] ? arguments[i] : {}; | ||
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common"; | ||
import PcTemplate from "./pc.js"; | ||
import MobileTemplate from "./mobile.js"; | ||
var template = function template2(mode) { | ||
if ("mobile" === (process.env.TINY_MODE || mode)) | ||
return MobileTemplate; | ||
else | ||
return PcTemplate; | ||
}; | ||
var $constants = { | ||
DIALOG_SLIDER_RIGHT: 'dialog-slideRight', | ||
DIALOG_FADE: 'dialog-fade', | ||
SELECT_DROPDOWN: $prefix + 'SelectDropdown', | ||
DROPDOWN_MENU: $prefix + 'DropdownMenu', | ||
DIALOG_BOX_CLASS: 'div.tiny-dialog-box', | ||
PC_SCROLL_LOCK_CLASS: 'tiny-dialog-box__scroll-lock', | ||
MOBILE_SCROLL_LOCK_CLASS: 'tiny-mobile-dialog-box__scroll-lock', | ||
Mode: 'pc', | ||
DIALOG_SLIDER_RIGHT: "dialog-slideRight", | ||
DIALOG_FADE: "dialog-fade", | ||
SELECT_DROPDOWN: $prefix + "SelectDropdown", | ||
DROPDOWN_MENU: $prefix + "DropdownMenu", | ||
DIALOG_BOX_CLASS: "div.tiny-dialog-box", | ||
PC_SCROLL_LOCK_CLASS: "tiny-dialog-box__scroll-lock", | ||
MOBILE_SCROLL_LOCK_CLASS: "tiny-mobile-dialog-box__scroll-lock", | ||
Mode: "pc", | ||
scrollLockClass: function scrollLockClass(mode) { | ||
@@ -68,12 +37,9 @@ return mode === this.Mode ? this.PC_SCROLL_LOCK_CLASS : this.MOBILE_SCROLL_LOCK_CLASS; | ||
}; | ||
var template = function template(mode) { | ||
if (process.env.TINY_MODE === 'pc') return PCTemplate;else if (process.env.TINY_MODE === 'mobile') return MobileTemplate;else return mode === 'mobile' ? MobileTemplate : PCTemplate; | ||
}; | ||
var DialogBox = { | ||
name: $prefix + 'DialogBox', | ||
var DialogBox = defineComponent({ | ||
name: $prefix + "DialogBox", | ||
model: { | ||
prop: 'visible', | ||
event: 'update:visible' | ||
prop: "visible", | ||
event: "update:visible" | ||
}, | ||
props: _objectSpread2(_objectSpread2({}, $props), {}, { | ||
props: _extends({}, $props, { | ||
_constants: { | ||
@@ -87,3 +53,3 @@ type: Object, | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default2() { | ||
return false; | ||
@@ -95,3 +61,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default3() { | ||
return false; | ||
@@ -102,3 +68,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default4() { | ||
return true; | ||
@@ -109,3 +75,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default5() { | ||
return true; | ||
@@ -117,4 +83,4 @@ } | ||
type: String, | ||
default: function _default() { | ||
return ''; | ||
default: function _default6() { | ||
return ""; | ||
} | ||
@@ -124,3 +90,3 @@ }, | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default7() { | ||
return false; | ||
@@ -131,3 +97,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default8() { | ||
return false; | ||
@@ -138,3 +104,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default9() { | ||
return true; | ||
@@ -145,3 +111,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default10() { | ||
return true; | ||
@@ -152,3 +118,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default11() { | ||
return true; | ||
@@ -159,3 +125,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default12() { | ||
return true; | ||
@@ -166,3 +132,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default13() { | ||
return false; | ||
@@ -173,3 +139,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default14() { | ||
return false; | ||
@@ -180,3 +146,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default15() { | ||
return true; | ||
@@ -187,3 +153,3 @@ } | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default16() { | ||
return true; | ||
@@ -194,4 +160,4 @@ } | ||
type: String, | ||
default: function _default() { | ||
return ''; | ||
default: function _default17() { | ||
return ""; | ||
} | ||
@@ -202,3 +168,3 @@ }, | ||
type: Boolean, | ||
default: function _default() { | ||
default: function _default18() { | ||
return false; | ||
@@ -209,4 +175,4 @@ } | ||
type: String, | ||
default: function _default() { | ||
return '500px'; | ||
default: function _default19() { | ||
return "500px"; | ||
} | ||
@@ -217,14 +183,15 @@ } | ||
return $setup({ | ||
props: props, | ||
context: context, | ||
template: template | ||
props, | ||
context, | ||
template | ||
}); | ||
} | ||
}; | ||
DialogBox.install = function (Vue) { | ||
}); | ||
var version = "3.7.0"; | ||
DialogBox.install = function(Vue) { | ||
Vue.component(DialogBox.name, DialogBox); | ||
}; | ||
DialogBox.version = '2.6.0'; | ||
export { DialogBox as default }; | ||
DialogBox.version = version; | ||
export { | ||
DialogBox as default | ||
}; |
@@ -1,117 +0,43 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/dialog-box/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import '@opentiny/vue-theme-mobile/dialog-box/index.css'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
var script = { | ||
emits: ['update:visible', 'change', 'before-close', 'open', 'close', 'opened', 'confirm', 'cancel', 'closed'], | ||
props: [].concat(_toConsumableArray(props), ['visible', 'title', 'modal', 'closeOnClickModal', 'modalAppendToBody', 'appendToBody', 'width', 'top', 'showHeader', 'destroyOnClose']), | ||
model: { | ||
prop: 'visible', | ||
event: 'update:visible' | ||
}, | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
}); | ||
import { renderless, api } from "@opentiny/vue-renderless/dialog-box/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import "@opentiny/vue-theme-mobile/dialog-box/index.css"; | ||
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; | ||
} | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier | ||
/* server only */ | ||
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
} // Vue.extend constructor export interop. | ||
var options = typeof script === 'function' ? script.options : script; // render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; // functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} // scopedId | ||
if (functionalTemplate) { | ||
options.functional = true; | ||
} | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
options._scopeId = "data-v-" + scopeId; | ||
} | ||
var hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function hook(context) { | ||
// 2.3 injection | ||
hook = function hook2(context) { | ||
context = context || // cached call | ||
this.$vnode && this.$vnode.ssrContext || // stateful | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") { | ||
context = __VUE_SSR_CONTEXT__; | ||
} // inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} // register component module identifier for async chunk inference | ||
} | ||
if (injectStyles) { | ||
injectStyles.call(this, context); | ||
} | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; // used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
}; | ||
options._ssrRegister = hook; | ||
} else if (style) { | ||
hook = shadowMode ? function () { | ||
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); | ||
} : function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} else if (injectStyles) { | ||
hook = shadowMode ? function() { | ||
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot); | ||
} : injectStyles; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
options._injectStyles = hook; | ||
var originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
@@ -122,3 +48,2 @@ hook.call(context); | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate; | ||
@@ -128,18 +53,33 @@ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
return script; | ||
return { | ||
exports: scriptExports, | ||
options | ||
}; | ||
} | ||
var normalizeComponent_1 = normalizeComponent; | ||
var __vue_script__ = script; | ||
var __vue_render__ = function __vue_render__() { | ||
var __vue2_script = defineComponent({ | ||
emits: ["update:visible", "change", "before-close", "open", "close", "opened", "confirm", "cancel", "closed"], | ||
props: [].concat(props, ["visible", "title", "modal", "closeOnClickModal", "modalAppendToBody", "appendToBody", "width", "top", "showHeader", "destroyOnClose"]), | ||
model: { | ||
prop: "visible", | ||
event: "update:visible" | ||
}, | ||
setup: function setup(props2, context) { | ||
return _setup({ | ||
props: props2, | ||
context, | ||
renderless, | ||
api | ||
}); | ||
} | ||
}); | ||
var render = function render2() { | ||
var _vm = this; | ||
var _h = _vm.$createElement; | ||
var _c = _vm._self._c || _h; | ||
return _c('transition', { | ||
return _c("transition", { | ||
attrs: { | ||
"name": "dialog-fade" | ||
} | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
directives: [{ | ||
@@ -154,9 +94,8 @@ name: "show", | ||
"click": function click($event) { | ||
if ($event.target !== $event.currentTarget) { | ||
if ($event.target !== $event.currentTarget) | ||
return null; | ||
} | ||
return _vm.handleWrapperClick.apply(null, arguments); | ||
} | ||
} | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
key: _vm.state.key, | ||
@@ -166,16 +105,16 @@ ref: "dialog", | ||
class: { | ||
'is-hide-header': !_vm.showHeader | ||
"is-hide-header": !_vm.showHeader | ||
} | ||
}, [_vm.showHeader ? _c('div', { | ||
}, [_vm.showHeader ? _c("div", { | ||
staticClass: "tiny-mobile-dialog-box__header" | ||
}, [_vm._t("title", function () { | ||
return [_c('span', { | ||
}, [_vm._t("title", function() { | ||
return [_c("span", { | ||
staticClass: "tiny-mobile-dialog-box__title" | ||
}, [_vm._v(_vm._s(_vm.title))])]; | ||
})], 2) : _vm._e(), _vm._v(" "), _c('div', { | ||
})], 2) : _vm._e(), _c("div", { | ||
staticClass: "tiny-mobile-dialog-box__body" | ||
}, [_vm._t("default")], 2), _vm._v(" "), _c('div', { | ||
}, [_vm._t("default")], 2), _c("div", { | ||
staticClass: "tiny-mobile-dialog-box__footer" | ||
}, [_vm._t("footer", function () { | ||
return [_c('button', { | ||
}, [_vm._t("footer", function() { | ||
return [_c("button", { | ||
staticClass: "tiny-mobile-dialog-box__button cancel-button", | ||
@@ -188,3 +127,3 @@ attrs: { | ||
} | ||
}, [_vm._v("\n " + _vm._s(_vm.t('ui.dialogBox.cancel')) + "\n ")]), _vm._v(" "), _c('button', { | ||
}, [_vm._v(" " + _vm._s(_vm.t("ui.dialogBox.cancel")) + " ")]), _c("button", { | ||
staticClass: "tiny-mobile-dialog-box__button confirm-button", | ||
@@ -197,15 +136,18 @@ attrs: { | ||
} | ||
}, [_vm._v("\n " + _vm._s(_vm.t('ui.dialogBox.confirm')) + "\n ")])]; | ||
}, [_vm._v(" " + _vm._s(_vm.t("ui.dialogBox.confirm")) + " ")])]; | ||
})], 2)])])]); | ||
}; | ||
var __vue_staticRenderFns__ = []; | ||
var __vue_inject_styles__ = undefined; | ||
var __vue_scope_id__ = undefined; | ||
var __vue_module_identifier__ = undefined; | ||
var __vue_is_functional_template__ = false; | ||
var __vue_component__ = normalizeComponent_1({ | ||
render: __vue_render__, | ||
staticRenderFns: __vue_staticRenderFns__ | ||
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined); | ||
export { __vue_component__ as default }; | ||
var staticRenderFns = []; | ||
var __cssModules = {}; | ||
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null); | ||
function __vue2_injectStyles(context) { | ||
for (var o in __cssModules) { | ||
this[o] = __cssModules[o]; | ||
} | ||
} | ||
var mobile = /* @__PURE__ */ function() { | ||
return __component__.exports; | ||
}(); | ||
export { | ||
mobile as default | ||
}; |
242
lib/pc.js
@@ -1,128 +0,44 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/dialog-box/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import { iconClose, iconFullscreen, iconMinscreen } from '@opentiny/vue-icon'; | ||
import '@opentiny/vue-theme/dialog-box/index.css'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
var script = { | ||
components: { | ||
IconClose: iconClose(), | ||
IconFullscreen: iconFullscreen(), | ||
IconMinscreen: iconMinscreen() | ||
}, | ||
emits: ['update:visible', 'change', 'before-close', 'open', 'close', 'opened', 'confirm', 'cancel', 'closed', 'drag-start', 'drag-move', 'drag-end'], | ||
props: [].concat(_toConsumableArray(props), ['resize', 'isFormReset', 'visible', 'title', 'modal', 'modalAppendToBody', 'appendToBody', 'lockScroll', 'closeOnClickModal', 'closeOnPressEscape', 'showClose', 'width', 'fullscreen', 'top', 'center', 'draggable', 'showHeader', 'rightSlide', 'destroyOnClose', 'dialogClass', 'beforeClose']), | ||
model: { | ||
prop: 'visible', | ||
event: 'update:visible' | ||
}, | ||
provide: function provide() { | ||
return { | ||
dialog: this | ||
}; | ||
}, | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
}); | ||
import { renderless, api } from "@opentiny/vue-renderless/dialog-box/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import { iconClose, iconFullscreen, iconMinscreen } from "@opentiny/vue-icon"; | ||
import "@opentiny/vue-theme/dialog-box/index.css"; | ||
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; | ||
} | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier | ||
/* server only */ | ||
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
} // Vue.extend constructor export interop. | ||
var options = typeof script === 'function' ? script.options : script; // render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; // functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} // scopedId | ||
if (functionalTemplate) { | ||
options.functional = true; | ||
} | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
options._scopeId = "data-v-" + scopeId; | ||
} | ||
var hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function hook(context) { | ||
// 2.3 injection | ||
hook = function hook2(context) { | ||
context = context || // cached call | ||
this.$vnode && this.$vnode.ssrContext || // stateful | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") { | ||
context = __VUE_SSR_CONTEXT__; | ||
} // inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} // register component module identifier for async chunk inference | ||
} | ||
if (injectStyles) { | ||
injectStyles.call(this, context); | ||
} | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; // used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
}; | ||
options._ssrRegister = hook; | ||
} else if (style) { | ||
hook = shadowMode ? function () { | ||
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); | ||
} : function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} else if (injectStyles) { | ||
hook = shadowMode ? function() { | ||
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot); | ||
} : injectStyles; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
options._injectStyles = hook; | ||
var originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
@@ -133,3 +49,2 @@ hook.call(context); | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate; | ||
@@ -139,14 +54,39 @@ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
return script; | ||
return { | ||
exports: scriptExports, | ||
options | ||
}; | ||
} | ||
var normalizeComponent_1 = normalizeComponent; | ||
var __vue_script__ = script; | ||
var __vue_render__ = function __vue_render__() { | ||
var __vue2_script = defineComponent({ | ||
components: { | ||
IconClose: iconClose(), | ||
IconFullscreen: iconFullscreen(), | ||
IconMinscreen: iconMinscreen() | ||
}, | ||
emits: ["update:visible", "change", "before-close", "open", "close", "opened", "confirm", "cancel", "closed", "drag-start", "drag-move", "drag-end"], | ||
props: [].concat(props, ["resize", "isFormReset", "visible", "title", "modal", "modalAppendToBody", "appendToBody", "lockScroll", "closeOnClickModal", "closeOnPressEscape", "showClose", "width", "fullscreen", "top", "center", "draggable", "showHeader", "rightSlide", "destroyOnClose", "dialogClass", "beforeClose"]), | ||
model: { | ||
prop: "visible", | ||
event: "update:visible" | ||
}, | ||
provide: function provide() { | ||
return { | ||
dialog: this | ||
}; | ||
}, | ||
setup: function setup(props2, context) { | ||
return _setup({ | ||
props: props2, | ||
context, | ||
renderless, | ||
api | ||
}); | ||
} | ||
}); | ||
var render = function render2() { | ||
var _vm = this; | ||
var _h = _vm.$createElement; | ||
var _c = _vm._self._c || _h; | ||
return _c('transition', { | ||
return _c("transition", { | ||
attrs: { | ||
@@ -159,3 +99,3 @@ "name": _vm.state.animationName | ||
} | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
directives: [{ | ||
@@ -167,12 +107,11 @@ name: "show", | ||
}], | ||
class: ['tiny-dialog-box__wrapper', _vm.dialogClass], | ||
class: ["tiny-dialog-box__wrapper", _vm.dialogClass], | ||
on: { | ||
"click": function click($event) { | ||
if ($event.target !== $event.currentTarget) { | ||
if ($event.target !== $event.currentTarget) | ||
return null; | ||
} | ||
return _vm.handleWrapperClick.apply(null, arguments); | ||
} | ||
} | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
key: _vm.state.key, | ||
@@ -182,8 +121,8 @@ ref: "dialog", | ||
class: [{ | ||
'is-fullscreen': _vm.state.isFull, | ||
'is-center': _vm.center, | ||
'is-right-slide': _vm.rightSlide | ||
"is-fullscreen": _vm.state.isFull, | ||
"is-center": _vm.center, | ||
"is-right-slide": _vm.rightSlide | ||
}], | ||
style: _vm.state.style | ||
}, [_vm.showHeader ? _c('div', { | ||
}, [_vm.showHeader ? _c("div", { | ||
staticClass: "tiny-dialog-box__header", | ||
@@ -193,7 +132,7 @@ on: { | ||
} | ||
}, [_vm._t("title", function () { | ||
return [_c('span', { | ||
}, [_vm._t("title", function() { | ||
return [_c("span", { | ||
staticClass: "tiny-dialog-box__title" | ||
}, [_vm._v(_vm._s(_vm.title))])]; | ||
}), _vm._v(" "), _vm.showClose ? _c('button', { | ||
}), _vm.showClose ? _c("button", { | ||
staticClass: "tiny-dialog-box__headerbtn", | ||
@@ -206,8 +145,8 @@ attrs: { | ||
"click": function click($event) { | ||
return _vm.handleClose('close', $event); | ||
return _vm.handleClose("close", $event); | ||
} | ||
} | ||
}, [_c('icon-close', { | ||
}, [_c("icon-close", { | ||
staticClass: "tiny-svg-size tiny-dialog-box__close" | ||
})], 1) : _vm._e(), _vm._v(" "), _vm.resize && !_vm.state.isFull ? _c('button', { | ||
})], 1) : _vm._e(), _vm.resize && !_vm.state.isFull ? _c("button", { | ||
staticClass: "tiny-dialog-box__headerbtn", | ||
@@ -223,5 +162,5 @@ attrs: { | ||
} | ||
}, [_c('icon-fullscreen', { | ||
}, [_c("icon-fullscreen", { | ||
staticClass: "tiny-svg-size tiny-dialog-box__close" | ||
})], 1) : _vm._e(), _vm._v(" "), _vm.resize && _vm.state.isFull ? _c('button', { | ||
})], 1) : _vm._e(), _vm.resize && _vm.state.isFull ? _c("button", { | ||
staticClass: "tiny-dialog-box__headerbtn", | ||
@@ -237,7 +176,7 @@ attrs: { | ||
} | ||
}, [_c('icon-minscreen', { | ||
}, [_c("icon-minscreen", { | ||
staticClass: "tiny-svg-size tiny-dialog-box__close" | ||
})], 1) : _vm._e()], 2) : _vm._e(), _vm._v(" "), _c('div', { | ||
})], 1) : _vm._e()], 2) : _vm._e(), _c("div", { | ||
staticClass: "tiny-dialog-box__body" | ||
}, [_vm._t("default")], 2), _vm._v(" "), _vm.slots.footer ? _c('div', { | ||
}, [_vm._t("default")], 2), _vm.slots.footer ? _c("div", { | ||
staticClass: "tiny-dialog-box__footer" | ||
@@ -248,12 +187,15 @@ }, [_vm._t("footer", null, { | ||
}; | ||
var __vue_staticRenderFns__ = []; | ||
var __vue_inject_styles__ = undefined; | ||
var __vue_scope_id__ = undefined; | ||
var __vue_module_identifier__ = undefined; | ||
var __vue_is_functional_template__ = false; | ||
var __vue_component__ = normalizeComponent_1({ | ||
render: __vue_render__, | ||
staticRenderFns: __vue_staticRenderFns__ | ||
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined); | ||
export { __vue_component__ as default }; | ||
var staticRenderFns = []; | ||
var __cssModules = {}; | ||
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null); | ||
function __vue2_injectStyles(context) { | ||
for (var o in __cssModules) { | ||
this[o] = __cssModules[o]; | ||
} | ||
} | ||
var pc = /* @__PURE__ */ function() { | ||
return __component__.exports; | ||
}(); | ||
export { | ||
pc as default | ||
}; |
{ | ||
"name": "@opentiny/vue-dialog-box", | ||
"version": "2.6.0", | ||
"version": "2.6.1-alpha.0", | ||
"description": "", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"lint": "eslint src/**/*{.js,.html,.vue} --quiet", | ||
"build:ui2": "cross-env BUILD_TARGET=single NODE_ENV=production node ../../build/build-ui.js", | ||
"build:ui3": "cross-env BUILD_TARGET=single NODE_ENV=production node ../../example/build/build-ui.js" | ||
}, | ||
"main": "./lib/index.js", | ||
"dependencies": { | ||
"@opentiny/vue-common": "~2.6.0", | ||
"@opentiny/vue-icon": "~2.6.0", | ||
"@opentiny/vue-renderless": "~3.6.0", | ||
"@opentiny/vue-theme": "~3.6.0", | ||
"@opentiny/vue-theme-mobile": "~3.6.0" | ||
"@opentiny/vue-common": "~2.6.1-alpha.0", | ||
"@opentiny/vue-icon": "~2.6.1-alpha.0", | ||
"@opentiny/vue-renderless": "~3.6.1-alpha.0" | ||
}, | ||
"license": "MIT", | ||
"sideEffects": false | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"build": "pnpm -w build:ui $npm_package_name", | ||
"//postversion": "pnpm build" | ||
} | ||
} |
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
23263
3
9
749
2
2
80
2
1
+ Addedpostcss@8.4.49(transitive)
- Removed@opentiny/vue-theme@~3.6.0
- Removed@opentiny/vue-theme-mobile@~3.6.0
- Removedpostcss@8.4.47(transitive)