@webx-ui/module-inbox 0.1.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/README.md +54 -0
- package/dist/FieldDialog.d.ts +16 -0
- package/dist/FieldList.d.ts +21 -0
- package/dist/FormAntispam.d.ts +10 -0
- package/dist/FormCreateDialog.d.ts +2 -0
- package/dist/FormEditorPage.d.ts +14 -0
- package/dist/FormEmbed.d.ts +19 -0
- package/dist/FormGeneral.d.ts +36 -0
- package/dist/FormNotifications.d.ts +24 -0
- package/dist/InboxPage.d.ts +19 -0
- package/dist/LocalizedRichText.d.ts +17 -0
- package/dist/StatusDialog.d.ts +16 -0
- package/dist/StatusesPage.d.ts +17 -0
- package/dist/SubmissionCreateDialog.d.ts +14 -0
- package/dist/SubmissionList.d.ts +33 -0
- package/dist/SubmissionPage.d.ts +17 -0
- package/dist/api.d.ts +54 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +3163 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +14 -0
- package/dist/module.d.ts +22 -0
- package/dist/options.d.ts +15 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +266 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @webx-ui/module-inbox
|
|
2
|
+
|
|
3
|
+
Forms and submissions as a section of the [WebX UI](https://github.com/webx-ui/webx-ui) admin
|
|
4
|
+
panel: the forms of a site on the left, what came in through one of them on the right.
|
|
5
|
+
|
|
6
|
+
The other half is `webx-ui/module-inbox` on the server, which holds the forms, takes the
|
|
7
|
+
submissions and sends the notifications. Neither is useful alone.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @webx-ui/module-inbox
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createAdmin } from '@webx-ui/module-admin'
|
|
17
|
+
import { inbox } from '@webx-ui/module-inbox'
|
|
18
|
+
import '@webx-ui/module-inbox/style.css'
|
|
19
|
+
|
|
20
|
+
createAdmin({
|
|
21
|
+
modules: [inbox()],
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The section claims the panel's front page: a panel with an inbox is one somebody opens in the
|
|
26
|
+
morning to see what came in overnight. A panel whose front page is something else says
|
|
27
|
+
`inbox({ landing: false })`.
|
|
28
|
+
|
|
29
|
+
## What is here
|
|
30
|
+
|
|
31
|
+
- **The section** — the forms in a column that can be dragged into order, each with what is
|
|
32
|
+
waiting in it, and the submissions of the chosen one beside them.
|
|
33
|
+
- **The form editor** — what the form is called and where it answers, its questions, who is
|
|
34
|
+
written to, the antispam, and the one line that puts it on a page.
|
|
35
|
+
- **The questions** — a field is a row with an identity, not a value of the form: it is saved
|
|
36
|
+
in its own dialog, dragged into its own order, and deleted softly so that answers already
|
|
37
|
+
given keep reading under the label they were asked with.
|
|
38
|
+
- **The statuses** — the states a submission can be in, as rows with their own words and
|
|
39
|
+
colours.
|
|
40
|
+
|
|
41
|
+
## Permissions
|
|
42
|
+
|
|
43
|
+
`inbox.view` opens the section and the submissions; `inbox.manage` changes what the forms ask
|
|
44
|
+
and what the statuses are. The panel draws only what the reader may do, and the server refuses
|
|
45
|
+
the rest either way.
|
|
46
|
+
|
|
47
|
+
## Words
|
|
48
|
+
|
|
49
|
+
The English here is a floor, so nothing shows a key while the dictionary is on its way. The
|
|
50
|
+
translations live in the Composer package — one set of files for both halves.
|
|
51
|
+
|
|
52
|
+
## Licence
|
|
53
|
+
|
|
54
|
+
MIT
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InboxField, InboxForm } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* One question, written.
|
|
4
|
+
*
|
|
5
|
+
* The settings shown are the ones the chosen type has and no others (§4): a `select` has
|
|
6
|
+
* choices, a `textarea` has a height, a `file` has a size and a list of extensions. Changing
|
|
7
|
+
* the type changes what is asked for, and the server keeps only what belongs — a leftover
|
|
8
|
+
* `choices` array on a text field would be a column of empty strings in an export a year from
|
|
9
|
+
* now.
|
|
10
|
+
*/
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
field: InboxField | null;
|
|
13
|
+
form: InboxForm;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InboxField, InboxForm } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The questions the form asks, in the order it asks them.
|
|
4
|
+
*
|
|
5
|
+
* A list with a grip rather than a table, because the order is the thing being edited here
|
|
6
|
+
* and a table cannot be dragged. Each question is saved on its own, in its own dialog: a
|
|
7
|
+
* field is a row with an identity that answers point at (§2.1), not a value of the form.
|
|
8
|
+
*/
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
form: InboxForm;
|
|
11
|
+
canManage: boolean;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = {
|
|
14
|
+
modelValue: InboxField[];
|
|
15
|
+
} & __VLS_Props;
|
|
16
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: InboxField[]) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: InboxField[]) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormOptions } from './types';
|
|
2
|
+
type __VLS_PublicProps = {
|
|
3
|
+
modelValue: FormOptions;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: FormOptions) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: FormOptions) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One form: what it is called, what it asks, who hears about it, and how it is put on a page.
|
|
3
|
+
*
|
|
4
|
+
* Five tabs and one save. The fields are the exception — a question is written in its own
|
|
5
|
+
* dialog and saved on its own, because it is a row with an identity (§2.1) and because a
|
|
6
|
+
* dragged order that waited for a save button would be an order nobody trusts.
|
|
7
|
+
*/
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
base?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
base: string;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InboxField, InboxForm } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* How the form gets onto a page.
|
|
4
|
+
*
|
|
5
|
+
* Two answers and both are one line, because the module's whole public half is one tag (§10):
|
|
6
|
+
* a template prints it, and a block type prints the same thing so that an editor never opens
|
|
7
|
+
* a template at all.
|
|
8
|
+
*
|
|
9
|
+
* Under them, the names. A hidden field is filled in by the page it stands on — the address
|
|
10
|
+
* somebody wrote from, the product they were looking at, the campaign that brought them — and
|
|
11
|
+
* the only way to fill one in is to know what it is called (§2.6).
|
|
12
|
+
*/
|
|
13
|
+
type __VLS_Props = {
|
|
14
|
+
form: InboxForm;
|
|
15
|
+
slug: string;
|
|
16
|
+
fields: InboxField[];
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LocalizedValue } from '@webx-ui/core';
|
|
2
|
+
import { FormOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* What the form is, and what it says once it has been sent.
|
|
5
|
+
*
|
|
6
|
+
* The two halves are on two cards because they are read at two different times: the first is
|
|
7
|
+
* set up once, the second is the sentence a visitor sees and is rewritten whenever the
|
|
8
|
+
* marketing does.
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
errors: Record<string, string[]>;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = {
|
|
14
|
+
'settings': {
|
|
15
|
+
slug: string;
|
|
16
|
+
title: LocalizedValue;
|
|
17
|
+
is_enabled: boolean;
|
|
18
|
+
};
|
|
19
|
+
'options': FormOptions;
|
|
20
|
+
} & __VLS_Props;
|
|
21
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
"update:settings": (value: {
|
|
23
|
+
slug: string;
|
|
24
|
+
title: LocalizedValue;
|
|
25
|
+
is_enabled: boolean;
|
|
26
|
+
}) => any;
|
|
27
|
+
"update:options": (value: FormOptions) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
"onUpdate:settings"?: ((value: {
|
|
30
|
+
slug: string;
|
|
31
|
+
title: LocalizedValue;
|
|
32
|
+
is_enabled: boolean;
|
|
33
|
+
}) => any) | undefined;
|
|
34
|
+
"onUpdate:options"?: ((value: FormOptions) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FormOptions, InboxField } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Who hears that something arrived (§9).
|
|
4
|
+
*
|
|
5
|
+
* Two kinds of recipient and they are not interchangeable. An administrator is written to at
|
|
6
|
+
* the address on their account and in the language they keep the panel in, so changing either
|
|
7
|
+
* changes it everywhere; a typed address is written to in the language the submission came in.
|
|
8
|
+
* The list offered is not every administrator but the ones who may open a submission — a
|
|
9
|
+
* notification is a link, and sending one to somebody who gets a 403 looks like the panel is
|
|
10
|
+
* broken rather than like the form is.
|
|
11
|
+
*/
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
fields: InboxField[];
|
|
14
|
+
errors: Record<string, string[]>;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_PublicProps = {
|
|
17
|
+
modelValue: FormOptions;
|
|
18
|
+
} & __VLS_Props;
|
|
19
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
"update:modelValue": (value: FormOptions) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: ((value: FormOptions) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The section: the forms of the site on the left, what came in through one of them on the
|
|
3
|
+
* right (§11, §2.12).
|
|
4
|
+
*
|
|
5
|
+
* One screen rather than two, and that is the decision this is built around. The columns of
|
|
6
|
+
* the list are the fields of the chosen form, so a list of everything would have no columns
|
|
7
|
+
* to speak of; and the two questions somebody opens this section to ask — "what is new" and
|
|
8
|
+
* "what does this form ask" — are one click apart instead of one screen apart.
|
|
9
|
+
*
|
|
10
|
+
* The right-hand side is the submissions, and it arrives with them. What is here is the
|
|
11
|
+
* column: the forms, in the order somebody dragged them, with what is waiting in each.
|
|
12
|
+
*/
|
|
13
|
+
type __VLS_Props = {
|
|
14
|
+
base?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
|
+
base: string;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LocalizedValue } from '@webx-ui/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
minHeight?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = {
|
|
7
|
+
modelValue?: LocalizedValue | string;
|
|
8
|
+
} & __VLS_Props;
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (value: string | LocalizedValue) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((value: string | LocalizedValue) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
placeholder: string;
|
|
15
|
+
minHeight: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InboxStatus } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* One state, written.
|
|
4
|
+
*
|
|
5
|
+
* The colour is a tone rather than a swatch: the panel has a light theme and a dark one, and
|
|
6
|
+
* a colour picked in one of them is unreadable in the other.
|
|
7
|
+
*
|
|
8
|
+
* Nothing here refuses a second default — the server clears the flag on whoever had it, which
|
|
9
|
+
* is what somebody moving the default from one status to another means, and refusing the save
|
|
10
|
+
* would be the other reading of the same click.
|
|
11
|
+
*/
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
status: InboxStatus | null;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The states a submission can be in (§2.11).
|
|
3
|
+
*
|
|
4
|
+
* Rows rather than an enum, because every panel ends up wanting its own words — and the flags
|
|
5
|
+
* are what the section reads, not the keys, so renaming "New" to whatever this client calls
|
|
6
|
+
* it keeps it the status a new submission gets.
|
|
7
|
+
*
|
|
8
|
+
* Their order is the order of the tabs over the list of submissions, which is why it is
|
|
9
|
+
* dragged rather than typed.
|
|
10
|
+
*/
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
base?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
+
base: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InboxForm } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A submission typed in by hand — a call that came by telephone, a form filled in on paper.
|
|
4
|
+
*
|
|
5
|
+
* The same questions the site asks, drawn from the same fields, and sent to the same intake:
|
|
6
|
+
* the rules are the form's own, so a required field is required here too and a refusal reads
|
|
7
|
+
* the same way. The one thing the panel cannot do is attach a visitor's file, because there is
|
|
8
|
+
* no visitor — the files a submission carries are what was posted with it.
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
form: InboxForm;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InboxForm } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* What has come in through the chosen form — the right-hand side of the section (§11).
|
|
4
|
+
*
|
|
5
|
+
* Its columns are the form's own `in_table` fields and arrive with the rows, so this never has
|
|
6
|
+
* to fetch the form to know what it is drawing. Which of them survive a narrow pane is decided
|
|
7
|
+
* here and not by the form: the first answer identifies the row and stays at any width, and
|
|
8
|
+
* each one after it goes a step earlier than the last. Pairing two of them into one cell — the
|
|
9
|
+
* e-mail under the name — would mean guessing which fields mean what, and the panel does not
|
|
10
|
+
* know that about somebody else's form.
|
|
11
|
+
*
|
|
12
|
+
* The state of the list lives in the address: coming back from a submission has to land on the
|
|
13
|
+
* same form, the same tab and the same page, or the screen costs exactly that over the dialog
|
|
14
|
+
* it was chosen instead of (§11).
|
|
15
|
+
*/
|
|
16
|
+
type __VLS_Props = {
|
|
17
|
+
form: InboxForm;
|
|
18
|
+
/** Where the section is mounted. */
|
|
19
|
+
base?: string;
|
|
20
|
+
/** Whether the pane is beside the list of forms or is the whole screen. */
|
|
21
|
+
inline?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
back: () => any;
|
|
25
|
+
changed: () => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onBack?: (() => any) | undefined;
|
|
28
|
+
onChanged?: (() => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
inline: boolean;
|
|
31
|
+
base: string;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One submission, on a screen of its own (§11).
|
|
3
|
+
*
|
|
4
|
+
* A dialog over the list would have kept the filters under the reader's hand, and it was
|
|
5
|
+
* rejected for one reason: a submission needs an address somebody can send. It goes into the
|
|
6
|
+
* mail to whoever deals with it, it gets pasted into a chat, an agent links to it. What the
|
|
7
|
+
* dialog would have given back is paid for here instead — the list's whole state travels in
|
|
8
|
+
* the address, so the way out lands exactly where the reader was, and the arrows walk the same
|
|
9
|
+
* filtered pile.
|
|
10
|
+
*/
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
base?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
+
base: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AdminContext } from '@webx-ui/module-admin';
|
|
2
|
+
import { FieldInput, FormInput, InboxField, InboxForm, InboxRecipient, InboxStatus, InboxSubmission, StatusInput, SubmissionInput, SubmissionMassInput, SubmissionQuery, SubmissionsPage } from './types';
|
|
3
|
+
export interface InboxApi {
|
|
4
|
+
/** Every form, in the order of the column, with what is waiting in each. */
|
|
5
|
+
forms(): Promise<InboxForm[]>;
|
|
6
|
+
/** One form with its fields — what the editor opens. */
|
|
7
|
+
form(id: number): Promise<InboxForm>;
|
|
8
|
+
createForm(input: FormInput): Promise<InboxForm>;
|
|
9
|
+
saveForm(id: number, input: FormInput): Promise<InboxForm>;
|
|
10
|
+
/** Refused with a 422 when the form has submissions: it is switched off, not deleted. */
|
|
11
|
+
removeForm(id: number): Promise<void>;
|
|
12
|
+
/** A copy, switched off, with the questions and none of the answers. */
|
|
13
|
+
duplicateForm(id: number): Promise<InboxForm>;
|
|
14
|
+
sortForms(ids: number[]): Promise<void>;
|
|
15
|
+
fields(formId: number): Promise<InboxField[]>;
|
|
16
|
+
createField(formId: number, input: FieldInput): Promise<InboxField>;
|
|
17
|
+
saveField(id: number, input: FieldInput): Promise<InboxField>;
|
|
18
|
+
/** Softly: the answers already given through it keep reading. */
|
|
19
|
+
removeField(id: number): Promise<void>;
|
|
20
|
+
sortFields(formId: number, ids: number[]): Promise<void>;
|
|
21
|
+
statuses(): Promise<InboxStatus[]>;
|
|
22
|
+
createStatus(input: StatusInput): Promise<InboxStatus>;
|
|
23
|
+
saveStatus(id: number, input: StatusInput): Promise<InboxStatus>;
|
|
24
|
+
/** Refused with a 422 while submissions are still in it. */
|
|
25
|
+
removeStatus(id: number): Promise<void>;
|
|
26
|
+
sortStatuses(ids: number[]): Promise<void>;
|
|
27
|
+
/** The administrators a form can be told to write to: the ones who may read the section. */
|
|
28
|
+
recipients(): Promise<InboxRecipient[]>;
|
|
29
|
+
/** One form's submissions, with the columns of the list and the counts of its tabs. */
|
|
30
|
+
submissions(formId: number, query?: SubmissionQuery): Promise<SubmissionsPage>;
|
|
31
|
+
/**
|
|
32
|
+
* One of them, open. Opening it marks it read.
|
|
33
|
+
*
|
|
34
|
+
* The filters travel with it so that the neighbours it reports are the ones either side of
|
|
35
|
+
* it in the list somebody was actually looking at.
|
|
36
|
+
*/
|
|
37
|
+
submission(id: number, query?: SubmissionQuery): Promise<InboxSubmission>;
|
|
38
|
+
/** Typed in by hand — a call that came by telephone. `fields` is by machine name. */
|
|
39
|
+
createSubmission(formId: number, fields: Record<string, unknown>): Promise<InboxSubmission>;
|
|
40
|
+
saveSubmission(id: number, input: SubmissionInput): Promise<InboxSubmission>;
|
|
41
|
+
removeSubmission(id: number): Promise<void>;
|
|
42
|
+
/** A pile moved, marked or thrown away at once. */
|
|
43
|
+
massSubmissions(input: SubmissionMassInput): Promise<{
|
|
44
|
+
count: number;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Where the spreadsheet is. An address rather than a request: a download is the browser's
|
|
48
|
+
* own job, and fetching a file into memory to hand it back to the browser is work for
|
|
49
|
+
* nothing.
|
|
50
|
+
*/
|
|
51
|
+
exportUrl(formId: number, query?: SubmissionQuery): string;
|
|
52
|
+
}
|
|
53
|
+
/** Everything under `/inbox`, below the panel's API path. */
|
|
54
|
+
export declare function createInboxApi(admin: AdminContext): InboxApi;
|
package/dist/i18n.d.ts
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { inbox, type InboxOptions } from './module';
|
|
2
|
+
export { createInboxApi, type InboxApi } from './api';
|
|
3
|
+
export { inboxMessages } from './messages';
|
|
4
|
+
export { option } from './options';
|
|
5
|
+
export { default as WxInboxPage } from './InboxPage';
|
|
6
|
+
export { default as WxInboxFormEditor } from './FormEditorPage';
|
|
7
|
+
export { default as WxInboxStatusesPage } from './StatusesPage';
|
|
8
|
+
export { default as WxInboxSubmissionList } from './SubmissionList';
|
|
9
|
+
export { default as WxInboxSubmissionPage } from './SubmissionPage';
|
|
10
|
+
export { default as WxInboxFieldList } from './FieldList';
|
|
11
|
+
export { FIELD_TYPES, STATUS_COLORS } from './types';
|
|
12
|
+
export type { FieldChoice, FieldInput, FieldOptions, FieldType, FormInput, FormOptions, InboxField, InboxForm, InboxAdmin, InboxPage, InboxRecipient, InboxStatus, InboxSubmission, Recipient, StatusColor, StatusInput, SubmissionAttachment, SubmissionColumn, SubmissionCounts, SubmissionEvent, SubmissionInput, SubmissionMassInput, SubmissionMeta, SubmissionQuery, SubmissionRow, SubmissionsPage, SubmissionValue, } from './types';
|