fds-vue-core 7.0.1 → 7.1.0
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 +21 -2
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +21 -2
- package/dist/fds-vue-core.es.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/FdsSearchSelectPro/FdsSearchSelectPro.vue +1 -1
- package/src/components/Form/FdsInput/FdsInput.stories.ts +20 -0
- package/src/components/Form/FdsInput/FdsInput.vue +15 -0
- package/src/lang/en.json +1 -0
- package/src/lang/sv.json +1 -0
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -44,6 +44,7 @@ const en = {
|
|
|
44
44
|
"FdsInput.hidePassword": "Hide",
|
|
45
45
|
"FdsInput.openDatePicker": "Open date picker",
|
|
46
46
|
"FdsInput.showPassword": "Show",
|
|
47
|
+
"FdsInput.today": "(today)",
|
|
47
48
|
"FdsListHeading.loading": "Loading...",
|
|
48
49
|
"FdsListHeading.separator": "of",
|
|
49
50
|
"FdsModal.closeModal": "Close modal window",
|
|
@@ -68,6 +69,7 @@ const sv = {
|
|
|
68
69
|
"FdsInput.hidePassword": "Dölj",
|
|
69
70
|
"FdsInput.openDatePicker": "Öppna datumväljare",
|
|
70
71
|
"FdsInput.showPassword": "Visa",
|
|
72
|
+
"FdsInput.today": "(idag)",
|
|
71
73
|
"FdsListHeading.loading": "Laddar...",
|
|
72
74
|
"FdsListHeading.separator": "av",
|
|
73
75
|
"FdsModal.closeModal": "Stäng dialogruta",
|
|
@@ -8636,6 +8638,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
8636
8638
|
const passwordButtonShowLabel = vue.computed(() => t("FdsInput.showPassword"));
|
|
8637
8639
|
const passwordButtonHideLabel = vue.computed(() => t("FdsInput.hidePassword"));
|
|
8638
8640
|
const dateButtonLabel = vue.computed(() => t("FdsInput.openDatePicker"));
|
|
8641
|
+
const todayLabel = vue.computed(() => t("FdsInput.today"));
|
|
8639
8642
|
const showInvalidMessage = vue.computed(() => props.valid === false && !props.optional && props.invalidMessage);
|
|
8640
8643
|
const isInvalid = vue.computed(() => props.valid === false && !props.optional && !props.disabled);
|
|
8641
8644
|
const isValid2 = vue.computed(() => props.valid === true);
|
|
@@ -8645,6 +8648,17 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
8645
8648
|
const showClearButton = vue.computed(() => props.clearButton && !!internalValue.value && !props.disabled);
|
|
8646
8649
|
const showValidationIcon = vue.computed(() => isInvalid.value || isValid2.value);
|
|
8647
8650
|
const showDateIcon = vue.computed(() => inputType.value === "date");
|
|
8651
|
+
const todayIsoDate = vue.computed(() => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10));
|
|
8652
|
+
const showTodaySuffixInField = vue.computed(
|
|
8653
|
+
() => inputType.value === "date" && String(internalValue.value ?? "") === todayIsoDate.value
|
|
8654
|
+
);
|
|
8655
|
+
const todaySuffixClasses = vue.computed(() => [
|
|
8656
|
+
"pointer-events-none absolute top-1/2 -translate-y-1/2 text-base leading-6",
|
|
8657
|
+
props.disabled ? "text-gray-800" : "text-gray-900"
|
|
8658
|
+
]);
|
|
8659
|
+
const todaySuffixStyle = vue.computed(() => ({
|
|
8660
|
+
left: "calc(0.75rem + 10ch + 0.25rem)"
|
|
8661
|
+
}));
|
|
8648
8662
|
const rightIconCount = vue.computed(() => {
|
|
8649
8663
|
let count = 0;
|
|
8650
8664
|
if (showDateIcon.value) count++;
|
|
@@ -8895,7 +8909,12 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
8895
8909
|
text: showPassword.value ? passwordButtonHideLabel.value : passwordButtonShowLabel.value,
|
|
8896
8910
|
onClick: toggleShowPassword
|
|
8897
8911
|
}, null, 8, ["icon", "text"])) : vue.createCommentVNode("", true)
|
|
8898
|
-
], 2)
|
|
8912
|
+
], 2),
|
|
8913
|
+
showTodaySuffixInField.value ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
8914
|
+
key: 0,
|
|
8915
|
+
class: vue.normalizeClass(todaySuffixClasses.value),
|
|
8916
|
+
style: vue.normalizeStyle(todaySuffixStyle.value)
|
|
8917
|
+
}, vue.toDisplayString(todayLabel.value), 7)) : vue.createCommentVNode("", true)
|
|
8899
8918
|
])
|
|
8900
8919
|
], 2)
|
|
8901
8920
|
], 2),
|
|
@@ -12024,7 +12043,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
12024
12043
|
mask: pidMask.value,
|
|
12025
12044
|
maskOptions: { lazy: true }
|
|
12026
12045
|
}, inputAriaAttrs.value, {
|
|
12027
|
-
searchIcon: !__props.disabled && inputHasFocus.value && !hasInputValue.value && !hasSelection.value,
|
|
12046
|
+
searchIcon: !__props.disabled && !inputHasFocus.value && !hasInputValue.value && !hasSelection.value && !dropdownVisible.value,
|
|
12028
12047
|
onInput: handleInput,
|
|
12029
12048
|
onClearInput: handleClear
|
|
12030
12049
|
}), null, 16, ["label", "meta", "labelLeft", "valid", "invalidMessage", "disabled", "value", "clearButton", "mask", "searchIcon"])
|