dattatable 1.4.9 → 1.5.3

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 (35) hide show
  1. package/build/common/installRequired.js +2 -0
  2. package/build/dashboard/index.js +33 -37
  3. package/build/documents.d.ts +3 -2
  4. package/build/documents.js +12 -8
  5. package/dist/dattatable.js +657 -657
  6. package/dist/dattatable.min.js +1 -1
  7. package/docs/assets/search.js +1 -1
  8. package/docs/classes/CanvasForm.html +1 -1
  9. package/docs/classes/Dashboard.html +2 -2
  10. package/docs/classes/DataTable.html +2 -2
  11. package/docs/classes/Documents.html +5 -5
  12. package/docs/classes/FilterSlideout.html +1 -1
  13. package/docs/classes/Footer.html +1 -1
  14. package/docs/classes/Header.html +1 -1
  15. package/docs/classes/InstallationRequired.html +1 -1
  16. package/docs/classes/ItemForm.html +3 -3
  17. package/docs/classes/LoadingDialog.html +1 -1
  18. package/docs/classes/Modal.html +1 -1
  19. package/docs/classes/Navigation.html +1 -1
  20. package/docs/enums/ActionButtonTypes.html +1 -1
  21. package/docs/interfaces/IDashboardProps.html +1 -1
  22. package/docs/interfaces/IDataTable.html +1 -1
  23. package/docs/interfaces/IDataTableProps.html +1 -1
  24. package/docs/interfaces/IDocumentsProps.html +1 -1
  25. package/docs/interfaces/IFilterItem.html +1 -1
  26. package/docs/interfaces/IFilterProps.html +1 -1
  27. package/docs/interfaces/IFooterProps.html +1 -1
  28. package/docs/interfaces/IHeaderProps.html +1 -1
  29. package/docs/interfaces/IItemFormCreateProps.html +1 -1
  30. package/docs/interfaces/IItemFormEditProps.html +1 -1
  31. package/docs/interfaces/IItemFormViewProps.html +1 -1
  32. package/docs/interfaces/IShowDialogProps.html +1 -1
  33. package/docs/modules.html +1 -1
  34. package/package.json +2 -2
  35. package/pnpm-lock.yaml +23 -23
@@ -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
@@ -58,16 +58,14 @@ var Dashboard = /** @class */ (function () {
58
58
  this._props.el.appendChild(elTemplate);
59
59
  // Set/Default the visibility flags
60
60
  var headerIsVisible = this._props.hideHeader != null && !this._props.hideHeader;
61
- var navIsVisible = false;
62
- var subNavIsVisible = false;
61
+ var navIsVisible = this._props.hideNavigation ? false : true;
62
+ var subNavIsVisible = (this._props.hideSubNavigation == null || this._props.hideSubNavigation == true) && this._props.subNavigation == null ? false : true;
63
63
  // See if we are hiding the navigation
64
- if (this._props.hideNavigation) {
64
+ if (!navIsVisible) {
65
65
  // Hide the element
66
66
  this._props.el.querySelector("#navigation").classList.add("d-none");
67
67
  }
68
68
  else {
69
- // Set the flag
70
- navIsVisible = true;
71
69
  // Render the navigation
72
70
  var navProps_1 = this._props.navigation || {};
73
71
  new navigation_1.Navigation({
@@ -100,14 +98,41 @@ var Dashboard = /** @class */ (function () {
100
98
  },
101
99
  });
102
100
  }
101
+ // See if we are hiding the header
102
+ if (!headerIsVisible) {
103
+ // Hide the element
104
+ this._props.el.querySelector("#header").classList.add("d-none");
105
+ }
106
+ else {
107
+ var elHeader = this._props.el.querySelector("#header");
108
+ // Render the header
109
+ var header = this._props.header || {};
110
+ new header_1.Header({
111
+ el: elHeader,
112
+ onRendering: this._props.header ? this._props.header.onRendering : null,
113
+ onRendered: this._props.header ? this._props.header.onRendered : null,
114
+ title: header.title
115
+ });
116
+ // See if the sub-nav is not visible
117
+ if (!navIsVisible && !subNavIsVisible) {
118
+ // Set the class name
119
+ elHeader.classList.add("rounded");
120
+ }
121
+ else if (navIsVisible && !subNavIsVisible) {
122
+ // Set the class name
123
+ elHeader.classList.add("rounded-bottom");
124
+ }
125
+ else if (!navIsVisible && subNavIsVisible) {
126
+ // Set the class name
127
+ elHeader.classList.add("rounded-top");
128
+ }
129
+ }
103
130
  // See if we are hiding the sub-navigation
104
- if ((this._props.hideSubNavigation == null || this._props.hideSubNavigation == true) && this._props.subNavigation == null) {
131
+ if (!subNavIsVisible) {
105
132
  // Hide the element
106
133
  this._props.el.querySelector("#sub-navigation").classList.add("d-none");
107
134
  }
108
135
  else {
109
- // Set the flag
110
- subNavIsVisible = true;
111
136
  // Render the navigation
112
137
  var navProps_2 = this._props.subNavigation || {};
113
138
  new navigation_1.Navigation({
@@ -138,35 +163,6 @@ var Dashboard = /** @class */ (function () {
138
163
  },
139
164
  });
140
165
  }
141
- // See if we are hiding the header
142
- if (!headerIsVisible) {
143
- // Hide the element
144
- this._props.el.querySelector("#header").classList.add("d-none");
145
- }
146
- else {
147
- var elHeader = this._props.el.querySelector("#header");
148
- // Render the header
149
- var header = this._props.header || {};
150
- new header_1.Header({
151
- el: elHeader,
152
- onRendering: this._props.header ? this._props.header.onRendering : null,
153
- onRendered: this._props.header ? this._props.header.onRendered : null,
154
- title: header.title
155
- });
156
- // See if the sub-nav is not visible
157
- if (!navIsVisible && !subNavIsVisible) {
158
- // Set the class name
159
- elHeader.classList.add("rounded");
160
- }
161
- else if (navIsVisible && !subNavIsVisible) {
162
- // Set the class name
163
- elHeader.classList.add("rounded-bottom");
164
- }
165
- else if (!navIsVisible && subNavIsVisible) {
166
- // Set the class name
167
- elHeader.classList.add("rounded-top");
168
- }
169
- }
170
166
  // Render the data table
171
167
  this._dt = new table_1.DataTable({
172
168
  columns: this._props.table ? this._props.table.columns : null,
@@ -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[];
@@ -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));