blixify-ui-web 0.1.85 → 0.1.87

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.
Files changed (32) hide show
  1. package/lib/components/chart/DateRange.d.ts +25 -0
  2. package/lib/components/chart/DateRange.d.ts.map +1 -0
  3. package/lib/components/chart/DateRange.js +122 -0
  4. package/lib/components/chart/DateRange.js.map +1 -0
  5. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  6. package/lib/components/data/dataTemplate/index.js +17 -10
  7. package/lib/components/data/dataTemplate/index.js.map +1 -1
  8. package/lib/components/data/utils.d.ts +1 -0
  9. package/lib/components/data/utils.d.ts.map +1 -1
  10. package/lib/components/data/utils.js +102 -29
  11. package/lib/components/data/utils.js.map +1 -1
  12. package/lib/components/input/address/index.d.ts +2 -1
  13. package/lib/components/input/address/index.d.ts.map +1 -1
  14. package/lib/components/input/address/index.js +1 -2
  15. package/lib/components/input/address/index.js.map +1 -1
  16. package/lib/components/input/datePicker/index.d.ts +2 -1
  17. package/lib/components/input/datePicker/index.d.ts.map +1 -1
  18. package/lib/components/input/datePicker/index.js +1 -1
  19. package/lib/components/input/datePicker/index.js.map +1 -1
  20. package/lib/components/input/select/index.d.ts +1 -0
  21. package/lib/components/input/select/index.d.ts.map +1 -1
  22. package/lib/components/input/select/index.js +1 -1
  23. package/lib/components/input/select/index.js.map +1 -1
  24. package/lib/components/input/textInput/index.d.ts +2 -1
  25. package/lib/components/input/textInput/index.d.ts.map +1 -1
  26. package/lib/components/input/textInput/index.js +2 -1
  27. package/lib/components/input/textInput/index.js.map +1 -1
  28. package/lib/components/input/uploadInput/index.d.ts +2 -1
  29. package/lib/components/input/uploadInput/index.d.ts.map +1 -1
  30. package/lib/components/input/uploadInput/index.js +1 -1
  31. package/lib/components/input/uploadInput/index.js.map +1 -1
  32. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import { Component } from "react";
