@destyler/dialog 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.
@@ -91,9 +91,7 @@ const DestylerDialogClose = vue.defineComponent({
91
91
  onClick: () => {
92
92
  this.rootContext.onOpenChange(false);
93
93
  }
94
- }), {
95
- default: () => this.$slots.default?.()
96
- });
94
+ }), () => this.$slots.default?.());
97
95
  }
98
96
  });
99
97
 
@@ -144,7 +142,7 @@ const DestylerDialogContentImpl = vue.defineComponent({
144
142
  onUnmountAutoFocus: (event) => {
145
143
  this.$emit("closeAutoFocus", event);
146
144
  }
147
- }, vue.withDirectives(vue.h(dismissableLayer.DestylerDismissableLayer, vue.mergeProps(this.$attrs, {
145
+ }, () => vue.withDirectives(vue.h(dismissableLayer.DestylerDismissableLayer, vue.mergeProps(this.$attrs, {
148
146
  "ref": (el) => this.forwardRef(el),
149
147
  "as": this.$props.as,
150
148
  "asChild": this.$props.asChild,
@@ -168,9 +166,7 @@ const DestylerDialogContentImpl = vue.defineComponent({
168
166
  "onPointerDownOutside": (event) => {
169
167
  this.$emit("pointerDownOutside", event);
170
168
  }
171
- }), {
172
- default: () => this.$slots.default?.()
173
- }), [
169
+ }), () => this.$slots.default?.()), [
174
170
  [directives.BindOnceDirective, { id: this.rootContext.contentId }]
175
171
  ]));
176
172
  }
@@ -216,9 +212,7 @@ const DestylerDialogContentModal = vue.defineComponent({
216
212
  "onOpenAutoFocus": (event) => {
217
213
  this.$emit("openAutoFocus", event);
218
214
  }
219
- }), {
220
- default: () => this.$slots.default?.()
221
- });
215
+ }), () => this.$slots.default?.());
222
216
  }
223
217
  });
224
218
 
@@ -265,9 +259,7 @@ const DestylerDialogContentNonModal = vue.defineComponent({
265
259
  if (event.detail.originalEvent.type === "focusin" && this.hasPointerDownOutsideRef)
266
260
  event.preventDefault();
267
261
  }
268
- }), {
269
- default: () => this.$slots.default?.()
270
- });
262
+ }), () => this.$slots.default?.());
271
263
  }
272
264
  });
273
265
 
@@ -310,18 +302,13 @@ const DestylerDialogContent = vue.defineComponent({
310
302
  const useVShow = this.rootContext.modal.value;
311
303
  return vue.h(presence.DestylerPresence, {
312
304
  present: this.$props.forceMount || this.rootContext.open.value
313
- }, [
305
+ }, () => [
314
306
  useVShow ? vue.h(DestylerDialogContentModal, vue.mergeProps(this.$props, this.emitsAsProps, this.$attrs, {
315
307
  ref: (el) => this.forwardRef(el),
316
308
  onOpenAutoFocus: (event) => {
317
309
  this.$emit("openAutoFocus", event);
318
310
  }
319
- }), {
320
- default: () => this.$slots.default?.()
321
- }) : vue.h(DestylerDialogContentNonModal, vue.mergeProps(this.$props, this.emitsAsProps, this.$attrs), {
322
- ref: (el) => this.forwardRef(el),
323
- default: () => this.$slots.default?.()
324
- })
311
+ }), () => this.$slots.default?.()) : vue.h(DestylerDialogContentNonModal, vue.mergeProps(this.$props, this.emitsAsProps, this.$attrs, { ref: (el) => this.forwardRef(el) }), () => this.$slots.default?.())
325
312
  ]);
326
313
  }
327
314
  });
@@ -351,9 +338,7 @@ const DestylerDialogDescription = vue.defineComponent({
351
338
  return vue.withDirectives(vue.h(primitive.DestylerPrimitive, {
352
339
  as: this.$props.as,
353
340
  asChild: this.$props.asChild
354
- }, {
355
- default: () => this.$slots.default?.()
356
- }), [
341
+ }, () => this.$slots.default?.()), [
357
342
  [directives.BindOnceDirective, { id: this.rootContext.descriptionId }]
358
343
  ]);
359
344
  }
@@ -389,9 +374,7 @@ const DestylerDialogOverlayImpl = vue.defineComponent({
389
374
  "style": {
390
375
  "pointer-events": "auto"
391
376
  }
392
- }, {
393
- default: () => this.$slots.default?.()
394
- });
377
+ }, () => this.$slots.default?.());
395
378
  }
396
379
  });
397
380
 
@@ -426,13 +409,11 @@ const DestylerDialogOverlay = vue.defineComponent({
426
409
  const useVShow = this.rootContext?.modal.value;
427
410
  return useVShow ? vue.h(presence.DestylerPresence, {
428
411
  present: this.$props.forceMount || this.rootContext.open.value
429
- }, vue.h(DestylerDialogOverlayImpl, vue.mergeProps(this.$attrs, {
412
+ }, () => vue.h(DestylerDialogOverlayImpl, vue.mergeProps(this.$attrs, {
430
413
  ref: (el) => this.forwardRef(el),
431
414
  as: this.$props.as,
432
415
  asChild: this.$props.asChild
433
- }), {
434
- default: () => this.$slots.default?.()
435
- })) : null;
416
+ }), () => this.$slots.default?.())) : null;
436
417
  }
437
418
  });
438
419
 
@@ -452,9 +433,7 @@ const DestylerDialogPortal = vue.defineComponent({
452
433
  name: "DestylerDialogPortal",
453
434
  props: destylerDialogPortalProps,
454
435
  render() {
455
- return vue.h(teleport.DestylerTeleport, {}, {
456
- default: () => this.$slots.default?.()
457
- });
436
+ return vue.h(teleport.DestylerTeleport, {}, () => this.$slots.default?.());
458
437
  }
459
438
  });
460
439
 
@@ -483,9 +462,7 @@ const DestylerDialogTitle = vue.defineComponent({
483
462
  return vue.withDirectives(vue.h(primitive.DestylerPrimitive, {
484
463
  as: this.$props.as,
485
464
  asChild: this.$props.asChild
486
- }, {
487
- default: () => this.$slots.default?.()
488
- }), [
465
+ }, () => this.$slots.default?.()), [
489
466
  [directives.BindOnceDirective, { id: this.rootContext.titleId }]
490
467
  ]);
491
468
  }
@@ -530,9 +507,7 @@ const DestylerDialogTrigger = vue.defineComponent({
530
507
  "onClick": () => {
531
508
  this.rootContext.onOpenToggle();
532
509
  }
533
- }), {
534
- default: () => this.$slots.default?.()
535
- });
510
+ }), () => this.$slots.default?.());
536
511
  }
537
512
  });
538
513
 
@@ -89,9 +89,7 @@ const DestylerDialogClose = defineComponent({
89
89
  onClick: () => {
90
90
  this.rootContext.onOpenChange(false);
91
91
  }
92
- }), {
93
- default: () => this.$slots.default?.()
94
- });
92
+ }), () => this.$slots.default?.());
95
93
  }
96
94
  });
97
95
 
@@ -142,7 +140,7 @@ const DestylerDialogContentImpl = defineComponent({
142
140
  onUnmountAutoFocus: (event) => {
143
141
  this.$emit("closeAutoFocus", event);
144
142
  }
145
- }, withDirectives(h(DestylerDismissableLayer, mergeProps(this.$attrs, {
143
+ }, () => withDirectives(h(DestylerDismissableLayer, mergeProps(this.$attrs, {
146
144
  "ref": (el) => this.forwardRef(el),
147
145
  "as": this.$props.as,
148
146
  "asChild": this.$props.asChild,
@@ -166,9 +164,7 @@ const DestylerDialogContentImpl = defineComponent({
166
164
  "onPointerDownOutside": (event) => {
167
165
  this.$emit("pointerDownOutside", event);
168
166
  }
169
- }), {
170
- default: () => this.$slots.default?.()
171
- }), [
167
+ }), () => this.$slots.default?.()), [
172
168
  [BindOnceDirective, { id: this.rootContext.contentId }]
173
169
  ]));
174
170
  }
@@ -214,9 +210,7 @@ const DestylerDialogContentModal = defineComponent({
214
210
  "onOpenAutoFocus": (event) => {
215
211
  this.$emit("openAutoFocus", event);
216
212
  }
217
- }), {
218
- default: () => this.$slots.default?.()
219
- });
213
+ }), () => this.$slots.default?.());
220
214
  }
221
215
  });
222
216
 
@@ -263,9 +257,7 @@ const DestylerDialogContentNonModal = defineComponent({
263
257
  if (event.detail.originalEvent.type === "focusin" && this.hasPointerDownOutsideRef)
264
258
  event.preventDefault();
265
259
  }
266
- }), {
267
- default: () => this.$slots.default?.()
268
- });
260
+ }), () => this.$slots.default?.());
269
261
  }
270
262
  });
271
263
 
@@ -308,18 +300,13 @@ const DestylerDialogContent = defineComponent({
308
300
  const useVShow = this.rootContext.modal.value;
309
301
  return h(DestylerPresence, {
310
302
  present: this.$props.forceMount || this.rootContext.open.value
311
- }, [
303
+ }, () => [
312
304
  useVShow ? h(DestylerDialogContentModal, mergeProps(this.$props, this.emitsAsProps, this.$attrs, {
313
305
  ref: (el) => this.forwardRef(el),
314
306
  onOpenAutoFocus: (event) => {
315
307
  this.$emit("openAutoFocus", event);
316
308
  }
317
- }), {
318
- default: () => this.$slots.default?.()
319
- }) : h(DestylerDialogContentNonModal, mergeProps(this.$props, this.emitsAsProps, this.$attrs), {
320
- ref: (el) => this.forwardRef(el),
321
- default: () => this.$slots.default?.()
322
- })
309
+ }), () => this.$slots.default?.()) : h(DestylerDialogContentNonModal, mergeProps(this.$props, this.emitsAsProps, this.$attrs, { ref: (el) => this.forwardRef(el) }), () => this.$slots.default?.())
323
310
  ]);
