@masterteam/components 0.0.279 → 0.0.280

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.
@@ -52,7 +52,12 @@ function buildTemplatePayload(action, formValue, externalResolvers) {
52
52
  const payloadKeys = action.payloadKeys ?? Object.keys(template);
53
53
  for (const key of payloadKeys) {
54
54
  if (key === 'fields') {
55
- payload[key] = resolveTemplateFieldsValue(action, template, formValue);
55
+ // The backend declares the operation's inputs as a `fields` template of
56
+ // `{ propertyKey, value: null }` placeholders. Only a host that rendered
57
+ // the operation's real form can fill them (see `hasActionInputFields`),
58
+ // so the values are taken whole from the form or left as declared —
59
+ // never patched per property key from here.
60
+ payload[key] = formValue?.['fields'] ?? template['fields'];
56
61
  continue;
57
62
  }
58
63
  const formFieldValue = formValue?.[key];
@@ -109,6 +114,27 @@ function resolveDefaultPayloadValue(key) {
109
114
  return undefined;
110
115
  }
111
116
  }
117
+ /**
118
+ * The declared operation inputs the payload would submit with no value — the
119
+ * `{ propertyKey, value: null }` placeholders the backend sent, still unfilled.
120
+ *
121
+ * A non-empty result means the action was fired without rendering its form, and
122
+ * submitting it would write nulls over the record (or fail the contract's
123
+ * `operation_input.required` rule). Hosts fill these by running the operation
124
+ * through `process-form-load` / `process-submit` instead.
125
+ */
126
+ function getUnfilledActionInputKeys(payload) {
127
+ const fields = payload?.['fields'];
128
+ if (!Array.isArray(fields)) {
129
+ return [];
130
+ }
131
+ return fields
132
+ .filter((field) => !!field &&
133
+ typeof field === 'object' &&
134
+ field.value == null)
135
+ .map((field) => field.propertyKey)
136
+ .filter((key) => typeof key === 'string' && key.trim() !== '');
137
+ }
112
138
  function getMissingRequiredPayloadKeys(action, payload) {
113
139
  return (action.requiredPayloadKeys ?? []).filter((key) => isMissingPayloadValue(payload?.[key]));
114
140
  }
@@ -143,36 +169,49 @@ function buildRequestOptions(method, payload) {
143
169
  observe: 'body',
144
170
  };
145
171
  }
172
+ /**
173
+ * The action collects free-form request metadata — a reason, a note, a
174
+ * delegate, attachments — which the generic confirm dialog can render on its
175
+ * own because the keys are fixed and operation-independent.
176
+ *
177
+ * Operation *inputs* are a different thing entirely: see
178
+ * {@link hasActionInputFields}.
179
+ */
146
180
  function hasActionFormFields(action) {
147
- return ((action.payloadKeys ?? []).some((key) => ['delegatedUser', 'reason', 'note', 'attachments'].includes(key)) || hasProgressTemplateField(action));
181
+ return (action.payloadKeys ?? []).some((key) => ['delegatedUser', 'reason', 'note', 'attachments'].includes(key));
148
182
  }
