@citruslime/ui 2.0.0-beta.15 → 2.0.0-beta.16

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.
@@ -272,8 +272,7 @@ const messages = {
272
272
  login: "Login",
273
273
  email: "Email Address",
274
274
  password: "Password",
275
- validEmail: "Username is a valid email address.",
276
- invalidEmail: "Username must be a valid email address."
275
+ validEmail: "Username is a valid email address."
277
276
  },
278
277
  slider: {
279
278
  invalidProps: "The current combination of props is invalid. Please confirm the values provided are correct."
@@ -1593,7 +1592,7 @@ function getInputTypeAsCalendarType(type) {
1593
1592
  return calendarType;
1594
1593
  }
1595
1594
  var clUiInput_vue_vue_type_style_index_0_scoped_true_lang = "";
1596
- const _hoisted_1$k = { class: "cl-align-top cl-inline-block cl-mb-4 cl-mr-4 cl-text-left" };
1595
+ const _hoisted_1$k = { class: "cl-align-top cl-border-none cl-inline-block cl-mb-4 cl-mr-4 cl-text-left" };
1597
1596
  const _hoisted_2$j = { class: "cl-flex cl-justify-between" };
1598
1597
  const _hoisted_3$f = { class: "cl-w-full" };
1599
1598
  const _hoisted_4$b = {
@@ -1612,6 +1611,10 @@ const _hoisted_8$5 = {
1612
1611
  };
1613
1612
  const _hoisted_9$5 = {
1614
1613
  key: 0,
1614
+ class: "cl-bg-primary-lighter cl-px-2 cl-rounded-md cl-text-center cl-text-secondary-light cl-text-xs cl-w-auto cl-whitespace-pre-line"
1615
+ };
1616
+ const _hoisted_10$5 = {
1617
+ key: 1,
1615
1618
  class: "cl-bg-danger-light cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-w-auto cl-whitespace-pre-line"
1616
1619
  };
1617
1620
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
@@ -1634,7 +1637,10 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1634
1637
  group: { default: "" },
1635
1638
  showLabel: { type: Boolean, default: true },
1636
1639
  showArrows: { type: Boolean, default: true },
1637
- autocomplete: { default: "off" }
1640
+ autocomplete: { default: "off" },
1641
+ highlightWhenValid: { type: Boolean, default: false },
1642
+ messageWhenValid: { default: "" },
1643
+ inputSpecificClasses: { default: "" }
1638
1644
  },
1639
1645
  emits: {
1640
1646
  "update:modelValue": null,
@@ -1664,6 +1670,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1664
1670
  const maxAsString = computed(() => typeof props.max === "number" ? props.max.toString() : props.max);
1665
1671
  const minAsNumber = computed(() => typeof props.min === "number" ? props.min : parseFloat(props.min));
1666
1672
  const maxAsNumber = computed(() => typeof props.max === "number" ? props.max : parseFloat(props.max));
1673
+ const validMessage = computed(() => props.messageWhenValid.trim() !== "" ? props.messageWhenValid : "");
1674
+ const isValid = ref(true);
1667
1675
  const internalErrors = ref([]);
1668
1676
  const errors = computed(() => {
1669
1677
  var _a, _b, _c, _d;
@@ -1693,7 +1701,6 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1693
1701
  message: "",
1694
1702
  valid: true
1695
1703
  };
1696
- const customValidationSuccess = props.customValidationFunction === null || props.customValidationFunction === void 0 ? defaultSuccess : props.customValidationFunction(props.label, value);
1697
1704
  const validationPromises = [props.customValidationFunction === null || props.customValidationFunction === void 0 ? new Promise((resolve) => {
1698
1705
  resolve(defaultSuccess);
1699
1706
  }) : new Promise((resolve) => {
@@ -1711,7 +1718,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1711
1718
  }
1712
1719
  Promise.all(validationPromises).then((internalValidationResults) => {
1713
1720
  const messages2 = [...internalValidationResults.map((e) => e.message)];
1714
- let invalid = internalValidationResults.some((e) => e.valid === false) || !customValidationSuccess.valid;
1721
+ let invalid = internalValidationResults.some((e) => e.valid === false) || props.externalErrors.length > 0;
1715
1722
  if (dateFlaggedAsOutOfRange.value) {
1716
1723
  messages2.push(t2("input.dateOutOfRange"));
1717
1724
  invalid = true;
@@ -1723,6 +1730,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1723
1730
  internalErrors.value = [];
1724
1731
  emit("validated", true, value);
1725
1732
  }
1733
+ isValid.value = !invalid;
1726
1734
  emit("update:modelValue", value);
1727
1735
  });
1728
1736
  }
@@ -1797,6 +1805,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1797
1805
  }
1798
1806
  });
1799
1807
  watch(() => props.isRequired, () => onValueChanged(props.modelValue));
1808
+ watch(() => props.externalErrors, () => updateAndValidateValue(currentValue.value));
1800
1809
  return (_ctx, _cache) => {
1801
1810
  const _component_icon = resolveComponent("icon");
1802
1811
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
@@ -1821,13 +1830,15 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1821
1830
  },
1822
1831
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentValue) ? currentValue.value = $event : null)
1823
1832
  }, _ctx.$attrs, {
1824
- class: ["cl-block cl-border cl-duration-300 cl-h-fit cl-mb-1 cl-transition cl-w-full focus:cl-outline-none", {
1833
+ class: ["cl-block cl-border cl-duration-300 cl-h-full cl-mb-1 cl-transition cl-w-full focus:cl-outline-none", {
1825
1834
  "hover:!cl-border-grey-3": __props.disabled === false && !unref(isInputButton)(__props.inputType),
1826
1835
  "!cl-cursor-default": __props.disabled,
1827
- "!cl-border-danger-default": unref(errors).length > 0,
1828
- "cl-border-grey-0 focus:cl-border-blue-light": unref(errors).length === 0 && !unref(isInputButton)(__props.inputType),
1836
+ "!cl-border-danger-default": !isValid.value,
1837
+ "!cl-border-primary-default": isValid.value && __props.highlightWhenValid,
1838
+ "cl-border-grey-0 focus:cl-border-blue-light": isValid.value && !unref(isInputButton)(__props.inputType),
1829
1839
  "!cl-p-2": __props.inputType === "checkbox" || __props.inputType === "radio",
1830
- "cl-p-3 cl-rounded-lg": !unref(isInputButton)(__props.inputType)
1840
+ "cl-p-3 cl-rounded-lg": !unref(isInputButton)(__props.inputType),
1841
+ [`${__props.inputSpecificClasses}`]: __props.inputSpecificClasses !== ""
1831
1842
  }],
1832
1843
  style: getStyle(),
1833
1844
  type: __props.inputType,
@@ -1858,7 +1869,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1858
1869
  "onUpdate:date": _cache[4] || (_cache[4] = ($event) => isRef(currentDateValue) ? currentDateValue.value = $event : null),
1859
1870
  class: ["cl-block cl-duration-300 cl-h-fit cl-mb-1 cl-rounded-lg cl-text-sm cl-transition cl-w-full focus:cl-outline-none", {
1860
1871
  "hover:cl-border-grey-3": !__props.disabled,
1861
- "!cl-border-danger-default": unref(errors).length > 0
1872
+ "!cl-border-danger-default": !isValid.value,
1873
+ "!cl-border-primary-default": isValid.value && __props.highlightWhenValid
1862
1874
  }],
1863
1875
  disabled: __props.disabled,
1864
1876
  type: unref(getInputTypeAsCalendarType)(__props.inputType),
@@ -1917,12 +1929,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1917
1929
  }, null, 8, ["value", "min", "max", "step", "disabled", "onBlur"])
1918
1930
  ])) : createCommentVNode("", true)
