@muxima-ui/core 1.4.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +11 -0
  2. package/fesm2022/muxima-ui-core-alert.mjs +5 -3
  3. package/fesm2022/muxima-ui-core-alert.mjs.map +1 -1
  4. package/fesm2022/muxima-ui-core-breadcrumb.mjs +5 -3
  5. package/fesm2022/muxima-ui-core-breadcrumb.mjs.map +1 -1
  6. package/fesm2022/muxima-ui-core-carousel.mjs +19 -17
  7. package/fesm2022/muxima-ui-core-carousel.mjs.map +1 -1
  8. package/fesm2022/muxima-ui-core-chips.mjs +19 -14
  9. package/fesm2022/muxima-ui-core-chips.mjs.map +1 -1
  10. package/fesm2022/muxima-ui-core-clipboard.mjs +10 -6
  11. package/fesm2022/muxima-ui-core-clipboard.mjs.map +1 -1
  12. package/fesm2022/muxima-ui-core-color-picker.mjs +53 -50
  13. package/fesm2022/muxima-ui-core-color-picker.mjs.map +1 -1
  14. package/fesm2022/muxima-ui-core-combobox.mjs +15 -12
  15. package/fesm2022/muxima-ui-core-combobox.mjs.map +1 -1
  16. package/fesm2022/muxima-ui-core-command.mjs +21 -16
  17. package/fesm2022/muxima-ui-core-command.mjs.map +1 -1
  18. package/fesm2022/muxima-ui-core-data-grid.mjs +50 -52
  19. package/fesm2022/muxima-ui-core-data-grid.mjs.map +1 -1
  20. package/fesm2022/muxima-ui-core-date-picker.mjs +102 -69
  21. package/fesm2022/muxima-ui-core-date-picker.mjs.map +1 -1
  22. package/fesm2022/muxima-ui-core-editor.mjs +25 -19
  23. package/fesm2022/muxima-ui-core-editor.mjs.map +1 -1
  24. package/fesm2022/muxima-ui-core-file-upload.mjs +32 -27
  25. package/fesm2022/muxima-ui-core-file-upload.mjs.map +1 -1
  26. package/fesm2022/muxima-ui-core-form-field.mjs +2 -2
  27. package/fesm2022/muxima-ui-core-form-field.mjs.map +1 -1
  28. package/fesm2022/muxima-ui-core-i18n.mjs +550 -0
  29. package/fesm2022/muxima-ui-core-i18n.mjs.map +1 -0
  30. package/fesm2022/muxima-ui-core-image-cropper.mjs +27 -24
  31. package/fesm2022/muxima-ui-core-image-cropper.mjs.map +1 -1
  32. package/fesm2022/muxima-ui-core-kanban.mjs +22 -19
  33. package/fesm2022/muxima-ui-core-kanban.mjs.map +1 -1
  34. package/fesm2022/muxima-ui-core-notification-center.mjs +42 -37
  35. package/fesm2022/muxima-ui-core-notification-center.mjs.map +1 -1
  36. package/fesm2022/muxima-ui-core-pagination.mjs +29 -26
  37. package/fesm2022/muxima-ui-core-pagination.mjs.map +1 -1
  38. package/fesm2022/muxima-ui-core-progress.mjs +5 -3
  39. package/fesm2022/muxima-ui-core-progress.mjs.map +1 -1
  40. package/fesm2022/muxima-ui-core-rating.mjs +12 -8
  41. package/fesm2022/muxima-ui-core-rating.mjs.map +1 -1
  42. package/fesm2022/muxima-ui-core-select.mjs +14 -11
  43. package/fesm2022/muxima-ui-core-select.mjs.map +1 -1
  44. package/fesm2022/muxima-ui-core-sidebar.mjs +10 -7
  45. package/fesm2022/muxima-ui-core-sidebar.mjs.map +1 -1
  46. package/fesm2022/muxima-ui-core-slider.mjs +10 -8
  47. package/fesm2022/muxima-ui-core-slider.mjs.map +1 -1
  48. package/fesm2022/muxima-ui-core-stepper.mjs +5 -3
  49. package/fesm2022/muxima-ui-core-stepper.mjs.map +1 -1
  50. package/fesm2022/muxima-ui-core-table.mjs +4 -4
  51. package/fesm2022/muxima-ui-core-table.mjs.map +1 -1
  52. package/fesm2022/muxima-ui-core-time-picker.mjs +7 -5
  53. package/fesm2022/muxima-ui-core-time-picker.mjs.map +1 -1
  54. package/fesm2022/muxima-ui-core-toast.mjs +8 -5
  55. package/fesm2022/muxima-ui-core-toast.mjs.map +1 -1
  56. package/fesm2022/muxima-ui-core-tour.mjs +6 -12
  57. package/fesm2022/muxima-ui-core-tour.mjs.map +1 -1
  58. package/fesm2022/muxima-ui-core.mjs +1 -1
  59. package/fesm2022/muxima-ui-core.mjs.map +1 -1
  60. package/package.json +5 -1
  61. package/types/muxima-ui-core-alert.d.ts +3 -1
  62. package/types/muxima-ui-core-breadcrumb.d.ts +6 -4
  63. package/types/muxima-ui-core-carousel.d.ts +4 -2
  64. package/types/muxima-ui-core-chips.d.ts +23 -3
  65. package/types/muxima-ui-core-clipboard.d.ts +6 -3
  66. package/types/muxima-ui-core-color-picker.d.ts +40 -7
  67. package/types/muxima-ui-core-combobox.d.ts +6 -3
  68. package/types/muxima-ui-core-command.d.ts +7 -3
  69. package/types/muxima-ui-core-data-grid.d.ts +30 -10
  70. package/types/muxima-ui-core-date-picker.d.ts +64 -15
  71. package/types/muxima-ui-core-editor.d.ts +13 -2
  72. package/types/muxima-ui-core-file-upload.d.ts +23 -7
  73. package/types/muxima-ui-core-form-field.d.ts +2 -2
  74. package/types/muxima-ui-core-i18n.d.ts +322 -0
  75. package/types/muxima-ui-core-image-cropper.d.ts +19 -6
  76. package/types/muxima-ui-core-kanban.d.ts +16 -3
  77. package/types/muxima-ui-core-notification-center.d.ts +31 -9
  78. package/types/muxima-ui-core-pagination.d.ts +16 -1
  79. package/types/muxima-ui-core-progress.d.ts +10 -8
  80. package/types/muxima-ui-core-rating.d.ts +6 -2
  81. package/types/muxima-ui-core-select.d.ts +6 -3
  82. package/types/muxima-ui-core-sidebar.d.ts +6 -3
  83. package/types/muxima-ui-core-slider.d.ts +6 -4
  84. package/types/muxima-ui-core-stepper.d.ts +10 -8
  85. package/types/muxima-ui-core-table.d.ts +3 -3
  86. package/types/muxima-ui-core-time-picker.d.ts +3 -1
  87. package/types/muxima-ui-core-toast.d.ts +3 -0
  88. package/types/muxima-ui-core-tour.d.ts +3 -3
  89. package/types/muxima-ui-core.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"muxima-ui-core-tour.mjs","sources":["../../../projects/core/tour/tour.ts","../../../projects/core/tour/muxima-ui-core-tour.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Directive,\n ElementRef,\n Injectable,\n InjectionToken,\n Injector,\n NgZone,\n TemplateRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { CdkTrapFocus } from '@angular/cdk/a11y';\nimport {\n OverlayRef,\n createGlobalPositionStrategy,\n createNoopScrollStrategy,\n createOverlayRef,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { MxButton } from '@muxima-ui/core/button';\nimport { mxUniqueId } from '@muxima-ui/core/form-field';\n\n/** Onde fica o cartão em relação ao elemento destacado. */\nexport type MxTourPlacement = 'auto' | 'top' | 'bottom' | 'start' | 'end';\n\n/** Nome de um `mxTourAnchor`, um elemento, ou um ElementRef. */\nexport type MxTourTarget = string | Element | ElementRef<Element>;\n\n/** Contexto do modelo de conteúdo de um passo. */\nexport interface MxTourStepContext {\n $implicit: MxTourStep;\n index: number;\n tour: MxTourRef;\n}\n\n/** Um passo da visita guiada. */\nexport interface MxTourStep {\n /** Elemento a destacar. Sem alvo (ou se não existir), o cartão aparece ao centro. */\n target?: MxTourTarget | null;\n title: string;\n /** Texto do passo. */\n content?: string;\n /** Conteúdo rico, em vez de `content`. */\n template?: TemplateRef<MxTourStepContext>;\n placement?: MxTourPlacement;\n /** Espaço à volta do elemento destacado, em px. Por omissão 6. */\n padding?: number;\n /** Corre antes de mostrar o passo (ex.: abrir um separador). Pode devolver uma Promise. */\n beforeShow?: () => void | Promise<unknown>;\n}\n\nexport interface MxTourLabels {\n next: string;\n previous: string;\n done: string;\n skip: string;\n close: string;\n /** Texto do progresso, por exemplo \"Passo 2 de 5\". */\n progress: (current: number, total: number) => string;\n}\n\nexport const MX_TOUR_LABELS: MxTourLabels = {\n next: 'Seguinte',\n previous: 'Anterior',\n done: 'Concluir',\n skip: 'Saltar',\n close: 'Fechar a visita guiada',\n progress: (current, total) => `Passo ${current} de ${total}`,\n};\n\nexport interface MxTourOptions {\n /** Passo inicial (base 0). */\n startAt?: number;\n labels?: Partial<MxTourLabels>;\n /** false: sem Saltar, sem botão de fechar e sem Escape (a visita tem de ser feita até ao fim). */\n dismissible?: boolean;\n /** Mostra os pontos de progresso. Por omissão true. */\n showDots?: boolean;\n}\n\n/** Como terminou a visita. */\nexport interface MxTourResult {\n /** true se chegou ao fim com Concluir. */\n completed: boolean;\n /** Último passo mostrado (base 0). */\n index: number;\n}\n\n/** Referência a uma visita em curso. */\nexport class MxTourRef {\n /** Passo actual (base 0). */\n readonly index = signal(0);\n /** Resolve quando a visita fecha. */\n readonly afterClosed: Promise<MxTourResult>;\n readonly labels: MxTourLabels;\n readonly dismissible: boolean;\n readonly showDots: boolean;\n private resolve!: (r: MxTourResult) => void;\n private done = false;\n\n constructor(\n readonly steps: readonly MxTourStep[],\n options: MxTourOptions,\n private readonly onClose: (r: MxTourResult) => void,\n ) {\n this.labels = { ...MX_TOUR_LABELS, ...options.labels };\n this.dismissible = options.dismissible ?? true;\n this.showDots = options.showDots ?? true;\n this.index.set(Math.min(Math.max(options.startAt ?? 0, 0), Math.max(steps.length - 1, 0)));\n this.afterClosed = new Promise((r) => (this.resolve = r));\n }\n\n get isOpen(): boolean {\n return !this.done;\n }\n get isLast(): boolean {\n return this.index() === this.steps.length - 1;\n }\n\n next(): void {\n if (this.isLast) this.close(true);\n else this.goTo(this.index() + 1);\n }\n previous(): void {\n this.goTo(this.index() - 1);\n }\n goTo(index: number): void {\n if (this.done || index < 0 || index >= this.steps.length) return;\n this.index.set(index);\n }\n /** Fecha a visita; `completed` diz se foi até ao fim. */\n close(completed = false): void {\n if (this.done) return;\n this.done = true;\n const result = { completed, index: this.index() };\n this.onClose(result);\n this.resolve(result);\n }\n}\n\nconst MX_TOUR_REF = new InjectionToken<MxTourRef>('MX_TOUR_REF');\n\ninterface Box {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\n/** requestAnimationFrame, ou um setTimeout onde não exista (testes, SSR). */\nconst nextFrame = (cb: () => void): number =>\n typeof requestAnimationFrame === 'function' ? requestAnimationFrame(cb) : (setTimeout(cb, 16) as unknown as number);\nconst cancelFrame = (id: number): void =>\n typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame(id) : clearTimeout(id);\n\nconst GAP = 12;\nconst MARGIN = 12;\n\n/** Painel da visita: o destaque, o fundo escurecido e o cartão do passo. Uso interno. */\n@Component({\n selector: 'mx-tour-panel',\n imports: [NgTemplateOutlet, CdkTrapFocus, MxButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'mx-tour-layer' },\n template: `\n @if (spot(); as s) {\n <div\n class=\"mx-tour-spotlight\"\n aria-hidden=\"true\"\n [style.top.px]=\"s.top\"\n [style.left.px]=\"s.left\"\n [style.width.px]=\"s.width\"\n [style.height.px]=\"s.height\"\n ></div>\n } @else {\n <div class=\"mx-tour-dim\" aria-hidden=\"true\"></div>\n }\n @if (step(); as st) {\n <div\n #card\n class=\"mx-tour-card\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n cdkTrapFocus\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"progressId + ' ' + bodyId\"\n [attr.data-placement]=\"spot() ? placement() : 'center'\"\n [style.top.px]=\"spot() ? pos().top : null\"\n [style.left.px]=\"spot() ? pos().left : null\"\n [style.visibility]=\"ready() ? null : 'hidden'\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"mx-tour-head\">\n <p class=\"mx-tour-progress\" [id]=\"progressId\">\n {{ ref.labels.progress(ref.index() + 1, ref.steps.length) }}\n </p>\n @if (ref.dismissible) {\n <button\n type=\"button\"\n class=\"mx-tour-close\"\n [attr.aria-label]=\"ref.labels.close\"\n (click)=\"ref.close(false)\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M4 4l8 8M12 4l-8 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n }\n </div>\n <h2 class=\"mx-tour-title\" [id]=\"titleId\">{{ st.title }}</h2>\n <div class=\"mx-tour-body\" [id]=\"bodyId\">\n @if (st.template) {\n <ng-container\n *ngTemplateOutlet=\"st.template; context: { $implicit: st, index: ref.index(), tour: ref }\"\n />\n } @else if (st.content) {\n <p>{{ st.content }}</p>\n }\n </div>\n <div class=\"mx-tour-foot\">\n @if (ref.showDots && ref.steps.length > 1) {\n <span class=\"mx-tour-dots\" aria-hidden=\"true\">\n @for (s of ref.steps; track $index) {\n <span class=\"mx-tour-dot\" [attr.data-active]=\"$index === ref.index() ? '' : null\"></span>\n }\n </span>\n }\n <span class=\"mx-tour-actions\">\n @if (ref.dismissible && !ref.isLast) {\n <button mxButton variant=\"ghost\" size=\"sm\" type=\"button\" (click)=\"ref.close(false)\">\n {{ ref.labels.skip }}\n </button>\n }\n @if (ref.index() > 0) {\n <button mxButton variant=\"outline\" size=\"sm\" type=\"button\" (click)=\"ref.previous()\">\n {{ ref.labels.previous }}\n </button>\n }\n <button mxButton size=\"sm\" type=\"button\" (click)=\"ref.next()\">\n {{ ref.isLast ? ref.labels.done : ref.labels.next }}\n </button>\n </span>\n </div>\n </div>\n }\n `,\n})\nexport class MxTourPanel {\n protected readonly ref = inject(MX_TOUR_REF);\n private readonly tour = inject(MxTour);\n\n protected readonly titleId = mxUniqueId('mx-tour-title');\n protected readonly bodyId = mxUniqueId('mx-tour-body');\n protected readonly progressId = mxUniqueId('mx-tour-progress');\n\n private readonly card = viewChild<ElementRef<HTMLElement>>('card');\n private readonly zone = inject(NgZone);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Passo que está desenhado (muda depois de beforeShow). */\n protected readonly step = signal<MxTourStep | null>(null);\n private readonly target = signal<Element | null>(null);\n protected readonly spot = signal<Box | null>(null);\n protected readonly pos = signal({ top: 0, left: 0 });\n protected readonly placement = signal<Exclude<MxTourPlacement, 'auto'>>('bottom');\n protected readonly ready = signal(false);\n\n private frame = 0;\n private resizeObserver?: ResizeObserver;\n private showToken = 0;\n\n constructor() {\n const destroy = inject(DestroyRef);\n // mostra o passo sempre que o índice muda\n effect(() => {\n const i = this.ref.index();\n untracked(() => void this.show(i));\n });\n\n afterNextRender(() => {\n const schedule = () => this.schedule();\n this.zone.runOutsideAngular(() => {\n window.addEventListener('scroll', schedule, { capture: true, passive: true });\n window.addEventListener('resize', schedule, { passive: true });\n });\n if (typeof ResizeObserver !== 'undefined') this.resizeObserver = new ResizeObserver(schedule);\n destroy.onDestroy(() => {\n window.removeEventListener('scroll', schedule, { capture: true });\n window.removeEventListener('resize', schedule);\n this.resizeObserver?.disconnect();\n cancelFrame(this.frame);\n });\n });\n }\n\n private async show(index: number): Promise<void> {\n const token = ++this.showToken;\n const st = this.ref.steps[index];\n if (!st) return;\n // só se esconde antes do primeiro passo (para o posicionar); depois, esconder\n // o cartão tirava-lhe o foco a meio da visita\n if (!this.step()) this.ready.set(false);\n try {\n await st.beforeShow?.();\n } catch {\n // um beforeShow que falha não deve prender a visita\n }\n // espera um frame para o DOM reflectir o que beforeShow mudou\n await new Promise<void>((r) => nextFrame(r));\n if (token !== this.showToken || !this.ref.isOpen) return;\n\n // o alvo pode só aparecer depois de beforeShow (ex.: conteúdo de um separador)\n let el = this.tour.resolve(st.target);\n for (let i = 0; !el && st.target && i < 5; i++) {\n await new Promise<void>((r) => nextFrame(r));\n if (token !== this.showToken || !this.ref.isOpen) return;\n el = this.tour.resolve(st.target);\n }\n this.resizeObserver?.disconnect();\n this.target.set(el);\n if (el) {\n this.resizeObserver?.observe(el);\n const r = el.getBoundingClientRect();\n const fora = r.top < 0 || r.bottom > window.innerHeight || r.left < 0 || r.right > window.innerWidth;\n if (fora) {\n const reduzir = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n el.scrollIntoView?.({ block: 'center', inline: 'nearest', behavior: reduzir ? 'auto' : 'smooth' });\n }\n }\n this.step.set(st);\n // desenha já o cartão para o medir, posicionar e dar-lhe o foco\n this.cdr.detectChanges();\n const card = this.card()?.nativeElement;\n if (card) this.resizeObserver?.observe(card);\n this.update();\n this.ready.set(true);\n this.cdr.detectChanges();\n card?.focus({ preventScroll: true });\n }\n\n private schedule(): void {\n cancelFrame(this.frame);\n this.frame = nextFrame(() => this.zone.run(() => this.update()));\n }\n\n private update(): void {\n const st = this.step();\n const el = this.target();\n const r = el?.getBoundingClientRect();\n if (!st || !r || (r.width === 0 && r.height === 0)) {\n this.spot.set(null);\n return;\n }\n const pad = st.padding ?? 6;\n const spot: Box = { top: r.top - pad, left: r.left - pad, width: r.width + pad * 2, height: r.height + pad * 2 };\n this.spot.set(spot);\n\n const card = this.card()?.nativeElement;\n const cw = card?.offsetWidth ?? 320;\n const ch = card?.offsetHeight ?? 160;\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const rtl = getComputedStyle(document.documentElement).direction === 'rtl';\n const side = (p: Exclude<MxTourPlacement, 'auto'>): Exclude<MxTourPlacement, 'auto'> =>\n rtl && (p === 'start' || p === 'end') ? (p === 'start' ? 'end' : 'start') : p;\n\n const fits: Record<Exclude<MxTourPlacement, 'auto'>, boolean> = {\n bottom: spot.top + spot.height + GAP + ch <= vh - MARGIN,\n top: spot.top - GAP - ch >= MARGIN,\n end: spot.left + spot.width + GAP + cw <= vw - MARGIN,\n start: spot.left - GAP - cw >= MARGIN,\n };\n const wanted = st.placement && st.placement !== 'auto' ? side(st.placement) : null;\n const order: Exclude<MxTourPlacement, 'auto'>[] = wanted\n ? [wanted, 'bottom', 'top', 'end', 'start']\n : ['bottom', 'top', 'end', 'start'];\n const p = order.find((o) => fits[o]) ?? 'bottom';\n\n let top: number;\n let left: number;\n if (p === 'bottom' || p === 'top') {\n top = p === 'bottom' ? spot.top + spot.height + GAP : spot.top - GAP - ch;\n left = spot.left + spot.width / 2 - cw / 2;\n } else {\n left = p === 'end' ? spot.left + spot.width + GAP : spot.left - GAP - cw;\n top = spot.top + spot.height / 2 - ch / 2;\n }\n const clamp = (v: number, min: number, max: number) => Math.min(Math.max(v, min), Math.max(min, max));\n this.placement.set(rtl && (p === 'start' || p === 'end') ? (p === 'start' ? 'end' : 'start') : p);\n this.pos.set({ top: clamp(top, MARGIN, vh - ch - MARGIN), left: clamp(left, MARGIN, vw - cw - MARGIN) });\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const t = event.target as HTMLElement;\n const editavel = t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName);\n if (event.key === 'Escape' && this.ref.dismissible) {\n event.preventDefault();\n event.stopPropagation();\n this.ref.close(false);\n } else if (!editavel && event.key === 'ArrowRight' && !this.ref.isLast) {\n event.preventDefault();\n this.ref.next();\n } else if (!editavel && event.key === 'ArrowLeft' && this.ref.index() > 0) {\n event.preventDefault();\n this.ref.previous();\n }\n }\n}\n\n/**\n * Visita guiada: destaca elementos da página, um passo de cada vez, com um cartão\n * que explica cada um. O cartão é um diálogo modal: o foco fica nele, Escape fecha\n * e, no fim, o foco volta para onde estava.\n *\n * ```html\n * <input mxInput mxTourAnchor=\"pesquisa\" aria-label=\"Pesquisar\" />\n * <button mxButton mxTourAnchor=\"nova\">Nova factura</button>\n * ```\n *\n * ```ts\n * private readonly tour = inject(MxTour);\n * mostrar() {\n * this.tour.start([\n * { title: 'Bem-vindo', content: 'Mostramos o essencial em 2 passos.' },\n * { target: 'pesquisa', title: 'Pesquisa', content: 'Procura clientes e facturas.' },\n * { target: 'nova', title: 'Nova factura', content: 'Começa aqui.' },\n * ]).afterClosed.then((r) => r.completed && guardarQueViu());\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class MxTour {\n private readonly injector = inject(Injector);\n private readonly anchors = new Map<string, Element>();\n private overlayRef?: OverlayRef;\n /** A visita em curso, ou null. */\n readonly active = signal<MxTourRef | null>(null);\n readonly isOpen = computed(() => !!this.active());\n\n /** Começa uma visita. Se já houver uma aberta, fecha-a primeiro. */\n start(steps: readonly MxTourStep[], options: MxTourOptions = {}): MxTourRef {\n this.active()?.close(false);\n const before = document.activeElement as HTMLElement | null;\n const ref = new MxTourRef(steps, options, () => {\n this.overlayRef?.dispose();\n this.overlayRef = undefined;\n this.active.set(null);\n if (before && before.isConnected) before.focus({ preventScroll: true });\n });\n if (!steps.length) {\n ref.close(true);\n return ref;\n }\n this.overlayRef = createOverlayRef(this.injector, {\n positionStrategy: createGlobalPositionStrategy(this.injector).top('0').left('0'),\n scrollStrategy: createNoopScrollStrategy(),\n width: '100%',\n height: '100%',\n panelClass: 'mx-tour-pane',\n });\n const injector = Injector.create({\n providers: [{ provide: MX_TOUR_REF, useValue: ref }],\n parent: this.injector,\n });\n this.overlayRef.attach(new ComponentPortal(MxTourPanel, null, injector));\n this.active.set(ref);\n return ref;\n }\n\n /** Regista um elemento com um nome (usado por `mxTourAnchor`). */\n register(name: string, element: Element): void {\n this.anchors.set(name, element);\n }\n unregister(name: string, element: Element): void {\n if (this.anchors.get(name) === element) this.anchors.delete(name);\n }\n\n /** Encontra o elemento de um alvo: nome de âncora, selector CSS, elemento ou ElementRef. */\n resolve(target: MxTourTarget | null | undefined): Element | null {\n if (!target) return null;\n if (target instanceof ElementRef) return target.nativeElement;\n if (typeof target !== 'string') return target;\n return this.anchors.get(target) ?? safeQuery(target);\n }\n}\n\nfunction safeQuery(selector: string): Element | null {\n try {\n return document.querySelector(selector);\n } catch {\n return null;\n }\n}\n\n/** Dá um nome a um elemento para ser alvo de um passo: `mxTourAnchor=\"pesquisa\"`. */\n@Directive({ selector: '[mxTourAnchor]', exportAs: 'mxTourAnchor' })\nexport class MxTourAnchor {\n readonly name = input.required<string>({ alias: 'mxTourAnchor' });\n private readonly tour = inject(MxTour);\n private readonly el = inject<ElementRef<Element>>(ElementRef).nativeElement;\n\n constructor() {\n effect((onCleanup) => {\n const name = this.name();\n this.tour.register(name, this.el);\n onCleanup(() => this.tour.unregister(name, this.el));\n });\n }\n}\n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/muxima-ui-core-tour.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Directive,\n ElementRef,\n Injectable,\n InjectionToken,\n Injector,\n NgZone,\n TemplateRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { MX_MESSAGES_EN, MxI18n } from '@muxima-ui/core/i18n';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { CdkTrapFocus } from '@angular/cdk/a11y';\nimport {\n OverlayRef,\n createGlobalPositionStrategy,\n createNoopScrollStrategy,\n createOverlayRef,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { MxButton } from '@muxima-ui/core/button';\nimport { mxUniqueId } from '@muxima-ui/core/form-field';\n\n/** Onde fica o cartão em relação ao elemento destacado. */\nexport type MxTourPlacement = 'auto' | 'top' | 'bottom' | 'start' | 'end';\n\n/** Nome de um `mxTourAnchor`, um elemento, ou um ElementRef. */\nexport type MxTourTarget = string | Element | ElementRef<Element>;\n\n/** Contexto do modelo de conteúdo de um passo. */\nexport interface MxTourStepContext {\n $implicit: MxTourStep;\n index: number;\n tour: MxTourRef;\n}\n\n/** Um passo da visita guiada. */\nexport interface MxTourStep {\n /** Elemento a destacar. Sem alvo (ou se não existir), o cartão aparece ao centro. */\n target?: MxTourTarget | null;\n title: string;\n /** Texto do passo. */\n content?: string;\n /** Conteúdo rico, em vez de `content`. */\n template?: TemplateRef<MxTourStepContext>;\n placement?: MxTourPlacement;\n /** Espaço à volta do elemento destacado, em px. Por omissão 6. */\n padding?: number;\n /** Corre antes de mostrar o passo (ex.: abrir um separador). Pode devolver uma Promise. */\n beforeShow?: () => void | Promise<unknown>;\n}\n\nexport interface MxTourLabels {\n next: string;\n previous: string;\n done: string;\n skip: string;\n close: string;\n /** Texto do progresso, por exemplo \"Passo 2 de 5\". */\n progress: (current: number, total: number) => string;\n}\n\nexport interface MxTourOptions {\n /** Passo inicial (base 0). */\n startAt?: number;\n labels?: Partial<MxTourLabels>;\n /** false: sem Saltar, sem botão de fechar e sem Escape (a visita tem de ser feita até ao fim). */\n dismissible?: boolean;\n /** Mostra os pontos de progresso. Por omissão true. */\n showDots?: boolean;\n}\n\n/** Como terminou a visita. */\nexport interface MxTourResult {\n /** true se chegou ao fim com Concluir. */\n completed: boolean;\n /** Último passo mostrado (base 0). */\n index: number;\n}\n\n/** Referência a uma visita em curso. */\nexport class MxTourRef {\n /** Passo actual (base 0). */\n readonly index = signal(0);\n /** Resolve quando a visita fecha. */\n readonly afterClosed: Promise<MxTourResult>;\n readonly labels: MxTourLabels;\n readonly dismissible: boolean;\n readonly showDots: boolean;\n private resolve!: (r: MxTourResult) => void;\n private done = false;\n\n constructor(\n readonly steps: readonly MxTourStep[],\n options: MxTourOptions,\n private readonly onClose: (r: MxTourResult) => void,\n defaults: MxTourLabels = MX_MESSAGES_EN.tour,\n ) {\n this.labels = { ...defaults, ...options.labels };\n this.dismissible = options.dismissible ?? true;\n this.showDots = options.showDots ?? true;\n this.index.set(Math.min(Math.max(options.startAt ?? 0, 0), Math.max(steps.length - 1, 0)));\n this.afterClosed = new Promise((r) => (this.resolve = r));\n }\n\n get isOpen(): boolean {\n return !this.done;\n }\n get isLast(): boolean {\n return this.index() === this.steps.length - 1;\n }\n\n next(): void {\n if (this.isLast) this.close(true);\n else this.goTo(this.index() + 1);\n }\n previous(): void {\n this.goTo(this.index() - 1);\n }\n goTo(index: number): void {\n if (this.done || index < 0 || index >= this.steps.length) return;\n this.index.set(index);\n }\n /** Fecha a visita; `completed` diz se foi até ao fim. */\n close(completed = false): void {\n if (this.done) return;\n this.done = true;\n const result = { completed, index: this.index() };\n this.onClose(result);\n this.resolve(result);\n }\n}\n\nconst MX_TOUR_REF = new InjectionToken<MxTourRef>('MX_TOUR_REF');\n\ninterface Box {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\n/** requestAnimationFrame, ou um setTimeout onde não exista (testes, SSR). */\nconst nextFrame = (cb: () => void): number =>\n typeof requestAnimationFrame === 'function' ? requestAnimationFrame(cb) : (setTimeout(cb, 16) as unknown as number);\nconst cancelFrame = (id: number): void =>\n typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame(id) : clearTimeout(id);\n\nconst GAP = 12;\nconst MARGIN = 12;\n\n/** Painel da visita: o destaque, o fundo escurecido e o cartão do passo. Uso interno. */\n@Component({\n selector: 'mx-tour-panel',\n imports: [NgTemplateOutlet, CdkTrapFocus, MxButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'mx-tour-layer' },\n template: `\n @if (spot(); as s) {\n <div\n class=\"mx-tour-spotlight\"\n aria-hidden=\"true\"\n [style.top.px]=\"s.top\"\n [style.left.px]=\"s.left\"\n [style.width.px]=\"s.width\"\n [style.height.px]=\"s.height\"\n ></div>\n } @else {\n <div class=\"mx-tour-dim\" aria-hidden=\"true\"></div>\n }\n @if (step(); as st) {\n <div\n #card\n class=\"mx-tour-card\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n cdkTrapFocus\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"progressId + ' ' + bodyId\"\n [attr.data-placement]=\"spot() ? placement() : 'center'\"\n [style.top.px]=\"spot() ? pos().top : null\"\n [style.left.px]=\"spot() ? pos().left : null\"\n [style.visibility]=\"ready() ? null : 'hidden'\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"mx-tour-head\">\n <p class=\"mx-tour-progress\" [id]=\"progressId\">\n {{ ref.labels.progress(ref.index() + 1, ref.steps.length) }}\n </p>\n @if (ref.dismissible) {\n <button\n type=\"button\"\n class=\"mx-tour-close\"\n [attr.aria-label]=\"ref.labels.close\"\n (click)=\"ref.close(false)\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M4 4l8 8M12 4l-8 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n }\n </div>\n <h2 class=\"mx-tour-title\" [id]=\"titleId\">{{ st.title }}</h2>\n <div class=\"mx-tour-body\" [id]=\"bodyId\">\n @if (st.template) {\n <ng-container\n *ngTemplateOutlet=\"st.template; context: { $implicit: st, index: ref.index(), tour: ref }\"\n />\n } @else if (st.content) {\n <p>{{ st.content }}</p>\n }\n </div>\n <div class=\"mx-tour-foot\">\n @if (ref.showDots && ref.steps.length > 1) {\n <span class=\"mx-tour-dots\" aria-hidden=\"true\">\n @for (s of ref.steps; track $index) {\n <span class=\"mx-tour-dot\" [attr.data-active]=\"$index === ref.index() ? '' : null\"></span>\n }\n </span>\n }\n <span class=\"mx-tour-actions\">\n @if (ref.dismissible && !ref.isLast) {\n <button mxButton variant=\"ghost\" size=\"sm\" type=\"button\" (click)=\"ref.close(false)\">\n {{ ref.labels.skip }}\n </button>\n }\n @if (ref.index() > 0) {\n <button mxButton variant=\"outline\" size=\"sm\" type=\"button\" (click)=\"ref.previous()\">\n {{ ref.labels.previous }}\n </button>\n }\n <button mxButton size=\"sm\" type=\"button\" (click)=\"ref.next()\">\n {{ ref.isLast ? ref.labels.done : ref.labels.next }}\n </button>\n </span>\n </div>\n </div>\n }\n `,\n})\nexport class MxTourPanel {\n protected readonly ref = inject(MX_TOUR_REF);\n private readonly tour = inject(MxTour);\n\n protected readonly titleId = mxUniqueId('mx-tour-title');\n protected readonly bodyId = mxUniqueId('mx-tour-body');\n protected readonly progressId = mxUniqueId('mx-tour-progress');\n\n private readonly card = viewChild<ElementRef<HTMLElement>>('card');\n private readonly zone = inject(NgZone);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Passo que está desenhado (muda depois de beforeShow). */\n protected readonly step = signal<MxTourStep | null>(null);\n private readonly target = signal<Element | null>(null);\n protected readonly spot = signal<Box | null>(null);\n protected readonly pos = signal({ top: 0, left: 0 });\n protected readonly placement = signal<Exclude<MxTourPlacement, 'auto'>>('bottom');\n protected readonly ready = signal(false);\n\n private frame = 0;\n private resizeObserver?: ResizeObserver;\n private showToken = 0;\n\n constructor() {\n const destroy = inject(DestroyRef);\n // mostra o passo sempre que o índice muda\n effect(() => {\n const i = this.ref.index();\n untracked(() => void this.show(i));\n });\n\n afterNextRender(() => {\n const schedule = () => this.schedule();\n this.zone.runOutsideAngular(() => {\n window.addEventListener('scroll', schedule, { capture: true, passive: true });\n window.addEventListener('resize', schedule, { passive: true });\n });\n if (typeof ResizeObserver !== 'undefined') this.resizeObserver = new ResizeObserver(schedule);\n destroy.onDestroy(() => {\n window.removeEventListener('scroll', schedule, { capture: true });\n window.removeEventListener('resize', schedule);\n this.resizeObserver?.disconnect();\n cancelFrame(this.frame);\n });\n });\n }\n\n private async show(index: number): Promise<void> {\n const token = ++this.showToken;\n const st = this.ref.steps[index];\n if (!st) return;\n // só se esconde antes do primeiro passo (para o posicionar); depois, esconder\n // o cartão tirava-lhe o foco a meio da visita\n if (!this.step()) this.ready.set(false);\n try {\n await st.beforeShow?.();\n } catch {\n // um beforeShow que falha não deve prender a visita\n }\n // espera um frame para o DOM reflectir o que beforeShow mudou\n await new Promise<void>((r) => nextFrame(r));\n if (token !== this.showToken || !this.ref.isOpen) return;\n\n // o alvo pode só aparecer depois de beforeShow (ex.: conteúdo de um separador)\n let el = this.tour.resolve(st.target);\n for (let i = 0; !el && st.target && i < 5; i++) {\n await new Promise<void>((r) => nextFrame(r));\n if (token !== this.showToken || !this.ref.isOpen) return;\n el = this.tour.resolve(st.target);\n }\n this.resizeObserver?.disconnect();\n this.target.set(el);\n if (el) {\n this.resizeObserver?.observe(el);\n const r = el.getBoundingClientRect();\n const fora = r.top < 0 || r.bottom > window.innerHeight || r.left < 0 || r.right > window.innerWidth;\n if (fora) {\n const reduzir = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n el.scrollIntoView?.({ block: 'center', inline: 'nearest', behavior: reduzir ? 'auto' : 'smooth' });\n }\n }\n this.step.set(st);\n // desenha já o cartão para o medir, posicionar e dar-lhe o foco\n this.cdr.detectChanges();\n const card = this.card()?.nativeElement;\n if (card) this.resizeObserver?.observe(card);\n this.update();\n this.ready.set(true);\n this.cdr.detectChanges();\n card?.focus({ preventScroll: true });\n }\n\n private schedule(): void {\n cancelFrame(this.frame);\n this.frame = nextFrame(() => this.zone.run(() => this.update()));\n }\n\n private update(): void {\n const st = this.step();\n const el = this.target();\n const r = el?.getBoundingClientRect();\n if (!st || !r || (r.width === 0 && r.height === 0)) {\n this.spot.set(null);\n return;\n }\n const pad = st.padding ?? 6;\n const spot: Box = { top: r.top - pad, left: r.left - pad, width: r.width + pad * 2, height: r.height + pad * 2 };\n this.spot.set(spot);\n\n const card = this.card()?.nativeElement;\n const cw = card?.offsetWidth ?? 320;\n const ch = card?.offsetHeight ?? 160;\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const rtl = getComputedStyle(document.documentElement).direction === 'rtl';\n const side = (p: Exclude<MxTourPlacement, 'auto'>): Exclude<MxTourPlacement, 'auto'> =>\n rtl && (p === 'start' || p === 'end') ? (p === 'start' ? 'end' : 'start') : p;\n\n const fits: Record<Exclude<MxTourPlacement, 'auto'>, boolean> = {\n bottom: spot.top + spot.height + GAP + ch <= vh - MARGIN,\n top: spot.top - GAP - ch >= MARGIN,\n end: spot.left + spot.width + GAP + cw <= vw - MARGIN,\n start: spot.left - GAP - cw >= MARGIN,\n };\n const wanted = st.placement && st.placement !== 'auto' ? side(st.placement) : null;\n const order: Exclude<MxTourPlacement, 'auto'>[] = wanted\n ? [wanted, 'bottom', 'top', 'end', 'start']\n : ['bottom', 'top', 'end', 'start'];\n const p = order.find((o) => fits[o]) ?? 'bottom';\n\n let top: number;\n let left: number;\n if (p === 'bottom' || p === 'top') {\n top = p === 'bottom' ? spot.top + spot.height + GAP : spot.top - GAP - ch;\n left = spot.left + spot.width / 2 - cw / 2;\n } else {\n left = p === 'end' ? spot.left + spot.width + GAP : spot.left - GAP - cw;\n top = spot.top + spot.height / 2 - ch / 2;\n }\n const clamp = (v: number, min: number, max: number) => Math.min(Math.max(v, min), Math.max(min, max));\n this.placement.set(rtl && (p === 'start' || p === 'end') ? (p === 'start' ? 'end' : 'start') : p);\n this.pos.set({ top: clamp(top, MARGIN, vh - ch - MARGIN), left: clamp(left, MARGIN, vw - cw - MARGIN) });\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const t = event.target as HTMLElement;\n const editavel = t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName);\n if (event.key === 'Escape' && this.ref.dismissible) {\n event.preventDefault();\n event.stopPropagation();\n this.ref.close(false);\n } else if (!editavel && event.key === 'ArrowRight' && !this.ref.isLast) {\n event.preventDefault();\n this.ref.next();\n } else if (!editavel && event.key === 'ArrowLeft' && this.ref.index() > 0) {\n event.preventDefault();\n this.ref.previous();\n }\n }\n}\n\n/**\n * Visita guiada: destaca elementos da página, um passo de cada vez, com um cartão\n * que explica cada um. O cartão é um diálogo modal: o foco fica nele, Escape fecha\n * e, no fim, o foco volta para onde estava.\n *\n * ```html\n * <input mxInput mxTourAnchor=\"pesquisa\" aria-label=\"Pesquisar\" />\n * <button mxButton mxTourAnchor=\"nova\">Nova factura</button>\n * ```\n *\n * ```ts\n * private readonly tour = inject(MxTour);\n * mostrar() {\n * this.tour.start([\n * { title: 'Bem-vindo', content: 'Mostramos o essencial em 2 passos.' },\n * { target: 'pesquisa', title: 'Pesquisa', content: 'Procura clientes e facturas.' },\n * { target: 'nova', title: 'Nova factura', content: 'Começa aqui.' },\n * ]).afterClosed.then((r) => r.completed && guardarQueViu());\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class MxTour {\n private readonly injector = inject(Injector);\n private readonly i18n = inject(MxI18n);\n private readonly anchors = new Map<string, Element>();\n private overlayRef?: OverlayRef;\n /** A visita em curso, ou null. */\n readonly active = signal<MxTourRef | null>(null);\n readonly isOpen = computed(() => !!this.active());\n\n /** Começa uma visita. Se já houver uma aberta, fecha-a primeiro. */\n start(steps: readonly MxTourStep[], options: MxTourOptions = {}): MxTourRef {\n this.active()?.close(false);\n const before = document.activeElement as HTMLElement | null;\n const ref = new MxTourRef(\n steps,\n options,\n () => {\n this.overlayRef?.dispose();\n this.overlayRef = undefined;\n this.active.set(null);\n if (before && before.isConnected) before.focus({ preventScroll: true });\n },\n this.i18n.messages().tour,\n );\n if (!steps.length) {\n ref.close(true);\n return ref;\n }\n this.overlayRef = createOverlayRef(this.injector, {\n positionStrategy: createGlobalPositionStrategy(this.injector).top('0').left('0'),\n scrollStrategy: createNoopScrollStrategy(),\n width: '100%',\n height: '100%',\n panelClass: 'mx-tour-pane',\n });\n const injector = Injector.create({\n providers: [{ provide: MX_TOUR_REF, useValue: ref }],\n parent: this.injector,\n });\n this.overlayRef.attach(new ComponentPortal(MxTourPanel, null, injector));\n this.active.set(ref);\n return ref;\n }\n\n /** Regista um elemento com um nome (usado por `mxTourAnchor`). */\n register(name: string, element: Element): void {\n this.anchors.set(name, element);\n }\n unregister(name: string, element: Element): void {\n if (this.anchors.get(name) === element) this.anchors.delete(name);\n }\n\n /** Encontra o elemento de um alvo: nome de âncora, selector CSS, elemento ou ElementRef. */\n resolve(target: MxTourTarget | null | undefined): Element | null {\n if (!target) return null;\n if (target instanceof ElementRef) return target.nativeElement;\n if (typeof target !== 'string') return target;\n return this.anchors.get(target) ?? safeQuery(target);\n }\n}\n\nfunction safeQuery(selector: string): Element | null {\n try {\n return document.querySelector(selector);\n } catch {\n return null;\n }\n}\n\n/** Dá um nome a um elemento para ser alvo de um passo: `mxTourAnchor=\"pesquisa\"`. */\n@Directive({ selector: '[mxTourAnchor]', exportAs: 'mxTourAnchor' })\nexport class MxTourAnchor {\n readonly name = input.required<string>({ alias: 'mxTourAnchor' });\n private readonly tour = inject(MxTour);\n private readonly el = inject<ElementRef<Element>>(ElementRef).nativeElement;\n\n constructor() {\n effect((onCleanup) => {\n const name = this.name();\n this.tour.register(name, this.el);\n onCleanup(() => this.tour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D,IAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,IAAA,EAAE,GAAG,MAAM,CAAsB,UAAU,CAAC,CAAC,aAAa;AAE3E,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,CAAC,CAAC,SAAS,KAAI;AACnB,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;AACjC,YAAA,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,QAAA,CAAC,CAAC;IACJ;wGAXW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE;;;ACjgBnE;;AAEG;;"}