2
+ export interface RangeInterface {
3
+ startDate: Date;
4
+ endDate: Date;
5
+ }
6
+ interface Props {
7
+ onChangeDate: (id: string, value: Date, type?: string) => void;
8
+ onChangeData?: () => void;
9
+ onResetDate?: () => void;
10
+ onChangeSuggestedData: (type: string) => void;
11
+ customDate: RangeInterface;
12
+ }
13
+ interface State {
14
+ dateRangeModalVisible: boolean;
15
+ }
16
+ export declare class DateRange extends Component<Props> {
17
+ state: State;
18
+ handleSetData: () => void;
19
+ handleResetDate: () => void;
20
+ handleDateRangeModalVisible: (visible: boolean) => void;
21
+ renderDateModalContent: () => JSX.Element;
22
+ render(): JSX.Element;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=DateRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRange.d.ts","sourceRoot":"","sources":["../../../src/components/chart/DateRange.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMzC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf;AAED,UAAU,KAAK;IACb,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,UAAU,KAAK;IACb,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,qBAAa,SAAU,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC7C,KAAK,EAAE,KAAK,CAEV;IAEF,aAAa,aAIX;IAEF,eAAe,aAIb;IACF,2BAA2B,YAAa,OAAO,UAI7C;IAEF,sBAAsB,oBAiCpB;IAEF,MAAM;CAwDP"}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ var __importDefault = (this && this.__importDefault) || function (mod) {
41
+ return (mod && mod.__esModule) ? mod : { "default": mod };
42
+ };
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.DateRange = void 0;
45
+ var react_1 = require("@headlessui/react");
46
+ var moment_1 = __importDefault(require("moment"));
47
+ var react_2 = __importStar(require("react"));
48
+ var button_1 = require("../action/button");
49
+ var textButton_1 = require("../action/textButton");
50
+ var modal_1 = require("../display/modal");
51
+ var datePicker_1 = require("../input/datePicker");
52
+ var DateRange = /** @class */ (function (_super) {
53
+ __extends(DateRange, _super);
54
+ function DateRange() {
55
+ var _this = _super !== null && _super.apply(this, arguments) || this;
56
+ _this.state = {
57
+ dateRangeModalVisible: false,
58
+ };
59
+ _this.handleSetData = function () {
60
+ if (_this.props.onChangeData) {
61
+ _this.props.onChangeData();
62
+ }
63
+ };
64
+ _this.handleResetDate = function () {
65
+ if (_this.props.onResetDate) {
66
+ _this.props.onResetDate();
67
+ }
68
+ };
69
+ _this.handleDateRangeModalVisible = function (visible) {
70
+ _this.setState({
71
+ dateRangeModalVisible: visible,
72
+ });
73
+ };
74
+ _this.renderDateModalContent = function () {
75
+ return (react_2.default.createElement("div", { className: "px-3 sm:px-0" },
76
+ react_2.default.createElement(datePicker_1.InputDatePicker, { className: "mt-5 h-40", range: true, startDate: _this.props.customDate.startDate, endDate: _this.props.customDate.endDate, onChange: _this.props.onChangeDate }),
77
+ react_2.default.createElement("div", { className: "flex flex-row mt-6 pt-32 justify-end" },
78
+ react_2.default.createElement(button_1.Button, { text: "Close", size: "small", type: "light", onClick: function () {
79
+ _this.handleResetDate();
80
+ _this.handleDateRangeModalVisible(false);
81
+ } }),
82
+ react_2.default.createElement(button_1.Button, { className: "ml-4", text: "Submit", size: "small", type: "normal", onClick: function () {
83
+ _this.handleSetData();
84
+ _this.handleDateRangeModalVisible(false);
85
+ } }))));
86
+ };
87
+ return _this;
88
+ }
89
+ DateRange.prototype.render = function () {
90
+ var _this = this;
91
+ return (react_2.default.createElement(react_2.default.Fragment, null,
92
+ react_2.default.createElement(modal_1.Modal, { title: "Select Date Range", open: this.state.dateRangeModalVisible, lib: {
93
+ Dialog: react_1.Dialog,
94
+ Transition: react_1.Transition,
95
+ }, renderContent: this.renderDateModalContent, onClose: function () {
96
+ _this.handleResetDate();
97
+ _this.handleDateRangeModalVisible(false);
98
+ } }),
99
+ react_2.default.createElement("div", { className: "flex flex-col sm:flex-row w-full justify-center items-center" },
100
+ react_2.default.createElement("div", { className: "grow" }),
101
+ react_2.default.createElement("p", { className: "ml-3 mb-3 text-gray-700" }, "Custom Duration: "),
102
+ react_2.default.createElement("div", { className: "w-full mt-2 sm:w-56 sm:mt-0" },
103
+ react_2.default.createElement(textButton_1.TextButton, { className: "ml-3 mb-3", text: (0, moment_1.default)(this.props.customDate.startDate).format("DD-MM-YYYY") +
104
+ " - " +
105
+ (0, moment_1.default)(this.props.customDate.endDate).format("DD-MM-YYYY"), onClick: function () {
106
+ _this.handleDateRangeModalVisible(true);
107
+ } }))),
108
+ react_2.default.createElement("div", { className: "flex flex-col sm:flex-row w-full justify-center items-center" },
109
+ react_2.default.createElement("div", { className: "grow" }),
110
+ react_2.default.createElement("p", { className: "ml-3 mb-3 text-gray-700" }, "Suggested Duration: "),
111
+ react_2.default.createElement("div", { className: "w-full mt-2 sm:w-56 sm:mt-0" },
112
+ react_2.default.createElement(textButton_1.TextButton, { className: "ml-3 mb-3", text: "Last 7 days", onClick: function () {
113
+ _this.props.onChangeSuggestedData("seven");
114
+ } }),
115
+ react_2.default.createElement(textButton_1.TextButton, { className: "ml-3 mb-3", text: "Last 28 days", onClick: function () {
116
+ _this.props.onChangeSuggestedData("28days");
117
+ } })))));
118
+ };
119
+ return DateRange;
120
+ }(react_2.Component));
121
+ exports.DateRange = DateRange;
122
+ //# sourceMappingURL=DateRange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRange.js","sourceRoot":"","sources":["../../../src/components/chart/DateRange.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAuD;AACvD,kDAA4B;AAC5B,6CAAyC;AACzC,2CAA0C;AAC1C,mDAAkD;AAClD,0CAAyC;AACzC,kDAAsD;AAmBtD;IAA+B,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CAAC;IACJ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAwDD,eAAO,MAAM,aAAa,aAKzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAK5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,eAwnGxC"}
@@ -1837,6 +1837,9 @@ function DataTemplate(props) {
1837
1837
  props.model.map(function (eachAttribute) {
1838
1838
  if (eachAttribute.id === "baseUpdatedAt" ||
1839
1839
  eachAttribute.type === "listObject" ||
1840
+ eachAttribute.type === "file" ||
1841
+ eachAttribute.type === "multipleFile" ||
1842
+ eachAttribute.type === "multipleImage" ||
1840
1843
  eachAttribute.hide) {
1841
1844
  return null;
1842
1845
  }
@@ -1878,6 +1881,7 @@ function DataTemplate(props) {
1878
1881
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1879
1882
  var clonedSelectedData = handleClonedDataAttribute(data, model);
1880
1883
  var label = eachAttribute.name;
1884
+ var labelExtra = !eachAttribute.optional ? (react_1.default.createElement("span", { className: "text-red-500" }, " (*) ")) : undefined;
1881
1885
  var disabled = props.type === "read"
1882
1886
  ? true
1883
1887
  : props.type === "update" && props.id === "new"
@@ -1885,7 +1889,7 @@ function DataTemplate(props) {
1885
1889
  : eachAttribute.disabled;
1886
1890
  switch (eachAttribute.type) {
1887
1891
  case "address":
1888
- inputList.push(react_1.default.createElement(address_1.Address, { id: eachAttribute.id, optional: eachAttribute.optional, label: label, value: (_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {
1892
+ inputList.push(react_1.default.createElement(address_1.Address, { id: eachAttribute.id, optional: eachAttribute.optional, label: label, labelExtra: labelExtra, value: (_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {
1889
1893
  lat: 0,
1890
1894
  lng: 0,
1891
1895
  name: "",
@@ -1896,7 +1900,10 @@ function DataTemplate(props) {
1896
1900
  case "object":
1897
1901
  var objectValue = Object.values((_b = clonedSelectedData[eachAttribute.id]) !== null && _b !== void 0 ? _b : {});
1898
1902
  inputList.push(react_1.default.createElement(react_1.default.Fragment, null,
1899
- react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" }, label),
1903
+ react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" },
1904
+ label,
1905
+ " ",
1906
+ labelExtra),
1900
1907
  react_1.default.createElement("div", { className: "block bg-white w-full border cursor-pointer border-gray-300 text-gray-300 text-left rounded-md mt-1 px-5 py-3 text-base focus:border-primary-500 focus:outline-none", onClick: function () {
1901
1908
  var _a;
1902
1909
  setSelectedObjectStructureId(eachAttribute.id);
@@ -1925,13 +1932,13 @@ function DataTemplate(props) {
1925
1932
  }
1926
1933
  });
1927
1934
  }
1928
- inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, optional: eachAttribute.optional, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : (eachAttribute.type === "list" ? "" : []), label: label, options: optionList_2, onChange: function (value) {
1935
+ inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, optional: eachAttribute.optional, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : (eachAttribute.type === "list" ? "" : []), label: label, labelExtra: labelExtra, options: optionList_2, onChange: function (value) {
1929
1936
  handleOnChangeSelect(eachAttribute.id, value);
1930
1937
  }, disabled: disabled }));
1931
1938
  break;
1932
1939
  case "boolean":
1933
1940
  var value = (_e = clonedSelectedData[eachAttribute.id]) === null || _e === void 0 ? void 0 : _e.toString();
1934
- inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, optional: eachAttribute.optional, options: [
1941
+ inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, options: [
1935
1942
  {
1936
1943
  key: "true",
1937
1944
  label: "True",
@@ -1955,7 +1962,7 @@ function DataTemplate(props) {
1955
1962
  : (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
1956
1963
  : (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName, props.id, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id]);
1957
1964
  }
1958
- inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_f = props.lib) === null || _f === void 0 ? void 0 : _f.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, optional: eachAttribute.optional, hidePreview: eachAttribute.type === "image" ? false : true, file: (_g = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _g !== void 0 ? _g : "", accept: eachAttribute.type === "image" ? ".png,.jpg,.jpe,.tiff" : ".pdf", fileDescription: eachAttribute.type === "image" ? undefined : "PDF up to 30MB", maxFileSize: props.maxFileSize, onChange: handleOnChangeFile, disabled: disabled }));
1965
+ inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_f = props.lib) === null || _f === void 0 ? void 0 : _f.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, hidePreview: eachAttribute.type === "image" ? false : true, file: (_g = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _g !== void 0 ? _g : "", accept: eachAttribute.type === "image" ? ".png,.jpg,.jpe,.tiff" : ".pdf", fileDescription: eachAttribute.type === "image" ? undefined : "PDF up to 30MB", maxFileSize: props.maxFileSize, onChange: handleOnChangeFile, disabled: disabled }));
1959
1966
  break;
1960
1967
  case "multipleFile":
1961
1968
  case "multipleImage":
@@ -1965,7 +1972,7 @@ function DataTemplate(props) {
1965
1972
  fileName: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName, props.id, eachImage.fileName, eachImage.token),
1966
1973
  };
1967
1974
  });
1968
- inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, clonedSelectedData[eachAttribute.id]), { data: multipleDataUrl }), optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: eachAttribute.type === "multipleImage"
1975
+ inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, clonedSelectedData[eachAttribute.id]), { data: multipleDataUrl }), optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, labelExtra: labelExtra, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: eachAttribute.type === "multipleImage"
1969
1976
  ? ".png,.jpg,.jpe,.tiff"
1970
1977
  : ".pdf", fileDescription: eachAttribute.type === "multipleImage"
1971
1978
  ? undefined
@@ -1977,12 +1984,12 @@ function DataTemplate(props) {
1977
1984
  }, disabled: disabled }));
1978
1985
  break;
1979
1986
  case "number":
1980
- inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_j = clonedSelectedData[eachAttribute.id]) !== null && _j !== void 0 ? _j : "", placeholder: label, label: label, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
1987
+ inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_j = clonedSelectedData[eachAttribute.id]) !== null && _j !== void 0 ? _j : "", placeholder: label, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
1981
1988
  break;
1982
1989
  case "reference":
1983
1990
  case "listReference":
1984
1991
  inputList.push(react_1.default.createElement(react_1.default.Fragment, null,
1985
- react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : (eachAttribute.type === "reference" ? "" : []), label: label, optional: eachAttribute.optional, options: isObject
1992
+ react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : (eachAttribute.type === "reference" ? "" : []), label: label, labelExtra: labelExtra, optional: eachAttribute.optional, options: isObject
1986
1993
  ? referencesOptions[selectedObjectStructureId + "." + eachAttribute.id]
1987
1994
  : (_l = referencesOptions[eachAttribute.id]) !== null && _l !== void 0 ? _l : [], onChange: function (value) {
1988
1995
  handleOnChangeSelect(eachAttribute.id, value);
@@ -2016,10 +2023,10 @@ function DataTemplate(props) {
2016
2023
  else if (eachAttribute.type === "email") {
2017
2024
  textType = "email";
2018
2025
  }
2019
- inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: textType, value: (_m = clonedSelectedData[eachAttribute.id]) !== null && _m !== void 0 ? _m : "", placeholder: label, label: label, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
2026
+ inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: textType, value: (_m = clonedSelectedData[eachAttribute.id]) !== null && _m !== void 0 ? _m : "", placeholder: label, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
2020
2027
  break;
2021
2028
  case "date":
2022
- inputList.push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, id: eachAttribute.id, optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], onChange: handleOnChangeDate, value: clonedSelectedData[eachAttribute.id], disabled: disabled }));
2029
+ inputList.push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, labelExtra: labelExtra, id: eachAttribute.id, optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], onChange: handleOnChangeDate, value: clonedSelectedData[eachAttribute.id], disabled: disabled }));
2023
2030
  break;
2024
2031
  }
2025
2032
  });