impaktapps-ui-builder 0.0.101-alpha.72 → 0.0.101-alpha.74

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.101-alpha.72",
3
+ "version": "0.0.101-alpha.74",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -2,22 +2,25 @@ import _ from "lodash";
2
2
  import TextInputField from "./uischema/textInputField";
3
3
  import { createLayoutFormat } from "./buildConfig";
4
4
 
5
- export const buildTextField = (config:any,componentScope:string) =>{
6
- const inputField: any = _.cloneDeep(TextInputField);
7
- inputField.config.main.label = config.label;
8
- if (config.style) {
9
- inputField.config.style = JSON.parse(config.style)
10
- }
11
- if (config.InputFormatingAndMasking) {
12
- inputField.config.main.formatStrArray = config.InputFormatingAndMasking.map(e => e.formatElement);
13
- }
14
- if (config.placeholder) {
15
- inputField.config.main.placeholder = config.placeholder;
16
- }
17
- if (config.layout) {
18
- inputField.config.layout = createLayoutFormat(config.layout)
19
- }
20
- inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
21
- inputField.scope = componentScope;
22
- return inputField;
5
+ export const buildTextField = (config: any, componentScope: string) => {
6
+ const inputField: any = _.cloneDeep(TextInputField);
7
+ inputField.config.main.label = config.label;
8
+ if (config.style) {
9
+ inputField.config.style = JSON.parse(config.style)
10
+ }
11
+ if (config.multiline) {
12
+ inputField.config.main.multiline = config.multiline === "YES" ? true : false;
13
+ }
14
+ if (config.InputFormatingAndMasking) {
15
+ inputField.config.main.formatStrArray = config.InputFormatingAndMasking.map(e => e.formatElement);
16
+ }
17
+ if (config.placeholder) {
18
+ inputField.config.main.placeholder = config.placeholder;
19
+ }
20
+ if (config.layout) {
21
+ inputField.config.layout = createLayoutFormat(config.layout)
22
+ }
23
+ inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
24
+ inputField.scope = componentScope;
25
+ return inputField;
23
26
  }
@@ -365,7 +365,8 @@ const buildUiSchema = (config: any, store?: any) => {
365
365
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
366
366
  // enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
367
367
  columnFilterModeOptions: cellElem.filteringOptions,
368
- enableColumnFilter: cellElem.enableFilter === "Yes" ? true : false
368
+ enableColumnFilter: cellElem.enableFilter === "Yes" ? true : false,
369
+ enableSorting: cellElem.enableSorting === "Yes" ? true : false
369
370
  }
370
371
  } else {
371
372
  return {
@@ -375,7 +376,8 @@ const buildUiSchema = (config: any, store?: any) => {
375
376
  size: sizeMap[cellElem.name] || 180,
376
377
  // enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
377
378
  columnFilterModeOptions: cellElem.filteringOptions,
378
- enableColumnFilter: cellElem.enableFilter === "Yes" ? true : false
379
+ enableColumnFilter: cellElem.enableFilter === "Yes" ? true : false,
380
+ enableSorting: cellElem.enableSorting === "Yes" ? true : false
379
381
  }
380
382
  }
381
383
 
@@ -322,7 +322,7 @@ export const buildPropertiesSection = function (type: String) {
322
322
  case "Text":
323
323
  uiSchema.elements = [
324
324
  getInputField("placeholder", "Placeholder"),
325
- emptyBox("TextEmpty1", {xs: 6, sm: 6, md: 4, lg: 4 }),
325
+ getRadioInputField("multiline", "Multiline", ["YES", "NO"]),
326
326
  emptyBox("TextEmpty1", {xs: 0, sm: 0, md: 4, lg: 4 }),
327
327
  getArrayControl("InputFormatingAndMasking", "formatElement", "Format Element")
328
328
  ]
@@ -83,7 +83,7 @@ export function refreshPage (type: string, store: any) {
83
83
  },
84
84
  },
85
85
  };
