@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260615064052 → 0.8.1-dev.20260615084103

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 !== "") {
@@ -6074,6 +6085,7 @@ var DataList = (props) => {
6074
6085
  let pages = 0;
6075
6086
  console.log(props.addLinkText);
6076
6087
  const [isDataFound, setIsDataFound] = (0, import_react55.useState)(null);
6088
+ const [searchTerm, setSearchTerm] = (0, import_react55.useState)(props.query?.searchTerm ?? "");
6077
6089
  (0, import_react55.useEffect)(() => {
6078
6090
  if (props?.dataset) {
6079
6091
  if (props?.dataset.result && props.dataset.result.length > 0) {
@@ -6143,6 +6155,18 @@ var DataList = (props) => {
6143
6155
  },
6144
6156
  [dispatch, props, router]
6145
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]);
6146
6170
  builder = builder.setQuery(props.query);
6147
6171
  orderBy = builder.getOrderBy();
6148
6172
  activePageNumber = builder.getPageNumber(Constants.pagesize);
@@ -6326,6 +6350,16 @@ var DataList = (props) => {
6326
6350
  children: [
6327
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", {}),
6328
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
+ ),
6329
6363
  props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6330
6364
  InputControl_default,
6331
6365
  {
@@ -6478,6 +6512,16 @@ var DataList = (props) => {
6478
6512
  children: [
6479
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", {}),
6480
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
+ ),
6481
6525
  props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6482
6526
  InputControl_default,
6483
6527
  {
@@ -6635,6 +6679,7 @@ var DataListRenderer = ({
6635
6679
  setDataset(result);
6636
6680
  };
6637
6681
  fetchData();
6682
+ console.log(query, "bdhbfdhvd");
6638
6683
  }, [serviceRoute, query, params]);
6639
6684
  const [tabItem, setTabItem] = (0, import_react56.useState)();
6640
6685
  const activeTab = tabItem?.find((tab) => tab.isActive);
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 !== "") {
@@ -4462,6 +4473,7 @@ var DataList = (props) => {
4462
4473
  let pages = 0;
4463
4474
  console.log(props.addLinkText);
4464
4475
  const [isDataFound, setIsDataFound] = useState9(null);
4476
+ const [searchTerm, setSearchTerm] = useState9(props.query?.searchTerm ?? "");
4465
4477
  useEffect10(() => {
4466
4478
  if (props?.dataset) {
4467
4479
  if (props?.dataset.result && props.dataset.result.length > 0) {
@@ -4531,6 +4543,18 @@ var DataList = (props) => {
4531
4543
  },
4532
4544
  [dispatch, props, router]
4533
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]);
4534
4558
  builder = builder.setQuery(props.query);
4535
4559
  orderBy = builder.getOrderBy();
4536
4560
  activePageNumber = builder.getPageNumber(Constants.pagesize);
@@ -4714,6 +4738,16 @@ var DataList = (props) => {
4714
4738
  children: [
4715
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", {}),
4716
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
+ ),
4717
4751
  props.filters && props.filters.map((filter) => /* @__PURE__ */ jsx65(
4718
4752
  InputControl_default,
4719
4753
  {
@@ -4866,6 +4900,16 @@ var DataList = (props) => {
4866
4900
  children: [
4867
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", {}),
4868
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
+ ),
4869
4913
  props.filters && props.filters.map((filter) => /* @__PURE__ */ jsx65(
4870
4914
  InputControl_default,
4871
4915
  {
@@ -5022,6 +5066,7 @@ var DataListRenderer = ({
5022
5066
  setDataset(result);
5023
5067
  };
5024
5068
  fetchData();
5069
+ console.log(query, "bdhbfdhvd");
5025
5070
  }, [serviceRoute, query, params]);
5026
5071
  const [tabItem, setTabItem] = useState10();
5027
5072
  const activeTab = tabItem?.find((tab) => tab.isActive);
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.20260615064052",
3
+ "version": "0.8.1-dev.20260615084103",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",