@budibase/shared-core 2.32.15 → 2.32.16
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/dist/helpers/views.d.ts +4 -1
- package/dist/index.js +62 -3
- package/dist/index.js.map +3 -3
- package/dist/index.js.meta.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/helpers/views.d.ts
CHANGED
|
@@ -5,5 +5,8 @@ type UnsavedViewV2 = Omit<ViewV2, "id" | "version">;
|
|
|
5
5
|
export declare function isCalculationView(view: UnsavedViewV2): boolean;
|
|
6
6
|
export declare function hasCalculationFields(view: UnsavedViewV2): boolean;
|
|
7
7
|
export declare function calculationFields(view: UnsavedViewV2): import("lodash").Dictionary<ViewCalculationFieldMetadata>;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function isVisible(field: ViewFieldMetadata): boolean;
|
|
9
|
+
export declare function basicFields(view: UnsavedViewV2, opts?: {
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
}): import("lodash").Dictionary<ViewFieldMetadata>;
|
|
9
12
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -17208,6 +17208,58 @@ var AutomationStepIdArray = [
|
|
|
17208
17208
|
// ../types/src/documents/document.ts
|
|
17209
17209
|
var SEPARATOR = "_";
|
|
17210
17210
|
var prefixed = (type) => `${type}${SEPARATOR}`;
|
|
17211
|
+
var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
|
|
17212
|
+
DocumentType2["USER"] = "us";
|
|
17213
|
+
DocumentType2["GROUP"] = "gr";
|
|
17214
|
+
DocumentType2["WORKSPACE"] = "workspace";
|
|
17215
|
+
DocumentType2["CONFIG"] = "config";
|
|
17216
|
+
DocumentType2["TEMPLATE"] = "template";
|
|
17217
|
+
DocumentType2["APP"] = "app";
|
|
17218
|
+
DocumentType2["DEV"] = "dev";
|
|
17219
|
+
DocumentType2["APP_DEV"] = "app_dev";
|
|
17220
|
+
DocumentType2["APP_METADATA"] = "app_metadata";
|
|
17221
|
+
DocumentType2["ROLE"] = "role";
|
|
17222
|
+
DocumentType2["MIGRATIONS"] = "migrations";
|
|
17223
|
+
DocumentType2["DEV_INFO"] = "devinfo";
|
|
17224
|
+
DocumentType2["AUTOMATION_LOG"] = "log_au";
|
|
17225
|
+
DocumentType2["ACCOUNT_METADATA"] = "acc_metadata";
|
|
17226
|
+
DocumentType2["PLUGIN"] = "plg";
|
|
17227
|
+
DocumentType2["DATASOURCE"] = "datasource";
|
|
17228
|
+
DocumentType2["DATASOURCE_PLUS"] = "datasource_plus";
|
|
17229
|
+
DocumentType2["APP_BACKUP"] = "backup";
|
|
17230
|
+
DocumentType2["TABLE"] = "ta";
|
|
17231
|
+
DocumentType2["ROW"] = "ro";
|
|
17232
|
+
DocumentType2["AUTOMATION"] = "au";
|
|
17233
|
+
DocumentType2["LINK"] = "li";
|
|
17234
|
+
DocumentType2["WEBHOOK"] = "wh";
|
|
17235
|
+
DocumentType2["INSTANCE"] = "inst";
|
|
17236
|
+
DocumentType2["LAYOUT"] = "layout";
|
|
17237
|
+
DocumentType2["SCREEN"] = "screen";
|
|
17238
|
+
DocumentType2["QUERY"] = "query";
|
|
17239
|
+
DocumentType2["DEPLOYMENTS"] = "deployments";
|
|
17240
|
+
DocumentType2["METADATA"] = "metadata";
|
|
17241
|
+
DocumentType2["MEM_VIEW"] = "view";
|
|
17242
|
+
DocumentType2["USER_FLAG"] = "flag";
|
|
17243
|
+
DocumentType2["AUTOMATION_METADATA"] = "meta_au";
|
|
17244
|
+
DocumentType2["AUDIT_LOG"] = "al";
|
|
17245
|
+
DocumentType2["APP_MIGRATION_METADATA"] = "_design/migrations";
|
|
17246
|
+
DocumentType2["SCIM_LOG"] = "scimlog";
|
|
17247
|
+
DocumentType2["ROW_ACTIONS"] = "ra";
|
|
17248
|
+
return DocumentType2;
|
|
17249
|
+
})(DocumentType || {});
|
|
17250
|
+
var sortedDocumentTypes = Object.values(DocumentType).sort(
|
|
17251
|
+
(a, b) => b.length - a.length
|
|
17252
|
+
// descending
|
|
17253
|
+
);
|
|
17254
|
+
var VirtualDocumentType = /* @__PURE__ */ ((VirtualDocumentType2) => {
|
|
17255
|
+
VirtualDocumentType2["VIEW"] = "view";
|
|
17256
|
+
VirtualDocumentType2["ROW_ACTION"] = "row_action";
|
|
17257
|
+
return VirtualDocumentType2;
|
|
17258
|
+
})(VirtualDocumentType || {});
|
|
17259
|
+
var sortedVirtualDocumentTypes = Object.values(VirtualDocumentType).sort(
|
|
17260
|
+
(a, b) => b.length - a.length
|
|
17261
|
+
// descending
|
|
17262
|
+
);
|
|
17211
17263
|
|
|
17212
17264
|
// ../types/src/documents/global/plugin.ts
|
|
17213
17265
|
var PluginType = /* @__PURE__ */ ((PluginType2) => {
|
|
@@ -17851,7 +17903,8 @@ __export(views_exports, {
|
|
|
17851
17903
|
hasCalculationFields: () => hasCalculationFields,
|
|
17852
17904
|
isBasicViewField: () => isBasicViewField,
|
|
17853
17905
|
isCalculationField: () => isCalculationField,
|
|
17854
|
-
isCalculationView: () => isCalculationView
|
|
17906
|
+
isCalculationView: () => isCalculationView,
|
|
17907
|
+
isVisible: () => isVisible
|
|
17855
17908
|
});
|
|
17856
17909
|
var import_lodash = __toESM(require_lodash());
|
|
17857
17910
|
function isCalculationField(field) {
|
|
@@ -17869,8 +17922,14 @@ function hasCalculationFields(view) {
|
|
|
17869
17922
|
function calculationFields(view) {
|
|
17870
17923
|
return (0, import_lodash.pickBy)(view.schema || {}, isCalculationField);
|
|
17871
17924
|
}
|
|
17872
|
-
function
|
|
17873
|
-
return
|
|
17925
|
+
function isVisible(field) {
|
|
17926
|
+
return field.visible !== false;
|
|
17927
|
+
}
|
|
17928
|
+
function basicFields(view, opts) {
|
|
17929
|
+
const { visible = true } = opts || {};
|
|
17930
|
+
return (0, import_lodash.pickBy)(view.schema || {}, (field) => {
|
|
17931
|
+
return !isCalculationField(field) && (!visible || isVisible(field));
|
|
17932
|
+
});
|
|
17874
17933
|
}
|
|
17875
17934
|
|
|
17876
17935
|
// src/filters.ts
|