@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260615062630 → 0.8.1-dev.20260615070214

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.js CHANGED
@@ -4945,6 +4945,9 @@ var OdataBuilder = class {
4945
4945
  if (key == "$orderby") {
4946
4946
  this.setOrderBy(odata[key]);
4947
4947
  }
4948
+ if (key == "searchTerm") {
4949
+ this.searchTerm = odata[key];
4950
+ }
4948
4951
  }
4949
4952
  }
4950
4953
  }
@@ -5020,6 +5023,9 @@ var OdataBuilder = class {
5020
5023
  if (this.orderBy !== null && this.orderBy !== "") {
5021
5024
  url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
5022
5025
  }
5026
+ if (this.searchTerm) {
5027
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
5028
+ }
5023
5029
  console.log(url);
5024
5030
  return url;
5025
5031
  }
@@ -5028,6 +5034,9 @@ var OdataBuilder = class {
5028
5034
  if (this.filterBy !== null && this.filterBy !== "") {
5029
5035
  url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
5030
5036
  }
5037
+ if (this.searchTerm) {
5038
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
5039
+ }
5031
5040
  url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
5032
5041
  return url;
5033
5042
  }
@@ -5053,7 +5062,9 @@ var OdataBuilder = class {
5053
5062
  return url;
5054
5063
  }
