fds-vue-core 2.1.27 → 2.1.29

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.
@@ -7819,10 +7819,25 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
7819
7819
  const inputType = vue.computed(() => type.value ?? props.type ?? "text");
7820
7820
  const autoId = `fds-input-${Math.random().toString(36).slice(2, 9)}`;
7821
7821
  const inputId = vue.computed(() => id.value ?? autoId);
7822
+ const labelAttrs = vue.computed(() => {
7823
+ const eventHandlers = {};
7824
+ for (const key in attrs) {
7825
+ if (key.startsWith("on") && typeof attrs[key] === "function") {
7826
+ eventHandlers[key] = attrs[key];
7827
+ }
7828
+ }
7829
+ return eventHandlers;
7830
+ });
7822
7831
  const inputAttrs = vue.computed(() => {
7823
7832
  const { class: _, type: _type, id: _id, ...rest } = attrs;
7833
+ const filtered = {};
7834
+ for (const key in rest) {
7835
+ if (!key.startsWith("on") || typeof rest[key] !== "function") {
7836
+ filtered[key] = rest[key];
7837
+ }
7838
+ }
7824
7839
  return {
7825
- ...rest,
7840
+ ...filtered,
7826
7841
  id: inputId.value
7827
7842
  };
7828
7843
  });
@@ -7952,11 +7967,11 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
7952
7967
  class: vue.normalizeClass({ "flex flex-row gap-4": props.labelLeft })
