eco-vue-js 0.11.64 → 0.11.65

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 +1 @@
1
- {"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"AAoQA;AAgmBA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AActD,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAA;yBAE9B,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;WA61BO,mBAAmB,CAAC;;;;;;;;;;;;;;2XAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;qBAzoB7B,IAAI;oBAOL,IAAI;+BA6DS,aAAa;0BA5NlB,MAAM,QAAQ,MAAM,KAAG,IAAI;wBAR/B,WAAW;;;oBAkDf,IAAI;oBAgBJ,IAAI;MAuuBgD,GAAG,IAAI;WACpE,GAAG;;uBAjEgB,GAAG;0BACA,GAAG;wBACJ,GAAG;;;YAGH,GAAG;;;YAFH,GAAG;;;YAGH,GAAG;;mCA3gBF,aAAa;YAygBb,GAAG;uBAGL,GAAG;;;;YACF,GAAG;uBACJ,GAAG;uBACH,GAAG;wBACF,GAAG;;;YA9wB1B,oBAAoB,SAAS,4CAAa,SAAS,GAAG,IAAI;YAC1D,gBAAgB,SAAS,aAAa,GAAG,IAAI;YAC7C,aAAa,SAAS,aAA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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, 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';
@@ -82,6 +82,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
82
82
  const isSecureVisible = ref(false);
83
83
  const history = ref([]);
84
84
  const historyPosition = ref(-1);
85
+ const hasNoValue = computed(() => !props.modelValue && !props.textParts?.length && !props.placeholderSecure);
85
86
  const getCaret = () => {
86
87
  if (!inputRef.value) return { start: 0, end: 0 };
87
88
  if ("getCaret" in inputRef.value) return inputRef.value.getCaret();
@@ -360,13 +361,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
360
361
  }]),
361
362
  onClick: focus
362
363
  }, [
363
- !unref(isDisabled) && !unref(isReadonly) && __props.textarea && (__props.rich || __props.toolbarActions || _ctx.$slots.toolbar) ? (openBlock(), createBlock(unref(InputToolbar), {
364
+ !unref(isReadonly) && __props.textarea && (__props.rich || __props.toolbarActions || _ctx.$slots.toolbar) ? (openBlock(), createBlock(unref(InputToolbar), {
364
365
  key: 0,
365
366
  list: __props.toolbarActions,
366
367
  rich: __props.rich === true,
367
368
  "is-undo": historyPosition.value > 0,
368
369
  "is-redo": historyPosition.value < history.value.length - 1,
369
370
  "text-secure": __props.textSecure ?? false,
371
+ disabled: unref(isDisabled) === true,
370
372
  onWrapSelection: wrapSelection,
371
373
  onUndo: undo,
372
374
  onRedo: redo
@@ -375,7 +377,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
375
377
  renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps({ wrapSelection })))
376
378
  ]),
377
379
  _: 3
378
- }, 8, ["list", "rich", "is-undo", "is-redo", "text-secure"])) : createCommentVNode("", true),
380
+ }, 8, ["list", "rich", "is-undo", "is-redo", "text-secure", "disabled"])) : createCommentVNode("", true),
379
381
  __props.icon ? (openBlock(), createElementBlock("div", {
380
382
  key: 1,
381
383
  class: normalizeClass(["flex h-full w-[--w-input-height,2.75rem] select-none items-center justify-center", {
@@ -418,7 +420,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
418
420
  }, [
419
421
  createElementVNode("div", _hoisted_1, [
420
422
  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),
423
+ __props.placeholder && __props.textarea && hasNoValue.value ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true),
422
424
  (openBlock(), createBlock(resolveDynamicComponent(__props.textarea ? unref(ContentEditable) : "input"), {
423
425
  id,
424
426
  ref: "input",
@@ -478,7 +480,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
478
480
  key: 2,
479
481
  "model-value": __props.modelValue,
480
482
  loading: __props.loading,
481
- "allow-clear": __props.allowClear && __props.modelValue !== "",
483
+ "allow-clear": __props.allowClear && !hasNoValue.value,
482
484
  disabled: unref(isDisabled) || __props.disabledActions,
483
485
  readonly: unref(isReadonly) || __props.unclickable === true,
484
486
  "text-secure": __props.textSecure,
@@ -1 +1 @@
1
- {"version":3,"file":"WInputAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputAsync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C,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"}
@@ -159,10 +159,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
159
159
  return openBlock(), createBlock(_sfc_main$1, mergeProps({ ref: "input" }, {
160
160
  ...props,
161
161
  modelValue: value.value,
162
- disabledActions: !focused.value && !hasChangesValue.value || __props.disabledActions,
163
162
  errorMessage: errorMessageValue.value ?? __props.errorMessage,
164
163
  hasChanges: __props.hasChanges || hasChangesValue.value,
165
- allowClear: !__props.textarea || __props.allowClear,
164
+ allowClear: (!__props.textarea || __props.allowClear) && focused.value,
166
165
  loading: void 0
167
166
  }, {
168
167
  class: _ctx.$attrs.class,
@@ -1 +1 @@
1
- {"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"AAwIA;AAsPA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAE7D,OAAO,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AAa,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"}
@@ -167,10 +167,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
167
167
  })
168
168
  ]),
169
169
  suffix: withCtx(() => [
170
- !unref(isDisabled) ? (openBlock(), createBlock(_sfc_main$4, {
170
+ !unref(isReadonly) ? (openBlock(), createBlock(_sfc_main$4, {
171
171
  key: 0,
172
172
  label: "Show suggest",
173
173
  expanded: isOpen.value,
174
+ disabled: unref(isDisabled),
174
175
  onClick: ($event) => isOpen.value ? toggleScope.unclickable === false ? close() : blur() : focus()
175
176
  }, {
176
177
  default: withCtx(() => [
@@ -179,7 +180,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
179
180
  }, null, 8, ["class"])
180
181
  ]),
181
182
  _: 1
182
- }, 8, ["expanded", "onClick"])) : createCommentVNode("", true)
183
+ }, 8, ["expanded", "disabled", "onClick"])) : createCommentVNode("", true)
183
184
  ]),
184
185
  _: 2
185
186
  }, [
@@ -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);
@@ -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":"AAsDA;AAyGA,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;WAwJT,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"}
@@ -35,13 +35,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
35
35
  const { doCopy, iconCopy } = useCopy(toRef(props, "modelValue"));
36
36
  return (_ctx, _cache) => {
37
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, {
38
+ __props.allowClear && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
39
39
  key: 0,
40
40
  icon: markRaw(unref(IconClose)),
41
+ disabled: __props.disabled,
41
42
  "tooltip-text": "Clear",
42
43
  top: "",
43
44
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click:clear"))
44
- }, null, 8, ["icon"])) : createCommentVNode("", true),
45
+ }, null, 8, ["icon", "disabled"])) : createCommentVNode("", true),
45
46
  __props.allowCopy && !__props.textSecure ? (openBlock(), createBlock(_sfc_main$1, {
46
47
  key: 1,
47
48
  icon: markRaw(unref(iconCopy)),
@@ -49,13 +50,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
50
  top: "",
50
51
  onClick: unref(doCopy)
51
52
  }, null, 8, ["icon", "onClick"])) : createCommentVNode("", true),
52
- __props.allowPaste && !__props.disabled && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
53
+ __props.allowPaste && !__props.readonly ? (openBlock(), createBlock(_sfc_main$1, {
53
54
  key: 2,
54
55
  icon: markRaw(unref(IconPaste)),
56
+ disabled: __props.disabled,
55
57
  "tooltip-text": "Paste",
56
58
  top: "",
57
59
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click:paste"))
58
- }, null, 8, ["icon"])) : createCommentVNode("", true),
60
+ }, null, 8, ["icon", "disabled"])) : createCommentVNode("", true),
59
61
  __props.textSecure ? (openBlock(), createBlock(_sfc_main$1, {
60
62
  key: 3,
61
63
  icon: __props.isSecureVisible ? markRaw(unref(IconEye)) : markRaw(unref(IconEyeSlash)),
@@ -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,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -11,7 +11,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  rich: { type: Boolean },
12
12
  isUndo: { type: Boolean },
13
13
  isRedo: { type: Boolean },
14
- textSecure: { type: Boolean }
14
+ textSecure: { type: Boolean },
15
+ disabled: { type: Boolean }
15
16
  },
16
17
  emits: ["wrap-selection", "undo", "redo"],
17
18
  setup(__props, { emit: __emit }) {
@@ -29,25 +30,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
30
  renderSlot(_ctx.$slots, "default"),
30
31
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (action, index) => {
31
32
  return openBlock(), createBlock(_sfc_main$1, mergeProps({ key: index }, { ref_for: true }, action, {
33
+ disabled: __props.disabled,
32
34
  onClick: ($event) => wrapSelection(action, $event)
33
- }), null, 16, ["onClick"]);
35
+ }), null, 16, ["disabled", "onClick"]);
34
36
  }), 128)),
35
37
  __props.rich ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(toolbarActionList), (action, index) => {
36
38
  return openBlock(), createBlock(_sfc_main$1, mergeProps({ key: index }, { ref_for: true }, action, {
39
+ disabled: __props.disabled,
37
40
  onClick: ($event) => wrapSelection(action, $event)
38
- }), null, 16, ["onClick"]);
41
+ }), null, 16, ["disabled", "onClick"]);
39
42
  }), 128)) : createCommentVNode("", true),
40
43
  !__props.textSecure ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
41
44
  createVNode(_sfc_main$1, {
42
45
  tooltip: "Undo",
43
46
  icon: markRaw(unref(IconUndo)),
44
- disabled: !__props.isUndo,
47
+ disabled: !__props.isUndo || __props.disabled,
45
48
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("undo"))
46
49
  }, null, 8, ["icon", "disabled"]),
47
50
  createVNode(_sfc_main$1, {
48
51
  tooltip: "Redo",
49
52
  icon: markRaw(unref(IconRedo)),
50
- disabled: !__props.isRedo,
53
+ disabled: !__props.isRedo || __props.disabled,
51
54
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("redo"))
52
55
  }, null, 8, ["icon", "disabled"])
53
56
  ], 64)) : createCommentVNode("", true)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.11.64",
7
+ "version": "0.11.65",
8
8
  "dependencies": {
9
9
  "@stylistic/eslint-plugin": "5.6.1",
10
10
  "@tanstack/eslint-plugin-query": "5.91.2",