@opentiny/vue-search
Advanced tools
Comparing version 2.6.0 to 2.6.1-alpha.0
134
lib/index.js
@@ -1,62 +0,28 @@ | ||
import { $prefix, $props, $setup } from '@opentiny/vue-common'; | ||
import { t } from '@opentiny/vue-locale'; | ||
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); | ||
} | ||
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; | ||
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common"; | ||
import { t } from "@opentiny/vue-locale"; | ||
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 Search = { | ||
name: $prefix + 'Search', | ||
props: _objectSpread2(_objectSpread2({}, $props), {}, { | ||
var Search = defineComponent({ | ||
name: $prefix + "Search", | ||
props: _extends({}, $props, { | ||
mini: { | ||
@@ -69,5 +35,8 @@ type: Boolean, | ||
default: function _default() { | ||
return t('ui.search.placeholder'); | ||
return t("ui.search.placeholder"); | ||
} | ||
}, | ||
/** | ||
* 设置为透明模式,配置为true时,边框变为透明且收缩后半透明显示,一般用在带有背景的场景 | ||
*/ | ||
transparent: { | ||
@@ -77,11 +46,17 @@ type: Boolean, | ||
}, | ||
/** | ||
* 搜索的类型选项,格式为[{text:'文档',value:1},...],不配置时类型选择固定显示为All | ||
*/ | ||
searchTypes: { | ||
type: Array, | ||
default: function _default() { | ||
default: function _default2() { | ||
return []; | ||
} | ||
}, | ||
/** | ||
* 设置搜索输入框内的提示占位文本 | ||
*/ | ||
placeholder: { | ||
type: String, | ||
default: '' | ||
default: "" | ||
}, | ||
@@ -95,4 +70,7 @@ modelValue: String, | ||
type: String, | ||
default: '1' | ||
default: "1" | ||
}, | ||
/** | ||
* 配置搜索输入框enter键,enter按下触发搜索 | ||
*/ | ||
isEnterSearch: { | ||
@@ -102,7 +80,10 @@ type: Boolean, | ||
}, | ||
/** | ||
* 配置主题色,primary:蓝 gray:灰 | ||
*/ | ||
themeType: { | ||
type: String, | ||
default: 'primary', | ||
default: "primary", | ||
validator: function validator(value) { | ||
return ['primary', 'gray'].includes(value); | ||
return ["primary", "gray"].includes(value); | ||
} | ||
@@ -113,18 +94,19 @@ } | ||
return $setup({ | ||
props: props, | ||
context: context, | ||
template: template | ||
props, | ||
context, | ||
template | ||
}); | ||
} | ||
}; | ||
}); | ||
var version = "3.7.0"; | ||
Search.model = { | ||
prop: 'modelValue', | ||
event: 'update:modelValue' | ||
prop: "modelValue", | ||
event: "update:modelValue" | ||
}; | ||
Search.install = function (Vue) { | ||
Search.install = function(Vue) { | ||
Vue.component(Search.name, Search); | ||
}; | ||
Search.version = '2.6.0'; | ||
export { Search as default }; | ||
Search.version = version; | ||
export { | ||
Search as default | ||
}; |
@@ -1,118 +0,44 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/search/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import { iconSearch, iconOperationfaild } from '@opentiny/vue-icon'; | ||
import '@opentiny/vue-theme-mobile/search/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 = { | ||
props: [].concat(_toConsumableArray(props), ['transparent', 'searchTypes', 'placeholder', 'buttonText', 'modelValue', 'themeType']), | ||
components: { | ||
IconSearch: iconSearch(), | ||
IconOperationfaild: iconOperationfaild() | ||
}, | ||
emits: ['change', 'search', 'update:modelValue', 'clear', 'select'], | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
}); | ||
import { renderless, api } from "@opentiny/vue-renderless/search/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import { iconSearch, iconOperationfaild } from "@opentiny/vue-icon"; | ||
import "@opentiny/vue-theme-mobile/search/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) { | ||
@@ -123,3 +49,2 @@ hook.call(context); | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate; | ||
@@ -129,15 +54,30 @@ 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({ | ||
props: [].concat(props, ["transparent", "searchTypes", "placeholder", "buttonText", "modelValue", "themeType"]), | ||
components: { | ||
IconSearch: iconSearch(), | ||
IconOperationfaild: iconOperationfaild() | ||
}, | ||
emits: ["change", "search", "update:modelValue", "clear", "select"], | ||
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('div', { | ||
class: ['tiny-mobile-search', "tiny-mobile-search-" + _vm.themeType, { | ||
return _c("div", { | ||
class: ["tiny-mobile-search", "tiny-mobile-search-" + _vm.themeType, { | ||
collapse: _vm.state.collapse | ||
@@ -147,13 +87,13 @@ }, { | ||
}] | ||
}, [_c('div', { | ||
class: ['tiny-mobile-search__line'] | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
class: ["tiny-mobile-search__line"] | ||
}, [_c("div", { | ||
staticClass: "tiny-mobile-search__box" | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
staticClass: "tiny-mobile-search__input-btn" | ||
}, [_c('a', { | ||
}, [_c("a", { | ||
staticClass: "tiny-mobile-search__icon" | ||
}, [_c('icon-search', { | ||
}, [_c("icon-search", { | ||
style: { | ||
fill: _vm.state.collapse && _vm.transparent ? '#fff' : '' | ||
fill: _vm.state.collapse && _vm.transparent ? "#fff" : "" | ||
}, | ||
@@ -163,3 +103,3 @@ on: { | ||
} | ||
})], 1)]), _vm._v(" "), _c('input', { | ||
})], 1)]), _c("input", { | ||
directives: [{ | ||
@@ -172,6 +112,6 @@ name: "model", | ||
ref: "input", | ||
class: ['tiny-mobile-search__input', "tiny-mobile-search__input-" + _vm.themeType], | ||
class: ["tiny-mobile-search__input", "tiny-mobile-search__input-" + _vm.themeType], | ||
style: _vm.transparent ? { | ||
border: 'transparent', | ||
background: _vm.state.collapse ? 'rgba(255,255,255,0.3)' : '#fff' | ||
border: "transparent", | ||
background: _vm.state.collapse ? "rgba(255,255,255,0.3)" : "#fff" | ||
} : {}, | ||
@@ -187,12 +127,10 @@ attrs: { | ||
"keyup": function keyup($event) { | ||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { | ||
if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) | ||
return null; | ||
} | ||
return _vm.searchEnterKey.apply(null, arguments); | ||
}, | ||
"change": _vm.handleChange, | ||
"input": [function ($event) { | ||
if ($event.target.composing) { | ||
"input": [function($event) { | ||
if ($event.target.composing) | ||
return; | ||
} | ||
_vm.$set(_vm.state, "currentValue", $event.target.value); | ||
@@ -210,3 +148,3 @@ }, _vm.handleInput], | ||
} | ||
}), _vm._v(" "), _c('span', { | ||
}), _c("span", { | ||
directives: [{ | ||
@@ -219,12 +157,12 @@ name: "show", | ||
staticClass: "tiny-mobile-search__close-icon" | ||
}, [_c('icon-operationfaild', { | ||
}, [_c("icon-operationfaild", { | ||
on: { | ||
"click": _vm.clear | ||
} | ||
})], 1)]), _vm._v(" "), _c('label', { | ||
})], 1)]), _c("label", { | ||
staticClass: "tiny-mobile-search__label" | ||
}, [_c('span', [_vm._v(_vm._s(_vm.placeholder))])])]), _vm._v(" "), _c('div', { | ||
}, [_c("span", [_vm._v(_vm._s(_vm.placeholder))])])]), _c("div", { | ||
staticClass: "tiny-mobile-search__right" | ||
}, [_vm._t("default", function () { | ||
return [_c('div', { | ||
}, [_vm._t("default", function() { | ||
return [_c("div", { | ||
staticClass: "tiny-mobile-search__present", | ||
@@ -234,3 +172,3 @@ on: { | ||
} | ||
}, [_c('span', { | ||
}, [_c("span", { | ||
staticClass: "tiny-mobile-search__text" | ||
@@ -240,12 +178,15 @@ }, [_vm._v(_vm._s(_vm.buttonText))])])]; | ||
}; | ||
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 | ||
}; |
249
lib/pc.js
@@ -1,119 +0,44 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/search/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import { iconChevronDown, iconSearch, iconClose } from '@opentiny/vue-icon'; | ||
import '@opentiny/vue-theme/search/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 = { | ||
props: [].concat(_toConsumableArray(props), ['mini', 'transparent', 'searchTypes', 'placeholder', 'modelValue', 'tabindex', 'clearable', 'isEnterSearch']), | ||
emits: ['change', 'search', 'update:modelValue', 'clear', 'select'], | ||
components: { | ||
IconChevronDown: iconChevronDown(), | ||
IconSearch: iconSearch(), | ||
IconClose: iconClose() | ||
}, | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
}); | ||
import { renderless, api } from "@opentiny/vue-renderless/search/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import { iconChevronDown, iconSearch, iconClose } from "@opentiny/vue-icon"; | ||
import "@opentiny/vue-theme/search/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) { | ||
@@ -124,3 +49,2 @@ hook.call(context); | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate; | ||
@@ -130,15 +54,31 @@ 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({ | ||
props: [].concat(props, ["mini", "transparent", "searchTypes", "placeholder", "modelValue", "tabindex", "clearable", "isEnterSearch"]), | ||
emits: ["change", "search", "update:modelValue", "clear", "select"], | ||
components: { | ||
IconChevronDown: iconChevronDown(), | ||
IconSearch: iconSearch(), | ||
IconClose: iconClose() | ||
}, | ||
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('div', { | ||
class: ['tiny-search', { | ||
return _c("div", { | ||
class: ["tiny-search", { | ||
mini: _vm.mini | ||
@@ -156,7 +96,7 @@ }, { | ||
} | ||
}, [_c('div', { | ||
class: ['tiny-search__line', { | ||
}, [_c("div", { | ||
class: ["tiny-search__line", { | ||
focus: _vm.state.focus | ||
}] | ||
}, [_vm.slots.prefix ? _vm._t("prefix") : _vm._e(), _vm._v(" "), _c('transition', { | ||
}, [_vm.slots.prefix ? _vm._t("prefix") : _vm._e(), _c("transition", { | ||
attrs: { | ||
@@ -166,3 +106,3 @@ "name": "tiny-transition-search-line-fade", | ||
} | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
directives: [{ | ||
@@ -178,13 +118,13 @@ name: "show", | ||
} | ||
}, [_vm._t("text", function () { | ||
return [_c('span', { | ||
}, [_vm._t("text", function() { | ||
return [_c("span", { | ||
staticClass: "tiny-search__text" | ||
}, [_vm._v(_vm._s(_vm.state.searchValue['text']))])]; | ||
}, [_vm._v(_vm._s(_vm.state.searchValue.text))])]; | ||
}, { | ||
"slotScope": _vm.state.searchValue | ||
}), _vm._v(" "), _c('span', { | ||
}), _c("span", { | ||
staticClass: "icon-outer" | ||
}, [_c('icon-chevron-down', { | ||
}, [_c("icon-chevron-down", { | ||
staticClass: "tiny-svg-size" | ||
})], 1)], 2)]), _vm._v(" "), _c('input', { | ||
})], 1)], 2)]), _c("input", { | ||
directives: [{ | ||
@@ -199,4 +139,4 @@ name: "model", | ||
style: _vm.transparent ? { | ||
border: 'transparent', | ||
background: _vm.state.collapse ? 'rgba(255,255,255,0.3)' : '#fff' | ||
border: "transparent", | ||
background: _vm.state.collapse ? "rgba(255,255,255,0.3)" : "#fff" | ||
} : {}, | ||
@@ -213,12 +153,10 @@ attrs: { | ||
"keyup": function keyup($event) { | ||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { | ||
if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) | ||
return null; | ||
} | ||
return _vm.searchEnterKey.apply(null, arguments); | ||
}, | ||
"change": _vm.handleChange, | ||
"input": [function ($event) { | ||
if ($event.target.composing) { | ||
"input": [function($event) { | ||
if ($event.target.composing) | ||
return; | ||
} | ||
_vm.$set(_vm.state, "currentValue", $event.target.value); | ||
@@ -236,13 +174,13 @@ }, _vm.handleInput], | ||
} | ||
}), _vm._v(" "), _c('transition', { | ||
}), _c("transition", { | ||
attrs: { | ||
"name": "tiny-transition-icon-scale-in" | ||
} | ||
}, [_vm.state.showClear && !_vm.state.collapse ? _c('div', { | ||
}, [_vm.state.showClear && !_vm.state.collapse ? _c("div", { | ||
staticClass: "tiny-search__input-btn" | ||
}, [_c('a', { | ||
}, [_c("a", { | ||
on: { | ||
"click": _vm.clear | ||
} | ||
}, [_c('icon-close', { | ||
}, [_c("icon-close", { | ||
staticClass: "tiny-svg-size", | ||
@@ -254,14 +192,14 @@ on: { | ||
} | ||
})], 1)]) : _vm._e()]), _vm._v(" "), _vm.slots.suffix ? _vm._t("suffix") : _c('div', { | ||
})], 1)]) : _vm._e()]), _vm.slots.suffix ? _vm._t("suffix") : _c("div", { | ||
staticClass: "tiny-search__input-btn" | ||
}, [_c('a', { | ||
}, [_c("a", { | ||
on: { | ||
"click": _vm.searchClick | ||
} | ||
}, [_c('icon-search', { | ||
}, [_c("icon-search", { | ||
staticClass: "tiny-svg-size", | ||
style: { | ||
fill: _vm.state.collapse && _vm.transparent ? '#fff' : '' | ||
fill: _vm.state.collapse && _vm.transparent ? "#fff" : "" | ||
} | ||
})], 1)])], 2), _vm._v(" "), _c('transition', { | ||
})], 1)])], 2), _c("transition", { | ||
attrs: { | ||
@@ -271,3 +209,3 @@ "name": "tiny-transition-zoom-in-top", | ||
} | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
directives: [{ | ||
@@ -281,8 +219,8 @@ name: "show", | ||
staticClass: "tiny-search__selector" | ||
}, [_c('div', { | ||
}, [_c("div", { | ||
staticClass: "tiny-search__selector-body" | ||
}, [_c('ul', { | ||
}, [_c("ul", { | ||
staticClass: "tiny-search__poplist" | ||
}, _vm._l(_vm.state.types, function (item, index) { | ||
return _c('li', { | ||
}, _vm._l(_vm.state.types, function(item, index) { | ||
return _c("li", { | ||
key: index, | ||
@@ -295,3 +233,3 @@ staticClass: "tiny-search__poplist-item", | ||
} | ||
}, [_vm._t("poplist", function () { | ||
}, [_vm._t("poplist", function() { | ||
return [_vm._v(_vm._s(item.text) + " ")]; | ||
@@ -303,12 +241,15 @@ }, { | ||
}; | ||
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-search", | ||
"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-renderless": "~3.6.0", | ||
"@opentiny/vue-common": "~2.6.0", | ||
"@opentiny/vue-icon": "~2.6.0", | ||
"@opentiny/vue-theme": "~3.6.0", | ||
"@opentiny/vue-theme-mobile": "~3.6.0" | ||
"@opentiny/vue-renderless": "~3.6.1-alpha.0", | ||
"@opentiny/vue-common": "~2.6.1-alpha.0", | ||
"@opentiny/vue-icon": "~2.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
22426
3
9
696
2
2
80
2
1