@masterteam/components 0.0.327 → 0.0.329

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.
Files changed (28) hide show
  1. package/assets/i18n/ar.json +3 -1
  2. package/assets/i18n/en.json +3 -1
  3. package/fesm2022/masterteam-components-business-fields.mjs +104 -9
  4. package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
  5. package/fesm2022/masterteam-components-client-page.mjs +10 -4
  6. package/fesm2022/masterteam-components-client-page.mjs.map +1 -1
  7. package/fesm2022/masterteam-components-entities.mjs +52 -47
  8. package/fesm2022/masterteam-components-entities.mjs.map +1 -1
  9. package/fesm2022/masterteam-components-field-validation.mjs.map +1 -1
  10. package/fesm2022/masterteam-components-formula.mjs +4 -4
  11. package/fesm2022/masterteam-components-formula.mjs.map +1 -1
  12. package/fesm2022/masterteam-components-pick-list-field.mjs +18 -2
  13. package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
  14. package/fesm2022/masterteam-components-slider-field.mjs +2 -2
  15. package/fesm2022/masterteam-components-slider-field.mjs.map +1 -1
  16. package/fesm2022/masterteam-components-table.mjs +220 -41
  17. package/fesm2022/masterteam-components-table.mjs.map +1 -1
  18. package/fesm2022/masterteam-components-tooltip.mjs +11 -3
  19. package/fesm2022/masterteam-components-tooltip.mjs.map +1 -1
  20. package/fesm2022/masterteam-components-treeselect-field.mjs +2 -2
  21. package/fesm2022/masterteam-components-treeselect-field.mjs.map +1 -1
  22. package/package.json +1 -1
  23. package/types/masterteam-components-business-fields.d.ts +22 -1
  24. package/types/masterteam-components-client-page.d.ts +7 -2
  25. package/types/masterteam-components-entities.d.ts +9 -0
  26. package/types/masterteam-components-pick-list-field.d.ts +7 -0
  27. package/types/masterteam-components-table.d.ts +122 -7
  28. package/types/masterteam-components-tooltip.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-components-field-validation.mjs","sources":["../../../../packages/masterteam/components/field-validation/error-message.pipe.ts","../../../../packages/masterteam/components/field-validation/field-validation.ts","../../../../packages/masterteam/components/field-validation/character-limit.validator.ts","../../../../packages/masterteam/components/field-validation/masterteam-components-field-validation.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { ValidationErrors } from '@angular/forms';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n@Pipe({\r\n name: 'errorMessage',\r\n standalone: true,\r\n pure: false,\r\n})\r\nexport class ErrorMessagePipe implements PipeTransform {\r\n private readonly translocoService = inject(TranslocoService);\r\n\r\n transform(errors: ValidationErrors | null): string {\r\n if (!errors) {\r\n return '';\r\n }\r\n\r\n const t = (key: string, params?: object) =>\r\n this.translocoService.translate(`components.validation.${key}`, params);\r\n\r\n // A `.message` on the error object means a caller deliberately configured\r\n // field-specific copy for this failure — ValidatorConfig with an explicit message\r\n // (buildValidators → wrapValidatorWithMessage), or ValidatorConfig.custom\r\n // (createCustomValidator). It must win over the generic translations below,\r\n // otherwise that copy is silently replaced by the generic string, e.g. every\r\n // pattern mismatch reading \"The format is invalid\" no matter what the field\r\n // configured.\r\n //\r\n // The inverse matters just as much: ValidatorConfig's type-specific factories\r\n // deliberately do NOT default `message` (see the note on ValidatorConfig in\r\n // dynamic-form.model.ts). With no message configured the raw Angular validator is\r\n // pushed unwrapped, so nothing reaches this loop and the translated — and, where\r\n // relevant, parameter-interpolated — generic branch below runs instead. Re-adding\r\n // a default there would shadow those translations in every locale but English.\r\n for (const key in errors) {\r\n const errorValue = errors[key];\r\n if (errorValue && typeof errorValue === 'object' && errorValue.message) {\r\n return errorValue.message;\r\n }\r\n }\r\n\r\n if (errors['required']) {\r\n return t('required');\r\n }\r\n if (errors['email']) {\r\n return t('email');\r\n }\r\n if (errors['minlength']) {\r\n const { requiredLength } = errors['minlength'];\r\n return t('minLength', { requiredLength });\r\n }\r\n if (errors['maxlength']) {\r\n const { requiredLength } = errors['maxlength'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['characterLimit']) {\r\n const { requiredLength } = errors['characterLimit'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['min']) {\r\n const { min } = errors['min'];\r\n return t('min', { min });\r\n }\r\n if (errors['max']) {\r\n const { max } = errors['max'];\r\n return t('max', { max });\r\n }\r\n if (errors['pattern']) {\r\n return t('pattern');\r\n }\r\n if (errors['fileSizeLimited']) {\r\n const { size } = errors['fileSizeLimited'] ?? {};\r\n return t('fileSizeLimited', { size });\r\n }\r\n\r\n // Fallback for any other error\r\n const firstErrorKey = Object.keys(errors)[0];\r\n return t('invalid', { key: firstErrorKey });\r\n }\r\n}\r\n","import {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n DoCheck,\r\n ElementRef,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { Message } from 'primeng/message';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { ErrorMessagePipe } from './error-message.pipe';\r\nimport { _IdGenerator } from '@angular/cdk/a11y';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\n/**\r\n * First focusable thing inside a field host — the element a screen reader is on\r\n * when it needs to hear that the value was rejected. Covers the native controls\r\n * and the inner input every PrimeNG wrapper renders.\r\n */\r\nconst CONTROL_SELECTOR =\r\n 'input, textarea, select, [contenteditable=\"true\"], [role=\"combobox\"], [role=\"listbox\"], [role=\"spinbutton\"]';\r\n\r\n@Component({\r\n selector: 'mt-field-validation',\r\n standalone: true,\r\n imports: [Message, ErrorMessagePipe],\r\n template: `\r\n @if (isInvalid(control())) {\r\n <p-message\r\n severity=\"error\"\r\n variant=\"simple\"\r\n size=\"small\"\r\n role=\"alert\"\r\n [id]=\"resolvedMessageId()\"\r\n [text]=\"control().errors | errorMessage\"\r\n >\r\n </p-message>\r\n }\r\n `,\r\n host: {\r\n class: 'mt-field-validation',\r\n // Reserve one line of space for fields that can produce an error so the\r\n // message appears/disappears without shifting the field height (and the\r\n // rest of the form). Fields with no validators stay compact.\r\n '[class.mt-field-validation--reserved]': 'shouldReserveSpace()',\r\n },\r\n styles: `\r\n .mt-field-validation {\r\n display: none;\r\n }\r\n .mt-field-validation--reserved {\r\n display: block;\r\n min-height: 1.25rem;\r\n }\r\n `,\r\n})\r\nexport class FieldValidation implements DoCheck {\r\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n readonly control = input<AbstractControl | null>(null);\r\n readonly touched = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n /**\r\n * Id the failing control points at with `aria-describedby`. Generated when\r\n * not supplied, so no caller has to pass anything for the wiring below to\r\n * work; override it only when a host needs a predictable id (a test, or a\r\n * second `aria-describedby` target it is composing itself).\r\n */\r\n readonly messageId = input<string | null>(null);\r\n\r\n private readonly fallbackMessageId =\r\n inject(_IdGenerator).getId('mt-field-error-');\r\n\r\n readonly resolvedMessageId = computed(\r\n () => this.messageId()?.trim() || this.fallbackMessageId,\r\n );\r\n\r\n isInvalid = isInvalid;\r\n\r\n /** Cached lookup — the control element never changes for a given field. */\r\n private controlElement: HTMLElement | null | undefined;\r\n private describedApplied = false;\r\n\r\n /**\r\n * Keep `aria-invalid` / `aria-describedby` on the field's own control in step\r\n * with the message below it.\r\n *\r\n * The message used to be loose text with no relationship to anything: a\r\n * screen-reader user heard the field, then — separately, later, if they kept\r\n * reading — an unattributed error (findings C-02, H-04). Wiring it here rather\r\n * than in each of the 23 field templates means every field that already\r\n * renders `mt-field-validation` gets it, including the ones whose control is\r\n * an input PrimeNG renders and the template cannot reach.\r\n *\r\n * `ngDoCheck` rather than an `effect` because `AbstractControl` validity is\r\n * not a signal — the template re-reads it every cycle, and so does this.\r\n */\r\n ngDoCheck(): void {\r\n const target = this.resolveControlElement();\r\n if (!target) {\r\n return;\r\n }\r\n\r\n const invalid = isInvalid(this.control());\r\n if (invalid === this.describedApplied) {\r\n return;\r\n }\r\n\r\n this.describedApplied = invalid;\r\n\r\n if (invalid) {\r\n target.setAttribute('aria-invalid', 'true');\r\n target.setAttribute('aria-describedby', this.resolvedMessageId());\r\n return;\r\n }\r\n\r\n target.removeAttribute('aria-invalid');\r\n if (target.getAttribute('aria-describedby') === this.resolvedMessageId()) {\r\n target.removeAttribute('aria-describedby');\r\n }\r\n }\r\n\r\n /**\r\n * Reserve the error-message line whenever the control can surface an error —\r\n * i.e. it has sync/async validators, or is already showing one. This keeps the\r\n * field's height constant so showing the error never pushes sibling fields or\r\n * the content below the row. Re-evaluated each change-detection cycle, so it\r\n * picks up validators that fields add asynchronously after init.\r\n */\r\n shouldReserveSpace(): boolean {\r\n const control = this.control();\r\n if (!control) {\r\n return false;\r\n }\r\n return (\r\n control.validator !== null ||\r\n control.asyncValidator !== null ||\r\n isInvalid(control)\r\n );\r\n }\r\n\r\n /**\r\n * The control this message belongs to: the first focusable element inside the\r\n * field component that hosts us. `undefined` means \"not looked up yet\",\r\n * `null` means \"looked up and there is nothing to annotate\" — a distinction\r\n * that matters, because the second case must not re-query every cycle.\r\n */\r\n private resolveControlElement(): HTMLElement | null {\r\n if (this.controlElement !== undefined) {\r\n return this.controlElement;\r\n }\r\n\r\n const host = this.elementRef.nativeElement.parentElement;\r\n this.controlElement =\r\n host?.querySelector<HTMLElement>(CONTROL_SELECTOR) ?? null;\r\n\r\n return this.controlElement;\r\n }\r\n}\r\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport const characterLimitValidator =\n (maxLength: number): ValidatorFn =>\n (control: AbstractControl): ValidationErrors | null => {\n const value = control.value;\n\n if (value === null || value === undefined) {\n return null;\n }\n\n const length = String(value).length;\n\n return length > maxLength\n ? {\n characterLimit: {\n requiredLength: maxLength,\n actualLength: length,\n },\n }\n : null;\n };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MASa,gBAAgB,CAAA;AACV,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5D,IAAA,SAAS,CAAC,MAA+B,EAAA;QACvC,IAAI,CAAC,MAAM,EAA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../../../../packages/masterteam/components/field-validation/error-message.pipe.ts","../../../../packages/masterteam/components/field-validation/field-validation.ts","../../../../packages/masterteam/components/field-validation/character-limit.validator.ts","../../../../packages/masterteam/components/field-validation/masterteam-components-field-validation.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { ValidationErrors } from '@angular/forms';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n@Pipe({\r\n name: 'errorMessage',\r\n standalone: true,\r\n pure: false,\r\n})\r\nexport class ErrorMessagePipe implements PipeTransform {\r\n private readonly translocoService = inject(TranslocoService);\r\n\r\n transform(errors: ValidationErrors | null): string {\r\n if (!errors) {\r\n return '';\r\n }\r\n\r\n const t = (key: string, params?: object) =>\r\n this.translocoService.translate(`components.validation.${key}`, params);\r\n\r\n // A `.message` on the error object means a caller deliberately configured\r\n // field-specific copy for this failure — ValidatorConfig with an explicit message\r\n // (buildValidators → wrapValidatorWithMessage), or ValidatorConfig.custom\r\n // (createCustomValidator). It must win over the generic translations below,\r\n // otherwise that copy is silently replaced by the generic string, e.g. every\r\n // pattern mismatch reading \"The format is invalid\" no matter what the field\r\n // configured.\r\n //\r\n // The inverse matters just as much: ValidatorConfig's type-specific factories\r\n // deliberately do NOT default `message` (see the note on ValidatorConfig in\r\n // dynamic-form.model.ts). With no message configured the raw Angular validator is\r\n // pushed unwrapped, so nothing reaches this loop and the translated — and, where\r\n // relevant, parameter-interpolated — generic branch below runs instead. Re-adding\r\n // a default there would shadow those translations in every locale but English.\r\n for (const key in errors) {\r\n const errorValue = errors[key];\r\n if (errorValue && typeof errorValue === 'object' && errorValue.message) {\r\n return errorValue.message;\r\n }\r\n }\r\n\r\n if (errors['required']) {\r\n return t('required');\r\n }\r\n if (errors['email']) {\r\n return t('email');\r\n }\r\n if (errors['minlength']) {\r\n const { requiredLength } = errors['minlength'];\r\n return t('minLength', { requiredLength });\r\n }\r\n if (errors['maxlength']) {\r\n const { requiredLength } = errors['maxlength'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['characterLimit']) {\r\n const { requiredLength } = errors['characterLimit'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['min']) {\r\n const { min } = errors['min'];\r\n return t('min', { min });\r\n }\r\n if (errors['max']) {\r\n const { max } = errors['max'];\r\n return t('max', { max });\r\n }\r\n if (errors['pattern']) {\r\n return t('pattern');\r\n }\r\n if (errors['fileSizeLimited']) {\r\n const { size } = errors['fileSizeLimited'] ?? {};\r\n return t('fileSizeLimited', { size });\r\n }\r\n\r\n // Fallback for any other error\r\n const firstErrorKey = Object.keys(errors)[0];\r\n return t('invalid', { key: firstErrorKey });\r\n }\r\n}\r\n","import {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n DoCheck,\r\n ElementRef,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { Message } from 'primeng/message';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { ErrorMessagePipe } from './error-message.pipe';\r\nimport { _IdGenerator } from '@angular/cdk/a11y';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\n/**\r\n * First focusable thing inside a field host — the element a screen reader is on\r\n * when it needs to hear that the value was rejected. Covers the native controls\r\n * and the inner input every PrimeNG wrapper renders.\r\n */\r\nconst CONTROL_SELECTOR =\r\n 'input, textarea, select, [contenteditable=\"true\"], [role=\"combobox\"], [role=\"listbox\"], [role=\"spinbutton\"]';\r\n\r\n@Component({\r\n selector: 'mt-field-validation',\r\n standalone: true,\r\n imports: [Message, ErrorMessagePipe],\r\n template: `\r\n @if (isInvalid(control())) {\r\n <p-message\r\n severity=\"error\"\r\n variant=\"simple\"\r\n size=\"small\"\r\n role=\"alert\"\r\n [id]=\"resolvedMessageId()\"\r\n [text]=\"control().errors | errorMessage\"\r\n >\r\n </p-message>\r\n }\r\n `,\r\n host: {\r\n class: 'mt-field-validation',\r\n // Reserve one line of space for fields that can produce an error so the\r\n // message appears/disappears without shifting the field height (and the\r\n // rest of the form). Fields with no validators stay compact.\r\n '[class.mt-field-validation--reserved]': 'shouldReserveSpace()',\r\n },\r\n styles: `\r\n .mt-field-validation {\r\n display: none;\r\n }\r\n .mt-field-validation--reserved {\r\n display: block;\r\n min-height: 1.25rem;\r\n }\r\n `,\r\n})\r\nexport class FieldValidation implements DoCheck {\r\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n readonly control = input<AbstractControl | null>(null);\r\n readonly touched = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n /**\r\n * Id the failing control points at with `aria-describedby`. Generated when\r\n * not supplied, so no caller has to pass anything for the wiring below to\r\n * work; override it only when a host needs a predictable id (a test, or a\r\n * second `aria-describedby` target it is composing itself).\r\n */\r\n readonly messageId = input<string | null>(null);\r\n\r\n private readonly fallbackMessageId =\r\n inject(_IdGenerator).getId('mt-field-error-');\r\n\r\n readonly resolvedMessageId = computed(\r\n () => this.messageId()?.trim() || this.fallbackMessageId,\r\n );\r\n\r\n isInvalid = isInvalid;\r\n\r\n /** Cached lookup — the control element never changes for a given field. */\r\n private controlElement: HTMLElement | null | undefined;\r\n private describedApplied = false;\r\n\r\n /**\r\n * Keep `aria-invalid` / `aria-describedby` on the field's own control in step\r\n * with the message below it.\r\n *\r\n * The message used to be loose text with no relationship to anything: a\r\n * screen-reader user heard the field, then — separately, later, if they kept\r\n * reading — an unattributed error (findings C-02, H-04). Wiring it here rather\r\n * than in each of the 23 field templates means every field that already\r\n * renders `mt-field-validation` gets it, including the ones whose control is\r\n * an input PrimeNG renders and the template cannot reach.\r\n *\r\n * `ngDoCheck` rather than an `effect` because `AbstractControl` validity is\r\n * not a signal — the template re-reads it every cycle, and so does this.\r\n */\r\n ngDoCheck(): void {\r\n const target = this.resolveControlElement();\r\n if (!target) {\r\n return;\r\n }\r\n\r\n const invalid = isInvalid(this.control());\r\n if (invalid === this.describedApplied) {\r\n return;\r\n }\r\n\r\n this.describedApplied = invalid;\r\n\r\n if (invalid) {\r\n target.setAttribute('aria-invalid', 'true');\r\n target.setAttribute('aria-describedby', this.resolvedMessageId());\r\n return;\r\n }\r\n\r\n target.removeAttribute('aria-invalid');\r\n if (target.getAttribute('aria-describedby') === this.resolvedMessageId()) {\r\n target.removeAttribute('aria-describedby');\r\n }\r\n }\r\n\r\n /**\r\n * Reserve the error-message line whenever the control can surface an error —\r\n * i.e. it has sync/async validators, or is already showing one. This keeps the\r\n * field's height constant so showing the error never pushes sibling fields or\r\n * the content below the row. Re-evaluated each change-detection cycle, so it\r\n * picks up validators that fields add asynchronously after init.\r\n */\r\n shouldReserveSpace(): boolean {\r\n const control = this.control();\r\n if (!control) {\r\n return false;\r\n }\r\n return (\r\n control.validator !== null ||\r\n control.asyncValidator !== null ||\r\n isInvalid(control)\r\n );\r\n }\r\n\r\n /**\r\n * The control this message belongs to: the first focusable element inside the\r\n * field component that hosts us. `undefined` means \"not looked up yet\",\r\n * `null` means \"looked up and there is nothing to annotate\" — a distinction\r\n * that matters, because the second case must not re-query every cycle.\r\n */\r\n private resolveControlElement(): HTMLElement | null {\r\n if (this.controlElement !== undefined) {\r\n return this.controlElement;\r\n }\r\n\r\n const host = this.elementRef.nativeElement.parentElement;\r\n this.controlElement =\r\n host?.querySelector<HTMLElement>(CONTROL_SELECTOR) ?? null;\r\n\r\n return this.controlElement;\r\n }\r\n}\r\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\r\n\r\nexport const characterLimitValidator =\r\n (maxLength: number): ValidatorFn =>\r\n (control: AbstractControl): ValidationErrors | null => {\r\n const value = control.value;\r\n\r\n if (value === null || value === undefined) {\r\n return null;\r\n }\r\n\r\n const length = String(value).length;\r\n\r\n return length > maxLength\r\n ? {\r\n characterLimit: {\r\n requiredLength: maxLength,\r\n actualLength: length,\r\n },\r\n }\r\n : null;\r\n };\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MASa,gBAAgB,CAAA;AACV,IAAA,gBAAgB,GAAG,MAA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AAA;AACF;UACD,IAAI;AACV;;ACrBF;;AAEG;;;;"}
@@ -2038,7 +2038,7 @@ class FormulaEditorCode {
2038
2038
  useExisting: forwardRef(() => FormulaEditorCode),
2039
2039
  multi: true,
2040
2040
  },
2041
- ], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"isDisabled()\"\r\n [class.pointer-events-none]=\"isDisabled()\"\r\n [attr.aria-busy]=\"loadState() === 'loading'\"\r\n>\r\n <div\r\n #editorHost\r\n class=\"min-h-20 flex-1\"\r\n [hidden]=\"loadState() === 'error'\"\r\n ></div>\r\n\r\n @if (loadState() !== \"ready\") {\r\n <div class=\"mt-formula-editor-code__load-state flex flex-col gap-2 p-3\">\r\n @if (loadState() === \"loading\") {\r\n <div role=\"status\" class=\"flex items-center gap-2 text-surface-500\">\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"mt-formula-editor-code__spinner\"\r\n ></span>\r\n <span>{{\r\n \"components.formulaEditor.loadingCodeEditor\" | transloco\r\n }}</span>\r\n </div>\r\n } @else {\r\n <div role=\"alert\" class=\"text-red-600 dark:text-red-400\">\r\n {{ \"components.formulaEditor.codeEditorLoadFailed\" | transloco }}\r\n </div>\r\n <mt-button\r\n type=\"button\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n [outlined]=\"true\"\r\n [disabled]=\"isDisabled()\"\r\n [label]=\"'components.formulaEditor.retryCodeEditor' | transloco\"\r\n (onClick)=\"retryLoadEditor()\"\r\n />\r\n }\r\n @if (value()) {\r\n <pre\r\n class=\"m-0 whitespace-pre-wrap break-words text-xs text-surface-600 dark:text-surface-300\"\r\n >{{ value() }}</pre\r\n >\r\n }\r\n </div>\r\n }\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code__load-state{grid-area:1/1;font-family:var(--default-font-family, sans-serif)}.mt-formula-editor-code__spinner{width:1rem;height:1rem;flex:none;border:2px solid currentColor;border-block-start-color:transparent;border-radius:50%;animation:mt-formula-editor-spin .8s linear infinite}@keyframes mt-formula-editor-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mt-formula-editor-code__spinner{animation:none}}.mt-formula-editor-code>[aria-busy]{display:grid;grid-template-columns:minmax(0,1fr)}.mt-formula-editor-code>[aria-busy]>div:first-child{grid-area:1/1}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2041
+ ], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"containerClasses()\"\n [class.opacity-60]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [attr.aria-busy]=\"loadState() === 'loading'\"\n>\n <div\n #editorHost\n class=\"min-h-20 flex-1\"\n [hidden]=\"loadState() === 'error'\"\n ></div>\n\n @if (loadState() !== \"ready\") {\n <div class=\"mt-formula-editor-code__load-state flex flex-col gap-2 p-3\">\n @if (loadState() === \"loading\") {\n <div role=\"status\" class=\"flex items-center gap-2 text-surface-500\">\n <span\n aria-hidden=\"true\"\n class=\"mt-formula-editor-code__spinner\"\n ></span>\n <span>{{\n \"components.formulaEditor.loadingCodeEditor\" | transloco\n }}</span>\n </div>\n } @else {\n <div role=\"alert\" class=\"text-red-600 dark:text-red-400\">\n {{ \"components.formulaEditor.codeEditorLoadFailed\" | transloco }}\n </div>\n <mt-button\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n [outlined]=\"true\"\n [disabled]=\"isDisabled()\"\n [label]=\"'components.formulaEditor.retryCodeEditor' | transloco\"\n (onClick)=\"retryLoadEditor()\"\n />\n }\n @if (value()) {\n <pre\n class=\"m-0 whitespace-pre-wrap break-words text-xs text-surface-600 dark:text-surface-300\"\n >{{ value() }}</pre\n >\n }\n </div>\n }\n\n @if (showPlaceholder()) {\n <div\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\n >\n {{ placeholder() }}\n </div>\n }\n</div>\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code__load-state{grid-area:1/1;font-family:var(--default-font-family, sans-serif)}.mt-formula-editor-code__spinner{width:1rem;height:1rem;flex:none;border:2px solid currentColor;border-block-start-color:transparent;border-radius:50%;animation:mt-formula-editor-spin .8s linear infinite}@keyframes mt-formula-editor-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mt-formula-editor-code__spinner{animation:none}}.mt-formula-editor-code>[aria-busy]{display:grid;grid-template-columns:minmax(0,1fr)}.mt-formula-editor-code>[aria-busy]>div:first-child{grid-area:1/1}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2042
2042
  }
