blixify-ui-web 1.2.78 → 1.2.80

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":"AAkCA,OAAO,KASN,MAAM,OAAO,CAAC;AAwFf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAwD1B,eAAO,MAAM,YAAY,mFA0nYvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAkCA,OAAO,KASN,MAAM,OAAO,CAAC;AAwFf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAwD1B,eAAO,MAAM,YAAY,mFA4oYvB,CAAC"}
@@ -6608,14 +6608,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6608
6608
  // inside a modal reads better with a plain button row than a card inside a
6609
6609
  // card; tabbed and long forms keep the sticky bar so Submit stays reachable
6610
6610
  var handleActionBarClassName = function (justifyEnd) {
6611
- var _a, _b, _c, _d, _e;
6611
+ var _a, _b, _c, _d, _e, _f, _g;
6612
6612
  var layout = "mt-6 flex flex-row items-center gap-2 whitespace-nowrap".concat(justifyEnd ? " justify-end" : "");
6613
6613
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom)
6614
6614
  return "".concat(layout).concat(((_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkMode) ? " text-white" : "");
6615
6615
  var surface = ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode)
6616
6616
  ? "border-gray-700 ".concat((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkModeBg) !== null && _e !== void 0 ? _e : "bg-gray-900/95", " text-white")
6617
6617
  : "border-gray-200 bg-white/95";
6618
- return "sticky bottom-3 z-20 -mx-2 ".concat(layout, " rounded-2xl border ").concat(surface, " px-3 py-2 shadow-lg backdrop-blur sm:mx-0 sm:px-4");
6618
+ // INFO: bareUpdateActionFloatingOffset replaces the default bottom-3 offset when
6619
+ // provided, so a consumer whose layout has something pinned to the bottom (a mobile
6620
+ // nav, a floating search bar) can lift the pill clear of it. Any Tailwind bottom-*
6621
+ // utility works, e.g. "bottom-24".
6622
+ var offset = (_g = (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareUpdateFloatingActionOffset) !== null && _g !== void 0 ? _g : "bottom-3";
6623
+ return "sticky ".concat(offset, " z-20 -mx-2 ").concat(layout, " rounded-2xl border ").concat(surface, " px-3 py-2 shadow-lg backdrop-blur sm:mx-0 sm:px-4");
6619
6624
  };
6620
6625
  var renderStepBar = function (uniqueTabIds) {
6621
6626
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -7885,6 +7890,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7885
7890
  }
7886
7891
  (_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));
7887
7892
  };
7893
+ // INFO: reported through the same onAddColumns callback as adding one — the
7894
+ // consumer receives the whole model either way, so the schema has one
7895
+ // destination rather than a second place to be written.
7896
+ var handleDeletePlainColumn = function (columnId) {
7897
+ var _a, _b;
7898
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onAddColumns) === null || _b === void 0 ? void 0 : _b.call(_a, structure.filter(function (eachColumn) { return eachColumn.id !== columnId; }));
7899
+ };
7888
7900
  var renderAddMathColumn = function (id, onClose) {
7889
7901
  var _a, _b, _c;
7890
7902
  return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
@@ -7935,7 +7947,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7935
7947
  return groups;
7936
7948
  };
