tsv2-library 1.0.61-alpha.56 → 1.0.61-alpha.58

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.
@@ -106,6 +106,10 @@ export type FileUploadProps = {
106
106
  * Wether show validator message on invalid file input
107
107
  */
108
108
  showValidatorMessage?: boolean;
109
+ /**
110
+ * Wether show validator message on invalid file input
111
+ */
112
+ validatorMessage?: boolean;
109
113
  };
110
114
 
111
115
  export type FileUploadEmits = {
@@ -68206,7 +68206,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
68206
68206
  const _hoisted_1$h = { class: "flex flex-row gap-3 items-end" };
68207
68207
  const _hoisted_2$b = { class: "w-full" };
68208
68208
  const _hoisted_3$7 = {
68209
- key: 0,
68209
+ key: 1,
68210
68210
  class: "flex w-full justify-end"
68211
68211
  };
68212
68212
  const _hoisted_4$5 = { class: "'!mt-0 font-light text-xs text-general-500'" };
@@ -68235,7 +68235,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
68235
68235
  fieldName: { default: "fileUpload" },
68236
68236
  mandatory: { type: Boolean },
68237
68237
  useErrorToast: { type: Boolean, default: true },
68238
- showValidatorMessage: { type: Boolean, default: false }
68238
+ showValidatorMessage: { type: Boolean, default: false },
68239
+ validatorMessage: { type: Boolean }
68239
68240
  }, {
68240
68241
  "modelValue": {},
68241
68242
  "modelModifiers": {}
@@ -68267,7 +68268,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
68267
68268
  });
68268
68269
  const setValidatorMessage = (value) => {
68269
68270
  if (props.mandatory && !value && !currentFile.value)
68270
- return `${props.label} must not be empty`;
68271
+ return props.validatorMessage ?? `${props.label} must not be empty`;
68271
68272
  return true;
68272
68273
  };
68273
68274
  const selectHandler = (event2) => {
@@ -68378,19 +68379,27 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
68378
68379
  ]),
68379
68380
  _: 2
68380
68381
  }, 1032, ["disabled", "invalid", "onClick"]),
68381
- props.fileExtensions || props.fileRequirements ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
68382
- createElementVNode("small", _hoisted_4$5, [
68383
- _ctx.fileRequirements ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
68384
- createTextVNode(toDisplayString$1(_ctx.fileRequirements), 1)
68385
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
68386
- createTextVNode(toDisplayString$1(props.maxFileSize ? `${props.fileExtensions}. max file ${Math.round(props.maxFileSize / BYTES_TO_MEGABYTES)} MB` : `${props.fileExtensions} file`), 1)
68387
- ], 64))
68388
- ])
68389
- ])) : createCommentVNode("", true),
68390
- props.showValidatorMessage ? (openBlock(), createBlock(_sfc_main$19, {
68391
- key: 1,
68392
- message: field2.errorMessage
68393
- }, null, 8, ["message"])) : createCommentVNode("", true)
68382
+ props.fileExtensions || props.fileRequirements || field2.errorMessage || props.validatorMessage ? (openBlock(), createElementBlock("div", {
68383
+ key: 0,
68384
+ class: normalizeClass([{
68385
+ "justify-between": field2.errorMessage,
68386
+ "justify-end": !field2.errorMessage
68387
+ }, "flex w-full"])
68388
+ }, [
68389
+ props.showValidatorMessage ? (openBlock(), createBlock(_sfc_main$19, {
68390
+ key: 0,
68391
+ message: field2.errorMessage
68392
+ }, null, 8, ["message"])) : createCommentVNode("", true),
68393
+ props.fileExtensions || props.fileRequirements ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
68394
+ createElementVNode("small", _hoisted_4$5, [
68395
+ _ctx.fileRequirements ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
68396
+ createTextVNode(toDisplayString$1(_ctx.fileRequirements), 1)
68397
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
68398
+ createTextVNode(toDisplayString$1(props.maxFileSize ? `${props.fileExtensions}. max file ${Math.round(props.maxFileSize / BYTES_TO_MEGABYTES)} MB` : `${props.fileExtensions} file`), 1)
68399
+ ], 64))
68400
+ ])
68401
+ ])) : createCommentVNode("", true)
68402
+ ], 2)) : createCommentVNode("", true)
68394
68403
  ]),
68395
68404
  _: 2
68396
68405
  }, 1032, ["label", "mandatory"])