impaktapps-ui-builder 0.0.351 → 0.0.352
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/impaktapps-ui-builder.es.js +237 -255
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +16 -16
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildInputSlider.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/services/clearLocalStorage.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +8 -9
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +9 -10
- package/dist/src/impaktapps-ui-builder/builder/services/getNavigationHistory.d.ts +3 -0
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +10 -10
- package/dist/src/impaktapps-ui-builder/builder/services/saveHandler.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -1
- package/package.json +1 -2
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +46 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +4 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +8 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +4 -33
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +2 -2
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +4 -33
- package/src/impaktapps-ui-builder/builder/services/clearLocalStorage.ts +3 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +34 -19
- package/src/impaktapps-ui-builder/builder/services/event.ts +20 -22
- package/src/impaktapps-ui-builder/builder/services/getNavigationHistory.ts +27 -0
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +36 -18
- package/src/impaktapps-ui-builder/builder/services/saveHandler.ts +29 -0
- package/src/impaktapps-ui-builder/lib/index.ts +1 -1
- package/README.md +0 -92
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +0 -10
- package/src/impaktapps-ui-builder/builder/services/utils.ts +0 -109
|
@@ -395,12 +395,12 @@ const PageMasterUiSchema = {
|
|
|
395
395
|
config: {
|
|
396
396
|
layout: 11.7,
|
|
397
397
|
main: {
|
|
398
|
-
name: "
|
|
398
|
+
name: "Submit Page",
|
|
399
399
|
startIcon: "ApproveIcon",
|
|
400
400
|
variant: "contained",
|
|
401
401
|
color: "info",
|
|
402
402
|
type: "text",
|
|
403
|
-
onClick: "
|
|
403
|
+
onClick: "submitPageHandler",
|
|
404
404
|
size: "small"
|
|
405
405
|
},
|
|
406
406
|
style: {
|
|
@@ -5876,6 +5876,7 @@ const ComponentSchema = {
|
|
|
5876
5876
|
{ title: "Empty Box", const: "EmptyBox" },
|
|
5877
5877
|
{ title: "File", const: "FileInput" },
|
|
5878
5878
|
{ title: "Graph", const: "Graph" },
|
|
5879
|
+
{ title: "Input Slider", const: "InputSlider" },
|
|
5879
5880
|
{ title: "Label", const: "Box" },
|
|
5880
5881
|
{ title: "LeaderBoard", const: "LeaderBoard" },
|
|
5881
5882
|
{ title: "MultipleSelect", const: "MultipleSelect" },
|
|
@@ -6319,7 +6320,7 @@ const componentBasicUiSchema = {
|
|
|
6319
6320
|
type: "Control",
|
|
6320
6321
|
scope: "#/properties/proc",
|
|
6321
6322
|
config: {
|
|
6322
|
-
layout: { xs: 11, sm: 11, md:
|
|
6323
|
+
layout: { xs: 11, sm: 11, md: 8, lg: 8 }
|
|
6323
6324
|
},
|
|
6324
6325
|
options: {
|
|
6325
6326
|
widget: "EmptyBox"
|
|
@@ -6335,39 +6336,11 @@ const componentBasicUiSchema = {
|
|
|
6335
6336
|
layout: {
|
|
6336
6337
|
xs: 11,
|
|
6337
6338
|
sm: 11,
|
|
6338
|
-
md:
|
|
6339
|
-
lg:
|
|
6339
|
+
md: 3,
|
|
6340
|
+
lg: 3
|
|
6340
6341
|
},
|
|
6341
6342
|
main: {
|
|
6342
|
-
name: "
|
|
6343
|
-
startIcon: "ApproveIcon",
|
|
6344
|
-
variant: "contained",
|
|
6345
|
-
color: "info",
|
|
6346
|
-
type: "text",
|
|
6347
|
-
onClick: "okHandler",
|
|
6348
|
-
size: "small"
|
|
6349
|
-
},
|
|
6350
|
-
style: {
|
|
6351
|
-
marginBottom: "8px",
|
|
6352
|
-
float: "right"
|
|
6353
|
-
}
|
|
6354
|
-
}
|
|
6355
|
-
},
|
|
6356
|
-
{
|
|
6357
|
-
type: "Control",
|
|
6358
|
-
scope: "#/properties/btnSubmit",
|
|
6359
|
-
options: {
|
|
6360
|
-
widget: "Button"
|
|
6361
|
-
},
|
|
6362
|
-
config: {
|
|
6363
|
-
layout: {
|
|
6364
|
-
xs: 11,
|
|
6365
|
-
sm: 11,
|
|
6366
|
-
md: 2.5,
|
|
6367
|
-
lg: 2.5
|
|
6368
|
-
},
|
|
6369
|
-
main: {
|
|
6370
|
-
name: "Save & Exit",
|
|
6343
|
+
name: "Save",
|
|
6371
6344
|
startIcon: "ApproveIcon",
|
|
6372
6345
|
variant: "contained",
|
|
6373
6346
|
color: "info",
|
|
@@ -6391,6 +6364,97 @@ const componentBasicUiSchema = {
|
|
|
6391
6364
|
}
|
|
6392
6365
|
]
|
|
6393
6366
|
};
|
|
6367
|
+
var buildConfig = (FormData) => {
|
|
6368
|
+
const formData = _.cloneDeep(FormData);
|
|
6369
|
+
let component = {};
|
|
6370
|
+
if (formData.pageName) {
|
|
6371
|
+
delete formData.pageName;
|
|
6372
|
+
}
|
|
6373
|
+
if (formData.eventsSelected) {
|
|
6374
|
+
delete formData.eventsSelected;
|
|
6375
|
+
}
|
|
6376
|
+
if (formData.type === "Table" || formData.type === "WrapperSection" || formData.type === "TabSection") {
|
|
6377
|
+
component.elements = formData.elements || [];
|
|
6378
|
+
if (formData.elements) {
|
|
6379
|
+
delete formData.elements;
|
|
6380
|
+
}
|
|
6381
|
+
}
|
|
6382
|
+
component.events = formData.events || [];
|
|
6383
|
+
if (formData.events) {
|
|
6384
|
+
delete formData.events;
|
|
6385
|
+
}
|
|
6386
|
+
component = { ...formData, ...component };
|
|
6387
|
+
return component;
|
|
6388
|
+
};
|
|
6389
|
+
const createLayoutFormat = (config) => {
|
|
6390
|
+
if (_.isEmpty(config)) {
|
|
6391
|
+
return {
|
|
6392
|
+
xs: 11,
|
|
6393
|
+
sm: 11,
|
|
6394
|
+
md: 5.5,
|
|
6395
|
+
lg: 5.5
|
|
6396
|
+
};
|
|
6397
|
+
}
|
|
6398
|
+
let data2 = {};
|
|
6399
|
+
config.map((e) => {
|
|
6400
|
+
data2[e.key || "xs"] = +e.value || 5.5;
|
|
6401
|
+
});
|
|
6402
|
+
return data2;
|
|
6403
|
+
};
|
|
6404
|
+
const flatObjectValueInArray = (config) => {
|
|
6405
|
+
const keyName = Object.keys(config[0])[0];
|
|
6406
|
+
const data2 = config.map((e) => {
|
|
6407
|
+
return e[keyName];
|
|
6408
|
+
});
|
|
6409
|
+
return data2;
|
|
6410
|
+
};
|
|
6411
|
+
const getNavigationHistory = (config, path) => {
|
|
6412
|
+
if (path) {
|
|
6413
|
+
let urlRoutes = config.name;
|
|
6414
|
+
const pathArrayAll = path.split(".");
|
|
6415
|
+
const arr = [];
|
|
6416
|
+
pathArrayAll.map((e, i) => {
|
|
6417
|
+
if (i === 0) {
|
|
6418
|
+
arr.push(e);
|
|
6419
|
+
return;
|
|
6420
|
+
}
|
|
6421
|
+
arr.push(`${arr[i - 1]}.${e}`);
|
|
6422
|
+
});
|
|
6423
|
+
arr.map((e) => {
|
|
6424
|
+
const data2 = _.get(config, e);
|
|
6425
|
+
if (data2) {
|
|
6426
|
+
urlRoutes = urlRoutes + ` > ${(data2 == null ? void 0 : data2.name) || (data2 == null ? void 0 : data2.eventType)}`;
|
|
6427
|
+
} else {
|
|
6428
|
+
urlRoutes = urlRoutes + " > NewComponent";
|
|
6429
|
+
}
|
|
6430
|
+
});
|
|
6431
|
+
return { pageName: urlRoutes };
|
|
6432
|
+
}
|
|
6433
|
+
return void 0;
|
|
6434
|
+
};
|
|
6435
|
+
const saveFormdataInLocalStorage = (formData, path) => {
|
|
6436
|
+
let updatedFormdata;
|
|
6437
|
+
if (path) {
|
|
6438
|
+
const pageFormdata = getFormdataFromLocalStorage();
|
|
6439
|
+
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
6440
|
+
} else {
|
|
6441
|
+
updatedFormdata = buildConfig(formData);
|
|
6442
|
+
}
|
|
6443
|
+
localStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata));
|
|
6444
|
+
return updatedFormdata;
|
|
6445
|
+
};
|
|
6446
|
+
const getFormdataFromLocalStorage = (path) => {
|
|
6447
|
+
const pageFormdata = localStorage.getItem("pageFormdata") ? JSON.parse(localStorage.getItem("pageFormdata")) : void 0;
|
|
6448
|
+
let returnValue;
|
|
6449
|
+
if (path) {
|
|
6450
|
+
returnValue = _.get(pageFormdata, path);
|
|
6451
|
+
returnValue = { ...returnValue, ...getNavigationHistory(pageFormdata, path) };
|
|
6452
|
+
}
|
|
6453
|
+
if (!returnValue) {
|
|
6454
|
+
returnValue = getNavigationHistory(pageFormdata, path);
|
|
6455
|
+
}
|
|
6456
|
+
return returnValue || pageFormdata;
|
|
6457
|
+
};
|
|
6394
6458
|
const CoreSection = {
|
|
6395
6459
|
type: "HorizontalLayout",
|
|
6396
6460
|
elements: [
|
|
@@ -6773,6 +6837,14 @@ const GraphSection = {
|
|
|
6773
6837
|
const buildPropertiesSection = function(type) {
|
|
6774
6838
|
let uiSchema = _.cloneDeep(GraphSection);
|
|
6775
6839
|
switch (type) {
|
|
6840
|
+
case "InputSlider":
|
|
6841
|
+
uiSchema.elements = [
|
|
6842
|
+
getInputField("max", "Max Limit"),
|
|
6843
|
+
getInputField("step", "Step"),
|
|
6844
|
+
getInputField("min", "Min Limit"),
|
|
6845
|
+
getRadioInputField("limitToMax", "Applly Max. Limit", ["YES", "NO"])
|
|
6846
|
+
];
|
|
6847
|
+
break;
|
|
6776
6848
|
case "Text":
|
|
6777
6849
|
uiSchema.elements = [
|
|
6778
6850
|
getInputField("placeholder", "Placeholder"),
|
|
@@ -7158,150 +7230,6 @@ const ValidationSection = {
|
|
|
7158
7230
|
}
|
|
7159
7231
|
]
|
|
7160
7232
|
};
|
|
7161
|
-
var buildConfig = (FormData) => {
|
|
7162
|
-
const formData = _.cloneDeep(FormData);
|
|
7163
|
-
let component = {};
|
|
7164
|
-
if (formData.pageName) {
|
|
7165
|
-
delete formData.pageName;
|
|
7166
|
-
}
|
|
7167
|
-
if (formData.eventsSelected) {
|
|
7168
|
-
delete formData.eventsSelected;
|
|
7169
|
-
}
|
|
7170
|
-
if (formData.type === "Table" || formData.type === "WrapperSection" || formData.type === "TabSection") {
|
|
7171
|
-
component.elements = formData.elements || [];
|
|
7172
|
-
if (formData.elements) {
|
|
7173
|
-
delete formData.elements;
|
|
7174
|
-
}
|
|
7175
|
-
}
|
|
7176
|
-
component.events = formData.events || [];
|
|
7177
|
-
if (formData.events) {
|
|
7178
|
-
delete formData.events;
|
|
7179
|
-
}
|
|
7180
|
-
component = { ...formData, ...component };
|
|
7181
|
-
return component;
|
|
7182
|
-
};
|
|
7183
|
-
const createLayoutFormat = (config) => {
|
|
7184
|
-
if (_.isEmpty(config)) {
|
|
7185
|
-
return {
|
|
7186
|
-
xs: 11,
|
|
7187
|
-
sm: 11,
|
|
7188
|
-
md: 5.5,
|
|
7189
|
-
lg: 5.5
|
|
7190
|
-
};
|
|
7191
|
-
}
|
|
7192
|
-
let data2 = {};
|
|
7193
|
-
config.map((e) => {
|
|
7194
|
-
data2[e.key || "xs"] = +e.value || 5.5;
|
|
7195
|
-
});
|
|
7196
|
-
return data2;
|
|
7197
|
-
};
|
|
7198
|
-
const flatObjectValueInArray = (config) => {
|
|
7199
|
-
const keyName = Object.keys(config[0])[0];
|
|
7200
|
-
const data2 = config.map((e) => {
|
|
7201
|
-
return e[keyName];
|
|
7202
|
-
});
|
|
7203
|
-
return data2;
|
|
7204
|
-
};
|
|
7205
|
-
const clearFromLocalStorage = () => {
|
|
7206
|
-
localStorage.removeItem("pageFormdata");
|
|
7207
|
-
};
|
|
7208
|
-
const getNavigationHistory = (config, path) => {
|
|
7209
|
-
if (path) {
|
|
7210
|
-
let urlRoutes = config.name;
|
|
7211
|
-
const pathArrayAll = path.split(".");
|
|
7212
|
-
const arr = [];
|
|
7213
|
-
pathArrayAll.map((e, i) => {
|
|
7214
|
-
if (i === 0) {
|
|
7215
|
-
arr.push(e);
|
|
7216
|
-
return;
|
|
7217
|
-
}
|
|
7218
|
-
arr.push(`${arr[i - 1]}.${e}`);
|
|
7219
|
-
});
|
|
7220
|
-
arr.map((e) => {
|
|
7221
|
-
const data2 = _.get(config, e);
|
|
7222
|
-
if (data2) {
|
|
7223
|
-
urlRoutes = urlRoutes + ` > ${(data2 == null ? void 0 : data2.name) || (data2 == null ? void 0 : data2.eventType)}`;
|
|
7224
|
-
} else {
|
|
7225
|
-
urlRoutes = urlRoutes + " > NewComponent";
|
|
7226
|
-
}
|
|
7227
|
-
});
|
|
7228
|
-
return { pageName: urlRoutes };
|
|
7229
|
-
}
|
|
7230
|
-
return void 0;
|
|
7231
|
-
};
|
|
7232
|
-
const saveFormdataInLocalStorage = (formData, path) => {
|
|
7233
|
-
let updatedFormdata;
|
|
7234
|
-
if (path) {
|
|
7235
|
-
const pageFormdata = getFormdataFromLocalStorage();
|
|
7236
|
-
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
7237
|
-
} else {
|
|
7238
|
-
updatedFormdata = buildConfig(formData);
|
|
7239
|
-
}
|
|
7240
|
-
localStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata));
|
|
7241
|
-
return updatedFormdata;
|
|
7242
|
-
};
|
|
7243
|
-
const getFormdataFromLocalStorage = (path) => {
|
|
7244
|
-
const pageFormdata = localStorage.getItem("pageFormdata") ? JSON.parse(localStorage.getItem("pageFormdata")) : void 0;
|
|
7245
|
-
let returnValue;
|
|
7246
|
-
if (path) {
|
|
7247
|
-
returnValue = _.get(pageFormdata, path);
|
|
7248
|
-
returnValue = { ...returnValue, ...getNavigationHistory(pageFormdata, path) };
|
|
7249
|
-
}
|
|
7250
|
-
if (!returnValue) {
|
|
7251
|
-
returnValue = getNavigationHistory(pageFormdata, path);
|
|
7252
|
-
}
|
|
7253
|
-
return returnValue || pageFormdata;
|
|
7254
|
-
};
|
|
7255
|
-
async function saveHandler(store2, service2, submitHandler, pageName) {
|
|
7256
|
-
var _a, _b;
|
|
7257
|
-
const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
7258
|
-
const path = (_b = store2.searchParams) == null ? void 0 : _b.get("path");
|
|
7259
|
-
saveFormdataInLocalStorage(store2.ctx.core.data, path);
|
|
7260
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
7261
|
-
if (_.isEmpty(store2.ctx.core.errors)) {
|
|
7262
|
-
try {
|
|
7263
|
-
const saveReturn = await submitHandler(store2, service2, config);
|
|
7264
|
-
navigateHandler(store2, true, pageName ? `/${pageName}?id=${id}` : "/PageMasterRecords");
|
|
7265
|
-
} catch (err) {
|
|
7266
|
-
navigateHandler(store2, false);
|
|
7267
|
-
}
|
|
7268
|
-
}
|
|
7269
|
-
}
|
|
7270
|
-
const navigateHandler = (store2, isSubmitted, pageName) => {
|
|
7271
|
-
if (isSubmitted) {
|
|
7272
|
-
localStorage.removeItem("pageFormdata");
|
|
7273
|
-
store2.navigate(pageName || -1);
|
|
7274
|
-
store2.setNotify({
|
|
7275
|
-
SuccessMessage: "Submit Successfully",
|
|
7276
|
-
Success: true
|
|
7277
|
-
});
|
|
7278
|
-
} else {
|
|
7279
|
-
store2.setValidation("ValidateAndShow");
|
|
7280
|
-
store2.setNotify({
|
|
7281
|
-
Fail: true,
|
|
7282
|
-
FailMessage: "Errors on Page"
|
|
7283
|
-
});
|
|
7284
|
-
}
|
|
7285
|
-
};
|
|
7286
|
-
function okHandler(store2) {
|
|
7287
|
-
var _a;
|
|
7288
|
-
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7289
|
-
console.log(store2.ctx.core.errors);
|
|
7290
|
-
if (_.isEmpty(store2.ctx.core.errors)) {
|
|
7291
|
-
saveFormdataInLocalStorage(store2.ctx.core.data, path);
|
|
7292
|
-
store2.navigate(-1);
|
|
7293
|
-
store2.setNotify({
|
|
7294
|
-
SuccessMessage: "Save Successfully",
|
|
7295
|
-
Success: true
|
|
7296
|
-
});
|
|
7297
|
-
} else {
|
|
7298
|
-
store2.setValidation("ValidateAndShow");
|
|
7299
|
-
store2.setNotify({
|
|
7300
|
-
Fail: true,
|
|
7301
|
-
FailMessage: "Errors on Page"
|
|
7302
|
-
});
|
|
7303
|
-
}
|
|
7304
|
-
}
|
|
7305
7233
|
const sectionLabels = {
|
|
7306
7234
|
Select: ["Core", "Properties", "Value", "style", "Event", "Validation"],
|
|
7307
7235
|
MultipleSelect: ["Core", "Properties", "Value", "style", "Event", "Validation"],
|
|
@@ -7325,7 +7253,8 @@ const sectionLabels = {
|
|
|
7325
7253
|
Array: ["Core", "Components", "Validation"],
|
|
7326
7254
|
Radio: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7327
7255
|
Text: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7328
|
-
TextArea: ["Core", "Properties", "style", "Event", "Validation"]
|
|
7256
|
+
TextArea: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7257
|
+
InputSlider: ["Core", "Properties", "style", "Event", "Validation"]
|
|
7329
7258
|
};
|
|
7330
7259
|
const refreshPage = (type, store2) => {
|
|
7331
7260
|
var _a;
|
|
@@ -7346,7 +7275,7 @@ const refreshPage = (type, store2) => {
|
|
|
7346
7275
|
}
|
|
7347
7276
|
store2.setUiSchema(UiSchema);
|
|
7348
7277
|
};
|
|
7349
|
-
var Component = (store2, dynamicData2
|
|
7278
|
+
var Component = (store2, dynamicData2) => {
|
|
7350
7279
|
return {
|
|
7351
7280
|
setPage: async function() {
|
|
7352
7281
|
const formdata = await this.getFormdata();
|
|
@@ -7356,7 +7285,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
7356
7285
|
this.refreshPage(formdata == null ? void 0 : formdata.type, store2);
|
|
7357
7286
|
},
|
|
7358
7287
|
refreshPage,
|
|
7359
|
-
getFormdata: function() {
|
|
7288
|
+
getFormdata: async function() {
|
|
7360
7289
|
var _a;
|
|
7361
7290
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7362
7291
|
return getFormdataFromLocalStorage(path);
|
|
@@ -7364,20 +7293,37 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
7364
7293
|
getSchema: function() {
|
|
7365
7294
|
return ComponentSchema;
|
|
7366
7295
|
},
|
|
7367
|
-
|
|
7368
|
-
|
|
7296
|
+
saveHandler: async function() {
|
|
7297
|
+
var _a;
|
|
7298
|
+
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7299
|
+
console.log(store2.ctx.core.errors);
|
|
7300
|
+
if (_.isEmpty(store2.ctx.core.errors)) {
|
|
7301
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
7302
|
+
store2.navigate(-1);
|
|
7303
|
+
store2.setNotify({
|
|
7304
|
+
SuccessMessage: "Save Successfully",
|
|
7305
|
+
Success: true
|
|
7306
|
+
});
|
|
7307
|
+
} else {
|
|
7308
|
+
store2.setValidation("ValidateAndShow");
|
|
7309
|
+
store2.setNotify({
|
|
7310
|
+
Fail: true,
|
|
7311
|
+
FailMessage: "Errors on Page"
|
|
7312
|
+
});
|
|
7313
|
+
}
|
|
7314
|
+
},
|
|
7369
7315
|
onChange: function() {
|
|
7370
7316
|
var _a, _b, _c, _d;
|
|
7371
7317
|
if (((_a = store2 == null ? void 0 : store2.formData) == null ? void 0 : _a.type) !== ((_b = store2 == null ? void 0 : store2.newData) == null ? void 0 : _b.type) && ((_c = store2 == null ? void 0 : store2.newData) == null ? void 0 : _c.type) !== void 0) {
|
|
7372
7318
|
this.refreshPage((_d = store2 == null ? void 0 : store2.newData) == null ? void 0 : _d.type, store2);
|
|
7373
7319
|
}
|
|
7374
7320
|
},
|
|
7375
|
-
editComponents: function() {
|
|
7321
|
+
editComponents: async function() {
|
|
7376
7322
|
var _a, _b, _c;
|
|
7377
7323
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7378
7324
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7379
7325
|
const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
|
|
7380
|
-
saveFormdataInLocalStorage(store2.
|
|
7326
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
7381
7327
|
if (path) {
|
|
7382
7328
|
const path2 = (_c = store2.searchParams) == null ? void 0 : _c.get("path");
|
|
7383
7329
|
const finalPath = `${path2}.elements[${rowId}]`;
|
|
@@ -7388,52 +7334,52 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
7388
7334
|
store2.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`);
|
|
7389
7335
|
}
|
|
7390
7336
|
},
|
|
7391
|
-
deleteComponents: function() {
|
|
7337
|
+
deleteComponents: async function() {
|
|
7392
7338
|
var _a;
|
|
7393
7339
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7394
7340
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7395
7341
|
store2.formData.elements.splice(rowId, 1);
|
|
7396
|
-
const response2 = saveFormdataInLocalStorage(store2.
|
|
7342
|
+
const response2 = saveFormdataInLocalStorage(store2.formData, path);
|
|
7397
7343
|
const data2 = path ? _.get(response2, path) : response2;
|
|
7398
7344
|
store2.setFormdata(data2);
|
|
7399
7345
|
},
|
|
7400
|
-
deleteEvent: function() {
|
|
7346
|
+
deleteEvent: async function() {
|
|
7401
7347
|
var _a;
|
|
7402
7348
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7403
7349
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7404
7350
|
store2.formData.events.splice(rowId, 1);
|
|
7405
|
-
const response2 = saveFormdataInLocalStorage(store2.
|
|
7351
|
+
const response2 = saveFormdataInLocalStorage(store2.formData, path);
|
|
7406
7352
|
store2.setFormdata(_.get(response2, path));
|
|
7407
7353
|
},
|
|
7408
|
-
widgetAddClickHandler: function() {
|
|
7354
|
+
widgetAddClickHandler: async function() {
|
|
7409
7355
|
var _a;
|
|
7410
7356
|
if (!Array.isArray(store2.formData.elements)) {
|
|
7411
7357
|
store2.formData.elements = [];
|
|
7412
7358
|
}
|
|
7413
7359
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7414
|
-
saveFormdataInLocalStorage(store2.
|
|
7360
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
7415
7361
|
const finalPath = `${path}.elements[${store2.formData.elements.length}]`;
|
|
7416
7362
|
store2.searchParams.set("path", finalPath);
|
|
7417
7363
|
store2.setSearchParams(store2.searchParams);
|
|
7418
7364
|
this.setPage();
|
|
7419
7365
|
},
|
|
7420
|
-
eventEditHandler: function() {
|
|
7366
|
+
eventEditHandler: async function() {
|
|
7421
7367
|
var _a, _b;
|
|
7422
7368
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7423
7369
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7424
7370
|
const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
|
|
7425
|
-
saveFormdataInLocalStorage(store2.
|
|
7371
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
7426
7372
|
const finalPath = `${path}.events[${rowId}]`;
|
|
7427
7373
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
7428
7374
|
},
|
|
7429
|
-
eventAddHandler: function() {
|
|
7375
|
+
eventAddHandler: async function() {
|
|
7430
7376
|
var _a, _b;
|
|
7431
7377
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7432
7378
|
const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
|
|
7433
7379
|
if (!Array.isArray(store2.formData.events)) {
|
|
7434
7380
|
store2.formData.events = [];
|
|
7435
7381
|
}
|
|
7436
|
-
saveFormdataInLocalStorage(store2.
|
|
7382
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
7437
7383
|
const finalPath = `${path}.events[${store2.formData.events.length}]`;
|
|
7438
7384
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
7439
7385
|
},
|
|
@@ -7443,7 +7389,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
7443
7389
|
};
|
|
7444
7390
|
};
|
|
7445
7391
|
var pageMaster = (funcParams) => {
|
|
7446
|
-
const { store: store2, dynamicData: dynamicData2, config, submitHandler
|
|
7392
|
+
const { store: store2, dynamicData: dynamicData2, config, submitHandler } = funcParams;
|
|
7447
7393
|
return {
|
|
7448
7394
|
setPage: async function() {
|
|
7449
7395
|
const formdata = await this.getFormdata();
|
|
@@ -7453,7 +7399,7 @@ var pageMaster = (funcParams) => {
|
|
|
7453
7399
|
store2.setSchema(schema2);
|
|
7454
7400
|
store2.setUiSchema(uiSchema);
|
|
7455
7401
|
},
|
|
7456
|
-
getFormdata: function() {
|
|
7402
|
+
getFormdata: async function() {
|
|
7457
7403
|
var _a;
|
|
7458
7404
|
(_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
7459
7405
|
const formData = getFormdataFromLocalStorage();
|
|
@@ -7463,7 +7409,7 @@ var pageMaster = (funcParams) => {
|
|
|
7463
7409
|
saveFormdataInLocalStorage(config);
|
|
7464
7410
|
return config;
|
|
7465
7411
|
},
|
|
7466
|
-
getUiSchema: function() {
|
|
7412
|
+
getUiSchema: async function() {
|
|
7467
7413
|
return PageMasterUiSchema;
|
|
7468
7414
|
},
|
|
7469
7415
|
getSchema: () => {
|
|
@@ -7473,42 +7419,60 @@ var pageMaster = (funcParams) => {
|
|
|
7473
7419
|
localStorage.removeItem("pageFormdata");
|
|
7474
7420
|
store2.navigate("/PageMasterRecords");
|
|
7475
7421
|
},
|
|
7476
|
-
onAddClickHandler: function() {
|
|
7422
|
+
onAddClickHandler: async function() {
|
|
7477
7423
|
var _a;
|
|
7478
7424
|
const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
7479
7425
|
if (!Array.isArray(store2.formData.elements)) {
|
|
7480
7426
|
store2.formData.elements = [];
|
|
7481
7427
|
}
|
|
7482
|
-
const response2 = saveFormdataInLocalStorage(store2.
|
|
7428
|
+
const response2 = saveFormdataInLocalStorage(store2.formData);
|
|
7483
7429
|
store2.navigate(
|
|
7484
7430
|
`/Component?path=${`elements[${response2 == null ? void 0 : response2.elements.length}]`}&id=${id}`
|
|
7485
7431
|
);
|
|
7486
7432
|
},
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7433
|
+
submitPageHandler: async function() {
|
|
7434
|
+
console.log();
|
|
7435
|
+
if (_.isEmpty(funcParams.store.ctx.core.errors)) {
|
|
7436
|
+
submitHandler(store2, funcParams.service).then((saveReturn) => {
|
|
7437
|
+
localStorage.removeItem("pageFormdata");
|
|
7438
|
+
store2.navigate(-1);
|
|
7439
|
+
store2.setNotify({
|
|
7440
|
+
SuccessMessage: "Submit Successfully",
|
|
7441
|
+
Success: true
|
|
7442
|
+
});
|
|
7443
|
+
});
|
|
7444
|
+
} else {
|
|
7445
|
+
funcParams.store.setValidation("ValidateAndShow");
|
|
7446
|
+
funcParams.store.setNotify({
|
|
7447
|
+
Fail: true,
|
|
7448
|
+
FailMessage: "Errors on Page"
|
|
7449
|
+
});
|
|
7450
|
+
}
|
|
7451
|
+
},
|
|
7452
|
+
Edit_Components: Component(store2, dynamicData2).editComponents,
|
|
7453
|
+
Delete_Components: Component(store2, dynamicData2).deleteComponents,
|
|
7454
|
+
eventAddHandler: async function() {
|
|
7491
7455
|
var _a;
|
|
7492
7456
|
const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
7493
7457
|
if (!Array.isArray(store2.formData.events)) {
|
|
7494
7458
|
store2.formData.events = [];
|
|
7495
7459
|
}
|
|
7496
|
-
saveFormdataInLocalStorage(store2.
|
|
7460
|
+
saveFormdataInLocalStorage(store2.formData);
|
|
7497
7461
|
const finalPath = `events[${store2.formData.events.length}]`;
|
|
7498
7462
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
7499
7463
|
},
|
|
7500
|
-
editEvent: function() {
|
|
7464
|
+
editEvent: async function() {
|
|
7501
7465
|
var _a;
|
|
7502
7466
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7503
7467
|
const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
7504
|
-
saveFormdataInLocalStorage(store2.
|
|
7468
|
+
saveFormdataInLocalStorage(store2.formData);
|
|
7505
7469
|
const finalPath = `events[${rowId}]`;
|
|
7506
7470
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
7507
7471
|
},
|
|
7508
|
-
deleteEvent: function() {
|
|
7472
|
+
deleteEvent: async function() {
|
|
7509
7473
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7510
7474
|
store2.formData.events.splice(rowId, 1);
|
|
7511
|
-
const response2 = saveFormdataInLocalStorage(store2.
|
|
7475
|
+
const response2 = saveFormdataInLocalStorage(store2.formData);
|
|
7512
7476
|
store2.setFormdata(response2);
|
|
7513
7477
|
}
|
|
7514
7478
|
};
|
|
@@ -7821,7 +7785,7 @@ const EventUiSchema = {
|
|
|
7821
7785
|
type: "Control",
|
|
7822
7786
|
scope: "#/properties/proc",
|
|
7823
7787
|
config: {
|
|
7824
|
-
layout: { xs: 11, sm: 11, md:
|
|
7788
|
+
layout: { xs: 11, sm: 11, md: 8, lg: 8 }
|
|
7825
7789
|
},
|
|
7826
7790
|
options: {
|
|
7827
7791
|
widget: "EmptyBox"
|
|
@@ -7837,39 +7801,11 @@ const EventUiSchema = {
|
|
|
7837
7801
|
layout: {
|
|
7838
7802
|
xs: 11,
|
|
7839
7803
|
sm: 11,
|
|
7840
|
-
md:
|
|
7841
|
-
lg:
|
|
7842
|
-
},
|
|
7843
|
-
main: {
|
|
7844
|
-
name: "Ok",
|
|
7845
|
-
startIcon: "ApproveIcon",
|
|
7846
|
-
variant: "contained",
|
|
7847
|
-
color: "info",
|
|
7848
|
-
type: "text",
|
|
7849
|
-
onClick: "okHandler",
|
|
7850
|
-
size: "small"
|
|
7851
|
-
},
|
|
7852
|
-
style: {
|
|
7853
|
-
marginBottom: "8px",
|
|
7854
|
-
float: "right"
|
|
7855
|
-
}
|
|
7856
|
-
}
|
|
7857
|
-
},
|
|
7858
|
-
{
|
|
7859
|
-
type: "Control",
|
|
7860
|
-
scope: "#/properties/btnSubmit",
|
|
7861
|
-
options: {
|
|
7862
|
-
widget: "Button"
|
|
7863
|
-
},
|
|
7864
|
-
config: {
|
|
7865
|
-
layout: {
|
|
7866
|
-
xs: 11,
|
|
7867
|
-
sm: 11,
|
|
7868
|
-
md: 2.5,
|
|
7869
|
-
lg: 2.5
|
|
7804
|
+
md: 3,
|
|
7805
|
+
lg: 3
|
|
7870
7806
|
},
|
|
7871
7807
|
main: {
|
|
7872
|
-
name: "Save
|
|
7808
|
+
name: "Save",
|
|
7873
7809
|
startIcon: "ApproveIcon",
|
|
7874
7810
|
variant: "contained",
|
|
7875
7811
|
color: "info",
|
|
@@ -8078,7 +8014,7 @@ const refreshSectionUiSchema = {
|
|
|
8078
8014
|
}
|
|
8079
8015
|
]
|
|
8080
8016
|
};
|
|
8081
|
-
var event = (store2, dynamicData2
|
|
8017
|
+
var event = (store2, dynamicData2) => {
|
|
8082
8018
|
return {
|
|
8083
8019
|
setPage: async function() {
|
|
8084
8020
|
const formdata = await this.getFormData();
|
|
@@ -8111,44 +8047,43 @@ var event = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8111
8047
|
store22.setSchema(schema2);
|
|
8112
8048
|
store22.setUiSchema(uiSchema);
|
|
8113
8049
|
},
|
|
8114
|
-
getFormData: Component(store2, dynamicData2
|
|
8115
|
-
getUiSchema: function() {
|
|
8050
|
+
getFormData: Component(store2, dynamicData2).getFormdata,
|
|
8051
|
+
getUiSchema: async function() {
|
|
8116
8052
|
return EventUiSchema;
|
|
8117
8053
|
},
|
|
8118
|
-
getSchema: () => {
|
|
8054
|
+
getSchema: async () => {
|
|
8119
8055
|
return EventSchema;
|
|
8120
8056
|
},
|
|
8121
|
-
okHandler: () => okHandler(store2),
|
|
8122
|
-
saveHandler: async () => await saveHandler(store2, service2, submitHandler, "PageMaster"),
|
|
8123
8057
|
onChange: function() {
|
|
8124
8058
|
var _a, _b, _c;
|
|
8125
8059
|
if (((_a = store2 == null ? void 0 : store2.formData) == null ? void 0 : _a.Handler) !== ((_b = store2 == null ? void 0 : store2.newData) == null ? void 0 : _b.Handler) && ((_c = store2 == null ? void 0 : store2.newData) == null ? void 0 : _c.Handler) !== void 0) {
|
|
8126
8060
|
this.refreshPage(store2.newData.Handler || store2.formdata.Handler, store2);
|
|
8127
8061
|
}
|
|
8128
8062
|
},
|
|
8129
|
-
|
|
8063
|
+
saveHandler: Component(store2, dynamicData2).saveHandler,
|
|
8064
|
+
addEvent: async function() {
|
|
8130
8065
|
var _a, _b, _c;
|
|
8131
8066
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8132
8067
|
if (!Array.isArray(store2.formData.events)) {
|
|
8133
8068
|
store2.formData.events = [];
|
|
8134
8069
|
}
|
|
8135
|
-
saveFormdataInLocalStorage(store2.
|
|
8070
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
8136
8071
|
const finalPath = `${path}.events[${(_c = (_b = store2.formData) == null ? void 0 : _b.events) == null ? void 0 : _c.length}]`;
|
|
8137
8072
|
store2.searchParams.set("path", finalPath);
|
|
8138
8073
|
store2.setSearchParams(store2.searchParams);
|
|
8139
8074
|
this.setPage();
|
|
8140
8075
|
},
|
|
8141
|
-
editEvent: function() {
|
|
8076
|
+
editEvent: async function() {
|
|
8142
8077
|
var _a;
|
|
8143
8078
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8144
8079
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8145
|
-
saveFormdataInLocalStorage(store2.
|
|
8080
|
+
saveFormdataInLocalStorage(store2.formData, path);
|
|
8146
8081
|
const finalPath = `${path}.events[${rowId}]`;
|
|
8147
8082
|
store2.searchParams.set("path", finalPath);
|
|
8148
8083
|
store2.setSearchParams(store2.searchParams);
|
|
8149
8084
|
this.setPage();
|
|
8150
8085
|
},
|
|
8151
|
-
deleteEvent: Component(store2, dynamicData2
|
|
8086
|
+
deleteEvent: Component(store2, dynamicData2).deleteEvent,
|
|
8152
8087
|
backHandler: function() {
|
|
8153
8088
|
store2.navigate(-1);
|
|
8154
8089
|
}
|
|
@@ -10238,7 +10173,7 @@ const FileInput = {
|
|
|
10238
10173
|
required: false,
|
|
10239
10174
|
onUpload: "onFileUpload",
|
|
10240
10175
|
onDownload: "onFileDownload",
|
|
10241
|
-
label: "
|
|
10176
|
+
label: "label"
|
|
10242
10177
|
},
|
|
10243
10178
|
style: {
|
|
10244
10179
|
backgroundColor: "none"
|
|
@@ -10248,7 +10183,7 @@ const FileInput = {
|
|
|
10248
10183
|
const buildFileInput = (config, componentScope) => {
|
|
10249
10184
|
const box = _.cloneDeep(FileInput);
|
|
10250
10185
|
box.scope = componentScope;
|
|
10251
|
-
box.config.main.
|
|
10186
|
+
box.config.main.label = config.label;
|
|
10252
10187
|
if (config.layout) {
|
|
10253
10188
|
box.config.layout = createLayoutFormat(config.layout);
|
|
10254
10189
|
}
|
|
@@ -10257,6 +10192,47 @@ const buildFileInput = (config, componentScope) => {
|
|
|
10257
10192
|
}
|
|
10258
10193
|
return box;
|
|
10259
10194
|
};
|
|
10195
|
+
const InputSlider = {
|
|
10196
|
+
type: "Control",
|
|
10197
|
+
scope: "#/properties/inputSlider",
|
|
10198
|
+
options: {
|
|
10199
|
+
widget: "InputSlider"
|
|
10200
|
+
},
|
|
10201
|
+
config: {
|
|
10202
|
+
layout: 12,
|
|
10203
|
+
main: {
|
|
10204
|
+
limitToMax: false,
|
|
10205
|
+
max: 1e4,
|
|
10206
|
+
step: 1e3,
|
|
10207
|
+
min: 0,
|
|
10208
|
+
label: "Slider"
|
|
10209
|
+
}
|
|
10210
|
+
}
|
|
10211
|
+
};
|
|
10212
|
+
const buildInputSlider = (config, componentScope) => {
|
|
10213
|
+
const inputSlider = _.cloneDeep(InputSlider);
|
|
10214
|
+
inputSlider.scope = componentScope;
|
|
10215
|
+
inputSlider.config.main.label = config.label;
|
|
10216
|
+
if (config.layout) {
|
|
10217
|
+
inputSlider.config.layout = createLayoutFormat(config.layout);
|
|
10218
|
+
}
|
|
10219
|
+
if (config.limitToMax) {
|
|
10220
|
+
inputSlider.config.main.limitToMax = config.limitToMax === "YES" ? true : false;
|
|
10221
|
+
}
|
|
10222
|
+
if (config.max) {
|
|
10223
|
+
inputSlider.config.main.max = config.max;
|
|
10224
|
+
}
|
|
10225
|
+
if (config.step) {
|
|
10226
|
+
inputSlider.config.main.step = config.step;
|
|
10227
|
+
}
|
|
10228
|
+
if (config.min) {
|
|
10229
|
+
inputSlider.config.main.min = config.min;
|
|
10230
|
+
}
|
|
10231
|
+
if (config.style) {
|
|
10232
|
+
inputSlider.config.main.defaultStyle = JSON.parse(config.style);
|
|
10233
|
+
}
|
|
10234
|
+
return inputSlider;
|
|
10235
|
+
};
|
|
10260
10236
|
let schema = {
|
|
10261
10237
|
type: "object",
|
|
10262
10238
|
properties: {},
|
|
@@ -10375,6 +10351,9 @@ const buildUiSchema = (config) => {
|
|
|
10375
10351
|
let elements = {};
|
|
10376
10352
|
const componentScope = `#/properties/${config.name}`;
|
|
10377
10353
|
switch (config.type) {
|
|
10354
|
+
case "InputSlider":
|
|
10355
|
+
elements = buildInputSlider(config, componentScope);
|
|
10356
|
+
break;
|
|
10378
10357
|
case "FileInput":
|
|
10379
10358
|
elements = buildFileInput(config, componentScope);
|
|
10380
10359
|
break;
|
|
@@ -10519,5 +10498,8 @@ const buildUiSchema = (config) => {
|
|
|
10519
10498
|
}
|
|
10520
10499
|
return elements;
|
|
10521
10500
|
};
|
|
10522
|
-
|
|
10501
|
+
var clearLocalStorage = () => {
|
|
10502
|
+
localStorage.removeItem("pageFormdata");
|
|
10503
|
+
};
|
|
10504
|
+
export { buildConfig, buildSchema, buildUiSchema, clearLocalStorage as clearPreviousCache, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
10523
10505
|
//# sourceMappingURL=impaktapps-ui-builder.es.js.map
|