blixify-ui-web 0.2.9 → 0.2.11
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/lib/components/advanced/infoWindow/index.d.ts +4 -14
- package/lib/components/advanced/infoWindow/index.d.ts.map +1 -1
- package/lib/components/advanced/infoWindow/index.js +44 -61
- package/lib/components/advanced/infoWindow/index.js.map +1 -1
- package/lib/components/data/dataReference/index.d.ts +22 -0
- package/lib/components/data/dataReference/index.d.ts.map +1 -0
- package/lib/components/data/dataReference/index.js +138 -0
- package/lib/components/data/dataReference/index.js.map +1 -0
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +14 -10
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +1 -0
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts +2 -2
- package/lib/components/data/dataTemplate/settingsModal.js +5 -5
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/spaceModel.d.ts +4 -4
- package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +3 -3
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +6 -4
- package/lib/components/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
2
|
import "../../../index.css";
|
|
3
3
|
interface Props {
|
|
4
|
-
content:
|
|
4
|
+
content: ReactElement;
|
|
5
5
|
icon: ReactElement;
|
|
6
|
-
type: "
|
|
7
|
-
infoTextColor?: string;
|
|
8
|
-
infoCardClassName?: string;
|
|
9
|
-
infoCardBackgroundColor?: string;
|
|
10
|
-
}
|
|
11
|
-
interface State {
|
|
12
|
-
open: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare class InfoWindow extends Component<Props> {
|
|
15
|
-
state: State;
|
|
16
|
-
renderLayout: () => React.JSX.Element;
|
|
17
|
-
render(): React.JSX.Element;
|
|
6
|
+
type: "left" | "right";
|
|
18
7
|
}
|
|
8
|
+
export declare const InfoWindow: (props: Props) => React.JSX.Element;
|
|
19
9
|
export {};
|
|
20
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/advanced/infoWindow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/advanced/infoWindow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAA+B,MAAM,OAAO,CAAC;AAEzE,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,UAAW,KAAK,sBAoDtC,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,57 +22,55 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
22
|
__setModuleDefault(result, mod);
|
|
38
23
|
return result;
|
|
39
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
40
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
29
|
exports.InfoWindow = void 0;
|
|
42
30
|
var react_1 = __importStar(require("react"));
|
|
31
|
+
var react_dom_1 = __importDefault(require("react-dom"));
|
|
43
32
|
require("../../../index.css");
|
|
44
|
-
var InfoWindow =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
var InfoWindow = function (props) {
|
|
34
|
+
var iconRef = (0, react_1.useRef)(null);
|
|
35
|
+
var _a = (0, react_1.useState)(false), isVisible = _a[0], setIsVisible = _a[1];
|
|
36
|
+
var _b = (0, react_1.useState)({ top: 0, left: 0 }), position = _b[0], setPosition = _b[1];
|
|
37
|
+
(0, react_1.useEffect)(function () {
|
|
38
|
+
var iconElement = iconRef.current;
|
|
39
|
+
var handleMouseEnter = function (event) {
|
|
40
|
+
var clientX = event.clientX, clientY = event.clientY;
|
|
41
|
+
setPosition({ top: clientY, left: clientX });
|
|
42
|
+
setIsVisible(true);
|
|
50
43
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var layoutClassName = "";
|
|
54
|
-
var arrowClasses = "w-3 h-3 ".concat(_this.props.infoCardBackgroundColor
|
|
55
|
-
? _this.props.infoCardBackgroundColor
|
|
56
|
-
: "bg-gray-200", " transform rotate-45 ");
|
|
57
|
-
var arrowPosition = "";
|
|
58
|
-
switch (_this.props.type) {
|
|
59
|
-
case "top":
|
|
60
|
-
layoutClassName = "".concat(defaultClassName, " mb-7 flex flex-col");
|
|
61
|
-
arrowPosition = "-mt-1.5";
|
|
62
|
-
break;
|
|
63
|
-
case "left":
|
|
64
|
-
layoutClassName = "".concat(defaultClassName, " top-0 right-7 flex flex-row ");
|
|
65
|
-
arrowPosition = "-ml-1.5";
|
|
66
|
-
break;
|
|
67
|
-
default:
|
|
68
|
-
layoutClassName = "".concat(defaultClassName, " top-0 ml-7 flex flex-row ");
|
|
69
|
-
arrowPosition = "-mr-1.5";
|
|
70
|
-
}
|
|
71
|
-
return (react_1.default.createElement("div", { className: layoutClassName },
|
|
72
|
-
_this.props.type === "right" && (react_1.default.createElement("div", { className: "".concat(arrowClasses, " ").concat(arrowPosition) })),
|
|
73
|
-
react_1.default.createElement("div", { className: "w-full p-4 ".concat(_this.props.infoCardBackgroundColor
|
|
74
|
-
? _this.props.infoCardBackgroundColor
|
|
75
|
-
: "bg-gray-200", " rounded z-10") },
|
|
76
|
-
react_1.default.createElement("p", { className: _this.props.infoTextColor
|
|
77
|
-
? _this.props.infoTextColor
|
|
78
|
-
: "text-gray-500" }, _this.props.content && _this.props.content)),
|
|
79
|
-
_this.props.type !== "right" && (react_1.default.createElement("div", { className: "".concat(arrowClasses, " ").concat(arrowPosition) }))));
|
|
44
|
+
var handleMouseLeave = function () {
|
|
45
|
+
setIsVisible(false);
|
|
80
46
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
47
|
+
iconElement === null || iconElement === void 0 ? void 0 : iconElement.addEventListener("mouseenter", handleMouseEnter);
|
|
48
|
+
iconElement === null || iconElement === void 0 ? void 0 : iconElement.addEventListener("mouseleave", handleMouseLeave);
|
|
49
|
+
return function () {
|
|
50
|
+
iconElement === null || iconElement === void 0 ? void 0 : iconElement.removeEventListener("mouseenter", handleMouseEnter);
|
|
51
|
+
iconElement === null || iconElement === void 0 ? void 0 : iconElement.removeEventListener("mouseleave", handleMouseLeave);
|
|
52
|
+
};
|
|
53
|
+
}, [isVisible]);
|
|
54
|
+
(0, react_1.useEffect)(function () {
|
|
55
|
+
if (isVisible) {
|
|
56
|
+
var popoutElement_1 = document.createElement("div");
|
|
57
|
+
popoutElement_1.className =
|
|
58
|
+
"absolute z-50 " +
|
|
59
|
+
(props.type === "left" ? "transform -translate-x-full" : "");
|
|
60
|
+
popoutElement_1.style.position = "absolute";
|
|
61
|
+
popoutElement_1.style.top = "".concat(position.top, "px");
|
|
62
|
+
popoutElement_1.style.left = "".concat(position.left, "px");
|
|
63
|
+
document.body.appendChild(popoutElement_1);
|
|
64
|
+
react_dom_1.default.render(props.content, popoutElement_1);
|
|
65
|
+
return function () {
|
|
66
|
+
document.body.removeChild(popoutElement_1);
|
|
67
|
+
react_dom_1.default.unmountComponentAtNode(popoutElement_1);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return function () { };
|
|
71
|
+
}, [isVisible, props.content, props.type, position.top, position.left]);
|
|
72
|
+
var refIcon = react_1.default.cloneElement(props.icon, { ref: iconRef });
|
|
73
|
+
return react_1.default.createElement("div", null, refIcon);
|
|
74
|
+
};
|
|
92
75
|
exports.InfoWindow = InfoWindow;
|
|
93
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/advanced/infoWindow/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/advanced/infoWindow/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;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ructure } from "../dataTemplate/model";
|
|
3
|
+
import { WorkspaceDevSettings } from "../dataTemplate/workspaceModel";
|
|
4
|
+
interface Props {
|
|
5
|
+
value: any;
|
|
6
|
+
schema: DataStructure;
|
|
7
|
+
devSettings?: WorkspaceDevSettings;
|
|
8
|
+
onChange?: (value: any) => void;
|
|
9
|
+
lib?: {
|
|
10
|
+
axios?: any;
|
|
11
|
+
firebase?: any;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class DataReference extends Component<Props> {
|
|
15
|
+
state: {
|
|
16
|
+
referenceLoading: boolean;
|
|
17
|
+
referenceOptions: never[];
|
|
18
|
+
};
|
|
19
|
+
render(): React.JSX.Element | null;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataReference/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,UAAU,KAAK;IACb,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE;QACJ,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;KAChB,CAAC;CACH;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,CAAC;IACjD,KAAK;;;MAGH;IAEF,MAAM;CAgEP"}
|
|
@@ -0,0 +1,138 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
56
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
+
exports.DataReference = void 0;
|
|
78
|
+
var solid_1 = require("@heroicons/react/20/solid");
|
|
79
|
+
var react_1 = __importStar(require("react"));
|
|
80
|
+
var loading_1 = require("../../display/loading");
|
|
81
|
+
var select_1 = require("../../input/select");
|
|
82
|
+
var updateModule_1 = require("../updateModule");
|
|
83
|
+
var DataReference = /** @class */ (function (_super) {
|
|
84
|
+
__extends(DataReference, _super);
|
|
85
|
+
function DataReference() {
|
|
86
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
87
|
+
_this.state = {
|
|
88
|
+
referenceLoading: false,
|
|
89
|
+
referenceOptions: [],
|
|
90
|
+
};
|
|
91
|
+
return _this;
|
|
92
|
+
}
|
|
93
|
+
DataReference.prototype.render = function () {
|
|
94
|
+
var _this = this;
|
|
95
|
+
var _a, _b;
|
|
96
|
+
var loadingSelect = (react_1.default.createElement("div", { className: "flex flex-row" },
|
|
97
|
+
react_1.default.createElement(loading_1.Loading, { sizeClassName: "h-5 w-5" }),
|
|
98
|
+
react_1.default.createElement("p", { className: "ml-1" }, "Loading...")));
|
|
99
|
+
var additionalSelect = (react_1.default.createElement("div", { className: "flex flex-row" },
|
|
100
|
+
react_1.default.createElement(solid_1.MagnifyingGlassCircleIcon, { className: "w-5 h-5" }),
|
|
101
|
+
react_1.default.createElement("p", { className: "ml-1" }, "Search for more...")));
|
|
102
|
+
var schema = this.props.schema;
|
|
103
|
+
var referenceLoading = this.state.referenceLoading;
|
|
104
|
+
var devSettings = this.props.devSettings;
|
|
105
|
+
var dbModule = (devSettings === null || devSettings === void 0 ? void 0 : devSettings.apiEndpointType) === "firebase"
|
|
106
|
+
? (_a = this.props.lib) === null || _a === void 0 ? void 0 : _a.firebase
|
|
107
|
+
: (_b = this.props.lib) === null || _b === void 0 ? void 0 : _b.axios;
|
|
108
|
+
if (schema.type !== "reference" && schema.type !== "listReference")
|
|
109
|
+
return null;
|
|
110
|
+
return (react_1.default.createElement(select_1.Select, { id: schema.id, value: this.props.value, label: schema.name, placeholder: schema.placeholder, options: this.state.referenceOptions, onChange: function (value) {
|
|
111
|
+
var _a, _b;
|
|
112
|
+
(_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
113
|
+
}, additional: referenceLoading ? loadingSelect : additionalSelect, onSearch: function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
114
|
+
var clonedReferenceOptions;
|
|
115
|
+
var _a, _b, _c;
|
|
116
|
+
return __generator(this, function (_d) {
|
|
117
|
+
switch (_d.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
this.setState({ referenceLoading: true });
|
|
120
|
+
clonedReferenceOptions = JSON.parse(JSON.stringify(this.state.referenceOptions));
|
|
121
|
+
return [4 /*yield*/, (0, updateModule_1.handleRetrieveObjectReferenceOptions)(schema, clonedReferenceOptions, {}, dbModule, (devSettings === null || devSettings === void 0 ? void 0 : devSettings.apiEndpointType) === "mongoDB"
|
|
122
|
+
? "mongoServer"
|
|
123
|
+
: "fbServer", (_a = devSettings === null || devSettings === void 0 ? void 0 : devSettings.apiEndpoint) !== null && _a !== void 0 ? _a : "", (_b = devSettings === null || devSettings === void 0 ? void 0 : devSettings.apiEndpointToken) !== null && _b !== void 0 ? _b : "", (_c = devSettings === null || devSettings === void 0 ? void 0 : devSettings.apiUserToken) !== null && _c !== void 0 ? _c : "", undefined, undefined, value)];
|
|
124
|
+
case 1:
|
|
125
|
+
_d.sent();
|
|
126
|
+
this.setState({
|
|
127
|
+
referenceLoading: false,
|
|
128
|
+
referenceOptions: clonedReferenceOptions[schema.id],
|
|
129
|
+
});
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); }, disabled: schema.disabled }));
|
|
134
|
+
};
|
|
135
|
+
return DataReference;
|
|
136
|
+
}(react_1.Component));
|
|
137
|
+
exports.DataReference = DataReference;
|
|
138
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/data/dataReference/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,6CAAyC;AACzC,iDAAgD;AAChD,6CAA4C;AAG5C,gDAAuE;AAavE;IAAmC,iCAAgB;IAAnD;QAAA,qEAsEC;QArEC,WAAK,GAAG;YACN,gBAAgB,EAAE,KAAK;YACvB,gBAAgB,EAAE,EAAE;SACrB,CAAC;;IAkEJ,CAAC;IAhEC,8BAAM,GAAN;QAAA,iBA+DC;;QA9DC,IAAM,aAAa,GAAG,CACpB,uCAAK,SAAS,EAAC,eAAe;YAC5B,8BAAC,iBAAO,IAAC,aAAa,EAAC,SAAS,GAAG;YACnC,qCAAG,SAAS,EAAC,MAAM,iBAAe,CAC9B,CACP,CAAC;QAEF,IAAM,gBAAgB,GAAG,CACvB,uCAAK,SAAS,EAAC,eAAe;YAC5B,8BAAC,iCAAyB,IAAC,SAAS,EAAC,SAAS,GAAG;YACjD,qCAAG,SAA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ACF,qBAAM,IAAA,mDAAoC,EACxC,MAAM,EACN,sBAAsB,EACtB,EAAE,EACF,QAAQ,EACR,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,MAAK,SAAS;oCACxC,CAAC,CAAC,aAAa;oCACf,CAAC,CAAC,UAAU,EACd,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,mCAAI,EAAE,EAC9B,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,mCAAI,EAAE,EACnC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,mCAAI,EAAE,EAC/B,SAAS,EACT,SAAS,EACT,KAAK,CACN,EAAA;;4BAdD,SAcC,CAAC;4BACF,IAAI,CAAC,QAAQ,CAAC;gCACZ,gBAAgB,EAAE,KAAK;gCACvB,gBAAgB,EAAE,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;6BACpD,CAAC,CAAC;;;;iBACJ,EACD,QAAQ,EAAE,MAAM,CAAC,QAAQ,GACzB,CACH,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAtED,CAAmC,iBAAS,GAsE3C;AAtEY,sCAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAON,MAAM,OAAO,CAAC;AAqDf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAO1B,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAON,MAAM,OAAO,CAAC;AAqDf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAO1B,eAAO,MAAM,YAAY,mFA66IvB,CAAC"}
|
|
@@ -2623,7 +2623,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2623
2623
|
return elementList;
|
|
2624
2624
|
};
|
|
2625
2625
|
var renderDetailListData = function (model) {
|
|
2626
|
-
var _a;
|
|
2626
|
+
var _a, _b, _c, _d;
|
|
2627
2627
|
var detailList = [];
|
|
2628
2628
|
var _loop_2 = function (eachKey, eachValue) {
|
|
2629
2629
|
var showIdCondition = showId
|
|
@@ -2642,15 +2642,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2642
2642
|
var filterModel = props.model.find(function (eachAttribute) {
|
|
2643
2643
|
return eachAttribute.id === eachKey;
|
|
2644
2644
|
});
|
|
2645
|
+
var currentValue = eachValue !== null && eachValue !== void 0 ? eachValue : "-";
|
|
2646
|
+
var bareReadDescFunc = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareReadDescription;
|
|
2647
|
+
if (bareReadDescFunc === null || bareReadDescFunc === void 0 ? void 0 : bareReadDescFunc((_b = filterModel === null || filterModel === void 0 ? void 0 : filterModel.id) !== null && _b !== void 0 ? _b : "", eachValue))
|
|
2648
|
+
currentValue = bareReadDescFunc === null || bareReadDescFunc === void 0 ? void 0 : bareReadDescFunc((_c = filterModel === null || filterModel === void 0 ? void 0 : filterModel.id) !== null && _c !== void 0 ? _c : "", eachValue);
|
|
2645
2649
|
detailList.push({
|
|
2646
|
-
title: (
|
|
2647
|
-
text:
|
|
2650
|
+
title: (_d = filterModel === null || filterModel === void 0 ? void 0 : filterModel.name) !== null && _d !== void 0 ? _d : "",
|
|
2651
|
+
text: currentValue,
|
|
2648
2652
|
});
|
|
2649
2653
|
}
|
|
2650
2654
|
}
|
|
2651
2655
|
};
|
|
2652
|
-
for (var _i = 0,
|
|
2653
|
-
var
|
|
2656
|
+
for (var _i = 0, _e = Object.entries(selectedData); _i < _e.length; _i++) {
|
|
2657
|
+
var _f = _e[_i], eachKey = _f[0], eachValue = _f[1];
|
|
2654
2658
|
_loop_2(eachKey, eachValue);
|
|
2655
2659
|
}
|
|
2656
2660
|
return detailList;
|
|
@@ -3367,11 +3371,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3367
3371
|
customFeedsData.map(function (eachData) {
|
|
3368
3372
|
var _a, _b, _c, _d, _e;
|
|
3369
3373
|
var content = {
|
|
3370
|
-
content: (_a = eachData.
|
|
3371
|
-
addContent: (_b = eachData.
|
|
3372
|
-
step: (_c = eachData.
|
|
3374
|
+
content: (_a = eachData.title) !== null && _a !== void 0 ? _a : "",
|
|
3375
|
+
addContent: (_b = eachData.content) !== null && _b !== void 0 ? _b : "",
|
|
3376
|
+
step: (_c = eachData.desc) !== null && _c !== void 0 ? _c : "",
|
|
3373
3377
|
iconClass: (_d = eachData.iconClass) !== null && _d !== void 0 ? _d : "",
|
|
3374
|
-
iconType: (_e = eachData.
|
|
3378
|
+
iconType: (_e = eachData.icon) !== null && _e !== void 0 ? _e : (react_1.default.createElement(solid_1.CheckIcon, { className: "h-5 w-5 text-white" })),
|
|
3375
3379
|
};
|
|
3376
3380
|
contentList_1.push(content);
|
|
3377
3381
|
return null;
|
|
@@ -3383,7 +3387,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3383
3387
|
var content = {
|
|
3384
3388
|
content: (_a = eachData[feedsSettings_1.title]) !== null && _a !== void 0 ? _a : "",
|
|
3385
3389
|
addContent: (react_1.default.createElement("p", { className: "mt-2 text-sm text-gray-500" }, (_b = eachData[feedsSettings_1.content]) !== null && _b !== void 0 ? _b : "")),
|
|
3386
|
-
step: (_c = eachData[feedsSettings_1.
|
|
3390
|
+
step: (_c = eachData[feedsSettings_1.desc]) !== null && _c !== void 0 ? _c : "",
|
|
3387
3391
|
iconClass: (_d = feedsSettings_1.iconClass) !== null && _d !== void 0 ? _d : "bg-primary-500",
|
|
3388
3392
|
iconType: (_e = feedsSettings_1.icon) !== null && _e !== void 0 ? _e : (react_1.default.createElement(solid_1.CheckIcon, { className: "h-5 w-5 text-white" })),
|
|
3389
3393
|
};
|