1919
1931
  ], 32),
1920
- unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_9$5, toDisplayString(unref(errors)), 1)) : createCommentVNode("", true)
1932
+ isValid.value && unref(validMessage) ? (openBlock(), createElementBlock("div", _hoisted_9$5, toDisplayString(unref(validMessage)), 1)) : createCommentVNode("", true),
1933
+ !isValid.value && unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_10$5, toDisplayString(unref(errors)), 1)) : createCommentVNode("", true)
1921
1934
  ]);
1922
1935
  };
1923
1936
  }
1924
1937
  });
1925
- var ClUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-2ef7d690"]]);
1938
+ var ClUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-3848d1cc"]]);
1926
1939
  const _hoisted_1$j = { class: "cl-align-items-center cl-bg-black cl-bg-opacity-40 cl-bottom-0 cl-fixed cl-flex cl-h-screen cl-justify-center cl-left-0 cl-right-0 cl-top-0 cl-w-full cl-z-40" };
1927
1940
  const _hoisted_2$i = ["onKeypress"];
1928
1941
  const _hoisted_3$e = { class: "cl-overflow-y-auto cl-p-2 cl-w-full" };
@@ -2939,8 +2952,8 @@ const _hoisted_7$5 = ["onClick"];
2939
2952
  const _hoisted_8$4 = ["innerHTML"];
