@kodaris/krubble-components 1.0.52 → 1.0.53
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/custom-elements.json +1811 -192
- package/dist/button/button.js +1 -1
- package/dist/form/select-field/select-field.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/krubble-components.bundled.js +3749 -1866
- package/dist/krubble-components.bundled.js.map +1 -1
- package/dist/krubble-components.bundled.min.js +874 -396
- package/dist/krubble-components.bundled.min.js.map +1 -1
- package/dist/krubble-components.umd.js +4564 -2678
- package/dist/krubble-components.umd.js.map +1 -1
- package/dist/krubble-components.umd.min.js +876 -398
- package/dist/krubble-components.umd.min.js.map +1 -1
- package/dist/table/query.d.ts +63 -0
- package/dist/table/query.d.ts.map +1 -0
- package/dist/table/query.js +1015 -0
- package/dist/table/query.js.map +1 -0
- package/dist/table/table.d.ts +63 -10
- package/dist/table/table.d.ts.map +1 -1
- package/dist/table/table.js +986 -113
- package/dist/table/table.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Filter operator types matching kodaris-ngx operators */
|
|
2
|
+
export type KROperator = 'equals' | 'n_equals' | 'contains' | 'n_contains' | 'starts_with' | 'ends_with' | 'less_than' | 'less_than_equal' | 'greater_than' | 'greater_than_equal' | 'between' | 'in' | 'empty' | 'n_empty';
|
|
3
|
+
/** Filter operator type categorization */
|
|
4
|
+
export type KROperatorType = 'comparison' | 'range' | 'nil' | 'list';
|
|
5
|
+
/** Date specificity for date range expansion */
|
|
6
|
+
export type KRDateSpecificity = 'year' | 'month' | 'day' | 'time' | null;
|
|
7
|
+
/** Range value for BETWEEN operator */
|
|
8
|
+
export interface KRQueryRange {
|
|
9
|
+
start: number | Date | null;
|
|
10
|
+
end: number | Date | null;
|
|
11
|
+
}
|
|
12
|
+
interface KROperatorMeta {
|
|
13
|
+
key: KROperator;
|
|
14
|
+
type: KROperatorType;
|
|
15
|
+
dataTypes: string[];
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
/** Data-driven operator metadata map */
|
|
19
|
+
export declare const KR_OPERATORS: Record<KROperator, KROperatorMeta>;
|
|
20
|
+
/** Returns the list of operators available for a given column type */
|
|
21
|
+
export declare function getOperatorsForType(columnType: string): {
|
|
22
|
+
key: KROperator;
|
|
23
|
+
label: string;
|
|
24
|
+
}[];
|
|
25
|
+
/** Converts a value to a Solr term */
|
|
26
|
+
export declare function termify(value: any, exact?: boolean): string;
|
|
27
|
+
export declare class KRQuery {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: KROperator;
|
|
30
|
+
value: any;
|
|
31
|
+
kql: string;
|
|
32
|
+
text: string;
|
|
33
|
+
type: string;
|
|
34
|
+
specificity: KRDateSpecificity[];
|
|
35
|
+
constructor();
|
|
36
|
+
/** Parse a KQL text string and populate operator/value/values */
|
|
37
|
+
setKql(kql: string): void;
|
|
38
|
+
setOperator(operator: KROperator): void;
|
|
39
|
+
setValue(value: any, specificity?: KRDateSpecificity): void;
|
|
40
|
+
setStart(value: any, specificity?: KRDateSpecificity): void;
|
|
41
|
+
setEnd(value: any, specificity?: KRDateSpecificity): void;
|
|
42
|
+
clear(): void;
|
|
43
|
+
isEmpty(): boolean;
|
|
44
|
+
/** Returns true if the value array contains the given value. Only applies to 'in' operator. */
|
|
45
|
+
has(val: any): boolean;
|
|
46
|
+
/** Adds or removes a value from the 'in' list and rebuilds text/kql. */
|
|
47
|
+
toggle(val: any): void;
|
|
48
|
+
isValid(): boolean;
|
|
49
|
+
/** Converts this filter to a Solr filter field object, or null if invalid */
|
|
50
|
+
toSolrData(): any;
|
|
51
|
+
/** Converts this filter to a DB filter field object, or null if invalid */
|
|
52
|
+
toDbParams(): any;
|
|
53
|
+
private _buildText;
|
|
54
|
+
private _format;
|
|
55
|
+
/** Parse a text value according to this query's type */
|
|
56
|
+
private _parse;
|
|
57
|
+
/** Parse a date string into a UTC Date */
|
|
58
|
+
private _parseDate;
|
|
59
|
+
/** Build a KQL display string from current operator/value state */
|
|
60
|
+
private _buildKql;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/table/query.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAClB,QAAQ,GAAG,UAAU,GACrB,UAAU,GAAG,YAAY,GACzB,aAAa,GAAG,WAAW,GAC3B,WAAW,GAAG,iBAAiB,GAC/B,cAAc,GAAG,oBAAoB,GACrC,SAAS,GAAG,IAAI,GAChB,OAAO,GAAG,SAAS,CAAC;AAExB,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAErE,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;AAEzE,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5B,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wCAAwC;AACxC,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,cAAc,CAe3D,CAAC;AAEF,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAA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