Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentiny/vue-switch

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentiny/vue-switch - npm Package Compare versions

Comparing version 3.1.0-alpha.0 to 3.5.0-alpha.0

index.d.ts

2

lib/index.js

@@ -119,4 +119,4 @@ import { $prefix, $props, $setup } from '@opentiny/vue-common';

};
Switch.version = '3.1.0-alpha.0';
Switch.version = '3.5.0-alpha.0';
export { Switch as default };
import { renderless, api } from '@opentiny/vue-renderless/switch/vue';
import { setup, props } from '@opentiny/vue-common';
import '@opentiny/vue-theme/switch/index.css';
import { openBlock, createElementBlock, normalizeClass, withKeys, createElementVNode, renderSlot, createTextVNode, createCommentVNode } from 'vue';

@@ -32,5 +31,35 @@

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-switch{--ti-switch-on-bg-color:var(--ti-base-color-brand-6);--ti-switch-off-bg-color:var(--ti-base-color-common-2);--ti-switch-disabled-bg-color:var(--ti-base-color-common-1);--ti-switch-checked-disabled-bg-color:var(--ti-base-color-brand-3);--ti-switch-checked-disabled-border-color:var(--ti-base-color-brand-3);--ti-switch-disabled-text-color:var(--ti-base-color-bg-5);--ti-switch-disabled-dot-bg-color:var(--ti-base-color-bg-5);--ti-switch-text-color:var(--ti-base-color-light);--ti-switch-dot-bg-color:var(--ti-base-color-light);--ti-switch-width:38px;--ti-switch-height:20px;--ti-switch-border-radius:24px;--ti-switch-inner-font-size:var(--ti-common-font-size-base, 12px);--ti-switch-dot-size-height-width:16px;--ti-switch-dot-position-left:16px;--ti-switch-dot-offset:calc(var(--ti-switch-dot-size-height-width) + 1px);--ti-switch-text-width:45px;display:inline-block;width:var(--ti-switch-width);height:var(--ti-switch-height);line-height:var(--ti-switch-height);border-radius:var(--ti-switch-border-radius);vertical-align:middle;border:1px solid var(--ti-switch-off-bg-color);background-color:var(--ti-switch-off-bg-color);position:relative;cursor:pointer;outline:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.tiny-switch .tiny-switch-inner{color:var(--ti-switch-text-color);font-size:var(--ti-switch-inner-font-size);position:absolute;left:calc(var(--ti-switch-dot-position-left) + 4px);top:-1px}.tiny-switch__text{width:var(--ti-switch-text-width)}.tiny-switch__text .tiny-switch-inner{left:calc(var(--ti-switch-dot-position-left) + 9px)}.tiny-switch.mini{width:calc(var(--ti-switch-width) - 6px)}.tiny-switch.disabled,.tiny-switch.tiny-switch-checked.disabled{cursor:not-allowed;background:var(--ti-switch-disabled-bg-color);border-color:var(--ti-switch-disabled-bg-color)}.tiny-switch.disabled::after,.tiny-switch.tiny-switch-checked.disabled::after{background:var(--ti-switch-disabled-dot-bg-color);cursor:not-allowed}.tiny-switch.disabled .tiny-switch-inner,.tiny-switch.tiny-switch-checked.disabled .tiny-switch-inner{color:var(--ti-switch-disabled-text-color)}.tiny-switch.tiny-switch-checked.disabled{background:var(--ti-switch-checked-disabled-bg-color);border-color:var(--ti-switch-checked-disabled-border-color)}.tiny-switch::after{content:'';width:var(--ti-switch-dot-size-height-width);height:var(--ti-switch-dot-size-height-width);border-radius:50%;background-color:var(--ti-switch-dot-bg-color);position:absolute;left:1px;top:1px;cursor:pointer;-webkit-transition:left .2s ease-in-out,width .2s ease-in-out;transition:left .2s ease-in-out,width .2s ease-in-out}.tiny-switch.tiny-switch-checked{border-color:var(--ti-switch-on-bg-color);background-color:var(--ti-switch-on-bg-color)}.tiny-switch.tiny-switch-checked .tiny-switch-inner{left:8px;width:calc(100% - var(--ti-switch-dot-size-height-width));overflow:hidden}.tiny-switch.tiny-switch-checked:after{left:calc(100% - var(--ti-switch-dot-offset))}";
styleInject(css_248z);
var script = {
emits: ['change', 'update:modelValue'],
props: [].concat(_toConsumableArray(props), ['modelValue', 'trueValue', 'falseValue', 'disabled', 'mini', 'tabindex']),
props: [].concat(_toConsumableArray(props), ['modelValue', 'trueValue', 'falseValue', 'disabled', 'mini', 'tabindex', 'showText']),
setup: function setup$1(props, context) {

@@ -52,3 +81,3 @@ return setup({

return openBlock(), createElementBlock("span", {
class: normalizeClass(_ctx.state.wrapClasses),
class: normalizeClass([_ctx.state.wrapClasses, $props.showText ? 'tiny-switch__text' : '']),
tabindex: $props.tabindex,

@@ -63,3 +92,3 @@ onClick: _cache[0] || (_cache[0] = function () {

class: normalizeClass(_ctx.state.innerClasses)
}, [!$props.mini ? (openBlock(), createElementBlock("div", _hoisted_2, [_ctx.state.currentValue === $props.trueValue ? renderSlot(_ctx.$slots, "open", {
}, [!$props.mini && $props.showText ? (openBlock(), createElementBlock("div", _hoisted_2, [_ctx.state.currentValue === $props.trueValue ? renderSlot(_ctx.$slots, "open", {
key: 0

@@ -66,0 +95,0 @@ }, function () {

{
"name": "@opentiny/vue-switch",
"version": "3.1.0-alpha.0",
"version": "3.5.0-alpha.0",
"description": "",

@@ -12,10 +12,11 @@ "main": "lib/index.js",

"dependencies": {
"@opentiny/vue-renderless": "~3.1.0-alpha.0",
"@opentiny/vue-common": "~3.1.0-alpha.0",
"@opentiny/vue-icon": "~3.1.0-alpha.0",
"@opentiny/vue-theme": "~3.1.0-alpha.0",
"@opentiny/vue-theme-mobile": "~3.1.0-alpha.0"
"@opentiny/vue-renderless": "~3.5.0",
"@opentiny/vue-common": "~3.5.0-alpha.0",
"@opentiny/vue-icon": "~3.5.0-alpha.0",
"@opentiny/vue-theme": "~3.5.0",
"@opentiny/vue-theme-mobile": "~3.5.0"
},
"license": "MIT",
"types": "index.d.ts",
"sideEffects": false
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc