@opentiny/vue-checkbox
Advanced tools
Comparing version 3.12.0 to 3.13.0-alpha.0
@@ -20,9 +20,11 @@ function _extends() { | ||
var template = function template2(mode) { | ||
if ("pc" === (process.env.TINY_MODE || mode)) { | ||
var _process$env; | ||
var tinyMode = typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null; | ||
if ("pc" === (tinyMode || mode)) { | ||
return PcTemplate; | ||
} | ||
if ("mobile" === (process.env.TINY_MODE || mode)) { | ||
if ("mobile" === (tinyMode || mode)) { | ||
return MobileTemplate; | ||
} | ||
if ("mobile-first" === (process.env.TINY_MODE || mode)) { | ||
if ("mobile-first" === (tinyMode || mode)) { | ||
return MobileFirstTemplate; | ||
@@ -86,2 +88,7 @@ } | ||
default: false | ||
}, | ||
iconPosition: String, | ||
shape: { | ||
type: String, | ||
default: "" | ||
} | ||
@@ -100,3 +107,3 @@ }); | ||
}); | ||
var version = "3.12.0"; | ||
var version = "3.13.0-alpha.0"; | ||
Checkbox.model = { | ||
@@ -103,0 +110,0 @@ prop: "modelValue", |
import { renderless, api } from "@opentiny/vue-renderless/checkbox/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import { iconHalfselect, iconCheckedSur, iconCheck } from "@opentiny/vue-icon"; | ||
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, createVNode, withDirectives, withModifiers, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue"; | ||
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, createVNode, withDirectives, withModifiers, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, Fragment, createCommentVNode } from "vue"; | ||
function _createForOfIteratorHelperLoose_tiny(o, allowArrayLike) { | ||
@@ -77,4 +77,3 @@ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; | ||
key: 0, | ||
ref: "label", | ||
class: "py-3 sm:py-0 pl-0 sm:pl-2 text-color-text-primary mr-5 flex-auto" | ||
class: "text-color-text-primary cursor-default" | ||
}; | ||
@@ -87,7 +86,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
"data-tag": "tiny-checkbox", | ||
class: _ctx.m("inline-flex sm:items-center text-sm sm:py-2 leading-5 cursor-pointer", _ctx.state.size === "medium" ? "sm:text-sm" : "sm:text-xs", _ctx.customClass), | ||
class: _ctx.m("inline-flex sm:items-center text-sm leading-5 cursor-pointer", _ctx.state.size === "medium" ? "sm:text-sm" : "sm:text-xs", { | ||
"sm:py-2": _ctx.state.vertical | ||
}, _ctx.state.isDisplayOnly || _ctx.state.isGroupDisplayOnly ? _ctx.state.isChecked ? "cursor-default after:content-[';'] after:inline-block last:after:content-['']" : "hidden" : "", _ctx.state.showLabel ? "inline-flex" : "", _ctx.customClass), | ||
id: _ctx.id, | ||
tabindex: "-1" | ||
}, _ctx.a(_ctx.$attrs, ["class", "style", "onClick"], true)), [createElementVNode("span", { | ||
class: normalizeClass(["relative w-11 h-11 sm:p-0", _ctx.state.size === "medium" ? "sm:w-6 sm:h-6" : "sm:h-4 sm:w-4", _ctx.state.isDisplayOnly || _ctx.state.isGroupDisplayOnly ? "hidden" : ""]), | ||
class: normalizeClass(["relative w-7 h-7 mr-2 sm:mr-0 sm:p-0", _ctx.state.size === "medium" ? "sm:w-6 sm:h-6" : "sm:h-4 sm:w-4", _ctx.state.isDisplayOnly || _ctx.state.isGroupDisplayOnly ? "hidden" : ""]), | ||
role: _ctx.indeterminate ? "checkbox" : false, | ||
@@ -106,7 +107,7 @@ "aria-checked": _ctx.indeterminate ? "mixed" : false | ||
key: 0, | ||
class: "absolute inset-0 w-0 h-0 -z-10 opacity-0", | ||
class: "absolute left-0 right-0 top-0 bottom-0 w-0 h-0 -z-10 opacity-0", | ||
type: "checkbox", | ||
"aria-hidden": _ctx.indeterminate ? "true" : "false", | ||
name: _ctx.name, | ||
disabled: _ctx.state.isDisabled, | ||
disabled: _ctx.state.inputDisabled, | ||
"true-value": _ctx.trueLabel, | ||
@@ -130,6 +131,6 @@ "false-value": _ctx.falseLabel, | ||
key: 1, | ||
class: "absolute inset-0 w-0 h-0 -z-10 opacity-0", | ||
class: "absolute left-0 right-0 top-0 bottom-0 w-0 h-0 -z-10 opacity-0", | ||
type: "checkbox", | ||
"aria-hidden": _ctx.indeterminate ? "true" : "false", | ||
disabled: _ctx.state.isDisabled, | ||
disabled: _ctx.state.inputDisabled, | ||
value: _ctx.label, | ||
@@ -153,3 +154,7 @@ name: _ctx.name, | ||
"span", | ||
_hoisted_6, | ||
{ | ||
key: 0, | ||
ref: "label", | ||
class: normalizeClass(_ctx.m("py-0 pl-0 sm:pl-2 mr-5 flex-auto leading-7 sm:leading-none", _ctx.state.isDisabled ? "cursor-not-allowed text-color-text-disabled" : "text-color-text-primary", _ctx.state.isDisplayOnly || _ctx.state.isGroupDisplayOnly ? "p-0 sm:p-0 m-0 text-color-text-primary cursor-default" : "")) | ||
}, | ||
[renderSlot(_ctx.$slots, "default", {}, function() { | ||
@@ -162,5 +167,19 @@ return [createTextVNode( | ||
})], | ||
512 | ||
/* NEED_PATCH */ | ||
)) : createCommentVNode("v-if", true)], 16, _hoisted_1); | ||
2 | ||
/* CLASS */ | ||
)) : (openBlock(), createElementBlock( | ||
Fragment, | ||
{ | ||
key: 1 | ||
}, | ||
[_ctx.state.isDisplayOnly ? (openBlock(), createElementBlock( | ||
"span", | ||
_hoisted_6, | ||
toDisplayString(_ctx.state.displayLabel), | ||
1 | ||
/* TEXT */ | ||
)) : createCommentVNode("v-if", true)], | ||
64 | ||
/* STABLE_FRAGMENT */ | ||
))], 16, _hoisted_1); | ||
} | ||
@@ -167,0 +186,0 @@ var mobileFirst = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); |
@@ -52,3 +52,3 @@ import { renderless, api } from "@opentiny/vue-renderless/checkbox/vue"; | ||
inheritAttrs: false, | ||
props: [].concat(props, ["modelValue", "text", "events", "label", "indeterminate", "disabled", "checked", "name", "trueLabel", "falseLabel", "id"]), | ||
props: [].concat(props, ["modelValue", "text", "events", "label", "indeterminate", "disabled", "checked", "name", "trueLabel", "falseLabel", "id", "iconPosition"]), | ||
setup: function setup(props2, context) { | ||
@@ -86,3 +86,4 @@ return _setup({ | ||
"is-indeterminate": _ctx.indeterminate, | ||
"is-focus": _ctx.state.focus | ||
"is-focus": _ctx.state.focus, | ||
"icon-position-top": _ctx.state.iconPosition === "top" | ||
}]), | ||
@@ -89,0 +90,0 @@ id: _ctx.id |
@@ -5,3 +5,4 @@ import { renderless, api } from "@opentiny/vue-renderless/checkbox/vue"; | ||
import { iconHalfselect, iconCheckedSur, iconCheck } from "@opentiny/vue-icon"; | ||
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, createBlock, withDirectives, withModifiers, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue"; | ||
import Tooltip from "@opentiny/vue-tooltip"; | ||
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, createBlock, withDirectives, withModifiers, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createCommentVNode } from "vue"; | ||
function _createForOfIteratorHelperLoose_tiny(o, allowArrayLike) { | ||
@@ -53,8 +54,9 @@ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; | ||
var _sfc_main = defineComponent({ | ||
emits: ["change", "update:modelValue", "complete"], | ||
props: [].concat(props, ["modelValue", "text", "events", "label", "indeterminate", "disabled", "checked", "name", "trueLabel", "falseLabel", "id", "controls", "size", "border", "validateEvent", "displayOnly"]), | ||
emits: ["update:modelValue", "change", "complete", "click"], | ||
props: [].concat(props, ["modelValue", "text", "events", "label", "indeterminate", "disabled", "checked", "name", "trueLabel", "falseLabel", "id", "controls", "size", "border", "validateEvent", "displayOnly", "shape"]), | ||
components: { | ||
IconHalfselect: iconHalfselect(), | ||
IconCheckedSur: iconCheckedSur(), | ||
IconCheck: iconCheck() | ||
IconCheck: iconCheck(), | ||
TinyTooltip: Tooltip | ||
}, | ||
@@ -78,6 +80,2 @@ setup: function setup(props2, context) { | ||
var _hoisted_5 = ["aria-hidden", "disabled", "value", "name"]; | ||
var _hoisted_6 = { | ||
key: 0, | ||
class: "tiny-checkbox__label tiny-checkbox-display-only" | ||
}; | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
@@ -87,2 +85,3 @@ var _component_icon_halfselect = resolveComponent("icon-halfselect"); | ||
var _component_icon_check = resolveComponent("icon-check"); | ||
var _component_tiny_tooltip = resolveComponent("tiny-tooltip"); | ||
return openBlock(), createElementBlock("label", mergeProps({ | ||
@@ -99,2 +98,4 @@ class: ["tiny-checkbox", [_ctx.border && _ctx.state.checkboxSize ? "tiny-checkbox--" + _ctx.state.checkboxSize : "", { | ||
"is-display-only": _ctx.state.isDisplayOnly | ||
}, { | ||
"is-filter": _ctx.state.shape === "filter" | ||
}]], | ||
@@ -112,3 +113,3 @@ id: _ctx.id, | ||
"aria-checked": _ctx.indeterminate ? "mixed" : false | ||
}, [createElementVNode("span", _hoisted_3, [_ctx.indeterminate ? (openBlock(), createBlock(_component_icon_halfselect, { | ||
}, [createElementVNode("span", _hoisted_3, [_ctx.indeterminate && _ctx.state.shape !== "filter" ? (openBlock(), createBlock(_component_icon_halfselect, { | ||
key: 0, | ||
@@ -167,9 +168,34 @@ class: "tiny-svg-size icon-halfselect" | ||
}, ["stop"])) | ||
}, null, 40, _hoisted_5)), [[vModelCheckbox, _ctx.state.model]])], 10, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || _ctx.state.isShowText ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "default", {}, function() { | ||
return [createTextVNode( | ||
toDisplayString(_ctx.state.showText), | ||
1 | ||
/* TEXT */ | ||
)]; | ||
})])) : createCommentVNode("v-if", true)], 16, _hoisted_1); | ||
}, null, 40, _hoisted_5)), [[vModelCheckbox, _ctx.state.model]])], 10, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || _ctx.state.isShowText ? (openBlock(), createElementBlock( | ||
"span", | ||
{ | ||
key: 0, | ||
class: "tiny-checkbox__label tiny-checkbox-display-only", | ||
onMouseenter: _cache[11] || (_cache[11] = function() { | ||
return _ctx.handleLabelMouseenter && _ctx.handleLabelMouseenter.apply(_ctx, arguments); | ||
}), | ||
onMouseleave: _cache[12] || (_cache[12] = function() { | ||
return _ctx.handleMouseleave && _ctx.handleMouseleave.apply(_ctx, arguments); | ||
}) | ||
}, | ||
[renderSlot(_ctx.$slots, "default", {}, function() { | ||
return [createTextVNode( | ||
toDisplayString(_ctx.state.showText), | ||
1 | ||
/* TEXT */ | ||
)]; | ||
}), createVNode(_component_tiny_tooltip, { | ||
ref: "tooltip", | ||
modelValue: _ctx.state.tooltipVisible, | ||
"onUpdate:modelValue": _cache[10] || (_cache[10] = function($event) { | ||
return _ctx.state.tooltipVisible = $event; | ||
}), | ||
manual: true, | ||
effect: "light", | ||
content: _ctx.state.displayedValue, | ||
placement: "top" | ||
}, null, 8, ["modelValue", "content"])], | ||
32 | ||
/* NEED_HYDRATION */ | ||
)) : createCommentVNode("v-if", true)], 16, _hoisted_1); | ||
} | ||
@@ -176,0 +202,0 @@ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); |
{ | ||
"name": "@opentiny/vue-checkbox", | ||
"version": "3.12.0", | ||
"version": "3.13.0-alpha.0", | ||
"description": "", | ||
@@ -10,4 +10,5 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@opentiny/vue-common": "~3.12.0", | ||
"@opentiny/vue-renderless": "~3.12.0" | ||
"@opentiny/vue-common": "~3.13.0-alpha.0", | ||
"@opentiny/vue-renderless": "~3.13.0-alpha.0", | ||
"@opentiny/vue-tooltip": "~3.13.0-alpha.0" | ||
}, | ||
@@ -14,0 +15,0 @@ "license": "MIT", |
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
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
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
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
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
0
100
2
27602
3
6
644
2
+ Added@opentiny/vue-common@3.13.1(transitive)
+ Added@opentiny/vue-locale@3.13.0(transitive)
+ Added@opentiny/vue-renderless@3.13.2(transitive)
+ Added@opentiny/vue-theme@3.13.3(transitive)
+ Added@opentiny/vue-theme-mobile@3.13.0(transitive)
+ Added@opentiny/vue-tooltip@3.13.0(transitive)
- Removed@opentiny/vue-common@3.12.0(transitive)
- Removed@opentiny/vue-locale@3.12.0(transitive)
- Removed@opentiny/vue-renderless@3.12.1(transitive)
- Removed@opentiny/vue-theme@3.12.1(transitive)
- Removed@opentiny/vue-theme-mobile@3.12.0(transitive)