@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.2
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 +46 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +10 -0
- package/addon/components/article-structure-plugin/article-structure-card.ts +33 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +46 -0
- package/addon/components/article-structure-plugin/structure-card.ts +124 -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 +138 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +40 -0
- package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +8 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +218 -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} +117 -90
- 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 +45 -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} +103 -66
- 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/helpers/{limit-text.js → limit-text.ts} +2 -2
- 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/commands/index.ts +6 -0
- package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +80 -0
- package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +130 -0
- package/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.ts +26 -0
- package/addon/plugins/article-structure-plugin/commands/remove-structure.ts +21 -0
- package/addon/plugins/article-structure-plugin/commands/unwrap-structure.ts +40 -0
- package/addon/plugins/article-structure-plugin/commands/wrap-structure-content.ts +66 -0
- package/addon/plugins/article-structure-plugin/constants.ts +11 -0
- package/addon/plugins/article-structure-plugin/index.ts +70 -0
- package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +94 -0
- package/addon/plugins/article-structure-plugin/structures/article.ts +129 -0
- package/addon/plugins/article-structure-plugin/structures/chapter.ts +83 -0
- package/addon/plugins/article-structure-plugin/structures/index.ts +33 -0
- package/addon/plugins/article-structure-plugin/structures/section.ts +82 -0
- package/addon/plugins/article-structure-plugin/structures/structure-header.ts +65 -0
- package/addon/plugins/article-structure-plugin/structures/subsection.ts +83 -0
- package/addon/plugins/article-structure-plugin/structures/title.ts +83 -0
- package/addon/plugins/article-structure-plugin/utils/namespace.ts +25 -0
- package/addon/plugins/article-structure-plugin/utils/structure.ts +162 -0
- package/addon/plugins/besluit-plugin/commands/get-article-nodes-for-besluit.ts +30 -0
- package/addon/plugins/besluit-plugin/commands/index.ts +4 -0
- package/addon/plugins/besluit-plugin/commands/insert-article.ts +70 -0
- package/addon/plugins/besluit-plugin/commands/insert-title.ts +67 -0
- package/addon/plugins/besluit-plugin/commands/move-article.ts +69 -0
- package/addon/plugins/besluit-plugin/commands/recalculate-article-numbers.ts +44 -0
- package/addon/plugins/besluit-plugin/index.ts +11 -0
- package/addon/plugins/besluit-plugin/utils/get-title-for-decision.ts +35 -0
- package/addon/plugins/besluit-type-plugin/index.ts +6 -0
- package/addon/{utils/fetchBesluitTypes.js → plugins/besluit-type-plugin/utils/fetchBesluitTypes.ts} +35 -16
- 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/{utils/legislation-types.js → plugins/citation-plugin/utils/legislation-types.ts} +17 -3
- package/addon/plugins/citation-plugin/utils/process-match.ts +132 -0
- package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +160 -41
- package/addon/plugins/import-snippet-plugin.ts +6 -0
- package/addon/plugins/insert-variable-plugin/index.ts +11 -0
- package/addon/{utils/variable-plugins/default-variable-types.js → plugins/insert-variable-plugin/utils/constants.ts} +18 -7
- package/addon/plugins/insert-variable-plugin/utils/fetch-data.ts +41 -0
- package/addon/plugins/rdfa-date-plugin/commands/index.ts +1 -0
- package/addon/plugins/rdfa-date-plugin/commands/modify-date.ts +48 -0
- package/addon/plugins/rdfa-date-plugin/index.ts +11 -0
- package/addon/plugins/roadsign-regulation-plugin/index.ts +6 -0
- package/addon/plugins/roadsign-regulation-plugin/utils/constants.ts +8 -0
- package/addon/{utils/roadsign-regulation-plugin/fetchData.js → plugins/roadsign-regulation-plugin/utils/fetchData.ts} +20 -3
- package/addon/plugins/roadsign-regulation-plugin/utils/includeInstructions.ts +16 -0
- package/addon/plugins/standard-template-plugin/index.ts +6 -0
- package/addon/plugins/standard-template-plugin/utils/instantiate-uuids.ts +48 -0
- package/addon/plugins/table-of-contents-plugin/index.ts +14 -0
- package/addon/plugins/table-of-contents-plugin/nodes/index.ts +1 -0
- package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +53 -0
- package/addon/plugins/table-of-contents-plugin/utils/constants.ts +17 -0
- package/addon/plugins/template-variable-plugin/index.ts +6 -0
- package/addon/plugins/template-variable-plugin/utils/constants.ts +2 -0
- package/addon/plugins/template-variable-plugin/utils/fetch-data.ts +62 -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/memoize.ts +8 -0
- package/addon/utils/option.ts +58 -0
- package/addon/utils/sparql-helpers.ts +27 -0
- 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/components/article-structure-plugin/article-structure-card.d.ts +17 -0
- package/components/article-structure-plugin/structure-card.d.ts +32 -0
- package/components/au-native-input.d.ts +20 -0
- package/components/besluit-plugin/besluit-context-card.d.ts +24 -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/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 +29 -8
- package/plugins/article-structure-plugin/commands/index.d.ts +6 -0
- package/plugins/article-structure-plugin/commands/insert-structure.d.ts +5 -0
- package/plugins/article-structure-plugin/commands/move-selected-structure.d.ts +10 -0
- package/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +3 -0
- package/plugins/article-structure-plugin/commands/remove-structure.d.ts +7 -0
- package/plugins/article-structure-plugin/commands/unwrap-structure.d.ts +8 -0
- package/plugins/article-structure-plugin/commands/wrap-structure-content.d.ts +8 -0
- package/plugins/article-structure-plugin/constants.d.ts +5 -0
- package/plugins/article-structure-plugin/index.d.ts +41 -0
- package/plugins/article-structure-plugin/structures/article-paragraph.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/article.d.ts +6 -0
- package/plugins/article-structure-plugin/structures/chapter.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/index.d.ts +17 -0
- package/plugins/article-structure-plugin/structures/section.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/structure-header.d.ts +2 -0
- package/plugins/article-structure-plugin/structures/subsection.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/title.d.ts +4 -0
- package/plugins/article-structure-plugin/utils/namespace.d.ts +6 -0
- package/plugins/article-structure-plugin/utils/structure.d.ts +20 -0
- package/plugins/besluit-plugin/commands/get-article-nodes-for-besluit.d.ts +5 -0
- package/plugins/besluit-plugin/commands/index.d.ts +4 -0
- package/plugins/besluit-plugin/commands/insert-article.d.ts +3 -0
- package/plugins/besluit-plugin/commands/insert-title.d.ts +2 -0
- package/plugins/besluit-plugin/commands/move-article.d.ts +2 -0
- package/plugins/besluit-plugin/commands/recalculate-article-numbers.d.ts +2 -0
- package/plugins/besluit-plugin/index.d.ts +3 -0
- package/plugins/besluit-plugin/utils/get-title-for-decision.d.ts +10 -0
- package/plugins/besluit-type-plugin/index.d.ts +2 -0
- package/plugins/besluit-type-plugin/utils/fetchBesluitTypes.d.ts +12 -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/legislation-types.d.ts +24 -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/index.d.ts +2 -0
- package/plugins/insert-variable-plugin/utils/constants.d.ts +7 -0
- package/plugins/insert-variable-plugin/utils/fetch-data.d.ts +5 -0
- package/plugins/rdfa-date-plugin/commands/index.d.ts +1 -0
- package/plugins/rdfa-date-plugin/commands/modify-date.d.ts +2 -0
- package/plugins/rdfa-date-plugin/index.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin/index.d.ts +2 -0
- package/plugins/roadsign-regulation-plugin/utils/constants.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin/utils/fetchData.d.ts +8 -0
- package/plugins/roadsign-regulation-plugin/utils/includeInstructions.d.ts +2 -0
- package/plugins/standard-template-plugin/index.d.ts +2 -0
- package/plugins/standard-template-plugin/utils/instantiate-uuids.d.ts +15 -0
- package/plugins/table-of-contents-plugin/index.d.ts +3 -0
- package/plugins/table-of-contents-plugin/nodes/index.d.ts +1 -0
- package/plugins/table-of-contents-plugin/nodes/table-of-contents.d.ts +4 -0
- package/plugins/table-of-contents-plugin/utils/constants.d.ts +7 -0
- package/plugins/template-variable-plugin/index.d.ts +2 -0
- package/plugins/template-variable-plugin/utils/constants.d.ts +1 -0
- package/plugins/template-variable-plugin/utils/fetch-data.d.ts +9 -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 +64 -1
- package/translations/nl-BE.yaml +66 -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/memoize.d.ts +1 -0
- package/utils/option.d.ts +14 -0
- package/utils/sparql-helpers.d.ts +7 -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/constants.js +0 -24
- package/addon/initializers/plugin-initializer.js +0 -75
- package/addon/inline-components/table-of-contents.js +0 -43
- package/addon/marks/citaten-mark.js +0 -32
- 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/generate-template-plugin.js +0 -16
- 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/generate-template-plugin/default-resources.js +0 -9
- package/addon/utils/instantiate-uuids.js +0 -34
- package/addon/utils/memoize.js +0 -8
- package/addon/utils/processMatch.js +0 -80
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
- package/addon/utils/variable-plugins/fetch-data.js +0 -98
- 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,11 +1,19 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
5
|
+
// @ts-ignore
|
|
4
6
|
import { localCopy } from 'tracked-toolbox';
|
|
7
|
+
import Intl from 'ember-intl/services/intl';
|
|
8
|
+
type Args = {
|
|
9
|
+
value: Date;
|
|
10
|
+
onChange: (date: Date) => void;
|
|
11
|
+
};
|
|
5
12
|
|
|
6
|
-
export default class
|
|
7
|
-
@service intl;
|
|
8
|
-
@
|
|
13
|
+
export default class RdfaDatePluginDateTimePicker extends Component<Args> {
|
|
14
|
+
@service declare intl: Intl;
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16
|
+
@localCopy('args.value') declare date: Date;
|
|
9
17
|
|
|
10
18
|
get hours() {
|
|
11
19
|
return this.date.getHours();
|
|
@@ -33,8 +41,8 @@ export default class RdfaDateTimePicker extends Component {
|
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
@action
|
|
36
|
-
onChangeDate(
|
|
37
|
-
|
|
44
|
+
onChangeDate(_isoDate: unknown, date: Date) {
|
|
45
|
+
const wasDateInputCleared = !date;
|
|
38
46
|
if (!wasDateInputCleared) {
|
|
39
47
|
if (!this.date) {
|
|
40
48
|
this.date = new Date();
|
|
@@ -47,7 +55,7 @@ export default class RdfaDateTimePicker extends Component {
|
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
@action
|
|
50
|
-
onChangeTime(timeObject) {
|
|
58
|
+
onChangeTime(timeObject: { hours: number; minutes: number }) {
|
|
51
59
|
if (!this.date) this.date = new Date();
|
|
52
60
|
this.date.setHours(timeObject.hours);
|
|
53
61
|
this.date.setMinutes(timeObject.minutes);
|
|
@@ -55,18 +63,24 @@ export default class RdfaDateTimePicker extends Component {
|
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
function getLocalizedMonths(
|
|
59
|
-
|
|
66
|
+
function getLocalizedMonths(
|
|
67
|
+
intl: Intl,
|
|
68
|
+
monthFormat: 'long' | 'numeric' | '2-digit' | 'short' | 'narrow' = 'long'
|
|
69
|
+
) {
|
|
70
|
+
const someYear = 2021;
|
|
60
71
|
return [...Array(12).keys()].map((monthIndex) => {
|
|
61
|
-
|
|
72
|
+
const date = new Date(someYear, monthIndex);
|
|
62
73
|
return intl.formatDate(date, { month: monthFormat });
|
|
63
74
|
});
|
|
64
75
|
}
|
|
65
76
|
|
|
66
|
-
function getLocalizedDays(
|
|
67
|
-
|
|
77
|
+
function getLocalizedDays(
|
|
78
|
+
intl: Intl,
|
|
79
|
+
weekdayFormat: 'long' | 'short' | 'narrow' = 'long'
|
|
80
|
+
) {
|
|
81
|
+
const someSunday = new Date('2021-01-03');
|
|
68
82
|
return [...Array(7).keys()].map((index) => {
|
|
69
|
-
|
|
83
|
+
const weekday = new Date(someSunday.getTime());
|
|
70
84
|
weekday.setDate(someSunday.getDate() + index);
|
|
71
85
|
return intl.formatDate(weekday, { weekday: weekdayFormat });
|
|
72
86
|
});
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
4
|
+
|
|
5
|
+
type Args = {
|
|
6
|
+
controller: ProseController;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default class RdfaDatePluginInsertComponent extends Component<Args> {
|
|
10
|
+
get controller() {
|
|
11
|
+
return this.args.controller;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get schema() {
|
|
15
|
+
return this.controller.schema;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@action
|
|
19
|
+
insertDate() {
|
|
20
|
+
this.controller.withTransaction((tr) => {
|
|
21
|
+
const dateNode = this.schema.text('${date}', [
|
|
22
|
+
this.schema.mark('inline_rdfa', {
|
|
23
|
+
datatype: 'xsd:date',
|
|
24
|
+
property: 'ext:content',
|
|
25
|
+
}),
|
|
26
|
+
]);
|
|
27
|
+
return tr.replaceSelectionWith(dateNode, false);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@action
|
|
32
|
+
insertDateTime() {
|
|
33
|
+
this.controller.withTransaction((tr) => {
|
|
34
|
+
return tr.replaceSelectionWith(
|
|
35
|
+
this.schema.text('${date and time}', [
|
|
36
|
+
this.schema.mark('inline_rdfa', {
|
|
37
|
+
datatype: 'xsd:dateTime',
|
|
38
|
+
property: 'ext:content',
|
|
39
|
+
}),
|
|
40
|
+
]),
|
|
41
|
+
false
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin/utils/constants';
|
|
9
|
+
import Measure from '@lblod/ember-rdfa-editor-lblod-plugins/models/measure';
|
|
10
|
+
import { assert } from '@ember/debug';
|
|
11
|
+
|
|
12
|
+
type Args = {
|
|
13
|
+
measure: Measure;
|
|
14
|
+
selectRow: (uri: string) => void;
|
|
15
|
+
insert: (
|
|
16
|
+
measure: Measure,
|
|
17
|
+
zonalityValue?: string,
|
|
18
|
+
temporalValue?: string
|
|
19
|
+
) => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default class ExpandedMeasureComponent extends Component<Args> {
|
|
23
|
+
@tracked zonalityValue?: string;
|
|
24
|
+
@tracked temporalValue?: string;
|
|
25
|
+
ZONAL_URI = ZONAL_URI;
|
|
26
|
+
NON_ZONAL_URI = NON_ZONAL_URI;
|
|
27
|
+
get isPotentiallyZonal() {
|
|
28
|
+
return this.args.measure.zonality === POTENTIALLY_ZONAL_URI;
|
|
29
|
+
}
|
|
30
|
+
get insertButtonDisabled() {
|
|
31
|
+
return this.isPotentiallyZonal && !this.zonalityValue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@action
|
|
35
|
+
changeZonality(event: InputEvent) {
|
|
36
|
+
assert(
|
|
37
|
+
'changeZonalityValue must be bound to an input element',
|
|
38
|
+
event.target instanceof HTMLInputElement
|
|
39
|
+
);
|
|
40
|
+
this.zonalityValue = event.target.value;
|
|
41
|
+
}
|
|
42
|
+
@action
|
|
43
|
+
changeTemporality(event: InputEvent) {
|
|
44
|
+
assert(
|
|
45
|
+
'changeTemporality must be bound to an input element',
|
|
46
|
+
event.target instanceof HTMLInputElement
|
|
47
|
+
);
|
|
48
|
+
this.temporalValue = event.target.value;
|
|
49
|
+
}
|
|
50
|
+
@action
|
|
51
|
+
insert() {
|
|
52
|
+
this.args.insert(this.args.measure, this.zonalityValue, this.temporalValue);
|
|
53
|
+
}
|
|
54
|
+
@action
|
|
55
|
+
unselectRow() {
|
|
56
|
+
this.args.selectRow(this.args.measure.uri);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin/utils/includeInstructions';
|
|
6
|
+
import RoadsignRegistryService from '@lblod/ember-rdfa-editor-lblod-plugins/services/roadsign-registry';
|
|
7
|
+
|
|
8
|
+
type Args = {
|
|
9
|
+
template: string;
|
|
10
|
+
measure: string;
|
|
11
|
+
annotated: boolean;
|
|
12
|
+
};
|
|
13
|
+
export default class MeasureTemplateComponent extends Component<Args> {
|
|
14
|
+
@service declare roadsignRegistry: RoadsignRegistryService;
|
|
15
|
+
@tracked template = '';
|
|
16
|
+
|
|
17
|
+
constructor(parent: unknown, args: Args) {
|
|
18
|
+
super(parent, args);
|
|
19
|
+
this.template = this.args.template;
|
|
20
|
+
void this.fetchData.perform();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fetchData = task(async () => {
|
|
24
|
+
const instructions =
|
|
25
|
+
await this.roadsignRegistry.getInstructionsForMeasure.perform(
|
|
26
|
+
this.args.measure
|
|
27
|
+
);
|
|
28
|
+
const template = includeInstructions(
|
|
29
|
+
this.args.template,
|
|
30
|
+
instructions,
|
|
31
|
+
this.args.annotated
|
|
32
|
+
);
|
|
33
|
+
this.template = template;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
@skin="link"
|
|
4
4
|
@icon="add"
|
|
5
5
|
@iconAlignment="left"
|
|
6
|
-
@disabled={{
|
|
6
|
+
@disabled={{not this.showCard}}
|
|
7
7
|
{{on "click" this.toggleModal}}
|
|
8
8
|
>
|
|
9
9
|
Voeg mobiliteitsmaatregel in
|
|
10
10
|
</AuButton>
|
|
11
11
|
</AuList::Item>
|
|
12
|
-
<RoadsignRegulationPlugin::RoadsignsModal @modalOpen={{this.modalOpen}} @closeModal={{this.toggleModal}} @controller={{@controller}}
|
|
12
|
+
<RoadsignRegulationPlugin::RoadsignsModal @modalOpen={{this.modalOpen}} @closeModal={{this.toggleModal}} @controller={{@controller}}/>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Card displaying a hint of the Date plugin
|
|
8
|
+
*
|
|
9
|
+
* @module editor-roadsign-regulation-plugin
|
|
10
|
+
* @class RoadsignRegulationCard
|
|
11
|
+
* @extends Ember.Component
|
|
12
|
+
*/
|
|
13
|
+
const acceptedTypes = [
|
|
14
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/4d8f678a-6fa4-4d5f-a2a1-80974e43bf34',
|
|
15
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/7d95fd2e-3cc9-4a4c-a58e-0fbc408c2f9b',
|
|
16
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/3bba9f10-faff-49a6-acaa-85af7f2199a3',
|
|
17
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/0d1278af-b69e-4152-a418-ec5cfd1c7d0b',
|
|
18
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/e8afe7c5-9640-4db8-8f74-3f023bec3241',
|
|
19
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/256bd04a-b74b-4f2a-8f5d-14dda4765af9',
|
|
20
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/67378dd0-5413-474b-8996-d992ef81637a',
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
type Args = {
|
|
24
|
+
controller: ProseController;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default class RoadsignRegulationCard extends Component<Args> {
|
|
28
|
+
@tracked modalOpen = false;
|
|
29
|
+
|
|
30
|
+
@action
|
|
31
|
+
toggleModal() {
|
|
32
|
+
this.modalOpen = !this.modalOpen;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get controller() {
|
|
36
|
+
return this.args.controller;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get showCard() {
|
|
40
|
+
const selection = this.controller.state.selection;
|
|
41
|
+
const limitedDatastore = this.controller.datastore.limitToRange(
|
|
42
|
+
this.controller.state,
|
|
43
|
+
selection.from,
|
|
44
|
+
selection.to
|
|
45
|
+
);
|
|
46
|
+
const besluit = [
|
|
47
|
+
...limitedDatastore
|
|
48
|
+
.match(undefined, 'a')
|
|
49
|
+
.transformDataset((dataset, termConverter) => {
|
|
50
|
+
return dataset.filter((quad) =>
|
|
51
|
+
acceptedTypes
|
|
52
|
+
.map((type) => termConverter(type).value)
|
|
53
|
+
.includes(quad.object.value)
|
|
54
|
+
);
|
|
55
|
+
})
|
|
56
|
+
.asQuadResultSet(),
|
|
57
|
+
][0];
|
|
58
|
+
return !!besluit;
|
|
59
|
+
}
|
|
60
|
+
}
|
package/addon/components/roadsign-regulation-plugin/{roadsigns-modal.js → roadsigns-modal.ts}
RENAMED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { action } from '@ember/object';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
|
-
import {
|
|
4
|
+
import { task } from 'ember-concurrency';
|
|
5
5
|
import { getOwner } from '@ember/application';
|
|
6
6
|
import { v4 as uuid } from 'uuid';
|
|
7
7
|
import { inject as service } from '@ember/service';
|
|
8
|
-
import includeInstructions from '
|
|
8
|
+
import includeInstructions from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin/utils/includeInstructions';
|
|
9
9
|
import {
|
|
10
10
|
NON_ZONAL_URI,
|
|
11
11
|
POTENTIALLY_ZONAL_URI,
|
|
12
12
|
ZONAL_URI,
|
|
13
|
-
} from '
|
|
13
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin/utils/constants';
|
|
14
|
+
import RoadsignRegistryService from '@lblod/ember-rdfa-editor-lblod-plugins/services/roadsign-registry';
|
|
15
|
+
import { assert } from '@ember/debug';
|
|
16
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
17
|
+
import Measure from '@lblod/ember-rdfa-editor-lblod-plugins/models/measure';
|
|
18
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
19
|
+
import { insertArticle } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-plugin/commands';
|
|
14
20
|
|
|
15
21
|
const PAGE_SIZE = 10;
|
|
16
22
|
const SIGN_TYPE_URI =
|
|
@@ -20,17 +26,33 @@ const ROAD_MARKING_URI =
|
|
|
20
26
|
const TRAFFIC_LIGHT_URI =
|
|
21
27
|
'https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept';
|
|
22
28
|
const measureTypes = [SIGN_TYPE_URI, ROAD_MARKING_URI, TRAFFIC_LIGHT_URI];
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
|
|
30
|
+
type Option = {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type Zonality = Option;
|
|
36
|
+
type TypeOption = Option;
|
|
37
|
+
type Code = Option;
|
|
38
|
+
type Category = Option;
|
|
39
|
+
|
|
40
|
+
type Args = {
|
|
41
|
+
closeModal: () => void;
|
|
42
|
+
controller: ProseController;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default class RoadsignRegulationCard extends Component<Args> {
|
|
46
|
+
endpoint: string;
|
|
25
47
|
|
|
26
48
|
pageSize = PAGE_SIZE;
|
|
27
|
-
@service roadsignRegistry;
|
|
49
|
+
@service declare roadsignRegistry: RoadsignRegistryService;
|
|
28
50
|
|
|
29
|
-
@tracked typeSelected;
|
|
51
|
+
@tracked typeSelected?: TypeOption;
|
|
30
52
|
|
|
31
|
-
@tracked categorySelected;
|
|
53
|
+
@tracked categorySelected?: Category;
|
|
32
54
|
|
|
33
|
-
@tracked zonalityOptions = [
|
|
55
|
+
@tracked zonalityOptions: Zonality[] = [
|
|
34
56
|
{
|
|
35
57
|
label: 'Zonaal',
|
|
36
58
|
value: ZONAL_URI,
|
|
@@ -40,13 +62,15 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
40
62
|
value: NON_ZONAL_URI,
|
|
41
63
|
},
|
|
42
64
|
];
|
|
43
|
-
@tracked zonalitySelected;
|
|
65
|
+
@tracked zonalitySelected?: Zonality;
|
|
44
66
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@tracked
|
|
48
|
-
@tracked
|
|
49
|
-
@tracked
|
|
67
|
+
descriptionFilter?: string;
|
|
68
|
+
|
|
69
|
+
@tracked selectedCode?: Code;
|
|
70
|
+
@tracked selectedCodeCombination?: Code[];
|
|
71
|
+
@tracked codeCombinationOptions: Code[] = [];
|
|
72
|
+
@tracked tableData: Measure[] = [];
|
|
73
|
+
@tracked count?: number;
|
|
50
74
|
@tracked pageStart = 0;
|
|
51
75
|
|
|
52
76
|
get isNotTypeSign() {
|
|
@@ -54,15 +78,21 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
54
78
|
return this.typeSelected.value !== SIGN_TYPE_URI;
|
|
55
79
|
}
|
|
56
80
|
|
|
57
|
-
constructor() {
|
|
58
|
-
super(
|
|
59
|
-
const config = getOwner(this).resolveRegistration(
|
|
81
|
+
constructor(parent: unknown, args: Args) {
|
|
82
|
+
super(parent, args);
|
|
83
|
+
const config = unwrap(getOwner(this)).resolveRegistration(
|
|
84
|
+
'config:environment'
|
|
85
|
+
) as {
|
|
86
|
+
roadsignRegulationPlugin: {
|
|
87
|
+
endpoint: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
60
90
|
this.endpoint = config.roadsignRegulationPlugin.endpoint;
|
|
61
91
|
this.search();
|
|
62
92
|
}
|
|
63
93
|
|
|
64
94
|
@action
|
|
65
|
-
selectTypeOrCategory(option) {
|
|
95
|
+
selectTypeOrCategory(option: Option) {
|
|
66
96
|
if (!option) {
|
|
67
97
|
this.typeSelected = undefined;
|
|
68
98
|
this.categorySelected = undefined;
|
|
@@ -81,34 +111,38 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
81
111
|
}
|
|
82
112
|
|
|
83
113
|
@action
|
|
84
|
-
changeCode(value) {
|
|
114
|
+
changeCode(value: Code) {
|
|
85
115
|
this.selectedCode = value;
|
|
86
116
|
this.selectedCodeCombination = undefined;
|
|
87
|
-
this.fetchCodeCombinations();
|
|
117
|
+
void this.fetchCodeCombinations();
|
|
88
118
|
this.search();
|
|
89
119
|
}
|
|
90
120
|
|
|
91
121
|
@action
|
|
92
|
-
changeCodeCombination(value) {
|
|
122
|
+
changeCodeCombination(value: Code[]) {
|
|
93
123
|
this.selectedCodeCombination = value;
|
|
94
|
-
this.fetchCodeCombinations();
|
|
124
|
+
void this.fetchCodeCombinations();
|
|
95
125
|
this.search();
|
|
96
126
|
}
|
|
97
127
|
|
|
98
128
|
@action
|
|
99
|
-
changeDescription(
|
|
100
|
-
|
|
129
|
+
changeDescription(event: InputEvent) {
|
|
130
|
+
assert(
|
|
131
|
+
'changeDescriptionValue must be bound to an input element',
|
|
132
|
+
event.target instanceof HTMLInputElement
|
|
133
|
+
);
|
|
134
|
+
this.descriptionFilter = event.target.value;
|
|
101
135
|
this.search();
|
|
102
136
|
}
|
|
103
137
|
|
|
104
138
|
@action
|
|
105
|
-
selectCategory(value) {
|
|
139
|
+
selectCategory(value: Category) {
|
|
106
140
|
this.categorySelected = value;
|
|
107
141
|
this.search();
|
|
108
142
|
}
|
|
109
143
|
|
|
110
144
|
@action
|
|
111
|
-
selectZonality(value) {
|
|
145
|
+
selectZonality(value: Zonality) {
|
|
112
146
|
this.zonalitySelected = value;
|
|
113
147
|
this.search();
|
|
114
148
|
}
|
|
@@ -118,19 +152,18 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
118
152
|
this.args.closeModal();
|
|
119
153
|
}
|
|
120
154
|
@action
|
|
121
|
-
searchCodes(term) {
|
|
122
|
-
const category = this.categorySelected
|
|
123
|
-
|
|
124
|
-
: undefined;
|
|
125
|
-
const type = this.typeSelected ? this.typeSelected.value : undefined;
|
|
155
|
+
searchCodes(term: string) {
|
|
156
|
+
const category = this.categorySelected?.value;
|
|
157
|
+
const type = this.typeSelected?.value;
|
|
126
158
|
return this.roadsignRegistry.searchCode.perform(term, category, type);
|
|
127
159
|
}
|
|
128
160
|
|
|
129
161
|
async fetchCodeCombinations() {
|
|
130
|
-
|
|
162
|
+
const selectedCodeValue = unwrap(this.selectedCode?.value);
|
|
163
|
+
let signs: string[] = [selectedCodeValue];
|
|
131
164
|
if (this.selectedCodeCombination) {
|
|
132
165
|
signs = [
|
|
133
|
-
|
|
166
|
+
selectedCodeValue,
|
|
134
167
|
...this.selectedCodeCombination.map((s) => s.value),
|
|
135
168
|
];
|
|
136
169
|
}
|
|
@@ -143,7 +176,10 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
143
176
|
this.codeCombinationOptions = codes;
|
|
144
177
|
}
|
|
145
178
|
|
|
146
|
-
get typeOptions() {
|
|
179
|
+
get typeOptions(): {
|
|
180
|
+
groupName: string;
|
|
181
|
+
options: TypeOption[];
|
|
182
|
+
}[] {
|
|
147
183
|
return [
|
|
148
184
|
{
|
|
149
185
|
groupName: 'Types',
|
|
@@ -171,9 +207,8 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
171
207
|
];
|
|
172
208
|
}
|
|
173
209
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
let codes = [];
|
|
210
|
+
fetchSigns = task({ restartable: true }, async () => {
|
|
211
|
+
const codes: Code[] = [];
|
|
177
212
|
if (this.selectedCodeCombination) {
|
|
178
213
|
codes.push(...this.selectedCodeCombination);
|
|
179
214
|
}
|
|
@@ -181,7 +216,7 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
181
216
|
codes.push(this.selectedCode);
|
|
182
217
|
}
|
|
183
218
|
const { measures, count } =
|
|
184
|
-
|
|
219
|
+
await this.roadsignRegistry.fetchMeasures.perform({
|
|
185
220
|
zonality: this.zonalitySelected
|
|
186
221
|
? this.zonalitySelected.value
|
|
187
222
|
: undefined,
|
|
@@ -194,10 +229,14 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
194
229
|
});
|
|
195
230
|
this.tableData = measures;
|
|
196
231
|
this.count = count;
|
|
197
|
-
}
|
|
232
|
+
});
|
|
198
233
|
|
|
199
234
|
@action
|
|
200
|
-
async insertHtml(
|
|
235
|
+
async insertHtml(
|
|
236
|
+
measure: Measure,
|
|
237
|
+
zonalityValue: string,
|
|
238
|
+
temporalValue: string
|
|
239
|
+
) {
|
|
201
240
|
const instructions =
|
|
202
241
|
await this.roadsignRegistry.fetchInstructionsForMeasure.perform(
|
|
203
242
|
measure.uri
|
|
@@ -211,7 +250,8 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
211
250
|
const signsHTML = measure.signs
|
|
212
251
|
.map((sign) => {
|
|
213
252
|
const roadSignUri = 'http://data.lblod.info/verkeerstekens/' + uuid();
|
|
214
|
-
return `<li style="margin-bottom:1rem;"
|
|
253
|
+
return `<li style="margin-bottom:1rem;">
|
|
254
|
+
<span property="mobiliteit:wordtAangeduidDoor" resource=${roadSignUri} typeof="mobiliteit:Verkeersbord-Verkeersteken">
|
|
215
255
|
<span property="mobiliteit:heeftVerkeersbordconcept" resource="${
|
|
216
256
|
sign.uri
|
|
217
257
|
}" typeof="mobiliteit:Verkeersbordconcept" style="display:flex;align-items:center;">
|
|
@@ -229,40 +269,37 @@ export default class RoadsignRegulationCard extends Component {
|
|
|
229
269
|
</li>`;
|
|
230
270
|
})
|
|
231
271
|
.join('\n');
|
|
272
|
+
const regulationHTML = `<div property="mobiliteit:heeftVerkeersmaatregel" typeof="mobiliteit:Mobiliteitsmaatregel" resource="http://data.lblod.info/mobiliteitsmaatregels/${uuid()}">
|
|
273
|
+
<span style="display:none;" property="prov:wasDerivedFrom" resource="${
|
|
274
|
+
measure.uri
|
|
275
|
+
}"> </span>
|
|
276
|
+
<span style="display:none;" property="ext:zonality" resource="${zonality}"></span>
|
|
277
|
+
<span style="display:none;" property="ext:temporal" value="${measure.temporal.toString()}"></span>
|
|
278
|
+
<div property="dct:description">
|
|
279
|
+
${html}
|
|
280
|
+
<p>Dit wordt aangeduid door verkeerstekens:</p>
|
|
281
|
+
<ul style="list-style:none;">
|
|
282
|
+
${signsHTML}
|
|
283
|
+
</ul>
|
|
284
|
+
${temporalValue === 'true' ? 'Deze signalisatie is dynamisch.' : ''}
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
`;
|
|
232
288
|
|
|
233
|
-
this.args.controller.
|
|
234
|
-
|
|
235
|
-
this.args.controller,
|
|
236
|
-
`<div property="mobiliteit:heeftVerkeersmaatregel" typeof="mobiliteit:Mobiliteitsmaatregel" resource="http://data.lblod.info/mobiliteitsmaatregels/${uuid()}">
|
|
237
|
-
<span style="display:none;" property="prov:wasDerivedFrom" resource="${
|
|
238
|
-
measure.uri
|
|
239
|
-
}"> </span>
|
|
240
|
-
<span style="display:none;" property="ext:zonality" resource="${zonality}"></span>
|
|
241
|
-
<span style="display:none;" property="ext:temporal" value="${
|
|
242
|
-
measure.temporal
|
|
243
|
-
}"></span>
|
|
244
|
-
<div property="dct:description">
|
|
245
|
-
${html}
|
|
246
|
-
<p>Dit wordt aangeduid door verkeerstekens:</p>
|
|
247
|
-
<ul style="list-style:none;">
|
|
248
|
-
${signsHTML}
|
|
249
|
-
</ul>
|
|
250
|
-
${temporalValue === 'true' ? 'Deze signalisatie is dynamisch.' : ''}
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
253
|
-
`
|
|
289
|
+
this.args.controller.doCommand(
|
|
290
|
+
insertArticle(this.args.controller, regulationHTML)
|
|
254
291
|
);
|
|
255
292
|
this.args.closeModal();
|
|
256
293
|
}
|
|
257
294
|
|
|
258
295
|
@action
|
|
259
|
-
goToPage(pageStart) {
|
|
296
|
+
goToPage(pageStart: number) {
|
|
260
297
|
this.pageStart = pageStart;
|
|
261
|
-
this.fetchSigns.perform();
|
|
298
|
+
void this.fetchSigns.perform();
|
|
262
299
|
}
|
|
263
300
|
@action
|
|
264
301
|
search() {
|
|
265
302
|
this.pageStart = 0;
|
|
266
|
-
this.fetchSigns.perform();
|
|
303
|
+
void this.fetchSigns.perform();
|
|
267
304
|
}
|
|
268
305
|
}
|
|
@@ -2,7 +2,12 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type Args = {
|
|
6
|
+
count: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
goToPage: (n: number) => void;
|
|
9
|
+
};
|
|
10
|
+
export default class RoadsignsPagination extends Component<Args> {
|
|
6
11
|
@tracked actualPageStart = 0;
|
|
7
12
|
@tracked actualPageEnd = 10;
|
|
8
13
|
|
|
@@ -31,8 +36,7 @@ export default class RoadsignsPagination extends Component {
|
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
@action
|
|
34
|
-
onUpdateCount(_element,
|
|
35
|
-
const pageStart = params[1];
|
|
39
|
+
onUpdateCount(_element: HTMLElement, [_, pageStart]: [number, number]) {
|
|
36
40
|
this.actualPageStart = pageStart;
|
|
37
41
|
this.actualPageEnd = pageStart + this.args.pageSize;
|
|
38
42
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { getOwner } from '@ember/application';
|
|
5
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
6
|
+
|
|
7
|
+
type Args = Record<string, never>;
|
|
8
|
+
export default class RoadsignsTable extends Component<Args> {
|
|
9
|
+
@tracked selected?: string;
|
|
10
|
+
imageBaseUrl: string;
|
|
11
|
+
|
|
12
|
+
constructor(parent: unknown, args: Args) {
|
|
13
|
+
super(parent, args);
|
|
14
|
+
const config = unwrap(getOwner(this)).resolveRegistration(
|
|
15
|
+
'config:environment'
|
|
16
|
+
) as {
|
|
17
|
+
roadsignRegulationPlugin: {
|
|
18
|
+
imageBaseUrl: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
this.imageBaseUrl = config.roadsignRegulationPlugin.imageBaseUrl;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@action
|
|
25
|
+
selectRow(id: string) {
|
|
26
|
+
if (this.selected === id) {
|
|
27
|
+
this.selected = undefined;
|
|
28
|
+
} else {
|
|
29
|
+
this.selected = id;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
3
|
+
|
|
4
|
+
type Args = {
|
|
5
|
+
controller: ProseController;
|
|
6
|
+
};
|
|
7
|
+
export default class StandardTemplatePluginCardComponent extends Component<Args> {
|
|
8
|
+
get controller() {
|
|
9
|
+
return this.args.controller;
|
|
10
|
+
}
|
|
11
|
+
}
|