@tectra-ng/utils 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/tectra-ng-utils-clipboard.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-clock.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-currency.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-date.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-file.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-filter-state.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-filter.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-form-changes.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-form-validation.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-http.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-in-view.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-polling.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-selection.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-text.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-title.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-validators.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils.mjs +1 -1
- package/fesm2022/tectra-ng-utils.mjs.map +1 -1
- package/package.json +5 -5
- package/types/tectra-ng-utils-auto-focus.d.ts +7 -0
- package/types/tectra-ng-utils-auto-focus.d.ts.map +1 -1
- package/types/tectra-ng-utils-breakpoint.d.ts +15 -0
- package/types/tectra-ng-utils-breakpoint.d.ts.map +1 -1
- package/types/tectra-ng-utils-clipboard.d.ts +19 -0
- package/types/tectra-ng-utils-clipboard.d.ts.map +1 -1
- package/types/tectra-ng-utils-clock.d.ts +11 -0
- package/types/tectra-ng-utils-clock.d.ts.map +1 -1
- package/types/tectra-ng-utils-currency.d.ts +9 -0
- package/types/tectra-ng-utils-currency.d.ts.map +1 -1
- package/types/tectra-ng-utils-date.d.ts +96 -0
- package/types/tectra-ng-utils-date.d.ts.map +1 -1
- package/types/tectra-ng-utils-debounce-input.d.ts +11 -0
- package/types/tectra-ng-utils-debounce-input.d.ts.map +1 -1
- package/types/tectra-ng-utils-drag-scroll.d.ts +13 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts.map +1 -1
- package/types/tectra-ng-utils-file.d.ts +21 -0
- package/types/tectra-ng-utils-file.d.ts.map +1 -1
- package/types/tectra-ng-utils-filter-state.d.ts +58 -0
- package/types/tectra-ng-utils-filter-state.d.ts.map +1 -1
- package/types/tectra-ng-utils-filter.d.ts +29 -0
- package/types/tectra-ng-utils-filter.d.ts.map +1 -1
- package/types/tectra-ng-utils-form-changes.d.ts +18 -0
- package/types/tectra-ng-utils-form-changes.d.ts.map +1 -1
- package/types/tectra-ng-utils-form-validation.d.ts +26 -0
- package/types/tectra-ng-utils-form-validation.d.ts.map +1 -1
- package/types/tectra-ng-utils-go-back.d.ts +8 -0
- package/types/tectra-ng-utils-go-back.d.ts.map +1 -1
- package/types/tectra-ng-utils-http.d.ts +72 -0
- package/types/tectra-ng-utils-http.d.ts.map +1 -1
- package/types/tectra-ng-utils-in-view.d.ts +19 -0
- package/types/tectra-ng-utils-in-view.d.ts.map +1 -1
- package/types/tectra-ng-utils-plural.d.ts +23 -0
- package/types/tectra-ng-utils-plural.d.ts.map +1 -1
- package/types/tectra-ng-utils-polling.d.ts +69 -0
- package/types/tectra-ng-utils-polling.d.ts.map +1 -1
- package/types/tectra-ng-utils-random.d.ts +12 -0
- package/types/tectra-ng-utils-random.d.ts.map +1 -1
- package/types/tectra-ng-utils-relative-time.d.ts +16 -0
- package/types/tectra-ng-utils-relative-time.d.ts.map +1 -1
- package/types/tectra-ng-utils-scroll-end.d.ts +10 -0
- package/types/tectra-ng-utils-scroll-end.d.ts.map +1 -1
- package/types/tectra-ng-utils-selection.d.ts +16 -0
- package/types/tectra-ng-utils-selection.d.ts.map +1 -1
- package/types/tectra-ng-utils-stop-propagation.d.ts +6 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts.map +1 -1
- package/types/tectra-ng-utils-stream.d.ts +8 -0
- package/types/tectra-ng-utils-stream.d.ts.map +1 -1
- package/types/tectra-ng-utils-style-class.d.ts +17 -0
- package/types/tectra-ng-utils-style-class.d.ts.map +1 -1
- package/types/tectra-ng-utils-text.d.ts +41 -0
- package/types/tectra-ng-utils-text.d.ts.map +1 -1
- package/types/tectra-ng-utils-title.d.ts +14 -0
- package/types/tectra-ng-utils-title.d.ts.map +1 -1
- package/types/tectra-ng-utils-validators.d.ts +61 -0
- package/types/tectra-ng-utils-validators.d.ts.map +1 -1
- package/types/tectra-ng-utils.d.ts +2 -1
- package/types/tectra-ng-utils.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-validators.mjs","names":[],"sources":["../../../../packages/utils/validators/src/validators.ts"],"sourcesContent":["import { AbstractControl, FormArray, ValidationErrors, ValidatorFn } from '@angular/forms';\nimport { TxCssSelectorValidatorOptions, TxDuplicateValidatorOptions, TxIpValidatorOptions, TxStrongPasswordOptions, TxUrlValidatorOptions } from './validators.types';\n\nexport const TX_DOMAIN_PATTERN =\n '^\\\\s*([a-zA-Z\\\\u0400-\\\\u04FF0-9]{1,63}(-+[a-zA-Z\\\\u0400-\\\\u04FF0-9]{1,63})*\\\\.)+(xn--[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,57}[a-zA-Z0-9])?|[a-zA-Z\\\\u0400-\\\\u04FF]{2,63})\\\\.?\\\\s*$';\n\nconst DOMAIN = new RegExp(TX_DOMAIN_PATTERN);\nconst PRICE = /^\\d{1,12}([.,]\\d{1,2})?$/;\nconst TIME_24 = /^([01]\\d|2[0-3]):([0-5]\\d)$/;\nconst ISO_DATE = /^\\d{4}-\\d{1,2}-\\d{1,2}$/;\nconst IPV4_PART = '(?:25[0-5]|2[0-4]\\\\d|1\\\\d{2}|[1-9]?\\\\d)';\nconst IPV4 = new RegExp(`^(?:${IPV4_PART}\\\\.){3}${IPV4_PART}$`);\nconst IPV4_CIDR = new RegExp(`^(?:${IPV4_PART}\\\\.){3}${IPV4_PART}(?:\\\\/(?:[0-9]|[12][0-9]|3[0-2]))?$`);\nconst IPV6_CHARS = /^[0-9a-fA-F:.]+$/;\nconst CONTROL_CHAR_MAX_CODE = 31;\nconst DELETE_CHAR_CODE = 127;\nconst UNSAFE_CHARS = ['<', '>'];\n\nconst isEmpty = (value: unknown): boolean => value === null || value === undefined || (typeof value === 'string' && value.trim() === '') || (Array.isArray(value) && value.length === 0);\n\nconst text = (value: unknown): string => (value ?? '').toString().trim();\n\nfunction isIpv6(value: string): boolean {\n if (!value.includes(':') || !IPV6_CHARS.test(value)) {\n return false;\n }\n try {\n return !!new URL(`http://[${value}]`).hostname;\n } catch {\n return false;\n }\n}\n\nexport function parsePrice(value: unknown): number | null {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : null;\n }\n if (typeof value !== 'string' || !PRICE.test(value.trim())) {\n return null;\n }\n return Number(value.trim().replace(',', '.'));\n}\n\nfunction numericCode(length = 6): ValidatorFn {\n const pattern = new RegExp(`^\\\\d{${length}}$`);\n return (control) => (isEmpty(control.value) || pattern.test(String(control.value)) ? null : { invalidCodeFormat: { length } });\n}\n\nfunction isoDate(): ValidatorFn {\n return (control) => {\n const value = control.value;\n if (isEmpty(value)) {\n return null;\n }\n if (typeof value === 'string' && ISO_DATE.test(value)) {\n const [year, month, day] = value.split('-').map(Number);\n const date = new Date(Date.UTC(year, month - 1, day));\n if (date.getUTCFullYear() === year && date.getUTCMonth() + 1 === month && date.getUTCDate() === day) {\n return null;\n }\n }\n return { invalidDate: true };\n };\n}\n\nfunction futureDate(): ValidatorFn {\n return (control) => {\n if (isEmpty(control.value)) {\n return null;\n }\n const now = new Date();\n now.setSeconds(0, 0);\n const value = new Date(control.value);\n if (Number.isNaN(value.getTime())) {\n return { invalidDate: true };\n }\n value.setSeconds(0, 0);\n return value < now ? { pastDate: true } : null;\n };\n}\n\nfunction url(options: TxUrlValidatorOptions = {}): ValidatorFn {\n const { https = true, host } = options;\n return (control) => {\n const value = text(control.value);\n if (!value) {\n return null;\n }\n try {\n const parsed = new URL(value);\n const protocolOk = https ? parsed.protocol === 'https:' : parsed.protocol === 'https:' || parsed.protocol === 'http:';\n const hostOk = !host || (typeof host === 'string' ? parsed.hostname === host || parsed.hostname.endsWith(`.${host}`) : host.test(parsed.hostname));\n return protocolOk && hostOk && !/\\s/.test(value) ? null : { invalidUrl: true };\n } catch {\n return { invalidUrl: true };\n }\n };\n}\n\nfunction strongPassword(options: TxStrongPasswordOptions = {}): ValidatorFn {\n const { minLength = 6, upper = true, lower = true, digit = false, symbol = true } = options;\n return (control) => {\n const value = control.value;\n if (isEmpty(value)) {\n return null;\n }\n const password = String(value);\n const missing = [\n password.length < minLength && 'length',\n upper && !/\\p{Lu}/u.test(password) && 'upper',\n lower && !/\\p{Ll}/u.test(password) && 'lower',\n digit && !/\\p{N}/u.test(password) && 'digit',\n symbol && !/[^\\p{L}\\p{N}\\s]/u.test(password) && 'symbol',\n ].filter((item): item is string => !!item);\n return missing.length ? { weakPassword: { minLength, missing } } : null;\n };\n}\n\nfunction matchFields(field: string, confirmField: string, errorKey = 'mismatch'): ValidatorFn {\n return (group) => {\n const confirm = group.get(confirmField);\n if (!confirm) {\n return null;\n }\n const mismatch = !isEmpty(confirm.value) && group.get(field)?.value !== confirm.value;\n const { [errorKey]: current, ...others } = confirm.errors ?? {};\n if (mismatch && !current) {\n confirm.setErrors({ ...others, [errorKey]: true });\n }\n if (!mismatch && current) {\n confirm.setErrors(Object.keys(others).length ? others : null);\n }\n return mismatch ? { [errorKey]: true } : null;\n };\n}\n\nfunction distinctFields(first: string, second: string): ValidatorFn {\n return (group) => {\n const left = group.get(first);\n const right = group.get(second);\n if (!left?.enabled || !right?.enabled || isEmpty(left.value)) {\n return null;\n }\n return left.value === right.value ? { distinctControls: true } : null;\n };\n}\n\nfunction ip(options: TxIpValidatorOptions = {}): ValidatorFn {\n const pattern = options.cidr ? IPV4_CIDR : IPV4;\n return (control) => {\n const value = text(control.value);\n if (!value || pattern.test(value) || (options.ipv6 && isIpv6(value.split('/')[0]))) {\n return null;\n }\n return { invalidIp: { value } };\n };\n}\n\nfunction domain(): ValidatorFn {\n return (control) => (isEmpty(control.value) || DOMAIN.test(String(control.value)) ? null : { invalidDomain: true });\n}\n\nfunction duplicate(taken: readonly string[] | (() => readonly string[]), options: TxDuplicateValidatorOptions = {}): ValidatorFn {\n const { message, caseSensitive = false, trim = true } = options;\n const normalize = (raw: unknown): string => {\n let value = (raw ?? '').toString();\n value = trim ? value.trim() : value;\n return caseSensitive ? value : value.toLowerCase();\n };\n return (control) => {\n const value = normalize(control.value);\n const list = typeof taken === 'function' ? taken() : taken;\n if (!value || !list.some((item) => normalize(item) === value)) {\n return null;\n }\n const resolved = typeof message === 'function' ? message() : message;\n return { duplicate: resolved ? { message: resolved } : true };\n };\n}\n\nfunction time24(): ValidatorFn {\n return (control) => (isEmpty(control.value) || TIME_24.test(String(control.value)) ? null : { invalidTime: true });\n}\n\nfunction noUnsafeChars(): ValidatorFn {\n return (control) => {\n const value = control.value;\n if (typeof value !== 'string' || !value) {\n return null;\n }\n for (const char of value) {\n const code = char.charCodeAt(0);\n if (code <= CONTROL_CHAR_MAX_CODE || code === DELETE_CHAR_CODE || UNSAFE_CHARS.includes(char)) {\n return { pattern: true };\n }\n }\n return null;\n };\n}\n\nfunction jsonObject(): ValidatorFn {\n return (control) => {\n const value = text(control.value);\n if (!value) {\n return null;\n }\n try {\n const parsed: unknown = JSON.parse(value);\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? null : { invalidJson: true };\n } catch {\n return { invalidJson: true };\n }\n };\n}\n\nfunction exactValue(expected: string, message?: string): ValidatorFn {\n return (control) => {\n const value = text(control.value);\n if (!value || value === expected) {\n return null;\n }\n return { valueMismatch: message ? { message } : { expected } };\n };\n}\n\nfunction cssSelector(options: TxCssSelectorValidatorOptions = {}): ValidatorFn {\n const { allowClass = true, allowId = true } = options;\n const prefixes = `${allowClass ? '.' : ''}${allowId ? '#' : ''}`;\n const requiredPattern = `^[${prefixes}][a-zA-Z_][a-zA-Z0-9_-]*$`;\n const pattern = new RegExp(requiredPattern);\n return (control) => {\n const value = text(control.value);\n if (!value || (prefixes && pattern.test(value))) {\n return null;\n }\n return { pattern: { requiredPattern, actualValue: value } };\n };\n}\n\nfunction requiredWhen(field: string, isRequired: (value: unknown) => boolean = Boolean): ValidatorFn {\n return (control) => {\n const sibling = control.parent?.get(field);\n if (!sibling || !isRequired(sibling.value)) {\n return null;\n }\n return isEmpty(control.value) ? { required: true } : null;\n };\n}\n\nfunction arraySumMax(field: string, max: number): ValidatorFn {\n return (control) => {\n if (!(control instanceof FormArray)) {\n return null;\n }\n const total = control.controls.reduce((sum, item: AbstractControl) => sum + (Number(item.value?.[field]) || 0), 0);\n return total > max ? { sumExceeded: { max, total } } : null;\n };\n}\n\nfunction price(): ValidatorFn {\n return (control): ValidationErrors | null => {\n if (isEmpty(control.value)) {\n return null;\n }\n const parsed = parsePrice(control.value);\n if (parsed === null) {\n return { priceFormat: true };\n }\n return parsed <= 0 ? { pricePositive: true } : null;\n };\n}\n\nexport const TxValidators = {\n numericCode,\n isoDate,\n futureDate,\n url,\n strongPassword,\n matchFields,\n distinctFields,\n ip,\n domain,\n duplicate,\n time24,\n noUnsafeChars,\n jsonObject,\n exactValue,\n cssSelector,\n requiredWhen,\n arraySumMax,\n price,\n} as const;\n"],"mappings":";AAGA,MAAa,oBACX;AAEF,MAAM,SAAS,IAAI,OAAO,iBAAiB;AAC3C,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,OAAO,IAAI,OAAO,OAAO,UAAS,SAAU,UAAS,EAAG;AAC9D,MAAM,YAAY,IAAI,OAAO,OAAO,UAAS,SAAU,UAAS,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I,CAAC,WAAW,CAAC,WAAW,QAAQ,KAAK,GACvC,OAAO;EAET,OAAO,QAAQ,QAAQ,KAAK,IAAI,EAAE,UAAU,KAAI,IAAK;CACvD;AACF;AAEA,SAAS,YAAY,OAAe,KAAW;CAC7C,QAAQ,YAAW;EACjB,IAAI,EAAE,mBAAmB,YACvB,OAAO;EAET,MAAM,QAAQ,QAAQ,SAAS,QAAQ,KAAK,SAA0B,OAAO,OAAO,KAAK,QAAQ,MAAM,KAAK,IAAI,CAAC;EACjH,OAAO,QAAQ,MAAM,EAAE,aAAa;GAAE;GAAK;EAAK,EAAE,IAAK;CACzD;AACF;AAEA,SAAS,QAAK;CACZ,QAAQ,YAAoC;EAC1C,IAAI,QAAQ,QAAQ,KAAK,GACvB,OAAO;EAET,MAAM,SAAS,WAAW,QAAQ,KAAK;EACvC,IAAI,WAAW,MACb,OAAO,EAAE,aAAa,KAAI;EAE5B,OAAO,UAAU,IAAI,EAAE,eAAe,KAAI,IAAK;CACjD;AACF;AAEA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACQ"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-validators.mjs","names":[],"sources":["../../../../packages/utils/validators/src/validators.ts"],"sourcesContent":["import { AbstractControl, FormArray, ValidationErrors, ValidatorFn } from '@angular/forms';\nimport { TxCssSelectorValidatorOptions, TxDuplicateValidatorOptions, TxIpValidatorOptions, TxStrongPasswordOptions, TxUrlValidatorOptions } from './validators.types';\n\nexport const TX_DOMAIN_PATTERN =\n '^\\\\s*([a-zA-Z\\\\u0400-\\\\u04FF0-9]{1,63}(-+[a-zA-Z\\\\u0400-\\\\u04FF0-9]{1,63})*\\\\.)+(xn--[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,57}[a-zA-Z0-9])?|[a-zA-Z\\\\u0400-\\\\u04FF]{2,63})\\\\.?\\\\s*$';\n\nconst DOMAIN = new RegExp(TX_DOMAIN_PATTERN);\nconst PRICE = /^\\d{1,12}([.,]\\d{1,2})?$/;\nconst TIME_24 = /^([01]\\d|2[0-3]):([0-5]\\d)$/;\nconst ISO_DATE = /^\\d{4}-\\d{1,2}-\\d{1,2}$/;\nconst IPV4_PART = '(?:25[0-5]|2[0-4]\\\\d|1\\\\d{2}|[1-9]?\\\\d)';\nconst IPV4 = new RegExp(`^(?:${IPV4_PART}\\\\.){3}${IPV4_PART}$`);\nconst IPV4_CIDR = new RegExp(`^(?:${IPV4_PART}\\\\.){3}${IPV4_PART}(?:\\\\/(?:[0-9]|[12][0-9]|3[0-2]))?$`);\nconst IPV6_CHARS = /^[0-9a-fA-F:.]+$/;\nconst CONTROL_CHAR_MAX_CODE = 31;\nconst DELETE_CHAR_CODE = 127;\nconst UNSAFE_CHARS = ['<', '>'];\n\nconst isEmpty = (value: unknown): boolean => value === null || value === undefined || (typeof value === 'string' && value.trim() === '') || (Array.isArray(value) && value.length === 0);\n\nconst text = (value: unknown): string => (value ?? '').toString().trim();\n\nfunction isIpv6(value: string): boolean {\n if (!value.includes(':') || !IPV6_CHARS.test(value)) {\n return false;\n }\n try {\n return !!new URL(`http://[${value}]`).hostname;\n } catch {\n return false;\n }\n}\n\nexport function parsePrice(value: unknown): number | null {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : null;\n }\n if (typeof value !== 'string' || !PRICE.test(value.trim())) {\n return null;\n }\n return Number(value.trim().replace(',', '.'));\n}\n\n/** A fixed number of digits, such as a code from a message (default 6); error `invalidCodeFormat`. */\nfunction numericCode(length = 6): ValidatorFn {\n const pattern = new RegExp(`^\\\\d{${length}}$`);\n return (control) => (isEmpty(control.value) || pattern.test(String(control.value)) ? null : { invalidCodeFormat: { length } });\n}\n\n/** A real calendar date as `YYYY-MM-DD`; error `invalidDate`. */\nfunction isoDate(): ValidatorFn {\n return (control) => {\n const value = control.value;\n if (isEmpty(value)) {\n return null;\n }\n if (typeof value === 'string' && ISO_DATE.test(value)) {\n const [year, month, day] = value.split('-').map(Number);\n const date = new Date(Date.UTC(year, month - 1, day));\n if (date.getUTCFullYear() === year && date.getUTCMonth() + 1 === month && date.getUTCDate() === day) {\n return null;\n }\n }\n return { invalidDate: true };\n };\n}\n\n/** A date and time not in the past, compared to the minute; errors `invalidDate`, `pastDate`. */\nfunction futureDate(): ValidatorFn {\n return (control) => {\n if (isEmpty(control.value)) {\n return null;\n }\n const now = new Date();\n now.setSeconds(0, 0);\n const value = new Date(control.value);\n if (Number.isNaN(value.getTime())) {\n return { invalidDate: true };\n }\n value.setSeconds(0, 0);\n return value < now ? { pastDate: true } : null;\n };\n}\n\n/**\n * A web address with no spaces; `https` only unless `https: false`, optionally for one host or its\n * subdomains; error `invalidUrl`.\n */\nfunction url(options: TxUrlValidatorOptions = {}): ValidatorFn {\n const { https = true, host } = options;\n return (control) => {\n const value = text(control.value);\n if (!value) {\n return null;\n }\n try {\n const parsed = new URL(value);\n const protocolOk = https ? parsed.protocol === 'https:' : parsed.protocol === 'https:' || parsed.protocol === 'http:';\n const hostOk = !host || (typeof host === 'string' ? parsed.hostname === host || parsed.hostname.endsWith(`.${host}`) : host.test(parsed.hostname));\n return protocolOk && hostOk && !/\\s/.test(value) ? null : { invalidUrl: true };\n } catch {\n return { invalidUrl: true };\n }\n };\n}\n\n/**\n * Checks the password length and the kinds of characters it needs; error `weakPassword` lists what is\n * missing.\n */\nfunction strongPassword(options: TxStrongPasswordOptions = {}): ValidatorFn {\n const { minLength = 6, upper = true, lower = true, digit = false, symbol = true } = options;\n return (control) => {\n const value = control.value;\n if (isEmpty(value)) {\n return null;\n }\n const password = String(value);\n const missing = [\n password.length < minLength && 'length',\n upper && !/\\p{Lu}/u.test(password) && 'upper',\n lower && !/\\p{Ll}/u.test(password) && 'lower',\n digit && !/\\p{N}/u.test(password) && 'digit',\n symbol && !/[^\\p{L}\\p{N}\\s]/u.test(password) && 'symbol',\n ].filter((item): item is string => !!item);\n return missing.length ? { weakPassword: { minLength, missing } } : null;\n };\n}\n\n/**\n * For a group: the confirm field must equal another field; sets the error on the confirm field too\n * (default key `mismatch`).\n */\nfunction matchFields(field: string, confirmField: string, errorKey = 'mismatch'): ValidatorFn {\n return (group) => {\n const confirm = group.get(confirmField);\n if (!confirm) {\n return null;\n }\n const mismatch = !isEmpty(confirm.value) && group.get(field)?.value !== confirm.value;\n const { [errorKey]: current, ...others } = confirm.errors ?? {};\n if (mismatch && !current) {\n confirm.setErrors({ ...others, [errorKey]: true });\n }\n if (!mismatch && current) {\n confirm.setErrors(Object.keys(others).length ? others : null);\n }\n return mismatch ? { [errorKey]: true } : null;\n };\n}\n\n/** For a group: two enabled fields must differ; error `distinctControls`. */\nfunction distinctFields(first: string, second: string): ValidatorFn {\n return (group) => {\n const left = group.get(first);\n const right = group.get(second);\n if (!left?.enabled || !right?.enabled || isEmpty(left.value)) {\n return null;\n }\n return left.value === right.value ? { distinctControls: true } : null;\n };\n}\n\n/** An IPv4 address, optionally with a CIDR suffix or as IPv6; error `invalidIp`. */\nfunction ip(options: TxIpValidatorOptions = {}): ValidatorFn {\n const pattern = options.cidr ? IPV4_CIDR : IPV4;\n return (control) => {\n const value = text(control.value);\n if (!value || pattern.test(value) || (options.ipv6 && isIpv6(value.split('/')[0]))) {\n return null;\n }\n return { invalidIp: { value } };\n };\n}\n\n/** A domain name such as `example.com`; error `invalidDomain`. */\nfunction domain(): ValidatorFn {\n return (control) => (isEmpty(control.value) || DOMAIN.test(String(control.value)) ? null : { invalidDomain: true });\n}\n\n/** The value must not be in the list of taken values, which can be a function; error `duplicate`. */\nfunction duplicate(taken: readonly string[] | (() => readonly string[]), options: TxDuplicateValidatorOptions = {}): ValidatorFn {\n const { message, caseSensitive = false, trim = true } = options;\n const normalize = (raw: unknown): string => {\n let value = (raw ?? '').toString();\n value = trim ? value.trim() : value;\n return caseSensitive ? value : value.toLowerCase();\n };\n return (control) => {\n const value = normalize(control.value);\n const list = typeof taken === 'function' ? taken() : taken;\n if (!value || !list.some((item) => normalize(item) === value)) {\n return null;\n }\n const resolved = typeof message === 'function' ? message() : message;\n return { duplicate: resolved ? { message: resolved } : true };\n };\n}\n\n/** A time as `HH:mm` on the 24-hour clock; error `invalidTime`. */\nfunction time24(): ValidatorFn {\n return (control) => (isEmpty(control.value) || TIME_24.test(String(control.value)) ? null : { invalidTime: true });\n}\n\n/** Rejects control characters and the angle brackets `<` and `>`; error `pattern`. */\nfunction noUnsafeChars(): ValidatorFn {\n return (control) => {\n const value = control.value;\n if (typeof value !== 'string' || !value) {\n return null;\n }\n for (const char of value) {\n const code = char.charCodeAt(0);\n if (code <= CONTROL_CHAR_MAX_CODE || code === DELETE_CHAR_CODE || UNSAFE_CHARS.includes(char)) {\n return { pattern: true };\n }\n }\n return null;\n };\n}\n\n/** A JSON text whose value is an object, not an array or a primitive; error `invalidJson`. */\nfunction jsonObject(): ValidatorFn {\n return (control) => {\n const value = text(control.value);\n if (!value) {\n return null;\n }\n try {\n const parsed: unknown = JSON.parse(value);\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? null : { invalidJson: true };\n } catch {\n return { invalidJson: true };\n }\n };\n}\n\n/** The value must equal the expected text, as in a delete confirmation; error `valueMismatch`. */\nfunction exactValue(expected: string, message?: string): ValidatorFn {\n return (control) => {\n const value = text(control.value);\n if (!value || value === expected) {\n return null;\n }\n return { valueMismatch: message ? { message } : { expected } };\n };\n}\n\n/** A simple class or id selector such as `.title` or `#main`; error `pattern`. */\nfunction cssSelector(options: TxCssSelectorValidatorOptions = {}): ValidatorFn {\n const { allowClass = true, allowId = true } = options;\n const prefixes = `${allowClass ? '.' : ''}${allowId ? '#' : ''}`;\n const requiredPattern = `^[${prefixes}][a-zA-Z_][a-zA-Z0-9_-]*$`;\n const pattern = new RegExp(requiredPattern);\n return (control) => {\n const value = text(control.value);\n if (!value || (prefixes && pattern.test(value))) {\n return null;\n }\n return { pattern: { requiredPattern, actualValue: value } };\n };\n}\n\n/**\n * The control is required while a sibling control's value passes the check (default: it is truthy);\n * error `required`.\n */\nfunction requiredWhen(field: string, isRequired: (value: unknown) => boolean = Boolean): ValidatorFn {\n return (control) => {\n const sibling = control.parent?.get(field);\n if (!sibling || !isRequired(sibling.value)) {\n return null;\n }\n return isEmpty(control.value) ? { required: true } : null;\n };\n}\n\n/** For a form array: the sum of one field over its items must not exceed a maximum; error `sumExceeded`. */\nfunction arraySumMax(field: string, max: number): ValidatorFn {\n return (control) => {\n if (!(control instanceof FormArray)) {\n return null;\n }\n const total = control.controls.reduce((sum, item: AbstractControl) => sum + (Number(item.value?.[field]) || 0), 0);\n return total > max ? { sumExceeded: { max, total } } : null;\n };\n}\n\n/** A positive number with a point or comma as the decimal sign; errors `priceFormat`, `pricePositive`. */\nfunction price(): ValidatorFn {\n return (control): ValidationErrors | null => {\n if (isEmpty(control.value)) {\n return null;\n }\n const parsed = parsePrice(control.value);\n if (parsed === null) {\n return { priceFormat: true };\n }\n return parsed <= 0 ? { pricePositive: true } : null;\n };\n}\n\nexport const TxValidators = {\n numericCode,\n isoDate,\n futureDate,\n url,\n strongPassword,\n matchFields,\n distinctFields,\n ip,\n domain,\n duplicate,\n time24,\n noUnsafeChars,\n jsonObject,\n exactValue,\n cssSelector,\n requiredWhen,\n arraySumMax,\n price,\n} as const;\n"],"mappings":";AAGA,MAAa,oBACX;AAEF,MAAM,SAAS,IAAI,OAAO,iBAAiB;AAC3C,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,OAAO,IAAI,OAAO,OAAO,UAAS,SAAU,UAAS,EAAG;AAC9D,MAAM,YAAY,IAAI,OAAO,OAAO,UAAS,SAAU,UAAS,oCAAqC;AACrG,MAAM,aAAa;AACnB,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AACzB,MAAM,eAAe,CAAC,KAAK,GAAG;AAE9B,MAAM,WAAW,UAA4B,UAAU,QAAQ,UAAU,UAAc,OAAO,UAAU,YAAY,MAAM,KAAI,MAAO,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mBAAmB,YACvB,OAAO;EAET,MAAM,QAAQ,QAAQ,SAAS,QAAQ,KAAK,SAA0B,OAAO,OAAO,KAAK,QAAQ,MAAM,KAAK,IAAI,CAAC;EACjH,OAAO,QAAQ,MAAM,EAAE,aAAa;GAAE;GAAK;EAAK,EAAE,IAAK;CACzD;AACF;AAGA,SAAS,QAAK;CACZ,QAAQ,YAAoC;EAC1C,IAAI,QAAQ,QAAQ,KAAK,GACvB,OAAO;EAET,MAAM,SAAS,WAAW,QAAQ,KAAK;EACvC,IAAI,WAAW,MACb,OAAO,EAAE,aAAa,KAAI;EAE5B,OAAO,UAAU,IAAI,EAAE,eAAe,KAAI,IAAK;CACjD;AACF;AAEA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils.mjs","names":[],"sources":["../../../../packages/utils/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils.mjs","names":[],"sources":["../../../../packages/utils/index.ts"],"sourcesContent":["/** Version of the installed `@tectra-ng/utils` package, written in when the package is built. */\nexport const TECTRA_UTILS_VERSION = '0.0.0';\n"],"mappings":"AACA,MAAa,uBAAuB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tectra-ng/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Angular utilities on signals next to the tectra components: date, relative time, plural, file size and currency pipes; debounced input, copy to clipboard, in view, defer, drag scroll and auto focus directives; form validators and scroll to the first invalid field; filters kept in storage and the URL; HTTP params, retries and polling; clock, page title and breakpoints. Server rendering safe.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://tectra-ng.com/components/date",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@angular/platform-browser": "^22.2.0",
|
|
35
35
|
"@angular/router": "^22.2.0",
|
|
36
36
|
"rxjs": "^7.8.0",
|
|
37
|
-
"@tectra-ng/core": "^0.
|
|
38
|
-
"@tectra-ng/icons": "^0.
|
|
39
|
-
"@tectra-ng/themes": "^0.
|
|
40
|
-
"@tectra-ng/ui": "^0.
|
|
37
|
+
"@tectra-ng/core": "^0.4.0",
|
|
38
|
+
"@tectra-ng/icons": "^0.4.0",
|
|
39
|
+
"@tectra-ng/themes": "^0.4.0",
|
|
40
|
+
"@tectra-ng/ui": "^0.4.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"@angular/forms": {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Moves the focus to a field once it is rendered — the first field of a dialog, a search box that opens, a code input. Put it on the field or on a wrapper (a kit field, a form section): the first focusable element inside gets the focus. It waits for the dialog's own focus handling, and does nothing on the server.
|
|
4
|
+
* @see https://tectra-ng.com/components/auto-focus
|
|
5
|
+
*/
|
|
2
6
|
export declare class TxAutoFocus {
|
|
3
7
|
private readonly host;
|
|
8
|
+
/** `false` turns it off, e.g. `[txAutoFocus]="!isMobile()"` */
|
|
4
9
|
readonly enabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
10
|
+
/** Also selects the text of an input */
|
|
5
11
|
readonly select: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
6
12
|
constructor();
|
|
13
|
+
/** Focuses again (`exportAs: 'txAutoFocus'`) */
|
|
7
14
|
focus(): void;
|
|
8
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxAutoFocus, never>;
|
|
9
16
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TxAutoFocus, "[txAutoFocus]", ["txAutoFocus"], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-auto-focus.d.ts","names":[],"sources":["../../../../packages/utils/auto-focus/src/auto-focus.directive.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-auto-focus.d.ts","names":[],"sources":["../../../../packages/utils/auto-focus/src/auto-focus.directive.ts"],"mappings":";;;;;qBASa;mBACM;;WAER,iCAAO;;WACP,gCAAM;;;EAaf;SAjBW,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAW;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA"}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* `(max-width: 640px)`, `(max-width: 768px)`
|
|
5
|
+
* @see https://tectra-ng.com/components/breakpoint
|
|
6
|
+
*/
|
|
3
7
|
export declare const TX_BREAKPOINT_MOBILE = "(max-width: 640px)";
|
|
8
|
+
/**
|
|
9
|
+
* `(max-width: 640px)`, `(max-width: 768px)`
|
|
10
|
+
* @see https://tectra-ng.com/components/breakpoint
|
|
11
|
+
*/
|
|
4
12
|
export declare const TX_BREAKPOINT_TABLET = "(max-width: 768px)";
|
|
13
|
+
/**
|
|
14
|
+
* Screen size as signals: `isMobile` (up to 640px) and `isTablet` (up to 768px) — the breakpoints of the kit layouts — and `matches(query)` for any media query. One listener per query for the whole app; `false` on the server.
|
|
15
|
+
* @see https://tectra-ng.com/components/breakpoint
|
|
16
|
+
*/
|
|
5
17
|
export declare class TxBreakpoints {
|
|
6
18
|
private readonly view;
|
|
7
19
|
private readonly destroyRef;
|
|
8
20
|
private readonly queries;
|
|
21
|
+
/** Signal: the viewport is at most 640px wide */
|
|
9
22
|
readonly isMobile: Signal<boolean>;
|
|
23
|
+
/** Signal: the viewport is at most 768px wide */
|
|
10
24
|
readonly isTablet: Signal<boolean>;
|
|
25
|
+
/** Signal of any media query, e.g. `(prefers-reduced-motion: reduce)`; the same signal for the same query */
|
|
11
26
|
matches(query: string): Signal<boolean>;
|
|
12
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxBreakpoints, never>;
|
|
13
28
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-breakpoint.d.ts","names":[],"sources":["../../../../packages/utils/breakpoint/src/breakpoints.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-breakpoint.d.ts","names":[],"sources":["../../../../packages/utils/breakpoint/src/breakpoints.ts"],"mappings":";;;;;;qBAGa;;;;;qBACA;;;;;qBAGA;mBACM;mBACA;mBACA;;WAER,UAAQ;;WACR,UAAQ;;EAEjB,QAAQ,gBAAgB;SARb,MAAA,GAAA,qBAAA"}
|
|
@@ -1,26 +1,45 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
/** Toasts shown after a copy. */
|
|
2
3
|
export interface TxCopyOptions {
|
|
4
|
+
/** Success toast text; `false` shows none (default: the translated "copied" text). */
|
|
3
5
|
message?: string | false;
|
|
6
|
+
/** Error toast text; `false` shows none (default: the translated "copy failed" text). */
|
|
4
7
|
errorMessage?: string | false;
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Copies without a toast; resolves to `true` or `false` (always `false` on the server)
|
|
11
|
+
* @see https://tectra-ng.com/components/clipboard
|
|
12
|
+
*/
|
|
6
13
|
export declare function copyToClipboard(text: string, document?: Document | undefined): Promise<boolean>;
|
|
14
|
+
/** Copies text to the clipboard and tells the user with a kit toast; needs `<tx-toast />` in the app shell. */
|
|
7
15
|
export declare class TxClipboard {
|
|
8
16
|
private readonly document;
|
|
9
17
|
private readonly toast;
|
|
10
18
|
private readonly locale;
|
|
19
|
+
/** The same from code, with the same toasts */
|
|
11
20
|
copy(value: string | number | null | undefined, options?: TxCopyOptions): Promise<boolean>;
|
|
12
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxClipboard, never>;
|
|
13
22
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
14
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Copies a value on click and says so with a kit toast — "Copied to clipboard" in the tectra locale, your own text, or nothing. Works outside a secure context too (falls back to a hidden selection), and turns a plain element into a keyboard-reachable button. Needs a `<tx-toast />` outlet in the app shell for the message.
|
|
26
|
+
* @see https://tectra-ng.com/components/clipboard
|
|
27
|
+
*/
|
|
15
28
|
export declare class TxCopy {
|
|
16
29
|
private readonly clipboard;
|
|
17
30
|
private readonly element;
|
|
31
|
+
/** The value to copy; nothing happens when it is empty */
|
|
18
32
|
readonly value: import("@angular/core").InputSignal<string | number | null | undefined>;
|
|
33
|
+
/** Toast text after copying; translated "Copied to clipboard" by default, `false` for no toast */
|
|
19
34
|
readonly copyMessage: import("@angular/core").InputSignal<string | false | undefined>;
|
|
35
|
+
/** Toast text when the browser refuses; translated "Could not copy" by default, `false` for none */
|
|
20
36
|
readonly copyErrorMessage: import("@angular/core").InputSignal<string | false | undefined>;
|
|
37
|
+
/** The copied text */
|
|
21
38
|
readonly copied: import("@angular/core").OutputEmitterRef<string>;
|
|
39
|
+
/** The text that could not be copied */
|
|
22
40
|
readonly copyFailed: import("@angular/core").OutputEmitterRef<string>;
|
|
23
41
|
protected readonly needsRole: boolean;
|
|
42
|
+
/** Copies now (`exportAs: 'txCopy'`); resolves to `true` when it worked */
|
|
24
43
|
copy(): Promise<boolean>;
|
|
25
44
|
protected onKey(event: Event): void;
|
|
26
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxCopy, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-clipboard.d.ts","names":[],"sources":["../../../../packages/utils/clipboard/src/clipboard.ts","../../../../packages/utils/clipboard/src/copy.directive.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-clipboard.d.ts","names":[],"sources":["../../../../packages/utils/clipboard/src/clipboard.ts","../../../../packages/utils/clipboard/src/copy.directive.ts"],"mappings":";;iBAMiB;;EAEf;;EAEA;;;;;;wBAGoB,gBAAgB,cAAc,WAAU,uBAA6C;;qBAuC9F;mBACM;mBACA;mBACA;;EAEX,KAAK,2CAA2C,UAAS,gBAAqB;SALzE,MAAA,GAAA,qBAAA;;;;;;;qBCjCA;mBACM;mBACA;;WAER,+BAAK;;WACL,qCAAW;;WACX,0CAAgB;;WAEhB,gCAAM;;WACN,oCAAU;qBAEA;;EAEb,QAAQ;YAeJ,MAAM,OAAO;SA5BZ,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAM;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA"}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
3
|
import { TxDateInput } from "@tectra-ng/utils/date";
|
|
4
|
+
/** Signals of a countdown created by `TxClock.countdown`. */
|
|
4
5
|
export interface TxCountdownState {
|
|
6
|
+
/** Milliseconds left until the target, never below 0. */
|
|
5
7
|
remainingMs: Signal<number>;
|
|
8
|
+
/** `true` once the target has passed. */
|
|
6
9
|
isExpired: Signal<boolean>;
|
|
10
|
+
/** `true` while the time left is above 0 and within the `endingSoonMs` of the countdown. */
|
|
7
11
|
isEndingSoon: Signal<boolean>;
|
|
8
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* One shared clock for the app: a `now` signal that ticks every second in the browser (no timer on the server, so prerendering stays fast), countdowns to a date as signals, and a check whether a date is still ahead. Everything that reads `now` updates together — times, countdowns, "5 minutes ago".
|
|
15
|
+
* @see https://tectra-ng.com/components/clock
|
|
16
|
+
*/
|
|
9
17
|
export declare class TxClock {
|
|
10
18
|
private readonly current;
|
|
19
|
+
/** Signal of `Date.now()`, updated every second in the browser */
|
|
11
20
|
readonly now: Signal<number>;
|
|
12
21
|
constructor();
|
|
22
|
+
/** Signals `remainingMs`, `isExpired` (the target passed) and `isEndingSoon` (less than `endingSoonMs` left) for a date or a signal of one */
|
|
13
23
|
countdown(target: Signal<TxDateInput> | TxDateInput, endingSoonMs?: number): TxCountdownState;
|
|
24
|
+
/** The date is later than `now()` */
|
|
14
25
|
isInFuture(value: TxDateInput): boolean;
|
|
15
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxClock, never>;
|
|
16
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-clock.d.ts","names":[],"sources":["../../../../packages/utils/clock/src/clock.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-clock.d.ts","names":[],"sources":["../../../../packages/utils/clock/src/clock.ts"],"mappings":";;;;iBAKiB;;EAEf,aAAa;;EAEb,WAAW;;EAEX,cAAc;;;;;;qBAIH;mBACM;;WAER,KAAG;;;EASZ,UAAU,QAAQ,OAAO,eAAe,aAAa,wBAAmB;;EAaxE,WAAW,OAAO;SAzBP,MAAA,GAAA,qBAAA"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { PipeTransform } from "@angular/core";
|
|
3
|
+
/** How `txCurrencySymbol` shows a currency: the short sign, the sign, the ISO code or the full name. */
|
|
3
4
|
export type TxCurrencyDisplay = 'narrowSymbol' | 'symbol' | 'code' | 'name';
|
|
5
|
+
/**
|
|
6
|
+
* The function behind the pipe; `en-US` and `narrowSymbol` by default; cached
|
|
7
|
+
* @see https://tectra-ng.com/components/currency
|
|
8
|
+
*/
|
|
4
9
|
export declare function currencySymbol(currency: string | null | undefined, locale?: string, display?: TxCurrencyDisplay): string;
|
|
10
|
+
/**
|
|
11
|
+
* `narrowSymbol` (default: `$`, `₴`), `symbol` (`CA$`, `UAH` in some locales), `code` or `name` ("Ukrainian Hryvnia"); follows the tectra locale
|
|
12
|
+
* @see https://tectra-ng.com/components/currency
|
|
13
|
+
*/
|
|
5
14
|
export declare class TxCurrencySymbolPipe implements PipeTransform {
|
|
6
15
|
private readonly localeService;
|
|
7
16
|
transform(currency: string | null | undefined, display?: TxCurrencyDisplay, locale?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-currency.d.ts","names":[],"sources":["../../../../packages/utils/currency/src/currency.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-currency.d.ts","names":[],"sources":["../../../../packages/utils/currency/src/currency.ts"],"mappings":";;;YAIY;;;;;wBAII,eAAe,qCAAqC,iBAAkB,UAAS;;;;;qBA0BlF,gCAAgC;mBAC1B;EAEjB,UAAU,qCAAqC,UAAS,mBAAoC;SAHjF,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA"}
|
|
@@ -1,31 +1,65 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { InjectionToken, PipeTransform, Provider } from "@angular/core";
|
|
3
|
+
/** Anything the date helpers accept: a `Date`, an ISO string, a timestamp in ms, or nothing. */
|
|
3
4
|
export type TxDateInput = Date | string | number | null | undefined;
|
|
5
|
+
/** Settings of the `txDate` pipe, set with `provideTxDateFormat`. */
|
|
4
6
|
export interface TxDateFormatConfig {
|
|
7
|
+
/** Angular date format or preset used when the pipe gets none (default `mediumDate`). */
|
|
5
8
|
format: string;
|
|
9
|
+
/** Text shown for an empty or invalid date (default `-`). */
|
|
6
10
|
empty: string;
|
|
11
|
+
/** Locale of the formatted dates (default `en-US`). */
|
|
7
12
|
locale: string;
|
|
13
|
+
/** Time zone of the formatted dates; the local one when not set. */
|
|
8
14
|
timezone: string | undefined;
|
|
9
15
|
}
|
|
16
|
+
/** A date range as two ISO strings. */
|
|
10
17
|
export interface TxIsoRange {
|
|
18
|
+
/** First day or moment of the range. */
|
|
11
19
|
start: string;
|
|
20
|
+
/** Last day or moment of the range. */
|
|
12
21
|
end: string;
|
|
13
22
|
}
|
|
23
|
+
/** Default date format settings: `mediumDate`, `-` for an empty value, `en-US`, the local time zone. */
|
|
14
24
|
export declare const TX_DATE_FORMAT_DEFAULTS: TxDateFormatConfig;
|
|
25
|
+
/** Date format settings used by the `txDate` pipe; set them with `provideTxDateFormat`. */
|
|
15
26
|
export declare const TX_DATE_FORMAT_CONFIG: InjectionToken<TxDateFormatConfig>;
|
|
27
|
+
/**
|
|
28
|
+
* App or component defaults of `txDate`: `format` (`'mediumDate'`), `empty` (`'-'`), `locale` (`'en-US'`; register the data of any other Angular locale), `timezone`
|
|
29
|
+
* @see https://tectra-ng.com/components/date
|
|
30
|
+
*/
|
|
16
31
|
export declare function provideTxDateFormat(config: Partial<TxDateFormatConfig>): Provider;
|
|
32
|
+
/**
|
|
33
|
+
* `MS_IN_SECOND`, `MS_IN_MINUTE`, `MS_IN_HOUR`, `MS_IN_DAY`, `MS_IN_WEEK`, `SECONDS_IN_MINUTE`, `SECONDS_IN_HOUR`, `SECONDS_IN_DAY`, `MINUTES_IN_HOUR`, `HOURS_IN_DAY`, `DAYS_IN_WEEK`, `MONTHS_IN_YEAR`
|
|
34
|
+
* @see https://tectra-ng.com/components/date
|
|
35
|
+
*/
|
|
17
36
|
export declare const MS_IN_SECOND = 1000;
|
|
37
|
+
/** Seconds in a minute (60). */
|
|
18
38
|
export declare const SECONDS_IN_MINUTE = 60;
|
|
39
|
+
/** Minutes in an hour (60). */
|
|
19
40
|
export declare const MINUTES_IN_HOUR = 60;
|
|
41
|
+
/** Hours in a day (24). */
|
|
20
42
|
export declare const HOURS_IN_DAY = 24;
|
|
43
|
+
/** Days in a week (7). */
|
|
21
44
|
export declare const DAYS_IN_WEEK = 7;
|
|
45
|
+
/** Months in a year (12). */
|
|
22
46
|
export declare const MONTHS_IN_YEAR = 12;
|
|
47
|
+
/** Seconds in an hour (3600). */
|
|
23
48
|
export declare const SECONDS_IN_HOUR: number;
|
|
49
|
+
/** Seconds in a day (86400). */
|
|
24
50
|
export declare const SECONDS_IN_DAY: number;
|
|
51
|
+
/** Milliseconds in a minute (60000). */
|
|
25
52
|
export declare const MS_IN_MINUTE: number;
|
|
53
|
+
/** Milliseconds in an hour (3600000). */
|
|
26
54
|
export declare const MS_IN_HOUR: number;
|
|
55
|
+
/** Milliseconds in a day (86400000). */
|
|
27
56
|
export declare const MS_IN_DAY: number;
|
|
57
|
+
/** Milliseconds in a week (604800000). */
|
|
28
58
|
export declare const MS_IN_WEEK: number;
|
|
59
|
+
/**
|
|
60
|
+
* Patterns: `dateTime` `dd.MM.yy HH:mm`, `date` `dd.MM.yyyy`, `time` `HH:mm:ss`, `timeShort` `HH:mm`, `isoDay` `yyyy-MM-dd`, `isoMonth` `yyyy-MM`, `day` `dd`, `dayMonth` `dd.MM`
|
|
61
|
+
* @see https://tectra-ng.com/components/date
|
|
62
|
+
*/
|
|
29
63
|
export declare const TX_DATE_FORMATS: {
|
|
30
64
|
readonly dateTime: "dd.MM.yy HH:mm";
|
|
31
65
|
readonly date: "dd.MM.yyyy";
|
|
@@ -36,27 +70,89 @@ export declare const TX_DATE_FORMATS: {
|
|
|
36
70
|
readonly day: "dd";
|
|
37
71
|
readonly dayMonth: "dd.MM";
|
|
38
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* A new `Date` from a `Date`, string or number; `null` when empty or invalid
|
|
75
|
+
* @see https://tectra-ng.com/components/date
|
|
76
|
+
*/
|
|
39
77
|
export declare function toDate(value: TxDateInput): Date | null;
|
|
78
|
+
/**
|
|
79
|
+
* `true` when the value is a real date
|
|
80
|
+
* @see https://tectra-ng.com/components/date
|
|
81
|
+
*/
|
|
40
82
|
export declare function isValidDate(value: TxDateInput): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 00:00:00.000, 12:00 or 23:59:59.999 of the same day
|
|
85
|
+
* @see https://tectra-ng.com/components/date
|
|
86
|
+
*/
|
|
41
87
|
export declare function startOfDay(value: Date | string | number): Date;
|
|
88
|
+
/** Returns a copy of the date set to 12:00 local time, away from the daylight-saving shifts around midnight. */
|
|
42
89
|
export declare function middleOfDay(value: Date | string | number): Date;
|
|
90
|
+
/** Returns a copy of the date set to the last millisecond of the day, 23:59:59.999 local time. */
|
|
43
91
|
export declare function endOfDay(value: Date | string | number): Date;
|
|
92
|
+
/**
|
|
93
|
+
* Calendar days forward or back; the time of day stays
|
|
94
|
+
* @see https://tectra-ng.com/components/date
|
|
95
|
+
*/
|
|
44
96
|
export declare function addDays(value: Date | string | number, days: number): Date;
|
|
97
|
+
/**
|
|
98
|
+
* Months forward or back; Jan 31 + 1 month → Feb 28 (29)
|
|
99
|
+
* @see https://tectra-ng.com/components/date
|
|
100
|
+
*/
|
|
45
101
|
export declare function addMonths(value: Date | string | number, months: number): Date;
|
|
102
|
+
/**
|
|
103
|
+
* Years forward or back; Feb 29 → Feb 28
|
|
104
|
+
* @see https://tectra-ng.com/components/date
|
|
105
|
+
*/
|
|
46
106
|
export declare function addYears(value: Date | string | number, years: number): Date;
|
|
107
|
+
/**
|
|
108
|
+
* Midnight of the first day of its week; Monday (`1`) by default, `0` for Sunday
|
|
109
|
+
* @see https://tectra-ng.com/components/date
|
|
110
|
+
*/
|
|
47
111
|
export declare function startOfWeek(value: Date | string | number, firstDayOfWeek?: number): Date;
|
|
112
|
+
/**
|
|
113
|
+
* Whole calendar days from one date to another, negative when `to` is earlier
|
|
114
|
+
* @see https://tectra-ng.com/components/date
|
|
115
|
+
*/
|
|
48
116
|
export declare function calendarDaysBetween(from: Date | string | number, to: Date | string | number): number;
|
|
117
|
+
/**
|
|
118
|
+
* Both values fall on the same calendar day
|
|
119
|
+
* @see https://tectra-ng.com/components/date
|
|
120
|
+
*/
|
|
49
121
|
export declare function isSameDay(a: TxDateInput, b: TxDateInput): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* `yyyy-MM-dd` in local time
|
|
124
|
+
* @see https://tectra-ng.com/components/date
|
|
125
|
+
*/
|
|
50
126
|
export declare function toIsoDay(value: Date | string | number): string;
|
|
127
|
+
/**
|
|
128
|
+
* ISO string of a date; a string is returned as it is; `undefined` when empty
|
|
129
|
+
* @see https://tectra-ng.com/components/date
|
|
130
|
+
*/
|
|
51
131
|
export declare function toIsoString(value: TxDateInput): string | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* The function behind `txDateRange`
|
|
134
|
+
* @see https://tectra-ng.com/components/date
|
|
135
|
+
*/
|
|
52
136
|
export declare function toIsoRange(range: readonly TxDateInput[] | null | undefined): TxIsoRange | null;
|
|
137
|
+
/**
|
|
138
|
+
* The date is past or comes within the period (a week by default)
|
|
139
|
+
* @see https://tectra-ng.com/components/date
|
|
140
|
+
*/
|
|
53
141
|
export declare function isExpiringWithin(value: TxDateInput, periodMs?: number, now?: Date | number): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Formats a `Date`, ISO string or timestamp with an Angular date pattern (`'dd.MM.yyyy'`, `'mediumDate'`, `'shortTime'` …); the empty text for `null`, `''` or an invalid date
|
|
144
|
+
* @see https://tectra-ng.com/components/date
|
|
145
|
+
*/
|
|
54
146
|
export declare class TxDatePipe implements PipeTransform {
|
|
55
147
|
private readonly config;
|
|
56
148
|
transform(value: TxDateInput, format?: string, timezone?: string, locale?: string): string;
|
|
57
149
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxDatePipe, never>;
|
|
58
150
|
static ɵpipe: i0.ɵɵPipeDeclaration<TxDatePipe, "txDate", true>;
|
|
59
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* `[start, end]` of a range datepicker → `{ start, end }` ISO strings, or `null` until both ends are picked
|
|
154
|
+
* @see https://tectra-ng.com/components/date
|
|
155
|
+
*/
|
|
60
156
|
export declare class TxDateRangePipe implements PipeTransform {
|
|
61
157
|
transform(range: readonly TxDateInput[] | null | undefined): TxIsoRange | null;
|
|
62
158
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxDateRangePipe, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-date.d.ts","names":[],"sources":["../../../../packages/utils/date/src/date.types.ts","../../../../packages/utils/date/src/date.config.ts","../../../../packages/utils/date/src/date.constants.ts","../../../../packages/utils/date/src/date.functions.ts","../../../../packages/utils/date/src/date.pipe.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-date.d.ts","names":[],"sources":["../../../../packages/utils/date/src/date.types.ts","../../../../packages/utils/date/src/date.config.ts","../../../../packages/utils/date/src/date.constants.ts","../../../../packages/utils/date/src/date.functions.ts","../../../../packages/utils/date/src/date.pipe.ts"],"mappings":";;;YACY,cAAc;;iBAGT;;EAEf;;EAEA;;EAEA;;EAEA;;;iBAIe;;EAEf;;EAEA;;;qBChBW,yBAAyB;;qBAQzB,uBAAqB,eAAA;;;;;wBAKlB,oBAAoB,QAAQ,QAAQ,sBAAsB;;;;;qBCjB7D;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;qBAEA;;;;;qBAEA;;;;;;;;;;;;;;wBCnBG,OAAO,OAAO,cAAc;;;;;wBAQ5B,YAAY,OAAO;;;;;wBAQnB,WAAW,OAAO,yBAAyB;;wBAO3C,YAAY,OAAO,yBAAyB;;wBAO5C,SAAS,OAAO,yBAAyB;;;;;wBAMzC,QAAQ,OAAO,wBAAwB,eAAe;;;;;wBAMtD,UAAU,OAAO,wBAAwB,iBAAiB;;;;;wBAU1D,SAAS,OAAO,wBAAwB,gBAAgB;;;;;wBAIxD,YAAY,OAAO,wBAAwB,0BAAqB;;;;;wBAMhE,oBAAoB,MAAM,wBAAwB,IAAI;;;;;wBAQtD,UAAU,GAAG,aAAa,GAAG;;;;;wBAM7B,SAAS,OAAO;;;;;wBAOhB,YAAY,OAAO;;;;;wBAOnB,WAAW,gBAAgB,mCAAmC;;;;;wBAS9D,iBAAiB,OAAO,aAAa,mBAAuB,MAAK;;;;;qBCjGpE,sBAAsB;mBAChB;EAEjB,UAAU,OAAO,aAAa,iBAAiB,mBAAmB;SAHvD,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA;;;;;;qBAiBA,2BAA2B;EACtC,UAAU,gBAAgB,mCAAmC;SADlD,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA"}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Waits until the user stops typing before it reports the value — search fields, filters, live validation. Put it on an input, a textarea or any element with a field inside (`tx-icon-field`, a kit field): it listens to the `input` events that bubble up. Enter reports at once.
|
|
4
|
+
* @see https://tectra-ng.com/components/debounce-input
|
|
5
|
+
*/
|
|
2
6
|
export declare class TxDebounceInput {
|
|
7
|
+
/** Pause in ms after the last keystroke */
|
|
3
8
|
readonly debounceTime: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
9
|
+
/** Skips a value equal to the last reported one (Enter still reports) */
|
|
4
10
|
readonly distinct: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
11
|
+
/** Reports only from this many characters; an emptied field is always reported */
|
|
5
12
|
readonly minLength: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
13
|
+
/** The last `input` event (or the Enter `keydown`) after the pause */
|
|
6
14
|
readonly debounceInput: import("@angular/core").OutputEmitterRef<Event>;
|
|
15
|
+
/** The text of the field after the pause */
|
|
7
16
|
readonly debounceValue: import("@angular/core").OutputEmitterRef<string>;
|
|
8
17
|
private timeout;
|
|
9
18
|
private pending;
|
|
10
19
|
private lastValue;
|
|
11
20
|
constructor();
|
|
12
21
|
schedule(event: Event): void;
|
|
22
|
+
/** Reports the pending value now (`exportAs: 'txDebounceInput'`) */
|
|
13
23
|
flush(event?: Event): void;
|
|
24
|
+
/** Drops the pending value */
|
|
14
25
|
cancel(): void;
|
|
15
26
|
private emit;
|
|
16
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxDebounceInput, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-debounce-input.d.ts","names":[],"sources":["../../../../packages/utils/debounce-input/src/debounce-input.directive.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-debounce-input.d.ts","names":[],"sources":["../../../../packages/utils/debounce-input/src/debounce-input.directive.ts"],"mappings":";;;;;qBAUa;;WACF,sCAAY;;WACZ,kCAAQ;;WACR,mCAAS;;WAET,uCAAa,iBAAA;;WACb,uCAAa;UAEd;UACA;UACA;;EAMR,SAAS,OAAO;;EAMhB,MAAM,QAAQ;;EAQd;UAQQ;SAtCG,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAe;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA"}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
/** How far the pointer moved during a pan, in px. */
|
|
2
3
|
export interface TxDragPanDelta {
|
|
4
|
+
/** Horizontal move since the last event. */
|
|
3
5
|
dx: number;
|
|
6
|
+
/** Vertical move since the last event. */
|
|
4
7
|
dy: number;
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Scroll a wide or tall box by dragging it with the mouse — boards, timelines, wide tables, image strips. Buttons, links, fields and anything marked `data-drag-ignore` stay clickable; a click right after a drag is swallowed so a card does not open by accident. Touch keeps its native scrolling. In pan mode it reports the movement instead, for a canvas you move yourself.
|
|
11
|
+
* @see https://tectra-ng.com/components/drag-scroll
|
|
12
|
+
*/
|
|
6
13
|
export declare class TxDragScroll {
|
|
7
14
|
private readonly host;
|
|
15
|
+
/** Report `panMove` instead of scrolling the box */
|
|
8
16
|
readonly panMode: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
17
|
+
/** Turns dragging off */
|
|
9
18
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
19
|
+
/** `{ dx, dy }` since the last move, in pan mode */
|
|
10
20
|
readonly panMove: import("@angular/core").OutputEmitterRef<TxDragPanDelta>;
|
|
21
|
+
/** A drag began (after 4px of movement) */
|
|
11
22
|
readonly dragStart: import("@angular/core").OutputEmitterRef<void>;
|
|
23
|
+
/** The drag ended */
|
|
12
24
|
readonly dragEnd: import("@angular/core").OutputEmitterRef<void>;
|
|
25
|
+
/** Signal (`exportAs: 'txDragScroll'`); the host also gets `tx-drag-scroll--dragging` */
|
|
13
26
|
readonly isDragging: import("@angular/core").WritableSignal<boolean>;
|
|
14
27
|
private pointerId;
|
|
15
28
|
private start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-drag-scroll.d.ts","names":[],"sources":["../../../../packages/utils/drag-scroll/src/drag-scroll.directive.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-drag-scroll.d.ts","names":[],"sources":["../../../../packages/utils/drag-scroll/src/drag-scroll.directive.ts"],"mappings":";;iBAGiB;;EAEf;;EAEA;;;;;;qBAoBW;mBACM;;WAER,iCAAO;;WACP,kCAAQ;;WAER,iCAAO,iBAAA;;WACP,mCAAS;;WACT,iCAAO;;WAEP,oCAAU;UAEX;UACA;UACA;UACA;mBACS;;YAaP,cAAc,OAAO;YAUrB,cAAc,OAAO;YAwBrB,YAAY,OAAO;SA/DlB,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAY;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA;IAAA"}
|
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { PipeTransform } from "@angular/core";
|
|
3
|
+
/** Options of `txFileSize` and `formatFileSize`. */
|
|
3
4
|
export interface TxFileSizeOptions {
|
|
5
|
+
/** Maximum digits after the point for sizes above 1 KB (default 1). */
|
|
4
6
|
decimals?: number;
|
|
7
|
+
/** Size of a unit: `1024` (default) or `1000`. */
|
|
5
8
|
base?: 1000 | 1024;
|
|
9
|
+
/** Locale of the number format (default `en-US`; the pipe uses the tectra locale). */
|
|
6
10
|
locale?: string;
|
|
11
|
+
/** Text shown for a missing or negative size (default `-`). */
|
|
7
12
|
empty?: string;
|
|
8
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* The function behind the pipe; `en-US` by default
|
|
16
|
+
* @see https://tectra-ng.com/components/file
|
|
17
|
+
*/
|
|
9
18
|
export declare function formatFileSize(bytes: number | null | undefined, options?: TxFileSizeOptions): string;
|
|
19
|
+
/**
|
|
20
|
+
* Downloads data made in the browser and frees its object URL
|
|
21
|
+
* @see https://tectra-ng.com/components/file
|
|
22
|
+
*/
|
|
10
23
|
export declare function downloadBlob(blob: Blob, filename?: string, document?: Document | undefined): void;
|
|
24
|
+
/**
|
|
25
|
+
* Downloads a URL through a temporary link; the name comes from the URL when not given
|
|
26
|
+
* @see https://tectra-ng.com/components/file
|
|
27
|
+
*/
|
|
11
28
|
export declare function downloadFile(url: string, filename?: string, document?: Document | undefined): void;
|
|
29
|
+
/**
|
|
30
|
+
* Size in B, KB, MB, GB, TB, PB; options `decimals` (1), `base` (`1024` or `1000`), `locale` (the tectra one by default), `empty` (`-` for no size)
|
|
31
|
+
* @see https://tectra-ng.com/components/file
|
|
32
|
+
*/
|
|
12
33
|
export declare class TxFileSizePipe implements PipeTransform {
|
|
13
34
|
private readonly localeService;
|
|
14
35
|
transform(bytes: number | null | undefined, options?: TxFileSizeOptions): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-file.d.ts","names":[],"sources":["../../../../packages/utils/file/src/file.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-file.d.ts","names":[],"sources":["../../../../packages/utils/file/src/file.ts"],"mappings":";;;iBAIiB;;EAEf;;EAEA;;EAEA;;EAEA;;;;;;wBAKc,eAAe,kCAAkC,UAAS;;;;;wBAW1D,aAAa,MAAM,MAAM,mBAAmB,WAAU;;;;;wBAUtD,aAAa,aAAa,mBAAmB,WAAU;;;;;qBAe1D,0BAA0B;mBACpB;EAEjB,UAAU,kCAAkC,UAAS;SAH1C,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA"}
|