dattatable 1.5.0 → 1.5.4

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.
Files changed (34) hide show
  1. package/build/common/installRequired.js +2 -0
  2. package/build/documents.d.ts +3 -2
  3. package/build/documents.js +15 -11
  4. package/dist/dattatable.js +657 -657
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/CanvasForm.html +1 -1
  8. package/docs/classes/Dashboard.html +2 -2
  9. package/docs/classes/DataTable.html +2 -2
  10. package/docs/classes/Documents.html +5 -5
  11. package/docs/classes/FilterSlideout.html +1 -1
  12. package/docs/classes/Footer.html +1 -1
  13. package/docs/classes/Header.html +1 -1
  14. package/docs/classes/InstallationRequired.html +1 -1
  15. package/docs/classes/ItemForm.html +3 -3
  16. package/docs/classes/LoadingDialog.html +1 -1
  17. package/docs/classes/Modal.html +1 -1
  18. package/docs/classes/Navigation.html +1 -1
  19. package/docs/enums/ActionButtonTypes.html +1 -1
  20. package/docs/interfaces/IDashboardProps.html +1 -1
  21. package/docs/interfaces/IDataTable.html +1 -1
  22. package/docs/interfaces/IDataTableProps.html +1 -1
  23. package/docs/interfaces/IDocumentsProps.html +1 -1
  24. package/docs/interfaces/IFilterItem.html +1 -1
  25. package/docs/interfaces/IFilterProps.html +1 -1
  26. package/docs/interfaces/IFooterProps.html +1 -1
  27. package/docs/interfaces/IHeaderProps.html +1 -1
  28. package/docs/interfaces/IItemFormCreateProps.html +1 -1
  29. package/docs/interfaces/IItemFormEditProps.html +1 -1
  30. package/docs/interfaces/IItemFormViewProps.html +1 -1
  31. package/docs/interfaces/IShowDialogProps.html +1 -1
  32. package/docs/modules.html +1 -1
  33. package/package.json +2 -2
  34. package/pnpm-lock.yaml +26 -26
