@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.1
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 +25 -0
- package/addon/commands/article-structure-plugin/delete-structure.ts +85 -0
- package/addon/commands/article-structure-plugin/index.ts +4 -0
- package/addon/commands/article-structure-plugin/insert-article-structure.ts +137 -0
- package/addon/commands/article-structure-plugin/move-structure.ts +227 -0
- package/addon/commands/article-structure-plugin/recalculate-structure-numbers.ts +88 -0
- package/addon/commands/besluit-plugin/get-article-nodes-for-besluit.ts +30 -0
- package/addon/commands/besluit-plugin/index.ts +4 -0
- package/addon/commands/besluit-plugin/insert-article.ts +94 -0
- package/addon/commands/besluit-plugin/insert-title.ts +67 -0
- package/addon/commands/besluit-plugin/move-article.ts +69 -0
- package/addon/commands/besluit-plugin/recalculate-article-numbers.ts +44 -0
- package/addon/commands/modify-date-command.ts +48 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +14 -0
- package/addon/components/article-structure-plugin/article-structure-card.ts +83 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +42 -0
- package/addon/components/article-structure-plugin/structure-card.ts +140 -0
- package/addon/components/au-native-input.hbs +30 -0
- package/addon/components/au-native-input.ts +47 -0
- package/addon/components/besluit-plugin/besluit-context-card.hbs +44 -0
- package/addon/components/besluit-plugin/besluit-context-card.ts +144 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +42 -0
- package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +9 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +216 -0
- package/addon/components/citation-plugin/citation-card.hbs +118 -0
- package/addon/components/citation-plugin/citation-card.ts +230 -0
- package/addon/components/citation-plugin/citation-insert.hbs +20 -0
- package/addon/components/citation-plugin/citation-insert.ts +102 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-preview.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-detail.hbs +9 -6
- package/addon/components/{citaten-plugin/citations/decision-detail.js → citation-plugin/citations/decision-detail.ts} +30 -31
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-preview.hbs +0 -0
- package/addon/components/citation-plugin/citations/search-modal.hbs +254 -0
- package/addon/components/{citaten-plugin/citations/search-modal.js → citation-plugin/citations/search-modal.ts} +116 -89
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.hbs +0 -0
- package/addon/components/import-snippet-plugin/card.ts +119 -0
- package/addon/components/insert-variable-plugin/insert-variable-card.hbs +2 -1
- package/addon/components/insert-variable-plugin/insert-variable-card.ts +134 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-card.hbs → card.hbs} +3 -1
- package/addon/components/rdfa-date-plugin/card.ts +72 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.hbs → date-time-picker.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.js → date-time-picker.ts} +26 -12
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-insert.hbs → insert.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/insert.ts +44 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +58 -0
- package/addon/components/roadsign-regulation-plugin/measure-template.ts +35 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -2
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +60 -0
- package/addon/components/roadsign-regulation-plugin/{roadsigns-modal.js → roadsigns-modal.ts} +101 -64
- package/addon/components/roadsign-regulation-plugin/{roadsigns-pagination.js → roadsigns-pagination.ts} +7 -3
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +32 -0
- package/addon/components/standard-template-plugin/{template-card.hbs → card.hbs} +0 -0
- package/addon/components/standard-template-plugin/card.ts +11 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +3 -1
- package/addon/components/standard-template-plugin/template-provider.ts +75 -0
- package/addon/components/table-of-contents-plugin/card.hbs +12 -1
- package/addon/components/table-of-contents-plugin/card.ts +60 -0
- package/addon/components/table-of-contents-plugin/{inline-components → ember-nodes}/outline.hbs +2 -2
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +9 -0
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +95 -0
- package/addon/components/template-variable-plugin/template-variable-card.hbs +2 -1
- package/addon/components/template-variable-plugin/template-variable-card.ts +227 -0
- package/addon/{constants.js → constants.ts} +15 -3
- package/addon/ember-nodes/table-of-contents.ts +53 -0
- package/addon/helpers/{limit-text.js → limit-text.ts} +2 -2
- package/addon/initializers/plugin-initializer.js +0 -75
- package/addon/models/instruction.ts +18 -0
- package/addon/models/measure.ts +38 -0
- package/addon/models/sign.ts +36 -0
- package/addon/models/template.ts +14 -0
- package/addon/plugins/article-structure-plugin.ts +55 -0
- package/addon/plugins/besluit-plugin.ts +27 -0
- package/addon/plugins/besluit-type-plugin.ts +6 -0
- package/addon/plugins/citation-plugin/index.ts +216 -0
- package/addon/plugins/citation-plugin/marks/citation.ts +27 -0
- package/addon/plugins/citation-plugin/utils/cited-text.ts +17 -0
- package/addon/plugins/citation-plugin/utils/process-match.ts +135 -0
- package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +161 -42
- package/addon/plugins/import-snippet-plugin.ts +6 -0
- package/addon/plugins/insert-variable-plugin.ts +11 -0
- package/addon/plugins/rdfa-date-plugin.ts +11 -0
- package/addon/plugins/roadsign-regulation-plugin.ts +6 -0
- package/addon/plugins/standard-template-plugin.ts +6 -0
- package/addon/plugins/table-of-contents-plugin.ts +14 -0
- package/addon/plugins/template-variable-plugin.ts +6 -0
- package/addon/services/{import-rdfa-snippet.js → import-rdfa-snippet.ts} +48 -36
- package/addon/services/roadsign-registry.ts +288 -0
- package/addon/services/{standard-template-plugin.js → standard-template-plugin.ts} +17 -11
- package/addon/utils/article-structure-plugin/constants.ts +260 -0
- package/addon/utils/article-structure-plugin/defaults.ts +3 -0
- package/addon/utils/article-structure-plugin/options-with-defaults.ts +31 -0
- package/addon/utils/article-structure-plugin/validate-datastore.ts +23 -0
- package/addon/utils/besluit-plugin/get-title-for-decision.ts +35 -0
- package/addon/utils/{fetchBesluitTypes.js → fetchBesluitTypes.ts} +36 -16
- package/addon/utils/generate-template-plugin/{default-resources.js → default-resources.ts} +0 -0
- package/addon/utils/{instantiate-uuids.js → instantiate-uuids.ts} +9 -6
- package/addon/utils/{legislation-types.js → legislation-types.ts} +17 -3
- package/addon/utils/{memoize.js → memoize.ts} +4 -2
- package/addon/utils/option.ts +58 -0
- package/addon/utils/roadsign-regulation-plugin/{fetchData.js → fetchData.ts} +19 -2
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.ts +16 -0
- package/addon/utils/romanize.ts +47 -0
- package/addon/utils/variable-plugins/{default-variable-types.js → default-variable-types.ts} +18 -7
- package/addon/utils/variable-plugins/{fetch-data.js → fetch-data.ts} +43 -15
- package/app/components/article-structure-plugin/article-structure-card.js +1 -0
- package/app/components/article-structure-plugin/structure-card.js +1 -0
- package/app/components/{citaten-plugin/citaat-card.js → au-native-input.js} +1 -1
- package/app/components/{citaten-plugin/citations/article-list.js → besluit-plugin/besluit-context-card.js} +1 -1
- package/app/components/besluit-plugin/besluit-plugin-card.js +1 -0
- package/app/components/{citaten-plugin/citations/modal.js → citation-plugin/citation-card.js} +1 -1
- package/app/components/citation-plugin/citation-insert.js +1 -0
- package/app/components/{citaten-plugin/citations/decision-list.js → citation-plugin/citations/article-list.js} +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/article-preview.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-detail.js +1 -1
- package/app/components/citation-plugin/citations/decision-list.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-preview.js +1 -1
- package/app/components/citation-plugin/citations/modal.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/search-modal.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.js +1 -1
- package/app/components/{citaten-plugin/citaat-insert.js → rdfa-date-plugin/card.js} +1 -1
- package/app/components/rdfa-date-plugin/date-time-picker.js +1 -0
- package/app/components/rdfa-date-plugin/insert.js +1 -0
- package/app/components/standard-template-plugin/card.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/outline.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/table-of-contents.js +1 -0
- package/app/styles/citaten-plugin.scss +1 -1
- package/commands/article-structure-plugin/delete-structure.d.ts +4 -0
- package/commands/article-structure-plugin/index.d.ts +4 -0
- package/commands/article-structure-plugin/insert-article-structure.d.ts +6 -0
- package/commands/article-structure-plugin/move-structure.d.ts +5 -0
- package/commands/article-structure-plugin/recalculate-structure-numbers.d.ts +7 -0
- package/commands/besluit-plugin/get-article-nodes-for-besluit.d.ts +5 -0
- package/commands/besluit-plugin/index.d.ts +4 -0
- package/commands/besluit-plugin/insert-article.d.ts +3 -0
- package/commands/besluit-plugin/insert-title.d.ts +2 -0
- package/commands/besluit-plugin/move-article.d.ts +2 -0
- package/commands/besluit-plugin/recalculate-article-numbers.d.ts +2 -0
- package/commands/modify-date-command.d.ts +2 -0
- package/components/article-structure-plugin/article-structure-card.d.ts +36 -0
- package/components/article-structure-plugin/structure-card.d.ts +23 -0
- package/components/au-native-input.d.ts +20 -0
- package/components/besluit-plugin/besluit-context-card.d.ts +29 -0
- package/components/besluit-plugin/besluit-plugin-card.d.ts +14 -0
- package/components/besluit-type-plugin/besluit-type-select.d.ts +11 -0
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +46 -0
- package/components/citation-plugin/citation-card.d.ts +51 -0
- package/components/citation-plugin/citation-insert.d.ts +24 -0
- package/components/citation-plugin/citations/decision-detail.d.ts +26 -0
- package/components/citation-plugin/citations/search-modal.d.ts +67 -0
- package/components/import-snippet-plugin/card.d.ts +19 -0
- package/components/insert-variable-plugin/insert-variable-card.d.ts +31 -0
- package/components/rdfa-date-plugin/card.d.ts +20 -0
- package/components/rdfa-date-plugin/date-time-picker.d.ts +32 -0
- package/components/rdfa-date-plugin/insert.d.ts +12 -0
- package/components/roadsign-regulation-plugin/expanded-measure.d.ts +20 -0
- package/components/roadsign-regulation-plugin/measure-template.d.ts +14 -0
- package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +12 -0
- package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +57 -0
- package/components/roadsign-regulation-plugin/roadsigns-pagination.d.ts +19 -0
- package/components/roadsign-regulation-plugin/roadsigns-table.d.ts +9 -0
- package/components/standard-template-plugin/card.d.ts +9 -0
- package/components/standard-template-plugin/template-provider.d.ts +17 -0
- package/components/table-of-contents-plugin/card.d.ts +20 -0
- package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +22 -0
- package/components/template-variable-plugin/template-variable-card.d.ts +27 -0
- package/constants.d.ts +11 -0
- package/ember-nodes/table-of-contents.d.ts +4 -0
- package/helpers/limit-text.d.ts +8 -0
- package/index.js +5 -0
- package/models/instruction.d.ts +8 -0
- package/models/measure.d.ts +14 -0
- package/models/sign.d.ts +12 -0
- package/models/template.d.ts +13 -0
- package/package.json +27 -8
- package/plugins/article-structure-plugin.d.ts +29 -0
- package/plugins/besluit-plugin.d.ts +9 -0
- package/plugins/besluit-type-plugin.d.ts +2 -0
- package/plugins/citation-plugin/index.d.ts +31 -0
- package/plugins/citation-plugin/marks/citation.d.ts +2 -0
- package/plugins/citation-plugin/utils/cited-text.d.ts +3 -0
- package/plugins/citation-plugin/utils/process-match.d.ts +23 -0
- package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +56 -0
- package/plugins/import-snippet-plugin.d.ts +2 -0
- package/plugins/insert-variable-plugin.d.ts +2 -0
- package/plugins/rdfa-date-plugin.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin.d.ts +2 -0
- package/plugins/standard-template-plugin.d.ts +2 -0
- package/plugins/table-of-contents-plugin.d.ts +3 -0
- package/plugins/template-variable-plugin.d.ts +2 -0
- package/services/import-rdfa-snippet.d.ts +99 -0
- package/services/roadsign-registry.d.ts +42 -0
- package/services/standard-template-plugin.d.ts +21 -0
- package/translations/en-US.yaml +47 -1
- package/translations/nl-BE.yaml +49 -3
- package/tsconfig.json +34 -9
- package/types/config/environment.d.ts +22 -0
- package/types/ember-mu-transform-helpers/transforms/string-set.d.ts +14 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/account.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid-classificatie-code.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid.d.ts +12 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/gebruiker-model.d.ts +18 -0
- package/types/lblod/frontend-gelinkt-notuleren/services/current-session.d.ts +30 -0
- package/types/lblod/marawa/dom-helpers.d.ts +4 -0
- package/types/lblod/marawa/ember-object-mock.d.ts +3 -0
- package/types/lblod/marawa/node-walker.d.ts +18 -0
- package/types/lblod/marawa/range-helpers.d.ts +10 -0
- package/types/lblod/marawa/rdfa-attributes.d.ts +25 -0
- package/types/lblod/marawa/rdfa-block.d.ts +22 -0
- package/types/lblod/marawa/rdfa-context-scanner.d.ts +13 -0
- package/types/lblod/marawa/rdfa-helpers.d.ts +22 -0
- package/types/lblod/marawa/rich-node.d.ts +50 -0
- package/types/lblod/marawa/triple.d.ts +16 -0
- package/utils/article-structure-plugin/constants.d.ts +2 -0
- package/utils/article-structure-plugin/defaults.d.ts +4 -0
- package/utils/article-structure-plugin/options-with-defaults.d.ts +2 -0
- package/utils/article-structure-plugin/validate-datastore.d.ts +3 -0
- package/utils/besluit-plugin/get-title-for-decision.d.ts +10 -0
- package/utils/fetchBesluitTypes.d.ts +12 -0
- package/utils/generate-template-plugin/default-resources.d.ts +2 -0
- package/utils/instantiate-uuids.d.ts +1 -0
- package/utils/legislation-types.d.ts +24 -0
- package/utils/memoize.d.ts +1 -0
- package/utils/option.d.ts +14 -0
- package/utils/roadsign-regulation-plugin/fetchData.d.ts +8 -0
- package/utils/roadsign-regulation-plugin/includeInstructions.d.ts +2 -0
- package/utils/romanize.d.ts +2 -0
- package/utils/variable-plugins/default-variable-types.d.ts +7 -0
- package/utils/variable-plugins/fetch-data.d.ts +14 -0
- package/addon/commands/generate-template-command.js +0 -35
- package/addon/commands/insert-and-collapse.js +0 -32
- package/addon/commands/modify-date-command.js +0 -42
- package/addon/components/besluit-type-plugin/toolbar-dropdown.js +0 -188
- package/addon/components/citaten-plugin/citaat-card.hbs +0 -76
- package/addon/components/citaten-plugin/citaat-card.js +0 -286
- package/addon/components/citaten-plugin/citaat-insert.hbs +0 -20
- package/addon/components/citaten-plugin/citaat-insert.js +0 -68
- package/addon/components/citaten-plugin/citations/search-modal.hbs +0 -175
- package/addon/components/import-snippet-plugin/card.js +0 -95
- package/addon/components/insert-variable-plugin/insert-variable-card.js +0 -125
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -71
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -24
- package/addon/components/roadsign-regulation-plugin/expanded-measure.js +0 -38
- package/addon/components/roadsign-regulation-plugin/measure-template.js +0 -30
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -101
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +0 -24
- package/addon/components/standard-template-plugin/template-card.js +0 -7
- package/addon/components/standard-template-plugin/template-provider.js +0 -75
- package/addon/components/table-of-contents-plugin/card.js +0 -53
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +0 -9
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -100
- package/addon/components/template-variable-plugin/template-variable-card.js +0 -230
- package/addon/inline-components/table-of-contents.js +0 -43
- package/addon/models/instruction.js +0 -19
- package/addon/models/measure.js +0 -46
- package/addon/models/sign.js +0 -37
- package/addon/models/template.js +0 -9
- package/addon/plugins/besluit-type-plugin.js +0 -16
- package/addon/plugins/citaten-plugin.js +0 -22
- package/addon/plugins/import-snippet-plugin.js +0 -16
- package/addon/plugins/insert-variable-plugin.js +0 -19
- package/addon/plugins/rdfa-date-plugin.js +0 -26
- package/addon/plugins/roadsign-regulation-plugin.js +0 -24
- package/addon/plugins/standard-template-plugin.js +0 -33
- package/addon/plugins/table-of-contents-plugin.js +0 -27
- package/addon/plugins/template-variable-plugin.js +0 -21
- package/addon/services/roadsign-registry.js +0 -240
- package/addon/utils/processMatch.js +0 -80
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
- package/app/components/standard-template-plugin/template-card.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/outline.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
- package/app/initializers/plugin-initializer.js +0 -4
- package/types/dummy/index.d.ts +0 -1
- package/types/ember-data/types/registries/model.d.ts +0 -6
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { action } from '@ember/object';
|
|
3
|
-
import { tracked } from '@glimmer/tracking';
|
|
4
|
-
import { LEGISLATION_TYPES } from '../../utils/legislation-types';
|
|
5
|
-
export default class EditorPluginsCitaatInsertComponent extends Component {
|
|
6
|
-
@tracked disableInsert = false;
|
|
7
|
-
@tracked showModal = false;
|
|
8
|
-
@tracked legislationTypeUri = LEGISLATION_TYPES.decreet;
|
|
9
|
-
@tracked text = '';
|
|
10
|
-
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.args.controller.onEvent(
|
|
14
|
-
'selectionChanged',
|
|
15
|
-
this.onSelectionChanged.bind(this)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
onSelectionChanged() {
|
|
20
|
-
const selectedRange = this.args.controller.selection.lastRange;
|
|
21
|
-
if (!selectedRange) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const limitedDatastore = this.args.controller.datastore.limitToRange(
|
|
25
|
-
selectedRange,
|
|
26
|
-
'rangeIsInside'
|
|
27
|
-
);
|
|
28
|
-
const motivering = limitedDatastore
|
|
29
|
-
.match(null, '>http://data.vlaanderen.be/ns/besluit#motivering')
|
|
30
|
-
.asQuads()
|
|
31
|
-
.next().value;
|
|
32
|
-
this.disableInsert = motivering ? false : true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@action
|
|
36
|
-
openModal() {
|
|
37
|
-
this.showModal = true;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@action
|
|
41
|
-
closeModal() {
|
|
42
|
-
this.showModal = false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@action
|
|
46
|
-
insertDecisionCitation(decision) {
|
|
47
|
-
const type = decision.legislationType.label;
|
|
48
|
-
const uri = decision.uri;
|
|
49
|
-
const title = decision.title;
|
|
50
|
-
const range = this.args.controller.selection.lastRange;
|
|
51
|
-
const citationHtml = `${
|
|
52
|
-
type ? type : ''
|
|
53
|
-
} <a class="annotation" href="${uri}" property="eli:cites" typeof="eli:LegalExpression">${title}</a> `;
|
|
54
|
-
this.args.controller.executeCommand('insert-html', citationHtml, range);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@action
|
|
58
|
-
insertArticleCitation(decision, article) {
|
|
59
|
-
const type = decision.legislationType.label;
|
|
60
|
-
const uri = article.uri;
|
|
61
|
-
const title = `${decision.title}, ${article.number}`;
|
|
62
|
-
const range = this.args.controller.selection.lastRange;
|
|
63
|
-
const citationHtml = `${
|
|
64
|
-
type ? type : ''
|
|
65
|
-
} <a class="annotation" href="${uri}" property="eli:cites" typeof="eli:LegalExpression">${title}</a> `;
|
|
66
|
-
this.args.controller.executeCommand('insert-html', citationHtml, range);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
<AuModal
|
|
2
|
-
@modalOpen={{true}}
|
|
3
|
-
@closeModal={{fn this.closeModal this.legislationTypeUri this.text}}
|
|
4
|
-
@title={{t "citaten-plugin.card.title"}}
|
|
5
|
-
@size="large"
|
|
6
|
-
@padding="none" as |modal|>
|
|
7
|
-
{{#if this.selectedDecision}}
|
|
8
|
-
<modal.Body>
|
|
9
|
-
<CitatenPlugin::Citations::DecisionDetail
|
|
10
|
-
@insertDecisionCitation={{this.insertDecisionCitation}}
|
|
11
|
-
@insertArticleCitation={{this.insertArticleCitation}}
|
|
12
|
-
@close={{this.closeDecisionDetail}}
|
|
13
|
-
@decision={{this.selectedDecision}} />
|
|
14
|
-
</modal.Body>
|
|
15
|
-
{{else}}
|
|
16
|
-
<modal.Body>
|
|
17
|
-
<AuMainContainer class="citaten--main-container" as |mc|>
|
|
18
|
-
<mc.sidebar class="citaten--sidebar" @scroll={{true}}>
|
|
19
|
-
<div class="au-c-sidebar">
|
|
20
|
-
<div class="au-c-sidebar__content au-u-padding">
|
|
21
|
-
<AuLabel class="au-margin-bottom-small" for="typeofdocumentexpanded" @inline={{false}} @required={{false}} @error={{false}} @warning={{false}}>{{t "citaten-plugin.search.type"}}</AuLabel>
|
|
22
|
-
<PowerSelect
|
|
23
|
-
id="typeofdocumentexpanded"
|
|
24
|
-
@renderInPlace={{true}}
|
|
25
|
-
@allowClear={{false}}
|
|
26
|
-
@disabled={{false}}
|
|
27
|
-
@searchEnabled={{true}}
|
|
28
|
-
@loadingMessage={{t "citaten-plugin.alert.loading"}}
|
|
29
|
-
@noMatchesMessage={{t "citaten-plugin.alert.no-results"}}
|
|
30
|
-
@searchMessage={{t "citaten-plugin.search.placeholder"}}
|
|
31
|
-
@options={{this.legislationTypes}}
|
|
32
|
-
@selected={{this.legislationSelected}}
|
|
33
|
-
@onChange={{this.selectLegislationType}}
|
|
34
|
-
as |type|>
|
|
35
|
-
{{type}}
|
|
36
|
-
</PowerSelect>
|
|
37
|
-
<AuLabel class="au-u-margin-top au-margin-bottom-small" for="searchtermexpanded" @inline={{false}} @required={{false}} @error={{false}} @warning={{false}}>{{t "citaten-plugin.search.term"}}</AuLabel>
|
|
38
|
-
<AuInput
|
|
39
|
-
id="searchtermexpanded"
|
|
40
|
-
@type="text"
|
|
41
|
-
@width="block"
|
|
42
|
-
@icon="search"
|
|
43
|
-
@iconAlignment="right"
|
|
44
|
-
@value={{this.text}}
|
|
45
|
-
placeholder={{t "citaten-plugin.search.placeholder"}}
|
|
46
|
-
{{on "input" (perform this.updateSearch)}}/>
|
|
47
|
-
<AuHr @size="large" />
|
|
48
|
-
{{! Date of document }}
|
|
49
|
-
<AuLabel class="au-u-margin-top au-u-margin-bottom-small" for="search-codex-datum-document-van" @inline={{false}}>{{t "citaten-plugin.search.date-document"}}</AuLabel>
|
|
50
|
-
{{! From }}
|
|
51
|
-
<AuFormRow @alignment="pre" class="au-u-margin-bottom-tiny">
|
|
52
|
-
<AuLabel for="search-codex-datum-document-van" class="au-u-hidden-visually">{{t "citaten-plugin.search.date-document-from"}}</AuLabel>
|
|
53
|
-
<AuLabel for="search-codex-datum-document-van" aria-hidden="true" class="au-u-1-4" @inline={{true}}>{{t "citaten-plugin.search.from"}}</AuLabel>
|
|
54
|
-
<AuDatePicker
|
|
55
|
-
@id="search-codex-datum-document-van"
|
|
56
|
-
@alignment="top"
|
|
57
|
-
@onChange={{this.updateDocumentDateFrom}}
|
|
58
|
-
@value={{this.documentDateFrom}}
|
|
59
|
-
@min={{this.minDate}}
|
|
60
|
-
@max={{this.maxDate}}
|
|
61
|
-
@localization={{this.datePickerLocalization}} />
|
|
62
|
-
</AuFormRow>
|
|
63
|
-
{{! To }}
|
|
64
|
-
<AuFormRow @alignment="pre">
|
|
65
|
-
<AuLabel for="search-codex-datum-document-tot" class="au-u-hidden-visually">{{t "citaten-plugin.search.date-document-to"}}</AuLabel>
|
|
66
|
-
<AuLabel for="search-codex-datum-document-tot" aria-hidden="true" class="au-u-1-4" @inline={{true}}>{{t "citaten-plugin.search.to"}}</AuLabel>
|
|
67
|
-
<AuDatePicker
|
|
68
|
-
@id="search-codex-datum-document-tot"
|
|
69
|
-
@alignment="top"
|
|
70
|
-
@onChange={{this.updateDocumentDateTo}}
|
|
71
|
-
@value={{this.documentDateTo}}
|
|
72
|
-
@min={{this.minDate}}
|
|
73
|
-
@max={{this.maxDate}}
|
|
74
|
-
@localization={{this.datePickerLocalization}} />
|
|
75
|
-
</AuFormRow>
|
|
76
|
-
|
|
77
|
-
{{! Date of staatsblad }}
|
|
78
|
-
<AuLabel class="au-u-margin-top au-u-margin-bottom-small" for="search-codex-datum-staatsblad-van" @inline={{false}}>{{t "citaten-plugin.search.date-publication"}}</AuLabel>
|
|
79
|
-
{{! From }}
|
|
80
|
-
<AuFormRow @alignment="pre" class="au-u-margin-bottom-tiny">
|
|
81
|
-
<AuLabel for="search-codex-datum-staatsblad-van" class="au-u-hidden-visually">{{t "citaten-plugin.search.date-publication-from"}}</AuLabel>
|
|
82
|
-
<AuLabel for="search-codex-datum-staatsblad-van" aria-hidden="true" class="au-u-1-4" @inline={{true}}>{{t "citaten-plugin.search.from"}}</AuLabel>
|
|
83
|
-
<AuDatePicker
|
|
84
|
-
@id="search-codex-datum-staatsblad-van"
|
|
85
|
-
@alignment="top"
|
|
86
|
-
@onChange={{this.updatePublicationDateFrom}}
|
|
87
|
-
@value={{this.publicationDateFrom}}
|
|
88
|
-
@min={{this.minDate}}
|
|
89
|
-
@max={{this.maxDate}}
|
|
90
|
-
@localization={{this.datePickerLocalization}} />
|
|
91
|
-
</AuFormRow>
|
|
92
|
-
{{! To }}
|
|
93
|
-
<AuFormRow @alignment="pre">
|
|
94
|
-
<AuLabel for="search-codex-datum-staatsblad-tot" class="au-u-hidden-visually">{{t "citaten-plugin.search.date-publication-to"}}</AuLabel>
|
|
95
|
-
<AuLabel for="search-codex-datum-staatsblad-tot" aria-hidden="true" class="au-u-1-4" @inline={{true}}>{{t "citaten-plugin.search.to"}}</AuLabel>
|
|
96
|
-
<AuDatePicker
|
|
97
|
-
@id="search-codex-datum-staatsblad-tot"
|
|
98
|
-
@alignment="top"
|
|
99
|
-
@onChange={{this.updatePublicationDateTo}}
|
|
100
|
-
@value={{this.publicationDateTo}}
|
|
101
|
-
@min={{this.minDate}}
|
|
102
|
-
@max={{this.maxDate}}
|
|
103
|
-
@localization={{this.datePickerLocalization}} />
|
|
104
|
-
</AuFormRow>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</mc.sidebar>
|
|
108
|
-
<mc.content>
|
|
109
|
-
{{#if this.decisionResource.isRunning}}
|
|
110
|
-
<div class="au-u-margin">
|
|
111
|
-
<AuLoader @padding="large" />
|
|
112
|
-
<span class="au-u-hidden-visually">{{t "citaten-plugin.alert.loading"}}</span>
|
|
113
|
-
</div>
|
|
114
|
-
{{else}}
|
|
115
|
-
{{#if this.error}}
|
|
116
|
-
<CitatenPlugin::Helpers::AlertLoadError @fullSize={{true}} @error={{this.error}} class="au-u-margin"/>
|
|
117
|
-
{{else}}
|
|
118
|
-
{{#if this.decisionResource.value.length}}
|
|
119
|
-
<div class="citaten--container-content au-u-padding-top-small au-u-padding-bottom-small">
|
|
120
|
-
<CitatenPlugin::Citations::DecisionList
|
|
121
|
-
@decisions={{this.decisionResource.value}}
|
|
122
|
-
@onCitationInsert={{this.insertDecisionCitation}}
|
|
123
|
-
@onCitationDetails={{this.openDecisionDetail}}
|
|
124
|
-
@fullSize={{true}} />
|
|
125
|
-
</div>
|
|
126
|
-
{{else}}
|
|
127
|
-
<CitatenPlugin::Helpers::AlertNoItems @fullSize={{true}} class="au-u-margin" />
|
|
128
|
-
{{/if}}
|
|
129
|
-
{{/if}}
|
|
130
|
-
{{/if}}
|
|
131
|
-
{{#if this.decisionResource.value.length}}
|
|
132
|
-
{{! Pagination in the footer of the dialog }}
|
|
133
|
-
<div class="citaten--container-footer au-u-background-gray-100">
|
|
134
|
-
<AuToolbar
|
|
135
|
-
@border="top"
|
|
136
|
-
@size="large"
|
|
137
|
-
@nowrap={{true}}>
|
|
138
|
-
<div class="au-c-pagination">
|
|
139
|
-
<p>
|
|
140
|
-
<span class="au-u-hidden-visually">{{t "citaten-plugin.search.results"}}</span>
|
|
141
|
-
<strong>
|
|
142
|
-
{{this.rangeStart}} - {{this.rangeEnd}}
|
|
143
|
-
</strong>
|
|
144
|
-
{{t "citaten-plugin.pagination.of"}}
|
|
145
|
-
{{this.totalCount}}
|
|
146
|
-
</p>
|
|
147
|
-
<div class="au-c-pagination__list-item">
|
|
148
|
-
{{#unless this.isFirstPage}}
|
|
149
|
-
<AuButton
|
|
150
|
-
@skin="link"
|
|
151
|
-
@icon="nav-left"
|
|
152
|
-
@iconAlignment="left"
|
|
153
|
-
{{on "click" this.previousPage}}>
|
|
154
|
-
{{t "citaten-plugin.pagination.previous"}}
|
|
155
|
-
</AuButton>
|
|
156
|
-
{{/unless}}
|
|
157
|
-
{{#unless this.isLastPage}}
|
|
158
|
-
<AuButton
|
|
159
|
-
@skin="link"
|
|
160
|
-
@icon="nav-right"
|
|
161
|
-
@iconAlignment="right"
|
|
162
|
-
{{on "click" this.nextPage}}>
|
|
163
|
-
{{t "citaten-plugin.pagination.next"}}
|
|
164
|
-
</AuButton>
|
|
165
|
-
{{/unless}}
|
|
166
|
-
</div>
|
|
167
|
-
</div>
|
|
168
|
-
</AuToolbar>
|
|
169
|
-
</div>
|
|
170
|
-
{{/if}}
|
|
171
|
-
</mc.content>
|
|
172
|
-
</AuMainContainer>
|
|
173
|
-
</modal.Body>
|
|
174
|
-
{{/if}}
|
|
175
|
-
</AuModal>
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { inject as service } from '@ember/service';
|
|
3
|
-
import { action } from '@ember/object';
|
|
4
|
-
import { tracked } from '@glimmer/tracking';
|
|
5
|
-
|
|
6
|
-
export default class ImportSnippetPluginCard extends Component {
|
|
7
|
-
@service importRdfaSnippet;
|
|
8
|
-
@tracked snippets = [];
|
|
9
|
-
@tracked besluitNode;
|
|
10
|
-
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.args.controller.onEvent(
|
|
14
|
-
'selectionChanged',
|
|
15
|
-
this.selectionChangedHandler
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@action
|
|
20
|
-
selectionChangedHandler() {
|
|
21
|
-
const { controller } = this.args;
|
|
22
|
-
const selectedRange = controller.selection.lastRange;
|
|
23
|
-
if (!selectedRange) {
|
|
24
|
-
console.info(
|
|
25
|
-
'Selection did not have a range, skipping handling of the selectionChanged event'
|
|
26
|
-
);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
this.snippets = this.importRdfaSnippet.snippetsForType('roadsign');
|
|
30
|
-
const limitedDatastore = controller.datastore.limitToRange(
|
|
31
|
-
selectedRange,
|
|
32
|
-
'rangeIsInside'
|
|
33
|
-
);
|
|
34
|
-
const besluit = limitedDatastore
|
|
35
|
-
.match(null, 'a', '>http://data.vlaanderen.be/ns/besluit#Besluit')
|
|
36
|
-
.asSubjectNodes()
|
|
37
|
-
.next().value;
|
|
38
|
-
if (besluit) {
|
|
39
|
-
this.besluitNode = [...besluit.nodes][0];
|
|
40
|
-
} else {
|
|
41
|
-
this.besluitNode = undefined;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@action
|
|
46
|
-
insert(snippet, type) {
|
|
47
|
-
const html = this.generateSnippetHtml(snippet, type);
|
|
48
|
-
let rangeToInsert;
|
|
49
|
-
if (this.besluitNode) {
|
|
50
|
-
rangeToInsert = this.args.controller.rangeFactory.fromInNode(
|
|
51
|
-
this.besluitNode,
|
|
52
|
-
this.besluitNode.getMaxOffset(),
|
|
53
|
-
this.besluitNode.getMaxOffset()
|
|
54
|
-
);
|
|
55
|
-
} else {
|
|
56
|
-
rangeToInsert = this.args.controller.selection.lastRange;
|
|
57
|
-
}
|
|
58
|
-
if (rangeToInsert) {
|
|
59
|
-
this.args.controller.executeCommand('insert-html', html, rangeToInsert);
|
|
60
|
-
this.importRdfaSnippet.removeSnippet(snippet);
|
|
61
|
-
} else {
|
|
62
|
-
console.warn('Could not find a range to insert, so we skipped inserting');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
generateSnippetHtml(snippet, type) {
|
|
67
|
-
if (type === 'attachment') {
|
|
68
|
-
return `
|
|
69
|
-
<div property="http://lblod.data.gift/vocabularies/editor/isLumpNode">
|
|
70
|
-
<div
|
|
71
|
-
resource="${snippet.source}"
|
|
72
|
-
property="http://data.europa.eu/eli/ontology#related_to"
|
|
73
|
-
typeof="http://xmlns.com/foaf/0.1/Document http://lblod.data.gift/vocabularies/editor/SnippetAttachment"
|
|
74
|
-
>
|
|
75
|
-
Bijlage uit externe bron <a href="${snippet.source}">${
|
|
76
|
-
new URL(snippet.source).hostname
|
|
77
|
-
}</a>
|
|
78
|
-
<div property="http://www.w3.org/ns/prov#value">${
|
|
79
|
-
snippet.content
|
|
80
|
-
}</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
`;
|
|
84
|
-
} else {
|
|
85
|
-
return `
|
|
86
|
-
<div property="http://lblod.data.gift/vocabularies/editor/isLumpNode">
|
|
87
|
-
Bijlage uit externe bron
|
|
88
|
-
<div property="http://data.europa.eu/eli/ontology#related_to" resource="${snippet.source}">
|
|
89
|
-
<div property="http://www.w3.org/ns/prov#value">${snippet.content}</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
`;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
|
-
import { action } from '@ember/object';
|
|
4
|
-
import { task } from 'ember-concurrency';
|
|
5
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
-
import { INVISIBLE_SPACE } from '@lblod/ember-rdfa-editor/model/util/constants';
|
|
7
|
-
import { defaultVariableTypes } from '../../utils/variable-plugins/default-variable-types';
|
|
8
|
-
|
|
9
|
-
export default class EditorPluginsInsertCodelistCardComponent extends Component {
|
|
10
|
-
@tracked variablesArray;
|
|
11
|
-
@tracked selectedVariable;
|
|
12
|
-
@tracked showCard = true;
|
|
13
|
-
@tracked hasSubtype = false;
|
|
14
|
-
@tracked selectedSubtype;
|
|
15
|
-
@tracked subtypes;
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
const { publisher, variableTypes, defaultEndpoint } =
|
|
20
|
-
this.args.widgetArgs.options || {};
|
|
21
|
-
this.publisher = publisher;
|
|
22
|
-
this.endpoint = defaultEndpoint;
|
|
23
|
-
let variableTypesSelectedByUser = variableTypes ?? [
|
|
24
|
-
'text',
|
|
25
|
-
'number',
|
|
26
|
-
'date',
|
|
27
|
-
'location',
|
|
28
|
-
'codelist',
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
const variablesArray = [];
|
|
32
|
-
for (let type of variableTypesSelectedByUser) {
|
|
33
|
-
if (typeof type === 'string') {
|
|
34
|
-
const defaultVariable = defaultVariableTypes[type];
|
|
35
|
-
if (defaultVariable) {
|
|
36
|
-
variablesArray.push(defaultVariable);
|
|
37
|
-
} else {
|
|
38
|
-
console.warn(
|
|
39
|
-
`Template Variable Plugin: variable type ${type} not found in the default variable types`
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
variablesArray.push(type);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
this.variablesArray = variablesArray;
|
|
47
|
-
this.args.controller.onEvent('selectionChanged', this.selectionChanged);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@action
|
|
51
|
-
insert() {
|
|
52
|
-
const uri = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
53
|
-
let variableContent;
|
|
54
|
-
if (typeof this.selectedVariable.template === 'function') {
|
|
55
|
-
variableContent = this.selectedVariable.template(
|
|
56
|
-
this.endpoint,
|
|
57
|
-
this.selectedSubtype
|
|
58
|
-
);
|
|
59
|
-
} else {
|
|
60
|
-
variableContent = this.selectedVariable.template;
|
|
61
|
-
}
|
|
62
|
-
const htmlToInsert = `
|
|
63
|
-
<span resource="${uri}" typeof="ext:Mapping">
|
|
64
|
-
${variableContent}
|
|
65
|
-
</span>
|
|
66
|
-
`;
|
|
67
|
-
this.args.controller.executeCommand(
|
|
68
|
-
'insert-html',
|
|
69
|
-
htmlToInsert,
|
|
70
|
-
this.args.controller.selection.lastRange
|
|
71
|
-
);
|
|
72
|
-
this.args.controller.executeCommand(
|
|
73
|
-
'insert-text',
|
|
74
|
-
INVISIBLE_SPACE,
|
|
75
|
-
this.args.controller.selection.lastRange
|
|
76
|
-
);
|
|
77
|
-
this.selectedVariableType = undefined;
|
|
78
|
-
this.selectedCodelist = undefined;
|
|
79
|
-
this.isCodelist = false;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@action
|
|
83
|
-
updateSelectedVariable(variable) {
|
|
84
|
-
this.selectedVariable = variable;
|
|
85
|
-
if (variable.fetchSubtypes) {
|
|
86
|
-
this.fetchSubtypes.perform(variable.fetchSubtypes);
|
|
87
|
-
this.hasSubtype = true;
|
|
88
|
-
} else {
|
|
89
|
-
this.hasSubtype = false;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@task
|
|
94
|
-
*fetchSubtypes(fetchFunction) {
|
|
95
|
-
const subtypes = yield fetchFunction(this.endpoint, this.publisher);
|
|
96
|
-
this.subtypes = subtypes;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@action
|
|
100
|
-
updateSubtype(subtype) {
|
|
101
|
-
this.selectedSubtype = subtype;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@action
|
|
105
|
-
selectionChanged() {
|
|
106
|
-
const currentSelection = this.args.controller.selection.lastRange;
|
|
107
|
-
if (!currentSelection) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
this.showCard = false;
|
|
111
|
-
const limitedDatastore = this.args.controller.datastore.limitToRange(
|
|
112
|
-
currentSelection,
|
|
113
|
-
'rangeIsInside'
|
|
114
|
-
);
|
|
115
|
-
const mapping = limitedDatastore
|
|
116
|
-
.match(null, 'a', 'ext:Mapping')
|
|
117
|
-
.asQuads()
|
|
118
|
-
.next().value;
|
|
119
|
-
if (mapping) {
|
|
120
|
-
this.showCard = false;
|
|
121
|
-
} else {
|
|
122
|
-
this.showCard = true;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
|
-
import { action } from '@ember/object';
|
|
4
|
-
|
|
5
|
-
export default class RdfaDatePluginCardComponent extends Component {
|
|
6
|
-
@tracked showCard = false;
|
|
7
|
-
@tracked dateValue;
|
|
8
|
-
@tracked dateElement;
|
|
9
|
-
@tracked dateInDocument;
|
|
10
|
-
@tracked onlyDate;
|
|
11
|
-
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.args.controller.onEvent(
|
|
15
|
-
'selectionChanged',
|
|
16
|
-
this.selectionChangedHandler
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@action
|
|
21
|
-
modifyDate() {
|
|
22
|
-
this.args.controller.executeCommand(
|
|
23
|
-
'modify-date',
|
|
24
|
-
this.args.controller,
|
|
25
|
-
this.dateElement,
|
|
26
|
-
this.dateValue,
|
|
27
|
-
this.onlyDate
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@action
|
|
32
|
-
changeDate(date) {
|
|
33
|
-
this.dateValue = date;
|
|
34
|
-
if (this.dateInDocument) this.modifyDate();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@action
|
|
38
|
-
selectionChangedHandler() {
|
|
39
|
-
const selectedRange = this.args.controller.selection.lastRange;
|
|
40
|
-
if (!selectedRange) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const selectionParent = selectedRange.start.findAncestors(
|
|
44
|
-
(element) => element.attributeMap && element.attributeMap.get('datatype')
|
|
45
|
-
)[0];
|
|
46
|
-
if (!selectionParent) {
|
|
47
|
-
this.showCard = false;
|
|
48
|
-
this.dateElement = undefined;
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const datatype = selectionParent.attributeMap.get('datatype');
|
|
52
|
-
if (datatype === 'xsd:dateTime') {
|
|
53
|
-
this.showCard = true;
|
|
54
|
-
this.dateElement = selectionParent;
|
|
55
|
-
const dateContent = selectionParent.attributeMap.get('content');
|
|
56
|
-
this.dateValue = dateContent ? new Date(dateContent) : new Date();
|
|
57
|
-
this.dateInDocument = !!dateContent;
|
|
58
|
-
this.onlyDate = false;
|
|
59
|
-
} else if (datatype === 'xsd:date') {
|
|
60
|
-
this.showCard = true;
|
|
61
|
-
this.dateElement = selectionParent;
|
|
62
|
-
const dateContent = selectionParent.attributeMap.get('content');
|
|
63
|
-
this.dateValue = dateContent ? new Date(dateContent) : new Date();
|
|
64
|
-
this.dateInDocument = !!dateContent;
|
|
65
|
-
this.onlyDate = true;
|
|
66
|
-
} else {
|
|
67
|
-
this.showCard = false;
|
|
68
|
-
this.dateElement = undefined;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { action } from '@ember/object';
|
|
3
|
-
|
|
4
|
-
export default class RdfaDatePluginInsertComponent extends Component {
|
|
5
|
-
@action
|
|
6
|
-
insertDate() {
|
|
7
|
-
const selection = this.args.controller.selection.lastRange;
|
|
8
|
-
this.args.controller.executeCommand(
|
|
9
|
-
'insert-html',
|
|
10
|
-
'<span datatype="xsd:date" property="ext:content">${date}</span>',
|
|
11
|
-
selection
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@action
|
|
16
|
-
insertDateTime() {
|
|
17
|
-
const selection = this.args.controller.selection.lastRange;
|
|
18
|
-
this.args.controller.executeCommand(
|
|
19
|
-
'insert-html',
|
|
20
|
-
'<span datatype="xsd:dateTime" property="ext:content">${date and time}</span>',
|
|
21
|
-
selection
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
|
-
import { action } from '@ember/object';
|
|
4
|
-
import {
|
|
5
|
-
NON_ZONAL_URI,
|
|
6
|
-
POTENTIALLY_ZONAL_URI,
|
|
7
|
-
ZONAL_URI,
|
|
8
|
-
} from '../../constants';
|
|
9
|
-
|
|
10
|
-
export default class ExpandedMeasureComponent extends Component {
|
|
11
|
-
@tracked zonalityValue;
|
|
12
|
-
@tracked temporalValue;
|
|
13
|
-
ZONAL_URI = ZONAL_URI;
|
|
14
|
-
NON_ZONAL_URI = NON_ZONAL_URI;
|
|
15
|
-
get isPotentiallyZonal() {
|
|
16
|
-
return this.args.measure.zonality === POTENTIALLY_ZONAL_URI;
|
|
17
|
-
}
|
|
18
|
-
get insertButtonDisabled() {
|
|
19
|
-
return this.isPotentiallyZonal && !this.zonalityValue;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@action
|
|
23
|
-
changeZonality(e) {
|
|
24
|
-
this.zonalityValue = e.target.value;
|
|
25
|
-
}
|
|
26
|
-
@action
|
|
27
|
-
changeTemporality(e) {
|
|
28
|
-
this.temporalValue = e.target.value;
|
|
29
|
-
}
|
|
30
|
-
@action
|
|
31
|
-
insert() {
|
|
32
|
-
this.args.insert(this.args.measure, this.zonalityValue, this.temporalValue);
|
|
33
|
-
}
|
|
34
|
-
@action
|
|
35
|
-
unselectRow() {
|
|
36
|
-
this.args.selectRow(this.args.measure.uri);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { inject as service } from '@ember/service';
|
|
3
|
-
import { task } from 'ember-concurrency';
|
|
4
|
-
import { tracked } from '@glimmer/tracking';
|
|
5
|
-
import includeInstructions from '../../utils/roadsign-regulation-plugin/includeInstructions';
|
|
6
|
-
|
|
7
|
-
export default class MeasureTemplateComponent extends Component {
|
|
8
|
-
@service roadsignRegistry;
|
|
9
|
-
@tracked template = '';
|
|
10
|
-
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.template = this.args.template;
|
|
14
|
-
this.fetchData.perform();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@task
|
|
18
|
-
*fetchData() {
|
|
19
|
-
const instructions =
|
|
20
|
-
yield this.roadsignRegistry.getInstructionsForMeasure.perform(
|
|
21
|
-
this.args.measure
|
|
22
|
-
);
|
|
23
|
-
let template = includeInstructions(
|
|
24
|
-
this.args.template,
|
|
25
|
-
instructions,
|
|
26
|
-
this.args.annotated
|
|
27
|
-
);
|
|
28
|
-
this.template = template;
|
|
29
|
-
}
|
|
30
|
-
}
|