edvoyui-component-library-test-flight 0.0.211 → 0.0.213

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.
@@ -14,15 +14,18 @@
14
14
  :class="[
15
15
  'relative',
16
16
  {
17
- 'pointer-events-none cursor-not-allowed':
18
- disabled || isInlineEditReadonly,
17
+ 'pointer-events-none': isNonEditable,
19
18
  },
20
19
  {
21
- 'h-14 rounded-2xl focus-within:border-purple-600 focus-within:ring-1 focus-within:ring-purple-600 border border-gray-200':
22
- inputFilled,
20
+ 'h-14 rounded-2xl border border-gray-200': inputFilled,
21
+ },
22
+ {
23
+ 'focus-within:border-purple-600 focus-within:ring-1 focus-within:ring-purple-600':
24
+ inputFilled && !isNonEditable,
23
25
  },
24
26
  {'border-transparent focus-within:border-transparent focus-within:ring-0': inlineEditButton && isInlineEditReadonly},
25
- 'group cursor-pointer relative w-full mb-2 overflow-hidden',
27
+ 'group relative w-full mb-2 overflow-hidden',
28
+ isNonEditable ? 'cursor-not-allowed' : 'cursor-pointer',
26
29
  ]"
27
30
  >
28
31
  <button
@@ -55,7 +58,8 @@
55
58
  : 'top-1/2 text-sm w-full text-gray-700 cursor-pointer h-14 pt-5 pb-4',
56
59
  disabled ? 'cursor-not-allowed bg-gray-50 z-10' : 'z-0 bg-white',
57
60
  required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
58
- 'absolute font-medium left-0 px-4 -translate-y-1/2 duration-300 group-focus-within:top-3.5 group-focus-within:text-xs group-focus-within:text-gray-400 rounded-2xl group-focus-within:bg-transparent group-focus-within:-translate-y-1/2 group-focus-within:ring-transparent group-focus-within:h-auto group-focus-within:py-0 first-letter:capitalize transition-all ease-in-out',
61
+ !isNonEditable && 'group-focus-within:top-3.5 group-focus-within:text-xs group-focus-within:text-gray-400 group-focus-within:bg-transparent group-focus-within:-translate-y-1/2 group-focus-within:ring-transparent group-focus-within:h-auto group-focus-within:py-0',
62
+ 'absolute font-medium left-0 px-4 -translate-y-1/2 duration-300 rounded-2xl first-letter:capitalize transition-all ease-in-out',
59
63
  ]"
60
64
  >
61
65
  {{ label || "Label" }}
@@ -82,12 +86,14 @@
82
86
  'z-10 block placeholder:text-gray-400 focus:outline-none text-sm font-medium appearance-none disabled:opacity-75 autofill:bg-white leading-6 transition-all duration-100 border-none outline-none',
83
87
  inputFilled
84
88
  ? 'pt-6 pb-3 rounded-2xl size-full'
85
- : 'py-3 h-10 w-full ring-1 ring-gray-200 focus-within:ring-purple-600 focus-within:ring-2 ring-inset',
89
+ : isNonEditable
90
+ ? 'py-3 h-10 w-full ring-1 ring-gray-200 ring-inset'
91
+ : 'py-3 h-10 w-full ring-1 ring-gray-200 focus-within:ring-purple-600 focus-within:ring-2 ring-inset',
86
92
  !inputFilled && rounded ? 'rounded-2xl' : 'rounded-md',
87
- disabled ? 'cursor-not-allowed' : 'cursor-text',
93
+ isNonEditable ? 'cursor-not-allowed' : 'cursor-text',
88
94
  getIconClass(),
89
95
  !inputFilled && className,
90
- 'pr-8',
96
+ {'pr-8': type === 'search'}
91
97
  ]"
92
98
  :required="required"
93
99
  :disabled="disabled"
@@ -231,6 +237,13 @@ const isInlineEditReadonly = computed(() => {
231
237
  return props.inlineEdit && props.readonly && !props.edit;
232
238
  });
233
239
 
240
+ // Disabled and (non-edit) readonly inputs are static display values, not editable
241
+ // fields. A readonly <input> stays focusable (unlike disabled), so without this
242
+ // guard it still triggers the purple focus-within ring and the floating-label
243
+ // animation on click/tab — making it look editable. Treat both states the same
244
+ // everywhere below. Inline-edit fields stay editable once `edit` is on.
245
+ const isNonEditable = computed(() => props.disabled || (props.readonly && !props.edit));
246
+
234
247
  const inlineEditButton = computed(() => {
235
248
  return props.inlineEdit && props.editIcon && (props.readonly || props.edit);
236
249
  });