@microsoft/connected-workbooks 3.1.1-beta.2 → 3.1.3-beta

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 (44) hide show
  1. package/README.md +2 -2
  2. package/dist/generators.js +9 -3
  3. package/dist/index.d.ts +1 -2
  4. package/dist/index.js +29 -4
  5. package/dist/main.js +357 -106
  6. package/dist/src/generators.js +7 -6
  7. package/dist/src/types.d.ts +1 -0
  8. package/dist/src/utils/arrayUtils.js +26 -21
  9. package/dist/src/utils/constants.js +18 -8
  10. package/dist/src/utils/documentUtils.js +92 -42
  11. package/dist/src/utils/gridUtils.js +23 -23
  12. package/dist/src/utils/htmlUtils.js +8 -8
  13. package/dist/src/utils/mashupDocumentParser.js +110 -67
  14. package/dist/src/utils/pqUtils.js +161 -65
  15. package/dist/src/utils/tableUtils.js +118 -74
  16. package/dist/src/utils/xmlInnerPartsUtils.js +213 -152
  17. package/dist/src/utils/xmlPartsUtils.js +116 -50
  18. package/dist/tests/arrayUtils.test.js +21 -21
  19. package/dist/tests/documentUtils.test.js +37 -8
  20. package/dist/tests/gridUtils.test.js +9 -9
  21. package/dist/tests/htmlUtils.test.js +48 -47
  22. package/dist/tests/mashupDocumentParser.test.js +91 -38
  23. package/dist/tests/mocks/PqMock.js +1 -1
  24. package/dist/tests/mocks/section1mSimpleQueryMock.js +5 -15
  25. package/dist/tests/mocks/xmlMocks.js +2 -2
  26. package/dist/tests/tableUtils.test.js +18 -18
  27. package/dist/tests/workbookQueryTemplate.test.js +127 -45
  28. package/dist/tests/workbookTableTemplate.test.js +104 -33
  29. package/dist/tests/xmlInnerPartsUtils.test.js +118 -37
  30. package/dist/types.js +9 -6
  31. package/dist/utils/arrayUtils.js +5 -2
  32. package/dist/utils/constants.js +68 -61
  33. package/dist/utils/documentUtils.js +42 -27
  34. package/dist/utils/gridUtils.js +10 -8
  35. package/dist/utils/htmlUtils.js +3 -1
  36. package/dist/utils/index.js +22 -8
  37. package/dist/utils/mashupDocumentParser.js +70 -47
  38. package/dist/utils/pqUtils.js +19 -15
  39. package/dist/utils/tableUtils.js +69 -63
  40. package/dist/utils/xmlInnerPartsUtils.js +80 -74
  41. package/dist/utils/xmlPartsUtils.js +31 -26
  42. package/dist/workbookManager.js +46 -35
  43. package/dist/workbookTemplate.js +5 -2
  44. package/package.json +4 -2
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Connected Workbooks
1
+ # Open In Excel
2
2
  [![License](https://img.shields.io/github/license/microsoft/connected-workbooks)](https://github.com/microsoft/connected-workbooks/blob/master/LICENSE)
3
3
 
4
4
  A pure JS library, Microsoft backed, that provides xlsx workbook generation capabilities, allowing for:
@@ -8,7 +8,7 @@ A pure JS library, Microsoft backed, that provides xlsx workbook generation capa
8
8
  - Allows for initial data population.
9
9
  - Supports more advanced scenarios where you provide branded/custom workbooks, and load your data into PivotTables or PivotCharts.
10
10
 
11
- Connected Workbooks allows you to avoid "data dumps" in CSV form, providing a richer experience with Tables and/or connected Queries for when your business application supports it.
11
+ Open in Excel allows you to avoid "data dumps" in CSV form, providing a richer experience with Tables and/or connected Queries for when your business application supports it.
12
12
 
13
13
  [Learn about Power Query here](https://powerquery.microsoft.com/en-us/)
14
14
 
@@ -1,9 +1,15 @@
1
+ "use strict";
1
2
  // Copyright (c) Microsoft Corporation.
2
3
  // Licensed under the MIT license.
3
- export var generateMashupXMLTemplate = function (base64) {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.generateCustomXmlFilePath = exports.generateSingleQueryMashup = exports.generateMashupXMLTemplate = void 0;
6
+ var generateMashupXMLTemplate = function (base64) {
4
7
  return "<?xml version=\"1.0\" encoding=\"utf-16\"?><DataMashup xmlns=\"http://schemas.microsoft.com/DataMashup\">".concat(base64, "</DataMashup>");
5
8
  };
6
- export var generateSingleQueryMashup = function (queryName, query) {
9
+ exports.generateMashupXMLTemplate = generateMashupXMLTemplate;
10
+ var generateSingleQueryMashup = function (queryName, query) {
7
11
  return "section Section1;\n \n shared #\"".concat(queryName, "\" = \n ").concat(query, ";");
8
12
  };
9
- export var generateCustomXmlFilePath = function (i) { return "customXml/item".concat(i, ".xml"); };
13
+ exports.generateSingleQueryMashup = generateSingleQueryMashup;
14
+ var generateCustomXmlFilePath = function (i) { return "customXml/item".concat(i, ".xml"); };
15
+ exports.generateCustomXmlFilePath = generateCustomXmlFilePath;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import * as workbookManager from "./workbookManager";
2
1
  import { DataTypes } from "./types";
3
2
  import type { QueryInfo, FileConfigs, Grid, DocProps } from "./types";
4
3
  export { DataTypes };
5
4
  export type { QueryInfo, FileConfigs, Grid, DocProps };
6
- export default workbookManager;
5
+ export * as workbookManager from "./workbookManager";
package/dist/index.js CHANGED
@@ -1,6 +1,31 @@
1
+ "use strict";
1
2
  // Copyright (c) Microsoft Corporation.
2
3
  // Licensed under the MIT license.
3
- import * as workbookManager from "./workbookManager";
4
- import { DataTypes } from "./types";
5
- export { DataTypes };
6
- export default workbookManager;
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.workbookManager = exports.DataTypes = void 0;
29
+ var types_1 = require("./types");
30
+ Object.defineProperty(exports, "DataTypes", { enumerable: true, get: function () { return types_1.DataTypes; } });
31
+ exports.workbookManager = __importStar(require("./workbookManager"));