@@ -3,7 +3,7 @@
3
3
  * Os componentes vivem em entradas secundárias, para só incluíres o que usas:
4
4
  * import { MxButton } from '@muxima-ui/core/button';
5
5
  */
6
- const MUXIMA_VERSION = '1.4.1';
6
+ const MUXIMA_VERSION = '2.0.0';
7
7
 
8
8
  /**
9
9
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"muxima-ui-core.mjs","sources":["../../../projects/core/src/public-api.ts","../../../projects/core/src/muxima-ui-core.ts"],"sourcesContent":["/*\n * Muxima UI — ponto de entrada principal.\n * Os componentes vivem em entradas secundárias, para só incluíres o que usas:\n * import { MxButton } from '@muxima-ui/core/button';\n */\nexport const MUXIMA_VERSION = '1.4.1';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACI,MAAM,cAAc,GAAG;;ACL9B;;AAEG;;"}
1
+ {"version":3,"file":"muxima-ui-core.mjs","sources":["../../../projects/core/src/public-api.ts","../../../projects/core/src/muxima-ui-core.ts"],"sourcesContent":["/*\n * Muxima UI — ponto de entrada principal.\n * Os componentes vivem em entradas secundárias, para só incluíres o que usas:\n * import { MxButton } from '@muxima-ui/core/button';\n */\nexport const MUXIMA_VERSION = '2.0.0';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACI,MAAM,cAAc,GAAG;;ACL9B;;AAEG;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muxima-ui/core",
3
- "version": "1.4.1",
3
+ "version": "2.0.0",
4
4
  "description": "Componentes Angular acessíveis e sóbrios para aplicações empresariais.",
5
5
  "keywords": [
6
6
  "angular",
@@ -147,6 +147,10 @@
147
147
  "types": "./types/muxima-ui-core-form-field.d.ts",
148
148
  "default": "./fesm2022/muxima-ui-core-form-field.mjs"
149
149
  },
150
+ "./i18n": {
151
+ "types": "./types/muxima-ui-core-i18n.d.ts",
152
+ "default": "./fesm2022/muxima-ui-core-i18n.mjs"
153
+ },
150
154
  "./image-cropper": {
151
155
  "types": "./types/muxima-ui-core-image-cropper.d.ts",
152
156
  "default": "./fesm2022/muxima-ui-core-image-cropper.mjs"
@@ -1,3 +1,4 @@
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
1
2
  import * as i0 from '@angular/core';
2
3
 
3
4
  type MxAlertVariant = 'info' | 'success' | 'warning' | 'danger';
@@ -26,7 +27,8 @@ declare class MxAlertTitle {
26
27
  }
27
28
  /** Botão de fechar do alerta. Esconder o alerta fica a cargo da aplicação (ex.: com @if). */
28
29
  declare class MxAlertClose {
29
- readonly label: i0.InputSignal<string>;
30
+ readonly label: i0.InputSignal<string | undefined>;
31
+ protected readonly i18n: i0.Signal<_muxima_ui_core_i18n.MxMessages>;
30
32
  static ɵfac: i0.ɵɵFactoryDeclaration<MxAlertClose, never>;
31
33
  static ɵdir: i0.ɵɵDirectiveDeclaration<MxAlertClose, "button[mxAlertClose]", never, { "label": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
32
34
  }
@@ -1,4 +1,5 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
2
+ import * as _angular_core from '@angular/core';
2
3
 
3
4
  /**
4
5
  * Migalhas: mostram onde a página está na hierarquia.
@@ -16,9 +17,10 @@ import * as i0 from '@angular/core';
16
17
  * Os separadores são desenhados em CSS, por isso o leitor de ecrã não os lê.
17
18
  */
18
19
  declare class MxBreadcrumb {
19
- readonly ariaLabel: i0.InputSignal<string>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<MxBreadcrumb, never>;
21
- static ɵdir: i0.ɵɵDirectiveDeclaration<MxBreadcrumb, "nav[mxBreadcrumb]", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
20
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
21
+ protected readonly i18n: _angular_core.Signal<_muxima_ui_core_i18n.MxMessages>;
22
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MxBreadcrumb, never>;
23
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MxBreadcrumb, "nav[mxBreadcrumb]", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
22
24
  }
23
25
 
24
26
  export { MxBreadcrumb };
@@ -1,3 +1,4 @@
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
1
2
  import * as _angular_core from '@angular/core';
2
3
 
3
4
  /** Um diapositivo. O carrossel dá-lhe o nome "2 de 5" e tira do teclado os que não se vêem. */
@@ -37,8 +38,9 @@ declare class MxCarousel {
37
38
  readonly indicators: _angular_core.InputSignalWithTransform<boolean, unknown>;
38
39
  /** Botões anterior e seguinte. Sem eles, dá à pessoa outra forma de mudar ([(index)]). */
39
40
  readonly controls: _angular_core.InputSignalWithTransform<boolean, unknown>;
40
- readonly prevLabel: _angular_core.InputSignal<string>;
41
- readonly nextLabel: _angular_core.InputSignal<string>;
41
+ readonly prevLabel: _angular_core.InputSignal<string | undefined>;
42
+ readonly nextLabel: _angular_core.InputSignal<string | undefined>;
43
+ readonly i18n: _angular_core.Signal<_muxima_ui_core_i18n.MxMessages>;
42
44
  readonly slides: _angular_core.Signal<readonly MxCarouselSlide[]>;
43
45
  private readonly viewport;
44
46
  private readonly reducedMotion;
@@ -19,8 +19,18 @@ declare class MxChip {
19
19
  readonly variant: _angular_core.InputSignal<"default" | "outline" | "accent">;
20
20
  readonly size: _angular_core.InputSignal<"sm" | "md">;
21
21
  /** Verbo do botão de remover, seguido do texto do chip. */
22
- readonly removeLabel: _angular_core.InputSignal<string>;
22
+ readonly removeLabel: _angular_core.InputSignal<string | undefined>;
23
23
  readonly removed: _angular_core.OutputEmitterRef<void>;
24
+ protected readonly msg: _angular_core.Signal<{
25
+ remove: string;
26
+ list: string;
27
+ help: string;
28
+ added: (tag: string) => string;
29
+ removed: (tag: string) => string;
30
+ max: (max: number) => string;
31
+ duplicate: (tag: string) => string;
32
+ }>;
33
+ private readonly i18n;
24
34
  private readonly label;
25
35
  protected readonly text: _angular_core.WritableSignal<string>;
26
36
  constructor();
@@ -67,8 +77,8 @@ declare class MxTagInput implements ControlValueAccessor, MxFormFieldControl {
67
77
  /** Valida cada etiqueta antes de a acrescentar (ex.: email). Devolve a mensagem de erro ou null. */
68
78
  readonly validate: _angular_core.InputSignal<(tag: string) => string | null>;
69
79
  /** Nome da lista para o leitor de ecrã. */
70
- readonly listLabel: _angular_core.InputSignal<string>;
71
- readonly helpText: _angular_core.InputSignal<string>;
80
+ readonly listLabel: _angular_core.InputSignal<string | undefined>;
81
+ readonly helpText: _angular_core.InputSignal<string | undefined>;
72
82
  readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
73
83
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
74
84
  readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -83,6 +93,16 @@ declare class MxTagInput implements ControlValueAccessor, MxFormFieldControl {
83
93
  protected readonly field: MxFormField | null;
84
94
  private readonly ngControl;
85
95
  private readonly announcer;
96
+ private readonly i18n;
97
+ protected readonly msg: _angular_core.Signal<{
98
+ remove: string;
99
+ list: string;
100
+ help: string;
101
+ added: (tag: string) => string;
102
+ removed: (tag: string) => string;
103
+ max: (max: number) => string;
104
+ duplicate: (tag: string) => string;
105
+ }>;
86
106
  private readonly host;
87
107
  private readonly input;
88
108
  private readonly injector;
@@ -1,3 +1,4 @@
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
1
2
  import * as _angular_core from '@angular/core';
2
3
 
3
4
  /**
@@ -11,7 +12,8 @@ import * as _angular_core from '@angular/core';
11
12
  declare class MxCopy {
12
13
  readonly text: _angular_core.InputSignal<string>;
13
14
  /** Mensagem anunciada ao copiar. */
14
- readonly copiedMessage: _angular_core.InputSignal<string>;
15
+ readonly copiedMessage: _angular_core.InputSignal<string | undefined>;
16
+ private readonly i18n;
15
17
  readonly copiedChange: _angular_core.OutputEmitterRef<boolean>;
16
18
  private readonly clipboard;
17
19
  private readonly announcer;
@@ -32,8 +34,9 @@ declare class MxCopy {
32
34
  */
33
35
  declare class MxCopyButton {
34
36
  protected readonly copy: MxCopy;
35
- readonly label: _angular_core.InputSignal<string>;
36
- readonly copiedLabel: _angular_core.InputSignal<string>;
37
+ protected readonly i18n: _angular_core.Signal<_muxima_ui_core_i18n.MxMessages>;
38
+ readonly label: _angular_core.InputSignal<string | undefined>;
39
+ readonly copiedLabel: _angular_core.InputSignal<string | undefined>;
37
40
  readonly size: _angular_core.InputSignal<"sm" | "md">;
38
41
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MxCopyButton, never>;
39
42
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MxCopyButton, "button[mxCopyButton]", ["mxCopyButton"], { "label": { "alias": "label"; "required": false; "isSignal": true; }; "copiedLabel": { "alias": "copiedLabel"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof MxCopy; inputs: { "mxCopy": "value"; }; outputs: { "mxCopied": "mxCopied"; }; }]>;
@@ -1,3 +1,5 @@
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
2
+ import { MxColorNames } from '@muxima-ui/core/i18n';
1
3
  import * as _angular_core from '@angular/core';
2
4
  import { ConnectedPosition } from '@angular/cdk/overlay';
3
5
  import { ControlValueAccessor } from '@angular/forms';
@@ -25,8 +27,11 @@ declare function mxHexToHsva(hex: string): MxHsva;
25
27
  declare function mxHsvaToHex({ h, s, v, a }: MxHsva): string;
26
28
  /** Contraste WCAG entre duas cores (1 a 21). */
27
29
  declare function mxContrast(a: string, b: string): number;
28
- /** Nome aproximado da cor em português, para o leitor de ecrã: "azul escuro", "cinzento claro". */
29
- declare function mxColorName(hex: string): string;
30
+ /**
31
+ * Nome aproximado da cor, para o leitor de ecrã: "azul escuro", "cinzento claro".
32
+ * Por omissão em inglês; passa `names` para outro idioma (ex.: `MX_MESSAGES_PT.colorPicker.names`).
33
+ */
34
+ declare function mxColorName(hex: string, names?: MxColorNames): string;
30
35
 
31
36
  /** Amostra pronta: só a cor, ou cor e nome. */
32
37
  type MxColorSwatch = string | {
@@ -54,10 +59,24 @@ declare class MxColorPanel {
54
59
  /** Só as amostras: uma paleta fechada, sem área nem matiz. */
55
60
  readonly swatchesOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
56
61
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
57
- readonly areaLabel: _angular_core.InputSignal<string>;
58
- readonly hueLabel: _angular_core.InputSignal<string>;
59
- readonly alphaLabel: _angular_core.InputSignal<string>;
60
- readonly swatchesLabel: _angular_core.InputSignal<string>;
62
+ readonly areaLabel: _angular_core.InputSignal<string | undefined>;
63
+ private readonly i18n;
64
+ protected readonly msg: _angular_core.Signal<{
65
+ choose: string;
66
+ change: (name: string, hex: string) => string;
67
+ area: string;
68
+ hue: string;
69
+ alpha: string;
70
+ swatches: string;
71
+ eyeDropper: string;
72
+ hex: string;
73
+ areaValue: (saturation: number, brightness: number, name: string) => string;
74
+ hueValue: (degrees: number, name: string) => string;
75
+ names: _muxima_ui_core_i18n.MxColorNames;
76
+ }>;
77
+ readonly hueLabel: _angular_core.InputSignal<string | undefined>;
78
+ readonly alphaLabel: _angular_core.InputSignal<string | undefined>;
79
+ readonly swatchesLabel: _angular_core.InputSignal<string | undefined>;
61
80
  /** Emite ao largar o rato, escolher amostra ou terminar de escrever (para guardar). */
62
81
  readonly committed: _angular_core.OutputEmitterRef<string>;
63
82
  private readonly area;
@@ -106,7 +125,21 @@ declare class MxColorPicker implements ControlValueAccessor, MxFormFieldControl
106
125
  readonly alpha: _angular_core.InputSignalWithTransform<boolean, unknown>;
107
126
  readonly swatches: _angular_core.InputSignal<MxColorSwatch[]>;
108
127
  readonly placeholder: _angular_core.InputSignal<string>;
109
- readonly dialogLabel: _angular_core.InputSignal<string>;
128
+ readonly dialogLabel: _angular_core.InputSignal<string | undefined>;
129
+ private readonly i18n;
130
+ protected readonly msg: _angular_core.Signal<{
131
+ choose: string;
132
+ change: (name: string, hex: string) => string;
133
+ area: string;
134
+ hue: string;
135
+ alpha: string;
136
+ swatches: string;
137
+ eyeDropper: string;
138
+ hex: string;
139
+ areaValue: (saturation: number, brightness: number, name: string) => string;
140
+ hueValue: (degrees: number, name: string) => string;
141
+ names: _muxima_ui_core_i18n.MxColorNames;
142
+ }>;
110
143
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
111
144
  readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
112
145
  readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -1,3 +1,4 @@
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { ConnectedPosition } from '@angular/cdk/overlay';
3
4
  import { ControlValueAccessor } from '@angular/forms';
@@ -21,11 +22,13 @@ declare class MxCombobox<T = unknown> implements ControlValueAccessor, MxFormFie
21
22
  /** Texto de cada opção. Por omissão, String(opção). */
22
23
  readonly displayWith: _angular_core.InputSignal<(option: T) => string>;
23
24
  readonly compareWith: _angular_core.InputSignal<(a: T | null, b: T | null) => boolean>;
24
- readonly placeholder: _angular_core.InputSignal<string>;
25
- readonly emptyText: _angular_core.InputSignal<string>;
25
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
26
+ protected readonly i18n: _angular_core.Signal<_muxima_ui_core_i18n.MxMessages>;
27
+ protected readonly placeholderText: _angular_core.Signal<string>;
28
+ readonly emptyText: _angular_core.InputSignal<string | undefined>;
26
29
  /** Resultados a chegar (pesquisa no servidor): mostra um indicador no campo e na lista. */
27
30
  readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
28
- readonly loadingText: _angular_core.InputSignal<string>;
31
+ readonly loadingText: _angular_core.InputSignal<string | undefined>;
29
32
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
30
33
  readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
31
34
  readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -1,3 +1,4 @@
1
+ import * as _muxima_ui_core_i18n from '@muxima-ui/core/i18n';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { TemplateRef } from '@angular/core';
3
4
  import { DialogRef } from '@angular/cdk/dialog';
@@ -33,9 +34,11 @@ declare class MxCommandItemTemplate {
33
34
  */
34
35
  declare class MxCommand<D = unknown> {
35
36
  readonly items: _angular_core.InputSignal<readonly MxCommandItem<D>[]>;
36
- readonly placeholder: _angular_core.InputSignal<string>;
37
- readonly emptyText: _angular_core.InputSignal<string>;
38
- readonly ariaLabel: _angular_core.InputSignal<string>;
37
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
38
+ readonly emptyText: _angular_core.InputSignal<string | undefined>;
39
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
40
+ protected readonly i18n: _angular_core.Signal<_muxima_ui_core_i18n.MxMessages>;
41
+ protected readonly labelText: _angular_core.Signal<string>;
39
42
  readonly selected: _angular_core.OutputEmitterRef<MxCommandItem<D>>;
40
43
  protected readonly itemTemplate: _angular_core.Signal<MxCommandItemTemplate | undefined>;
41
44
  private readonly host;
@@ -81,6 +84,7 @@ declare class MxCommandPaletteDialog {
81
84
  */
82
85
  declare class MxCommandPalette {
83
86
  private readonly dialog;
87
+ private readonly i18n;
84
88
  open<D>(items: MxCommandItem<D>[], options?: {
85
89
  placeholder?: string;
86
90
  label?: string;
@@ -85,18 +85,38 @@ declare class MxDataGrid<T = any> {
85
85
  readonly density: _angular_core.InputSignal<"comfortable" | "compact">;
86
86
  readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
87
87
  readonly columnMenu: _angular_core.InputSignalWithTransform<boolean, unknown>;
88
- readonly ariaLabel: _angular_core.InputSignal<string>;
88
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
89
+ private readonly i18n;
90
+ protected readonly msg: _angular_core.Signal<{
91
+ label: string;
92
+ empty: string;
93
+ loading: string;
94
+ columns: string;
95
+ filter: string;
96
+ all: string;
97
+ selectAll: string;
98
+ selectRow: string;
99
+ selection: string;
100
+ resizeHint: string;
101
+ numberFilter: (filter: string, column: string) => string;
102
+ rows: (n: string, count: number) => string;
103
+ of: (total: string) => string;
104
+ selected: (n: string, count: number) => string;
105
+ sorted: (column: string, direction: "asc" | "desc") => string;
106
+ unsorted: string;
107
+ width: (column: string, px: number) => string;
108
+ }>;
89
109
  /** Coluna cujo texto identifica a linha nos nomes ("Seleccionar FT 2026/0201"). */
90
110
  readonly labelKey: _angular_core.InputSignal<string | null>;
91
- readonly emptyText: _angular_core.InputSignal<string>;
92
- readonly loadingText: _angular_core.InputSignal<string>;
93
- readonly columnsText: _angular_core.InputSignal<string>;
94
- readonly filterText: _angular_core.InputSignal<string>;
95
- readonly allText: _angular_core.InputSignal<string>;
96
- readonly selectAllText: _angular_core.InputSignal<string>;
97
- readonly selectRowText: _angular_core.InputSignal<string>;
98
- readonly selectText: _angular_core.InputSignal<string>;
99
- readonly resizeHint: _angular_core.InputSignal<string>;
111
+ readonly emptyText: _angular_core.InputSignal<string | undefined>;
112
+ readonly loadingText: _angular_core.InputSignal<string | undefined>;
113
+ readonly columnsText: _angular_core.InputSignal<string | undefined>;
114
+ readonly filterText: _angular_core.InputSignal<string | undefined>;
115
+ readonly allText: _angular_core.InputSignal<string | undefined>;
116
+ readonly selectAllText: _angular_core.InputSignal<string | undefined>;
117
+ readonly selectRowText: _angular_core.InputSignal<string | undefined>;
118
+ readonly selectText: _angular_core.InputSignal<string | undefined>;
119
+ readonly resizeHint: _angular_core.InputSignal<string | undefined>;
100
120
  /** Enter ou duplo clique numa linha. */
101
121
  readonly rowActivate: _angular_core.OutputEmitterRef<T>;
102
122
  private readonly cells;