@pequity/squirrel 1.2.11 → 1.2.12

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.
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
3
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
- const _hoisted_1 = { class: "inline-flex items-center" };
5
- const _hoisted_2 = ["checked"];
6
- const _hoisted_3 = {
4
+ const _hoisted_1 = ["checked"];
5
+ const _hoisted_2 = {
7
6
  key: 0,
8
7
  class: "ml-2 text-sm"
9
8
  };
@@ -25,22 +24,33 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
24
  },
26
25
  emits: ["update:modelValue"],
27
26
  setup(__props) {
27
+ const allAttrs = vue.useAttrs();
28
+ const attrs = vue.computed(() => {
29
+ const { class: classes, style: style2, ...rest } = allAttrs;
30
+ return rest;
31
+ });
32
+ const style = vue.computed(() => {
33
+ return allAttrs.style;
34
+ });
28
35
  return (_ctx, _cache) => {
29
- return vue.openBlock(), vue.createElementBlock("label", _hoisted_1, [
36
+ return vue.openBlock(), vue.createElementBlock("label", {
37
+ class: vue.normalizeClass(["inline-flex items-center", [{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]]),
38
+ style: vue.normalizeStyle(style.value)
39
+ }, [
30
40
  vue.renderSlot(_ctx.$slots, "label-before", {}, void 0, true),
31
41
  vue.createElementVNode("input", vue.mergeProps({
32
42
  type: "checkbox",
33
- class: "h-4 w-4 shrink-0 appearance-none rounded border border-p-gray-30 bg-surface duration-100 ease-in-out checked:border-none checked:bg-primary disabled:opacity-50",
34
- checked: __props.modelValue
35
- }, _ctx.$attrs, {
43
+ class: "h-4 w-4 shrink-0 appearance-none rounded border border-p-gray-30 bg-surface duration-100 ease-in-out checked:border-none checked:bg-primary disabled:opacity-50"
44
+ }, attrs.value, {
45
+ checked: __props.modelValue,
36
46
  onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
37
- }), null, 16, _hoisted_2),
47
+ }), null, 16, _hoisted_1),
38
48
  vue.renderSlot(_ctx.$slots, "label", {}, () => [
39
- __props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(__props.label), 1)) : vue.createCommentVNode("", true)
49
+ __props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, vue.toDisplayString(__props.label), 1)) : vue.createCommentVNode("", true)
40
50
  ], true)
41
- ]);
51
+ ], 6);
42
52
  };
43
53
  }
44
54
  });
45
- const pCheckbox = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-6729bf3b"]]);
55
+ const pCheckbox = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-01f2e2c0"]]);
46
56
  module.exports = pCheckbox;
@@ -1,8 +1,7 @@
1
- import { defineComponent, openBlock, createElementBlock, renderSlot, createElementVNode, mergeProps, toDisplayString, createCommentVNode } from "vue";
1
+ import { defineComponent, useAttrs, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createElementVNode, mergeProps, toDisplayString, createCommentVNode } from "vue";
2
2
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
3
- const _hoisted_1 = { class: "inline-flex items-center" };
4
- const _hoisted_2 = ["checked"];
5
- const _hoisted_3 = {
3
+ const _hoisted_1 = ["checked"];
4
+ const _hoisted_2 = {
6
5
  key: 0,
7
6
  class: "ml-2 text-sm"
8
7
  };
@@ -24,24 +23,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
23
  },
25
24
  emits: ["update:modelValue"],