@@ -81,6 +81,8 @@ var InstallationRequired = /** @class */ (function () {
81
81
  InstallationRequired.showDialog = function (props) {
82
82
  var _this = this;
83
83
  if (props === void 0) { props = {}; }
84
+ // Clear the modal
85
+ modal_1.Modal.clear();
84
86
  // Set the header
85
87
  modal_1.Modal.setHeader("Installation Required");
86
88
  // Set the body
@@ -21,6 +21,7 @@ export interface IDocumentsProps {
21
21
  enableSearch?: boolean;
22
22
  listName: string;
23
23
  query?: Types.IODataQuery;
24
+ onActionsRendered?: (el: HTMLElement, col: Components.ITableColumn, file: Types.SP.Attachment | Types.SP.File) => void;
24
25
  onFilterRendered?: (el: HTMLElement) => void;
25
26
  onItemFormEditing?: {
26
27
  onCreateEditForm?: (props: Components.IListFormEditProps) => Components.IListFormEditProps;
@@ -44,8 +45,8 @@ export interface IDocumentsProps {
44
45
  onNavigationRendering?: (props: Components.INavbarProps) => void;
45
46
  onNavigationRendered?: (nav: Components.INavbar) => void;
46
47
  onRefresh?: () => void;
47
- onRendered?: () => void;
48
- onSearchRendered?: (el: HTMLElement) => void;
48
+ onRendered?: (el?: HTMLElement) => void;
49
+ onSearchRendered?: (el?: HTMLElement) => void;
49
50
  onShowFilter?: Function;
50
51
  table?: {
51
52
  columns?: Components.ITableColumn[];
@@ -206,7 +206,7 @@ var Documents = /** @class */ (function () {
206
206
  // Get the file contents
207
207
  (0, gd_sprest_bs_1.Web)().getFileByServerRelativeUrl(file.ServerRelativeUrl).content().execute(function (data) {
208
208
  // Copy the file
209
- (0, gd_sprest_bs_1.List)(_this._props.listName).RootFolder().Files().add(file.Name, true, data).execute(resolve, resolve);
209
+ (0, gd_sprest_bs_1.Web)().getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(file.Name, true, data).execute(resolve, resolve);
210
210
  });
211
211
  });
212
212
  }).then(function () {
@@ -221,7 +221,7 @@ var Documents = /** @class */ (function () {
221
221
  var file_1 = item.data;
222
222
  file_1.content().execute(function (data) {
223
223
  // Copy the file
224
- (0, gd_sprest_bs_1.List)(_this._props.listName).RootFolder().Files().add(file_1.Name, true, data).execute(function () {
224
+ (0, gd_sprest_bs_1.Web)().getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(file_1.Name, true, data).execute(function () {
225
225
  // Close the dialog
226
226
  loadingDialog_1.LoadingDialog.hide();
227
227
  // Refresh the page
@@ -393,8 +393,8 @@ var Documents = /** @class */ (function () {
393
393
  // Render the file
394
394
  _this.renderFileIcon(el, _this.getFileName(file));
395
395
  // Set the filter/sort value
396
- el.setAttribute("data-filter", _this.getFileName(file));
397
- el.setAttribute("data-sort", _this.getFileName(file));
396
+ el.setAttribute("data-filter", (0, methods_1.getFileExt)(_this.getFileName(file)));
397
+ el.setAttribute("data-sort", (0, methods_1.getFileExt)(_this.getFileName(file)));
398
398
  // Call the custom event
399
399
  customEvent ? customEvent(el, col, file) : null;
400
400
  };
@@ -443,6 +443,7 @@ var Documents = /** @class */ (function () {
443
443
  _this.renderActionButtons(el, file);
444
444
  // Call the custom event
445
445
  customEvent ? customEvent(el, col, file) : null;
446
+ _this._props.onActionsRendered ? _this._props.onActionsRendered(el, col, file) : null;
446
447
  };
447
448
  }
448
449
  else {
@@ -559,7 +560,7 @@ var Documents = /** @class */ (function () {
559
560
  // Render the table
560
561
  _this.renderTable();
561
562
  // Call the render event
562
- _this._props.onRendered ? _this._props.onRendered() : null;
563
+ _this._props.onRendered ? _this._props.onRendered(_this._el) : null;
563
564
  // Resolve the promise
564
565
  resolve();
565
566
  }, reject);
@@ -598,7 +599,7 @@ var Documents = /** @class */ (function () {
598
599
  content: "Delete",
599
600
  btnProps: {
600
601
  // Render the icon button
601
- className: "p-1",
602
+ className: "p-1 btn-actions-delete",
602
603
  iconType: x_1.x,
603
604
  iconSize: 24,
604
605
  isDisabled: !this.CanDelete,
@@ -634,7 +635,7 @@ var Documents = /** @class */ (function () {
634
635
  content: "Download",
635
636
  btnProps: {
636
637
  // Render the icon button
637
- className: "p-1",
638
+ className: "p-1 btn-actions-download",
638
639
  iconType: fileEarmarkArrowDown_1.fileEarmarkArrowDown,
639
640
  iconSize: 24,
640
641
  isDisabled: !this.CanView,
@@ -651,7 +652,7 @@ var Documents = /** @class */ (function () {
651
652
  content: "Edit",
652
653
  btnProps: {
653
654
  // Render the icon button
654
- className: "p-1",
655
+ className: "p-1 btn-actions-edit",
655
656
  iconType: inputCursorText_1.inputCursorText,
656
657
  iconSize: 24,
657
658
  isDisabled: (!isWopi || !this.CanEdit),
@@ -669,7 +670,7 @@ var Documents = /** @class */ (function () {
669
670
  content: "Properties",
670
671
  btnProps: {
671
672
  // Render the icon button
672
- className: "p-1",
673
+ className: "p-1 btn-actions-properties",
673
674
  iconType: layoutTextSidebar_1.layoutTextSidebar,
674
675
  iconSize: 24,
675
676
  isDisabled: !this.CanEdit && !this.CanView,
@@ -762,7 +763,7 @@ var Documents = /** @class */ (function () {
762
763
  content: "View",
763
764
  btnProps: {
764
765
  // Render the icon button
765
- className: "img-flip-x p-1",
766
+ className: "img-flip-x p-1 btn-actions-view",
766
767
  iconType: front_1.front,
767
768
  iconSize: 24,
768
769
  isDisabled: !this.CanView,
@@ -803,6 +804,7 @@ var Documents = /** @class */ (function () {
803
804
  span.title = "Binary File";
804
805
  break;
805
806
  // Code
807
+ case "app":
806
808
  case "asp":
807
809
  case "aspx":
808
810
  case "css":
@@ -814,6 +816,8 @@ var Documents = /** @class */ (function () {
814
816
  case "mht":
815
817
  case "mhtml":
816
818
  case "scss":
819
+ case "sppkg":
820
+ case "wsp":
817
821
  case "xml":
818
822
  case "yaml":
819
823
  span.appendChild((0, fileEarmarkCode_1.fileEarmarkCode)(size));
@@ -1090,7 +1094,7 @@ var Documents = /** @class */ (function () {
1090
1094
  }
1091
1095
  else {
1092
1096
  // Upload the file to the objective folder
1093
- list.RootFolder().Files().add(fileInfo.name, true, fileInfo.data).execute(resolve, reject);
1097
+ (0, gd_sprest_bs_1.Web)().getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(fileInfo.name, true, fileInfo.data).execute(resolve, reject);
1094
1098
  }
1095
1099
  });
1096
1100
  };