@wow-two-beta/fe 0.0.38 → 0.0.40
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.
- package/dist/formsEngine/AppForm.d.ts +12 -3
- package/dist/formsEngine/FormOperations.d.ts +18 -0
- package/dist/formsEngine/FormOperations.js +9 -0
- package/dist/formsEngine/FormOperations.js.map +1 -1
- package/dist/formsEngine/adapters/house/HouseFormCore.js +15 -6
- package/dist/formsEngine/adapters/house/HouseFormCore.js.map +1 -1
- package/dist/formsEngine/adapters/tanstack/TanstackFormOverlay.d.ts +4 -0
- package/dist/formsEngine/adapters/tanstack/TanstackFormOverlay.js +10 -1
- package/dist/formsEngine/adapters/tanstack/TanstackFormOverlay.js.map +1 -1
- package/dist/formsEngine/adapters/tanstack/UseAppForm.js +9 -6
- package/dist/formsEngine/adapters/tanstack/UseAppForm.js.map +1 -1
- package/dist/foundation/animation/animatedLayout/AnimatedLayout.d.ts +3 -3
- package/dist/foundation/dom/FocusTarget.d.ts +13 -0
- package/dist/foundation/dom/FocusTarget.js +12 -0
- package/dist/foundation/dom/FocusTarget.js.map +1 -0
- package/dist/foundation/dom/index.d.ts +1 -0
- package/dist/foundation/dom/index.js +3 -0
- package/dist/foundation/dom/index.js.map +1 -1
- package/dist/foundation/phone/PhoneCountries.d.ts +13 -0
- package/dist/foundation/phone/PhoneCountries.js +62 -0
- package/dist/foundation/phone/PhoneCountries.js.map +1 -0
- package/dist/foundation/phone/PhoneFormats.d.ts +12 -0
- package/dist/foundation/phone/PhoneFormats.js +32 -0
- package/dist/foundation/phone/PhoneFormats.js.map +1 -0
- package/dist/foundation/phone/PhoneNumberExtensions.d.ts +94 -0
- package/dist/foundation/phone/PhoneNumberExtensions.js +137 -0
- package/dist/foundation/phone/PhoneNumberExtensions.js.map +1 -0
- package/dist/foundation/phone/index.d.ts +3 -0
- package/dist/foundation/phone/index.js +9 -0
- package/dist/foundation/phone/index.js.map +1 -0
- package/dist/foundation/primitives/index.d.ts +1 -0
- package/dist/foundation/primitives/index.js +3 -0
- package/dist/foundation/primitives/index.js.map +1 -1
- package/dist/foundation/primitives/swapTransition/SwapTransition.d.ts +76 -0
- package/dist/foundation/primitives/swapTransition/SwapTransition.js +240 -0
- package/dist/foundation/primitives/swapTransition/SwapTransition.js.map +1 -0
- package/dist/foundation/primitives/swapTransition/index.d.ts +1 -0
- package/dist/foundation/validators/Formats.d.ts +15 -0
- package/dist/foundation/validators/Formats.js +32 -1
- package/dist/foundation/validators/Formats.js.map +1 -1
- package/dist/foundation/validators/Messages.d.ts +1 -1
- package/dist/foundation/validators/Messages.js +10 -0
- package/dist/foundation/validators/Messages.js.map +1 -1
- package/dist/foundation/validators/index.d.ts +1 -1
- package/dist/foundation/validators/index.js +2 -1
- package/dist/index.css +11 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/presentation/actions/refreshButton/RefreshButton.vue.js.map +1 -1
- package/dist/presentation/display/animatedNumberText/AnimatedNumberText.vue.d.ts +1 -1
- package/dist/presentation/display/carousel/Carousel.vue.d.ts +1 -1
- package/dist/presentation/display/countUpText/CountUpText.vue.d.ts +1 -1
- package/dist/presentation/display/scrollRevealGroup/ScrollRevealGroup.vue.d.ts +2 -2
- package/dist/presentation/forms/field/Field.vue.js +10 -3
- package/dist/presentation/forms/field/Field.vue.js.map +1 -1
- package/dist/presentation/forms/imageCropEditor/ImageCropEditor.vue.d.ts +1 -1
- package/dist/presentation/forms/imageEditor/ImageEditor.vue.d.ts +1 -1
- package/dist/presentation/forms/index.js +2 -1
- package/dist/presentation/forms/index.js.map +1 -1
- package/dist/presentation/forms/labeledField/LabeledField.vue.js +2 -2
- package/dist/presentation/forms/labeledField/LabeledField.vue.js.map +1 -1
- package/dist/presentation/forms/phoneInput/PhoneInput.vue.d.ts +5 -9
- package/dist/presentation/forms/phoneInput/PhoneInput.vue.js +104 -92
- package/dist/presentation/forms/phoneInput/PhoneInput.vue.js.map +1 -1
- package/dist/presentation/forms/phoneInput/PhoneInput2.vue.js +0 -2
- package/dist/presentation/forms/phoneInput/PhoneInput2.vue.js.map +1 -1
- package/dist/presentation/forms/phoneInput/index.d.ts +2 -1
- package/dist/presentation/layout/navbar/Navbar.vue.js.map +1 -1
- package/dist/router/adapters/vueRouter/routeAnnouncer/RouteAnnouncer.vue.js +17 -5
- package/dist/router/adapters/vueRouter/routeAnnouncer/RouteAnnouncer.vue.js.map +1 -1
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formats.js","sources":["../../../src/foundation/validators/Formats.ts"],"sourcesContent":["// Format validators for the four string shapes that show up at almost every boundary. Each returns a\n// `StringValidator`, so the type check, the format check, and any further refinement compose in one\n// chain: `email().max(254)`.\n//\n// THE REGEXES ARE DELIBERATELY CONSERVATIVE, AND THEY ARE NOT SPECIFICATIONS:\n//\n// - `email()` IS A PRAGMATIC CHECK, NOT RFC 5322. The real grammar admits quoted local parts, comments,\n// and bracketed IP literals; the widely-cited \"RFC-compliant\" regex runs thousands of characters and\n// still accepts addresses no mail server will deliver to. This checks the shape that catches real\n// typos — one `@`, no whitespace, a dotted domain — and nothing more. The only true validation of an\n// email address is sending mail to it, so anything stricter here buys false rejections, not safety.\n// - `url()` uses the `URL` constructor instead of a regex, because a hand-written URL regex is wrong in\n// ways that matter. It accepts ANY scheme, `mailto:` and `javascript:` included — restrict with\n// `.refine()` when the value reaches an `href`.\n// - `uuid()` requires the RFC 4122 layout with a version nibble of 1–8 and a variant nibble of 8/9/a/b.\n// NOTE: this REJECTS the nil UUID (`000…0`), which some systems use as a sentinel — chain a `union`\n// with `literal()` if a nil is meaningful in that field.\n// - `isoDate()` accepts a calendar date (`YYYY-MM-DD`) ONLY, not a full ISO 8601 timestamp, and confirms\n// the date exists by round-tripping it — `2025-02-30` matches the pattern but is not a day. Years are\n// compared after the round trip, including the four-digit years below 0100.\n\nimport { string,
|
|
1
|
+
{"version":3,"file":"Formats.js","sources":["../../../src/foundation/validators/Formats.ts"],"sourcesContent":["// Format validators for the four string shapes that show up at almost every boundary. Each returns a\n// `StringValidator`, so the type check, the format check, and any further refinement compose in one\n// chain: `email().max(254)`.\n//\n// THE REGEXES ARE DELIBERATELY CONSERVATIVE, AND THEY ARE NOT SPECIFICATIONS:\n//\n// - `email()` IS A PRAGMATIC CHECK, NOT RFC 5322. The real grammar admits quoted local parts, comments,\n// and bracketed IP literals; the widely-cited \"RFC-compliant\" regex runs thousands of characters and\n// still accepts addresses no mail server will deliver to. This checks the shape that catches real\n// typos — one `@`, no whitespace, a dotted domain — and nothing more. The only true validation of an\n// email address is sending mail to it, so anything stricter here buys false rejections, not safety.\n// - `url()` uses the `URL` constructor instead of a regex, because a hand-written URL regex is wrong in\n// ways that matter. It accepts ANY scheme, `mailto:` and `javascript:` included — restrict with\n// `.refine()` when the value reaches an `href`.\n// - `uuid()` requires the RFC 4122 layout with a version nibble of 1–8 and a variant nibble of 8/9/a/b.\n// NOTE: this REJECTS the nil UUID (`000…0`), which some systems use as a sentinel — chain a `union`\n// with `literal()` if a nil is meaningful in that field.\n// - `isoDate()` accepts a calendar date (`YYYY-MM-DD`) ONLY, not a full ISO 8601 timestamp, and confirms\n// the date exists by round-tripping it — `2025-02-30` matches the pattern but is not a day. Years are\n// compared after the round trip, including the four-digit years below 0100.\n// - `phone()` checks an E.164 value (`+998996632582`) against its country's national digit count from\n// `foundation/phone`: the exact length for a fixed-length plan, else the E.164 bound (4 to 15 digits less the dial\n// code). It is a length check by numbering plan, not `libphonenumber`: it cannot tell an unassigned number.\n\nimport { PhoneNumberExtensions } from '../phone';\nimport { invalid } from './ValidationOutcome';\nimport { string, StringValidator } from './Primitives';\n\n/** One `@`, no whitespace, and a dotted domain. See the header — pragmatic, not RFC 5322. */\nconst EmailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n/** RFC 4122 layout: 8-4-4-4-12 hex, version nibble 1–8, variant nibble 8/9/a/b. */\nconst UuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$(?![\\s\\S])/i;\n\n/** Calendar date only — four-digit year, two-digit month, two-digit day. */\nconst IsoDatePattern = /^\\d{4}-\\d{2}-\\d{2}$(?![\\s\\S])/;\n\n/** Accepts an email-shaped string. Pragmatic check — see the header for what it deliberately does not do. */\nexport function email(message = 'must be a valid email address'): StringValidator {\n return string().pattern(EmailPattern, message, 'email');\n}\n\n/** Accepts any string the `URL` constructor parses. Any scheme passes — restrict further if it reaches an `href`. */\nexport function url(message = 'must be a valid URL'): StringValidator {\n return string().refine(\n (value) => {\n try {\n // Construct-and-discard: `URL` throws on a malformed value, and the caller keeps their string.\n void new URL(value);\n return true;\n } catch {\n return false;\n }\n },\n message,\n 'url',\n );\n}\n\n/** Accepts a canonical RFC 4122 UUID, any case. Rejects the nil UUID — see the header. */\nexport function uuid(message = 'must be a valid UUID'): StringValidator {\n return string().pattern(UuidPattern, message, 'uuid');\n}\n\n/** Accepts a `YYYY-MM-DD` calendar date that actually exists. Not a full ISO 8601 timestamp. */\nexport function isoDate(message = 'must be a valid ISO date (YYYY-MM-DD)'): StringValidator {\n return string()\n .pattern(IsoDatePattern, message, 'isoDate')\n .refine(\n (value) => {\n const parts = value.split('-');\n const year = Number(parts[0]);\n const month = Number(parts[1]);\n const day = Number(parts[2]);\n\n // Round-trip through UTC: an overflowing day (`2025-02-30`) lands on a different date, so\n // comparing the parts back out is what proves the calendar date is real.\n const parsed = new Date(0);\n parsed.setUTCFullYear(year, month - 1, day);\n return parsed.getUTCFullYear() === year && parsed.getUTCMonth() === month - 1 && parsed.getUTCDate() === day;\n },\n message,\n 'isoDate',\n );\n}\n\n/** Configures the {@link phone} rule. */\nexport interface PhoneRuleOptions {\n /** The ISO codes a number may come from — the phone control's `countries`. Every known country when omitted. */\n readonly countries?: ReadonlyArray<string>;\n /** Accepts the empty string a cleared phone control emits. Default `false`: an empty value fails as `required`. */\n readonly isOptional?: boolean;\n /** Replaces the message of a `phone` failure; the form's catalogue still renders the code first. */\n readonly message?: string;\n}\n\n/**\n * Accepts an E.164 phone value whose national number has its country's digit count — `+998` takes 9 digits. Fails\n * with code `phone` and params `{ country, dial, length }` (a fixed-length plan) or `{ country, dial, min, max }`;\n * a value that is not `+` and digits, or whose dial code names none of `countries`, fails with `phone` alone.\n */\nexport function phone(options: PhoneRuleOptions = {}): StringValidator {\n const countries = PhoneNumberExtensions.resolveCountries(options.countries);\n const text = string();\n\n return new StringValidator('phone', (value, path) => {\n const parsed = text.parseAt(value, path);\n if (!parsed.ok) return parsed;\n\n const number = parsed.value;\n if (number === '') {\n return options.isOptional ? parsed : invalid([{ path, message: 'is required', code: 'required' }]);\n }\n\n const country = PhoneNumberExtensions.E164Pattern.test(number)\n ? PhoneNumberExtensions.countryOf(number, countries)\n : null;\n if (!country) {\n return invalid([{ path, message: options.message ?? 'must be a valid phone number', code: 'phone' }]);\n }\n\n const digits = number.length - country.dial.length;\n const { min, max } = PhoneNumberExtensions.lengthOf(country);\n if (digits >= min && digits <= max) return parsed;\n\n const fixed = min === max;\n return invalid([\n {\n path,\n message:\n options.message ??\n (fixed\n ? `must have ${min} digits after ${country.dial}`\n : `must have ${min} to ${max} digits after ${country.dial}`),\n code: 'phone',\n params: fixed\n ? { country: country.iso, dial: country.dial, length: min }\n : { country: country.iso, dial: country.dial, min, max },\n },\n ]);\n });\n}\n"],"names":[],"mappings":";;;AA6BA,MAAM,eAAe;AAGrB,MAAM,cAAc;AAGpB,MAAM,iBAAiB;AAGhB,SAAS,MAAM,UAAU,iCAAkD;AAChF,SAAO,OAAA,EAAS,QAAQ,cAAc,SAAS,OAAO;AACxD;AAGO,SAAS,IAAI,UAAU,uBAAwC;AACpE,SAAO,SAAS;AAAA,IACd,CAAC,UAAU;AACT,UAAI;AAEF,aAAK,IAAI,IAAI,KAAK;AAClB,eAAO;AAAA,MACT,QAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA;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AAO,SAAS,QAAQ,KAAK;AAC5C,UAAM,EAAE,KAAK,IAAA,IAAQ,sBAAsB,SAAS,OAAO;AAC3D,QAAI,UAAU,OAAO,UAAU,IAAK,QAAO;AAE3C,UAAM,QAAQ,QAAQ;AACtB,WAAO,QAAQ;AAAA,MACb;AAAA,QACE;AAAA,QACA,SACE,QAAQ,YACP,QACG,aAAa,GAAG,iBAAiB,QAAQ,IAAI,KAC7C,aAAa,GAAG,OAAO,GAAG,iBAAiB,QAAQ,IAAI;AAAA,QAC7D,MAAM;AAAA,QACN,QAAQ,QACJ,EAAE,SAAS,QAAQ,KAAK,MAAM,QAAQ,MAAM,QAAQ,QACpD,EAAE,SAAS,QAAQ,KAAK,MAAM,QAAQ,MAAM,KAAK,IAAA;AAAA,MAAI;AAAA,IAC3D,CACD;AAAA,EACH,CAAC;AACH;"}
|
|
@@ -12,7 +12,7 @@ export interface FieldIssue {
|
|
|
12
12
|
* `pattern`, …); the rest arrive from the server. Kept as one flat union because a catalogue keys on it
|
|
13
13
|
* and a split would mean two lookups for one concept.
|
|
14
14
|
*/
|
|
15
|
-
export declare const ValidationCodes: readonly ["required", "type", "mustBeNull", "mustBeEmpty", "min", "max", "length", "integer", "precision", "greaterThan", "lessThan", "between", "betweenExclusive", "equal", "notEqual", "literal", "oneOf", "union", "pattern", "email", "url", "uuid", "isoDate", "creditCard", "custom", "transform", "internal"];
|
|
15
|
+
export declare const ValidationCodes: readonly ["required", "type", "mustBeNull", "mustBeEmpty", "min", "max", "length", "integer", "precision", "greaterThan", "lessThan", "between", "betweenExclusive", "equal", "notEqual", "literal", "oneOf", "union", "pattern", "email", "url", "uuid", "isoDate", "creditCard", "phone", "custom", "transform", "internal"];
|
|
16
16
|
/** A member of the shared rule-code vocabulary. */
|
|
17
17
|
export type ValidationCode = (typeof ValidationCodes)[number];
|
|
18
18
|
/**
|
|
@@ -29,6 +29,7 @@ const ValidationCodes = [
|
|
|
29
29
|
"uuid",
|
|
30
30
|
"isoDate",
|
|
31
31
|
"creditCard",
|
|
32
|
+
"phone",
|
|
32
33
|
// escape hatches
|
|
33
34
|
"custom",
|
|
34
35
|
"transform",
|
|
@@ -162,6 +163,15 @@ const defaultValidationMessages = Object.freeze({
|
|
|
162
163
|
uuid: () => "must be a valid UUID",
|
|
163
164
|
isoDate: () => "must be a valid ISO date (YYYY-MM-DD)",
|
|
164
165
|
creditCard: () => "must be a valid card number",
|
|
166
|
+
phone: (context) => {
|
|
167
|
+
const dial = operand(context.params, "dial");
|
|
168
|
+
const length = operand(context.params, "length");
|
|
169
|
+
if (dial !== null && length !== null) return `must have ${length} digits after ${dial}`;
|
|
170
|
+
const min = operand(context.params, "min");
|
|
171
|
+
const max = operand(context.params, "max");
|
|
172
|
+
if (dial !== null && min !== null && max !== null) return `must have ${min} to ${max} digits after ${dial}`;
|
|
173
|
+
return "must be a valid phone number";
|
|
174
|
+
},
|
|
165
175
|
custom: (context) => context.message,
|
|
166
176
|
transform: (context) => context.message,
|
|
167
177
|
internal: (context) => context.message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Messages.js","sources":["../../../src/foundation/validators/Messages.ts"],"sourcesContent":["// The shared rule-code vocabulary and the message catalogue that renders it. This slice's reason to\n// exist is NOT to save strings — it is to make the client and the server speak with ONE voice for one\n// rule. A user who reads \"Name is required\" from the client and \"'Name' must not be empty.\" from the\n// server is hearing two voices for the same failure, and that is the drift that actually shows.\n//\n// WHY A VOCABULARY, NOT A SHARED RULE SET: each layer validates its own scope and neither delegates\n// (`conventions/development/backend/foundation/validators.md` § Layer independence). Sharing rule\n// DEFINITIONS would break that; sharing the machine tag a rule reports does not — a tag is presentation\n// metadata, not authority. Client rules stay a latency optimisation; the server stays the authority.\n//\n// WHY THE SERVER MESSAGE IS THE FALLBACK, NEVER THE OVERRIDE: adoption has to be incremental. A code\n// this catalogue does not know renders the message the server already sent, so wiring the catalogue can\n// never make a form worse — the worst case is the behaviour that existed before it.\n//\n// WHY PARAMS EXIST: a catalogue entry that cannot reach the `50` in \"at most 50 characters\" can only\n// emit parameterless strings, which is a catalogue that cannot replace the messages it is meant to\n// replace. Every built-in refinement therefore reports its own limits alongside its code.\n//\n// TWO VOCABULARIES MEET HERE. The house validators report `min` / `max` / `pattern`; FluentValidation\n// reports `MinimumLengthValidator` / `MaximumLengthValidator` / `RegularExpressionValidator`. Neither is\n// wrong and neither wins by default — `FluentValidationCodes` normalizes the server's onto this one so\n// a single catalogue serves both. The alias pass lives on the CLIENT deliberately: it lets a form adopt\n// the catalogue before the backend normalizes anything, and it keeps working unchanged afterwards.\n\nimport { ExactNumber } from '../numbers';\n\n/** A field-level failure widened to carry its machine tag — the channel a catalogue can key on. */\nexport interface FieldIssue {\n /** The authoring or server message. Always present; used verbatim when no catalogue entry matches. */\n readonly message: string;\n /** The normalized rule code (`required`, `min`, `pattern`, …). Absent when the source reported none. */\n readonly code?: string;\n /** The rule's own operands (`{ max: 50 }`), normalized to the vocabulary's names. */\n readonly params?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * The rule codes this ecosystem speaks. The client's own validators report a subset (`type`, `min`,\n * `pattern`, …); the rest arrive from the server. Kept as one flat union because a catalogue keys on it\n * and a split would mean two lookups for one concept.\n */\nexport const ValidationCodes = [\n // shape / presence\n 'required',\n 'type',\n 'mustBeNull',\n 'mustBeEmpty',\n // size\n 'min',\n 'max',\n 'length',\n 'integer',\n 'precision',\n // comparison\n 'greaterThan',\n 'lessThan',\n 'between',\n 'betweenExclusive',\n 'equal',\n 'notEqual',\n // shape membership\n 'literal',\n 'oneOf',\n 'union',\n // format\n 'pattern',\n 'email',\n 'url',\n 'uuid',\n 'isoDate',\n 'creditCard',\n // escape hatches\n 'custom',\n 'transform',\n 'internal',\n] as const;\n\n/** A member of the shared rule-code vocabulary. */\nexport type ValidationCode = (typeof ValidationCodes)[number];\n\n/**\n * Maps FluentValidation's `ErrorCode` onto the shared vocabulary. Covers the built-in validators whose\n * failures reach a form; anything absent falls through with its raw code, which simply misses the\n * catalogue and renders the server's own message.\n */\nexport const FluentValidationCodes: Readonly<Record<string, ValidationCode>> = Object.freeze({\n NotEmptyValidator: 'required',\n NotNullValidator: 'required',\n NullValidator: 'mustBeNull',\n EmptyValidator: 'mustBeEmpty',\n MinimumLengthValidator: 'min',\n MaximumLengthValidator: 'max',\n ExactLengthValidator: 'length',\n LengthValidator: 'length',\n RegularExpressionValidator: 'pattern',\n EmailValidator: 'email',\n CreditCardValidator: 'creditCard',\n EnumValidator: 'oneOf',\n GreaterThanValidator: 'greaterThan',\n GreaterThanOrEqualValidator: 'min',\n LessThanValidator: 'lessThan',\n LessThanOrEqualValidator: 'max',\n InclusiveBetweenValidator: 'between',\n ExclusiveBetweenValidator: 'betweenExclusive',\n EqualValidator: 'equal',\n NotEqualValidator: 'notEqual',\n ScalePrecisionValidator: 'precision',\n PredicateValidator: 'custom',\n AsyncPredicateValidator: 'custom',\n});\n\n/**\n * Maps FluentValidation's message placeholders onto the vocabulary's param names, so one catalogue entry\n * reads the same operand whichever side reported it. Unlisted placeholders pass through unchanged —\n * `PropertyName` deliberately among them, since the label is resolved from the form, not the payload.\n */\nexport const FluentValidationParameters: Readonly<Record<string, string>> = Object.freeze({\n MinLength: 'min',\n MaxLength: 'max',\n TotalLength: 'length',\n ComparisonValue: 'comparison',\n ComparisonProperty: 'comparisonLabel',\n From: 'from',\n To: 'to',\n ExpectedPrecision: 'precision',\n ExpectedScale: 'scale',\n});\n\n/** What a catalogue entry renders from. */\nexport interface ValidationMessageContext {\n /** The normalized rule code that failed. */\n readonly code: string;\n /** The rule's operands, vocabulary-named. Empty when the source reported none. */\n readonly params: Readonly<Record<string, unknown>>;\n /** The form path the failure is filed under; `''` for a form-level failure. */\n readonly path: string;\n /** The field's display label, when the form named one. Absent means render label-free. */\n readonly label?: string;\n /** The originating message — return this to defer to the source. */\n readonly message: string;\n}\n\n/** Renders one rule code into user-facing text. */\nexport type ValidationMessageEntry = (context: ValidationMessageContext) => string;\n\n/** A code → renderer table. Partial by design: an unlisted code falls back to the source's message. */\nexport type ValidationMessageCatalogue = Readonly<Record<string, ValidationMessageEntry>>;\n\n/** Resolves one issue at one path into the string a field renders. */\nexport type ResolveValidationMessage = (issue: FieldIssue, path: string) => string;\n\n/** Reads a numeric operand, tolerating the string form a JSON payload may carry. */\nfunction operand(params: Readonly<Record<string, unknown>>, key: string): string | null {\n const value = Object.hasOwn(params, key) ? params[key] : undefined;\n if (ExactNumber.isExactNumber(value)) return value.toString();\n if (typeof value === 'number' && Number.isFinite(value)) return String(value);\n if (typeof value === 'string' && value.length > 0) return value;\n return null;\n}\n\n/** Pluralizes the character-count fragments the size rules share. */\nfunction characters(count: string): string {\n return `${count} character${count === '1' ? '' : 's'}`;\n}\n\n/** Pluralizes the item-count fragments the collection size rules share. */\nfunction items(count: string): string {\n return `${count} item${count === '1' ? '' : 's'}`;\n}\n\n/**\n * The English voice for the vocabulary. Entries are FRAGMENTS, not sentences — a field message renders\n * under its own labelled control, so \"must be at least 2 characters\" reads correctly and repeating the\n * label there is noise. A form that supplies `labels` gets the label prefixed by `createMessageResolver`,\n * which is the form-level and cross-field case where the fragment alone would be unaddressed.\n *\n * An entry that cannot render (its operand never arrived) returns `context.message`, so a half-populated\n * payload degrades to the source's wording instead of to \"must be at most undefined\".\n */\nexport const defaultValidationMessages: ValidationMessageCatalogue = Object.freeze({\n required: () => 'is required',\n type: (context) => context.message,\n mustBeNull: () => 'must be empty',\n mustBeEmpty: () => 'must be empty',\n\n min: (context) => {\n const limit = operand(context.params, 'min');\n if (limit === null) return context.message;\n switch (operand(context.params, 'unit')) {\n case 'characters':\n return `must be at least ${characters(limit)}`;\n case 'items':\n return `must have at least ${items(limit)}`;\n case 'instant':\n return `must be on or after ${limit}`;\n default:\n return `must be at least ${limit}`;\n }\n },\n max: (context) => {\n const limit = operand(context.params, 'max');\n if (limit === null) return context.message;\n switch (operand(context.params, 'unit')) {\n case 'characters':\n return `must be at most ${characters(limit)}`;\n case 'items':\n return `must have at most ${items(limit)}`;\n case 'instant':\n return `must be on or before ${limit}`;\n default:\n return `must be at most ${limit}`;\n }\n },\n length: (context) => {\n const exact = operand(context.params, 'length');\n if (exact === null) return context.message;\n if (operand(context.params, 'unit') === 'items') return `must have exactly ${items(exact)}`;\n return `must be exactly ${characters(exact)}`;\n },\n integer: () => 'must be a whole number',\n precision: (context) => {\n const scale = operand(context.params, 'scale');\n return scale === null ? context.message : `must have at most ${scale} decimal places`;\n },\n\n greaterThan: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must be greater than ${comparison}`;\n },\n lessThan: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must be less than ${comparison}`;\n },\n between: (context) => {\n const from = operand(context.params, 'from');\n const to = operand(context.params, 'to');\n return from === null || to === null ? context.message : `must be between ${from} and ${to}`;\n },\n betweenExclusive: (context) => {\n const from = operand(context.params, 'from');\n const to = operand(context.params, 'to');\n return from === null || to === null ? context.message : `must be between ${from} and ${to}, exclusive`;\n },\n equal: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must equal ${comparison}`;\n },\n notEqual: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must not equal ${comparison}`;\n },\n\n literal: (context) => context.message,\n oneOf: (context) => context.message,\n union: (context) => context.message,\n\n pattern: (context) => context.message,\n email: () => 'must be a valid email address',\n url: () => 'must be a valid URL',\n uuid: () => 'must be a valid UUID',\n isoDate: () => 'must be a valid ISO date (YYYY-MM-DD)',\n creditCard: () => 'must be a valid card number',\n\n custom: (context) => context.message,\n transform: (context) => context.message,\n internal: (context) => context.message,\n});\n\nconst EmptyParameters: Readonly<Record<string, unknown>> = Object.freeze({});\n\n/**\n * Strips array indices so one label serves every row: `rules[0].destination` → `rules[].destination`.\n * Looked up only after the exact path misses, so a per-row override stays possible.\n */\nfunction toLabelKey(path: string): string {\n return path.replace(/\\[\\d+\\]/g, '[]');\n}\n\n/**\n * Builds the resolver the form engines call for every message they are about to render.\n *\n * Resolution order per issue: the caller's catalogue → {@link defaultValidationMessages} → the issue's\n * own message. A known label is prefixed to the rendered fragment; an unlabelled field renders the\n * fragment alone, which is what every message in this SDK did before a catalogue existed.\n *\n * `catalogue` is MERGED over the defaults rather than replacing them, so overriding one code's wording —\n * or translating a handful — never silently drops the rest of the vocabulary.\n */\nexport function createMessageResolver(\n catalogue?: ValidationMessageCatalogue,\n labels?: Readonly<Record<string, string>>,\n): ResolveValidationMessage {\n const table: ValidationMessageCatalogue = catalogue\n ? { ...defaultValidationMessages, ...catalogue }\n : defaultValidationMessages;\n\n return (issue, path) => {\n const code = issue.code;\n const entry = code !== undefined && Object.hasOwn(table, code) ? table[code] : undefined;\n const labelKey = toLabelKey(path);\n const label =\n labels === undefined\n ? undefined\n : Object.hasOwn(labels, path)\n ? labels[path]\n : Object.hasOwn(labels, labelKey)\n ? labels[labelKey]\n : undefined;\n if (entry === undefined) return issue.message;\n\n let rendered: string;\n try {\n rendered = entry({\n code: code as string,\n params: issue.params ?? EmptyParameters,\n path,\n label,\n message: issue.message,\n });\n } catch {\n // A caller-supplied entry threw. A message is never worth a second failure — defer to the source.\n return issue.message;\n }\n\n if (typeof rendered !== 'string' || rendered.length === 0) return issue.message;\n return label === undefined || rendered === issue.message ? rendered : `${label} ${rendered}`;\n };\n}\n"],"names":[],"mappings":";AAyCO,MAAM,kBAAkB;AAAA;AAAA,EAE7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,wBAAkE,OAAO,OAAO;A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AAA,EACZ,SAAS,MAAM;AAAA,EACf,YAAY,MAAM;AAAA,EAElB,QAAQ,CAAC,YAAY,QAAQ;AAAA,EAC7B,WAAW,CAAC,YAAY,QAAQ;AAAA,EAChC,UAAU,CAAC,YAAY,QAAQ;AACjC,CAAC;AAED,MAAM,kBAAqD,OAAO,OAAO,EAAE;AAM3E,SAAS,WAAW,MAAsB;AACxC,SAAO,KAAK,QAAQ,YAAY,IAAI;AACtC;AAYO,SAAS,sBACd,WACA,QAC0B;AAC1B,QAAM,QAAoC,YACtC,EAAE,GAAG,2BAA2B,GAAG,cACnC;AAEJ,SAAO,CAAC,OAAO,SAAS;AACtB,UAAM,OAAO,MAAM;AACnB,UAAM,QAAQ,SAAS,UAAa,OAAO,OAAO,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI;AAC/E,UAAM,WAAW,WAAW,IAAI;AAChC,UAAM,QACJ,WAAW,SACP,SACA,OAAO,OAAO,QAAQ,IAAI,IACxB,OAAO,IAAI,IACX,OAAO,OAAO,QAAQ,QAAQ,IAC5B,OAAO,QAAQ,IACf;AACV,QAAI,UAAU,OAAW,QAAO,MAAM;AAEtC,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM;AAAA,QACf;AAAA,QACA,QAAQ,MAAM,UAAU;AAAA,QACxB;AAAA,QACA;AAAA,QACA,SAAS,MAAM;AAAA,MAAA,CAChB;AAAA,IACH,QAAQ;AAEN,aAAO,MAAM;AAAA,IACf;AAEA,QAAI,OAAO,aAAa,YAAY,SAAS,WAAW,UAAU,MAAM;AACxE,WAAO,UAAU,UAAa,aAAa,MAAM,UAAU,WAAW,GAAG,KAAK,IAAI,QAAQ;AAAA,EAC5F;AACF;"}
|
|
1
|
+
{"version":3,"file":"Messages.js","sources":["../../../src/foundation/validators/Messages.ts"],"sourcesContent":["// The shared rule-code vocabulary and the message catalogue that renders it. This slice's reason to\n// exist is NOT to save strings — it is to make the client and the server speak with ONE voice for one\n// rule. A user who reads \"Name is required\" from the client and \"'Name' must not be empty.\" from the\n// server is hearing two voices for the same failure, and that is the drift that actually shows.\n//\n// WHY A VOCABULARY, NOT A SHARED RULE SET: each layer validates its own scope and neither delegates\n// (`conventions/development/backend/foundation/validators.md` § Layer independence). Sharing rule\n// DEFINITIONS would break that; sharing the machine tag a rule reports does not — a tag is presentation\n// metadata, not authority. Client rules stay a latency optimisation; the server stays the authority.\n//\n// WHY THE SERVER MESSAGE IS THE FALLBACK, NEVER THE OVERRIDE: adoption has to be incremental. A code\n// this catalogue does not know renders the message the server already sent, so wiring the catalogue can\n// never make a form worse — the worst case is the behaviour that existed before it.\n//\n// WHY PARAMS EXIST: a catalogue entry that cannot reach the `50` in \"at most 50 characters\" can only\n// emit parameterless strings, which is a catalogue that cannot replace the messages it is meant to\n// replace. Every built-in refinement therefore reports its own limits alongside its code.\n//\n// TWO VOCABULARIES MEET HERE. The house validators report `min` / `max` / `pattern`; FluentValidation\n// reports `MinimumLengthValidator` / `MaximumLengthValidator` / `RegularExpressionValidator`. Neither is\n// wrong and neither wins by default — `FluentValidationCodes` normalizes the server's onto this one so\n// a single catalogue serves both. The alias pass lives on the CLIENT deliberately: it lets a form adopt\n// the catalogue before the backend normalizes anything, and it keeps working unchanged afterwards.\n\nimport { ExactNumber } from '../numbers';\n\n/** A field-level failure widened to carry its machine tag — the channel a catalogue can key on. */\nexport interface FieldIssue {\n /** The authoring or server message. Always present; used verbatim when no catalogue entry matches. */\n readonly message: string;\n /** The normalized rule code (`required`, `min`, `pattern`, …). Absent when the source reported none. */\n readonly code?: string;\n /** The rule's own operands (`{ max: 50 }`), normalized to the vocabulary's names. */\n readonly params?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * The rule codes this ecosystem speaks. The client's own validators report a subset (`type`, `min`,\n * `pattern`, …); the rest arrive from the server. Kept as one flat union because a catalogue keys on it\n * and a split would mean two lookups for one concept.\n */\nexport const ValidationCodes = [\n // shape / presence\n 'required',\n 'type',\n 'mustBeNull',\n 'mustBeEmpty',\n // size\n 'min',\n 'max',\n 'length',\n 'integer',\n 'precision',\n // comparison\n 'greaterThan',\n 'lessThan',\n 'between',\n 'betweenExclusive',\n 'equal',\n 'notEqual',\n // shape membership\n 'literal',\n 'oneOf',\n 'union',\n // format\n 'pattern',\n 'email',\n 'url',\n 'uuid',\n 'isoDate',\n 'creditCard',\n 'phone',\n // escape hatches\n 'custom',\n 'transform',\n 'internal',\n] as const;\n\n/** A member of the shared rule-code vocabulary. */\nexport type ValidationCode = (typeof ValidationCodes)[number];\n\n/**\n * Maps FluentValidation's `ErrorCode` onto the shared vocabulary. Covers the built-in validators whose\n * failures reach a form; anything absent falls through with its raw code, which simply misses the\n * catalogue and renders the server's own message.\n */\nexport const FluentValidationCodes: Readonly<Record<string, ValidationCode>> = Object.freeze({\n NotEmptyValidator: 'required',\n NotNullValidator: 'required',\n NullValidator: 'mustBeNull',\n EmptyValidator: 'mustBeEmpty',\n MinimumLengthValidator: 'min',\n MaximumLengthValidator: 'max',\n ExactLengthValidator: 'length',\n LengthValidator: 'length',\n RegularExpressionValidator: 'pattern',\n EmailValidator: 'email',\n CreditCardValidator: 'creditCard',\n EnumValidator: 'oneOf',\n GreaterThanValidator: 'greaterThan',\n GreaterThanOrEqualValidator: 'min',\n LessThanValidator: 'lessThan',\n LessThanOrEqualValidator: 'max',\n InclusiveBetweenValidator: 'between',\n ExclusiveBetweenValidator: 'betweenExclusive',\n EqualValidator: 'equal',\n NotEqualValidator: 'notEqual',\n ScalePrecisionValidator: 'precision',\n PredicateValidator: 'custom',\n AsyncPredicateValidator: 'custom',\n});\n\n/**\n * Maps FluentValidation's message placeholders onto the vocabulary's param names, so one catalogue entry\n * reads the same operand whichever side reported it. Unlisted placeholders pass through unchanged —\n * `PropertyName` deliberately among them, since the label is resolved from the form, not the payload.\n */\nexport const FluentValidationParameters: Readonly<Record<string, string>> = Object.freeze({\n MinLength: 'min',\n MaxLength: 'max',\n TotalLength: 'length',\n ComparisonValue: 'comparison',\n ComparisonProperty: 'comparisonLabel',\n From: 'from',\n To: 'to',\n ExpectedPrecision: 'precision',\n ExpectedScale: 'scale',\n});\n\n/** What a catalogue entry renders from. */\nexport interface ValidationMessageContext {\n /** The normalized rule code that failed. */\n readonly code: string;\n /** The rule's operands, vocabulary-named. Empty when the source reported none. */\n readonly params: Readonly<Record<string, unknown>>;\n /** The form path the failure is filed under; `''` for a form-level failure. */\n readonly path: string;\n /** The field's display label, when the form named one. Absent means render label-free. */\n readonly label?: string;\n /** The originating message — return this to defer to the source. */\n readonly message: string;\n}\n\n/** Renders one rule code into user-facing text. */\nexport type ValidationMessageEntry = (context: ValidationMessageContext) => string;\n\n/** A code → renderer table. Partial by design: an unlisted code falls back to the source's message. */\nexport type ValidationMessageCatalogue = Readonly<Record<string, ValidationMessageEntry>>;\n\n/** Resolves one issue at one path into the string a field renders. */\nexport type ResolveValidationMessage = (issue: FieldIssue, path: string) => string;\n\n/** Reads a numeric operand, tolerating the string form a JSON payload may carry. */\nfunction operand(params: Readonly<Record<string, unknown>>, key: string): string | null {\n const value = Object.hasOwn(params, key) ? params[key] : undefined;\n if (ExactNumber.isExactNumber(value)) return value.toString();\n if (typeof value === 'number' && Number.isFinite(value)) return String(value);\n if (typeof value === 'string' && value.length > 0) return value;\n return null;\n}\n\n/** Pluralizes the character-count fragments the size rules share. */\nfunction characters(count: string): string {\n return `${count} character${count === '1' ? '' : 's'}`;\n}\n\n/** Pluralizes the item-count fragments the collection size rules share. */\nfunction items(count: string): string {\n return `${count} item${count === '1' ? '' : 's'}`;\n}\n\n/**\n * The English voice for the vocabulary. Entries are FRAGMENTS, not sentences — a field message renders\n * under its own labelled control, so \"must be at least 2 characters\" reads correctly and repeating the\n * label there is noise. A form that supplies `labels` gets the label prefixed by `createMessageResolver`,\n * which is the form-level and cross-field case where the fragment alone would be unaddressed.\n *\n * An entry that cannot render (its operand never arrived) returns `context.message`, so a half-populated\n * payload degrades to the source's wording instead of to \"must be at most undefined\".\n */\nexport const defaultValidationMessages: ValidationMessageCatalogue = Object.freeze({\n required: () => 'is required',\n type: (context) => context.message,\n mustBeNull: () => 'must be empty',\n mustBeEmpty: () => 'must be empty',\n\n min: (context) => {\n const limit = operand(context.params, 'min');\n if (limit === null) return context.message;\n switch (operand(context.params, 'unit')) {\n case 'characters':\n return `must be at least ${characters(limit)}`;\n case 'items':\n return `must have at least ${items(limit)}`;\n case 'instant':\n return `must be on or after ${limit}`;\n default:\n return `must be at least ${limit}`;\n }\n },\n max: (context) => {\n const limit = operand(context.params, 'max');\n if (limit === null) return context.message;\n switch (operand(context.params, 'unit')) {\n case 'characters':\n return `must be at most ${characters(limit)}`;\n case 'items':\n return `must have at most ${items(limit)}`;\n case 'instant':\n return `must be on or before ${limit}`;\n default:\n return `must be at most ${limit}`;\n }\n },\n length: (context) => {\n const exact = operand(context.params, 'length');\n if (exact === null) return context.message;\n if (operand(context.params, 'unit') === 'items') return `must have exactly ${items(exact)}`;\n return `must be exactly ${characters(exact)}`;\n },\n integer: () => 'must be a whole number',\n precision: (context) => {\n const scale = operand(context.params, 'scale');\n return scale === null ? context.message : `must have at most ${scale} decimal places`;\n },\n\n greaterThan: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must be greater than ${comparison}`;\n },\n lessThan: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must be less than ${comparison}`;\n },\n between: (context) => {\n const from = operand(context.params, 'from');\n const to = operand(context.params, 'to');\n return from === null || to === null ? context.message : `must be between ${from} and ${to}`;\n },\n betweenExclusive: (context) => {\n const from = operand(context.params, 'from');\n const to = operand(context.params, 'to');\n return from === null || to === null ? context.message : `must be between ${from} and ${to}, exclusive`;\n },\n equal: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must equal ${comparison}`;\n },\n notEqual: (context) => {\n const comparison = operand(context.params, 'comparison');\n return comparison === null ? context.message : `must not equal ${comparison}`;\n },\n\n literal: (context) => context.message,\n oneOf: (context) => context.message,\n union: (context) => context.message,\n\n pattern: (context) => context.message,\n email: () => 'must be a valid email address',\n url: () => 'must be a valid URL',\n uuid: () => 'must be a valid UUID',\n isoDate: () => 'must be a valid ISO date (YYYY-MM-DD)',\n creditCard: () => 'must be a valid card number',\n phone: (context) => {\n const dial = operand(context.params, 'dial');\n const length = operand(context.params, 'length');\n if (dial !== null && length !== null) return `must have ${length} digits after ${dial}`;\n const min = operand(context.params, 'min');\n const max = operand(context.params, 'max');\n if (dial !== null && min !== null && max !== null) return `must have ${min} to ${max} digits after ${dial}`;\n return 'must be a valid phone number';\n },\n\n custom: (context) => context.message,\n transform: (context) => context.message,\n internal: (context) => context.message,\n});\n\nconst EmptyParameters: Readonly<Record<string, unknown>> = Object.freeze({});\n\n/**\n * Strips array indices so one label serves every row: `rules[0].destination` → `rules[].destination`.\n * Looked up only after the exact path misses, so a per-row override stays possible.\n */\nfunction toLabelKey(path: string): string {\n return path.replace(/\\[\\d+\\]/g, '[]');\n}\n\n/**\n * Builds the resolver the form engines call for every message they are about to render.\n *\n * Resolution order per issue: the caller's catalogue → {@link defaultValidationMessages} → the issue's\n * own message. A known label is prefixed to the rendered fragment; an unlabelled field renders the\n * fragment alone, which is what every message in this SDK did before a catalogue existed.\n *\n * `catalogue` is MERGED over the defaults rather than replacing them, so overriding one code's wording —\n * or translating a handful — never silently drops the rest of the vocabulary.\n */\nexport function createMessageResolver(\n catalogue?: ValidationMessageCatalogue,\n labels?: Readonly<Record<string, string>>,\n): ResolveValidationMessage {\n const table: ValidationMessageCatalogue = catalogue\n ? { ...defaultValidationMessages, ...catalogue }\n : defaultValidationMessages;\n\n return (issue, path) => {\n const code = issue.code;\n const entry = code !== undefined && Object.hasOwn(table, code) ? table[code] : undefined;\n const labelKey = toLabelKey(path);\n const label =\n labels === undefined\n ? undefined\n : Object.hasOwn(labels, path)\n ? labels[path]\n : Object.hasOwn(labels, labelKey)\n ? labels[labelKey]\n : undefined;\n if (entry === undefined) return issue.message;\n\n let rendered: string;\n try {\n rendered = entry({\n code: code as string,\n params: issue.params ?? EmptyParameters,\n path,\n label,\n message: issue.message,\n });\n } catch {\n // A caller-supplied entry threw. A message is never worth a second failure — defer to the source.\n return issue.message;\n }\n\n if (typeof rendered !== 'string' || rendered.length === 0) return issue.message;\n return label === undefined || rendered === issue.message ? rendered : `${label} ${rendered}`;\n };\n}\n"],"names":[],"mappings":";AAyCO,MAAM,kBAAkB;AAAA;AAAA,EAE7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,wBAAkE,OAAO,OAAO;AAAA,EAC3F,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,4BAA4B;AAAA,EAC5B,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,6BAA6B;AAAA,EAC7B,mBAAmB;AAAA,EACnB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,yBAAyB;AAC3B,CAAC;AAOM,MAAM,6BAA+D,OAAO,OAAO;AAAA,EACxF,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,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M3E,SAAS,WAAW,MAAsB;AACxC,SAAO,KAAK,QAAQ,YAAY,IAAI;AACtC;AAYO,SAAS,sBACd,WACA,QAC0B;AAC1B,QAAM,QAAoC,YACtC,EAAE,GAAG,2BAA2B,GAAG,cACnC;AAEJ,SAAO,CAAC,OAAO,SAAS;AACtB,UAAM,OAAO,MAAM;AACnB,UAAM,QAAQ,SAAS,UAAa,OAAO,OAAO,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI;AAC/E,UAAM,WAAW,WAAW,IAAI;AAChC,UAAM,QACJ,WAAW,SACP,SACA,OAAO,OAAO,QAAQ,IAAI,IACxB,OAAO,IAAI,IACX,OAAO,OAAO,QAAQ,QAAQ,IAC5B,OAAO,QAAQ,IACf;AACV,QAAI,UAAU,OAAW,QAAO,MAAM;AAEtC,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM;AAAA,QACf;AAAA,QACA,QAAQ,MAAM,UAAU;AAAA,QACxB;AAAA,QACA;AAAA,QACA,SAAS,MAAM;AAAA,MAAA,CAChB;AAAA,IACH,QAAQ;AAEN,aAAO,MAAM;AAAA,IACf;AAEA,QAAI,OAAO,aAAa,YAAY,SAAS,WAAW,UAAU,MAAM;AACxE,WAAO,UAAU,UAAa,aAAa,MAAM,UAAU,WAAW,GAAG,KAAK,IAAI,QAAQ;AAAA,EAC5F;AACF;"}
|
|
@@ -3,6 +3,6 @@ export { type StandardSchemaV1 } from './StandardSchema';
|
|
|
3
3
|
export { type ParseFn, type Infer, type InferInput, Validator, ValidationVendor, toStandardResult, toStandardSchema, } from './Validator';
|
|
4
4
|
export { StringValidator, NumberValidator, ExactNumberValidator, DateValidator, string, number, exactNumber, boolean, date, literal, oneOf, } from './Primitives';
|
|
5
5
|
export { type ObjectShape, type InferObject, type InferTuple, ArrayValidator, object, array, record, union, tuple, } from './Composites';
|
|
6
|
-
export { email, url, uuid, isoDate } from './Formats';
|
|
6
|
+
export { type PhoneRuleOptions, email, url, uuid, isoDate, phone } from './Formats';
|
|
7
7
|
export { ValidationError, assertValid } from './ValidationError';
|
|
8
8
|
export { type FieldIssue, type ValidationCode, type ValidationMessageContext, type ValidationMessageEntry, type ValidationMessageCatalogue, type ResolveValidationMessage, ValidationCodes, FluentValidationCodes, FluentValidationParameters, defaultValidationMessages, createMessageResolver, } from './Messages';
|
|
@@ -2,7 +2,7 @@ import { describeType, formatIssuePath, invalid, valid } from "./ValidationOutco
|
|
|
2
2
|
import { ValidationVendor, Validator, toStandardResult, toStandardSchema } from "./Validator.js";
|
|
3
3
|
import { DateValidator, ExactNumberValidator, NumberValidator, StringValidator, boolean, date, exactNumber, literal, number, oneOf, string } from "./Primitives.js";
|
|
4
4
|
import { ArrayValidator, array, object, record, tuple, union } from "./Composites.js";
|
|
5
|
-
import { email, isoDate, url, uuid } from "./Formats.js";
|
|
5
|
+
import { email, isoDate, phone, url, uuid } from "./Formats.js";
|
|
6
6
|
import { ValidationError, assertValid } from "./ValidationError.js";
|
|
7
7
|
import { FluentValidationCodes, FluentValidationParameters, ValidationCodes, createMessageResolver, defaultValidationMessages } from "./Messages.js";
|
|
8
8
|
export {
|
|
@@ -33,6 +33,7 @@ export {
|
|
|
33
33
|
number,
|
|
34
34
|
object,
|
|
35
35
|
oneOf,
|
|
36
|
+
phone,
|
|
36
37
|
record,
|
|
37
38
|
string,
|
|
38
39
|
toStandardResult,
|
package/dist/index.css
CHANGED
|
@@ -291,6 +291,17 @@ body {
|
|
|
291
291
|
color: var(--color-foreground);
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
+
/* A programmatic focus target — what `focusTarget` (`foundation/dom`) marks with `data-focus-target`: a page's `main`
|
|
295
|
+
after a route change, a heading, a region holding focus while its content swaps. It is not a control, so it draws
|
|
296
|
+
no focus ring, and a screen reader still lands on it. The selector outweighs preflight's Firefox ring in the same
|
|
297
|
+
layer, `:-moz-focusring:where(:not(iframe)) { outline: auto }`, which a zero-specificity `:where()` lost to;
|
|
298
|
+
`@layer base` still leaves a utility the app sets on the element in charge. */
|
|
299
|
+
@layer base {
|
|
300
|
+
[data-focus-target]:focus {
|
|
301
|
+
outline: none;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
294
305
|
/* ---------------------------------------------------------------------------
|
|
295
306
|
* Scrollbars — a slim themed track and a pill-shaped thumb on every scroll container, always visible.
|
|
296
307
|
*
|
package/dist/index.js
CHANGED
|
@@ -291,7 +291,7 @@ import { default as default299 } from "./presentation/forms/passwordInput/Passwo
|
|
|
291
291
|
import { default as default300 } from "./presentation/feedback/passwordStrengthCallout/PasswordStrengthCallout.vue.js";
|
|
292
292
|
import { default as default301 } from "./presentation/display/pdfViewer/PdfViewer.vue.js";
|
|
293
293
|
import { default as default302 } from "./presentation/forms/percentInput/PercentInput.vue.js";
|
|
294
|
-
import {
|
|
294
|
+
import { default as default303 } from "./presentation/forms/phoneInput/PhoneInput.vue.js";
|
|
295
295
|
import { default as default304, PinInputType } from "./presentation/forms/pinInput/PinInput.vue.js";
|
|
296
296
|
import { default as default305 } from "./presentation/overlays/popover/Popover.vue.js";
|
|
297
297
|
import { default as default306 } from "./presentation/overlays/popover/PopoverArrow.vue.js";
|
|
@@ -458,6 +458,7 @@ import { ListboxPickerItemState } from "./presentation/forms/listboxPicker/Listb
|
|
|
458
458
|
import { MenuItemState, menuItemIndicatorVariants, menuItemVariants, menuLabelVariants, menuSeparatorVariants, menuSubIndicatorVariants, menuVariants } from "./presentation/nav/menu/Menu.variants.js";
|
|
459
459
|
import { MenuKey, MenuRadioGroupKey, MenuSubKey, MenuSubOpenReason, MenuTreeKey, useMenuContext, useMenuRadioGroupContext, useMenuSubContext } from "./presentation/nav/menu/MenuContext.js";
|
|
460
460
|
import { NavbarElement, NavbarHeight, NavbarOrientation, NavbarVariant, navbarVariants } from "./presentation/layout/navbar/Navbar.variants.js";
|
|
461
|
+
import { PhoneCountries } from "./foundation/phone/PhoneCountries.js";
|
|
461
462
|
import { RadioGroupKey, useRadioGroup } from "./presentation/forms/radioGroup/RadioGroupContext.js";
|
|
462
463
|
import { SectionPaddingY, sectionVariants } from "./presentation/layout/section/Section.variants.js";
|
|
463
464
|
import { SelectPickerSize, selectTriggerVariants } from "./presentation/forms/selectPicker/SelectPicker.variants.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshButton.vue.js","sources":["../../../../src/presentation/actions/refreshButton/RefreshButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ButtonProps } from '../button';\n\n/** @internal The `ButtonProps` this preset decides itself. */\ntype OwnedButtonProp = keyof Pick<ButtonProps, 'isLoading' | 'shape' | 'leadingSlot'>;\n\n/** Defines the forwarded `ButtonProps`, minus the ones the refresh preset sets. */\ntype RefreshButtonAttributes = Omit<ButtonProps, OwnedButtonProp>;\n\n/** Defines props for the one refresh control a region shows. */\nexport interface RefreshButtonProps extends /* @vue-ignore */ RefreshButtonAttributes {\n /** True from the click until the refresh settles — `useRefresh`'s `refreshing`; the icon spins and clicks wait. */\n readonly isRefreshing?: boolean;\n\n /** The visible label, or the accessible name of an icon-only button. Default `\"Refresh\"`, localized. */\n readonly label?: string;\n\n /** Renders the icon alone, square at its size, named by `label`. */\n readonly isIconOnly?: boolean;\n\n /** The visual surface style. Default `outline`; `ghost` inside a panel header. */\n readonly variant?: ButtonProps['variant'];\n\n /** The size step. Default `sm`; `md` beside page-level controls. */\n readonly size?: ButtonProps['size'];\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport { RefreshCw } from 'lucide-vue-next';\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { Icon } from '../../../foundation/icons';\nimport Button from '../button/Button.vue';\n\n/**\n * Renders the refresh control a region reruns its reads with — a `Button` preset that swaps the refresh icon for the\n * spinner while `isRefreshing`, keeps its label and width, and swallows repeat clicks until the refresh settles. Pair\n * it with `useRefresh` from `@wow-two-beta/fe/query`, which also drives the region's placeholders.\n */\ndefineOptions({ name: 'RefreshButton', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<RefreshButtonProps>(), {\n isRefreshing: false,\n label: undefined,\n isIconOnly: false,\n variant: 'outline',\n size: 'sm',\n});\nconst props = useLocaleDefaults(componentProps, 'RefreshButton', { label: 'Refresh' });\n\nconst attrs = useAttrs();\n\n/** The icon-only form names itself through `aria-label`, and `title` shows the name on hover. */\nconst naming = computed(() =>\n props.isIconOnly ? { 'aria-label': props.label, title: props.label } : ({} as Record<string, string>),\n);\n</script>\n\n<template>\n <Button\n tone=\"neutral\"\n :variant=\"props.variant\"\n :size=\"props.size\"\n :shape=\"props.isIconOnly ? 'square' : 'default'\"\n :is-loading=\"props.isRefreshing\"\n v-bind=\"{ ...naming, ...attrs }\"\n >\n <template #leading><Icon :icon=\"RefreshCw\" :size=\"14\" /></template>\n <template v-if=\"!props.isIconOnly\">{{ props.label }}</template>\n </Button>\n</template>\n"],"names":["_openBlock","_createBlock","Button","_mergeProps","_unref","_createVNode","Icon","_createElementBlock","_Fragment","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;AA0CA,UAAM,iBAAiB;AAOvB,UAAM,QAAQ,kBAAkB,gBAAgB,iBAAiB,EAAE,OAAO,WAAW;AAErF,UAAM,QAAQ,SAAA;AAGd,UAAM,SAAS;AAAA,MAAS,MACtB,MAAM,aAAa,EAAE,cAAc,MAAM,OAAO,OAAO,MAAM,UAAW,CAAA;AAAA,IAAC;;AAKzE,aAAAA,UAAA,GAAAC,YAUSC,aAVTC,WAUS;AAAA,QATP,MAAK;AAAA,QACJ,SAASC,MAAA,KAAA,EAAM;AAAA,QACf,MAAMA,MAAA,KAAA,EAAM;AAAA,QACZ,OAAOA,MAAA,KAAA,EAAM,aAAU,WAAA;AAAA,QACvB,cAAYA,MAAA,KAAA,EAAM;AAAA,MAAA,GACN,EAAA,GAAA,OAAA,UAAWA,MAAA,KAAA,EAAA,CAAK,GAAA;AAAA,QAElB,iBAAQ,MAAqC;AAAA,UAArCC,YAAqCD,MAAAE,WAAA,GAAA;AAAA,YAA9B,MAAMF,MAAA,SAAA;AAAA,YAAY,MAAM;AAAA,UAAA;;
|
|
1
|
+
{"version":3,"file":"RefreshButton.vue.js","sources":["../../../../src/presentation/actions/refreshButton/RefreshButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ButtonProps } from '../button';\n\n/** @internal The `ButtonProps` this preset decides itself. */\ntype OwnedButtonProp = keyof Pick<ButtonProps, 'isLoading' | 'shape' | 'leadingSlot'>;\n\n/** Defines the forwarded `ButtonProps`, minus the ones the refresh preset sets. */\ntype RefreshButtonAttributes = Omit<ButtonProps, OwnedButtonProp>;\n\n/** Defines props for the one refresh control a region shows. */\nexport interface RefreshButtonProps extends /* @vue-ignore */ RefreshButtonAttributes {\n /** True from the click until the refresh settles — `useRefresh`'s `refreshing`; the icon spins and clicks wait. */\n readonly isRefreshing?: boolean;\n\n /** The visible label, or the accessible name of an icon-only button. Default `\"Refresh\"`, localized. */\n readonly label?: string;\n\n /** Renders the icon alone, square at its size, named by `label`. */\n readonly isIconOnly?: boolean;\n\n /** The visual surface style. Default `outline`; `ghost` inside a panel header. */\n readonly variant?: ButtonProps['variant'];\n\n /** The size step. Default `sm`; `md` beside page-level controls. */\n readonly size?: ButtonProps['size'];\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport { RefreshCw } from 'lucide-vue-next';\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { Icon } from '../../../foundation/icons';\nimport Button from '../button/Button.vue';\n\n/**\n * Renders the refresh control a region reruns its reads with — a `Button` preset that swaps the refresh icon for the\n * spinner while `isRefreshing`, keeps its label and width, and swallows repeat clicks until the refresh settles. Pair\n * it with `useRefresh` from `@wow-two-beta/fe/query`, which also drives the region's placeholders.\n */\ndefineOptions({ name: 'RefreshButton', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<RefreshButtonProps>(), {\n isRefreshing: false,\n label: undefined,\n isIconOnly: false,\n variant: 'outline',\n size: 'sm',\n});\nconst props = useLocaleDefaults(componentProps, 'RefreshButton', { label: 'Refresh' });\n\nconst attrs = useAttrs();\n\n/** The icon-only form names itself through `aria-label`, and `title` shows the name on hover. */\nconst naming = computed(() =>\n props.isIconOnly ? { 'aria-label': props.label, title: props.label } : ({} as Record<string, string>),\n);\n</script>\n\n<template>\n <Button\n tone=\"neutral\"\n :variant=\"props.variant\"\n :size=\"props.size\"\n :shape=\"props.isIconOnly ? 'square' : 'default'\"\n :is-loading=\"props.isRefreshing\"\n v-bind=\"{ ...naming, ...attrs }\"\n >\n <template #leading><Icon :icon=\"RefreshCw\" :size=\"14\" /></template>\n <template v-if=\"!props.isIconOnly\">{{ props.label }}</template>\n </Button>\n</template>\n"],"names":["_openBlock","_createBlock","Button","_mergeProps","_unref","_createVNode","Icon","_createElementBlock","_Fragment","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;AA0CA,UAAM,iBAAiB;AAOvB,UAAM,QAAQ,kBAAkB,gBAAgB,iBAAiB,EAAE,OAAO,WAAW;AAErF,UAAM,QAAQ,SAAA;AAGd,UAAM,SAAS;AAAA,MAAS,MACtB,MAAM,aAAa,EAAE,cAAc,MAAM,OAAO,OAAO,MAAM,UAAW,CAAA;AAAA,IAAC;;AAKzE,aAAAA,UAAA,GAAAC,YAUSC,aAVTC,WAUS;AAAA,QATP,MAAK;AAAA,QACJ,SAASC,MAAA,KAAA,EAAM;AAAA,QACf,MAAMA,MAAA,KAAA,EAAM;AAAA,QACZ,OAAOA,MAAA,KAAA,EAAM,aAAU,WAAA;AAAA,QACvB,cAAYA,MAAA,KAAA,EAAM;AAAA,MAAA,GACN,EAAA,GAAA,OAAA,UAAWA,MAAA,KAAA,EAAA,CAAK,GAAA;AAAA,QAElB,iBAAQ,MAAqC;AAAA,UAArCC,YAAqCD,MAAAE,WAAA,GAAA;AAAA,YAA9B,MAAMF,MAAA,SAAA;AAAA,YAAY,MAAM;AAAA,UAAA;;yBATuC,MAGjF;AAAA,UAOS,CAAAA,MAAA,KAAA,EAAM,2BAAvBG,mBAA+DC,UAAA,EAAA,KAAA,KAAA;AAAA,YAAzBC,gBAAAC,gBAAAN,MAAA,KAAA,EAAM,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;"}
|
|
@@ -16,8 +16,8 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<AnimatedNu
|
|
|
16
16
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AnimatedNumberTextProps> & Readonly<{}>, {
|
|
17
17
|
readonly as: ElementTag;
|
|
18
18
|
readonly format: (value: number) => string;
|
|
19
|
-
readonly duration: number;
|
|
20
19
|
readonly easing: (t: number) => number;
|
|
20
|
+
readonly duration: number;
|
|
21
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
22
22
|
/** The rich override for the formatted number — receives the live tween value. */
|
|
23
23
|
value?(props: {
|
|
@@ -21,8 +21,8 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<CarouselPr
|
|
|
21
21
|
}, string, import('vue').PublicProps, Readonly<CarouselProps> & Readonly<{
|
|
22
22
|
"onUpdate:index"?: ((index: number) => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
readonly canLoop: boolean;
|
|
25
24
|
readonly index: number;
|
|
25
|
+
readonly canLoop: boolean;
|
|
26
26
|
readonly defaultIndex: number;
|
|
27
27
|
readonly autoPlay: number;
|
|
28
28
|
readonly slidesCount: number;
|
|
@@ -21,8 +21,8 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<CountUpTex
|
|
|
21
21
|
readonly as: ElementTag;
|
|
22
22
|
readonly format: (value: number) => string;
|
|
23
23
|
readonly from: number;
|
|
24
|
-
readonly duration: number;
|
|
25
24
|
readonly easing: (t: number) => number;
|
|
25
|
+
readonly duration: number;
|
|
26
26
|
readonly canTriggerOnView: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
28
28
|
/** The rich override for the formatted number — receives the live tween value. */
|
|
@@ -33,10 +33,10 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<ScrollReve
|
|
|
33
33
|
el: Readonly<import('vue').ShallowRef<HTMLElement | null>>;
|
|
34
34
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScrollRevealGroupProps> & Readonly<{}>, {
|
|
35
35
|
readonly as: ElementTag;
|
|
36
|
-
readonly threshold: number;
|
|
37
36
|
readonly duration: number;
|
|
38
|
-
readonly effect: ScrollRevealGroupEffect;
|
|
39
37
|
readonly delay: number;
|
|
38
|
+
readonly threshold: number;
|
|
39
|
+
readonly effect: ScrollRevealGroupEffect;
|
|
40
40
|
readonly isOnce: boolean;
|
|
41
41
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
42
42
|
default(): unknown;
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
const passthroughAttrs = computed(
|
|
43
43
|
() => Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key)))
|
|
44
44
|
);
|
|
45
|
-
const rootClass = computed(() => cn("flex flex-col
|
|
45
|
+
const rootClass = computed(() => cn("flex flex-col", attrs.class));
|
|
46
46
|
const root = useTemplateRef("root");
|
|
47
47
|
__expose({ el: root });
|
|
48
48
|
return (_ctx, _cache) => {
|
|
@@ -62,7 +62,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
"aria-busy": props.isSkeleton || void 0,
|
|
63
63
|
class: rootClass.value
|
|
64
64
|
}, passthroughAttrs.value), [
|
|
65
|
-
hasLabel.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
65
|
+
hasLabel.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "mb-1.5"
|
|
68
|
+
}, {
|
|
66
69
|
default: withCtx(() => [
|
|
67
70
|
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
68
71
|
createTextVNode(toDisplayString(__props.label), 1)
|
|
@@ -73,6 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
76
|
renderSlot(_ctx.$slots, "default"),
|
|
74
77
|
showError.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
75
78
|
key: 1,
|
|
79
|
+
class: "mt-1.5",
|
|
76
80
|
message: hasOwnError.value ? __props.error : void 0
|
|
77
81
|
}, createSlots({ _: 2 }, [
|
|
78
82
|
hasOwnError.value && _ctx.$slots.error ? {
|
|
@@ -82,7 +86,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
86
|
]),
|
|
83
87
|
key: "0"
|
|
84
88
|
} : void 0
|
|
85
|
-
]), 1032, ["message"])) : hasHelper.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
89
|
+
]), 1032, ["message"])) : hasHelper.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
90
|
+
key: 2,
|
|
91
|
+
class: "mt-1.5"
|
|
92
|
+
}, {
|
|
86
93
|
default: withCtx(() => [
|
|
87
94
|
renderSlot(_ctx.$slots, "helper", {}, () => [
|
|
88
95
|
createTextVNode(toDisplayString(__props.helper), 1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.vue.js","sources":["../../../../src/presentation/forms/field/Field.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface FieldProps {\n /** The label text. Fill the `label` slot instead for richer content (e.g. label + tooltip). */\n readonly label?: string | number;\n\n /** The helper / hint shown beneath the control. Hidden while errors show. */\n readonly helper?: string | number;\n\n /**\n * The error text — renders only when truthy. Sets `isInvalid` on the form context.\n * Inside a forms-engine `Field` this is an OVERRIDE: leave it unset and the\n * field's own errors (client + server, all of them) render automatically.\n */\n readonly error?: string | number;\n\n /** The required state (also exposes `isRequired` to the control via context). */\n readonly isRequired?: boolean;\n\n /** The disabled state (also exposes `isDisabled` to the control). */\n readonly isDisabled?: boolean;\n\n /** The read-only state (also exposes `isReadOnly` to the control). */\n readonly isReadOnly?: boolean;\n\n /** Keeps the layout and draws the label, control and helper as skeletons; defaults to the nearest `DataRegion`. */\n readonly isSkeleton?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { FormControlProvider, useFormControl } from '../../../foundation/primitives';\nimport LabelText from '../../display/labelText/LabelText.vue';\nimport FieldHelperText from '../../display/fieldHelperText/FieldHelperText.vue';\nimport FieldErrorCallout from '../../feedback/fieldErrorCallout/FieldErrorCallout.vue';\nimport { provideSkeletonState, useSkeletonState } from '../../feedback/skeletonState/SkeletonStateContext';\n\n/**\n * Renders label, control, helper and error as one block, wiring the control through form-control context.\n *\n * Wraps the default slot in a `FormControlProvider` so the inner control auto-wires `id`,\n * `aria-describedby`, `aria-invalid`, `disabled`, `required`, `readOnly`.\n *\n * Form-aware: composed inside a forms-engine `Field` it ADOPTS the glue's context\n * instead of shadowing it — same ids, inherited `isInvalid`/flags, and the field's\n * errors render without hand-wiring (`error` stays as an override). Standalone (no\n * surrounding provider) it behaves exactly as before.\n *\n * Each of React's three `ReactNode` props keeps its scalar form and gains a\n * same-named slot for richer content; the prop stays the discriminator.\n */\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\ndefineOptions({ name: 'Field', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<FieldProps>(), {\n /* Explicit `undefined` defaults are load-bearing: each flag falls back to the PARENT\n context's value, and Vue's Boolean casting would turn an absent prop into an explicit\n `false` that shadows the parent instead of deferring to it. */\n isRequired: undefined,\n isDisabled: undefined,\n isReadOnly: undefined,\n isSkeleton: undefined,\n});\n\n/* One flag switches the label, the control and the helper; each draws its own skeleton in its own box. */\nconst skeleton = useSkeletonState(() => props.isSkeleton);\nprovideSkeletonState(skeleton);\n\n/** The single form control (TextInput, SelectPicker, …) — receives wired id/aria via context. */\ndefineSlots<{\n default(): unknown;\n label?(): unknown;\n helper?(): unknown;\n error?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\n\n/* `parent` is a live-getter object — read fields off it, never destructure. */\nconst parent = useFormControl();\n\nconst hasLabel = computed(() => Boolean(props.label) || Boolean(slots.label));\nconst hasHelper = computed(() => Boolean(props.helper) || Boolean(slots.helper));\nconst hasOwnError = computed(() => Boolean(props.error) || Boolean(slots.error));\n\n/* Mirrors FieldErrorCallout's visibility so the helper never hides behind an error\n that won't render. */\nconst showError = computed(\n () => hasOwnError.value || ((parent?.errors?.length ?? 0) > 0 && (parent?.isInvalid ?? false)),\n);\n\nconst parentId = computed(() => parent?.id);\nconst parentErrors = computed(() => parent?.errors);\nconst isInvalid = computed(() => hasOwnError.value || (parent?.isInvalid ?? false));\nconst isRequired = computed(() => props.isRequired ?? parent?.isRequired);\nconst isDisabled = computed(() => props.isDisabled ?? parent?.isDisabled);\nconst isReadOnly = computed(() => props.isReadOnly ?? parent?.isReadOnly);\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() => cn('flex flex-col
|
|
1
|
+
{"version":3,"file":"Field.vue.js","sources":["../../../../src/presentation/forms/field/Field.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface FieldProps {\n /** The label text. Fill the `label` slot instead for richer content (e.g. label + tooltip). */\n readonly label?: string | number;\n\n /** The helper / hint shown beneath the control. Hidden while errors show. */\n readonly helper?: string | number;\n\n /**\n * The error text — renders only when truthy. Sets `isInvalid` on the form context.\n * Inside a forms-engine `Field` this is an OVERRIDE: leave it unset and the\n * field's own errors (client + server, all of them) render automatically.\n */\n readonly error?: string | number;\n\n /** The required state (also exposes `isRequired` to the control via context). */\n readonly isRequired?: boolean;\n\n /** The disabled state (also exposes `isDisabled` to the control). */\n readonly isDisabled?: boolean;\n\n /** The read-only state (also exposes `isReadOnly` to the control). */\n readonly isReadOnly?: boolean;\n\n /** Keeps the layout and draws the label, control and helper as skeletons; defaults to the nearest `DataRegion`. */\n readonly isSkeleton?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { FormControlProvider, useFormControl } from '../../../foundation/primitives';\nimport LabelText from '../../display/labelText/LabelText.vue';\nimport FieldHelperText from '../../display/fieldHelperText/FieldHelperText.vue';\nimport FieldErrorCallout from '../../feedback/fieldErrorCallout/FieldErrorCallout.vue';\nimport { provideSkeletonState, useSkeletonState } from '../../feedback/skeletonState/SkeletonStateContext';\n\n/**\n * Renders label, control, helper and error as one block, wiring the control through form-control context.\n *\n * Wraps the default slot in a `FormControlProvider` so the inner control auto-wires `id`,\n * `aria-describedby`, `aria-invalid`, `disabled`, `required`, `readOnly`.\n *\n * Form-aware: composed inside a forms-engine `Field` it ADOPTS the glue's context\n * instead of shadowing it — same ids, inherited `isInvalid`/flags, and the field's\n * errors render without hand-wiring (`error` stays as an override). Standalone (no\n * surrounding provider) it behaves exactly as before.\n *\n * Each of React's three `ReactNode` props keeps its scalar form and gains a\n * same-named slot for richer content; the prop stays the discriminator.\n */\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\ndefineOptions({ name: 'Field', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<FieldProps>(), {\n /* Explicit `undefined` defaults are load-bearing: each flag falls back to the PARENT\n context's value, and Vue's Boolean casting would turn an absent prop into an explicit\n `false` that shadows the parent instead of deferring to it. */\n isRequired: undefined,\n isDisabled: undefined,\n isReadOnly: undefined,\n isSkeleton: undefined,\n});\n\n/* One flag switches the label, the control and the helper; each draws its own skeleton in its own box. */\nconst skeleton = useSkeletonState(() => props.isSkeleton);\nprovideSkeletonState(skeleton);\n\n/** The single form control (TextInput, SelectPicker, …) — receives wired id/aria via context. */\ndefineSlots<{\n default(): unknown;\n label?(): unknown;\n helper?(): unknown;\n error?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\n\n/* `parent` is a live-getter object — read fields off it, never destructure. */\nconst parent = useFormControl();\n\nconst hasLabel = computed(() => Boolean(props.label) || Boolean(slots.label));\nconst hasHelper = computed(() => Boolean(props.helper) || Boolean(slots.helper));\nconst hasOwnError = computed(() => Boolean(props.error) || Boolean(slots.error));\n\n/* Mirrors FieldErrorCallout's visibility so the helper never hides behind an error\n that won't render. */\nconst showError = computed(\n () => hasOwnError.value || ((parent?.errors?.length ?? 0) > 0 && (parent?.isInvalid ?? false)),\n);\n\nconst parentId = computed(() => parent?.id);\nconst parentErrors = computed(() => parent?.errors);\nconst isInvalid = computed(() => hasOwnError.value || (parent?.isInvalid ?? false));\nconst isRequired = computed(() => props.isRequired ?? parent?.isRequired);\nconst isDisabled = computed(() => props.isDisabled ?? parent?.isDisabled);\nconst isReadOnly = computed(() => props.isReadOnly ?? parent?.isReadOnly);\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\n/* Spacing is the chrome's own margin, never a flex `gap`: a password manager (NordPass and others) inserts its icon\n element beside a focused `<input>`, and a gap would open around that element and push the block — and a page\n centred on it — by the gap's height. A zero-size or absolutely positioned insert now moves nothing. */\nconst rootClass = computed(() => cn('flex flex-col', attrs.class as ClassValue));\n\nconst root = useTemplateRef<HTMLDivElement>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <FormControlProvider\n :id=\"parentId\"\n :errors=\"parentErrors\"\n :is-invalid=\"isInvalid\"\n :is-required=\"isRequired\"\n :is-disabled=\"isDisabled\"\n :is-read-only=\"isReadOnly\"\n >\n <div\n ref=\"root\"\n :data-skeleton=\"skeleton.isSkeleton.value || undefined\"\n :aria-busy=\"props.isSkeleton || undefined\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n >\n <LabelText v-if=\"hasLabel\" class=\"mb-1.5\">\n <slot name=\"label\">{{ label }}</slot>\n </LabelText>\n\n <slot />\n\n <FieldErrorCallout v-if=\"showError\" class=\"mt-1.5\" :message=\"hasOwnError ? error : undefined\">\n <!-- Passed only when this Field owns the error: an always-present default slot\n would read as an override and suppress the context's own `errors`. -->\n <template v-if=\"hasOwnError && $slots.error\" #default>\n <slot name=\"error\" />\n </template>\n </FieldErrorCallout>\n <FieldHelperText v-else-if=\"hasHelper\" class=\"mt-1.5\">\n <slot name=\"helper\">{{ helper }}</slot>\n </FieldHelperText>\n </div>\n </FormControlProvider>\n</template>\n"],"names":["_createBlock","_unref","FormControlProvider","_createElementVNode","_mergeProps","LabelText","_renderSlot","FieldErrorCallout","$slots","FieldHelperText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyDA,UAAM,QAAQ;AAWd,UAAM,WAAW,iBAAiB,MAAM,MAAM,UAAU;AACxD,yBAAqB,QAAQ;AAU7B,UAAM,QAAQ,SAAA;AACd,UAAM,QAAQ,SAAA;AAGd,UAAM,SAAS,eAAA;AAEf,UAAM,WAAW,SAAS,MAAM,QAAQ,MAAM,KAAK,KAAK,QAAQ,MAAM,KAAK,CAAC;AAC5E,UAAM,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,KAAK,QAAQ,MAAM,MAAM,CAAC;AAC/E,UAAM,cAAc,SAAS,MAAM,QAAQ,MAAM,KAAK,KAAK,QAAQ,MAAM,KAAK,CAAC;AAI/E,UAAM,YAAY;AAAA,MAChB,MAAM,YAAY,UAAW,QAAQ,QAAQ,UAAU,KAAK,MAAM,QAAQ,aAAa;AAAA,IAAA;AAGzF,UAAM,WAAW,SAAS,MAAM,QAAQ,EAAE;AAC1C,UAAM,eAAe,SAAS,MAAM,QAAQ,MAAM;AAClD,UAAM,YAAY,SAAS,MAAM,YAAY,UAAU,QAAQ,aAAa,MAAM;AAClF,UAAM,aAAa,SAAS,MAAM,MAAM,cAAc,QAAQ,UAAU;AACxE,UAAM,aAAa,SAAS,MAAM,MAAM,cAAc,QAAQ,UAAU;AACxE,UAAM,aAAa,SAAS,MAAM,MAAM,cAAc,QAAQ,UAAU;AAExE,UAAM,kBAAuC,oBAAI,IAAI,CAAC,OAAO,CAAC;AAC9D,UAAM,mBAAmB;AAAA,MAAS,MAChC,OAAO,YAAY,OAAO,QAAQ,KAAK,E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AAM,GAAA,CAAA;AAAA,gBAAA;;;;;;;;;;;"}
|
|
@@ -33,10 +33,10 @@ declare const _default: import('vue').DefineComponent<ImageCropEditorProps, {
|
|
|
33
33
|
}, string, import('vue').PublicProps, Readonly<ImageCropEditorProps> & Readonly<{
|
|
34
34
|
"onUpdate:modelValue"?: ((crop: CropRect) => any) | undefined;
|
|
35
35
|
}>, {
|
|
36
|
+
readonly alt: string;
|
|
36
37
|
readonly isDisabled: boolean;
|
|
37
38
|
readonly isReadOnly: boolean;
|
|
38
39
|
readonly maxHeight: string;
|
|
39
|
-
readonly alt: string;
|
|
40
40
|
readonly defaultValue: CropRect | null;
|
|
41
41
|
readonly modelValue: CropRect | null;
|
|
42
42
|
readonly aspectRatio: number;
|
|
@@ -26,9 +26,9 @@ declare const _default: import('vue').DefineComponent<ImageEditorProps, {}, {},
|
|
|
26
26
|
onPreview?: ((recipe: ImageEditRecipe) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
28
|
readonly error: string;
|
|
29
|
+
readonly alt: string;
|
|
29
30
|
readonly isDisabled: boolean;
|
|
30
31
|
readonly isReadOnly: boolean;
|
|
31
|
-
readonly alt: string;
|
|
32
32
|
readonly defaultValue: ImageEditRecipe;
|
|
33
33
|
readonly modelValue: ImageEditRecipe;
|
|
34
34
|
readonly maxDimension: number;
|
|
@@ -73,7 +73,7 @@ import { default as default73 } from "./optionTileGroupField/OptionTileGroupFiel
|
|
|
73
73
|
import { default as default74 } from "./optionTilePicker/OptionTilePicker.vue.js";
|
|
74
74
|
import { default as default75 } from "./passwordInput/PasswordInput.vue.js";
|
|
75
75
|
import { default as default76 } from "./percentInput/PercentInput.vue.js";
|
|
76
|
-
import {
|
|
76
|
+
import { default as default77 } from "./phoneInput/PhoneInput.vue.js";
|
|
77
77
|
import { default as default78, PinInputType } from "./pinInput/PinInput.vue.js";
|
|
78
78
|
import { default as default79 } from "./radioField/RadioField.vue.js";
|
|
79
79
|
import { default as default80 } from "./radioGroup/RadioGroup.vue.js";
|
|
@@ -126,6 +126,7 @@ import { ImageEditRecipeExtensions } from "../../domain/imageEditing/ImageEditRe
|
|
|
126
126
|
import { JsonEditorMode } from "./jsonEditor/JsonEditorContext.js";
|
|
127
127
|
import { ListboxPickerIndicator } from "./listboxPicker/ListboxPickerContext.js";
|
|
128
128
|
import { ListboxPickerItemState } from "./listboxPicker/ListboxPicker.variants.js";
|
|
129
|
+
import { PhoneCountries } from "../../foundation/phone/PhoneCountries.js";
|
|
129
130
|
import { RadioGroupKey, useRadioGroup } from "./radioGroup/RadioGroupContext.js";
|
|
130
131
|
import { SelectPickerSize, selectTriggerVariants } from "./selectPicker/SelectPicker.variants.js";
|
|
131
132
|
import { ToggleGroupKey } from "./toggleGroup/ToggleGroupContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { defineComponent, useAttrs, useSlots, computed, useTemplateRef, openBloc
|
|
|
2
2
|
import { cn } from "../../../foundation/styles/Cn.js";
|
|
3
3
|
import { useId } from "../../../foundation/identifiers/UseId.js";
|
|
4
4
|
import _sfc_main$1 from "../../display/labelText/LabelText.vue.js";
|
|
5
|
-
const _hoisted_1 = { class: "flex items-center justify-between" };
|
|
5
|
+
const _hoisted_1 = { class: "mb-1.5 flex items-center justify-between" };
|
|
6
6
|
const _hoisted_2 = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-xs text-muted-foreground"
|
|
@@ -24,7 +24,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
const passthroughAttrs = computed(
|
|
25
25
|
() => Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key)))
|
|
26
26
|
);
|
|
27
|
-
const rootClass = computed(() => cn("flex flex-col
|
|
27
|
+
const rootClass = computed(() => cn("flex flex-col", attrs.class));
|
|
28
28
|
const root = useTemplateRef("root");
|
|
29
29
|
__expose({ el: root });
|
|
30
30
|
return (_ctx, _cache) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledField.vue.js","sources":["../../../../src/presentation/forms/labeledField/LabeledField.vue"],"sourcesContent":["<script lang=\"ts\">\n/** @deprecated Prefer `Field` (was `FormField`) or compose `LabelText` + a control directly. */\nexport interface LabeledFieldProps {\n /** The label text. Fill the `label` slot instead for richer content. */\n readonly label?: string | number;\n\n /** The optional inline-end label (e.g. \"Optional\"). Fill the `trailing` slot for richer content. */\n readonly trailing?: string | number;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { useId } from '../../../foundation/identifiers';\nimport LabelText from '../../display/labelText/LabelText.vue';\n\n/**\n * Renders a `LabelText` above its control with no helper, error or context wiring — for compact inline forms.\n *\n * @deprecated Prefer `Field` (was `FormField`) for label + control + helper/error,\n * or compose `LabelText` + a control directly. Kept for one release.\n */\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\ndefineOptions({ name: 'LabeledField', inheritAttrs: false });\n\nconst props = defineProps<LabeledFieldProps>();\n\n/*\n * React reached into `children.props.id` and re-cloned the element with a generated id.\n * Vue has no vnode-prop read at that point, so the default slot is SCOPED instead: the\n * generated id is handed to the consumer, who binds it on their control.\n */\ndefineSlots<{\n default(props: { id: string }): unknown;\n label?(): unknown;\n trailing?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\n\nconst generatedId = useId();\n\nconst hasTrailing = computed(() => Boolean(props.trailing) || Boolean(slots.trailing));\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() => cn('flex flex-col
|
|
1
|
+
{"version":3,"file":"LabeledField.vue.js","sources":["../../../../src/presentation/forms/labeledField/LabeledField.vue"],"sourcesContent":["<script lang=\"ts\">\n/** @deprecated Prefer `Field` (was `FormField`) or compose `LabelText` + a control directly. */\nexport interface LabeledFieldProps {\n /** The label text. Fill the `label` slot instead for richer content. */\n readonly label?: string | number;\n\n /** The optional inline-end label (e.g. \"Optional\"). Fill the `trailing` slot for richer content. */\n readonly trailing?: string | number;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { useId } from '../../../foundation/identifiers';\nimport LabelText from '../../display/labelText/LabelText.vue';\n\n/**\n * Renders a `LabelText` above its control with no helper, error or context wiring — for compact inline forms.\n *\n * @deprecated Prefer `Field` (was `FormField`) for label + control + helper/error,\n * or compose `LabelText` + a control directly. Kept for one release.\n */\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\ndefineOptions({ name: 'LabeledField', inheritAttrs: false });\n\nconst props = defineProps<LabeledFieldProps>();\n\n/*\n * React reached into `children.props.id` and re-cloned the element with a generated id.\n * Vue has no vnode-prop read at that point, so the default slot is SCOPED instead: the\n * generated id is handed to the consumer, who binds it on their control.\n */\ndefineSlots<{\n default(props: { id: string }): unknown;\n label?(): unknown;\n trailing?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\n\nconst generatedId = useId();\n\nconst hasTrailing = computed(() => Boolean(props.trailing) || Boolean(slots.trailing));\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\n/* Margin, not a flex `gap`, as in `Field`: an element a password manager inserts beside the input opens no gap. */\nconst rootClass = computed(() => cn('flex flex-col', attrs.class as ClassValue));\n\nconst root = useTemplateRef<HTMLDivElement>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <div ref=\"root\" :class=\"rootClass\" v-bind=\"passthroughAttrs\">\n <div class=\"mb-1.5 flex items-center justify-between\">\n <LabelText :for=\"generatedId\">\n <slot name=\"label\">{{ label }}</slot>\n </LabelText>\n <span v-if=\"hasTrailing\" class=\"text-xs text-muted-foreground\">\n <slot name=\"trailing\">{{ trailing }}</slot>\n </span>\n </div>\n <slot :id=\"generatedId\" />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_createVNode","LabelText","_unref","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,UAAM,QAAQ;AAad,UAAM,QAAQ,SAAA;AACd,UAAM,QAAQ,SAAA;AAEd,UAAM,cAAc,MAAA;AAEpB,UAAM,cAAc,SAAS,MAAM,QAAQ,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ,CAAC;AAErF,UAAM,kBAAuC,oBAAI,IAAI,CAAC,OAAO,CAAC;AAC9D,UAAM,mBAAmB;AAAA,MAAS,MAChC,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,gBAAgB,IAAI,GAAG,CAAC,CAAC;AAAA,IAAA;AAIvF,UAAM,YAAY,SAAS,MAAM,GAAG,iBAAiB,MAAM,KAAmB,CAAC;AAE/E,UAAM,OAAO,eAA+B,MAAM;AAGlD,aAAa,EAAE,IAAI,MAAM;;AAIvB,aAAAA,UAAA,GAAAC,mBAUM,OAVNC,WAUM;AAAA,iBAVG;AAAA,QAAJ,KAAI;AAAA,QAAQ,OAAO,UAAA;AAAA,MAAA,GAAmB,iBAAA,KAAgB,GAAA;AAAA,QACzDC,mBAOM,OAPN,YAOM;AAAA,UANJC,YAEYC,aAAA,EAFA,KAAKC,MAAA,WAAA,KAAW;AAAA,6BAC1B,MAAqC;AAAA,cAArCC,WAAqC,0BAArC,MAAqC;AAAA,gDAAf,QAAA,KAAK,GAAA,CAAA;AAAA,cAAA;;;;UAEjB,YAAA,SAAZP,UAAA,GAAAC,mBAEO,QAFP,YAEO;AAAA,YADLM,WAA2C,6BAA3C,MAA2C;AAAA,8CAAlB,QAAA,QAAQ,GAAA,CAAA;AAAA,YAAA;;;QAGrCA,WAA0B,KAAA,QAAA,WAAA,EAAnB,IAAID,MAAA,WAAA,EAAA,CAAW;AAAA,MAAA;;;;"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { NativeInputAttributes } from '../NativeControlAttributes';
|
|
2
|
-
/** Represents one selectable dialling country. */
|
|
3
|
-
export interface PhoneCountry {
|
|
4
|
-
iso: string;
|
|
5
|
-
name: string;
|
|
6
|
-
dial: string;
|
|
7
|
-
flag: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const PhoneCountries: ReadonlyArray<PhoneCountry>;
|
|
10
2
|
export interface PhoneInputProps extends /* @vue-ignore */ NativeInputAttributes {
|
|
11
3
|
/** The E.164 value, controlled. The `v-model` binding target. */
|
|
12
4
|
readonly modelValue?: string;
|
|
@@ -22,14 +14,18 @@ export interface PhoneInputProps extends /* @vue-ignore */ NativeInputAttributes
|
|
|
22
14
|
readonly isReadOnly?: boolean;
|
|
23
15
|
/** The invalid surface override. Falls back to the surrounding form control's `isInvalid`. */
|
|
24
16
|
readonly isInvalid?: boolean;
|
|
25
|
-
/** The national-number placeholder. */
|
|
17
|
+
/** The national-number placeholder. Default the country's mask with zeros (`00-000-00-00`), none without a mask. */
|
|
26
18
|
readonly placeholder?: string;
|
|
27
19
|
/** The hidden input name; the hidden input emits the full E.164 value. */
|
|
28
20
|
readonly name?: string;
|
|
29
21
|
}
|
|
30
22
|
declare const _default: import('vue').DefineComponent<PhoneInputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
|
+
blur: (event: FocusEvent) => any;
|
|
24
|
+
focus: (event: FocusEvent) => any;
|
|
31
25
|
"update:modelValue": (e164: string) => any;
|
|
32
26
|
}, string, import('vue').PublicProps, Readonly<PhoneInputProps> & Readonly<{
|
|
27
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
28
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
33
29
|
"onUpdate:modelValue"?: ((e164: string) => any) | undefined;
|
|
34
30
|
}>, {
|
|
35
31
|
readonly placeholder: string;
|