@featherds/checkbox
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -23,10 +23,12 @@ var __defProp = Object.defineProperty; | ||
import { FeatherRipple } from "@featherds/ripple"; | ||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createBlock, createCommentVNode, renderSlot, pushScopeId, popScopeId, toRef, computed, mergeProps, toDisplayString, createVNode } from "vue"; | ||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createBlock, createCommentVNode, renderSlot, pushScopeId, popScopeId, toRef, computed, ref, mergeProps, toDisplayString, createVNode } from "vue"; | ||
import { InputInheritAttrsMixin, InputSubTextMixin, InputSubText } from "@featherds/input-helper"; | ||
import { useValidation } from "@featherds/input/src/components/useValidation"; | ||
var FeatherCheckbox_vue_vue_type_style_index_0_scoped_true_lang = ""; | ||
var _export_sfc = (sfc, props) => { | ||
const target = sfc.__vccOpts || sfc; | ||
for (const [key, val] of props) { | ||
sfc[key] = val; | ||
target[key] = val; | ||
} | ||
return sfc; | ||
return target; | ||
}; | ||
@@ -39,2 +41,3 @@ const _sfc_main$1 = { | ||
emits: ["click", "update:modelValue", "indeterminate"], | ||
inject: ["registerCheckbox"], | ||
props: { | ||
@@ -61,2 +64,7 @@ disabled: { | ||
}, | ||
mounted() { | ||
if (this.registerCheckbox) { | ||
this.registerCheckbox(this.inputId); | ||
} | ||
}, | ||
computed: { | ||
@@ -111,3 +119,3 @@ inputId() { | ||
}; | ||
const _withScopeId = (n) => (pushScopeId("data-v-70bfd9f5"), n = n(), popScopeId(), n); | ||
const _withScopeId = (n) => (pushScopeId("data-v-c79530a2"), n = n(), popScopeId(), n); | ||
const _hoisted_1$1 = { class: "layout-container" }; | ||
@@ -167,3 +175,3 @@ const _hoisted_2$1 = ["aria-checked", "aria-disabled", "aria-labelledby", "aria-label", "id", "tabindex"]; | ||
} | ||
var FeatherCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-70bfd9f5"]]); | ||
var FeatherCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-c79530a2"]]); | ||
var FeatherCheckboxGroup_vue_vue_type_style_index_0_scoped_true_lang = ""; | ||
@@ -173,2 +181,6 @@ const _sfc_main = { | ||
props: { | ||
modelValue: { | ||
type: [Array, Object], | ||
required: false | ||
}, | ||
label: { | ||
@@ -181,4 +193,13 @@ type: String, | ||
default: false | ||
}, | ||
schema: { | ||
type: Object, | ||
required: false | ||
} | ||
}, | ||
provide() { | ||
return { | ||
registerCheckbox: this.registerCheckbox | ||
}; | ||
}, | ||
setup(props, context) { | ||
@@ -205,7 +226,17 @@ const error = toRef(props, "error"); | ||
}); | ||
const inputId = ref(groupId.value); | ||
let validate = useValidation(inputId, toRef(props, "modelValue"), props.label, props.schema); | ||
const registerCheckbox = (id) => { | ||
if (inputId.value === groupId.value) { | ||
inputId.value = id; | ||
} | ||
}; | ||
return { | ||
groupId, | ||
inputId, | ||
descriptionId, | ||
labelId, | ||
attrs | ||
attrs, | ||
validate, | ||
registerCheckbox | ||
}; | ||
@@ -241,3 +272,3 @@ }, | ||
} | ||
var FeatherCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-32b0c310"]]); | ||
var FeatherCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4d1bba6f"]]); | ||
export { FeatherCheckbox, FeatherCheckboxGroup }; |
{ | ||
"name": "@featherds/checkbox", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"publishConfig": { | ||
@@ -12,5 +12,5 @@ "access": "public" | ||
"dependencies": { | ||
"@featherds/input-helper": "^0.9.2", | ||
"@featherds/ripple": "^0.9.2", | ||
"@featherds/styles": "^0.9.2", | ||
"@featherds/input-helper": "^0.9.3", | ||
"@featherds/ripple": "^0.9.3", | ||
"@featherds/styles": "^0.9.3", | ||
"vue": "^3.1.0-0" | ||
@@ -23,3 +23,3 @@ }, | ||
"types": "./src/index.d.ts", | ||
"gitHead": "c5b9a591688579921f59e070325aa141c23315f7" | ||
"gitHead": "aebb5c7fe38504ab6719aff7007fe42ba940c63e" | ||
} |
@@ -14,2 +14,7 @@ import { nextTick } from "vue"; | ||
}; | ||
options.global = { | ||
provide: { | ||
registerCheckbox: jest.fn(), | ||
}, | ||
}; | ||
return mount(FeatherCheckbox, options); | ||
@@ -16,0 +21,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
57483
825
Updated@featherds/ripple@^0.9.3
Updated@featherds/styles@^0.9.3