@selfhelp/shared 1.23.0 → 1.25.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/CHANGELOG.md +127 -0
- package/dist/index.d.mts +300 -100
- package/dist/index.d.ts +300 -100
- package/dist/index.js +531 -3
- package/dist/index.mjs +506 -3
- package/dist/plugin-sdk/index.d.mts +1 -1
- package/dist/plugin-sdk/index.d.ts +1 -1
- package/dist/plugin-sdk/index.js +7 -1
- package/dist/plugin-sdk/index.mjs +7 -1
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry/index.js +15 -1
- package/dist/registry/index.mjs +14 -1
- package/dist/{styles.registry-BBd9T2Ox.d.ts → styles.registry-C2ACy7H0.d.ts} +734 -2
- package/dist/{styles.registry-IjDTff8P.d.mts → styles.registry-DnIJqEzM.d.mts} +734 -2
- package/package.json +1 -1
- package/src/api/__tests__/endpoints.test.ts +45 -0
- package/src/api/__tests__/formListErrors.test.ts +143 -0
- package/src/api/endpoints.ts +41 -0
- package/src/api/formListErrors.ts +134 -0
- package/src/api/index.ts +1 -0
- package/src/content/__tests__/formListState.test.ts +448 -0
- package/src/content/__tests__/formRecordPrefill.test.ts +120 -0
- package/src/content/formListState.ts +559 -0
- package/src/content/formRecordPrefill.ts +108 -5
- package/src/content/index.ts +1 -0
- package/src/registry/__tests__/platform.test.ts +15 -6
- package/src/registry/__tests__/registry.test.ts +14 -0
- package/src/registry/styles.registry.ts +23 -0
- package/src/types/api/__tests__/formWrites.test.ts +84 -0
- package/src/types/api/form-lists.ts +475 -0
- package/src/types/api/forms.ts +149 -4
- package/src/types/api/index.ts +1 -0
- package/src/types/styles/__tests__/entryFormListFormFields.test.ts +44 -0
- package/src/types/styles/composite.ts +13 -0
- package/src/types/styles/forms.ts +124 -0
- package/src/types/styles/unknown.ts +5 -1
|
@@ -662,6 +662,603 @@ interface INotificationStyle extends IStyleWithSpacing {
|
|
|
662
662
|
radius?: IContentField<TSharedRadius>;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
+
/**
|
|
666
|
+
* Common API envelope returned by the Symfony backend's ApiResponseFormatter.
|
|
667
|
+
*/
|
|
668
|
+
interface IApiMeta {
|
|
669
|
+
version: string;
|
|
670
|
+
timestamp: string;
|
|
671
|
+
}
|
|
672
|
+
type IMeta = IApiMeta;
|
|
673
|
+
interface IBaseApiResponse<TData> {
|
|
674
|
+
status: number;
|
|
675
|
+
message: string;
|
|
676
|
+
error: null | string;
|
|
677
|
+
error_type?: string;
|
|
678
|
+
logged_in: boolean;
|
|
679
|
+
meta: IApiMeta;
|
|
680
|
+
data: TData;
|
|
681
|
+
}
|
|
682
|
+
interface IApiError {
|
|
683
|
+
status: number;
|
|
684
|
+
message: string;
|
|
685
|
+
error: string;
|
|
686
|
+
error_type?: string;
|
|
687
|
+
logged_in?: boolean;
|
|
688
|
+
meta?: IApiMeta;
|
|
689
|
+
data?: unknown;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/** `data` of a 409 form-write envelope (re-exported for form consumers). */
|
|
693
|
+
type TFormConflictData = IFormStaleVersionData;
|
|
694
|
+
/**
|
|
695
|
+
* Which configuration a form or list request acts on: every write (submit,
|
|
696
|
+
* update, delete, quick action, restore) and every list read (state, history,
|
|
697
|
+
* version, comparison, historical file). The server decides what is allowed;
|
|
698
|
+
* the client only says which version of the page it is looking at.
|
|
699
|
+
*/
|
|
700
|
+
interface IFormEffectiveContext {
|
|
701
|
+
/**
|
|
702
|
+
* Act on the DRAFT of the page instead of its published version. Send it
|
|
703
|
+
* exactly when the person looks at the draft (the page was fetched with
|
|
704
|
+
* `preview`): the request must be judged by the same inputs, conditions,
|
|
705
|
+
* list properties and quick actions the person sees. Honoured for a
|
|
706
|
+
* signed-in person who may read the draft, refused otherwise; without it the
|
|
707
|
+
* published version decides, also for a signed-in person. Page access
|
|
708
|
+
* rights, live data and permissions are not part of the draft and stay the
|
|
709
|
+
* same. A request body carries it as a boolean, a query string as `preview=true`.
|
|
710
|
+
*/
|
|
711
|
+
preview?: boolean;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* `form_data` holds the values of the inputs of the form the server resolves for
|
|
715
|
+
* `section_id` (keyed by input name). It is untrusted: the server refuses (400)
|
|
716
|
+
* an unknown input, an owner or trigger field and any internal key, on JSON and
|
|
717
|
+
* on multipart requests, signed in or as a guest.
|
|
718
|
+
*/
|
|
719
|
+
interface IFormSubmitRequest extends IFormEffectiveContext {
|
|
720
|
+
section_id: number;
|
|
721
|
+
page_id?: number;
|
|
722
|
+
record_id?: number;
|
|
723
|
+
form_data: Record<string, unknown>;
|
|
724
|
+
}
|
|
725
|
+
interface IFormUpdateRequest extends IFormEffectiveContext {
|
|
726
|
+
section_id: number;
|
|
727
|
+
page_id?: number;
|
|
728
|
+
record_id?: number;
|
|
729
|
+
form_data: Record<string, unknown>;
|
|
730
|
+
/**
|
|
731
|
+
* The record the update changes: `{ record_id }` alone, or the documented
|
|
732
|
+
* alternative of plain field values. Anything else (empty, both, malformed)
|
|
733
|
+
* answers 400 `unsupported_target_selection`; a record outside the dataset
|
|
734
|
+
* of the form or list answers 404.
|
|
735
|
+
*/
|
|
736
|
+
update_based_on?: Record<string, unknown>;
|
|
737
|
+
/**
|
|
738
|
+
* REQUIRED: the record `version` the change is based on (the `version` the
|
|
739
|
+
* client last received from the record, a list row or the previous write).
|
|
740
|
+
* Missing, not a whole number of at least 1 (also as multipart text) answers
|
|
741
|
+
* 400 `expected_version_required` / `invalid_expected_version` before
|
|
742
|
+
* anything is stored; a save based on an older version answers 409 with
|
|
743
|
+
* {@link IFormStaleVersionData} and writes nothing. The schema marks it
|
|
744
|
+
* optional only so the refusal can carry its reason; the type does not.
|
|
745
|
+
*/
|
|
746
|
+
expected_version: number;
|
|
747
|
+
}
|
|
748
|
+
interface IFormDeleteRequest extends IFormEffectiveContext {
|
|
749
|
+
record_id: number;
|
|
750
|
+
page_id?: number;
|
|
751
|
+
/** The form's section, or the id of the entry list the record belongs to. */
|
|
752
|
+
section_id: number;
|
|
753
|
+
/**
|
|
754
|
+
* REQUIRED: the record `version` the delete is based on, with the same
|
|
755
|
+
* refusals as {@link IFormUpdateRequest.expected_version} (400 when missing
|
|
756
|
+
* or malformed, 409 `stale_version` when old).
|
|
757
|
+
*/
|
|
758
|
+
expected_version: number;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* The rule of an input a value broke (`422 invalid_form_data`). The server
|
|
762
|
+
* checks the CURRENT effective form: `required`, `read_only` and `not_available`
|
|
763
|
+
* (hidden by a condition or not an input of the form), `invalid` (not a value
|
|
764
|
+
* this kind of input takes), `too_many` (selections or files), `type`, `min`,
|
|
765
|
+
* `max`, `max_length`, `format` (email, web address), `option`, `min_date`,
|
|
766
|
+
* `max_date` and `file_type`.
|
|
767
|
+
*/
|
|
768
|
+
type TFormInputRule = 'not_available' | 'read_only' | 'required' | 'invalid' | 'too_many' | 'type' | 'min' | 'max' | 'max_length' | 'format' | 'option' | 'min_date' | 'max_date' | 'file_type';
|
|
769
|
+
/** One refused input of a write. Show `message` at the input named `field`; branch on `rule`, never on the text. */
|
|
770
|
+
interface IFormInputError {
|
|
771
|
+
/** The input's name, as the person knows it. */
|
|
772
|
+
field: string;
|
|
773
|
+
/** The stable column key of the input (`section_<input id>`). */
|
|
774
|
+
key: string;
|
|
775
|
+
rule: TFormInputRule;
|
|
776
|
+
message: string;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* `data` of the 422 envelope a write answers with when a value breaks the rules
|
|
780
|
+
* of the CURRENT form (a save, a quick action's candidate state or a restore). The
|
|
781
|
+
* whole write is refused: nothing was stored, uploaded or scheduled, so a client
|
|
782
|
+
* keeps the person's draft and files and shows the errors.
|
|
783
|
+
*/
|
|
784
|
+
interface IFormInvalidData {
|
|
785
|
+
reason: 'invalid_form_data';
|
|
786
|
+
errors: IFormInputError[];
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* The `data.reason` of the refusals a form or list write can answer with, besides
|
|
790
|
+
* `stale_version` and `restore_blocked` ({@link IFormStaleVersionData},
|
|
791
|
+
* {@link IFormListRestoreBlockedData}) and `invalid_form_data`
|
|
792
|
+
* ({@link IFormInvalidData}). They are statuses of one request, not page state.
|
|
793
|
+
*
|
|
794
|
+
* - 400: `expected_version_required`, `invalid_expected_version`,
|
|
795
|
+
* `unsupported_target_selection`, `protected_field`, `unknown_field`,
|
|
796
|
+
* `invalid_file_value`, `table_mismatch`.
|
|
797
|
+
* - 401 `login_required`: a guest on an own-entries list.
|
|
798
|
+
* - 403: `operation_disabled` (create, update or delete switched off on the list),
|
|
799
|
+
* `history_disabled`, or no right to the page, the record or the table.
|
|
800
|
+
* - 404: `unknown_action`, or a record that is not part of the list's dataset
|
|
801
|
+
* (never a hint whether it exists elsewhere).
|
|
802
|
+
* - 409: `action_not_available` (the action's condition no longer holds).
|
|
803
|
+
*/
|
|
804
|
+
type TFormWriteRefusalReason = 'expected_version_required' | 'invalid_expected_version' | 'unsupported_target_selection' | 'protected_field' | 'unknown_field' | 'invalid_file_value' | 'table_mismatch' | 'login_required' | 'operation_disabled' | 'history_disabled' | 'unknown_action' | 'action_not_available';
|
|
805
|
+
/**
|
|
806
|
+
* Legacy/aspirational form-result fields.
|
|
807
|
+
*
|
|
808
|
+
* @deprecated The current backend `form_submitted` / `form_updated` responses
|
|
809
|
+
* do NOT include these. `FormController` returns only the structured fields on
|
|
810
|
+
* {@link IFormSubmitData} / {@link IFormUpdateData}, and both JSON schemas
|
|
811
|
+
* declare `additionalProperties: false`. Frontend code that reads
|
|
812
|
+
* `data.success` / `data.message` (e.g. `useFormSubmission.ts`) is reading
|
|
813
|
+
* values the backend never sends. Kept OPTIONAL so consumers keep compiling
|
|
814
|
+
* during migration; drop them once no consumer references them.
|
|
815
|
+
*/
|
|
816
|
+
interface IFormResultLegacyFields {
|
|
817
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
818
|
+
success?: boolean;
|
|
819
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
820
|
+
redirect_url?: string;
|
|
821
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
822
|
+
message?: string;
|
|
823
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
824
|
+
field_errors?: Record<string, string>;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Data returned by a successful POST form submit. Mirrors the backend contract
|
|
828
|
+
* `config/schemas/api/v1/responses/frontend/form_submitted.json`.
|
|
829
|
+
*/
|
|
830
|
+
interface IFormSubmitData extends IFormResultLegacyFields {
|
|
831
|
+
record_id: number;
|
|
832
|
+
section_id: number;
|
|
833
|
+
page_id: number;
|
|
834
|
+
submitted_at: string;
|
|
835
|
+
user_authenticated: boolean;
|
|
836
|
+
/** The record's version after the submit (1 for a new record). */
|
|
837
|
+
version: number;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Data returned by a successful PUT form update. Mirrors the backend contract
|
|
841
|
+
* `config/schemas/api/v1/responses/frontend/form_updated.json` (note: the
|
|
842
|
+
* update response carries `updated_at`, not `submitted_at`/`user_authenticated`).
|
|
843
|
+
*/
|
|
844
|
+
interface IFormUpdateData extends IFormResultLegacyFields {
|
|
845
|
+
record_id: number;
|
|
846
|
+
section_id: number;
|
|
847
|
+
page_id: number;
|
|
848
|
+
updated_at: string;
|
|
849
|
+
/** The record's version after the update. */
|
|
850
|
+
version: number;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Data returned by a successful DELETE form delete. Mirrors the backend contract
|
|
854
|
+
* `config/schemas/api/v1/responses/frontend/form_deleted.json`. The delete is
|
|
855
|
+
* soft: the record's history is kept.
|
|
856
|
+
*/
|
|
857
|
+
interface IFormDeleteData extends IFormResultLegacyFields {
|
|
858
|
+
record_id: number;
|
|
859
|
+
section_id?: number;
|
|
860
|
+
page_id?: number;
|
|
861
|
+
/** The record's version after the delete. */
|
|
862
|
+
version: number;
|
|
863
|
+
}
|
|
864
|
+
type IFormSubmitResponse = IBaseApiResponse<IFormSubmitData>;
|
|
865
|
+
type IFormUpdateResponse = IBaseApiResponse<IFormUpdateData>;
|
|
866
|
+
type IFormDeleteResponse = IBaseApiResponse<IFormDeleteData>;
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* DTOs of the `entry-form-list` and `data-view` styles ("lists").
|
|
870
|
+
*
|
|
871
|
+
* They mirror the backend contracts under
|
|
872
|
+
* `config/schemas/api/v1/{common/_form_list_state,common/_form_list_error,
|
|
873
|
+
* responses/frontend/form_list_*,requests/frontend/list_*}.json` and
|
|
874
|
+
* `docs/reference/api/22-form-lists.md`. The server decides, clients draw:
|
|
875
|
+
* nothing in here lets a client evaluate access, conditions, filters or
|
|
876
|
+
* quick-action assignments. A list's state is read from the page payload
|
|
877
|
+
* (`list_state` / `list_error` on the section) or from
|
|
878
|
+
* `GET /cms-api/v1/lists/{section_id}/state`.
|
|
879
|
+
*/
|
|
880
|
+
|
|
881
|
+
type TFormListStyleName = 'entry-form-list' | 'data-view';
|
|
882
|
+
/**
|
|
883
|
+
* `custom` (a `data-view` only): the sections placed inside the view are the layout of one
|
|
884
|
+
* record; the server renders them per record into each row's `sections`.
|
|
885
|
+
*/
|
|
886
|
+
type TFormListLayout = 'table' | 'cards' | 'custom';
|
|
887
|
+
type TFormListPresentation = 'modal' | 'page';
|
|
888
|
+
type TFormListColumnFormat = 'text' | 'number' | 'date' | 'datetime' | 'boolean' | 'badge' | 'file' | 'image';
|
|
889
|
+
type TFormListControlType = 'text' | 'select' | 'multi_select' | 'boolean' | 'date_range' | 'number_range';
|
|
890
|
+
type TFormListTextMatch = 'contains' | 'eq' | 'starts_with';
|
|
891
|
+
type TFormListSortDirection = 'asc' | 'desc';
|
|
892
|
+
/** What the URL asks for next to a record: look at it, edit it, or start a new one. */
|
|
893
|
+
type TFormListMode = 'view' | 'edit' | 'create' | 'history';
|
|
894
|
+
/** The modes of an open record (`create` has no record). */
|
|
895
|
+
type TFormListOpenMode = Exclude<TFormListMode, 'create'>;
|
|
896
|
+
/** An uploaded file in a cell. `url` is a section-scoped download route; no storage path ever leaves the server. */
|
|
897
|
+
interface IFormListFileValue {
|
|
898
|
+
index: number;
|
|
899
|
+
name: string;
|
|
900
|
+
mime?: string | null;
|
|
901
|
+
size?: number | null;
|
|
902
|
+
url: string;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* A file / image cell: the `files` list of contract 2. Format `image` is drawn as a
|
|
906
|
+
* thumbnail; `file` as download links. Never a bare array of files and never a storage key.
|
|
907
|
+
*/
|
|
908
|
+
interface IFormListFilesCell {
|
|
909
|
+
files: IFormListFileValue[];
|
|
910
|
+
}
|
|
911
|
+
/** A cell as the server sends it: text, a number, nothing, or a file/image cell. */
|
|
912
|
+
type TFormListCellValue = string | number | null | IFormListFilesCell;
|
|
913
|
+
/** Author text in the visitor's language. `add` and `confirm_delete` exist on `entry-form-list` only. */
|
|
914
|
+
type TFormListLabels = Partial<Record<'add' | 'empty' | 'search' | 'confirm_delete', string>>;
|
|
915
|
+
interface IFormListInfo {
|
|
916
|
+
section_id: number;
|
|
917
|
+
page_id: number;
|
|
918
|
+
/** The list's name in the URL: `<key>.page`, `<key>.q`, ... */
|
|
919
|
+
key: string;
|
|
920
|
+
style: TFormListStyleName;
|
|
921
|
+
layout: TFormListLayout;
|
|
922
|
+
form_presentation: TFormListPresentation;
|
|
923
|
+
/**
|
|
924
|
+
* The section that creates and edits records.
|
|
925
|
+
* For an `entry-form-list` that owns its table (no foreign `data_table`),
|
|
926
|
+
* this is the **list's own** section id. It is `null` for a `data-view`
|
|
927
|
+
* and for an `entry-form-list` with a foreign `data_table` (read-only
|
|
928
|
+
* override: delete and quick actions only, no form).
|
|
929
|
+
*/
|
|
930
|
+
form_section_id: number | null;
|
|
931
|
+
/** False while the list's form was never submitted: there is nothing to read yet. */
|
|
932
|
+
table_exists: boolean;
|
|
933
|
+
labels: TFormListLabels;
|
|
934
|
+
/** Classes of the element that holds the records of the `custom` layout (web only); empty otherwise. */
|
|
935
|
+
row_css: string;
|
|
936
|
+
/**
|
|
937
|
+
* True when the author placed sections inside a data view with the `custom` layout.
|
|
938
|
+
* A `custom` layout without any is drawn as cards.
|
|
939
|
+
*/
|
|
940
|
+
has_template: boolean;
|
|
941
|
+
}
|
|
942
|
+
interface IFormListColumn {
|
|
943
|
+
/** The key of `values` in rows. */
|
|
944
|
+
field: string;
|
|
945
|
+
label: string;
|
|
946
|
+
format: TFormListColumnFormat;
|
|
947
|
+
sortable: boolean;
|
|
948
|
+
searchable: boolean;
|
|
949
|
+
}
|
|
950
|
+
interface IFormListControlOption {
|
|
951
|
+
value: string;
|
|
952
|
+
label: string;
|
|
953
|
+
/** Records holding the value inside the visitor's dataset; null for fixed choices. */
|
|
954
|
+
count: number | null;
|
|
955
|
+
}
|
|
956
|
+
interface IFormListControl {
|
|
957
|
+
/** The `<key>.f.<id>` URL parameter. */
|
|
958
|
+
id: string;
|
|
959
|
+
type: TFormListControlType;
|
|
960
|
+
field: string;
|
|
961
|
+
label: string;
|
|
962
|
+
match?: TFormListTextMatch;
|
|
963
|
+
options?: IFormListControlOption[];
|
|
964
|
+
}
|
|
965
|
+
interface IFormListSort {
|
|
966
|
+
field: string;
|
|
967
|
+
direction: TFormListSortDirection;
|
|
968
|
+
}
|
|
969
|
+
/** The state that was served: the page after clamping, the order in effect, and the URL parameters that express it. */
|
|
970
|
+
interface IFormListServedState {
|
|
971
|
+
page: number;
|
|
972
|
+
page_size: number;
|
|
973
|
+
q: string | null;
|
|
974
|
+
sort: IFormListSort[];
|
|
975
|
+
/** Control id to the control's raw value. */
|
|
976
|
+
filters: Record<string, string>;
|
|
977
|
+
record: number | null;
|
|
978
|
+
mode: TFormListMode | null;
|
|
979
|
+
/** The URL parameters (`news.page`, `news.q`, ...) that express this state; build links from them. */
|
|
980
|
+
query: Record<string, string>;
|
|
981
|
+
}
|
|
982
|
+
interface IFormListQuickActionInfo {
|
|
983
|
+
id: string;
|
|
984
|
+
label: string;
|
|
985
|
+
confirm: string | null;
|
|
986
|
+
}
|
|
987
|
+
interface IFormListCapabilities {
|
|
988
|
+
/** False for a guest on an own-entries list. */
|
|
989
|
+
create: boolean;
|
|
990
|
+
search: boolean;
|
|
991
|
+
history: boolean;
|
|
992
|
+
/** Labels and confirmations; a row's `quick_actions` say which of them apply to it. */
|
|
993
|
+
quick_actions: IFormListQuickActionInfo[];
|
|
994
|
+
}
|
|
995
|
+
/** What the visitor may do with one record. These are rendering hints; the server re-checks on every write. */
|
|
996
|
+
interface IFormListRecordAccess {
|
|
997
|
+
is_own: boolean;
|
|
998
|
+
can_update: boolean;
|
|
999
|
+
can_delete: boolean;
|
|
1000
|
+
can_view_history: boolean;
|
|
1001
|
+
/** Ids of the quick actions whose condition holds now for this record. Offer no other. */
|
|
1002
|
+
quick_actions: string[];
|
|
1003
|
+
detail_url: string | null;
|
|
1004
|
+
}
|
|
1005
|
+
interface IFormListRow extends IFormListRecordAccess {
|
|
1006
|
+
record_id: number;
|
|
1007
|
+
entry_date: string;
|
|
1008
|
+
/** Send back as `expected_version` when changing the record. */
|
|
1009
|
+
version: number;
|
|
1010
|
+
/** Exactly the configured columns, by field. */
|
|
1011
|
+
values: Record<string, TFormListCellValue>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Only with the `custom` layout: the author's row template rendered for this record, in the
|
|
1014
|
+
* shape of page sections (tokens, translations and conditions already resolved). Render them
|
|
1015
|
+
* like any other sections; never evaluate anything.
|
|
1016
|
+
*/
|
|
1017
|
+
sections?: TStyle[];
|
|
1018
|
+
}
|
|
1019
|
+
/** The record that is open (view or edit). */
|
|
1020
|
+
interface IFormListSelected extends IFormListRecordAccess {
|
|
1021
|
+
record_id: number;
|
|
1022
|
+
mode: TFormListOpenMode;
|
|
1023
|
+
entry_date: string;
|
|
1024
|
+
/** Send back as `expected_version` when saving, deleting, running an action or restoring. */
|
|
1025
|
+
version: number;
|
|
1026
|
+
values: Record<string, TFormListCellValue>;
|
|
1027
|
+
/** The prefill the inline form receives on a page load; null when the caller cannot edit the record. */
|
|
1028
|
+
form_values: Record<string, unknown> | unknown[] | null;
|
|
1029
|
+
}
|
|
1030
|
+
interface IFormListPagination {
|
|
1031
|
+
page: number;
|
|
1032
|
+
page_size: number;
|
|
1033
|
+
total: number;
|
|
1034
|
+
total_pages: number;
|
|
1035
|
+
}
|
|
1036
|
+
/** The server-rendered state of one list for one visitor and one URL state. */
|
|
1037
|
+
interface IFormListState {
|
|
1038
|
+
list: IFormListInfo;
|
|
1039
|
+
columns: IFormListColumn[];
|
|
1040
|
+
controls: IFormListControl[];
|
|
1041
|
+
state: IFormListServedState;
|
|
1042
|
+
capabilities: IFormListCapabilities;
|
|
1043
|
+
rows: IFormListRow[];
|
|
1044
|
+
pagination: IFormListPagination;
|
|
1045
|
+
selected: IFormListSelected | null;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Why a list on a page has no state. The page is still served; the client draws
|
|
1049
|
+
* the list's error state. `parameter` names the URL parameter that caused it - a
|
|
1050
|
+
* client may drop it and retry.
|
|
1051
|
+
*/
|
|
1052
|
+
interface IFormListError {
|
|
1053
|
+
/** The HTTP status the state endpoint would answer with: 400, 401, 403, 404 or 500. */
|
|
1054
|
+
status: number;
|
|
1055
|
+
message: string;
|
|
1056
|
+
reason?: TFormListErrorReason | string | null;
|
|
1057
|
+
parameter?: string | null;
|
|
1058
|
+
}
|
|
1059
|
+
type TFormListErrorReason = 'login_required' | 'operation_disabled' | 'history_disabled' | 'invalid_list_parameter' | 'unknown_list_parameter' | 'duplicate_list_parameter' | 'field_not_allowed' | 'table_mismatch' | 'unknown_action' | 'stale_version' | 'action_not_available' | 'restore_blocked' | 'invalid_list_config';
|
|
1060
|
+
type IFormListStateResponse = IBaseApiResponse<IFormListState>;
|
|
1061
|
+
/**
|
|
1062
|
+
* `data` of the 409 envelope a stale save, delete, quick action or restore answers
|
|
1063
|
+
* with. Nothing was written: keep the draft and offer reload, comparison and re-apply.
|
|
1064
|
+
*/
|
|
1065
|
+
interface IFormStaleVersionData {
|
|
1066
|
+
reason: 'stale_version';
|
|
1067
|
+
record_id: number;
|
|
1068
|
+
expected_version: number;
|
|
1069
|
+
current_version: number;
|
|
1070
|
+
}
|
|
1071
|
+
interface IFormListQuickActionRequest extends IFormEffectiveContext {
|
|
1072
|
+
page_id: number;
|
|
1073
|
+
/** REQUIRED: the record `version` the action is based on; missing or malformed answers 400, an old one 409. */
|
|
1074
|
+
expected_version: number;
|
|
1075
|
+
}
|
|
1076
|
+
interface IFormListQuickActionData {
|
|
1077
|
+
record_id: number;
|
|
1078
|
+
/** The record's version after the action. */
|
|
1079
|
+
version: number;
|
|
1080
|
+
action: string;
|
|
1081
|
+
}
|
|
1082
|
+
type IFormListQuickActionResponse = IBaseApiResponse<IFormListQuickActionData>;
|
|
1083
|
+
type TDataRevisionOperation = 'create' | 'update' | 'delete' | 'restore' | 'baseline';
|
|
1084
|
+
type TDataRevisionSource = 'form' | 'admin' | 'quick_action' | 'job' | 'import' | 'system';
|
|
1085
|
+
interface IFormListActor {
|
|
1086
|
+
id: number;
|
|
1087
|
+
name: string | null;
|
|
1088
|
+
}
|
|
1089
|
+
/** One revision of a record: who changed it, how, and how much. */
|
|
1090
|
+
interface IFormListRevision {
|
|
1091
|
+
version: number;
|
|
1092
|
+
/** UTC, ISO 8601 (ATOM). */
|
|
1093
|
+
created_at: string;
|
|
1094
|
+
operation: TDataRevisionOperation;
|
|
1095
|
+
source: TDataRevisionSource;
|
|
1096
|
+
actor: IFormListActor | null;
|
|
1097
|
+
impersonated_by: IFormListActor | null;
|
|
1098
|
+
restored_from_version: number | null;
|
|
1099
|
+
/** The number of fields the revision changed. */
|
|
1100
|
+
changed_fields: number;
|
|
1101
|
+
is_checkpoint: boolean;
|
|
1102
|
+
}
|
|
1103
|
+
/** A file a revision held; `available` is false once the file was erased. */
|
|
1104
|
+
interface IFormListHistoricalFile {
|
|
1105
|
+
index: number;
|
|
1106
|
+
name: string;
|
|
1107
|
+
available: boolean;
|
|
1108
|
+
/** Historical-file download route when `available` (list or admin data browser). */
|
|
1109
|
+
url?: string;
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Explicit file-field instruction on update (contract 4). Omit the field to keep
|
|
1113
|
+
* files; send this object (or its JSON string in multipart) to clear or drop indexes.
|
|
1114
|
+
* A new upload then replaces (single-file) or appends (multi-file).
|
|
1115
|
+
*/
|
|
1116
|
+
interface IFormFileFieldOp {
|
|
1117
|
+
remove?: boolean;
|
|
1118
|
+
remove_indexes?: number[];
|
|
1119
|
+
}
|
|
1120
|
+
interface IFormListChangeBase {
|
|
1121
|
+
field_key: string;
|
|
1122
|
+
field_label: string | null;
|
|
1123
|
+
language_id: number;
|
|
1124
|
+
truncated: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
interface IFormListValueChange extends IFormListChangeBase {
|
|
1127
|
+
change: 'added' | 'changed' | 'removed';
|
|
1128
|
+
kind: 'value';
|
|
1129
|
+
before: string | null;
|
|
1130
|
+
after: string | null;
|
|
1131
|
+
}
|
|
1132
|
+
interface IFormListFileChange extends IFormListChangeBase {
|
|
1133
|
+
change: 'added' | 'changed' | 'removed';
|
|
1134
|
+
kind: 'file';
|
|
1135
|
+
before: null;
|
|
1136
|
+
after: null;
|
|
1137
|
+
before_files: IFormListHistoricalFile[];
|
|
1138
|
+
after_files: IFormListHistoricalFile[];
|
|
1139
|
+
}
|
|
1140
|
+
/** A change of a revision or of a comparison. */
|
|
1141
|
+
type TFormListChange = IFormListValueChange | IFormListFileChange;
|
|
1142
|
+
/** A field of the record as it stood after a version. */
|
|
1143
|
+
interface IFormListStateField {
|
|
1144
|
+
field_key: string;
|
|
1145
|
+
field_label: string | null;
|
|
1146
|
+
language_id: number;
|
|
1147
|
+
kind: 'value' | 'file';
|
|
1148
|
+
value: string | null;
|
|
1149
|
+
files: IFormListHistoricalFile[];
|
|
1150
|
+
}
|
|
1151
|
+
interface IFormListHistoryQuery extends IFormEffectiveContext {
|
|
1152
|
+
page_id: number;
|
|
1153
|
+
page?: number;
|
|
1154
|
+
/** 1 to 100, default 20. */
|
|
1155
|
+
page_size?: number;
|
|
1156
|
+
}
|
|
1157
|
+
interface IFormListHistoryData {
|
|
1158
|
+
/** Newest first. */
|
|
1159
|
+
items: IFormListRevision[];
|
|
1160
|
+
total: number;
|
|
1161
|
+
page: number;
|
|
1162
|
+
page_size: number;
|
|
1163
|
+
current_version: number;
|
|
1164
|
+
}
|
|
1165
|
+
interface IFormListVersionData {
|
|
1166
|
+
revision: {
|
|
1167
|
+
revision: IFormListRevision;
|
|
1168
|
+
changes: TFormListChange[];
|
|
1169
|
+
};
|
|
1170
|
+
state: {
|
|
1171
|
+
version: number;
|
|
1172
|
+
current_version: number;
|
|
1173
|
+
fields: IFormListStateField[];
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
interface IFormListCompareQuery extends IFormEffectiveContext {
|
|
1177
|
+
page_id: number;
|
|
1178
|
+
from: number;
|
|
1179
|
+
to: number;
|
|
1180
|
+
}
|
|
1181
|
+
interface IFormListCompareData {
|
|
1182
|
+
from_version: number;
|
|
1183
|
+
to_version: number;
|
|
1184
|
+
current_version: number;
|
|
1185
|
+
changes: TFormListChange[];
|
|
1186
|
+
}
|
|
1187
|
+
type TFormListRestoreBlockerReason = 'field_missing' | 'language_missing' | 'file_unavailable' | 'invalid_value';
|
|
1188
|
+
/** Why one field of an earlier version cannot be written back today. */
|
|
1189
|
+
interface IFormListRestoreBlocker {
|
|
1190
|
+
field_key: string;
|
|
1191
|
+
field_label: string | null;
|
|
1192
|
+
language_id: number;
|
|
1193
|
+
reason: TFormListRestoreBlockerReason;
|
|
1194
|
+
detail: string | null;
|
|
1195
|
+
}
|
|
1196
|
+
/** What a restore would write: set a value (and files) or remove what that version did not have. */
|
|
1197
|
+
interface IFormListRestoreChange {
|
|
1198
|
+
field_key: string;
|
|
1199
|
+
field_label: string | null;
|
|
1200
|
+
language_id: number;
|
|
1201
|
+
action: 'set' | 'remove';
|
|
1202
|
+
kind: 'value' | 'file';
|
|
1203
|
+
before: string | null;
|
|
1204
|
+
after: string | null;
|
|
1205
|
+
before_files?: IFormListHistoricalFile[];
|
|
1206
|
+
after_files?: IFormListHistoricalFile[];
|
|
1207
|
+
}
|
|
1208
|
+
interface IFormListRestoreRequest extends IFormEffectiveContext {
|
|
1209
|
+
page_id: number;
|
|
1210
|
+
/** The earlier version to restore. */
|
|
1211
|
+
version: number;
|
|
1212
|
+
/**
|
|
1213
|
+
* The current version the person saw. REQUIRED for a real restore (missing or
|
|
1214
|
+
* malformed answers 400, an old one 409); a `dry_run` needs none.
|
|
1215
|
+
*/
|
|
1216
|
+
expected_version?: number;
|
|
1217
|
+
/** Restore only these fields (1 to 100) - the way to resolve a blocked restore. */
|
|
1218
|
+
field_keys?: string[];
|
|
1219
|
+
/** Only report what a restore would change and what blocks it; write nothing. */
|
|
1220
|
+
dry_run?: boolean;
|
|
1221
|
+
}
|
|
1222
|
+
interface IFormListRestorePreview {
|
|
1223
|
+
dry_run: true;
|
|
1224
|
+
restorable: boolean;
|
|
1225
|
+
record_id: number;
|
|
1226
|
+
from_version: number;
|
|
1227
|
+
current_version: number;
|
|
1228
|
+
changes: IFormListRestoreChange[];
|
|
1229
|
+
blockers: IFormListRestoreBlocker[];
|
|
1230
|
+
}
|
|
1231
|
+
interface IFormListRestoreResult {
|
|
1232
|
+
dry_run: false;
|
|
1233
|
+
record_id: number;
|
|
1234
|
+
restored_from_version: number;
|
|
1235
|
+
/** The record's version after the restore (unchanged when nothing differed). */
|
|
1236
|
+
version: number;
|
|
1237
|
+
}
|
|
1238
|
+
type TFormListRestoreData = IFormListRestorePreview | IFormListRestoreResult;
|
|
1239
|
+
/** `data` of the 422 envelope a restore that cannot be applied whole answers with. Nothing was applied. */
|
|
1240
|
+
interface IFormListRestoreBlockedData {
|
|
1241
|
+
reason: 'restore_blocked';
|
|
1242
|
+
record_id: number;
|
|
1243
|
+
from_version: number;
|
|
1244
|
+
blockers: IFormListRestoreBlocker[];
|
|
1245
|
+
}
|
|
1246
|
+
type IFormListHistoryResponse = IBaseApiResponse<IFormListHistoryData>;
|
|
1247
|
+
type IFormListVersionResponse = IBaseApiResponse<IFormListVersionData>;
|
|
1248
|
+
type IFormListCompareResponse = IBaseApiResponse<IFormListCompareData>;
|
|
1249
|
+
type IFormListRestoreResponse = IBaseApiResponse<TFormListRestoreData>;
|
|
1250
|
+
/** Restore body for the data browser (contract 6); no page context. */
|
|
1251
|
+
interface IAdminDataRecordRestoreRequest {
|
|
1252
|
+
version: number;
|
|
1253
|
+
expected_version?: number;
|
|
1254
|
+
field_keys?: string[];
|
|
1255
|
+
dry_run?: boolean;
|
|
1256
|
+
}
|
|
1257
|
+
type IAdminDataRecordHistoryResponse = IFormListHistoryResponse;
|
|
1258
|
+
type IAdminDataRecordVersionResponse = IFormListVersionResponse;
|
|
1259
|
+
type IAdminDataRecordCompareResponse = IFormListCompareResponse;
|
|
1260
|
+
type IAdminDataRecordRestoreResponse = IFormListRestoreResponse;
|
|
1261
|
+
|
|
665
1262
|
type TMantineTextInputVariant = 'default' | 'filled' | 'unstyled';
|
|
666
1263
|
type TMantineTextareaAutosize = '0' | '1';
|
|
667
1264
|
type TMantineTextareaResize = 'none' | 'vertical' | 'both';
|
|
@@ -1132,6 +1729,12 @@ interface IEntryTableEntry {
|
|
|
1132
1729
|
_can_delete?: boolean;
|
|
1133
1730
|
/** Per-row edit permission (backend rule `canUpdateOwnedRecord`). */
|
|
1134
1731
|
_can_edit?: boolean;
|
|
1732
|
+
/**
|
|
1733
|
+
* The version the record has when the page is built (present on rows that offer delete
|
|
1734
|
+
* or edit). Send it back as `expected_version`: a delete without it is refused (400), one
|
|
1735
|
+
* based on an old version is refused (409) and the record stays.
|
|
1736
|
+
*/
|
|
1737
|
+
_version?: number;
|
|
1135
1738
|
[key: string]: unknown;
|
|
1136
1739
|
}
|
|
1137
1740
|
/**
|
|
@@ -1202,6 +1805,93 @@ interface IEntryTableStyle extends IBaseStyle {
|
|
|
1202
1805
|
*/
|
|
1203
1806
|
field_labels?: Record<string, string>;
|
|
1204
1807
|
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Fields and server-added state both list styles share. The configuration
|
|
1810
|
+
* fields hold what the author set; the JSON fields (`list_columns`, `list_sort`,
|
|
1811
|
+
* `list_controls`, `list_fixed_filter`, `quick_actions`) are JSON documents the
|
|
1812
|
+
* server validates when the section is saved or imported, so a renderer never
|
|
1813
|
+
* parses them: it draws `list_state`.
|
|
1814
|
+
*/
|
|
1815
|
+
interface IFormListBaseStyle extends IStyleWithSpacing {
|
|
1816
|
+
/**
|
|
1817
|
+
* The server-rendered state of the list for this visitor and URL, added by the
|
|
1818
|
+
* page endpoints after the page cache. Absent when {@link list_error} is set.
|
|
1819
|
+
*/
|
|
1820
|
+
list_state?: IFormListState;
|
|
1821
|
+
/** Why the list has no state (sign in, not allowed, invalid parameter, bad configuration). The page is still served. */
|
|
1822
|
+
list_error?: IFormListError;
|
|
1823
|
+
/** Optional auto-styled heading rendered above the list when set. */
|
|
1824
|
+
title?: IContentField<string>;
|
|
1825
|
+
/** The list's name in the URL (`<key>.page`, `<key>.q`, ...); unique on a page. */
|
|
1826
|
+
list_key?: IContentField<string>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Numeric `data_tables.id`, or empty.
|
|
1829
|
+
* - On `entry-form-list`: empty means the list owns its table (created on
|
|
1830
|
+
* first submit as `data_tables.name = "<list section id>"`). Set to another
|
|
1831
|
+
* table for a read-only override: the list only deletes and runs quick
|
|
1832
|
+
* actions; inputs, create and edit are refused.
|
|
1833
|
+
* - On `data-view`: required; the view is always read-only.
|
|
1834
|
+
*/
|
|
1835
|
+
data_table?: IContentField<string>;
|
|
1836
|
+
list_layout?: IContentField<TFormListLayout>;
|
|
1837
|
+
/** Rows per page, 1 to 100. */
|
|
1838
|
+
page_size?: IContentField<string>;
|
|
1839
|
+
/** JSON: up to 30 columns `{field, label, sortable, searchable, format}`. */
|
|
1840
|
+
list_columns?: IContentField<string>;
|
|
1841
|
+
/** JSON: up to 3 default sort keys `{field, direction}`. */
|
|
1842
|
+
list_sort?: IContentField<string>;
|
|
1843
|
+
/** JSON: up to 12 visitor controls (search-adjacent filters). */
|
|
1844
|
+
list_controls?: IContentField<string>;
|
|
1845
|
+
/** JSON: the author's dataset filter; every read and write of the list honours it. */
|
|
1846
|
+
list_fixed_filter?: IContentField<string>;
|
|
1847
|
+
/** '1' (default on `entry-form-list`): the list shows and changes the visitor's own records only. */
|
|
1848
|
+
own_entries_only?: IContentField<string>;
|
|
1849
|
+
label_empty?: IContentField<string>;
|
|
1850
|
+
label_search?: IContentField<string>;
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Form fields that an Entry List with Form carries when it is its own form.
|
|
1854
|
+
* Picked from {@link IFormRecordStyle} so labels, alerts and button knobs cannot
|
|
1855
|
+
* drift from standalone forms. Not included: `description` (the list has
|
|
1856
|
+
* `title`), `close_modal_on_save`, `redirect_on_save`, `btn_cancel_url` (the
|
|
1857
|
+
* list closes its modal or returns to itself).
|
|
1858
|
+
*/
|
|
1859
|
+
type TEntryFormListFormFields = Pick<IFormRecordStyle, 'name' | 'btn_save_label' | 'btn_save_color' | 'btn_update_label' | 'btn_update_color' | 'btn_cancel_label' | 'btn_cancel_color' | 'alert_success' | 'alert_success_title' | 'alert_error' | 'alert_error_title' | 'confirm_submit' | 'confirm_message' | 'buttons_size' | 'buttons_radius' | 'buttons_variant' | 'buttons_position' | 'buttons_order' | 'redirect_at_end'>;
|
|
1860
|
+
/**
|
|
1861
|
+
* Entry List with Form: a server-rendered list of records that is also the form
|
|
1862
|
+
* that creates and edits them. Put the inputs directly inside the list; the
|
|
1863
|
+
* first successful submit creates `data_tables.name = "<list section id>"`.
|
|
1864
|
+
* A nested `form-record` / `form-log` / `entry-record-form` / `entry-form-list`
|
|
1865
|
+
* is refused. When {@link IFormListBaseStyle.data_table} names another table,
|
|
1866
|
+
* the list is a read-only override (delete and quick actions only).
|
|
1867
|
+
*/
|
|
1868
|
+
interface IEntryFormListStyle extends IFormListBaseStyle, TEntryFormListFormFields {
|
|
1869
|
+
style_name: 'entry-form-list';
|
|
1870
|
+
form_presentation?: IContentField<TFormListPresentation>;
|
|
1871
|
+
/** JSON: up to 8 server-defined quick actions `{id, label, confirm, set, when}`. */
|
|
1872
|
+
quick_actions?: IContentField<string>;
|
|
1873
|
+
allow_create?: IContentField<string>;
|
|
1874
|
+
allow_update?: IContentField<string>;
|
|
1875
|
+
allow_delete?: IContentField<string>;
|
|
1876
|
+
/** '1' offers versions, comparison and restore of a record. */
|
|
1877
|
+
show_history?: IContentField<string>;
|
|
1878
|
+
label_add?: IContentField<string>;
|
|
1879
|
+
label_confirm_delete?: IContentField<string>;
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Data View: the read-only sibling of {@link IEntryFormListStyle}. It shows a
|
|
1883
|
+
* table, cards or your own layout of records and never writes; a forged write is
|
|
1884
|
+
* refused. With the `custom` layout its child sections are the template of ONE
|
|
1885
|
+
* record: the server renders them per record into `list_state.rows[].sections`, so
|
|
1886
|
+
* the page itself carries no children for it.
|
|
1887
|
+
*/
|
|
1888
|
+
interface IDataViewStyle extends IFormListBaseStyle {
|
|
1889
|
+
style_name: 'data-view';
|
|
1890
|
+
/** A site path containing `{record_id}` exactly once; a row links there. */
|
|
1891
|
+
detail_url?: IContentField<string>;
|
|
1892
|
+
/** Classes of the element that holds the records of the `custom` layout (for example a grid); web only. */
|
|
1893
|
+
list_row_css?: IContentField<string>;
|
|
1894
|
+
}
|
|
1205
1895
|
|
|
1206
1896
|
type TMantineAccordionMultiple = '0' | '1';
|
|
1207
1897
|
type TMantineAccordionChevronPosition = 'left' | 'right';
|
|
@@ -1308,10 +1998,23 @@ interface IEntryRecordStyle extends IBaseStyle {
|
|
|
1308
1998
|
* `/team-members/{record_id}`). The holder loads that single row.
|
|
1309
1999
|
*/
|
|
1310
2000
|
load_record_from?: IContentField<string>;
|
|
2001
|
+
/**
|
|
2002
|
+
* Typed JSON fixed filter (same shape as a list's `list_fixed_filter`).
|
|
2003
|
+
* Bounds which record this detail may show; a record outside it is treated
|
|
2004
|
+
* like a missing record (F166).
|
|
2005
|
+
*/
|
|
2006
|
+
fixed_filter?: IContentField<string>;
|
|
1311
2007
|
scope?: IContentField<string>;
|
|
1312
2008
|
}
|
|
1313
2009
|
interface IEntryRecordDeleteStyle extends IBaseStyle {
|
|
1314
2010
|
style_name: 'entry-record-delete';
|
|
2011
|
+
/** The record this button deletes: injected by the server from the enclosing record (not a CMS field). */
|
|
2012
|
+
record_id?: IContentField<string>;
|
|
2013
|
+
/**
|
|
2014
|
+
* The version that record has when the page is built, as digits (injected next to `record_id`;
|
|
2015
|
+
* absent when the record no longer exists). Send it back as `expected_version`.
|
|
2016
|
+
*/
|
|
2017
|
+
record_version?: IContentField<string>;
|
|
1315
2018
|
/** Delete button text (catalog field; the generic `label` field is not linked to this style). */
|
|
1316
2019
|
label_delete?: IContentField<string>;
|
|
1317
2020
|
confirmation_title?: IContentField<string>;
|
|
@@ -1429,7 +2132,7 @@ interface IVersionStyle extends IBaseStyle {
|
|
|
1429
2132
|
* Admin/CMS-only styles are intentionally NOT in this union — the mobile
|
|
1430
2133
|
* app does not render them.
|
|
1431
2134
|
*/
|
|
1432
|
-
type TStyle = ILoginStyle | IRegisterStyle | IValidateStyle | IResetPasswordStyle | ITwoFactorAuthStyle | IProfileStyle | IContainerStyle | IBoxStyle | IFlexStyle | IGroupStyle | IStackStyle | ISimpleGridStyle | IGridStyle | IGridColumnStyle | ISpaceStyle | IDividerStyle | IPaperStyle | ICenterStyle | IScrollAreaStyle | ICardStyle | ICardSegmentStyle | IAspectRatioStyle | IBackgroundImageStyle | ITitleStyle | ITextStyle | ICodeStyle | IHighlightStyle | IBlockquoteStyle | IHtmlTagStyle | IKbdStyle | ITypographyStyle | IFieldsetStyle | ISpoilerStyle | IImageStyle | IVideoStyle | IAudioStyle | IFigureStyle | ICarouselStyle | IButtonStyle | ILinkStyle | IActionIconStyle | IAlertStyle | IBadgeStyle | IAvatarStyle | IChipStyle | IIndicatorStyle | IThemeIconStyle | INotificationStyle | IFormLogStyle | IFormRecordStyle | IInputStyle | ITextInputStyle | ITextareaStyle | IRichTextEditorStyle | ISelectStyle | IRadioStyle | ICheckboxStyle | ISliderStyle | IRangeSliderStyle | IDatePickerStyle | ISwitchStyle | IComboboxStyle | IColorInputStyle | IColorPickerStyle | IFileInputStyle | INumberInputStyle | ISegmentedControlStyle | IRatingStyle | IProgressStyle | IProgressRootStyle | IProgressSectionStyle | IAccordionStyle | IAccordionItemStyle | ITabsStyle | ITabStyle | ITimelineStyle | IListStyle | IListItemStyle | IEntryListStyle | IEntryRecordStyle | IEntryRecordDeleteStyle | ILoopStyle | ITimelineItemStyle | INoAccessStyle | INotFoundStyle | IMissingStyle | IVersionStyle | IRefContainerStyle | IDataContainerStyle | IEntryTableStyle;
|
|
2135
|
+
type TStyle = ILoginStyle | IRegisterStyle | IValidateStyle | IResetPasswordStyle | ITwoFactorAuthStyle | IProfileStyle | IContainerStyle | IBoxStyle | IFlexStyle | IGroupStyle | IStackStyle | ISimpleGridStyle | IGridStyle | IGridColumnStyle | ISpaceStyle | IDividerStyle | IPaperStyle | ICenterStyle | IScrollAreaStyle | ICardStyle | ICardSegmentStyle | IAspectRatioStyle | IBackgroundImageStyle | ITitleStyle | ITextStyle | ICodeStyle | IHighlightStyle | IBlockquoteStyle | IHtmlTagStyle | IKbdStyle | ITypographyStyle | IFieldsetStyle | ISpoilerStyle | IImageStyle | IVideoStyle | IAudioStyle | IFigureStyle | ICarouselStyle | IButtonStyle | ILinkStyle | IActionIconStyle | IAlertStyle | IBadgeStyle | IAvatarStyle | IChipStyle | IIndicatorStyle | IThemeIconStyle | INotificationStyle | IFormLogStyle | IFormRecordStyle | IInputStyle | ITextInputStyle | ITextareaStyle | IRichTextEditorStyle | ISelectStyle | IRadioStyle | ICheckboxStyle | ISliderStyle | IRangeSliderStyle | IDatePickerStyle | ISwitchStyle | IComboboxStyle | IColorInputStyle | IColorPickerStyle | IFileInputStyle | INumberInputStyle | ISegmentedControlStyle | IRatingStyle | IProgressStyle | IProgressRootStyle | IProgressSectionStyle | IAccordionStyle | IAccordionItemStyle | ITabsStyle | ITabStyle | ITimelineStyle | IListStyle | IListItemStyle | IEntryListStyle | IEntryRecordStyle | IEntryRecordDeleteStyle | ILoopStyle | ITimelineItemStyle | INoAccessStyle | INotFoundStyle | IMissingStyle | IVersionStyle | IRefContainerStyle | IDataContainerStyle | IEntryTableStyle | IEntryFormListStyle | IDataViewStyle;
|
|
1433
2136
|
/**
|
|
1434
2137
|
* Discriminator — name of every supported style. Derived from the
|
|
1435
2138
|
* `STYLE_REGISTRY` keys (declared in `src/registry/styles.registry.ts`).
|
|
@@ -2077,7 +2780,26 @@ declare const BASE_STYLE_REGISTRY: {
|
|
|
2077
2780
|
readonly category: "forms";
|
|
2078
2781
|
readonly canHaveChildren: false;
|
|
2079
2782
|
};
|
|
2783
|
+
readonly 'entry-form-list': {
|
|
2784
|
+
readonly description: "Entry List with Form: a list of records that is also the form that creates and edits them (put the inputs directly inside it); supports search, sort, filters, paging, quick actions and history";
|
|
2785
|
+
readonly category: "forms";
|
|
2786
|
+
readonly canHaveChildren: true;
|
|
2787
|
+
};
|
|
2788
|
+
readonly 'data-view': {
|
|
2789
|
+
readonly description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table";
|
|
2790
|
+
readonly category: "forms";
|
|
2791
|
+
readonly canHaveChildren: true;
|
|
2792
|
+
};
|
|
2080
2793
|
};
|
|
2794
|
+
/**
|
|
2795
|
+
* Style names that act as a form section: standalone forms plus
|
|
2796
|
+
* `entry-form-list` (the list is the form). Used by the CMS add-section
|
|
2797
|
+
* dialog to hide these styles below an `entry-form-list`, and by clients
|
|
2798
|
+
* that need the same closed set the backend refuses to nest.
|
|
2799
|
+
*/
|
|
2800
|
+
declare const FORM_SECTION_STYLE_NAMES: readonly ["form-record", "form-log", "entry-record-form", "entry-form-list"];
|
|
2801
|
+
/** One of {@link FORM_SECTION_STYLE_NAMES}. */
|
|
2802
|
+
type TFormSectionStyleName = (typeof FORM_SECTION_STYLE_NAMES)[number];
|
|
2081
2803
|
/**
|
|
2082
2804
|
* Backward-compatible alias for the core registry. Pre-plugin code
|
|
2083
2805
|
* imported `STYLE_REGISTRY`; that import still works and still resolves
|
|
@@ -2540,6 +3262,16 @@ declare const STYLE_REGISTRY: {
|
|
|
2540
3262
|
readonly category: "forms";
|
|
2541
3263
|
readonly canHaveChildren: false;
|
|
2542
3264
|
};
|
|
3265
|
+
readonly 'entry-form-list': {
|
|
3266
|
+
readonly description: "Entry List with Form: a list of records that is also the form that creates and edits them (put the inputs directly inside it); supports search, sort, filters, paging, quick actions and history";
|
|
3267
|
+
readonly category: "forms";
|
|
3268
|
+
readonly canHaveChildren: true;
|
|
3269
|
+
};
|
|
3270
|
+
readonly 'data-view': {
|
|
3271
|
+
readonly description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table";
|
|
3272
|
+
readonly category: "forms";
|
|
3273
|
+
readonly canHaveChildren: true;
|
|
3274
|
+
};
|
|
2543
3275
|
};
|
|
2544
3276
|
type TStyleRegistryKey = keyof typeof BASE_STYLE_REGISTRY;
|
|
2545
3277
|
/**
|
|
@@ -2585,4 +3317,4 @@ declare function getPluginStyleRegistry(): Record<string, IPluginStyleRegistryEn
|
|
|
2585
3317
|
*/
|
|
2586
3318
|
declare function _resetPluginStyleRegistry(): void;
|
|
2587
3319
|
|
|
2588
|
-
export { type
|
|
3320
|
+
export { type IChipStyle as $, type IAdminDataRecordHistoryResponse as A, BASE_STYLE_REGISTRY as B, type IAdminDataRecordRestoreRequest as C, type IAdminDataRecordRestoreResponse as D, type IAdminDataRecordVersionResponse as E, FORM_SECTION_STYLE_NAMES as F, type IAlertStyle as G, type IApiError as H, type IStyleRegistryEntry as I, type IApiMeta as J, type IAspectRatioStyle as K, type IAudioStyle as L, type IAvatarStyle as M, type IBackgroundImageStyle as N, type IBadgeStyle as O, type IBaseStyle as P, type IBlockquoteStyle as Q, type IBoxStyle as R, STYLE_REGISTRY as S, type TStyleName as T, type IButtonStyle as U, type ICardSegmentStyle as V, type ICardStyle as W, type ICarouselStyle as X, type ICenterStyle as Y, type ICheckboxStyle as Z, type _AssertRegistryMatchesStyleName as _, type IPluginStyleRegistryEntry as a, type IFormListVersionData as a$, type ICodeStyle as a0, type IColorInputStyle as a1, type IColorPickerStyle as a2, type IComboboxStyle as a3, type IContainerStyle as a4, type IDataContainerStyle as a5, type IDataViewStyle as a6, type IDatePickerStyle as a7, type IDividerStyle as a8, type IEntryFormListStyle as a9, type IFormListFileChange as aA, type IFormListFileValue as aB, type IFormListHistoricalFile as aC, type IFormListHistoryData as aD, type IFormListHistoryQuery as aE, type IFormListHistoryResponse as aF, type IFormListInfo as aG, type IFormListPagination as aH, type IFormListQuickActionData as aI, type IFormListQuickActionInfo as aJ, type IFormListQuickActionRequest as aK, type IFormListQuickActionResponse as aL, type IFormListRecordAccess as aM, type IFormListRestoreBlocker as aN, type IFormListRestoreChange as aO, type IFormListRestorePreview as aP, type IFormListRestoreRequest as aQ, type IFormListRestoreResponse as aR, type IFormListRestoreResult as aS, type IFormListRevision as aT, type IFormListRow as aU, type IFormListSelected as aV, type IFormListServedState as aW, type IFormListState as aX, type IFormListStateField as aY, type IFormListStateResponse as aZ, type IFormListValueChange as a_, type IEntryListStyle as aa, type IEntryRecordDeleteStyle as ab, type IEntryRecordFormStyle as ac, type IEntryRecordStyle as ad, type IEntryTableEntry as ae, type IEntryTableStyle as af, type IFieldsetStyle as ag, type IFigureStyle as ah, type IFileInputStyle as ai, type IFlexStyle as aj, type IFormDeleteData as ak, type IFormDeleteRequest as al, type IFormDeleteResponse as am, type IFormEffectiveContext as an, type IFormFileFieldOp as ao, type IFormInputError as ap, type IFormListActor as aq, type IFormListBaseStyle as ar, type IFormListCapabilities as as, type IFormListColumn as at, type IFormListCompareData as au, type IFormListCompareQuery as av, type IFormListCompareResponse as aw, type IFormListControl as ax, type IFormListControlOption as ay, type IFormListError as az, type TStylePlacement as b, type ITwoFactorAuthStyle as b$, type IFormListVersionResponse as b0, type IFormLogStyle as b1, type IFormRecordStyle as b2, type IFormResultLegacyFields as b3, type IFormStyle as b4, type IFormSubmitData as b5, type IFormSubmitRequest as b6, type IFormSubmitResponse as b7, type IFormUpdateData as b8, type IFormUpdateRequest as b9, type IProgressStyle as bA, type IRadioStyle as bB, type IRangeSliderStyle as bC, type IRatingStyle as bD, type IRefContainerStyle as bE, type IRegisterStyle as bF, type IResetPasswordStyle as bG, type IRichTextEditorStyle as bH, type IScrollAreaStyle as bI, type ISegmentedControlStyle as bJ, type ISelectStyle as bK, type ISimpleGridStyle as bL, type ISliderStyle as bM, type ISpaceStyle as bN, type ISpoilerStyle as bO, type IStackStyle as bP, type IStyleWithSpacing as bQ, type ISwitchStyle as bR, type ITabStyle as bS, type ITabsStyle as bT, type ITextInputStyle as bU, type ITextStyle as bV, type ITextareaStyle as bW, type IThemeIconStyle as bX, type ITimelineItemStyle as bY, type ITimelineStyle as bZ, type ITitleStyle as b_, type IFormUpdateResponse as ba, type IGridColumnStyle as bb, type IGridStyle as bc, type IGroupStyle as bd, type IHighlightStyle as be, type IHtmlTagStyle as bf, type IImageStyle as bg, type IIndicatorStyle as bh, type IInputStyle as bi, type IKbdStyle as bj, type ILinkStyle as bk, type IListItemStyle as bl, type IListStyle as bm, type ILoginStyle as bn, type ILoopStyle as bo, type IMeta as bp, type IMissingStyle as bq, type INoAccessStyle as br, type INotFoundStyle as bs, type INotificationStyle as bt, type INumberInputStyle as bu, type IPaperStyle as bv, type IPlatformAbout as bw, type IProfileStyle as bx, type IProgressRootStyle as by, type IProgressSectionStyle as bz, type TConcretePlatform as c, type TMantineTimelineAlign as c$, type ITypographyStyle as c0, type IUnknownStyle as c1, type IValidateStyle as c2, type IVersionStyle as c3, type IVideoStyle as c4, type TDataRevisionOperation as c5, type TDataRevisionSource as c6, type TEntryFormListFormFields as c7, type TFormConflictData as c8, type TFormInputRule as c9, type TMantineGridOffset as cA, type TMantineGridOrder as cB, type TMantineHeight as cC, type TMantineIconSize as cD, type TMantineImageFit as cE, type TMantineLineClamp as cF, type TMantineListCenter as cG, type TMantineListStyleType as cH, type TMantineListType as cI, type TMantineListWithPadding as cJ, type TMantinePaperShadow as cK, type TMantineProgressTransition as cL, type TMantineScrollAreaSize as cM, type TMantineScrollAreaType as cN, type TMantineTextAlign as cO, type TMantineTextDecoration as cP, type TMantineTextFontStyle as cQ, type TMantineTextFontWeight as cR, type TMantineTextInherit as cS, type TMantineTextInputVariant as cT, type TMantineTextSpan as cU, type TMantineTextTransform as cV, type TMantineTextTruncate as cW, type TMantineTextVariant as cX, type TMantineTextareaAutosize as cY, type TMantineTextareaResize as cZ, type TMantineTextareaVariant as c_, type TFormListCellValue as ca, type TFormListChange as cb, type TFormListColumnFormat as cc, type TFormListControlType as cd, type TFormListErrorReason as ce, type TFormListLabels as cf, type TFormListLayout as cg, type TFormListOpenMode as ch, type TFormListPresentation as ci, type TFormListRestoreBlockerReason as cj, type TFormListRestoreData as ck, type TFormListSortDirection as cl, type TFormListStyleName as cm, type TFormListTextMatch as cn, type TFormWriteRefusalReason as co, type TMantineAccordionChevronPosition as cp, type TMantineAccordionDisableChevronRotation as cq, type TMantineAccordionLoop as cr, type TMantineAccordionMultiple as cs, type TMantineAnchorUnderline as ct, type TMantineBorder as cu, type TMantineCardPadding as cv, type TMantineCardShadow as cw, type TMantineCols as cx, type TMantineDividerVariant as cy, type TMantineGap as cz, type TStylePlatform as d, type TMantineTitleLineClamp as d0, type TMantineTitleTextWrap as d1, type TMantineTranslatable as d2, type TMantineUseInputWrapper as d3, type TMantineWidth as d4, type TSharedBorder as d5, type TSharedCols as d6, type TSharedDimension as d7, type TSharedDividerLabelPosition as d8, type TSharedDividerVariant as d9, type TSharedLabelPosition as da, type TStyle as db, type TFormSectionStyleName as e, type TStyleRegistryKey as f, _resetPluginStyleRegistry as g, extendStyleRegistry as h, getMergedStyleRegistry as i, getPluginStyleRegistry as j, type IContentField as k, type IBaseApiResponse as l, type IAboutItem as m, type TMobileButtonFeedback as n, type TMobileFieldVariant as o, type TMobileSelectPresentation as p, type IFormInvalidData as q, type IFormListRestoreBlockedData as r, type IFormStaleVersionData as s, type IFormListFilesCell as t, type TFormListMode as u, type IFormListSort as v, type IAccordionItemStyle as w, type IAccordionStyle as x, type IActionIconStyle as y, type IAdminDataRecordCompareResponse as z };
|