@bpui/radio
Advanced tools
Comparing version 0.0.5 to 0.0.6
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.bpRadio = factory()); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.bpRadio = factory()); | ||
}(this, (function () { 'use strict'; | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
var _index = "@import \"~@bpui/libs/style/variable\";\n@import \"./variable\";\n\n.bp-radio {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: 0;\n outline-offset: 0;\n \n color: $bpRadioLabelColor;\n font-weight: $bpRadioFontWeight;\n font-size: $bpRadioFontSize;\n position: relative;\n cursor: pointer;\n display: inline-block;\n white-space: nowrap;\n user-select: none;\n margin: 2px;\n\n .bp-radio__label {\n height: $bpRadioSize;\n display: inline-block;\n padding-left: 5px;\n line-height: 1;\n vertical-align: middle;\n }\n\n .bp-radio__input {\n white-space: nowrap;\n cursor: pointer;\n outline: none;\n display: inline-block;\n line-height: 1;\n position: relative;\n vertical-align: middle;\n\n .bp-radio__inner {\n display: inline-block;\n position: relative;\n border: 1px solid #dcdfe6;\n border-radius: $bpRadioRadius;\n box-sizing: border-box;\n width: $bpRadioSize;\n height: $bpRadioSize;\n background-color: $bpRadioTickColor;\n z-index: 1;\n transition: border-color .5s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29);\n\n &:after {\n width: $bpRadioInnerSize;\n height: $bpRadioInnerSize;\n border-radius: 100%;\n background-color: $bpRadioTickColor;\n content: \"\";\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%) scale(0);\n transition: transform .15s ease-in;\n }\n }\n\n .bp-radio__inner_hover {\n border-color: $bpRadioBgColor;\n }\n\n .bp-radio__original {\n opacity: 0;\n outline: none;\n position: absolute;\n margin: 0;\n width: 0;\n height: 0;\n z-index: -1;\n }\n }\n\n .bp-radio__checked {\n .bp-radio__inner {\n border-color: $bpRadioBgColor;\n background-color: $bpRadioBgColor;\n position: relative;\n\n &:after {\n transform: translate(-50%, -50%) scale(1);\n }\n }\n }\n\n\n // disabled\n &.bp-radio__disabled {\n opacity: .5;\n cursor: not-allowed;\n touch-action: none;\n pointer-events: none;\n }\n}\n"; | ||
return _index; | ||
var script = { | ||
components: {}, | ||
props: { | ||
value: {}, | ||
disabled: Boolean | ||
}, | ||
data() { | ||
return { | ||
hovering: false, | ||
radioGroup: "" | ||
}; | ||
}, | ||
computed: { | ||
isGroup() { | ||
let parent = this.$parent; | ||
if (parent.bpNodeName === "bpRadioGroup") { | ||
return true; | ||
} | ||
return false; | ||
}, | ||
model: { | ||
get() { | ||
return this.isGroup ? this.$parent.value : this.value; | ||
}, | ||
set(val) { | ||
if (this.isGroup) { | ||
this.$parent.$emit("handleInput", val); | ||
} else { | ||
this.$emit("input", val); | ||
} | ||
this.$refs.radio && | ||
(this.$refs.radio.checked = this.model == this.value); | ||
} | ||
}, | ||
isDisabled() { | ||
return this.isGroup ? this.$parent.disabled : this.disabled; | ||
} | ||
}, | ||
created() {}, | ||
beforeDestroy() {}, | ||
beforeMount() {}, | ||
mounted() {}, | ||
methods: { | ||
handleChange() { | ||
this.$nextTick(() => { | ||
this.$emit("change", this.model); | ||
this.isGroup && this.$parent.$emit("handleChange", this.model); | ||
}); | ||
} | ||
} | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
} | ||
// Vue.extend constructor export interop. | ||
const options = typeof script === 'function' ? script.options : script; | ||
// render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; | ||
// functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
} | ||
let hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function (context) { | ||
// 2.3 injection | ||
context = | ||
context || // cached call | ||
(this.$vnode && this.$vnode.ssrContext) || // stateful | ||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__; | ||
} | ||
// inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} | ||
// register component module identifier for async chunk inference | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; | ||
// used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook; | ||
} | ||
else if (style) { | ||
hook = shadowMode | ||
? function (context) { | ||
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); | ||
} | ||
: function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
const originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context); | ||
return originalRender(h, context); | ||
}; | ||
} | ||
else { | ||
// inject component registration as beforeCreate hook | ||
const existing = options.beforeCreate; | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
} | ||
return script; | ||
} | ||
/* script */ | ||
const __vue_script__ = script; | ||
/* template */ | ||
var __vue_render__ = function() { | ||
var _vm = this; | ||
var _h = _vm.$createElement; | ||
var _c = _vm._self._c || _h; | ||
return _c( | ||
"label", | ||
{ | ||
staticClass: "bp-radio", | ||
class: { | ||
"bp-radio__disabled": _vm.isDisabled | ||
}, | ||
on: { | ||
mouseenter: function($event) { | ||
_vm.hovering = true; | ||
}, | ||
mouseleave: function($event) { | ||
_vm.hovering = false; | ||
} | ||
} | ||
}, | ||
[ | ||
_c( | ||
"span", | ||
{ | ||
staticClass: "bp-radio__input", | ||
class: { | ||
"bp-radio__checked": _vm.model == _vm.value | ||
} | ||
}, | ||
[ | ||
_c("span", { | ||
staticClass: "bp-radio__inner", | ||
class: [_vm.hovering ? "bp-radio__inner_hover" : ""] | ||
}), | ||
_vm._v(" "), | ||
_c( | ||
"input", | ||
_vm._b( | ||
{ | ||
directives: [ | ||
{ | ||
name: "model", | ||
rawName: "v-model", | ||
value: _vm.model, | ||
expression: "model" | ||
} | ||
], | ||
ref: "radio", | ||
staticClass: "bp-radio__original", | ||
attrs: { type: "radio", disabled: _vm.isDisabled }, | ||
domProps: { | ||
value: _vm.value, | ||
checked: _vm._q(_vm.model, _vm.value) | ||
}, | ||
on: { | ||
change: [ | ||
function($event) { | ||
_vm.model = _vm.value; | ||
}, | ||
_vm.handleChange | ||
] | ||
} | ||
}, | ||
"input", | ||
_vm.$attrs, | ||
false | ||
) | ||
) | ||
] | ||
), | ||
_vm._v(" "), | ||
_c("span", { staticClass: "bp-radio__label" }, [_vm._t("default")], 2) | ||
] | ||
) | ||
}; | ||
var __vue_staticRenderFns__ = []; | ||
__vue_render__._withStripped = true; | ||
/* style */ | ||
const __vue_inject_styles__ = undefined; | ||
/* scoped */ | ||
const __vue_scope_id__ = undefined; | ||
/* module identifier */ | ||
const __vue_module_identifier__ = undefined; | ||
/* functional template */ | ||
const __vue_is_functional_template__ = false; | ||
/* style inject */ | ||
/* style inject SSR */ | ||
/* style inject shadow dom */ | ||
const __vue_component__ = normalizeComponent( | ||
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, | ||
__vue_inject_styles__, | ||
__vue_script__, | ||
__vue_scope_id__, | ||
__vue_is_functional_template__, | ||
__vue_module_identifier__, | ||
false, | ||
undefined, | ||
undefined, | ||
undefined | ||
); | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
var script$1 = { | ||
name: "bpRadioGroup", | ||
components: {}, | ||
props: { | ||
value: {}, | ||
disabled: { default: false, type: Boolean } | ||
}, | ||
data() { | ||
return { | ||
bpNodeName: "bpRadioGroup" | ||
}; | ||
}, | ||
computed: {}, | ||
created() { | ||
this.$on("handleChange", value => { | ||
this.$emit("change", value); | ||
}); | ||
this.$on("handleInput", value => { | ||
this.$emit("input", value); | ||
}); | ||
}, | ||
beforeDestroy() {}, | ||
beforeMount() {}, | ||
mounted() {}, | ||
methods: {} | ||
}; | ||
/* script */ | ||
const __vue_script__$1 = script$1; | ||
/* template */ | ||
var __vue_render__$1 = function() { | ||
var _vm = this; | ||
var _h = _vm.$createElement; | ||
var _c = _vm._self._c || _h; | ||
return _c("div", [_vm._t("default")], 2) | ||
}; | ||
var __vue_staticRenderFns__$1 = []; | ||
__vue_render__$1._withStripped = true; | ||
/* style */ | ||
const __vue_inject_styles__$1 = undefined; | ||
/* scoped */ | ||
const __vue_scope_id__$1 = undefined; | ||
/* module identifier */ | ||
const __vue_module_identifier__$1 = undefined; | ||
/* functional template */ | ||
const __vue_is_functional_template__$1 = false; | ||
/* style inject */ | ||
/* style inject SSR */ | ||
/* style inject shadow dom */ | ||
const __vue_component__$1 = normalizeComponent( | ||
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, | ||
__vue_inject_styles__$1, | ||
__vue_script__$1, | ||
__vue_scope_id__$1, | ||
__vue_is_functional_template__$1, | ||
__vue_module_identifier__$1, | ||
false, | ||
undefined, | ||
undefined, | ||
undefined | ||
); | ||
var index = { | ||
bpRadio: __vue_component__, | ||
bpRadioGroup: __vue_component__$1, | ||
}; | ||
return index; | ||
}))); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"description": "radio", | ||
"dependencies": { | ||
"@bpui/libs": "0.0.22" | ||
"@bpui/libs": "0.0.25" | ||
}, | ||
@@ -17,4 +17,10 @@ "directories": {}, | ||
], | ||
"main": "src/index.js", | ||
"unpkg": "dist/index.js", | ||
"homepage": "https://github.com/bpui/radio#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/bpui/radio.git" | ||
}, | ||
"main": "dist/index.common.min.js", | ||
"module": "dist/index.esm.min.js", | ||
"unpkg": "dist/index.min.js", | ||
"types": "types/index.d.ts", | ||
@@ -36,3 +42,3 @@ "license": "MIT", | ||
"name": "@bpui/radio", | ||
"version": "0.0.5" | ||
"version": "0.0.6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
63723
779
+ Added@bpui/libs@0.0.25(transitive)
- Removed@bpui/libs@0.0.22(transitive)
Updated@bpui/libs@0.0.25