impaktapps-ui-builder 0.0.274 → 0.0.276
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 +398 -121
- 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/buildConfig.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildLineGraph.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildRadio.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildSchema.d.ts +6 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +0 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.d.ts +1 -6
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +8 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.d.ts +9 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +31 -0
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +14 -7
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +10 -0
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +4 -2
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +28 -21
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +12 -16
- package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +35 -0
- package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +34 -0
- package/src/impaktapps-ui-builder/builder/build/buildSpeedoMeter.ts +21 -8
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/buildTimer.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +44 -37
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +53 -45
- package/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +4 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.ts +5 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +75 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +41 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +2 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +27 -24
- package/src/impaktapps-ui-builder/builder/services/getNavigationHistory.ts +6 -1
- package/src/impaktapps-ui-builder/lib/index.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +86 -4
- package/src/impaktapps-ui-builder/runtime/services/service.ts +1 -0
|
@@ -4531,7 +4531,7 @@ var lodash = { exports: {} };
|
|
|
4531
4531
|
customizer = typeof customizer == "function" ? customizer : undefined$1;
|
|
4532
4532
|
return baseIsMatch(object, source, getMatchData(source), customizer);
|
|
4533
4533
|
}
|
|
4534
|
-
function
|
|
4534
|
+
function isNaN2(value) {
|
|
4535
4535
|
return isNumber(value) && value != +value;
|
|
4536
4536
|
}
|
|
4537
4537
|
function isNative(value) {
|
|
@@ -5608,7 +5608,7 @@ var lodash = { exports: {} };
|
|
|
5608
5608
|
lodash2.isMap = isMap;
|
|
5609
5609
|
lodash2.isMatch = isMatch;
|
|
5610
5610
|
lodash2.isMatchWith = isMatchWith;
|
|
5611
|
-
lodash2.isNaN =
|
|
5611
|
+
lodash2.isNaN = isNaN2;
|
|
5612
5612
|
lodash2.isNative = isNative;
|
|
5613
5613
|
lodash2.isNil = isNil;
|
|
5614
5614
|
lodash2.isNull = isNull;
|
|
@@ -5948,6 +5948,45 @@ const ComponentSchema = {
|
|
|
5948
5948
|
}
|
|
5949
5949
|
}
|
|
5950
5950
|
}
|
|
5951
|
+
},
|
|
5952
|
+
legendLabels: {
|
|
5953
|
+
type: "array",
|
|
5954
|
+
items: {
|
|
5955
|
+
type: "object",
|
|
5956
|
+
properties: {
|
|
5957
|
+
label: {
|
|
5958
|
+
type: "string"
|
|
5959
|
+
}
|
|
5960
|
+
}
|
|
5961
|
+
}
|
|
5962
|
+
},
|
|
5963
|
+
pieArcColors: {
|
|
5964
|
+
type: "array",
|
|
5965
|
+
items: {
|
|
5966
|
+
type: "object",
|
|
5967
|
+
properties: {
|
|
5968
|
+
label: {
|
|
5969
|
+
type: "string"
|
|
5970
|
+
}
|
|
5971
|
+
}
|
|
5972
|
+
}
|
|
5973
|
+
},
|
|
5974
|
+
validation: {
|
|
5975
|
+
type: "array",
|
|
5976
|
+
items: {
|
|
5977
|
+
type: "object",
|
|
5978
|
+
properties: {
|
|
5979
|
+
componentName: {
|
|
5980
|
+
type: "string"
|
|
5981
|
+
},
|
|
5982
|
+
validationType: {
|
|
5983
|
+
type: "string"
|
|
5984
|
+
},
|
|
5985
|
+
validationValue: {
|
|
5986
|
+
type: "string"
|
|
5987
|
+
}
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5951
5990
|
}
|
|
5952
5991
|
}
|
|
5953
5992
|
};
|
|
@@ -6028,7 +6067,7 @@ const componentBasicUiSchema = {
|
|
|
6028
6067
|
main: {
|
|
6029
6068
|
tabLabels: ["Core"],
|
|
6030
6069
|
defaultStyle: true,
|
|
6031
|
-
id:
|
|
6070
|
+
id: `component`
|
|
6032
6071
|
}
|
|
6033
6072
|
},
|
|
6034
6073
|
elements: [
|
|
@@ -6054,6 +6093,7 @@ const componentBasicUiSchema = {
|
|
|
6054
6093
|
{ label: "Container", value: "WrapperSection" },
|
|
6055
6094
|
{ label: "Tabs", value: "TabSection" },
|
|
6056
6095
|
{ label: "Text", value: "Text" },
|
|
6096
|
+
{ label: "Radio", value: "Radio" },
|
|
6057
6097
|
{ label: "Text Area", value: "TextArea" },
|
|
6058
6098
|
{ label: "Button", value: "Button" },
|
|
6059
6099
|
{ label: "Card", value: "card" },
|
|
@@ -6263,6 +6303,13 @@ const createLayoutFormat = (config) => {
|
|
|
6263
6303
|
});
|
|
6264
6304
|
return data2;
|
|
6265
6305
|
};
|
|
6306
|
+
const flatObjectValueInArray = (config) => {
|
|
6307
|
+
const keyName = Object.keys(config[0])[0];
|
|
6308
|
+
const data2 = config.map((e) => {
|
|
6309
|
+
return e[keyName];
|
|
6310
|
+
});
|
|
6311
|
+
return data2;
|
|
6312
|
+
};
|
|
6266
6313
|
const getNavigationHistory = (config, path) => {
|
|
6267
6314
|
if (path) {
|
|
6268
6315
|
let urlRoutes = config.name;
|
|
@@ -6277,7 +6324,11 @@ const getNavigationHistory = (config, path) => {
|
|
|
6277
6324
|
});
|
|
6278
6325
|
arr.map((e) => {
|
|
6279
6326
|
const data2 = _.get(config, e);
|
|
6280
|
-
|
|
6327
|
+
if (data2) {
|
|
6328
|
+
urlRoutes = urlRoutes + ` > ${(data2 == null ? void 0 : data2.name) || (data2 == null ? void 0 : data2.eventType)}`;
|
|
6329
|
+
} else {
|
|
6330
|
+
urlRoutes = urlRoutes + " > NewComponent";
|
|
6331
|
+
}
|
|
6281
6332
|
});
|
|
6282
6333
|
return { pageName: urlRoutes };
|
|
6283
6334
|
}
|
|
@@ -6332,6 +6383,7 @@ const CoreSection = {
|
|
|
6332
6383
|
{ label: "Text Area", value: "TextArea" },
|
|
6333
6384
|
{ label: "Button", value: "Button" },
|
|
6334
6385
|
{ label: "Card", value: "card" },
|
|
6386
|
+
{ label: "Radio", value: "Radio" },
|
|
6335
6387
|
{ label: "Rank", value: "Rank" },
|
|
6336
6388
|
{ label: "SpeedoMeter", value: "SpeedoMeter" },
|
|
6337
6389
|
{ label: "ProgressBar", value: "ProgressBar" },
|
|
@@ -6625,6 +6677,38 @@ const EventSection = {
|
|
|
6625
6677
|
}
|
|
6626
6678
|
]
|
|
6627
6679
|
};
|
|
6680
|
+
const getArrayControl = (parentScope, childScope, childLabel) => {
|
|
6681
|
+
return {
|
|
6682
|
+
type: "Control",
|
|
6683
|
+
scope: `#/properties/${parentScope}`,
|
|
6684
|
+
layout: 11.5,
|
|
6685
|
+
options: {
|
|
6686
|
+
detail: {
|
|
6687
|
+
type: "HorizontalLayout",
|
|
6688
|
+
elements: [
|
|
6689
|
+
{
|
|
6690
|
+
type: "Control",
|
|
6691
|
+
scope: `#/properties/${childScope}`,
|
|
6692
|
+
options: {
|
|
6693
|
+
widget: "InputField"
|
|
6694
|
+
},
|
|
6695
|
+
config: {
|
|
6696
|
+
layout: {
|
|
6697
|
+
xs: 11,
|
|
6698
|
+
sm: 11,
|
|
6699
|
+
md: 5.5,
|
|
6700
|
+
lg: 5.5
|
|
6701
|
+
},
|
|
6702
|
+
main: {
|
|
6703
|
+
label: childLabel || "Labels for Tab"
|
|
6704
|
+
}
|
|
6705
|
+
}
|
|
6706
|
+
}
|
|
6707
|
+
]
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6710
|
+
};
|
|
6711
|
+
};
|
|
6628
6712
|
const getInputField = (scope, label) => {
|
|
6629
6713
|
return {
|
|
6630
6714
|
type: "Control",
|
|
@@ -6716,7 +6800,15 @@ const GraphSection = {
|
|
|
6716
6800
|
};
|
|
6717
6801
|
const buildPropertiesSection = function(type) {
|
|
6718
6802
|
let uiSchema = _.cloneDeep(GraphSection);
|
|
6719
|
-
if (type === "SpeedoMeter"
|
|
6803
|
+
if (type === "SpeedoMeter") {
|
|
6804
|
+
uiSchema.elements = [
|
|
6805
|
+
getInputField("segments", "Segments Count"),
|
|
6806
|
+
getInputField("heading", "Container Heading"),
|
|
6807
|
+
getInputField("heading", "Container Heading"),
|
|
6808
|
+
getInputField("speedoCaption", "Speedometer Caption"),
|
|
6809
|
+
getInputField("width", "Speedometer Width")
|
|
6810
|
+
];
|
|
6811
|
+
} else if (type === "RankCard") {
|
|
6720
6812
|
uiSchema.elements = [
|
|
6721
6813
|
getInputField("rank", "Rank"),
|
|
6722
6814
|
getInputField("image", "Image Url"),
|
|
@@ -6775,47 +6867,25 @@ const buildPropertiesSection = function(type) {
|
|
|
6775
6867
|
getSelectField("graphType", "Graph Type", [
|
|
6776
6868
|
{ label: "Bar Graph", value: "BarGraph" },
|
|
6777
6869
|
{ label: "Stack Bar Graph", value: "StackBarGraph" },
|
|
6870
|
+
{ label: "Line Graph", value: "LineGraph" },
|
|
6778
6871
|
{ label: "Pie Graph", value: "PieGraph" },
|
|
6779
6872
|
{ label: "Horizontal Bar Graph", value: "HorizontalBarGraph" }
|
|
6780
6873
|
]),
|
|
6781
6874
|
leftLabel,
|
|
6782
6875
|
bottomLabel,
|
|
6783
|
-
legendAvailabe
|
|
6876
|
+
legendAvailabe,
|
|
6877
|
+
getArrayControl("legendLabels", "label"),
|
|
6878
|
+
getArrayControl("pieArcColors", "color")
|
|
6784
6879
|
];
|
|
6785
6880
|
} else if (type === "WrapperSection") {
|
|
6786
6881
|
uiSchema.elements = [getRadioInputField("divider", "Divider", ["YES", "No"]), getRadioInputField("heading", "Page Heading", ["YES", "No"])];
|
|
6787
6882
|
} else if (type === "TabSection") {
|
|
6788
6883
|
uiSchema.elements = [
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
detail: {
|
|
6795
|
-
type: "HorizontalLayout",
|
|
6796
|
-
elements: [
|
|
6797
|
-
{
|
|
6798
|
-
type: "Control",
|
|
6799
|
-
scope: "#/properties/label",
|
|
6800
|
-
options: {
|
|
6801
|
-
widget: "InputField"
|
|
6802
|
-
},
|
|
6803
|
-
config: {
|
|
6804
|
-
layout: {
|
|
6805
|
-
xs: 11,
|
|
6806
|
-
sm: 11,
|
|
6807
|
-
md: 5.5,
|
|
6808
|
-
lg: 5.5
|
|
6809
|
-
},
|
|
6810
|
-
main: {
|
|
6811
|
-
label: "Labels for Tab"
|
|
6812
|
-
}
|
|
6813
|
-
}
|
|
6814
|
-
}
|
|
6815
|
-
]
|
|
6816
|
-
}
|
|
6817
|
-
}
|
|
6818
|
-
}
|
|
6884
|
+
getArrayControl("sectionLabels", "label")
|
|
6885
|
+
];
|
|
6886
|
+
} else if (type === "Radio") {
|
|
6887
|
+
uiSchema.elements = [
|
|
6888
|
+
getArrayControl("sectionLabels", "label", "Options Of Radio")
|
|
6819
6889
|
];
|
|
6820
6890
|
}
|
|
6821
6891
|
return uiSchema;
|
|
@@ -6978,27 +7048,82 @@ const ValueTab = {
|
|
|
6978
7048
|
type: "HorizontalLayout",
|
|
6979
7049
|
elements: [OptionArray]
|
|
6980
7050
|
};
|
|
7051
|
+
const ValidationSection = {
|
|
7052
|
+
type: "HorizontalLayout",
|
|
7053
|
+
elements: [
|
|
7054
|
+
{
|
|
7055
|
+
type: "Control",
|
|
7056
|
+
scope: "#/properties/validation",
|
|
7057
|
+
layout: 11.5,
|
|
7058
|
+
options: {
|
|
7059
|
+
detail: {
|
|
7060
|
+
type: "HorizontalLayout",
|
|
7061
|
+
elements: [
|
|
7062
|
+
{
|
|
7063
|
+
type: "Control",
|
|
7064
|
+
scope: "#/properties/validationType",
|
|
7065
|
+
options: {
|
|
7066
|
+
widget: "InputField"
|
|
7067
|
+
},
|
|
7068
|
+
config: {
|
|
7069
|
+
layout: {
|
|
7070
|
+
xs: 11,
|
|
7071
|
+
sm: 11,
|
|
7072
|
+
md: 5.5,
|
|
7073
|
+
lg: 5.5
|
|
7074
|
+
},
|
|
7075
|
+
main: {
|
|
7076
|
+
label: "Validation Type"
|
|
7077
|
+
}
|
|
7078
|
+
}
|
|
7079
|
+
},
|
|
7080
|
+
{
|
|
7081
|
+
type: "Control",
|
|
7082
|
+
scope: "#/properties/validationValue",
|
|
7083
|
+
options: {
|
|
7084
|
+
widget: "InputField"
|
|
7085
|
+
},
|
|
7086
|
+
config: {
|
|
7087
|
+
layout: {
|
|
7088
|
+
xs: 11,
|
|
7089
|
+
sm: 11,
|
|
7090
|
+
md: 5.5,
|
|
7091
|
+
lg: 5.5
|
|
7092
|
+
},
|
|
7093
|
+
main: {
|
|
7094
|
+
label: "Validation Value"
|
|
7095
|
+
}
|
|
7096
|
+
}
|
|
7097
|
+
}
|
|
7098
|
+
]
|
|
7099
|
+
}
|
|
7100
|
+
}
|
|
7101
|
+
}
|
|
7102
|
+
]
|
|
7103
|
+
};
|
|
6981
7104
|
const sectionLabels = {
|
|
6982
|
-
Select: ["Core", "Value", "style", "Event"],
|
|
6983
|
-
MultipleSelect: ["Core", "Value", "style", "Event"],
|
|
6984
|
-
Table: ["Core", "Components", "style", "Event"],
|
|
6985
|
-
LeaderBoard: ["Core", "Components", "Properties", "style", "Event"],
|
|
6986
|
-
WrapperSection: ["Core", "Components", "Properties", "style"],
|
|
6987
|
-
TabSection: ["Core", "Components", "Properties", "style"],
|
|
6988
|
-
SpeedoMeter: ["Core", "Properties", "style", "Event"],
|
|
6989
|
-
card: ["Core", "Properties", "style", "Event"],
|
|
6990
|
-
UploadFile: ["Core", "style", "Event"],
|
|
6991
|
-
Graph: ["Core", "Properties", "style", "Event"],
|
|
6992
|
-
DownloadFile: ["Core", "style", "Event"],
|
|
6993
|
-
Box: ["Core", "Properties", "style", "Event"],
|
|
6994
|
-
Properties: ["Core", "Properties", "style", "Event"],
|
|
6995
|
-
ProgressBarCard: ["Core", "Properties", "style", "Event"],
|
|
6996
|
-
RankCard: ["Core", "Properties", "style", "Event"],
|
|
6997
|
-
Slider: ["Core", "Components", "Properties", "style", "Event"],
|
|
6998
|
-
Timer: ["Core", "Properties", "style", "Event"],
|
|
6999
|
-
Rank: ["Core", "Properties", "style", "Event"],
|
|
7000
|
-
Button: ["Core", "Properties", "style", "Event"],
|
|
7001
|
-
Array: ["Core", "Components"]
|
|
7105
|
+
Select: ["Core", "Value", "style", "Event", "Validation"],
|
|
7106
|
+
MultipleSelect: ["Core", "Value", "style", "Event", "Validation"],
|
|
7107
|
+
Table: ["Core", "Components", "style", "Event", "Validation"],
|
|
7108
|
+
LeaderBoard: ["Core", "Components", "Properties", "style", "Event", "Validation"],
|
|
7109
|
+
WrapperSection: ["Core", "Components", "Properties", "style", "Validation"],
|
|
7110
|
+
TabSection: ["Core", "Components", "Properties", "style", "Validation"],
|
|
7111
|
+
SpeedoMeter: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7112
|
+
card: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7113
|
+
UploadFile: ["Core", "style", "Event", "Validation"],
|
|
7114
|
+
Graph: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7115
|
+
DownloadFile: ["Core", "style", "Event", "Validation"],
|
|
7116
|
+
Box: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7117
|
+
Properties: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7118
|
+
ProgressBarCard: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7119
|
+
RankCard: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7120
|
+
Slider: ["Core", "Components", "Properties", "style", "Event", "Validation"],
|
|
7121
|
+
Timer: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7122
|
+
Rank: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7123
|
+
Button: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7124
|
+
Array: ["Core", "Components", "Validation"],
|
|
7125
|
+
Radio: ["Core", "Properties", "style", "Event", "Validation"],
|
|
7126
|
+
Text: ["Core", "Event", "Validation"]
|
|
7002
7127
|
};
|
|
7003
7128
|
const refreshPage = (type, store2) => {
|
|
7004
7129
|
var _a;
|
|
@@ -7010,11 +7135,12 @@ const refreshPage = (type, store2) => {
|
|
|
7010
7135
|
style: StyleSection,
|
|
7011
7136
|
Event: EventSection,
|
|
7012
7137
|
Components: TableSection,
|
|
7013
|
-
Properties: buildPropertiesSection(type)
|
|
7138
|
+
Properties: buildPropertiesSection(type),
|
|
7139
|
+
Validation: ValidationSection
|
|
7014
7140
|
};
|
|
7015
7141
|
const elements = (_a = sectionLabels[type]) == null ? void 0 : _a.map((e) => sectionUiSchema[e]);
|
|
7016
|
-
UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style", "Event"];
|
|
7017
|
-
UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection];
|
|
7142
|
+
UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style", "Event", "Validation"];
|
|
7143
|
+
UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection, ValidationSection];
|
|
7018
7144
|
}
|
|
7019
7145
|
store2.setUiSchema(UiSchema);
|
|
7020
7146
|
};
|
|
@@ -7023,8 +7149,8 @@ var Component = (store2, dynamicData2) => {
|
|
|
7023
7149
|
setPage: async function() {
|
|
7024
7150
|
const formdata = await this.getFormdata();
|
|
7025
7151
|
store2.setFormdata(formdata);
|
|
7026
|
-
const
|
|
7027
|
-
store2.setSchema(
|
|
7152
|
+
const schema2 = this.getSchema();
|
|
7153
|
+
store2.setSchema(schema2);
|
|
7028
7154
|
this.refreshPage(formdata == null ? void 0 : formdata.type, store2);
|
|
7029
7155
|
},
|
|
7030
7156
|
refreshPage,
|
|
@@ -7073,8 +7199,8 @@ var Component = (store2, dynamicData2) => {
|
|
|
7073
7199
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7074
7200
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7075
7201
|
store2.formData.elements.splice(rowId, 1);
|
|
7076
|
-
const
|
|
7077
|
-
const data2 = path ? _.get(
|
|
7202
|
+
const response2 = saveFormdataInLocalStorage(store2.formData, path);
|
|
7203
|
+
const data2 = path ? _.get(response2, path) : response2;
|
|
7078
7204
|
store2.setFormdata(data2);
|
|
7079
7205
|
},
|
|
7080
7206
|
deleteEvent: async function() {
|
|
@@ -7082,8 +7208,8 @@ var Component = (store2, dynamicData2) => {
|
|
|
7082
7208
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7083
7209
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7084
7210
|
store2.formData.events.splice(rowId, 1);
|
|
7085
|
-
const
|
|
7086
|
-
store2.setFormdata(_.get(
|
|
7211
|
+
const response2 = saveFormdataInLocalStorage(store2.formData, path);
|
|
7212
|
+
store2.setFormdata(_.get(response2, path));
|
|
7087
7213
|
},
|
|
7088
7214
|
widgetAddClickHandler: async function() {
|
|
7089
7215
|
var _a;
|
|
@@ -7129,8 +7255,8 @@ var pageMaster = (funcParams) => {
|
|
|
7129
7255
|
const formdata = await this.getFormdata();
|
|
7130
7256
|
store2.setFormdata(formdata);
|
|
7131
7257
|
const uiSchema = await this.getUiSchema();
|
|
7132
|
-
const
|
|
7133
|
-
store2.setSchema(
|
|
7258
|
+
const schema2 = await this.getSchema();
|
|
7259
|
+
store2.setSchema(schema2);
|
|
7134
7260
|
store2.setUiSchema(uiSchema);
|
|
7135
7261
|
},
|
|
7136
7262
|
getFormdata: async function() {
|
|
@@ -7159,9 +7285,9 @@ var pageMaster = (funcParams) => {
|
|
|
7159
7285
|
if (!Array.isArray(store2.formData.elements)) {
|
|
7160
7286
|
store2.formData.elements = [];
|
|
7161
7287
|
}
|
|
7162
|
-
const
|
|
7288
|
+
const response2 = saveFormdataInLocalStorage(store2.formData);
|
|
7163
7289
|
store2.navigate(
|
|
7164
|
-
`/Component?path=${`elements[${
|
|
7290
|
+
`/Component?path=${`elements[${response2 == null ? void 0 : response2.elements.length}]`}&id=${id}`
|
|
7165
7291
|
);
|
|
7166
7292
|
},
|
|
7167
7293
|
submitPageHandler: async function() {
|
|
@@ -7197,8 +7323,8 @@ var pageMaster = (funcParams) => {
|
|
|
7197
7323
|
deleteEvent: async function() {
|
|
7198
7324
|
const rowId = dynamicData2.path.split(".")[1];
|
|
7199
7325
|
store2.formData.events.splice(rowId, 1);
|
|
7200
|
-
const
|
|
7201
|
-
store2.setFormdata(
|
|
7326
|
+
const response2 = saveFormdataInLocalStorage(store2.formData);
|
|
7327
|
+
store2.setFormdata(response2);
|
|
7202
7328
|
}
|
|
7203
7329
|
};
|
|
7204
7330
|
};
|
|
@@ -7343,6 +7469,7 @@ const EventUiSchema = {
|
|
|
7343
7469
|
type: "text",
|
|
7344
7470
|
options: [
|
|
7345
7471
|
{ label: "Click Event", value: "onClick" },
|
|
7472
|
+
{ label: "onStart", value: "onStart" },
|
|
7346
7473
|
{ label: "Load Event", value: "onLoad" },
|
|
7347
7474
|
{ label: "Change Event", value: "onChange" },
|
|
7348
7475
|
{ label: "Success", value: "Success" },
|
|
@@ -7705,8 +7832,8 @@ var event = (store2, dynamicData2) => {
|
|
|
7705
7832
|
setPage: async function() {
|
|
7706
7833
|
const formdata = await this.getFormData();
|
|
7707
7834
|
store2.setFormdata(formdata);
|
|
7708
|
-
const
|
|
7709
|
-
store2.setSchema(
|
|
7835
|
+
const schema2 = await this.getSchema();
|
|
7836
|
+
store2.setSchema(schema2);
|
|
7710
7837
|
this.refreshPage(formdata.Handler, store2);
|
|
7711
7838
|
},
|
|
7712
7839
|
refreshPage: (handlerType, store22) => {
|
|
@@ -7789,7 +7916,7 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
|
|
|
7789
7916
|
let nextEvent = [];
|
|
7790
7917
|
let LoadResponse = null;
|
|
7791
7918
|
if (config.eventType === "onLoad") {
|
|
7792
|
-
const { response, events } = await executetOnLoadEvent(
|
|
7919
|
+
const { response: response2, events } = await executetOnLoadEvent(
|
|
7793
7920
|
config,
|
|
7794
7921
|
componentName2,
|
|
7795
7922
|
store2,
|
|
@@ -7800,10 +7927,10 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
|
|
|
7800
7927
|
eventGroups2,
|
|
7801
7928
|
parentEventOutput2
|
|
7802
7929
|
);
|
|
7803
|
-
LoadResponse =
|
|
7930
|
+
LoadResponse = response2;
|
|
7804
7931
|
nextEvent = events;
|
|
7805
7932
|
} else {
|
|
7806
|
-
const { response, events } = await executeEventsHandler(
|
|
7933
|
+
const { response: response2, events } = await executeEventsHandler(
|
|
7807
7934
|
config,
|
|
7808
7935
|
componentName2,
|
|
7809
7936
|
store2,
|
|
@@ -7814,7 +7941,7 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
|
|
|
7814
7941
|
eventGroups2,
|
|
7815
7942
|
parentEventOutput2
|
|
7816
7943
|
);
|
|
7817
|
-
LoadResponse =
|
|
7944
|
+
LoadResponse = response2;
|
|
7818
7945
|
nextEvent = events;
|
|
7819
7946
|
}
|
|
7820
7947
|
if ((nextEvent == null ? void 0 : nextEvent.length) > 0) {
|
|
@@ -7825,7 +7952,24 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
|
|
|
7825
7952
|
};
|
|
7826
7953
|
const executetOnLoadEvent = async (config, componentName2, store2, dynamicData2, userValue2, service2, serviceHolder2, eventGroups2, parentEventOutput2) => {
|
|
7827
7954
|
try {
|
|
7828
|
-
const
|
|
7955
|
+
const startEvent = config == null ? void 0 : config.events.filter((e) => e.eventType === "onStart");
|
|
7956
|
+
if (startEvent.length > 0) {
|
|
7957
|
+
const { response: response3 } = await executeEventsHandler(
|
|
7958
|
+
config,
|
|
7959
|
+
componentName2,
|
|
7960
|
+
store2,
|
|
7961
|
+
dynamicData2,
|
|
7962
|
+
userValue2,
|
|
7963
|
+
service2,
|
|
7964
|
+
serviceHolder2,
|
|
7965
|
+
eventGroups2,
|
|
7966
|
+
parentEventOutput2
|
|
7967
|
+
);
|
|
7968
|
+
if (response3) {
|
|
7969
|
+
return;
|
|
7970
|
+
}
|
|
7971
|
+
}
|
|
7972
|
+
const { response: response2 } = await executeEventsHandler(
|
|
7829
7973
|
config,
|
|
7830
7974
|
componentName2,
|
|
7831
7975
|
store2,
|
|
@@ -7838,7 +7982,7 @@ const executetOnLoadEvent = async (config, componentName2, store2, dynamicData2,
|
|
|
7838
7982
|
);
|
|
7839
7983
|
const SuccessEvent = config == null ? void 0 : config.events.filter((e) => e.eventType === "Success");
|
|
7840
7984
|
const setEvent = SuccessEvent.length > 0 ? SuccessEvent : [{ Handler: "mergeFormdata", eventType: "Success", type: config.type }];
|
|
7841
|
-
return { response, events: setEvent };
|
|
7985
|
+
return { response: response2, events: setEvent };
|
|
7842
7986
|
} catch (err) {
|
|
7843
7987
|
const FailEvent = config == null ? void 0 : config.events.filter((e) => e.eventType === "Fail");
|
|
7844
7988
|
const setEvent = FailEvent.length > 0 ? FailEvent : [];
|
|
@@ -7909,13 +8053,13 @@ async function executeApiEventHandler(apiHandlerConfig, componentName2, store2,
|
|
|
7909
8053
|
"Access-Control-Allow-Origin": "*"
|
|
7910
8054
|
};
|
|
7911
8055
|
const { body: body2, headers: headers2 } = await buildApiPayload(apiHandlerConfig, initialBody, initialHeaders, store2, dynamicData2, userValue2);
|
|
7912
|
-
let
|
|
7913
|
-
|
|
8056
|
+
let response2;
|
|
8057
|
+
response2 = await service2[apiHandlerConfig.method](
|
|
7914
8058
|
apiHandlerConfig.path,
|
|
7915
8059
|
body2,
|
|
7916
8060
|
headers2 && { headers: headers2 }
|
|
7917
8061
|
);
|
|
7918
|
-
return { response, events: apiHandlerConfig == null ? void 0 : apiHandlerConfig.events };
|
|
8062
|
+
return { response: response2, events: apiHandlerConfig == null ? void 0 : apiHandlerConfig.events };
|
|
7919
8063
|
}
|
|
7920
8064
|
async function executeInBuiltFunctionHandler(refreshHandlerConfig, componentName, store, dynamicData, userValue, service, serviceHolder, parentEventOutput) {
|
|
7921
8065
|
let parameter = {};
|
|
@@ -7927,9 +8071,10 @@ async function executeInBuiltFunctionHandler(refreshHandlerConfig, componentName
|
|
|
7927
8071
|
return { response: void 0, events: refreshHandlerConfig == null ? void 0 : refreshHandlerConfig.events };
|
|
7928
8072
|
}
|
|
7929
8073
|
async function executeCustomHandler(customHandlerConfig, componentName, store, dynamicData, userValue, service, serviceHolder, parentEventOutput) {
|
|
8074
|
+
console.log(service);
|
|
7930
8075
|
const makeFunc = eval(customHandlerConfig.eventCode);
|
|
7931
|
-
makeFunc(store, dynamicData, userValue, parentEventOutput, service);
|
|
7932
|
-
return { response
|
|
8076
|
+
const response = await makeFunc(store, dynamicData, userValue, parentEventOutput, service, componentName);
|
|
8077
|
+
return { response, events: customHandlerConfig == null ? void 0 : customHandlerConfig.events };
|
|
7933
8078
|
}
|
|
7934
8079
|
async function mergeFormdata(handlerResponse, componentName2, eventConfig, store2) {
|
|
7935
8080
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse) && handlerResponse)) {
|
|
@@ -8008,6 +8153,7 @@ function getRefreshElements(eventConfig, eventGropus) {
|
|
|
8008
8153
|
} else {
|
|
8009
8154
|
if (eventGropus == null ? void 0 : eventGropus.onLoad) {
|
|
8010
8155
|
result = Object.keys(eventGropus == null ? void 0 : eventGropus.onLoad);
|
|
8156
|
+
result.push(result[0]);
|
|
8011
8157
|
}
|
|
8012
8158
|
}
|
|
8013
8159
|
return result;
|
|
@@ -8126,10 +8272,12 @@ var leaderBoard = {
|
|
|
8126
8272
|
label: "LeaderBoard",
|
|
8127
8273
|
divider: true
|
|
8128
8274
|
},
|
|
8275
|
+
style: { wrapperStyle: {
|
|
8276
|
+
height: { xs: 850, sm: 1e3 }
|
|
8277
|
+
} },
|
|
8129
8278
|
wrapperStyle: {
|
|
8130
8279
|
position: "relative",
|
|
8131
|
-
width: "100%"
|
|
8132
|
-
height: 1e3
|
|
8280
|
+
width: "100%"
|
|
8133
8281
|
}
|
|
8134
8282
|
},
|
|
8135
8283
|
elements: [
|
|
@@ -8645,6 +8793,41 @@ const PieGraph = {
|
|
|
8645
8793
|
}
|
|
8646
8794
|
}
|
|
8647
8795
|
};
|
|
8796
|
+
const LineGraph = {
|
|
8797
|
+
type: "Control",
|
|
8798
|
+
scope: "#/properties/graph",
|
|
8799
|
+
options: {
|
|
8800
|
+
widget: "Graph"
|
|
8801
|
+
},
|
|
8802
|
+
config: {
|
|
8803
|
+
main: {
|
|
8804
|
+
type: "LineGraph",
|
|
8805
|
+
header: "Quartely Incentive in Thousand",
|
|
8806
|
+
bottomLabel: "Years",
|
|
8807
|
+
leftLabel: "Incentive",
|
|
8808
|
+
gridHidden: true,
|
|
8809
|
+
numHidden: false,
|
|
8810
|
+
tooltipDataKey: ["MAMA New Project", "Second", "Third"],
|
|
8811
|
+
axisLeft: true,
|
|
8812
|
+
axisBottom: true,
|
|
8813
|
+
hideLeftAxisLine: false,
|
|
8814
|
+
hideBottomAxisLine: false,
|
|
8815
|
+
legend: {
|
|
8816
|
+
labelColor: "green",
|
|
8817
|
+
legendTitle: "Our Assests",
|
|
8818
|
+
direction: "row",
|
|
8819
|
+
align: "right",
|
|
8820
|
+
colorRectWidth: 20
|
|
8821
|
+
}
|
|
8822
|
+
},
|
|
8823
|
+
style: {
|
|
8824
|
+
containerStyle: {},
|
|
8825
|
+
headerStyle: {},
|
|
8826
|
+
labelStyle: {},
|
|
8827
|
+
lineStyle: {}
|
|
8828
|
+
}
|
|
8829
|
+
}
|
|
8830
|
+
};
|
|
8648
8831
|
const HorizontalBarGraph = {
|
|
8649
8832
|
type: "Control",
|
|
8650
8833
|
scope: "#/properties/graph",
|
|
@@ -8680,8 +8863,9 @@ const HorizontalBarGraph = {
|
|
|
8680
8863
|
};
|
|
8681
8864
|
const buildHorizontalBarGraph = (config, componentScope) => {
|
|
8682
8865
|
const horizontalBarGraph = _.cloneDeep(HorizontalBarGraph);
|
|
8866
|
+
horizontalBarGraph.scope = componentScope;
|
|
8683
8867
|
if (config.layout) {
|
|
8684
|
-
horizontalBarGraph.config.layout = config.layout;
|
|
8868
|
+
horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
|
|
8685
8869
|
}
|
|
8686
8870
|
horizontalBarGraph.scope = componentScope;
|
|
8687
8871
|
horizontalBarGraph.config.main.header = config.heading;
|
|
@@ -8692,7 +8876,7 @@ const buildHorizontalBarGraph = (config, componentScope) => {
|
|
|
8692
8876
|
horizontalBarGraph.config.containerStyle.background = config.containerBackground;
|
|
8693
8877
|
}
|
|
8694
8878
|
if (config.height) {
|
|
8695
|
-
horizontalBarGraph.config.containerStyle.height = config.height;
|
|
8879
|
+
horizontalBarGraph.config.style.containerStyle.height = config.height;
|
|
8696
8880
|
}
|
|
8697
8881
|
if (config.bottomLabel) {
|
|
8698
8882
|
horizontalBarGraph.config.main.bottomLabel = config.bottomLabel;
|
|
@@ -8709,10 +8893,12 @@ var SpeedoMeter = {
|
|
|
8709
8893
|
widget: "SpeedoMeter"
|
|
8710
8894
|
},
|
|
8711
8895
|
config: {
|
|
8712
|
-
layout: 12,
|
|
8896
|
+
layout: { xs: 0, sm: 12, md: 12, lg: 12 },
|
|
8897
|
+
width: 350,
|
|
8898
|
+
segments: "5",
|
|
8713
8899
|
main: {
|
|
8714
|
-
currentValueText: "",
|
|
8715
|
-
customSegmentLabels:
|
|
8900
|
+
currentValueText: "Your Score",
|
|
8901
|
+
customSegmentLabels: [],
|
|
8716
8902
|
data: {
|
|
8717
8903
|
maxValue: 1e5,
|
|
8718
8904
|
value: 5e4,
|
|
@@ -8726,7 +8912,6 @@ var SpeedoMeter = {
|
|
|
8726
8912
|
needleColor: "#3f51b5",
|
|
8727
8913
|
startColor: "red",
|
|
8728
8914
|
textColor: "black",
|
|
8729
|
-
segments: 5,
|
|
8730
8915
|
endColor: "green",
|
|
8731
8916
|
containerStyle: {
|
|
8732
8917
|
background: "white",
|
|
@@ -8751,16 +8936,28 @@ const buildSpeedoMeter = (config, componentScope) => {
|
|
|
8751
8936
|
const speedoMeter = _.cloneDeep(SpeedoMeter);
|
|
8752
8937
|
speedoMeter.scope = componentScope;
|
|
8753
8938
|
if (config.layout) {
|
|
8754
|
-
speedoMeter.config.layout = config.layout;
|
|
8939
|
+
speedoMeter.config.layout = createLayoutFormat(config.layout);
|
|
8755
8940
|
}
|
|
8756
8941
|
if (config.heading) {
|
|
8757
8942
|
speedoMeter.config.main.header = config.heading;
|
|
8758
8943
|
}
|
|
8759
|
-
if (config.
|
|
8760
|
-
speedoMeter.config.main.
|
|
8944
|
+
if (config.segments) {
|
|
8945
|
+
speedoMeter.config.main.segments = config.segments;
|
|
8946
|
+
}
|
|
8947
|
+
if (config.style) {
|
|
8948
|
+
const styleObj = JSON.parse(config.style);
|
|
8949
|
+
if (styleObj == null ? void 0 : styleObj.style) {
|
|
8950
|
+
speedoMeter.config.style = { ...speedoMeter.config.style, ...styleObj.style };
|
|
8951
|
+
}
|
|
8952
|
+
if (styleObj == null ? void 0 : styleObj.containerStyle) {
|
|
8953
|
+
speedoMeter.config.style.containerStyle = { ...speedoMeter.config.style.containerStyle, ...styleObj.containerStyle };
|
|
8954
|
+
}
|
|
8955
|
+
}
|
|
8956
|
+
if (config.width) {
|
|
8957
|
+
speedoMeter.config.main.width = config.width;
|
|
8761
8958
|
}
|
|
8762
|
-
if (config.
|
|
8763
|
-
speedoMeter.config.main.
|
|
8959
|
+
if (config.speedoCaption) {
|
|
8960
|
+
speedoMeter.config.main.currentValueText = config.speedoCaption;
|
|
8764
8961
|
}
|
|
8765
8962
|
if (config.data) {
|
|
8766
8963
|
speedoMeter.config.main.data = config.data;
|
|
@@ -8785,34 +8982,28 @@ const buildSpeedoMeter = (config, componentScope) => {
|
|
|
8785
8982
|
const buildPieGraph = (config, componentScope) => {
|
|
8786
8983
|
const pieGraph = _.cloneDeep(PieGraph);
|
|
8787
8984
|
if (config.layout) {
|
|
8788
|
-
pieGraph.config.layout = config.layout;
|
|
8789
|
-
}
|
|
8790
|
-
if (config.containerBackground) {
|
|
8791
|
-
pieGraph.config.style.containerStyle.background = config.containerBackground;
|
|
8985
|
+
pieGraph.config.layout = createLayoutFormat(config.layout);
|
|
8792
8986
|
}
|
|
8793
8987
|
if (config.height) {
|
|
8794
8988
|
pieGraph.config.style.containerStyle.height = config.height;
|
|
8795
8989
|
}
|
|
8796
|
-
if (config.
|
|
8797
|
-
pieGraph.config.main.legendAvailabe = config.
|
|
8990
|
+
if (config.legendHide) {
|
|
8991
|
+
pieGraph.config.main.legendAvailabe = config.legendHide === "YES" ? false : true;
|
|
8798
8992
|
}
|
|
8799
8993
|
pieGraph.scope = componentScope;
|
|
8800
8994
|
pieGraph.config.main.header = config.heading;
|
|
8801
|
-
if (config.
|
|
8802
|
-
pieGraph.config.main.
|
|
8995
|
+
if (config.legendLabels) {
|
|
8996
|
+
pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
|
|
8803
8997
|
}
|
|
8804
|
-
if (config.
|
|
8805
|
-
pieGraph.config.
|
|
8806
|
-
}
|
|
8807
|
-
if (config.tooltipDataKey) {
|
|
8808
|
-
pieGraph.config.main.tooltipDataKey = config.tooltipDataKey;
|
|
8998
|
+
if (config.pieArcColors) {
|
|
8999
|
+
pieGraph.config.style.pieStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
|
|
8809
9000
|
}
|
|
8810
9001
|
return pieGraph;
|
|
8811
9002
|
};
|
|
8812
9003
|
const buildStackbarGraph = (config, componentScope) => {
|
|
8813
9004
|
const barGraph = _.cloneDeep(BarGraph);
|
|
8814
9005
|
if (config.layout) {
|
|
8815
|
-
barGraph.config.layout = config.layout;
|
|
9006
|
+
barGraph.config.layout = createLayoutFormat(config.layout);
|
|
8816
9007
|
}
|
|
8817
9008
|
if (config.legendHide) {
|
|
8818
9009
|
barGraph.config.main.legendAvailable = false;
|
|
@@ -9245,15 +9436,12 @@ const buildCard = (config, componentScope) => {
|
|
|
9245
9436
|
if (config.style) {
|
|
9246
9437
|
card.config.style = JSON.parse(config.style);
|
|
9247
9438
|
}
|
|
9248
|
-
card.elements[0].scope = `#/properties/${config.name
|
|
9249
|
-
card.elements[1].scope = `#/properties/${config.name
|
|
9250
|
-
card.elements[2].scope = `#/properties/${config.name
|
|
9439
|
+
card.elements[0].scope = `#/properties/${config.name}/properties/value`;
|
|
9440
|
+
card.elements[1].scope = `#/properties/${config.name}/properties/url`;
|
|
9441
|
+
card.elements[2].scope = `#/properties/${config.name}/properties/description`;
|
|
9251
9442
|
if (config.layout) {
|
|
9252
9443
|
card.config.layout = createLayoutFormat(config.layout);
|
|
9253
9444
|
}
|
|
9254
|
-
card.elements[0].config.main.heading = config.label;
|
|
9255
|
-
card.elements[1].config.main.url = config.url;
|
|
9256
|
-
card.elements[2].config.main.heading = config.description;
|
|
9257
9445
|
return card;
|
|
9258
9446
|
};
|
|
9259
9447
|
var DateInputField = {
|
|
@@ -9374,7 +9562,7 @@ const buildTimer = (config, componentScope) => {
|
|
|
9374
9562
|
timer.config.main.label = config.label;
|
|
9375
9563
|
}
|
|
9376
9564
|
if (config.layout) {
|
|
9377
|
-
timer.config.layout = config.layout;
|
|
9565
|
+
timer.config.layout = createLayoutFormat(config.layout);
|
|
9378
9566
|
}
|
|
9379
9567
|
return timer;
|
|
9380
9568
|
};
|
|
@@ -9462,7 +9650,7 @@ var cardSlider = {
|
|
|
9462
9650
|
},
|
|
9463
9651
|
elements: [],
|
|
9464
9652
|
config: {
|
|
9465
|
-
layout:
|
|
9653
|
+
layout: 12,
|
|
9466
9654
|
main: {}
|
|
9467
9655
|
}
|
|
9468
9656
|
};
|
|
@@ -9501,6 +9689,63 @@ const buildCheckbox = (config, componentScope) => {
|
|
|
9501
9689
|
}
|
|
9502
9690
|
return check;
|
|
9503
9691
|
};
|
|
9692
|
+
const buildLineGraph = (config, componentScope) => {
|
|
9693
|
+
const lineGraph = _.cloneDeep(LineGraph);
|
|
9694
|
+
if (config.layout) {
|
|
9695
|
+
lineGraph.config.layout = config.layout;
|
|
9696
|
+
}
|
|
9697
|
+
lineGraph.config.main.header = config.heading;
|
|
9698
|
+
if (config.height) {
|
|
9699
|
+
lineGraph.config.style.containerStyle.height = config.height;
|
|
9700
|
+
}
|
|
9701
|
+
if (config.bottomLabel) {
|
|
9702
|
+
lineGraph.config.main.bottomLabel = config.bottomLabel;
|
|
9703
|
+
}
|
|
9704
|
+
if (config.leftLabel) {
|
|
9705
|
+
lineGraph.config.main.leftLabel = config.leftLabel;
|
|
9706
|
+
}
|
|
9707
|
+
if (config.legendHide) {
|
|
9708
|
+
lineGraph.config.main.legendAvailabe = config.legendHide === "YES" ? false : true;
|
|
9709
|
+
}
|
|
9710
|
+
if (config.legendLabels) {
|
|
9711
|
+
lineGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
|
|
9712
|
+
}
|
|
9713
|
+
if (config.pieArcColors) {
|
|
9714
|
+
lineGraph.config.style.lineStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
|
|
9715
|
+
}
|
|
9716
|
+
lineGraph.scope = componentScope;
|
|
9717
|
+
return lineGraph;
|
|
9718
|
+
};
|
|
9719
|
+
const RadioUiSchema = {
|
|
9720
|
+
type: "Control",
|
|
9721
|
+
scope: "#/properties/invoiceEnabled",
|
|
9722
|
+
options: {
|
|
9723
|
+
widget: "RadioInputField"
|
|
9724
|
+
},
|
|
9725
|
+
config: {
|
|
9726
|
+
layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
|
|
9727
|
+
main: {
|
|
9728
|
+
label: "Enabled",
|
|
9729
|
+
options: ["YES", "NO"],
|
|
9730
|
+
errorMessage: "Enabled is not marked as YES or NO"
|
|
9731
|
+
}
|
|
9732
|
+
}
|
|
9733
|
+
};
|
|
9734
|
+
const buildRadio = (config, componentScope) => {
|
|
9735
|
+
const Radio = _.cloneDeep(RadioUiSchema);
|
|
9736
|
+
Radio.scope = componentScope;
|
|
9737
|
+
Radio.config.main.heading = config.label;
|
|
9738
|
+
if (config.layout) {
|
|
9739
|
+
Radio.config.layout = createLayoutFormat(config.layout);
|
|
9740
|
+
}
|
|
9741
|
+
if (config.sectionLabels) {
|
|
9742
|
+
Radio.config.main.options = config.sectionLabels.map((e) => e.label || e.Options);
|
|
9743
|
+
}
|
|
9744
|
+
if (config.style) {
|
|
9745
|
+
Radio.config.style = JSON.parse(config.style);
|
|
9746
|
+
}
|
|
9747
|
+
return Radio;
|
|
9748
|
+
};
|
|
9504
9749
|
const buildUiSchema = (config) => {
|
|
9505
9750
|
let elements = {};
|
|
9506
9751
|
const componentScope = `#/properties/${config.name}`;
|
|
@@ -9526,6 +9771,9 @@ const buildUiSchema = (config) => {
|
|
|
9526
9771
|
case "Select":
|
|
9527
9772
|
elements = buildSelect(config, componentScope);
|
|
9528
9773
|
break;
|
|
9774
|
+
case "Radio":
|
|
9775
|
+
elements = buildRadio(config, componentScope);
|
|
9776
|
+
break;
|
|
9529
9777
|
case "Button":
|
|
9530
9778
|
elements = buildButton(config, componentScope);
|
|
9531
9779
|
break;
|
|
@@ -9561,7 +9809,7 @@ const buildUiSchema = (config) => {
|
|
|
9561
9809
|
elements = buildStackbarGraph(config, componentScope);
|
|
9562
9810
|
break;
|
|
9563
9811
|
case "LineGraph":
|
|
9564
|
-
elements =
|
|
9812
|
+
elements = buildLineGraph(config, componentScope);
|
|
9565
9813
|
break;
|
|
9566
9814
|
case "PieGraph":
|
|
9567
9815
|
elements = buildPieGraph(config, componentScope);
|
|
@@ -9626,8 +9874,37 @@ const buildUiSchema = (config) => {
|
|
|
9626
9874
|
}
|
|
9627
9875
|
return elements;
|
|
9628
9876
|
};
|
|
9877
|
+
const schema = {
|
|
9878
|
+
type: "object",
|
|
9879
|
+
properties: {},
|
|
9880
|
+
required: []
|
|
9881
|
+
};
|
|
9882
|
+
const buildSchema = (config) => {
|
|
9883
|
+
function buildRule(configObj) {
|
|
9884
|
+
if (configObj.validation) {
|
|
9885
|
+
configObj.validation.forEach((rule) => {
|
|
9886
|
+
if (!schema.properties[configObj.name]) {
|
|
9887
|
+
schema.properties[configObj.name] = {};
|
|
9888
|
+
}
|
|
9889
|
+
if (rule.validationType === "required") {
|
|
9890
|
+
schema.required.push(configObj.name);
|
|
9891
|
+
} else {
|
|
9892
|
+
schema.properties[configObj.name]["type"] = "string";
|
|
9893
|
+
schema.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
|
|
9894
|
+
}
|
|
9895
|
+
});
|
|
9896
|
+
}
|
|
9897
|
+
}
|
|
9898
|
+
buildRule(config);
|
|
9899
|
+
if (config == null ? void 0 : config.elements) {
|
|
9900
|
+
config.elements.forEach(buildRule);
|
|
9901
|
+
}
|
|
9902
|
+
console.log(schema);
|
|
9903
|
+
window.localStorage.setItem("schemaDemo", JSON.stringify(schema));
|
|
9904
|
+
return schema;
|
|
9905
|
+
};
|
|
9629
9906
|
var clearLocalStorage = () => {
|
|
9630
9907
|
localStorage.removeItem("pageFormdata");
|
|
9631
9908
|
};
|
|
9632
|
-
export { buildConfig, buildUiSchema, clearLocalStorage as clearPreviousCache, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService };
|
|
9909
|
+
export { buildConfig, buildSchema, buildUiSchema, clearLocalStorage as clearPreviousCache, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService };
|
|
9633
9910
|
//# sourceMappingURL=impaktapps-ui-builder.es.js.map
|