5055
5064
  getNewPageSizeUrl(pageSize) {
5056
- const currentPage = this.getPageNumber(parseInt(this.top || Constants.pagesize.toString()));
5065
+ const currentPage = this.getPageNumber(
5066
+ parseInt(this.top || Constants.pagesize.toString())
5067
+ );
5057
5068
  const skip = (currentPage - 1) * pageSize;
5058
5069
  let url = `${this.baseUrl}?$skip=${skip}&$top=${pageSize}&$count=true`;
5059
5070
  if (this.filterBy !== null && this.filterBy !== "") {
@@ -5649,8 +5660,14 @@ var DivContainer = async (props) => {
5649
5660
  }
5650
5661
  const shouldHideContainer = () => {
5651
5662
  if (!props.node.fieldVisibleOnTrue) return false;
5652
- const fieldValue = getNestedValue3(props.dataitem, props.node.fieldVisibleOnTrue);
5653
- return fieldValue !== void 0 && fieldValue === false;
5663
+ const condition = props.node.fieldVisibleOnTrue;
5664
+ const isNegated = condition.startsWith("!");
5665
+ const fieldName = isNegated ? condition.substring(1) : condition;
5666
+ const fieldValue = getNestedValue3(props.dataitem, fieldName);
5667
+ if (fieldValue === void 0) {
5668
+ return false;
5669
+ }
5670
+ return isNegated ? fieldValue === true : fieldValue === false;
5654
5671
  };
5655
5672
  const isHidden = shouldHideContainer();
5656
5673
  let odataString = void 0;
@@ -6068,6 +6085,7 @@ var DataList = (props) => {
6068
6085
  let pages = 0;
6069
6086
  console.log(props.addLinkText);
6070
6087
  const [isDataFound, setIsDataFound] = (0, import_react55.useState)(null);
6088
+ const [searchTerm, setSearchTerm] = (0, import_react55.useState)(props.query?.searchTerm ?? "");
6071
6089
  (0, import_react55.useEffect)(() => {
6072
6090
  if (props?.dataset) {
6073
6091
  if (props?.dataset.result && props.dataset.result.length > 0) {
@@ -6137,6 +6155,18 @@ var DataList = (props) => {
6137
6155
  },
6138
6156
  [dispatch, props, router]
6139
6157
  );
6158
+ (0, import_react55.useEffect)(() => {
6159
+ const timeout = setTimeout(() => {
6160
+ const builder2 = new OdataBuilder(props.path);
6161
+ builder2.setQuery({
6162
+ ...props.query,
6163
+ searchTerm,
6164
+ $skip: "0"
6165
+ });
6166
+ router.push(builder2.getUrl());
6167
+ }, 500);
6168
+ return () => clearTimeout(timeout);
6169
+ }, [searchTerm]);
6140
6170
  builder = builder.setQuery(props.query);
6141
6171
  orderBy = builder.getOrderBy();
6142
6172
  activePageNumber = builder.getPageNumber(Constants.pagesize);
@@ -6320,6 +6350,16 @@ var DataList = (props) => {
6320
6350
  children: [
6321
6351
  props.title ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", {}),
6322
6352
  /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center gap-3", children: [
6353
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6354
+ InputControl_default,
6355
+ {
6356
+ name: "Search_input",
6357
+ controlType: InputControlType_default.lineTextInput,
6358
+ value: searchTerm,
6359
+ callback: (e) => setSearchTerm(e.value),
6360
+ attributes: { placeholder: "Search..." }
6361
+ }
6362
+ ),
6323
6363
  props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6324
6364
  InputControl_default,
6325
6365
  {
@@ -6472,6 +6512,16 @@ var DataList = (props) => {
6472
6512
  children: [
6473
6513
  props.title ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", {}),
6474
6514
  /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center gap-3", children: [
6515
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6516
+ InputControl_default,
6517
+ {
6518
+ name: "Search_input",
6519
+ controlType: InputControlType_default.lineTextInput,
6520
+ value: searchTerm,
6521
+ callback: (e) => setSearchTerm(e.value),
6522
+ attributes: { placeholder: "Search..." }
6523
+ }
6524
+ ),
6475
6525
  props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6476
6526
  InputControl_default,
6477
6527
  {
package/dist/index.mjs CHANGED
@@ -3340,6 +3340,9 @@ var OdataBuilder = class {
3340
3340
  if (key == "$orderby") {
3341
3341
  this.setOrderBy(odata[key]);
3342
3342
  }
3343
+ if (key == "searchTerm") {
3344
+ this.searchTerm = odata[key];
3345
+ }
3343
3346
  }
3344
3347
  }
3345
3348
  }
@@ -3415,6 +3418,9 @@ var OdataBuilder = class {
3415
3418
  if (this.orderBy !== null && this.orderBy !== "") {
3416
3419
  url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
3417
3420
  }
3421
+ if (this.searchTerm) {
3422
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
3423
+ }
3418
3424
  console.log(url);
3419
3425
  return url;
3420
3426
  }
@@ -3423,6 +3429,9 @@ var OdataBuilder = class {
3423
3429
  if (this.filterBy !== null && this.filterBy !== "") {
3424
3430
  url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
3425
3431
  }
3432
+ if (this.searchTerm) {
3433
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
3434
+ }
3426
3435
  url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
3427
3436
  return url;
3428
3437
  }
@@ -3448,7 +3457,9 @@ var OdataBuilder = class {
3448
3457
  return url;
3449
3458
  }
3450
3459
  getNewPageSizeUrl(pageSize) {
3451
- const currentPage = this.getPageNumber(parseInt(this.top || Constants.pagesize.toString()));
3460
+ const currentPage = this.getPageNumber(
3461
+ parseInt(this.top || Constants.pagesize.toString())
3462
+ );
3452
3463
  const skip = (currentPage - 1) * pageSize;
3453
3464
  let url = `${this.baseUrl}?$skip=${skip}&$top=${pageSize}&$count=true`;
3454
3465
  if (this.filterBy !== null && this.filterBy !== "") {
@@ -4043,8 +4054,14 @@ var DivContainer = async (props) => {
4043
4054
  }
4044
4055
  const shouldHideContainer = () => {
4045
4056
  if (!props.node.fieldVisibleOnTrue) return false;
4046
- const fieldValue = getNestedValue3(props.dataitem, props.node.fieldVisibleOnTrue);
4047
- return fieldValue !== void 0 && fieldValue === false;
4057
+ const condition = props.node.fieldVisibleOnTrue;
4058
+ const isNegated = condition.startsWith("!");
4059
+ const fieldName = isNegated ? condition.substring(1) : condition;
4060
+ const fieldValue = getNestedValue3(props.dataitem, fieldName);
4061
+ if (fieldValue === void 0) {
4062
+ return false;
4063
+ }
4064
+ return isNegated ? fieldValue === true : fieldValue === false;
4048
4065
  };
4049
4066
  const isHidden = shouldHideContainer();
4050
4067
  let odataString = void 0;
@@ -4456,6 +4473,7 @@ var DataList = (props) => {
4456
4473
  let pages = 0;
4457
4474
  console.log(props.addLinkText);
4458
4475
  const [isDataFound, setIsDataFound] = useState9(null);
4476
+ const [searchTerm, setSearchTerm] = useState9(props.query?.searchTerm ?? "");
4459
4477
  useEffect10(() => {
4460
4478
  if (props?.dataset) {
4461
4479
  if (props?.dataset.result && props.dataset.result.length > 0) {
@@ -4525,6 +4543,18 @@ var DataList = (props) => {
4525
4543
  },
4526
4544
  [dispatch, props, router]
4527
4545
  );
4546
+ useEffect10(() => {
4547
+ const timeout = setTimeout(() => {
4548
+ const builder2 = new OdataBuilder(props.path);
4549
+ builder2.setQuery({
4550
+ ...props.query,
4551
+ searchTerm,
4552
+ $skip: "0"
4553
+ });
4554
+ router.push(builder2.getUrl());
4555
+ }, 500);
4556
+ return () => clearTimeout(timeout);
4557
+ }, [searchTerm]);
4528
4558
  builder = builder.setQuery(props.query);
4529
4559
  orderBy = builder.getOrderBy();
4530
4560
  activePageNumber = builder.getPageNumber(Constants.pagesize);
@@ -4708,6 +4738,16 @@ var DataList = (props) => {
4708
4738
  children: [
4709
4739
  props.title ? /* @__PURE__ */ jsx65("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ jsx65("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ jsx65("div", {}),
4710
4740
  /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-3", children: [
4741
+ /* @__PURE__ */ jsx65(
4742
+ InputControl_default,
4743
+ {
4744
+ name: "Search_input",
4745
+ controlType: InputControlType_default.lineTextInput,
4746
+ value: searchTerm,
4747
+ callback: (e) => setSearchTerm(e.value),
4748
+ attributes: { placeholder: "Search..." }
4749
+ }
4750
+ ),
4711
4751
  props.filters && props.filters.map((filter) => /* @__PURE__ */ jsx65(
4712
4752
  InputControl_default,
4713
4753
  {
@@ -4860,6 +4900,16 @@ var DataList = (props) => {
4860
4900
  children: [
4861
4901
  props.title ? /* @__PURE__ */ jsx65("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ jsx65("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ jsx65("div", {}),
4862
4902
  /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-3", children: [
4903
+ /* @__PURE__ */ jsx65(
4904
+ InputControl_default,
4905
+ {
4906
+ name: "Search_input",
4907
+ controlType: InputControlType_default.lineTextInput,
4908
+ value: searchTerm,
4909
+ callback: (e) => setSearchTerm(e.value),
4910
+ attributes: { placeholder: "Search..." }
4911
+ }
4912
+ ),
4863
4913
  props.filters && props.filters.map((filter) => /* @__PURE__ */ jsx65(
4864
4914
  InputControl_default,
4865
4915
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260615062630",
3
+ "version": "0.8.1-dev.20260615070214",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",