7937
7949
  var renderGroupTable = function (multipleSelect) {
7938
- 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, _30, _31, _32, _33, _34;
7950
+ 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, _30, _31, _32, _33, _34, _35;
7939
7951
  if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
7940
7952
  var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
7941
7953
  var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
@@ -8127,20 +8139,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8127
8139
  onAddColumn: ((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareAddColumns)
8128
8140
  ? handleAddPlainColumn
8129
8141
  : undefined,
8130
- renderAddColumnElements: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
8142
+ onDeleteColumn: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
8143
+ ? handleDeletePlainColumn
8144
+ : undefined,
8145
+ renderAddColumnElements: ((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareAddColumns)
8131
8146
  ? undefined
8132
8147
  : renderAddMathColumn,
8133
8148
  // INFO: the popup's reference pickers read from the same providers
8134
8149
  // the schema editor uses — without them a reference column would be
8135
8150
  // created with no target and resolve nothing
8136
- renderReferenceSpaceOptions: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.renderReferenceSpaceOptions,
8137
- renderReferenceLabelOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceLabelOptions,
8151
+ renderReferenceSpaceOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceSpaceOptions,
8152
+ renderReferenceLabelOptions: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceLabelOptions,
8138
8153
  dragEnabled: isViewSettingsEnabled,
8139
8154
  sortEnabled: isViewSettingsEnabled,
8140
8155
  // INFO: per-column header filter is replaced by the flex filters
8141
8156
  filterEnabled: false,
8142
8157
  sortId: activeSortId,
8143
- 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
8158
+ sortOptions: (_5 = (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.renderReferenceLabelOptions) === null || _4 === void 0 ? void 0 : _4.call(_3)) !== null && _5 !== void 0 ? _5 : (isViewSettingsEnabled
8144
8159
  ? getViewSettingsColumns().map(function (eachColumn) {
8145
8160
  var _a;
8146
8161
  return ({
@@ -8172,7 +8187,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8172
8187
  return renderSearchContent(newQuery);
8173
8188
  },
8174
8189
  }, editable: {
8175
- active: ((_5 = props.edit) === null || _5 === void 0 ? void 0 : _5.listEditable) && !props.edit.disabledUpdate
8190
+ active: ((_6 = props.edit) === null || _6 === void 0 ? void 0 : _6.listEditable) && !props.edit.disabledUpdate
8176
8191
  ? true
8177
8192
  : false,
8178
8193
  onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
@@ -8186,7 +8201,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8186
8201
  });
8187
8202
  }); },
8188
8203
  }, onObjectEdit: handleObjectCellEdit, addable: {
8189
- active: ((_6 = props.edit) === null || _6 === void 0 ? void 0 : _6.listAddable) ? true : false,
8204
+ active: ((_7 = props.edit) === null || _7 === void 0 ? void 0 : _7.listAddable) ? true : false,
8190
8205
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
8191
8206
  return __generator(this, function (_a) {
8192
8207
  switch (_a.label) {
@@ -8197,27 +8212,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8197
8212
  }
8198
8213
  });
8199
8214
  }); },
8200
- }, darkMode: (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.darkMode, hidePagination: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.disableEllipsisOnLongWord, pinColumns: (_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareListTablePinColumns }));
8215
+ }, darkMode: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.darkMode, hidePagination: (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.disableEllipsisOnLongWord, pinColumns: (_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListTablePinColumns }));
8201
8216
  }
8202
- 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: (_12 = (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.disableSelectFullData) === null || _12 === void 0 ? void 0 : _12.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8217
+ 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: (_13 = (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.disableSelectFullData) === null || _13 === void 0 ? void 0 : _13.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8203
8218
  selectedIds.length > 0 &&
8204
- !((_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.disabledUpdate) &&
8205
- !((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
8219
+ !((_14 = props.edit) === null || _14 === void 0 ? void 0 : _14.disabledUpdate) &&
8220
+ !((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
8206
8221
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
8207
8222
  handleBatchDraftData();
8208
8223
  } }),
8209
8224
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
8210
8225
  handleCloneSelectedData();
8211
8226
  } }))),
8212
- ((_15 = props.edit) === null || _15 === void 0 ? void 0 : _15.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8227
+ ((_16 = props.edit) === null || _16 === void 0 ? void 0 : _16.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8213
8228
  handleGenerateDeletePasscode();
8214
8229
  setDeleteModal(true);
8215
8230
  } })),
8216
- !isFirebase && !((_16 = props.edit) === null || _16 === void 0 ? void 0 : _16.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8231
+ !isFirebase && !((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8217
8232
  setBatchUpdateModal(true);
8218
8233
  } })),