86
- UiSchema.elements[0].elements[0].elements[5] =
86
+ UiSchema.elements[0].elements[0].elements[6] =
87
87
  {
88
88
  type: "Control",
89
89
  scope: "#/properties/filteringOptions",
@@ -98,7 +98,7 @@ export function refreshPage (type: string, store: any) {
98
98
  },
99
99
  },
100
100
  };
101
- UiSchema.elements[0].elements[0].elements[6] =
101
+ UiSchema.elements[0].elements[0].elements[5] =
102
102
  {
103
103
  type: "Control",
104
104
  scope: "#/properties/enableFilter",
@@ -110,16 +110,30 @@ export function refreshPage (type: string, store: any) {
110
110
  main: {
111
111
  label: "Enable Filter",
112
112
  options: ["Yes", "No"],
113
- errorMessage: "Active is not marked YES or NO",
114
113
  },
115
114
  },
116
115
  },
117
116
  UiSchema.elements[0].elements[0].elements[7] =
117
+ {
118
+ type: "Control",
119
+ scope: "#/properties/enableSorting",
120
+ options: {
121
+ widget: "RadioInputField",
122
+ },
123
+ config: {
124
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
125
+ main: {
126
+ label: "Enable Sorting",
127
+ options: ["Yes", "No"],
128
+ },
129
+ },
130
+ },
131
+ UiSchema.elements[0].elements[0].elements[8] =
118
132
  {
119
133
  type: "Control",
120
134
  scope: "#/properties/proc",
121
135
  config: {
122
- layout: { xs: 0, sm: 0, md: 0, lg: 6 },
136
+ layout: { xs: 6, sm: 6, md: 8, lg: 3 },
123
137
  },
124
138
  options: {
125
139
  widget: "EmptyBox",
@@ -1,4 +1,4 @@
1
- import _, { cloneDeep } from "lodash";
1
+ import _ from "lodash";
2
2
  import { handlersProps } from "./interface";
3
3
  export const executeEvents = (params: handlersProps) => {
4
4
  let nextEvent = [];
@@ -186,6 +186,13 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
186
186
  store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
187
187
  }
188
188
  }
189
+ else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
190
+ if (handlerResponse && handlerResponse?.data) {
191
+ formDataHolder[componentName] = handlerResponse.data?.data
192
+ formDataHolder[`${componentName}_RowCount`] = handlerResponse.data?.meta?.totalRowCount
193
+ store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
194
+ }
195
+ }
189
196
  else {
190
197
  if (handlerResponse) {
191
198
  formDataHolder[componentName] = handlerResponse.data
@@ -294,7 +294,7 @@ export default (funcParams: funcParamsProps) => {
294
294
  fontSize: "12px",
295
295
  cursor: "pointer",
296
296
  marginLeft: "2px",
297
-
297
+
298
298
  top: 3,
299
299
  right: "12px",
300
300
  position: "absolute",
@@ -319,12 +319,12 @@ export default (funcParams: funcParamsProps) => {
319
319
  await executeRefreshHandler({
320
320
  config: {}, componentName: "",
321
321
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
322
- serviceHolder: this, eventGroups, formDataHolder
322
+ serviceHolder: this, eventGroups, formDataHolder: {}
323
323
  })
324
324
  funcParams.store.setSchema(
325
325
  (pre: any) => {
326
326
  return {
327
- ...schema,...pre, properties:
327
+ ...schema, ...pre, properties:
328
328
  { ...schema.properties, ...pre.properties, }
329
329
  }
330
330
  }
@@ -336,7 +336,8 @@ export default (funcParams: funcParamsProps) => {
336
336
  if (eventGroups.onCellRenderer) {
337
337
  let finalResponse = {};
338
338
  const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
339
- for (const eventConfig of eventGroups?.onCellRenderer[path]) {
339
+
340
+ for (const eventConfig of eventGroups?.onCellRenderer?.[path]) {
340
341
  executeEventsParameters.store.functionParameters = cellParams
341
342
  finalResponse = executeEvents({
342
343
  ...executeEventsParameters,