@lblod/ember-rdfa-editor-lblod-plugins 28.0.0 → 28.1.0-dev.ed578cc3a5b1de900ca53bd1e5ebe4e950e51439
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/.changeset/kind-cooks-cross.md +5 -0
- package/.changeset/lovely-carpets-grow.md +5 -0
- package/CHANGELOG.md +12 -0
- package/addon/components/besluit-type-plugin/besluit-type-form.gts +68 -0
- package/addon/components/besluit-type-plugin/besluit-type-select.gts +80 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.gts +191 -0
- package/addon/components/common/documents/preview.gts +24 -6
- package/addon/components/common/documents/types.ts +2 -17
- package/addon/components/snippet-plugin/nodes/snippet.gts +1 -1
- package/addon/components/snippet-plugin/snippet-insert.gts +1 -1
- package/addon/plugins/besluit-type-plugin/utils/besluit-type-instances.ts +100 -0
- package/addon/plugins/besluit-type-plugin/utils/set-besluit-type.ts +57 -0
- package/addon/plugins/snippet-plugin/index.ts +5 -10
- package/addon/plugins/snippet-plugin/utils/collate-imported-resources.ts +5 -2
- package/app/components/besluit-type-plugin/besluit-type-form.js +1 -0
- package/declarations/addon/components/besluit-type-plugin/besluit-type-form.d.ts +17 -0
- package/declarations/addon/components/besluit-type-plugin/besluit-type-select.d.ts +15 -8
- package/declarations/addon/components/besluit-type-plugin/toolbar-dropdown.d.ts +8 -28
- package/declarations/addon/components/common/documents/preview.d.ts +2 -0
- package/declarations/addon/components/common/documents/types.d.ts +2 -9
- package/declarations/addon/plugins/besluit-type-plugin/utils/besluit-type-instances.d.ts +18 -0
- package/declarations/addon/plugins/besluit-type-plugin/utils/set-besluit-type.d.ts +4 -0
- package/declarations/addon/plugins/snippet-plugin/index.d.ts +3 -3
- package/package.json +1 -1
- package/translations/en-US.yaml +9 -7
- package/translations/nl-BE.yaml +12 -10
- package/addon/components/besluit-type-plugin/besluit-type-select.hbs +0 -32
- package/addon/components/besluit-type-plugin/besluit-type-select.ts +0 -29
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +0 -102
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +0 -223
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { IMPORTED_RESOURCES_ATTR } from '@lblod/ember-rdfa-editor/plugins/imported-resources';
|
|
2
2
|
import { jsonParse } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
3
3
|
import { type Snippet } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
|
+
import { optionMap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
4
5
|
|
|
5
6
|
export function collateImportedResources(snippets: Snippet[]): string[] {
|
|
6
7
|
const domParser = new DOMParser();
|
|
7
8
|
return [
|
|
8
9
|
...new Set(
|
|
9
10
|
snippets.flatMap(({ content }) => {
|
|
10
|
-
const htmlNode =
|
|
11
|
-
|
|
11
|
+
const htmlNode = optionMap(
|
|
12
|
+
(some) => domParser.parseFromString(some, 'text/html'),
|
|
13
|
+
content,
|
|
14
|
+
);
|
|
12
15
|
const imports = jsonParse(
|
|
13
16
|
htmlNode
|
|
14
17
|
?.querySelector('[data-say-document]')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/besluit-type-plugin/besluit-type-form';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
|
|
3
|
+
import { type BesluitTypeInstance } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/besluit-type-instances';
|
|
4
|
+
interface Sig {
|
|
5
|
+
Args: {
|
|
6
|
+
types: BesluitType[];
|
|
7
|
+
selectedType?: BesluitTypeInstance;
|
|
8
|
+
setType: (selected: BesluitTypeInstance) => void;
|
|
9
|
+
};
|
|
10
|
+
Element: HTMLDivElement;
|
|
11
|
+
}
|
|
12
|
+
export default class BesluitTypePluginBesluitTypeSelectComponent extends Component<Sig> {
|
|
13
|
+
updateParentType: (selected: BesluitType) => void;
|
|
14
|
+
updateSubType: (selected: BesluitType) => void;
|
|
15
|
+
updateSubSubType: (selected: BesluitType) => void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { type BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
|
|
3
|
+
interface Sig {
|
|
4
|
+
Args: {
|
|
5
|
+
fieldNameTranslation: string;
|
|
6
|
+
besluitTypes: BesluitType[];
|
|
7
|
+
selected?: BesluitType;
|
|
8
|
+
showWarningWhenEmpty: boolean;
|
|
9
|
+
onchange: (selected: BesluitType) => void;
|
|
10
|
+
};
|
|
11
|
+
Element: HTMLDivElement;
|
|
12
|
+
}
|
|
13
|
+
export default class BesluitTypePluginBesluitTypeSelectComponent extends Component<Sig> {
|
|
8
14
|
besluitTypes: BesluitType[];
|
|
9
|
-
constructor(parent: unknown, args: Args);
|
|
10
|
-
|
|
15
|
+
constructor(parent: unknown, args: Sig['Args']);
|
|
16
|
+
get showWarning(): boolean;
|
|
17
|
+
search: (term: string) => BesluitType[];
|
|
11
18
|
}
|
|
12
19
|
export {};
|
|
@@ -1,42 +1,22 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
|
|
4
3
|
import { BesluitTypePluginOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin';
|
|
4
|
+
import { BesluitTypeInstance } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/besluit-type-instances';
|
|
5
5
|
type Args = {
|
|
6
6
|
controller: SayController;
|
|
7
7
|
options: BesluitTypePluginOptions;
|
|
8
8
|
};
|
|
9
9
|
export default class EditorPluginsToolbarDropdownComponent extends Component<Args> {
|
|
10
|
-
|
|
11
|
-
MailIcon: import("@ember/component/template-only").TOC<import("@appuniversum/ember-appuniversum/components/icons/mail").MailIconSignature>;
|
|
12
|
-
CrossIcon: import("@ember/component/template-only").TOC<import("@appuniversum/ember-appuniversum/components/icons/cross").CrossIconSignature>;
|
|
13
|
-
AlertTriangleIcon: import("@ember/component/template-only").TOC<import("@appuniversum/ember-appuniversum/components/icons/alert-triangle").AlertTriangleIconSignature>;
|
|
14
|
-
/**
|
|
15
|
-
* Actual besluit type selected
|
|
16
|
-
* @property besluitType
|
|
17
|
-
* @type BesluitType
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
besluitType?: BesluitType;
|
|
21
|
-
previousBesluitType?: string;
|
|
22
|
-
besluit?: BesluitType;
|
|
23
|
-
subBesluit?: BesluitType;
|
|
24
|
-
subSubBesluit?: BesluitType;
|
|
10
|
+
selectedTypeInstance?: BesluitTypeInstance;
|
|
25
11
|
cardExpanded: boolean;
|
|
26
|
-
constructor(parent: unknown, args: Args);
|
|
27
12
|
get controller(): SayController;
|
|
28
|
-
|
|
29
|
-
types: import("reactiveweb/function").State<Promise<BesluitType[]>>;
|
|
13
|
+
types: import("reactiveweb/function").State<Promise<import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes").BesluitType[]>>;
|
|
30
14
|
get currentBesluitRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
31
|
-
get currentBesluitURI(): string | undefined;
|
|
32
15
|
get showCard(): boolean;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
findBesluitTypeByURI(uri: string, types?: BesluitType[] | null): BesluitType | undefined;
|
|
39
|
-
insert(): void;
|
|
40
|
-
toggleCard(): void;
|
|
16
|
+
get selectedType(): import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes").BesluitType | undefined;
|
|
17
|
+
toggleCard: () => void;
|
|
18
|
+
setType: (type: BesluitTypeInstance) => void;
|
|
19
|
+
updateBesluitTypes: () => void;
|
|
20
|
+
insertIfValid(): void;
|
|
41
21
|
}
|
|
42
22
|
export {};
|
|
@@ -17,5 +17,7 @@ export default class DocumentPreview<Doc extends PreviewableDocument> extends Co
|
|
|
17
17
|
togglePreview(): void;
|
|
18
18
|
get isFavourite(): boolean | undefined;
|
|
19
19
|
toggleFavourite: (event: MouseEvent) => void;
|
|
20
|
+
contentTask: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<"" | import("@ember/template").SafeString | null>>;
|
|
21
|
+
get content(): "" | import("@ember/template").SafeString | null | undefined;
|
|
20
22
|
}
|
|
21
23
|
export {};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
interface PreviewableDocumentArgs {
|
|
1
|
+
export interface PreviewableDocument {
|
|
3
2
|
title: string | null;
|
|
4
|
-
content: string | null;
|
|
3
|
+
content: string | Promise<string | null> | null;
|
|
5
4
|
}
|
|
6
|
-
export declare class PreviewableDocument {
|
|
7
|
-
content: SafeString | null;
|
|
8
|
-
title: string | null;
|
|
9
|
-
constructor({ title, content }: PreviewableDocumentArgs);
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type EditorState } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { type BesluitType } from './fetchBesluitTypes';
|
|
3
|
+
export interface BesluitTypeInstance {
|
|
4
|
+
parent: BesluitType;
|
|
5
|
+
subType?: BesluitType;
|
|
6
|
+
subSubType?: BesluitType;
|
|
7
|
+
}
|
|
8
|
+
export declare function extractBesluitTypeUris(editorState: EditorState): string[];
|
|
9
|
+
/**
|
|
10
|
+
* Finds a decision type in the document and checks that it represents a valid decision type
|
|
11
|
+
* according to the list of types passed in.
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkBesluitTypeInstance(editorState: EditorState, types: BesluitType[]): BesluitTypeInstance | false;
|
|
14
|
+
/**
|
|
15
|
+
* Checks that the passed type instance has all of the necessary sub-types selected (and no more)
|
|
16
|
+
*/
|
|
17
|
+
export declare function isValidTypeChoice({ parent, subType, subSubType, }: BesluitTypeInstance): boolean;
|
|
18
|
+
export declare function mostSpecificBesluitType(typeInstance: BesluitTypeInstance): BesluitType;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type EditorState } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { type TransactionCombinatorResult } from '@lblod/ember-rdfa-editor/utils/transaction-utils';
|
|
3
|
+
import { type BesluitTypeInstance } from './besluit-type-instances';
|
|
4
|
+
export declare function setBesluitType(initialState: EditorState, typeInstance: BesluitTypeInstance): TransactionCombinatorResult<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PreviewableDocument } from '@lblod/ember-rdfa-editor-lblod-plugins/components/common/documents/types';
|
|
1
2
|
import { type Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
2
|
-
import { SafeString } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
3
3
|
export declare const DEFAULT_CONTENT_STRING = "block+";
|
|
4
4
|
export type SnippetPluginConfig = {
|
|
5
5
|
endpoint: string;
|
|
@@ -11,8 +11,8 @@ interface SnippetArgs {
|
|
|
11
11
|
createdOn: string | null;
|
|
12
12
|
content: string | null;
|
|
13
13
|
}
|
|
14
|
-
export declare class Snippet {
|
|
15
|
-
content:
|
|
14
|
+
export declare class Snippet implements PreviewableDocument {
|
|
15
|
+
content: string | null;
|
|
16
16
|
createdOn: string | null;
|
|
17
17
|
title: string | null;
|
|
18
18
|
constructor({ title, createdOn, content }: SnippetArgs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "28.0.
|
|
3
|
+
"version": "28.1.0-dev.ed578cc3a5b1de900ca53bd1e5ebe4e950e51439",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
package/translations/en-US.yaml
CHANGED
|
@@ -12,6 +12,13 @@ common:
|
|
|
12
12
|
asc: Sort ascending
|
|
13
13
|
desc: Sort descending
|
|
14
14
|
not-applicable: 'N/A'
|
|
15
|
+
preview-list:
|
|
16
|
+
preview-button:
|
|
17
|
+
title: Show preview
|
|
18
|
+
select-button:
|
|
19
|
+
label: Select
|
|
20
|
+
title: Insert
|
|
21
|
+
no-content: Does not contain any content
|
|
15
22
|
|
|
16
23
|
structure-plugin:
|
|
17
24
|
move-up: 'Move {structureName} up'
|
|
@@ -82,6 +89,7 @@ citaten-plugin:
|
|
|
82
89
|
|
|
83
90
|
besluit-type-plugin:
|
|
84
91
|
dt: 'Decision type'
|
|
92
|
+
sub-type: 'Sub type'
|
|
85
93
|
insert-dt: 'Select a decision type'
|
|
86
94
|
search-message: 'Type to search'
|
|
87
95
|
no-matches-message: 'No results'
|
|
@@ -219,7 +227,7 @@ variable-plugin:
|
|
|
219
227
|
minimum-placeholder: minimum value
|
|
220
228
|
maximum: Maximum
|
|
221
229
|
maximum-placeholder: maximum value
|
|
222
|
-
to: to
|
|
230
|
+
to: to and including
|
|
223
231
|
person:
|
|
224
232
|
card-title: Insert person
|
|
225
233
|
nodeview-placeholder: Person
|
|
@@ -255,16 +263,10 @@ snippet-plugin:
|
|
|
255
263
|
active-lists: 'Active lists:'
|
|
256
264
|
modal:
|
|
257
265
|
title: Choose a snippet from {snippetListNames}
|
|
258
|
-
preview-button:
|
|
259
|
-
title: Show snippet preview
|
|
260
|
-
select-button:
|
|
261
|
-
label: Select
|
|
262
|
-
title: Insert snippet
|
|
263
266
|
search:
|
|
264
267
|
title: Filter on
|
|
265
268
|
label: Snippet name
|
|
266
269
|
placeholder: Type something...
|
|
267
|
-
no-content: Snippet does not contain any content
|
|
268
270
|
snippet-list:
|
|
269
271
|
open-modal: Manage snippet lists
|
|
270
272
|
modal:
|
package/translations/nl-BE.yaml
CHANGED
|
@@ -12,6 +12,13 @@ common:
|
|
|
12
12
|
asc: Oplopend sorteren
|
|
13
13
|
desc: Aflopend sorteren
|
|
14
14
|
not-applicable: 'n.v.t.'
|
|
15
|
+
preview-list:
|
|
16
|
+
preview-button:
|
|
17
|
+
title: Preview tonen
|
|
18
|
+
select-button:
|
|
19
|
+
label: Selecteer
|
|
20
|
+
title: Invoegen
|
|
21
|
+
no-content: Bevat geen inhoud
|
|
15
22
|
|
|
16
23
|
structure-plugin:
|
|
17
24
|
move-up: '{structureName} naar boven verplaatsen'
|
|
@@ -43,10 +50,10 @@ structure-plugin:
|
|
|
43
50
|
|
|
44
51
|
citaten-plugin:
|
|
45
52
|
card:
|
|
46
|
-
title: Voeg
|
|
53
|
+
title: Voeg citaat toe
|
|
47
54
|
suggestions: Suggesties
|
|
48
55
|
insert:
|
|
49
|
-
title:
|
|
56
|
+
title: Citaat invoegen
|
|
50
57
|
search:
|
|
51
58
|
term: Zoekterm
|
|
52
59
|
government-search: Filter op bestuursorgaan
|
|
@@ -70,7 +77,7 @@ citaten-plugin:
|
|
|
70
77
|
previous: Vorige pagina
|
|
71
78
|
of: van
|
|
72
79
|
references:
|
|
73
|
-
insert:
|
|
80
|
+
insert: Citaat invoegen
|
|
74
81
|
details: Details
|
|
75
82
|
refer-whole: Verwijs naar volledig document
|
|
76
83
|
refer-article: Verwijs naar artikel
|
|
@@ -82,6 +89,7 @@ citaten-plugin:
|
|
|
82
89
|
|
|
83
90
|
besluit-type-plugin:
|
|
84
91
|
dt: 'Besluittype'
|
|
92
|
+
sub-type: 'Subtype'
|
|
85
93
|
insert-dt: 'Selecteer een besluittype'
|
|
86
94
|
search-message: 'Typ om te zoeken'
|
|
87
95
|
no-matches-message: 'Geen resultaten'
|
|
@@ -223,7 +231,7 @@ variable-plugin:
|
|
|
223
231
|
minimum-placeholder: minimumwaarde
|
|
224
232
|
maximum: Maximum
|
|
225
233
|
maximum-placeholder: maximumwaarde
|
|
226
|
-
to: tot
|
|
234
|
+
to: tot en met
|
|
227
235
|
person:
|
|
228
236
|
card-title: Persoon invoegen
|
|
229
237
|
nodeview-placeholder: Persoon
|
|
@@ -254,16 +262,10 @@ snippet-plugin:
|
|
|
254
262
|
active-lists: 'Actieve lijsten:'
|
|
255
263
|
modal:
|
|
256
264
|
title: Kies een fragment uit {snippetListNames}
|
|
257
|
-
preview-button:
|
|
258
|
-
title: Preview van fragment tonen
|
|
259
|
-
select-button:
|
|
260
|
-
label: Selecteer
|
|
261
|
-
title: Fragment invoegen
|
|
262
265
|
search:
|
|
263
266
|
title: Filter op
|
|
264
267
|
label: Fragmentnaam
|
|
265
268
|
placeholder: Typ iets...
|
|
266
|
-
no-content: Fragment bevat geen inhoud
|
|
267
269
|
snippet-list:
|
|
268
270
|
open-modal: Fragmentlijsten beheren
|
|
269
271
|
modal:
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<div ...attributes>
|
|
3
|
-
<PowerSelect
|
|
4
|
-
@renderInPlace={{true}}
|
|
5
|
-
@searchEnabled={{true}}
|
|
6
|
-
@searchMessage={{t 'besluit-type-plugin.search-message'}}
|
|
7
|
-
@noMatchesMessage={{t 'besluit-type-plugin.no-matches-message'}}
|
|
8
|
-
@search={{this.search}}
|
|
9
|
-
@options={{this.besluitTypes}}
|
|
10
|
-
@selected={{@selected}}
|
|
11
|
-
@onChange={{@onchange}}
|
|
12
|
-
as |besluitType|
|
|
13
|
-
>
|
|
14
|
-
{{besluitType.label}}
|
|
15
|
-
</PowerSelect>
|
|
16
|
-
<p class='au-u-muted au-u-margin-tiny au-u-margin-bottom-small'>
|
|
17
|
-
{{@selected.definition}}
|
|
18
|
-
</p>
|
|
19
|
-
{{#if @showWarningWhenEmpty}}
|
|
20
|
-
{{#unless @selected}}
|
|
21
|
-
<AuAlert
|
|
22
|
-
@icon={{this.AlertTriangleIcon}}
|
|
23
|
-
@title={{t 'besluit-type-plugin.alert-title'}}
|
|
24
|
-
@skin='warning'
|
|
25
|
-
@size='small'
|
|
26
|
-
class='au-u-margin-bottom-none au-u-margin-top-small'
|
|
27
|
-
>
|
|
28
|
-
<p>{{t 'besluit-type-plugin.alert-body'}}</p>
|
|
29
|
-
</AuAlert>
|
|
30
|
-
{{/unless}}
|
|
31
|
-
{{/if}}
|
|
32
|
-
</div>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { action } from '@ember/object';
|
|
3
|
-
import { tracked } from '@glimmer/tracking';
|
|
4
|
-
import { BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
|
|
5
|
-
import { AlertTriangleIcon } from '@appuniversum/ember-appuniversum/components/icons/alert-triangle';
|
|
6
|
-
|
|
7
|
-
type Args = {
|
|
8
|
-
besluitTypes: BesluitType[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default class BesluitTypePluginBesluitTypeSelectComponent extends Component<Args> {
|
|
12
|
-
AlertTriangleIcon = AlertTriangleIcon;
|
|
13
|
-
|
|
14
|
-
@tracked besluitTypes;
|
|
15
|
-
constructor(parent: unknown, args: Args) {
|
|
16
|
-
super(parent, args);
|
|
17
|
-
this.besluitTypes = this.args.besluitTypes.sort((a, b) =>
|
|
18
|
-
a.label > b.label ? 1 : -1,
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@action
|
|
23
|
-
search(term: string) {
|
|
24
|
-
const lowerTerm = term.toLowerCase();
|
|
25
|
-
return this.args.besluitTypes.filter((besluitType) =>
|
|
26
|
-
besluitType.label.toLowerCase().includes(lowerTerm),
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<div
|
|
3
|
-
{{did-update this.updateBesluitTypes @controller.mainEditorState}}
|
|
4
|
-
{{did-update this.updateBesluitTypes this.types.value}}
|
|
5
|
-
>
|
|
6
|
-
{{#if this.showCard}}
|
|
7
|
-
{{#if this.types.isError}}
|
|
8
|
-
<AuPill
|
|
9
|
-
@skin='error'
|
|
10
|
-
@icon={{this.CircleXIcon}}
|
|
11
|
-
@iconAlignment='left'
|
|
12
|
-
class='au-c-pill--link besluit-toolbar-pill'
|
|
13
|
-
{{on 'click' this.toggleCard}}
|
|
14
|
-
title={{t 'besluit-type-plugin.insert-dt'}}
|
|
15
|
-
>
|
|
16
|
-
{{t 'besluit-type-plugin.error-short'}}
|
|
17
|
-
</AuPill>
|
|
18
|
-
{{else}}
|
|
19
|
-
{{#if this.besluit.label}}
|
|
20
|
-
<AuPill
|
|
21
|
-
@skin='link'
|
|
22
|
-
{{on 'click' this.toggleCard}}
|
|
23
|
-
title={{t 'besluit-type-plugin.insert-dt'}}
|
|
24
|
-
>
|
|
25
|
-
{{t 'besluit-type-plugin.dt'}}:
|
|
26
|
-
{{this.besluit.label}}
|
|
27
|
-
</AuPill>
|
|
28
|
-
{{else}}
|
|
29
|
-
<AuPill
|
|
30
|
-
@icon={{this.AlertTriangleIcon}}
|
|
31
|
-
@iconAlignment='left'
|
|
32
|
-
@skin='link'
|
|
33
|
-
{{on 'click' this.toggleCard}}
|
|
34
|
-
title={{t 'besluit-type-plugin.insert-dt'}}
|
|
35
|
-
>
|
|
36
|
-
{{t 'besluit-type-plugin.insert-dt'}}
|
|
37
|
-
</AuPill>
|
|
38
|
-
{{/if}}
|
|
39
|
-
{{/if}}
|
|
40
|
-
{{/if}}
|
|
41
|
-
{{#if this.cardExpanded}}
|
|
42
|
-
<AuModal
|
|
43
|
-
@title={{t 'besluit-type-plugin.insert-dt'}}
|
|
44
|
-
@closeModal={{this.toggleCard}}
|
|
45
|
-
@modalOpen={{true}}
|
|
46
|
-
@size='default'
|
|
47
|
-
class='au-c-modal--overflow'
|
|
48
|
-
as |Modal|
|
|
49
|
-
>
|
|
50
|
-
<Modal.Body>
|
|
51
|
-
{{#if this.types.isError}}
|
|
52
|
-
<AuAlert
|
|
53
|
-
@title={{t 'besluit-type-plugin.error-title'}}
|
|
54
|
-
@skin='error'
|
|
55
|
-
@icon={{this.CrossIcon}}
|
|
56
|
-
>
|
|
57
|
-
<p>
|
|
58
|
-
{{t 'besluit-type-plugin.error-first-body'}}
|
|
59
|
-
{{! template-lint-disable no-bare-strings }}
|
|
60
|
-
<AuLinkExternal
|
|
61
|
-
href='mailto:gelinktnotuleren@vlaanderen.be'
|
|
62
|
-
@icon={{this.MailIcon}}
|
|
63
|
-
@iconAlignment='left'
|
|
64
|
-
>
|
|
65
|
-
GelinktNotuleren@vlaanderen.be
|
|
66
|
-
</AuLinkExternal>
|
|
67
|
-
{{! template-lint-enable no-bare-strings }}
|
|
68
|
-
{{t 'besluit-type-plugin.error-rest-body'}}
|
|
69
|
-
</p>
|
|
70
|
-
</AuAlert>
|
|
71
|
-
{{else}}
|
|
72
|
-
<BesluitTypePlugin::BesluitTypeSelect
|
|
73
|
-
@besluitTypes={{this.types.value}}
|
|
74
|
-
@onchange={{this.updateBesluitType}}
|
|
75
|
-
@selected={{this.besluit}}
|
|
76
|
-
@showWarningWhenEmpty={{false}}
|
|
77
|
-
/>
|
|
78
|
-
{{#if this.besluit.subTypes.length}}
|
|
79
|
-
<AuHr @size='large' />
|
|
80
|
-
<BesluitTypePlugin::BesluitTypeSelect
|
|
81
|
-
@besluitTypes={{this.besluit.subTypes}}
|
|
82
|
-
@onchange={{this.updateBesluitSubType}}
|
|
83
|
-
@selected={{this.subBesluit}}
|
|
84
|
-
@showWarningWhenEmpty={{true}}
|
|
85
|
-
class='au-u-padding-left au-u-padding-right'
|
|
86
|
-
/>
|
|
87
|
-
{{/if}}
|
|
88
|
-
{{#if this.subBesluit.subTypes.length}}
|
|
89
|
-
<AuHr @size='large' />
|
|
90
|
-
<BesluitTypePlugin::BesluitTypeSelect
|
|
91
|
-
@besluitTypes={{this.subBesluit.subTypes}}
|
|
92
|
-
@onchange={{this.updateBesluitSubSubType}}
|
|
93
|
-
@selected={{this.subSubBesluit}}
|
|
94
|
-
@showWarningWhenEmpty={{true}}
|
|
95
|
-
class='au-u-padding-left au-u-padding-right'
|
|
96
|
-
/>
|
|
97
|
-
{{/if}}
|
|
98
|
-
{{/if}}
|
|
99
|
-
</Modal.Body>
|
|
100
|
-
</AuModal>
|
|
101
|
-
{{/if}}
|
|
102
|
-
</div>
|