@lostgradient/cinder 0.9.0 → 0.12.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 +26 -0
- package/components.json +82 -4
- package/dist/components/access-gate/index.js +381 -239
- package/dist/components/chat/builders.d.ts +17 -8
- package/dist/components/chat/conversation-model.d.ts +1 -1
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/chat/index.js +300 -17
- package/dist/components/chat/utilities/conversation.d.ts +6 -6
- package/dist/components/chat-conversation-header/index.js +19 -6
- package/dist/components/chat-conversation-list/index.js +19 -6
- package/dist/components/code-block/code-block.css +15 -9
- package/dist/components/code-block/code-block.variables.js +8 -2
- package/dist/components/confirm-dialog/confirm-dialog.css +2 -0
- package/dist/components/confirm-dialog/confirm-dialog.schema.js +10 -1
- package/dist/components/confirm-dialog/confirm-dialog.types.d.ts +7 -0
- package/dist/components/confirm-dialog/index.js +478 -106
- package/dist/components/connection-indicator/connection-indicator.css +136 -0
- package/dist/components/connection-indicator/connection-indicator.css.d.ts +1 -0
- package/dist/components/connection-indicator/connection-indicator.schema.d.ts +3 -0
- package/dist/components/connection-indicator/connection-indicator.schema.js +89 -0
- package/dist/components/connection-indicator/connection-indicator.svelte.d.ts +21 -0
- package/dist/components/connection-indicator/connection-indicator.types.d.ts +46 -0
- package/dist/components/connection-indicator/connection-indicator.variables.d.ts +2 -0
- package/dist/components/connection-indicator/connection-indicator.variables.js +61 -0
- package/dist/components/connection-indicator/index.d.ts +5 -0
- package/dist/components/connection-indicator/index.js +409 -0
- package/dist/components/container/container.schema.js +4 -4
- package/dist/components/faceted-filter-bar/faceted-filter-bar.schema.js +5 -1
- package/dist/components/faceted-filter-bar/faceted-filter-bar.types.d.ts +2 -0
- package/dist/components/faceted-filter-bar/index.js +40 -31
- package/dist/components/invocation-rule-builder/index.d.ts +1 -1
- package/dist/components/invocation-rule-builder/index.js +305 -150
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +89 -5
- package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +2 -1
- package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +114 -16
- package/dist/components/navigation-bar/index.js +11 -17
- package/dist/components/run-step-timeline/index.d.ts +1 -1
- package/dist/components/run-step-timeline/index.js +1052 -560
- package/dist/components/run-step-timeline/run-step-branch-disclosure.svelte.d.ts +17 -0
- package/dist/components/run-step-timeline/run-step-timeline.css +124 -0
- package/dist/components/run-step-timeline/run-step-timeline.schema.js +873 -350
- package/dist/components/run-step-timeline/run-step-timeline.svelte.d.ts +1 -15
- package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +182 -5
- package/dist/components/run-step-timeline/run-step-timeline.utilities.d.ts +60 -0
- package/dist/components/schedule-builder/index.d.ts +5 -0
- package/dist/components/schedule-builder/index.js +3176 -0
- package/dist/components/schedule-builder/schedule-builder.css +121 -0
- package/dist/components/schedule-builder/schedule-builder.css.d.ts +1 -0
- package/dist/components/schedule-builder/schedule-builder.schema.d.ts +3 -0
- package/dist/components/schedule-builder/schedule-builder.schema.js +141 -0
- package/dist/components/schedule-builder/schedule-builder.svelte.d.ts +22 -0
- package/dist/components/schedule-builder/schedule-builder.types.d.ts +130 -0
- package/dist/components/schedule-builder/schedule-builder.utilities.d.ts +78 -0
- package/dist/components/schedule-builder/schedule-builder.variables.d.ts +2 -0
- package/dist/components/schedule-builder/schedule-builder.variables.js +61 -0
- package/dist/components/tag-input/index.js +22 -4
- package/dist/components/tag-input/tag-input.schema.js +5 -1
- package/dist/components/tag-input/tag-input.types.d.ts +4 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +23069 -20833
- package/dist/server/components/access-gate/index.js +2 -1
- package/dist/server/components/chat/index.js +4 -4
- package/dist/server/components/chat-conversation-header/index.js +5 -5
- package/dist/server/components/chat-conversation-list/index.js +3 -3
- package/dist/server/components/color-field/index.js +2 -2
- package/dist/server/components/confirm-dialog/index.js +7 -2
- package/dist/server/components/connection-indicator/index.js +16 -0
- package/dist/server/components/data-table/index.js +3 -3
- package/dist/server/components/diff-viewer/index.js +4 -3
- package/dist/server/components/faceted-filter-bar/index.js +1 -1
- package/dist/server/components/invocation-rule-builder/index.js +1 -1
- package/dist/server/components/json-schema-editor/index.js +4 -3
- package/dist/server/components/navigation-bar/index.js +1 -1
- package/dist/server/components/review-editor/index.js +4 -3
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/components/schedule-builder/index.js +30 -0
- package/dist/server/components/side-navigation/index.js +2 -2
- package/dist/server/components/table/index.js +3 -3
- package/dist/server/components/tag-input/index.js +1 -1
- package/dist/server/components/time-field/index.js +5 -3
- package/dist/server/index.js +105 -92
- package/dist/server/index.server-0sx92swg.js +9 -0
- package/dist/server/{index.server-mzzb7dnm.js → index.server-2bbwajb2.js} +1 -1
- package/dist/server/{index.server-q7w4jw89.js → index.server-2s5h1d05.js} +2 -2
- package/dist/server/{index.server-dg83ke3k.js → index.server-2zdbz3rj.js} +1 -1
- package/dist/server/{index.server-0jhra85x.js → index.server-3w72dxz7.js} +4 -4
- package/dist/server/{index.server-5tf22d6e.js → index.server-4wx0qven.js} +3 -3
- package/dist/server/{index.server-qh9qzd5t.js → index.server-4x4hgvqe.js} +283 -13
- package/dist/server/{index.server-c6pe4kaf.js → index.server-5gzyqv78.js} +1 -1
- package/dist/server/{index.server-mqt1ngqw.js → index.server-6hnfzc7f.js} +19 -6
- package/dist/server/{index.server-894t97kv.js → index.server-7yvpb6z7.js} +4 -4
- package/dist/server/index.server-be9bpqeh.js +93 -0
- package/dist/server/{index.server-f3z7tpxr.js → index.server-c42b462p.js} +2 -4
- package/dist/server/{index.server-7vyzen5x.js → index.server-c5qv3p61.js} +171 -63
- package/dist/server/index.server-cch0eed5.js +144 -0
- package/dist/server/{index.server-btgb3d56.js → index.server-d5a5ccz7.js} +18 -12
- package/dist/server/index.server-g5jgq3jp.js +793 -0
- package/dist/server/index.server-gmh5ar16.js +2 -0
- package/dist/server/{index.server-0atyznp7.js → index.server-h89zk5ev.js} +7 -7
- package/dist/server/{index.server-jxg42jpz.js → index.server-jdcq5zza.js} +7 -7
- package/dist/server/{index.server-2dga5yzr.js → index.server-jfrssta6.js} +1 -1
- package/dist/server/{index.server-fy068yne.js → index.server-jj76374p.js} +1 -1
- package/dist/server/{index.server-39ne5cd1.js → index.server-pxq277t5.js} +32 -1
- package/dist/server/index.server-qbkxz7r2.js +750 -0
- package/dist/server/{index.server-marjz8ps.js → index.server-tcay903b.js} +3 -2
- package/dist/server/{index.server-yz4k36cw.js → index.server-z7hxtqs1.js} +1 -1
- package/package.json +87 -97
- package/src/components/chat/builders.ts +445 -14
- package/src/components/chat/conversation-model.ts +1 -0
- package/src/components/chat/index.ts +1 -0
- package/src/components/chat/utilities/conversation.ts +33 -15
- package/src/components/code-block/code-block.css +15 -9
- package/src/components/code-block/code-block.variables.json +7 -1
- package/src/components/code-block/code-block.variables.ts +7 -1
- package/src/components/confirm-dialog/confirm-dialog.css +2 -0
- package/src/components/confirm-dialog/confirm-dialog.schema.json +8 -0
- package/src/components/confirm-dialog/confirm-dialog.schema.ts +10 -0
- package/src/components/confirm-dialog/confirm-dialog.svelte +31 -3
- package/src/components/confirm-dialog/confirm-dialog.types.ts +7 -0
- package/src/components/connection-indicator/connection-indicator.css +136 -0
- package/src/components/connection-indicator/connection-indicator.examples.json +31 -0
- package/src/components/connection-indicator/connection-indicator.schema.json +29 -0
- package/src/components/connection-indicator/connection-indicator.schema.ts +36 -0
- package/src/components/connection-indicator/connection-indicator.svelte +63 -0
- package/src/components/connection-indicator/connection-indicator.types.ts +58 -0
- package/src/components/connection-indicator/connection-indicator.variables.json +1 -0
- package/src/components/connection-indicator/connection-indicator.variables.ts +3 -0
- package/src/components/connection-indicator/index.ts +10 -0
- package/src/components/container/container.schema.json +3 -3
- package/src/components/container/container.schema.ts +3 -3
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.json +4 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.ts +4 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.svelte +13 -11
- package/src/components/faceted-filter-bar/faceted-filter-bar.types.ts +2 -0
- package/src/components/invocation-rule-builder/index.ts +4 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +6 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +76 -3
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +83 -3
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +326 -113
- package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +157 -43
- package/src/components/navigation-bar/navigation-bar.svelte +2 -2
- package/src/components/run-step-timeline/index.ts +8 -0
- package/src/components/run-step-timeline/run-step-branch-disclosure.svelte +16 -0
- package/src/components/run-step-timeline/run-step-timeline.css +124 -0
- package/src/components/run-step-timeline/run-step-timeline.examples.json +18 -0
- package/src/components/run-step-timeline/run-step-timeline.schema.json +872 -349
- package/src/components/run-step-timeline/run-step-timeline.schema.ts +931 -349
- package/src/components/run-step-timeline/run-step-timeline.svelte +388 -269
- package/src/components/run-step-timeline/run-step-timeline.types.ts +192 -5
- package/src/components/run-step-timeline/run-step-timeline.utilities.ts +310 -0
- package/src/components/schedule-builder/index.ts +14 -0
- package/src/components/schedule-builder/schedule-builder.css +121 -0
- package/src/components/schedule-builder/schedule-builder.examples.json +31 -0
- package/src/components/schedule-builder/schedule-builder.schema.json +78 -0
- package/src/components/schedule-builder/schedule-builder.schema.ts +86 -0
- package/src/components/schedule-builder/schedule-builder.svelte +629 -0
- package/src/components/schedule-builder/schedule-builder.types.ts +137 -0
- package/src/components/schedule-builder/schedule-builder.utilities.ts +344 -0
- package/src/components/schedule-builder/schedule-builder.variables.json +1 -0
- package/src/components/schedule-builder/schedule-builder.variables.ts +3 -0
- package/src/components/tag-input/tag-input.schema.json +4 -0
- package/src/components/tag-input/tag-input.schema.ts +4 -0
- package/src/components/tag-input/tag-input.svelte +20 -3
- package/src/components/tag-input/tag-input.types.ts +4 -0
- package/src/index.ts +23 -0
- package/src/styles/components.css +2 -0
- package/dist/server/index.server-qk1h0n02.js +0 -393
|
@@ -8,12 +8,20 @@ import { tick } from "svelte";
|
|
|
8
8
|
function Invocation_rule_builder($$renderer, $$props) {
|
|
9
9
|
$$renderer.component(($$renderer2) => {
|
|
10
10
|
const baseId = $.props_id($$renderer2);
|
|
11
|
+
const CONDITIONS_ONLY_OPERATOR_OPTIONS = [
|
|
12
|
+
{ value: "eq", label: "equals" },
|
|
13
|
+
{ value: "gt", label: "greater than" },
|
|
14
|
+
{ value: "lt", label: "less than" },
|
|
15
|
+
{ value: "gte", label: "greater than or equal" },
|
|
16
|
+
{ value: "lte", label: "less than or equal" }
|
|
17
|
+
];
|
|
11
18
|
let {
|
|
12
19
|
rules,
|
|
13
20
|
onchange,
|
|
14
21
|
fieldOptions,
|
|
15
22
|
operatorOptions,
|
|
16
23
|
actionOptions,
|
|
24
|
+
mode = "full",
|
|
17
25
|
readonly = false,
|
|
18
26
|
addRuleLabel = "Add rule",
|
|
19
27
|
addConditionLabel = "Add condition",
|
|
@@ -28,6 +36,59 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
28
36
|
} = $$props;
|
|
29
37
|
const sectionAriaLabel = $.derived(() => ariaLabelledby ? undefined : ariaLabel ?? label ?? "Invocation rules");
|
|
30
38
|
const effectiveReadonly = $.derived(() => readonly || onchange === undefined);
|
|
39
|
+
const conditionsOnly = $.derived(() => mode === "conditions");
|
|
40
|
+
const resolvedOperatorOptions = $.derived(() => conditionsOnly() ? CONDITIONS_ONLY_OPERATOR_OPTIONS : operatorOptions ?? []);
|
|
41
|
+
const resolvedActionOptions = $.derived(() => actionOptions ?? []);
|
|
42
|
+
function fieldValueType(fieldValue) {
|
|
43
|
+
return fieldOptions.find((option) => option.value === fieldValue)?.type ?? "string";
|
|
44
|
+
}
|
|
45
|
+
function fieldEnumOptions(fieldValue) {
|
|
46
|
+
return fieldOptions.find((option) => option.value === fieldValue)?.options ?? [];
|
|
47
|
+
}
|
|
48
|
+
function defaultConditionValue(fieldValue) {
|
|
49
|
+
const type = fieldValueType(fieldValue);
|
|
50
|
+
switch (type) {
|
|
51
|
+
case "boolean":
|
|
52
|
+
return "false";
|
|
53
|
+
case "enum":
|
|
54
|
+
return fieldEnumOptions(fieldValue)[0]?.value ?? "";
|
|
55
|
+
case "number":
|
|
56
|
+
case "string":
|
|
57
|
+
return "";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const NUMBER_LIKE_VALUE_PATTERN = /^([+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d*)?|[+-]?\.?)$/i;
|
|
61
|
+
function isValueValidForFieldType(value, type, fieldValue) {
|
|
62
|
+
switch (type) {
|
|
63
|
+
case "boolean":
|
|
64
|
+
return value === "true" || value === "false";
|
|
65
|
+
case "enum":
|
|
66
|
+
return fieldEnumOptions(fieldValue).some((option) => option.value === value);
|
|
67
|
+
case "number":
|
|
68
|
+
return value === "" || value.trim() !== "" && NUMBER_LIKE_VALUE_PATTERN.test(value.trim());
|
|
69
|
+
case "string":
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function isConditionsOnlyOperator(operator) {
|
|
74
|
+
return CONDITIONS_ONLY_OPERATOR_OPTIONS.some((option) => option.value === operator);
|
|
75
|
+
}
|
|
76
|
+
function displayOperator(operator) {
|
|
77
|
+
return conditionsOnly() && !isConditionsOnlyOperator(operator) ? "eq" : operator;
|
|
78
|
+
}
|
|
79
|
+
function emitChange(nextRules, change) {
|
|
80
|
+
const rulesToEmit = conditionsOnly() ? nextRules.map((rule) => ({
|
|
81
|
+
...rule,
|
|
82
|
+
actions: [],
|
|
83
|
+
conditions: rule.conditions.map((condition) => {
|
|
84
|
+
const operator = isConditionsOnlyOperator(condition.operator) ? condition.operator : "eq";
|
|
85
|
+
const type = fieldValueType(condition.field);
|
|
86
|
+
const value = isValueValidForFieldType(condition.value, type, condition.field) ? condition.value : defaultConditionValue(condition.field);
|
|
87
|
+
return operator === condition.operator && value === condition.value ? condition : { ...condition, operator, value };
|
|
88
|
+
})
|
|
89
|
+
})) : nextRules;
|
|
90
|
+
onchange?.(rulesToEmit, change);
|
|
91
|
+
}
|
|
31
92
|
let announcement = "";
|
|
32
93
|
let ruleLabelDrafts = {};
|
|
33
94
|
function announce(message) {
|
|
@@ -54,13 +115,13 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
54
115
|
}
|
|
55
116
|
];
|
|
56
117
|
const change = { type: "add-rule", ruleId };
|
|
57
|
-
|
|
118
|
+
emitChange(nextRules, change);
|
|
58
119
|
announce("Rule added.");
|
|
59
120
|
}
|
|
60
121
|
function handleRemoveRule(ruleId, ruleLabel, ruleIndex) {
|
|
61
122
|
const nextRules = rules.filter((rule) => rule.id !== ruleId);
|
|
62
123
|
const change = { type: "remove-rule", ruleId };
|
|
63
|
-
|
|
124
|
+
emitChange(nextRules, change);
|
|
64
125
|
announce(`${ruleLabel} removed.`);
|
|
65
126
|
tick().then(() => {
|
|
66
127
|
const targetIndex = ruleIndex > 0 ? ruleIndex - 1 : 0;
|
|
@@ -77,7 +138,7 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
77
138
|
const [moved] = nextRules.splice(fromIndex, 1);
|
|
78
139
|
nextRules.splice(toIndex, 0, moved);
|
|
79
140
|
const change = { type: "move-rule", ruleId, fromIndex, toIndex };
|
|
80
|
-
|
|
141
|
+
emitChange(nextRules, change);
|
|
81
142
|
announce(`${moved.label} moved to position ${toIndex + 1} of ${nextRules.length}.`);
|
|
82
143
|
}
|
|
83
144
|
function handleRenameRule(ruleId, label2) {
|
|
@@ -89,7 +150,7 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
89
150
|
return;
|
|
90
151
|
const nextRules = updateRules(ruleId, (rule) => ({ ...rule, label: nextLabel }));
|
|
91
152
|
const change = { type: "rename-rule", ruleId };
|
|
92
|
-
|
|
153
|
+
emitChange(nextRules, change);
|
|
93
154
|
}
|
|
94
155
|
function ruleLabelDraft(rule) {
|
|
95
156
|
const draft = ruleLabelDrafts[rule.id];
|
|
@@ -98,7 +159,8 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
98
159
|
function handleAddCondition(ruleId) {
|
|
99
160
|
const conditionId = generateId();
|
|
100
161
|
const firstField = fieldOptions[0]?.value ?? "";
|
|
101
|
-
const firstOperator =
|
|
162
|
+
const firstOperator = resolvedOperatorOptions()[0]?.value ?? "";
|
|
163
|
+
const initialValue = conditionsOnly() ? defaultConditionValue(firstField) : "";
|
|
102
164
|
const nextRules = updateRules(ruleId, (rule) => ({
|
|
103
165
|
...rule,
|
|
104
166
|
conditions: [
|
|
@@ -107,12 +169,12 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
107
169
|
id: conditionId,
|
|
108
170
|
field: firstField,
|
|
109
171
|
operator: firstOperator,
|
|
110
|
-
value:
|
|
172
|
+
value: initialValue
|
|
111
173
|
}
|
|
112
174
|
]
|
|
113
175
|
}));
|
|
114
176
|
const change = { type: "add-condition", ruleId, conditionId };
|
|
115
|
-
|
|
177
|
+
emitChange(nextRules, change);
|
|
116
178
|
announce("Condition added.");
|
|
117
179
|
}
|
|
118
180
|
function handleRemoveCondition(ruleId, conditionId, conditionIndex, ruleIndex) {
|
|
@@ -121,7 +183,7 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
121
183
|
conditions: rule.conditions.filter((condition) => condition.id !== conditionId)
|
|
122
184
|
}));
|
|
123
185
|
const change = { type: "remove-condition", ruleId, conditionId };
|
|
124
|
-
|
|
186
|
+
emitChange(nextRules, change);
|
|
125
187
|
announce("Condition removed.");
|
|
126
188
|
tick().then(() => {
|
|
127
189
|
const ruleEl = document.querySelector(`[data-irb-region="${baseId}"] [data-irb-rule="${ruleIndex}"]`);
|
|
@@ -134,20 +196,29 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
134
196
|
function handleUpdateCondition(ruleId, conditionId, field, value) {
|
|
135
197
|
const nextRules = updateRules(ruleId, (rule) => ({
|
|
136
198
|
...rule,
|
|
137
|
-
conditions: rule.conditions.map((condition) =>
|
|
199
|
+
conditions: rule.conditions.map((condition) => {
|
|
200
|
+
if (condition.id !== conditionId)
|
|
201
|
+
return condition;
|
|
202
|
+
if (field === "field" && conditionsOnly()) {
|
|
203
|
+
const nextType = fieldValueType(value);
|
|
204
|
+
const nextValue = isValueValidForFieldType(condition.value, nextType, value) ? condition.value : defaultConditionValue(value);
|
|
205
|
+
return { ...condition, field: value, value: nextValue };
|
|
206
|
+
}
|
|
207
|
+
return { ...condition, [field]: value };
|
|
208
|
+
})
|
|
138
209
|
}));
|
|
139
210
|
const change = { type: "update-condition", ruleId, conditionId, field };
|
|
140
|
-
|
|
211
|
+
emitChange(nextRules, change);
|
|
141
212
|
}
|
|
142
213
|
function handleAddAction(ruleId) {
|
|
143
214
|
const actionId = generateId();
|
|
144
|
-
const firstTarget =
|
|
215
|
+
const firstTarget = resolvedActionOptions()[0]?.value ?? "";
|
|
145
216
|
const nextRules = updateRules(ruleId, (rule) => ({
|
|
146
217
|
...rule,
|
|
147
218
|
actions: [...rule.actions, { id: actionId, target: firstTarget }]
|
|
148
219
|
}));
|
|
149
220
|
const change = { type: "add-action", ruleId, actionId };
|
|
150
|
-
|
|
221
|
+
emitChange(nextRules, change);
|
|
151
222
|
announce("Action added.");
|
|
152
223
|
}
|
|
153
224
|
function handleRemoveAction(ruleId, actionId, actionIndex, ruleIndex) {
|
|
@@ -156,7 +227,7 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
156
227
|
actions: rule.actions.filter((action) => action.id !== actionId)
|
|
157
228
|
}));
|
|
158
229
|
const change = { type: "remove-action", ruleId, actionId };
|
|
159
|
-
|
|
230
|
+
emitChange(nextRules, change);
|
|
160
231
|
announce("Action removed.");
|
|
161
232
|
tick().then(() => {
|
|
162
233
|
const ruleEl = document.querySelector(`[data-irb-region="${baseId}"] [data-irb-rule="${ruleIndex}"]`);
|
|
@@ -172,16 +243,17 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
172
243
|
actions: rule.actions.map((action) => action.id === actionId ? { ...action, target } : action)
|
|
173
244
|
}));
|
|
174
245
|
const change = { type: "update-action", ruleId, actionId };
|
|
175
|
-
|
|
246
|
+
emitChange(nextRules, change);
|
|
176
247
|
}
|
|
177
248
|
function fieldLabel(value) {
|
|
178
249
|
return fieldOptions.find((option) => option.value === value)?.label ?? value;
|
|
179
250
|
}
|
|
180
251
|
function operatorLabel(value) {
|
|
181
|
-
|
|
252
|
+
const displayValue = displayOperator(value);
|
|
253
|
+
return resolvedOperatorOptions().find((option) => option.value === displayValue)?.label ?? displayValue;
|
|
182
254
|
}
|
|
183
255
|
function actionTargetLabel(value) {
|
|
184
|
-
return
|
|
256
|
+
return resolvedActionOptions().find((option) => option.value === value)?.label ?? value;
|
|
185
257
|
}
|
|
186
258
|
function conditionSummary(condition) {
|
|
187
259
|
return `${fieldLabel(condition.field)} ${operatorLabel(condition.operator)} "${condition.value}"`;
|
|
@@ -266,11 +338,11 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
266
338
|
$$renderer2.select({
|
|
267
339
|
class: "cinder-invocation-rule-builder__condition-select",
|
|
268
340
|
"aria-label": `Operator for condition ${conditionIndex + 1} of ${rule.label}`,
|
|
269
|
-
value: condition.operator,
|
|
341
|
+
value: displayOperator(condition.operator),
|
|
270
342
|
onchange: (event) => handleUpdateCondition(rule.id, condition.id, "operator", event.target.value)
|
|
271
343
|
}, ($$renderer3) => {
|
|
272
344
|
$$renderer3.push(`<!--[-->`);
|
|
273
|
-
const each_array_4 = $.ensure_array_like(
|
|
345
|
+
const each_array_4 = $.ensure_array_like(resolvedOperatorOptions());
|
|
274
346
|
for (let $$index_2 = 0, $$length3 = each_array_4.length;$$index_2 < $$length3; $$index_2++) {
|
|
275
347
|
let option = each_array_4[$$index_2];
|
|
276
348
|
$$renderer3.option({ value: option.value }, ($$renderer4) => {
|
|
@@ -279,63 +351,99 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
279
351
|
}
|
|
280
352
|
$$renderer3.push(`<!--]-->`);
|
|
281
353
|
});
|
|
282
|
-
$$renderer2.push(`
|
|
354
|
+
$$renderer2.push(` `);
|
|
355
|
+
if (conditionsOnly() && fieldValueType(condition.field) === "number") {
|
|
356
|
+
$$renderer2.push("<!--[0-->");
|
|
357
|
+
$$renderer2.push(`<input type="number" class="cinder-invocation-rule-builder__condition-value"${$.attr("aria-label", `Value for condition ${conditionIndex + 1} of ${rule.label}`)} placeholder="Value to compare"${$.attr("value", condition.value)}/>`);
|
|
358
|
+
} else if (conditionsOnly() && fieldValueType(condition.field) === "boolean") {
|
|
359
|
+
$$renderer2.push("<!--[1-->");
|
|
360
|
+
$$renderer2.push(`<input type="checkbox" class="cinder-invocation-rule-builder__condition-value-checkbox"${$.attr("aria-label", `Value for condition ${conditionIndex + 1} of ${rule.label}`)}${$.attr("checked", condition.value === "true", true)}/>`);
|
|
361
|
+
} else if (conditionsOnly() && fieldValueType(condition.field) === "enum") {
|
|
362
|
+
$$renderer2.push("<!--[2-->");
|
|
363
|
+
$$renderer2.select({
|
|
364
|
+
class: "cinder-invocation-rule-builder__condition-select cinder-invocation-rule-builder__condition-value-select",
|
|
365
|
+
"aria-label": `Value for condition ${conditionIndex + 1} of ${rule.label}`,
|
|
366
|
+
value: condition.value,
|
|
367
|
+
onchange: (event) => handleUpdateCondition(rule.id, condition.id, "value", event.target.value)
|
|
368
|
+
}, ($$renderer3) => {
|
|
369
|
+
$$renderer3.push(`<!--[-->`);
|
|
370
|
+
const each_array_5 = $.ensure_array_like(fieldEnumOptions(condition.field));
|
|
371
|
+
for (let $$index_3 = 0, $$length3 = each_array_5.length;$$index_3 < $$length3; $$index_3++) {
|
|
372
|
+
let option = each_array_5[$$index_3];
|
|
373
|
+
$$renderer3.option({ value: option.value }, ($$renderer4) => {
|
|
374
|
+
$$renderer4.push(`${$.escape(option.label)}`);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
$$renderer3.push(`<!--]-->`);
|
|
378
|
+
});
|
|
379
|
+
} else {
|
|
380
|
+
$$renderer2.push("<!--[-1-->");
|
|
381
|
+
$$renderer2.push(`<input type="text" class="cinder-invocation-rule-builder__condition-value"${$.attr("aria-label", `Value for condition ${conditionIndex + 1} of ${rule.label}`)} placeholder="Value to compare"${$.attr("value", condition.value)}/>`);
|
|
382
|
+
}
|
|
383
|
+
$$renderer2.push(`<!--]--> <button type="button" class="cinder-invocation-rule-builder__icon-btn"${$.attr("aria-label", `Remove condition ${conditionIndex + 1} of ${rule.label}`)} data-irb-condition-remove=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="2" fill="none"></path></svg></button></div>`);
|
|
283
384
|
}
|
|
284
385
|
$$renderer2.push(`<!--]--></div> <button type="button" class="cinder-invocation-rule-builder__add-btn"${$.attr("aria-label", `${addConditionLabel} to ${rule.label}`)} data-irb-add-condition="">+ ${$.escape(addConditionLabel)}</button>`);
|
|
285
386
|
}
|
|
286
|
-
$$renderer2.push(`<!--]--></div>
|
|
287
|
-
if (
|
|
288
|
-
$$renderer2.push("<!--[0-->");
|
|
289
|
-
$$renderer2.push(`<p class="cinder-invocation-rule-builder__validation" role="status">Add at least one action for this rule.</p>`);
|
|
290
|
-
} else {
|
|
291
|
-
$$renderer2.push("<!--[-1-->");
|
|
292
|
-
}
|
|
293
|
-
$$renderer2.push(`<!--]--> `);
|
|
294
|
-
if (effectiveReadonly()) {
|
|
387
|
+
$$renderer2.push(`<!--]--></div> `);
|
|
388
|
+
if (mode === "full") {
|
|
295
389
|
$$renderer2.push("<!--[0-->");
|
|
296
|
-
$$renderer2.push(`<div class="cinder-invocation-rule-
|
|
297
|
-
if (rule.actions.length === 0) {
|
|
390
|
+
$$renderer2.push(`<div><span${$.attr("id", `${baseId}-rule-${ruleIndex}-actions-label`)} class="cinder-invocation-rule-builder__section-heading">Actions</span> `);
|
|
391
|
+
if (!effectiveReadonly() && rule.actions.length === 0) {
|
|
298
392
|
$$renderer2.push("<!--[0-->");
|
|
299
|
-
$$renderer2.push(`<p class="cinder-invocation-rule-
|
|
393
|
+
$$renderer2.push(`<p class="cinder-invocation-rule-builder__validation" role="status">Add at least one action for this rule.</p>`);
|
|
300
394
|
} else {
|
|
301
395
|
$$renderer2.push("<!--[-1-->");
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
396
|
+
}
|
|
397
|
+
$$renderer2.push(`<!--]--> `);
|
|
398
|
+
if (effectiveReadonly()) {
|
|
399
|
+
$$renderer2.push("<!--[0-->");
|
|
400
|
+
$$renderer2.push(`<div class="cinder-invocation-rule-builder__summary"${$.attr("aria-label", `Actions for ${rule.label}`)}>`);
|
|
401
|
+
if (rule.actions.length === 0) {
|
|
402
|
+
$$renderer2.push("<!--[0-->");
|
|
403
|
+
$$renderer2.push(`<p class="cinder-invocation-rule-builder__empty">No actions configured.</p>`);
|
|
404
|
+
} else {
|
|
405
|
+
$$renderer2.push("<!--[-1-->");
|
|
406
|
+
$$renderer2.push(`<!--[-->`);
|
|
407
|
+
const each_array_6 = $.ensure_array_like(rule.actions);
|
|
408
|
+
for (let $$index_5 = 0, $$length2 = each_array_6.length;$$index_5 < $$length2; $$index_5++) {
|
|
409
|
+
let action = each_array_6[$$index_5];
|
|
410
|
+
$$renderer2.push(`<div class="cinder-invocation-rule-builder__summary-row">${$.escape(actionSummary(action))}</div>`);
|
|
411
|
+
}
|
|
412
|
+
$$renderer2.push(`<!--]-->`);
|
|
307
413
|
}
|
|
308
|
-
$$renderer2.push(`<!--]
|
|
414
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
415
|
+
} else {
|
|
416
|
+
$$renderer2.push("<!--[-1-->");
|
|
417
|
+
$$renderer2.push(`<div class="cinder-invocation-rule-builder__actions" role="list"${$.attr("aria-labelledby", `${baseId}-rule-${ruleIndex}-actions-label`)}><!--[-->`);
|
|
418
|
+
const each_array_7 = $.ensure_array_like(rule.actions);
|
|
419
|
+
for (let actionIndex = 0, $$length2 = each_array_7.length;actionIndex < $$length2; actionIndex++) {
|
|
420
|
+
let action = each_array_7[actionIndex];
|
|
421
|
+
$$renderer2.push(`<div class="cinder-invocation-rule-builder__action" role="listitem">`);
|
|
422
|
+
$$renderer2.select({
|
|
423
|
+
class: "cinder-invocation-rule-builder__action-select",
|
|
424
|
+
"aria-label": `Action ${actionIndex + 1} target for ${rule.label}`,
|
|
425
|
+
value: action.target,
|
|
426
|
+
onchange: (event) => handleUpdateAction(rule.id, action.id, event.target.value)
|
|
427
|
+
}, ($$renderer3) => {
|
|
428
|
+
$$renderer3.push(`<!--[-->`);
|
|
429
|
+
const each_array_8 = $.ensure_array_like(resolvedActionOptions());
|
|
430
|
+
for (let $$index_6 = 0, $$length3 = each_array_8.length;$$index_6 < $$length3; $$index_6++) {
|
|
431
|
+
let option = each_array_8[$$index_6];
|
|
432
|
+
$$renderer3.option({ value: option.value }, ($$renderer4) => {
|
|
433
|
+
$$renderer4.push(`${$.escape(option.label)}`);
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
$$renderer3.push(`<!--]-->`);
|
|
437
|
+
});
|
|
438
|
+
$$renderer2.push(` <button type="button" class="cinder-invocation-rule-builder__icon-btn"${$.attr("aria-label", `Remove action ${actionIndex + 1} of ${rule.label}`)} data-irb-action-remove=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="2" fill="none"></path></svg></button></div>`);
|
|
439
|
+
}
|
|
440
|
+
$$renderer2.push(`<!--]--></div> <button type="button" class="cinder-invocation-rule-builder__add-btn"${$.attr("aria-label", `${addActionLabel} to ${rule.label}`)} data-irb-add-action="">+ ${$.escape(addActionLabel)}</button>`);
|
|
309
441
|
}
|
|
310
442
|
$$renderer2.push(`<!--]--></div>`);
|
|
311
443
|
} else {
|
|
312
444
|
$$renderer2.push("<!--[-1-->");
|
|
313
|
-
$$renderer2.push(`<div class="cinder-invocation-rule-builder__actions" role="list"${$.attr("aria-labelledby", `${baseId}-rule-${ruleIndex}-actions-label`)}><!--[-->`);
|
|
314
|
-
const each_array_6 = $.ensure_array_like(rule.actions);
|
|
315
|
-
for (let actionIndex = 0, $$length2 = each_array_6.length;actionIndex < $$length2; actionIndex++) {
|
|
316
|
-
let action = each_array_6[actionIndex];
|
|
317
|
-
$$renderer2.push(`<div class="cinder-invocation-rule-builder__action" role="listitem">`);
|
|
318
|
-
$$renderer2.select({
|
|
319
|
-
class: "cinder-invocation-rule-builder__action-select",
|
|
320
|
-
"aria-label": `Action ${actionIndex + 1} target for ${rule.label}`,
|
|
321
|
-
value: action.target,
|
|
322
|
-
onchange: (event) => handleUpdateAction(rule.id, action.id, event.target.value)
|
|
323
|
-
}, ($$renderer3) => {
|
|
324
|
-
$$renderer3.push(`<!--[-->`);
|
|
325
|
-
const each_array_7 = $.ensure_array_like(actionOptions);
|
|
326
|
-
for (let $$index_5 = 0, $$length3 = each_array_7.length;$$index_5 < $$length3; $$index_5++) {
|
|
327
|
-
let option = each_array_7[$$index_5];
|
|
328
|
-
$$renderer3.option({ value: option.value }, ($$renderer4) => {
|
|
329
|
-
$$renderer4.push(`${$.escape(option.label)}`);
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
$$renderer3.push(`<!--]-->`);
|
|
333
|
-
});
|
|
334
|
-
$$renderer2.push(` <button type="button" class="cinder-invocation-rule-builder__icon-btn"${$.attr("aria-label", `Remove action ${actionIndex + 1} of ${rule.label}`)} data-irb-action-remove=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="2" fill="none"></path></svg></button></div>`);
|
|
335
|
-
}
|
|
336
|
-
$$renderer2.push(`<!--]--></div> <button type="button" class="cinder-invocation-rule-builder__add-btn"${$.attr("aria-label", `${addActionLabel} to ${rule.label}`)} data-irb-add-action="">+ ${$.escape(addActionLabel)}</button>`);
|
|
337
445
|
}
|
|
338
|
-
$$renderer2.push(`<!--]--></div
|
|
446
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
339
447
|
}
|
|
340
448
|
$$renderer2.push(`<!--]--> `);
|
|
341
449
|
if (!effectiveReadonly()) {
|
|
@@ -359,4 +467,4 @@ function Invocation_rule_builder($$renderer, $$props) {
|
|
|
359
467
|
var invocation_rule_builder_default = Invocation_rule_builder;
|
|
360
468
|
export { Invocation_rule_builder, invocation_rule_builder_default };
|
|
361
469
|
|
|
362
|
-
//# debugId=
|
|
470
|
+
//# debugId=A800062A9676887364756E2164756E21
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon
|
|
3
|
+
} from "./index.server-s4ynjgep.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/lucide-svelte/dist/icons/loader.svelte
|
|
6
|
+
import * as $ from "svelte/internal/server";
|
|
7
|
+
function Loader($$renderer, $$props) {
|
|
8
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
9
|
+
const iconNode = [
|
|
10
|
+
["path", { d: "M12 2v4" }],
|
|
11
|
+
["path", { d: "m16.2 7.8 2.9-2.9" }],
|
|
12
|
+
["path", { d: "M18 12h4" }],
|
|
13
|
+
["path", { d: "m16.2 16.2 2.9 2.9" }],
|
|
14
|
+
["path", { d: "M12 18v4" }],
|
|
15
|
+
["path", { d: "m4.9 19.1 2.9-2.9" }],
|
|
16
|
+
["path", { d: "M2 12h4" }],
|
|
17
|
+
["path", { d: "m4.9 4.9 2.9 2.9" }]
|
|
18
|
+
];
|
|
19
|
+
Icon($$renderer, $.spread_props([
|
|
20
|
+
{ name: "loader" },
|
|
21
|
+
$$sanitized_props,
|
|
22
|
+
{
|
|
23
|
+
iconNode,
|
|
24
|
+
children: ($$renderer2) => {
|
|
25
|
+
$$renderer2.push(`<!--[-->`);
|
|
26
|
+
$.slot($$renderer2, $$props, "default", {}, null);
|
|
27
|
+
$$renderer2.push(`<!--]-->`);
|
|
28
|
+
},
|
|
29
|
+
$$slots: { default: true }
|
|
30
|
+
}
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/lucide-svelte/dist/icons/refresh-ccw-dot.svelte
|
|
35
|
+
import * as $2 from "svelte/internal/server";
|
|
36
|
+
function Refresh_ccw_dot($$renderer, $$props) {
|
|
37
|
+
const $$sanitized_props = $2.sanitize_props($$props);
|
|
38
|
+
const iconNode = [
|
|
39
|
+
["path", { d: "M3 2v6h6" }],
|
|
40
|
+
["path", { d: "M21 12A9 9 0 0 0 6 5.3L3 8" }],
|
|
41
|
+
["path", { d: "M21 22v-6h-6" }],
|
|
42
|
+
["path", { d: "M3 12a9 9 0 0 0 15 6.7l3-2.7" }],
|
|
43
|
+
["circle", { cx: "12", cy: "12", r: "1" }]
|
|
44
|
+
];
|
|
45
|
+
Icon($$renderer, $2.spread_props([
|
|
46
|
+
{ name: "refresh-ccw-dot" },
|
|
47
|
+
$$sanitized_props,
|
|
48
|
+
{
|
|
49
|
+
iconNode,
|
|
50
|
+
children: ($$renderer2) => {
|
|
51
|
+
$$renderer2.push(`<!--[-->`);
|
|
52
|
+
$2.slot($$renderer2, $$props, "default", {}, null);
|
|
53
|
+
$$renderer2.push(`<!--]-->`);
|
|
54
|
+
},
|
|
55
|
+
$$slots: { default: true }
|
|
56
|
+
}
|
|
57
|
+
]));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ../../node_modules/lucide-svelte/dist/icons/triangle-alert.svelte
|
|
61
|
+
import * as $3 from "svelte/internal/server";
|
|
62
|
+
function Triangle_alert($$renderer, $$props) {
|
|
63
|
+
const $$sanitized_props = $3.sanitize_props($$props);
|
|
64
|
+
const iconNode = [
|
|
65
|
+
[
|
|
66
|
+
"path",
|
|
67
|
+
{
|
|
68
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
["path", { d: "M12 9v4" }],
|
|
72
|
+
["path", { d: "M12 17h.01" }]
|
|
73
|
+
];
|
|
74
|
+
Icon($$renderer, $3.spread_props([
|
|
75
|
+
{ name: "triangle-alert" },
|
|
76
|
+
$$sanitized_props,
|
|
77
|
+
{
|
|
78
|
+
iconNode,
|
|
79
|
+
children: ($$renderer2) => {
|
|
80
|
+
$$renderer2.push(`<!--[-->`);
|
|
81
|
+
$3.slot($$renderer2, $$props, "default", {}, null);
|
|
82
|
+
$$renderer2.push(`<!--]-->`);
|
|
83
|
+
},
|
|
84
|
+
$$slots: { default: true }
|
|
85
|
+
}
|
|
86
|
+
]));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ../../node_modules/lucide-svelte/dist/icons/wifi-off.svelte
|
|
90
|
+
import * as $4 from "svelte/internal/server";
|
|
91
|
+
function Wifi_off($$renderer, $$props) {
|
|
92
|
+
const $$sanitized_props = $4.sanitize_props($$props);
|
|
93
|
+
const iconNode = [
|
|
94
|
+
["path", { d: "M12 20h.01" }],
|
|
95
|
+
["path", { d: "M8.5 16.429a5 5 0 0 1 7 0" }],
|
|
96
|
+
["path", { d: "M5 12.859a10 10 0 0 1 5.17-2.69" }],
|
|
97
|
+
["path", { d: "M19 12.859a10 10 0 0 0-2.007-1.523" }],
|
|
98
|
+
["path", { d: "M2 8.82a15 15 0 0 1 4.177-2.643" }],
|
|
99
|
+
["path", { d: "M22 8.82a15 15 0 0 0-11.288-3.764" }],
|
|
100
|
+
["path", { d: "m2 2 20 20" }]
|
|
101
|
+
];
|
|
102
|
+
Icon($$renderer, $4.spread_props([
|
|
103
|
+
{ name: "wifi-off" },
|
|
104
|
+
$$sanitized_props,
|
|
105
|
+
{
|
|
106
|
+
iconNode,
|
|
107
|
+
children: ($$renderer2) => {
|
|
108
|
+
$$renderer2.push(`<!--[-->`);
|
|
109
|
+
$4.slot($$renderer2, $$props, "default", {}, null);
|
|
110
|
+
$$renderer2.push(`<!--]-->`);
|
|
111
|
+
},
|
|
112
|
+
$$slots: { default: true }
|
|
113
|
+
}
|
|
114
|
+
]));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ../../node_modules/lucide-svelte/dist/icons/wifi.svelte
|
|
118
|
+
import * as $5 from "svelte/internal/server";
|
|
119
|
+
function Wifi($$renderer, $$props) {
|
|
120
|
+
const $$sanitized_props = $5.sanitize_props($$props);
|
|
121
|
+
const iconNode = [
|
|
122
|
+
["path", { d: "M12 20h.01" }],
|
|
123
|
+
["path", { d: "M2 8.82a15 15 0 0 1 20 0" }],
|
|
124
|
+
["path", { d: "M5 12.859a10 10 0 0 1 14 0" }],
|
|
125
|
+
["path", { d: "M8.5 16.429a5 5 0 0 1 7 0" }]
|
|
126
|
+
];
|
|
127
|
+
Icon($$renderer, $5.spread_props([
|
|
128
|
+
{ name: "wifi" },
|
|
129
|
+
$$sanitized_props,
|
|
130
|
+
{
|
|
131
|
+
iconNode,
|
|
132
|
+
children: ($$renderer2) => {
|
|
133
|
+
$$renderer2.push(`<!--[-->`);
|
|
134
|
+
$5.slot($$renderer2, $$props, "default", {}, null);
|
|
135
|
+
$$renderer2.push(`<!--]-->`);
|
|
136
|
+
},
|
|
137
|
+
$$slots: { default: true }
|
|
138
|
+
}
|
|
139
|
+
]));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export { Loader, Refresh_ccw_dot, Triangle_alert, Wifi_off, Wifi };
|
|
143
|
+
|
|
144
|
+
//# debugId=296F2B96A19618BB64756E2164756E21
|
|
@@ -23,6 +23,7 @@ function Faceted_filter_bar($$renderer, $$props) {
|
|
|
23
23
|
let {
|
|
24
24
|
"aria-label": ariaLabel = "Filters",
|
|
25
25
|
searchQuery,
|
|
26
|
+
showSearch = true,
|
|
26
27
|
searchPlaceholder = "Search…",
|
|
27
28
|
searchAriaLabel = "Search",
|
|
28
29
|
facets = [],
|
|
@@ -51,7 +52,7 @@ function Faceted_filter_bar($$renderer, $$props) {
|
|
|
51
52
|
return value;
|
|
52
53
|
return facet.options.find((option) => option.value === value)?.label ?? value;
|
|
53
54
|
}
|
|
54
|
-
const hasAppliedFilters = $.derived(() => appliedFilters.length > 0 || currentSearchQuery().length > 0);
|
|
55
|
+
const hasAppliedFilters = $.derived(() => appliedFilters.length > 0 || showSearch && currentSearchQuery().length > 0);
|
|
55
56
|
const totalActiveCount = $.derived(() => appliedFilters.length);
|
|
56
57
|
const summaryMessage = $.derived(() => {
|
|
57
58
|
if (totalActiveCount() === 0)
|
|
@@ -92,16 +93,21 @@ function Faceted_filter_bar($$renderer, $$props) {
|
|
|
92
93
|
"aria-label": ariaLabel,
|
|
93
94
|
"data-disabled": disabled ? "" : undefined
|
|
94
95
|
})}><div class="cinder-faceted-filter-bar__controls">`);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
if (showSearch) {
|
|
97
|
+
$$renderer2.push("<!--[0-->");
|
|
98
|
+
Search_field($$renderer2, {
|
|
99
|
+
id: searchId(),
|
|
100
|
+
class: "cinder-faceted-filter-bar__search",
|
|
101
|
+
value: currentSearchQuery(),
|
|
102
|
+
placeholder: searchPlaceholder,
|
|
103
|
+
"aria-label": searchAriaLabel,
|
|
104
|
+
disabled,
|
|
105
|
+
oninput: handleSearchInput
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
$$renderer2.push("<!--[-1-->");
|
|
109
|
+
}
|
|
110
|
+
$$renderer2.push(`<!--]--> <!--[-->`);
|
|
105
111
|
const each_array = $.ensure_array_like(facets);
|
|
106
112
|
for (let $$index_1 = 0, $$length = each_array.length;$$index_1 < $$length; $$index_1++) {
|
|
107
113
|
let facet = each_array[$$index_1];
|
|
@@ -192,4 +198,4 @@ function Faceted_filter_bar($$renderer, $$props) {
|
|
|
192
198
|
var faceted_filter_bar_default = Faceted_filter_bar;
|
|
193
199
|
export { Faceted_filter_bar, faceted_filter_bar_default };
|
|
194
200
|
|
|
195
|
-
//# debugId=
|
|
201
|
+
//# debugId=E343E69E0C14B4CA64756E2164756E21
|