Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
115
vendor/filament/support/resources/js/components/dropdown.js
vendored
Normal file
115
vendor/filament/support/resources/js/components/dropdown.js
vendored
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
export default () => ({
|
||||
panelId: null,
|
||||
|
||||
observer: null,
|
||||
|
||||
navigateListener: null,
|
||||
|
||||
init() {
|
||||
this.navigateListener = () => this.close()
|
||||
|
||||
document.addEventListener('livewire:navigate', this.navigateListener)
|
||||
|
||||
this.setUpAria()
|
||||
},
|
||||
|
||||
destroy() {
|
||||
this.observer?.disconnect()
|
||||
this.observer = null
|
||||
|
||||
document.removeEventListener('livewire:navigate', this.navigateListener)
|
||||
this.navigateListener = null
|
||||
},
|
||||
|
||||
setUpAria() {
|
||||
const trigger = this.getTrigger()
|
||||
const panel = this.$refs.panel
|
||||
|
||||
if (!trigger || !panel) {
|
||||
return
|
||||
}
|
||||
|
||||
// Generate the panel `id` once per component instance, so `aria-controls`
|
||||
// stays stable for the lifetime of the page even when it is re-applied.
|
||||
this.panelId ??=
|
||||
panel.id ||
|
||||
'fi-dropdown-panel-' + Math.random().toString(36).slice(2, 10)
|
||||
|
||||
this.syncAria()
|
||||
|
||||
this.observer = new MutationObserver(() => this.syncAria())
|
||||
|
||||
// The floating UI plugin toggles the panel's `display` for open and close paths this
|
||||
// component does not drive itself (click-away, the plugin's own Escape handler), so observe
|
||||
// it directly to keep `aria-expanded` on the real trigger correct in every case. A Livewire
|
||||
// morph also strips the client-applied panel `id`, so observe that too and re-apply it.
|
||||
this.observer.observe(panel, {
|
||||
attributeFilter: ['id', 'style'],
|
||||
})
|
||||
|
||||
// A Livewire morph re-renders the trigger from server HTML, stripping the client-applied
|
||||
// ARIA attributes, so observe them and re-apply. `syncAria()` only writes attributes whose
|
||||
// values have changed, so re-applying does not retrigger the observer in a loop.
|
||||
this.observer.observe(trigger, {
|
||||
attributeFilter: [
|
||||
'aria-controls',
|
||||
'aria-expanded',
|
||||
'aria-haspopup',
|
||||
],
|
||||
})
|
||||
},
|
||||
|
||||
getTrigger() {
|
||||
return this.$el.querySelector(
|
||||
':scope > .fi-dropdown-trigger button, :scope > .fi-dropdown-trigger a, :scope > .fi-dropdown-trigger [tabindex]',
|
||||
)
|
||||
},
|
||||
|
||||
syncAria() {
|
||||
const trigger = this.getTrigger()
|
||||
const panel = this.$refs.panel
|
||||
|
||||
if (!trigger || !panel) {
|
||||
return
|
||||
}
|
||||
|
||||
if (panel.id !== this.panelId) {
|
||||
panel.id = this.panelId
|
||||
}
|
||||
|
||||
this.setAttributeIfChanged(trigger, 'aria-haspopup', 'true')
|
||||
this.setAttributeIfChanged(trigger, 'aria-controls', this.panelId)
|
||||
this.setAttributeIfChanged(
|
||||
trigger,
|
||||
'aria-expanded',
|
||||
panel.style.display === 'block' ? 'true' : 'false',
|
||||
)
|
||||
|
||||
// The floating UI plugin also writes `aria-expanded` onto the non-focusable
|
||||
// `.fi-dropdown-trigger` wrapper; remove it so the state only lives on the real control.
|
||||
this.$el
|
||||
.querySelector(':scope > .fi-dropdown-trigger')
|
||||
?.removeAttribute('aria-expanded')
|
||||
},
|
||||
|
||||
setAttributeIfChanged(element, attribute, value) {
|
||||
if (element.getAttribute(attribute) !== value) {
|
||||
element.setAttribute(attribute, value)
|
||||
}
|
||||
},
|
||||
|
||||
toggle(event) {
|
||||
this.$refs.panel?.toggle(event)
|
||||
this.syncAria()
|
||||
},
|
||||
|
||||
open(event) {
|
||||
this.$refs.panel?.open(event)
|
||||
this.syncAria()
|
||||
},
|
||||
|
||||
close(event) {
|
||||
this.$refs.panel?.close(event)
|
||||
this.syncAria()
|
||||
},
|
||||
})
|
||||
42
vendor/filament/support/resources/js/components/form-button.js
vendored
Normal file
42
vendor/filament/support/resources/js/components/form-button.js
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
export default () => ({
|
||||
form: null,
|
||||
|
||||
eventListenersController: null,
|
||||
|
||||
processingCount: 0,
|
||||
|
||||
isProcessing: false,
|
||||
|
||||
processingMessage: null,
|
||||
|
||||
init() {
|
||||
this.form = this.$el.closest('form')
|
||||
|
||||
this.eventListenersController = new AbortController()
|
||||
|
||||
const { signal } = this.eventListenersController
|
||||
|
||||
this.form?.addEventListener(
|
||||
'form-processing-started',
|
||||
(event) => {
|
||||
this.processingCount++
|
||||
this.isProcessing = true
|
||||
this.processingMessage = event.detail.message
|
||||
},
|
||||
{ signal },
|
||||
)
|
||||
|
||||
this.form?.addEventListener(
|
||||
'form-processing-finished',
|
||||
() => {
|
||||
this.processingCount = Math.max(0, this.processingCount - 1)
|
||||
this.isProcessing = this.processingCount > 0
|
||||
},
|
||||
{ signal },
|
||||
)
|
||||
},
|
||||
|
||||
destroy() {
|
||||
this.eventListenersController?.abort()
|
||||
},
|
||||
})
|
||||
265
vendor/filament/support/resources/js/components/modal.js
vendored
Normal file
265
vendor/filament/support/resources/js/components/modal.js
vendored
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
let scrollLockCount = 0
|
||||
|
||||
let restoreScroll = null
|
||||
|
||||
const acquireScrollLock = () => {
|
||||
if (scrollLockCount === 0) {
|
||||
const overflow = document.documentElement.style.overflow
|
||||
const paddingRight = document.documentElement.style.paddingRight
|
||||
|
||||
const scrollbarWidth =
|
||||
window.innerWidth - document.documentElement.clientWidth
|
||||
const scrollbarGutter = window.getComputedStyle(
|
||||
document.documentElement,
|
||||
).scrollbarGutter
|
||||
|
||||
document.documentElement.style.overflow = 'hidden'
|
||||
|
||||
// A reserved scrollbar gutter already compensates for the scrollbar.
|
||||
if (scrollbarGutter && scrollbarGutter !== 'auto') {
|
||||
restoreScroll = () => {
|
||||
document.documentElement.style.overflow = overflow
|
||||
}
|
||||
} else {
|
||||
document.documentElement.style.paddingRight = `${scrollbarWidth}px`
|
||||
|
||||
restoreScroll = () => {
|
||||
document.documentElement.style.overflow = overflow
|
||||
document.documentElement.style.paddingRight = paddingRight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scrollLockCount++
|
||||
}
|
||||
|
||||
const releaseScrollLock = () => {
|
||||
if (scrollLockCount === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
scrollLockCount--
|
||||
|
||||
if (scrollLockCount === 0) {
|
||||
restoreScroll?.()
|
||||
restoreScroll = null
|
||||
}
|
||||
}
|
||||
|
||||
export default ({ id, isScrollLocked = true, shouldRestoreFocus = true }) => ({
|
||||
isOpen: false,
|
||||
|
||||
isWindowVisible: false,
|
||||
|
||||
isTrapActive: false,
|
||||
|
||||
isHoldingScrollLock: false,
|
||||
|
||||
livewire: null,
|
||||
|
||||
previouslyFocusedElement: null,
|
||||
|
||||
textSelectionClosePreventionMouseDownHandler: null,
|
||||
|
||||
textSelectionClosePreventionMouseUpHandler: null,
|
||||
|
||||
textSelectionClosePreventionClickHandler: null,
|
||||
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.isWindowVisible = this.isOpen
|
||||
|
||||
this.setUpTextSelectionClosePrevention()
|
||||
|
||||
this.$watch('isOpen', () => (this.isWindowVisible = this.isOpen))
|
||||
})
|
||||
},
|
||||
|
||||
setUpTextSelectionClosePrevention() {
|
||||
// Ensure that the click element is not triggered from a user selecting text inside an input.
|
||||
// https://github.com/filamentphp/filament/pull/18022
|
||||
|
||||
const windowSelector = '.fi-modal-window'
|
||||
const closeOverlaySelector = '.fi-modal-close-overlay'
|
||||
|
||||
const capture = true
|
||||
|
||||
let isMouseDownOnModal = false
|
||||
let mouseDownTime = 0
|
||||
|
||||
this.textSelectionClosePreventionClickHandler = (event) => {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
|
||||
document.removeEventListener(
|
||||
'click',
|
||||
this.textSelectionClosePreventionClickHandler,
|
||||
capture,
|
||||
)
|
||||
}
|
||||
|
||||
const isCloseOverlayClick = (event) => {
|
||||
return (
|
||||
!event.target.closest(windowSelector) &&
|
||||
(event.target.closest(closeOverlaySelector) ||
|
||||
event.target.closest('body'))
|
||||
)
|
||||
}
|
||||
|
||||
this.textSelectionClosePreventionMouseDownHandler = (event) => {
|
||||
mouseDownTime = Date.now()
|
||||
isMouseDownOnModal = !!event.target.closest(windowSelector)
|
||||
}
|
||||
|
||||
this.textSelectionClosePreventionMouseUpHandler = (event) => {
|
||||
const isClick = Date.now() - mouseDownTime < 75
|
||||
|
||||
if (isMouseDownOnModal && isCloseOverlayClick(event) && !isClick) {
|
||||
document.addEventListener(
|
||||
'click',
|
||||
this.textSelectionClosePreventionClickHandler,
|
||||
capture,
|
||||
)
|
||||
} else {
|
||||
document.removeEventListener(
|
||||
'click',
|
||||
this.textSelectionClosePreventionClickHandler,
|
||||
capture,
|
||||
)
|
||||
}
|
||||
|
||||
isMouseDownOnModal = false
|
||||
}
|
||||
|
||||
document.addEventListener(
|
||||
'mousedown',
|
||||
this.textSelectionClosePreventionMouseDownHandler,
|
||||
capture,
|
||||
)
|
||||
document.addEventListener(
|
||||
'mouseup',
|
||||
this.textSelectionClosePreventionMouseUpHandler,
|
||||
capture,
|
||||
)
|
||||
},
|
||||
|
||||
isTopmost() {
|
||||
if (!id) {
|
||||
return true
|
||||
}
|
||||
|
||||
const openModals = document.querySelectorAll('.fi-modal-open')
|
||||
|
||||
if (openModals.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
return openModals[openModals.length - 1].id === id
|
||||
},
|
||||
|
||||
acquireScrollLock() {
|
||||
if (this.isHoldingScrollLock) {
|
||||
return
|
||||
}
|
||||
|
||||
this.isHoldingScrollLock = true
|
||||
|
||||
acquireScrollLock()
|
||||
},
|
||||
|
||||
releaseScrollLock() {
|
||||
if (!this.isHoldingScrollLock) {
|
||||
return
|
||||
}
|
||||
|
||||
this.isHoldingScrollLock = false
|
||||
|
||||
releaseScrollLock()
|
||||
},
|
||||
|
||||
restorePreviouslyFocusedElement() {
|
||||
if (!shouldRestoreFocus || !this.previouslyFocusedElement) {
|
||||
return
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.previouslyFocusedElement.focus({ preventScroll: true })
|
||||
this.previouslyFocusedElement = null
|
||||
})
|
||||
},
|
||||
|
||||
close() {
|
||||
this.closeQuietly()
|
||||
|
||||
this.isTrapActive = false
|
||||
|
||||
this.releaseScrollLock()
|
||||
|
||||
this.restorePreviouslyFocusedElement()
|
||||
|
||||
this.$dispatch('modal-closed', { id })
|
||||
},
|
||||
|
||||
closeQuietly() {
|
||||
this.isOpen = false
|
||||
},
|
||||
|
||||
open() {
|
||||
this.$nextTick(() => {
|
||||
if (shouldRestoreFocus) {
|
||||
this.previouslyFocusedElement = document.activeElement
|
||||
}
|
||||
|
||||
this.isOpen = true
|
||||
this.isTrapActive = true
|
||||
|
||||
// Click-through modals let you interact with the page behind them,
|
||||
// so they must not lock scrolling.
|
||||
if (isScrollLocked) {
|
||||
this.acquireScrollLock()
|
||||
}
|
||||
|
||||
document.dispatchEvent(
|
||||
new CustomEvent('x-modal-opened', {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
detail: { id },
|
||||
}),
|
||||
)
|
||||
})
|
||||
},
|
||||
|
||||
destroy() {
|
||||
// Release in case the modal is removed while still holding the lock.
|
||||
this.releaseScrollLock()
|
||||
|
||||
const capture = true
|
||||
|
||||
if (this.textSelectionClosePreventionMouseDownHandler) {
|
||||
document.removeEventListener(
|
||||
'mousedown',
|
||||
this.textSelectionClosePreventionMouseDownHandler,
|
||||
capture,
|
||||
)
|
||||
this.textSelectionClosePreventionMouseDownHandler = null
|
||||
}
|
||||
|
||||
if (this.textSelectionClosePreventionMouseUpHandler) {
|
||||
document.removeEventListener(
|
||||
'mouseup',
|
||||
this.textSelectionClosePreventionMouseUpHandler,
|
||||
capture,
|
||||
)
|
||||
this.textSelectionClosePreventionMouseUpHandler = null
|
||||
}
|
||||
|
||||
if (this.textSelectionClosePreventionClickHandler) {
|
||||
document.removeEventListener(
|
||||
'click',
|
||||
this.textSelectionClosePreventionClickHandler,
|
||||
capture,
|
||||
)
|
||||
this.textSelectionClosePreventionClickHandler = null
|
||||
}
|
||||
},
|
||||
})
|
||||
137
vendor/filament/support/resources/js/components/one-time-code.js
vendored
Normal file
137
vendor/filament/support/resources/js/components/one-time-code.js
vendored
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
export default () => ({
|
||||
inputs: [],
|
||||
|
||||
state: null,
|
||||
|
||||
init() {
|
||||
this.inputs = Array.from(
|
||||
this.$root.querySelectorAll('.fi-one-time-code-input-digit'),
|
||||
)
|
||||
|
||||
this.distribute(this.state)
|
||||
|
||||
this.$watch('state', (state) => {
|
||||
if (this.read() === (state ?? '')) {
|
||||
return
|
||||
}
|
||||
|
||||
this.distribute(state)
|
||||
})
|
||||
|
||||
this.inputs.forEach((input, index) => {
|
||||
input.addEventListener('input', (event) => {
|
||||
event.stopPropagation()
|
||||
|
||||
let value = event.target.value
|
||||
|
||||
// A value longer than one character has been autofilled or pasted, so it is
|
||||
// spread across every input instead of being treated as a single digit.
|
||||
if (value.length > 1) {
|
||||
this.distribute(value)
|
||||
this.commit()
|
||||
this.focusInput(this.getFirstEmptyInputIndex())
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (value === '') {
|
||||
this.commit()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (/\D/.test(value)) {
|
||||
event.target.value = ''
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
this.commit()
|
||||
this.focusInput(index + 1)
|
||||
})
|
||||
|
||||
input.addEventListener('keydown', (event) => {
|
||||
if (
|
||||
['Backspace', 'Delete'].includes(event.key) &&
|
||||
event.target.value === ''
|
||||
) {
|
||||
this.focusInput(index - 1)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (event.key === 'ArrowLeft') {
|
||||
this.focusInput(index - 1)
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
if (event.key === 'ArrowRight') {
|
||||
this.focusInput(index + 1)
|
||||
event.preventDefault()
|
||||
}
|
||||
})
|
||||
|
||||
// Select the existing character on focus, so that typing replaces it.
|
||||
input.addEventListener('focus', (event) =>
|
||||
event.target.setSelectionRange(0, 1),
|
||||
)
|
||||
|
||||
// Prevent focusing an empty input ahead of the next one to be filled.
|
||||
input.addEventListener('pointerdown', (event) => {
|
||||
let firstEmptyInputIndex = Math.min(
|
||||
index,
|
||||
this.getFirstEmptyInputIndex(),
|
||||
)
|
||||
|
||||
if (firstEmptyInputIndex !== index) {
|
||||
event.preventDefault()
|
||||
this.focusInput(firstEmptyInputIndex)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
distribute(value) {
|
||||
let digits = (value ?? '')
|
||||
.toString()
|
||||
.replace(/\D/g, '')
|
||||
.slice(0, this.inputs.length)
|
||||
|
||||
this.inputs.forEach((input, index) => {
|
||||
input.value = digits[index] ?? ''
|
||||
})
|
||||
},
|
||||
|
||||
read() {
|
||||
return this.inputs.map((input) => input.value).join('')
|
||||
},
|
||||
|
||||
commit() {
|
||||
let value = this.read()
|
||||
|
||||
this.state = value === '' ? null : value
|
||||
},
|
||||
|
||||
getFirstEmptyInputIndex() {
|
||||
let index = this.inputs.findIndex((input) => input.value === '')
|
||||
|
||||
return index === -1 ? this.inputs.length - 1 : index
|
||||
},
|
||||
|
||||
focusInput(index) {
|
||||
let input =
|
||||
this.inputs[Math.max(0, Math.min(index, this.inputs.length - 1))]
|
||||
|
||||
if (!input) {
|
||||
return
|
||||
}
|
||||
|
||||
if (document.activeElement === input) {
|
||||
input.setSelectionRange(0, 1)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
input.focus()
|
||||
},
|
||||
})
|
||||
41
vendor/filament/support/resources/js/components/tooltip.js
vendored
Normal file
41
vendor/filament/support/resources/js/components/tooltip.js
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// Dismiss any visible tooltip when `Escape` is pressed (WAI-ARIA APG Tooltip).
|
||||
// Tippy has no built-in Escape handler, and Filament attaches tooltips to
|
||||
// non-focusable hosts. Each mounted tippy popover stores its instance on the
|
||||
// `[data-tippy-root]` element, so hide those directly — a top-level `hideAll()`
|
||||
// would not work here, as `@ryangjchandler/alpine-tooltip` bundles its own tippy
|
||||
// with a separate instance registry. Only acts — and stops the keypress from also
|
||||
// closing a modal/dropdown — when a tooltip is actually visible; otherwise
|
||||
// `Escape` propagates as normal. Focus is left untouched.
|
||||
//
|
||||
// Registered on `window` in the capture phase so it runs before
|
||||
// `@awcodes/alpine-floating-ui`, which closes open dropdowns from its own
|
||||
// `window` capture-phase `keydown` listener. Because this module evaluates at
|
||||
// load — before the float plugin registers its listener on first open — this
|
||||
// handler comes first among the `window` capture listeners, so
|
||||
// `stopImmediatePropagation()` prevents both the dropdown's capture handler and
|
||||
// any modal's bubble-phase handler from also acting on the same `Escape`.
|
||||
window.addEventListener(
|
||||
'keydown',
|
||||
(event) => {
|
||||
if (event.key !== 'Escape') {
|
||||
return
|
||||
}
|
||||
|
||||
let didHideTooltip = false
|
||||
|
||||
document.querySelectorAll('[data-tippy-root]').forEach((popover) => {
|
||||
const tooltip = popover._tippy
|
||||
|
||||
if (tooltip?.state.isVisible) {
|
||||
tooltip.hide()
|
||||
|
||||
didHideTooltip = true
|
||||
}
|
||||
})
|
||||
|
||||
if (didHideTooltip) {
|
||||
event.stopImmediatePropagation()
|
||||
}
|
||||
},
|
||||
true,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue