blixify-ui-web 0.4.106 → 0.4.108

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,44 @@
1
+ import React, { Component } from "react";
2
+ import "../../../index.css";
3
+ import { LinkProps } from "../../structure/link";
4
+ import { ChartUtils } from "../ChartUtils";
5
+ interface GanttTask {
6
+ id: string;
7
+ name: string;
8
+ start: Date;
9
+ end: Date;
10
+ color?: string;
11
+ }
12
+ interface Props extends ChartUtils, LinkProps {
13
+ title: string;
14
+ tasks?: GanttTask[];
15
+ showGrid?: boolean;
16
+ showTooltip?: boolean;
17
+ showDataLabel?: boolean;
18
+ showToolbar?: boolean;
19
+ borderColor?: string;
20
+ onClick?: (taskId: string, taskName: string) => void;
21
+ }
22
+ export declare class GanttChart extends Component<Props> {
23
+ state: {
24
+ apexModule: null;
25
+ colors: never[];
26
+ };
27
+ componentDidMount: () => Promise<void>;
28
+ renderTasksToSeries: () => {
29
+ name: string;
30
+ data: {
31
+ x: string;
32
+ y: number[];
33
+ }[];
34
+ }[];
35
+ renderChart: () => React.JSX.Element;
36
+ renderDarkModeSettings: () => {
37
+ bgColor: string;
38
+ textColor: string;
39
+ borderColor: string;
40
+ };
41
+ render(): React.JSX.Element;
42
+ }
43
+ export {};
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/ganttChart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,UAAU,SAAS;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,KAAM,SAAQ,UAAU,EAAE,SAAS;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED,qBAAa,UAAW,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC9C,KAAK;;;MAGH;IAEF,iBAAiB,sBAcf;IAEF,mBAAmB;;;;;;QAgBjB;IAEF,WAAW,0BAiIT;IAEF,sBAAsB;;;;MAQpB;IAEF,MAAM;CA6BP"}
@@ -0,0 +1,249 @@
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.GanttChart = void 0;
78
+ var react_1 = __importStar(require("react"));
79
+ require("../../../index.css");
80
+ var DateRange_1 = require("../DateRange");
81
+ var GanttChart = /** @class */ (function (_super) {
82
+ __extends(GanttChart, _super);
83
+ function GanttChart() {
84
+ var _this = _super !== null && _super.apply(this, arguments) || this;
85
+ _this.state = {
86
+ apexModule: null,
87
+ colors: [],
88
+ };
89
+ _this.componentDidMount = function () { return __awaiter(_this, void 0, void 0, function () {
90
+ var reactApexChart, colors, propColors, primaryColor;
91
+ return __generator(this, function (_a) {
92
+ switch (_a.label) {
93
+ case 0: return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require("react-apexcharts")); })];
94
+ case 1:
95
+ reactApexChart = _a.sent();
96
+ colors = undefined;
97
+ propColors = this.props.colors;
98
+ primaryColor = localStorage.getItem("localChartColors");
99
+ primaryColor = primaryColor ? JSON.parse(primaryColor) : primaryColor;
100
+ if (propColors && propColors.length > 0)
101
+ colors = propColors;
102
+ else if (primaryColor)
103
+ colors = primaryColor;
104
+ this.setState({
105
+ apexModule: reactApexChart.default,
106
+ colors: colors,
107
+ });
108
+ return [2 /*return*/];
109
+ }
110
+ });
111
+ }); };
112
+ _this.renderTasksToSeries = function () {
113
+ if (!_this.props.tasks || _this.props.tasks.length === 0) {
114
+ return [];
115
+ }
116
+ var seriesData = _this.props.tasks.map(function (task) { return ({
117
+ x: task.name,
118
+ y: [task.start.getTime(), task.end.getTime()],
119
+ }); });
120
+ return [
121
+ {
122
+ name: "Tasks",
123
+ data: seriesData,
124
+ },
125
+ ];
126
+ };
127
+ _this.renderChart = function () {
128
+ var _a, _b, _c, _d;
129
+ var APEXModule = _this.state.apexModule;
130
+ var borderColor = _this.renderDarkModeSettings().borderColor;
131
+ var series = _this.renderTasksToSeries();
132
+ return (react_1.default.createElement(react_1.default.Fragment, null, APEXModule && (react_1.default.createElement(APEXModule, { options: {
133
+ chart: {
134
+ type: "rangeBar",
135
+ foreColor: _this.props.darkMode ? "#FFFFFF" : "#000000",
136
+ toolbar: {
137
+ show: (_a = _this.props.showToolbar) !== null && _a !== void 0 ? _a : true,
138
+ },
139
+ events: {
140
+ click: function (_event, _chartContext, config) {
141
+ var _a, _b, _c, _d, _e;
142
+ if (config.dataPointIndex !== -1) {
143
+ var taskName_1 = (_b = (_a = config === null || config === void 0 ? void 0 : config.globals) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b[config.dataPointIndex];
144
+ var task = (_c = _this.props.tasks) === null || _c === void 0 ? void 0 : _c.find(function (t) { return t.name === taskName_1; });
145
+ if (task) {
146
+ (_e = (_d = _this.props).onClick) === null || _e === void 0 ? void 0 : _e.call(_d, task.id, task.name);
147
+ }
148
+ }
149
+ },
150
+ },
151
+ },
152
+ plotOptions: {
153
+ bar: {
154
+ horizontal: true,
155
+ barHeight: "50%",
156
+ rangeBarGroupRows: false,
157
+ distributed: true,
158
+ },
159
+ },
160
+ dataLabels: {
161
+ enabled: (_b = _this.props.showDataLabel) !== null && _b !== void 0 ? _b : true,
162
+ formatter: function (_val, opts) {
163
+ var taskName = opts.w.globals.labels[opts.dataPointIndex];
164
+ return taskName;
165
+ },
166
+ style: {
167
+ colors: [_this.props.darkMode ? "#FFFFFF" : "#000000"],
168
+ },
169
+ },
170
+ grid: {
171
+ borderColor: borderColor,
172
+ show: (_c = _this.props.showGrid) !== null && _c !== void 0 ? _c : true,
173
+ },
174
+ xaxis: {
175
+ type: "datetime",
176
+ labels: {
177
+ datetimeUTC: false,
178
+ style: {
179
+ colors: _this.props.darkMode ? "#FFFFFF" : "#000000",
180
+ },
181
+ },
182
+ },
183
+ yaxis: {
184
+ show: true,
185
+ labels: {
186
+ style: {
187
+ colors: _this.props.darkMode ? "#FFFFFF" : "#000000",
188
+ },
189
+ },
190
+ },
191
+ tooltip: {
192
+ enabled: (_d = _this.props.showTooltip) !== null && _d !== void 0 ? _d : true,
193
+ custom: function (_a) {
194
+ var _b, _c, _d, _e;
195
+ var _series = _a.series, seriesIndex = _a.seriesIndex, dataPointIndex = _a.dataPointIndex, w = _a.w;
196
+ var taskName = w.globals.labels[dataPointIndex];
197
+ var seriesRangeStart = (_c = (_b = w.globals.seriesRangeStart) === null || _b === void 0 ? void 0 : _b[seriesIndex]) === null || _c === void 0 ? void 0 : _c[dataPointIndex];
198
+ var seriesRangeEnd = (_e = (_d = w.globals.seriesRangeEnd) === null || _d === void 0 ? void 0 : _d[seriesIndex]) === null || _e === void 0 ? void 0 : _e[dataPointIndex];
199
+ if (!seriesRangeStart || !seriesRangeEnd) {
200
+ return "\n <div class=\"bg-white p-3 shadow-lg rounded border text-sm\">\n <div class=\"font-semibold text-gray-900\">".concat(taskName, "</div>\n <div class=\"text-gray-600\">Data not available</div>\n </div>\n ");
201
+ }
202
+ var startTime = new Date(seriesRangeStart);
203
+ var endTime = new Date(seriesRangeEnd);
204
+ var duration = Math.ceil((endTime.getTime() - startTime.getTime()) /
205
+ (1000 * 3600 * 24));
206
+ return "\n <div class=\"bg-white p-3 shadow-lg rounded border text-sm\">\n <div class=\"font-semibold text-gray-900\">".concat(taskName, "</div>\n <div class=\"text-gray-600\">Start: ").concat(startTime.toLocaleDateString(), "</div>\n <div class=\"text-gray-600\">End: ").concat(endTime.toLocaleDateString(), "</div>\n <div class=\"text-gray-600\">Duration: ").concat(duration, " days</div>\n </div>\n ");
207
+ },
208
+ },
209
+ colors: _this.state.colors || [
210
+ "#008FFB",
211
+ "#00E396",
212
+ "#FEB019",
213
+ "#FF4560",
214
+ "#775DD0",
215
+ ],
216
+ fill: {
217
+ type: _this.props.enableGradient ? "gradient" : "solid",
218
+ },
219
+ }, series: series, type: "rangeBar", height: _this.props.chartSize ? _this.props.chartSize : "400" }))));
220
+ };
221
+ _this.renderDarkModeSettings = function () {
222
+ var _a, _b;
223
+ var bgColor = "bg-white";
224
+ if (_this.props.darkMode) {
225
+ bgColor = (_a = _this.props.darkModeBg) !== null && _a !== void 0 ? _a : "bg-gray-900";
226
+ }
227
+ var textColor = _this.props.darkMode ? "text-white" : "text-gray-700";
228
+ var borderColor = (_b = _this.props.borderColor) !== null && _b !== void 0 ? _b : "#e7e7e7";
229
+ return { bgColor: bgColor, textColor: textColor, borderColor: borderColor };
230
+ };
231
+ return _this;
232
+ }
233
+ GanttChart.prototype.render = function () {
234
+ var _a = this.renderDarkModeSettings(), bgColor = _a.bgColor, textColor = _a.textColor;
235
+ var defaultClass = "flex flex-col justify-center ".concat(bgColor, " overflow-hidden shadow rounded-lg pl-4 pb-3 w-full mb-6 ");
236
+ if (this.props.containerStyle)
237
+ defaultClass += this.props.containerStyle;
238
+ return !this.props.chartOnly ? (react_1.default.createElement("div", { className: defaultClass },
239
+ react_1.default.createElement("div", { className: "ml-2 pr-5 my-4 flex flex-row items-center" },
240
+ react_1.default.createElement("div", { className: "flex-1 " },
241
+ react_1.default.createElement("h3", { className: "text-lg truncate font-medium ".concat(textColor) }, this.props.title)),
242
+ this.props.tool),
243
+ react_1.default.createElement("div", { className: "mr-4 " }, this.renderChart()),
244
+ this.props.dateRangeVisible && (react_1.default.createElement(DateRange_1.DateRange, { className: "px-3", customDate: this.props.customDate, onChangeDate: this.props.onChangeDate, darkMode: this.props.darkMode })))) : (react_1.default.createElement("div", { className: this.props.containerStyle }, this.renderChart()));
245
+ };
246
+ return GanttChart;
247
+ }(react_1.Component));
248
+ exports.GanttChart = GanttChart;
249
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/chart/ganttChart/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8BAA4B;AAG5B,0CAAyC;AAqBzC;IAAgC,8BAAgB;IAAhD;;QACE,WAAK,GAAG;YACN,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,EAAE;SACX,CAAC;QAEF,uBAAiB,GAAG;;;;4BACK,sFAAa,kBAAkB,QAAC;;wBAAjD,cAAc,GAAG,SAAgC;wBAEnD,MAAM,GAAQ,SAAS,CAAC;wBACtB,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;wBACjC,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;wBAC5D,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;wBACtE,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;4BAAE,MAAM,GAAG,UAAU,CAAC;6BACxD,IAAI,YAAY;4BAAE,MAAM,GAAG,YAAY,CAAC;wBAE7C,IAAI,CAAC,QAAQ,CAAC;4BACZ,UAAU,EAAE,cAAc,CAAC,OAAO;4BAClC,MAA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AAO,MAAM,YAAY,mFAygOvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAQN,MAAM,OAAO,CAAC;AAqEf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAoB1B,eAAO,MAAM,YAAY,mFAkhOvB,CAAC"}
@@ -485,7 +485,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
485
485
  }, [selectedData, props.id]);
