@lblod/ember-rdfa-editor-lblod-plugins 35.2.0 → 35.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/addon/components/besluit-type-plugin/besluit-type-form.gts +4 -0
- package/addon/components/besluit-type-plugin/besluit-type-select.gts +2 -1
- package/addon/components/placeholder-utils-plugin/edit.gts +15 -12
- package/declarations/addon/components/besluit-type-plugin/besluit-type-form.d.ts +1 -0
- package/declarations/addon/components/besluit-type-plugin/besluit-type-select.d.ts +1 -0
- package/declarations/addon/components/placeholder-utils-plugin/edit.d.ts +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 35.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#641](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/641) [`062b89a`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/062b89ad35edff9cb0963a17e606497697e7614a) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Add a way to set the required attribute of the label of the besluit type select
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#635](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/635) [`d2ac617`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/d2ac61769c71978bc9bc5e3ff10385057ae807bb) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Fix resetting the placeholder edit card
|
|
12
|
+
|
|
3
13
|
## 35.2.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -8,6 +8,7 @@ interface Sig {
|
|
|
8
8
|
types: BesluitType[];
|
|
9
9
|
selectedType?: BesluitTypeInstance;
|
|
10
10
|
setType: (selected: BesluitTypeInstance) => void;
|
|
11
|
+
required?: boolean;
|
|
11
12
|
};
|
|
12
13
|
Element: HTMLDivElement;
|
|
13
14
|
}
|
|
@@ -44,6 +45,7 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
|
|
|
44
45
|
@onchange={{this.updateParentType}}
|
|
45
46
|
@selected={{@selectedType.parent}}
|
|
46
47
|
@showWarningWhenEmpty={{false}}
|
|
48
|
+
@required={{@required}}
|
|
47
49
|
/>
|
|
48
50
|
{{#if @selectedType.parent.subTypes.length}}
|
|
49
51
|
<BesluitTypeSelect
|
|
@@ -52,6 +54,7 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
|
|
|
52
54
|
@onchange={{this.updateSubType}}
|
|
53
55
|
@selected={{@selectedType.subType}}
|
|
54
56
|
@showWarningWhenEmpty={{true}}
|
|
57
|
+
@required={{@required}}
|
|
55
58
|
/>
|
|
56
59
|
{{/if}}
|
|
57
60
|
{{#if @selectedType.subType.subTypes.length}}
|
|
@@ -61,6 +64,7 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
|
|
|
61
64
|
@onchange={{this.updateSubSubType}}
|
|
62
65
|
@selected={{@selectedType.subSubType}}
|
|
63
66
|
@showWarningWhenEmpty={{true}}
|
|
67
|
+
@required={{@required}}
|
|
64
68
|
/>
|
|
65
69
|
{{/if}}
|
|
66
70
|
</div>
|
|
@@ -15,6 +15,7 @@ interface Sig {
|
|
|
15
15
|
selected?: BesluitType;
|
|
16
16
|
showWarningWhenEmpty: boolean;
|
|
17
17
|
onchange: (selected: BesluitType) => void;
|
|
18
|
+
required?: boolean;
|
|
18
19
|
};
|
|
19
20
|
Element: HTMLDivElement;
|
|
20
21
|
}
|
|
@@ -43,7 +44,7 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
|
|
|
43
44
|
<template>
|
|
44
45
|
<div ...attributes>
|
|
45
46
|
{{#let (uuidv4) as |id|}}
|
|
46
|
-
<AuLabel for={{id}}>
|
|
47
|
+
<AuLabel for={{id}} @required={{@required}}>
|
|
47
48
|
{{t @fieldNameTranslation}}
|
|
48
49
|
</AuLabel>
|
|
49
50
|
<PowerSelect
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
2
|
import { type ComponentLike } from '@glint/template';
|
|
4
|
-
import { NodeSelection, SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { NodeSelection, Node, SayController } from '@lblod/ember-rdfa-editor';
|
|
5
4
|
import { service } from '@ember/service';
|
|
6
5
|
import IntlService from 'ember-intl/services/intl';
|
|
7
6
|
import AuCard from '@appuniversum/ember-appuniversum/components/au-card';
|
|
@@ -14,6 +13,8 @@ import AuNativeInput from '../au-native-input';
|
|
|
14
13
|
import AuFormRow from '@appuniversum/ember-appuniversum/components/au-form-row';
|
|
15
14
|
import checkEnterAndSubmit from '@lblod/ember-rdfa-editor-lblod-plugins/utils/check-enter-and-submit';
|
|
16
15
|
import { fn } from '@ember/helper';
|
|
16
|
+
import { not } from 'ember-truth-helpers';
|
|
17
|
+
import { trackedReset } from 'tracked-toolbox';
|
|
17
18
|
|
|
18
19
|
type VariableComponentArgs = {
|
|
19
20
|
Args: {
|
|
@@ -34,7 +35,14 @@ type Args = {
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
37
|
-
@
|
|
38
|
+
@trackedReset({
|
|
39
|
+
memo: 'selectedPlaceholderNode',
|
|
40
|
+
update(component: PlaceholderUtilsEditCardComponent) {
|
|
41
|
+
return component.selectedPlaceholderNode?.attrs.placeholderText;
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
placeholderLabel: string | null = null;
|
|
45
|
+
lastSelectedPlaceholder: Node | null = null;
|
|
38
46
|
|
|
39
47
|
@service declare intl: IntlService;
|
|
40
48
|
|
|
@@ -50,20 +58,14 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
50
58
|
) {
|
|
51
59
|
return selection.node;
|
|
52
60
|
} else {
|
|
53
|
-
return;
|
|
61
|
+
return null;
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
get showCard() {
|
|
57
65
|
return !!this.selectedPlaceholderNode;
|
|
58
66
|
}
|
|
59
|
-
get placeholderLabel() {
|
|
60
|
-
return (
|
|
61
|
-
this.editedPlaceholderLabel ||
|
|
62
|
-
this.selectedPlaceholderNode?.attrs.placeholderText
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
67
|
updateLabelPlaceholder = (event: InputEvent) => {
|
|
66
|
-
this.
|
|
68
|
+
this.placeholderLabel = (event.target as HTMLInputElement).value;
|
|
67
69
|
};
|
|
68
70
|
updatePlaceholder = () => {
|
|
69
71
|
const { selection } = this.controller.activeEditorState;
|
|
@@ -71,7 +73,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
71
73
|
return tr.setNodeAttribute(
|
|
72
74
|
selection.$from.pos,
|
|
73
75
|
'placeholderText',
|
|
74
|
-
this.
|
|
76
|
+
this.placeholderLabel,
|
|
75
77
|
);
|
|
76
78
|
});
|
|
77
79
|
};
|
|
@@ -110,6 +112,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
110
112
|
<AuButton
|
|
111
113
|
{{on 'click' this.updatePlaceholder}}
|
|
112
114
|
class='au-u-margin-top'
|
|
115
|
+
@disabled={{not this.placeholderLabel}}
|
|
113
116
|
>
|
|
114
117
|
{{t 'editor-plugins.utils.insert'}}
|
|
115
118
|
</AuButton>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { type ComponentLike } from '@glint/template';
|
|
3
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { Node, SayController } from '@lblod/ember-rdfa-editor';
|
|
4
4
|
import IntlService from 'ember-intl/services/intl';
|
|
5
5
|
type VariableComponentArgs = {
|
|
6
6
|
Args: {
|
|
@@ -19,12 +19,12 @@ type Args = {
|
|
|
19
19
|
variableTypes: VariableConfig[];
|
|
20
20
|
};
|
|
21
21
|
export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
22
|
-
|
|
22
|
+
placeholderLabel: string | null;
|
|
23
|
+
lastSelectedPlaceholder: Node | null;
|
|
23
24
|
intl: IntlService;
|
|
24
25
|
get controller(): SayController;
|
|
25
|
-
get selectedPlaceholderNode():
|
|
26
|
+
get selectedPlaceholderNode(): Node | null;
|
|
26
27
|
get showCard(): boolean;
|
|
27
|
-
get placeholderLabel(): any;
|
|
28
28
|
updateLabelPlaceholder: (event: InputEvent) => void;
|
|
29
29
|
updatePlaceholder: () => void;
|
|
30
30
|
}
|