@qrvey/utils 1.2.9-35 → 1.2.9-38

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 (166) hide show
  1. package/README.md +116 -117
  2. package/bitbucket-pipelines.yml +1 -1
  3. package/dist/cjs/charts/constants/index.js +5 -1
  4. package/dist/cjs/charts/helpers/index.js +5 -1
  5. package/dist/cjs/charts/index.js +5 -1
  6. package/dist/cjs/charts/interfaces/index.js +5 -1
  7. package/dist/cjs/columns/constants/COLUMN_LABEL.d.ts +1 -0
  8. package/dist/cjs/columns/constants/COLUMN_LABEL.js +1 -1
  9. package/dist/cjs/columns/constants/COLUMN_PROPERTY_INFO.js +1 -1
  10. package/dist/cjs/columns/constants/index.js +5 -1
  11. package/dist/cjs/columns/helpers/index.js +5 -1
  12. package/dist/cjs/columns/index.js +5 -1
  13. package/dist/cjs/columns/interfaces/index.js +5 -1
  14. package/dist/cjs/constants/index.js +5 -1
  15. package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSION.js +1 -1
  16. package/dist/cjs/dates/constants/index.js +5 -1
  17. package/dist/cjs/dates/helpers/getSeparatorByDateFormat.js +1 -1
  18. package/dist/cjs/dates/helpers/index.js +5 -1
  19. package/dist/cjs/dates/index.js +5 -1
  20. package/dist/cjs/dates/interfaces/index.js +5 -1
  21. package/dist/cjs/dates/range/index.js +5 -1
  22. package/dist/cjs/dates/relative/constants/index.js +5 -1
  23. package/dist/cjs/dates/relative/constants/ui/index.js +5 -1
  24. package/dist/cjs/dates/relative/helpers/dayjs-module.js +5 -1
  25. package/dist/cjs/dates/relative/helpers/index.js +5 -1
  26. package/dist/cjs/dates/relative/index.js +5 -1
  27. package/dist/cjs/dates/relative/interfaces/index.js +5 -1
  28. package/dist/cjs/dates/relative/interfaces/ui/index.js +5 -1
  29. package/dist/cjs/filters/adapters/index.js +5 -1
  30. package/dist/cjs/filters/classes/index.js +5 -1
  31. package/dist/cjs/filters/constants/backend/index.js +5 -1
  32. package/dist/cjs/filters/constants/builder/index.js +5 -1
  33. package/dist/cjs/filters/constants/common/index.js +5 -1
  34. package/dist/cjs/filters/constants/index.js +5 -1
  35. package/dist/cjs/filters/constants/panel/index.js +5 -1
  36. package/dist/cjs/filters/helpers/backend/index.js +5 -1
  37. package/dist/cjs/filters/helpers/builder/index.js +5 -1
  38. package/dist/cjs/filters/helpers/common/index.js +5 -1
  39. package/dist/cjs/filters/helpers/index.js +5 -1
  40. package/dist/cjs/filters/helpers/ui/index.js +5 -1
  41. package/dist/cjs/filters/index.js +5 -1
  42. package/dist/cjs/filters/interfaces/backend/index.js +5 -1
  43. package/dist/cjs/filters/interfaces/builder/index.js +5 -1
  44. package/dist/cjs/filters/interfaces/common/index.js +5 -1
  45. package/dist/cjs/filters/interfaces/index.js +5 -1
  46. package/dist/cjs/filters/interfaces/panel/index.js +5 -1
  47. package/dist/cjs/filters/interfaces/ui/index.js +5 -1
  48. package/dist/cjs/format/format.d.ts +1 -1
  49. package/dist/cjs/format/format.js +3 -0
  50. package/dist/cjs/format/index.js +5 -1
  51. package/dist/cjs/format/localization.js +2 -2
  52. package/dist/cjs/formulas/constants/index.js +5 -1
  53. package/dist/cjs/formulas/index.js +5 -1
  54. package/dist/cjs/formulas/interfaces/index.js +5 -1
  55. package/dist/cjs/general/array/index.js +5 -1
  56. package/dist/cjs/general/function/index.js +5 -1
  57. package/dist/cjs/general/index.js +5 -1
  58. package/dist/cjs/general/mix/index.js +5 -1
  59. package/dist/cjs/general/object/index.js +5 -1
  60. package/dist/cjs/general/string/index.js +5 -1
  61. package/dist/cjs/globalization/helpers/index.js +5 -1
  62. package/dist/cjs/globalization/index.js +5 -1
  63. package/dist/cjs/globalization/interfaces/bucket_builder/index.js +5 -1
  64. package/dist/cjs/globalization/interfaces/calendar/index.js +5 -1
  65. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderTableStyleOptions.d.ts +6 -0
  66. package/dist/cjs/globalization/interfaces/chart_builder/index.js +5 -1
  67. package/dist/cjs/globalization/interfaces/columns/index.js +5 -1
  68. package/dist/cjs/globalization/interfaces/common/II18nColumnTypes.d.ts +1 -0
  69. package/dist/cjs/globalization/interfaces/common/index.js +5 -1
  70. package/dist/cjs/globalization/interfaces/cross_tabs/index.js +5 -1
  71. package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardToast.d.ts +1 -0
  72. package/dist/cjs/globalization/interfaces/dashboard/index.js +5 -1
  73. package/dist/cjs/globalization/interfaces/filters/index.js +5 -1
  74. package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderDeleteDialog.d.ts +3 -3
  75. package/dist/cjs/globalization/interfaces/formula_builder/II18nFormulaBuilderListTable.d.ts +5 -5
  76. package/dist/cjs/globalization/interfaces/formula_builder/index.js +5 -1
  77. package/dist/cjs/globalization/interfaces/index.js +5 -1
  78. package/dist/cjs/globalization/interfaces/panel/index.js +5 -1
  79. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +2 -0
  80. package/dist/cjs/globalization/interfaces/style_themes/index.js +5 -1
  81. package/dist/cjs/globalization/interfaces/table_charts/index.js +5 -1
  82. package/dist/cjs/globalization/labels/bucket_builder/index.js +5 -1
  83. package/dist/cjs/globalization/labels/calendar/index.js +5 -1
  84. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +6 -0
  85. package/dist/cjs/globalization/labels/chart_builder/index.js +5 -1
  86. package/dist/cjs/globalization/labels/columns/index.js +5 -1
  87. package/dist/cjs/globalization/labels/common/I18N_COLUMN_LABEL.d.ts +1 -0
  88. package/dist/cjs/globalization/labels/common/I18N_COLUMN_LABEL.js +1 -0
  89. package/dist/cjs/globalization/labels/common/index.js +5 -1
  90. package/dist/cjs/globalization/labels/cross_tabs/index.js +5 -1
  91. package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
  92. package/dist/cjs/globalization/labels/dashboard/index.js +5 -1
  93. package/dist/cjs/globalization/labels/filters/index.js +5 -1
  94. package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +9 -9
  95. package/dist/cjs/globalization/labels/formula_builder/index.js +5 -1
  96. package/dist/cjs/globalization/labels/index.js +5 -1
  97. package/dist/cjs/globalization/labels/panel/index.js +5 -1
  98. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +2 -0
  99. package/dist/cjs/globalization/labels/style_themes/index.js +5 -1
  100. package/dist/cjs/globalization/labels/table_charts/index.js +5 -1
  101. package/dist/cjs/globalization/service/index.js +5 -1
  102. package/dist/cjs/index.js +5 -1
  103. package/dist/cjs/interfaces/format/index.js +5 -1
  104. package/dist/cjs/interfaces/general/index.js +5 -1
  105. package/dist/cjs/interfaces/index.js +5 -1
  106. package/dist/cjs/qrvey/constants/index.js +5 -1
  107. package/dist/cjs/qrvey/helpers/index.js +5 -1
  108. package/dist/cjs/qrvey/index.js +5 -1
  109. package/dist/cjs/qrvey/interfaces/index.js +5 -1
  110. package/dist/cjs/services/adapters/index.js +5 -1
  111. package/dist/cjs/services/api/index.js +5 -1
  112. package/dist/cjs/services/constants/index.js +5 -1
  113. package/dist/cjs/services/helpers/index.js +5 -1
  114. package/dist/cjs/services/index.js +5 -1
  115. package/dist/cjs/services/interfaces/index.js +5 -1
  116. package/dist/cjs/stencil/decorators/index.js +5 -1
  117. package/dist/cjs/stencil/index.js +5 -1
  118. package/dist/cjs/stencil/util/index.js +5 -1
  119. package/dist/cjs/tokens/index.js +5 -1
  120. package/dist/cjs/typescript/decorators/index.js +5 -1
  121. package/dist/cjs/typescript/index.js +5 -1
  122. package/dist/columns/constants/COLUMN_LABEL.d.ts +1 -0
  123. package/dist/columns/constants/COLUMN_LABEL.js +1 -1
  124. package/dist/columns/constants/COLUMN_PROPERTY_INFO.js +1 -1
  125. package/dist/dates/constants/DATE_REGULAR_EXPRESSION.js +1 -1
  126. package/dist/dates/helpers/getSeparatorByDateFormat.js +1 -1
  127. package/dist/format/format.d.ts +1 -1
  128. package/dist/format/format.js +3 -0
  129. package/dist/format/localization.js +2 -2
  130. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderTableStyleOptions.d.ts +6 -0
  131. package/dist/globalization/interfaces/common/II18nColumnTypes.d.ts +1 -0
  132. package/dist/globalization/interfaces/dashboard/II18nDashboardToast.d.ts +1 -0
  133. package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderDeleteDialog.d.ts +3 -3
  134. package/dist/globalization/interfaces/formula_builder/II18nFormulaBuilderListTable.d.ts +5 -5
  135. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +2 -0
  136. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +6 -0
  137. package/dist/globalization/labels/common/I18N_COLUMN_LABEL.d.ts +1 -0
  138. package/dist/globalization/labels/common/I18N_COLUMN_LABEL.js +1 -0
  139. package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +1 -0
  140. package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +9 -9
  141. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +2 -0
  142. package/package.json +22 -16
  143. package/scripts/clean-build/index.js +62 -0
  144. package/scripts/generating-docs/index.js +133 -0
  145. package/{prepareToPublish.js → scripts/prepare-publish/index.js} +0 -0
  146. package/scripts/publishing/index.js +209 -0
  147. package/src/columns/constants/COLUMN_LABEL.ts +1 -0
  148. package/src/columns/constants/COLUMN_PROPERTY_INFO.ts +1 -1
  149. package/src/dates/constants/DATE_REGULAR_EXPRESSION.ts +1 -1
  150. package/src/dates/helpers/getSeparatorByDateFormat.ts +1 -1
  151. package/src/dates/helpers/validateDate.ts +1 -1
  152. package/src/dates/helpers/validateDateByDateFormat.ts +1 -1
  153. package/src/filters/helpers/ui/getUIValues.ts +15 -6
  154. package/src/filters/interfaces/ui/IFUUIValueSettings.ts +2 -0
  155. package/src/format/format.ts +3 -1
  156. package/src/globalization/interfaces/chart_builder/II18nChartBuilderTableStyleOptions.ts +6 -0
  157. package/src/globalization/interfaces/common/II18nColumnTypes.ts +1 -0
  158. package/src/globalization/interfaces/dashboard/II18nDashboardToast.ts +1 -0
  159. package/src/globalization/interfaces/formula_builder/II18nFormulaBuilderDeleteDialog.ts +3 -3
  160. package/src/globalization/interfaces/formula_builder/II18nFormulaBuilderListTable.ts +5 -5
  161. package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +2 -0
  162. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +6 -0
  163. package/src/globalization/labels/common/I18N_COLUMN_LABEL.ts +1 -0
  164. package/src/globalization/labels/dashboard/I18N_DASHBOARD.ts +1 -0
  165. package/src/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.ts +9 -9
  166. package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +2 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Script for cleaning the project from temporary files and building a new bundle