2940
2953
  const _hoisted_9$4 = /* @__PURE__ */ createElementVNode("option", { value: void 0 }, null, -1);
2941
2954
  const _hoisted_10$4 = ["selected"];
2942
- const _hoisted_11$4 = ["selected"];
2943
- const _hoisted_12$4 = {
2955
+ const _hoisted_11$3 = ["selected"];
2956
+ const _hoisted_12$3 = {
2944
2957
  key: 1,
2945
2958
  class: "cl-flex cl-w-full"
2946
2959
  };
@@ -3121,7 +3134,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3121
3134
  createElementVNode("option", {
3122
3135
  value: "false",
3123
3136
  selected: unref(currentFilter) === "false"
3124
- }, toDisplayString(unref(t2)("grid.false")), 9, _hoisted_11$4)
3137
+ }, toDisplayString(unref(t2)("grid.false")), 9, _hoisted_11$3)
3125
3138
  ], 32)) : __props.column.type === "date" || __props.column.type === "datetime" || (__props.column.slotType === "date" || __props.column.slotType === "datetime") && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
3126
3139
  key: 2,
3127
3140
  "model-value": unref(currentDateFilter),
@@ -3148,7 +3161,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3148
3161
  "input-type": "text",
3149
3162
  onInput: _cache[5] || (_cache[5] = ($event) => unref(debounce)(setFilter, [$event.target]))
3150
3163
  }, null, 8, ["modelValue"])) : createCommentVNode("", true)
3151
- ], 2)) : (openBlock(), createElementBlock("div", _hoisted_12$4, " \xA0 "));
3164
+ ], 2)) : (openBlock(), createElementBlock("div", _hoisted_12$3, " \xA0 "));
3152
3165
  };
3153
3166
  }
3154
3167
  });
@@ -3165,12 +3178,12 @@ const _hoisted_7$4 = { class: "cl-text-grey-3 cl-w-full lg:cl-mr-2 lg:cl-w-auto"
3165
3178
  const _hoisted_8$3 = { class: "cl-flex cl-flex-wrap cl-text-sm mb:cl-flex-nowrap" };
3166
3179
  const _hoisted_9$3 = { class: "cl-pr-2" };
3167
3180
  const _hoisted_10$3 = ["onClick"];
3168
- const _hoisted_11$3 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3169
- const _hoisted_12$3 = { class: "cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
3170
- const _hoisted_13$2 = ["onClick"];
3171
- const _hoisted_14$2 = { class: "cl-mb-2 cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3172
- const _hoisted_15$2 = { class: "cl-block cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-inline-block lg:cl-mb-0 lg:cl-mr-1 lg:cl-w-auto" };
3173
- const _hoisted_16$2 = { class: "cl-block lg:cl-inline-block" };
3181
+ const _hoisted_11$2 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3182
+ const _hoisted_12$2 = { class: "cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
3183
+ const _hoisted_13$1 = ["onClick"];
3184
+ const _hoisted_14$1 = { class: "cl-mb-2 cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3185
+ const _hoisted_15$1 = { class: "cl-block cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-inline-block lg:cl-mb-0 lg:cl-mr-1 lg:cl-w-auto" };
3186
+ const _hoisted_16$1 = { class: "cl-block lg:cl-inline-block" };
3174
3187
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
3175
3188
  props: {
3176
3189
  request: null,
@@ -3302,8 +3315,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3302
3315
  ])
3303
3316
  ])
3304
3317
  ]),
3305
- createElementVNode("ul", _hoisted_11$3, [
3306
- createElementVNode("li", _hoisted_12$3, toDisplayString(unref(t2)("grid.pageSize")), 1),
3318
+ createElementVNode("ul", _hoisted_11$2, [
3319
+ createElementVNode("li", _hoisted_12$2, toDisplayString(unref(t2)("grid.pageSize")), 1),
3307
3320
  (openBlock(), createElementBlock(Fragment, null, renderList(pageSizes, (size, index) => {
3308
3321
  return createElementVNode("li", {
3309
3322
  key: index,
@@ -3312,12 +3325,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3312
3325
  "cl-text-grey-6": __props.request.pageSize !== size
3313
3326
  }]),
3314
3327
  onClick: ($event) => setPageSize(size)
3315
- }, toDisplayString(unref(n)(size, unref(NumberFormat).INTEGER)), 11, _hoisted_13$2);
3328
+ }, toDisplayString(unref(n)(size, unref(NumberFormat).INTEGER)), 11, _hoisted_13$1);
3316
3329
  }), 64))
3317
3330
  ]),