486
486
  //INFO : Change Data Type & ID Refresh
487
487
  (0, react_1.useEffect)(function () {
488
- var _a, _b, _c;
488
+ var _a, _b, _c, _d, _e;
489
489
  switch (props.type) {
490
490
  case "read":
491
491
  case "update":
@@ -497,13 +497,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
497
497
  setSelectedData({});
498
498
  setSelectedObjectData({});
499
499
  setSelectedIds([]);
500
- setActiveTab((_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "");
500
+ var newTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
501
+ setActiveTab(newTabId);
502
+ (_d = (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareUpdateTabId) === null || _d === void 0 ? void 0 : _d.call(_c, newTabId);
501
503
  if (props.id !== "new" && props.id !== "") {
502
504
  setModalVisible(true);
503
505
  setLoading(true);
504
506
  if ((previousType.current === "read" && props.type === "update") ||
505
507
  (previousType.current === "update" && props.type === "read")) {
506
- (_c = readQueryHocRef.current) === null || _c === void 0 ? void 0 : _c.handleRefresh();
508
+ (_e = readQueryHocRef.current) === null || _e === void 0 ? void 0 : _e.handleRefresh();
507
509
  }
508
510
  }
509
511
  if (props.id === "new") {
@@ -4137,17 +4139,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4137
4139
  hasTabAlign_1 ? (react_1.default.createElement("div", { className: "w-full ".concat(leftTabAlign
4138
4140
  ? "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5"
4139
4141
  : "") },
4140
- react_1.default.createElement("div", { className: "w-full" }, leftTabAlign && uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) { return setActiveTab(tabId); } }))),
4142
+ react_1.default.createElement("div", { className: "w-full" }, leftTabAlign && uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) {
4143
+ var _a, _b;
4144
+ setActiveTab(tabId);
4145
+ (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateTabId) === null || _b === void 0 ? void 0 : _b.call(_a, tabId);
4146
+ } }))),
4141
4147
  react_1.default.createElement("div", { className: "w-full ".concat(leftTabAlign ? " md:col-span-2 lg:col-span-3" : "") },
4142
- topTabAlign && uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) { return setActiveTab(tabId); }, horizontal: true })),
4148
+ topTabAlign && uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) {
4149
+ var _a, _b;
4150
+ setActiveTab(tabId);
4151
+ (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateTabId) === null || _b === void 0 ? void 0 : _b.call(_a, tabId);
4152
+ }, horizontal: true })),
4143
4153
  react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: modalFormInputRefs, handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: function (refList) {
4144
4154
  var _a, _b, _c;
4145
4155
  if ((refList === null || refList === void 0 ? void 0 : refList.length) > 0) {
4146
- var firstRef = refList[0];
4147
- var foundId_1 = (_b = (_a = firstRef === null || firstRef === void 0 ? void 0 : firstRef.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.id;
4156
+ var foundId_1 = refList[0];
4148
4157
  if (foundId_1) {
4149
4158
  var foundModel = filterModel_1.find(function (eachModel) { return eachModel.id === foundId_1; });
4150
- setActiveTab((_c = foundModel === null || foundModel === void 0 ? void 0 : foundModel.tabId) !== null && _c !== void 0 ? _c : "");
4159
+ var newTabId = (_a = foundModel === null || foundModel === void 0 ? void 0 : foundModel.tabId) !== null && _a !== void 0 ? _a : "";
4160
+ setActiveTab(newTabId);
4161
+ (_c = (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareUpdateTabId) === null || _c === void 0 ? void 0 : _c.call(_b, newTabId);
4151
4162
  }
4152
4163
  }
4153
4164
  } },