@cypress-design/vue-checkbox 0.5.0 → 2.0.0-next.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 +16 -0
- package/CHANGELOG.md +94 -0
- package/Checkbox.vue +43 -24
- package/CheckboxVue.cy.tsx +59 -6
- package/ReadMe.md +19 -0
- package/dist/Checkbox.vue.d.ts +59 -170
- package/dist/Checkbox.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +68 -77
- 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 +9 -4
- 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,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue"),require("@cypress-design/vue-icon")):typeof define=="function"&&define.amd?define(["vue","@cypress-design/vue-icon"],a):(e=typeof globalThis<"u"?globalThis:e||self,e.Checkbox=a(e.Vue,e.CyIcon))})(this,function(e,a){"use strict";const s={wrapper:"cyds-checkbox-wrapper",hiddenInput:"cyds-checkbox-hiddeninput",labelTag:"cyds-checkbox-labeltag",visibleCheckbox:"cyds-checkbox-visiblecheckbox",trueLabel:"cyds-checkbox-truelabel"},n={indigo:"cyds-checkbox-checkboxcolors-indigo",jade:"cyds-checkbox-checkboxcolors-jade",red:"cyds-checkbox-checkboxcolors-red",disabled:"cyds-checkbox-checkboxcolors-disabled",empty:"cyds-checkbox-checkboxcolors-empty"},r={class:"relative flex items-center"},i=["id","name","disabled","checked"],m=["for"];function b(){return String(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}return e.defineComponent({__name:"Checkbox",props:{id:{default:()=>b()},name:{},checked:{type:Boolean},color:{default:"indigo"},disabled:{type:Boolean},modelValue:{type:[Boolean,Array]},label:{}},emits:["update:modelValue","change"],setup(h,{emit:p}){const o=h,c=e.ref((Array.isArray(o.modelValue)?o.name?o.modelValue.includes(o.name):!1:o.modelValue)||o.checked),d=p;function u(){if(c.value=!c.value,Array.isArray(o.modelValue)){const l=[...o.modelValue];if(!o.name)return;const t=l.indexOf(o.name);t===-1?l.push(o.name):l.splice(t,1),d("update:modelValue",l)}else d("update:modelValue",c.value);d("change",c.value)}const k=e.computed(()=>o.disabled?n.disabled:c.value?n[o.color]:n.empty);return(l,t)=>(e.openBlock(),e.createElementBlock("span",r,[e.createElementVNode("input",{id:l.id,class:e.normalizeClass(e.unref(s).hiddenInput),name:l.name||l.id,type:"checkbox",disabled:o.disabled,checked:c.value,onChange:u},null,42,i),e.createElementVNode("label",{class:e.normalizeClass(e.unref(s).labelTag),for:l.id},[c.value?(e.openBlock(),e.createBlock(e.unref(a.IconCheckmarkSmall),{key:0,strokeColor:"white",class:"absolute"})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass([k.value,e.unref(s).visibleCheckbox])},null,2),e.renderSlot(l.$slots,"label",{},()=>[l.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(s).trueLabel,l.disabled?"text-gray-500":"text-gray-800"])},e.toDisplayString(l.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"> */
|