@qrvey/utils 1.12.0-8 → 1.12.0-9

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.
@@ -0,0 +1,4 @@
1
+ import { IFilterBuilderConfig } from "./IFilterBuilderConfig";
2
+ export interface IFilterBuilderDisplayEvent extends IFilterBuilderConfig {
3
+ id: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,4 +13,5 @@
13
13
  * IFP-: Structures to Filter Panel
14
14
  */
15
15
  export * from "./IFilterBuilderConfig";
16
+ export * from "./IFilterBuilderDisplayEvent";
16
17
  export * from "./IFilterBuilderSettings";
@@ -29,4 +29,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  };
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
31
  __exportStar(require("./IFilterBuilderConfig"), exports);
32
+ __exportStar(require("./IFilterBuilderDisplayEvent"), exports);
32
33
  __exportStar(require("./IFilterBuilderSettings"), exports);
@@ -1,4 +1,6 @@
1
1
  export interface II18nChartBuilderThreshold {
2
+ dynamic: string;
3
+ fixed: string;
2
4
  title: string;
3
5
  add: string;
4
6
  label: string;
@@ -16,5 +16,7 @@ exports.I18N_CHART_BUILDER_THRESHOLD = {
16
16
  value: "Value",
17
17
  end_value: "End Value",
18
18
  remove: "Remove",
19
+ dynamic: "Dynamic",
20
+ fixed: "Fixed",
19
21
  },
20
22
  };
@@ -9,3 +9,10 @@ export interface ICustomTokensSimple {
9
9
  export interface ICustomTokensComplex {
10
10
  [key: string]: CustomTokens[];
11
11
  }
12
+ export interface ICustomTokensBoxDetail {
13
+ alias: string;
14
+ label: string;
15
+ }
16
+ export interface ICustomTokensBox {
17
+ [key: string]: ICustomTokensBoxDetail[];
18
+ }
@@ -1,4 +1,4 @@
1
- import { ICustomTokensComplex } from "../interfaces";
1
+ import { ICustomTokensBox, ICustomTokensComplex } from "../interfaces";
2
2
  /**
3
3
  * The function `getCustomTokenBoxParse` takes in an object of custom tokens and returns a formatted
4
4
  * list of tokens with aliases and labels.
@@ -7,4 +7,4 @@ import { ICustomTokensComplex } from "../interfaces";
7
7
  * in the object, and the value is an array of tokens within that group.
8
8
  * @returns an object called `tokensList`.
9
9
  */
10
- export declare function getCustomTokenBoxParse(customTokens: ICustomTokensComplex): {};
10
+ export declare function getCustomTokenBoxParse(customTokens: ICustomTokensComplex): ICustomTokensBox;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getCustomtonTokensWithKeys_1 = require("../../src/tokens/getCustomtonTokensWithKeys");
4
+ describe("getCustomtonTokensWithKeys", () => {
5
+ test("should add camelized key to custom tokens", () => {
6
+ const customTokens = [
7
+ { label: "token one", value: "value1" },
8
+ { label: "Token 2", value: "value2", key: "{{token dos}}" },
9
+ { label: "3rd token", value: "value3" },
10
+ ];
11
+ const result = (0, getCustomtonTokensWithKeys_1.getCustomtonTokensWithKeys)(customTokens);
12
+ expect(result).toEqual([
13
+ { label: "token one", value: "value1", key: "tokenOne" },
14
+ { label: "Token 2", value: "value2", key: "tokenDos" },
15
+ { label: "3rd token", value: "value3", key: "3rdToken" },
16
+ ]);
17
+ });
18
+ test("should handle empty array", () => {
19
+ const emptyTokens = [];
20
+ const result = (0, getCustomtonTokensWithKeys_1.getCustomtonTokensWithKeys)(emptyTokens);
21
+ expect(result).toEqual([]);
22
+ });
23
+ });
@@ -0,0 +1,4 @@
1
+ import { IFilterBuilderConfig } from "./IFilterBuilderConfig";
2
+ export interface IFilterBuilderDisplayEvent extends IFilterBuilderConfig {
3
+ id: string;
4
+ }
@@ -13,4 +13,5 @@
13
13
  * IFP-: Structures to Filter Panel
14
14
  */
15
15
  export * from "./IFilterBuilderConfig";
16
+ export * from "./IFilterBuilderDisplayEvent";
16
17
  export * from "./IFilterBuilderSettings";
@@ -13,4 +13,5 @@
13
13
  * IFP-: Structures to Filter Panel
14
14
  */
15
15
  export * from "./IFilterBuilderConfig";
16
+ export * from "./IFilterBuilderDisplayEvent";
16
17
  export * from "./IFilterBuilderSettings";
@@ -1,4 +1,6 @@
1
1
  export interface II18nChartBuilderThreshold {
2
+ dynamic: string;
3
+ fixed: string;
2
4
  title: string;
3
5
  add: string;
4
6
  label: string;
@@ -13,5 +13,7 @@ export const I18N_CHART_BUILDER_THRESHOLD = {
13
13
  value: "Value",
14
14
  end_value: "End Value",
15
15
  remove: "Remove",
16
+ dynamic: "Dynamic",
17
+ fixed: "Fixed",
16
18
  },
17
19
  };
@@ -9,3 +9,10 @@ export interface ICustomTokensSimple {
9
9
  export interface ICustomTokensComplex {
10
10
  [key: string]: CustomTokens[];
11
11
  }
12
+ export interface ICustomTokensBoxDetail {
13
+ alias: string;
14
+ label: string;
15
+ }
16
+ export interface ICustomTokensBox {
17
+ [key: string]: ICustomTokensBoxDetail[];
18
+ }
@@ -1,4 +1,4 @@
1
- import { ICustomTokensComplex } from "../interfaces";
1
+ import { ICustomTokensBox, ICustomTokensComplex } from "../interfaces";
2
2
  /**
3
3
  * The function `getCustomTokenBoxParse` takes in an object of custom tokens and returns a formatted
4
4
  * list of tokens with aliases and labels.
@@ -7,4 +7,4 @@ import { ICustomTokensComplex } from "../interfaces";
7
7
  * in the object, and the value is an array of tokens within that group.
8
8
  * @returns an object called `tokensList`.
9
9
  */
10
- export declare function getCustomTokenBoxParse(customTokens: ICustomTokensComplex): {};
10
+ export declare function getCustomTokenBoxParse(customTokens: ICustomTokensComplex): ICustomTokensBox;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { getCustomtonTokensWithKeys } from "../../src/tokens/getCustomtonTokensWithKeys";
2
+ describe("getCustomtonTokensWithKeys", () => {
3
+ test("should add camelized key to custom tokens", () => {
4
+ const customTokens = [
5
+ { label: "token one", value: "value1" },
6
+ { label: "Token 2", value: "value2", key: "{{token dos}}" },
7
+ { label: "3rd token", value: "value3" },
8
+ ];
9
+ const result = getCustomtonTokensWithKeys(customTokens);
10
+ expect(result).toEqual([
11
+ { label: "token one", value: "value1", key: "tokenOne" },
12
+ { label: "Token 2", value: "value2", key: "tokenDos" },
13
+ { label: "3rd token", value: "value3", key: "3rdToken" },
14
+ ]);
15
+ });
16
+ test("should handle empty array", () => {
17
+ const emptyTokens = [];
18
+ const result = getCustomtonTokensWithKeys(emptyTokens);
19
+ expect(result).toEqual([]);
20
+ });
21
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.12.0-8",
3
+ "version": "1.12.0-9",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",