@opentiny/vue-button-group
Advanced tools
Comparing version 3.6.0 to 3.6.1-alpha.0
@@ -13,3 +13,2 @@ /** | ||
import ButtonGroup from './src/index'; | ||
import '@opentiny/vue-theme/button-group/index.css'; | ||
export default ButtonGroup; |
138
lib/index.js
@@ -1,59 +0,26 @@ | ||
import { $prefix, $props, $setup } from '@opentiny/vue-common'; | ||
import PCTemplate from './pc'; | ||
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() { | ||
return PCTemplate; | ||
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common"; | ||
import PcTemplate from "./pc.js"; | ||
import "@opentiny/vue-theme/button-group/index.css"; | ||
var template = function template2(mode) { | ||
if ("mobile" === (process.env.TINY_MODE || mode)) | ||
return MobileTemplate; | ||
else | ||
return PcTemplate; | ||
}; | ||
var ButtonGroup = { | ||
name: $prefix + 'ButtonGroup', | ||
var ButtonGroup = defineComponent({ | ||
name: $prefix + "ButtonGroup", | ||
provide: function provide() { | ||
@@ -64,3 +31,3 @@ return { | ||
}, | ||
props: _objectSpread2(_objectSpread2({}, $props), {}, { | ||
props: _extends({}, $props, { | ||
size: String, | ||
@@ -73,7 +40,7 @@ data: Array, | ||
type: String, | ||
default: 'value' | ||
default: "value" | ||
}, | ||
textField: { | ||
type: String, | ||
default: 'text' | ||
default: "text" | ||
}, | ||
@@ -88,48 +55,19 @@ showMore: Number, | ||
return $setup({ | ||
props: props, | ||
context: context, | ||
template: template | ||
props, | ||
context, | ||
template | ||
}); | ||
} | ||
}; | ||
function styleInject(css, ref) { | ||
if ( ref === void 0 ) ref = {}; | ||
var insertAt = ref.insertAt; | ||
if (!css || typeof document === 'undefined') { return; } | ||
var head = document.head || document.getElementsByTagName('head')[0]; | ||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
if (insertAt === 'top') { | ||
if (head.firstChild) { | ||
head.insertBefore(style, head.firstChild); | ||
} else { | ||
head.appendChild(style); | ||
} | ||
} else { | ||
head.appendChild(style); | ||
} | ||
if (style.styleSheet) { | ||
style.styleSheet.cssText = css; | ||
} else { | ||
style.appendChild(document.createTextNode(css)); | ||
} | ||
} | ||
var css_248z = ".tiny-button-group{--ti-button-group-border-color:var(--ti-base-color-border);--ti-button-group-border-radius:var(--ti-common-border-radius-normal);--ti-button-group-hover-border-color:var(--ti-base-color-brand-6);--ti-button-group-info-border-color:rgba(255, 255, 255, 0.5);--ti-button-group-disabled-text-color:var(--ti-common-color-bg-disabled);--ti-button-group-item-bg-color:var(--ti-base-color-light);--ti-button-group-item-btn-text-color:var(--ti-base-color-info-normal);--ti-button-group-item-btn-width:var(--ti-base-size-width-normal);--ti-button-group-item-btn-height:var(--ti-base-size-height-minor);--ti-button-group-item-btn-font-size:var(--ti-common-font-size-base);--ti-button-group-item-btn-disabled-bg-color:var(--ti-common-color-bg-disabled);--ti-button-group-item-btn-disabled-border-color:var(--ti-base-color-border);--ti-button-group-item-btn-disabled-text-color:var(--ti-base-color-placeholder);--ti-button-group-item-btn-hover-bg-color:var(--ti-base-color-brand-5);--ti-button-group-item-btn-hover-text-color:var(--ti-base-color-light);--ti-button-group-item-btn-plain-text-color:var(--ti-base-color-brand-6);--ti-button-group-item-btn-plain-bg-color:rgba(24, 144, 255, 0.06);--ti-button-group-item-btn-plain-border-color:var(--ti-base-color-brand-6);--ti-button-group-item-active-bg-color:var(--ti-base-color-brand-6);--ti-button-group-item-active-text-color:var(--ti-base-color-light);display:inline-block;vertical-align:middle}.tiny-button-group:after,.tiny-button-group:before{content:'';display:table}.tiny-button-group:after{clear:both}.tiny-button-group .tiny-group-item{display:inline-block;vertical-align:middle}.tiny-button-group .tiny-group-item li{line-height:28px;background:var(--ti-button-group-item-bg-color);float:left;position:relative}.tiny-button-group .tiny-group-item li button{border:1px solid var(--ti-button-group-border-color);display:block;text-align:center;color:var(--ti-button-group-item-btn-text-color);background:var(--ti-button-group-item-bg-color);min-width:var(--ti-button-group-item-btn-width);height:var(--ti-button-group-item-btn-height);padding:0 8px;text-decoration:none;font-size:var(--ti-button-group-item-btn-font-size);outline:0;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.tiny-button-group .tiny-group-item li button.disabled,.tiny-button-group .tiny-group-item li button[disabled]{background:var(--ti-button-group-item-btn-disabled-bg-color);border-color:var(--ti-button-group-item-btn-disabled-border-color);cursor:not-allowed;color:var(--ti-button-group-item-btn-disabled-text-color)}.tiny-button-group .tiny-group-item li button.plain,.tiny-button-group .tiny-group-item li button[plain]{background:0 0}.tiny-button-group .tiny-group-item li:hover{z-index:1}.tiny-button-group .tiny-group-item li:hover button:not(.disabled){background:var(--ti-button-group-item-btn-hover-bg-color);color:var(--ti-button-group-item-btn-hover-text-color);border-color:var(--ti-button-group-item-btn-hover-bg-color);outline:0}.tiny-button-group .tiny-group-item li:hover button:not(.disabled).plain,.tiny-button-group .tiny-group-item li:hover button:not(.disabled)[plain]{color:var(--ti-button-group-item-btn-plain-text-color);background-color:var(--ti-button-group-item-btn-plain-bg-color);border-color:var(--ti-button-group-item-btn-plain-border-color)}.tiny-button-group .tiny-group-item li.active{z-index:1}.tiny-button-group .tiny-group-item li.active:hover button:not(.disabled){background:var(--ti-button-group-item-btn-hover-bg-color);border-color:var(--ti-button-group-item-btn-hover-bg-color)}.tiny-button-group .tiny-group-item li.active:hover button:not(.disabled).plain,.tiny-button-group .tiny-group-item li.active:hover button:not(.disabled)[plain]{background-color:var(--ti-button-group-item-btn-plain-bg-color)}.tiny-button-group .tiny-group-item li.active button:not(.disabled){background:var(--ti-button-group-item-active-bg-color);color:var(--ti-button-group-item-active-text-color);border-color:var(--ti-button-group-item-active-bg-color);outline:0}.tiny-button-group .tiny-group-item li.active button:not(.disabled).plain,.tiny-button-group .tiny-group-item li.active button:not(.disabled)[plain]{color:var(--ti-button-group-item-active-bg-color);background:0 0}.tiny-button-group .tiny-group-item li:first-child button{border-radius:var(--ti-button-group-border-radius) 0 0 var(--ti-button-group-border-radius)}.tiny-button-group .tiny-group-item li:last-child button{border-radius:0 var(--ti-button-group-border-radius) var(--ti-button-group-border-radius) 0}.tiny-button-group .tiny-group-item li:not(:last-child){margin-right:-1px}.tiny-button-group>.tiny-button{float:left;position:relative}.tiny-button-group>.tiny-button+.tiny-button{margin-left:0}.tiny-button-group>.tiny-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0;border-right-color:var(--ti-button-group-info-border-color)}.tiny-button-group>.tiny-button:first-child.tiny-button--default{border-right-color:var(--ti-button-group-border-color)}.tiny-button-group>.tiny-button:first-child.tiny-button--default:active,.tiny-button-group>.tiny-button:first-child.tiny-button--default:focus,.tiny-button-group>.tiny-button:first-child.tiny-button--default:hover{border-right-color:var(--ti-button-group-hover-border-color);z-index:1}.tiny-button-group>.tiny-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--ti-button-group-info-border-color)}.tiny-button-group>.tiny-button:last-child.tiny-button--default{border-left-color:var(--ti-button-group-border-color)}.tiny-button-group>.tiny-button:last-child.tiny-button--default:active,.tiny-button-group>.tiny-button:last-child.tiny-button--default:focus,.tiny-button-group>.tiny-button:last-child.tiny-button--default:hover{border-left-color:var(--ti-button-group-hover-border-color);z-index:1}.tiny-button-group>.tiny-button:first-child:last-child{border-radius:var(--ti-button-group-border-radius)}.tiny-button-group>.tiny-button:first-child:last-child.is-round{border-radius:calc(var(--ti-button-size-normal-height,30px)/ 2)}.tiny-button-group>.tiny-button:first-child:last-child.is-circle{border-radius:50%}.tiny-button-group>.tiny-button:not(:first-child):not(:last-child){border-radius:0;border-left-color:var(--ti-button-group-info-border-color);border-right-color:var(--ti-button-group-info-border-color)}.tiny-button-group>.tiny-button:not(:first-child):not(:last-child).tiny-button--default{border-left-color:var(--ti-button-group-border-color);border-right-color:var(--ti-button-group-border-color)}.tiny-button-group>.tiny-button:not(:first-child):not(:last-child).tiny-button--default:active,.tiny-button-group>.tiny-button:not(:first-child):not(:last-child).tiny-button--default:focus,.tiny-button-group>.tiny-button:not(:first-child):not(:last-child).tiny-button--default:hover{border-left-color:var(--ti-button-group-hover-border-color);border-right-color:var(--ti-button-group-hover-border-color);z-index:1}.tiny-button-group>.tiny-button:not(:last-child){margin-right:-1px}.tiny-button-group>.tiny-button>.tiny-dropdown>.tiny-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--ti-button-group-info-border-color)}"; | ||
styleInject(css_248z); | ||
}); | ||
var version = "3.7.0"; | ||
ButtonGroup.model = { | ||
prop: 'modelValue', | ||
event: 'update:modelValue' | ||
prop: "modelValue", | ||
event: "update:modelValue" | ||
}; | ||
ButtonGroup.install = function (Vue) { | ||
ButtonGroup.install = function(Vue) { | ||
Vue.component(ButtonGroup.name, ButtonGroup); | ||
}; | ||
ButtonGroup.version = '3.6.0'; | ||
export { ButtonGroup as default }; | ||
ButtonGroup.version = version; | ||
export { | ||
ButtonGroup as default | ||
}; |
247
lib/pc.js
@@ -1,36 +0,54 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/button-group/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import Popover from '@opentiny/vue-popover'; | ||
import Button from '@opentiny/vue-button'; | ||
import { iconPopup, iconWriting } from '@opentiny/vue-icon'; | ||
import { resolveComponent, openBlock, createElementBlock, renderSlot, Fragment, renderList, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createVNode, withCtx, createTextVNode, createCommentVNode } from 'vue'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
import { renderless, api } from "@opentiny/vue-renderless/button-group/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import Popover from "@opentiny/vue-popover"; | ||
import Button from "@opentiny/vue-button"; | ||
import { iconPopup, iconWriting } from "@opentiny/vue-icon"; | ||
import { resolveComponent, openBlock, createElementBlock, renderSlot, Fragment, renderList, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createVNode, withCtx, createTextVNode, createCommentVNode } from "vue"; | ||
function _createForOfIteratorHelperLoose(o, allowArrayLike) { | ||
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; | ||
if (it) | ||
return (it = it.call(o)).next.bind(it); | ||
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { | ||
if (it) | ||
o = it; | ||
var i = 0; | ||
return function() { | ||
if (i >= o.length) | ||
return { done: true }; | ||
return { done: false, value: o[i++] }; | ||
}; | ||
} | ||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
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); | ||
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); | ||
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]; | ||
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 _export_sfc = function _export_sfc2(sfc, props) { | ||
var target = sfc.__vccOpts || sfc; | ||
for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) { | ||
var _step$value = _step.value, key = _step$value[0], val = _step$value[1]; | ||
target[key] = val; | ||
} | ||
return target; | ||
}; | ||
var script = { | ||
props: [].concat(_toConsumableArray(props), ['size', 'data', 'plain', 'modelValue', 'disabled', 'valueField', 'textField', 'showMore', 'showEdit']), | ||
var _sfc_main = /* @__PURE__ */ defineComponent({ | ||
props: [].concat(props, ["size", "data", "plain", "modelValue", "disabled", "valueField", "textField", "showMore", "showEdit"]), | ||
components: { | ||
@@ -42,12 +60,11 @@ TinyPopover: Popover, | ||
}, | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
setup: function setup(props2, context) { | ||
return _setup({ | ||
props: props2, | ||
context, | ||
renderless, | ||
api | ||
}); | ||
} | ||
}; | ||
}); | ||
var _hoisted_1 = { | ||
@@ -77,3 +94,3 @@ class: "tiny-button-group" | ||
}; | ||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
var _component_tiny_button = resolveComponent("tiny-button"); | ||
@@ -83,38 +100,67 @@ var _component_icon_popup = resolveComponent("icon-popup"); | ||
var _component_icon_writing = resolveComponent("icon-writing"); | ||
return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "default", {}, function () { | ||
return [!($props.showMore && $props.showMore > 0) ? (openBlock(), createElementBlock("ul", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.data, function (node, index) { | ||
return openBlock(), createElementBlock("li", { | ||
key: index, | ||
class: normalizeClass({ | ||
active: _ctx.state.value === node[$props.valueField] | ||
}) | ||
}, [createElementVNode("button", { | ||
class: normalizeClass(_ctx.state.attributeValue), | ||
style: normalizeStyle({ | ||
height: $props.size == 'medium' ? '42px' : $props.size == 'small' ? '36px' : $props.size == 'mini' ? '24px' : '', | ||
'line-height': $props.size == 'medium' ? '40px' : $props.size == 'small' ? '34px' : $props.size == 'mini' ? '22px' : '' | ||
}), | ||
type: "button", | ||
onClick: function onClick($event) { | ||
return _ctx.handleClick(node); | ||
} | ||
}, toDisplayString(node[$props.textField]), 15, _hoisted_3)], 2); | ||
}), 128))])) : (openBlock(), createElementBlock("ul", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.state.buttonData, function (node, index) { | ||
return openBlock(), createElementBlock("li", { | ||
key: index, | ||
class: normalizeClass({ | ||
active: _ctx.state.value === node[$props.valueField] | ||
}) | ||
}, [createVNode(_component_tiny_button, { | ||
class: normalizeClass(_ctx.state.attributeValue), | ||
onClick: function onClick($event) { | ||
return _ctx.handleClick(node); | ||
} | ||
}, { | ||
default: withCtx(function () { | ||
return [createTextVNode(toDisplayString(node[$props.textField]), 1)]; | ||
}), | ||
_: 2 | ||
}, 1032, ["class", "onClick"])], 2); | ||
}), 128)), $props.data.length > $props.showMore ? (openBlock(), createElementBlock("li", _hoisted_5, [createVNode(_component_tiny_popover, { | ||
return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "default", {}, function() { | ||
return [!(_ctx.showMore && _ctx.showMore > 0) ? (openBlock(), createElementBlock("ul", _hoisted_2, [(openBlock(true), createElementBlock( | ||
Fragment, | ||
null, | ||
renderList(_ctx.data, function(node, index) { | ||
return openBlock(), createElementBlock( | ||
"li", | ||
{ | ||
key: index, | ||
class: normalizeClass({ | ||
active: _ctx.state.value === node[_ctx.valueField] | ||
}) | ||
}, | ||
[createElementVNode("button", { | ||
class: normalizeClass(_ctx.state.attributeValue), | ||
style: normalizeStyle({ | ||
height: _ctx.size == "medium" ? "42px" : _ctx.size == "small" ? "36px" : _ctx.size == "mini" ? "24px" : "", | ||
"line-height": _ctx.size == "medium" ? "40px" : _ctx.size == "small" ? "34px" : _ctx.size == "mini" ? "22px" : "" | ||
}), | ||
type: "button", | ||
onClick: function onClick($event) { | ||
return _ctx.handleClick(node); | ||
} | ||
}, toDisplayString(node[_ctx.textField]), 15, _hoisted_3)], | ||
2 | ||
/* CLASS */ | ||
); | ||
}), | ||
128 | ||
/* KEYED_FRAGMENT */ | ||
))])) : (openBlock(), createElementBlock("ul", _hoisted_4, [(openBlock(true), createElementBlock( | ||
Fragment, | ||
null, | ||
renderList(_ctx.state.buttonData, function(node, index) { | ||
return openBlock(), createElementBlock( | ||
"li", | ||
{ | ||
key: index, | ||
class: normalizeClass({ | ||
active: _ctx.state.value === node[_ctx.valueField] | ||
}) | ||
}, | ||
[createVNode(_component_tiny_button, { | ||
class: normalizeClass(_ctx.state.attributeValue), | ||
onClick: function onClick($event) { | ||
return _ctx.handleClick(node); | ||
} | ||
}, { | ||
default: withCtx(function() { | ||
return [createTextVNode( | ||
toDisplayString(node[_ctx.textField]), | ||
1 | ||
/* TEXT */ | ||
)]; | ||
}), | ||
_: 2 | ||
/* DYNAMIC */ | ||
}, 1032, ["class", "onClick"])], | ||
2 | ||
/* CLASS */ | ||
); | ||
}), | ||
128 | ||
/* KEYED_FRAGMENT */ | ||
)), _ctx.data.length > _ctx.showMore ? (openBlock(), createElementBlock("li", _hoisted_5, [createVNode(_component_tiny_popover, { | ||
"visible-arrow": false, | ||
@@ -124,43 +170,52 @@ width: "200", | ||
}, { | ||
reference: withCtx(function () { | ||
reference: withCtx(function() { | ||
return [createVNode(_component_tiny_button, { | ||
class: "more-button" | ||
}, { | ||
default: withCtx(function () { | ||
default: withCtx(function() { | ||
return [createVNode(_component_icon_popup)]; | ||
}), | ||
_: 1 | ||
/* STABLE */ | ||
})]; | ||
}), | ||
default: withCtx(function () { | ||
return [createElementVNode("ul", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.state.moreData, function (moreNode, index) { | ||
return openBlock(), createElementBlock("li", { | ||
key: index, | ||
class: normalizeClass({ | ||
active: _ctx.state.value === moreNode[$props.valueField], | ||
'more-item': true | ||
}), | ||
onClick: function onClick($event) { | ||
return _ctx.moreNodeClick(moreNode); | ||
} | ||
}, toDisplayString(moreNode[$props.textField]), 11, _hoisted_7); | ||
}), 128))])]; | ||
default: withCtx(function() { | ||
return [createElementVNode("ul", _hoisted_6, [(openBlock(true), createElementBlock( | ||
Fragment, | ||
null, | ||
renderList(_ctx.state.moreData, function(moreNode, index) { | ||
return openBlock(), createElementBlock("li", { | ||
key: index, | ||
class: normalizeClass({ | ||
active: _ctx.state.value === moreNode[_ctx.valueField], | ||
"more-item": true | ||
}), | ||
onClick: function onClick($event) { | ||
return _ctx.moreNodeClick(moreNode); | ||
} | ||
}, toDisplayString(moreNode[_ctx.textField]), 11, _hoisted_7); | ||
}), | ||
128 | ||
/* KEYED_FRAGMENT */ | ||
))])]; | ||
}), | ||
_: 1 | ||
})])) : createCommentVNode("", true), $props.showEdit ? (openBlock(), createElementBlock("li", _hoisted_8, [createVNode(_component_tiny_button, { | ||
onClick: _cache[0] || (_cache[0] = function ($event) { | ||
return _ctx.$emit('edit'); | ||
/* STABLE */ | ||
})])) : createCommentVNode("v-if", true), _ctx.showEdit ? (openBlock(), createElementBlock("li", _hoisted_8, [createVNode(_component_tiny_button, { | ||
onClick: _cache[0] || (_cache[0] = function($event) { | ||
return _ctx.$emit("edit"); | ||
}), | ||
class: "edit-button" | ||
}, { | ||
default: withCtx(function () { | ||
default: withCtx(function() { | ||
return [createVNode(_component_icon_writing)]; | ||
}), | ||
_: 1 | ||
})])) : createCommentVNode("", true)]))]; | ||
/* STABLE */ | ||
})])) : createCommentVNode("v-if", true)]))]; | ||
})]); | ||
} | ||
script.render = render; | ||
export { script as default }; | ||
var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { | ||
pc as default | ||
}; |
{ | ||
"name": "@opentiny/vue-button-group", | ||
"version": "3.6.0", | ||
"version": "3.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": "~3.6.0", | ||
"@opentiny/vue-renderless": "~3.6.0", | ||
"@opentiny/vue-icon": "~3.6.0", | ||
"@opentiny/vue-theme": "~3.6.0", | ||
"@opentiny/vue-theme-mobile": "~3.6.0" | ||
"@opentiny/vue-common": "~3.6.1-alpha.0", | ||
"@opentiny/vue-renderless": "~3.6.1-alpha.0" | ||
}, | ||
"license": "MIT", | ||
"types": "index.d.ts", | ||
"sideEffects": false | ||
"scripts": { | ||
"build": "pnpm -w build:ui $npm_package_name", | ||
"//postversion": "pnpm build" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
declare const _default: import("vue").DefineComponent<{ | ||
declare const _default: import("@vue/runtime-core").DefineComponent<{ | ||
size: StringConstructor; | ||
@@ -20,3 +20,5 @@ data: ArrayConstructor; | ||
}; | ||
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "edit"[], "edit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{ | ||
size: StringConstructor; | ||
@@ -40,7 +42,5 @@ data: ArrayConstructor; | ||
}; | ||
}>> & { | ||
onEdit?: ((...args: any[]) => any) | undefined; | ||
}, { | ||
}>>, { | ||
plain: boolean; | ||
disabled: boolean; | ||
plain: boolean; | ||
valueField: string; | ||
@@ -47,0 +47,0 @@ textField: string; |
@@ -1,18 +0,15 @@ | ||
declare const _default: { | ||
props: string[]; | ||
components: { | ||
TinyPopover: any; | ||
TinyButton: any; | ||
IconPopup: any; | ||
IconWriting: any; | ||
}; | ||
setup(props: any, context: any): { | ||
t: any; | ||
vm: any; | ||
f: (props: any, attrs?: {}) => {}; | ||
a: (attrs: any, filters: any, include: any) => {}; | ||
d: (props: any) => void; | ||
dp: (props: any) => void; | ||
}; | ||
}; | ||
export default _default; | ||
declare const _sfc_main: import("@vue/runtime-core").DefineComponent<Readonly<{ | ||
[x: string]: any; | ||
}>, { | ||
t: (this: any, path: any, options?: any) => any; | ||
vm: any; | ||
f: (props: any, attrs?: {}) => {}; | ||
a: (attrs: any, filters: any, include: any) => {}; | ||
d: (props: any) => void; | ||
dp: (props: any) => void; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{ | ||
[x: string]: any; | ||
}>>>, { | ||
[x: string]: any; | ||
}>; | ||
export default _sfc_main; |
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
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
2
7
13513
363
2
1
- Removed@opentiny/vue-icon@~3.6.0
- Removed@opentiny/vue-theme@~3.6.0
- Removed@opentiny/vue-theme-mobile@~3.6.0
- Removed@opentiny/vue-icon@3.6.7(transitive)