@antelopejs/interface-dms 0.17.3 → 0.17.4-next.1135.gc1cba20
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/README.md +9 -9
- package/dist/auth/index.d.ts +42 -0
- package/dist/auth/index.js +40 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/base/data-types/default/identifiers.d.ts +62 -0
- package/dist/base/data-types/default/identifiers.js +183 -0
- package/dist/base/data-types/default/identifiers.js.map +1 -0
- package/dist/base/data-types/default/options.d.ts +30 -0
- package/dist/base/data-types/default-types.d.ts +10 -0
- package/dist/base/data-types/default-types.js +5 -0
- package/dist/base/data-types/default-types.js.map +1 -1
- package/dist/base/data-types/internal/legal-identifiers.d.ts +36 -0
- package/dist/base/data-types/internal/legal-identifiers.js +191 -0
- package/dist/base/data-types/internal/legal-identifiers.js.map +1 -0
- package/dist/base/form-schema.d.ts +32 -0
- package/dist/base/form-schema.js +9 -0
- package/dist/base/form-schema.js.map +1 -1
- package/dist/base/internal/column-badges.d.ts +3 -2
- package/dist/base/internal/column-badges.js +4 -3
- package/dist/base/internal/column-badges.js.map +1 -1
- package/dist/base/layouts.d.ts +1 -1
- package/dist/base/layouts.js.map +1 -1
- package/dist/base/table-view/internal/group-order.d.ts +26 -0
- package/dist/base/table-view/internal/group-order.js +50 -0
- package/dist/base/table-view/internal/group-order.js.map +1 -0
- package/dist/base/table-view/internal/grouped-pinned.d.ts +6 -0
- package/dist/base/table-view/internal/grouped-pinned.js +19 -0
- package/dist/base/table-view/internal/grouped-pinned.js.map +1 -0
- package/dist/base/table-view/internal/option-contract.d.ts +3 -3
- package/dist/base/table-view/internal/option-displays.d.ts +30 -0
- package/dist/base/table-view/internal/option-expandable.d.ts +12 -0
- package/dist/base/table-view/internal/validation.d.ts +22 -4
- package/dist/base/table-view/internal/validation.js +29 -8
- package/dist/base/table-view/internal/validation.js.map +1 -1
- package/dist/base/table-view/options.d.ts +1 -0
- package/dist/base/table-view/schema.d.ts +2 -0
- package/dist/base/table-view/schema.js +8 -0
- package/dist/base/table-view/schema.js.map +1 -1
- package/dist/base/table-view.d.ts +1 -1
- package/dist/base/table-view.js.map +1 -1
- package/dist/component-options/data-type.js +3 -3
- package/dist/component-options/data-type.js.map +1 -1
- package/dist/component-options/internal/data-type-registry.d.ts +14 -0
- package/dist/component-options/internal/data-type-registry.js +19 -0
- package/dist/component-options/internal/data-type-registry.js.map +1 -0
- package/dist/component-options/page-layout.d.ts +29 -1
- package/dist/component-options/page-layout.js +8 -2
- package/dist/component-options/page-layout.js.map +1 -1
- package/dist/db/tables/tenants.table.d.ts +7 -1
- package/dist/db/tables/tenants.table.js +11 -7
- package/dist/db/tables/tenants.table.js.map +1 -1
- package/dist/page/internal/layout-filter.js +1 -1
- package/dist/page/internal/layout-filter.js.map +1 -1
- package/dist/period-request.d.ts +66 -0
- package/dist/period-request.js +149 -0
- package/dist/period-request.js.map +1 -0
- package/dist/request-tenant.d.ts +2 -1
- package/dist/request-tenant.js +2 -1
- package/dist/request-tenant.js.map +1 -1
- package/docs/1.core/12.frontend-modules-and-request-helpers.md +21 -1
- package/docs/1.core/5.tenancy.md +1 -1
- package/docs/2.auth/1.introduction.md +1 -1
- package/docs/2.auth/2.authentication.md +68 -0
- package/docs/3.base/11.page-layouts.md +18 -1
- package/docs/3.base/16.identifier-types.md +27 -0
- package/docs/3.base/4.tables.md +3 -3
- package/docs/3.base/8.data-types.md +7 -0
- package/docs/5.html-render/2.built-in-emails.md +2 -0
- package/package.json +7 -7
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.identifierFilterText = identifierFilterText;
|
|
4
|
+
exports.readIban = readIban;
|
|
5
|
+
exports.readBic = readBic;
|
|
6
|
+
exports.isCompanyNumberCountry = isCompanyNumberCountry;
|
|
7
|
+
exports.readCompanyNumber = readCompanyNumber;
|
|
8
|
+
exports.readVatNumber = readVatNumber;
|
|
9
|
+
/** What a person types, without its spaces, dots, dashes and slashes, in upper case. */
|
|
10
|
+
function compactIdentifier(value) {
|
|
11
|
+
return value.replace(/[\s.\-/]/g, "").toUpperCase();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @internal What a filter of an identifier column looks for: the identifier
|
|
15
|
+
* `read` makes of the typed text, or else that text compacted, so a part of
|
|
16
|
+
* an identifier typed as printed (`BE68 5390`) finds the stored one.
|
|
17
|
+
*/
|
|
18
|
+
function identifierFilterText(value, read) {
|
|
19
|
+
return read(value) ?? compactIdentifier(value);
|
|
20
|
+
}
|
|
21
|
+
/** The remainder of a digit string of any length divided by 97. */
|
|
22
|
+
function mod97(digits) {
|
|
23
|
+
let remainder = 0;
|
|
24
|
+
for (const digit of digits) {
|
|
25
|
+
remainder = (remainder * 10 + Number(digit)) % 97;
|
|
26
|
+
}
|
|
27
|
+
return remainder;
|
|
28
|
+
}
|
|
29
|
+
/** Whether a digit string passes the Luhn check (ISO/IEC 7812). */
|
|
30
|
+
function passesLuhn(digits) {
|
|
31
|
+
let sum = 0;
|
|
32
|
+
for (let index = 0; index < digits.length; index++) {
|
|
33
|
+
const digit = Number(digits[digits.length - 1 - index]);
|
|
34
|
+
const weighted = index % 2 === 1 ? digit * 2 : digit;
|
|
35
|
+
sum += weighted > 9 ? weighted - 9 : weighted;
|
|
36
|
+
}
|
|
37
|
+
return sum % 10 === 0;
|
|
38
|
+
}
|
|
39
|
+
const IBAN = /^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/;
|
|
40
|
+
/**
|
|
41
|
+
* @internal An IBAN without spaces (`BE68539007547034`), checked against its
|
|
42
|
+
* two check digits (ISO 13616, modulo 97); `undefined` when it is none.
|
|
43
|
+
*/
|
|
44
|
+
function readIban(value) {
|
|
45
|
+
const iban = compactIdentifier(value);
|
|
46
|
+
if (!IBAN.test(iban))
|
|
47
|
+
return undefined;
|
|
48
|
+
const numeric = `${iban.slice(4)}${iban.slice(0, 4)}`.replace(/[A-Z]/g, (letter) => String(letter.charCodeAt(0) - 55));
|
|
49
|
+
return mod97(numeric) === 1 ? iban : undefined;
|
|
50
|
+
}
|
|
51
|
+
const BIC = /^[A-Z0-9]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?$/;
|
|
52
|
+
/**
|
|
53
|
+
* @internal A BIC of 8 or 11 characters (ISO 9362): party prefix, country,
|
|
54
|
+
* location and an optional branch; `undefined` when it is none.
|
|
55
|
+
*/
|
|
56
|
+
function readBic(value) {
|
|
57
|
+
const bic = compactIdentifier(value);
|
|
58
|
+
return BIC.test(bic) ? bic : undefined;
|
|
59
|
+
}
|
|
60
|
+
/** The ten digits of a Belgian enterprise number, or `undefined`. */
|
|
61
|
+
function readBelgianEnterpriseNumber(digits) {
|
|
62
|
+
const number = digits.length === 9 ? `0${digits}` : digits;
|
|
63
|
+
if (!/^[01]\d{9}$/.test(number))
|
|
64
|
+
return undefined;
|
|
65
|
+
const check = 97 - mod97(number.slice(0, 8));
|
|
66
|
+
return check === Number(number.slice(8)) ? number : undefined;
|
|
67
|
+
}
|
|
68
|
+
/** The nine digits of a French SIREN, or `undefined`. */
|
|
69
|
+
function readSiren(digits) {
|
|
70
|
+
return /^\d{9}$/.test(digits) && passesLuhn(digits) ? digits : undefined;
|
|
71
|
+
}
|
|
72
|
+
const COMPANY_NUMBER_READERS = new Map([
|
|
73
|
+
["BE", readBelgianEnterpriseNumber],
|
|
74
|
+
["FR", readSiren],
|
|
75
|
+
]);
|
|
76
|
+
/** @internal Whether `country` is one whose company number is read. */
|
|
77
|
+
function isCompanyNumberCountry(country) {
|
|
78
|
+
return typeof country === "string" && COMPANY_NUMBER_READERS.has(country);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @internal A company registration number of `country` as its register
|
|
82
|
+
* writes it, digits only: a Belgian enterprise number of ten digits (the
|
|
83
|
+
* nine of before 2005 get their leading zero), a French SIREN of nine.
|
|
84
|
+
* Typed with its country's code in front (`BE 0123.456.749`), it reads the
|
|
85
|
+
* same. `undefined` when it is none.
|
|
86
|
+
*/
|
|
87
|
+
function readCompanyNumber(value, country) {
|
|
88
|
+
const compact = compactIdentifier(value);
|
|
89
|
+
const digits = compact.startsWith(country)
|
|
90
|
+
? compact.slice(country.length)
|
|
91
|
+
: compact;
|
|
92
|
+
return COMPANY_NUMBER_READERS.get(country)?.(digits);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The format of each country's VAT number after its country code, as the
|
|
96
|
+
* EU's VIES service lists it, plus Northern Ireland (`XI`) and Great Britain.
|
|
97
|
+
*/
|
|
98
|
+
const VAT_NUMBER_FORMATS = new Map([
|
|
99
|
+
["AT", /^U\d{8}$/],
|
|
100
|
+
["BE", /^[01]\d{9}$/],
|
|
101
|
+
["BG", /^\d{9,10}$/],
|
|
102
|
+
["CY", /^\d{8}[A-Z]$/],
|
|
103
|
+
["CZ", /^\d{8,10}$/],
|
|
104
|
+
["DE", /^\d{9}$/],
|
|
105
|
+
["DK", /^\d{8}$/],
|
|
106
|
+
["EE", /^\d{9}$/],
|
|
107
|
+
["EL", /^\d{9}$/],
|
|
108
|
+
["ES", /^[A-Z0-9]\d{7}[A-Z0-9]$/],
|
|
109
|
+
["FI", /^\d{8}$/],
|
|
110
|
+
["FR", /^[A-HJ-NP-Z0-9]{2}\d{9}$/],
|
|
111
|
+
["GB", /^(?:\d{9}|\d{12}|GD\d{3}|HA\d{3})$/],
|
|
112
|
+
["HR", /^\d{11}$/],
|
|
113
|
+
["HU", /^\d{8}$/],
|
|
114
|
+
["IE", /^(?:\d{7}[A-W][A-IW]?|\d[A-Z+*]\d{5}[A-W])$/],
|
|
115
|
+
["IT", /^\d{11}$/],
|
|
116
|
+
["LT", /^(?:\d{9}|\d{12})$/],
|
|
117
|
+
["LU", /^\d{8}$/],
|
|
118
|
+
["LV", /^\d{11}$/],
|
|
119
|
+
["MT", /^\d{8}$/],
|
|
120
|
+
["NL", /^\d{9}B\d{2}$/],
|
|
121
|
+
["PL", /^\d{10}$/],
|
|
122
|
+
["PT", /^\d{9}$/],
|
|
123
|
+
["RO", /^[1-9]\d{1,9}$/],
|
|
124
|
+
["SE", /^\d{10}01$/],
|
|
125
|
+
["SI", /^\d{8}$/],
|
|
126
|
+
["SK", /^\d{10}$/],
|
|
127
|
+
["XI", /^(?:\d{9}|\d{12}|GD\d{3}|HA\d{3})$/],
|
|
128
|
+
]);
|
|
129
|
+
/** German VAT check digit: ISO 7064 MOD 11,10 over the first eight digits. */
|
|
130
|
+
function passesGermanCheck(number) {
|
|
131
|
+
let product = 10;
|
|
132
|
+
for (const digit of number.slice(0, 8)) {
|
|
133
|
+
let sum = (Number(digit) + product) % 10;
|
|
134
|
+
if (sum === 0)
|
|
135
|
+
sum = 10;
|
|
136
|
+
product = (2 * sum) % 11;
|
|
137
|
+
}
|
|
138
|
+
const check = (11 - product) % 10;
|
|
139
|
+
return check === Number(number[8]);
|
|
140
|
+
}
|
|
141
|
+
/** French VAT key: `(12 + 3 × (SIREN mod 97)) mod 97`, when it is numeric. */
|
|
142
|
+
function passesFrenchCheck(number) {
|
|
143
|
+
const key = number.slice(0, 2);
|
|
144
|
+
if (!/^\d{2}$/.test(key))
|
|
145
|
+
return true;
|
|
146
|
+
const siren = number.slice(2);
|
|
147
|
+
return Number(key) === (12 + 3 * mod97(siren)) % 97;
|
|
148
|
+
}
|
|
149
|
+
/** Luxembourg VAT: the first six digits modulo 89 are the last two. */
|
|
150
|
+
function passesLuxembourgCheck(number) {
|
|
151
|
+
return Number(number.slice(0, 6)) % 89 === Number(number.slice(6));
|
|
152
|
+
}
|
|
153
|
+
/** The check digits of the countries whose public rule is stable; the format only elsewhere. */
|
|
154
|
+
const VAT_CHECKS = new Map([
|
|
155
|
+
["BE", (number) => readBelgianEnterpriseNumber(number) !== undefined],
|
|
156
|
+
["DE", passesGermanCheck],
|
|
157
|
+
["FR", passesFrenchCheck],
|
|
158
|
+
["IT", passesLuhn],
|
|
159
|
+
["LU", passesLuxembourgCheck],
|
|
160
|
+
]);
|
|
161
|
+
/** The code a person may type for a VAT country, read as VIES writes it. */
|
|
162
|
+
const VAT_PREFIX_ALIASES = new Map([["GR", "EL"]]);
|
|
163
|
+
/**
|
|
164
|
+
* @internal A VAT number as VIES writes it (`BE0123456749`): its country's
|
|
165
|
+
* code, then its number without spaces. The number must have its country's
|
|
166
|
+
* format; Belgium, Germany, France, Italy and Luxembourg also check its check
|
|
167
|
+
* digits. A number typed without its country's code reads in
|
|
168
|
+
* `defaultCountry`, and a Belgian one of nine digits gets its leading zero.
|
|
169
|
+
* `undefined` when it is none.
|
|
170
|
+
*/
|
|
171
|
+
function readVatNumber(value, defaultCountry) {
|
|
172
|
+
const compact = compactIdentifier(value);
|
|
173
|
+
const typedPrefix = compact.slice(0, 2);
|
|
174
|
+
const isPrefixed = /^[A-Z]{2}$/.test(typedPrefix);
|
|
175
|
+
const prefix = isPrefixed ? typedPrefix : defaultCountry?.toUpperCase();
|
|
176
|
+
if (!prefix)
|
|
177
|
+
return undefined;
|
|
178
|
+
const country = VAT_PREFIX_ALIASES.get(prefix) ?? prefix;
|
|
179
|
+
const format = VAT_NUMBER_FORMATS.get(country);
|
|
180
|
+
if (!format)
|
|
181
|
+
return undefined;
|
|
182
|
+
const typed = isPrefixed ? compact.slice(2) : compact;
|
|
183
|
+
const number = country === "BE" && typed.length === 9 ? `0${typed}` : typed;
|
|
184
|
+
if (!format.test(number))
|
|
185
|
+
return undefined;
|
|
186
|
+
const check = VAT_CHECKS.get(country);
|
|
187
|
+
if (check && !check(number))
|
|
188
|
+
return undefined;
|
|
189
|
+
return `${country}${number}`;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=legal-identifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legal-identifiers.js","sourceRoot":"","sources":["../../../../src/base/data-types/internal/legal-identifiers.ts"],"names":[],"mappings":";;;;;;;;AAEA,wFAAwF;AACxF,SAAS,i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KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;IACxE,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;IACzD,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACtD,MAAM,MAAM,GAAG,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9C,OAAO,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import "../component";
|
|
|
3
3
|
import "../uploads";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import type { DefaultDataTypes } from "./data-types/default-types";
|
|
6
|
+
import type { CompanyNumberCountry } from "./data-types/default/options";
|
|
6
7
|
import type * as RelationPickers from "./form-relation-options";
|
|
7
8
|
import type { AxeOrientation, DefaultValue, EnumOption } from "./types";
|
|
8
9
|
import "./internal/form-block-schema";
|
|
@@ -192,6 +193,31 @@ export declare namespace FormComponents {
|
|
|
192
193
|
requiredPrefix?: boolean;
|
|
193
194
|
defaultCountry?: string;
|
|
194
195
|
}
|
|
196
|
+
/** A legal or bank identifier `InputIdentifier` reads. */
|
|
197
|
+
type IdentifierKind = "iban" | "bic" | "vat_number" | "company_number";
|
|
198
|
+
/**
|
|
199
|
+
* The options of `InputIdentifier`, by `identifier`: which identifier the
|
|
200
|
+
* field holds, and so which rule it checks. A company number needs its
|
|
201
|
+
* `country`; only a VAT number takes a `defaultCountry`.
|
|
202
|
+
*/
|
|
203
|
+
type InputIdentifierOptions = {
|
|
204
|
+
identifier: "iban" | "bic";
|
|
205
|
+
placeholder?: string;
|
|
206
|
+
defaultCountry?: never;
|
|
207
|
+
country?: never;
|
|
208
|
+
} | {
|
|
209
|
+
identifier: "vat_number";
|
|
210
|
+
placeholder?: string;
|
|
211
|
+
/** The country a number typed without its code is read in. */
|
|
212
|
+
defaultCountry?: string;
|
|
213
|
+
country?: never;
|
|
214
|
+
} | {
|
|
215
|
+
identifier: "company_number";
|
|
216
|
+
placeholder?: string;
|
|
217
|
+
defaultCountry?: never;
|
|
218
|
+
/** The country whose register the number belongs to. */
|
|
219
|
+
country: CompanyNumberCountry;
|
|
220
|
+
};
|
|
195
221
|
interface InputTextOptions {
|
|
196
222
|
placeholder?: string;
|
|
197
223
|
maxLength?: number;
|
|
@@ -322,6 +348,12 @@ export declare namespace FormComponents {
|
|
|
322
348
|
function InputTime(options?: InputTimeOptions): ComponentInfoSerialized<InputTimeOptions>;
|
|
323
349
|
function InputText(options?: InputTextOptions): ComponentInfoSerialized<InputTextOptions>;
|
|
324
350
|
function InputPhone(options?: InputPhoneOptions): ComponentInfoSerialized<InputPhoneOptions>;
|
|
351
|
+
/**
|
|
352
|
+
* A text input for an IBAN, a BIC, a VAT number or a company registration
|
|
353
|
+
* number: it checks the value with the rule of its data type as it is
|
|
354
|
+
* typed, and shows it as printed (an IBAN in groups of four) once read.
|
|
355
|
+
*/
|
|
356
|
+
function InputIdentifier(options: InputIdentifierOptions): ComponentInfoSerialized<InputIdentifierOptions>;
|
|
325
357
|
function InputRadioGroup<T extends RadioGroupOptions>(options: T): ComponentInfoSerialized<T>;
|
|
326
358
|
function InputSelect<T extends SelectOptions>(options: T): ComponentInfoSerialized<T>;
|
|
327
359
|
function InputRelation<T extends RelationOptions>(options: T): ComponentInfoSerialized<T>;
|
package/dist/base/form-schema.js
CHANGED
|
@@ -180,6 +180,15 @@ var FormComponents;
|
|
|
180
180
|
return (0, form_schema_components_1.formComponent)("dms-input-phone", options);
|
|
181
181
|
}
|
|
182
182
|
FormComponents.InputPhone = InputPhone;
|
|
183
|
+
/**
|
|
184
|
+
* A text input for an IBAN, a BIC, a VAT number or a company registration
|
|
185
|
+
* number: it checks the value with the rule of its data type as it is
|
|
186
|
+
* typed, and shows it as printed (an IBAN in groups of four) once read.
|
|
187
|
+
*/
|
|
188
|
+
function InputIdentifier(options) {
|
|
189
|
+
return (0, form_schema_components_1.formComponent)("dms-input-identifier", options);
|
|
190
|
+
}
|
|
191
|
+
FormComponents.InputIdentifier = InputIdentifier;
|
|
183
192
|
function InputRadioGroup(options) {
|
|
184
193
|
return (0, form_schema_components_1.formComponent)("dms-radio-group", options);
|
|
185
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-schema.js","sourceRoot":"","sources":["../../src/base/form-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,wBAAsB;AACtB,sBAAoB;AACpB,6BAAwB;AACxB,4CAAkD;
|
|
1
|
+
{"version":3,"file":"form-schema.js","sourceRoot":"","sources":["../../src/base/form-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,wBAAsB;AACtB,sBAAoB;AACpB,6BAAwB;AACxB,4CAAkD;AAKlD,wCAAsC;AAUtC,8EAI2C;AA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@@ export interface ColumnBadgeTab {
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function badgeItems(values: readonly string[]): ColumnBadge[];
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* A tab per badge of `column` in its order, filtering the rows that hold its
|
|
40
|
+
* value and drawn in its tone. The dashboard draws the "all" tab before them
|
|
41
|
+
* in its own locale.
|
|
41
42
|
*
|
|
42
43
|
* @internal
|
|
43
44
|
*/
|
|
@@ -63,8 +63,9 @@ function tabId(column, value) {
|
|
|
63
63
|
return [...words(column), ...words(value)].join("-");
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
66
|
+
* A tab per badge of `column` in its order, filtering the rows that hold its
|
|
67
|
+
* value and drawn in its tone. The dashboard draws the "all" tab before them
|
|
68
|
+
* in its own locale.
|
|
68
69
|
*
|
|
69
70
|
* @internal
|
|
70
71
|
*/
|
|
@@ -81,6 +82,6 @@ function badgeTabs(column, badges) {
|
|
|
81
82
|
textColor: badge.tone,
|
|
82
83
|
};
|
|
83
84
|
});
|
|
84
|
-
return
|
|
85
|
+
return tabs;
|
|
85
86
|
}
|
|
86
87
|
//# sourceMappingURL=column-badges.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-badges.js","sourceRoot":"","sources":["../../../src/base/internal/column-badges.ts"],"names":[],"mappings":";;;;AA4BA,sGAAsG;AACtG,MAAM,UAAU,GAAoD;IAClE;QACE,SAAS;QACT,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC;KAC5E;IACD,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpE;QACE,OAAO;QACP;YACE,QAAQ;YACR,WAAW;YACX,UAAU;YACV,UAAU;YACV,UAAU;YACV,OAAO;YACP,SAAS;SACV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tB,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/base/layouts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as pageLayout from "../component-options/page-layout";
|
|
2
|
-
export type { DefaultLayoutOptions, PageHeaderButton, PageRecordLoader, } from "../component-options/page-layout";
|
|
2
|
+
export type { DefaultLayoutOptions, EmptyLayoutOptions, PageHeaderButton, PageRecordLoader, } from "../component-options/page-layout";
|
|
3
3
|
export import DefaultLayout = pageLayout.DefaultLayout;
|
|
4
4
|
export import FormPageLayout = pageLayout.FormPageLayout;
|
|
5
5
|
export import SettingsLayout = pageLayout.SettingsLayout;
|
package/dist/base/layouts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.js","sourceRoot":"","sources":["../../src/base/layouts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,UAAU,6DAAyC;
|
|
1
|
+
{"version":3,"file":"layouts.js","sourceRoot":"","sources":["../../src/base/layouts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,UAAU,6DAAyC;AAQjD,QAAA,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;AACzC,QAAA,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;AAC3C,QAAA,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;AAC3C,QAAA,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { GroupedOptions } from "../options";
|
|
3
|
+
/**
|
|
4
|
+
* The most values `grouped.order` lists: the list route reads one group at a
|
|
5
|
+
* time.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_GROUP_ORDER_VALUES = 50;
|
|
10
|
+
/**
|
|
11
|
+
* The values a group order lists: 1 to {@link MAX_GROUP_ORDER_VALUES} scalars.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare const groupOrderSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
16
|
+
/**
|
|
17
|
+
* `grouped.order` orders the groups of one value each: `"items"` on a single
|
|
18
|
+
* `SelectType` column, else values listed once each.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateGroupOrder(controllerName: string, grouped: GroupedOptions, typeId: string | undefined, type: {
|
|
23
|
+
options?: {
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
};
|
|
26
|
+
}): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.groupOrderSchema = exports.MAX_GROUP_ORDER_VALUES = void 0;
|
|
4
|
+
exports.validateGroupOrder = validateGroupOrder;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
/**
|
|
7
|
+
* The most values `grouped.order` lists: the list route reads one group at a
|
|
8
|
+
* time.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
exports.MAX_GROUP_ORDER_VALUES = 50;
|
|
13
|
+
/**
|
|
14
|
+
* The values a group order lists: 1 to {@link MAX_GROUP_ORDER_VALUES} scalars.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
exports.groupOrderSchema = zod_1.z
|
|
19
|
+
.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()]))
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(exports.MAX_GROUP_ORDER_VALUES);
|
|
22
|
+
/**
|
|
23
|
+
* `grouped.order` orders the groups of one value each: `"items"` on a single
|
|
24
|
+
* `SelectType` column, else values listed once each.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
function validateGroupOrder(controllerName, grouped, typeId, type) {
|
|
29
|
+
const { order, groupByField, by } = grouped;
|
|
30
|
+
if (order === undefined)
|
|
31
|
+
return;
|
|
32
|
+
const where = `TableView grouped order on ${controllerName}`;
|
|
33
|
+
if (by && by !== "value") {
|
|
34
|
+
throw new Error(`${where} orders groups of one value each, and "${groupByField}" is grouped by ${by}`);
|
|
35
|
+
}
|
|
36
|
+
if (order === "items") {
|
|
37
|
+
if (typeId !== "select" || type.options?.multiple) {
|
|
38
|
+
throw new Error(`${where} follows the items of a SelectType, and "${groupByField}" is ${typeId ?? "untyped"}${type.options?.multiple ? " (multiple)" : ""}`);
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (order.length === 0 || order.length > exports.MAX_GROUP_ORDER_VALUES) {
|
|
43
|
+
throw new Error(`${where} lists ${order.length} values: give between 1 and ${exports.MAX_GROUP_ORDER_VALUES}`);
|
|
44
|
+
}
|
|
45
|
+
const seen = new Set(order.map((value) => JSON.stringify(value)));
|
|
46
|
+
if (seen.size !== order.length) {
|
|
47
|
+
throw new Error(`${where} lists a value twice`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=group-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-order.js","sourceRoot":"","sources":["../../../../src/base/table-view/internal/group-order.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AAGxB;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,OAAC;KAC9B,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;KACrD,G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AAC;QAC/B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,sBAAsB,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TableViewOptions } from "../options";
|
|
2
|
+
/**
|
|
3
|
+
* The grouped display pins the rows `pinnedRows` accepts: it needs that rule.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateGroupedPinned<T extends object>(controllerName: string, options: Pick<TableViewOptions<T>, "grouped" | "pinnedRows">): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateGroupedPinned = validateGroupedPinned;
|
|
4
|
+
/**
|
|
5
|
+
* The grouped display pins the rows `pinnedRows` accepts: it needs that rule.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
function validateGroupedPinned(controllerName, options) {
|
|
9
|
+
const { grouped } = options;
|
|
10
|
+
if (!grouped?.pinned && grouped?.pinnedLabel === undefined)
|
|
11
|
+
return;
|
|
12
|
+
if (!grouped.pinned) {
|
|
13
|
+
throw new Error(`TableView grouped on ${controllerName} names a pinnedLabel without pinned: true`);
|
|
14
|
+
}
|
|
15
|
+
if (!options.pinnedRows) {
|
|
16
|
+
throw new Error(`TableView grouped on ${controllerName} pins rows, but declares no pinnedRows rule`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=grouped-pinned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grouped-pinned.js","sourceRoot":"","sources":["../../../../src/base/table-view/internal/grouped-pinned.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,+BACE,cAAsB,EACtB,OAA4D;IAE5D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,WAAW,KAAK,SAAS;QAAE,OAAO;IACnE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,wBAAwB,cAAc,2CAA2C,CAClF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,wBAAwB,cAAc,6CAA6C,CACpF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -182,9 +182,9 @@ export interface TableViewOptions<T extends object = Record<string, unknown>> {
|
|
|
182
182
|
* them. The rest follows in the sort's order. A route answering every row
|
|
183
183
|
* (a `TableView.fromSource` without `paginate`) has its pinned rows on the
|
|
184
184
|
* first page; a route answering one page has them first within the page it
|
|
185
|
-
* answers. The `grouped` display
|
|
186
|
-
*
|
|
187
|
-
* position.
|
|
185
|
+
* answers. The `grouped` display pins them only with `grouped.pinned`,
|
|
186
|
+
* as a group leading the others; registration refuses `pinnedRows`
|
|
187
|
+
* alongside `reorder`, whose rows keep their position.
|
|
188
188
|
* @example { field: "isBase", equals: true }
|
|
189
189
|
*/
|
|
190
190
|
pinnedRows?: RowActionRule<T>;
|
|
@@ -101,6 +101,12 @@ export interface KanbanOptions {
|
|
|
101
101
|
}
|
|
102
102
|
/** How the `grouped` display cuts the rows into groups. */
|
|
103
103
|
export type TableViewGroupBy = "value" | "day" | "week";
|
|
104
|
+
/**
|
|
105
|
+
* The order of the `grouped` display's groups: `"items"`, the order of the
|
|
106
|
+
* `items` of the column's `SelectType` (the badge), as the kanban's columns
|
|
107
|
+
* follow it; or the stored values themselves, in the order wanted.
|
|
108
|
+
*/
|
|
109
|
+
export type TableViewGroupOrder = "items" | (string | number | boolean)[];
|
|
104
110
|
/**
|
|
105
111
|
* The `grouped` display: the table's own columns, with a header row before
|
|
106
112
|
* each group of rows sharing a value of `groupByField` (a status, a day of a
|
|
@@ -118,8 +124,32 @@ export interface GroupedOptions {
|
|
|
118
124
|
* per calendar day or week of a date column.
|
|
119
125
|
*/
|
|
120
126
|
by?: TableViewGroupBy;
|
|
127
|
+
/**
|
|
128
|
+
* The order of the groups, with `by: "value"` only. Left out, the groups
|
|
129
|
+
* follow the sort on the stored value (alphabetical for a text). The list
|
|
130
|
+
* route reads each group's rows in this order across pages, so the first
|
|
131
|
+
* page opens on the first group; rows holding a value the order leaves
|
|
132
|
+
* out, or none, follow in the sort's order. Applies to `groupByField`:
|
|
133
|
+
* grouped on another column from the options menu, the rows follow that
|
|
134
|
+
* column's badge with `"items"`, its sort with a list of values.
|
|
135
|
+
*/
|
|
136
|
+
order?: TableViewGroupOrder;
|
|
121
137
|
/** A click on a group header folds its rows. */
|
|
122
138
|
collapsible?: boolean;
|
|
123
139
|
/** Group headers show how many rows the group holds. */
|
|
124
140
|
count?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The rows the table's `pinnedRows` accepts lead the display as a group
|
|
143
|
+
* of their own, before the others, as they lead the grid: within the page
|
|
144
|
+
* the list route answers. They leave their value's group on that page.
|
|
145
|
+
* The group folds like the others, and with `count` its header shows how
|
|
146
|
+
* many rows it holds on the page. Registration throws without
|
|
147
|
+
* `pinnedRows`.
|
|
148
|
+
*/
|
|
149
|
+
pinned?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Heading of the pinned group (`$`: i18n key), "Pinned" when left out:
|
|
152
|
+
* `"Overdue"`, `"$orders.late"`.
|
|
153
|
+
*/
|
|
154
|
+
pinnedLabel?: string;
|
|
125
155
|
}
|
|
@@ -6,6 +6,18 @@ export interface TableViewExpandableField {
|
|
|
6
6
|
key: string;
|
|
7
7
|
/** Label shown instead of the column's name. `$`-prefixed: an i18n key. */
|
|
8
8
|
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The value takes the band's whole width under its label and is shown in
|
|
11
|
+
* full: it wraps instead of being cut, keeps its line breaks, and an
|
|
12
|
+
* `ArrayType` or `KeyValueType` lists its entries instead of their count.
|
|
13
|
+
*/
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Leaves the field out of a row with no value for it: absent, `null`, an
|
|
17
|
+
* empty text, an empty list or an object without keys. `0` and `false` are
|
|
18
|
+
* values.
|
|
19
|
+
*/
|
|
20
|
+
hideEmpty?: boolean;
|
|
9
21
|
}
|
|
10
22
|
/** Which rows open on arrival and after the listed set changes. */
|
|
11
23
|
export type TableViewExpandedDefault = "none" | "first" | "all";
|
|
@@ -20,10 +20,28 @@ export declare function validatePageSize(controllerName: string, pageSize: numbe
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function assertKnownColumns(controllerName: string, meta: Pick<TableViewMeta, "columns">, option: string, keys: string[]): void;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* A quick filter whose column offers nothing to pick — a free-text string, a
|
|
24
|
+
* number, a date, a select without items: its position in `quickFilters`, its
|
|
25
|
+
* field, and why the browser leaves it out of the toolbar.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export interface ValuelessQuickFilter {
|
|
30
|
+
index: number;
|
|
31
|
+
field: string;
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The quick filters of `quickFilters` whose column offers nothing to pick. A
|
|
36
|
+
* field naming no column is not one of them.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function valuelessQuickFilters(columns: Record<string, Pick<ColumnOptions, "type"> | undefined>, quickFilters: readonly TableViewQuickFilter[] | undefined): ValuelessQuickFilter[];
|
|
41
|
+
/**
|
|
42
|
+
* Warns, once per table and field, about each of
|
|
43
|
+
* {@link valuelessQuickFilters}. Not thrown, so that an application already
|
|
44
|
+
* declaring one keeps starting.
|
|
27
45
|
*
|
|
28
46
|
* @internal
|
|
29
47
|
*/
|