26
25
  setup(__props) {
26
+ const allAttrs = useAttrs();
27
+ const attrs = computed(() => {
28
+ const { class: classes, style: style2, ...rest } = allAttrs;
29
+ return rest;
30
+ });
31
+ const style = computed(() => {
32
+ return allAttrs.style;
33
+ });
27
34
  return (_ctx, _cache) => {
28
- return openBlock(), createElementBlock("label", _hoisted_1, [
35
+ return openBlock(), createElementBlock("label", {
36
+ class: normalizeClass(["inline-flex items-center", [{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]]),
37
+ style: normalizeStyle(style.value)
38
+ }, [
29
39
  renderSlot(_ctx.$slots, "label-before", {}, void 0, true),
30
40
  createElementVNode("input", mergeProps({
31
41
  type: "checkbox",
32
- class: "h-4 w-4 shrink-0 appearance-none rounded border border-p-gray-30 bg-surface duration-100 ease-in-out checked:border-none checked:bg-primary disabled:opacity-50",
33
- checked: __props.modelValue
34
- }, _ctx.$attrs, {
42
+ class: "h-4 w-4 shrink-0 appearance-none rounded border border-p-gray-30 bg-surface duration-100 ease-in-out checked:border-none checked:bg-primary disabled:opacity-50"
43
+ }, attrs.value, {
44
+ checked: __props.modelValue,
35
45
  onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
36
- }), null, 16, _hoisted_2),
46
+ }), null, 16, _hoisted_1),
37
47
  renderSlot(_ctx.$slots, "label", {}, () => [
38
- __props.label ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("", true)
48
+ __props.label ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.label), 1)) : createCommentVNode("", true)
39
49
  ], true)
40
- ]);
50
+ ], 6);
41
51
  };
42
52
  }
43
53
  });
44
- const pCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6729bf3b"]]);
54
+ const pCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-01f2e2c0"]]);
45
55
  export {
46
56
  pCheckbox as default
47
57
  };
package/dist/style.css CHANGED
@@ -256,7 +256,7 @@ div[id^=popper_].dropdown .v-popper__inner .dropdown-menu .dropdown-divider {
256
256
  --tw-content: "";
257
257
  content: var(--tw-content);
258
258
  }
259
- input[type='checkbox'][data-v-6729bf3b]:checked {
259
+ input[type='checkbox'][data-v-01f2e2c0]:checked {
260
260
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
261
261
  }
262
262
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pequity/squirrel",
3
3
  "description": "Squirrel component library",
4
- "version": "1.2.11",
4
+ "version": "1.2.12",
5
5
  "packageManager": "pnpm@8.9.2",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -75,7 +75,7 @@
75
75
  "@types/jest": "^29.5.12",
76
76
  "@types/jsdom": "^21.1.7",
77
77
  "@types/lodash-es": "^4.17.12",
78
- "@types/node": "^20.14.8",
78
+ "@types/node": "^20.14.9",
79
79
  "@vitejs/plugin-vue": "^5.0.5",
80
80
  "@vue/compiler-sfc": "3.4.30",
81
81
  "@vue/test-utils": "^2.4.6",
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <label class="inline-flex items-center">
2
+ <label class="inline-flex items-center" :class="[{ hidden: $attrs.hidden }, $attrs.class]" :style="style">
3
3
  <slot name="label-before"></slot>
4
4
  <input
5
5
  type="checkbox"
6
6
  class="h-4 w-4 shrink-0 appearance-none rounded border border-p-gray-30 bg-surface duration-100 ease-in-out checked:border-none checked:bg-primary disabled:opacity-50"
7
+ v-bind="attrs"
7
8
  :checked="modelValue"
8
- v-bind="$attrs"
9
9
  @change="$emit('update:modelValue', ($event.target as HTMLInputElement).checked)"
10
10
  />
11
11
  <slot name="label">
@@ -17,6 +17,8 @@
17
17
  </template>
18
18
 
19
19
  <script setup lang="ts">
20
+ import { type StyleValue, computed, useAttrs } from 'vue';
21
+
20
22
  defineOptions({
21
23
  name: 'PCheckbox',
22
24
  inheritAttrs: false,
@@ -34,6 +36,18 @@ defineProps({
34
36
  default: '',
35
37
  },
36
38
  });
39
+
40
+ const allAttrs = useAttrs();
41
+
42
+ const attrs = computed(() => {
43
+ const { class: classes, style, ...rest } = allAttrs;
44
+
45
+ return rest;
46
+ });
47
+
48
+ const style = computed(() => {
49
+ return allAttrs.style as StyleValue;
50
+ });
37
51
  </script>
38
52
 
39
53
  <style lang="css" scoped>