@8base/utils
Advanced tools
Comparing version 0.32.1 to 0.32.2
@@ -17,5 +17,11 @@ import { ParametricSelector } from 'reselect'; | ||
export declare const isSystemField: import("reselect").OutputSelector<FieldSchema, boolean, (res: FieldSchema) => boolean>; | ||
export declare const getFieldId: import("reselect").OutputSelector<FieldSchema, string, (res: FieldSchema) => string>; | ||
export declare const getFieldName: import("reselect").OutputSelector<FieldSchema, string, (res: FieldSchema) => string>; | ||
export declare const getFieldDisplayName: import("reselect").OutputSelector<FieldSchema, string, (res: FieldSchema) => string>; | ||
export declare const getTableId: import("reselect").OutputSelector<FieldSchema, any, (res: FieldSchema) => any>; | ||
export declare const getTableName: import("reselect").OutputSelector<FieldSchema, any, (res: FieldSchema) => any>; | ||
export declare const getTableDisplayName: import("reselect").OutputSelector<FieldSchema, any, (res: FieldSchema) => any>; | ||
export declare const getRelationTableId: ParametricSelector<FieldSchema, void, string>; | ||
export declare const getRelationTableName: ParametricSelector<FieldSchema, void, string>; | ||
export declare const getRelationTableDisplayName: ParametricSelector<FieldSchema, void, string>; | ||
//# sourceMappingURL=tableFieldSelectors.d.ts.map |
@@ -23,5 +23,11 @@ "use strict"; | ||
exports.isSystemField = reselect_1.createSelector(exports.getTableField, R.propEq('isSystem', true)); | ||
exports.getFieldId = reselect_1.createSelector(exports.getTableField, R.prop('id')); | ||
exports.getFieldName = reselect_1.createSelector(exports.getTableField, R.prop('name')); | ||
exports.getFieldDisplayName = reselect_1.createSelector(exports.getTableField, R.prop('displayName')); | ||
exports.getTableId = reselect_1.createSelector(exports.getTableField, R.path(['table', 'id'])); | ||
exports.getTableName = reselect_1.createSelector(exports.getTableField, R.path(['table', 'name'])); | ||
exports.getTableDisplayName = reselect_1.createSelector(exports.getTableField, R.path(['table', 'displayName'])); | ||
exports.getRelationTableId = reselect_1.createSelector(exports.getTableField, R.path(['relation', 'refTable', 'id'])); | ||
exports.getRelationTableName = reselect_1.createSelector(exports.getTableField, R.path(['relation', 'refTable', 'name'])); | ||
exports.getRelationTableDisplayName = reselect_1.createSelector(exports.getTableField, R.path(['relation', 'refTable', 'displayName'])); | ||
//# sourceMappingURL=tableFieldSelectors.js.map |
@@ -8,3 +8,8 @@ import { FIELD_TYPE, SWITCH_FORMATS, TEXT_FORMATS, NUMBER_FORMATS, FILE_FORMATS, DATE_FORMATS, MUTATION_TYPE, SMART_FORMATS, APP_STATUS } from './constants'; | ||
name: string; | ||
displayName?: string; | ||
displayName: string; | ||
table: { | ||
id: string; | ||
name: string; | ||
displayName: string; | ||
}; | ||
description?: string; | ||
@@ -32,2 +37,3 @@ fieldType: FieldType; | ||
name: string; | ||
displayName: string; | ||
}; | ||
@@ -34,0 +40,0 @@ }; |
{ | ||
"name": "@8base/utils", | ||
"version": "0.32.1", | ||
"version": "0.32.2", | ||
"repository": "https://github.com/8base/sdk", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/8base/sdk/tree/master/packages/utils#readme", |
import * as R from 'ramda'; | ||
import { createSelector, ParametricSelector, Selector } from 'reselect'; | ||
import { FIELD_TYPE } from '../constants'; | ||
import { FieldSchema, Format } from '../types'; | ||
import { FieldSchema } from '../types'; | ||
@@ -53,2 +53,7 @@ export const getTableField = (tableField: FieldSchema) => tableField; | ||
export const getFieldId = createSelector( | ||
getTableField, | ||
R.prop('id'), | ||
); | ||
export const getFieldName = createSelector( | ||
@@ -59,2 +64,22 @@ getTableField, | ||
export const getFieldDisplayName = createSelector( | ||
getTableField, | ||
R.prop('displayName'), | ||
); | ||
export const getTableId = createSelector( | ||
getTableField, | ||
R.path<any>(['table', 'id']), | ||
); | ||
export const getTableName = createSelector( | ||
getTableField, | ||
R.path<any>(['table', 'name']), | ||
); | ||
export const getTableDisplayName = createSelector( | ||
getTableField, | ||
R.path<any>(['table', 'displayName']), | ||
); | ||
export const getRelationTableId: ParametricSelector<FieldSchema, void, string> = createSelector( | ||
@@ -69,1 +94,6 @@ getTableField, | ||
); | ||
export const getRelationTableDisplayName: ParametricSelector<FieldSchema, void, string> = createSelector( | ||
getTableField, | ||
R.path<any>(['relation', 'refTable', 'displayName']), | ||
); |
@@ -28,3 +28,8 @@ import { | ||
name: string; | ||
displayName?: string; | ||
displayName: string; | ||
table: { | ||
id: string; | ||
name: string; | ||
displayName: string; | ||
}; | ||
description?: string; | ||
@@ -50,2 +55,3 @@ fieldType: FieldType; | ||
name: string; | ||
displayName: string; | ||
}; | ||
@@ -52,0 +58,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
233989
3716