impaktapps-ui-builder 1.0.200 → 1.0.201

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.
@@ -6250,6 +6250,7 @@ const ComponentSchema = {
6250
6250
  { title: "Radio", const: "Radio" },
6251
6251
  { title: "Rank", const: "Rank" },
6252
6252
  { title: "Rank Card", const: "RankCard" },
6253
+ { title: "Metric Card", const: "MetricCard" },
6253
6254
  { title: "Runner Boy", const: "RunnerBoyProgressBar" },
6254
6255
  { title: "Table", const: "Table" },
6255
6256
  { title: "Tabs", const: "TabSection" },
@@ -6313,6 +6314,12 @@ const ComponentSchema = {
6313
6314
  { title: "Standard", const: "standard" }
6314
6315
  ]
6315
6316
  },
6317
+ growthRate: {
6318
+ oneOf: [
6319
+ { title: "Positive", const: "positive" },
6320
+ { title: "Negative", const: "negative" }
6321
+ ]
6322
+ },
6316
6323
  orientation: {
6317
6324
  oneOf: [
6318
6325
  { title: "Horizontal", const: "horizontal" },
@@ -7974,14 +7981,14 @@ const buildPropertiesSection = function(type) {
7974
7981
  emptyBox$1("cardEmpty", { xs: 0, sm: 0, md: 8, lg: 8 })
7975
7982
  ];
7976
7983
  break;
7977
- case "DataCard":
7984
+ case "MetricCard":
7978
7985
  uiSchema.elements = [
7979
7986
  getInputField("url", "Image Url"),
7980
7987
  getInputField("label", "Label"),
7981
7988
  getInputField("description", "Description"),
7982
- getInputField("value", "value"),
7983
- getInputField("trendIconUrl", "Trend Icon Url"),
7984
- emptyBox$1("cardEmpty", { xs: 0, sm: 0, md: 8, lg: 8 })
7989
+ getInputField("cardValue", "Value"),
7990
+ getSelectField("growthRate", "Growth Rate"),
7991
+ getInputField("color", "Card Color")
7985
7992
  ];
7986
7993
  break;
7987
7994
  case "Button":
@@ -8618,6 +8625,7 @@ const sectionLabels = {
8618
8625
  Properties: ["Core", "Properties", "Events", "Style", "Validation"],
8619
8626
  ProgressBarCard: ["Core", "Properties", "Events", "Style", "Validation"],
8620
8627
  RankCard: ["Core", "Properties", "Events", "Style", "Validation"],
8628
+ MetricCard: ["Core", "Properties", "Events", "Style", "Validation"],
8621
8629
  Slider: ["Core", "Components", "Events", "Style", "Validation"],
8622
8630
  Timer: ["Core", "Events", "Style", "Validation"],
8623
8631
  Rank: ["Core", "Events", "Style", "Validation"],
@@ -11798,257 +11806,43 @@ const buildCard = (config, componentScope, store) => {
11798
11806
  }
11799
11807
  return card;
11800
11808
  };
11801
- function DataCard(theme) {
11802
- const uiSchema = {
11803
- type: "WrapperLayout",
11804
- config: {
11805
- main: {},
11806
- style: {
11807
- wrapperStyle: {
11808
- position: "relative",
11809
- top: "50%",
11810
- transform: "translateY(-50%)",
11811
- marginBottom: 0,
11812
- borderRadius: "8px"
11813
- },
11814
- componentsBoxStyle: {
11815
- boxShadow: "0px 2px 6px rgba(0, 0, 0, 0.06)",
11816
- flexDirection: "column",
11817
- overflow: "hidden",
11818
- flexWrap: "nowrap",
11819
- width: "90% !important",
11820
- background: "#F9FAFB",
11821
- border: "2px solid #E5E7EB",
11822
- borderRadius: "16px",
11823
- padding: "24px 20px 20px 24px",
11824
- height: "100%",
11825
- minHeight: "140px",
11826
- position: "relative",
11827
- marginLeft: "0px",
11828
- transition: "all 0.3s ease",
11829
- "&:hover": {
11830
- transform: "translateY(-6px)",
11831
- boxShadow: "0px 8px 16px rgba(0, 0, 0, 0.08)"
11832
- }
11833
- }
11834
- },
11835
- layout: { xs: 12, sm: 12, md: 6, lg: 3 }
11836
- },
11837
- elements: [
11838
- {
11839
- type: "Control",
11840
- scope: "#/properties/programType",
11841
- config: {
11842
- main: {
11843
- url: "https://unpkg.com/heroicons@2.0.18/24/outline/information-circle.svg"
11844
- },
11845
- style: {
11846
- containerStyle: {
11847
- position: "absolute",
11848
- top: "20px",
11849
- right: "20px",
11850
- display: "flex",
11851
- justifyContent: "center",
11852
- alignItems: "center",
11853
- background: "#F3F4F6",
11854
- borderRadius: "20%",
11855
- width: "48px",
11856
- height: "48px",
11857
- padding: "12px"
11858
- },
11859
- imageStyle: {
11860
- width: "24px",
11861
- height: "24px",
11862
- padding: "0px",
11863
- margin: "0px",
11864
- opacity: 0.7
11865
- }
11866
- }
11867
- },
11868
- options: { widget: "Image" }
11869
- },
11870
- {
11871
- type: "Control",
11872
- scope: "#/properties/programType",
11873
- config: {
11874
- main: {
11875
- heading: "METRIC"
11876
- },
11877
- style: {
11878
- color: "#9CA3AF",
11879
- justifyContent: "flex-start",
11880
- background: "inherit",
11881
- margin: "0px",
11882
- marginBottom: "16px",
11883
- paddingRight: "60px",
11884
- whiteSpace: "normal",
11885
- wordWrap: "break-word",
11886
- overflowWrap: "break-word",
11887
- fontStyle: "normal",
11888
- fontSize: "12px",
11889
- fontWeight: "600",
11890
- letterSpacing: "0.3px",
11891
- textTransform: "uppercase",
11892
- fontFamily: "Arial",
11893
- maxWidth: "24%",
11894
- lineHeight: "1.2",
11895
- height: "20px"
11896
- }
11897
- },
11898
- options: { widget: "Box" }
11899
- },
11900
- {
11901
- type: "Control",
11902
- scope: "#/properties/programType",
11903
- config: {
11904
- main: {
11905
- heading: "--"
11906
- },
11907
- style: {
11908
- color: "#111827",
11909
- display: "flex",
11910
- fontSize: { xs: "36px", md: "42px" },
11911
- fontWeight: "700",
11912
- background: "inherit",
11913
- justifyContent: "flex-start",
11914
- width: "100%",
11915
- margin: "0px",
11916
- marginBottom: "16px",
11917
- lineHeight: "1",
11918
- maxWidth: "200px",
11919
- whiteSpace: "nowrap",
11920
- opacity: 0.85
11921
- }
11922
- },
11923
- options: { widget: "Box" }
11924
- },
11925
- {
11926
- type: "WrapperLayout",
11927
- config: {
11928
- main: { spacing: 0, rowSpacing: 0, columnSpacing: 0, gap: 0 },
11929
- style: {
11930
- componentsBoxStyle: {
11931
- display: "flex",
11932
- flexDirection: "row",
11933
- alignItems: "center",
11934
- justifyContent: "flex-start",
11935
- background: "#E5E7EB",
11936
- borderRadius: "999px",
11937
- padding: "6px 14px",
11938
- width: "fit-content",
11939
- whiteSpace: "nowrap",
11940
- gap: "6px",
11941
- margin: "0px",
11942
- paddingLeft: "20px",
11943
- paddingRight: "20px"
11944
- }
11945
- },
11946
- layout: { xs: "auto" }
11947
- },
11948
- elements: [
11949
- {
11950
- type: "Control",
11951
- scope: "#/properties/programType",
11952
- config: {
11953
- main: {
11954
- url: "https://unpkg.com/heroicons@2.0.18/24/outline/arrow-right.svg"
11955
- },
11956
- style: {
11957
- containerStyle: {
11958
- display: "flex",
11959
- alignItems: "center",
11960
- justifyContent: "center",
11961
- margin: "0px",
11962
- padding: "0px"
11963
- },
11964
- imageStyle: {
11965
- width: "14px",
11966
- height: "14px",
11967
- filter: "brightness(0) invert(0.5)",
11968
- display: "block"
11969
- }
11970
- },
11971
- layout: { xs: "auto" }
11972
- },
11973
- options: { widget: "Image" }
11974
- },
11975
- {
11976
- type: "Control",
11977
- scope: "#/properties/programType",
11978
- config: {
11979
- main: {
11980
- heading: "\u2014"
11981
- },
11982
- style: {
11983
- color: "#6B7280",
11984
- fontSize: "12px",
11985
- fontWeight: "550",
11986
- background: "transparent",
11987
- margin: "0px",
11988
- padding: "0px",
11989
- lineHeight: "1",
11990
- display: "flex",
11991
- alignItems: "center"
11992
- },
11993
- layout: { xs: "auto" }
11994
- },
11995
- options: { widget: "Box" }
11996
- }
11997
- ]
11998
- }
11999
- ]
12000
- };
12001
- return uiSchema;
12002
- }
12003
- const buildDataCard = (config2, componentScope2, store2) => {
12004
- var _a, _b, _c, _d, _e;
12005
- const card2 = _.cloneDeep(DataCard(store2.theme.myTheme));
11809
+ var MetricCard = {
11810
+ type: "Control",
11811
+ scope: "#/properties/metricpath",
11812
+ options: {
11813
+ widget: "MetricCard"
11814
+ },
11815
+ config: {
11816
+ layout: { xs: 12, sm: 12, md: 12, lg: 12 },
11817
+ main: {}
11818
+ }
11819
+ };
11820
+ const buildMetricCard = (config2, componentScope2, store2) => {
11821
+ const card2 = _.cloneDeep(MetricCard);
11822
+ card2.scope = componentScope2;
12006
11823
  if (config2.style) {
12007
- const parsedStyle = JSON.parse(config2.style);
12008
- card2.config.wrapperStyle = parsedStyle;
12009
- card2.elements[1].config.style = {
12010
- ...card2.elements[1].config.style,
12011
- ...(_a = parsedStyle.labelStyle) != null ? _a : {}
12012
- };
12013
- card2.elements[3].config.style.componentsBoxStyle = {
12014
- ...card2.elements[3].config.style.componentsBoxStyle,
12015
- ...(_b = parsedStyle.descriptionBoxStyle) != null ? _b : {}
12016
- };
12017
- card2.elements[2].config.style = {
12018
- ...card2.elements[2].config.style,
12019
- ...(_c = parsedStyle.valueStyle) != null ? _c : {}
12020
- };
12021
- card2.config.componentsBoxStyle = {
12022
- ...card2.config.componentsBoxStyle,
12023
- ...(_d = parsedStyle.componentsBoxStyle) != null ? _d : {}
12024
- };
12025
- card2.elements[0].config.style.containerStyle = {
12026
- ...card2.elements[0].config.style.containerStyle,
12027
- ...(_e = parsedStyle.imageContainerStyle) != null ? _e : {}
12028
- };
11824
+ card2.config.style = JSON.parse(config2.style);
12029
11825
  }
12030
- card2.elements[2].scope = `#/properties/${config2.name}/properties/value`;
12031
- card2.elements[0].scope = `#/properties/${config2.name}/properties/url`;
12032
- card2.elements[3].elements[1].scope = `#/properties/${config2.name}/properties/description`;
12033
- card2.elements[1].scope = `#/properties/${config2.name}/properties/label`;
12034
- card2.elements[3].elements[0].scope = `#/properties/${config2.name}/properties/trendIconUrl`;
12035
11826
  if (config2.layout) {
12036
11827
  card2.config.layout = createLayoutFormat(config2.layout);
12037
11828
  }
12038
11829
  if (config2.label) {
12039
- card2.elements[1].config.main.heading = config2.label;
11830
+ card2.config.main.label = config2.label;
12040
11831
  }
12041
11832
  if (config2.url) {
12042
- card2.elements[0].config.main.url = config2.url;
11833
+ card2.config.main.url = config2.url;
12043
11834
  }
12044
11835
  if (config2.description) {
12045
- card2.elements[3].elements[1].config.main.heading = config2.description;
11836
+ card2.config.main.description = config2.description;
12046
11837
  }
12047
- if (config2.value) {
12048
- card2.elements[2].config.main.heading = config2.value;
11838
+ if (config2.values) {
11839
+ card2.config.main.cardValue = config2.value;
12049
11840
  }
12050
- if (config2.trendIconUrl) {
12051
- card2.elements[3].elements[0].config.main.url = config2.trendIconUrl;
11841
+ if (config2.growthRate) {
11842
+ card2.config.main.growthRate = config2.growthRate;
11843
+ }
11844
+ if (config2.color) {
11845
+ card2.config.main.color = config2.color;
12052
11846
  }
12053
11847
  return card2;
12054
11848
  };
@@ -13003,8 +12797,9 @@ const buildUiSchema = (config2, store2) => {
13003
12797
  case "card":
13004
12798
  elements = buildCard(config2, componentScope2, store2);
13005
12799
  break;
13006
- case "DataCard":
13007
- elements = buildDataCard(config2, componentScope2, store2);
12800
+ case "MetricCard":
12801
+ elements = buildMetricCard(config2, componentScope2);
12802
+ break;
13008
12803
  case "Graph":
13009
12804
  switch (config2.graphType) {
13010
12805
  case "BarGraph":