@qrvey/utils 1.2.9-37 → 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.
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-
|
|
1
|
+
# [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-38*
|
|
2
2
|
|
|
3
3
|
> Helper, Utils for all Qrvey Projects
|
|
4
4
|
|
|
@@ -2722,47 +2722,50 @@ Gets the format config
|
|
|
2722
2722
|
|
|
2723
2723
|
|
|
2724
2724
|
|
|
2725
|
-
### dist/
|
|
2726
|
-
|
|
2725
|
+
### dist/services/api/getAllDatasets.api.js
|
|
2727
2726
|
|
|
2728
|
-
#### Config()
|
|
2729
2727
|
|
|
2730
|
-
|
|
2731
|
-
Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
|
|
2732
|
-
But for this, is required ask for a property in `snake_case` style
|
|
2728
|
+
#### getAllDatasets(config, pickDatasets)
|
|
2733
2729
|
|
|
2730
|
+
Get a dataset list from a collection of Qrvey IDs
|
|
2734
2731
|
|
|
2735
2732
|
|
|
2736
2733
|
|
|
2737
2734
|
|
|
2735
|
+
##### Parameters
|
|
2738
2736
|
|
|
2739
|
-
|
|
2737
|
+
| Name | Type | Description | |
|
|
2738
|
+
| ---- | ---- | ----------- | -------- |
|
|
2739
|
+
| config | | the widget config. Includes the appid and others configuration properties | |
|
|
2740
|
+
| pickDatasets | | Collection of Qrvey IDs for filtering the request | |
|
|
2740
2741
|
|
|
2741
|
-
```javascript
|
|
2742
|
-
\ @Config() @Prop() settings;
|
|
2743
2742
|
|
|
2744
|
-
someMethod() {
|
|
2745
|
-
this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
|
|
2746
|
-
}
|
|
2747
|
-
```
|
|
2748
2743
|
|
|
2749
2744
|
|
|
2750
2745
|
##### Returns
|
|
2751
2746
|
|
|
2752
2747
|
|
|
2753
|
-
-
|
|
2748
|
+
- a promise
|
|
2754
2749
|
|
|
2755
2750
|
|
|
2756
2751
|
|
|
2757
2752
|
|
|
2758
|
-
### dist/
|
|
2753
|
+
### dist/services/api/getAllQrveys.api.js
|
|
2759
2754
|
|
|
2760
2755
|
|
|
2761
|
-
####
|
|
2756
|
+
#### getAllQrveys(config, params)
|
|
2757
|
+
|
|
2758
|
+
POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
|
|
2759
|
+
|
|
2762
2760
|
|
|
2763
|
-
lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
|
|
2764
2761
|
|
|
2765
2762
|
|
|
2763
|
+
##### Parameters
|
|
2764
|
+
|
|
2765
|
+
| Name | Type | Description | |
|
|
2766
|
+
| ---- | ---- | ----------- | -------- |
|
|
2767
|
+
| config | | Configuration | |
|
|
2768
|
+
| params | | Object for getting precise data | |
|
|
2766
2769
|
|
|
2767
2770
|
|
|
2768
2771
|
|
|
@@ -2770,21 +2773,17 @@ lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom
|
|
|
2770
2773
|
##### Returns
|
|
2771
2774
|
|
|
2772
2775
|
|
|
2773
|
-
-
|
|
2776
|
+
- `Void`
|
|
2774
2777
|
|
|
2775
2778
|
|
|
2776
2779
|
|
|
2777
2780
|
|
|
2778
|
-
### dist/
|
|
2781
|
+
### dist/services/api/getDatasetColumns.api.js
|
|
2779
2782
|
|
|
2780
2783
|
|
|
2781
|
-
####
|
|
2784
|
+
#### getDatasetColumns(qrveyid)
|
|
2782
2785
|
|
|
2783
|
-
|
|
2784
|
-
- In case _cfg_ is a string, first try to make a JSON parse in other case
|
|
2785
|
-
try to find this string as a variable on Windows object
|
|
2786
|
-
- If _cfg_ is a fuction, tis is invoked and parsed
|
|
2787
|
-
- Finally, if is an object, _cfg_ is inmediatly returned
|
|
2786
|
+
Get a dataset by Qrvey ID
|
|
2788
2787
|
|
|
2789
2788
|
|
|
2790
2789
|
|
|
@@ -2793,7 +2792,7 @@ try to find this string as a variable on Windows object
|
|
|
2793
2792
|
|
|
2794
2793
|
| Name | Type | Description | |
|
|
2795
2794
|
| ---- | ---- | ----------- | -------- |
|
|
2796
|
-
|
|
|
2795
|
+
| qrveyid | | The Qrvey ID | |
|
|
2797
2796
|
|
|
2798
2797
|
|
|
2799
2798
|
|
|
@@ -2801,55 +2800,52 @@ try to find this string as a variable on Windows object
|
|
|
2801
2800
|
##### Returns
|
|
2802
2801
|
|
|
2803
2802
|
|
|
2804
|
-
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2803
|
+
- a promise
|
|
2807
2804
|
|
|
2808
2805
|
|
|
2809
|
-
### dist/services/api/getAllDatasets.api.js
|
|
2810
2806
|
|
|
2811
2807
|
|
|
2812
|
-
|
|
2808
|
+
### dist/stencil/decorators/Config.js
|
|
2813
2809
|
|
|
2814
|
-
Get a dataset list from a collection of Qrvey IDs
|
|
2815
2810
|
|
|
2811
|
+
#### Config()
|
|
2816
2812
|
|
|
2813
|
+
Stencil.js - Prop Decorator
|
|
2814
|
+
Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
|
|
2815
|
+
But for this, is required ask for a property in `snake_case` style
|
|
2817
2816
|
|
|
2818
2817
|
|
|
2819
|
-
##### Parameters
|
|
2820
2818
|
|
|
2821
|
-
| Name | Type | Description | |
|
|
2822
|
-
| ---- | ---- | ----------- | -------- |
|
|
2823
|
-
| config | | the widget config. Includes the appid and others configuration properties | |
|
|
2824
|
-
| pickDatasets | | Collection of Qrvey IDs for filtering the request | |
|
|
2825
2819
|
|
|
2826
2820
|
|
|
2827
2821
|
|
|
2822
|
+
##### Examples
|
|
2828
2823
|
|
|
2829
|
-
|
|
2824
|
+
```javascript
|
|
2825
|
+
\ @Config() @Prop() settings;
|
|
2830
2826
|
|
|
2827
|
+
someMethod() {
|
|
2828
|
+
this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
|
|
2829
|
+
}
|
|
2830
|
+
```
|
|
2831
2831
|
|
|
2832
|
-
- a promise
|
|
2833
2832
|
|
|
2833
|
+
##### Returns
|
|
2834
2834
|
|
|
2835
2835
|
|
|
2836
|
+
- `Void`
|
|
2836
2837
|
|
|
2837
|
-
### dist/services/api/getAllQrveys.api.js
|
|
2838
2838
|
|
|
2839
2839
|
|
|
2840
|
-
#### getAllQrveys(config, params)
|
|
2841
2840
|
|
|
2842
|
-
|
|
2841
|
+
### dist/stencil/util/createRef.js
|
|
2843
2842
|
|
|
2844
2843
|
|
|
2844
|
+
#### createRef()
|
|
2845
2845
|
|
|
2846
|
+
lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
|
|
2846
2847
|
|
|
2847
|
-
##### Parameters
|
|
2848
2848
|
|
|
2849
|
-
| Name | Type | Description | |
|
|
2850
|
-
| ---- | ---- | ----------- | -------- |
|
|
2851
|
-
| config | | Configuration | |
|
|
2852
|
-
| params | | Object for getting precise data | |
|
|
2853
2849
|
|
|
2854
2850
|
|
|
2855
2851
|
|
|
@@ -2857,17 +2853,21 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
|
|
|
2857
2853
|
##### Returns
|
|
2858
2854
|
|
|
2859
2855
|
|
|
2860
|
-
-
|
|
2856
|
+
- function - Function to use in ref prop in html elements
|
|
2861
2857
|
|
|
2862
2858
|
|
|
2863
2859
|
|
|
2864
2860
|
|
|
2865
|
-
### dist/
|
|
2861
|
+
### dist/stencil/util/getConfig.js
|
|
2866
2862
|
|
|
2867
2863
|
|
|
2868
|
-
####
|
|
2864
|
+
#### getConfig(cfg)
|
|
2869
2865
|
|
|
2870
|
-
|
|
2866
|
+
verify the Config object type and try to return a parsed Object
|
|
2867
|
+
- In case _cfg_ is a string, first try to make a JSON parse in other case
|
|
2868
|
+
try to find this string as a variable on Windows object
|
|
2869
|
+
- If _cfg_ is a fuction, tis is invoked and parsed
|
|
2870
|
+
- Finally, if is an object, _cfg_ is inmediatly returned
|
|
2871
2871
|
|
|
2872
2872
|
|
|
2873
2873
|
|
|
@@ -2876,7 +2876,7 @@ Get a dataset by Qrvey ID
|
|
|
2876
2876
|
|
|
2877
2877
|
| Name | Type | Description | |
|
|
2878
2878
|
| ---- | ---- | ----------- | -------- |
|
|
2879
|
-
|
|
|
2879
|
+
| cfg | | | |
|
|
2880
2880
|
|
|
2881
2881
|
|
|
2882
2882
|
|
|
@@ -2884,7 +2884,7 @@ Get a dataset by Qrvey ID
|
|
|
2884
2884
|
##### Returns
|
|
2885
2885
|
|
|
2886
2886
|
|
|
2887
|
-
-
|
|
2887
|
+
- `Void`
|
|
2888
2888
|
|
|
2889
2889
|
|
|
2890
2890
|
|
|
@@ -4398,9 +4398,9 @@ Filters and gets a UI Flatten Filters by the given scopes
|
|
|
4398
4398
|
### dist/filters/helpers/ui/getUIValues.js
|
|
4399
4399
|
|
|
4400
4400
|
|
|
4401
|
-
#### getUIValues(filter,
|
|
4402
|
-
|
|
4401
|
+
#### getUIValues(filter, settings)
|
|
4403
4402
|
|
|
4403
|
+
Gets the UI Values from the filter object
|
|
4404
4404
|
|
|
4405
4405
|
|
|
4406
4406
|
|
|
@@ -4409,9 +4409,8 @@ Filters and gets a UI Flatten Filters by the given scopes
|
|
|
4409
4409
|
|
|
4410
4410
|
| Name | Type | Description | |
|
|
4411
4411
|
| ---- | ---- | ----------- | -------- |
|
|
4412
|
-
| filter | |
|
|
4413
|
-
|
|
|
4414
|
-
| rankingGroupIndex | | | |
|
|
4412
|
+
| filter | | The filter object | |
|
|
4413
|
+
| settings | | configuration for this function | |
|
|
4415
4414
|
|
|
4416
4415
|
|
|
4417
4416
|
|
|
@@ -4419,7 +4418,7 @@ Filters and gets a UI Flatten Filters by the given scopes
|
|
|
4419
4418
|
##### Returns
|
|
4420
4419
|
|
|
4421
4420
|
|
|
4422
|
-
-
|
|
4421
|
+
- an array of values
|
|
4423
4422
|
|
|
4424
4423
|
|
|
4425
4424
|
|
package/package.json
CHANGED
|
@@ -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
|
|
21
|
-
* @
|
|
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)}
|
|
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
|
}
|