324
311
  }
325
312
  });
@@ -349,9 +336,7 @@ const DestylerDialogDescription = defineComponent({
349
336
  return withDirectives(h(DestylerPrimitive, {
350
337
  as: this.$props.as,
351
338
  asChild: this.$props.asChild
352
- }, {
353
- default: () => this.$slots.default?.()
354
- }), [
339
+ }, () => this.$slots.default?.()), [
355
340
  [BindOnceDirective, { id: this.rootContext.descriptionId }]
356
341
  ]);
357
342
  }
@@ -387,9 +372,7 @@ const DestylerDialogOverlayImpl = defineComponent({
387
372
  "style": {
388
373
  "pointer-events": "auto"
389
374
  }
390
- }, {
391
- default: () => this.$slots.default?.()
392
- });
375
+ }, () => this.$slots.default?.());
393
376
  }
394
377
  });
395
378
 
@@ -424,13 +407,11 @@ const DestylerDialogOverlay = defineComponent({
424
407
  const useVShow = this.rootContext?.modal.value;
425
408
  return useVShow ? h(DestylerPresence, {
426
409
  present: this.$props.forceMount || this.rootContext.open.value
427
- }, h(DestylerDialogOverlayImpl, mergeProps(this.$attrs, {
410
+ }, () => h(DestylerDialogOverlayImpl, mergeProps(this.$attrs, {
428
411
  ref: (el) => this.forwardRef(el),
429
412
  as: this.$props.as,
430
413
  asChild: this.$props.asChild
431
- }), {
432
- default: () => this.$slots.default?.()
433
- })) : null;
414
+ }), () => this.$slots.default?.())) : null;
434
415
  }
435
416
  });
436
417
 
@@ -450,9 +431,7 @@ const DestylerDialogPortal = defineComponent({
450
431
  name: "DestylerDialogPortal",
451
432
  props: destylerDialogPortalProps,
452
433
  render() {
453
- return h(DestylerTeleport, {}, {
454
- default: () => this.$slots.default?.()
455
- });
434
+ return h(DestylerTeleport, {}, () => this.$slots.default?.());
456
435
  }
457
436
  });
458
437
 
@@ -481,9 +460,7 @@ const DestylerDialogTitle = defineComponent({
481
460
  return withDirectives(h(DestylerPrimitive, {
482
461
  as: this.$props.as,
483
462
  asChild: this.$props.asChild
484
- }, {
485
- default: () => this.$slots.default?.()
486
- }), [
463
+ }, () => this.$slots.default?.()), [
487
464
  [BindOnceDirective, { id: this.rootContext.titleId }]
488
465
  ]);
489
466
  }
@@ -528,9 +505,7 @@ const DestylerDialogTrigger = defineComponent({
528
505
  "onClick": () => {
529
506
  this.rootContext.onOpenToggle();
530
507
  }
531
- }), {
532
- default: () => this.$slots.default?.()
533
- });
508
+ }), () => this.$slots.default?.());
534
509
  }
535
510
  });
536
511
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@destyler/dialog",
3
- "version": "0.0.2",
3
+ "type": "module",
4
+ "version": "0.0.3",
4
5
  "description": "unstyled dialog component for vue",
5
6
  "author": "Elone Hoo <elonehoo@gmail.com>",
6
7
  "license": "MIT",
@@ -33,14 +34,14 @@
33
34
  "vue": ">=3.3.4"
34
35
  },
35
36
  "dependencies": {
36
- "@destyler/presence": "0.0.2",
37
- "@destyler/primitive": "0.0.2",
38
- "@destyler/focus-scope": "0.0.2",
39
- "@destyler/directives": "0.0.2",
40
- "@destyler/composition": "0.0.2",
41
- "@destyler/shared": "0.0.2",
42
- "@destyler/dismissable-layer": "0.0.2",
43
- "@destyler/teleport": "0.0.2"
37
+ "@destyler/composition": "0.0.3",
38
+ "@destyler/directives": "0.0.3",
39
+ "@destyler/dismissable-layer": "0.0.3",
40
+ "@destyler/shared": "0.0.3",
41
+ "@destyler/focus-scope": "0.0.3",
42
+ "@destyler/teleport": "0.0.3",
43
+ "@destyler/primitive": "0.0.3",
44
+ "@destyler/presence": "0.0.3"
44
45
  },
45
46
  "scripts": {
46
47
  "clear": "rimraf ./dist",