@destyler/toggle 0.0.2 → 0.0.3

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/dist/index.cjs CHANGED
@@ -66,9 +66,7 @@ const DestylerToggle = vue.defineComponent({
66
66
  "onClick": () => {
67
67
  this.togglePressed();
68
68
  }
69
- }, {
70
- default: () => this.$slots.default?.()
71
- });
69
+ }, () => this.$slots.default?.());
72
70
  }
73
71
  });
74
72
 
@@ -153,18 +151,12 @@ const DestylerToggleGroupRoot = vue.defineComponent({
153
151
  orientation: this.rovingFocus ? this.$props.orientation : void 0,
154
152
  dir: this.dir,
155
153
  loop: this.rovingFocus ? this.loop : void 0
156
- }, {
157
- default: () => {
158
- return vue.h(primitive.DestylerPrimitive, {
159
- ref: (el) => this.forwardRef(el),
160
- role: "group",
161
- as: this.$props.as,
162
- asChild: this.$props.asChild
163
- }, {
164
- default: () => this.$slots.default?.()
165
- });
166
- }
167
- });
154
+ }, () => vue.h(primitive.DestylerPrimitive, {
155
+ ref: (el) => this.forwardRef(el),
156
+ role: "group",
157
+ as: this.$props.as,
158
+ asChild: this.$props.asChild
159
+ }, () => this.$slots.default?.()));
168
160
  }
169
161
  });
170
162
 
@@ -195,20 +187,14 @@ const DestylerToggleGroupItem = vue.defineComponent({
195
187
  asChild: true,
196
188
  focusable: !this.disabled,
197
189
  active: this.pressed
198
- }, {
199
- default: () => {
200
- return vue.h(DestylerToggle, vue.mergeProps(this.$props, {
201
- "ref": (el) => this.forwardRef(el),
202
- "disabled": this.disabled,
203
- "pressed": this.rootContext.type === "single" ? this.rootContext.modelValue.value === this.$props.value : this.rootContext.modelValue.value?.includes(this.$props.value),
204
- "onUpdate:pressed": () => {
205
- this.rootContext.changeModelValue(this.$props.value);
206
- }
207
- }), {
208
- default: () => this.$slots.default?.()
209
- });
190
+ }, () => vue.h(DestylerToggle, vue.mergeProps(this.$props, {
191
+ "ref": (el) => this.forwardRef(el),
192
+ "disabled": this.disabled,
193
+ "pressed": this.rootContext.type === "single" ? this.rootContext.modelValue.value === this.$props.value : this.rootContext.modelValue.value?.includes(this.$props.value),
194
+ "onUpdate:pressed": () => {
195
+ this.rootContext.changeModelValue(this.$props.value);
210
196
  }
211
- });
197
+ }), () => this.$slots.default?.()));
212
198
  }
213
199
  });
214
200
 
package/dist/index.mjs CHANGED
@@ -64,9 +64,7 @@ const DestylerToggle = defineComponent({
64
64
  "onClick": () => {
65
65
  this.togglePressed();
66
66
  }
67
- }, {
68
- default: () => this.$slots.default?.()
69
- });
67
+ }, () => this.$slots.default?.());
70
68
  }
71
69
  });
72
70
 
@@ -151,18 +149,12 @@ const DestylerToggleGroupRoot = defineComponent({
151
149
  orientation: this.rovingFocus ? this.$props.orientation : void 0,
152
150
  dir: this.dir,
153
151
  loop: this.rovingFocus ? this.loop : void 0
154
- }, {
155
- default: () => {
156
- return h(DestylerPrimitive, {
157
- ref: (el) => this.forwardRef(el),
158
- role: "group",
159
- as: this.$props.as,
160
- asChild: this.$props.asChild
161
- }, {
162
- default: () => this.$slots.default?.()
163
- });
164
- }
165
- });
152
+ }, () => h(DestylerPrimitive, {
153
+ ref: (el) => this.forwardRef(el),
154
+ role: "group",
155
+ as: this.$props.as,
156
+ asChild: this.$props.asChild
157
+ }, () => this.$slots.default?.()));
166
158
  }
167
159
  });
168
160
 
@@ -193,20 +185,14 @@ const DestylerToggleGroupItem = defineComponent({
193
185
  asChild: true,
194
186
  focusable: !this.disabled,
195
187
  active: this.pressed
196
- }, {
197
- default: () => {
198
- return h(DestylerToggle, mergeProps(this.$props, {
199
- "ref": (el) => this.forwardRef(el),
200
- "disabled": this.disabled,
201
- "pressed": this.rootContext.type === "single" ? this.rootContext.modelValue.value === this.$props.value : this.rootContext.modelValue.value?.includes(this.$props.value),
202
- "onUpdate:pressed": () => {
203
- this.rootContext.changeModelValue(this.$props.value);
204
- }
205
- }), {
206
- default: () => this.$slots.default?.()
207
- });
188
+ }, () => h(DestylerToggle, mergeProps(this.$props, {
189
+ "ref": (el) => this.forwardRef(el),
190
+ "disabled": this.disabled,
191
+ "pressed": this.rootContext.type === "single" ? this.rootContext.modelValue.value === this.$props.value : this.rootContext.modelValue.value?.includes(this.$props.value),
192
+ "onUpdate:pressed": () => {
193
+ this.rootContext.changeModelValue(this.$props.value);
208
194
  }
209
- });
195
+ }), () => this.$slots.default?.()));
210
196
  }
211
197
  });
212
198
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@destyler/toggle",
3
- "version": "0.0.2",
3
+ "type": "module",
4
+ "version": "0.0.3",
4
5
  "description": "unstyled toggle component for vue",
5
6
  "author": "Elone Hoo <elonehoo@gmail.com>",
6
7
  "license": "MIT",
@@ -33,10 +34,10 @@
33
34
  "vue": ">=3.3.4"
34
35
  },
35
36
  "dependencies": {
36
- "@destyler/composition": "0.0.2",
37
- "@destyler/primitive": "0.0.2",
38
- "@destyler/roving-focus": "0.0.2",
39
- "@destyler/shared": "0.0.2"
37
+ "@destyler/shared": "0.0.3",
38
+ "@destyler/primitive": "0.0.3",
39
+ "@destyler/composition": "0.0.3",
40
+ "@destyler/roving-focus": "0.0.3"
40
41
  },
41
42
  "scripts": {
42
43
  "clear": "rimraf ./dist",