3318
- createElementVNode("ul", _hoisted_14$2, [
3319
- createElementVNode("li", _hoisted_15$2, toDisplayString(unref(t2)("grid.totalRecords")), 1),
3320
- createElementVNode("li", _hoisted_16$2, toDisplayString(unref(n)(__props.data.totalRecords, unref(NumberFormat).INTEGER)), 1)
3331
+ createElementVNode("ul", _hoisted_14$1, [
3332
+ createElementVNode("li", _hoisted_15$1, toDisplayString(unref(t2)("grid.totalRecords")), 1),
3333
+ createElementVNode("li", _hoisted_16$1, toDisplayString(unref(n)(__props.data.totalRecords, unref(NumberFormat).INTEGER)), 1)
3321
3334
  ])
3322
3335
  ])
3323
3336
  ])) : createCommentVNode("", true);
@@ -3334,8 +3347,8 @@ const _hoisted_7$3 = { class: "cl-py-2 cl-w-1/4" };
3334
3347
  const _hoisted_8$2 = { class: "cl-py-2 cl-w-1/5" };
3335
3348
  const _hoisted_9$2 = { class: "cl-flex-1 cl-py-2" };
3336
3349
  const _hoisted_10$2 = { class: "cl-py-2 cl-w-1/4" };
3337
- const _hoisted_11$2 = { class: "cl-py-2 cl-text-off-white cl-w-1/5" };
3338
- const _hoisted_12$2 = { key: 1 };
3350
+ const _hoisted_11$1 = { class: "cl-py-2 cl-text-off-white cl-w-1/5" };
3351
+ const _hoisted_12$1 = { key: 1 };
3339
3352
  const __default__ = {
3340
3353
  inheritAttrs: false
3341
3354
  };
@@ -3408,7 +3421,7 @@ function setup(__props, { emit }) {
3408
3421
  onClick: ($event) => updateColumnVisibility($event.target, column)
3409
3422
  }, null, 8, ["model-value", "onClick"])
3410
3423
  ]),
3411
- createElementVNode("div", _hoisted_11$2, [
3424
+ createElementVNode("div", _hoisted_11$1, [
3412
3425
  column.visible === void 0 || column.visible === true ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3413
3426
  index !== 0 ? (openBlock(), createBlock(_component_icon, {
3414
3427
  key: 0,
@@ -3422,7 +3435,7 @@ function setup(__props, { emit }) {
3422
3435
  icon: "ph:arrow-right",
3423
3436
  onClick: ($event) => changeColumnOrder(index, "up")
3424
3437
  }, null, 8, ["onClick"])) : createCommentVNode("", true)
3425
- ], 64)) : (openBlock(), createElementBlock("em", _hoisted_12$2, toDisplayString(unref(t2)("grid.hidden")), 1))
3438
+ ], 64)) : (openBlock(), createElementBlock("em", _hoisted_12$1, toDisplayString(unref(t2)("grid.hidden")), 1))
3426
3439
  ])
3427
3440
  ]);
3428
3441
  }), 128))
@@ -3539,16 +3552,16 @@ const _hoisted_7$2 = { class: "cl-flex cl-flex-wrap cl-w-full" };
3539
3552
  const _hoisted_8$1 = { class: "!cl-bg-white cl-absolute cl-h-screen cl-overflow-x-auto cl-p-4 cl-text-sm cl-w-full cl-z-10" };
3540
3553
  const _hoisted_9$1 = { class: "cl-border-b cl-border-grey-2 cl-mb-2 cl-pb-2 cl-text-right cl-w-full" };
3541
3554
  const _hoisted_10$1 = { class: "cl-grid cl-grid-cols-3" };
3542
- const _hoisted_11$1 = {
3555
+ const _hoisted_11 = {
3543
3556
  key: 1,
3544
3557
  class: "cl-ml-2"
3545
3558
  };
3546
- const _hoisted_12$1 = { class: "cl-overflow-auto cl-w-full" };
3547
- const _hoisted_13$1 = { class: "cl-min-w-full cl-table-fixed" };
3548
- const _hoisted_14$1 = { class: "cl-hidden lg:cl-table-column-group" };
3549
- const _hoisted_15$1 = { class: "cl-hidden lg:cl-table-header-group" };
3550
- const _hoisted_16$1 = ["onClick"];
3551
- const _hoisted_17$1 = { key: 1 };
3559
+ const _hoisted_12 = { class: "cl-overflow-auto cl-w-full" };
3560
+ const _hoisted_13 = { class: "cl-min-w-full cl-table-fixed" };
3561
+ const _hoisted_14 = { class: "cl-hidden lg:cl-table-column-group" };
3562
+ const _hoisted_15 = { class: "cl-hidden lg:cl-table-header-group" };
3563
+ const _hoisted_16 = ["onClick"];
3564
+ const _hoisted_17 = { key: 1 };
3552
3565
  const _hoisted_18 = { key: 0 };
3553
3566
  const _hoisted_19 = { key: 1 };
3554
3567
  const _hoisted_20 = ["colspan"];
@@ -3757,7 +3770,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3757
3770
  icon: "ph:caret-up",
3758
3771
  onClick: ($event) => setSort(column.field)
3759
3772
  }, null, 8, ["onClick"]))
