@pilotiq/pilotiq 0.1.0 → 0.3.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +6 -5
- package/dist/Pilotiq.d.ts +20 -1
- package/dist/Pilotiq.d.ts.map +1 -1
- package/dist/Pilotiq.js.map +1 -1
- package/dist/actions/Action.d.ts +25 -0
- package/dist/actions/Action.d.ts.map +1 -1
- package/dist/actions/Action.js +25 -0
- package/dist/actions/Action.js.map +1 -1
- package/dist/elements/dispatchForm.d.ts +0 -14
- package/dist/elements/dispatchForm.d.ts.map +1 -1
- package/dist/elements/dispatchForm.js +28 -0
- package/dist/elements/dispatchForm.js.map +1 -1
- package/dist/fields/BuilderField.d.ts +27 -1
- package/dist/fields/BuilderField.d.ts.map +1 -1
- package/dist/fields/BuilderField.js +36 -1
- package/dist/fields/BuilderField.js.map +1 -1
- package/dist/fields/FileUploadField.d.ts +65 -0
- package/dist/fields/FileUploadField.d.ts.map +1 -1
- package/dist/fields/FileUploadField.js +72 -0
- package/dist/fields/FileUploadField.js.map +1 -1
- package/dist/fields/RepeaterField.d.ts +34 -1
- package/dist/fields/RepeaterField.d.ts.map +1 -1
- package/dist/fields/RepeaterField.js +43 -1
- package/dist/fields/RepeaterField.js.map +1 -1
- package/dist/fields/RowButton.d.ts +9 -2
- package/dist/fields/RowButton.d.ts.map +1 -1
- package/dist/fields/TextField.d.ts +106 -0
- package/dist/fields/TextField.d.ts.map +1 -1
- package/dist/fields/TextField.js +115 -0
- package/dist/fields/TextField.js.map +1 -1
- package/dist/filters/queryBuilder/Constraint.d.ts +1 -1
- package/dist/filters/queryBuilder/Constraint.d.ts.map +1 -1
- package/dist/filters/queryBuilder/TextConstraint.d.ts.map +1 -1
- package/dist/filters/queryBuilder/TextConstraint.js +2 -3
- package/dist/filters/queryBuilder/TextConstraint.js.map +1 -1
- package/dist/orm/modelDefaults.d.ts +1 -1
- package/dist/orm/modelDefaults.d.ts.map +1 -1
- package/dist/react/SchemaRenderer.d.ts.map +1 -1
- package/dist/react/SchemaRenderer.js +108 -7
- package/dist/react/SchemaRenderer.js.map +1 -1
- package/dist/react/fields/BuilderInput.d.ts.map +1 -1
- package/dist/react/fields/BuilderInput.js +32 -3
- package/dist/react/fields/BuilderInput.js.map +1 -1
- package/dist/react/fields/FieldShell.d.ts +9 -1
- package/dist/react/fields/FieldShell.d.ts.map +1 -1
- package/dist/react/fields/FieldShell.js +4 -3
- package/dist/react/fields/FieldShell.js.map +1 -1
- package/dist/react/fields/FileUploadInput.d.ts +17 -4
- package/dist/react/fields/FileUploadInput.d.ts.map +1 -1
- package/dist/react/fields/FileUploadInput.js +204 -25
- package/dist/react/fields/FileUploadInput.js.map +1 -1
- package/dist/react/fields/RepeaterInput.d.ts.map +1 -1
- package/dist/react/fields/RepeaterInput.js +33 -2
- package/dist/react/fields/RepeaterInput.js.map +1 -1
- package/dist/react/fields/TextLikeInput.d.ts +5 -1
- package/dist/react/fields/TextLikeInput.d.ts.map +1 -1
- package/dist/react/fields/TextLikeInput.js +17 -2
- package/dist/react/fields/TextLikeInput.js.map +1 -1
- package/dist/react/fields/rowChromeButton.d.ts +24 -5
- package/dist/react/fields/rowChromeButton.d.ts.map +1 -1
- package/dist/react/fields/rowChromeButton.js +51 -8
- package/dist/react/fields/rowChromeButton.js.map +1 -1
- package/dist/react/fields/textInputControls.d.ts +47 -0
- package/dist/react/fields/textInputControls.d.ts.map +1 -0
- package/dist/react/fields/textInputControls.js +134 -0
- package/dist/react/fields/textInputControls.js.map +1 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +32 -1
- package/dist/routes.js.map +1 -1
- package/dist/schema/Alert.d.ts +58 -0
- package/dist/schema/Alert.d.ts.map +1 -1
- package/dist/schema/Alert.js +68 -1
- package/dist/schema/Alert.js.map +1 -1
- package/dist/schema/resolveSchema.d.ts.map +1 -1
- package/dist/schema/resolveSchema.js +32 -0
- package/dist/schema/resolveSchema.js.map +1 -1
- package/package.json +12 -11
- package/src/Pilotiq.test.ts +78 -0
- package/src/Pilotiq.ts +20 -1
- package/src/actions/Action.test.ts +47 -0
- package/src/actions/Action.ts +35 -0
- package/src/elements/dispatchForm.ts +28 -0
- package/src/fields/BuilderField.ts +38 -1
- package/src/fields/FileUploadField.test.ts +46 -0
- package/src/fields/FileUploadField.ts +90 -2
- package/src/fields/RepeaterField.ts +45 -1
- package/src/fields/RowButton.test.ts +70 -0
- package/src/fields/RowButton.ts +11 -1
- package/src/fields/TextField.test.ts +168 -0
- package/src/fields/TextField.ts +141 -1
- package/src/filters/QueryBuilderFilter.test.ts +18 -0
- package/src/filters/queryBuilder/Constraint.ts +1 -1
- package/src/filters/queryBuilder/TextConstraint.ts +5 -6
- package/src/orm/modelDefaults.ts +1 -1
- package/src/react/SchemaRenderer.tsx +222 -14
- package/src/react/fields/BuilderInput.tsx +37 -0
- package/src/react/fields/FieldShell.tsx +13 -2
- package/src/react/fields/FileUploadInput.tsx +516 -85
- package/src/react/fields/RepeaterInput.tsx +39 -0
- package/src/react/fields/TextLikeInput.tsx +22 -2
- package/src/react/fields/rowChromeButton.tsx +102 -6
- package/src/react/fields/textInputControls.tsx +238 -0
- package/src/routes.ts +33 -1
- package/src/schema/Alert.test.ts +46 -0
- package/src/schema/Alert.ts +90 -8
- package/src/schema/resolveSchema.ts +32 -0
|
@@ -1,11 +1,117 @@
|
|
|
1
1
|
import { Field, type FieldMeta } from './Field.js';
|
|
2
2
|
import type { RenderContext } from '../schema/resolveSchema.js';
|
|
3
|
+
import type { Action } from '../actions/Action.js';
|
|
4
|
+
/**
|
|
5
|
+
* HTML5 `inputmode` values — drive the on-screen keyboard mobile browsers
|
|
6
|
+
* pop up. `'text'` is the default; the others map 1:1 to spec values.
|
|
7
|
+
*/
|
|
8
|
+
export type TextInputMode = 'none' | 'text' | 'numeric' | 'tel' | 'email' | 'decimal' | 'search' | 'url';
|
|
9
|
+
/**
|
|
10
|
+
* HTML5 `autocapitalize` values — control which characters mobile virtual
|
|
11
|
+
* keyboards capitalize automatically. `'off'` and `'none'` are aliases per
|
|
12
|
+
* spec; we surface only `'off'` for clarity.
|
|
13
|
+
*/
|
|
14
|
+
export type TextAutocapitalize = 'off' | 'sentences' | 'words' | 'characters';
|
|
15
|
+
/**
|
|
16
|
+
* Mask alphabet documented for `mask(pattern)`:
|
|
17
|
+
* `9` — digit (0-9)
|
|
18
|
+
* `a` — alpha (A-Za-z)
|
|
19
|
+
* `*` — alphanumeric or any character
|
|
20
|
+
* anything else — literal (rendered verbatim, skipped on input)
|
|
21
|
+
*
|
|
22
|
+
* Examples: `'(999) 999-9999'` (US phone), `'9999-9999-9999-9999'` (card),
|
|
23
|
+
* `'aaa-9999'` (custom). The renderer formats values keystroke-by-keystroke
|
|
24
|
+
* and strips literals from the submitted value so the persisted column
|
|
25
|
+
* stores the raw digits/letters.
|
|
26
|
+
*/
|
|
3
27
|
export declare class TextField extends Field {
|
|
4
28
|
private _maxLength?;
|
|
29
|
+
private _password;
|
|
30
|
+
private _revealable;
|
|
31
|
+
private _copyable;
|
|
32
|
+
private _copyMessage?;
|
|
33
|
+
private _mask?;
|
|
34
|
+
private _datalist?;
|
|
35
|
+
private _stripCharacters?;
|
|
36
|
+
private _inputMode?;
|
|
37
|
+
private _autocapitalize?;
|
|
38
|
+
private _prefixAction?;
|
|
39
|
+
private _suffixAction?;
|
|
5
40
|
private constructor();
|
|
6
41
|
static make(name: string): TextField;
|
|
7
42
|
maxLength(n: number): this;
|
|
8
43
|
getMaxLength(): number | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Render the input as `type="password"`. Pair with `revealable()` to
|
|
46
|
+
* surface an eye-icon toggle. Pure presentation — the column type +
|
|
47
|
+
* value handling stays string-shaped.
|
|
48
|
+
*/
|
|
49
|
+
password(v?: boolean): this;
|
|
50
|
+
/**
|
|
51
|
+
* Mount an eye-icon toggle in the suffix slot that flips the input
|
|
52
|
+
* type between `password` and `text`. No-op when the field is not in
|
|
53
|
+
* `password()` mode (the toggle hides itself client-side so a stray
|
|
54
|
+
* `revealable()` on a non-password input doesn't render a useless
|
|
55
|
+
* button).
|
|
56
|
+
*/
|
|
57
|
+
revealable(v?: boolean): this;
|
|
58
|
+
/**
|
|
59
|
+
* Mount a copy button in the suffix slot that writes the current input
|
|
60
|
+
* value to the clipboard. The optional message overrides the default
|
|
61
|
+
* `'Copied!'` toast text — same convention as
|
|
62
|
+
* `Column.copyMessage()`.
|
|
63
|
+
*/
|
|
64
|
+
copyable(message?: string): this;
|
|
65
|
+
/**
|
|
66
|
+
* Format the input keystroke-by-keystroke against the supplied mask
|
|
67
|
+
* pattern. See `TextField` doc-block for the alphabet (`9` = digit,
|
|
68
|
+
* `a` = alpha, `*` = any, literals passthrough). Submitted values are
|
|
69
|
+
* stripped of literal characters before the form body lands on the
|
|
70
|
+
* server — the persisted column stores the raw chars only.
|
|
71
|
+
*/
|
|
72
|
+
mask(pattern: string): this;
|
|
73
|
+
/**
|
|
74
|
+
* Suggest values via a native HTML5 `<datalist>` attached to the
|
|
75
|
+
* input. Browsers render an autocomplete dropdown; users can still
|
|
76
|
+
* type a value not on the list. Useful for canonical-but-not-exclusive
|
|
77
|
+
* sets (countries, departments, common email domains).
|
|
78
|
+
*/
|
|
79
|
+
datalist(values: string[]): this;
|
|
80
|
+
/**
|
|
81
|
+
* Strip the listed characters from the submitted value before
|
|
82
|
+
* validation runs. Pass a single string (each char becomes a strip
|
|
83
|
+
* token) or an array of strings. Useful for input-mask-style fields
|
|
84
|
+
* where the persisted column should not carry the mask literals
|
|
85
|
+
* (`'(' / ')' / '-' / ' '` for phone numbers, `' '` for credit cards).
|
|
86
|
+
* The strip applies on both create and edit — server-side authority,
|
|
87
|
+
* so a tampered client still gets cleaned values.
|
|
88
|
+
*/
|
|
89
|
+
stripCharacters(chars: string | string[]): this;
|
|
90
|
+
getStripCharacters(): string[] | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Set the HTML `inputmode` attribute — drives the virtual-keyboard
|
|
93
|
+
* layout on mobile. Distinct from `type=` (a `text` field with
|
|
94
|
+
* `inputMode('numeric')` still accepts non-digit pastes; for strict
|
|
95
|
+
* numeric-only, use `NumberField` instead).
|
|
96
|
+
*/
|
|
97
|
+
inputMode(mode: TextInputMode): this;
|
|
98
|
+
/** Set the HTML `autocapitalize` attribute. */
|
|
99
|
+
autocapitalize(mode: TextAutocapitalize): this;
|
|
100
|
+
/**
|
|
101
|
+
* Mount a clickable Action button in the prefix slot of the input
|
|
102
|
+
* shell. Distinct from the passive `prefix()` decoration (which is a
|
|
103
|
+
* string or icon descriptor only). Use this for an in-input affordance
|
|
104
|
+
* — e.g. an OAuth-style "Generate" button next to an API key field.
|
|
105
|
+
* The Action retains its full chrome (`.icon() / .color() / .visible()
|
|
106
|
+
* / .modal*()`); visibility rules evaluate through the standard schema
|
|
107
|
+
* walker the same way they do anywhere else.
|
|
108
|
+
*/
|
|
109
|
+
prefixAction(action: Action): this;
|
|
110
|
+
/** Suffix-slot variant of `prefixAction`. Same semantics. */
|
|
111
|
+
suffixAction(action: Action): this;
|
|
112
|
+
/** Read-only access for the resolver. */
|
|
113
|
+
getPrefixAction(): Action | undefined;
|
|
114
|
+
getSuffixAction(): Action | undefined;
|
|
9
115
|
toMeta(ctx?: RenderContext): FieldMeta;
|
|
10
116
|
}
|
|
11
117
|
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/fields/TextField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/fields/TextField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,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MAAM,GAAG,IAAI;IAMhC;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAE3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAEhC;;;;;;;;OAQG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAO/C,kBAAkB,IAAI,MAAM,EAAE,GAAG,SAAS;IAE1C;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAEpC,+CAA+C;IAC/C,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAE9C;;;;;;;;OAQG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAElC,6DAA6D;IAC7D,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAElC,yCAAyC;IACzC,eAAe,IAAI,MAAM,GAAG,SAAS;IACrC,eAAe,IAAI,MAAM,GAAG,SAAS;IAE5B,MAAM,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,SAAS;CAehD"}
|
package/dist/fields/TextField.js
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import { Field } from './Field.js';
|
|
2
|
+
/**
|
|
3
|
+
* Mask alphabet documented for `mask(pattern)`:
|
|
4
|
+
* `9` — digit (0-9)
|
|
5
|
+
* `a` — alpha (A-Za-z)
|
|
6
|
+
* `*` — alphanumeric or any character
|
|
7
|
+
* anything else — literal (rendered verbatim, skipped on input)
|
|
8
|
+
*
|
|
9
|
+
* Examples: `'(999) 999-9999'` (US phone), `'9999-9999-9999-9999'` (card),
|
|
10
|
+
* `'aaa-9999'` (custom). The renderer formats values keystroke-by-keystroke
|
|
11
|
+
* and strips literals from the submitted value so the persisted column
|
|
12
|
+
* stores the raw digits/letters.
|
|
13
|
+
*/
|
|
2
14
|
export class TextField extends Field {
|
|
3
15
|
_maxLength;
|
|
16
|
+
_password = false;
|
|
17
|
+
_revealable = false;
|
|
18
|
+
_copyable = false;
|
|
19
|
+
_copyMessage;
|
|
20
|
+
_mask;
|
|
21
|
+
_datalist;
|
|
22
|
+
_stripCharacters;
|
|
23
|
+
_inputMode;
|
|
24
|
+
_autocapitalize;
|
|
25
|
+
_prefixAction;
|
|
26
|
+
_suffixAction;
|
|
4
27
|
constructor(name) {
|
|
5
28
|
super(name, 'text');
|
|
6
29
|
}
|
|
@@ -9,10 +32,102 @@ export class TextField extends Field {
|
|
|
9
32
|
}
|
|
10
33
|
maxLength(n) { this._maxLength = n; return this; }
|
|
11
34
|
getMaxLength() { return this._maxLength; }
|
|
35
|
+
/**
|
|
36
|
+
* Render the input as `type="password"`. Pair with `revealable()` to
|
|
37
|
+
* surface an eye-icon toggle. Pure presentation — the column type +
|
|
38
|
+
* value handling stays string-shaped.
|
|
39
|
+
*/
|
|
40
|
+
password(v = true) { this._password = v; return this; }
|
|
41
|
+
/**
|
|
42
|
+
* Mount an eye-icon toggle in the suffix slot that flips the input
|
|
43
|
+
* type between `password` and `text`. No-op when the field is not in
|
|
44
|
+
* `password()` mode (the toggle hides itself client-side so a stray
|
|
45
|
+
* `revealable()` on a non-password input doesn't render a useless
|
|
46
|
+
* button).
|
|
47
|
+
*/
|
|
48
|
+
revealable(v = true) { this._revealable = v; return this; }
|
|
49
|
+
/**
|
|
50
|
+
* Mount a copy button in the suffix slot that writes the current input
|
|
51
|
+
* value to the clipboard. The optional message overrides the default
|
|
52
|
+
* `'Copied!'` toast text — same convention as
|
|
53
|
+
* `Column.copyMessage()`.
|
|
54
|
+
*/
|
|
55
|
+
copyable(message) {
|
|
56
|
+
this._copyable = true;
|
|
57
|
+
if (message !== undefined)
|
|
58
|
+
this._copyMessage = message;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Format the input keystroke-by-keystroke against the supplied mask
|
|
63
|
+
* pattern. See `TextField` doc-block for the alphabet (`9` = digit,
|
|
64
|
+
* `a` = alpha, `*` = any, literals passthrough). Submitted values are
|
|
65
|
+
* stripped of literal characters before the form body lands on the
|
|
66
|
+
* server — the persisted column stores the raw chars only.
|
|
67
|
+
*/
|
|
68
|
+
mask(pattern) { this._mask = pattern; return this; }
|
|
69
|
+
/**
|
|
70
|
+
* Suggest values via a native HTML5 `<datalist>` attached to the
|
|
71
|
+
* input. Browsers render an autocomplete dropdown; users can still
|
|
72
|
+
* type a value not on the list. Useful for canonical-but-not-exclusive
|
|
73
|
+
* sets (countries, departments, common email domains).
|
|
74
|
+
*/
|
|
75
|
+
datalist(values) { this._datalist = values.slice(); return this; }
|
|
76
|
+
/**
|
|
77
|
+
* Strip the listed characters from the submitted value before
|
|
78
|
+
* validation runs. Pass a single string (each char becomes a strip
|
|
79
|
+
* token) or an array of strings. Useful for input-mask-style fields
|
|
80
|
+
* where the persisted column should not carry the mask literals
|
|
81
|
+
* (`'(' / ')' / '-' / ' '` for phone numbers, `' '` for credit cards).
|
|
82
|
+
* The strip applies on both create and edit — server-side authority,
|
|
83
|
+
* so a tampered client still gets cleaned values.
|
|
84
|
+
*/
|
|
85
|
+
stripCharacters(chars) {
|
|
86
|
+
const list = typeof chars === 'string' ? Array.from(chars) : [...chars];
|
|
87
|
+
if (list.length === 0)
|
|
88
|
+
delete this._stripCharacters;
|
|
89
|
+
else
|
|
90
|
+
this._stripCharacters = list;
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
getStripCharacters() { return this._stripCharacters; }
|
|
94
|
+
/**
|
|
95
|
+
* Set the HTML `inputmode` attribute — drives the virtual-keyboard
|
|
96
|
+
* layout on mobile. Distinct from `type=` (a `text` field with
|
|
97
|
+
* `inputMode('numeric')` still accepts non-digit pastes; for strict
|
|
98
|
+
* numeric-only, use `NumberField` instead).
|
|
99
|
+
*/
|
|
100
|
+
inputMode(mode) { this._inputMode = mode; return this; }
|
|
101
|
+
/** Set the HTML `autocapitalize` attribute. */
|
|
102
|
+
autocapitalize(mode) { this._autocapitalize = mode; return this; }
|
|
103
|
+
/**
|
|
104
|
+
* Mount a clickable Action button in the prefix slot of the input
|
|
105
|
+
* shell. Distinct from the passive `prefix()` decoration (which is a
|
|
106
|
+
* string or icon descriptor only). Use this for an in-input affordance
|
|
107
|
+
* — e.g. an OAuth-style "Generate" button next to an API key field.
|
|
108
|
+
* The Action retains its full chrome (`.icon() / .color() / .visible()
|
|
109
|
+
* / .modal*()`); visibility rules evaluate through the standard schema
|
|
110
|
+
* walker the same way they do anywhere else.
|
|
111
|
+
*/
|
|
112
|
+
prefixAction(action) { this._prefixAction = action; return this; }
|
|
113
|
+
/** Suffix-slot variant of `prefixAction`. Same semantics. */
|
|
114
|
+
suffixAction(action) { this._suffixAction = action; return this; }
|
|
115
|
+
/** Read-only access for the resolver. */
|
|
116
|
+
getPrefixAction() { return this._prefixAction; }
|
|
117
|
+
getSuffixAction() { return this._suffixAction; }
|
|
12
118
|
toMeta(ctx) {
|
|
13
119
|
return {
|
|
14
120
|
...this.buildMeta(ctx),
|
|
15
121
|
...(this._maxLength !== undefined ? { maxLength: this._maxLength } : {}),
|
|
122
|
+
...(this._password ? { password: true } : {}),
|
|
123
|
+
...(this._revealable ? { revealable: true } : {}),
|
|
124
|
+
...(this._copyable ? { copyable: true } : {}),
|
|
125
|
+
...(this._copyMessage !== undefined ? { copyMessage: this._copyMessage } : {}),
|
|
126
|
+
...(this._mask !== undefined ? { mask: this._mask } : {}),
|
|
127
|
+
...(this._datalist !== undefined ? { datalist: this._datalist } : {}),
|
|
128
|
+
...(this._stripCharacters !== undefined ? { stripCharacters: this._stripCharacters } : {}),
|
|
129
|
+
...(this._inputMode !== undefined ? { inputMode: this._inputMode } : {}),
|
|
130
|
+
...(this._autocapitalize !== undefined ? { autocapitalize: this._autocapitalize } : {}),
|
|
16
131
|
};
|
|
17
132
|
}
|
|
18
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../src/fields/TextField.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,IAAI,CAAC,gBAAgB,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACvF,GAAG,CAAC,IAAI,CAAC,UAAU,KAAU,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAO,IAAI,CAAC,UAAU,EAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACvF,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxF,CAAA;IACH,CAAC;CACF"}
|
|
@@ -12,7 +12,7 @@ export type ConstraintValueKind = 'text' | 'number' | 'date' | 'dateTime' | 'sel
|
|
|
12
12
|
* via `getOperators()`. Storage / URL value rules reference operators by
|
|
13
13
|
* this string.
|
|
14
14
|
*/
|
|
15
|
-
export type ConstraintOperatorName = 'equals' | 'notEquals' | 'contains' | 'startsWith' | 'endsWith' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'before' | 'after' | 'dateBetween' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty' | 'isTrue' | 'isFalse';
|
|
15
|
+
export type ConstraintOperatorName = 'equals' | 'notEquals' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'before' | 'after' | 'dateBetween' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty' | 'isTrue' | 'isFalse';
|
|
16
16
|
/** A single operator option with renderer-side label + value-input kind. */
|
|
17
17
|
export interface ConstraintOperator {
|
|
18
18
|
name: ConstraintOperatorName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constraint.d.ts","sourceRoot":"","sources":["../../../src/filters/queryBuilder/Constraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,QAAQ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AC,EAAE,sBAAsB,CAAA;CACzC;AAED;;;;;;;;;;;GAWG;AACH,8BAAsB,UAAU;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAEzB,SAAS,aAAa,IAAI,EAAE,MAAM;IAIlC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAEtB,QAAQ,IAAI,MAAM;IAIlB,iEAAiE;IACjE,QAAQ,CAAC,YAAY,IAAI,kBAAkB,EAAE;IAE7C,uEAAuE;IACvE,kBAAkB,IAAI,sBAAsB;IAK5C,mEAAmE;IACnE,UAAU,IAAI,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS;IAEjE;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,sBAAsB,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU;IAE/F,iDAAiD;IACjD,MAAM,IAAI,cAAc;CAYzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextConstraint.d.ts","sourceRoot":"","sources":["../../../src/filters/queryBuilder/TextConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"TextConstraint.d.ts","sourceRoot":"","sources":["../../../src/filters/queryBuilder/TextConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAa5D;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAEhC,YAAY,IAAI,kBAAkB,EAAE;IAEpC,kBAAkB,IAAI,sBAAsB;IAE5C,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,sBAAsB,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU;CAiBhG"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Constraint } from './Constraint.js';
|
|
2
|
-
// `notContains` is intentionally omitted in v1 — the rudder Prisma adapter
|
|
3
|
-
// doesn't translate `NOT LIKE` (only `LIKE`). Re-add once the adapter
|
|
4
|
-
// learns negation, mirrored on the pilotiq `ModelWhereOperator` union.
|
|
5
2
|
const OPERATORS = [
|
|
6
3
|
{ name: 'contains', label: 'Contains', valueKind: 'text' },
|
|
4
|
+
{ name: 'notContains', label: 'Does not contain', valueKind: 'text' },
|
|
7
5
|
{ name: 'equals', label: 'Equals', valueKind: 'text' },
|
|
8
6
|
{ name: 'notEquals', label: 'Does not equal', valueKind: 'text' },
|
|
9
7
|
{ name: 'startsWith', label: 'Starts with', valueKind: 'text' },
|
|
@@ -34,6 +32,7 @@ export class TextConstraint extends Constraint {
|
|
|
34
32
|
return query;
|
|
35
33
|
switch (operator) {
|
|
36
34
|
case 'contains': return query.where(this.name, 'LIKE', `%${escapeLike(v)}%`);
|
|
35
|
+
case 'notContains': return query.where(this.name, 'NOT LIKE', `%${escapeLike(v)}%`);
|
|
37
36
|
case 'startsWith': return query.where(this.name, 'LIKE', `${escapeLike(v)}%`);
|
|
38
37
|
case 'endsWith': return query.where(this.name, 'LIKE', `%${escapeLike(v)}`);
|
|
39
38
|
case 'equals': return query.where(this.name, '=', v);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextConstraint.js","sourceRoot":"","sources":["../../../src/filters/queryBuilder/TextConstraint.ts"],"names":[],"mappings":"AAAA,OA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C1D,OAAO,CAAC,CAAY,OAAO,KAAK,CAAA;QAClC,CAAC;IACH,CAAC;CACF;AAED,SAAS,gBAAgB,CAAC,CAAa,EAAE,GAAW;IAClD,IAAI,OAAO,CAAC,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;AAC9B,CAAC;AAED,SAAS,uBAAuB,CAAC,CAAa,EAAE,GAAW;IACzD,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;AAC/B,CAAC;AAED,6EAA6E;AAC7E,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAC/E,CAAC"}
|
|
@@ -6,7 +6,7 @@ import type { SaveHandler, LoadRecordHandler } from '../elements/Form.js';
|
|
|
6
6
|
* structurally assignable to `ModelLike` — but pilotiq doesn't import
|
|
7
7
|
* `@rudderjs/contracts` here to keep this file dependency-light.
|
|
8
8
|
*/
|
|
9
|
-
export type ModelWhereOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'LIKE' | 'IN' | 'NOT IN';
|
|
9
|
+
export type ModelWhereOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'LIKE' | 'NOT LIKE' | 'IN' | 'NOT IN';
|
|
10
10
|
/**
|
|
11
11
|
* Context passed into `Resource.query(ctx)`. Carries the resolved user so
|
|
12
12
|
* tenant-scoping / role-driven default ordering / etc. can branch on it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelDefaults.d.ts","sourceRoot":"","sources":["../../src/orm/modelDefaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAsB,MAAM,sBAAsB,CAAA;AAC1F,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAe,MAAM,qBAAqB,CAAA;AAEtF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"modelDefaults.d.ts","sourceRoot":"","sources":["../../src/orm/modelDefaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAsB,MAAM,sBAAsB,CAAA;AAC1F,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAe,MAAM,qBAAqB,CAAA;AAEtF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,QAAQ,CAAA;AAE7G;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;2EACuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAK,MAAM,CAAA;IACf,KAAK,CAAC,EAAG,SAAS,CAAA;IAClB,KAAK,CAAC,GAAG,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAAA;IACjD,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EA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AAgB,0BAA0B,CACxC,WAAW,EAAE,SAAS,EACtB,IAAI,EAAS,MAAM,GAClB,uBAAuB,GAAG,SAAS,CAcrC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAM,OAAO,EACnB,UAAU,EAAE,uBAAuB,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBzB;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,UAAU,CASrF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAY,SAAS,EACtB,MAAM,EAAO,OAAO,EACpB,YAAY,EAAE,MAAM,GACnB,UAAU,CAKZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAG,SAAS,EACvB,MAAM,EAAQ,OAAO,EACrB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAS,KAAK,GAClB,mBAAmB,CA4CrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaRenderer.d.ts","sourceRoot":"","sources":["../../src/react/SchemaRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"SchemaRenderer.d.ts","sourceRoot":"","sources":["../../src/react/SchemaRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AA2HvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,WAAW,EAAE,CAAA;IACxB,MAAM,CAAC,EAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAapF;AAodD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAExE,KAAK,MAAM,GAAM,CAAC,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,IAAI,CAAA;AAC7E,KAAK,QAAQ,GAAI,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;AAkDtC;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAO,MAAM,EAChB,GAAG,EAAO,MAAM,EAAE,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAI,MAAM,EAChB,MAAM,GAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACrC,YAAY,CAAC,EAAE,QAAQ,GACtB,OAAO,CAAC,IAAI,CAAC,CAoCf;AAilFD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAC/B,KAAK,CAAC,SAAS,CAejB;AA41FD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,mBAAmB,kDAW3E"}
|
|
@@ -7,6 +7,7 @@ import { Input } from './ui/input.js';
|
|
|
7
7
|
import { Popover, PopoverTrigger, PopoverContent } from './ui/popover.js';
|
|
8
8
|
import { FieldShell } from './fields/FieldShell.js';
|
|
9
9
|
import { TextLikeInput } from './fields/TextLikeInput.js';
|
|
10
|
+
import { useTextInputControls } from './fields/textInputControls.js';
|
|
10
11
|
import { SelectFieldInput } from './fields/SelectFieldInput.js';
|
|
11
12
|
import { ToggleFieldInput } from './fields/ToggleFieldInput.js';
|
|
12
13
|
import { DateFieldInput } from './fields/DateFieldInput.js';
|
|
@@ -30,7 +31,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '
|
|
|
30
31
|
import { Table as DataTable, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from './ui/table.js';
|
|
31
32
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from './ui/dropdown-menu.js';
|
|
32
33
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from './ui/tooltip.js';
|
|
33
|
-
import { FilterIcon, CircleIcon, InboxIcon, GripVerticalIcon, ChevronDownIcon, CopyIcon, CheckIcon, XIcon, } from 'lucide-react';
|
|
34
|
+
import { FilterIcon, CircleIcon, InboxIcon, GripVerticalIcon, ChevronDownIcon, CopyIcon, CheckIcon, XIcon, InfoIcon, TriangleAlertIcon, CircleCheckIcon, CircleAlertIcon, } from 'lucide-react';
|
|
34
35
|
import { useNavigate } from './navigate.js';
|
|
35
36
|
import { parseDateRangeValue, encodeDateRangeValue, } from '../filters/DateRangeFilter.js';
|
|
36
37
|
import { parseMultiSelectValue, encodeMultiSelectValue, } from '../filters/MultiSelectFilter.js';
|
|
@@ -106,9 +107,39 @@ function renderField(el, index) {
|
|
|
106
107
|
if (Custom) {
|
|
107
108
|
return (_jsx(FieldShell, { el: el, name: name, label: label, required: required, children: _jsx(Custom, { el: el, name: name, defaultValue: defaultValue, required: required, disabled: disabled, placeholder: placeholder }) }, index));
|
|
108
109
|
}
|
|
110
|
+
// TextField (and slug) rich affordances live in a dedicated shell so
|
|
111
|
+
// `useTextInputControls` can hold reveal-toggle / mask state via React
|
|
112
|
+
// hooks (renderField itself is a plain function, hooks would violate
|
|
113
|
+
// rules-of-hooks here).
|
|
114
|
+
if (fieldType === 'text' || fieldType === 'slug') {
|
|
115
|
+
return (_jsx(TextFieldShell, { el: el, name: name, label: label, required: required, common: common }, index));
|
|
116
|
+
}
|
|
109
117
|
const input = renderFieldInput(fieldType, el, name, defaultValue, defaultStr, common, disabled, required, placeholder);
|
|
110
118
|
return (_jsx(FieldShell, { el: el, name: name, label: label, required: required, children: input }, index));
|
|
111
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Component-shape TextField renderer — wraps the input shell so we can
|
|
122
|
+
* use `useTextInputControls()` (which holds the eye-toggle / mask state).
|
|
123
|
+
* Keeps `renderField` itself hook-free.
|
|
124
|
+
*/
|
|
125
|
+
function TextFieldShell({ el, name, label, required, common, }) {
|
|
126
|
+
const controls = useTextInputControls(el, name, (m) => renderElement(m, 0));
|
|
127
|
+
// Build the input with all the new HTML attrs (inputMode /
|
|
128
|
+
// autocapitalize / list / maxLength + the password/text type from
|
|
129
|
+
// the controls hook).
|
|
130
|
+
const textExtra = {};
|
|
131
|
+
if (el['maxLength'] !== undefined)
|
|
132
|
+
textExtra['maxLength'] = Number(el['maxLength']);
|
|
133
|
+
if (el['inputMode'] !== undefined)
|
|
134
|
+
textExtra['inputMode'] = String(el['inputMode']);
|
|
135
|
+
if (el['autocapitalize'] !== undefined)
|
|
136
|
+
textExtra['autoCapitalize'] = String(el['autocapitalize']);
|
|
137
|
+
if (Array.isArray(el['datalist']))
|
|
138
|
+
textExtra['list'] = `${name}__datalist`;
|
|
139
|
+
const datalist = Array.isArray(el['datalist']) ? el['datalist'] : undefined;
|
|
140
|
+
const input = (_jsxs(_Fragment, { children: [_jsx(TextLikeInput, { el: el, name: name, common: common, type: controls.type, extraProps: textExtra, multiline: false, applyMask: controls.applyMask }), datalist && (_jsx("datalist", { id: `${name}__datalist`, children: datalist.map((v, i) => _jsx("option", { value: v }, i)) }))] }));
|
|
141
|
+
return (_jsx(FieldShell, { el: el, name: name, label: label, required: required, before: controls.before, after: controls.after, children: input }));
|
|
142
|
+
}
|
|
112
143
|
function renderFieldInput(fieldType, el, name, defaultValue, defaultStr, common, disabled, required, placeholder) {
|
|
113
144
|
switch (fieldType) {
|
|
114
145
|
case 'textarea': {
|
|
@@ -178,7 +209,13 @@ function renderFieldInput(fieldType, el, name, defaultValue, defaultStr, common,
|
|
|
178
209
|
return (_jsx(TagsInput, { name: name, defaultValue: defaultValue, disabled: disabled, placeholder: placeholder, suggestions: suggestions, separator: separator, splitKeys: splitKeys, maxTags: maxTags, reorderable: reorderable }));
|
|
179
210
|
}
|
|
180
211
|
case 'fileUpload': {
|
|
181
|
-
return (_jsx(FileUploadInput, { name: name, defaultValue: defaultValue, disabled: disabled, accept: el['accept'], maxSize: typeof el['maxSize'] === 'number' ? el['maxSize'] : undefined, multiple: Boolean(el['multiple']), preview: el['preview'] !== false, directory: typeof el['directory'] === 'string' ? el['directory'] : undefined, uploadUrl: typeof el['uploadUrl'] === 'string' ? el['uploadUrl'] : undefined
|
|
212
|
+
return (_jsx(FileUploadInput, { name: name, defaultValue: defaultValue, disabled: disabled, accept: el['accept'], maxSize: typeof el['maxSize'] === 'number' ? el['maxSize'] : undefined, multiple: Boolean(el['multiple']), preview: el['preview'] !== false, directory: typeof el['directory'] === 'string' ? el['directory'] : undefined, uploadUrl: typeof el['uploadUrl'] === 'string' ? el['uploadUrl'] : undefined, downloadable: Boolean(el['downloadable']), openable: Boolean(el['openable']), reorderable: Boolean(el['reorderable']), appendFiles: Boolean(el['appendFiles']), panelLayout: el['panelLayout'] === 'grid' ? 'grid'
|
|
213
|
+
: el['panelLayout'] === 'integrated' ? 'integrated'
|
|
214
|
+
: 'list', ...(el['automaticallyResize'] && typeof el['automaticallyResize'] === 'object'
|
|
215
|
+
? { automaticallyResize: el['automaticallyResize'] }
|
|
216
|
+
: {}), imageEditor: Boolean(el['imageEditor']), circleCropper: Boolean(el['circleCropper']), automaticallyCropImagesToAspectRatio: Boolean(el['automaticallyCropImagesToAspectRatio']), ...(Array.isArray(el['imageEditorAspectRatioOptions'])
|
|
217
|
+
? { imageEditorAspectRatioOptions: el['imageEditorAspectRatioOptions'] }
|
|
218
|
+
: {}) }));
|
|
182
219
|
}
|
|
183
220
|
case 'markdown': {
|
|
184
221
|
const toolbarButtons = el['toolbarButtons'] ?? [];
|
|
@@ -403,6 +440,9 @@ function ActionModalDialog({ trigger, meta, ids, initialValues = {}, open: contr
|
|
|
403
440
|
const dispatchUrl = meta['dispatchUrl'];
|
|
404
441
|
const fields = (meta.children ?? []);
|
|
405
442
|
const hasForm = fields.length > 0;
|
|
443
|
+
// Filament v5 — auxiliary Elements stamped by the resolver between
|
|
444
|
+
// the body and the footer (Alert / Text / Heading / Action / …).
|
|
445
|
+
const contentFooter = (meta['modalContentFooter'] ?? []);
|
|
406
446
|
const heading = modal?.heading ?? confirm?.title ?? (hasForm ? String(meta['label'] ?? 'Submit') : 'Are you sure?');
|
|
407
447
|
const description = modal?.description ?? confirm?.message;
|
|
408
448
|
const submitLabel = modal?.submitLabel ?? (destructive ? 'Delete' : (hasForm ? 'Submit' : 'Confirm'));
|
|
@@ -534,7 +574,7 @@ function ActionModalDialog({ trigger, meta, ids, initialValues = {}, open: contr
|
|
|
534
574
|
if (!o)
|
|
535
575
|
reset();
|
|
536
576
|
setOpen(o);
|
|
537
|
-
}, children: _jsxs(DialogContent, { className: popupClass, children: [showCloseButton && (_jsx("button", { type: "button", "aria-label": "Close", onClick: () => setOpen(false), className: "absolute top-3 right-3 z-20 inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground", children: _jsx(XIcon, { className: "size-4" }) })), _jsxs("form", { ref: formRef, onSubmit: onSubmit, className: formCls, children: [_jsxs(DialogHeader, { className: headerCls, children: [_jsxs(DialogTitle, { className: modal?.icon ? 'flex items-center gap-2' : undefined, children: [HeaderIcon && (_jsx(HeaderIcon, { "aria-hidden": true, className: `size-5 shrink-0 ${iconColorClass ?? ''}`.trim() })), _jsx("span", { children: heading })] }), description && _jsx(DialogDescription, { children: description })] }), hasForm && (
|
|
577
|
+
}, children: _jsxs(DialogContent, { className: popupClass, children: [showCloseButton && (_jsx("button", { type: "button", "aria-label": "Close", onClick: () => setOpen(false), className: "absolute top-3 right-3 z-20 inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground", children: _jsx(XIcon, { className: "size-4" }) })), _jsxs("form", { ref: formRef, onSubmit: onSubmit, className: formCls, children: [_jsxs(DialogHeader, { className: headerCls, children: [_jsxs(DialogTitle, { className: modal?.icon ? 'flex items-center gap-2' : undefined, children: [HeaderIcon && (_jsx(HeaderIcon, { "aria-hidden": true, className: `size-5 shrink-0 ${iconColorClass ?? ''}`.trim() })), _jsx("span", { children: heading })] }), description && _jsx(DialogDescription, { children: description })] }), (hasForm || contentFooter.length > 0) && (_jsxs("div", { className: `flex flex-col gap-3 py-2 ${bodyCls}`.trim(), children: [fields.map((f, i) => renderFormChild(f, i, initialValues, errors)), contentFooter.map((c, i) => renderElement(c, fields.length + i))] })), !hasForm && contentFooter.length === 0 && stickyMode && _jsx("div", { className: bodyCls }), serverError && (_jsx("p", { className: `py-2 text-sm text-destructive ${stickyMode ? 'px-6' : ''}`.trim(), children: serverError })), _jsxs(DialogFooter, { className: footerCls, children: [_jsx("button", { type: "button", onClick: () => setOpen(false), className: cancelClass, children: cancelLabel }), _jsx("button", { type: "submit", disabled: submitting, autoFocus: submitAutofocus, className: confirmClass, children: submitting ? 'Working…' : submitLabel })] })] })] }) })] }));
|
|
538
578
|
}
|
|
539
579
|
/**
|
|
540
580
|
* Confirm-style dialog wrapping an action's button. The trigger button is
|
|
@@ -1460,6 +1500,70 @@ function EntryCopyButton({ text, label }) {
|
|
|
1460
1500
|
};
|
|
1461
1501
|
return (_jsx("button", { type: "button", onClick: handleClick, "aria-label": label, title: label, className: "inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted", children: copied ? _jsx(CheckIcon, { className: "size-3.5" }) : _jsx(CopyIcon, { className: "size-3.5" }) }));
|
|
1462
1502
|
}
|
|
1503
|
+
// ─── Alert renderer ─────────────────────────────────────────
|
|
1504
|
+
//
|
|
1505
|
+
// Owns dismissal state (per-mount + optional localStorage persistence)
|
|
1506
|
+
// + icon dispatch + footer-actions alignment. Lifted out of the inline
|
|
1507
|
+
// `case 'alert'` branch when Alert gained `dismissible() / iconColor() /
|
|
1508
|
+
// footerActionsAlignment()` setters — those need component-local state
|
|
1509
|
+
// (the dismiss button, the persisted-dismissal hydration on mount), and
|
|
1510
|
+
// inlining the hooks under a switch arm is fragile.
|
|
1511
|
+
const ALERT_TYPE_ICONS = {
|
|
1512
|
+
info: InfoIcon,
|
|
1513
|
+
warning: TriangleAlertIcon,
|
|
1514
|
+
success: CircleCheckIcon,
|
|
1515
|
+
danger: CircleAlertIcon,
|
|
1516
|
+
};
|
|
1517
|
+
const ALERT_TYPE_DEFAULT_ICON_COLOR = {
|
|
1518
|
+
info: 'info',
|
|
1519
|
+
warning: 'warning',
|
|
1520
|
+
success: 'success',
|
|
1521
|
+
danger: 'destructive',
|
|
1522
|
+
};
|
|
1523
|
+
const ALERT_ACTIONS_ALIGNMENT = {
|
|
1524
|
+
start: 'justify-start',
|
|
1525
|
+
center: 'justify-center',
|
|
1526
|
+
end: 'justify-end',
|
|
1527
|
+
};
|
|
1528
|
+
function alertPersistKey(persistKey) {
|
|
1529
|
+
return `pilotiq.alert.${persistKey}`;
|
|
1530
|
+
}
|
|
1531
|
+
function AlertRenderer(props) {
|
|
1532
|
+
const { alertType, content, title, dismissible, persistDismissal, iconColor, actionsAlignment, footer, } = props;
|
|
1533
|
+
const [dismissed, setDismissed] = useState(false);
|
|
1534
|
+
// Hydrate persisted-dismissal on first paint. `useState(false)` keeps
|
|
1535
|
+
// SSR + first client paint identical (Hydration safe); the effect
|
|
1536
|
+
// flips to dismissed if localStorage has the flag set.
|
|
1537
|
+
useEffect(() => {
|
|
1538
|
+
if (!persistDismissal)
|
|
1539
|
+
return;
|
|
1540
|
+
if (typeof window === 'undefined')
|
|
1541
|
+
return;
|
|
1542
|
+
try {
|
|
1543
|
+
if (window.localStorage.getItem(alertPersistKey(persistDismissal)) === '1') {
|
|
1544
|
+
setDismissed(true);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
catch { /* localStorage blocked (Safari ITP / SSR) — render visible */ }
|
|
1548
|
+
}, [persistDismissal]);
|
|
1549
|
+
if (dismissed)
|
|
1550
|
+
return null;
|
|
1551
|
+
const styles = alertStyles[alertType] ?? alertStyles['info'];
|
|
1552
|
+
const Icon = ALERT_TYPE_ICONS[alertType] ?? InfoIcon;
|
|
1553
|
+
const iconColorKey = iconColor ?? ALERT_TYPE_DEFAULT_ICON_COLOR[alertType] ?? 'info';
|
|
1554
|
+
const iconColorCls = TEXT_COLOR_CLASSES[iconColorKey] ?? '';
|
|
1555
|
+
const alignCls = ALERT_ACTIONS_ALIGNMENT[actionsAlignment ?? 'start'] ?? 'justify-start';
|
|
1556
|
+
const handleDismiss = () => {
|
|
1557
|
+
setDismissed(true);
|
|
1558
|
+
if (persistDismissal && typeof window !== 'undefined') {
|
|
1559
|
+
try {
|
|
1560
|
+
window.localStorage.setItem(alertPersistKey(persistDismissal), '1');
|
|
1561
|
+
}
|
|
1562
|
+
catch { /* localStorage blocked — dismiss is per-mount only */ }
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
return (_jsxs("div", { className: `relative rounded-lg border p-4 ${styles} ${dismissible ? 'pr-9' : ''}`, children: [_jsxs("div", { className: "flex gap-3", children: [_jsx(Icon, { className: `size-5 shrink-0 mt-0.5 ${iconColorCls}`, "aria-hidden": "true" }), _jsxs("div", { className: "flex-1 min-w-0", children: [title !== undefined && _jsx("p", { className: "font-medium mb-1", children: title }), _jsx("p", { className: "text-sm", children: content }), footer.length > 0 && (_jsx("div", { className: `flex items-center gap-2 mt-3 ${alignCls}`, children: footer }))] })] }), dismissible && (_jsx("button", { type: "button", onClick: handleDismiss, "aria-label": "Dismiss", title: "Dismiss", className: "absolute top-3 right-3 inline-flex h-6 w-6 items-center justify-center rounded opacity-70 hover:opacity-100 transition-opacity", children: _jsx(XIcon, { className: "size-4", "aria-hidden": "true" }) }))] }));
|
|
1566
|
+
}
|
|
1463
1567
|
function renderElement(el, index) {
|
|
1464
1568
|
switch (el.type) {
|
|
1465
1569
|
case 'text':
|
|
@@ -1508,11 +1612,8 @@ function renderElement(el, index) {
|
|
|
1508
1612
|
return (_jsxs("div", { className: "flex items-start justify-between gap-4", children: [titleBlock, _jsx("div", { className: "flex items-center gap-2 shrink-0", children: headerActions.map((a, i) => renderActionLike(a, i)) })] }, index));
|
|
1509
1613
|
}
|
|
1510
1614
|
case 'alert': {
|
|
1511
|
-
const alertType = String(el['alertType'] ?? 'info');
|
|
1512
|
-
const styles = alertStyles[alertType] ?? alertStyles['info'];
|
|
1513
|
-
const title = el['title'] ? String(el['title']) : undefined;
|
|
1514
1615
|
const footer = (el.children ?? []).filter(c => c.type === 'action' || c.type === 'actionGroup');
|
|
1515
|
-
return (
|
|
1616
|
+
return (_jsx(AlertRenderer, { alertType: String(el['alertType'] ?? 'info'), content: String(el['content'] ?? ''), ...(el['title'] !== undefined ? { title: String(el['title']) } : {}), ...(el['dismissible'] ? { dismissible: Boolean(el['dismissible']) } : {}), ...(el['persistDismissal'] !== undefined ? { persistDismissal: String(el['persistDismissal']) } : {}), ...(el['iconColor'] !== undefined ? { iconColor: String(el['iconColor']) } : {}), ...(el['actionsAlignment'] !== undefined ? { actionsAlignment: String(el['actionsAlignment']) } : {}), footer: footer.map((a, i) => renderActionLike(a, i)) }, index));
|
|
1516
1617
|
}
|
|
1517
1618
|
case 'emptyState': {
|
|
1518
1619
|
const heading = String(el['heading'] ?? '');
|