@sustaina/shared-ui 1.30.3 → 1.31.0

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/index.mjs CHANGED
@@ -700,7 +700,8 @@ function makeNewRow(field) {
700
700
  operator: op,
701
701
  value: "",
702
702
  multiTableSearch: field.multiTableSearch,
703
- lookupFieldName: field.lookupFieldName
703
+ lookupFieldName: field.lookupFieldName,
704
+ allowRegex: field.type === "text" ? field.allowRegex : void 0
704
705
  };
705
706
  }
706
707
  function useAdvanceSearch({ fields, limitRows }) {
@@ -743,7 +744,8 @@ function useAdvanceSearch({ fields, limitRows }) {
743
744
  value2: "",
744
745
  multiTableSearch: r.multiTableSearch,
745
746
  jsonPath: r.jsonPath,
746
- lookupFieldName: r.lookupFieldName
747
+ lookupFieldName: r.lookupFieldName,
748
+ allowRegex: r.allowRegex
747
749
  } : {
748
750
  id: r.id,
749
751
  fieldName: r.fieldName,
@@ -752,7 +754,8 @@ function useAdvanceSearch({ fields, limitRows }) {
752
754
  value: "",
753
755
  multiTableSearch: r.multiTableSearch,
754
756
  jsonPath: r.jsonPath,
755
- lookupFieldName: r.lookupFieldName
757
+ lookupFieldName: r.lookupFieldName,
758
+ allowRegex: r.allowRegex
756
759
  };
757
760
  })
758
761
  );
@@ -800,7 +803,8 @@ function useAdvanceSearch({ fields, limitRows }) {
800
803
  lookupFieldName: r.lookupFieldName,
801
804
  jsonPath: r.jsonPath,
802
805
  operator,
803
- value: ""
806
+ value: "",
807
+ allowRegex: r.allowRegex
804
808
  };
805
809
  })
806
810
  );
@@ -1390,11 +1394,19 @@ var ConditionTextInput = ({ row, control, onClear }) => /* @__PURE__ */ jsx(
1390
1394
  field.onChange("");
1391
1395
  onClear("value");
1392
1396
  };
1397
+ const handleChange = (e) => {
1398
+ const val = e.target.value;
1399
+ if (val !== "" && row.allowRegex && !row.allowRegex.test(val)) {
1400
+ return;
1401
+ }
1402
+ field.onChange(val);
1403
+ };
1393
1404
  return /* @__PURE__ */ jsxs(FormItem, { className: "relative", children: [
1394
1405
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
1395
1406
  Input,
1396
1407
  {
1397
1408
  ...field,
1409
+ onChange: handleChange,
1398
1410
  value: field.value ?? "",
1399
1411
  autoComplete: "off",
1400
1412
  inputMode: "text",
@@ -3129,7 +3141,8 @@ var DatetimeBuilder = class {
3129
3141
  case "after":
3130
3142
  return {
3131
3143
  [row.fieldName]: helper(
3132
- { gte: dayStart.toISOString() },
3144
+ { gte: dayEnd.toISOString() },
3145
+ // use end of the day time
3133
3146
  { multiTableSearch: row.multiTableSearch }
3134
3147
  )
3135
3148
  };