149
- function hasProgressTemplateField(action) {
183
+ /**
184
+ * The action declares operation inputs the user still has to supply — its
185
+ * `payloadTemplate.fields` is a non-empty list of `{ propertyKey, value: null }`
186
+ * placeholders.
187
+ *
188
+ * Firing such an action straight from its template submits those nulls, so a
189
+ * host must instead run the operation through its own form: `process-form-load`
190
+ * for the effective form and current values, `process-submit/validate`, then
191
+ * `process-submit`. The backend owns which fields those are — never infer them
192
+ * from the operation key.
193
+ */
194
+ function hasActionInputFields(action) {
150
195
  const fields = action.payloadTemplate
151
196
  ?.fields;
152
- return (Array.isArray(fields) &&
153
- fields.some((field) => !!field &&
154
- typeof field === 'object' &&
155
- field.propertyKey === 'Progress'));
197
+ return Array.isArray(fields) && fields.length > 0;
156
198
  }
157
- function resolveTemplateFieldsValue(action, template, formValue) {
158
- const templateFields = template['fields'];
159
- if (!Array.isArray(templateFields)) {
160
- return formValue?.['fields'] ?? templateFields;
161
- }
162
- if (!hasProgressTemplateField(action)) {
163
- return formValue?.['fields'] ?? templateFields;
199
+ /**
200
+ * The property keys an action declares as its operation inputs, in the
201
+ * backend's own casing. Pass them to `mt-client-form`'s `allowedFieldKeys` to
202
+ * scope a configured form down to the inputs this action actually writes.
203
+ */
204
+ function getActionInputFieldKeys(action) {
205
+ const fields = action.payloadTemplate
206
+ ?.fields;
207
+ if (!Array.isArray(fields)) {
208
+ return [];
164
209
  }
165
- return templateFields.map((field) => {
166
- if (!field ||
167
- typeof field !== 'object' ||
168
- field.propertyKey !== 'Progress') {
169
- return field;
170
- }
171
- return {
172
- ...field,
173
- value: formValue?.['progress'] ?? field.value,
174
- };
175
- });
210
+ return fields
211
+ .map((field) => field && typeof field === 'object'
212
+ ? field.propertyKey
213
+ : null)
214
+ .filter((key) => typeof key === 'string' && key.trim() !== '');
176
215
  }
177
216
 
178
217
  class RuntimeActionContextStore {
@@ -218,7 +257,17 @@ class RuntimeActionRunner {
218
257
  if (options.transformPayload) {
219
258
  payload = options.transformPayload(payload, action);
220
259
  }
221
- const missing = getMissingRequiredPayloadKeys(action, payload);
260
+ // An action that declares operation inputs cannot be fired from its
261
+ // template alone: the backend sends those fields as `value: null`
262
+ // placeholders for a form to fill, so submitting them as-is writes nulls
263
+ // over the record. Only checked when no form value was collected — a host
264
+ // that supplied one owns what it put in `fields`, cleared values included.
265
+ // The way to run such an action is `process-form-load` →
266
+ // `process-submit/validate` → `process-submit`; see `hasActionInputFields`.
267
+ const missing = [
268
+ ...getMissingRequiredPayloadKeys(action, payload),
269
+ ...(formValue ? [] : getUnfilledActionInputKeys(payload)),
270
+ ];
222
271
  if (missing.length) {
223
272
  const message = this.transloco.translate('components.runtimeAction.missingArgs', { action: resolveActionLabel(action), missing: missing.join(', ') });
224
273
  if (!options.silent) {
@@ -402,5 +451,5 @@ function resolveHttpErrorMessage(error, fallback) {
402
451
  * Generated bundle index. Do not edit.
403
452
  */
404
453
 
405
- export { RUNTIME_ACTION_CONFIRM_DIALOG, RuntimeActionContextStore, RuntimeActionRunner, buildActionPayload, buildRequestOptions, getMissingRequiredPayloadKeys, hasActionFormFields, hasProgressTemplateField, isMissingPayloadValue, methodSupportsBody, normalizeHttpMethod, normalizePayloadValue, resolveActionLabel, resolveDefaultPayloadValue };
454
+ export { RUNTIME_ACTION_CONFIRM_DIALOG, RuntimeActionContextStore, RuntimeActionRunner, buildActionPayload, buildRequestOptions, getActionInputFieldKeys, getMissingRequiredPayloadKeys, getUnfilledActionInputKeys, hasActionFormFields, hasActionInputFields, isMissingPayloadValue, methodSupportsBody, normalizeHttpMethod, normalizePayloadValue, resolveActionLabel, resolveDefaultPayloadValue };
406
455
  //# sourceMappingURL=masterteam-components-runtime-action.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-components-runtime-action.mjs","sources":["../../../../packages/masterteam/components/runtime-action/runtime-action.types.ts","../../../../packages/masterteam/components/runtime-action/payload-builder.ts","../../../../packages/masterteam/components/runtime-action/runtime-action-context.store.ts","../../../../packages/masterteam/components/runtime-action/runtime-action.runner.ts","../../../../packages/masterteam/components/runtime-action/masterteam-components-runtime-action.ts"],"sourcesContent":["export interface RuntimeActionTranslatable {\r\n display?: string;\r\n en?: string;\r\n ar?: string;\r\n}\r\n\r\nexport type RuntimeActionAfterSuccess = 'refresh' | 'close';\r\n\r\nexport interface RuntimeActionReason {\r\n source?: string;\r\n code?: string;\r\n message?: string;\r\n blocking?: boolean;\r\n details?: string | null;\r\n ruleKey?: string | null;\r\n requestId?: number | null;\r\n requestStatus?: string | null;\r\n requestSchemaId?: number | null;\r\n relatedRequestIds?: number[];\r\n}\r\n\r\nexport interface RuntimeAction {\r\n actionKey: string;\r\n actionName?: RuntimeActionTranslatable | string | null;\r\n httpMethod?: string | null;\r\n url?: string | null;\r\n isAvailable?: boolean;\r\n afterSuccess?: RuntimeActionAfterSuccess | null;\r\n stepIds?: Array<number | string>;\r\n needConfirmation?: boolean;\r\n payloadKeys?: string[];\r\n requiredPayloadKeys?: string[];\r\n payloadTemplate?: Record<string, unknown> | null;\r\n formId?: string | number | null;\r\n\r\n targetType?: string;\r\n targetId?: number;\r\n moduleKey?: string;\r\n operationKey?: string;\r\n primaryReasonCode?: string | null;\r\n reasons?: RuntimeActionReason[];\r\n}\r\n\r\nexport type RuntimeActionStatus = 'success' | 'error' | 'cancelled';\r\n\r\nexport interface RuntimeActionResult {\r\n status: RuntimeActionStatus;\r\n actionKey: string;\r\n afterSuccess: RuntimeActionAfterSuccess | null;\r\n response?: unknown;\r\n error?: unknown;\r\n}\r\n\r\nexport interface RuntimeActionExecuteOptions {\r\n externalPayloadResolvers?: Record<string, () => unknown>;\r\n defaultAfterSuccess?: RuntimeActionAfterSuccess;\r\n successMessage?: (response: unknown, action: RuntimeAction) => string;\r\n errorMessage?: (error: unknown, action: RuntimeAction) => string;\r\n transformPayload?: (\r\n payload: Record<string, unknown> | undefined,\r\n action: RuntimeAction,\r\n ) => Record<string, unknown> | undefined;\r\n silent?: boolean;\r\n}\r\n\r\nexport interface RuntimeActionFormValue {\r\n requestPropertyId?: number;\r\n propertyKey: string;\r\n value: unknown;\r\n}\r\n\r\nexport interface RuntimeActionFormSource {\r\n getSubmitValues(): RuntimeActionFormValue[] | undefined;\r\n}\r\n\r\nexport function resolveActionLabel(action: RuntimeAction): string {\r\n const name = action.actionName;\r\n if (typeof name === 'string') {\r\n return name || action.actionKey;\r\n }\r\n return name?.display || action.actionKey;\r\n}\r\n","import { RuntimeAction } from './runtime-action.types';\r\n\r\nexport function buildActionPayload(\r\n action: RuntimeAction,\r\n formValue: Record<string, unknown> | undefined,\r\n externalResolvers: Record<string, () => unknown> = {},\r\n): Record<string, unknown> | undefined {\r\n const templatePayload = buildTemplatePayload(\r\n action,\r\n formValue,\r\n externalResolvers,\r\n );\r\n if (templatePayload) {\r\n return templatePayload;\r\n }\r\n\r\n const payloadKeys = action.payloadKeys ?? [];\r\n if (!payloadKeys.length) {\r\n return undefined;\r\n }\r\n\r\n const payload: Record<string, unknown> = {};\r\n\r\n for (const key of payloadKeys) {\r\n const formFieldValue = formValue?.[key];\r\n if (formFieldValue !== undefined) {\r\n payload[key] = normalizePayloadValue(key, formFieldValue);\r\n continue;\r\n }\r\n\r\n const externalValue = resolveExternalPayloadValue(\r\n key,\r\n action,\r\n externalResolvers,\r\n );\r\n if (externalValue !== undefined) {\r\n payload[key] = externalValue;\r\n continue;\r\n }\r\n\r\n const defaultValue = resolveDefaultPayloadValue(key);\r\n if (defaultValue !== undefined) {\r\n payload[key] = defaultValue;\r\n }\r\n }\r\n\r\n return Object.keys(payload).length ? payload : undefined;\r\n}\r\n\r\nfunction buildTemplatePayload(\r\n action: RuntimeAction,\r\n formValue: Record<string, unknown> | undefined,\r\n externalResolvers: Record<string, () => unknown>,\r\n): Record<string, unknown> | null {\r\n const template = action.payloadTemplate as Record<string, unknown> | null;\r\n if (!template || typeof template !== 'object') {\r\n return null;\r\n }\r\n\r\n const payload: Record<string, unknown> = {};\r\n const payloadKeys = action.payloadKeys ?? Object.keys(template);\r\n\r\n for (const key of payloadKeys) {\r\n if (key === 'fields') {\r\n payload[key] = resolveTemplateFieldsValue(action, template, formValue);\r\n continue;\r\n }\r\n\r\n const formFieldValue = formValue?.[key];\r\n if (formFieldValue !== undefined) {\r\n payload[key] = normalizePayloadValue(key, formFieldValue);\r\n continue;\r\n }\r\n\r\n const externalValue = resolveExternalPayloadValue(\r\n key,\r\n action,\r\n externalResolvers,\r\n );\r\n if (externalValue !== undefined) {\r\n payload[key] = externalValue;\r\n continue;\r\n }\r\n\r\n if (template[key] !== undefined) {\r\n payload[key] = template[key];\r\n continue;\r\n }\r\n\r\n const defaultValue = resolveDefaultPayloadValue(key);\r\n if (defaultValue !== undefined) {\r\n payload[key] = defaultValue;\r\n }\r\n }\r\n\r\n return Object.keys(payload).length ? payload : null;\r\n}\r\n\r\nfunction resolveExternalPayloadValue(\r\n key: string,\r\n action: RuntimeAction,\r\n externalResolvers: Record<string, () => unknown>,\r\n): unknown {\r\n const resolver = externalResolvers[key];\r\n if (resolver) {\r\n return resolver();\r\n }\r\n\r\n if (key === 'stepId') {\r\n return action.stepIds?.[0];\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function normalizePayloadValue(key: string, value: unknown): unknown {\r\n if (key === 'attachments') {\r\n if (value == null) {\r\n return [];\r\n }\r\n return Array.isArray(value) ? value : [value];\r\n }\r\n\r\n return value;\r\n}\r\n\r\nexport function resolveDefaultPayloadValue(key: string): unknown {\r\n switch (key) {\r\n case 'attachments':\r\n return [];\r\n case 'delegatedUser':\r\n case 'note':\r\n case 'reason':\r\n return null;\r\n case 'values':\r\n return [];\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\nexport function getMissingRequiredPayloadKeys(\r\n action: RuntimeAction,\r\n payload: Record<string, unknown> | undefined,\r\n): string[] {\r\n return (action.requiredPayloadKeys ?? []).filter((key) =>\r\n isMissingPayloadValue(payload?.[key]),\r\n );\r\n}\r\n\r\nexport function isMissingPayloadValue(value: unknown): boolean {\r\n if (value == null) {\r\n return true;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n return value.trim().length === 0;\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n return value.length === 0;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport function normalizeHttpMethod(\r\n value: string | null | undefined,\r\n): string | null {\r\n if (!value || typeof value !== 'string') {\r\n return null;\r\n }\r\n\r\n const method = value.trim().toUpperCase();\r\n return method.length ? method : null;\r\n}\r\n\r\nexport function methodSupportsBody(method: string): boolean {\r\n return ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method);\r\n}\r\n\r\nexport function buildRequestOptions(\r\n method: string,\r\n payload: Record<string, unknown> | undefined,\r\n): Record<string, unknown> {\r\n if (!payload || !methodSupportsBody(method)) {\r\n return { observe: 'body' };\r\n }\r\n\r\n return {\r\n body: payload,\r\n observe: 'body',\r\n };\r\n}\r\n\r\nexport function hasActionFormFields(action: RuntimeAction): boolean {\r\n return (\r\n (action.payloadKeys ?? []).some((key) =>\r\n ['delegatedUser', 'reason', 'note', 'attachments'].includes(key),\r\n ) || hasProgressTemplateField(action)\r\n );\r\n}\r\n\r\nexport function hasProgressTemplateField(action: RuntimeAction): boolean {\r\n const fields = (action.payloadTemplate as { fields?: unknown } | null)\r\n ?.fields;\r\n return (\r\n Array.isArray(fields) &&\r\n fields.some(\r\n (field) =>\r\n !!field &&\r\n typeof field === 'object' &&\r\n (field as { propertyKey?: string }).propertyKey === 'Progress',\r\n )\r\n );\r\n}\r\n\r\nfunction resolveTemplateFieldsValue(\r\n action: RuntimeAction,\r\n template: Record<string, unknown>,\r\n formValue: Record<string, unknown> | undefined,\r\n): unknown {\r\n const templateFields = template['fields'];\r\n if (!Array.isArray(templateFields)) {\r\n return formValue?.['fields'] ?? templateFields;\r\n }\r\n\r\n if (!hasProgressTemplateField(action)) {\r\n return formValue?.['fields'] ?? templateFields;\r\n }\r\n\r\n return templateFields.map((field) => {\r\n if (\r\n !field ||\r\n typeof field !== 'object' ||\r\n (field as { propertyKey?: string }).propertyKey !== 'Progress'\r\n ) {\r\n return field;\r\n }\r\n\r\n return {\r\n ...(field as Record<string, unknown>),\r\n value: formValue?.['progress'] ?? (field as { value?: unknown }).value,\r\n };\r\n });\r\n}\r\n","import { Injectable, signal } from '@angular/core';\r\n\r\nimport {\r\n RuntimeActionFormSource,\r\n RuntimeActionFormValue,\r\n} from './runtime-action.types';\r\n\r\n@Injectable()\r\nexport class RuntimeActionContextStore {\r\n private readonly formSource = signal<RuntimeActionFormSource | null>(null);\r\n\r\n setFormSource(source: RuntimeActionFormSource | null): void {\r\n this.formSource.set(source);\r\n }\r\n\r\n resolveFormValues(): RuntimeActionFormValue[] {\r\n const values = this.formSource()?.getSubmitValues();\r\n return Array.isArray(values)\r\n ? values.map((value) => ({\r\n requestPropertyId: value.requestPropertyId,\r\n propertyKey: value.propertyKey,\r\n value: value.value,\r\n }))\r\n : [];\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, InjectionToken, Type, inject } from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { ConfirmationService } from '@masterteam/components/confirmation';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { ToastService } from '@masterteam/components/toast';\r\nimport { firstValueFrom, map } from 'rxjs';\r\n\r\nimport {\r\n buildActionPayload,\r\n buildRequestOptions,\r\n getMissingRequiredPayloadKeys,\r\n hasActionFormFields,\r\n normalizeHttpMethod,\r\n} from './payload-builder';\r\nimport {\r\n RuntimeAction,\r\n RuntimeActionAfterSuccess,\r\n RuntimeActionExecuteOptions,\r\n RuntimeActionResult,\r\n resolveActionLabel,\r\n} from './runtime-action.types';\r\n\r\nexport const RUNTIME_ACTION_CONFIRM_DIALOG = new InjectionToken<Type<unknown>>(\r\n 'RUNTIME_ACTION_CONFIRM_DIALOG',\r\n);\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class RuntimeActionRunner {\r\n private readonly http = inject(HttpClient);\r\n private readonly confirmation = inject(ConfirmationService);\r\n private readonly modal = inject(ModalService);\r\n private readonly toast = inject(ToastService);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly confirmDialogClass = inject(RUNTIME_ACTION_CONFIRM_DIALOG, {\r\n optional: true,\r\n });\r\n\r\n async execute(\r\n action: RuntimeAction,\r\n options: RuntimeActionExecuteOptions = {},\r\n ): Promise<RuntimeActionResult> {\r\n const method = normalizeHttpMethod(action.httpMethod);\r\n const url = action.url?.trim();\r\n\r\n if (!method || !url || action.isAvailable === false) {\r\n return cancelledOrError(\r\n action,\r\n 'error',\r\n new Error(this.notExecutableMessage(action)),\r\n );\r\n }\r\n\r\n const performRun = (\r\n formValue?: Record<string, unknown>,\r\n ): Promise<RuntimeActionResult> => {\r\n let payload = buildActionPayload(\r\n action,\r\n formValue,\r\n options.externalPayloadResolvers ?? {},\r\n );\r\n\r\n if (options.transformPayload) {\r\n payload = options.transformPayload(payload, action);\r\n }\r\n\r\n const missing = getMissingRequiredPayloadKeys(action, payload);\r\n if (missing.length) {\r\n const message = this.transloco.translate(\r\n 'components.runtimeAction.missingArgs',\r\n { action: resolveActionLabel(action), missing: missing.join(', ') },\r\n );\r\n if (!options.silent) {\r\n this.toast.error(message);\r\n }\r\n return Promise.resolve({\r\n status: 'error',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error: new Error(message),\r\n });\r\n }\r\n\r\n return this.run(action, method, url, payload, options);\r\n };\r\n\r\n if (action.needConfirmation) {\r\n if (hasActionFormFields(action) && this.confirmDialogClass) {\r\n return this.runWithFormDialog(action, performRun);\r\n }\r\n\r\n const confirmed = await this.confirmPlain(action);\r\n if (!confirmed) {\r\n return {\r\n status: 'cancelled',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n };\r\n }\r\n }\r\n\r\n return performRun();\r\n }\r\n\r\n private runWithFormDialog(\r\n action: RuntimeAction,\r\n performRun: (\r\n value: Record<string, unknown>,\r\n ) => Promise<RuntimeActionResult>,\r\n ): Promise<RuntimeActionResult> {\r\n return new Promise((resolve) => {\r\n let pendingRun: Promise<RuntimeActionResult> | null = null;\r\n let finalResult: RuntimeActionResult | null = null;\r\n\r\n const ref = this.modal.openModal(this.confirmDialogClass!, 'dialog', {\r\n header: resolveActionLabel(action),\r\n width: '40rem',\r\n dismissableMask: true,\r\n inputValues: {\r\n action,\r\n onSubmit: async (value: Record<string, unknown>) => {\r\n pendingRun = performRun(value);\r\n const result = await pendingRun;\r\n finalResult = result;\r\n return result.status === 'success';\r\n },\r\n },\r\n });\r\n\r\n ref.onClose.subscribe(async () => {\r\n if (finalResult) {\r\n resolve(finalResult);\r\n return;\r\n }\r\n if (pendingRun) {\r\n try {\r\n resolve(await pendingRun);\r\n } catch (error) {\r\n resolve({\r\n status: 'error',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error,\r\n });\r\n }\r\n return;\r\n }\r\n resolve({\r\n status: 'cancelled',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n });\r\n });\r\n });\r\n }\r\n\r\n private confirmPlain(action: RuntimeAction): Promise<boolean> {\r\n return new Promise((resolve) => {\r\n const label = resolveActionLabel(action);\r\n this.confirmation.confirm({\r\n type: 'dialog',\r\n header: label,\r\n message: this.transloco.translate(\r\n 'components.runtimeAction.confirmDefault',\r\n { action: label },\r\n ),\r\n acceptLabel: label,\r\n icon: 'alert.alert-triangle',\r\n accept: () => resolve(true),\r\n reject: () => resolve(false),\r\n });\r\n });\r\n }\r\n\r\n private async run(\r\n action: RuntimeAction,\r\n method: string,\r\n url: string,\r\n payload: Record<string, unknown> | undefined,\r\n options: RuntimeActionExecuteOptions,\r\n ): Promise<RuntimeActionResult> {\r\n const fallbackErrorMessage = this.transloco.translate(\r\n 'components.runtimeAction.executeFailed',\r\n { action: resolveActionLabel(action) },\r\n );\r\n\r\n try {\r\n const response = await firstValueFrom(\r\n this.http\r\n .request<unknown>(method, url, buildRequestOptions(method, payload))\r\n .pipe(\r\n map((res) => ensureSuccessfulEnvelope(res, fallbackErrorMessage)),\r\n ),\r\n );\r\n\r\n if (options.successMessage && !options.silent) {\r\n this.toast.success(options.successMessage(response, action));\r\n }\r\n\r\n return {\r\n status: 'success',\r\n actionKey: action.actionKey,\r\n afterSuccess: resolveAfterSuccess(action, options.defaultAfterSuccess),\r\n response,\r\n };\r\n } catch (error) {\r\n const message =\r\n options.errorMessage?.(error, action) ??\r\n resolveHttpErrorMessage(error, fallbackErrorMessage);\r\n\r\n if (!options.silent) {\r\n this.toast.error(message);\r\n }\r\n\r\n return {\r\n status: 'error',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error,\r\n };\r\n }\r\n }\r\n\r\n private notExecutableMessage(action: RuntimeAction): string {\r\n if (action.isAvailable === false) {\r\n return this.transloco.translate('components.runtimeAction.notAvailable', {\r\n action: action.actionKey,\r\n });\r\n }\r\n if (!action.url) {\r\n return this.transloco.translate('components.runtimeAction.noUrl', {\r\n action: action.actionKey,\r\n });\r\n }\r\n return this.transloco.translate('components.runtimeAction.noHttpMethod', {\r\n action: action.actionKey,\r\n });\r\n }\r\n}\r\n\r\nfunction cancelledOrError(\r\n action: RuntimeAction,\r\n status: 'error' | 'cancelled',\r\n error?: unknown,\r\n): RuntimeActionResult {\r\n return {\r\n status,\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error,\r\n };\r\n}\r\n\r\nfunction resolveAfterSuccess(\r\n action: RuntimeAction,\r\n fallback: RuntimeActionAfterSuccess | undefined,\r\n): RuntimeActionAfterSuccess {\r\n if (action.afterSuccess === 'close' || action.afterSuccess === 'refresh') {\r\n return action.afterSuccess;\r\n }\r\n return fallback ?? 'refresh';\r\n}\r\n\r\nfunction ensureSuccessfulEnvelope(\r\n response: unknown,\r\n fallback: string,\r\n): unknown {\r\n if (!response || typeof response !== 'object') {\r\n return response;\r\n }\r\n\r\n const envelope = response as { code?: number };\r\n if (typeof envelope.code === 'number' && envelope.code !== 1) {\r\n throw new Error(resolveEnvelopeErrorMessage(response, fallback));\r\n }\r\n return response;\r\n}\r\n\r\nfunction resolveEnvelopeErrorMessage(\r\n response: unknown,\r\n fallback: string,\r\n): string {\r\n if (!response || typeof response !== 'object') {\r\n return fallback;\r\n }\r\n const envelope = response as {\r\n message?: string | null;\r\n errors?: { message?: string } | null;\r\n };\r\n return envelope.errors?.message ?? envelope.message ?? fallback;\r\n}\r\n\r\nfunction resolveHttpErrorMessage(error: unknown, fallback: string): string {\r\n if (!error || typeof error !== 'object') {\r\n return fallback;\r\n }\r\n const httpError = error as {\r\n message?: string;\r\n error?: { message?: string | null } | null;\r\n };\r\n return httpError.error?.message ?? httpError.message ?? fallback;\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AA2EM,SAAU,kBAAkB,CAAC,MAAqB,EAAA;AACtD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU;AAC9B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC5B,QAAA,OAAO,IAAI,IAAI,MAAM,CAAC,SAAS;IACjC;AACA,IAAA,OAAO,IAAI,EAAE,OAAO,IAAI,MAAM,CAAC,SAAS;AAC1C;;AC/EM,SAAU,kBAAkB,CAChC,MAAqB,EACrB,SAA8C,EAC9C,oBAAmD,EAAE,EAAA;IAErD,MAAM,eAAe,GAAG,oBAAoB,CAC1C,MAAM,EACN,SAAS,EACT,iBAAiB,CAClB;IACD,IAAI,eAAe,EAAE;AACnB,QAAA,OAAO,eAAe;IACxB;AAEA,IA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,CAAC,MAAM,EAAE,OAAO,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ;AACjE;AAEA,SAAS,uBAAuB,CAAC,KAAc,EAAE,QAAgB,EAAA;IAC/D,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,QAAQ;IACjB;IACA,MAAM,SAAS,GAAG,KAGjB;IACD,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,IAAI,SAAS,CAAC,OAAO,IAAI,QAAQ;AAClE;;AC7SA;;AAEG;;;;"}
1
+ {"version":3,"file":"masterteam-components-runtime-action.mjs","sources":["../../../../packages/masterteam/components/runtime-action/runtime-action.types.ts","../../../../packages/masterteam/components/runtime-action/payload-builder.ts","../../../../packages/masterteam/components/runtime-action/runtime-action-context.store.ts","../../../../packages/masterteam/components/runtime-action/runtime-action.runner.ts","../../../../packages/masterteam/components/runtime-action/masterteam-components-runtime-action.ts"],"sourcesContent":["export interface RuntimeActionTranslatable {\r\n display?: string;\r\n en?: string;\r\n ar?: string;\r\n}\r\n\r\nexport type RuntimeActionAfterSuccess = 'refresh' | 'close';\r\n\r\nexport interface RuntimeActionReason {\r\n source?: string;\r\n code?: string;\r\n message?: string;\r\n blocking?: boolean;\r\n details?: string | null;\r\n ruleKey?: string | null;\r\n requestId?: number | null;\r\n requestStatus?: string | null;\r\n requestSchemaId?: number | null;\r\n relatedRequestIds?: number[];\r\n}\r\n\r\nexport interface RuntimeAction {\r\n actionKey: string;\r\n actionName?: RuntimeActionTranslatable | string | null;\r\n httpMethod?: string | null;\r\n url?: string | null;\r\n isAvailable?: boolean;\r\n afterSuccess?: RuntimeActionAfterSuccess | null;\r\n stepIds?: Array<number | string>;\r\n needConfirmation?: boolean;\r\n payloadKeys?: string[];\r\n requiredPayloadKeys?: string[];\r\n payloadTemplate?: Record<string, unknown> | null;\r\n formId?: string | number | null;\r\n\r\n targetType?: string;\r\n targetId?: number;\r\n moduleKey?: string;\r\n operationKey?: string;\r\n primaryReasonCode?: string | null;\r\n reasons?: RuntimeActionReason[];\r\n}\r\n\r\nexport type RuntimeActionStatus = 'success' | 'error' | 'cancelled';\r\n\r\nexport interface RuntimeActionResult {\r\n status: RuntimeActionStatus;\r\n actionKey: string;\r\n afterSuccess: RuntimeActionAfterSuccess | null;\r\n response?: unknown;\r\n error?: unknown;\r\n}\r\n\r\nexport interface RuntimeActionExecuteOptions {\r\n externalPayloadResolvers?: Record<string, () => unknown>;\r\n defaultAfterSuccess?: RuntimeActionAfterSuccess;\r\n successMessage?: (response: unknown, action: RuntimeAction) => string;\r\n errorMessage?: (error: unknown, action: RuntimeAction) => string;\r\n transformPayload?: (\r\n payload: Record<string, unknown> | undefined,\r\n action: RuntimeAction,\r\n ) => Record<string, unknown> | undefined;\r\n silent?: boolean;\r\n}\r\n\r\nexport interface RuntimeActionFormValue {\r\n requestPropertyId?: number;\r\n propertyKey: string;\r\n value: unknown;\r\n}\r\n\r\nexport interface RuntimeActionFormSource {\r\n getSubmitValues(): RuntimeActionFormValue[] | undefined;\r\n}\r\n\r\nexport function resolveActionLabel(action: RuntimeAction): string {\r\n const name = action.actionName;\r\n if (typeof name === 'string') {\r\n return name || action.actionKey;\r\n }\r\n return name?.display || action.actionKey;\r\n}\r\n","import { RuntimeAction } from './runtime-action.types';\r\n\r\nexport function buildActionPayload(\r\n action: RuntimeAction,\r\n formValue: Record<string, unknown> | undefined,\r\n externalResolvers: Record<string, () => unknown> = {},\r\n): Record<string, unknown> | undefined {\r\n const templatePayload = buildTemplatePayload(\r\n action,\r\n formValue,\r\n externalResolvers,\r\n );\r\n if (templatePayload) {\r\n return templatePayload;\r\n }\r\n\r\n const payloadKeys = action.payloadKeys ?? [];\r\n if (!payloadKeys.length) {\r\n return undefined;\r\n }\r\n\r\n const payload: Record<string, unknown> = {};\r\n\r\n for (const key of payloadKeys) {\r\n const formFieldValue = formValue?.[key];\r\n if (formFieldValue !== undefined) {\r\n payload[key] = normalizePayloadValue(key, formFieldValue);\r\n continue;\r\n }\r\n\r\n const externalValue = resolveExternalPayloadValue(\r\n key,\r\n action,\r\n externalResolvers,\r\n );\r\n if (externalValue !== undefined) {\r\n payload[key] = externalValue;\r\n continue;\r\n }\r\n\r\n const defaultValue = resolveDefaultPayloadValue(key);\r\n if (defaultValue !== undefined) {\r\n payload[key] = defaultValue;\r\n }\r\n }\r\n\r\n return Object.keys(payload).length ? payload : undefined;\r\n}\r\n\r\nfunction buildTemplatePayload(\r\n action: RuntimeAction,\r\n formValue: Record<string, unknown> | undefined,\r\n externalResolvers: Record<string, () => unknown>,\r\n): Record<string, unknown> | null {\r\n const template = action.payloadTemplate as Record<string, unknown> | null;\r\n if (!template || typeof template !== 'object') {\r\n return null;\r\n }\r\n\r\n const payload: Record<string, unknown> = {};\r\n const payloadKeys = action.payloadKeys ?? Object.keys(template);\r\n\r\n for (const key of payloadKeys) {\r\n if (key === 'fields') {\r\n // The backend declares the operation's inputs as a `fields` template of\r\n // `{ propertyKey, value: null }` placeholders. Only a host that rendered\r\n // the operation's real form can fill them (see `hasActionInputFields`),\r\n // so the values are taken whole from the form or left as declared —\r\n // never patched per property key from here.\r\n payload[key] = formValue?.['fields'] ?? template['fields'];\r\n continue;\r\n }\r\n\r\n const formFieldValue = formValue?.[key];\r\n if (formFieldValue !== undefined) {\r\n payload[key] = normalizePayloadValue(key, formFieldValue);\r\n continue;\r\n }\r\n\r\n const externalValue = resolveExternalPayloadValue(\r\n key,\r\n action,\r\n externalResolvers,\r\n );\r\n if (externalValue !== undefined) {\r\n payload[key] = externalValue;\r\n continue;\r\n }\r\n\r\n if (template[key] !== undefined) {\r\n payload[key] = template[key];\r\n continue;\r\n }\r\n\r\n const defaultValue = resolveDefaultPayloadValue(key);\r\n if (defaultValue !== undefined) {\r\n payload[key] = defaultValue;\r\n }\r\n }\r\n\r\n return Object.keys(payload).length ? payload : null;\r\n}\r\n\r\nfunction resolveExternalPayloadValue(\r\n key: string,\r\n action: RuntimeAction,\r\n externalResolvers: Record<string, () => unknown>,\r\n): unknown {\r\n const resolver = externalResolvers[key];\r\n if (resolver) {\r\n return resolver();\r\n }\r\n\r\n if (key === 'stepId') {\r\n return action.stepIds?.[0];\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function normalizePayloadValue(key: string, value: unknown): unknown {\r\n if (key === 'attachments') {\r\n if (value == null) {\r\n return [];\r\n }\r\n return Array.isArray(value) ? value : [value];\r\n }\r\n\r\n return value;\r\n}\r\n\r\nexport function resolveDefaultPayloadValue(key: string): unknown {\r\n switch (key) {\r\n case 'attachments':\r\n return [];\r\n case 'delegatedUser':\r\n case 'note':\r\n case 'reason':\r\n return null;\r\n case 'values':\r\n return [];\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * The declared operation inputs the payload would submit with no value — the\r\n * `{ propertyKey, value: null }` placeholders the backend sent, still unfilled.\r\n *\r\n * A non-empty result means the action was fired without rendering its form, and\r\n * submitting it would write nulls over the record (or fail the contract's\r\n * `operation_input.required` rule). Hosts fill these by running the operation\r\n * through `process-form-load` / `process-submit` instead.\r\n */\r\nexport function getUnfilledActionInputKeys(\r\n payload: Record<string, unknown> | undefined,\r\n): string[] {\r\n const fields = payload?.['fields'];\r\n if (!Array.isArray(fields)) {\r\n return [];\r\n }\r\n\r\n return fields\r\n .filter(\r\n (field) =>\r\n !!field &&\r\n typeof field === 'object' &&\r\n (field as { value?: unknown }).value == null,\r\n )\r\n .map((field) => (field as { propertyKey?: unknown }).propertyKey)\r\n .filter(\r\n (key): key is string => typeof key === 'string' && key.trim() !== '',\r\n );\r\n}\r\n\r\nexport function getMissingRequiredPayloadKeys(\r\n action: RuntimeAction,\r\n payload: Record<string, unknown> | undefined,\r\n): string[] {\r\n return (action.requiredPayloadKeys ?? []).filter((key) =>\r\n isMissingPayloadValue(payload?.[key]),\r\n );\r\n}\r\n\r\nexport function isMissingPayloadValue(value: unknown): boolean {\r\n if (value == null) {\r\n return true;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n return value.trim().length === 0;\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n return value.length === 0;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport function normalizeHttpMethod(\r\n value: string | null | undefined,\r\n): string | null {\r\n if (!value || typeof value !== 'string') {\r\n return null;\r\n }\r\n\r\n const method = value.trim().toUpperCase();\r\n return method.length ? method : null;\r\n}\r\n\r\nexport function methodSupportsBody(method: string): boolean {\r\n return ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method);\r\n}\r\n\r\nexport function buildRequestOptions(\r\n method: string,\r\n payload: Record<string, unknown> | undefined,\r\n): Record<string, unknown> {\r\n if (!payload || !methodSupportsBody(method)) {\r\n return { observe: 'body' };\r\n }\r\n\r\n return {\r\n body: payload,\r\n observe: 'body',\r\n };\r\n}\r\n\r\n/**\r\n * The action collects free-form request metadata — a reason, a note, a\r\n * delegate, attachments — which the generic confirm dialog can render on its\r\n * own because the keys are fixed and operation-independent.\r\n *\r\n * Operation *inputs* are a different thing entirely: see\r\n * {@link hasActionInputFields}.\r\n */\r\nexport function hasActionFormFields(action: RuntimeAction): boolean {\r\n return (action.payloadKeys ?? []).some((key) =>\r\n ['delegatedUser', 'reason', 'note', 'attachments'].includes(key),\r\n );\r\n}\r\n\r\n/**\r\n * The action declares operation inputs the user still has to supply — its\r\n * `payloadTemplate.fields` is a non-empty list of `{ propertyKey, value: null }`\r\n * placeholders.\r\n *\r\n * Firing such an action straight from its template submits those nulls, so a\r\n * host must instead run the operation through its own form: `process-form-load`\r\n * for the effective form and current values, `process-submit/validate`, then\r\n * `process-submit`. The backend owns which fields those are — never infer them\r\n * from the operation key.\r\n */\r\nexport function hasActionInputFields(action: RuntimeAction): boolean {\r\n const fields = (action.payloadTemplate as { fields?: unknown } | null)\r\n ?.fields;\r\n return Array.isArray(fields) && fields.length > 0;\r\n}\r\n\r\n/**\r\n * The property keys an action declares as its operation inputs, in the\r\n * backend's own casing. Pass them to `mt-client-form`'s `allowedFieldKeys` to\r\n * scope a configured form down to the inputs this action actually writes.\r\n */\r\nexport function getActionInputFieldKeys(action: RuntimeAction): string[] {\r\n const fields = (action.payloadTemplate as { fields?: unknown } | null)\r\n ?.fields;\r\n if (!Array.isArray(fields)) {\r\n return [];\r\n }\r\n\r\n return fields\r\n .map((field) =>\r\n field && typeof field === 'object'\r\n ? (field as { propertyKey?: unknown }).propertyKey\r\n : null,\r\n )\r\n .filter(\r\n (key): key is string => typeof key === 'string' && key.trim() !== '',\r\n );\r\n}\r\n","import { Injectable, signal } from '@angular/core';\r\n\r\nimport {\r\n RuntimeActionFormSource,\r\n RuntimeActionFormValue,\r\n} from './runtime-action.types';\r\n\r\n@Injectable()\r\nexport class RuntimeActionContextStore {\r\n private readonly formSource = signal<RuntimeActionFormSource | null>(null);\r\n\r\n setFormSource(source: RuntimeActionFormSource | null): void {\r\n this.formSource.set(source);\r\n }\r\n\r\n resolveFormValues(): RuntimeActionFormValue[] {\r\n const values = this.formSource()?.getSubmitValues();\r\n return Array.isArray(values)\r\n ? values.map((value) => ({\r\n requestPropertyId: value.requestPropertyId,\r\n propertyKey: value.propertyKey,\r\n value: value.value,\r\n }))\r\n : [];\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, InjectionToken, Type, inject } from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { ConfirmationService } from '@masterteam/components/confirmation';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { ToastService } from '@masterteam/components/toast';\r\nimport { firstValueFrom, map } from 'rxjs';\r\n\r\nimport {\r\n buildActionPayload,\r\n buildRequestOptions,\r\n getMissingRequiredPayloadKeys,\r\n getUnfilledActionInputKeys,\r\n hasActionFormFields,\r\n normalizeHttpMethod,\r\n} from './payload-builder';\r\nimport {\r\n RuntimeAction,\r\n RuntimeActionAfterSuccess,\r\n RuntimeActionExecuteOptions,\r\n RuntimeActionResult,\r\n resolveActionLabel,\r\n} from './runtime-action.types';\r\n\r\nexport const RUNTIME_ACTION_CONFIRM_DIALOG = new InjectionToken<Type<unknown>>(\r\n 'RUNTIME_ACTION_CONFIRM_DIALOG',\r\n);\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class RuntimeActionRunner {\r\n private readonly http = inject(HttpClient);\r\n private readonly confirmation = inject(ConfirmationService);\r\n private readonly modal = inject(ModalService);\r\n private readonly toast = inject(ToastService);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly confirmDialogClass = inject(RUNTIME_ACTION_CONFIRM_DIALOG, {\r\n optional: true,\r\n });\r\n\r\n async execute(\r\n action: RuntimeAction,\r\n options: RuntimeActionExecuteOptions = {},\r\n ): Promise<RuntimeActionResult> {\r\n const method = normalizeHttpMethod(action.httpMethod);\r\n const url = action.url?.trim();\r\n\r\n if (!method || !url || action.isAvailable === false) {\r\n return cancelledOrError(\r\n action,\r\n 'error',\r\n new Error(this.notExecutableMessage(action)),\r\n );\r\n }\r\n\r\n const performRun = (\r\n formValue?: Record<string, unknown>,\r\n ): Promise<RuntimeActionResult> => {\r\n let payload = buildActionPayload(\r\n action,\r\n formValue,\r\n options.externalPayloadResolvers ?? {},\r\n );\r\n\r\n if (options.transformPayload) {\r\n payload = options.transformPayload(payload, action);\r\n }\r\n\r\n // An action that declares operation inputs cannot be fired from its\r\n // template alone: the backend sends those fields as `value: null`\r\n // placeholders for a form to fill, so submitting them as-is writes nulls\r\n // over the record. Only checked when no form value was collected — a host\r\n // that supplied one owns what it put in `fields`, cleared values included.\r\n // The way to run such an action is `process-form-load` →\r\n // `process-submit/validate` → `process-submit`; see `hasActionInputFields`.\r\n const missing = [\r\n ...getMissingRequiredPayloadKeys(action, payload),\r\n ...(formValue ? [] : getUnfilledActionInputKeys(payload)),\r\n ];\r\n if (missing.length) {\r\n const message = this.transloco.translate(\r\n 'components.runtimeAction.missingArgs',\r\n { action: resolveActionLabel(action), missing: missing.join(', ') },\r\n );\r\n if (!options.silent) {\r\n this.toast.error(message);\r\n }\r\n return Promise.resolve({\r\n status: 'error',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error: new Error(message),\r\n });\r\n }\r\n\r\n return this.run(action, method, url, payload, options);\r\n };\r\n\r\n if (action.needConfirmation) {\r\n if (hasActionFormFields(action) && this.confirmDialogClass) {\r\n return this.runWithFormDialog(action, performRun);\r\n }\r\n\r\n const confirmed = await this.confirmPlain(action);\r\n if (!confirmed) {\r\n return {\r\n status: 'cancelled',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n };\r\n }\r\n }\r\n\r\n return performRun();\r\n }\r\n\r\n private runWithFormDialog(\r\n action: RuntimeAction,\r\n performRun: (\r\n value: Record<string, unknown>,\r\n ) => Promise<RuntimeActionResult>,\r\n ): Promise<RuntimeActionResult> {\r\n return new Promise((resolve) => {\r\n let pendingRun: Promise<RuntimeActionResult> | null = null;\r\n let finalResult: RuntimeActionResult | null = null;\r\n\r\n const ref = this.modal.openModal(this.confirmDialogClass!, 'dialog', {\r\n header: resolveActionLabel(action),\r\n width: '40rem',\r\n dismissableMask: true,\r\n inputValues: {\r\n action,\r\n onSubmit: async (value: Record<string, unknown>) => {\r\n pendingRun = performRun(value);\r\n const result = await pendingRun;\r\n finalResult = result;\r\n return result.status === 'success';\r\n },\r\n },\r\n });\r\n\r\n ref.onClose.subscribe(async () => {\r\n if (finalResult) {\r\n resolve(finalResult);\r\n return;\r\n }\r\n if (pendingRun) {\r\n try {\r\n resolve(await pendingRun);\r\n } catch (error) {\r\n resolve({\r\n status: 'error',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error,\r\n });\r\n }\r\n return;\r\n }\r\n resolve({\r\n status: 'cancelled',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n });\r\n });\r\n });\r\n }\r\n\r\n private confirmPlain(action: RuntimeAction): Promise<boolean> {\r\n return new Promise((resolve) => {\r\n const label = resolveActionLabel(action);\r\n this.confirmation.confirm({\r\n type: 'dialog',\r\n header: label,\r\n message: this.transloco.translate(\r\n 'components.runtimeAction.confirmDefault',\r\n { action: label },\r\n ),\r\n acceptLabel: label,\r\n icon: 'alert.alert-triangle',\r\n accept: () => resolve(true),\r\n reject: () => resolve(false),\r\n });\r\n });\r\n }\r\n\r\n private async run(\r\n action: RuntimeAction,\r\n method: string,\r\n url: string,\r\n payload: Record<string, unknown> | undefined,\r\n options: RuntimeActionExecuteOptions,\r\n ): Promise<RuntimeActionResult> {\r\n const fallbackErrorMessage = this.transloco.translate(\r\n 'components.runtimeAction.executeFailed',\r\n { action: resolveActionLabel(action) },\r\n );\r\n\r\n try {\r\n const response = await firstValueFrom(\r\n this.http\r\n .request<unknown>(method, url, buildRequestOptions(method, payload))\r\n .pipe(\r\n map((res) => ensureSuccessfulEnvelope(res, fallbackErrorMessage)),\r\n ),\r\n );\r\n\r\n if (options.successMessage && !options.silent) {\r\n this.toast.success(options.successMessage(response, action));\r\n }\r\n\r\n return {\r\n status: 'success',\r\n actionKey: action.actionKey,\r\n afterSuccess: resolveAfterSuccess(action, options.defaultAfterSuccess),\r\n response,\r\n };\r\n } catch (error) {\r\n const message =\r\n options.errorMessage?.(error, action) ??\r\n resolveHttpErrorMessage(error, fallbackErrorMessage);\r\n\r\n if (!options.silent) {\r\n this.toast.error(message);\r\n }\r\n\r\n return {\r\n status: 'error',\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error,\r\n };\r\n }\r\n }\r\n\r\n private notExecutableMessage(action: RuntimeAction): string {\r\n if (action.isAvailable === false) {\r\n return this.transloco.translate('components.runtimeAction.notAvailable', {\r\n action: action.actionKey,\r\n });\r\n }\r\n if (!action.url) {\r\n return this.transloco.translate('components.runtimeAction.noUrl', {\r\n action: action.actionKey,\r\n });\r\n }\r\n return this.transloco.translate('components.runtimeAction.noHttpMethod', {\r\n action: action.actionKey,\r\n });\r\n }\r\n}\r\n\r\nfunction cancelledOrError(\r\n action: RuntimeAction,\r\n status: 'error' | 'cancelled',\r\n error?: unknown,\r\n): RuntimeActionResult {\r\n return {\r\n status,\r\n actionKey: action.actionKey,\r\n afterSuccess: null,\r\n error,\r\n };\r\n}\r\n\r\nfunction resolveAfterSuccess(\r\n action: RuntimeAction,\r\n fallback: RuntimeActionAfterSuccess | undefined,\r\n): RuntimeActionAfterSuccess {\r\n if (action.afterSuccess === 'close' || action.afterSuccess === 'refresh') {\r\n return action.afterSuccess;\r\n }\r\n return fallback ?? 'refresh';\r\n}\r\n\r\nfunction ensureSuccessfulEnvelope(\r\n response: unknown,\r\n fallback: string,\r\n): unknown {\r\n if (!response || typeof response !== 'object') {\r\n return response;\r\n }\r\n\r\n const envelope = response as { code?: number };\r\n if (typeof envelope.code === 'number' && envelope.code !== 1) {\r\n throw new Error(resolveEnvelopeErrorMessage(response, fallback));\r\n }\r\n return response;\r\n}\r\n\r\nfunction resolveEnvelopeErrorMessage(\r\n response: unknown,\r\n fallback: string,\r\n): string {\r\n if (!response || typeof response !== 'object') {\r\n return fallback;\r\n }\r\n const envelope = response as {\r\n message?: string | null;\r\n errors?: { message?: string } | null;\r\n };\r\n return envelope.errors?.message ?? envelope.message ?? fallback;\r\n}\r\n\r\nfunction resolveHttpErrorMessage(error: unknown, fallback: string): string {\r\n if (!error || typeof error !== 'object') {\r\n return fallback;\r\n }\r\n const httpError = error as {\r\n message?: string;\r\n error?: { message?: string | null } | null;\r\n };\r\n return httpError.error?.message ?? httpError.message ?? fallback;\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AA2EM,SAAU,kBAAkB,CAAC,MAAqB,EAAA;AACtD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU;AAC9B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC5B,QAAA,OAAO,IAAI,IAAI,MAAM,CAAC,SAAS;IACjC;AACA,IAAA,OAAO,IAAI,EAAE,OAAO,IAAI,MAAM,CAAC,SAAS;AAC1C;;AC/EM,SAAU,kBAAkB,CAChC,MAAqB,EACrB,SAA8C,EA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ACjB;IAEA,MAAM,QAAQ,GAAG,QAA6B;AAC9C,IAAA,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE;QAC5D,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClE;AACA,IAAA,OAAO,QAAQ;AACjB;AAEA,SAAS,2BAA2B,CAClC,QAAiB,EACjB,QAAgB,EAAA;IAEhB,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC7C,QAAA,OAAO,QAAQ;IACjB;IACA,MAAM,QAAQ,GAAG,QAGhB;IACD,OAAO,QAAQ,CAAC,MAAM,EAAE,OAAO,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ;AACjE;AAEA,SAAS,uBAAuB,CAAC,KAAc,EAAE,QAAgB,EAAA;IAC/D,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,QAAQ;IACjB;IACA,MAAM,SAAS,GAAG,KAGjB;IACD,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,IAAI,SAAS,CAAC,OAAO,IAAI,QAAQ;AAClE;;ACxTA;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, input, booleanAttribute, signal, output, computed, HostListener, Component } from '@angular/core';
2
+ import { inject, input, computed, booleanAttribute, signal, output, HostListener, Component } from '@angular/core';
3
3
  import { TranslocoPipe } from '@jsverse/transloco';
4
4
  import { Icon } from '@masterteam/icons';
5
5
  import { Router, NavigationEnd, RouterLinkActive, RouterLink } from '@angular/router';
@@ -20,6 +20,13 @@ class Sidebar {
20
20
  logoLink = input(...(ngDevMode ? [undefined, { debugName: "logoLink" }] : /* istanbul ignore next */ []));
21
21
  title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
22
22
  subTitle = input(...(ngDevMode ? [undefined, { debugName: "subTitle" }] : /* istanbul ignore next */ []));
23
+ // Each half renders only when it carries text. A host can legitimately have
24
+ // one and not the other — clearing the tagline in the branding editor is how
25
+ // a tenant hides it — and an empty `<span>` still holds a line box, which
26
+ // left the surviving half sitting off-centre.
27
+ hasTitle = computed(() => !!this.title()?.trim(), ...(ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []));
28
+ hasSubTitle = computed(() => !!this.subTitle()?.trim(), ...(ngDevMode ? [{ debugName: "hasSubTitle" }] : /* istanbul ignore next */ []));
29
+ hasBrandText = computed(() => this.hasTitle() || this.hasSubTitle(), ...(ngDevMode ? [{ debugName: "hasBrandText" }] : /* istanbul ignore next */ []));
23
30
  bgColor = input(...(ngDevMode ? [undefined, { debugName: "bgColor" }] : /* istanbul ignore next */ []));
24
31
  bgImage = input(...(ngDevMode ? [undefined, { debugName: "bgImage" }] : /* istanbul ignore next */ []));
25
32
  bgRepeat = input(false, { ...(ngDevMode ? { debugName: "bgRepeat" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
@@ -137,11 +144,11 @@ class Sidebar {
137
144
  this.closeFlyout();
138
145
  }
139
146
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Sidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
140
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Sidebar, isStandalone: true, selector: "mt-sidebar", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoLink: { classPropertyName: "logoLink", publicName: "logoLink", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgImage: { classPropertyName: "bgImage", publicName: "bgImage", isSignal: true, isRequired: false, transformFunction: null }, bgRepeat: { classPropertyName: "bgRepeat", publicName: "bgRepeat", isSignal: true, isRequired: false, transformFunction: null }, iconsColor: { classPropertyName: "iconsColor", publicName: "iconsColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedChange: "expandedChange" }, host: { listeners: { "window:resize": "onViewportChange()" }, properties: { "attr.title": "null" } }, ngImport: i0, template: "<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || title()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && (title() || subTitle())) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (title() || subTitle()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <span class=\"text-sm font-semibold truncate\">{{ title() }}</span>\r\n @if (subTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [":host{display:block;height:100%;min-height:0}.mt-sidebar-menu{scrollbar-width:thin;scrollbar-color:var(--p-surface-400) transparent}.mt-sidebar-menu::-webkit-scrollbar{width:6px}.mt-sidebar-menu::-webkit-scrollbar-track{background:transparent}.mt-sidebar-menu::-webkit-scrollbar-thumb{border-radius:9999px;background:color-mix(in srgb,var(--p-surface-500) 58%,transparent)}.mt-sidebar-menu::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--p-surface-600) 72%,transparent)}.mt-sidebar-menu-collapsed{scrollbar-color:var(--p-surface-500) transparent}.mt-sidebar-menu-collapsed::-webkit-scrollbar{width:2px}.mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--p-surface-600) 82%,transparent)}.mt-sidebar-flyout{position:fixed;z-index:1200;animation:mt-sidebar-flyout-in .14s ease-out}@keyframes mt-sidebar-flyout-in{0%{opacity:0;transform:translateY(2px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.mt-sidebar-flyout{animation:none}}\n"], dependencies: [{ kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
147
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Sidebar, isStandalone: true, selector: "mt-sidebar", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoLink: { classPropertyName: "logoLink", publicName: "logoLink", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgImage: { classPropertyName: "bgImage", publicName: "bgImage", isSignal: true, isRequired: false, transformFunction: null }, bgRepeat: { classPropertyName: "bgRepeat", publicName: "bgRepeat", isSignal: true, isRequired: false, transformFunction: null }, iconsColor: { classPropertyName: "iconsColor", publicName: "iconsColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedChange: "expandedChange" }, host: { listeners: { "window:resize": "onViewportChange()" }, properties: { "attr.title": "null" } }, ngImport: i0, template: "<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || hasBrandText()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (hasTitle()) {\r\n <span class=\"text-sm font-semibold truncate\">{{\r\n title()\r\n }}</span>\r\n }\r\n @if (hasSubTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [":host{display:block;height:100%;min-height:0}.mt-sidebar-menu{scrollbar-width:thin;scrollbar-color:var(--p-surface-400) transparent}.mt-sidebar-menu::-webkit-scrollbar{width:6px}.mt-sidebar-menu::-webkit-scrollbar-track{background:transparent}.mt-sidebar-menu::-webkit-scrollbar-thumb{border-radius:9999px;background:color-mix(in srgb,var(--p-surface-500) 58%,transparent)}.mt-sidebar-menu::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--p-surface-600) 72%,transparent)}.mt-sidebar-menu-collapsed{scrollbar-color:var(--p-surface-500) transparent}.mt-sidebar-menu-collapsed::-webkit-scrollbar{width:2px}.mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--p-surface-600) 82%,transparent)}.mt-sidebar-flyout{position:fixed;z-index:1200;animation:mt-sidebar-flyout-in .14s ease-out}@keyframes mt-sidebar-flyout-in{0%{opacity:0;transform:translateY(2px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.mt-sidebar-flyout{animation:none}}\n"], dependencies: [{ kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
141
148
  }
142
149
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Sidebar, decorators: [{
143
150
  type: Component,
144
- args: [{ selector: 'mt-sidebar', standalone: true, imports: [RouterLinkActive, RouterLink, Icon, Tooltip, TranslocoPipe], host: { '[attr.title]': 'null' }, template: "<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || title()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && (title() || subTitle())) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (title() || subTitle()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <span class=\"text-sm font-semibold truncate\">{{ title() }}</span>\r\n @if (subTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [":host{display:block;height:100%;min-height:0}.mt-sidebar-menu{scrollbar-width:thin;scrollbar-color:var(--p-surface-400) transparent}.mt-sidebar-menu::-webkit-scrollbar{width:6px}.mt-sidebar-menu::-webkit-scrollbar-track{background:transparent}.mt-sidebar-menu::-webkit-scrollbar-thumb{border-radius:9999px;background:color-mix(in srgb,var(--p-surface-500) 58%,transparent)}.mt-sidebar-menu::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--p-surface-600) 72%,transparent)}.mt-sidebar-menu-collapsed{scrollbar-color:var(--p-surface-500) transparent}.mt-sidebar-menu-collapsed::-webkit-scrollbar{width:2px}.mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--p-surface-600) 82%,transparent)}.mt-sidebar-flyout{position:fixed;z-index:1200;animation:mt-sidebar-flyout-in .14s ease-out}@keyframes mt-sidebar-flyout-in{0%{opacity:0;transform:translateY(2px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.mt-sidebar-flyout{animation:none}}\n"] }]
151
+ args: [{ selector: 'mt-sidebar', standalone: true, imports: [RouterLinkActive, RouterLink, Icon, Tooltip, TranslocoPipe], host: { '[attr.title]': 'null' }, template: "<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || hasBrandText()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (hasTitle()) {\r\n <span class=\"text-sm font-semibold truncate\">{{\r\n title()\r\n }}</span>\r\n }\r\n @if (hasSubTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [":host{display:block;height:100%;min-height:0}.mt-sidebar-menu{scrollbar-width:thin;scrollbar-color:var(--p-surface-400) transparent}.mt-sidebar-menu::-webkit-scrollbar{width:6px}.mt-sidebar-menu::-webkit-scrollbar-track{background:transparent}.mt-sidebar-menu::-webkit-scrollbar-thumb{border-radius:9999px;background:color-mix(in srgb,var(--p-surface-500) 58%,transparent)}.mt-sidebar-menu::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--p-surface-600) 72%,transparent)}.mt-sidebar-menu-collapsed{scrollbar-color:var(--p-surface-500) transparent}.mt-sidebar-menu-collapsed::-webkit-scrollbar{width:2px}.mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--p-surface-600) 82%,transparent)}.mt-sidebar-flyout{position:fixed;z-index:1200;animation:mt-sidebar-flyout-in .14s ease-out}@keyframes mt-sidebar-flyout-in{0%{opacity:0;transform:translateY(2px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.mt-sidebar-flyout{animation:none}}\n"] }]
145
152
  }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], logoLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoLink", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitle", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], bgImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgImage", required: false }] }], bgRepeat: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgRepeat", required: false }] }], iconsColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconsColor", required: false }] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }], onViewportChange: [{
146
153
  type: HostListener,
147
154
  args: ['window:resize']
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-components-sidebar.mjs","sources":["../../../../packages/masterteam/components/sidebar/sidebar.ts","../../../../packages/masterteam/components/sidebar/sidebar.html","../../../../packages/masterteam/components/sidebar/masterteam-components-sidebar.ts"],"sourcesContent":["import {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n HostListener,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport {\r\n NavigationEnd,\r\n Router,\r\n RouterLink,\r\n RouterLinkActive,\r\n} from '@angular/router';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { filter } from 'rxjs';\r\nimport { Directionality } from '@angular/cdk/bidi';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\n\r\nexport interface SidebarItem {\r\n id: string | number;\r\n title: string;\r\n icon?: MTIcon;\r\n routerLink?: any[] | string;\r\n /** Absolute or app-relative URL for cross-app links. */\r\n href?: string;\r\n /**\r\n * Optional nested items. When present the entry becomes a submenu:\r\n * an inline accordion while the sidebar is expanded, and a hover/focus\r\n * flyout panel beside the icon while the sidebar is collapsed.\r\n */\r\n children?: SidebarItem[];\r\n /** Show a placeholder spinner row while the children load lazily. */\r\n loading?: boolean;\r\n}\r\n\r\n/** Positioned state for the collapsed-mode flyout panel. */\r\ninterface FlyoutState {\r\n item: SidebarItem;\r\n top: number;\r\n left?: number;\r\n right?: number;\r\n maxHeight: number;\r\n}\r\n\r\nconst FLYOUT_GAP = 8;\r\nconst FLYOUT_MARGIN = 16;\r\nconst FLYOUT_MIN_HEIGHT = 200;\r\nconst FLYOUT_CLOSE_DELAY = 140;\r\n\r\n@Component({\r\n selector: 'mt-sidebar',\r\n standalone: true,\r\n imports: [RouterLinkActive, RouterLink, Icon, Tooltip, TranslocoPipe],\r\n templateUrl: './sidebar.html',\r\n styles: [\r\n `\r\n :host {\r\n display: block;\r\n height: 100%;\r\n min-height: 0;\r\n }\r\n\r\n .mt-sidebar-menu {\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--p-surface-400) transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar {\r\n width: 6px;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-track {\r\n background: transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb {\r\n border-radius: 9999px;\r\n background: color-mix(in srgb, var(--p-surface-500) 58%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb:hover {\r\n background: color-mix(in srgb, var(--p-surface-600) 72%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu-collapsed {\r\n scrollbar-color: var(--p-surface-500) transparent;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar {\r\n width: 2px;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb {\r\n background: color-mix(in srgb, var(--p-surface-600) 82%, transparent);\r\n }\r\n\r\n /* Collapsed-mode submenu flyout */\r\n .mt-sidebar-flyout {\r\n position: fixed;\r\n z-index: 1200;\r\n animation: mt-sidebar-flyout-in 140ms ease-out;\r\n }\r\n\r\n @keyframes mt-sidebar-flyout-in {\r\n from {\r\n opacity: 0;\r\n transform: translateY(2px) scale(0.98);\r\n }\r\n\r\n to {\r\n opacity: 1;\r\n transform: translateY(0) scale(1);\r\n }\r\n }\r\n\r\n @media (prefers-reduced-motion: reduce) {\r\n .mt-sidebar-flyout {\r\n animation: none;\r\n }\r\n }\r\n `,\r\n ],\r\n // A static `title=\"…\"` is also the HTML global title attribute - without\r\n // this the browser shows it as a native tooltip over the whole sidebar.\r\n host: { '[attr.title]': 'null' },\r\n})\r\nexport class Sidebar {\r\n private readonly router = inject(Router);\r\n private readonly dir = inject(Directionality, { optional: true });\r\n\r\n items = input<SidebarItem[]>([]);\r\n\r\n logo = input<string>();\r\n logoLink = input<string | any[]>();\r\n title = input<string>();\r\n subTitle = input<string>();\r\n\r\n bgColor = input<string>();\r\n bgImage = input<string>();\r\n bgRepeat = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n iconsColor = input<string>('var(--p-text-color)');\r\n\r\n expanded = signal(false);\r\n expandedChange = output<boolean>();\r\n\r\n /** Parent items the user forced open / closed, overriding auto-expand. */\r\n private readonly openGroupIds = signal<Set<string | number>>(new Set());\r\n private readonly closedGroupIds = signal<Set<string | number>>(new Set());\r\n\r\n /** Currently anchored collapsed-mode flyout, if any. */\r\n readonly flyout = signal<FlyoutState | null>(null);\r\n private flyoutCloseTimer: ReturnType<typeof setTimeout> | null = null;\r\n\r\n /** Live URL so active sections auto-expand their submenu. */\r\n private readonly currentUrl = signal(this.router.url);\r\n\r\n protected readonly isRtl = computed(() => this.dir?.value === 'rtl');\r\n\r\n constructor() {\r\n this.router.events\r\n .pipe(\r\n filter(\r\n (event): event is NavigationEnd => event instanceof NavigationEnd,\r\n ),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe((event) => this.currentUrl.set(event.urlAfterRedirects));\r\n }\r\n\r\n toggleSidebar(): void {\r\n this.expanded.update((v) => !v);\r\n this.expandedChange.emit(this.expanded());\r\n this.closeFlyout();\r\n }\r\n\r\n hasChildren(item: SidebarItem): boolean {\r\n return !!item.children?.length || !!item.loading;\r\n }\r\n\r\n // ============================================================================\r\n // Expanded mode — inline accordion\r\n // ============================================================================\r\n\r\n isGroupOpen(item: SidebarItem): boolean {\r\n if (this.openGroupIds().has(item.id)) return true;\r\n if (this.closedGroupIds().has(item.id)) return false;\r\n return this.isSectionActive(item);\r\n }\r\n\r\n toggleGroup(item: SidebarItem, event?: Event): void {\r\n event?.stopPropagation();\r\n const open = new Set(this.openGroupIds());\r\n const closed = new Set(this.closedGroupIds());\r\n if (this.isGroupOpen(item)) {\r\n open.delete(item.id);\r\n closed.add(item.id);\r\n } else {\r\n closed.delete(item.id);\r\n open.add(item.id);\r\n }\r\n this.openGroupIds.set(open);\r\n this.closedGroupIds.set(closed);\r\n }\r\n\r\n /** A parent is \"active\" when the current route matches it or any child. */\r\n isSectionActive(item: SidebarItem): boolean {\r\n const url = this.currentUrl().split('?')[0];\r\n if (this.linkMatches(item.routerLink, url, true)) return true;\r\n return !!item.children?.some((child) =>\r\n this.linkMatches(child.routerLink, url),\r\n );\r\n }\r\n\r\n private linkMatches(\r\n link: SidebarItem['routerLink'],\r\n url: string,\r\n exact = false,\r\n ): boolean {\r\n const path = this.toPath(link);\r\n if (!path) return false;\r\n return exact ? url === path : url === path || url.startsWith(path + '/');\r\n }\r\n\r\n private toPath(link: SidebarItem['routerLink']): string {\r\n if (!link) return '';\r\n const parts = Array.isArray(link) ? link : [link];\r\n return ('/' + parts.map((p) => String(p)).join('/')).replace(\r\n /\\/{2,}/g,\r\n '/',\r\n );\r\n }\r\n\r\n // ============================================================================\r\n // Collapsed mode — flyout panel\r\n // ============================================================================\r\n\r\n openFlyout(item: SidebarItem, event: Event): void {\r\n if (this.expanded() || !this.hasChildren(item)) return;\r\n\r\n const anchor = event.currentTarget as HTMLElement | null;\r\n if (!anchor) return;\r\n\r\n this.cancelFlyoutClose();\r\n\r\n const rect = anchor.getBoundingClientRect();\r\n const viewportHeight = window.innerHeight;\r\n\r\n let top = rect.top;\r\n if (top + FLYOUT_MIN_HEIGHT > viewportHeight) {\r\n top = Math.max(\r\n FLYOUT_MARGIN,\r\n viewportHeight - FLYOUT_MIN_HEIGHT - FLYOUT_MARGIN,\r\n );\r\n }\r\n\r\n const maxHeight = Math.max(\r\n FLYOUT_MIN_HEIGHT,\r\n viewportHeight - top - FLYOUT_MARGIN,\r\n );\r\n\r\n this.flyout.set(\r\n this.isRtl()\r\n ? {\r\n item,\r\n top,\r\n right: window.innerWidth - rect.left + FLYOUT_GAP,\r\n maxHeight,\r\n }\r\n : { item, top, left: rect.right + FLYOUT_GAP, maxHeight },\r\n );\r\n }\r\n\r\n /** Keep the panel open while the pointer travels into it. */\r\n cancelFlyoutClose(): void {\r\n if (this.flyoutCloseTimer !== null) {\r\n clearTimeout(this.flyoutCloseTimer);\r\n this.flyoutCloseTimer = null;\r\n }\r\n }\r\n\r\n scheduleFlyoutClose(): void {\r\n this.cancelFlyoutClose();\r\n this.flyoutCloseTimer = setTimeout(\r\n () => this.flyout.set(null),\r\n FLYOUT_CLOSE_DELAY,\r\n );\r\n }\r\n\r\n closeFlyout(): void {\r\n this.cancelFlyoutClose();\r\n this.flyout.set(null);\r\n }\r\n\r\n @HostListener('window:resize')\r\n onViewportChange(): void {\r\n this.closeFlyout();\r\n }\r\n}\r\n","<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || title()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && (title() || subTitle())) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (title() || subTitle()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <span class=\"text-sm font-semibold truncate\">{{ title() }}</span>\r\n @if (subTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAiDA,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,kBAAkB,GAAG,GAAG;MA+EjB,OAAO,CAAA;AACD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACvB,GAAG,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEjE,IAAA,KAAK,GAAG,KAAK,CAAgB,EAAE,4EAAC;IAEhC,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACtB,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAkB;IAClC,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAA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AAA,EAAE,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,IAAI,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,OAAO,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FA0EzD,OAAO,EAAA,UAAA,EAAA,CAAA;kBA7EnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,EAAA,IAAA,EAwE/D,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,ukgBAAA,EAAA,MAAA,EAAA,CAAA,6gCAAA,CAAA,EAAA;;sBAyK/B,YAAY;uBAAC,eAAe;;;AE1S/B;;AAEG;;;;"}
1
+ {"version":3,"file":"masterteam-components-sidebar.mjs","sources":["../../../../packages/masterteam/components/sidebar/sidebar.ts","../../../../packages/masterteam/components/sidebar/sidebar.html","../../../../packages/masterteam/components/sidebar/masterteam-components-sidebar.ts"],"sourcesContent":["import {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n HostListener,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport {\r\n NavigationEnd,\r\n Router,\r\n RouterLink,\r\n RouterLinkActive,\r\n} from '@angular/router';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { filter } from 'rxjs';\r\nimport { Directionality } from '@angular/cdk/bidi';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\n\r\nexport interface SidebarItem {\r\n id: string | number;\r\n title: string;\r\n icon?: MTIcon;\r\n routerLink?: any[] | string;\r\n /** Absolute or app-relative URL for cross-app links. */\r\n href?: string;\r\n /**\r\n * Optional nested items. When present the entry becomes a submenu:\r\n * an inline accordion while the sidebar is expanded, and a hover/focus\r\n * flyout panel beside the icon while the sidebar is collapsed.\r\n */\r\n children?: SidebarItem[];\r\n /** Show a placeholder spinner row while the children load lazily. */\r\n loading?: boolean;\r\n}\r\n\r\n/** Positioned state for the collapsed-mode flyout panel. */\r\ninterface FlyoutState {\r\n item: SidebarItem;\r\n top: number;\r\n left?: number;\r\n right?: number;\r\n maxHeight: number;\r\n}\r\n\r\nconst FLYOUT_GAP = 8;\r\nconst FLYOUT_MARGIN = 16;\r\nconst FLYOUT_MIN_HEIGHT = 200;\r\nconst FLYOUT_CLOSE_DELAY = 140;\r\n\r\n@Component({\r\n selector: 'mt-sidebar',\r\n standalone: true,\r\n imports: [RouterLinkActive, RouterLink, Icon, Tooltip, TranslocoPipe],\r\n templateUrl: './sidebar.html',\r\n styles: [\r\n `\r\n :host {\r\n display: block;\r\n height: 100%;\r\n min-height: 0;\r\n }\r\n\r\n .mt-sidebar-menu {\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--p-surface-400) transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar {\r\n width: 6px;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-track {\r\n background: transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb {\r\n border-radius: 9999px;\r\n background: color-mix(in srgb, var(--p-surface-500) 58%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb:hover {\r\n background: color-mix(in srgb, var(--p-surface-600) 72%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu-collapsed {\r\n scrollbar-color: var(--p-surface-500) transparent;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar {\r\n width: 2px;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb {\r\n background: color-mix(in srgb, var(--p-surface-600) 82%, transparent);\r\n }\r\n\r\n /* Collapsed-mode submenu flyout */\r\n .mt-sidebar-flyout {\r\n position: fixed;\r\n z-index: 1200;\r\n animation: mt-sidebar-flyout-in 140ms ease-out;\r\n }\r\n\r\n @keyframes mt-sidebar-flyout-in {\r\n from {\r\n opacity: 0;\r\n transform: translateY(2px) scale(0.98);\r\n }\r\n\r\n to {\r\n opacity: 1;\r\n transform: translateY(0) scale(1);\r\n }\r\n }\r\n\r\n @media (prefers-reduced-motion: reduce) {\r\n .mt-sidebar-flyout {\r\n animation: none;\r\n }\r\n }\r\n `,\r\n ],\r\n // A static `title=\"…\"` is also the HTML global title attribute - without\r\n // this the browser shows it as a native tooltip over the whole sidebar.\r\n host: { '[attr.title]': 'null' },\r\n})\r\nexport class Sidebar {\r\n private readonly router = inject(Router);\r\n private readonly dir = inject(Directionality, { optional: true });\r\n\r\n items = input<SidebarItem[]>([]);\r\n\r\n logo = input<string>();\r\n logoLink = input<string | any[]>();\r\n title = input<string>();\r\n subTitle = input<string>();\r\n\r\n // Each half renders only when it carries text. A host can legitimately have\r\n // one and not the other — clearing the tagline in the branding editor is how\r\n // a tenant hides it — and an empty `<span>` still holds a line box, which\r\n // left the surviving half sitting off-centre.\r\n protected readonly hasTitle = computed(() => !!this.title()?.trim());\r\n protected readonly hasSubTitle = computed(() => !!this.subTitle()?.trim());\r\n protected readonly hasBrandText = computed(\r\n () => this.hasTitle() || this.hasSubTitle(),\r\n );\r\n\r\n bgColor = input<string>();\r\n bgImage = input<string>();\r\n bgRepeat = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n iconsColor = input<string>('var(--p-text-color)');\r\n\r\n expanded = signal(false);\r\n expandedChange = output<boolean>();\r\n\r\n /** Parent items the user forced open / closed, overriding auto-expand. */\r\n private readonly openGroupIds = signal<Set<string | number>>(new Set());\r\n private readonly closedGroupIds = signal<Set<string | number>>(new Set());\r\n\r\n /** Currently anchored collapsed-mode flyout, if any. */\r\n readonly flyout = signal<FlyoutState | null>(null);\r\n private flyoutCloseTimer: ReturnType<typeof setTimeout> | null = null;\r\n\r\n /** Live URL so active sections auto-expand their submenu. */\r\n private readonly currentUrl = signal(this.router.url);\r\n\r\n protected readonly isRtl = computed(() => this.dir?.value === 'rtl');\r\n\r\n constructor() {\r\n this.router.events\r\n .pipe(\r\n filter(\r\n (event): event is NavigationEnd => event instanceof NavigationEnd,\r\n ),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe((event) => this.currentUrl.set(event.urlAfterRedirects));\r\n }\r\n\r\n toggleSidebar(): void {\r\n this.expanded.update((v) => !v);\r\n this.expandedChange.emit(this.expanded());\r\n this.closeFlyout();\r\n }\r\n\r\n hasChildren(item: SidebarItem): boolean {\r\n return !!item.children?.length || !!item.loading;\r\n }\r\n\r\n // ============================================================================\r\n // Expanded mode — inline accordion\r\n // ============================================================================\r\n\r\n isGroupOpen(item: SidebarItem): boolean {\r\n if (this.openGroupIds().has(item.id)) return true;\r\n if (this.closedGroupIds().has(item.id)) return false;\r\n return this.isSectionActive(item);\r\n }\r\n\r\n toggleGroup(item: SidebarItem, event?: Event): void {\r\n event?.stopPropagation();\r\n const open = new Set(this.openGroupIds());\r\n const closed = new Set(this.closedGroupIds());\r\n if (this.isGroupOpen(item)) {\r\n open.delete(item.id);\r\n closed.add(item.id);\r\n } else {\r\n closed.delete(item.id);\r\n open.add(item.id);\r\n }\r\n this.openGroupIds.set(open);\r\n this.closedGroupIds.set(closed);\r\n }\r\n\r\n /** A parent is \"active\" when the current route matches it or any child. */\r\n isSectionActive(item: SidebarItem): boolean {\r\n const url = this.currentUrl().split('?')[0];\r\n if (this.linkMatches(item.routerLink, url, true)) return true;\r\n return !!item.children?.some((child) =>\r\n this.linkMatches(child.routerLink, url),\r\n );\r\n }\r\n\r\n private linkMatches(\r\n link: SidebarItem['routerLink'],\r\n url: string,\r\n exact = false,\r\n ): boolean {\r\n const path = this.toPath(link);\r\n if (!path) return false;\r\n return exact ? url === path : url === path || url.startsWith(path + '/');\r\n }\r\n\r\n private toPath(link: SidebarItem['routerLink']): string {\r\n if (!link) return '';\r\n const parts = Array.isArray(link) ? link : [link];\r\n return ('/' + parts.map((p) => String(p)).join('/')).replace(\r\n /\\/{2,}/g,\r\n '/',\r\n );\r\n }\r\n\r\n // ============================================================================\r\n // Collapsed mode — flyout panel\r\n // ============================================================================\r\n\r\n openFlyout(item: SidebarItem, event: Event): void {\r\n if (this.expanded() || !this.hasChildren(item)) return;\r\n\r\n const anchor = event.currentTarget as HTMLElement | null;\r\n if (!anchor) return;\r\n\r\n this.cancelFlyoutClose();\r\n\r\n const rect = anchor.getBoundingClientRect();\r\n const viewportHeight = window.innerHeight;\r\n\r\n let top = rect.top;\r\n if (top + FLYOUT_MIN_HEIGHT > viewportHeight) {\r\n top = Math.max(\r\n FLYOUT_MARGIN,\r\n viewportHeight - FLYOUT_MIN_HEIGHT - FLYOUT_MARGIN,\r\n );\r\n }\r\n\r\n const maxHeight = Math.max(\r\n FLYOUT_MIN_HEIGHT,\r\n viewportHeight - top - FLYOUT_MARGIN,\r\n );\r\n\r\n this.flyout.set(\r\n this.isRtl()\r\n ? {\r\n item,\r\n top,\r\n right: window.innerWidth - rect.left + FLYOUT_GAP,\r\n maxHeight,\r\n }\r\n : { item, top, left: rect.right + FLYOUT_GAP, maxHeight },\r\n );\r\n }\r\n\r\n /** Keep the panel open while the pointer travels into it. */\r\n cancelFlyoutClose(): void {\r\n if (this.flyoutCloseTimer !== null) {\r\n clearTimeout(this.flyoutCloseTimer);\r\n this.flyoutCloseTimer = null;\r\n }\r\n }\r\n\r\n scheduleFlyoutClose(): void {\r\n this.cancelFlyoutClose();\r\n this.flyoutCloseTimer = setTimeout(\r\n () => this.flyout.set(null),\r\n FLYOUT_CLOSE_DELAY,\r\n );\r\n }\r\n\r\n closeFlyout(): void {\r\n this.cancelFlyoutClose();\r\n this.flyout.set(null);\r\n }\r\n\r\n @HostListener('window:resize')\r\n onViewportChange(): void {\r\n this.closeFlyout();\r\n }\r\n}\r\n","<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || hasBrandText()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (hasTitle()) {\r\n <span class=\"text-sm font-semibold truncate\">{{\r\n title()\r\n }}</span>\r\n }\r\n @if (hasSubTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAiDA,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,kBAAkB,GAAG,GAAG;MA+EjB,OAAO,CAAA;AACD,IAAA,MAAM,GAAG,MA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AAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FA0EzD,OAAO,EAAA,UAAA,EAAA,CAAA;kBA7EnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,EAAA,IAAA,EAwE/D,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,kqgBAAA,EAAA,MAAA,EAAA,CAAA,6gCAAA,CAAA,EAAA;;sBAmL/B,YAAY;uBAAC,eAAe;;;AEpT/B;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, Component } from '@angular/core';
2
+ import { input, booleanAttribute, computed, Component } from '@angular/core';
3
3
  import { RouterLink } from '@angular/router';
4
4
  import { TranslocoPipe } from '@jsverse/transloco';
5
5
 
@@ -16,12 +16,19 @@ class Topbar {
16
16
  logoClass = input(...(ngDevMode ? [undefined, { debugName: "logoClass" }] : /* istanbul ignore next */ []));
17
17
  titleClass = input(...(ngDevMode ? [undefined, { debugName: "titleClass" }] : /* istanbul ignore next */ []));
18
18
  subTitleClass = input(...(ngDevMode ? [undefined, { debugName: "subTitleClass" }] : /* istanbul ignore next */ []));
19
+ // Each half renders only when it carries text. A host can legitimately have
20
+ // one and not the other — clearing the tagline in the branding editor is how
21
+ // a tenant hides it — and an empty element still holds a line box, which left
22
+ // the surviving half sitting off-centre against the logo.
23
+ hasTitle = computed(() => !!this.title()?.trim(), ...(ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []));
24
+ hasSubTitle = computed(() => !!this.subTitle()?.trim(), ...(ngDevMode ? [{ debugName: "hasSubTitle" }] : /* istanbul ignore next */ []));
25
+ hasBrandText = computed(() => this.hasTitle() || this.hasSubTitle(), ...(ngDevMode ? [{ debugName: "hasBrandText" }] : /* istanbul ignore next */ []));
19
26
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Topbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
20
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Topbar, isStandalone: true, selector: "mt-topbar", inputs: { logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoLink: { classPropertyName: "logoLink", publicName: "logoLink", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgImage: { classPropertyName: "bgImage", publicName: "bgImage", isSignal: true, isRequired: false, transformFunction: null }, bgRepeat: { classPropertyName: "bgRepeat", publicName: "bgRepeat", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null }, showBranding: { classPropertyName: "showBranding", publicName: "showBranding", isSignal: true, isRequired: false, transformFunction: null }, logoClass: { classPropertyName: "logoClass", publicName: "logoClass", isSignal: true, isRequired: false, transformFunction: null }, titleClass: { classPropertyName: "titleClass", publicName: "titleClass", isSignal: true, isRequired: false, transformFunction: null }, subTitleClass: { classPropertyName: "subTitleClass", publicName: "subTitleClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.title": "null" } }, ngImport: i0, template: "<div\r\n class=\"w-full flex justify-between align-center bg-primary px-4 py-2 h-[var(--header-height)]\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n>\r\n <div class=\"flex gap-4 items-center\" [style.color]=\"textColor()\">\r\n <div\r\n class=\"flex gap-3 items-center h-full overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!showBranding()\"\r\n [class.opacity-0]=\"!showBranding()\"\r\n [class.max-w-lg]=\"showBranding()\"\r\n [class.opacity-100]=\"showBranding()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.topbar.logoAlt' | transloco\"\r\n class=\"h-10 shrink-0\"\r\n [class]=\"logoClass()\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && (title() || subTitle())) {\r\n <div class=\"h-3/4 w-[1px] bg-current shrink-0 opacity-30\"></div>\r\n }\r\n @if (title() || subTitle()) {\r\n <div class=\"flex flex-col shrink-0\">\r\n <h2\r\n class=\"text-md font-semibold product-name whitespace-nowrap\"\r\n [class]=\"titleClass()\"\r\n >\r\n {{ title() }}\r\n </h2>\r\n <span\r\n class=\"text-sm product-tagline whitespace-nowrap\"\r\n [class]=\"subTitleClass()\"\r\n >{{ subTitle() }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n <ng-content select=\"[start]\"></ng-content>\r\n </div>\r\n <div class=\"flex gap-2 items-center\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
27
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Topbar, isStandalone: true, selector: "mt-topbar", inputs: { logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoLink: { classPropertyName: "logoLink", publicName: "logoLink", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgImage: { classPropertyName: "bgImage", publicName: "bgImage", isSignal: true, isRequired: false, transformFunction: null }, bgRepeat: { classPropertyName: "bgRepeat", publicName: "bgRepeat", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null }, showBranding: { classPropertyName: "showBranding", publicName: "showBranding", isSignal: true, isRequired: false, transformFunction: null }, logoClass: { classPropertyName: "logoClass", publicName: "logoClass", isSignal: true, isRequired: false, transformFunction: null }, titleClass: { classPropertyName: "titleClass", publicName: "titleClass", isSignal: true, isRequired: false, transformFunction: null }, subTitleClass: { classPropertyName: "subTitleClass", publicName: "subTitleClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.title": "null" } }, ngImport: i0, template: "<div\r\n class=\"w-full flex justify-between align-center bg-primary px-4 py-2 h-[var(--header-height)]\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n>\r\n <div class=\"flex gap-4 items-center\" [style.color]=\"textColor()\">\r\n <div\r\n class=\"flex gap-3 items-center h-full overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!showBranding()\"\r\n [class.opacity-0]=\"!showBranding()\"\r\n [class.max-w-lg]=\"showBranding()\"\r\n [class.opacity-100]=\"showBranding()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.topbar.logoAlt' | transloco\"\r\n class=\"h-10 shrink-0\"\r\n [class]=\"logoClass()\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div class=\"h-3/4 w-[1px] bg-current shrink-0 opacity-30\"></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div class=\"flex flex-col shrink-0\">\r\n @if (hasTitle()) {\r\n <h2\r\n class=\"text-md font-semibold product-name whitespace-nowrap\"\r\n [class]=\"titleClass()\"\r\n >\r\n {{ title() }}\r\n </h2>\r\n }\r\n @if (hasSubTitle()) {\r\n <span\r\n class=\"text-sm product-tagline whitespace-nowrap\"\r\n [class]=\"subTitleClass()\"\r\n >{{ subTitle() }}</span\r\n >\r\n }\r\n </div>\r\n }\r\n </div>\r\n <ng-content select=\"[start]\"></ng-content>\r\n </div>\r\n <div class=\"flex gap-2 items-center\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
21
28
  }
22
29
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Topbar, decorators: [{
23
30
  type: Component,
24
- args: [{ selector: 'mt-topbar', standalone: true, imports: [RouterLink, TranslocoPipe], host: { '[attr.title]': 'null' }, template: "<div\r\n class=\"w-full flex justify-between align-center bg-primary px-4 py-2 h-[var(--header-height)]\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n>\r\n <div class=\"flex gap-4 items-center\" [style.color]=\"textColor()\">\r\n <div\r\n class=\"flex gap-3 items-center h-full overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!showBranding()\"\r\n [class.opacity-0]=\"!showBranding()\"\r\n [class.max-w-lg]=\"showBranding()\"\r\n [class.opacity-100]=\"showBranding()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.topbar.logoAlt' | transloco\"\r\n class=\"h-10 shrink-0\"\r\n [class]=\"logoClass()\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && (title() || subTitle())) {\r\n <div class=\"h-3/4 w-[1px] bg-current shrink-0 opacity-30\"></div>\r\n }\r\n @if (title() || subTitle()) {\r\n <div class=\"flex flex-col shrink-0\">\r\n <h2\r\n class=\"text-md font-semibold product-name whitespace-nowrap\"\r\n [class]=\"titleClass()\"\r\n >\r\n {{ title() }}\r\n </h2>\r\n <span\r\n class=\"text-sm product-tagline whitespace-nowrap\"\r\n [class]=\"subTitleClass()\"\r\n >{{ subTitle() }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n <ng-content select=\"[start]\"></ng-content>\r\n </div>\r\n <div class=\"flex gap-2 items-center\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n" }]
31
+ args: [{ selector: 'mt-topbar', standalone: true, imports: [RouterLink, TranslocoPipe], host: { '[attr.title]': 'null' }, template: "<div\r\n class=\"w-full flex justify-between align-center bg-primary px-4 py-2 h-[var(--header-height)]\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n>\r\n <div class=\"flex gap-4 items-center\" [style.color]=\"textColor()\">\r\n <div\r\n class=\"flex gap-3 items-center h-full overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!showBranding()\"\r\n [class.opacity-0]=\"!showBranding()\"\r\n [class.max-w-lg]=\"showBranding()\"\r\n [class.opacity-100]=\"showBranding()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.topbar.logoAlt' | transloco\"\r\n class=\"h-10 shrink-0\"\r\n [class]=\"logoClass()\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div class=\"h-3/4 w-[1px] bg-current shrink-0 opacity-30\"></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div class=\"flex flex-col shrink-0\">\r\n @if (hasTitle()) {\r\n <h2\r\n class=\"text-md font-semibold product-name whitespace-nowrap\"\r\n [class]=\"titleClass()\"\r\n >\r\n {{ title() }}\r\n </h2>\r\n }\r\n @if (hasSubTitle()) {\r\n <span\r\n class=\"text-sm product-tagline whitespace-nowrap\"\r\n [class]=\"subTitleClass()\"\r\n >{{ subTitle() }}</span\r\n >\r\n }\r\n </div>\r\n }\r\n </div>\r\n <ng-content select=\"[start]\"></ng-content>\r\n </div>\r\n <div class=\"flex gap-2 items-center\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n" }]
25
32
  }], propDecorators: { logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], logoLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoLink", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], bgImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgImage", required: false }] }], bgRepeat: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgRepeat", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitle", required: false }] }], showBranding: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBranding", required: false }] }], logoClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoClass", required: false }] }], titleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleClass", required: false }] }], subTitleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitleClass", required: false }] }] } });