8219
- ((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareListMultipleSelectAddtionalActions) &&
8220
- ((_19 = (_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareListMultipleSelectAddtionalActions) === null || _19 === void 0 ? void 0 : _19.map(function (eachButton) {
8234
+ ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareListMultipleSelectAddtionalActions) &&
8235
+ ((_20 = (_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareListMultipleSelectAddtionalActions) === null || _20 === void 0 ? void 0 : _20.map(function (eachButton) {
8221
8236
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
8222
8237
  var _a, _b;
8223
8238
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -8225,17 +8240,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8225
8240
  }))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
8226
8241
  var _a, _b;
8227
8242
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8228
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_21 = (_20 = props.newTabUrl) === null || _20 === void 0 ? void 0 : _20.default) !== null && _21 !== void 0 ? _21 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_23 = (_22 = props.newTabUrl) === null || _22 === void 0 ? void 0 : _22.addons) !== null && _23 !== void 0 ? _23 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8243
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_22 = (_21 = props.newTabUrl) === null || _21 === void 0 ? void 0 : _21.default) !== null && _22 !== void 0 ? _22 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_24 = (_23 = props.newTabUrl) === null || _23 === void 0 ? void 0 : _23.addons) !== null && _24 !== void 0 ? _24 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8229
8244
  handlePagination(value);
8230
- }, className: "mt-5", lib: { axios: (_24 = props.lib) === null || _24 === void 0 ? void 0 : _24.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.fixedPagination, advSettings: {
8231
- addColumnEnabled: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.addColumnEnabled,
8245
+ }, className: "mt-5", lib: { axios: (_25 = props.lib) === null || _25 === void 0 ? void 0 : _25.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.fixedPagination, advSettings: {
8246
+ addColumnEnabled: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.addColumnEnabled,
8232
8247
  renderAddColumnElements: renderAddMathColumn,
8233
8248
  dragEnabled: isViewSettingsEnabled,
8234
8249
  sortEnabled: isViewSettingsEnabled,
8235
8250
  // INFO: per-column header filter is replaced by the flex filters
8236
8251
  filterEnabled: false,
8237
8252
  sortId: activeSortId,
8238
- sortOptions: (_29 = (_28 = (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.renderReferenceLabelOptions) === null || _28 === void 0 ? void 0 : _28.call(_27)) !== null && _29 !== void 0 ? _29 : (isViewSettingsEnabled
8253
+ sortOptions: (_30 = (_29 = (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.renderReferenceLabelOptions) === null || _29 === void 0 ? void 0 : _29.call(_28)) !== null && _30 !== void 0 ? _30 : (isViewSettingsEnabled
8239
8254
  ? getViewSettingsColumns().map(function (eachColumn) {
8240
8255
  var _a;
8241
8256
  return ({
@@ -8264,7 +8279,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8264
8279
  return renderSearchContent(newQuery);
8265
8280
  },
8266
8281
  }, editable: {
8267
- active: ((_30 = props.edit) === null || _30 === void 0 ? void 0 : _30.listEditable) && !props.edit.disabledUpdate
8282
+ active: ((_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.listEditable) && !props.edit.disabledUpdate
8268
8283
  ? true
8269
8284
  : false,
8270
8285
  onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
@@ -8278,7 +8293,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8278
8293
  });
8279
8294
  }); },
8280
8295
  }, onObjectEdit: handleObjectCellEdit, addable: {
8281
- active: ((_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.listAddable) ? true : false,
8296
+ active: ((_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.listAddable) ? true : false,
8282
8297
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
8283
8298
  return __generator(this, function (_a) {
8284
8299
  switch (_a.label) {
@@ -8289,7 +8304,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8289
8304
  }
8290
8305
  });
8291
8306
  }); },
8292
- }, darkMode: (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.darkMode, hidePagination: (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.disableEllipsisOnLongWord }));
8307
+ }, darkMode: (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.darkMode, hidePagination: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.disableEllipsisOnLongWord }));
8293
8308
  }
8294
8309
  };
8295
8310
  var renderTabContent = function (tabs, dataType, viewType) {