3760
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_11$1, " \xA0 "))
3773
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_11, " \xA0 "))
3761
3774
  ]);
3762
3775
  }), 128))
3763
3776
  ], 512), [
@@ -3767,9 +3780,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3767
3780
  _: 1
3768
3781
  })
3769
3782
  ]),
3770
- createElementVNode("div", _hoisted_12$1, [
3771
- createElementVNode("table", _hoisted_13$1, [
3772
- createElementVNode("colgroup", _hoisted_14$1, [
3783
+ createElementVNode("div", _hoisted_12, [
3784
+ createElementVNode("table", _hoisted_13, [
3785
+ createElementVNode("colgroup", _hoisted_14, [
3773
3786
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, index) => {
3774
3787
  return openBlock(), createElementBlock("col", {
3775
3788
  key: index,
@@ -3778,7 +3791,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3778
3791
  }, null, 4);
3779
3792
  }), 128))
3780
3793
  ]),
3781
- createElementVNode("thead", _hoisted_15$1, [
3794
+ createElementVNode("thead", _hoisted_15, [
3782
3795
  createElementVNode("tr", null, [
3783
3796
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, index) => {
3784
3797
  var _a2;
@@ -3805,7 +3818,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3805
3818
  }, null, 512), [
3806
3819
  [vShow, unref(currentRequest).sort !== null && unref(currentRequest).sort.sortOnColumn === column.field && unref(currentRequest).sort.sortByAscending === false]
3807
3820
  ])
3808
- ], 8, _hoisted_16$1)) : (openBlock(), createElementBlock("span", _hoisted_17$1, toDisplayString(column.caption), 1))
3821
+ ], 8, _hoisted_16)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(column.caption), 1))
3809
3822
  ], 4);
3810
3823
  }), 128))
3811
3824
  ]),
@@ -4086,7 +4099,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4086
4099
  };
4087
4100
  }
4088
4101
  });
4089
- var clUiLogin_vue_vue_type_style_index_0_scoped_true_lang = "";
4090
4102
  const _hoisted_1$4 = { class: "cl-relative" };
4091
4103
  const _hoisted_2$3 = { class: "cl-h-screen cl-z-0" };
4092
4104
  const _hoisted_3$2 = { class: "cl-absolute cl-bg-secondary-default cl-gap-y-1 cl-grid cl-grid-cols-1 cl-left-0 cl-opacity-95 cl-p-6 cl-top-0 cl-w-full cl-z-10 lg:cl-gap-x-1 lg:cl-grid-cols-10 lg:cl-p-10" };
@@ -4097,16 +4109,9 @@ const _hoisted_5 = {
4097
4109
  };
4098
4110
  const _hoisted_6 = { class: "cl-col-span-3" };
4099
4111
  const _hoisted_7 = { class: "cl-inline cl-relative cl-text-grey-4" };
