blixify-ui-web 1.2.158 → 1.2.160

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AAgGf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AA8G1B,eAAO,MAAM,YAAY,mFAw5bvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AAgGf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AA8G1B,eAAO,MAAM,YAAY,mFAo7bvB,CAAC"}
@@ -8668,6 +8668,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8668
8668
  }
8669
8669
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onAddColumns) === null || _b === void 0 ? void 0 : _b.call(_a, __spreadArray(__spreadArray([], structure, true), [newColumn], false));
8670
8670
  };
8671
+ // INFO: a changed column replaces itself in place, under the same id, and
8672
+ // goes out through onAddColumns like adding and removing do. A column now
8673
+ // holding files is filed against this table, as a new one is.
8674
+ var handleEditPlainColumn = function (column) {
8675
+ var _a, _b, _c, _d;
8676
+ var edited = __assign({}, column);
8677
+ if (["image", "file", "multipleImage", "multipleFile"].includes(column.type)) {
8678
+ edited.imageCollectionName =
8679
+ (_a = edited.imageCollectionName) !== null && _a !== void 0 ? _a : props.collectionId;
8680
+ edited.imageFileName = (_b = edited.imageFileName) !== null && _b !== void 0 ? _b : "".concat(column.id, ".png");
8681
+ if (devSettings.uploadEndpoint && !edited.uploadEndpoint)
8682
+ edited.uploadEndpoint = devSettings.uploadEndpoint;
8683
+ }
8684
+ (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns) === null || _d === void 0 ? void 0 : _d.call(_c, structure.map(function (eachColumn) {
8685
+ return eachColumn.id === column.id ? edited : eachColumn;
8686
+ }));
8687
+ };
8671
8688
  // INFO: reported through the same onAddColumns callback as adding one — the
8672
8689
  // consumer receives the whole model either way, so the schema has one
8673
8690
  // destination rather than a second place to be written.
@@ -8761,7 +8778,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8761
8778
  return groups;
8762
8779
  };
8763
8780
  var renderGroupTable = function (multipleSelect) {
8764
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
8781
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29;
8765
8782
  if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
8766
8783
  var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
8767
8784
  var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
@@ -8961,20 +8978,28 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8961
8978
  onDeleteColumn: ((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareAddColumns)
8962
8979
  ? handleDeletePlainColumn
8963
8980
  : undefined,
8964
- renderAddColumnElements: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareAddColumns)
8981
+ onEditColumn: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareAddColumns)
8982
+ ? handleEditPlainColumn
8983
+ : undefined,
8984
+ getColumnSchema: ((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareAddColumns)
8985
+ ? function (columnId) {
8986
+ return structure.find(function (eachColumn) { return eachColumn.id === columnId; });
8987
+ }
8988
+ : undefined,
8989
+ renderAddColumnElements: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
8965
8990
  ? undefined
8966
8991
  : renderAddMathColumn,
8967
8992
  // INFO: the popup's reference pickers read from the same providers
8968
8993
  // the schema editor uses — without them a reference column would be
8969
8994
  // created with no target and resolve nothing
8970
- renderReferenceSpaceOptions: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.renderReferenceSpaceOptions,
8971
- renderReferenceLabelOptions: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.renderReferenceLabelOptions,
8995
+ renderReferenceSpaceOptions: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.renderReferenceSpaceOptions,
8996
+ renderReferenceLabelOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceLabelOptions,
8972
8997
  dragEnabled: isViewSettingsEnabled,
8973
8998
  sortEnabled: isViewSettingsEnabled,
8974
8999
  // INFO: per-column header filter is replaced by the flex filters
8975
9000
  filterEnabled: false,
8976
9001
  sortId: activeSortId,
8977
- sortOptions: (_2 = (_1 = (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.renderReferenceLabelOptions) === null || _1 === void 0 ? void 0 : _1.call(_0)) !== null && _2 !== void 0 ? _2 : (isViewSettingsEnabled
9002
+ sortOptions: (_4 = (_3 = (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceLabelOptions) === null || _3 === void 0 ? void 0 : _3.call(_2)) !== null && _4 !== void 0 ? _4 : (isViewSettingsEnabled
8978
9003
  ? getViewSettingsColumns().map(function (eachColumn) {
8979
9004
  var _a;
8980
9005
  return ({
@@ -9021,7 +9046,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9021
9046
  });
9022
9047
  }); },
9023
9048
  }, onObjectEdit: handleObjectCellEdit, addable: {
9024
- active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
9049
+ active: ((_5 = props.edit) === null || _5 === void 0 ? void 0 : _5.listAddable) ? true : false,
9025
9050
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
9026
9051
  return __generator(this, function (_a) {
9027
9052
  switch (_a.label) {
@@ -9032,12 +9057,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9032
9057
  }
9033
9058
  });
9034
9059
  }); },
9035
- }, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode, hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
9060
+ }, darkMode: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.darkMode, hidePagination: (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableEllipsisOnLongWord, pinColumns: (_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareListTablePinColumns }));
9036
9061
  }