26
33
 
27
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-components-topbar.mjs","sources":["../../../../packages/masterteam/components/topbar/topbar.ts","../../../../packages/masterteam/components/topbar/topbar.html","../../../../packages/masterteam/components/topbar/masterteam-components-topbar.ts"],"sourcesContent":["import { booleanAttribute, Component, input } from '@angular/core';\r\nimport { RouterLink } from '@angular/router';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\n\r\n@Component({\r\n selector: 'mt-topbar',\r\n standalone: true,\r\n imports: [RouterLink, TranslocoPipe],\r\n templateUrl: './topbar.html',\r\n // A static `title=\"…\"` is also the HTML global title attribute - without\r\n // this the browser shows it as a native tooltip over the whole topbar.\r\n host: { '[attr.title]': 'null' },\r\n})\r\nexport class Topbar {\r\n logo = input<string>();\r\n logoLink = input<string | any[]>();\r\n bgColor = input<string>('var(--p-primary-color)');\r\n bgImage = input<string>();\r\n bgRepeat = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n textColor = input<string>('var(--p-primary-contrast-color)');\r\n title = input<string>();\r\n subTitle = input<string>();\r\n showBranding = input<boolean, unknown>(true, { transform: booleanAttribute });\r\n logoClass = input<string>();\r\n titleClass = input<string>();\r\n subTitleClass = input<string>();\r\n}\r\n","<div\r\n class=\"w-full flex justify-between align-center bg-primary px-4 py-2 h-[var(--header-height)]\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n>\r\n <div class=\"flex gap-4 items-center\" [style.color]=\"textColor()\">\r\n <div\r\n class=\"flex gap-3 items-center h-full overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!showBranding()\"\r\n [class.opacity-0]=\"!showBranding()\"\r\n [class.max-w-lg]=\"showBranding()\"\r\n [class.opacity-100]=\"showBranding()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.topbar.logoAlt' | transloco\"\r\n class=\"h-10 shrink-0\"\r\n [class]=\"logoClass()\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && (title() || subTitle())) {\r\n <div class=\"h-3/4 w-[1px] bg-current shrink-0 opacity-30\"></div>\r\n }\r\n @if (title() || subTitle()) {\r\n <div class=\"flex flex-col shrink-0\">\r\n <h2\r\n class=\"text-md font-semibold product-name whitespace-nowrap\"\r\n [class]=\"titleClass()\"\r\n >\r\n {{ title() }}\r\n </h2>\r\n <span\r\n class=\"text-sm product-tagline whitespace-nowrap\"\r\n [class]=\"subTitleClass()\"\r\n >{{ subTitle() }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n <ng-content select=\"[start]\"></ng-content>\r\n </div>\r\n <div class=\"flex gap-2 items-center\">\r\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AA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAMxB,MAAM,EAAA,UAAA,EAAA,CAAA;kBATlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,EAAE,aAAa,CAAC,EAAA,IAAA,EAI9B,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,m+DAAA,EAAA;;;AEXlC;;AAEG;;;;"}
1
+ {"version":3,"file":"masterteam-components-topbar.mjs","sources":["../../../../packages/masterteam/components/topbar/topbar.ts","../../../../packages/masterteam/components/topbar/topbar.html","../../../../packages/masterteam/components/topbar/masterteam-components-topbar.ts"],"sourcesContent":["import { booleanAttribute, Component, computed, input } from '@angular/core';\r\nimport { RouterLink } from '@angular/router';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\n\r\n@Component({\r\n selector: 'mt-topbar',\r\n standalone: true,\r\n imports: [RouterLink, TranslocoPipe],\r\n templateUrl: './topbar.html',\r\n // A static `title=\"…\"` is also the HTML global title attribute - without\r\n // this the browser shows it as a native tooltip over the whole topbar.\r\n host: { '[attr.title]': 'null' },\r\n})\r\nexport class Topbar {\r\n logo = input<string>();\r\n logoLink = input<string | any[]>();\r\n bgColor = input<string>('var(--p-primary-color)');\r\n bgImage = input<string>();\r\n bgRepeat = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n textColor = input<string>('var(--p-primary-contrast-color)');\r\n title = input<string>();\r\n subTitle = input<string>();\r\n showBranding = input<boolean, unknown>(true, { transform: booleanAttribute });\r\n logoClass = input<string>();\r\n titleClass = input<string>();\r\n subTitleClass = input<string>();\r\n\r\n // Each half renders only when it carries text. A host can legitimately have\r\n // one and not the other — clearing the tagline in the branding editor is how\r\n // a tenant hides it — and an empty element still holds a line box, which left\r\n // the surviving half sitting off-centre against the logo.\r\n protected readonly hasTitle = computed(() => !!this.title()?.trim());\r\n protected readonly hasSubTitle = computed(() => !!this.subTitle()?.trim());\r\n protected readonly hasBrandText = computed(\r\n () => this.hasTitle() || this.hasSubTitle(),\r\n );\r\n}\r\n","<div\r\n class=\"w-full flex justify-between align-center bg-primary px-4 py-2 h-[var(--header-height)]\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n>\r\n <div class=\"flex gap-4 items-center\" [style.color]=\"textColor()\">\r\n <div\r\n class=\"flex gap-3 items-center h-full overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!showBranding()\"\r\n [class.opacity-0]=\"!showBranding()\"\r\n [class.max-w-lg]=\"showBranding()\"\r\n [class.opacity-100]=\"showBranding()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.topbar.logoAlt' | transloco\"\r\n class=\"h-10 shrink-0\"\r\n [class]=\"logoClass()\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div class=\"h-3/4 w-[1px] bg-current shrink-0 opacity-30\"></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div class=\"flex flex-col shrink-0\">\r\n @if (hasTitle()) {\r\n <h2\r\n class=\"text-md font-semibold product-name whitespace-nowrap\"\r\n [class]=\"titleClass()\"\r\n >\r\n {{ title() }}\r\n </h2>\r\n }\r\n @if (hasSubTitle()) {\r\n <span\r\n class=\"text-sm product-tagline whitespace-nowrap\"\r\n [class]=\"subTitleClass()\"\r\n >{{ subTitle() }}</span\r\n >\r\n }\r\n </div>\r\n }\r\n </div>\r\n <ng-content select=\"[start]\"></ng-content>\r\n </div>\r\n <div class=\"flex gap-2 items-center\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAaa,MAAM,CAAA;IACjB,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACtB,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAkB;AAClC,IAAA,OAAO,GAAG,KAAK,CAAS,wBAAwB,8EAAC;IACjD,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACzB,QAAQ,GAAG,KAAK,CAAmB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAC1E,IAAA,SAAS,GAAG,KAAK,CAAS,iCAAiC,gFAAC;IAC5D,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACvB,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IAC1B,YAAY,GAAG,KAAK,CAAmB,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IAC7E,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IAC3B,UAAU,GAAG,KAA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A,EAAA,aAAA,EAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECbnB,0kEAwDA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDjDY,UAAU,+NAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAMxB,MAAM,EAAA,UAAA,EAAA,CAAA;kBATlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,EAAE,aAAa,CAAC,EAAA,IAAA,EAI9B,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,0kEAAA,EAAA;;;AEXlC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/components",
3
- "version": "0.0.279",
3
+ "version": "0.0.280",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -68,13 +68,48 @@ declare function resolveActionLabel(action: RuntimeAction): string;
68
68
  declare function buildActionPayload(action: RuntimeAction, formValue: Record<string, unknown> | undefined, externalResolvers?: Record<string, () => unknown>): Record<string, unknown> | undefined;
69
69
  declare function normalizePayloadValue(key: string, value: unknown): unknown;
70
70
  declare function resolveDefaultPayloadValue(key: string): unknown;
71
+ /**
72
+ * The declared operation inputs the payload would submit with no value — the
73
+ * `{ propertyKey, value: null }` placeholders the backend sent, still unfilled.
74
+ *
75
+ * A non-empty result means the action was fired without rendering its form, and
76
+ * submitting it would write nulls over the record (or fail the contract's
77
+ * `operation_input.required` rule). Hosts fill these by running the operation
78
+ * through `process-form-load` / `process-submit` instead.
79
+ */
80
+ declare function getUnfilledActionInputKeys(payload: Record<string, unknown> | undefined): string[];
71
81
  declare function getMissingRequiredPayloadKeys(action: RuntimeAction, payload: Record<string, unknown> | undefined): string[];
72
82
  declare function isMissingPayloadValue(value: unknown): boolean;
73
83
  declare function normalizeHttpMethod(value: string | null | undefined): string | null;
74
84
  declare function methodSupportsBody(method: string): boolean;
75
85
  declare function buildRequestOptions(method: string, payload: Record<string, unknown> | undefined): Record<string, unknown>;
86
+ /**
87
+ * The action collects free-form request metadata — a reason, a note, a
88
+ * delegate, attachments — which the generic confirm dialog can render on its
89
+ * own because the keys are fixed and operation-independent.
90
+ *
91
+ * Operation *inputs* are a different thing entirely: see
92
+ * {@link hasActionInputFields}.
93
+ */
76
94
  declare function hasActionFormFields(action: RuntimeAction): boolean;
77
- declare function hasProgressTemplateField(action: RuntimeAction): boolean;
95
+ /**
96
+ * The action declares operation inputs the user still has to supply — its
97
+ * `payloadTemplate.fields` is a non-empty list of `{ propertyKey, value: null }`
98
+ * placeholders.
99
+ *
100
+ * Firing such an action straight from its template submits those nulls, so a
101
+ * host must instead run the operation through its own form: `process-form-load`
102
+ * for the effective form and current values, `process-submit/validate`, then
103
+ * `process-submit`. The backend owns which fields those are — never infer them
104
+ * from the operation key.
105
+ */
106
+ declare function hasActionInputFields(action: RuntimeAction): boolean;
107
+ /**
108
+ * The property keys an action declares as its operation inputs, in the
109
+ * backend's own casing. Pass them to `mt-client-form`'s `allowedFieldKeys` to
110
+ * scope a configured form down to the inputs this action actually writes.
111
+ */
112
+ declare function getActionInputFieldKeys(action: RuntimeAction): string[];
78
113
 
79
114
  declare class RuntimeActionContextStore {
80
115
  private readonly formSource;
@@ -101,5 +136,5 @@ declare class RuntimeActionRunner {
101
136
  static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeActionRunner>;
102
137
  }
103
138
 
104
- export { RUNTIME_ACTION_CONFIRM_DIALOG, RuntimeActionContextStore, RuntimeActionRunner, buildActionPayload, buildRequestOptions, getMissingRequiredPayloadKeys, hasActionFormFields, hasProgressTemplateField, isMissingPayloadValue, methodSupportsBody, normalizeHttpMethod, normalizePayloadValue, resolveActionLabel, resolveDefaultPayloadValue };
139
+ export { RUNTIME_ACTION_CONFIRM_DIALOG, RuntimeActionContextStore, RuntimeActionRunner, buildActionPayload, buildRequestOptions, getActionInputFieldKeys, getMissingRequiredPayloadKeys, getUnfilledActionInputKeys, hasActionFormFields, hasActionInputFields, isMissingPayloadValue, methodSupportsBody, normalizeHttpMethod, normalizePayloadValue, resolveActionLabel, resolveDefaultPayloadValue };
105
140
  export type { RuntimeAction, RuntimeActionAfterSuccess, RuntimeActionExecuteOptions, RuntimeActionFormSource, RuntimeActionFormValue, RuntimeActionReason, RuntimeActionResult, RuntimeActionStatus, RuntimeActionTranslatable };
@@ -33,6 +33,9 @@ declare class Sidebar {
33
33
  logoLink: _angular_core.InputSignal<string | any[] | undefined>;
34
34
  title: _angular_core.InputSignal<string | undefined>;
35
35
  subTitle: _angular_core.InputSignal<string | undefined>;
36
+ protected readonly hasTitle: _angular_core.Signal<boolean>;
37
+ protected readonly hasSubTitle: _angular_core.Signal<boolean>;
38
+ protected readonly hasBrandText: _angular_core.Signal<boolean>;
36
39
  bgColor: _angular_core.InputSignal<string | undefined>;
37
40
  bgImage: _angular_core.InputSignal<string | undefined>;
38
41
  bgRepeat: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -13,6 +13,9 @@ declare class Topbar {
13
13
  logoClass: _angular_core.InputSignal<string | undefined>;
14
14
  titleClass: _angular_core.InputSignal<string | undefined>;
15
15
  subTitleClass: _angular_core.InputSignal<string | undefined>;
16
+ protected readonly hasTitle: _angular_core.Signal<boolean>;
17
+ protected readonly hasSubTitle: _angular_core.Signal<boolean>;
18
+ protected readonly hasBrandText: _angular_core.Signal<boolean>;
16
19
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Topbar, never>;
17
20
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Topbar, "mt-topbar", never, { "logo": { "alias": "logo"; "required": false; "isSignal": true; }; "logoLink": { "alias": "logoLink"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "bgImage": { "alias": "bgImage"; "required": false; "isSignal": true; }; "bgRepeat": { "alias": "bgRepeat"; "required": false; "isSignal": true; }; "textColor": { "alias": "textColor"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "subTitle": { "alias": "subTitle"; "required": false; "isSignal": true; }; "showBranding": { "alias": "showBranding"; "required": false; "isSignal": true; }; "logoClass": { "alias": "logoClass"; "required": false; "isSignal": true; }; "titleClass": { "alias": "titleClass"; "required": false; "isSignal": true; }; "subTitleClass": { "alias": "subTitleClass"; "required": false; "isSignal": true; }; }, {}, never, ["[start]", "[actions]"], true, never>;
18
21
  }