2043
2043
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FormulaEditorCode, decorators: [{
2044
2044
  type: Component,
@@ -2050,7 +2050,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2050
2050
  useExisting: forwardRef(() => FormulaEditorCode),
2051
2051
  multi: true,
2052
2052
  },
2053
- ], template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"isDisabled()\"\r\n [class.pointer-events-none]=\"isDisabled()\"\r\n [attr.aria-busy]=\"loadState() === 'loading'\"\r\n>\r\n <div\r\n #editorHost\r\n class=\"min-h-20 flex-1\"\r\n [hidden]=\"loadState() === 'error'\"\r\n ></div>\r\n\r\n @if (loadState() !== \"ready\") {\r\n <div class=\"mt-formula-editor-code__load-state flex flex-col gap-2 p-3\">\r\n @if (loadState() === \"loading\") {\r\n <div role=\"status\" class=\"flex items-center gap-2 text-surface-500\">\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"mt-formula-editor-code__spinner\"\r\n ></span>\r\n <span>{{\r\n \"components.formulaEditor.loadingCodeEditor\" | transloco\r\n }}</span>\r\n </div>\r\n } @else {\r\n <div role=\"alert\" class=\"text-red-600 dark:text-red-400\">\r\n {{ \"components.formulaEditor.codeEditorLoadFailed\" | transloco }}\r\n </div>\r\n <mt-button\r\n type=\"button\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n [outlined]=\"true\"\r\n [disabled]=\"isDisabled()\"\r\n [label]=\"'components.formulaEditor.retryCodeEditor' | transloco\"\r\n (onClick)=\"retryLoadEditor()\"\r\n />\r\n }\r\n @if (value()) {\r\n <pre\r\n class=\"m-0 whitespace-pre-wrap break-words text-xs text-surface-600 dark:text-surface-300\"\r\n >{{ value() }}</pre\r\n >\r\n }\r\n </div>\r\n }\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code__load-state{grid-area:1/1;font-family:var(--default-font-family, sans-serif)}.mt-formula-editor-code__spinner{width:1rem;height:1rem;flex:none;border:2px solid currentColor;border-block-start-color:transparent;border-radius:50%;animation:mt-formula-editor-spin .8s linear infinite}@keyframes mt-formula-editor-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mt-formula-editor-code__spinner{animation:none}}.mt-formula-editor-code>[aria-busy]{display:grid;grid-template-columns:minmax(0,1fr)}.mt-formula-editor-code>[aria-busy]>div:first-child{grid-area:1/1}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"] }]
2053
+ ], template: "<div\n [class]=\"containerClasses()\"\n [class.opacity-60]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [attr.aria-busy]=\"loadState() === 'loading'\"\n>\n <div\n #editorHost\n class=\"min-h-20 flex-1\"\n [hidden]=\"loadState() === 'error'\"\n ></div>\n\n @if (loadState() !== \"ready\") {\n <div class=\"mt-formula-editor-code__load-state flex flex-col gap-2 p-3\">\n @if (loadState() === \"loading\") {\n <div role=\"status\" class=\"flex items-center gap-2 text-surface-500\">\n <span\n aria-hidden=\"true\"\n class=\"mt-formula-editor-code__spinner\"\n ></span>\n <span>{{\n \"components.formulaEditor.loadingCodeEditor\" | transloco\n }}</span>\n </div>\n } @else {\n <div role=\"alert\" class=\"text-red-600 dark:text-red-400\">\n {{ \"components.formulaEditor.codeEditorLoadFailed\" | transloco }}\n </div>\n <mt-button\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n [outlined]=\"true\"\n [disabled]=\"isDisabled()\"\n [label]=\"'components.formulaEditor.retryCodeEditor' | transloco\"\n (onClick)=\"retryLoadEditor()\"\n />\n }\n @if (value()) {\n <pre\n class=\"m-0 whitespace-pre-wrap break-words text-xs text-surface-600 dark:text-surface-300\"\n >{{ value() }}</pre\n >\n }\n </div>\n }\n\n @if (showPlaceholder()) {\n <div\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\n >\n {{ placeholder() }}\n </div>\n }\n</div>\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code__load-state{grid-area:1/1;font-family:var(--default-font-family, sans-serif)}.mt-formula-editor-code__spinner{width:1rem;height:1rem;flex:none;border:2px solid currentColor;border-block-start-color:transparent;border-radius:50%;animation:mt-formula-editor-spin .8s linear infinite}@keyframes mt-formula-editor-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mt-formula-editor-code__spinner{animation:none}}.mt-formula-editor-code>[aria-busy]{display:grid;grid-template-columns:minmax(0,1fr)}.mt-formula-editor-code>[aria-busy]>div:first-child{grid-area:1/1}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"] }]
2054
2054
  }], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialFormula: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFormula", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], borderless: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderless", required: false }] }], autocompleteProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteProvider", required: false }] }], autocompleteDebounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteDebounceMs", required: false }] }], formulaChange: [{ type: i0.Output, args: ["formulaChange"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { isSignal: true }] }] } });
