eco-vue-js 0.11.64 → 0.11.66

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.
Files changed (58) hide show
  1. package/dist/assets/icons/IconUpload.svg.js +38 -0
  2. package/dist/components/BorderSvg/WBorderSvg.vue.d.ts +26 -0
  3. package/dist/components/BorderSvg/WBorderSvg.vue.d.ts.map +1 -0
  4. package/dist/components/BorderSvg/WBorderSvg.vue.js +36 -0
  5. package/dist/components/BorderSvg/WBorderSvg.vue2.js +5 -0
  6. package/dist/components/Button/WButtonGroup.vue.js +1 -0
  7. package/dist/components/Checkbox/WCheckboxGroup.vue.js +1 -0
  8. package/dist/components/Checkbox/WCheckboxGroupMultiple.vue.js +1 -0
  9. package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts +6 -0
  10. package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts.map +1 -1
  11. package/dist/components/FieldWrapper/WFieldWrapper.vue.js +36 -12
  12. package/dist/components/FieldWrapper/types.d.ts +1 -0
  13. package/dist/components/FieldWrapper/types.d.ts.map +1 -1
  14. package/dist/components/FilePicker/WFilePicker.vue.d.ts +0 -2
  15. package/dist/components/FilePicker/WFilePicker.vue.d.ts.map +1 -1
  16. package/dist/components/FilePicker/WFilePicker.vue.js +17 -44
  17. package/dist/components/FilePicker/components/FilePickerSvg.vue.d.ts +2 -7
  18. package/dist/components/FilePicker/components/FilePickerSvg.vue.d.ts.map +1 -1
  19. package/dist/components/FilePicker/components/FilePickerSvg.vue.js +21 -71
  20. package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.js +1 -0
  21. package/dist/components/FormAsync/WFormAsyncCheckboxGroup.vue.js +1 -0
  22. package/dist/components/FormAsync/WFormAsyncInput.vue.js +1 -0
  23. package/dist/components/FormAsync/WFormAsyncSelect.vue.js +1 -0
  24. package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +1 -0
  25. package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +1 -0
  26. package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +1 -0
  27. package/dist/components/Input/WInput.vue.d.ts.map +1 -1
  28. package/dist/components/Input/WInput.vue.js +82 -19
  29. package/dist/components/Input/WInputAsync.vue.d.ts.map +1 -1
  30. package/dist/components/Input/WInputAsync.vue.js +4 -4
  31. package/dist/components/Input/WInputDate.vue.js +1 -0
  32. package/dist/components/Input/WInputOptions.vue.js +1 -0
  33. package/dist/components/Input/WInputSuggest.vue.d.ts.map +1 -1
  34. package/dist/components/Input/WInputSuggest.vue.js +4 -2
  35. package/dist/components/Input/components/ContentEditable.vue.d.ts.map +1 -1
  36. package/dist/components/Input/components/ContentEditable.vue2.js +35 -3
  37. package/dist/components/Input/components/InputActions.vue.d.ts +4 -0
  38. package/dist/components/Input/components/InputActions.vue.d.ts.map +1 -1
  39. package/dist/components/Input/components/InputActions.vue.js +40 -19
  40. package/dist/components/Input/components/InputActionsButton.vue.d.ts +1 -0
  41. package/dist/components/Input/components/InputActionsButton.vue.d.ts.map +1 -1
  42. package/dist/components/Input/components/InputActionsButton.vue.js +5 -5
  43. package/dist/components/Input/components/InputToolbar.vue.d.ts +1 -0
  44. package/dist/components/Input/components/InputToolbar.vue.d.ts.map +1 -1
  45. package/dist/components/Input/components/InputToolbar.vue2.js +8 -5
  46. package/dist/components/Select/WSelect.vue.js +1 -0
  47. package/dist/components/Select/WSelectAsync.vue.js +1 -0
  48. package/dist/components/Select/WSelectAsyncSingle.vue.js +1 -0
  49. package/dist/components/Select/WSelectSingle.vue.js +1 -0
  50. package/dist/components/Select/WSelectStringified.vue.js +1 -0
  51. package/dist/main.d.ts +4 -1
  52. package/dist/main.d.ts.map +1 -1
  53. package/dist/main.js +213 -209
  54. package/dist/utils/preventDragFile.d.ts +3 -0
  55. package/dist/utils/preventDragFile.d.ts.map +1 -0
  56. package/dist/utils/preventDragFile.js +20 -0
  57. package/package.json +7 -1
  58. package/tailwind-base/plugins/internal-variables.ts +15 -0
@@ -1,18 +1,25 @@
1
- import { defineComponent, defineAsyncComponent, useTemplateRef, ref, watch, nextTick, onMounted, onBeforeUnmount, computed, createBlock, openBlock, mergeProps, createSlots, withCtx, renderSlot, unref, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, normalizeProps, guardReactiveProps, toDisplayString, resolveDynamicComponent, withModifiers, withKeys } from 'vue';
1
+ import { defineComponent, defineAsyncComponent, useTemplateRef, ref, computed, watch, nextTick, onMounted, onBeforeUnmount, createBlock, openBlock, mergeProps, createSlots, withCtx, renderSlot, unref, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, normalizeProps, guardReactiveProps, toDisplayString, resolveDynamicComponent, createVNode, withModifiers, withKeys } from 'vue';
2
2
  import _sfc_main$1 from '../FieldWrapper/WFieldWrapper.vue.js';
3
3
  import { useTabActiveListener } from '../Tabs/use/useTabActiveListener.js';
4
4
  import { Notify } from '../../utils/Notify.js';
5
5
  import { getIsMobile } from '../../utils/mobile.js';
6
+ import { isDragging } from '../../utils/preventDragFile.js';
6
7
  import { useComponentStates } from '../../utils/useComponentStates.js';
7
8
  import { checkPermissionPaste } from '../../utils/useCopy.js';
8
9
  import { debounce } from '../../utils/utils.js';
9
- import _sfc_main$2 from './components/InputActions.vue.js';
10
+ import _sfc_main$3 from './components/InputActions.vue.js';
11
+ import _sfc_main$2 from '../FilePicker/components/FilePickerSvg.vue.js';
10
12
 
11
- const _hoisted_1 = { class: "relative flex min-h-full flex-1" };
12
- const _hoisted_2 = {
13
+ const _hoisted_1 = {
14
+ key: 0,
15
+ class: "text-primary dark:text-primary-dark bg-primary/10 dark:bg-primary-dark/10 pointer-events-none absolute inset-0.5 rounded-[--w-option-rounded]"
16
+ };
17
+ const _hoisted_2 = { class: "relative flex min-h-full flex-1" };
18
+ const _hoisted_3 = {
13
19
  key: 0,
14
20
  class: "text-description pointer-events-none absolute"
15
21
  };
22
+ const maxSizeKb = 10;
16
23
  const _sfc_main = /* @__PURE__ */ defineComponent({
17
24
  ...{ inheritAttrs: false },
18
25
  __name: "WInput",
@@ -67,7 +74,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
74
  subgrid: { type: Boolean },
68
75
  seamless: { type: Boolean },
69
76
  savedText: {},
70
- topText: { type: Boolean }
77
+ topText: { type: Boolean },
78
+ allowDropFile: { type: Boolean }
71
79
  },
72
80
  emits: ["update:model-value", "keypress:enter", "keypress:up", "keypress:down", "keypress:delete", "keypress:backspace", "click:clear", "focus", "blur", "click", "mousedown", "select:input", "paste"],
73
81
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -82,6 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
82
90
  const isSecureVisible = ref(false);
83
91
  const history = ref([]);
84
92
  const historyPosition = ref(-1);
93
+ const hasNoValue = computed(() => !props.modelValue && !props.textParts?.length && !props.placeholderSecure);
85
94
  const getCaret = () => {
86
95
  if (!inputRef.value) return { start: 0, end: 0 };
87
96
  if ("getCaret" in inputRef.value) return inputRef.value.getCaret();
@@ -255,8 +264,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
255
264
  };
256
265
  const scrollToInput = () => {
257
266
  if (!contentRef.value || !inputRef.value) return;
258
- if (inputRef.value instanceof HTMLElement) inputRef.value.scrollIntoView({ behavior: "instant", block: "center" });
259
- else contentRef.value.scrollTo({ left: contentRef.value.scrollWidth - 40 });
267
+ contentRef.value.scrollTo({ left: contentRef.value.scrollWidth - 40 });
260
268
  };
261
269
  const wrapSelection = (value) => inputRef.value && "wrapSelection" in inputRef.value ? inputRef.value.wrapSelection(value) : void 0;
262
270
  let timeout;
@@ -271,6 +279,50 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
271
279
  timeout = void 0;
272
280
  }, typeof props.autofocus === "number" ? props.autofocus : 250);
273
281
  };
282
+ const maxSize = maxSizeKb * 1024;
283
+ let closeModal = null;
284
+ const processFile = async (file) => {
285
+ if (file.size > maxSize) {
286
+ fieldWrapperRef.value?.showMessage(`File is too large. Max size is ${maxSizeKb.toFixed(0)} KB`, 4e3);
287
+ return;
288
+ }
289
+ const text = await file.text();
290
+ if (text.length === 0) {
291
+ fieldWrapperRef.value?.showMessage("File is empty", 4e3);
292
+ return;
293
+ } else if (props.maxLength && text.length > props.maxLength) {
294
+ fieldWrapperRef.value?.showMessage(`File content length exceeds the allowed limit of ${props.maxLength} characters`, 4e3);
295
+ return;
296
+ }
297
+ if (props.modelValue === text) {
298
+ fieldWrapperRef.value?.showMessage("File content is already applied", 2e3);
299
+ return;
300
+ }
301
+ updateModelValue(text, true);
302
+ fieldWrapperRef.value?.showMessage(`File "${file.name}" applied`, 2e3);
303
+ focus();
304
+ };
305
+ const onDrop = async (list) => {
306
+ closeModal?.();
307
+ closeModal = null;
308
+ const file = list[0]?.getAsFile();
309
+ if (!file) return;
310
+ await processFile(file);
311
+ };
312
+ const openFilePicker = () => {
313
+ if (props.loading || isDisabled.value || isReadonly.value || props.unclickable) return;
314
+ closeModal?.();
315
+ closeModal = null;
316
+ const input = document.createElement("input");
317
+ input.type = "file";
318
+ input.onchange = async (event) => {
319
+ const target = event.target;
320
+ const file = target.files?.[0];
321
+ if (!file) return;
322
+ await processFile(file);
323
+ };
324
+ input.click();
325
+ };
274
326
  if (props.autofocus !== false && props.autofocus !== void 0) useTabActiveListener(autofocusDebounced);
275
327
  watch(() => props.autofocus, (value) => {
276
328
  if (value === false || value === void 0) return;
@@ -301,7 +353,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
301
353
  class: [_ctx.$attrs.class, {
302
354
  "group/seamless": __props.seamless
303
355
  }],
304
- onClick: _cache[9] || (_cache[9] = ($event) => __props.seamless && focus())
356
+ onClick: _cache[9] || (_cache[9] = ($event) => __props.seamless && focus()),
357
+ onDrop
305
358
  }), createSlots({ _: 2 }, [
306
359
  _ctx.$slots.title ? {
307
360
  name: "title",
@@ -347,7 +400,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
347
400
  key: "2"
348
401
  } : {
349
402
  name: "field",
350
- fn: withCtx(({ id, setFocused, focused }) => [
403
+ fn: withCtx(({ id, setFocused, focused, isDragover }) => [
351
404
  createElementVNode("div", {
352
405
  class: normalizeClass(["relative isolate grid min-h-[--w-input-min-height,var(--w-input-height,2.75rem)] grid-cols-[auto,1fr,auto] overflow-hidden rounded-[--w-input-rounded,0.75rem] border border-solid", {
353
406
  "focus-within:border-primary dark:focus-within:border-primary-dark focus-within:outline-primary/20 dark:focus-within:outline-primary-dark/20 focus-within:outline focus-within:outline-2": !unref(isDisabled) && !unref(isReadonly) && !__props.unclickable,
@@ -360,13 +413,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
360
413
  }]),
361
414
  onClick: focus
362
415
  }, [
363
- !unref(isDisabled) && !unref(isReadonly) && __props.textarea && (__props.rich || __props.toolbarActions || _ctx.$slots.toolbar) ? (openBlock(), createBlock(unref(InputToolbar), {
416
+ !unref(isReadonly) && __props.textarea && (__props.rich || __props.toolbarActions || _ctx.$slots.toolbar) ? (openBlock(), createBlock(unref(InputToolbar), {
364
417
  key: 0,
365
418
  list: __props.toolbarActions,
366
419
  rich: __props.rich === true,
367
420
  "is-undo": historyPosition.value > 0,
368
421
  "is-redo": historyPosition.value < history.value.length - 1,
369
422
  "text-secure": __props.textSecure ?? false,
423
+ disabled: unref(isDisabled) === true,
370
424
  onWrapSelection: wrapSelection,
371
425
  onUndo: undo,
372
426
  onRedo: redo
@@ -375,7 +429,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
375
429
  renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps({ wrapSelection })))
376
430
  ]),
377
431
  _: 3
378
- }, 8, ["list", "rich", "is-undo", "is-redo", "text-secure"])) : createCommentVNode("", true),
432
+ }, 8, ["list", "rich", "is-undo", "is-redo", "text-secure", "disabled"])) : createCommentVNode("", true),
379
433
  __props.icon ? (openBlock(), createElementBlock("div", {
380
434
  key: 1,
381
435
  class: normalizeClass(["flex h-full w-[--w-input-height,2.75rem] select-none items-center justify-center", {
@@ -387,12 +441,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
387
441
  ], 2)) : createCommentVNode("", true),
388
442
  createElementVNode("div", {
389
443
  ref: "content",
390
- class: normalizeClass(["group/input col-start-2 grid grid-cols-1", {
444
+ class: normalizeClass(["group/input relative col-start-2 grid grid-cols-1", {
391
445
  "py-[--w-input-gap,0.25rem] first:pl-[--w-input-gap,0.25rem] last:pr-[--w-input-gap,0.25rem]": _ctx.$slots.prefix,
392
446
  "no-scrollbar overflow-x-auto overscroll-x-contain": __props.noWrap && !(__props.seamless && !focused),
393
447
  "overflow-hidden": __props.seamless && !focused
394
448
  }])
395
449
  }, [
450
+ __props.allowDropFile && unref(isDragging) ? (openBlock(), createElementBlock("div", _hoisted_1, [
451
+ createVNode(_sfc_main$2, {
452
+ animate: isDragover,
453
+ class: "w-border-svg-rounded-[--w-option-rounded]"
454
+ }, null, 8, ["animate"])
455
+ ])) : createCommentVNode("", true),
396
456
  createElementVNode("div", {
397
457
  class: normalizeClass(["w-skeleton-w-32 flex gap-[--w-input-gap,0.25rem]", {
398
458
  "[&:not(:has(.w-option-has-bg))]:-px--w-option-padding": !__props.icon && !__props.textarea,
@@ -416,15 +476,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
416
476
  "absolute": __props.hideInput
417
477
  }])
418
478
  }, [
419
- createElementVNode("div", _hoisted_1, [
479
+ createElementVNode("div", _hoisted_2, [
420
480
  renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ modelValue: __props.modelValue }))),
421
- __props.placeholder && __props.textarea && !__props.modelValue && !__props.textParts?.length ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true),
481
+ __props.placeholder && __props.textarea && hasNoValue.value ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true),
422
482
  (openBlock(), createBlock(resolveDynamicComponent(__props.textarea ? unref(ContentEditable) : "input"), {
423
483
  id,
424
484
  ref: "input",
425
485
  class: normalizeClass(["w-input sm-not:text-base min-h-full flex-1 basis-auto appearance-none border-none bg-[inherit] outline-0 placeholder:text-gray-400 disabled:cursor-not-allowed dark:placeholder:text-gray-500", {
426
486
  "w-0 max-w-0": __props.hideInput,
427
- "text-secure": __props.textSecure && !isSecureVisible.value,
487
+ "text-secure w-input-whitespace-pre-wrap break-all": __props.textSecure && !isSecureVisible.value,
428
488
  "[-webkit-text-fill-color:transparent]": __props.textTransparent
429
489
  }]),
430
490
  value: __props.placeholderSecure && __props.modelValue === void 0 && !focused ? "******" : __props.modelValue,
@@ -474,11 +534,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
474
534
  ], 2)
475
535
  ], 2)
476
536
  ], 2),
477
- !__props.seamless || focused ? (openBlock(), createBlock(_sfc_main$2, {
537
+ !__props.seamless || focused ? (openBlock(), createBlock(_sfc_main$3, {
478
538
  key: 2,
479
539
  "model-value": __props.modelValue,
480
540
  loading: __props.loading,
481
- "allow-clear": __props.allowClear && __props.modelValue !== "",
541
+ "allow-clear": __props.allowClear && !hasNoValue.value,
482
542
  disabled: unref(isDisabled) || __props.disabledActions,
483
543
  readonly: unref(isReadonly) || __props.unclickable === true,
484
544
  "text-secure": __props.textSecure,
@@ -486,13 +546,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
486
546
  "allow-paste": __props.allowPaste,
487
547
  "allow-copy": __props.allowCopy,
488
548
  focused,
549
+ "allow-drop-file": __props.allowDropFile,
550
+ textarea: __props.textarea,
489
551
  "onClick:clear": clearValue,
490
552
  "onShow:secure": _cache[7] || (_cache[7] = ($event) => {
491
553
  isSecureVisible.value = true;
492
554
  _ctx.$emit("click", $event);
493
555
  }),
494
556
  "onHide:secure": _cache[8] || (_cache[8] = ($event) => isSecureVisible.value = false),
495
- "onClick:paste": paste
557
+ "onClick:paste": paste,
558
+ "onClick:dropFile": openFilePicker
496
559
  }, createSlots({ _: 2 }, [
497
560
  _ctx.$slots.suffix ? {
498
561
  name: "default",
@@ -501,7 +564,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
501
564
  ]),
502
565
  key: "0"
503
566
  } : void 0
504
- ]), 1032, ["model-value", "loading", "allow-clear", "disabled", "readonly", "text-secure", "is-secure-visible", "allow-paste", "allow-copy", "focused"])) : createCommentVNode("", true),
567
+ ]), 1032, ["model-value", "loading", "allow-clear", "disabled", "readonly", "text-secure", "is-secure-visible", "allow-paste", "allow-copy", "focused", "allow-drop-file", "textarea"])) : createCommentVNode("", true),
505
568
  renderSlot(_ctx.$slots, "inner")
506
569
  ], 2)
507
570
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"WInputAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputAsync.vue"],"names":[],"mappings":"AA2HA;AAiRA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;yBAU3B,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAybO,mBAAmB,CAAC;;kLAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;uBA/CiB,GAAG;0BACA,GAAG;uBACN,GAAG;;;YACF,GAAG;;;YACH,GAAG;;cA/X1B,oBAAoB,SAAS,4CAAa,SAAS,KAAG,IAAI;EA8a5D,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AApczE,wBAoc4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"WInputAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputAsync.vue"],"names":[],"mappings":"AA0HA;AAgRA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;yBAU3B,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAubO,mBAAmB,CAAC;;kLAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;uBA/CiB,GAAG;0BACA,GAAG;uBACN,GAAG;;;YACF,GAAG;;;YACH,GAAG;;cA7X1B,oBAAoB,SAAS,4CAAa,SAAS,KAAG,IAAI;EA4a5D,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAlczE,wBAkc4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -4,7 +4,7 @@ import _sfc_main$1 from './WInput.vue.js';
4
4
  import { SemanticType } from '../../utils/SemanticType.js';
5
5
  import { useComponentStates } from '../../utils/useComponentStates.js';
6
6
 
7
- const _hoisted_1 = { class: "flex justify-end gap-4 pt-4" };
7
+ const _hoisted_1 = { class: "flex justify-end gap-4 pt-5" };
8
8
  const _hoisted_2 = { class: "absolute inset-x-3 bottom-[calc((var(--w-input-height)-1.75em)/2)] isolate h-0.5" };
9
9
  const _hoisted_3 = {
10
10
  key: 0,
@@ -67,7 +67,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
67
  subgrid: { type: Boolean },
68
68
  seamless: { type: Boolean },
69
69
  savedText: {},
70
- topText: { type: Boolean }
70
+ topText: { type: Boolean },
71
+ allowDropFile: { type: Boolean }
71
72
  },
72
73
  emits: ["update:model-value"],
73
74
  setup(__props, { emit: __emit }) {
@@ -159,10 +160,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
159
160
  return openBlock(), createBlock(_sfc_main$1, mergeProps({ ref: "input" }, {
160
161
  ...props,
161
162
  modelValue: value.value,
162
- disabledActions: !focused.value && !hasChangesValue.value || __props.disabledActions,
163
163
  errorMessage: errorMessageValue.value ?? __props.errorMessage,
164
164
  hasChanges: __props.hasChanges || hasChangesValue.value,
165
- allowClear: !__props.textarea || __props.allowClear,
165
+ allowClear: (!__props.textarea || __props.allowClear) && focused.value,
166
166
  loading: void 0
167
167
  }, {
168
168
  class: _ctx.$attrs.class,
@@ -64,6 +64,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
64
  seamless: { type: Boolean },
65
65
  savedText: {},
66
66
  topText: { type: Boolean },
67
+ allowDropFile: { type: Boolean },
67
68
  parentElement: {},
68
69
  dropdownClass: {},
69
70
  horizontalAlign: { default: HorizontalAlign.RIGHT_INNER },
@@ -70,6 +70,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
70
70
  seamless: { type: Boolean },
71
71
  savedText: {},
72
72
  topText: { type: Boolean },
73
+ allowDropFile: { type: Boolean },
73
74
  parentElement: {},
74
75
  dropdownClass: {},
75
76
  horizontalAlign: {},
@@ -1 +1 @@
1
-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AG,IAAI;YAC7C,aAAa,SAAS,aAAa,GAAG,IAAI;YAC1C,eAAe,SAAS,aAAa,GAAG,IAAI;YAC5C,iBAAiB,SAAS,aAAa,GAAG,IAAI;YAC9C,MAAM,GAAG,IAAI;YACb,OAAO,GAAG,IAAI;YACd,aAAa,GAAG,IAAI;YACpB,OAAO,SAAS,UAAU,GAAG,SAAS,GAAG,IAAI;YAC7C,MAAM,SAAS,UAAU,GAAG,IAAI;;EAualC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAxczE,wBAwc4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -68,6 +68,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
68
68
  seamless: { type: Boolean },
69
69
  savedText: {},
70
70
  topText: { type: Boolean },
71
+ allowDropFile: { type: Boolean },
71
72
  parentElement: {},
72
73
  dropdownClass: {},
73
74
  horizontalAlign: { default: HorizontalAlign.FILL },
@@ -167,10 +168,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
167
168
  })
168
169
  ]),
169
170
  suffix: withCtx(() => [
170
- !unref(isDisabled) ? (openBlock(), createBlock(_sfc_main$4, {
171
+ !unref(isReadonly) ? (openBlock(), createBlock(_sfc_main$4, {
171
172
  key: 0,
172
173
  label: "Show suggest",
173
174
  expanded: isOpen.value,
175
+ disabled: unref(isDisabled),
174
176
  onClick: ($event) => isOpen.value ? toggleScope.unclickable === false ? close() : blur() : focus()
175
177
  }, {
176
178
  default: withCtx(() => [
@@ -179,7 +181,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
179
181
  }, null, 8, ["class"])
180
182
  ]),
181
183
  _: 1
182
- }, 8, ["expanded", "onClick"])) : createCommentVNode("", true)
184
+ }, 8, ["expanded", "disabled", "onClick"])) : createCommentVNode("", true)
183
185
  ]),
184
186
  _: 2
185
187
  }, [
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAeA;AAwUA,OAAO,KAAK,EAAC,QAAQ,EAAG,aAAa,EAAC,MAAM,UAAU,CAAA;AAStD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B,CAAC;;;;2BAmJ4B,aAAa,KAAG,IAAI;2BATpB,MAAM,aAAa,MAAM;;wBAhB5B,MAAM;;;;;;;;;;;;;;;AAsPjC,wBAUG"}
1
+ {"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAeA;AA+WA,OAAO,KAAK,EAAC,QAAQ,EAAG,aAAa,EAAC,MAAM,UAAU,CAAA;AAStD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B,CAAC;;;;2BA0L4B,aAAa,KAAG,IAAI;2BATpB,MAAM,aAAa,MAAM;;wBAhB5B,MAAM;;;;;;;;;;;;;;;AAsPjC,wBAUG"}
@@ -74,10 +74,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
74
  return props.textParts ? textPartsToText(props.textParts) : props.value;
75
75
  };
76
76
  const lineBreakEvents = ["insertParagraph", "insertLineBreak"];
77
- const insertParagraph = (e) => {
77
+ const autoPairMap = {
78
+ "(": ")",
79
+ "[": "]",
80
+ "{": "}",
81
+ '"': '"',
82
+ "'": "'",
83
+ "`": "`"
84
+ };
85
+ const handleBeforeInput = (e) => {
78
86
  if (lineBreakEvents.includes(e.inputType)) {
79
87
  e.preventDefault();
80
- insertPlain("\n");
88
+ const { start } = getCaret();
89
+ const currentText = getCurrentText();
90
+ const lineStart = currentText.lastIndexOf("\n", start - 1) + 1;
91
+ const currentLine = currentText.slice(lineStart, start);
92
+ const leadingSpaces = currentLine.match(/^[ ]*/)?.[0] || "";
93
+ insertPlain("\n" + leadingSpaces);
94
+ return;
95
+ }
96
+ if (e.inputType === "insertText" && e.data && autoPairMap[e.data]) {
97
+ e.preventDefault();
98
+ const { start, end } = getCaret();
99
+ const currentText = getCurrentText();
100
+ const closingChar = autoPairMap[e.data];
101
+ if (start !== end) {
102
+ const before = currentText.slice(0, start);
103
+ const selected = currentText.slice(start, end);
104
+ const after = currentText.slice(end);
105
+ const newText = before + e.data + selected + closingChar + after;
106
+ emit("update:model-value", newText, true);
107
+ nextTick(() => setCaret(start + 1, end + 1));
108
+ } else {
109
+ const newText = currentText.slice(0, start) + e.data + closingChar + currentText.slice(start);
110
+ emit("update:model-value", newText, true);
111
+ nextTick(() => setCaret(start + 1));
112
+ }
81
113
  }
82
114
  };
83
115
  const regexDifferentEnding = /\r\n?/g;
@@ -251,7 +283,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
251
283
  spellcheck: "false",
252
284
  class: "relative [white-space:var(--w-input-whitespace,pre)]",
253
285
  onInput,
254
- onBeforeinput: _cache[0] || (_cache[0] = ($event) => insertParagraph($event)),
286
+ onBeforeinput: _cache[0] || (_cache[0] = ($event) => handleBeforeInput($event)),
255
287
  onKeydown: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("keydown", $event)),
256
288
  onFocus: _cache[2] || (_cache[2] = ($event) => {
257
289
  _ctx.$emit("focus", $event);
@@ -4,11 +4,13 @@ type __VLS_Props = {
4
4
  allowClear?: boolean;
5
5
  allowPaste?: boolean;
6
6
  allowCopy?: boolean;
7
+ allowDropFile?: boolean;
7
8
  disabled?: boolean;
8
9
  readonly?: boolean;
9
10
  textSecure?: boolean;
10
11
  isSecureVisible?: boolean;
11
12
  focused?: boolean;
13
+ textarea?: boolean;
12
14
  };
13
15
  declare function __VLS_template(): {
14
16
  attrs: Partial<{}>;
@@ -24,11 +26,13 @@ declare function __VLS_template(): {
24
26
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
25
27
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
26
28
  "click:paste": () => any;
29
+ "click:drop-file": () => any;
27
30
  "show:secure": (value: MouseEvent) => any;
28
31
  "hide:secure": (value: MouseEvent) => any;
29
32
  "click:clear": () => any;
30
33
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
31
34
  "onClick:paste"?: (() => any) | undefined;
35
+ "onClick:drop-file"?: (() => any) | undefined;
32
36
  "onShow:secure"?: ((value: MouseEvent) => any) | undefined;
33
37
  "onHide:secure"?: ((value: MouseEvent) => any) | undefined;
34
38
  "onClick:clear"?: (() => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"InputActions.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/InputActions.vue"],"names":[],"mappings":"AAoDA;AAuGA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AAeF,iBAAS,cAAc;WAoJT,OAAO,IAA6B;;;;;YAVpB,GAAG;;;;EAehC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"InputActions.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/InputActions.vue"],"names":[],"mappings":"AAwEA;AAgIA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAgBF,iBAAS,cAAc;WAmMT,OAAO,IAA6B;;;;;YAVpB,GAAG;;;;EAehC;AAmBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,18 +1,15 @@
1
- import { defineComponent, toRef, createElementBlock, createCommentVNode, openBlock, createBlock, renderSlot, markRaw, unref, createVNode } from 'vue';
1
+ import { defineComponent, toRef, createElementBlock, createCommentVNode, openBlock, withModifiers, normalizeClass, createBlock, renderSlot, markRaw, unref, createVNode } from 'vue';
2
2
  import WSpinner from '../../Spinner/WSpinner.vue.js';
3
3
  import IconClose from '../../../assets/icons/IconClose.svg.js';
4
4
  import IconEye from '../../../assets/icons/IconEye.svg.js';
5
5
  import IconEyeSlash from '../../../assets/icons/IconEyeSlash.svg.js';
6
6
  import IconPaste from '../../../assets/icons/IconPaste.svg.js';
7
+ import IconUpload from '../../../assets/icons/IconUpload.svg.js';
7
8
  import { useCopy } from '../../../utils/useCopy.js';
8
9
  import _sfc_main$1 from './InputActionsButton.vue.js';
9
10
 
10
11
  const _hoisted_1 = {
11
- key: 0,
12
- class: "bg-default dark:bg-default-dark flex overflow-hidden rounded-[--w-input-rounded,0.75rem]"
13
- };
14
- const _hoisted_2 = {
15
- key: 4,
12
+ key: 5,
16
13
  class: "text-description flex h-full w-11 cursor-progress items-center justify-center"
17
14
  };
18
15
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -23,55 +20,79 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
20
  allowClear: { type: Boolean },
24
21
  allowPaste: { type: Boolean },
25
22
  allowCopy: { type: Boolean },
23
+ allowDropFile: { type: Boolean },
26
24
  disabled: { type: Boolean },
27
25
  readonly: { type: Boolean },
28
26
  textSecure: { type: Boolean },
29
27
  isSecureVisible: { type: Boolean },
30
- focused: { type: Boolean }
28
+ focused: { type: Boolean },
29
+ textarea: { type: Boolean }
31
30
  },
32
- emits: ["click:paste", "show:secure", "hide:secure", "click:clear"],
31
+ emits: ["click:paste", "click:drop-file", "show:secure", "hide:secure", "click:clear"],
33
32
  setup(__props) {
34
33
  const props = __props;
35
34
  const { doCopy, iconCopy } = useCopy(toRef(props, "modelValue"));
36
35
  return (_ctx, _cache) => {
37
- return __props.loading || _ctx.$slots.default || __props.textSecure || __props.allowCopy || (__props.allowPaste || __props.allowClear) && !__props.disabled && !__props.readonly ? (openBlock(), createElementBlock("div", _hoisted_1, [
38
- __props.allowClear && !__props.disabled && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
36
+ return __props.loading || _ctx.$slots.default || __props.textSecure || __props.allowCopy || (__props.allowPaste || __props.allowClear || __props.allowDropFile) && !__props.disabled && !__props.readonly ? (openBlock(), createElementBlock("div", {
37
+ key: 0,
38
+ class: normalizeClass(["bg-default dark:bg-default-dark flex overflow-hidden rounded-[--w-input-rounded,0.75rem]", {
39
+ "flex-col": __props.textarea
40
+ }]),
41
+ onMousedown: _cache[4] || (_cache[4] = withModifiers(() => {
42
+ }, ["prevent", "stop"]))
43
+ }, [
44
+ __props.allowClear && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
39
45
  key: 0,
40
46
  icon: markRaw(unref(IconClose)),
47
+ disabled: __props.disabled,
48
+ "tooltip-right": __props.textarea,
41
49
  "tooltip-text": "Clear",
42
50
  top: "",
43
51
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click:clear"))
44
- }, null, 8, ["icon"])) : createCommentVNode("", true),
52
+ }, null, 8, ["icon", "disabled", "tooltip-right"])) : createCommentVNode("", true),
45
53
  __props.allowCopy && !__props.textSecure ? (openBlock(), createBlock(_sfc_main$1, {
46
54
  key: 1,
47
55
  icon: markRaw(unref(iconCopy)),
56
+ "tooltip-right": __props.textarea,
48
57
  "tooltip-text": "Copy",
49
58
  top: "",
50
59
  onClick: unref(doCopy)
51
- }, null, 8, ["icon", "onClick"])) : createCommentVNode("", true),
52
- __props.allowPaste && !__props.disabled && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
60
+ }, null, 8, ["icon", "tooltip-right", "onClick"])) : createCommentVNode("", true),
61
+ __props.allowPaste && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
53
62
  key: 2,
54
63
  icon: markRaw(unref(IconPaste)),
64
+ disabled: __props.disabled,
65
+ "tooltip-right": __props.textarea,
55
66
  "tooltip-text": "Paste",
56
67
  top: "",
57
68
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click:paste"))
58
- }, null, 8, ["icon"])) : createCommentVNode("", true),
59
- __props.textSecure ? (openBlock(), createBlock(_sfc_main$1, {
69
+ }, null, 8, ["icon", "disabled", "tooltip-right"])) : createCommentVNode("", true),
70
+ __props.allowDropFile && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
60
71
  key: 3,
72
+ icon: markRaw(unref(IconUpload)),
73
+ disabled: __props.disabled,
74
+ "tooltip-right": __props.textarea,
75
+ "tooltip-text": "Read from file",
76
+ top: "",
77
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("click:drop-file"))
78
+ }, null, 8, ["icon", "disabled", "tooltip-right"])) : createCommentVNode("", true),
79
+ __props.textSecure ? (openBlock(), createBlock(_sfc_main$1, {
80
+ key: 4,
61
81
  icon: __props.isSecureVisible ? markRaw(unref(IconEye)) : markRaw(unref(IconEyeSlash)),
62
82
  "tooltip-text": __props.isSecureVisible ? "Hide" : "Show",
63
83
  disabled: __props.disabled || __props.readonly,
84
+ "tooltip-right": __props.textarea,
64
85
  top: "",
65
- onClick: _cache[2] || (_cache[2] = ($event) => __props.isSecureVisible ? _ctx.$emit("hide:secure", $event) : _ctx.$emit("show:secure", $event))
66
- }, null, 8, ["icon", "tooltip-text", "disabled"])) : createCommentVNode("", true),
67
- __props.loading ? (openBlock(), createElementBlock("div", _hoisted_2, [
86
+ onClick: _cache[3] || (_cache[3] = ($event) => __props.isSecureVisible ? _ctx.$emit("hide:secure", $event) : _ctx.$emit("show:secure", $event))
87
+ }, null, 8, ["icon", "tooltip-text", "disabled", "tooltip-right"])) : createCommentVNode("", true),
88
+ __props.loading ? (openBlock(), createElementBlock("div", _hoisted_1, [
68
89
  createVNode(WSpinner, { class: "w-spinner-size-[1.125em]" })
69
90
  ])) : createCommentVNode("", true),
