fds-vue-core 7.0.1 → 7.1.1
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 +36 -4
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +36 -4
- package/dist/fds-vue-core.es.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/FdsSearchSelectPro/FdsSearchSelectPro.vue +1 -1
- package/src/components/FdsWeekCalendar/WeekDay.vue +16 -1
- package/src/components/FdsWizard/FdsWizard.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"])
|
|
@@ -14753,7 +14772,7 @@ const checkIfDateIsBeforeToday = (date) => {
|
|
|
14753
14772
|
return isAfter(startOfToday, startOfDate);
|
|
14754
14773
|
};
|
|
14755
14774
|
const checkIfDateIsEnabled = (date, enabledDates) => enabledDates.some((enabledDate) => isSameDay(enabledDate, date));
|
|
14756
|
-
const _hoisted_1$6 = ["disabled"];
|
|
14775
|
+
const _hoisted_1$6 = ["disabled", "aria-label"];
|
|
14757
14776
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
14758
14777
|
__name: "WeekDay",
|
|
14759
14778
|
props: {
|
|
@@ -14791,11 +14810,24 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
14791
14810
|
const value = new Intl.DateTimeFormat(locale.value, { weekday: "short" }).format(props.date);
|
|
14792
14811
|
return value.charAt(0).toUpperCase() + value.slice(1).replace(".", "");
|
|
14793
14812
|
});
|
|
14813
|
+
const dateAriaLabel = vue.computed(() => {
|
|
14814
|
+
const spokenDate = new Intl.DateTimeFormat(locale.value, {
|
|
14815
|
+
day: "numeric",
|
|
14816
|
+
month: "long",
|
|
14817
|
+
weekday: "long"
|
|
14818
|
+
}).format(props.date);
|
|
14819
|
+
const normalizedDate = spokenDate.charAt(0).toUpperCase() + spokenDate.slice(1);
|
|
14820
|
+
if (props.isToday) {
|
|
14821
|
+
return `${t("FdsWeekCalendar.today")}. ${normalizedDate}.`;
|
|
14822
|
+
}
|
|
14823
|
+
return `${normalizedDate}.`;
|
|
14824
|
+
});
|
|
14794
14825
|
return (_ctx, _cache) => {
|
|
14795
14826
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
14796
14827
|
type: "button",
|
|
14797
14828
|
class: vue.normalizeClass(classes.value),
|
|
14798
14829
|
disabled: __props.disabled,
|
|
14830
|
+
"aria-label": dateAriaLabel.value,
|
|
14799
14831
|
onClick
|
|
14800
14832
|
}, [
|
|
14801
14833
|
vue.createElementVNode("span", {
|
|
@@ -15485,7 +15517,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
15485
15517
|
}, [
|
|
15486
15518
|
vue.createElementVNode("button", {
|
|
15487
15519
|
type: "button",
|
|
15488
|
-
class: vue.normalizeClass(["relative flex flex-col items-center", { "cursor-not-allowed": !canGoToStep(currentStepIndex.value, entry.index) }]),
|
|
15520
|
+
class: vue.normalizeClass(["relative flex flex-col items-center focus-visible:outline-2 focus-visible:outline-dashed focus-visible:outline-offset-4 focus-visible:outline-blue-500", { "cursor-not-allowed": !canGoToStep(currentStepIndex.value, entry.index) }]),
|
|
15489
15521
|
onClick: ($event) => __props.disableStepJump ? null : goToStep(entry.index),
|
|
15490
15522
|
disabled: !canGoToStep(currentStepIndex.value, entry.index)
|
|
15491
15523
|
}, [
|