7953
7968
  }, [
7954
7969
  vue.createElementVNode("div", null, [
7955
- props.label ? (vue.openBlock(), vue.createElementBlock("label", {
7970
+ props.label ? (vue.openBlock(), vue.createElementBlock("label", vue.mergeProps({
7956
7971
  key: 0,
7957
7972
  for: inputId.value,
7958
- class: vue.normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0": props.meta, "mb-1": !props.meta }])
7959
- }, vue.toDisplayString(props.label), 11, _hoisted_1$c)) : vue.createCommentVNode("", true),
7973
+ class: ["block font-bold text-gray-900 cursor-pointer", { "mb-0": props.meta, "mb-1": !props.meta }]
7974
+ }, labelAttrs.value), vue.toDisplayString(props.label), 17, _hoisted_1$c)) : vue.createCommentVNode("", true),
7960
7975
  props.meta ? (vue.openBlock(), vue.createElementBlock("div", {
7961
7976
  key: 1,
7962
7977
  class: vue.normalizeClass(["font-thin", { "mb-1": !props.labelLeft }])
@@ -8138,12 +8153,13 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
8138
8153
  "label-position": "right"
8139
8154
  })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
8140
8155
  vue.createVNode(_sfc_main$h, {
8156
+ style: { "text-align": "center" },
8141
8157
  value: inputValue.value,
8142
8158
  type: "text",
8143
8159
  size: __props.max.toString().length,
8144
8160
  maxlength: __props.max.toString().length,
8145
8161
  onInput: vue.unref(handlePageChange),
8146
- class: "mb-0! text-center!"
8162
+ class: "mb-0!"
8147
8163
  }, null, 8, ["value", "size", "maxlength", "onInput"]),
8148
8164
  vue.createElementVNode("div", _hoisted_4$5, "/ " + vue.toDisplayString(__props.max), 1)
8149
8165
  ], 64))
@@ -9133,6 +9149,9 @@ const useTreeState = (options = {}) => {
9133
9149
  const _hoisted_1$9 = ["for"];
9134
9150
  const _hoisted_2$7 = ["value", "disabled", "required"];
9135
9151
  const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9152
+ ...{
9153
+ inheritAttrs: false
9154
+ },
9136
9155
  __name: "FdsCheckbox",
9137
9156
  props: /* @__PURE__ */ vue.mergeModels({
9138
9157
  label: { default: void 0 },
@@ -9155,6 +9174,31 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9155
9174
  const props = __props;
9156
9175
  const emit = __emit;
9157
9176
  const { id, attrs } = useAttrsWithDefaults(props);
9177
+ const autoId = `fds-checkbox-${Math.random().toString(36).slice(2, 9)}`;
9178
+ const inputId = vue.computed(() => id.value ?? autoId);
9179
+ const labelAttrs = vue.computed(() => {
9180
+ const eventHandlers = {};
9181
+ for (const key in attrs) {
9182
+ if (key.startsWith("on") && typeof attrs[key] === "function") {
9183
+ eventHandlers[key] = attrs[key];
9184
+ }
9185
+ }
9186
+ return eventHandlers;
9187
+ });
9188
+ const inputAttrs = vue.computed(() => {
9189
+ const { id: _, ...rest } = attrs;
9190
+ const filtered = {};
9191
+ for (const key in rest) {
9192
+ if (!key.startsWith("on") || typeof rest[key] !== "function") {
9193
+ filtered[key] = rest[key];
9194
+ }
9195
+ }
9196
+ return {
9197
+ ...filtered,
9198
+ id: inputId.value
9199
+ };
9200
+ });
9201
+ const hasLabelSlot = useHasSlot();
9158
9202
  const wrapperClasses = vue.computed(() => ["block relative flex items-center mb-2 last:mb-0"]);
9159
9203
  const innerWrapperClasses = vue.computed(() => [
9160
9204
  "flex p-0.5 items-start rounded-md",
@@ -9167,16 +9211,6 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9167
9211
  "peer z-2 bg-white min-w-[18px] min-h-[18px] focus-visible:outline-none",
9168
9212
  props.disabled && "cursor-not-allowed"
9169
9213
  ]);
9170
- const autoId = `fds-checkbox-${Math.random().toString(36).slice(2, 9)}`;
9171
- const inputId = vue.computed(() => id.value ?? autoId);
9172
- const inputAttrs = vue.computed(() => {
9173
- const { id: _, ...rest } = attrs;
9174
- return {
9175
- ...rest,
9176
- id: inputId.value
9177
- };
9178
- });
9179
- const hasLabelSlot = useHasSlot();
9180
9214
  const internalChecked = vue.computed({
9181
9215
  get: () => {
9182
9216
  if (modelValue.value === void 0) {
@@ -9243,10 +9277,10 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9243
9277
  return vue.openBlock(), vue.createElementBlock("div", {
9244
9278
  class: vue.normalizeClass(wrapperClasses.value)
9245
9279
  }, [
9246
- vue.createElementVNode("label", {
9280
+ vue.createElementVNode("label", vue.mergeProps({
9247
9281
  for: inputId.value,
9248
- class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }])
9249
- }, [
9282
+ class: [innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }]
9283
+ }, labelAttrs.value), [
9250
9284
  vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
9251
9285
  value: props.value,
9252
9286
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalChecked.value = $event),
@@ -9265,7 +9299,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9265
9299
  vue.createTextVNode(vue.toDisplayString(props.label), 1)
9266
9300
  ], 64)) : vue.createCommentVNode("", true)
9267
9301
  ], 2)) : vue.createCommentVNode("", true)
9268
- ], 10, _hoisted_1$9)
9302
+ ], 16, _hoisted_1$9)
9269
9303
  ], 2);
9270
9304
  };
9271
9305
  }
@@ -9296,10 +9330,25 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
9296
9330
  const { id, name, attrs } = useAttrsWithDefaults(props);
9297
9331
  const autoId = `fds-radio-${Math.random().toString(36).slice(2, 9)}`;
9298
9332
  const inputId = vue.computed(() => id.value ?? autoId);
