@limetech/lime-crm-building-blocks 1.98.0 → 1.100.0
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/CHANGELOG.md +14 -0
- package/dist/cjs/{index.esm-a894ac76.js → index.esm-d785eb6e.js} +2 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +68 -179
- package/dist/cjs/limebb-lime-query-filter-and.cjs.entry.js +80 -0
- package/dist/cjs/{limebb-limetype-field_2.cjs.entry.js → limebb-lime-query-filter-builder_3.cjs.entry.js} +108 -6
- package/dist/cjs/limebb-lime-query-filter-comparison_5.cjs.entry.js +705 -0
- package/dist/cjs/limebb-lime-query-filter-expression.cjs.entry.js +45 -0
- package/dist/cjs/limebb-lime-query-filter-or.cjs.entry.js +68 -0
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
- package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/{limetype-1fe0207f.js → limetype-f2e4376e.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +41 -49
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.css +5 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.js +225 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +77 -41
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +35 -46
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +130 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +269 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +19 -25
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +34 -34
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +11 -26
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +1 -1
- package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/summary-popover/summary-popover.js +3 -3
- package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
- package/dist/components/index.esm.js +2 -1
- package/dist/components/lime-query-filter-builder.js +129 -0
- package/dist/components/lime-query-filter-comparison.js +32 -45
- package/dist/components/lime-query-filter-expression.js +315 -0
- package/dist/components/limebb-lime-query-builder.js +73 -182
- package/dist/components/limebb-lime-query-filter-and.js +130 -1
- package/dist/components/limebb-lime-query-filter-builder.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-builder.js +6 -0
- package/dist/components/limebb-lime-query-filter-comparison.js +1 -1
- package/dist/components/limebb-lime-query-filter-expression.js +1 -1
- package/dist/components/limebb-lime-query-filter-group.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-group.js +6 -0
- package/dist/components/limebb-lime-query-filter-not.js +1 -1
- package/dist/components/limebb-lime-query-filter-or.js +118 -1
- package/dist/components/limebb-locale-picker.js +1 -1
- package/dist/components/limebb-mention-group-counter.js +2 -2
- package/dist/components/limebb-percentage-visualizer.js +2 -2
- package/dist/components/limebb-text-editor.js +1 -1
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limetype-field.js +34 -2
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/{index.esm-d8fdeb18.js → index.esm-bb569663.js} +2 -1
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-item_2.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +67 -178
- package/dist/esm/limebb-lime-query-filter-and.entry.js +76 -0
- package/dist/esm/{limebb-limetype-field_2.entry.js → limebb-lime-query-filter-builder_3.entry.js} +107 -6
- package/dist/esm/limebb-lime-query-filter-comparison_5.entry.js +697 -0
- package/dist/esm/limebb-lime-query-filter-expression.entry.js +41 -0
- package/dist/esm/limebb-lime-query-filter-or.entry.js +64 -0
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-loader.entry.js +1 -1
- package/dist/esm/limebb-locale-picker.entry.js +2 -2
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-mention.entry.js +1 -1
- package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
- package/dist/esm/limebb-notification-item.entry.js +2 -2
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-text-editor.entry.js +3 -3
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/{limetype-6e7552a7.js → limetype-c0e041f7.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-a1818969.entry.js → p-03af0e66.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f402184f.entry.js → p-098ee6c1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-42e52b50.entry.js → p-1be0eec7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2aa18c2b.entry.js → p-206575e4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-20bfca36.js +1 -0
- package/dist/lime-crm-building-blocks/p-24aeb928.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-82d33d43.entry.js → p-2faaacbc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d4016891.entry.js → p-2fdcb868.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f52125a0.entry.js → p-3122ea05.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-baf4e428.entry.js → p-3175883d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8c8b7115.entry.js → p-32534eb7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6c1146ca.entry.js → p-36ea13c0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-422f6d51.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-1fba0ade.js → p-4838284a.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-5e4ba110.entry.js → p-5464f0de.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e9d23ef7.entry.js → p-569c86b5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-90e1716a.entry.js → p-5dc574a3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-00da9b24.entry.js → p-631ca5a5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-67dbaa4c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-6d119dab.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-beb0d164.entry.js → p-7271f47a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-34357744.entry.js → p-9031f136.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-91732502.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8c4eb49f.entry.js → p-93cadc1e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3932077b.entry.js → p-9cac4de2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-79d4668a.entry.js → p-a200954f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-b198194a.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d89c44ad.entry.js → p-b9b954d9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3a620226.entry.js → p-cfa1a4ad.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ef8a5266.entry.js → p-e8946134.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9d9f25da.entry.js → p-eb81bceb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-50d3d61a.entry.js → p-ee1b00b9.entry.js} +1 -1
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +5 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-builder.d.ts +50 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +6 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +10 -14
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +60 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +4 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +5 -4
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +1 -0
- package/dist/types/components/lime-query-builder/lime-query.types.d.ts +2 -1
- package/dist/types/components.d.ts +293 -65
- package/package.json +1 -1
- package/dist/cjs/isEqual-e77cce75.js +0 -37
- package/dist/cjs/lime-query.types-bcb63a22.js +0 -61
- package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +0 -278
- package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +0 -239
- package/dist/cjs/limebb-property-selector.cjs.entry.js +0 -234
- package/dist/components/isEqual.js +0 -35
- package/dist/components/lime-query-filter-and.js +0 -408
- package/dist/esm/isEqual-57d0c223.js +0 -35
- package/dist/esm/lime-query.types-f72355e1.js +0 -59
- package/dist/esm/limebb-lime-query-filter-and_5.entry.js +0 -270
- package/dist/esm/limebb-lime-query-value-input.entry.js +0 -235
- package/dist/esm/limebb-property-selector.entry.js +0 -230
- package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-0957b2a6.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3b0a15ec.js +0 -1
- package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +0 -1
- package/dist/lime-crm-building-blocks/p-60971d64.js +0 -1
- package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { b as baseIsEqual } from './_baseIsEqual-28053b81.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Performs a deep comparison between two values to determine if they are
|
|
5
|
-
* equivalent.
|
|
6
|
-
*
|
|
7
|
-
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
8
|
-
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
9
|
-
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
10
|
-
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
11
|
-
* nodes are compared by strict equality, i.e. `===`.
|
|
12
|
-
*
|
|
13
|
-
* @static
|
|
14
|
-
* @memberOf _
|
|
15
|
-
* @since 0.1.0
|
|
16
|
-
* @category Lang
|
|
17
|
-
* @param {*} value The value to compare.
|
|
18
|
-
* @param {*} other The other value to compare.
|
|
19
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* var object = { 'a': 1 };
|
|
23
|
-
* var other = { 'a': 1 };
|
|
24
|
-
*
|
|
25
|
-
* _.isEqual(object, other);
|
|
26
|
-
* // => true
|
|
27
|
-
*
|
|
28
|
-
* object === other;
|
|
29
|
-
* // => false
|
|
30
|
-
*/
|
|
31
|
-
function isEqual(value, other) {
|
|
32
|
-
return baseIsEqual(value, other);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { isEqual as i };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript type definitions for Lime Query DSL
|
|
3
|
-
*
|
|
4
|
-
* These types represent the structure of Lime Query as defined in:
|
|
5
|
-
* - lime-core/lime_query/schema.py
|
|
6
|
-
* - lime-core/lime_filter/schema.py
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Available operators with display metadata
|
|
10
|
-
*/
|
|
11
|
-
const LIME_QUERY_OPERATORS = [
|
|
12
|
-
{ value: '=', label: 'Equals', icon: 'equals' },
|
|
13
|
-
{ value: '!=', label: 'Not Equals', icon: 'not-equal' },
|
|
14
|
-
{
|
|
15
|
-
value: '>',
|
|
16
|
-
label: 'Greater Than',
|
|
17
|
-
icon: 'greater-than',
|
|
18
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
value: '>=',
|
|
22
|
-
label: 'Greater or Equal',
|
|
23
|
-
icon: 'greater-or-equal',
|
|
24
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
value: '<',
|
|
28
|
-
label: 'Less Than',
|
|
29
|
-
icon: 'less-than',
|
|
30
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: '<=',
|
|
34
|
-
label: 'Less or Equal',
|
|
35
|
-
icon: 'less-or-equal',
|
|
36
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
37
|
-
},
|
|
38
|
-
{ value: 'IN', label: 'In List', icon: 'list' },
|
|
39
|
-
{
|
|
40
|
-
value: '?',
|
|
41
|
-
label: 'Contains',
|
|
42
|
-
icon: '-lime-filter-contain',
|
|
43
|
-
applicableTypes: ['string', 'text'],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
value: '=?',
|
|
47
|
-
label: 'Begins With',
|
|
48
|
-
icon: '-lime-filter-begin',
|
|
49
|
-
applicableTypes: ['string', 'text'],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
value: '=$',
|
|
53
|
-
label: 'Ends With',
|
|
54
|
-
icon: '-lime-filter-end',
|
|
55
|
-
applicableTypes: ['string', 'text'],
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
export { LIME_QUERY_OPERATORS as L };
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
import { i as isEqual } from './isEqual-57d0c223.js';
|
|
3
|
-
import { L as LIME_QUERY_OPERATORS } from './lime-query.types-f72355e1.js';
|
|
4
|
-
import './_baseIsEqual-28053b81.js';
|
|
5
|
-
import './_Uint8Array-d6ebd526.js';
|
|
6
|
-
import './_MapCache-af496e9d.js';
|
|
7
|
-
import './_Map-aede53b6.js';
|
|
8
|
-
import './_getTag-d02a95fa.js';
|
|
9
|
-
|
|
10
|
-
const limeQueryFilterAndCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-500));border-radius:0.75rem}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:disc}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none}";
|
|
11
|
-
const LimebbLimeQueryFilterAndStyle0 = limeQueryFilterAndCss;
|
|
12
|
-
|
|
13
|
-
const LimeQueryFilterAndComponent = class {
|
|
14
|
-
constructor(hostRef) {
|
|
15
|
-
registerInstance(this, hostRef);
|
|
16
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
17
|
-
/**
|
|
18
|
-
* The AND expression containing child expressions
|
|
19
|
-
*/
|
|
20
|
-
this.expression = {
|
|
21
|
-
filter_type: 'AND',
|
|
22
|
-
expressions: [],
|
|
23
|
-
};
|
|
24
|
-
this.renderChildExpression = (expression, childIndex) => (h("li", null, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
|
|
25
|
-
this.handleAddChildExpression = () => {
|
|
26
|
-
const updatedExpressionsList = [
|
|
27
|
-
...this.expression.expressions,
|
|
28
|
-
{
|
|
29
|
-
filter_type: 'OR',
|
|
30
|
-
expressions: [
|
|
31
|
-
{
|
|
32
|
-
filter_type: '',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
this.expressionChange.emit({
|
|
38
|
-
filter_type: 'AND',
|
|
39
|
-
expressions: updatedExpressionsList,
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
43
|
-
event.stopPropagation();
|
|
44
|
-
const updatedExpression = event.detail;
|
|
45
|
-
const expressions = [...this.expression.expressions];
|
|
46
|
-
const missingExpression = {
|
|
47
|
-
filter_type: '',
|
|
48
|
-
};
|
|
49
|
-
if (isEqual(updatedExpression, missingExpression)) {
|
|
50
|
-
expressions.splice(updatedChildIndex, 1);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
expressions[updatedChildIndex] = updatedExpression;
|
|
54
|
-
}
|
|
55
|
-
if (expressions.length === 0) {
|
|
56
|
-
this.expressionChange.emit(missingExpression);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
this.expressionChange.emit({
|
|
60
|
-
filter_type: 'AND',
|
|
61
|
-
expressions: expressions,
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
let subheading = 'All of these conditions are true';
|
|
67
|
-
if (this.expression.expressions.length <= 1) {
|
|
68
|
-
subheading = '';
|
|
69
|
-
}
|
|
70
|
-
return (h("div", { key: 'b58b7c54e8f1ded42a965f430cc103e6a344dfbf', class: "expression" }, (this.label || subheading) && (h("limel-header", { key: 'd5c38eef732ccbfff6baec25f007a9accdabdec0', heading: this.label, subheading: subheading })), h("ul", { key: 'aee3cc6799ae69c1df334a826cd708a9b6cf2be6' }, this.expression.expressions.map(this.renderChildExpression), h("li", { key: 'f120182c92d6b9a0b35b21be2d3308f6e62e36ab', class: "add-button" }, this.renderAddChildExpression()))));
|
|
71
|
-
}
|
|
72
|
-
renderAddChildExpression() {
|
|
73
|
-
return (h("limel-button", { label: this.getAddButtonLabel(), icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
74
|
-
}
|
|
75
|
-
getAddButtonLabel() {
|
|
76
|
-
if (this.expression.expressions.length === 0) {
|
|
77
|
-
return 'Add a condition';
|
|
78
|
-
}
|
|
79
|
-
return 'Add another condition';
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
LimeQueryFilterAndComponent.style = LimebbLimeQueryFilterAndStyle0;
|
|
83
|
-
|
|
84
|
-
const limeQueryFilterComparisonCss = ".expression-container{display:flex;flex-direction:row;align-items:flex-start;gap:1rem;flex-wrap:wrap}.expression-container>*{flex-grow:2;width:30%;max-width:calc(100% - 3.25rem)}.expression-container>.operator{flex-grow:1;width:calc(30% + 1rem);min-width:4rem}.expression-container>.remove{flex-grow:0;width:auto;margin-left:auto}@media (max-width: 768px){.expression-container{flex-direction:column}.expression-container>*{width:100%;max-width:100%}.expression-container>.operator{width:100%}.expression-container>.remove{margin-left:0;align-self:flex-end}}";
|
|
85
|
-
const LimebbLimeQueryFilterComparisonStyle0 = limeQueryFilterComparisonCss;
|
|
86
|
-
|
|
87
|
-
const LimeQueryFilterComparisonComponent = class {
|
|
88
|
-
constructor(hostRef) {
|
|
89
|
-
registerInstance(this, hostRef);
|
|
90
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
91
|
-
/**
|
|
92
|
-
* The comparison expression to render
|
|
93
|
-
*/
|
|
94
|
-
this.expression = {
|
|
95
|
-
filter_type: 'comparison',
|
|
96
|
-
property: '',
|
|
97
|
-
operator: '=',
|
|
98
|
-
value: '',
|
|
99
|
-
};
|
|
100
|
-
this.handlePropertyChange = (event) => {
|
|
101
|
-
event.stopPropagation();
|
|
102
|
-
this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { property: event.detail }));
|
|
103
|
-
};
|
|
104
|
-
this.handleOperatorChange = (event) => {
|
|
105
|
-
event.stopPropagation();
|
|
106
|
-
this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { operator: event.detail.value }));
|
|
107
|
-
};
|
|
108
|
-
this.handleValueChange = (event) => {
|
|
109
|
-
event.stopPropagation();
|
|
110
|
-
this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { value: event.detail }));
|
|
111
|
-
};
|
|
112
|
-
this.removeExpression = () => {
|
|
113
|
-
this.expressionChange.emit({ filter_type: '' });
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
render() {
|
|
117
|
-
return (h("div", { key: '618150e84e87cdc234b5eab7cd0ef6443bcb261c', class: "expression" }, this.label && h("limel-header", { key: '7b9a35794777df5556b591ea54d1e63b64833808', heading: this.label }), h("div", { key: '4367741a9383fc268fcfe6dbcc14bea49f20871b', class: "expression-container" }, this.renderPropertySelector(), this.renderOperator(), this.renderValueInput(), h("limel-icon-button", { key: '3ad667258da994636f484c0f7a5649b1e13b063b', class: "remove", icon: "trash", label: "Remove condition", onClick: this.removeExpression }))));
|
|
118
|
-
}
|
|
119
|
-
renderPropertySelector() {
|
|
120
|
-
return (h("limebb-property-selector", { platform: this.platform, context: this.context, label: "Property", limetype: this.limetype, value: this.expression.property, required: true, onChange: this.handlePropertyChange }));
|
|
121
|
-
}
|
|
122
|
-
renderOperator() {
|
|
123
|
-
const operatorHasBeenSet = !!this.expression.operator;
|
|
124
|
-
const options = LIME_QUERY_OPERATORS.map((op) => ({
|
|
125
|
-
text: op.label,
|
|
126
|
-
value: op.value,
|
|
127
|
-
icon: op.icon ? { name: op.icon } : undefined,
|
|
128
|
-
}));
|
|
129
|
-
const selectedOption = options.find((o) => o.value === this.expression.operator);
|
|
130
|
-
return (h("limel-select", { class: "operator", label: "Operator", value: selectedOption, options: options, disabled: !operatorHasBeenSet && !this.expression.property, onChange: this.handleOperatorChange }));
|
|
131
|
-
}
|
|
132
|
-
renderValueInput() {
|
|
133
|
-
if (!this.expression.operator) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
return (h("limebb-lime-query-value-input", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, propertyPath: this.expression.property, operator: this.expression.operator, value: this.expression.value, onChange: this.handleValueChange }));
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
LimeQueryFilterComparisonComponent.style = LimebbLimeQueryFilterComparisonStyle0;
|
|
140
|
-
|
|
141
|
-
const limeQueryFilterExpressionCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem}";
|
|
142
|
-
const LimebbLimeQueryFilterExpressionStyle0 = limeQueryFilterExpressionCss;
|
|
143
|
-
|
|
144
|
-
const LimeQueryFilterExpressionComponent = class {
|
|
145
|
-
constructor(hostRef) {
|
|
146
|
-
registerInstance(this, hostRef);
|
|
147
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
148
|
-
}
|
|
149
|
-
render() {
|
|
150
|
-
var _a;
|
|
151
|
-
const props = {
|
|
152
|
-
platform: this.platform,
|
|
153
|
-
context: this.context,
|
|
154
|
-
label: this.label,
|
|
155
|
-
limetype: this.limetype,
|
|
156
|
-
activeLimetype: this.activeLimetype,
|
|
157
|
-
};
|
|
158
|
-
switch ((_a = this.expression) === null || _a === void 0 ? void 0 : _a.filter_type) {
|
|
159
|
-
case 'AND': {
|
|
160
|
-
return (h("limebb-lime-query-filter-and", Object.assign({}, props, { expression: this.expression })));
|
|
161
|
-
}
|
|
162
|
-
case 'OR': {
|
|
163
|
-
return (h("limebb-lime-query-filter-or", Object.assign({}, props, { expression: this.expression })));
|
|
164
|
-
}
|
|
165
|
-
case 'NOT': {
|
|
166
|
-
return (h("limebb-lime-query-filter-not", Object.assign({}, props, { expression: this.expression })));
|
|
167
|
-
}
|
|
168
|
-
case 'comparison': {
|
|
169
|
-
return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: this.expression })));
|
|
170
|
-
}
|
|
171
|
-
default: {
|
|
172
|
-
// Default to comparison for empty/missing expressions
|
|
173
|
-
// Convert missing expression to empty comparison
|
|
174
|
-
const comparisonExpression = {
|
|
175
|
-
filter_type: 'comparison',
|
|
176
|
-
property: '',
|
|
177
|
-
operator: '=',
|
|
178
|
-
value: '',
|
|
179
|
-
};
|
|
180
|
-
return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: comparisonExpression })));
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
LimeQueryFilterExpressionComponent.style = LimebbLimeQueryFilterExpressionStyle0;
|
|
186
|
-
|
|
187
|
-
const limeQueryFilterNotCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem;padding:1rem;border-left:0.25rem solid rgb(var(--contrast-400));background-color:rgb(var(--contrast-100))}";
|
|
188
|
-
const LimebbLimeQueryFilterNotStyle0 = limeQueryFilterNotCss;
|
|
189
|
-
|
|
190
|
-
const LimeQueryFilterNotComponent = class {
|
|
191
|
-
constructor(hostRef) {
|
|
192
|
-
registerInstance(this, hostRef);
|
|
193
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
194
|
-
this.handleExpressionChange = (event) => {
|
|
195
|
-
event.stopPropagation();
|
|
196
|
-
const missingExpression = {
|
|
197
|
-
filter_type: '',
|
|
198
|
-
};
|
|
199
|
-
if (isEqual(event.detail, missingExpression)) {
|
|
200
|
-
this.expressionChange.emit(missingExpression);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
this.expressionChange.emit({
|
|
204
|
-
filter_type: 'NOT',
|
|
205
|
-
expression: event.detail,
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
render() {
|
|
210
|
-
return (h("div", { key: '005a133401b16d03bdb5d8683b6a51c2c9691dfb', class: "expression" }, this.label && h("limel-header", { key: '31b44cd46fa6cd6fbe19e77df4eef9075523733d', heading: this.label }), h("limebb-lime-query-filter-expression", { key: '487f857eccec79d6a1da6a71aa31be04204b8862', platform: this.platform, context: this.context, label: "Not", limetype: this.limetype, activeLimetype: this.activeLimetype, expression: this.expression.expression, onExpressionChange: this.handleExpressionChange })));
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
LimeQueryFilterNotComponent.style = LimebbLimeQueryFilterNotStyle0;
|
|
214
|
-
|
|
215
|
-
const limeQueryFilterOrCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-200));border:1px solid rgb(var(--contrast-600));border-radius:0.75rem}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:circle}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none;margin-top:0;text-align:right}";
|
|
216
|
-
const LimebbLimeQueryFilterOrStyle0 = limeQueryFilterOrCss;
|
|
217
|
-
|
|
218
|
-
const LimeQueryFilterOrComponent = class {
|
|
219
|
-
constructor(hostRef) {
|
|
220
|
-
registerInstance(this, hostRef);
|
|
221
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
222
|
-
this.renderChildExpression = (expression, childIndex) => {
|
|
223
|
-
const label = this.expression.expressions.length === 1 ? this.label : undefined;
|
|
224
|
-
return (h("li", null, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, label: label, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
|
|
225
|
-
};
|
|
226
|
-
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
227
|
-
event.stopPropagation();
|
|
228
|
-
const updatedExpression = event.detail;
|
|
229
|
-
const expressions = [...this.expression.expressions];
|
|
230
|
-
const missingExpression = {
|
|
231
|
-
filter_type: '',
|
|
232
|
-
};
|
|
233
|
-
if (isEqual(updatedExpression, missingExpression)) {
|
|
234
|
-
expressions.splice(updatedChildIndex, 1);
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
expressions[updatedChildIndex] = updatedExpression;
|
|
238
|
-
}
|
|
239
|
-
if (expressions.length === 0) {
|
|
240
|
-
this.expressionChange.emit(missingExpression);
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
this.expressionChange.emit({
|
|
244
|
-
filter_type: 'OR',
|
|
245
|
-
expressions: expressions,
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
this.handleAddChildExpression = () => {
|
|
249
|
-
const updatedExpressionsList = [
|
|
250
|
-
...this.expression.expressions,
|
|
251
|
-
{
|
|
252
|
-
filter_type: '',
|
|
253
|
-
},
|
|
254
|
-
];
|
|
255
|
-
this.expressionChange.emit({
|
|
256
|
-
filter_type: 'OR',
|
|
257
|
-
expressions: updatedExpressionsList,
|
|
258
|
-
});
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
render() {
|
|
262
|
-
return (h("div", { key: '9a0e6876f32ebcb614ab1ef0ccb122a5a5b8e978', class: "expression" }, this.expression.expressions.length > 1 && (h("limel-header", { key: 'cb1ff04ce7669582f0c4f6afefbce3402876d435', heading: this.label, subheading: "Any of these conditions is true" })), h("ul", { key: '21efcfec20f4ea04105ccbea880dbb9ed551efb9' }, this.expression.expressions.map(this.renderChildExpression), h("li", { key: '541811a52176182be501078c3cf662bbe6a71cda', class: "add-button" }, this.renderAddChildExpression()))));
|
|
263
|
-
}
|
|
264
|
-
renderAddChildExpression() {
|
|
265
|
-
return (h("limel-icon-button", { label: "Add alternative", icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
LimeQueryFilterOrComponent.style = LimebbLimeQueryFilterOrStyle0;
|
|
269
|
-
|
|
270
|
-
export { LimeQueryFilterAndComponent as limebb_lime_query_filter_and, LimeQueryFilterComparisonComponent as limebb_lime_query_filter_comparison, LimeQueryFilterExpressionComponent as limebb_lime_query_filter_expression, LimeQueryFilterNotComponent as limebb_lime_query_filter_not, LimeQueryFilterOrComponent as limebb_lime_query_filter_or };
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
import { T as Te } from './index.esm-d8fdeb18.js';
|
|
3
|
-
import { a as getPropertyFromPath } from './property-resolution-fde2375e.js';
|
|
4
|
-
|
|
5
|
-
const limeQueryValueInputCss = ":host{display:block}.value-input-container{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.mode-toggle{flex-shrink:0;margin-top:0.5rem;opacity:0.7;transition:opacity 0.2s ease}.mode-toggle:hover{opacity:1}.placeholder-input{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.placeholder-preview{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;background-color:rgba(var(--color-blue-light), 0.1);border-radius:var(--border-radius-small);font-size:0.875rem;color:rgb(var(--color-blue-default));border-left:3px solid rgb(var(--color-blue-default))}.placeholder-preview limel-icon{flex-shrink:0;color:rgb(var(--color-blue-default))}.placeholder-preview span{font-family:var(--font-monospace);word-break:break-all}";
|
|
6
|
-
const LimebbLimeQueryValueInputStyle0 = limeQueryValueInputCss;
|
|
7
|
-
|
|
8
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
9
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
11
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
12
|
-
else
|
|
13
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
14
|
-
if (d = decorators[i])
|
|
15
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17
|
-
};
|
|
18
|
-
const LimeQueryValueInput = class {
|
|
19
|
-
constructor(hostRef) {
|
|
20
|
-
registerInstance(this, hostRef);
|
|
21
|
-
this.change = createEvent(this, "change", 7);
|
|
22
|
-
/**
|
|
23
|
-
* Optional label for the input
|
|
24
|
-
*/
|
|
25
|
-
this.label = 'Value';
|
|
26
|
-
this.inputMode = 'value';
|
|
27
|
-
this.handleTextChange = (event) => {
|
|
28
|
-
event.stopPropagation();
|
|
29
|
-
// Try to parse as number for number inputs
|
|
30
|
-
const value = event.detail;
|
|
31
|
-
const numValue = Number(value);
|
|
32
|
-
if (!Number.isNaN(numValue) && value !== '') {
|
|
33
|
-
this.change.emit(numValue);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.change.emit(value);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
this.handleSelectChange = (event) => {
|
|
40
|
-
event.stopPropagation();
|
|
41
|
-
const detail = event.detail;
|
|
42
|
-
if (Array.isArray(detail)) {
|
|
43
|
-
this.change.emit(detail.map((o) => o.value));
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.change.emit(detail === null || detail === void 0 ? void 0 : detail.value);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
this.handleBooleanChange = (event) => {
|
|
50
|
-
event.stopPropagation();
|
|
51
|
-
const detail = event.detail;
|
|
52
|
-
if (!Array.isArray(detail)) {
|
|
53
|
-
// Convert string back to boolean
|
|
54
|
-
this.change.emit((detail === null || detail === void 0 ? void 0 : detail.value) === 'true');
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
this.handleDateChange = (event) => {
|
|
58
|
-
event.stopPropagation();
|
|
59
|
-
// Convert Date to ISO string for storage
|
|
60
|
-
const date = event.detail;
|
|
61
|
-
this.change.emit(date ? date.toISOString() : null);
|
|
62
|
-
};
|
|
63
|
-
this.handleMultiValueChange = (event) => {
|
|
64
|
-
event.stopPropagation();
|
|
65
|
-
// Split by comma and trim whitespace
|
|
66
|
-
const values = event.detail
|
|
67
|
-
.split(',')
|
|
68
|
-
.map((v) => v.trim())
|
|
69
|
-
.filter((v) => v.length > 0);
|
|
70
|
-
this.change.emit(values);
|
|
71
|
-
};
|
|
72
|
-
this.handleModeToggle = () => {
|
|
73
|
-
if (this.inputMode === 'value') {
|
|
74
|
-
// Switching to placeholder mode
|
|
75
|
-
this.inputMode = 'placeholder';
|
|
76
|
-
// Emit placeholder value (empty initially)
|
|
77
|
-
this.change.emit('%activeObject%');
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
// Switching to value mode
|
|
81
|
-
this.inputMode = 'value';
|
|
82
|
-
// Emit empty value
|
|
83
|
-
this.change.emit('');
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
this.handlePlaceholderPropertyChange = (event) => {
|
|
87
|
-
event.stopPropagation();
|
|
88
|
-
const propertyPath = event.detail;
|
|
89
|
-
const placeholderValue = this.buildPlaceholderValue(propertyPath);
|
|
90
|
-
this.change.emit(placeholderValue);
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
componentWillLoad() {
|
|
94
|
-
// Detect if the current value is a placeholder
|
|
95
|
-
if (this.isPlaceholder(this.value)) {
|
|
96
|
-
this.inputMode = 'placeholder';
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
componentWillUpdate() {
|
|
100
|
-
// Update mode if value changes externally
|
|
101
|
-
if (this.isPlaceholder(this.value) &&
|
|
102
|
-
this.inputMode !== 'placeholder') {
|
|
103
|
-
this.inputMode = 'placeholder';
|
|
104
|
-
}
|
|
105
|
-
else if (!this.isPlaceholder(this.value) &&
|
|
106
|
-
this.inputMode === 'placeholder') {
|
|
107
|
-
this.inputMode = 'value';
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
isPlaceholder(value) {
|
|
111
|
-
return typeof value === 'string' && value.startsWith('%activeObject%');
|
|
112
|
-
}
|
|
113
|
-
parsePlaceholderPath(value) {
|
|
114
|
-
if (!this.isPlaceholder(value)) {
|
|
115
|
-
return '';
|
|
116
|
-
}
|
|
117
|
-
// Extract path after %activeObject%. (e.g., "%activeObject%.company.name" → "company.name")
|
|
118
|
-
return value.replace(/^%activeObject%\.?/, '');
|
|
119
|
-
}
|
|
120
|
-
buildPlaceholderValue(propertyPath) {
|
|
121
|
-
if (!propertyPath) {
|
|
122
|
-
return '%activeObject%';
|
|
123
|
-
}
|
|
124
|
-
return `%activeObject%.${propertyPath}`;
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
if (!this.operator) {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
return (h("div", { class: "value-input-container" }, this.renderModeToggle(), this.inputMode === 'placeholder'
|
|
131
|
-
? this.renderPlaceholderInput()
|
|
132
|
-
: this.renderValueInputByType()));
|
|
133
|
-
}
|
|
134
|
-
renderModeToggle() {
|
|
135
|
-
// Only show toggle if activeLimetype is set
|
|
136
|
-
if (!this.activeLimetype) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
const isPlaceholderMode = this.inputMode === 'placeholder';
|
|
140
|
-
const buttonLabel = isPlaceholderMode ? 'Use Value' : 'Use Placeholder';
|
|
141
|
-
const buttonIcon = isPlaceholderMode ? 'text' : 'link';
|
|
142
|
-
return (h("limel-icon-button", { class: "mode-toggle", icon: buttonIcon, label: buttonLabel, onClick: this.handleModeToggle }));
|
|
143
|
-
}
|
|
144
|
-
renderPlaceholderInput() {
|
|
145
|
-
const propertyPath = this.parsePlaceholderPath(this.value);
|
|
146
|
-
return (h("div", { class: "placeholder-input" }, h("limebb-property-selector", { platform: this.platform, context: this.context, limetype: this.activeLimetype, label: "Active Object Property", value: propertyPath, required: false, helperText: "Select property from the active object", onChange: this.handlePlaceholderPropertyChange }), this.isPlaceholder(this.value) && (h("div", { class: "placeholder-preview" }, h("limel-icon", { name: "info", size: "small" }), h("span", null, "Placeholder: ", this.value)))));
|
|
147
|
-
}
|
|
148
|
-
renderValueInputByType() {
|
|
149
|
-
// Special handling for IN operator - always use chip set for arrays
|
|
150
|
-
if (this.operator === 'IN') {
|
|
151
|
-
return this.renderMultiValueInput();
|
|
152
|
-
}
|
|
153
|
-
const property = this.getProperty();
|
|
154
|
-
if (!property) {
|
|
155
|
-
return this.renderTextInput();
|
|
156
|
-
}
|
|
157
|
-
switch (property.type) {
|
|
158
|
-
case 'integer':
|
|
159
|
-
case 'decimal': {
|
|
160
|
-
return this.renderNumberInput(property.type);
|
|
161
|
-
}
|
|
162
|
-
case 'yesno': {
|
|
163
|
-
return this.renderBooleanInput();
|
|
164
|
-
}
|
|
165
|
-
case 'option': {
|
|
166
|
-
return this.renderOptionInput(property);
|
|
167
|
-
}
|
|
168
|
-
case 'date': {
|
|
169
|
-
return this.renderDateInput();
|
|
170
|
-
}
|
|
171
|
-
case 'time': {
|
|
172
|
-
return this.renderTimeInput();
|
|
173
|
-
}
|
|
174
|
-
default: {
|
|
175
|
-
return this.renderTextInput();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
renderTextInput() {
|
|
180
|
-
var _a;
|
|
181
|
-
return (h("limel-input-field", { label: this.label, value: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) || '', placeholder: "Enter value", onChange: this.handleTextChange }));
|
|
182
|
-
}
|
|
183
|
-
renderNumberInput(type) {
|
|
184
|
-
var _a;
|
|
185
|
-
const step = type === 'integer' ? 1 : 0.01;
|
|
186
|
-
return (h("limel-input-field", { label: this.label, type: "number", value: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) || '', step: step, onChange: this.handleTextChange }));
|
|
187
|
-
}
|
|
188
|
-
renderBooleanInput() {
|
|
189
|
-
const options = [
|
|
190
|
-
{ text: 'True', value: 'true' },
|
|
191
|
-
{ text: 'False', value: 'false' },
|
|
192
|
-
];
|
|
193
|
-
const valueAsString = this.value === true || this.value === 'true' ? 'true' : 'false';
|
|
194
|
-
const selectedOption = options.find((o) => o.value === valueAsString);
|
|
195
|
-
return (h("limel-select", { label: this.label, options: options, value: selectedOption, onChange: this.handleBooleanChange }));
|
|
196
|
-
}
|
|
197
|
-
renderOptionInput(property) {
|
|
198
|
-
if (!property.options || property.options.length === 0) {
|
|
199
|
-
return this.renderTextInput();
|
|
200
|
-
}
|
|
201
|
-
const options = property.options.map((opt) => ({
|
|
202
|
-
text: opt.text || opt.key,
|
|
203
|
-
value: opt.key,
|
|
204
|
-
}));
|
|
205
|
-
const selectedOption = options.find((o) => o.value === this.value);
|
|
206
|
-
return (h("limel-select", { label: this.label, options: options, value: selectedOption, onChange: this.handleSelectChange }));
|
|
207
|
-
}
|
|
208
|
-
renderDateInput() {
|
|
209
|
-
// Convert string to Date if needed
|
|
210
|
-
const dateValue = typeof this.value === 'string' ? new Date(this.value) : this.value;
|
|
211
|
-
return (h("limel-date-picker", { label: this.label, value: dateValue, onChange: this.handleDateChange }));
|
|
212
|
-
}
|
|
213
|
-
renderTimeInput() {
|
|
214
|
-
return (h("limel-input-field", { label: this.label, type: "time", value: this.value || '', onChange: this.handleTextChange }));
|
|
215
|
-
}
|
|
216
|
-
renderMultiValueInput() {
|
|
217
|
-
// For IN operator, allow comma-separated values
|
|
218
|
-
const displayValue = Array.isArray(this.value)
|
|
219
|
-
? this.value.join(', ')
|
|
220
|
-
: this.value || '';
|
|
221
|
-
return (h("limel-input-field", { label: this.label + ' (comma-separated)', value: displayValue, placeholder: "e.g., won, lost, tender", onChange: this.handleMultiValueChange }));
|
|
222
|
-
}
|
|
223
|
-
getProperty() {
|
|
224
|
-
if (!this.limetypes || !this.limetype || !this.propertyPath) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
return getPropertyFromPath(this.limetypes, this.limetype, this.propertyPath);
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
__decorate([
|
|
231
|
-
Te()
|
|
232
|
-
], LimeQueryValueInput.prototype, "limetypes", void 0);
|
|
233
|
-
LimeQueryValueInput.style = LimebbLimeQueryValueInputStyle0;
|
|
234
|
-
|
|
235
|
-
export { LimeQueryValueInput as limebb_lime_query_value_input };
|