blixify-ui-web 0.2.10 → 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.
@@ -0,0 +1,22 @@
1
+ import React, { Component } from "react";
2
+ import { DataStructure } 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,iB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AAO,KAAa;;;;;;4BAC5B,IAAI,CAAC,QAAQ,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;4BACpC,sBAAsB,GAAG,IAAI,CAAC,KAAK,CACvC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAC5C,CAAC;4BACF,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,mFAw6IvB,CAAC"}
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: (_a = filterModel === null || filterModel === void 0 ? void 0 : filterModel.name) !== null && _a !== void 0 ? _a : "",
2647
- text: eachValue !== null && eachValue !== void 0 ? eachValue : "-",
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, _b = Object.entries(selectedData); _i < _b.length; _i++) {
2653
- var _c = _b[_i], eachKey = _c[0], eachValue = _c[1];
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.content) !== null && _a !== void 0 ? _a : "",
3371
- addContent: (_b = eachData.addContent) !== null && _b !== void 0 ? _b : "",
3372
- step: (_c = eachData.step) !== null && _c !== void 0 ? _c : "",
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.iconType) !== null && _e !== void 0 ? _e : (react_1.default.createElement(solid_1.CheckIcon, { className: "h-5 w-5 text-white" })),
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.step]) !== null && _c !== void 0 ? _c : "",
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
  };