3
+ * 1- Deleting some directories and files
4
+ * 2- Installing dependencies
5
+ * 3- Build a new bundle
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const util = require('util');
10
+ const childProcess = require('child_process');
11
+ const exec = util.promisify(childProcess.exec);
12
+ const proc = require('process');
13
+ const readline = require("readline");
14
+ const rl = readline.createInterface({
15
+ input: proc.stdin,
16
+ output: proc.stdout
17
+ });
18
+ const question = util.promisify(rl.question).bind(rl);
19
+ const { exit } = require('process');
20
+
21
+ async function execute(command) {
22
+ console.log(command);
23
+ const response = await exec(command);
24
+ if (response.error != null) {
25
+ throw new Error(response.error);
26
+ }
27
+ if (response.stderr != null && response.stderr !== '') {
28
+ console.error(response.stderr);
29
+ }
30
+ if (response.stdout != null && response.stdout !== '') {
31
+ console.log(response.stdout);
32
+ }
33
+ return response;
34
+ }
35
+
36
+ async function getPackageJson(settings) {
37
+ console.log('==>>> Opening package.json file...');
38
+ const packageJson = await fs.readFileSync(settings.packagePath, 'utf8');
39
+ const packageObject = JSON.parse(packageJson);
40
+ if (packageObject != null) {
41
+ console.log(`**** The current version is ${packageObject.version}`);
42
+ return packageObject.version;
43
+ }
44
+ return '';
45
+ }
46
+
47
+ async function getNewVersion() {
48
+ console.log('==>>> Checking the new version provided...');
49
+ let newVersion;
50
+ const versionIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-new-version='); });
51
+ if (versionIndex > -1) {
52
+ const versionArg = proc.argv[versionIndex].split('--np-new-version=');
53
+ newVersion = versionArg[1] == null || versionArg[1] === '' ? undefined : versionArg[1];
54
+ }
55
+ if (newVersion == null) {
56
+ newVersion = await question('No version provided. Type the new version: ');
57
+ }
58
+ console.log('**** Version to publish: ' + newVersion);
59
+ return newVersion;
60
+ }
61
+
62
+ async function startGeneratingDocs(settings) {
63
+ console.log('==>>> Starting the Docs generation');
64
+
65
+ await generatingDocument(settings);
66
+ await changingVersion(settings);
67
+ await pushingChanges(settings);
68
+ }
69
+
70
+ async function generatingDocument(settings) {
71
+ console.log('==>>> Generating Document...');
72
+ await execute(`doxdox './dist/**/*.js' --output ${settings.docsFileName} --ignore './dist/cjs/**/*.js' --package ${settings.packagePath} --layout markdown`);
73
+ }
74
+
75
+ async function changingVersion(settings) {
76
+ console.log('==>>> Replacing the old version in the document');
77
+ const doc = await fs.readFileSync(settings.docsPath, 'utf8');
78
+ const replacedDoc = doc.replace(settings.currentVersion, settings.newVersion);
79
+ await fs.writeFileSync(settings.docsPath, replacedDoc, 'utf8');
80
+ }
81
+
82
+ async function pushingChanges(settings) {
83
+ console.log('==>>> Commiting and Pushing Docs changes...');
84
+
85
+ const gitStatus = await execute('git status -s');
86
+ console.log('gitStatus', gitStatus);
87
+ if (gitStatus.stdout !== '') {
88
+ const gitStdout = await execute('git rev-parse --abbrev-ref HEAD');
89
+ console.log('gitStdout', gitStdout);
90
+ await execute(`git add ${settings.docsPath}`);
91
+ await execute(`git commit -m "📝 docs: Updated docs${settings.newVersion != null || settings.newVersion !== '' ? ' for ' + settings.newVersion : ''}"`);
92
+ await execute(`git push -u origin ${gitStdout.stdout}`);
93
+ } else {
94
+ console.log('Nothing to Push');
95
+ }
96
+ }
97
+
98
+ async function revertChanges(settings) {
99
+ console.log('>>> Checking for modifications...');
100
+ console.warn(`>>> Unstaging posible changes from ${settings.docsFileName} and ${settings.packageFileName} file`);
101
+ await execute(`git restore --staged ${settings.docsPath} ${settings.packagePath}`);
102
+ console.warn(`>>> Discarting posible changes of ${settings.docsFileName} and ${settings.packageFileName} file`);
103
+ await execute(`git checkout -- ${settings.docsPath} ${settings.packagePath}`);
104
+ }
105
+
106
+ async function init() {
107
+ console.log('Generating Docs execution.');
108
+ let settings = {
109
+ currentVersion: '',
110
+ docsPath: './README.md',
111
+ docsFileName: 'README.md',
112
+ newVersion: undefined,
113
+ packageFileName: 'package.json',
114
+ packagePath: './package.json',
115
+ };
116
+
117
+ try {
118
+ settings["currentVersion"] = await getPackageJson(settings);
119
+ settings["newVersion"] = await getNewVersion();
120
+
121
+ await startGeneratingDocs(settings);
122
+ console.info('Docs were generated.');
123
+ } catch (err) {
124
+ console.error('Error: ', err);
125
+ await revertChanges(settings);
126
+ } finally {
127
+ console.log('Execution finished');
128
+ exit();
129
+ }
130
+ }
131
+
132
+ init();
133
+
@@ -0,0 +1,209 @@
1
+ /**
2
+ * New version for publishing a new version of Qrvey Utils
3
+ * 1- Publish the version with np
4
+ * 2- Update the README.md doc with doxdox
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const util = require('util');
9
+ const childProcess = require('child_process');
10
+ const exec = util.promisify(childProcess.exec);
11
+ const spawn = childProcess.spawn;
12
+ const proc = require('process');
13
+ const readline = require("readline");
14
+ const { exit } = require('process');
15
+ const rl = readline.createInterface({
16
+ input: proc.stdin,
17
+ output: proc.stdout
18
+ });
19
+ const question = util.promisify(rl.question).bind(rl);
20
+
21
+
22
+ async function execute(command) {
23
+ console.log(command);
24
+ const response = await exec(command);
25
+ if (response.error != null) {
26
+ throw new Error(response.error);
27
+ }
28
+ if (response.stderr != null && response.stderr !== '') {
29
+ console.error(response.stderr);
30
+ }
31
+ if (response.stdout != null && response.stdout !== '') {
32
+ console.log(response.stdout);
33
+ }
34
+ return response;
35
+ }
36
+
37
+ async function spawning(command, sArguments) {
38
+ let newProcess;
39
+ await new Promise(function (resolve, reject) {
40
+ newProcess = spawn(command, sArguments, { shell: true });
41
+ newProcess.stdout.on("data", data => {
42
+ console.log(`stdout: ${data}`);
43
+ });
44
+
45
+ newProcess.stderr.on("data", data => {
46
+ console.log(`stderr: ${data}`);
47
+ });
48
+
49
+ newProcess.on('error', (_error) => {
50
+ newProcess.stdin.pause();
51
+ newProcess.stdin.destroy();
52
+ newProcess.stdout.pause();
53
+ newProcess.stdout.destroy();
54
+ newProcess.kill();
55
+ reject();
56
+ });
57
+
58
+ newProcess.on("close", code => {
59
+ newProcess.stdin.pause();
60
+ newProcess.stdin.destroy();
61
+ newProcess.stdout.pause();
62
+ newProcess.stdout.destroy();
63
+ newProcess.kill();
64
+ if (code == '1') {
65
+ reject();
66
+ }
67
+ resolve();
68
+ });
69
+ });
70
+ }
71
+
72
+ async function getPackageJson(settings) {
73
+ console.log('==>>> Opening package.json file...');
74
+ const packageJson = await fs.readFileSync(settings.packagePath, 'utf8');
75
+ const packageObject = JSON.parse(packageJson);
76
+ if (packageObject != null) {
77
+ console.log(`**** The current version is ${packageObject.version}`);
78
+ return packageObject.version;
79
+ }
80
+ return '';
81
+ }
82
+
83
+ async function getNewVersion() {
84
+ console.log('==>>> Checking the new version provided...');
85
+ let newVersion;
86
+ const versionIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-new-version='); });
87
+ if (versionIndex > -1) {
88
+ const versionArg = proc.argv[versionIndex].split('--np-new-version=');
89
+ newVersion = versionArg[1] == null || versionArg[1] === '' ? undefined : versionArg[1];
90
+ }
91
+ if (newVersion == null) {
92
+ newVersion = question('No version provided. Type the new version: ');
93
+ }
94
+ console.log('**** Version to publish: ' + newVersion);
95
+ return newVersion;
96
+ }
97
+
98
+ async function cleaningProject(settings) {
99
+ console.log('==>>> Cleaning project...');
100
+ await execute(`rm -f ${settings.packageLockPath}`);
101
+ await execute(`rm -f -R ${settings.nodeModulesPath}`);
102
+ await execute(`rm -f -R ${settings.distPath}`);
103
+ }
104
+
105
+ async function buildingBundle(_settings) {
106
+ console.log('==>>> Installing Dependencies...');
107
+ await execute('npm install');
108
+
109
+ console.log('==>>> Generating Build...');
110
+ await execute('npm run build');
111
+ }
112
+
113
+ async function startPublishingVersion(settings) {
114
+ await callingPublisher(settings);
115
+ }
116
+
117
+ async function callingPublisher(settings) {
118
+ console.log('==>>> Calling Publisher');
119
+ let anyBranch = '', tag = '';
120
+ const anyBranchIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-any-branch='); });
121
+ const tagIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-tag='); });
122
+ if (anyBranchIndex > -1) {
123
+ const anyBranchArg = proc.argv[anyBranchIndex].split('--np-any-branch=');
124
+ anyBranch = anyBranchArg[1] == null || anyBranchArg[1] === '' ? '' : '--any-branch';
125
+ }
126
+ if (tagIndex > -1) {
127
+ const tagArg = proc.argv[tagIndex].split('--np-tag=');
128
+ tag = tagArg[1] == null || tagArg[1] === '' ? '' : proc.argv[tagIndex].replace('--np-tag=', '--tag=');
129
+ }
130
+ await spawning(`np ${settings.newVersion}`, [anyBranch, tag]);
131
+ }
132
+
133
+ async function startGeneratingDocs(settings) {
134
+ console.log('==>>> Starting the Docs generation');
135
+
136
+ await generatingDocument(settings);
137
+ await changingVersion(settings);
138
+ await pushingChanges(settings);
139
+ }
140
+
141
+ async function generatingDocument(settings) {
142
+ console.log('==>>> Generating Document...');
143
+ await execute(`doxdox './dist/**/*.js' --output ${settings.docsFileName} --ignore './dist/cjs/**/*.js' --package ${settings.packagePath} --layout markdown`);
144
+ }
145
+
146
+ async function changingVersion(settings) {
147
+ console.log('==>>> Replacing the old version in the document');
148
+ const doc = await fs.readFileSync(settings.docsPath, 'utf8');
149
+ const replacedDoc = doc.replace(settings.currentVersion, settings.newVersion);
150
+ await fs.writeFileSync(settings.docsPath, replacedDoc, 'utf8');
151
+ }
152
+
153
+ async function pushingChanges(settings) {
154
+ console.log('==>>> Commiting and Pushing Docs changes...');
155
+
156
+ const gitStatus = await execute('git status -s');
157
+ console.log('gitStatus', gitStatus);
158
+ if (gitStatus.stdout !== '') {
159
+ const gitStdout = await execute('git rev-parse --abbrev-ref HEAD');
160
+ console.log('gitStdout', gitStdout);
161
+ await execute(`git add ${settings.docsPath}`);
162
+ await execute(`git commit -m "📝 docs: Updated docs${settings.newVersion != null || settings.newVersion !== '' ? ' for ' + settings.newVersion : ''}"`);
163
+ await execute(`git push -u origin ${gitStdout.stdout}`);
164
+ } else {
165
+ console.log('Nothing to Push');
166
+ }
167
+ }
168
+
169
+ async function revertChanges(settings) {
170
+ console.log('>>> Checking for modifications...');
171
+ console.warn(`>>> Unstaging posible changes from ${settings.docsFileName} and ${settings.packageFileName} file`);
172
+ await execute(`git restore --staged ${settings.docsPath} ${settings.packagePath}`);
173
+ console.warn(`>>> Discarting posible changes of ${settings.docsFileName} and ${settings.packageFileName} file`);
174
+ await execute(`git checkout -- ${settings.docsPath} ${settings.packagePath}`);
175
+ }
176
+
177
+ async function init() {
178
+ let settings = {
179
+ currentVersion: '',
180
+ distPath: './dist',
181
+ docsPath: './README.md',
182
+ docsFileName: 'README.md',
183
+ newVersion: undefined,
184
+ nodeModulesPath: './node_modules',
185
+ packageFileName: 'package.json',
186
+ packageLockPath: './package-lock.json',
187
+ packagePath: './package.json',
188
+ };
189
+
190
+ console.log('Welcome. The publishing operationg will begin.');
191
+ try {
192
+ settings["currentVersion"] = await getPackageJson(settings);
193
+ settings["newVersion"] = await getNewVersion();
194
+
195
+ await cleaningProject(settings);
196
+ await buildingBundle(settings);
197
+ await startGeneratingDocs(settings);
198
+ await startPublishingVersion(settings);
199
+ console.info('Finished Publishing');
200
+ } catch (err) {
201
+ console.error('Error: ', err);
202
+ await revertChanges(settings);
203
+ } finally {
204
+ console.log('Execution finished');
205
+ exit();
206
+ }
207
+ }
208
+
209
+ init();
@@ -17,6 +17,7 @@ export const COLUMN_LABEL = {
17
17
  CHECKLIST: 'Check List',
18
18
  NPS_SCORE: 'NPS Score',
19
19
  NPS_FEEDBACK: 'NPS Feedback',
20
+ TEXT: 'Text',
20
21
  TEXT_LABEL: 'Text Label',
21
22
  TEXT_CATEGORY: 'Text Category',
22
23
  LOOKUP: 'Lookup',
@@ -12,7 +12,7 @@ import { DATE_DISTINCT_TIME_PROPERTY_INFO_LIST } from "../../dates/constants/DAT
12
12
  export const COLUMN_PROPERTY_INFO: { [key in IColumnType]?: IColumnPropertyInfo[] } = {
13
13
  [COLUMN.LOOKUP]: [
14
14
  { value: COLUMN_PROPERTY.LOOKUP_DISPLAY, label: 'Display', shortLabel: 'Display', abbrLabel: 'DSY', displayed: true, i18nLabelPath: 'common.properties.lookup_display_label' },
15
- { value: COLUMN_PROPERTY.LOOKUP_VALUE, label: 'Value', shortLabel: 'Value', abbrLabel: 'Val', displayed: true, i18nLabelPath: 'common.properties.lookup_display_value' }
15
+ { value: COLUMN_PROPERTY.LOOKUP_VALUE, label: 'Value', shortLabel: 'Value', abbrLabel: 'Val', displayed: true, i18nLabelPath: 'common.properties.lookup_value_label' }
16
16
  ],
17
17
  [COLUMN.DATE]: [
18
18
  ...DATE_GROUPING_PROPERTY_INFO_LIST,
@@ -25,7 +25,7 @@ export const DATE_REGULAR_EXPRESSION = {
25
25
  SECOND: `^${YEAR_MONTH_NUMBER}/${MONTH_DAY}/${YEAR} ${DAY_TIME}$`,
26
26
  MONTH_DAY: `^${MONTH_DAY}$`,
27
27
  YEAR_MONTH: `^${YEAR_MONTH}$`,
28
- YEAR_MONTH_NUMBER: `${YEAR_MONTH_NUMBER}`,
28
+ YEAR_MONTH_NUMBER: `^${YEAR_MONTH_NUMBER}$`,
29
29
  YEAR_QUARTER: `^${YEAR_QUARTER}$`,
30
30
  YEAR_WEEK: `^${YEAR_WEEK}$`,
31
31
  DAY_HOUR: `^${DAY_HOUR}$`,
@@ -7,7 +7,7 @@ import { IDateFormat } from "../interfaces/IDateFormat";
7
7
  * @returns a separator string
8
8
  */
9
9
  export function getSeparatorByDateFormat(format: IDateFormat = DATE_FORMAT.DAY): string {
10
- return format === DATE_FORMAT.YEAR || format === DATE_FORMAT.DAY_TIME || format === DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT.DAY_HOUR|| format === DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT.MINUTE_SECOND ? '' :
10
+ return format === DATE_FORMAT.YEAR || format === DATE_FORMAT.DAY_TIME || format === DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT.DAY_HOUR|| format === DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT.MINUTE_SECOND ? ' ' :
11
11
  format === DATE_FORMAT.MONTH || format === DATE_FORMAT.QUARTER || format === DATE_FORMAT.WEEK || format === DATE_FORMAT.HOUR || format === DATE_FORMAT.MINUTE || format === DATE_FORMAT.SECOND ? ' ' :
12
12
  '/';
13
13
  }
@@ -14,7 +14,7 @@ import { validateDateByDateFormat } from "./validateDateByDateFormat";
14
14
  * @param format String of the format to validate
15
15
  * @returns True if it is valid or not. Undefined if date is undefined
16
16
  */
17
- export function validateDate(date: string, format: IDateFormat = DATE_FORMAT.DAY): boolean {
17
+ export function validateDate(date: string, format: IDateFormat = DATE_FORMAT.DAY): boolean {
18
18
  if (isEmpty(date)) return false;
19
19
  if (isTokenLabel(date)) return true;
20
20
 
@@ -15,7 +15,7 @@ export function validateDateByDateFormat(date: string, dateFormat: IDateFormat =
15
15
  const separator = getSeparatorByDateFormat(dateFormat);
16
16
  const separatedDate = date.split(separator);
17
17
  const regularExpression = getDateFormatRegularExpressionInArray(dateFormat);
18
-
18
+
19
19
  if (regularExpression.length !== separatedDate.length) return false;
20
20
 
21
21
  for (let i = 0; i < separatedDate.length; i++) {
@@ -15,11 +15,10 @@ import { IFUUIValueSettings } from "../../interfaces/ui/IFUUIValueSettings";
15
15
  import { getI18nDateGroupLabel, IDateColumnPropertyType } from "../../..";
16
16
 
17
17
  /**
18
- *
19
- * @param filter
20
- * @param addEnableds
21
- * @param rankingGroupIndex
22
- * @returns
18
+ * Gets the UI Values from the filter object
19
+ * @param filter The filter object
20
+ * @param settings configuration for this function
21
+ * @returns an array of values
23
22
  */
24
23
  export function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): IFUValue[] {
25
24
  settings = getUiValuesSettings(settings);
@@ -43,7 +42,7 @@ export function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): I
43
42
  case FILTER_VALIDATOR.BETWEEN_INCLUSIVE:
44
43
  case FILTER_VALIDATOR.BETWEEN_EXCLUSIVE:
45
44
  return (filter.values as IFSValueRange[]).map(value => ({
46
- value: `${getValueLabel(value.min, filter, settings)} - ${getValueLabel(value.max, filter, settings)}`,
45
+ value: `${getValueLabel(value.min, filter, settings)} ${getRangeSeparator(settings)} ${getValueLabel(value.max, filter, settings)}`,
47
46
  enabled: settings.addEnableds ? value.enabled != null ? value.enabled : true : undefined,
48
47
  }));
49
48
  case FILTER_VALIDATOR.IS_NULL:
@@ -83,6 +82,8 @@ function getValueLabel(value, filter, settings: IFUUIValueSettings): string {
83
82
  function getUiValuesSettings(settings: IFUUIValueSettings): IFUUIValueSettings {
84
83
  return {
85
84
  addEnableds: settings?.addEnableds ?? false,
85
+ rangeSeparator: settings?.rangeSeparator || '-',
86
+ rangeSeparatorPath: settings?.rangeSeparatorPath,
86
87
  rankingGroupIndex: settings?.rankingGroupIndex,
87
88
  translate: settings?.translate,
88
89
  };
@@ -102,3 +103,11 @@ function getRankingUIValues(values: IFSValueRanking[][], addEnableds = false, ra
102
103
  enabled: addEnableds ? rankingValue.enabled : undefined
103
104
  }));
104
105
  }
106
+
107
+ function getRangeSeparator(settings: IFUUIValueSettings): string {
108
+ if (!isEmpty(settings.translate) && !isEmpty(settings.rangeSeparatorPath)) {
109
+ return settings.translate(settings.rangeSeparatorPath);
110
+ } else {
111
+ return settings.rangeSeparator;
112
+ }
113
+ }
@@ -3,5 +3,7 @@ import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nSe
3
3
  export interface IFUUIValueSettings {
4
4
  addEnableds?: boolean;
5
5
  rankingGroupIndex?: number;
6
+ rangeSeparator?: string; // The string to separate the min and max values from range validator
7
+ rangeSeparatorPath?: string; // Prioriteze over rangeSeparator. Path for translate the range separator
6
8
  translate?: II18nServiceTranslate;
7
9
  }
@@ -6,8 +6,9 @@ import { isEmpty } from '../general/mix/isEmpty';
6
6
  import { _get } from '../general/object/get';
7
7
  import { COLUMN } from '../columns/constants/COLUMN';
8
8
  import { FORMULA } from '../formulas/constants/FORMULA';
9
- import { IFormatConfig } from '..';
10
9
  import { formatWithLocale } from './localization';
10
+ import { isObject } from '../general/object/isObject';
11
+ import { IFormatConfig } from '../interfaces/format/IFormatConfig.Interface';
11
12
 
12
13
  dayjs.extend(advancedFormat); // Add support to advanced formats https://day.js.org/docs/en/plugin/advanced-format
13
14
 
@@ -21,6 +22,7 @@ function isValidDateString(dateString = '') {
21
22
  }
22
23
 
23
24
  export function formatDate(dateString, format) {
25
+ if(isObject(format)) format = format.format || "";
24
26
  if (isEmpty(dateString) || !isNaN(dateString) || format === 'Default') return dateString;
25
27
  if (!isValidDateString(dateString)) return dateString;
26
28
  const dateValue = dateString?.replace(/Z$/i, '');
@@ -1,4 +1,10 @@
1
1
  export interface II18nChartBuilderTableStyleOptions {
2
+ align: string,
3
+ align_all_columns: string,
4
+ align_default: string,
5
+ align_left: string,
6
+ align_right: string,
7
+ align_center: string,
2
8
  typeface: string;
3
9
  weight: string;
4
10
  weight_bold: string;
@@ -20,6 +20,7 @@ export interface II18nColumnTypes {
20
20
  checklist_label: string;
21
21
  nps_score_label: string;
22
22
  nps_feedback_label: string;
23
+ text_label: string;
23
24
  text_label_label: string;
24
25
  text_category_label: string;
25
26
  lookup_label: string;
@@ -3,4 +3,5 @@ export interface II18nDashboardToast {
3
3
  delete_record_message: string;
4
4
  add_record_message: string;
5
5
  data_views_updated_message: string;
6
+ failed_download: string;
6
7
  }
@@ -1,7 +1,7 @@
1
1
  export interface II18nFormulaBuilderDeleteDialog {
2
- title: string;
2
+ apply_button: string;
3
+ cancel_button: string;
3
4
  description: string;
5
+ title: string;
4
6
  toast_description: string;
5
- cancel_button: string;
6
- apply_button: string;
7
7
  }
@@ -1,9 +1,9 @@
1
1
  export interface II18nFormulaBuilderListTable{
2
- name: string;
3
- formula: string;
4
- menu_edit: string;
5
- menu_duplicate: string;
6
- menu_delete: string;
7
2
  duplicate_copy: string;
8
3
  duplicate_toast: string
4
+ formula: string;
5
+ menu_delete: string;
6
+ menu_duplicate: string;
7
+ menu_edit: string;
8
+ name: string;
9
9
  }
@@ -13,10 +13,12 @@ export interface II18nStyleThemesTheme {
13
13
  legends: string;
14
14
  main_color: string;
15
15
  name_placeholder: string;
16
+ panel_background: string;
16
17
  panel_styles: string;
17
18
  qrvey_theme: string;
18
19
  restore_to_default: string;
19
20
  save_theme: string;
21
+ show_title: string;
20
22
  table_header_styles: string;
21
23
  text_styles: string;
22
24
  tooltips: string;
@@ -188,6 +188,12 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOpti
188
188
  target_value: 'Target Value'
189
189
  },
190
190
  table_style_options: {
191
+ align: 'Align',
192
+ align_all_columns: 'All Columns',
193
+ align_default: 'Default',
194
+ align_left: 'Align Left',
195
+ align_right: 'Align Right',
196
+ align_center: 'Align Center',
191
197
  typeface: 'Typeface',
192
198
  weight: 'Weight',
193
199
  weight_bold: 'Bold',
@@ -21,6 +21,7 @@ export const I18N_COLUMN_LABEL = {
21
21
  checklist_label: COLUMN_LABEL.CHECKLIST,
22
22
  nps_score_label: COLUMN_LABEL.NPS_SCORE,
23
23
  nps_feedback_label: COLUMN_LABEL.NPS_FEEDBACK,
24
+ text_label: COLUMN_LABEL.TEXT,
24
25
  text_label_label: COLUMN_LABEL.TEXT_LABEL,
25
26
  text_category_label: COLUMN_LABEL.TEXT_CATEGORY,
26
27
  lookup_label: COLUMN_LABEL.LOOKUP,
@@ -25,6 +25,7 @@ export const I18N_DASHBOARD: II18nDashboard = {
25
25
  data_views_updated_message: 'Data views updated successfully.',
26
26
  delete_record_message: 'Record Successfully Deleted.',
27
27
  refresh_table_message: 'Record Successfully Edited.',
28
+ failed_download: 'The file(s) could not be exported at this time.',
28
29
  },
29
30
  tooltips: {
30
31
  buckets: "Buckets",
@@ -9,20 +9,20 @@ export const I18N_FORMULA_BUILDER: II18nFormulaBuilder = {
9
9
  information_text_text: 'create and work with formulas',
10
10
  },
11
11
  list_table: {
12
- name: 'Formula Name',
12
+ duplicate_copy: 'Copy',
13
+ duplicate_toast: 'Formula Duplicated Successfully',
13
14
  formula: 'Formula',
14
- menu_edit: 'Edit',
15
- menu_duplicate: 'Duplicate',
16
15
  menu_delete: 'Delete',
17
- duplicate_copy: 'Copy',
18
- duplicate_toast: 'Formula Successfully Duplicated'
16
+ menu_duplicate: 'Duplicate',
17
+ menu_edit: 'Edit',
18
+ name: 'Formula Name'
19
19
  },
20
20
  delete_dialog: {
21
- title: 'Delete Formula',
22
- description: 'Deleting this formula will remove all instances of this calculation in your analytics.',
23
- toast_description: 'Formula Successfully Deleted',
21
+ apply_button: 'Delete',
24
22
  cancel_button: 'Cancel',
25
- apply_button: 'Delete'
23
+ description: 'Deleting this formula will remove all instances of this calculation in your analytics.',
24
+ title: 'Delete Formula',
25
+ toast_description: 'Formula Deleted Successfully'
26
26
  },
27
27
  create_modal: {
28
28
  title_header_create: 'Create Formula',
@@ -37,10 +37,12 @@ export const I18N_STYLE_THEMES: II18nStyleThemes = {
37
37
  legends: 'Legends',
38
38
  main_color: 'Main Color',
39
39
  name_placeholder: 'Type name',
40
+ panel_background: 'Panel Background',
40
41
  panel_styles: 'Panel Styles',
41
42
  qrvey_theme: 'Qrvey Theme',
42
43
  restore_to_default: 'Restore to Default',
43
44
  save_theme: 'Save Theme',
45
+ show_title: 'Show Title',
44
46
  table_header_styles: 'Table Header Styles',
45
47
  text_styles: 'Text Styles',
46
48
  tooltips: 'Tooltips',