2055
2055
 
2056
2056
  /**
@@ -2854,11 +2854,11 @@ class FormulaToolbar {
2854
2854
  this.customValue.set('');
2855
2855
  }
2856
2856
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FormulaToolbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
2857
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: FormulaToolbar, isStandalone: true, selector: "mt-formula-toolbar", inputs: { knownProperties: { classPropertyName: "knownProperties", publicName: "knownProperties", isSignal: true, isRequired: false, transformFunction: null }, propertiesTemplate: { classPropertyName: "propertiesTemplate", publicName: "propertiesTemplate", isSignal: true, isRequired: false, transformFunction: null }, propertyValues: { classPropertyName: "propertyValues", publicName: "propertyValues", isSignal: true, isRequired: false, transformFunction: null }, loadingValuesFor: { classPropertyName: "loadingValuesFor", publicName: "loadingValuesFor", isSignal: true, isRequired: false, transformFunction: null }, functionCategories: { classPropertyName: "functionCategories", publicName: "functionCategories", isSignal: true, isRequired: false, transformFunction: null }, operators: { classPropertyName: "operators", publicName: "operators", isSignal: true, isRequired: false, transformFunction: null }, initialTab: { classPropertyName: "initialTab", publicName: "initialTab", isSignal: true, isRequired: false, transformFunction: null }, visibleTabs: { classPropertyName: "visibleTabs", publicName: "visibleTabs", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onBlockInsert: "onBlockInsert", onTabChange: "onTabChange", onPropertyValuesRequest: "onPropertyValuesRequest" }, queries: [{ propertyName: "projectedPropertiesTemplate", first: true, predicate: ["properties"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<div\r\n *transloco=\"let t; prefix: 'components.formula.toolbar'\"\r\n class=\"flex flex-col border-b border-slate-200 dark:border-slate-700\"\r\n [class.h-52]=\"activeTab() !== 'properties' || !resolvedPropertiesTemplate()\"\r\n>\r\n <!-- Top Bar: Search + Quick Insert -->\r\n <div\r\n class=\"flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-slate-700\"\r\n >\r\n <!-- Search Field -->\r\n <div class=\"relative flex-1\">\r\n <svg\r\n class=\"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\r\n />\r\n </svg>\r\n <input\r\n type=\"text\"\r\n class=\"w-full rounded-lg border border-slate-300 bg-white py-1.5 ps-9 pe-8 text-sm text-slate-700 placeholder:text-slate-400 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-200 dark:placeholder:text-slate-500\"\r\n [placeholder]=\"searchPlaceholder() || t('search')\"\r\n [(ngModel)]=\"searchQuery\"\r\n />\r\n @if (searchQuery()) {\r\n <button\r\n type=\"button\"\r\n class=\"absolute end-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 transition-all duration-200 dark:hover:bg-slate-700\"\r\n (click)=\"clearSearch()\"\r\n >\r\n <svg\r\n class=\"h-4 w-4\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M6 18L18 6M6 6l12 12\"\r\n />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- Separator -->\r\n <div class=\"h-6 w-px bg-slate-200 dark:bg-slate-600\"></div>\r\n\r\n <!-- Quick Insert Input -->\r\n <div class=\"relative flex items-center gap-2\">\r\n <span\r\n class=\"text-sm font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide\"\r\n >{{ t(\"insertLabel\") }}:</span\r\n >\r\n <div class=\"relative\">\r\n <input\r\n #customValueInput\r\n type=\"text\"\r\n class=\"w-32 rounded-md border border-dashed border-slate-300 bg-slate-50 px-3 py-1.5 text-sm font-mono text-slate-700 placeholder:text-slate-400 focus:border-primary focus:bg-white focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:placeholder:text-slate-500 dark:focus:bg-slate-900\"\r\n [placeholder]=\"t('customValuePlaceholder')\"\r\n [(ngModel)]=\"customValue\"\r\n (keydown.enter)=\"insertCustomValue()\"\r\n (keydown.escape)=\"clearCustomValue()\"\r\n />\r\n </div>\r\n\r\n <!-- Insert Button with Type Preview -->\r\n @if (customValue()) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all duration-200 hover:shadow-sm active:scale-95\"\r\n [class]=\"customValueTypeClass()\"\r\n (click)=\"insertCustomValue()\"\r\n [title]=\"t('insertType', { type: customValueType() })\"\r\n >\r\n @switch (customValueType()) {\r\n @case (\"boolean\") {\r\n <span class=\"text-xs\">{{ t(\"booleanType\") }}</span>\r\n }\r\n @case (\"number\") {\r\n <svg\r\n class=\"h-3 w-3\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\"\r\n />\r\n </svg>\r\n }\r\n @case (\"string\") {\r\n <svg\r\n class=\"h-3 w-3\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z\"\r\n />\r\n </svg>\r\n }\r\n @default {\r\n <svg\r\n class=\"h-3 w-3\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M12 4.5v15m7.5-7.5h-15\"\r\n />\r\n </svg>\r\n }\r\n }\r\n <span class=\"max-w-16 truncate\">{{ customValuePreview() }}</span>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Main Content Row -->\r\n <div class=\"flex flex-1 overflow-hidden\">\r\n <!-- Vertical Tabs -->\r\n <div\r\n class=\"flex w-44 flex-col border-e border-slate-200 dark:border-slate-700\"\r\n >\r\n @for (tab of resolvedTabOptions(); track tab.value) {\r\n <button\r\n type=\"button\"\r\n class=\"flex cursor-pointer items-center gap-2 px-3 py-2.5 text-start text-sm font-medium transition-all duration-200\"\r\n [class]=\"\r\n activeTab() === tab.value\r\n ? 'bg-white border-e-2 border-primary text-primary dark:bg-slate-900'\r\n : searchQuery() && !tabHasResults(tab.value)\r\n ? 'text-slate-300 dark:text-slate-600'\r\n : 'text-slate-600 hover:bg-slate-100 hover:text-slate-800 dark:text-slate-300 dark:hover:bg-slate-700'\r\n \"\r\n (click)=\"setActiveTab(tab.value)\"\r\n >\r\n <!-- Tab Icons -->\r\n @switch (tab.value) {\r\n @case (\"functions\") {\r\n <svg\r\n class=\"h-5 w-5 shrink-0\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5\"\r\n />\r\n </svg>\r\n }\r\n @case (\"properties\") {\r\n <svg\r\n class=\"h-5 w-5 shrink-0\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z\"\r\n />\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M6 6h.008v.008H6V6z\"\r\n />\r\n </svg>\r\n }\r\n @case (\"operators\") {\r\n <svg\r\n class=\"h-5 w-5 shrink-0\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M15.75 15.75V18m-7.5-6.75h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V13.5zm0 2.25h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V18zm2.498-6.75h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V13.5zm0 2.25h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V18zm2.504-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zm0 2.25h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V18zm2.498-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zM8.25 6h7.5v2.25h-7.5V6zM12 2.25c-1.892 0-3.758.11-5.593.322C5.307 2.7 4.5 3.65 4.5 4.757V19.5a2.25 2.25 0 002.25 2.25h10.5a2.25 2.25 0 002.25-2.25V4.757c0-1.108-.806-2.057-1.907-2.185A48.507 48.507 0 0012 2.25z\"\r\n />\r\n </svg>\r\n }\r\n }\r\n <!-- Label (always visible) -->\r\n <span class=\"truncate whitespace-nowrap text-sm\">{{\r\n t(tab.value)\r\n }}</span>\r\n <!-- Count Badge -->\r\n @if (tab.value !== \"properties\" || !resolvedPropertiesTemplate()) {\r\n <span\r\n class=\"ms-auto rounded-full px-1.5 py-0.5 text-xs font-semibold\"\r\n [class]=\"\r\n activeTab() === tab.value\r\n ? 'bg-primary/10 text-primary'\r\n : 'bg-slate-200 text-slate-600 dark:bg-slate-600 dark:text-slate-300'\r\n \"\r\n >\r\n {{ getTabCount(tab.value) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- Content Area -->\r\n <div class=\"flex flex-1 flex-col overflow-hidden\">\r\n <!-- Items Grid -->\r\n <div\r\n class=\"flex-1 p-2.5\"\r\n [class.overflow-y-auto]=\"\r\n activeTab() !== 'properties' || !resolvedPropertiesTemplate()\r\n \"\r\n >\r\n @switch (activeTab()) {\r\n @case (\"functions\") {\r\n @if (filteredCategories().length === 0) {\r\n <div\r\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\r\n >\r\n {{ labels()?.noFunctionsFound ?? t(\"noFunctionsFound\") }}\r\n </div>\r\n } @else {\r\n <div class=\"space-y-3\">\r\n @for (category of filteredCategories(); track category.name) {\r\n <div>\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\r\n >\r\n {{ categoryLabel(category) }}\r\n </span>\r\n <span\r\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\r\n ></span>\r\n <span\r\n class=\"text-sm text-slate-400 dark:text-slate-500\"\r\n >{{ category.functions.length }}</span\r\n >\r\n </div>\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (fn of category.functions; track fn.name) {\r\n <mt-formula-toolbar-item\r\n type=\"function\"\r\n [value]=\"fn.name\"\r\n [description]=\"fn.description\"\r\n [signature]=\"fn.signature\"\r\n [template]=\"fn.template\"\r\n [templateCursorOffset]=\"fn.templateCursorOffset\"\r\n [returnType]=\"fn.returnType\"\r\n [parameters]=\"fn.parameters ?? []\"\r\n [examples]=\"fn.examples ?? []\"\r\n [hints]=\"fn.hints ?? []\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n @case (\"properties\") {\r\n @if (resolvedPropertiesTemplate(); as template) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"template\"\r\n [ngTemplateOutletContext]=\"propertiesTemplateContext\"\r\n />\r\n } @else {\r\n @if (filteredProperties().length === 0) {\r\n <div\r\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\r\n >\r\n {{\r\n labels()?.noPropertiesAvailable ??\r\n t(\"noPropertiesAvailable\")\r\n }}\r\n </div>\r\n } @else {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (prop of filteredProperties(); track prop.key) {\r\n @if (prop.hasValues) {\r\n <!-- Value-backed property: insert the property itself, or\r\n open its real value list instead of typing a literal. -->\r\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\r\n <mt-formula-toolbar-item\r\n type=\"property\"\r\n [value]=\"prop.key\"\r\n [display]=\"prop.name\"\r\n [description]=\"\r\n prop.description || t('property') + ': ' + prop.key\r\n \"\r\n propertyType=\"current\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n <!-- Only set when another property shares this display\r\n name, so identical chips can still be told apart. -->\r\n @if (qualifierFor(prop.key); as qualifier) {\r\n <span\r\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\r\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\r\n >{{ qualifier }}</span\r\n >\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"ms-0.5 inline-flex h-[26px] w-6 shrink-0 cursor-pointer items-center justify-center rounded bg-amber-100 text-amber-700 transition-colors hover:bg-amber-200 active:scale-95 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/50\"\r\n [attr.aria-expanded]=\"isPropertyExpanded(prop.key)\"\r\n [attr.aria-label]=\"\r\n (labels()?.values ?? t('values')) +\r\n ': ' +\r\n (prop.name || prop.key)\r\n \"\r\n [title]=\"\r\n (labels()?.values ?? t('values')) +\r\n ': ' +\r\n (prop.name || prop.key)\r\n \"\r\n (click)=\"togglePropertyValues(prop)\"\r\n >\r\n <svg\r\n class=\"h-3.5 w-3.5 transition-transform duration-200\"\r\n [class.rotate-180]=\"isPropertyExpanded(prop.key)\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2.5\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\"\r\n />\r\n </svg>\r\n </button>\r\n </span>\r\n } @else {\r\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\r\n <mt-formula-toolbar-item\r\n type=\"property\"\r\n [value]=\"prop.key\"\r\n [display]=\"prop.name\"\r\n [description]=\"\r\n prop.description || t('property') + ': ' + prop.key\r\n \"\r\n propertyType=\"current\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n @if (qualifierFor(prop.key); as qualifier) {\r\n <span\r\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\r\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\r\n >{{ qualifier }}</span\r\n >\r\n }\r\n </span>\r\n }\r\n }\r\n </div>\r\n\r\n <!-- Values of the expanded property. Each chip inserts the\r\n item's key (what the engine compares) and only shows its\r\n name, so the value can never be mistyped. -->\r\n @if (expandedProperty(); as expanded) {\r\n <div\r\n class=\"mt-2.5 rounded-md border border-dashed border-slate-300 p-2.5 dark:border-slate-600\"\r\n >\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n class=\"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\r\n >\r\n {{ labels()?.values ?? t(\"values\") }}\r\n </span>\r\n <span\r\n class=\"truncate text-xs text-slate-400 dark:text-slate-500\"\r\n >{{ expanded.name || expanded.key }}</span\r\n >\r\n <span\r\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\r\n ></span>\r\n </div>\r\n\r\n @if (isLoadingExpandedValues()) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (placeholder of [1, 2, 3]; track placeholder) {\r\n <span\r\n class=\"h-[26px] w-20 animate-pulse rounded bg-slate-200 dark:bg-slate-700\"\r\n ></span>\r\n }\r\n </div>\r\n } @else if (hasNoExpandedValues()) {\r\n <p class=\"text-sm text-slate-400 dark:text-slate-500\">\r\n {{\r\n labels()?.noValuesAvailable ?? t(\"noValuesAvailable\")\r\n }}\r\n </p>\r\n } @else {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (\r\n item of expandedPropertyValues();\r\n track item.key\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex min-w-0 max-w-full cursor-pointer items-center rounded bg-emerald-100 px-2 py-1 text-sm font-medium text-emerald-700 transition-colors hover:bg-emerald-200 hover:shadow-sm active:scale-95 dark:bg-emerald-900/30 dark:text-emerald-300 dark:hover:bg-emerald-900/50\"\r\n [title]=\"item.key\"\r\n (click)=\"insertPropertyValue(item)\"\r\n >\r\n <span class=\"truncate\">{{ item.name }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n @case (\"operators\") {\r\n @if (filteredOperators().length === 0) {\r\n <div\r\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\r\n >\r\n {{ labels()?.noOperatorsFound ?? t(\"noOperatorsFound\") }}\r\n </div>\r\n } @else {\r\n <div class=\"space-y-3\">\r\n @for (group of operatorGroups(); track group.type) {\r\n <div>\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\r\n >\r\n {{ operatorTypeLabel(group.type) }}\r\n </span>\r\n <span\r\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\r\n ></span>\r\n </div>\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (op of group.operators; track op.symbol) {\r\n <mt-formula-toolbar-item\r\n type=\"operator\"\r\n [value]=\"op.symbol\"\r\n [description]=\"op.description\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i1$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: FormulaToolbarItem, selector: "mt-formula-toolbar-item", inputs: ["type", "value", "display", "description", "signature", "examples", "template", "templateCursorOffset", "hints", "returnType", "parameters", "propertyType"], outputs: ["onInsert"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2857
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: FormulaToolbar, isStandalone: true, selector: "mt-formula-toolbar", inputs: { knownProperties: { classPropertyName: "knownProperties", publicName: "knownProperties", isSignal: true, isRequired: false, transformFunction: null }, propertiesTemplate: { classPropertyName: "propertiesTemplate", publicName: "propertiesTemplate", isSignal: true, isRequired: false, transformFunction: null }, propertyValues: { classPropertyName: "propertyValues", publicName: "propertyValues", isSignal: true, isRequired: false, transformFunction: null }, loadingValuesFor: { classPropertyName: "loadingValuesFor", publicName: "loadingValuesFor", isSignal: true, isRequired: false, transformFunction: null }, functionCategories: { classPropertyName: "functionCategories", publicName: "functionCategories", isSignal: true, isRequired: false, transformFunction: null }, operators: { classPropertyName: "operators", publicName: "operators", isSignal: true, isRequired: false, transformFunction: null }, initialTab: { classPropertyName: "initialTab", publicName: "initialTab", isSignal: true, isRequired: false, transformFunction: null }, visibleTabs: { classPropertyName: "visibleTabs", publicName: "visibleTabs", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onBlockInsert: "onBlockInsert", onTabChange: "onTabChange", onPropertyValuesRequest: "onPropertyValuesRequest" }, queries: [{ propertyName: "projectedPropertiesTemplate", first: true, predicate: ["properties"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<div\n *transloco=\"let t; prefix: 'components.formula.toolbar'\"\n class=\"flex flex-col border-b border-slate-200 dark:border-slate-700\"\n [class.h-52]=\"activeTab() !== 'properties' || !resolvedPropertiesTemplate()\"\n>\n <!-- Top Bar: Search + Quick Insert -->\n <div\n class=\"flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-slate-700\"\n >\n <!-- Search Field -->\n <div class=\"relative flex-1\">\n <svg\n class=\"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\n />\n </svg>\n <input\n type=\"text\"\n class=\"w-full rounded-lg border border-slate-300 bg-white py-1.5 ps-9 pe-8 text-sm text-slate-700 placeholder:text-slate-400 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-200 dark:placeholder:text-slate-500\"\n [placeholder]=\"searchPlaceholder() || t('search')\"\n [(ngModel)]=\"searchQuery\"\n />\n @if (searchQuery()) {\n <button\n type=\"button\"\n class=\"absolute end-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 transition-all duration-200 dark:hover:bg-slate-700\"\n (click)=\"clearSearch()\"\n >\n <svg\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n }\n </div>\n\n <!-- Separator -->\n <div class=\"h-6 w-px bg-slate-200 dark:bg-slate-600\"></div>\n\n <!-- Quick Insert Input -->\n <div class=\"relative flex items-center gap-2\">\n <span\n class=\"text-sm font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide\"\n >{{ t(\"insertLabel\") }}:</span\n >\n <div class=\"relative\">\n <input\n #customValueInput\n type=\"text\"\n class=\"w-32 rounded-md border border-dashed border-slate-300 bg-slate-50 px-3 py-1.5 text-sm font-mono text-slate-700 placeholder:text-slate-400 focus:border-primary focus:bg-white focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:placeholder:text-slate-500 dark:focus:bg-slate-900\"\n [placeholder]=\"t('customValuePlaceholder')\"\n [(ngModel)]=\"customValue\"\n (keydown.enter)=\"insertCustomValue()\"\n (keydown.escape)=\"clearCustomValue()\"\n />\n </div>\n\n <!-- Insert Button with Type Preview -->\n @if (customValue()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all duration-200 hover:shadow-sm active:scale-95\"\n [class]=\"customValueTypeClass()\"\n (click)=\"insertCustomValue()\"\n [title]=\"t('insertType', { type: customValueType() })\"\n >\n @switch (customValueType()) {\n @case (\"boolean\") {\n <span class=\"text-xs\">{{ t(\"booleanType\") }}</span>\n }\n @case (\"number\") {\n <svg\n class=\"h-3 w-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\"\n />\n </svg>\n }\n @case (\"string\") {\n <svg\n class=\"h-3 w-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z\"\n />\n </svg>\n }\n @default {\n <svg\n class=\"h-3 w-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </svg>\n }\n }\n <span class=\"max-w-16 truncate\">{{ customValuePreview() }}</span>\n </button>\n }\n </div>\n </div>\n\n <!-- Main Content Row -->\n <div class=\"flex flex-1 overflow-hidden\">\n <!-- Vertical Tabs -->\n <div\n class=\"flex w-44 flex-col border-e border-slate-200 dark:border-slate-700\"\n >\n @for (tab of resolvedTabOptions(); track tab.value) {\n <button\n type=\"button\"\n class=\"flex cursor-pointer items-center gap-2 px-3 py-2.5 text-start text-sm font-medium transition-all duration-200\"\n [class]=\"\n activeTab() === tab.value\n ? 'bg-white border-e-2 border-primary text-primary dark:bg-slate-900'\n : searchQuery() && !tabHasResults(tab.value)\n ? 'text-slate-300 dark:text-slate-600'\n : 'text-slate-600 hover:bg-slate-100 hover:text-slate-800 dark:text-slate-300 dark:hover:bg-slate-700'\n \"\n (click)=\"setActiveTab(tab.value)\"\n >\n <!-- Tab Icons -->\n @switch (tab.value) {\n @case (\"functions\") {\n <svg\n class=\"h-5 w-5 shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5\"\n />\n </svg>\n }\n @case (\"properties\") {\n <svg\n class=\"h-5 w-5 shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z\"\n />\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6 6h.008v.008H6V6z\"\n />\n </svg>\n }\n @case (\"operators\") {\n <svg\n class=\"h-5 w-5 shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 15.75V18m-7.5-6.75h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V13.5zm0 2.25h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V18zm2.498-6.75h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V13.5zm0 2.25h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V18zm2.504-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zm0 2.25h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V18zm2.498-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zM8.25 6h7.5v2.25h-7.5V6zM12 2.25c-1.892 0-3.758.11-5.593.322C5.307 2.7 4.5 3.65 4.5 4.757V19.5a2.25 2.25 0 002.25 2.25h10.5a2.25 2.25 0 002.25-2.25V4.757c0-1.108-.806-2.057-1.907-2.185A48.507 48.507 0 0012 2.25z\"\n />\n </svg>\n }\n }\n <!-- Label (always visible) -->\n <span class=\"truncate whitespace-nowrap text-sm\">{{\n t(tab.value)\n }}</span>\n <!-- Count Badge -->\n @if (tab.value !== \"properties\" || !resolvedPropertiesTemplate()) {\n <span\n class=\"ms-auto rounded-full px-1.5 py-0.5 text-xs font-semibold\"\n [class]=\"\n activeTab() === tab.value\n ? 'bg-primary/10 text-primary'\n : 'bg-slate-200 text-slate-600 dark:bg-slate-600 dark:text-slate-300'\n \"\n >\n {{ getTabCount(tab.value) }}\n </span>\n }\n </button>\n }\n </div>\n\n <!-- Content Area -->\n <div class=\"flex flex-1 flex-col overflow-hidden\">\n <!-- Items Grid -->\n <div\n class=\"flex-1 p-2.5\"\n [class.overflow-y-auto]=\"\n activeTab() !== 'properties' || !resolvedPropertiesTemplate()\n \"\n >\n @switch (activeTab()) {\n @case (\"functions\") {\n @if (filteredCategories().length === 0) {\n <div\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\n >\n {{ labels()?.noFunctionsFound ?? t(\"noFunctionsFound\") }}\n </div>\n } @else {\n <div class=\"space-y-3\">\n @for (category of filteredCategories(); track category.name) {\n <div>\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\n >\n {{ categoryLabel(category) }}\n </span>\n <span\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\n ></span>\n <span\n class=\"text-sm text-slate-400 dark:text-slate-500\"\n >{{ category.functions.length }}</span\n >\n </div>\n <div class=\"flex flex-wrap gap-1.5\">\n @for (fn of category.functions; track fn.name) {\n <mt-formula-toolbar-item\n type=\"function\"\n [value]=\"fn.name\"\n [description]=\"fn.description\"\n [signature]=\"fn.signature\"\n [template]=\"fn.template\"\n [templateCursorOffset]=\"fn.templateCursorOffset\"\n [returnType]=\"fn.returnType\"\n [parameters]=\"fn.parameters ?? []\"\n [examples]=\"fn.examples ?? []\"\n [hints]=\"fn.hints ?? []\"\n (onInsert)=\"insertBlock($event)\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n @case (\"properties\") {\n @if (resolvedPropertiesTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"propertiesTemplateContext\"\n />\n } @else {\n @if (filteredProperties().length === 0) {\n <div\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\n >\n {{\n labels()?.noPropertiesAvailable ??\n t(\"noPropertiesAvailable\")\n }}\n </div>\n } @else {\n <div class=\"flex flex-wrap gap-1.5\">\n @for (prop of filteredProperties(); track prop.key) {\n @if (prop.hasValues) {\n <!-- Value-backed property: insert the property itself, or\n open its real value list instead of typing a literal. -->\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\n <mt-formula-toolbar-item\n type=\"property\"\n [value]=\"prop.key\"\n [display]=\"prop.name\"\n [description]=\"\n prop.description || t('property') + ': ' + prop.key\n \"\n propertyType=\"current\"\n (onInsert)=\"insertBlock($event)\"\n />\n <!-- Only set when another property shares this display\n name, so identical chips can still be told apart. -->\n @if (qualifierFor(prop.key); as qualifier) {\n <span\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\n >{{ qualifier }}</span\n >\n }\n <button\n type=\"button\"\n class=\"ms-0.5 inline-flex h-[26px] w-6 shrink-0 cursor-pointer items-center justify-center rounded bg-amber-100 text-amber-700 transition-colors hover:bg-amber-200 active:scale-95 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/50\"\n [attr.aria-expanded]=\"isPropertyExpanded(prop.key)\"\n [attr.aria-label]=\"\n (labels()?.values ?? t('values')) +\n ': ' +\n (prop.name || prop.key)\n \"\n [title]=\"\n (labels()?.values ?? t('values')) +\n ': ' +\n (prop.name || prop.key)\n \"\n (click)=\"togglePropertyValues(prop)\"\n >\n <svg\n class=\"h-3.5 w-3.5 transition-transform duration-200\"\n [class.rotate-180]=\"isPropertyExpanded(prop.key)\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\"\n />\n </svg>\n </button>\n </span>\n } @else {\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\n <mt-formula-toolbar-item\n type=\"property\"\n [value]=\"prop.key\"\n [display]=\"prop.name\"\n [description]=\"\n prop.description || t('property') + ': ' + prop.key\n \"\n propertyType=\"current\"\n (onInsert)=\"insertBlock($event)\"\n />\n @if (qualifierFor(prop.key); as qualifier) {\n <span\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\n >{{ qualifier }}</span\n >\n }\n </span>\n }\n }\n </div>\n\n <!-- Values of the expanded property. Each chip inserts the\n item's key (what the engine compares) and only shows its\n name, so the value can never be mistyped. -->\n @if (expandedProperty(); as expanded) {\n <div\n class=\"mt-2.5 rounded-md border border-dashed border-slate-300 p-2.5 dark:border-slate-600\"\n >\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n class=\"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\n >\n {{ labels()?.values ?? t(\"values\") }}\n </span>\n <span\n class=\"truncate text-xs text-slate-400 dark:text-slate-500\"\n >{{ expanded.name || expanded.key }}</span\n >\n <span\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\n ></span>\n </div>\n\n @if (isLoadingExpandedValues()) {\n <div class=\"flex flex-wrap gap-1.5\">\n @for (placeholder of [1, 2, 3]; track placeholder) {\n <span\n class=\"h-[26px] w-20 animate-pulse rounded bg-slate-200 dark:bg-slate-700\"\n ></span>\n }\n </div>\n } @else if (hasNoExpandedValues()) {\n <p class=\"text-sm text-slate-400 dark:text-slate-500\">\n {{\n labels()?.noValuesAvailable ?? t(\"noValuesAvailable\")\n }}\n </p>\n } @else {\n <div class=\"flex flex-wrap gap-1.5\">\n @for (\n item of expandedPropertyValues();\n track item.key\n ) {\n <button\n type=\"button\"\n class=\"inline-flex min-w-0 max-w-full cursor-pointer items-center rounded bg-emerald-100 px-2 py-1 text-sm font-medium text-emerald-700 transition-colors hover:bg-emerald-200 hover:shadow-sm active:scale-95 dark:bg-emerald-900/30 dark:text-emerald-300 dark:hover:bg-emerald-900/50\"\n [title]=\"item.key\"\n (click)=\"insertPropertyValue(item)\"\n >\n <span class=\"truncate\">{{ item.name }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n }\n }\n }\n @case (\"operators\") {\n @if (filteredOperators().length === 0) {\n <div\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\n >\n {{ labels()?.noOperatorsFound ?? t(\"noOperatorsFound\") }}\n </div>\n } @else {\n <div class=\"space-y-3\">\n @for (group of operatorGroups(); track group.type) {\n <div>\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\n >\n {{ operatorTypeLabel(group.type) }}\n </span>\n <span\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\n ></span>\n </div>\n <div class=\"flex flex-wrap gap-1.5\">\n @for (op of group.operators; track op.symbol) {\n <mt-formula-toolbar-item\n type=\"operator\"\n [value]=\"op.symbol\"\n [description]=\"op.description\"\n (onInsert)=\"insertBlock($event)\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i1$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: FormulaToolbarItem, selector: "mt-formula-toolbar-item", inputs: ["type", "value", "display", "description", "signature", "examples", "template", "templateCursorOffset", "hints", "returnType", "parameters", "propertyType"], outputs: ["onInsert"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2858
2858
  }
2859
2859
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FormulaToolbar, decorators: [{
2860
2860
  type: Component,
2861
- args: [{ selector: 'mt-formula-toolbar', standalone: true, imports: [CommonModule, FormsModule, TranslocoModule, FormulaToolbarItem], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n *transloco=\"let t; prefix: 'components.formula.toolbar'\"\r\n class=\"flex flex-col border-b border-slate-200 dark:border-slate-700\"\r\n [class.h-52]=\"activeTab() !== 'properties' || !resolvedPropertiesTemplate()\"\r\n>\r\n <!-- Top Bar: Search + Quick Insert -->\r\n <div\r\n class=\"flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-slate-700\"\r\n >\r\n <!-- Search Field -->\r\n <div class=\"relative flex-1\">\r\n <svg\r\n class=\"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\r\n />\r\n </svg>\r\n <input\r\n type=\"text\"\r\n class=\"w-full rounded-lg border border-slate-300 bg-white py-1.5 ps-9 pe-8 text-sm text-slate-700 placeholder:text-slate-400 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-200 dark:placeholder:text-slate-500\"\r\n [placeholder]=\"searchPlaceholder() || t('search')\"\r\n [(ngModel)]=\"searchQuery\"\r\n />\r\n @if (searchQuery()) {\r\n <button\r\n type=\"button\"\r\n class=\"absolute end-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 transition-all duration-200 dark:hover:bg-slate-700\"\r\n (click)=\"clearSearch()\"\r\n >\r\n <svg\r\n class=\"h-4 w-4\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M6 18L18 6M6 6l12 12\"\r\n />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- Separator -->\r\n <div class=\"h-6 w-px bg-slate-200 dark:bg-slate-600\"></div>\r\n\r\n <!-- Quick Insert Input -->\r\n <div class=\"relative flex items-center gap-2\">\r\n <span\r\n class=\"text-sm font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide\"\r\n >{{ t(\"insertLabel\") }}:</span\r\n >\r\n <div class=\"relative\">\r\n <input\r\n #customValueInput\r\n type=\"text\"\r\n class=\"w-32 rounded-md border border-dashed border-slate-300 bg-slate-50 px-3 py-1.5 text-sm font-mono text-slate-700 placeholder:text-slate-400 focus:border-primary focus:bg-white focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:placeholder:text-slate-500 dark:focus:bg-slate-900\"\r\n [placeholder]=\"t('customValuePlaceholder')\"\r\n [(ngModel)]=\"customValue\"\r\n (keydown.enter)=\"insertCustomValue()\"\r\n (keydown.escape)=\"clearCustomValue()\"\r\n />\r\n </div>\r\n\r\n <!-- Insert Button with Type Preview -->\r\n @if (customValue()) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all duration-200 hover:shadow-sm active:scale-95\"\r\n [class]=\"customValueTypeClass()\"\r\n (click)=\"insertCustomValue()\"\r\n [title]=\"t('insertType', { type: customValueType() })\"\r\n >\r\n @switch (customValueType()) {\r\n @case (\"boolean\") {\r\n <span class=\"text-xs\">{{ t(\"booleanType\") }}</span>\r\n }\r\n @case (\"number\") {\r\n <svg\r\n class=\"h-3 w-3\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\"\r\n />\r\n </svg>\r\n }\r\n @case (\"string\") {\r\n <svg\r\n class=\"h-3 w-3\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z\"\r\n />\r\n </svg>\r\n }\r\n @default {\r\n <svg\r\n class=\"h-3 w-3\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M12 4.5v15m7.5-7.5h-15\"\r\n />\r\n </svg>\r\n }\r\n }\r\n <span class=\"max-w-16 truncate\">{{ customValuePreview() }}</span>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Main Content Row -->\r\n <div class=\"flex flex-1 overflow-hidden\">\r\n <!-- Vertical Tabs -->\r\n <div\r\n class=\"flex w-44 flex-col border-e border-slate-200 dark:border-slate-700\"\r\n >\r\n @for (tab of resolvedTabOptions(); track tab.value) {\r\n <button\r\n type=\"button\"\r\n class=\"flex cursor-pointer items-center gap-2 px-3 py-2.5 text-start text-sm font-medium transition-all duration-200\"\r\n [class]=\"\r\n activeTab() === tab.value\r\n ? 'bg-white border-e-2 border-primary text-primary dark:bg-slate-900'\r\n : searchQuery() && !tabHasResults(tab.value)\r\n ? 'text-slate-300 dark:text-slate-600'\r\n : 'text-slate-600 hover:bg-slate-100 hover:text-slate-800 dark:text-slate-300 dark:hover:bg-slate-700'\r\n \"\r\n (click)=\"setActiveTab(tab.value)\"\r\n >\r\n <!-- Tab Icons -->\r\n @switch (tab.value) {\r\n @case (\"functions\") {\r\n <svg\r\n class=\"h-5 w-5 shrink-0\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5\"\r\n />\r\n </svg>\r\n }\r\n @case (\"properties\") {\r\n <svg\r\n class=\"h-5 w-5 shrink-0\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z\"\r\n />\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M6 6h.008v.008H6V6z\"\r\n />\r\n </svg>\r\n }\r\n @case (\"operators\") {\r\n <svg\r\n class=\"h-5 w-5 shrink-0\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M15.75 15.75V18m-7.5-6.75h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V13.5zm0 2.25h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V18zm2.498-6.75h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V13.5zm0 2.25h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V18zm2.504-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zm0 2.25h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V18zm2.498-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zM8.25 6h7.5v2.25h-7.5V6zM12 2.25c-1.892 0-3.758.11-5.593.322C5.307 2.7 4.5 3.65 4.5 4.757V19.5a2.25 2.25 0 002.25 2.25h10.5a2.25 2.25 0 002.25-2.25V4.757c0-1.108-.806-2.057-1.907-2.185A48.507 48.507 0 0012 2.25z\"\r\n />\r\n </svg>\r\n }\r\n }\r\n <!-- Label (always visible) -->\r\n <span class=\"truncate whitespace-nowrap text-sm\">{{\r\n t(tab.value)\r\n }}</span>\r\n <!-- Count Badge -->\r\n @if (tab.value !== \"properties\" || !resolvedPropertiesTemplate()) {\r\n <span\r\n class=\"ms-auto rounded-full px-1.5 py-0.5 text-xs font-semibold\"\r\n [class]=\"\r\n activeTab() === tab.value\r\n ? 'bg-primary/10 text-primary'\r\n : 'bg-slate-200 text-slate-600 dark:bg-slate-600 dark:text-slate-300'\r\n \"\r\n >\r\n {{ getTabCount(tab.value) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- Content Area -->\r\n <div class=\"flex flex-1 flex-col overflow-hidden\">\r\n <!-- Items Grid -->\r\n <div\r\n class=\"flex-1 p-2.5\"\r\n [class.overflow-y-auto]=\"\r\n activeTab() !== 'properties' || !resolvedPropertiesTemplate()\r\n \"\r\n >\r\n @switch (activeTab()) {\r\n @case (\"functions\") {\r\n @if (filteredCategories().length === 0) {\r\n <div\r\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\r\n >\r\n {{ labels()?.noFunctionsFound ?? t(\"noFunctionsFound\") }}\r\n </div>\r\n } @else {\r\n <div class=\"space-y-3\">\r\n @for (category of filteredCategories(); track category.name) {\r\n <div>\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\r\n >\r\n {{ categoryLabel(category) }}\r\n </span>\r\n <span\r\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\r\n ></span>\r\n <span\r\n class=\"text-sm text-slate-400 dark:text-slate-500\"\r\n >{{ category.functions.length }}</span\r\n >\r\n </div>\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (fn of category.functions; track fn.name) {\r\n <mt-formula-toolbar-item\r\n type=\"function\"\r\n [value]=\"fn.name\"\r\n [description]=\"fn.description\"\r\n [signature]=\"fn.signature\"\r\n [template]=\"fn.template\"\r\n [templateCursorOffset]=\"fn.templateCursorOffset\"\r\n [returnType]=\"fn.returnType\"\r\n [parameters]=\"fn.parameters ?? []\"\r\n [examples]=\"fn.examples ?? []\"\r\n [hints]=\"fn.hints ?? []\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n @case (\"properties\") {\r\n @if (resolvedPropertiesTemplate(); as template) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"template\"\r\n [ngTemplateOutletContext]=\"propertiesTemplateContext\"\r\n />\r\n } @else {\r\n @if (filteredProperties().length === 0) {\r\n <div\r\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\r\n >\r\n {{\r\n labels()?.noPropertiesAvailable ??\r\n t(\"noPropertiesAvailable\")\r\n }}\r\n </div>\r\n } @else {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (prop of filteredProperties(); track prop.key) {\r\n @if (prop.hasValues) {\r\n <!-- Value-backed property: insert the property itself, or\r\n open its real value list instead of typing a literal. -->\r\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\r\n <mt-formula-toolbar-item\r\n type=\"property\"\r\n [value]=\"prop.key\"\r\n [display]=\"prop.name\"\r\n [description]=\"\r\n prop.description || t('property') + ': ' + prop.key\r\n \"\r\n propertyType=\"current\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n <!-- Only set when another property shares this display\r\n name, so identical chips can still be told apart. -->\r\n @if (qualifierFor(prop.key); as qualifier) {\r\n <span\r\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\r\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\r\n >{{ qualifier }}</span\r\n >\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"ms-0.5 inline-flex h-[26px] w-6 shrink-0 cursor-pointer items-center justify-center rounded bg-amber-100 text-amber-700 transition-colors hover:bg-amber-200 active:scale-95 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/50\"\r\n [attr.aria-expanded]=\"isPropertyExpanded(prop.key)\"\r\n [attr.aria-label]=\"\r\n (labels()?.values ?? t('values')) +\r\n ': ' +\r\n (prop.name || prop.key)\r\n \"\r\n [title]=\"\r\n (labels()?.values ?? t('values')) +\r\n ': ' +\r\n (prop.name || prop.key)\r\n \"\r\n (click)=\"togglePropertyValues(prop)\"\r\n >\r\n <svg\r\n class=\"h-3.5 w-3.5 transition-transform duration-200\"\r\n [class.rotate-180]=\"isPropertyExpanded(prop.key)\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2.5\"\r\n >\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\"\r\n />\r\n </svg>\r\n </button>\r\n </span>\r\n } @else {\r\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\r\n <mt-formula-toolbar-item\r\n type=\"property\"\r\n [value]=\"prop.key\"\r\n [display]=\"prop.name\"\r\n [description]=\"\r\n prop.description || t('property') + ': ' + prop.key\r\n \"\r\n propertyType=\"current\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n @if (qualifierFor(prop.key); as qualifier) {\r\n <span\r\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\r\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\r\n >{{ qualifier }}</span\r\n >\r\n }\r\n </span>\r\n }\r\n }\r\n </div>\r\n\r\n <!-- Values of the expanded property. Each chip inserts the\r\n item's key (what the engine compares) and only shows its\r\n name, so the value can never be mistyped. -->\r\n @if (expandedProperty(); as expanded) {\r\n <div\r\n class=\"mt-2.5 rounded-md border border-dashed border-slate-300 p-2.5 dark:border-slate-600\"\r\n >\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n class=\"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\r\n >\r\n {{ labels()?.values ?? t(\"values\") }}\r\n </span>\r\n <span\r\n class=\"truncate text-xs text-slate-400 dark:text-slate-500\"\r\n >{{ expanded.name || expanded.key }}</span\r\n >\r\n <span\r\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\r\n ></span>\r\n </div>\r\n\r\n @if (isLoadingExpandedValues()) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (placeholder of [1, 2, 3]; track placeholder) {\r\n <span\r\n class=\"h-[26px] w-20 animate-pulse rounded bg-slate-200 dark:bg-slate-700\"\r\n ></span>\r\n }\r\n </div>\r\n } @else if (hasNoExpandedValues()) {\r\n <p class=\"text-sm text-slate-400 dark:text-slate-500\">\r\n {{\r\n labels()?.noValuesAvailable ?? t(\"noValuesAvailable\")\r\n }}\r\n </p>\r\n } @else {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (\r\n item of expandedPropertyValues();\r\n track item.key\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex min-w-0 max-w-full cursor-pointer items-center rounded bg-emerald-100 px-2 py-1 text-sm font-medium text-emerald-700 transition-colors hover:bg-emerald-200 hover:shadow-sm active:scale-95 dark:bg-emerald-900/30 dark:text-emerald-300 dark:hover:bg-emerald-900/50\"\r\n [title]=\"item.key\"\r\n (click)=\"insertPropertyValue(item)\"\r\n >\r\n <span class=\"truncate\">{{ item.name }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n @case (\"operators\") {\r\n @if (filteredOperators().length === 0) {\r\n <div\r\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\r\n >\r\n {{ labels()?.noOperatorsFound ?? t(\"noOperatorsFound\") }}\r\n </div>\r\n } @else {\r\n <div class=\"space-y-3\">\r\n @for (group of operatorGroups(); track group.type) {\r\n <div>\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\r\n >\r\n {{ operatorTypeLabel(group.type) }}\r\n </span>\r\n <span\r\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\r\n ></span>\r\n </div>\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (op of group.operators; track op.symbol) {\r\n <mt-formula-toolbar-item\r\n type=\"operator\"\r\n [value]=\"op.symbol\"\r\n [description]=\"op.description\"\r\n (onInsert)=\"insertBlock($event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
2861
+ args: [{ selector: 'mt-formula-toolbar', standalone: true, imports: [CommonModule, FormsModule, TranslocoModule, FormulaToolbarItem], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *transloco=\"let t; prefix: 'components.formula.toolbar'\"\n class=\"flex flex-col border-b border-slate-200 dark:border-slate-700\"\n [class.h-52]=\"activeTab() !== 'properties' || !resolvedPropertiesTemplate()\"\n>\n <!-- Top Bar: Search + Quick Insert -->\n <div\n class=\"flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-slate-700\"\n >\n <!-- Search Field -->\n <div class=\"relative flex-1\">\n <svg\n class=\"absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\n />\n </svg>\n <input\n type=\"text\"\n class=\"w-full rounded-lg border border-slate-300 bg-white py-1.5 ps-9 pe-8 text-sm text-slate-700 placeholder:text-slate-400 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-200 dark:placeholder:text-slate-500\"\n [placeholder]=\"searchPlaceholder() || t('search')\"\n [(ngModel)]=\"searchQuery\"\n />\n @if (searchQuery()) {\n <button\n type=\"button\"\n class=\"absolute end-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 transition-all duration-200 dark:hover:bg-slate-700\"\n (click)=\"clearSearch()\"\n >\n <svg\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n }\n </div>\n\n <!-- Separator -->\n <div class=\"h-6 w-px bg-slate-200 dark:bg-slate-600\"></div>\n\n <!-- Quick Insert Input -->\n <div class=\"relative flex items-center gap-2\">\n <span\n class=\"text-sm font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide\"\n >{{ t(\"insertLabel\") }}:</span\n >\n <div class=\"relative\">\n <input\n #customValueInput\n type=\"text\"\n class=\"w-32 rounded-md border border-dashed border-slate-300 bg-slate-50 px-3 py-1.5 text-sm font-mono text-slate-700 placeholder:text-slate-400 focus:border-primary focus:bg-white focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all duration-200 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:placeholder:text-slate-500 dark:focus:bg-slate-900\"\n [placeholder]=\"t('customValuePlaceholder')\"\n [(ngModel)]=\"customValue\"\n (keydown.enter)=\"insertCustomValue()\"\n (keydown.escape)=\"clearCustomValue()\"\n />\n </div>\n\n <!-- Insert Button with Type Preview -->\n @if (customValue()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-all duration-200 hover:shadow-sm active:scale-95\"\n [class]=\"customValueTypeClass()\"\n (click)=\"insertCustomValue()\"\n [title]=\"t('insertType', { type: customValueType() })\"\n >\n @switch (customValueType()) {\n @case (\"boolean\") {\n <span class=\"text-xs\">{{ t(\"booleanType\") }}</span>\n }\n @case (\"number\") {\n <svg\n class=\"h-3 w-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\"\n />\n </svg>\n }\n @case (\"string\") {\n <svg\n class=\"h-3 w-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z\"\n />\n </svg>\n }\n @default {\n <svg\n class=\"h-3 w-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </svg>\n }\n }\n <span class=\"max-w-16 truncate\">{{ customValuePreview() }}</span>\n </button>\n }\n </div>\n </div>\n\n <!-- Main Content Row -->\n <div class=\"flex flex-1 overflow-hidden\">\n <!-- Vertical Tabs -->\n <div\n class=\"flex w-44 flex-col border-e border-slate-200 dark:border-slate-700\"\n >\n @for (tab of resolvedTabOptions(); track tab.value) {\n <button\n type=\"button\"\n class=\"flex cursor-pointer items-center gap-2 px-3 py-2.5 text-start text-sm font-medium transition-all duration-200\"\n [class]=\"\n activeTab() === tab.value\n ? 'bg-white border-e-2 border-primary text-primary dark:bg-slate-900'\n : searchQuery() && !tabHasResults(tab.value)\n ? 'text-slate-300 dark:text-slate-600'\n : 'text-slate-600 hover:bg-slate-100 hover:text-slate-800 dark:text-slate-300 dark:hover:bg-slate-700'\n \"\n (click)=\"setActiveTab(tab.value)\"\n >\n <!-- Tab Icons -->\n @switch (tab.value) {\n @case (\"functions\") {\n <svg\n class=\"h-5 w-5 shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5\"\n />\n </svg>\n }\n @case (\"properties\") {\n <svg\n class=\"h-5 w-5 shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z\"\n />\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6 6h.008v.008H6V6z\"\n />\n </svg>\n }\n @case (\"operators\") {\n <svg\n class=\"h-5 w-5 shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 15.75V18m-7.5-6.75h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V13.5zm0 2.25h.008v.008H8.25v-.008zm0 2.25h.008v.008H8.25V18zm2.498-6.75h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V13.5zm0 2.25h.007v.008h-.007v-.008zm0 2.25h.007v.008h-.007V18zm2.504-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zm0 2.25h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V18zm2.498-6.75h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V13.5zM8.25 6h7.5v2.25h-7.5V6zM12 2.25c-1.892 0-3.758.11-5.593.322C5.307 2.7 4.5 3.65 4.5 4.757V19.5a2.25 2.25 0 002.25 2.25h10.5a2.25 2.25 0 002.25-2.25V4.757c0-1.108-.806-2.057-1.907-2.185A48.507 48.507 0 0012 2.25z\"\n />\n </svg>\n }\n }\n <!-- Label (always visible) -->\n <span class=\"truncate whitespace-nowrap text-sm\">{{\n t(tab.value)\n }}</span>\n <!-- Count Badge -->\n @if (tab.value !== \"properties\" || !resolvedPropertiesTemplate()) {\n <span\n class=\"ms-auto rounded-full px-1.5 py-0.5 text-xs font-semibold\"\n [class]=\"\n activeTab() === tab.value\n ? 'bg-primary/10 text-primary'\n : 'bg-slate-200 text-slate-600 dark:bg-slate-600 dark:text-slate-300'\n \"\n >\n {{ getTabCount(tab.value) }}\n </span>\n }\n </button>\n }\n </div>\n\n <!-- Content Area -->\n <div class=\"flex flex-1 flex-col overflow-hidden\">\n <!-- Items Grid -->\n <div\n class=\"flex-1 p-2.5\"\n [class.overflow-y-auto]=\"\n activeTab() !== 'properties' || !resolvedPropertiesTemplate()\n \"\n >\n @switch (activeTab()) {\n @case (\"functions\") {\n @if (filteredCategories().length === 0) {\n <div\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\n >\n {{ labels()?.noFunctionsFound ?? t(\"noFunctionsFound\") }}\n </div>\n } @else {\n <div class=\"space-y-3\">\n @for (category of filteredCategories(); track category.name) {\n <div>\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\n >\n {{ categoryLabel(category) }}\n </span>\n <span\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\n ></span>\n <span\n class=\"text-sm text-slate-400 dark:text-slate-500\"\n >{{ category.functions.length }}</span\n >\n </div>\n <div class=\"flex flex-wrap gap-1.5\">\n @for (fn of category.functions; track fn.name) {\n <mt-formula-toolbar-item\n type=\"function\"\n [value]=\"fn.name\"\n [description]=\"fn.description\"\n [signature]=\"fn.signature\"\n [template]=\"fn.template\"\n [templateCursorOffset]=\"fn.templateCursorOffset\"\n [returnType]=\"fn.returnType\"\n [parameters]=\"fn.parameters ?? []\"\n [examples]=\"fn.examples ?? []\"\n [hints]=\"fn.hints ?? []\"\n (onInsert)=\"insertBlock($event)\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n @case (\"properties\") {\n @if (resolvedPropertiesTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"propertiesTemplateContext\"\n />\n } @else {\n @if (filteredProperties().length === 0) {\n <div\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\n >\n {{\n labels()?.noPropertiesAvailable ??\n t(\"noPropertiesAvailable\")\n }}\n </div>\n } @else {\n <div class=\"flex flex-wrap gap-1.5\">\n @for (prop of filteredProperties(); track prop.key) {\n @if (prop.hasValues) {\n <!-- Value-backed property: insert the property itself, or\n open its real value list instead of typing a literal. -->\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\n <mt-formula-toolbar-item\n type=\"property\"\n [value]=\"prop.key\"\n [display]=\"prop.name\"\n [description]=\"\n prop.description || t('property') + ': ' + prop.key\n \"\n propertyType=\"current\"\n (onInsert)=\"insertBlock($event)\"\n />\n <!-- Only set when another property shares this display\n name, so identical chips can still be told apart. -->\n @if (qualifierFor(prop.key); as qualifier) {\n <span\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\n >{{ qualifier }}</span\n >\n }\n <button\n type=\"button\"\n class=\"ms-0.5 inline-flex h-[26px] w-6 shrink-0 cursor-pointer items-center justify-center rounded bg-amber-100 text-amber-700 transition-colors hover:bg-amber-200 active:scale-95 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/50\"\n [attr.aria-expanded]=\"isPropertyExpanded(prop.key)\"\n [attr.aria-label]=\"\n (labels()?.values ?? t('values')) +\n ': ' +\n (prop.name || prop.key)\n \"\n [title]=\"\n (labels()?.values ?? t('values')) +\n ': ' +\n (prop.name || prop.key)\n \"\n (click)=\"togglePropertyValues(prop)\"\n >\n <svg\n class=\"h-3.5 w-3.5 transition-transform duration-200\"\n [class.rotate-180]=\"isPropertyExpanded(prop.key)\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\"\n />\n </svg>\n </button>\n </span>\n } @else {\n <span class=\"inline-flex min-w-0 max-w-full items-center\">\n <mt-formula-toolbar-item\n type=\"property\"\n [value]=\"prop.key\"\n [display]=\"prop.name\"\n [description]=\"\n prop.description || t('property') + ': ' + prop.key\n \"\n propertyType=\"current\"\n (onInsert)=\"insertBlock($event)\"\n />\n @if (qualifierFor(prop.key); as qualifier) {\n <span\n class=\"ms-0.5 max-w-28 shrink-0 truncate rounded bg-slate-100 px-1 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-700 dark:text-slate-400\"\n [title]=\"qualifier + ' \u2014 ' + prop.key\"\n >{{ qualifier }}</span\n >\n }\n </span>\n }\n }\n </div>\n\n <!-- Values of the expanded property. Each chip inserts the\n item's key (what the engine compares) and only shows its\n name, so the value can never be mistyped. -->\n @if (expandedProperty(); as expanded) {\n <div\n class=\"mt-2.5 rounded-md border border-dashed border-slate-300 p-2.5 dark:border-slate-600\"\n >\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n class=\"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\n >\n {{ labels()?.values ?? t(\"values\") }}\n </span>\n <span\n class=\"truncate text-xs text-slate-400 dark:text-slate-500\"\n >{{ expanded.name || expanded.key }}</span\n >\n <span\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\n ></span>\n </div>\n\n @if (isLoadingExpandedValues()) {\n <div class=\"flex flex-wrap gap-1.5\">\n @for (placeholder of [1, 2, 3]; track placeholder) {\n <span\n class=\"h-[26px] w-20 animate-pulse rounded bg-slate-200 dark:bg-slate-700\"\n ></span>\n }\n </div>\n } @else if (hasNoExpandedValues()) {\n <p class=\"text-sm text-slate-400 dark:text-slate-500\">\n {{\n labels()?.noValuesAvailable ?? t(\"noValuesAvailable\")\n }}\n </p>\n } @else {\n <div class=\"flex flex-wrap gap-1.5\">\n @for (\n item of expandedPropertyValues();\n track item.key\n ) {\n <button\n type=\"button\"\n class=\"inline-flex min-w-0 max-w-full cursor-pointer items-center rounded bg-emerald-100 px-2 py-1 text-sm font-medium text-emerald-700 transition-colors hover:bg-emerald-200 hover:shadow-sm active:scale-95 dark:bg-emerald-900/30 dark:text-emerald-300 dark:hover:bg-emerald-900/50\"\n [title]=\"item.key\"\n (click)=\"insertPropertyValue(item)\"\n >\n <span class=\"truncate\">{{ item.name }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n }\n }\n }\n @case (\"operators\") {\n @if (filteredOperators().length === 0) {\n <div\n class=\"flex h-full items-center justify-center text-sm text-slate-400 dark:text-slate-500\"\n >\n {{ labels()?.noOperatorsFound ?? t(\"noOperatorsFound\") }}\n </div>\n } @else {\n <div class=\"space-y-3\">\n @for (group of operatorGroups(); track group.type) {\n <div>\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n class=\"text-sm font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400\"\n >\n {{ operatorTypeLabel(group.type) }}\n </span>\n <span\n class=\"h-px flex-1 bg-slate-200/60 dark:bg-slate-700/60\"\n ></span>\n </div>\n <div class=\"flex flex-wrap gap-1.5\">\n @for (op of group.operators; track op.symbol) {\n <mt-formula-toolbar-item\n type=\"operator\"\n [value]=\"op.symbol\"\n [description]=\"op.description\"\n (onInsert)=\"insertBlock($event)\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n </div>\n </div>\n </div>\n</div>\n" }]
2862
2862
  }], ctorParameters: () => [], propDecorators: { knownProperties: [{ type: i0.Input, args: [{ isSignal: true, alias: "knownProperties", required: false }] }], propertiesTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesTemplate", required: false }] }], projectedPropertiesTemplate: [{ type: i0.ContentChild, args: ['properties', { ...{
2863
2863
  read: TemplateRef,
2864
2864
  }, isSignal: true }] }], propertyValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyValues", required: false }] }], loadingValuesFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingValuesFor", required: false }] }], functionCategories: [{ type: i0.Input, args: [{ isSignal: true, alias: "functionCategories", required: false }] }], operators: [{ type: i0.Input, args: [{ isSignal: true, alias: "operators", required: false }] }], initialTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialTab", required: false }] }], visibleTabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleTabs", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], onBlockInsert: [{ type: i0.Output, args: ["onBlockInsert"] }], onTabChange: [{ type: i0.Output, args: ["onTabChange"] }], onPropertyValuesRequest: [{ type: i0.Output, args: ["onPropertyValuesRequest"] }] } });