✨ MAJOR FEATURES: • Auto-zoom intelligence với smart bounds fitting • Enhanced 3D GPS markers với pulsing effects • Professional route display với 6-layer rendering • Status-based parking icons với availability indicators • Production-ready build optimizations 🗺️ AUTO-ZOOM FEATURES: • Smart bounds fitting cho GPS + selected parking • Adaptive padding (50px) cho visual balance • Max zoom control (level 16) để tránh quá gần • Dynamic centering khi không có selection 🎨 ENHANCED VISUALS: • 3D GPS marker với multi-layer pulse effects • Advanced parking icons với status colors • Selection highlighting với animation • Dimming system cho non-selected items 🛣️ ROUTE SYSTEM: • OpenRouteService API integration • Multi-layer route rendering (glow, shadow, main, animated) • Real-time distance & duration calculation • Visual route info trong popup 📱 PRODUCTION READY: • SSR safe với dynamic imports • Build errors resolved • Global deployment via Vercel • Optimized performance 🌍 DEPLOYMENT: • Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app • Bundle size: 22.8 kB optimized • Global CDN distribution • HTTPS enabled 💾 VERSION CONTROL: • MapView-v2.0.tsx backup created • MAPVIEW_VERSIONS.md documentation • Full version history tracking
71 lines
2.7 KiB
JavaScript
71 lines
2.7 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const codegen_1 = require("../../compile/codegen");
|
|
const metadata_1 = require("./metadata");
|
|
const nullable_1 = require("./nullable");
|
|
const error_1 = require("./error");
|
|
const types_1 = require("../discriminator/types");
|
|
const error = {
|
|
message: (cxt) => {
|
|
const { schema, params } = cxt;
|
|
return params.discrError
|
|
? params.discrError === types_1.DiscrError.Tag
|
|
? `tag "${schema}" must be string`
|
|
: `value of tag "${schema}" must be in mapping`
|
|
: (0, error_1.typeErrorMessage)(cxt, "object");
|
|
},
|
|
params: (cxt) => {
|
|
const { schema, params } = cxt;
|
|
return params.discrError
|
|
? (0, codegen_1._) `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}`
|
|
: (0, error_1.typeErrorParams)(cxt, "object");
|
|
},
|
|
};
|
|
const def = {
|
|
keyword: "discriminator",
|
|
schemaType: "string",
|
|
implements: ["mapping"],
|
|
error,
|
|
code(cxt) {
|
|
(0, metadata_1.checkMetadata)(cxt);
|
|
const { gen, data, schema, parentSchema } = cxt;
|
|
const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data);
|
|
gen.if(cond);
|
|
validateDiscriminator();
|
|
gen.elseIf((0, codegen_1.not)(valid));
|
|
cxt.error();
|
|
gen.endIf();
|
|
cxt.ok(valid);
|
|
function validateDiscriminator() {
|
|
const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(schema)}`);
|
|
gen.if((0, codegen_1._) `${tag} === undefined`);
|
|
cxt.error(false, { discrError: types_1.DiscrError.Tag, tag });
|
|
gen.elseIf((0, codegen_1._) `typeof ${tag} == "string"`);
|
|
validateMapping(tag);
|
|
gen.else();
|
|
cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema });
|
|
gen.endIf();
|
|
}
|
|
function validateMapping(tag) {
|
|
gen.if(false);
|
|
for (const tagValue in parentSchema.mapping) {
|
|
gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
|
|
gen.assign(valid, applyTagSchema(tagValue));
|
|
}
|
|
gen.else();
|
|
cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true });
|
|
gen.endIf();
|
|
}
|
|
function applyTagSchema(schemaProp) {
|
|
const _valid = gen.name("valid");
|
|
cxt.subschema({
|
|
keyword: "mapping",
|
|
schemaProp,
|
|
jtdDiscriminator: schema,
|
|
}, _valid);
|
|
return _valid;
|
|
}
|
|
},
|
|
};
|
|
exports.default = def;
|
|
//# sourceMappingURL=discriminator.js.map
|