9037
- return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9062
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.disableSelectFullData) === null || _11 === void 0 ? void 0 : _11.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9038
9063
  selectedIds.length > 0 &&
9039
9064
  canBatchUpdate &&
9040
- !((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
9065
+ !((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
9041
9066
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
9042
9067
  handleBatchDraftData();
9043
9068
  } }),
@@ -9051,8 +9076,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9051
9076
  !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
9052
9077
  setBatchUpdateModal(true);
9053
9078
  } })),
9054
- ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListMultipleSelectAddtionalActions) &&
9055
- ((_13 = (_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareListMultipleSelectAddtionalActions) === null || _13 === void 0 ? void 0 : _13.map(function (eachButton) {
9079
+ ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareListMultipleSelectAddtionalActions) &&
9080
+ ((_15 = (_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareListMultipleSelectAddtionalActions) === null || _15 === void 0 ? void 0 : _15.map(function (eachButton) {
9056
9081
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
9057
9082
  var _a, _b;
9058
9083
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -9061,17 +9086,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9061
9086
  var _a, _b;
9062
9087
  handleCaptureListScroll(id);
9063
9088
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9064
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_15 = (_14 = props.newTabUrl) === null || _14 === void 0 ? void 0 : _14.default) !== null && _15 !== void 0 ? _15 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.addons) !== null && _17 !== void 0 ? _17 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
9089
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.default) !== null && _17 !== void 0 ? _17 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_19 = (_18 = props.newTabUrl) === null || _18 === void 0 ? void 0 : _18.addons) !== null && _19 !== void 0 ? _19 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
9065
9090
  handlePagination(value);
9066
- }, className: "mt-5", lib: { axios: (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.fixedPagination, advSettings: {
9067
- addColumnEnabled: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.addColumnEnabled,
9091
+ }, className: "mt-5", lib: { axios: (_20 = props.lib) === null || _20 === void 0 ? void 0 : _20.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.fixedPagination, advSettings: {
9092
+ addColumnEnabled: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.addColumnEnabled,
9068
9093
  renderAddColumnElements: renderAddMathColumn,
9069
9094
  dragEnabled: isViewSettingsEnabled,
9070
9095
  sortEnabled: isViewSettingsEnabled,
9071
9096
  // INFO: per-column header filter is replaced by the flex filters
9072
9097
  filterEnabled: false,
9073
9098
  sortId: activeSortId,
9074
- sortOptions: (_23 = (_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.renderReferenceLabelOptions) === null || _22 === void 0 ? void 0 : _22.call(_21)) !== null && _23 !== void 0 ? _23 : (isViewSettingsEnabled
9099
+ sortOptions: (_25 = (_24 = (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.renderReferenceLabelOptions) === null || _24 === void 0 ? void 0 : _24.call(_23)) !== null && _25 !== void 0 ? _25 : (isViewSettingsEnabled
9075
9100
  ? getViewSettingsColumns().map(function (eachColumn) {
9076
9101
  var _a;
9077
9102
  return ({
@@ -9115,7 +9140,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9115
9140
  });
9116
9141
  }); },
9117
9142
  }, onObjectEdit: handleObjectCellEdit, addable: {
9118
- active: ((_24 = props.edit) === null || _24 === void 0 ? void 0 : _24.listAddable) ? true : false,
9143
+ active: ((_26 = props.edit) === null || _26 === void 0 ? void 0 : _26.listAddable) ? true : false,
9119
9144
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
9120
9145
  return __generator(this, function (_a) {
9121
9146
  switch (_a.label) {
@@ -9126,7 +9151,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9126
9151
  }
9127
9152
  });
9128
9153
  }); },
9129
- }, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.disableEllipsisOnLongWord }));
9154
+ }, darkMode: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.darkMode, hidePagination: (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.disableEllipsisOnLongWord }));
9130
9155
  }
9131
9156
  };
9132
9157
  // INFO: `hidden` keeps the markers out of space-y spacing