70
91
  renderSlot(_ctx.$slots, "default", {
71
92
  loading: __props.loading,
72
93
  disabled: __props.disabled
73
94
  })
74
- ])) : createCommentVNode("", true);
95
+ ], 34)) : createCommentVNode("", true);
75
96
  };
76
97
  }
77
98
  });
@@ -1,5 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  tooltipText?: string;
3
+ tooltipRight?: boolean;
3
4
  disabled?: boolean;
4
5
  icon?: SVGComponent;
5
6
  top?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"InputActionsButton.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/InputActionsButton.vue"],"names":[],"mappings":"AA+BA;AA6DA,KAAK,WAAW,GAAG;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA0BJ,iBAAS,cAAc;WA4DT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WA1GT,MAAM;UAFP,YAAY;iBAFL,MAAM;aAKV,OAAO;cACN,OAAO;2FAiHpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"InputActionsButton.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/InputActionsButton.vue"],"names":[],"mappings":"AA+BA;AA8DA,KAAK,WAAW,GAAG;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA0BJ,iBAAS,cAAc;WA6DT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WA3GT,MAAM;UAFP,YAAY;iBAHL,MAAM;aAMV,OAAO;cACN,OAAO;2FAkHpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -6,6 +6,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "InputActionsButton",
7
7
  props: {
8
8
  tooltipText: { default: void 0 },
9
+ tooltipRight: { type: Boolean },
9
10
  disabled: { type: Boolean },
10
11
  icon: { default: void 0 },
11
12
  top: { type: Boolean },
@@ -28,9 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
29
  "aria-disabled": __props.disabled,
29
30
  "aria-pressed": __props.pressed,
30
31
  "aria-expanded": __props.expanded,
31
- onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
32
- }, ["prevent", "stop"])),
33
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.$emit("click", $event), ["stop"]))
32
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("click", $event), ["stop"]))
34
33
  }, [
35
34
  renderSlot(_ctx.$slots, "default", {}, () => [
36
35
  (openBlock(), createBlock(resolveDynamicComponent(__props.icon), { class: "square-[1.125em]" }))
@@ -38,9 +37,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
37
  __props.tooltipText && !__props.disabled ? (openBlock(), createBlock(_sfc_main$1, {
39
38
  key: 0,
40
39
  text: __props.tooltipText,
40
+ right: __props.tooltipRight,
41
41
  "no-touch": ""
42
- }, null, 8, ["text"])) : createCommentVNode("", true)
43
- ], 42, _hoisted_1);
42
+ }, null, 8, ["text", "right"])) : createCommentVNode("", true)
43
+ ], 10, _hoisted_1);
44
44
  };
45
45
  }
46
46
  });
@@ -5,6 +5,7 @@ type __VLS_Props = {
5
5
  isUndo: boolean;
6
6
  isRedo: boolean;
7
7
  textSecure: boolean;
8
+ disabled: boolean;
8
9
  };
9
10
  declare function __VLS_template(): {
10
11
  attrs: Partial<{}>;
@@ -1 +1 @@
1
- {"version":3,"file":"InputToolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/InputToolbar.vue"],"names":[],"mappings":"AA2CA;AA2EA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAA;AAU1E,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;IACjC,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;AAiBF,iBAAS,cAAc;WA4HT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;6FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"InputToolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/InputToolbar.vue"],"names":[],"mappings":"AA6CA;AA8EA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAA;AAU1E,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;IACjC,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AAiBF,iBAAS,cAAc;WAgIT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;6FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EA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