fds-vue-core 2.1.52 → 2.1.53
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/fds-vue-core.cjs.js
CHANGED
|
@@ -7939,10 +7939,28 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7939
7939
|
const showPasswordToggle = vue.computed(
|
|
7940
7940
|
() => inputType.value === "password" && internalValue.value !== void 0 && internalValue.value !== null && String(internalValue.value).length > 0
|
|
7941
7941
|
);
|
|
7942
|
+
const showClearButton = vue.computed(() => props.clearButton && !!internalValue.value && !props.disabled);
|
|
7943
|
+
const showValidationIcon = vue.computed(() => isInvalid.value || isValid.value);
|
|
7944
|
+
const rightIconCount = vue.computed(() => {
|
|
7945
|
+
let count = 0;
|
|
7946
|
+
if (showValidationIcon.value) count++;
|
|
7947
|
+
if (showClearButton.value) count++;
|
|
7948
|
+
if (showPasswordToggle.value) count += 3;
|
|
7949
|
+
return count;
|
|
7950
|
+
});
|
|
7951
|
+
const inputPaddingRight = vue.computed(() => {
|
|
7952
|
+
if (rightIconCount.value === 0) return "";
|
|
7953
|
+
if (rightIconCount.value === 1) return "pr-12";
|
|
7954
|
+
if (rightIconCount.value === 2) return "pr-20";
|
|
7955
|
+
if (rightIconCount.value === 3) return "pr-24";
|
|
7956
|
+
if (rightIconCount.value === 4) return "pr-32";
|
|
7957
|
+
return "pr-40";
|
|
7958
|
+
});
|
|
7942
7959
|
const externalClass = vue.computed(() => props.class ?? attrs.class);
|
|
7943
7960
|
const inputClasses = vue.computed(() => [
|
|
7944
7961
|
"block rounded-md border border-gray-500 px-3 py-[calc(0.75rem-1px)]",
|
|
7945
7962
|
maxlength.value ? "" : "w-full",
|
|
7963
|
+
inputPaddingRight.value,
|
|
7946
7964
|
"focus:outline-2 focus:outline-blue-500 -outline-offset-2 focus:border-transparent",
|
|
7947
7965
|
props.disabled ? "text-gray-600 outline-dashed outline-2 outline-gray-400 cursor-not-allowed border-transparent" : "bg-white",
|
|
7948
7966
|
isInvalid.value && "outline-2 outline-red-600"
|
|
@@ -7956,7 +7974,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7956
7974
|
}
|
|
7957
7975
|
return {};
|
|
7958
7976
|
});
|
|
7959
|
-
const
|
|
7977
|
+
const rightIconsContainerClasses = vue.computed(() => [
|
|
7960
7978
|
"absolute flex gap-2 right-4 top-1/2 -translate-y-1/2 flex items-center justify-end"
|
|
7961
7979
|
]);
|
|
7962
7980
|
const internalValue = vue.computed({
|
|
@@ -8098,7 +8116,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
8098
8116
|
})
|
|
8099
8117
|
}), null, 16, _hoisted_3$7),
|
|
8100
8118
|
vue.createElementVNode("div", {
|
|
8101
|
-
class: vue.normalizeClass(
|
|
8119
|
+
class: vue.normalizeClass(rightIconsContainerClasses.value)
|
|
8102
8120
|
}, [
|
|
8103
8121
|
isInvalid.value ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
|
|
8104
8122
|
key: 0,
|
|
@@ -8109,7 +8127,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
8109
8127
|
key: 1,
|
|
8110
8128
|
name: "bigSuccess"
|
|
8111
8129
|
})) : vue.createCommentVNode("", true),
|
|
8112
|
-
|
|
8130
|
+
showClearButton.value ? (vue.openBlock(), vue.createBlock(_sfc_main$v, vue.mergeProps({
|
|
8113
8131
|
key: 2,
|
|
8114
8132
|
icon: "cross"
|
|
8115
8133
|
}, { "aria-label": clearButtonLabel.value }, { onClick: onClear }), null, 16)) : vue.createCommentVNode("", true),
|