@opentiny/vue-checkbox
Advanced tools
Comparing version 3.6.0 to 3.6.1-alpha.0
@@ -0,0 +0,0 @@ /** |
123
lib/index.js
@@ -1,67 +0,33 @@ | ||
import { $prefix, $props, $setup } from '@opentiny/vue-common'; | ||
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); | ||
} | ||
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common"; | ||
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 $constants = { | ||
FORM_ITEM: 'FormItem', | ||
FORM_CHANGE: 'form.change', | ||
CHECKBOX: $prefix + 'Checkbox', | ||
CHECKBOX_GROUP: 'CheckboxGroup' | ||
FORM_ITEM: "FormItem", | ||
FORM_CHANGE: "form.change", | ||
CHECKBOX: $prefix + "Checkbox", | ||
CHECKBOX_GROUP: "CheckboxGroup" | ||
}; | ||
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; | ||
}; | ||
var Checkbox = { | ||
name: $prefix + 'Checkbox', | ||
props: _objectSpread2(_objectSpread2({}, $props), {}, { | ||
var Checkbox = defineComponent({ | ||
name: $prefix + "Checkbox", | ||
props: _extends({}, $props, { | ||
_constants: { | ||
@@ -81,3 +47,9 @@ type: Object, | ||
falseLabel: [String, Number], | ||
/* | ||
* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系 | ||
*/ | ||
id: String, | ||
/* | ||
* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系 | ||
*/ | ||
controls: String, | ||
@@ -93,3 +65,3 @@ border: Boolean, | ||
type: Object, | ||
default: function _default() { | ||
default: function _default2() { | ||
return {}; | ||
@@ -101,18 +73,19 @@ } | ||
return $setup({ | ||
props: props, | ||
context: context, | ||
template: template | ||
props, | ||
context, | ||
template | ||
}); | ||
} | ||
}; | ||
}); | ||
var version = "3.7.0"; | ||
Checkbox.model = { | ||
prop: 'modelValue', | ||
event: 'update:modelValue' | ||
prop: "modelValue", | ||
event: "update:modelValue" | ||
}; | ||
Checkbox.install = function (Vue) { | ||
Checkbox.install = function(Vue) { | ||
Vue.component(Checkbox.name, Checkbox); | ||
}; | ||
Checkbox.version = '3.6.0'; | ||
export { Checkbox as default }; | ||
Checkbox.version = version; | ||
export { | ||
Checkbox as default | ||
}; |
@@ -1,50 +0,73 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/checkbox/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import '@opentiny/vue-theme-mobile/checkbox/index.css'; | ||
import { createElementVNode, openBlock, createElementBlock, normalizeClass, withDirectives, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
import { renderless, api } from "@opentiny/vue-renderless/checkbox/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import "@opentiny/vue-theme-mobile/checkbox/index.css"; | ||
import { openBlock, createElementBlock, normalizeClass, createElementVNode, withDirectives, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, 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 = { | ||
var _sfc_main = /* @__PURE__ */ defineComponent({ | ||
inheritAttrs: false, | ||
props: [].concat(_toConsumableArray(props), ['modelValue', 'text', 'events', 'label', 'indeterminate', 'disabled', 'checked', 'name', 'trueLabel', 'falseLabel', 'id']), | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api | ||
props: [].concat(props, ["modelValue", "text", "events", "label", "indeterminate", "disabled", "checked", "name", "trueLabel", "falseLabel", "id"]), | ||
setup: function setup(props2, context) { | ||
return _setup({ | ||
props: props2, | ||
context, | ||
renderless, | ||
api | ||
}); | ||
} | ||
}; | ||
}); | ||
var _hoisted_1 = ["id"]; | ||
var _hoisted_2 = ["tabindex", "role", "aria-checked"]; | ||
var _hoisted_3 = createElementVNode("span", { | ||
class: "tiny-mobile-checkbox__inner" | ||
}, null, -1); | ||
var _hoisted_3 = /* @__PURE__ */ createElementVNode( | ||
"span", | ||
{ | ||
class: "tiny-mobile-checkbox__inner" | ||
}, | ||
null, | ||
-1 | ||
/* HOISTED */ | ||
); | ||
var _hoisted_4 = ["aria-hidden", "name", "disabled", "true-value", "false-value"]; | ||
@@ -56,35 +79,35 @@ var _hoisted_5 = ["aria-hidden", "disabled", "value", "name"]; | ||
}; | ||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("label", { | ||
class: normalizeClass(["tiny-mobile-checkbox", { | ||
'is-disabled': _ctx.state.isDisabled, | ||
'is-checked': _ctx.state.isChecked, | ||
'is-indeterminate': $props.indeterminate, | ||
'is-focus': _ctx.state.focus | ||
"is-disabled": _ctx.state.isDisabled, | ||
"is-checked": _ctx.state.isChecked, | ||
"is-indeterminate": _ctx.indeterminate, | ||
"is-focus": _ctx.state.focus | ||
}]), | ||
id: $props.id | ||
id: _ctx.id | ||
}, [createElementVNode("span", { | ||
class: "tiny-mobile-checkbox__input", | ||
tabindex: $props.indeterminate ? 0 : false, | ||
role: $props.indeterminate ? 'checkbox' : false, | ||
"aria-checked": $props.indeterminate ? 'mixed' : false | ||
}, [_hoisted_3, $props.trueLabel || $props.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { | ||
tabindex: _ctx.indeterminate ? 0 : false, | ||
role: _ctx.indeterminate ? "checkbox" : false, | ||
"aria-checked": _ctx.indeterminate ? "mixed" : false | ||
}, [_hoisted_3, _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { | ||
key: 0, | ||
class: "tiny-mobile-checkbox__original", | ||
type: "checkbox", | ||
"aria-hidden": $props.indeterminate ? 'true' : 'false', | ||
name: $props.name, | ||
"aria-hidden": _ctx.indeterminate ? "true" : "false", | ||
name: _ctx.name, | ||
disabled: _ctx.state.isDisabled, | ||
"true-value": $props.trueLabel, | ||
"false-value": $props.falseLabel, | ||
"onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { | ||
"true-value": _ctx.trueLabel, | ||
"false-value": _ctx.falseLabel, | ||
"onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) { | ||
return _ctx.state.model = $event; | ||
}), | ||
onChange: _cache[1] || (_cache[1] = function () { | ||
onChange: _cache[1] || (_cache[1] = function() { | ||
return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments); | ||
}), | ||
onFocus: _cache[2] || (_cache[2] = function ($event) { | ||
onFocus: _cache[2] || (_cache[2] = function($event) { | ||
return _ctx.state.focus = true; | ||
}), | ||
onBlur: _cache[3] || (_cache[3] = function ($event) { | ||
onBlur: _cache[3] || (_cache[3] = function($event) { | ||
return _ctx.state.focus = false; | ||
@@ -96,25 +119,29 @@ }) | ||
type: "checkbox", | ||
"aria-hidden": $props.indeterminate ? 'true' : 'false', | ||
"aria-hidden": _ctx.indeterminate ? "true" : "false", | ||
disabled: _ctx.state.isDisabled, | ||
value: $props.label, | ||
name: $props.name, | ||
"onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) { | ||
value: _ctx.label, | ||
name: _ctx.name, | ||
"onUpdate:modelValue": _cache[4] || (_cache[4] = function($event) { | ||
return _ctx.state.model = $event; | ||
}), | ||
onChange: _cache[5] || (_cache[5] = function () { | ||
onChange: _cache[5] || (_cache[5] = function() { | ||
return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments); | ||
}), | ||
onFocus: _cache[6] || (_cache[6] = function ($event) { | ||
onFocus: _cache[6] || (_cache[6] = function($event) { | ||
return _ctx.state.focus = true; | ||
}), | ||
onBlur: _cache[7] || (_cache[7] = function ($event) { | ||
onBlur: _cache[7] || (_cache[7] = function($event) { | ||
return _ctx.state.focus = false; | ||
}) | ||
}, null, 40, _hoisted_5)), [[vModelCheckbox, _ctx.state.model]])], 8, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || $props.text || $props.label ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "default", {}, function () { | ||
return [createTextVNode(toDisplayString($props.text || $props.label), 1)]; | ||
})])) : createCommentVNode("", true)], 10, _hoisted_1); | ||
}, null, 40, _hoisted_5)), [[vModelCheckbox, _ctx.state.model]])], 8, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || _ctx.text || _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "default", {}, function() { | ||
return [createTextVNode( | ||
toDisplayString(_ctx.text || _ctx.label), | ||
1 | ||
/* TEXT */ | ||
)]; | ||
})])) : createCommentVNode("v-if", true)], 10, _hoisted_1); | ||
} | ||
script.render = render; | ||
export { script as default }; | ||
var mobile = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { | ||
mobile as default | ||
}; |
202
lib/pc.js
@@ -1,65 +0,54 @@ | ||
import { renderless, api } from '@opentiny/vue-renderless/checkbox/vue'; | ||
import { setup, props } from '@opentiny/vue-common'; | ||
import { iconHalfselect, iconCheckedSur, iconCheck } from '@opentiny/vue-icon'; | ||
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, createBlock, createCommentVNode, withDirectives, withModifiers, vModelCheckbox, renderSlot, createTextVNode, toDisplayString } from 'vue'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
import { renderless, api } from "@opentiny/vue-renderless/checkbox/vue"; | ||
import { defineComponent, props, setup as _setup } from "@opentiny/vue-common"; | ||
import "@opentiny/vue-theme/checkbox/index.css"; | ||
import { iconHalfselect, iconCheckedSur, iconCheck } from "@opentiny/vue-icon"; | ||
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, createBlock, createCommentVNode, withDirectives, withModifiers, vModelCheckbox, renderSlot, createTextVNode, toDisplayString } 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."); | ||
} | ||
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); | ||
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; | ||
}; | ||
if (style.styleSheet) { | ||
style.styleSheet.cssText = css; | ||
} else { | ||
style.appendChild(document.createTextNode(css)); | ||
} | ||
} | ||
var css_248z = ".tiny-checkbox{--ti-checkbox-text-color:var(--ti-base-color-info-normal);--ti-checkbox-font-size:var(--ti-common-font-size-base);--ti-checkbox-button-bg-color:var(--ti-base-color-brand-2);--ti-checkbox-bg-color:var(--ti-base-color-white);--ti-checkbox-shadow-color:#dfe1e6;--ti-checkbox-border-radius:var(--ti-common-border-radius-normal);--ti-checkbox-button-hover-text-color:var(--ti-base-color-common-7);--ti-checkbox-button-checked-border-color:var(--ti-base-color-brand-6);--ti-checkbox-button-disabled-text-color:var(--ti-base-color-placeholder);--ti-checkbox-disabled-bg-color:var(--ti-base-color-bg-5);--ti-checkbox-button-disabled-bg-color:var(--ti-base-color-bg-5);--ti-checkbox-button-text-color:var(--ti-base-color-info-normal);--ti-checkbox-button-checked-text-color:var(--ti-base-color-info-normal);--ti-checkbox-inner-border-color:var(--ti-base-color-light);--ti-checkbox-bg-color-checked:var(--ti-base-color-brand-6);--ti-checkbox-border-color-checked:var(--ti-base-color-brand-6);--ti-checkbox-border-color:var(--ti-common-color-line-normal);--ti-checkbox-border-color-hover:var(--ti-base-color-brand-6);--ti-checkbox-icon-height:8px;--ti-checkbox-icon-width:4px;--ti-checkbox-icon-left:4.5px;--ti-checkbox-icon-top:0;--ti-checkbox-bg-color-disable:var(--ti-base-color-bg-5);--ti-checkbox-border-color-unchecked-disabled:var(--ti-base-color-common-1);--ti-checkbox-label-text-color-disabled:var(--ti-base-color-common-2);--ti-checkbox-bg-color-hover:var(--ti-base-color-brand-3);position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--ti-checkbox-text-color);font-weight:500;font-size:0;white-space:nowrap;margin-right:30px;outline:0;cursor:pointer;-ms-user-select:none;-webkit-user-select:none;-o-user-select:none;-moz-user-select:none;user-select:none}.tiny-checkbox:last-of-type{margin-right:0}.tiny-checkbox.is-bordered{padding:9px 20px 9px 10px;border-radius:2px;border:1px solid var(--ti-checkbox-border-color);-webkit-box-sizing:border-box;box-sizing:border-box;line-height:normal;height:40px}.tiny-checkbox.is-bordered+.tiny-checkbox.is-bordered{margin-left:10px}.tiny-checkbox.is-bordered.is-checked{border-color:var(--ti-checkbox-button-checked-border-color)}.tiny-checkbox.is-bordered.is-disabled{border-color:var(--ti-checkbox-border-color-unchecked-disabled);color:var(--ti-checkbox-bg-color-disable);pointer-events:none;cursor:not-allowed}.tiny-checkbox.is-bordered.is-disabled .tiny-checkbox__inner,.tiny-checkbox.is-bordered.is-disabled .tiny-checkbox__inner:hover{border-color:var(--ti-checkbox-border-color-unchecked-disabled);cursor:not-allowed}.tiny-checkbox.is-bordered.is-disabled.is-checked{border-color:var(--ti-checkbox-bg-color-disable)}.tiny-checkbox.is-bordered.is-disabled.is-checked .tiny-checkbox__inner,.tiny-checkbox.is-bordered.is-disabled.is-checked .tiny-checkbox__inner:hover{background-color:var(--ti-checkbox-bg-color-disable);border-color:var(--ti-checkbox-bg-color-disable)}.tiny-checkbox.is-bordered.is-disabled.is-checked .tiny-checkbox__inner::after,.tiny-checkbox.is-bordered.is-disabled.is-checked .tiny-checkbox__inner:hover::after{border-color:var(--ti-checkbox-border-color-unchecked-disabled)}.tiny-checkbox.is-bordered.tiny-checkbox--medium{padding:7px 20px 7px 10px;border-radius:4px;height:36px}.tiny-checkbox.is-bordered.tiny-checkbox--medium .tiny-checkbox__label{line-height:17px;font-size:var(--ti-common-font-size-1)}.tiny-checkbox.is-bordered.tiny-checkbox--medium .tiny-checkbox__inner{height:14px;width:14px}.tiny-checkbox.is-bordered.tiny-checkbox--small{padding:5px 15px 5px 10px;border-radius:3px;height:32px}.tiny-checkbox.is-bordered.tiny-checkbox--small .tiny-checkbox__label{line-height:15px;font-size:var(--ti-common-font-size-base)}.tiny-checkbox.is-bordered.tiny-checkbox--small .tiny-checkbox__inner{height:12px;width:12px}.tiny-checkbox.is-bordered.tiny-checkbox--small .tiny-checkbox__inner::after{height:6px;width:2px}.tiny-checkbox.is-bordered.tiny-checkbox--mini{padding:3px 15px 3px 10px;border-radius:3px;height:28px}.tiny-checkbox.is-bordered.tiny-checkbox--mini .tiny-checkbox__label{line-height:12px;font-size:var(--ti-common-font-size-base)}.tiny-checkbox.is-bordered.tiny-checkbox--mini .tiny-checkbox__inner{height:12px;width:12px}.tiny-checkbox.is-bordered.tiny-checkbox--mini .tiny-checkbox__inner::after{height:6px;width:2px}.tiny-checkbox__input{position:relative;display:inline-block;white-space:nowrap;vertical-align:middle;outline:0;line-height:1;cursor:pointer}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.tiny-checkbox__input{display:inline-block}}@supports (-ms-ime-align:auto){.tiny-checkbox__input{display:inline-block}}.tiny-checkbox__input .tiny-checkbox__inner svg{fill:var(--ti-checkbox-border-color)}.tiny-checkbox__input .tiny-checkbox__inner:hover svg{fill:var(--ti-checkbox-button-hover-text-color)}.tiny-checkbox__input.is-disabled .tiny-checkbox__inner{background-color:var(--ti-checkbox-bg-color-disable);border-color:var(--ti-checkbox-border-color-unchecked-disabled);cursor:not-allowed}.tiny-checkbox__input.is-disabled .tiny-checkbox__inner svg{fill:var(--ti-checkbox-border-color-unchecked-disabled)}.tiny-checkbox__input.is-disabled .tiny-checkbox__inner+.tiny-checkbox__label{cursor:not-allowed}.tiny-checkbox__input.is-disabled.is-checked .tiny-checkbox__inner,.tiny-checkbox__input.is-disabled.is-checked .tiny-checkbox__inner:hover{background-color:var(--ti-checkbox-label-text-color-disabled);border-color:var(--ti-checkbox-label-text-color-disabled)}.tiny-checkbox__input.is-disabled.is-checked .tiny-checkbox__inner::after,.tiny-checkbox__input.is-disabled.is-checked .tiny-checkbox__inner:hover::after{border-color:var(--ti-checkbox-bg-color-disable)}.tiny-checkbox__input.is-disabled.is-indeterminate .tiny-checkbox__inner,.tiny-checkbox__input.is-disabled.is-indeterminate .tiny-checkbox__inner:hover{background-color:var(--ti-checkbox-label-text-color-disabled);border-color:var(--ti-checkbox-label-text-color-disabled)}.tiny-checkbox__input.is-disabled.is-indeterminate .tiny-checkbox__inner::before,.tiny-checkbox__input.is-disabled.is-indeterminate .tiny-checkbox__inner:hover::before{background-color:var(--ti-checkbox-bg-color-disable);border-color:var(--ti-checkbox-bg-color-disable)}.tiny-checkbox__input.is-disabled+span.tiny-checkbox__label{color:var(--ti-checkbox-label-text-color-disabled);cursor:not-allowed}.tiny-checkbox__input.is-checked .tiny-checkbox__inner::after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1)}.tiny-checkbox__input.is-indeterminate .tiny-checkbox__inner::before{content:'';position:absolute;display:block;border-radius:1px;background-color:#fff;height:6px;width:6px;left:0;right:0;top:0;bottom:0;margin:auto}.tiny-checkbox__input.is-indeterminate .tiny-checkbox__inner::after{display:none}.tiny-checkbox__input.is-checked .tiny-checkbox__inner,.tiny-checkbox__input.is-indeterminate .tiny-checkbox__inner{background-color:var(--ti-checkbox-bg-color-checked);border-color:var(--ti-checkbox-border-color-checked)}.tiny-checkbox__input.is-checked .tiny-checkbox__inner:hover,.tiny-checkbox__input.is-indeterminate .tiny-checkbox__inner:hover{background-color:var(--ti-checkbox-bg-color-checked);border-color:var(--ti-checkbox-border-color-checked)}.tiny-checkbox__inner{display:inline-block;position:relative;border:1px solid var(--ti-checkbox-border-color);border-radius:var(--ti-common-border-radius-normal);-webkit-box-sizing:border-box;box-sizing:border-box;width:16px;height:16px;background-color:var(--ti-checkbox-bg-color);outline:0;z-index:1;-webkit-transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.tiny-checkbox__inner:hover{border-color:var(--ti-checkbox-border-color-hover)}.tiny-checkbox__inner::after{-webkit-box-sizing:content-box;box-sizing:content-box;content:'';border:1px solid #fff;border-width:0 2px 2px 0;border-left:0;border-top:0;height:var(--ti-checkbox-icon-height);width:var(--ti-checkbox-icon-width);position:absolute;left:var(--ti-checkbox-icon-left);top:var(--ti-checkbox-icon-top);-webkit-transform:rotate(45deg) scaleY(0);transform:rotate(45deg) scaleY(0);-webkit-transition:-webkit-transform .15s ease-in 50ms;transition:-webkit-transform .15s ease-in 50ms;transition:transform .15s ease-in 50ms;transition:transform .15s ease-in 50ms,-webkit-transform .15s ease-in 50ms;-webkit-transform-origin:center;transform-origin:center}.tiny-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.tiny-checkbox__label{padding-left:8px;font-size:var(--ti-checkbox-font-size)}"; | ||
styleInject(css_248z); | ||
var script = { | ||
emits: ['change', 'update:modelValue', 'complete'], | ||
props: [].concat(_toConsumableArray(props), ['modelValue', 'text', 'events', 'label', 'indeterminate', 'disabled', 'checked', 'name', 'trueLabel', 'falseLabel', 'id', 'controls', 'size', 'border', 'validateEvent']), | ||
var _sfc_main = /* @__PURE__ */ defineComponent({ | ||
emits: ["change", "update:modelValue", "complete"], | ||
props: [].concat(props, ["modelValue", "text", "events", "label", "indeterminate", "disabled", "checked", "name", "trueLabel", "falseLabel", "id", "controls", "size", "border", "validateEvent"]), | ||
components: { | ||
@@ -70,12 +59,11 @@ IconHalfselect: iconHalfselect(), | ||
}, | ||
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 = ["id"]; | ||
@@ -93,3 +81,3 @@ var _hoisted_2 = ["role", "aria-checked"]; | ||
}; | ||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
var _component_icon_check = resolveComponent("icon-check"); | ||
@@ -99,51 +87,52 @@ var _component_icon_checked_sur = resolveComponent("icon-checked-sur"); | ||
return openBlock(), createElementBlock("label", mergeProps({ | ||
class: ["tiny-checkbox", [$props.border && _ctx.state.checkboxSize ? 'tiny-checkbox--' + _ctx.state.checkboxSize : '', { | ||
'is-disabled': _ctx.state.isDisabled | ||
class: ["tiny-checkbox", [_ctx.border && _ctx.state.checkboxSize ? "tiny-checkbox--" + _ctx.state.checkboxSize : "", { | ||
"is-disabled": _ctx.state.isDisabled | ||
}, { | ||
'is-bordered': $props.border | ||
"is-bordered": _ctx.border | ||
}, { | ||
'is-checked': _ctx.state.isChecked | ||
"is-checked": _ctx.state.isChecked | ||
}]], | ||
id: $props.id, | ||
id: _ctx.id, | ||
tabindex: "-1" | ||
}, _ctx.a(_ctx.$attrs, ['class', 'style', 'onClick'], true)), [createElementVNode("span", { | ||
}, _ctx.a(_ctx.$attrs, ["class", "style", "onClick"], true)), [createElementVNode("span", { | ||
class: normalizeClass(["tiny-checkbox__input", { | ||
'is-disabled': _ctx.state.isDisabled, | ||
'is-checked': _ctx.state.isChecked, | ||
'is-indeterminate': $props.indeterminate, | ||
'is-focus': _ctx.state.focus | ||
"is-disabled": _ctx.state.isDisabled, | ||
"is-checked": _ctx.state.isChecked, | ||
"is-indeterminate": _ctx.indeterminate, | ||
"is-focus": _ctx.state.focus | ||
}]), | ||
role: $props.indeterminate ? 'checkbox' : false, | ||
"aria-checked": $props.indeterminate ? 'mixed' : false | ||
}, [createElementVNode("span", _hoisted_3, [!_ctx.state.isChecked && !$props.indeterminate ? (openBlock(), createBlock(_component_icon_check, { | ||
role: _ctx.indeterminate ? "checkbox" : false, | ||
"aria-checked": _ctx.indeterminate ? "mixed" : false | ||
}, [createElementVNode("span", _hoisted_3, [!_ctx.state.isChecked && !_ctx.indeterminate ? (openBlock(), createBlock(_component_icon_check, { | ||
key: 0, | ||
class: "tiny-svg-size" | ||
})) : createCommentVNode("", true), _ctx.state.isChecked ? (openBlock(), createBlock(_component_icon_checked_sur, { | ||
})) : createCommentVNode("v-if", true), _ctx.state.isChecked ? (openBlock(), createBlock(_component_icon_checked_sur, { | ||
key: 1, | ||
class: "tiny-svg-size" | ||
})) : createCommentVNode("", true), $props.indeterminate ? (openBlock(), createBlock(_component_icon_halfselect, { | ||
})) : createCommentVNode("v-if", true), _ctx.indeterminate ? (openBlock(), createBlock(_component_icon_halfselect, { | ||
key: 2, | ||
class: "tiny-svg-size" | ||
})) : createCommentVNode("", true)]), $props.trueLabel || $props.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { | ||
})) : createCommentVNode("v-if", true)]), _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { | ||
key: 0, | ||
class: "tiny-checkbox__original", | ||
type: "checkbox", | ||
"aria-hidden": $props.indeterminate ? 'true' : 'false', | ||
name: $props.name, | ||
"aria-hidden": _ctx.indeterminate ? "true" : "false", | ||
name: _ctx.name, | ||
disabled: _ctx.state.isDisabled, | ||
"true-value": $props.trueLabel, | ||
"false-value": $props.falseLabel, | ||
"onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { | ||
"true-value": _ctx.trueLabel, | ||
"false-value": _ctx.falseLabel, | ||
"onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) { | ||
return _ctx.state.model = $event; | ||
}), | ||
onChange: _cache[1] || (_cache[1] = function () { | ||
onChange: _cache[1] || (_cache[1] = function() { | ||
return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments); | ||
}), | ||
onFocus: _cache[2] || (_cache[2] = function ($event) { | ||
onFocus: _cache[2] || (_cache[2] = function($event) { | ||
return _ctx.state.focus = true; | ||
}), | ||
onBlur: _cache[3] || (_cache[3] = function ($event) { | ||
onBlur: _cache[3] || (_cache[3] = function($event) { | ||
return _ctx.state.focus = false; | ||
}), | ||
onClick: _cache[4] || (_cache[4] = withModifiers(function () {}, ["stop"])) | ||
onClick: _cache[4] || (_cache[4] = withModifiers(function() { | ||
}, ["stop"])) | ||
}, null, 40, _hoisted_4)), [[vModelCheckbox, _ctx.state.model]]) : withDirectives((openBlock(), createElementBlock("input", { | ||
@@ -153,26 +142,31 @@ key: 1, | ||
type: "checkbox", | ||
"aria-hidden": $props.indeterminate ? 'true' : 'false', | ||
"aria-hidden": _ctx.indeterminate ? "true" : "false", | ||
disabled: _ctx.state.isDisabled, | ||
value: $props.label, | ||
name: $props.name, | ||
"onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { | ||
value: _ctx.label, | ||
name: _ctx.name, | ||
"onUpdate:modelValue": _cache[5] || (_cache[5] = function($event) { | ||
return _ctx.state.model = $event; | ||
}), | ||
onChange: _cache[6] || (_cache[6] = function () { | ||
onChange: _cache[6] || (_cache[6] = function() { | ||
return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments); | ||
}), | ||
onFocus: _cache[7] || (_cache[7] = function ($event) { | ||
onFocus: _cache[7] || (_cache[7] = function($event) { | ||
return _ctx.state.focus = true; | ||
}), | ||
onBlur: _cache[8] || (_cache[8] = function ($event) { | ||
onBlur: _cache[8] || (_cache[8] = function($event) { | ||
return _ctx.state.focus = false; | ||
}), | ||
onClick: _cache[9] || (_cache[9] = withModifiers(function () {}, ["stop"])) | ||
}, null, 40, _hoisted_5)), [[vModelCheckbox, _ctx.state.model]])], 10, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || $props.text || $props.label ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "default", {}, function () { | ||
return [createTextVNode(toDisplayString($props.text || $props.label), 1)]; | ||
})])) : createCommentVNode("", true)], 16, _hoisted_1); | ||
onClick: _cache[9] || (_cache[9] = withModifiers(function() { | ||
}, ["stop"])) | ||
}, null, 40, _hoisted_5)), [[vModelCheckbox, _ctx.state.model]])], 10, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || _ctx.text || _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "default", {}, function() { | ||
return [createTextVNode( | ||
toDisplayString(_ctx.text || _ctx.label), | ||
1 | ||
/* TEXT */ | ||
)]; | ||
})])) : createCommentVNode("v-if", true)], 16, _hoisted_1); | ||
} | ||
script.render = render; | ||
export { script as default }; | ||
var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { | ||
pc as default | ||
}; |
{ | ||
"name": "@opentiny/vue-checkbox", | ||
"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<{ | ||
_constants: { | ||
@@ -32,3 +32,5 @@ type: ObjectConstructor; | ||
}; | ||
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", 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<{ | ||
_constants: { | ||
@@ -64,13 +66,11 @@ type: ObjectConstructor; | ||
}; | ||
}>> & { | ||
onChange?: ((...args: any[]) => any) | undefined; | ||
}, { | ||
}>>, { | ||
disabled: boolean; | ||
_constants: Record<string, any>; | ||
disabled: boolean; | ||
validateEvent: boolean; | ||
events: Record<string, any>; | ||
border: boolean; | ||
indeterminate: boolean; | ||
checked: boolean; | ||
validateEvent: boolean; | ||
border: boolean; | ||
}>; | ||
export default _default; |
@@ -1,14 +0,15 @@ | ||
import '@opentiny/vue-theme-mobile/checkbox/index.css'; | ||
declare const _default: { | ||
inheritAttrs: boolean; | ||
props: string[]; | ||
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; |
@@ -1,19 +0,19 @@ | ||
import '@opentiny/vue-theme/checkbox/index.css'; | ||
declare const _default: { | ||
inheritAttrs: boolean; | ||
props: string[]; | ||
components: { | ||
IconHalfselect: any; | ||
IconCheckedSur: any; | ||
IconCheck: 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, ("update:modelValue" | "change" | "complete")[], "update:modelValue" | "change" | "complete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{ | ||
[x: string]: any; | ||
}>>> & { | ||
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; | ||
onChange?: ((...args: any[]) => any) | undefined; | ||
onComplete?: ((...args: any[]) => any) | undefined; | ||
}, { | ||
[x: string]: any; | ||
}>; | ||
export default _sfc_main; |
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
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2
9
2
20837
522
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)