@cypress-design/vue-checkbox 0.5.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -0
- package/CHANGELOG.md +89 -0
- package/Checkbox.vue +66 -24
- package/CheckboxVue.cy.tsx +59 -6
- package/ReadMe.md +19 -0
- package/dist/Checkbox.vue.d.ts +100 -170
- package/dist/Checkbox.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +74 -78
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +11 -6
- package/tsconfig.build.json +3 -2
- package/vite.config.ts +1 -1
- package/Checkbox.stories.mdx +0 -75
- package/tsconfig.json +0 -10
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,
|
|
2
|
-
|
|
3
|
-
/* <windicss-keep class="border-gray-200 bg-gray-100 border-indigo-500 bg-indigo-400 border-jade-500 bg-jade-400 border-red-500 bg-red-400 bg-white block relative flex items-center absolute inset-0 w-0 h-0 opacity-0 border border-solid rounded h-[16px] w-[16px] flex-shrink-0 ml-[8px] text-[16px] leading-[24px] font-light select-none text-gray-500 text-gray-800 icon-dark-white"> */
|
|
1
|
+
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue"),require("@cypress-design/vue-icon")):typeof define=="function"&&define.amd?define(["vue","@cypress-design/vue-icon"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.Checkbox=o(e.Vue,e.Icon))})(this,function(e,o){"use strict";const t={wrapper:"relative flex items-center",hiddenInput:"absolute inset-0 w-0 h-0 opacity-0",labelTag:"flex items-center",visibleCheckbox:"border border-solid rounded h-[16px] w-[16px] flex flex-shrink-0 items-center text-white",trueLabel:"block ml-[8px] text-[16px] leading-[24px] font-light select-none"},d={indigo:"border-indigo-500 bg-indigo-400",jade:"border-jade-500 bg-jade-400",red:"border-red-500 bg-red-400",disabled:"border-gray-200 bg-gray-100",empty:"border-gray-200 bg-white"},s={class:"relative flex items-center"},c=["id","name","disabled","checked","tabindex","aria-hidden"],m=["for"];function p(){return String(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}return e.defineComponent({__name:"Checkbox",props:{id:{default:()=>p()},name:{},checked:{type:Boolean},color:{default:"indigo"},disabled:{type:Boolean},modelValue:{type:[Boolean,Array]},label:{},inputTabIndex:{},hideInput:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(u,{emit:b}){const a=u,l=e.ref((Array.isArray(a.modelValue)?a.name?a.modelValue.includes(a.name):!1:a.modelValue)||a.checked),i=b;function f(){if(l.value=!l.value,Array.isArray(a.modelValue)){const n=[...a.modelValue];if(!a.name)return;const r=n.indexOf(a.name);r===-1?n.push(a.name):n.splice(r,1),i("update:modelValue",n)}else i("update:modelValue",l.value);i("change",l.value)}const h=e.computed(()=>a.disabled?d.disabled:l.value?d[a.color]:d.empty);return(n,r)=>(e.openBlock(),e.createElementBlock("span",s,[e.createElementVNode("input",{id:n.id,class:e.normalizeClass(e.unref(t).hiddenInput),name:n.name||n.id,type:"checkbox",disabled:a.disabled,checked:l.value,tabindex:n.inputTabIndex,"aria-hidden":n.hideInput||void 0,style:e.normalizeStyle(n.hideInput?{display:"none"}:void 0),onChange:f},null,46,c),e.createElementVNode("label",{class:e.normalizeClass(e.unref(t).labelTag),for:n.id},[l.value?(e.openBlock(),e.createBlock(e.unref(o.IconCheckmarkSmall),{key:0,strokeColor:"white",class:"absolute"})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass([h.value,e.unref(t).visibleCheckbox])},null,2),e.renderSlot(n.$slots,"label",{},()=>[n.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(t).trueLabel,n.disabled?"text-gray-500":"text-gray-800"])},e.toDisplayString(n.label),3)):e.createCommentVNode("",!0)])],10,m)]))}})});
|
|
4
2
|
//# sourceMappingURL=index.umd.js.map
|
|
3
|
+
|
|
4
|
+
/* <wind-keep class="relative flex items-center absolute text-gray-500 text-gray-800 icon-dark-white"> */
|