edvoyui-component-library-test-flight 0.0.210 → 0.0.212

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
  });
@@ -34,6 +34,7 @@ declare const _default: import('../../../node_modules/vue').DefineComponent<impo
34
34
  };
35
35
  }>, {
36
36
  closeModal: () => void;
37
+ dismissModal: () => void;
37
38
  slideClass: import('../../../node_modules/vue').ComputedRef<string>;
38
39
  }, {}, {}, {}, import('../../../node_modules/vue').ComponentOptionsMixin, import('../../../node_modules/vue').ComponentOptionsMixin, ("update:isVisible" | "confirm")[], "update:isVisible" | "confirm", import('../../../node_modules/vue').PublicProps, Readonly<import('../../../node_modules/vue').ExtractPropTypes<{
39
40
  isVisible: {
@@ -44,7 +44,7 @@
44
44
  <button
45
45
  type="button"
46
46
  class="flex items-center justify-center text-gray-400 bg-white hover:bg-gray-50 rounded-3xl hover:text-gray-600 size-8"
47
- @click="closeModal"
47
+ @click="dismissModal"
48
48
  >
49
49
  <span class="sr-only">Close</span>
50
50
  <svg
@@ -84,7 +84,7 @@
84
84
  class="sticky bottom-0 flex items-center justify-end float-none p-4 space-x-2"
85
85
  >
86
86
  <button
87
- @click="closeModal"
87
+ @click="dismissModal"
88
88
  class="px-4 py-2 text-base font-semibold tracking-wide text-gray-600 transition-colors duration-75 bg-white rounded-md hover:bg-gray-100"
89
89
  >
90
90
  Cancel
@@ -166,11 +166,18 @@ export default defineComponent({
166
166
  });
167
167
 
168
168
  // Methods
169
+ // Accidental dismissal (backdrop click / Esc) — suppressed when persistent.
169
170
  const closeModal = () => {
170
171
  if (!props.persistent) {
171
172
  emit("update:isVisible", false);
172
173
  }
173
174
  };
175
+ // Explicit close affordances (the X button and default Cancel) always
176
+ // dismiss, even when persistent. `persistent` only guards against the
177
+ // accidental backdrop/Esc dismissal handled by closeModal.
178
+ const dismissModal = () => {
179
+ emit("update:isVisible", false);
180
+ };
174
181
  const handleKeydown = (event: KeyboardEvent) => {
175
182
  if (event.key === "Escape" && props.isVisible && !props.persistent) {
176
183
  closeModal();
@@ -194,6 +201,7 @@ export default defineComponent({
194
201
  });
195
202
  return {
196
203
  closeModal,
204
+ dismissModal,
197
205
  slideClass,
198
206
  };
199
207
  },