@vuu-ui/vuu-utils 0.8.59 → 0.8.60
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.
- package/cjs/feature-utils.js +29 -0
- package/cjs/feature-utils.js.map +1 -0
- package/cjs/index.js +3 -0
- package/cjs/index.js.map +1 -1
- package/esm/feature-utils.js +26 -0
- package/esm/feature-utils.js.map +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/package.json +6 -6
- package/types/feature-utils.d.ts +16 -0
- package/types/index.d.ts +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const env = process.env.NODE_ENV;
|
|
4
|
+
const byModule = (schema1, schema2) => {
|
|
5
|
+
const m1 = schema1.table.module.toLowerCase();
|
|
6
|
+
const m2 = schema2.table.module.toLowerCase();
|
|
7
|
+
if (m1 < m2) {
|
|
8
|
+
return -1;
|
|
9
|
+
} else if (m1 > m2) {
|
|
10
|
+
return 1;
|
|
11
|
+
} else if (schema1.table.table < schema2.table.table) {
|
|
12
|
+
return -1;
|
|
13
|
+
} else if (schema1.table.table > schema2.table.table) {
|
|
14
|
+
return 1;
|
|
15
|
+
} else {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const getFilterTableFeatures = (schemas, getFeaturePath) => schemas.sort(byModule).map((schema) => ({
|
|
20
|
+
ComponentProps: {
|
|
21
|
+
tableSchema: schema
|
|
22
|
+
},
|
|
23
|
+
title: `${schema.table.module} ${schema.table.table}`,
|
|
24
|
+
...getFeaturePath({ env, fileName: "FilterTable" })
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
exports.env = env;
|
|
28
|
+
exports.getFilterTableFeatures = getFilterTableFeatures;
|
|
29
|
+
//# sourceMappingURL=feature-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-utils.js","sources":["../src/feature-utils.ts"],"sourcesContent":["import { FeatureConfig, FeatureProps } from \"@vuu-ui/vuu-shell\";\nimport { TableSchema } from \"@vuu-ui/vuu-data-types\";\n\nexport type PathMap = { [key: string]: Pick<FeatureConfig, \"css\" | \"url\"> };\nexport type Environment = \"development\" | \"production\";\nexport const env = process.env.NODE_ENV as Environment;\n\nexport interface FilterTableFeatureProps {\n tableSchema: TableSchema;\n}\n\n// Sort TableScheas by module\nconst byModule = (schema1: TableSchema, schema2: TableSchema) => {\n const m1 = schema1.table.module.toLowerCase();\n const m2 = schema2.table.module.toLowerCase();\n if (m1 < m2) {\n return -1;\n } else if (m1 > m2) {\n return 1;\n } else if (schema1.table.table < schema2.table.table) {\n return -1;\n } else if (schema1.table.table > schema2.table.table) {\n return 1;\n } else {\n return 0;\n }\n};\n\nexport type GetFeaturePaths = (params: {\n env: Environment;\n fileName: string;\n withCss?: boolean;\n}) => FeatureProps;\n\nexport const getFilterTableFeatures = (\n schemas: TableSchema[],\n getFeaturePath: GetFeaturePaths\n): FeatureProps<FilterTableFeatureProps>[] =>\n schemas.sort(byModule).map((schema) => ({\n ComponentProps: {\n tableSchema: schema,\n },\n title: `${schema.table.module} ${schema.table.table}`,\n ...getFeaturePath({ env, fileName: \"FilterTable\" }),\n }));\n"],"names":[],"mappings":";;AAKa,MAAA,GAAA,GAAM,QAAQ,GAAI,CAAA,SAAA;AAO/B,MAAM,QAAA,GAAW,CAAC,OAAA,EAAsB,OAAyB,KAAA;AAC/D,EAAA,MAAM,EAAK,GAAA,OAAA,CAAQ,KAAM,CAAA,MAAA,CAAO,WAAY,EAAA,CAAA;AAC5C,EAAA,MAAM,EAAK,GAAA,OAAA,CAAQ,KAAM,CAAA,MAAA,CAAO,WAAY,EAAA,CAAA;AAC5C,EAAA,IAAI,KAAK,EAAI,EAAA;AACX,IAAO,OAAA,CAAA,CAAA,CAAA;AAAA,GACT,MAAA,IAAW,KAAK,EAAI,EAAA;AAClB,IAAO,OAAA,CAAA,CAAA;AAAA,aACE,OAAQ,CAAA,KAAA,CAAM,KAAQ,GAAA,OAAA,CAAQ,MAAM,KAAO,EAAA;AACpD,IAAO,OAAA,CAAA,CAAA,CAAA;AAAA,aACE,OAAQ,CAAA,KAAA,CAAM,KAAQ,GAAA,OAAA,CAAQ,MAAM,KAAO,EAAA;AACpD,IAAO,OAAA,CAAA,CAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,CAAA,CAAA;AAAA,GACT;AACF,CAAA,CAAA;AAQa,MAAA,sBAAA,GAAyB,CACpC,OAAA,EACA,cAEA,KAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA,CAAE,GAAI,CAAA,CAAC,MAAY,MAAA;AAAA,EACtC,cAAgB,EAAA;AAAA,IACd,WAAa,EAAA,MAAA;AAAA,GACf;AAAA,EACA,KAAA,EAAO,GAAG,MAAO,CAAA,KAAA,CAAM,MAAM,CAAI,CAAA,EAAA,MAAA,CAAO,MAAM,KAAK,CAAA,CAAA;AAAA,EACnD,GAAG,cAAe,CAAA,EAAE,GAAK,EAAA,QAAA,EAAU,eAAe,CAAA;AACpD,CAAE,CAAA;;;;;"}
|
package/cjs/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var utils = require('./filters/utils.js');
|
|
|
20
20
|
var filterAsQuery = require('./filters/filterAsQuery.js');
|
|
21
21
|
var htmlUtils = require('./html-utils.js');
|
|
22
22
|
var eventEmitter = require('./event-emitter.js');
|
|
23
|
+
var featureUtils = require('./feature-utils.js');
|
|
23
24
|
var formUtils = require('./form-utils.js');
|
|
24
25
|
var formattingUtils = require('./formatting-utils.js');
|
|
25
26
|
var getUniqueId = require('./getUniqueId.js');
|
|
@@ -223,6 +224,8 @@ exports.hasOpenOptionList = htmlUtils.hasOpenOptionList;
|
|
|
223
224
|
exports.isSelectableElement = htmlUtils.isSelectableElement;
|
|
224
225
|
exports.queryClosest = htmlUtils.queryClosest;
|
|
225
226
|
exports.EventEmitter = eventEmitter.EventEmitter;
|
|
227
|
+
exports.env = featureUtils.env;
|
|
228
|
+
exports.getFilterTableFeatures = featureUtils.getFilterTableFeatures;
|
|
226
229
|
exports.getFieldName = formUtils.getFieldName;
|
|
227
230
|
exports.defaultValueFormatter = formattingUtils.defaultValueFormatter;
|
|
228
231
|
exports.getValueFormatter = formattingUtils.getValueFormatter;
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const env = process.env.NODE_ENV;
|
|
2
|
+
const byModule = (schema1, schema2) => {
|
|
3
|
+
const m1 = schema1.table.module.toLowerCase();
|
|
4
|
+
const m2 = schema2.table.module.toLowerCase();
|
|
5
|
+
if (m1 < m2) {
|
|
6
|
+
return -1;
|
|
7
|
+
} else if (m1 > m2) {
|
|
8
|
+
return 1;
|
|
9
|
+
} else if (schema1.table.table < schema2.table.table) {
|
|
10
|
+
return -1;
|
|
11
|
+
} else if (schema1.table.table > schema2.table.table) {
|
|
12
|
+
return 1;
|
|
13
|
+
} else {
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const getFilterTableFeatures = (schemas, getFeaturePath) => schemas.sort(byModule).map((schema) => ({
|
|
18
|
+
ComponentProps: {
|
|
19
|
+
tableSchema: schema
|
|
20
|
+
},
|
|
21
|
+
title: `${schema.table.module} ${schema.table.table}`,
|
|
22
|
+
...getFeaturePath({ env, fileName: "FilterTable" })
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
export { env, getFilterTableFeatures };
|
|
26
|
+
//# sourceMappingURL=feature-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-utils.js","sources":["../src/feature-utils.ts"],"sourcesContent":["import { FeatureConfig, FeatureProps } from \"@vuu-ui/vuu-shell\";\nimport { TableSchema } from \"@vuu-ui/vuu-data-types\";\n\nexport type PathMap = { [key: string]: Pick<FeatureConfig, \"css\" | \"url\"> };\nexport type Environment = \"development\" | \"production\";\nexport const env = process.env.NODE_ENV as Environment;\n\nexport interface FilterTableFeatureProps {\n tableSchema: TableSchema;\n}\n\n// Sort TableScheas by module\nconst byModule = (schema1: TableSchema, schema2: TableSchema) => {\n const m1 = schema1.table.module.toLowerCase();\n const m2 = schema2.table.module.toLowerCase();\n if (m1 < m2) {\n return -1;\n } else if (m1 > m2) {\n return 1;\n } else if (schema1.table.table < schema2.table.table) {\n return -1;\n } else if (schema1.table.table > schema2.table.table) {\n return 1;\n } else {\n return 0;\n }\n};\n\nexport type GetFeaturePaths = (params: {\n env: Environment;\n fileName: string;\n withCss?: boolean;\n}) => FeatureProps;\n\nexport const getFilterTableFeatures = (\n schemas: TableSchema[],\n getFeaturePath: GetFeaturePaths\n): FeatureProps<FilterTableFeatureProps>[] =>\n schemas.sort(byModule).map((schema) => ({\n ComponentProps: {\n tableSchema: schema,\n },\n title: `${schema.table.module} ${schema.table.table}`,\n ...getFeaturePath({ env, fileName: \"FilterTable\" }),\n }));\n"],"names":[],"mappings":"AAKa,MAAA,GAAA,GAAM,QAAQ,GAAI,CAAA,SAAA;AAO/B,MAAM,QAAA,GAAW,CAAC,OAAA,EAAsB,OAAyB,KAAA;AAC/D,EAAA,MAAM,EAAK,GAAA,OAAA,CAAQ,KAAM,CAAA,MAAA,CAAO,WAAY,EAAA,CAAA;AAC5C,EAAA,MAAM,EAAK,GAAA,OAAA,CAAQ,KAAM,CAAA,MAAA,CAAO,WAAY,EAAA,CAAA;AAC5C,EAAA,IAAI,KAAK,EAAI,EAAA;AACX,IAAO,OAAA,CAAA,CAAA,CAAA;AAAA,GACT,MAAA,IAAW,KAAK,EAAI,EAAA;AAClB,IAAO,OAAA,CAAA,CAAA;AAAA,aACE,OAAQ,CAAA,KAAA,CAAM,KAAQ,GAAA,OAAA,CAAQ,MAAM,KAAO,EAAA;AACpD,IAAO,OAAA,CAAA,CAAA,CAAA;AAAA,aACE,OAAQ,CAAA,KAAA,CAAM,KAAQ,GAAA,OAAA,CAAQ,MAAM,KAAO,EAAA;AACpD,IAAO,OAAA,CAAA,CAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,CAAA,CAAA;AAAA,GACT;AACF,CAAA,CAAA;AAQa,MAAA,sBAAA,GAAyB,CACpC,OAAA,EACA,cAEA,KAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA,CAAE,GAAI,CAAA,CAAC,MAAY,MAAA;AAAA,EACtC,cAAgB,EAAA;AAAA,IACd,WAAa,EAAA,MAAA;AAAA,GACf;AAAA,EACA,KAAA,EAAO,GAAG,MAAO,CAAA,KAAA,CAAM,MAAM,CAAI,CAAA,EAAA,MAAA,CAAO,MAAM,KAAK,CAAA,CAAA;AAAA,EACnD,GAAG,cAAe,CAAA,EAAE,GAAK,EAAA,QAAA,EAAU,eAAe,CAAA;AACpD,CAAE,CAAA;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { applyFilterToColumns, extractFilterForColumn, isAndFilter, isCompleteFi
|
|
|
18
18
|
export { dateFilterAsQuery, filterAsQuery, removeColumnFromFilter } from './filters/filterAsQuery.js';
|
|
19
19
|
export { createEl, dispatchCustomEvent, dispatchKeyboardEvent, dispatchMouseEvent, focusFirstFocusableElement, getClosest, getClosestIndexItem, getElementByDataIndex, getElementDataIndex, getFocusableElement, getScrollbarSize, hasOpenOptionList, isSelectableElement, queryClosest } from './html-utils.js';
|
|
20
20
|
export { EventEmitter } from './event-emitter.js';
|
|
21
|
+
export { env, getFilterTableFeatures } from './feature-utils.js';
|
|
21
22
|
export { getFieldName } from './form-utils.js';
|
|
22
23
|
export { defaultValueFormatter, getValueFormatter, numericFormatter } from './formatting-utils.js';
|
|
23
24
|
export { getUniqueId } from './getUniqueId.js';
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
2
|
+
"version": "0.8.60",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-data-types": "0.8.
|
|
8
|
-
"@vuu-ui/vuu-table-types": "0.8.
|
|
9
|
-
"@vuu-ui/vuu-filter-types": "0.8.
|
|
10
|
-
"@vuu-ui/vuu-protocol-types": "0.8.
|
|
7
|
+
"@vuu-ui/vuu-data-types": "0.8.60",
|
|
8
|
+
"@vuu-ui/vuu-table-types": "0.8.60",
|
|
9
|
+
"@vuu-ui/vuu-filter-types": "0.8.60",
|
|
10
|
+
"@vuu-ui/vuu-protocol-types": "0.8.60"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@internationalized/date": "^3.0.0",
|
|
14
|
-
"@vuu-ui/vuu-filter-parser": "0.8.
|
|
14
|
+
"@vuu-ui/vuu-filter-parser": "0.8.60",
|
|
15
15
|
"clsx": "^2.0.0",
|
|
16
16
|
"react": ">=17.0.2",
|
|
17
17
|
"react-dom": ">=17.0.2"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FeatureConfig, FeatureProps } from "@vuu-ui/vuu-shell";
|
|
2
|
+
import { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
export type PathMap = {
|
|
4
|
+
[key: string]: Pick<FeatureConfig, "css" | "url">;
|
|
5
|
+
};
|
|
6
|
+
export type Environment = "development" | "production";
|
|
7
|
+
export declare const env: Environment;
|
|
8
|
+
export interface FilterTableFeatureProps {
|
|
9
|
+
tableSchema: TableSchema;
|
|
10
|
+
}
|
|
11
|
+
export type GetFeaturePaths = (params: {
|
|
12
|
+
env: Environment;
|
|
13
|
+
fileName: string;
|
|
14
|
+
withCss?: boolean;
|
|
15
|
+
}) => FeatureProps;
|
|
16
|
+
export declare const getFilterTableFeatures: (schemas: TableSchema[], getFeaturePath: GetFeaturePaths) => FeatureProps<FilterTableFeatureProps>[];
|
package/types/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./debug-utils";
|
|
|
14
14
|
export * from "./filters";
|
|
15
15
|
export * from "./html-utils";
|
|
16
16
|
export * from "./event-emitter";
|
|
17
|
+
export * from "./feature-utils";
|
|
17
18
|
export * from "./form-utils";
|
|
18
19
|
export * from "./formatting-utils";
|
|
19
20
|
export * from "./getUniqueId";
|