9333
+ const labelAttrs = vue.computed(() => {
9334
+ const eventHandlers = {};
9335
+ for (const key in attrs) {
9336
+ if (key.startsWith("on") && typeof attrs[key] === "function") {
9337
+ eventHandlers[key] = attrs[key];
9338
+ }
9339
+ }
9340
+ return eventHandlers;
9341
+ });
9299
9342
  const inputAttrs = vue.computed(() => {
9300
9343
  const { id: _, ...rest } = attrs;
9344
+ const filtered = {};
9345
+ for (const key in rest) {
9346
+ if (!key.startsWith("on") || typeof rest[key] !== "function") {
9347
+ filtered[key] = rest[key];
9348
+ }
9349
+ }
9301
9350
  return {
9302
- ...rest,
9351
+ ...filtered,
9303
9352
  id: inputId.value
9304
9353
  };
9305
9354
  });
@@ -9329,10 +9378,10 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
9329
9378
  return vue.openBlock(), vue.createElementBlock("div", {
9330
9379
  class: vue.normalizeClass(wrapperClasses.value)
9331
9380
  }, [
9332
- vue.createElementVNode("label", {
9381
+ vue.createElementVNode("label", vue.mergeProps({
9333
9382
  for: inputId.value,
9334
- class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }])
9335
- }, [
9383
+ class: [innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }]
9384
+ }, labelAttrs.value), [
9336
9385
  vue.withDirectives(vue.createElementVNode("input", vue.mergeProps(inputAttrs.value, {
9337
9386
  name: vue.unref(name),
9338
9387
  value: props.value,
@@ -9352,7 +9401,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
9352
9401
  vue.createTextVNode(vue.toDisplayString(props.label), 1)
9353
9402
  ], 64)) : vue.createCommentVNode("", true)
9354
9403
  ], 2)) : vue.createCommentVNode("", true)
9355
- ], 10, _hoisted_1$8)
9404
+ ], 16, _hoisted_1$8)
9356
9405
  ], 2);
9357
9406
  };
9358
9407
  }
@@ -10042,11 +10091,26 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
10042
10091
  const emit = __emit;
10043
10092
  const { id, placeholder, attrs } = useAttrsWithDefaults(props);
10044
10093
  const autoId = `fds-select-${Math.random().toString(36).slice(2, 9)}`;
