@superleapai/flow-ui 2.3.8 → 2.4.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/components/record-multiselect.js +10 -1
- package/components/record-select.js +10 -1
- package/dist/output.css +1 -1
- package/dist/superleap-flow.js +383 -681
- package/dist/superleap-flow.js.map +1 -1
- package/dist/superleap-flow.min.js +2 -2
- package/package.json +1 -1
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
* @param {string} [config.size] - 'default' | 'large' | 'small'
|
|
153
153
|
* @param {number} [config.initialLimit] - Initial fetch limit (default 50)
|
|
154
154
|
* @param {Array<string>} [config.displayFields] - Fields to display as secondary info (e.g. ["email", "phone"])
|
|
155
|
+
* @param {Object} [config.initialFilter] - Optional filter object to merge with search (e.g. { field: "status", operator: "exact", value: "active" } or { and: [...] })
|
|
155
156
|
* @param {Object} [config.objectSchema] - Optional object type/schema; properties.icon_data { icon?, color? } used for static icon (not used for user; user shows Vivid Avatar)
|
|
156
157
|
* @returns {HTMLElement} Record multiselect container element
|
|
157
158
|
*/
|
|
@@ -166,6 +167,7 @@
|
|
|
166
167
|
var variant = config.variant || "default";
|
|
167
168
|
var size = config.size || "default";
|
|
168
169
|
var initialLimit = config.initialLimit != null ? config.initialLimit : 50;
|
|
170
|
+
var initialFilter = config.initialFilter || null;
|
|
169
171
|
var displayFields = config.displayFields || [];
|
|
170
172
|
|
|
171
173
|
var disabled = config.disabled === true;
|
|
@@ -469,14 +471,21 @@
|
|
|
469
471
|
try {
|
|
470
472
|
if (model && typeof model.select === "function") {
|
|
471
473
|
var q = model.select.apply(model, fields);
|
|
474
|
+
var filters = [];
|
|
475
|
+
if (initialFilter) {
|
|
476
|
+
filters = filters.concat(Array.isArray(initialFilter) ? initialFilter : [initialFilter]);
|
|
477
|
+
}
|
|
472
478
|
if (search && search.trim()) {
|
|
473
|
-
|
|
479
|
+
filters.push({
|
|
474
480
|
or: [
|
|
475
481
|
{ field: "name", operator: "contains", value: search.trim() },
|
|
476
482
|
{ field: "id", operator: "eq", value: search.trim() },
|
|
477
483
|
],
|
|
478
484
|
});
|
|
479
485
|
}
|
|
486
|
+
if (filters.length > 0) {
|
|
487
|
+
q = q.filterBy(filters.length === 1 ? filters[0] : { and: filters });
|
|
488
|
+
}
|
|
480
489
|
var orderBy = ["name"];
|
|
481
490
|
if (objectSlug === "account") orderBy.push("-ParentId");
|
|
482
491
|
return q
|
|
@@ -145,6 +145,7 @@
|
|
|
145
145
|
* @param {string} [config.size] - 'default' | 'large' | 'small'
|
|
146
146
|
* @param {boolean} [config.canClear] - Show clear button when value is set
|
|
147
147
|
* @param {number} [config.initialLimit] - Initial fetch limit (default 50)
|
|
148
|
+
* @param {Object} [config.initialFilter] - Optional filter object to merge with search (e.g. { field: "status", operator: "exact", value: "active" } or { and: [...] })
|
|
148
149
|
* @param {Object} [config.objectSchema] - Optional object type/schema; properties.icon_data { svg?, color? } used for static icon (not used for user; user shows Vivid Avatar)
|
|
149
150
|
* @returns {HTMLElement} Record select container element
|
|
150
151
|
*/
|
|
@@ -159,6 +160,7 @@
|
|
|
159
160
|
var size = config.size || "default";
|
|
160
161
|
var canClear = !!config.canClear;
|
|
161
162
|
var initialLimit = config.initialLimit != null ? config.initialLimit : 50;
|
|
163
|
+
var initialFilter = config.initialFilter || null;
|
|
162
164
|
|
|
163
165
|
var disabled = config.disabled === true;
|
|
164
166
|
var value =
|
|
@@ -484,14 +486,21 @@
|
|
|
484
486
|
try {
|
|
485
487
|
if (model && typeof model.select === "function") {
|
|
486
488
|
var q = model.select.apply(model, fields);
|
|
489
|
+
var filters = [];
|
|
490
|
+
if (initialFilter) {
|
|
491
|
+
filters = filters.concat(Array.isArray(initialFilter) ? initialFilter : [initialFilter]);
|
|
492
|
+
}
|
|
487
493
|
if (search && search.trim()) {
|
|
488
|
-
|
|
494
|
+
filters.push({
|
|
489
495
|
or: [
|
|
490
496
|
{ field: "name", operator: "contains", value: search.trim() },
|
|
491
497
|
{ field: "id", operator: "eq", value: search.trim() },
|
|
492
498
|
],
|
|
493
499
|
});
|
|
494
500
|
}
|
|
501
|
+
if (filters.length > 0) {
|
|
502
|
+
q = q.filterBy(filters.length === 1 ? filters[0] : { and: filters });
|
|
503
|
+
}
|
|
495
504
|
var orderBy = ["name"];
|
|
496
505
|
if (objectSlug === "account") orderBy.push("-ParentId");
|
|
497
506
|
return q
|