@masterteam/formula-builder 0.0.29 → 0.0.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/formula-builder",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/formula-builder",
6
6
  "linkDirectory": true,
@@ -19,7 +19,7 @@
19
19
  "rxjs": "^7.8.2",
20
20
  "tailwindcss": "^4.2.2",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
- "@masterteam/components": "^0.0.249",
22
+ "@masterteam/components": "^0.0.280",
23
23
  "@masterteam/icons": "^0.0.17"
24
24
  },
25
25
  "sideEffects": false,
@@ -144,6 +144,7 @@ interface FormulaBuilderUiConfig {
144
144
  valueMode?: 'object' | 'expression';
145
145
  hideToolbar?: boolean;
146
146
  hideStatusBar?: boolean;
147
+ invalidWhenEmpty?: boolean;
147
148
  isProcessBuilder?: boolean;
148
149
  contextEntityTypeKey?: string;
149
150
  }
@@ -183,6 +184,14 @@ declare class FormulaBuilder implements ControlValueAccessor, OnDestroy {
183
184
  readonly hideToolbar: _angular_core.InputSignal<boolean>;
184
185
  /** Hide the status bar */
185
186
  readonly hideStatusBar: _angular_core.InputSignal<boolean>;
187
+ /**
188
+ * Treat an empty expression as invalid (a required formula). When true, an
189
+ * empty formula reports `isValid: false` with a localized "required" error so
190
+ * the status bar shows Invalid and `validationChange` emits an invalid state.
191
+ * Default `false` keeps an empty formula valid, so other consumers that allow
192
+ * empty formulas are unaffected.
193
+ */
194
+ readonly invalidWhenEmpty: _angular_core.InputSignal<boolean>;
186
195
  /** Visible toolbar tabs */
187
196
  readonly toolbarTabs: _angular_core.InputSignal<readonly ToolbarTab[]>;
188
197
  /** Optional host-owned function catalog. Takes precedence over API context. */
@@ -220,6 +229,15 @@ declare class FormulaBuilder implements ControlValueAccessor, OnDestroy {
220
229
  * navigation scopes never flash for a standalone module.
221
230
  */
222
231
  readonly isCurrentOnlyContext: _angular_core.Signal<boolean>;
232
+ /**
233
+ * True when the scope is addressed by the context key alone — a standalone
234
+ * module (`Module:{id}`), whose id is not a level schema id, so sending
235
+ * `levelSchemaId` / `moduleId` alongside it is rejected by the backend.
236
+ * Current-only surfaces without a context key (process / escalation builder)
237
+ * are still addressed by `levelSchemaId` + `moduleId`, and must keep sending
238
+ * them or validation and autocomplete resolve against no schema at all.
239
+ */
240
+ readonly isAddressedByContextKey: _angular_core.Signal<boolean>;
223
241
  /**
224
242
  * Scope tokens the backend allows for this context, or null when it doesn't
225
243
  * constrain them (legacy contexts). Used to gate the visible navigation.
@@ -245,7 +263,13 @@ declare class FormulaBuilder implements ControlValueAccessor, OnDestroy {
245
263
  private onTouched;
246
264
  /** Disabled state */
247
265
  private readonly isDisabled;
248
- /** Validation result from service */
266
+ /**
267
+ * Validation result surfaced to the status bar and the `validationChange`
268
+ * output. Normally mirrors the validator service; when `invalidWhenEmpty` is
269
+ * set and the expression is empty it reports an invalid "required" result so
270
+ * the status bar (Invalid + message) and any host-side validity agree that an
271
+ * empty formula is not acceptable here. See `invalidWhenEmpty`.
272
+ */
249
273
  readonly validation: _angular_core.Signal<_masterteam_formula_builder.ValidationResult>;
250
274
  /** Is validation in progress */
251
275
  readonly isValidating: _angular_core.Signal<boolean>;
@@ -394,7 +418,7 @@ declare class FormulaBuilder implements ControlValueAccessor, OnDestroy {
394
418
  private buildLookupValueResponse;
395
419
  getOperatorDisplayName(token: string): string;
396
420
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormulaBuilder, never>;
397
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormulaBuilder, "mt-formula-builder", never, { "propertiesByPath": { "alias": "propertiesByPath"; "required": false; "isSignal": true; }; "levelSchemaId": { "alias": "levelSchemaId"; "required": false; "isSignal": true; }; "moduleId": { "alias": "moduleId"; "required": false; "isSignal": true; }; "contextKey": { "alias": "contextKey"; "required": false; "isSignal": true; }; "contextEntityTypeKey": { "alias": "contextEntityTypeKey"; "required": false; "isSignal": true; }; "templateId": { "alias": "templateId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hideToolbar": { "alias": "hideToolbar"; "required": false; "isSignal": true; }; "hideStatusBar": { "alias": "hideStatusBar"; "required": false; "isSignal": true; }; "toolbarTabs": { "alias": "toolbarTabs"; "required": false; "isSignal": true; }; "functionCategories": { "alias": "functionCategories"; "required": false; "isSignal": true; }; "operators": { "alias": "operators"; "required": false; "isSignal": true; }; "codeOnly": { "alias": "codeOnly"; "required": false; "isSignal": true; }; "builderOnly": { "alias": "builderOnly"; "required": false; "isSignal": true; }; "valueMode": { "alias": "valueMode"; "required": false; "isSignal": true; }; "isProcessBuilder": { "alias": "isProcessBuilder"; "required": false; "isSignal": true; }; }, { "validationChange": "validationChange"; "tokensChange": "tokensChange"; }, never, never, true, never>;
421
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormulaBuilder, "mt-formula-builder", never, { "propertiesByPath": { "alias": "propertiesByPath"; "required": false; "isSignal": true; }; "levelSchemaId": { "alias": "levelSchemaId"; "required": false; "isSignal": true; }; "moduleId": { "alias": "moduleId"; "required": false; "isSignal": true; }; "contextKey": { "alias": "contextKey"; "required": false; "isSignal": true; }; "contextEntityTypeKey": { "alias": "contextEntityTypeKey"; "required": false; "isSignal": true; }; "templateId": { "alias": "templateId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hideToolbar": { "alias": "hideToolbar"; "required": false; "isSignal": true; }; "hideStatusBar": { "alias": "hideStatusBar"; "required": false; "isSignal": true; }; "invalidWhenEmpty": { "alias": "invalidWhenEmpty"; "required": false; "isSignal": true; }; "toolbarTabs": { "alias": "toolbarTabs"; "required": false; "isSignal": true; }; "functionCategories": { "alias": "functionCategories"; "required": false; "isSignal": true; }; "operators": { "alias": "operators"; "required": false; "isSignal": true; }; "codeOnly": { "alias": "codeOnly"; "required": false; "isSignal": true; }; "builderOnly": { "alias": "builderOnly"; "required": false; "isSignal": true; }; "valueMode": { "alias": "valueMode"; "required": false; "isSignal": true; }; "isProcessBuilder": { "alias": "isProcessBuilder"; "required": false; "isSignal": true; }; }, { "validationChange": "validationChange"; "tokensChange": "tokensChange"; }, never, never, true, never>;
398
422
  }
399
423
 
400
424
  type FormulaApiMode$1 = 'default' | 'current-only';