4100
- const _hoisted_8 = ["data-valid", "placeholder"];
4101
- const _hoisted_9 = { class: "cl-text-grey-3 cl-text-sm" };
4102
- const _hoisted_10 = { class: "cl-flex cl-mt-2" };
4103
- const _hoisted_11 = { class: "cl-align-middle cl-inline-block cl-ml-2" };
4104
- const _hoisted_12 = { class: "cl-flex cl-mt-2" };
4105
- const _hoisted_13 = { class: "cl-align-middle cl-inline-block cl-ml-2" };
4106
- const _hoisted_14 = { class: "cl-col-span-3" };
4107
- const _hoisted_15 = { class: "cl-inline cl-relative cl-text-grey-4" };
4108
- const _hoisted_16 = ["type", "data-valid", "placeholder"];
4109
- const _hoisted_17 = { class: "cl-col-span-10 cl-emphasis-danger cl-mt-10 cl-p-3 cl-rounded-md cl-text-sm md:cl-mt-3" };
4112
+ const _hoisted_8 = { class: "cl-col-span-3" };
4113
+ const _hoisted_9 = { class: "cl-inline cl-relative cl-text-grey-4" };
4114
+ const _hoisted_10 = { class: "cl-col-span-10 cl-emphasis-danger cl-mt-10 cl-p-3 cl-rounded-md cl-text-sm md:cl-mt-3" };
4110
4115
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4111
4116
  props: {
4112
4117
  errors: { default: () => [] },
@@ -4121,7 +4126,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4121
4126
  const username = ref("");
4122
4127
  const password = ref("");
4123
4128
  const passwordFieldType = ref("password");
4124
- const usernameValid = computed(() => /[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)/gi.test(username.value));
4129
+ const usernameValid = ref();
4125
4130
  function login() {
4126
4131
  const authentication = {
4127
4132
  username: username.value,
@@ -4132,18 +4137,31 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4132
4137
  function clearErrors() {
4133
4138
  emit("update:errors", []);
4134
4139
  }
4140
+ function emptyIsInvalidValidation(_, value) {
4141
+ const state = {
4142
+ valid: true,
4143
+ message: ""
4144
+ };
4145
+ if (typeof value === "string" && value.trim() === "") {
4146
+ state.valid = false;
4147
+ }
4148
+ return state;
4149
+ }
4150
+ function onUsernameValidated(valid, _) {
4151
+ usernameValid.value = valid;
4152
+ }
4135
4153
  return (_ctx, _cache) => {
4136
4154
  const _component_icon = resolveComponent("icon");
4137
4155
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
4138
4156
  createElementVNode("div", _hoisted_2$3, [
4139
- renderSlot(_ctx.$slots, "background", {}, void 0, true)
4157
+ renderSlot(_ctx.$slots, "background")
4140
4158
  ]),
4141
4159
  createElementVNode("form", _hoisted_3$2, [
4142
4160
  createElementVNode("div", _hoisted_4, [
4143
- renderSlot(_ctx.$slots, "logo", {}, void 0, true)
4161
+ renderSlot(_ctx.$slots, "logo")
4144
4162
  ]),
4145
4163
  _ctx.$slots["language-switcher"] ? (openBlock(), createElementBlock("div", _hoisted_5, [
4146
- renderSlot(_ctx.$slots, "language-switcher", {}, void 0, true)
4164
+ renderSlot(_ctx.$slots, "language-switcher")
4147
4165
  ])) : createCommentVNode("", true),
4148
4166
  createElementVNode("div", {
4149
4167
  class: normalizeClass(["cl-gap-y-4 cl-grid cl-grid-cols-1 lg:cl-gap-x-2 lg:cl-grid-cols-8", {
@@ -4154,66 +4172,39 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4154
4172
  createElementVNode("div", _hoisted_6, [
4155
4173
  createElementVNode("div", _hoisted_7, [
4156
4174
  createVNode(_component_icon, {
4157
- class: "cl-absolute cl-left-3 cl-top-2",
4175
+ class: "cl-absolute cl-left-3 cl-top-2.5",
4158
4176
  icon: "ph:user",
4159
4177
  size: 18
4160
4178
  }),
4161
- withDirectives(createElementVNode("input", {
4179
+ createVNode(ClUiInput, {
4180
+ modelValue: username.value,
4162
4181
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => username.value = $event),
4163
- class: "!cl-pb-1 !cl-pl-9 cl-w-full",
4164
- type: "email",
4165
- "data-valid": unref(usernameValid),
4166
- placeholder: unref(t2)("login.email"),
4182
+ modelModifiers: { trim: true },
4183
+ class: "!cl-border-2 !cl-mb-1 cl-w-full",
4184
+ "input-type": "email",
4185
+ "highlight-when-valid": true,
4186
+ label: "Username",
4187
+ "show-label": false,
4188
+ "placeholder-text": unref(t2)("login.email"),
4167
4189
  autocomplete: "username",
4168
- onInput: clearErrors
4169
- }, null, 40, _hoisted_8), [
4170
- [
4171
- vModelText,
4172
- username.value,
4173
- void 0,
4174
- { trim: true }
4175
- ]
4176
- ])
4177
- ]),
4178
- createVNode(Transition, { name: "fade" }, {
4179
- default: withCtx(() => [
4180
- withDirectives(createElementVNode("div", _hoisted_9, [
4181
- withDirectives(createElementVNode("div", _hoisted_10, [
4182
- createVNode(_component_icon, {
4183
- class: "cl-mt-1 cl-text-primary-default",
4184
- icon: "ph:check",
4185
- size: 16
4186
- }),
4187
- createElementVNode("em", _hoisted_11, toDisplayString(unref(t2)("login.validEmail")), 1)
4188
- ], 512), [
4189
- [vShow, unref(usernameValid)]
4190
- ]),
4191
- withDirectives(createElementVNode("div", _hoisted_12, [
4192
- createVNode(_component_icon, {
4193
- class: "cl-mt-1 cl-text-danger-default",
4194
- icon: "ph:x",
4195
- size: 16
4196
- }),
4197
- createElementVNode("em", _hoisted_13, toDisplayString(unref(t2)("login.invalidEmail")), 1)
4198
- ], 512), [
4199
- [vShow, !unref(usernameValid)]
4200
- ])
4201
- ], 512), [
4202
- [vShow, username.value !== ""]
4203
- ])
4204
- ]),
4205
- _: 1
4206
- })
4190
+ "validate-immediately": true,
4191
+ "custom-validation-function": emptyIsInvalidValidation,
4192
+ "input-specific-classes": "!cl-pl-9",
4193
+ "message-when-valid": unref(t2)("login.validEmail"),
4194
+ onInput: clearErrors,
4195
+ onValidated: onUsernameValidated
4196
+ }, null, 8, ["modelValue", "placeholder-text", "message-when-valid"])
4197
+ ])
4207
4198
  ]),
4208
- createElementVNode("div", _hoisted_14, [
4209
- createElementVNode("div", _hoisted_15, [
4199
+ createElementVNode("div", _hoisted_8, [
4200
+ createElementVNode("div", _hoisted_9, [
4210
4201
  createVNode(_component_icon, {
4211
- class: "cl-absolute cl-left-3 cl-top-2",
4202
+ class: "cl-absolute cl-left-3 cl-top-2.5",
4212
4203
  icon: "ph:lock",
4213
4204
  size: 18
4214
4205
  }),
4215
4206
  withDirectives(createVNode(_component_icon, {
4216
- class: "cl-absolute cl-cursor-pointer cl-right-3 cl-top-2",
4207
+ class: "cl-absolute cl-cursor-pointer cl-right-6 cl-top-2.5",
4217
4208
  icon: "ph:eye",
4218
4209
  size: 18,
4219
4210
  onClick: _cache[1] || (_cache[1] = ($event) => passwordFieldType.value = "text")
@@ -4221,24 +4212,26 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4221
4212
  [vShow, passwordFieldType.value === "password"]
4222
4213
  ]),
4223
4214
  withDirectives(createVNode(_component_icon, {
4224
- class: "cl-absolute cl-cursor-pointer cl-right-3 cl-top-2",
4215
+ class: "cl-absolute cl-cursor-pointer cl-right-6 cl-top-2.5",
4225
4216
  icon: "ph:eye-slash",
4226
4217
  size: 18,
4227
4218
  onClick: _cache[2] || (_cache[2] = ($event) => passwordFieldType.value = "password")
4228
4219
  }, null, 512), [
4229
4220
  [vShow, passwordFieldType.value === "text"]
4230
4221
  ]),
4231
- withDirectives(createElementVNode("input", {
4222
+ createVNode(ClUiInput, {
4223
+ modelValue: password.value,
4232
4224
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => password.value = $event),
4233
- class: "!cl-pb-1 !cl-pl-9 !cl-pr-9 cl-w-full",
4234
- type: passwordFieldType.value,
4235
- "data-valid": password.value !== "",
4236
- placeholder: unref(t2)("login.password"),
4225
+ class: "!cl-border-2 cl-w-full",
4226
+ "input-type": passwordFieldType.value,
4227
+ "highlight-when-valid": true,
4228
+ "placeholder-text": unref(t2)("login.password"),
4237
4229
  autocomplete: "current-password",
4230
+ "validate-immediately": true,
4231
+ "input-specific-classes": "!cl-pl-9 !cl-pr-9",
4232
+ "custom-validation-function": emptyIsInvalidValidation,
4238
4233
  onInput: clearErrors
4239
- }, null, 40, _hoisted_16), [
4240
- [vModelDynamic, password.value]
4241
- ])
4234
+ }, null, 8, ["modelValue", "input-type", "placeholder-text"])
4242
4235
  ])
4243
4236
  ]),
4244
4237
  createElementVNode("div", {
@@ -4247,10 +4240,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4247
4240
  }])
4248
4241
  }, [
4249
4242
  createVNode(_sfc_main$p, {
4250
- class: "cl-w-full",
4243
+ class: "!cl-leading-9 cl-w-full",
4251
4244
  colour: "blue",
4252
4245
  loading: __props.loading,
4253
- disabled: !unref(usernameValid) || password.value === "",
4246
+ disabled: !usernameValid.value || password.value === "",
4254
4247
  onClick: withModifiers(login, ["prevent"])
4255
4248
  }, {
4256
4249
  default: withCtx(() => [
@@ -4264,7 +4257,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4264
4257
  default: withCtx(() => {
4265
4258
  var _a;
4266
4259
  return [
4267
- withDirectives(createElementVNode("span", _hoisted_17, [
4260
+ withDirectives(createElementVNode("span", _hoisted_10, [
4268
4261
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.errors, (error, index) => {
4269
4262
  return openBlock(), createElementBlock("div", {
4270
4263
  key: index,
@@ -4283,7 +4276,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4283
4276
  };
4284
4277
  }
4285
4278
  });
4286
- var clUiLogin = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-b0617ab0"]]);
4287
4279
  const modalSizes = [
4288
4280
  "x-small",
4289
4281
  "small",
@@ -4476,7 +4468,7 @@ var components = /* @__PURE__ */ Object.freeze({
4476
4468
  isLanguageLocaleFormat,
4477
4469
  isLanguageArray,
4478
4470
  clUiLoadingSpinner: ClUiLoadingSpinner,
4479
- clUiLogin,
4471
+ clUiLogin: _sfc_main$5,
4480
4472
  clUiModal: _sfc_main$k,
4481
4473
  modalSizes,
4482
4474
  modalColours,
@@ -4737,4 +4729,4 @@ const install = (app) => {
4737
4729
  app.component(name, component);
4738
4730
  });
4739
4731
  };
4740
- export { DateFormat, FilterOperation, NumberFormat, buttonColours, buttonSizes, cardSizes, _sfc_main$v as clUiAccordion, clUiAccordionHeader, _sfc_main$u as clUiAccordionItem, _sfc_main$r as clUiApp, _sfc_main$p as clUiButton, _sfc_main$o as clUiCard, _sfc_main$g as clUiComboBox, clUiFooter, clUiGrid, clUiHeader, _sfc_main$7 as clUiHeaderMenu, ClUiInput as clUiInput, _sfc_main$6 as clUiLanguageSwitcher, ClUiLoadingSpinner as clUiLoadingSpinner, clUiLogin, _sfc_main$k as clUiModal, clUiNavigation, _sfc_main$2 as clUiNavigationGroup, _sfc_main$3 as clUiNavigationIcon, clUiNavigationItem, clUiNavigationSection, _sfc_main$s as clUiNotification, compareByProperty, copy, datetimeFormats, install as default, filterMethodTypes, generateStringId, getParamsByName, gridColumnTypes, i18n, inputTypes, isComboBoxCreateRequest, isComboBoxItem, isFilterRequest, isFilterResponse, isGridColumn, isGridColumnArray, isLanguageArray, isLanguageLocaleFormat, messages, modalColours, modalSizes, nameOf, numberFormats, setCurrentLocale, setLocaleDateTimeFormats, setLocaleMessages, setLocaleNumberFormats, showNotification, stringFormats, useDebouncer, validateEmail, validateMaxValue, validateMinValue };
4732
+ export { DateFormat, FilterOperation, NumberFormat, buttonColours, buttonSizes, cardSizes, _sfc_main$v as clUiAccordion, clUiAccordionHeader, _sfc_main$u as clUiAccordionItem, _sfc_main$r as clUiApp, _sfc_main$p as clUiButton, _sfc_main$o as clUiCard, _sfc_main$g as clUiComboBox, clUiFooter, clUiGrid, clUiHeader, _sfc_main$7 as clUiHeaderMenu, ClUiInput as clUiInput, _sfc_main$6 as clUiLanguageSwitcher, ClUiLoadingSpinner as clUiLoadingSpinner, _sfc_main$5 as clUiLogin, _sfc_main$k as clUiModal, clUiNavigation, _sfc_main$2 as clUiNavigationGroup, _sfc_main$3 as clUiNavigationIcon, clUiNavigationItem, clUiNavigationSection, _sfc_main$s as clUiNotification, compareByProperty, copy, datetimeFormats, install as default, filterMethodTypes, generateStringId, getParamsByName, gridColumnTypes, i18n, inputTypes, isComboBoxCreateRequest, isComboBoxItem, isFilterRequest, isFilterResponse, isGridColumn, isGridColumnArray, isLanguageArray, isLanguageLocaleFormat, messages, modalColours, modalSizes, nameOf, numberFormats, setCurrentLocale, setLocaleDateTimeFormats, setLocaleMessages, setLocaleNumberFormats, showNotification, stringFormats, useDebouncer, validateEmail, validateMaxValue, validateMinValue };