feat(planning): grille hebdomadaire complète avec API et filtres
- Connexion API via proxy Angular (résolution CORS, base path /api) - Import CSS ng-zorro global pour les modales et composants - Filtres Camion/Show câblés sur l'affichage de la grille - Camions affichés via TrucksService (linkés au show du même créneau) - Panneau de détails : spectacles + camions du jour sélectionné - Modale de création de spectacle stylisée avec fond et centrage - Positionnement précis des events à la minute dans leur créneau - Auto-scroll vers l'heure courante au chargement - Ligne "maintenant" sur la colonne du jour actuel - Régénération des services OpenAPI (nouveaux noms de types) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+24
-90
@@ -1,6 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')
|
||||
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require('./lib/utils')
|
||||
const { SCHEMES, getSchemeHandler } = require('./lib/schemes')
|
||||
|
||||
/**
|
||||
@@ -11,7 +11,7 @@ const { SCHEMES, getSchemeHandler } = require('./lib/schemes')
|
||||
*/
|
||||
function normalize (uri, options) {
|
||||
if (typeof uri === 'string') {
|
||||
uri = /** @type {T} */ (normalizeString(uri, options))
|
||||
uri = /** @type {T} */ (serialize(parse(uri, options), options))
|
||||
} else if (typeof uri === 'object') {
|
||||
uri = /** @type {T} */ (parse(serialize(uri, options), options))
|
||||
}
|
||||
@@ -106,10 +106,21 @@ function resolveComponent (base, relative, options, skipNormalization) {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function equal (uriA, uriB, options) {
|
||||
const normalizedA = normalizeComparableURI(uriA, options)
|
||||
const normalizedB = normalizeComparableURI(uriB, options)
|
||||
if (typeof uriA === 'string') {
|
||||
uriA = unescape(uriA)
|
||||
uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true })
|
||||
} else if (typeof uriA === 'object') {
|
||||
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true })
|
||||
}
|
||||
|
||||
return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()
|
||||
if (typeof uriB === 'string') {
|
||||
uriB = unescape(uriB)
|
||||
uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true })
|
||||
} else if (typeof uriB === 'object') {
|
||||
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true })
|
||||
}
|
||||
|
||||
return uriA.toLowerCase() === uriB.toLowerCase()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,13 +156,13 @@ function serialize (cmpts, opts) {
|
||||
|
||||
if (component.path !== undefined) {
|
||||
if (!options.skipEscape) {
|
||||
component.path = escapePreservingEscapes(component.path)
|
||||
component.path = escape(component.path)
|
||||
|
||||
if (component.scheme !== undefined) {
|
||||
component.path = component.path.split('%3A').join(':')
|
||||
}
|
||||
} else {
|
||||
component.path = normalizePercentEncoding(component.path)
|
||||
component.path = unescape(component.path)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,29 +213,12 @@ function serialize (cmpts, opts) {
|
||||
|
||||
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u
|
||||
|
||||
/**
|
||||
* @param {import('./types/index').URIComponent} parsed
|
||||
* @param {RegExpMatchArray} matches
|
||||
* @returns {string|undefined}
|
||||
*/
|
||||
function getParseError (parsed, matches) {
|
||||
if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {
|
||||
return 'URI path must start with "/" when authority is present.'
|
||||
}
|
||||
|
||||
if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {
|
||||
return 'URI port is malformed.'
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} uri
|
||||
* @param {import('./types/index').Options} [opts]
|
||||
* @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}
|
||||
* @returns
|
||||
*/
|
||||
function parseWithStatus (uri, opts) {
|
||||
function parse (uri, opts) {
|
||||
const options = Object.assign({}, opts)
|
||||
/** @type {import('./types/index').URIComponent} */
|
||||
const parsed = {
|
||||
@@ -237,8 +231,6 @@ function parseWithStatus (uri, opts) {
|
||||
fragment: undefined
|
||||
}
|
||||
|
||||
let malformedAuthorityOrPort = false
|
||||
|
||||
let isIP = false
|
||||
if (options.reference === 'suffix') {
|
||||
if (options.scheme) {
|
||||
@@ -264,13 +256,6 @@ function parseWithStatus (uri, opts) {
|
||||
if (isNaN(parsed.port)) {
|
||||
parsed.port = matches[5]
|
||||
}
|
||||
|
||||
const parseError = getParseError(parsed, matches)
|
||||
if (parseError !== undefined) {
|
||||
parsed.error = parsed.error || parseError
|
||||
malformedAuthorityOrPort = true
|
||||
}
|
||||
|
||||
if (parsed.host) {
|
||||
const ipv4result = isIPv4(parsed.host)
|
||||
if (ipv4result === false) {
|
||||
@@ -319,18 +304,14 @@ function parseWithStatus (uri, opts) {
|
||||
parsed.scheme = unescape(parsed.scheme)
|
||||
}
|
||||
if (parsed.host !== undefined) {
|
||||
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)
|
||||
parsed.host = unescape(parsed.host)
|
||||
}
|
||||
}
|
||||
if (parsed.path) {
|
||||
parsed.path = normalizePathEncoding(parsed.path)
|
||||
parsed.path = escape(unescape(parsed.path))
|
||||
}
|
||||
if (parsed.fragment) {
|
||||
try {
|
||||
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))
|
||||
} catch {
|
||||
parsed.error = parsed.error || 'URI malformed'
|
||||
}
|
||||
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,54 +322,7 @@ function parseWithStatus (uri, opts) {
|
||||
} else {
|
||||
parsed.error = parsed.error || 'URI can not be parsed.'
|
||||
}
|
||||
return { parsed, malformedAuthorityOrPort }
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} uri
|
||||
* @param {import('./types/index').Options} [opts]
|
||||
* @returns
|
||||
*/
|
||||
function parse (uri, opts) {
|
||||
return parseWithStatus(uri, opts).parsed
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} uri
|
||||
* @param {import('./types/index').Options} [opts]
|
||||
* @returns {string}
|
||||
*/
|
||||
function normalizeString (uri, opts) {
|
||||
return normalizeStringWithStatus(uri, opts).normalized
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} uri
|
||||
* @param {import('./types/index').Options} [opts]
|
||||
* @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}
|
||||
*/
|
||||
function normalizeStringWithStatus (uri, opts) {
|
||||
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)
|
||||
return {
|
||||
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
||||
malformedAuthorityOrPort
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import ('./types/index').URIComponent|string} uri
|
||||
* @param {import('./types/index').Options} [opts]
|
||||
* @returns {string|undefined}
|
||||
*/
|
||||
function normalizeComparableURI (uri, opts) {
|
||||
if (typeof uri === 'string') {
|
||||
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)
|
||||
return malformedAuthorityOrPort ? undefined : normalized
|
||||
}
|
||||
|
||||
if (typeof uri === 'object') {
|
||||
return serialize(uri, opts)
|
||||
}
|
||||
return parsed
|
||||
}
|
||||
|
||||
const fastUri = {
|
||||
|
||||
Reference in New Issue
Block a user