fds-vue-core 2.1.44 → 2.1.45
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 +77 -27
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +77 -27
- package/dist/fds-vue-core.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Form/FdsCheckbox/FdsCheckbox.vue +8 -6
- package/src/components/Form/FdsCheckbox/types.ts +16 -5
- package/src/components/Form/FdsInput/FdsInput.vue +7 -4
- package/src/components/Form/FdsInput/types.ts +26 -5
- package/src/components/Form/FdsRadio/FdsRadio.vue +15 -12
- package/src/components/Form/FdsRadio/types.ts +16 -5
- package/src/index.ts +2 -1
- package/src/.DS_Store +0 -0
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -7760,7 +7760,7 @@ try {
|
|
|
7760
7760
|
}
|
|
7761
7761
|
const _hoisted_1$c = ["for"];
|
|
7762
7762
|
const _hoisted_2$a = { class: "relative" };
|
|
7763
|
-
const _hoisted_3$7 = ["type", "required", "value", "aria-invalid"];
|
|
7763
|
+
const _hoisted_3$7 = ["type", "required", "value", "disabled", "tabindex", "aria-invalid"];
|
|
7764
7764
|
const _hoisted_4$6 = {
|
|
7765
7765
|
key: 0,
|
|
7766
7766
|
class: "text-red-600 font-bold mt-1"
|
|
@@ -7775,16 +7775,38 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7775
7775
|
meta: { default: void 0 },
|
|
7776
7776
|
valid: { type: [Boolean, null], default: void 0 },
|
|
7777
7777
|
optional: { type: Boolean, default: false },
|
|
7778
|
+
required: { type: Boolean, default: false },
|
|
7779
|
+
disabled: { type: Boolean, default: false },
|
|
7778
7780
|
invalidMessage: {},
|
|
7779
7781
|
labelLeft: { type: Boolean, default: false },
|
|
7780
7782
|
clearButton: { type: Boolean, default: false },
|
|
7781
7783
|
locale: { default: "sv" },
|
|
7782
7784
|
mask: { default: void 0 },
|
|
7783
7785
|
modelValue: {},
|
|
7786
|
+
value: { default: void 0 },
|
|
7787
|
+
type: {},
|
|
7788
|
+
placeholder: {},
|
|
7789
|
+
maxlength: {},
|
|
7790
|
+
minlength: {},
|
|
7791
|
+
size: {},
|
|
7792
|
+
autocomplete: {},
|
|
7793
|
+
autofocus: { type: Boolean },
|
|
7794
|
+
readonly: { type: Boolean },
|
|
7784
7795
|
onClearInput: {},
|
|
7785
7796
|
maskOptions: { default: void 0 },
|
|
7786
7797
|
modelModifiers: { default: () => ({}) },
|
|
7787
|
-
|
|
7798
|
+
class: {},
|
|
7799
|
+
style: {},
|
|
7800
|
+
tabindex: {},
|
|
7801
|
+
id: {},
|
|
7802
|
+
name: {},
|
|
7803
|
+
onInput: {},
|
|
7804
|
+
onChange: {},
|
|
7805
|
+
onFocus: {},
|
|
7806
|
+
onBlur: {},
|
|
7807
|
+
onClick: {},
|
|
7808
|
+
onKeydown: {},
|
|
7809
|
+
onKeyup: {}
|
|
7788
7810
|
}, {
|
|
7789
7811
|
"modelValue": { default: void 0, required: false },
|
|
7790
7812
|
"modelModifiers": {}
|
|
@@ -7794,7 +7816,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7794
7816
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
7795
7817
|
const props = __props;
|
|
7796
7818
|
const emit = __emit;
|
|
7797
|
-
const { id, type,
|
|
7819
|
+
const { id, type, maxlength, attrs } = useAttrsWithDefaults(props);
|
|
7798
7820
|
const inputType = vue.computed(() => type.value ?? props.type ?? "text");
|
|
7799
7821
|
const autoId = `fds-input-${Math.random().toString(36).slice(2, 9)}`;
|
|
7800
7822
|
const inputId = vue.computed(() => id.value ?? autoId);
|
|
@@ -7808,7 +7830,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7808
7830
|
return eventHandlers;
|
|
7809
7831
|
});
|
|
7810
7832
|
const inputAttrs = vue.computed(() => {
|
|
7811
|
-
const { class: _, type: _type, id: _id, ...rest } = attrs;
|
|
7833
|
+
const { class: _, type: _type, id: _id, disabled: _disabled, tabindex: _tabindex, ...rest } = attrs;
|
|
7812
7834
|
const filtered = {};
|
|
7813
7835
|
for (const key in rest) {
|
|
7814
7836
|
if (!key.startsWith("on") || typeof rest[key] !== "function") {
|
|
@@ -7824,7 +7846,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7824
7846
|
const passwordButtonShowLabel = vue.computed(() => props.locale === "sv" ? "Visa" : "Show");
|
|
7825
7847
|
const passwordButtonHideLabel = vue.computed(() => props.locale === "sv" ? "Dölj" : "Hide");
|
|
7826
7848
|
const showInvalidMessage = vue.computed(() => props.valid === false && !props.optional && props.invalidMessage);
|
|
7827
|
-
const isInvalid = vue.computed(() => props.valid === false && !props.optional && !disabled
|
|
7849
|
+
const isInvalid = vue.computed(() => props.valid === false && !props.optional && !props.disabled);
|
|
7828
7850
|
const isValid = vue.computed(() => props.valid === true);
|
|
7829
7851
|
const showPasswordToggle = vue.computed(
|
|
7830
7852
|
() => inputType.value === "password" && internalValue.value !== void 0 && internalValue.value !== null && String(internalValue.value).length > 0
|
|
@@ -7834,7 +7856,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7834
7856
|
"block rounded-md border border-gray-500 px-3 py-[calc(0.75rem-1px)]",
|
|
7835
7857
|
maxlength.value ? "" : "w-full",
|
|
7836
7858
|
"focus:outline-2 focus:outline-blue-500 -outline-offset-2 focus:border-transparent",
|
|
7837
|
-
disabled
|
|
7859
|
+
props.disabled ? "text-gray-600 outline-dashed outline-2 outline-gray-400 cursor-not-allowed border-transparent" : "bg-white",
|
|
7838
7860
|
isInvalid.value && "outline-2 outline-red-600"
|
|
7839
7861
|
]);
|
|
7840
7862
|
const inputStyle = vue.computed(() => {
|
|
@@ -7966,6 +7988,8 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7966
7988
|
type: inputType.value === "password" ? showPassword.value ? "text" : "password" : inputType.value,
|
|
7967
7989
|
required: props.required,
|
|
7968
7990
|
value: internalValue.value,
|
|
7991
|
+
disabled: props.disabled,
|
|
7992
|
+
tabindex: props.disabled ? -1 : void 0,
|
|
7969
7993
|
"aria-invalid": props.valid === false ? "true" : void 0,
|
|
7970
7994
|
class: inputClasses.value,
|
|
7971
7995
|
style: inputStyle.value
|
|
@@ -9134,11 +9158,24 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9134
9158
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
9135
9159
|
label: { default: void 0 },
|
|
9136
9160
|
indeterminate: { type: Boolean, default: false },
|
|
9161
|
+
disabled: { type: Boolean, default: false },
|
|
9162
|
+
required: { type: Boolean, default: false },
|
|
9137
9163
|
modelValue: { type: [Boolean, Array] },
|
|
9138
9164
|
checked: { type: Boolean, default: false },
|
|
9139
9165
|
value: { default: void 0 },
|
|
9166
|
+
class: {},
|
|
9167
|
+
style: {},
|
|
9168
|
+
tabindex: {},
|
|
9169
|
+
autofocus: { type: Boolean },
|
|
9170
|
+
id: {},
|
|
9171
|
+
name: {},
|
|
9140
9172
|
onInput: {},
|
|
9141
|
-
onChange: {}
|
|
9173
|
+
onChange: {},
|
|
9174
|
+
onFocus: {},
|
|
9175
|
+
onBlur: {},
|
|
9176
|
+
onClick: {},
|
|
9177
|
+
onKeydown: {},
|
|
9178
|
+
onKeyup: {}
|
|
9142
9179
|
}, {
|
|
9143
9180
|
"modelValue": { type: [Boolean, Array], ...{
|
|
9144
9181
|
default: void 0,
|
|
@@ -9151,7 +9188,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9151
9188
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
9152
9189
|
const props = __props;
|
|
9153
9190
|
const emit = __emit;
|
|
9154
|
-
const { id, attrs
|
|
9191
|
+
const { id, attrs } = useAttrsWithDefaults(props);
|
|
9155
9192
|
const autoId = `fds-checkbox-${Math.random().toString(36).slice(2, 9)}`;
|
|
9156
9193
|
const inputId = vue.computed(() => id.value ?? autoId);
|
|
9157
9194
|
const labelAttrs = vue.computed(() => {
|
|
@@ -9183,12 +9220,12 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9183
9220
|
"flex p-0.5 items-start rounded-md",
|
|
9184
9221
|
"hover:bg-blue_t-100 active:bg-blue_t-200",
|
|
9185
9222
|
"[&:has(:focus-visible)]:outline-2 [&:has(:focus-visible)]:outline-dashed [&:has(:focus-visible)]:-outline-offset-2 [&:has(:focus-visible)]:outline-blue-500",
|
|
9186
|
-
disabled
|
|
9223
|
+
props.disabled && "hover:bg-transparent active:bg-transparent"
|
|
9187
9224
|
]);
|
|
9188
9225
|
const checkboxClasses = vue.computed(() => [
|
|
9189
9226
|
"rounded-md transition-colors duration-200 accent-blue-500 m-[3px]",
|
|
9190
9227
|
"peer z-2 bg-white min-w-[18px] min-h-[18px] focus-visible:outline-none",
|
|
9191
|
-
disabled
|
|
9228
|
+
props.disabled && "cursor-not-allowed"
|
|
9192
9229
|
]);
|
|
9193
9230
|
const internalChecked = vue.computed({
|
|
9194
9231
|
get: () => {
|
|
@@ -9258,13 +9295,13 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9258
9295
|
}, [
|
|
9259
9296
|
vue.createElementVNode("label", vue.mergeProps({
|
|
9260
9297
|
for: inputId.value,
|
|
9261
|
-
class: [innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9298
|
+
class: [innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }]
|
|
9262
9299
|
}, labelAttrs.value), [
|
|
9263
9300
|
vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
|
|
9264
9301
|
value: props.value,
|
|
9265
9302
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalChecked.value = $event),
|
|
9266
|
-
disabled:
|
|
9267
|
-
required:
|
|
9303
|
+
disabled: props.disabled,
|
|
9304
|
+
required: __props.required,
|
|
9268
9305
|
type: "checkbox",
|
|
9269
9306
|
class: [checkboxClasses.value]
|
|
9270
9307
|
}, inputAttrs.value), null, 16, _hoisted_2$7), [
|
|
@@ -9272,7 +9309,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9272
9309
|
]),
|
|
9273
9310
|
vue.unref(hasLabelSlot) || props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
9274
9311
|
key: 0,
|
|
9275
|
-
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9312
|
+
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": props.disabled }])
|
|
9276
9313
|
}, [
|
|
9277
9314
|
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : props.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
9278
9315
|
vue.createTextVNode(vue.toDisplayString(props.label), 1)
|
|
@@ -9284,7 +9321,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9284
9321
|
}
|
|
9285
9322
|
});
|
|
9286
9323
|
const _hoisted_1$8 = ["for"];
|
|
9287
|
-
const _hoisted_2$6 = ["
|
|
9324
|
+
const _hoisted_2$6 = ["value", "checked", "disabled", "required"];
|
|
9288
9325
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
9289
9326
|
...{
|
|
9290
9327
|
inheritAttrs: false
|
|
@@ -9293,10 +9330,23 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9293
9330
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
9294
9331
|
label: { default: void 0 },
|
|
9295
9332
|
modelValue: {},
|
|
9333
|
+
disabled: { type: Boolean, default: false },
|
|
9334
|
+
required: { type: Boolean, default: false },
|
|
9296
9335
|
checked: { type: Boolean, default: false },
|
|
9297
9336
|
value: { default: void 0 },
|
|
9337
|
+
name: { default: void 0 },
|
|
9338
|
+
id: { default: void 0 },
|
|
9339
|
+
class: {},
|
|
9340
|
+
style: {},
|
|
9341
|
+
tabindex: {},
|
|
9342
|
+
autofocus: { type: Boolean },
|
|
9298
9343
|
onInput: {},
|
|
9299
|
-
onChange: {}
|
|
9344
|
+
onChange: {},
|
|
9345
|
+
onFocus: {},
|
|
9346
|
+
onBlur: {},
|
|
9347
|
+
onClick: {},
|
|
9348
|
+
onKeydown: {},
|
|
9349
|
+
onKeyup: {}
|
|
9300
9350
|
}, {
|
|
9301
9351
|
"modelValue": { default: void 0, required: false },
|
|
9302
9352
|
"modelModifiers": {}
|
|
@@ -9306,9 +9356,9 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9306
9356
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
9307
9357
|
const props = __props;
|
|
9308
9358
|
const emit = __emit;
|
|
9309
|
-
const
|
|
9359
|
+
const attrs = vue.useAttrs();
|
|
9310
9360
|
const autoId = `fds-radio-${Math.random().toString(36).slice(2, 9)}`;
|
|
9311
|
-
const inputId = vue.computed(() => id.
|
|
9361
|
+
const inputId = vue.computed(() => props.id ?? attrs.id ?? autoId);
|
|
9312
9362
|
const labelAttrs = vue.computed(() => {
|
|
9313
9363
|
const eventHandlers = {};
|
|
9314
9364
|
for (const key in attrs) {
|
|
@@ -9319,7 +9369,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9319
9369
|
return eventHandlers;
|
|
9320
9370
|
});
|
|
9321
9371
|
const inputAttrs = vue.computed(() => {
|
|
9322
|
-
const { id:
|
|
9372
|
+
const { id: _id, name: _name, disabled: _disabled, ...rest } = attrs;
|
|
9323
9373
|
const filtered = {};
|
|
9324
9374
|
for (const key in rest) {
|
|
9325
9375
|
if (!key.startsWith("on") || typeof rest[key] !== "function") {
|
|
@@ -9328,7 +9378,8 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9328
9378
|
}
|
|
9329
9379
|
return {
|
|
9330
9380
|
...filtered,
|
|
9331
|
-
id: inputId.value
|
|
9381
|
+
id: inputId.value,
|
|
9382
|
+
name: props.name ?? attrs.name
|
|
9332
9383
|
};
|
|
9333
9384
|
});
|
|
9334
9385
|
const hasLabelSlot = useHasSlot();
|
|
@@ -9365,11 +9416,11 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9365
9416
|
"flex p-0.5 items-start rounded-l-xl rounded-r-md",
|
|
9366
9417
|
"hover:bg-blue_t-100 active:bg-blue_t-200",
|
|
9367
9418
|
"[&:has(:focus-visible)]:outline-2 [&:has(:focus-visible)]:outline-dashed [&:has(:focus-visible)]:-outline-offset-2 [&:has(:focus-visible)]:outline-blue-500",
|
|
9368
|
-
disabled
|
|
9419
|
+
props.disabled && "hover:bg-transparent active:bg-transparent"
|
|
9369
9420
|
]);
|
|
9370
9421
|
const inputClasses = vue.computed(() => [
|
|
9371
9422
|
"peer z-2 bg-white min-w-[20px] min-h-[20px] focus-visible:outline-none rounded-full accent-blue-500",
|
|
9372
|
-
disabled
|
|
9423
|
+
props.disabled && "cursor-not-allowed"
|
|
9373
9424
|
]);
|
|
9374
9425
|
return (_ctx, _cache) => {
|
|
9375
9426
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -9377,21 +9428,20 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9377
9428
|
}, [
|
|
9378
9429
|
vue.createElementVNode("label", vue.mergeProps({
|
|
9379
9430
|
for: inputId.value,
|
|
9380
|
-
class: [innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9431
|
+
class: [innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }]
|
|
9381
9432
|
}, labelAttrs.value), [
|
|
9382
9433
|
vue.createElementVNode("input", vue.mergeProps(inputAttrs.value, {
|
|
9383
|
-
name: vue.unref(name),
|
|
9384
9434
|
value: props.value,
|
|
9385
9435
|
checked: isChecked.value,
|
|
9386
9436
|
onChange: handleChange,
|
|
9387
|
-
disabled:
|
|
9388
|
-
required:
|
|
9437
|
+
disabled: props.disabled,
|
|
9438
|
+
required: props.required,
|
|
9389
9439
|
type: "radio",
|
|
9390
9440
|
class: [inputClasses.value, "m-[2px]"]
|
|
9391
9441
|
}), null, 16, _hoisted_2$6),
|
|
9392
9442
|
vue.unref(hasLabelSlot) || props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
9393
9443
|
key: 0,
|
|
9394
|
-
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9444
|
+
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": props.disabled }])
|
|
9395
9445
|
}, [
|
|
9396
9446
|
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : props.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
9397
9447
|
vue.createTextVNode(vue.toDisplayString(props.label), 1)
|