@opentiny/vue-multi-select
Advanced tools
Comparing version 2.6.0 to 2.6.1
105
lib/index.js
@@ -1,82 +0,47 @@ | ||
import { $prefix, $setup, $props } from '@opentiny/vue-common'; | ||
import MobileTemplate from './mobile'; | ||
import '@opentiny/vue-theme-mobile/multi-select/index.css'; | ||
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); | ||
} | ||
var template = function template(mode) { | ||
if (process.env.TINY_MODE === 'mobile' || mode === 'mobile') { | ||
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common"; | ||
import MobileTemplate from "./mobile.js"; | ||
import "@opentiny/vue-theme-mobile/multi-select/index.less"; | ||
var template = function template2(mode) { | ||
if ("mobile" === (process.env.TINY_MODE || mode)) | ||
return MobileTemplate; | ||
} | ||
else | ||
return PcTemplate; | ||
}; | ||
var MultiSelect = { | ||
name: $prefix + 'MultiSelect', | ||
var MultiSelect = defineComponent({ | ||
name: $prefix + "MultiSelect", | ||
inject: {}, | ||
props: _objectSpread2({}, $props), | ||
props: _extends({}, $props), | ||
setup: function setup(props, context) { | ||
return $setup({ | ||
props: props, | ||
context: context, | ||
template: template | ||
props, | ||
context, | ||
template | ||
}); | ||
} | ||
}; | ||
}); | ||
var version = "2.6.1"; | ||
MultiSelect.model = { | ||
prop: 'modelValue', | ||
event: 'update:modelValue' | ||
prop: "modelValue", | ||
event: "update:modelValue" | ||
}; | ||
MultiSelect.install = function (Vue) { | ||
MultiSelect.install = function(Vue) { | ||
Vue.component(MultiSelect.name, MultiSelect); | ||
}; | ||
MultiSelect.version = '2.6.0'; | ||
export { MultiSelect as default }; | ||
MultiSelect.version = version; | ||
export { | ||
MultiSelect as default | ||
}; |
@@ -1,10 +0,8 @@ | ||
import { $prefix, setup } from '@opentiny/vue-common'; | ||
import { renderless, api } from '@opentiny/vue-renderless/multi-select/vue'; | ||
import { IconChevronDown } from '@opentiny/vue-icon'; | ||
import Button from '@opentiny/vue-button'; | ||
import Wheel from '@opentiny/vue-wheel'; | ||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, normalizeStyle, createVNode, createCommentVNode, withCtx, createTextVNode } from 'vue'; | ||
var script = { | ||
name: $prefix + 'MultiSelect', | ||
import { defineComponent, $prefix, setup as _setup } from "@opentiny/vue-common"; | ||
import { renderless, api } from "@opentiny/vue-renderless/multi-select/vue"; | ||
import { IconChevronDown } from "@opentiny/vue-icon"; | ||
import Button from "@opentiny/vue-button"; | ||
import Wheel from "@opentiny/vue-wheel"; | ||
var __vue2_script = defineComponent({ | ||
name: $prefix + "MultiSelect", | ||
components: { | ||
@@ -24,3 +22,3 @@ IconChevronDown: IconChevronDown(), | ||
type: Array, | ||
default: function _default() { | ||
default: function _default2() { | ||
return []; | ||
@@ -30,112 +28,158 @@ } | ||
}, | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
setup: function setup(props, context) { | ||
return _setup({ | ||
props, | ||
context, | ||
renderless, | ||
api | ||
}); | ||
} | ||
}; | ||
var _hoisted_1 = { | ||
class: "tiny-mobile-multi-select" | ||
}; | ||
var _hoisted_2 = { | ||
class: "tiny-mobile-multi-select__header" | ||
}; | ||
var _hoisted_3 = { | ||
class: "tiny-mobile-multi-select__header__flexCenter", | ||
ref: "headerBox" | ||
}; | ||
var _hoisted_4 = { | ||
class: "tiny-mobile-multi-select__header__calc" | ||
}; | ||
var _hoisted_5 = { | ||
key: 0 | ||
}; | ||
var _hoisted_6 = { | ||
key: 1 | ||
}; | ||
var _hoisted_7 = ["onClick"]; | ||
var _hoisted_8 = { | ||
key: 0 | ||
}; | ||
var _hoisted_9 = { | ||
key: 1 | ||
}; | ||
var _hoisted_10 = { | ||
key: 1, | ||
class: "tiny-mobile-multi-select__footer" | ||
}; | ||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
var _$props$dataSource$_c, _$props$dataSource$_c2, _$props$dataSource$_c3; | ||
var _component_IconChevronDown = resolveComponent("IconChevronDown"); | ||
var _component_tiny_wheel = resolveComponent("tiny-wheel"); | ||
var _component_tiny_button = resolveComponent("tiny-button"); | ||
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.dataSource, function (item, index) { | ||
var _ctx$state$headerInfo, _ctx$state$headerInfo2, _ctx$state$headerInfo3, _ctx$state$headerInfo4, _ctx$state$headerInfo5; | ||
return openBlock(), createElementBlock("div", { | ||
}); | ||
var render = function render2() { | ||
var _vm$dataSource$_vm$st, _vm$dataSource$_vm$st2, _vm$dataSource$_vm$st3; | ||
var _vm = this; | ||
var _h = _vm.$createElement; | ||
var _c = _vm._self._c || _h; | ||
return _c("div", { | ||
staticClass: "tiny-mobile-multi-select" | ||
}, [_c("div", { | ||
staticClass: "tiny-mobile-multi-select__header" | ||
}, [_c("div", { | ||
ref: "headerBox", | ||
staticClass: "tiny-mobile-multi-select__header__flexCenter" | ||
}, [_c("div", { | ||
staticClass: "tiny-mobile-multi-select__header__calc" | ||
}, _vm._l(_vm.dataSource, function(item, index) { | ||
var _vm$state$headerInfo$, _vm$state$headerInfo$2, _vm$state$headerInfo$3, _vm$state$headerInfo$4, _vm$state$headerInfo$5; | ||
return _c("div", { | ||
key: index, | ||
class: "tiny-mobile-multi-select__header__item", | ||
ref_for: true, | ||
ref: "label" | ||
}, [createElementVNode("div", { | ||
class: normalizeClass(['tiny-mobile-multi-select__header__label', (_ctx$state$headerInfo = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo !== void 0 && _ctx$state$headerInfo.isSelected ? 'tiny-mobile-multi-select__header__active' : '']) | ||
}, [!((_ctx$state$headerInfo2 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo2 !== void 0 && _ctx$state$headerInfo2.isSelected) ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(item.title), 1)) : (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString((_ctx$state$headerInfo3 = _ctx.state.headerInfo[index]) === null || _ctx$state$headerInfo3 === void 0 ? void 0 : _ctx$state$headerInfo3.title), 1))], 2), createElementVNode("div", { | ||
class: normalizeClass(['tiny-mobile-multi-select__header__icon', (_ctx$state$headerInfo4 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo4 !== void 0 && _ctx$state$headerInfo4.isSelected ? 'tiny-mobile-multi-select__header__active' : '']), | ||
style: normalizeStyle({ | ||
transform: (_ctx$state$headerInfo5 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo5 !== void 0 && _ctx$state$headerInfo5.isUP ? 'rotate(180deg)' : 'none' | ||
}) | ||
}, [createVNode(_component_IconChevronDown)], 6)]); | ||
}), 128))]), (openBlock(true), createElementBlock(Fragment, null, renderList($props.dataSource, function (item, index) { | ||
var _ctx$state$headerInfo6, _ctx$state$headerInfo7, _ctx$state$headerInfo8, _ctx$state$headerInfo9, _ctx$state$headerInfo10; | ||
return openBlock(), createElementBlock("div", { | ||
ref: "label", | ||
refInFor: true, | ||
staticClass: "tiny-mobile-multi-select__header__item" | ||
}, [_c("div", { | ||
class: ["tiny-mobile-multi-select__header__label", (_vm$state$headerInfo$ = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$ !== void 0 && _vm$state$headerInfo$.isSelected ? "tiny-mobile-multi-select__header__active" : ""] | ||
}, [!((_vm$state$headerInfo$2 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$2 !== void 0 && _vm$state$headerInfo$2.isSelected) ? _c("span", [_vm._v(_vm._s(item.title))]) : _c("span", [_vm._v(_vm._s((_vm$state$headerInfo$3 = _vm.state.headerInfo[index]) === null || _vm$state$headerInfo$3 === void 0 ? void 0 : _vm$state$headerInfo$3.title))])]), _c("div", { | ||
class: ["tiny-mobile-multi-select__header__icon", (_vm$state$headerInfo$4 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$4 !== void 0 && _vm$state$headerInfo$4.isSelected ? "tiny-mobile-multi-select__header__active" : ""], | ||
style: { | ||
transform: (_vm$state$headerInfo$5 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$5 !== void 0 && _vm$state$headerInfo$5.isUP ? "rotate(180deg)" : "none" | ||
} | ||
}, [_c("IconChevronDown")], 1)]); | ||
}), 0), _vm._l(_vm.dataSource, function(item, index) { | ||
var _vm$state$headerInfo$6, _vm$state$headerInfo$7, _vm$state$headerInfo$8, _vm$state$headerInfo$9, _vm$state$headerInfo$10; | ||
return _c("div", { | ||
key: index, | ||
class: "tiny-mobile-multi-select__header__item", | ||
onClick: function onClick($event) { | ||
return _ctx.handleClick(index); | ||
}, | ||
style: normalizeStyle(_ctx.state.labelsStyle[index]) | ||
}, [createElementVNode("div", { | ||
class: normalizeClass(['tiny-mobile-multi-select__header__label', (_ctx$state$headerInfo6 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo6 !== void 0 && _ctx$state$headerInfo6.isSelected ? 'tiny-mobile-multi-select__header__active' : '']) | ||
}, [!((_ctx$state$headerInfo7 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo7 !== void 0 && _ctx$state$headerInfo7.isSelected) ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(item.title), 1)) : (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString((_ctx$state$headerInfo8 = _ctx.state.headerInfo[index]) === null || _ctx$state$headerInfo8 === void 0 ? void 0 : _ctx$state$headerInfo8.title), 1))], 2), createElementVNode("div", { | ||
class: normalizeClass(['tiny-mobile-multi-select__header__icon', (_ctx$state$headerInfo9 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo9 !== void 0 && _ctx$state$headerInfo9.isSelected ? 'tiny-mobile-multi-select__header__active' : '']), | ||
style: normalizeStyle({ | ||
transform: (_ctx$state$headerInfo10 = _ctx.state.headerInfo[index]) !== null && _ctx$state$headerInfo10 !== void 0 && _ctx$state$headerInfo10.isUP ? 'rotate(180deg)' : 'none' | ||
}) | ||
}, [createVNode(_component_IconChevronDown)], 6)], 12, _hoisted_7); | ||
}), 128))], 512)]), _ctx.state.showWheel ? (openBlock(), createElementBlock("div", { | ||
key: 0, | ||
class: normalizeClass(['tiny-mobile-multi-select__content', !((_$props$dataSource$_c = $props.dataSource[_ctx.state.headerIndex]) !== null && _$props$dataSource$_c !== void 0 && _$props$dataSource$_c.hasFooter) ? 'noFooter' : '']) | ||
}, [createVNode(_component_tiny_wheel, { | ||
dataSource: _ctx.state.wheelData, | ||
defaultSelectedIndexs: _ctx.state.defaultSelectedIndexs, | ||
hasFooter: (_$props$dataSource$_c2 = $props.dataSource[_ctx.state.headerIndex]) === null || _$props$dataSource$_c2 === void 0 ? void 0 : _$props$dataSource$_c2.hasFooter, | ||
onChange: _ctx.wheelChange, | ||
onClickWheelItem: _ctx.clickWheelItem | ||
}, null, 8, ["dataSource", "defaultSelectedIndexs", "hasFooter", "onChange", "onClickWheelItem"])], 2)) : createCommentVNode("", true), _ctx.state.showWheel && (_$props$dataSource$_c3 = $props.dataSource[_ctx.state.headerIndex]) !== null && _$props$dataSource$_c3 !== void 0 && _$props$dataSource$_c3.hasFooter ? (openBlock(), createElementBlock("div", _hoisted_10, [createVNode(_component_tiny_button, { | ||
round: "", | ||
size: "large", | ||
onClick: _ctx.reset | ||
}, { | ||
default: withCtx(function () { | ||
return [createTextVNode(toDisplayString(_ctx.t('ui.base.reset')), 1)]; | ||
}), | ||
_: 1 | ||
}, 8, ["onClick"]), createVNode(_component_tiny_button, { | ||
round: "", | ||
size: "large", | ||
type: "primary", | ||
onClick: _ctx.confirm | ||
}, { | ||
default: withCtx(function () { | ||
return [createTextVNode(toDisplayString(_ctx.t('ui.button.confirm')), 1)]; | ||
}), | ||
_: 1 | ||
}, 8, ["onClick"])])) : createCommentVNode("", true)]); | ||
staticClass: "tiny-mobile-multi-select__header__item", | ||
style: _vm.state.labelsStyle[index], | ||
on: { | ||
"click": function click($event) { | ||
return _vm.handleClick(index); | ||
} | ||
} | ||
}, [_c("div", { | ||
class: ["tiny-mobile-multi-select__header__label", (_vm$state$headerInfo$6 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$6 !== void 0 && _vm$state$headerInfo$6.isSelected ? "tiny-mobile-multi-select__header__active" : ""] | ||
}, [!((_vm$state$headerInfo$7 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$7 !== void 0 && _vm$state$headerInfo$7.isSelected) ? _c("span", [_vm._v(_vm._s(item.title))]) : _c("span", [_vm._v(_vm._s((_vm$state$headerInfo$8 = _vm.state.headerInfo[index]) === null || _vm$state$headerInfo$8 === void 0 ? void 0 : _vm$state$headerInfo$8.title))])]), _c("div", { | ||
class: ["tiny-mobile-multi-select__header__icon", (_vm$state$headerInfo$9 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$9 !== void 0 && _vm$state$headerInfo$9.isSelected ? "tiny-mobile-multi-select__header__active" : ""], | ||
style: { | ||
transform: (_vm$state$headerInfo$10 = _vm.state.headerInfo[index]) !== null && _vm$state$headerInfo$10 !== void 0 && _vm$state$headerInfo$10.isUP ? "rotate(180deg)" : "none" | ||
} | ||
}, [_c("IconChevronDown")], 1)]); | ||
})], 2)]), _vm.state.showWheel ? _c("div", { | ||
class: ["tiny-mobile-multi-select__content", !((_vm$dataSource$_vm$st = _vm.dataSource[_vm.state.headerIndex]) !== null && _vm$dataSource$_vm$st !== void 0 && _vm$dataSource$_vm$st.hasFooter) ? "noFooter" : ""] | ||
}, [_c("tiny-wheel", { | ||
attrs: { | ||
"dataSource": _vm.state.wheelData, | ||
"defaultSelectedIndexs": _vm.state.defaultSelectedIndexs, | ||
"hasFooter": (_vm$dataSource$_vm$st2 = _vm.dataSource[_vm.state.headerIndex]) === null || _vm$dataSource$_vm$st2 === void 0 ? void 0 : _vm$dataSource$_vm$st2.hasFooter | ||
}, | ||
on: { | ||
"change": _vm.wheelChange, | ||
"clickWheelItem": _vm.clickWheelItem | ||
} | ||
})], 1) : _vm._e(), _vm.state.showWheel && (_vm$dataSource$_vm$st3 = _vm.dataSource[_vm.state.headerIndex]) !== null && _vm$dataSource$_vm$st3 !== void 0 && _vm$dataSource$_vm$st3.hasFooter ? _c("div", { | ||
staticClass: "tiny-mobile-multi-select__footer" | ||
}, [_c("tiny-button", { | ||
attrs: { | ||
"round": "", | ||
"size": "large" | ||
}, | ||
on: { | ||
"click": _vm.reset | ||
} | ||
}, [_vm._v(_vm._s(_vm.t("ui.base.reset")))]), _c("tiny-button", { | ||
attrs: { | ||
"round": "", | ||
"size": "large", | ||
"type": "primary" | ||
}, | ||
on: { | ||
"click": _vm.confirm | ||
} | ||
}, [_vm._v(_vm._s(_vm.t("ui.button.confirm")))])], 1) : _vm._e()]); | ||
}; | ||
var staticRenderFns = []; | ||
function normalizeComponent(scriptExports, render3, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { | ||
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; | ||
if (render3) { | ||
options.render = render3; | ||
options.staticRenderFns = staticRenderFns2; | ||
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__; | ||
} | ||
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 | ||
}; | ||
} | ||
script.render = render; | ||
export { script as default }; | ||
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 | ||
}; |
{ | ||
"name": "@opentiny/vue-multi-select", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
232
9820
1