@sepveneto/free-dom 0.12.5 → 0.12.6

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.css CHANGED
@@ -1,4 +1,4 @@
1
- /* ../../../../../../../tmp/tmp-2033-Gdg1v2Xs1Hrq/core/src/style/index.css */
1
+ /* ../../../../../../../tmp/tmp-1927-YWEQqwZ72Bii/core/src/style/index.css */
2
2
  :root {
3
3
  --vv-free-dom--theme: rgb(64, 137, 239);
4
4
  --vv-free-dom--line: var(--vv-free-dom--theme);
package/dist/index.d.ts CHANGED
@@ -393,6 +393,10 @@ declare const FreeDom: vue.DefineComponent<vue.ExtractPropTypes<{
393
393
  }>>;
394
394
  default: () => {};
395
395
  };
396
+ active: {
397
+ type: BooleanConstructor;
398
+ default: undefined;
399
+ };
396
400
  keyboard: BooleanConstructor;
397
401
  x: {
398
402
  type: NumberConstructor;
@@ -627,7 +631,7 @@ declare const FreeDom: vue.DefineComponent<vue.ExtractPropTypes<{
627
631
  handleSelect: (evt: MouseEvent) => void;
628
632
  disabled: vue.ComputedRef<boolean>;
629
633
  scale: vue.ComputedRef<number>;
630
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("update:modelValue" | "update:width" | "update:height" | "update:x" | "update:y")[], "update:modelValue" | "update:width" | "update:height" | "update:x" | "update:y", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
634
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("update:modelValue" | "update:width" | "update:height" | "update:x" | "update:y" | "select")[], "update:modelValue" | "update:width" | "update:height" | "update:x" | "update:y" | "select", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
631
635
  modelValue: {
632
636
  type: vue.PropType<Partial<{
633
637
  x: number;
@@ -637,6 +641,10 @@ declare const FreeDom: vue.DefineComponent<vue.ExtractPropTypes<{
637
641
  }>>;
638
642
  default: () => {};
639
643
  };
644
+ active: {
645
+ type: BooleanConstructor;
646
+ default: undefined;
647
+ };
640
648
  keyboard: BooleanConstructor;
641
649
  x: {
642
650
  type: NumberConstructor;
@@ -713,6 +721,7 @@ declare const FreeDom: vue.DefineComponent<vue.ExtractPropTypes<{
713
721
  "onUpdate:height"?: ((...args: any[]) => any) | undefined;
714
722
  "onUpdate:x"?: ((...args: any[]) => any) | undefined;
715
723
  "onUpdate:y"?: ((...args: any[]) => any) | undefined;
724
+ onSelect?: ((...args: any[]) => any) | undefined;
716
725
  }>, {
717
726
  x: number;
718
727
  y: number;
@@ -735,6 +744,7 @@ declare const FreeDom: vue.DefineComponent<vue.ExtractPropTypes<{
735
744
  h: number;
736
745
  }>;
737
746
  width: number;
747
+ active: boolean;
738
748
  height: number;
739
749
  dragStartFn: CoreFnCallback;
740
750
  dragStopFn: CoreFnCallback;
package/dist/index.js CHANGED
@@ -35292,7 +35292,7 @@ var require_reactivity_cjs_prod = __commonJS({
35292
35292
  cleanups.push(cleanupFn);
35293
35293
  }
35294
35294
  }
35295
- function watch7(source, cb, options = shared.EMPTY_OBJ) {
35295
+ function watch8(source, cb, options = shared.EMPTY_OBJ) {
35296
35296
  const { immediate, deep, once, scheduler, augmentJob, call } = options;
35297
35297
  const reactiveGetter = (source2) => {
35298
35298
  if (deep)
@@ -35518,7 +35518,7 @@ var require_reactivity_cjs_prod = __commonJS({
35518
35518
  exports.trigger = trigger;
35519
35519
  exports.triggerRef = triggerRef;
35520
35520
  exports.unref = unref5;
35521
- exports.watch = watch7;
35521
+ exports.watch = watch8;
35522
35522
  }
35523
35523
  });
35524
35524
 
@@ -37146,7 +37146,7 @@ var require_reactivity_cjs = __commonJS({
37146
37146
  );
37147
37147
  }
37148
37148
  }
37149
- function watch7(source, cb, options = shared.EMPTY_OBJ) {
37149
+ function watch8(source, cb, options = shared.EMPTY_OBJ) {
37150
37150
  const { immediate, deep, once, scheduler, augmentJob, call } = options;
37151
37151
  const warnInvalidSource = (s) => {
37152
37152
  (options.onWarn || warn2)(
@@ -37385,7 +37385,7 @@ var require_reactivity_cjs = __commonJS({
37385
37385
  exports.trigger = trigger;
37386
37386
  exports.triggerRef = triggerRef;
37387
37387
  exports.unref = unref5;
37388
- exports.watch = watch7;
37388
+ exports.watch = watch8;
37389
37389
  }
37390
37390
  });
37391
37391
 
@@ -39363,7 +39363,7 @@ var require_runtime_core_cjs_prod = __commonJS({
39363
39363
  cache.delete(key);
39364
39364
  keys.delete(key);
39365
39365
  }
39366
- watch7(
39366
+ watch8(
39367
39367
  () => [props.include, props.exclude],
39368
39368
  ([include, exclude]) => {
39369
39369
  include && pruneCache((name) => matches(include, name));
@@ -40140,12 +40140,12 @@ var require_runtime_core_cjs_prod = __commonJS({
40140
40140
  const handler = ctx[raw];
40141
40141
  if (shared.isFunction(handler)) {
40142
40142
  {
40143
- watch7(getter, handler);
40143
+ watch8(getter, handler);
40144
40144
  }
40145
40145
  }
40146
40146
  } else if (shared.isFunction(raw)) {
40147
40147
  {
40148
- watch7(getter, raw.bind(publicThis));
40148
+ watch8(getter, raw.bind(publicThis));
40149
40149
  }
40150
40150
  } else if (shared.isObject(raw)) {
40151
40151
  if (shared.isArray(raw)) {
@@ -40153,7 +40153,7 @@ var require_runtime_core_cjs_prod = __commonJS({
40153
40153
  } else {
40154
40154
  const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
40155
40155
  if (shared.isFunction(handler)) {
40156
- watch7(getter, handler, raw);
40156
+ watch8(getter, handler, raw);
40157
40157
  }
40158
40158
  }
40159
40159
  } else
@@ -42191,7 +42191,7 @@ var require_runtime_core_cjs_prod = __commonJS({
42191
42191
  return ctx;
42192
42192
  }
42193
42193
  };
42194
- function watchEffect5(effect, options) {
42194
+ function watchEffect6(effect, options) {
42195
42195
  return doWatch(effect, null, options);
42196
42196
  }
42197
42197
  function watchPostEffect(effect, options) {
@@ -42208,7 +42208,7 @@ var require_runtime_core_cjs_prod = __commonJS({
42208
42208
  { flush: "sync" }
42209
42209
  );
42210
42210
  }
42211
- function watch7(source, cb, options) {
42211
+ function watch8(source, cb, options) {
42212
42212
  return doWatch(source, cb, options);
42213
42213
  }
42214
42214
  function doWatch(source, cb, options = shared.EMPTY_OBJ) {
@@ -44058,8 +44058,8 @@ var require_runtime_core_cjs_prod = __commonJS({
44058
44058
  exports.useTransitionState = useTransitionState;
44059
44059
  exports.version = version3;
44060
44060
  exports.warn = warn$1;
44061
- exports.watch = watch7;
44062
- exports.watchEffect = watchEffect5;
44061
+ exports.watch = watch8;
44062
+ exports.watchEffect = watchEffect6;
44063
44063
  exports.watchPostEffect = watchPostEffect;
44064
44064
  exports.watchSyncEffect = watchSyncEffect;
44065
44065
  exports.withAsyncContext = withAsyncContext;
@@ -46688,7 +46688,7 @@ Server rendered element contains fewer child nodes than client vdom.`
46688
46688
  cache.delete(key);
46689
46689
  keys.delete(key);
46690
46690
  }
46691
- watch7(
46691
+ watch8(
46692
46692
  () => [props.include, props.exclude],
46693
46693
  ([include, exclude]) => {
46694
46694
  include && pruneCache((name) => matches(include, name));
@@ -47698,14 +47698,14 @@ If this is a native custom element, make sure to exclude it from component resol
47698
47698
  const handler = ctx[raw];
47699
47699
  if (shared.isFunction(handler)) {
47700
47700
  {
47701
- watch7(getter, handler);
47701
+ watch8(getter, handler);
47702
47702
  }
47703
47703
  } else {
47704
47704
  warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
47705
47705
  }
47706
47706
  } else if (shared.isFunction(raw)) {
47707
47707
  {
47708
- watch7(getter, raw.bind(publicThis));
47708
+ watch8(getter, raw.bind(publicThis));
47709
47709
  }
47710
47710
  } else if (shared.isObject(raw)) {
47711
47711
  if (shared.isArray(raw)) {
@@ -47713,7 +47713,7 @@ If this is a native custom element, make sure to exclude it from component resol
47713
47713
  } else {
47714
47714
  const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
47715
47715
  if (shared.isFunction(handler)) {
47716
- watch7(getter, handler, raw);
47716
+ watch8(getter, handler, raw);
47717
47717
  } else {
47718
47718
  warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
47719
47719
  }
@@ -50160,7 +50160,7 @@ If you want to remount the same app, move your app creation logic into a factory
50160
50160
  return ctx;
50161
50161
  }
50162
50162
  };
50163
- function watchEffect5(effect, options) {
50163
+ function watchEffect6(effect, options) {
50164
50164
  return doWatch(effect, null, options);
50165
50165
  }
50166
50166
  function watchPostEffect(effect, options) {
@@ -50177,7 +50177,7 @@ If you want to remount the same app, move your app creation logic into a factory
50177
50177
  shared.extend({}, options, { flush: "sync" })
50178
50178
  );
50179
50179
  }
50180
- function watch7(source, cb, options) {
50180
+ function watch8(source, cb, options) {
50181
50181
  if (!shared.isFunction(cb)) {
50182
50182
  warn$1(
50183
50183
  `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
@@ -52563,8 +52563,8 @@ Component that was made reactive: `,
52563
52563
  exports.useTransitionState = useTransitionState;
52564
52564
  exports.version = version3;
52565
52565
  exports.warn = warn2;
52566
- exports.watch = watch7;
52567
- exports.watchEffect = watchEffect5;
52566
+ exports.watch = watch8;
52567
+ exports.watchEffect = watchEffect6;
52568
52568
  exports.watchPostEffect = watchPostEffect;
52569
52569
  exports.watchSyncEffect = watchSyncEffect;
52570
52570
  exports.withAsyncContext = withAsyncContext;
@@ -57493,6 +57493,7 @@ function useMask(target, props, nodes, size) {
57493
57493
  };
57494
57494
  });
57495
57495
  const selecting = (0, import_vue_demi13.ref)(false);
57496
+ const prepareSelect = (0, import_vue_demi13.ref)(false);
57496
57497
  const rect = useElementBounding(target);
57497
57498
  const ownerDoc = (0, import_vue_demi13.computed)(() => unrefElement(target)?.ownerDocument);
57498
57499
  const activeNodes = (0, import_vue_demi13.computed)(() => nodes.value.filter((node) => {
@@ -57545,7 +57546,7 @@ function useMask(target, props, nodes, size) {
57545
57546
  return;
57546
57547
  addUserSelectStyle(ownerDoc.value);
57547
57548
  const { x: offsetX, y: offsetY } = offsetFormat(evt);
57548
- selecting.value = true;
57549
+ prepareSelect.value = true;
57549
57550
  startX.value = offsetX;
57550
57551
  startY.value = offsetY;
57551
57552
  lastX.value = offsetX;
@@ -57553,7 +57554,7 @@ function useMask(target, props, nodes, size) {
57553
57554
  document.addEventListener("mouseup", handleMouseup);
57554
57555
  }
57555
57556
  function handleMousemove(evt) {
57556
- if (!selecting.value)
57557
+ if (!prepareSelect.value)
57557
57558
  return;
57558
57559
  if (!hasEmit.value) {
57559
57560
  eventBus.emit("batch-select", "start");
@@ -57563,6 +57564,7 @@ function useMask(target, props, nodes, size) {
57563
57564
  debug(lastX.value, offsetX, lastY.value, offsetY);
57564
57565
  if (lastX.value === offsetX && lastY.value === offsetY)
57565
57566
  return;
57567
+ selecting.value = true;
57566
57568
  debug("cal", offsetX, 0, size.width.value);
57567
57569
  lastX.value = clamp(offsetX, 0, size.width.value);
57568
57570
  lastY.value = clamp(offsetY, 0, size.height.value);
@@ -57571,6 +57573,7 @@ function useMask(target, props, nodes, size) {
57571
57573
  }
57572
57574
  function handleMouseup() {
57573
57575
  removeUserSelectStyle(ownerDoc.value);
57576
+ prepareSelect.value = false;
57574
57577
  selecting.value = false;
57575
57578
  hasEmit.value = false;
57576
57579
  if (lastX.value === startX.value && lastY.value === startY.value) {
@@ -57923,6 +57926,10 @@ var freeDomProps = {
57923
57926
  type: Object,
57924
57927
  default: () => ({})
57925
57928
  },
57929
+ active: {
57930
+ type: Boolean,
57931
+ default: void 0
57932
+ },
57926
57933
  keyboard: Boolean,
57927
57934
  x: {
57928
57935
  type: Number,
@@ -57993,7 +58000,8 @@ var freeDom = (0, import_vue_demi17.defineComponent)({
57993
58000
  "update:height",
57994
58001
  "update:x",
57995
58002
  "update:y",
57996
- "update:modelValue"
58003
+ "update:modelValue",
58004
+ "select"
57997
58005
  ],
57998
58006
  setup(props, { emit, expose, slots }) {
57999
58007
  const domRef = (0, import_vue_demi17.ref)();
@@ -58014,6 +58022,14 @@ var freeDom = (0, import_vue_demi17.defineComponent)({
58014
58022
  } = useDraggableData(props);
58015
58023
  const { width, height, syncSize: _syncSize } = useResizableData(props, domRef);
58016
58024
  const selected = (0, import_vue_demi17.ref)(false);
58025
+ (0, import_vue_demi17.watch)(() => props.active, (val) => {
58026
+ if (typeof val === "boolean") {
58027
+ selected.value = val;
58028
+ }
58029
+ }, { immediate: true });
58030
+ (0, import_vue_demi17.watchEffect)(() => {
58031
+ emit("select", selected.value);
58032
+ });
58017
58033
  const context = (0, import_vue_demi17.reactive)({
58018
58034
  disabledSelect: (0, import_vue_demi17.toRef)(props, "disabledSelect"),
58019
58035
  selected,
@@ -58253,7 +58269,7 @@ var freeDom = (0, import_vue_demi17.defineComponent)({
58253
58269
  class: [
58254
58270
  "vv-free-dom--draggable",
58255
58271
  this.disabled && "vv-free-dom--draggable__disabled",
58256
- this.selected && "vv-free-dom--draggable__selected"
58272
+ (this.active || this.selected) && "vv-free-dom--draggable__selected"
58257
58273
  ],
58258
58274
  style: this.style
58259
58275
  },
package/dist/index.mjs CHANGED
@@ -35293,7 +35293,7 @@ var require_reactivity_cjs_prod = __commonJS({
35293
35293
  cleanups.push(cleanupFn);
35294
35294
  }
35295
35295
  }
35296
- function watch7(source, cb, options = shared.EMPTY_OBJ) {
35296
+ function watch8(source, cb, options = shared.EMPTY_OBJ) {
35297
35297
  const { immediate, deep, once, scheduler, augmentJob, call } = options;
35298
35298
  const reactiveGetter = (source2) => {
35299
35299
  if (deep)
@@ -35519,7 +35519,7 @@ var require_reactivity_cjs_prod = __commonJS({
35519
35519
  exports.trigger = trigger;
35520
35520
  exports.triggerRef = triggerRef;
35521
35521
  exports.unref = unref5;
35522
- exports.watch = watch7;
35522
+ exports.watch = watch8;
35523
35523
  }
35524
35524
  });
35525
35525
 
@@ -37147,7 +37147,7 @@ var require_reactivity_cjs = __commonJS({
37147
37147
  );
37148
37148
  }
37149
37149
  }
37150
- function watch7(source, cb, options = shared.EMPTY_OBJ) {
37150
+ function watch8(source, cb, options = shared.EMPTY_OBJ) {
37151
37151
  const { immediate, deep, once, scheduler, augmentJob, call } = options;
37152
37152
  const warnInvalidSource = (s) => {
37153
37153
  (options.onWarn || warn2)(
@@ -37386,7 +37386,7 @@ var require_reactivity_cjs = __commonJS({
37386
37386
  exports.trigger = trigger;
37387
37387
  exports.triggerRef = triggerRef;
37388
37388
  exports.unref = unref5;
37389
- exports.watch = watch7;
37389
+ exports.watch = watch8;
37390
37390
  }
37391
37391
  });
37392
37392
 
@@ -39364,7 +39364,7 @@ var require_runtime_core_cjs_prod = __commonJS({
39364
39364
  cache.delete(key);
39365
39365
  keys.delete(key);
39366
39366
  }
39367
- watch7(
39367
+ watch8(
39368
39368
  () => [props.include, props.exclude],
39369
39369
  ([include, exclude]) => {
39370
39370
  include && pruneCache((name) => matches(include, name));
@@ -40141,12 +40141,12 @@ var require_runtime_core_cjs_prod = __commonJS({
40141
40141
  const handler = ctx[raw];
40142
40142
  if (shared.isFunction(handler)) {
40143
40143
  {
40144
- watch7(getter, handler);
40144
+ watch8(getter, handler);
40145
40145
  }
40146
40146
  }
40147
40147
  } else if (shared.isFunction(raw)) {
40148
40148
  {
40149
- watch7(getter, raw.bind(publicThis));
40149
+ watch8(getter, raw.bind(publicThis));
40150
40150
  }
40151
40151
  } else if (shared.isObject(raw)) {
40152
40152
  if (shared.isArray(raw)) {
@@ -40154,7 +40154,7 @@ var require_runtime_core_cjs_prod = __commonJS({
40154
40154
  } else {
40155
40155
  const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
40156
40156
  if (shared.isFunction(handler)) {
40157
- watch7(getter, handler, raw);
40157
+ watch8(getter, handler, raw);
40158
40158
  }
40159
40159
  }
40160
40160
  } else
@@ -42192,7 +42192,7 @@ var require_runtime_core_cjs_prod = __commonJS({
42192
42192
  return ctx;
42193
42193
  }
42194
42194
  };
42195
- function watchEffect5(effect, options) {
42195
+ function watchEffect6(effect, options) {
42196
42196
  return doWatch(effect, null, options);
42197
42197
  }
42198
42198
  function watchPostEffect(effect, options) {
@@ -42209,7 +42209,7 @@ var require_runtime_core_cjs_prod = __commonJS({
42209
42209
  { flush: "sync" }
42210
42210
  );
42211
42211
  }
42212
- function watch7(source, cb, options) {
42212
+ function watch8(source, cb, options) {
42213
42213
  return doWatch(source, cb, options);
42214
42214
  }
42215
42215
  function doWatch(source, cb, options = shared.EMPTY_OBJ) {
@@ -44059,8 +44059,8 @@ var require_runtime_core_cjs_prod = __commonJS({
44059
44059
  exports.useTransitionState = useTransitionState;
44060
44060
  exports.version = version3;
44061
44061
  exports.warn = warn$1;
44062
- exports.watch = watch7;
44063
- exports.watchEffect = watchEffect5;
44062
+ exports.watch = watch8;
44063
+ exports.watchEffect = watchEffect6;
44064
44064
  exports.watchPostEffect = watchPostEffect;
44065
44065
  exports.watchSyncEffect = watchSyncEffect;
44066
44066
  exports.withAsyncContext = withAsyncContext;
@@ -46689,7 +46689,7 @@ Server rendered element contains fewer child nodes than client vdom.`
46689
46689
  cache.delete(key);
46690
46690
  keys.delete(key);
46691
46691
  }
46692
- watch7(
46692
+ watch8(
46693
46693
  () => [props.include, props.exclude],
46694
46694
  ([include, exclude]) => {
46695
46695
  include && pruneCache((name) => matches(include, name));
@@ -47699,14 +47699,14 @@ If this is a native custom element, make sure to exclude it from component resol
47699
47699
  const handler = ctx[raw];
47700
47700
  if (shared.isFunction(handler)) {
47701
47701
  {
47702
- watch7(getter, handler);
47702
+ watch8(getter, handler);
47703
47703
  }
47704
47704
  } else {
47705
47705
  warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
47706
47706
  }
47707
47707
  } else if (shared.isFunction(raw)) {
47708
47708
  {
47709
- watch7(getter, raw.bind(publicThis));
47709
+ watch8(getter, raw.bind(publicThis));
47710
47710
  }
47711
47711
  } else if (shared.isObject(raw)) {
47712
47712
  if (shared.isArray(raw)) {
@@ -47714,7 +47714,7 @@ If this is a native custom element, make sure to exclude it from component resol
47714
47714
  } else {
47715
47715
  const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
47716
47716
  if (shared.isFunction(handler)) {
47717
- watch7(getter, handler, raw);
47717
+ watch8(getter, handler, raw);
47718
47718
  } else {
47719
47719
  warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
47720
47720
  }
@@ -50161,7 +50161,7 @@ If you want to remount the same app, move your app creation logic into a factory
50161
50161
  return ctx;
50162
50162
  }
50163
50163
  };
50164
- function watchEffect5(effect, options) {
50164
+ function watchEffect6(effect, options) {
50165
50165
  return doWatch(effect, null, options);
50166
50166
  }
50167
50167
  function watchPostEffect(effect, options) {
@@ -50178,7 +50178,7 @@ If you want to remount the same app, move your app creation logic into a factory
50178
50178
  shared.extend({}, options, { flush: "sync" })
50179
50179
  );
50180
50180
  }
50181
- function watch7(source, cb, options) {
50181
+ function watch8(source, cb, options) {
50182
50182
  if (!shared.isFunction(cb)) {
50183
50183
  warn$1(
50184
50184
  `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
@@ -52564,8 +52564,8 @@ Component that was made reactive: `,
52564
52564
  exports.useTransitionState = useTransitionState;
52565
52565
  exports.version = version3;
52566
52566
  exports.warn = warn2;
52567
- exports.watch = watch7;
52568
- exports.watchEffect = watchEffect5;
52567
+ exports.watch = watch8;
52568
+ exports.watchEffect = watchEffect6;
52569
52569
  exports.watchPostEffect = watchPostEffect;
52570
52570
  exports.watchSyncEffect = watchSyncEffect;
52571
52571
  exports.withAsyncContext = withAsyncContext;
@@ -56216,7 +56216,7 @@ import {
56216
56216
  ref as ref13,
56217
56217
  shallowRef as shallowRef6,
56218
56218
  toRefs as toRefs2,
56219
- watch as watch5
56219
+ watch as watch6
56220
56220
  } from "vue-demi";
56221
56221
 
56222
56222
  // src/util/tokens.ts
@@ -57492,6 +57492,7 @@ function useMask(target, props, nodes, size) {
57492
57492
  };
57493
57493
  });
57494
57494
  const selecting = ref9(false);
57495
+ const prepareSelect = ref9(false);
57495
57496
  const rect = useElementBounding(target);
57496
57497
  const ownerDoc = computed6(() => unrefElement(target)?.ownerDocument);
57497
57498
  const activeNodes = computed6(() => nodes.value.filter((node) => {
@@ -57544,7 +57545,7 @@ function useMask(target, props, nodes, size) {
57544
57545
  return;
57545
57546
  addUserSelectStyle(ownerDoc.value);
57546
57547
  const { x: offsetX, y: offsetY } = offsetFormat(evt);
57547
- selecting.value = true;
57548
+ prepareSelect.value = true;
57548
57549
  startX.value = offsetX;
57549
57550
  startY.value = offsetY;
57550
57551
  lastX.value = offsetX;
@@ -57552,7 +57553,7 @@ function useMask(target, props, nodes, size) {
57552
57553
  document.addEventListener("mouseup", handleMouseup);
57553
57554
  }
57554
57555
  function handleMousemove(evt) {
57555
- if (!selecting.value)
57556
+ if (!prepareSelect.value)
57556
57557
  return;
57557
57558
  if (!hasEmit.value) {
57558
57559
  eventBus.emit("batch-select", "start");
@@ -57562,6 +57563,7 @@ function useMask(target, props, nodes, size) {
57562
57563
  debug(lastX.value, offsetX, lastY.value, offsetY);
57563
57564
  if (lastX.value === offsetX && lastY.value === offsetY)
57564
57565
  return;
57566
+ selecting.value = true;
57565
57567
  debug("cal", offsetX, 0, size.width.value);
57566
57568
  lastX.value = clamp(offsetX, 0, size.width.value);
57567
57569
  lastY.value = clamp(offsetY, 0, size.height.value);
@@ -57570,6 +57572,7 @@ function useMask(target, props, nodes, size) {
57570
57572
  }
57571
57573
  function handleMouseup() {
57572
57574
  removeUserSelectStyle(ownerDoc.value);
57575
+ prepareSelect.value = false;
57573
57576
  selecting.value = false;
57574
57577
  hasEmit.value = false;
57575
57578
  if (lastX.value === startX.value && lastY.value === startY.value) {
@@ -57630,7 +57633,7 @@ function useOperateHistory(nodes) {
57630
57633
  }
57631
57634
 
57632
57635
  // src/components/freeDom.ts
57633
- import { computed as computed10, defineComponent as defineComponent5, onMounted as onMounted4, reactive as reactive4, ref as ref12, toRef as toRef2 } from "vue-demi";
57636
+ import { computed as computed10, defineComponent as defineComponent5, onMounted as onMounted4, reactive as reactive4, ref as ref12, toRef as toRef2, watch as watch5, watchEffect as watchEffect5 } from "vue-demi";
57634
57637
 
57635
57638
  // src/components/freeDomCore.ts
57636
57639
  import { computed as computed8, defineComponent as defineComponent3, onUnmounted as onUnmounted3, ref as ref11 } from "vue-demi";
@@ -57922,6 +57925,10 @@ var freeDomProps = {
57922
57925
  type: Object,
57923
57926
  default: () => ({})
57924
57927
  },
57928
+ active: {
57929
+ type: Boolean,
57930
+ default: void 0
57931
+ },
57925
57932
  keyboard: Boolean,
57926
57933
  x: {
57927
57934
  type: Number,
@@ -57992,7 +57999,8 @@ var freeDom = defineComponent5({
57992
57999
  "update:height",
57993
58000
  "update:x",
57994
58001
  "update:y",
57995
- "update:modelValue"
58002
+ "update:modelValue",
58003
+ "select"
57996
58004
  ],
57997
58005
  setup(props, { emit, expose, slots }) {
57998
58006
  const domRef = ref12();
@@ -58013,6 +58021,14 @@ var freeDom = defineComponent5({
58013
58021
  } = useDraggableData(props);
58014
58022
  const { width, height, syncSize: _syncSize } = useResizableData(props, domRef);
58015
58023
  const selected = ref12(false);
58024
+ watch5(() => props.active, (val) => {
58025
+ if (typeof val === "boolean") {
58026
+ selected.value = val;
58027
+ }
58028
+ }, { immediate: true });
58029
+ watchEffect5(() => {
58030
+ emit("select", selected.value);
58031
+ });
58016
58032
  const context = reactive4({
58017
58033
  disabledSelect: toRef2(props, "disabledSelect"),
58018
58034
  selected,
@@ -58252,7 +58268,7 @@ var freeDom = defineComponent5({
58252
58268
  class: [
58253
58269
  "vv-free-dom--draggable",
58254
58270
  this.disabled && "vv-free-dom--draggable__disabled",
58255
- this.selected && "vv-free-dom--draggable__selected"
58271
+ (this.active || this.selected) && "vv-free-dom--draggable__selected"
58256
58272
  ],
58257
58273
  style: this.style
58258
58274
  },
@@ -58312,7 +58328,7 @@ var FreeDomWrap = defineComponent6({
58312
58328
  const height = ref13(0);
58313
58329
  const rectRef = shallowRef6();
58314
58330
  const wrapRect = useElementBounding(rectRef);
58315
- watch5([
58331
+ watch6([
58316
58332
  wrapRect.width,
58317
58333
  wrapRect.height,
58318
58334
  () => nodes.value.length
@@ -58463,7 +58479,7 @@ var FreeDomWrap = defineComponent6({
58463
58479
  import { Fragment as Fragment2, defineComponent as defineComponent8, h as h6, provide as provide3, reactive as reactive6, ref as ref16, toRefs as toRefs3 } from "vue-demi";
58464
58480
 
58465
58481
  // src/components/gridItem.ts
58466
- import { defineComponent as defineComponent7, inject as inject5, onMounted as onMounted5, ref as ref14, watch as watch6 } from "vue-demi";
58482
+ import { defineComponent as defineComponent7, inject as inject5, onMounted as onMounted5, ref as ref14, watch as watch7 } from "vue-demi";
58467
58483
 
58468
58484
  // src/components/tokens.ts
58469
58485
  var gridLayoutContextKey = Symbol("gridLayoutContext");
@@ -58537,7 +58553,7 @@ var GridItem = defineComponent7({
58537
58553
  onMounted5(() => {
58538
58554
  moveDroppingItem();
58539
58555
  });
58540
- watch6(() => props.droppingPosition, (currPos, prevPos) => {
58556
+ watch7(() => props.droppingPosition, (currPos, prevPos) => {
58541
58557
  moveDroppingItem(prevPos);
58542
58558
  }, { deep: true });
58543
58559
  function moveDroppingItem(prevPos) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sepveneto/free-dom",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",