10045
- const selectId = vue.computed(() => id.value ?? autoId);
10094
+ const selectId = vue.computed(() => id.value && id.value.trim() !== "" ? id.value : autoId);
10095
+ const labelAttrs = vue.computed(() => {
10096
+ const eventHandlers = {};
10097
+ for (const key in attrs) {
10098
+ if (key.startsWith("on") && typeof attrs[key] === "function") {
10099
+ eventHandlers[key] = attrs[key];
10100
+ }
10101
+ }
10102
+ return eventHandlers;
10103
+ });
10046
10104
  const selectAttrs = vue.computed(() => {
10047
- const { class: _class, ...rest } = attrs;
10105
+ const { class: _class, id: _id, ...rest } = attrs;
10106
+ const filtered = {};
10107
+ for (const key in rest) {
10108
+ if (!key.startsWith("on") || typeof rest[key] !== "function") {
10109
+ filtered[key] = rest[key];
10110
+ }
10111
+ }
10048
10112
  return {
10049
- ...rest,
10113
+ ...filtered,
10050
10114
  id: selectId.value,
10051
10115
  disabled: props.disabled,
10052
10116
  "aria-invalid": props.valid === false ? "true" : void 0
@@ -10080,11 +10144,11 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
10080
10144
  }
10081
10145
  return (_ctx, _cache) => {
10082
10146
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
10083
- __props.label ? (vue.openBlock(), vue.createElementBlock("label", {
10147
+ __props.label ? (vue.openBlock(), vue.createElementBlock("label", vue.mergeProps({
10084
10148
  key: 0,
10085
10149
  for: selectId.value,
10086
- class: vue.normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0": __props.meta, "mb-1": !__props.meta }])
10087
- }, vue.toDisplayString(__props.label), 11, _hoisted_2$3)) : vue.createCommentVNode("", true),
10150
+ class: ["block font-bold text-gray-900 cursor-pointer", { "mb-0": __props.meta, "mb-1": !__props.meta }]
10151
+ }, labelAttrs.value), vue.toDisplayString(__props.label), 17, _hoisted_2$3)) : vue.createCommentVNode("", true),
10088
10152
  __props.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, vue.toDisplayString(__props.meta), 1)) : vue.createCommentVNode("", true),
10089
10153
  vue.createElementVNode("div", _hoisted_4$2, [
10090
10154
  vue.withDirectives(vue.createElementVNode("select", vue.mergeProps({
@@ -10158,20 +10222,35 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
10158
10222
  const modelValue = vue.useModel(__props, "modelValue");
10159
10223
  const props = __props;
10160
10224
  const emit = __emit;
10161
- const { id, attrs } = useAttrsWithDefaults(props);
10225
+ const { id, rows, attrs } = useAttrsWithDefaults(props);
10162
10226
  const wrapperClass = vue.computed(() => attrs.class);
10227
+ const autoId = `fds-textarea-${Math.random().toString(36).slice(2, 9)}`;
10228
+ const textareaId = vue.computed(() => id.value && id.value.trim() !== "" ? id.value : autoId);
10229
+ const labelAttrs = vue.computed(() => {
10230
+ const eventHandlers = {};
10231
+ for (const key in attrs) {
10232
+ if (key.startsWith("on") && typeof attrs[key] === "function") {
10233
+ eventHandlers[key] = attrs[key];
10234
+ }
10235
+ }
10236
+ return eventHandlers;
10237
+ });
10163
10238
  const textareaAttrs = vue.computed(() => {
10164
- const { class: _, ...rest } = attrs;
10239
+ const { class: _, id: _id, rows: _rows, ...rest } = attrs;
10240
+ const filtered = {};
10241
+ for (const key in rest) {
10242
+ if (!key.startsWith("on") || typeof rest[key] !== "function") {
10243
+ filtered[key] = rest[key];
10244
+ }
10245
+ }
10165
10246
  return {
10166
- ...rest,
10247
+ ...filtered,
10167
10248
  id: textareaId.value,
10168
10249
  disabled: props.disabled,
10169
- rows: props.rows,
10250
+ rows: rows.value ?? 4,
10170
10251
  "aria-invalid": props.valid === false ? true : void 0
10171
10252
  };
10172
10253
  });
10173
- const autoId = `fds-textarea-${Math.random().toString(36).slice(2, 9)}`;
10174
- const textareaId = vue.computed(() => id.value ?? autoId);
10175
10254
  const isLazy = vue.computed(() => props.modelModifiers?.lazy === true);
10176
10255
  const showInvalidMessage = vue.computed(() => props.valid === false && !props.optional && props.invalidMessage);
10177
10256
  const isInvalid = vue.computed(() => props.valid === false && !props.optional && !props.disabled);
@@ -10209,11 +10288,11 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
10209
10288
  return vue.openBlock(), vue.createElementBlock("div", {
10210
10289
  class: vue.normalizeClass(["w-full mb-4", wrapperClass.value])
10211
10290
  }, [
10212
- __props.label ? (vue.openBlock(), vue.createElementBlock("label", {
10291
+ __props.label ? (vue.openBlock(), vue.createElementBlock("label", vue.mergeProps({
10213
10292
  key: 0,
10214
10293
  for: textareaId.value,
10215
- class: vue.normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0": __props.meta, "mb-1": !__props.meta }])
10216
- }, vue.toDisplayString(__props.label), 11, _hoisted_1$3)) : vue.createCommentVNode("", true),
10294
+ class: ["block font-bold text-gray-900 cursor-pointer", { "mb-0": __props.meta, "mb-1": !__props.meta }]
10295
+ }, labelAttrs.value), vue.toDisplayString(__props.label), 17, _hoisted_1$3)) : vue.createCommentVNode("", true),
10217
10296
  __props.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, vue.toDisplayString(__props.meta), 1)) : vue.createCommentVNode("", true),
10218
10297
  vue.createElementVNode("div", _hoisted_3$1, [
10219
10298
  vue.createElementVNode("textarea", vue.mergeProps({