impaktapps-ui-builder 1.0.436 → 1.0.438

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.
@@ -1,4 +1,4 @@
1
- export declare const TableSection: (theme: any) => {
1
+ export declare const TableSection: (theme: any, scopeName?: string) => {
2
2
  type: string;
3
3
  elements: {
4
4
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.436",
3
+ "version": "1.0.438",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -22,27 +22,31 @@ export default (FormData: any) => {
22
22
  if (formData.events) {
23
23
  delete formData.events
24
24
  }
25
+ if (formData.tabLabelElements) {
26
+ component.tabLabelElements = formData.tabLabelElements || [];
27
+ delete formData.tabLabelElements
28
+ }
25
29
  component = { ...formData, ...component };
26
30
  return component;
27
31
  };
28
32
 
29
33
  export const createLayoutFormat = (layout: any[], type?: string) => {
30
34
  if (_.isEmpty(layout)) {
31
- const fullLayoutComponents: string[] = ["WrapperSection", "DataGrid", "LeaderBoard", "PopUp", "TextArea", "TreeMap", "Thought", "HorizontalLayout","Table"]
32
- if(fullLayoutComponents.includes(type)){
35
+ const fullLayoutComponents: string[] = ["WrapperSection", "DataGrid", "LeaderBoard", "PopUp", "TextArea", "TreeMap", "Thought", "HorizontalLayout", "Table"]
36
+ if (fullLayoutComponents.includes(type)) {
33
37
  return { xs: 12, sm: 12, md: 12, lg: 12 }
34
38
  }
35
- else if(type === "Graph"){
36
- return {xs :12,sm:12,md:12,lg:6}
39
+ else if (type === "Graph") {
40
+ return { xs: 12, sm: 12, md: 12, lg: 6 }
37
41
  }
38
- else if(type === "Button"){
42
+ else if (type === "Button") {
39
43
  return { xs: 4, sm: 2.5, md: 2, lg: 1.5 }
40
44
  }
41
- else{
45
+ else {
42
46
  return { xs: 6, sm: 6, md: 4, lg: 3 }
43
47
  }
44
48
  }
45
- let data: any = { };
49
+ let data: any = {};
46
50
 
47
51
  layout.map((e: any) => {
48
52
  data[e.key || "xs"] =
@@ -20,9 +20,6 @@ export const buildMultiSelect = (config, componentScope) => {
20
20
  }
21
21
  if (config.lazyLoading) {
22
22
  multipleSelect.config.main.lazyLoading = config.lazyLoading === "YES" ? true : false;
23
- if (config.lazyLoading === "YES" && config.pageSize) {
24
- multipleSelect.config.main.pageSize = config.pageSize;
25
- }
26
23
  }
27
24
  if (config.toolTip) {
28
25
  multipleSelect.config.main.toolTip = config.toolTip;
@@ -13,9 +13,6 @@ export const buildSelect = (config: any, componentScope: string) => {
13
13
  }
14
14
  if (config.lazyLoading) {
15
15
  selectInputField.config.main.lazyLoading = config.lazyLoading === "YES" ? true : false;
16
- if (config.lazyLoading === "YES" && config.pageSize) {
17
- selectInputField.config.main.pageSize = config.pageSize;
18
- }
19
16
  }
20
17
  if (config.variant) {
21
18
  selectInputField.config.main.variant = config.variant;
@@ -295,7 +295,6 @@ const buildUiSchema = (config: any, store?: any) => {
295
295
  case "PdfViewer":
296
296
  elements = buildPdfViewer(config, componentScope);
297
297
  break;
298
- break;
299
298
  default:
300
299
  schema = {
301
300
  type: "object",
@@ -404,6 +403,11 @@ const buildUiSchema = (config: any, store?: any) => {
404
403
  });
405
404
  }
406
405
  }
406
+ if (config.tabLabelElements) {
407
+ elements.tabLabelElements = config.tabLabelElements.map((e: any, elemInd: number) => {
408
+ return buildUiSchema(e, store)
409
+ });
410
+ }
407
411
  return elements;
408
412
  }
409
413
 
@@ -676,7 +676,6 @@ export const buildPropertiesSection = function (type: String) {
676
676
  case "Select":
677
677
  uiSchema.elements = [
678
678
  getRadioInputField("lazyLoading", "Lazy Loading", ["YES", "NO"]),
679
- getInputField("pageSize", "Single Page Size"),
680
679
  getRadioInputField("freeSolo", "FreeSolo", ["YES", "NO"]),
681
680
  getSelectField("variant", "Variant", [
682
681
  { label: "Outlined", value: "outlined" },
@@ -690,13 +689,12 @@ export const buildPropertiesSection = function (type: String) {
690
689
  { label: "Right", value: "right" },
691
690
  { label: "Bottom", value: "bottom" }
692
691
  ]),
693
- emptyBox("SelectEmpty", { xs: 0, sm: 0, md: 0, lg: 6 })
692
+ emptyBox("SelectEmpty", { xs: 6, sm: 6, md: 8, lg: 9 })
694
693
  ]
695
694
  break;
696
695
  case "MultipleSelect":
697
696
  uiSchema.elements = [
698
697
  getRadioInputField("lazyLoading", "Lazy Loading", ["YES", "NO"]),
699
- getInputField("pageSize", "Single Page Size"),
700
698
  getSelectField("variant", "Variant", [
701
699
  { label: "Outlined", value: "outlined" },
702
700
  { label: "Filled", value: "filled" },
@@ -1,10 +1,10 @@
1
- export const TableSection = (theme) => {
1
+ export const TableSection = (theme,scopeName="elements") => {
2
2
  const uiSchema = {
3
3
  type: "HorizontalLayout",
4
4
  elements: [
5
5
  {
6
6
  type: "Control",
7
- scope: "#/properties/elements",
7
+ scope: `#/properties/${scopeName}`,
8
8
  options: {
9
9
  widget: "Table",
10
10
  },
@@ -15,8 +15,7 @@ export const TableSection = (theme) => {
15
15
  {
16
16
  widget: {
17
17
  type: "Control",
18
- scope: "#/properties/New_Record",
19
-
18
+ scope: `#/properties/${scopeName}_New_Record`,
20
19
  options: {
21
20
  widget: "IconButton",
22
21
  },
@@ -43,7 +42,7 @@ export const TableSection = (theme) => {
43
42
  {
44
43
  widget: {
45
44
  type: "Control",
46
- scope: "#/properties/Paste_Component",
45
+ scope: scopeName === "elements" ? `#/properties/Paste_Component` : `#/properties/Paste_TabsComponent`,
47
46
  options: {
48
47
  widget: "IconButton",
49
48
  },
@@ -109,7 +108,7 @@ export const TableSection = (theme) => {
109
108
  },
110
109
  {
111
110
  type: "Control",
112
- scope: "#/properties/Copy_Component",
111
+ scope: scopeName === "elements" ? `#/properties/Copy_Component` : `#/properties/Copy_TabsComponent`,
113
112
  options: {
114
113
  widget: "Button",
115
114
  },
@@ -16,7 +16,7 @@ const sectionLabels = {
16
16
  LeaderBoard: ["Core", "Components", "Properties", "Events", "Style",],
17
17
  WrapperSection: ["Core", "Components", "Properties", "Style",],
18
18
  HorizontalLayout: ["Core", "Components", "Properties", "Style",],
19
- TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
19
+ TabSection: ["Core", "Components", "TabLebelComponet", "Properties", "Style", "Validation"],
20
20
  SpeedoMeter: ["Core", "Properties", "Events", "Style",],
21
21
  card: ["Core", "Properties", "Events", "Style", "Validation"],
22
22
  UploadFile: ["Core", "Events", "Style", "Validation"],
@@ -39,7 +39,7 @@ const sectionLabels = {
39
39
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
40
40
  PopUp: ["Core", "Components", "Properties", "Events", "Style"],
41
41
  PopOver: ["Core", "Components", "Properties", "Style"],
42
- PdfViewer: ["Core","Properties", "Style"],
42
+ PdfViewer: ["Core", "Properties", "Style"],
43
43
  Stepper: ["Core", "Components", "Properties", "Events", "Style"],
44
44
  DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
45
45
  InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
@@ -63,6 +63,7 @@ export function refreshPage(type: string, store: any) {
63
63
  Style: StyleSection,
64
64
  Events: EventSection(store.theme.myTheme),
65
65
  Components: TableSection(store.theme.myTheme),
66
+ TabLebelComponet: TableSection(store.theme.myTheme, "tabLabelElements"),
66
67
  Properties: buildPropertiesSection(type),
67
68
  Validation: ValidationSection
68
69
  }
@@ -74,7 +75,7 @@ export function refreshPage(type: string, store: any) {
74
75
  // Get Widget Type of parent
75
76
  const path = store.searchParams?.get("path");
76
77
  const lastDotIndex = path.lastIndexOf('.')
77
- const parentPath = path.slice(0,lastDotIndex)
78
+ const parentPath = path.slice(0, lastDotIndex)
78
79
 
79
80
  const parentObj = _.get(currentConfig, parentPath)
80
81
 
@@ -234,7 +235,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
234
235
  if (sessionStorage.getItem("copiedConfig")) {
235
236
  schema.properties.RemoveItemButton.disabled = false;
236
237
  }
237
-
238
+
238
239
  const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
239
240
  const path = store.searchParams?.get("path");
240
241
  const id = store.searchParams?.get("id")
@@ -283,8 +284,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
283
284
  const id = store.searchParams?.get("id");
284
285
  saveFormdataInSessionStorage(store.ctx.core.data, path)
285
286
  if (path) {
286
- const path = store.searchParams?.get("path");
287
- const finalPath = `${path}.elements[${rowId}]`
287
+ let finalPath = `${path}`;
288
+ if (dynamicData?.path?.startsWith("tabLabels")) {
289
+ finalPath = `${finalPath}.tabLabelElements[${rowId}]`
290
+ } else {
291
+ finalPath = `${finalPath}.elements[${rowId}]`
292
+ }
288
293
  store.searchParams.set("path", finalPath)
289
294
  store.setSearchParams(store.searchParams)
290
295
  this.setPage()
@@ -295,7 +300,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
295
300
  deleteComponents: function (shouldUpdateDialog: boolean = true) {
296
301
  const path = store.searchParams?.get("path");
297
302
  const rowId = sessionStorage.getItem('rowId');
298
- store.formData.elements.splice(rowId, 1);
303
+ const isTabLabelElements = sessionStorage.getItem('isTabLabelElements') === "true";
304
+ if (isTabLabelElements) {
305
+ store.formData.tabLabelElements.splice(rowId, 1);
306
+ } else {
307
+ store.formData.elements.splice(rowId, 1);
308
+ }
299
309
  const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
300
310
  const data = path ? _.get(response, path) : response;
301
311
  store.setFormdata(data);
@@ -303,6 +313,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
303
313
  store.updateDialog("popUpComponentSection");
304
314
  }
305
315
  sessionStorage.removeItem('rowId');
316
+ sessionStorage.removeItem('isTabLabelElements');
306
317
  },
307
318
  deleteEvent: function (shouldUpdateDialog: boolean = true) {
308
319
  const path = store.searchParams?.get("path");
@@ -321,9 +332,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
321
332
  if (!Array.isArray(store.formData.elements)) {
322
333
  store.formData.elements = []
323
334
  }
335
+ if (!Array.isArray(store.formData.tabLabelElements)) {
336
+ store.formData.tabLabelElements = []
337
+ }
324
338
  const path = store.searchParams?.get("path");
325
339
  saveFormdataInSessionStorage(store.ctx.core.data, path)
326
- const finalPath = `${path}.elements[${store.formData.elements.length}]`
340
+ let finalPath = `${path}`;
341
+ if (dynamicData.path.startsWith("tabLabels")) {
342
+ finalPath = `${finalPath}.tabLabelElements[${store.formData.tabLabelElements.length}]`
343
+ } else {
344
+ finalPath = `${finalPath}.elements[${store.formData.elements.length}]`
345
+ }
327
346
  store.searchParams.set("path", finalPath)
328
347
  store.setSearchParams(store.searchParams)
329
348
  this.setPage()
@@ -355,6 +374,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
355
374
  deletePopUpComponent: function () {
356
375
  const rowId = dynamicData.path.split(".")[1];
357
376
  sessionStorage.setItem('rowId', rowId);
377
+ sessionStorage.setItem('isTabLabelElements', dynamicData.path.startsWith("tabLabels") ? "true" : "false");
358
378
  store.updateDialog("popUpComponentSection");
359
379
  },
360
380
  deletePopUpEvent: function () {
@@ -401,9 +421,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
401
421
  if (!Array.isArray(store.formData.events)) {
402
422
  store.formData.events = []
403
423
  }
424
+ if (!Array.isArray(store.formData.tabLabelElements)) {
425
+ store.formData.tabLabelElements = []
426
+ }
404
427
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
405
428
  const formData = getFormdataFromSessionStorage(pastedElementParentPath);
406
- const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
429
+ const currentLength = {
430
+ "TabsComponent": formData.tabLabelElements.length,
431
+ "Component": formData.elements.length,
432
+ "Events": formData.events.length
433
+ };
434
+ const insertElementIndex = currentLength[elementType] || 0;
407
435
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
408
436
 
409
437
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
@@ -440,6 +468,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
440
468
  elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
441
469
  if (elementType === "Component") {
442
470
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
471
+ }
472
+ if(elementType === "TabsComponent"){
473
+ return `${parentPath}.tabLabelElements[${rowId}]`
443
474
  }
444
475
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
445
476
  },
@@ -196,14 +196,14 @@ export default (funcParams: funcParamsProps) => {
196
196
  return response?.data;
197
197
  },
198
198
  getSelectOptions: async function (param) {
199
- const apiBody = [
200
- { key: "searchValue", value: param.searchValue },
201
- { key: "currentValue", value: param.currentValue },
202
- { key: "currentItemCount", value: param.currentItemCount },
203
- { key: "limit", value: param.limit },
204
- ]
205
- const response = await this.callExecuteEvents(param, apiBody, "onLoad");
206
- return response?.data;
199
+ if (param.serachValue !== "" && param.serachValue !== undefined) {
200
+ const apiBody = [
201
+ { key: "searchValue", value: param.serachValue },
202
+ { key: "currentValue", value: param.currentValue }
203
+ ]
204
+ const response = await this.callExecuteEvents(param, apiBody, "onLoad");
205
+ return response?.data;
206
+ }
207
207
  },
208
208
  onChange: function () {
209
209
  if (!eventGroups.onChange) return;