@opentiny/vue-dropdown-item
Advanced tools
Comparing version 3.1.0-alpha.0 to 3.4.7
@@ -77,2 +77,20 @@ import { $prefix, $props, $setup } from '@opentiny/vue-common'; | ||
default: 'selection' | ||
}, | ||
label: { | ||
type: String, | ||
default: '' | ||
}, | ||
itemData: { | ||
type: Object, | ||
default: function _default() { | ||
return {}; | ||
} | ||
}, | ||
appendToBody: { | ||
type: Boolean, | ||
default: true | ||
}, | ||
textField: { | ||
type: String, | ||
default: 'label' | ||
} | ||
@@ -96,4 +114,4 @@ }), | ||
}; | ||
DropdownItem.version = '3.1.0-alpha.0'; | ||
DropdownItem.version = '3.4.7'; | ||
export { DropdownItem as default }; |
@@ -1,4 +0,6 @@ | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import { $prefix, setup, props } from '@opentiny/vue-common'; | ||
import { renderless, api } from '@opentiny/vue-renderless/dropdown-item/vue'; | ||
import { iconDeltaLeft } from '@opentiny/vue-icon'; | ||
import '@opentiny/vue-theme/dropdown-item/index.css'; | ||
import { openBlock, createElementBlock, normalizeClass, withModifiers, createBlock, resolveDynamicComponent, createCommentVNode, renderSlot } from 'vue'; | ||
import { resolveComponent, openBlock, createElementBlock, normalizeClass, withModifiers, createVNode, createCommentVNode, createElementVNode, createBlock, resolveDynamicComponent, renderSlot, toDisplayString, Fragment, renderList, withCtx } from 'vue'; | ||
@@ -32,3 +34,9 @@ function _toConsumableArray(arr) { | ||
var script = { | ||
props: [].concat(_toConsumableArray(props), ['command', 'disabled', 'divided', 'icon']), | ||
name: $prefix + 'DropdownItem', | ||
componentName: $prefix + 'DropdownItem', | ||
emits: ['item-click'], | ||
props: [].concat(_toConsumableArray(props), ['command', 'disabled', 'divided', 'icon', 'label', 'itemData', 'appendToBody', 'textField']), | ||
components: { | ||
iconDeltaLeft: iconDeltaLeft() | ||
}, | ||
setup: function setup$1(props, context) { | ||
@@ -38,12 +46,4 @@ return setup({ | ||
context: context, | ||
renderless: function renderless(props, hooks, _ref) { | ||
var dispatch = _ref.dispatch, | ||
vm = _ref.vm; | ||
return { | ||
handleClick: function handleClick() { | ||
dispatch('TinyDropdown', 'menu-item-click', [props.itemData, vm]); | ||
} | ||
}; | ||
}, | ||
api: ['handleClick'] | ||
renderless: renderless, | ||
api: api | ||
}); | ||
@@ -54,3 +54,12 @@ } | ||
var _hoisted_1 = ["aria-disabled", "tabindex"]; | ||
var _hoisted_2 = { | ||
key: 0, | ||
class: "tiny-dropdown-menu__item-expand" | ||
}; | ||
var _hoisted_3 = { | ||
class: "tiny-dropdown-menu__item-content" | ||
}; | ||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
var _component_icon_delta_left = resolveComponent("icon-delta-left"); | ||
var _component_tiny_dropdown_item = resolveComponent("tiny-dropdown-item"); | ||
return openBlock(), createElementBlock("li", { | ||
@@ -61,11 +70,36 @@ class: normalizeClass(["tiny-dropdown-menu__item", { | ||
}]), | ||
onClick: _cache[0] || (_cache[0] = withModifiers(function () { | ||
ref: "dropdownItem", | ||
onClick: _cache[0] || (_cache[0] = function () { | ||
return _ctx.handleClick && _ctx.handleClick.apply(_ctx, arguments); | ||
}, ["stop"])), | ||
}), | ||
onMousedown: _cache[1] || (_cache[1] = withModifiers(function () {}, ["stop"])), | ||
"aria-disabled": $props.disabled, | ||
tabindex: $props.disabled ? null : -1 | ||
}, [$props.icon ? (openBlock(), createBlock(resolveDynamicComponent($props.icon), { | ||
}, [$props.itemData.children && $props.itemData.children.length ? (openBlock(), createElementBlock("span", _hoisted_2, [createVNode(_component_icon_delta_left)])) : createCommentVNode("", true), createElementVNode("div", _hoisted_3, [$props.icon ? (openBlock(), createBlock(resolveDynamicComponent($props.icon), { | ||
key: 0, | ||
class: "tiny-svg-size" | ||
})) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")], 10, _hoisted_1); | ||
})) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default", { | ||
itemData: $props.itemData | ||
}, function () { | ||
return [createElementVNode("span", null, toDisplayString($props.label), 1)]; | ||
})]), $props.itemData.children && $props.itemData.children.length ? (openBlock(), createElementBlock("ul", { | ||
key: 1, | ||
class: normalizeClass(['tiny-dropdown-menu', 'tiny-dropdown-menu__item--child', _ctx.state.popperClass]) | ||
}, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.itemData.children, function (item, index) { | ||
return openBlock(), createBlock(_component_tiny_dropdown_item, { | ||
key: index, | ||
label: item[_ctx.state.textField], | ||
itemData: item, | ||
icon: item.icon, | ||
disabled: item.disabled, | ||
divided: item.divided | ||
}, { | ||
default: withCtx(function () { | ||
return [renderSlot(_ctx.$slots, "default", { | ||
itemData: item | ||
})]; | ||
}), | ||
_: 2 | ||
}, 1032, ["label", "itemData", "icon", "disabled", "divided"]); | ||
}), 128))], 2)) : createCommentVNode("", true)], 42, _hoisted_1); | ||
} | ||
@@ -72,0 +106,0 @@ |
{ | ||
"name": "@opentiny/vue-dropdown-item", | ||
"version": "3.1.0-alpha.0", | ||
"version": "3.4.7", | ||
"description": "", | ||
@@ -12,12 +12,13 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@opentiny/vue-common": "~3.1.0-alpha.0", | ||
"@opentiny/vue-icon": "~3.1.0-alpha.0", | ||
"@opentiny/vue-renderless": "~3.1.0-alpha.0", | ||
"@opentiny/vue-popup": "~3.1.0-alpha.0", | ||
"@opentiny/vue-button": "~3.1.0-alpha.0", | ||
"@opentiny/vue-theme": "~3.1.0-alpha.0", | ||
"@opentiny/vue-theme-mobile": "~3.1.0-alpha.0" | ||
"@opentiny/vue-common": "~3.4.7", | ||
"@opentiny/vue-icon": "~3.4.7", | ||
"@opentiny/vue-renderless": "~3.4.0", | ||
"@opentiny/vue-popup": "~3.4.7", | ||
"@opentiny/vue-button": "~3.4.7", | ||
"@opentiny/vue-theme": "~3.4.0", | ||
"@opentiny/vue-theme-mobile": "~3.4.0" | ||
}, | ||
"license": "MIT", | ||
"types": "index.d.ts", | ||
"sideEffects": false | ||
} |
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
21368
9
520
1
2
80
+ Added@babel/runtime@7.18.3(transitive)
+ Added@opentiny/vue-button@3.4.7(transitive)
+ Added@opentiny/vue-common@3.4.7(transitive)
+ Added@opentiny/vue-icon@3.4.8(transitive)
+ Added@opentiny/vue-locale@3.4.7(transitive)
+ Added@opentiny/vue-popup@3.4.7(transitive)
+ Added@opentiny/vue-renderless@3.4.7(transitive)
+ Added@opentiny/vue-theme@3.4.7(transitive)
+ Added@opentiny/vue-theme-mobile@3.4.7(transitive)
+ Addedregenerator-runtime@0.13.11(transitive)
- Removed@babel/runtime@7.25.6(transitive)
- Removed@opentiny/vue-button@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-common@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-icon@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-locale@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-popup@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-renderless@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-theme@3.1.0-alpha.1(transitive)
- Removed@opentiny/vue-theme-mobile@3.1.0-alpha.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
Updated@opentiny/vue-button@~3.4.7
Updated@opentiny/vue-common@~3.4.7
Updated@opentiny/vue-icon@~3.4.7
Updated@opentiny/vue-popup@~3.4.7
Updated@opentiny/vue-theme@~3.4.0