geonetwork-ui 2.3.0-dev.6e2b8bea → 2.3.0-dev.c22cb78a
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/esm2022/index.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +5 -1
- package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +35 -7
- package/esm2022/libs/data-access/gn4/src/openapi/model/models.mjs +1 -2
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +2 -2
- package/esm2022/libs/feature/editor/src/index.mjs +2 -2
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +6 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-array/form-field-array.component.mjs +11 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-file/form-field-file.component.mjs +28 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-object/form-field-object.component.mjs +11 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +45 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-simple/form-field-simple.component.mjs +50 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +11 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extent/form-field-temporal-extent.component.mjs +11 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +107 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.mjs +2 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +10 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +29 -0
- package/esm2022/libs/feature/editor/src/lib/feature-editor.module.mjs +10 -10
- package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.mjs +3 -3
- package/esm2022/libs/feature/notifications/src/index.mjs +4 -0
- package/esm2022/libs/feature/notifications/src/lib/feature-notifications.module.mjs +18 -0
- package/esm2022/libs/feature/notifications/src/lib/notification.model.mjs +2 -0
- package/esm2022/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.mjs +49 -0
- package/esm2022/libs/feature/notifications/src/lib/notifications.service.mjs +29 -0
- package/esm2022/libs/feature/search/src/lib/results-table/results-table.component.mjs +3 -3
- package/esm2022/libs/ui/catalog/src/lib/organisation-preview/organisation-preview.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/index.mjs +15 -15
- package/esm2022/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.mjs +5 -5
- package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +45 -0
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/notification/notification.component.mjs +34 -0
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +4 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +6 -5
- package/esm2022/libs/ui/inputs/src/index.mjs +1 -2
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/files-drop/files-drop.directive.mjs +59 -0
- package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +183 -0
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +10 -23
- package/esm2022/libs/ui/layout/src/index.mjs +6 -5
- package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +18 -0
- package/esm2022/libs/util/shared/src/lib/utils/bytes-convert.mjs +4 -0
- package/esm2022/libs/util/shared/src/lib/utils/image-resize.mjs +60 -0
- package/esm2022/libs/util/shared/src/lib/utils/index.mjs +8 -6
- package/esm2022/translations/de.json +18 -0
- package/esm2022/translations/en.json +18 -0
- package/esm2022/translations/es.json +18 -0
- package/esm2022/translations/fr.json +18 -0
- package/esm2022/translations/it.json +18 -0
- package/esm2022/translations/nl.json +18 -0
- package/esm2022/translations/pt.json +18 -0
- package/fesm2022/geonetwork-ui.mjs +1766 -1142
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.ts +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts +9 -5
- package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
- package/libs/data-access/gn4/src/openapi/model/models.d.ts +0 -1
- package/libs/data-access/gn4/src/openapi/model/models.d.ts.map +1 -1
- package/libs/feature/editor/src/index.d.ts +1 -1
- package/libs/feature/editor/src/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +8 -5
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-array/form-field-array.component.d.ts.map +1 -0
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-file/form-field-file.component.d.ts.map +1 -0
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-object/form-field-object.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts +16 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -0
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.d.ts +2 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-simple/form-field-simple.component.d.ts.map +1 -0
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +1 -0
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.d.ts +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extent/form-field-temporal-extent.component.d.ts.map +1 -0
- package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.component.d.ts +8 -3
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/{record-form → components/record-form}/record-form.component.d.ts +3 -3
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/feature-editor.module.d.ts +1 -1
- package/libs/feature/editor/src/lib/feature-editor.module.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/models/fields.model.d.ts +1 -1
- package/libs/feature/notifications/src/index.d.ts +4 -0
- package/libs/feature/notifications/src/index.d.ts.map +1 -0
- package/libs/feature/notifications/src/lib/feature-notifications.module.d.ts +7 -0
- package/libs/feature/notifications/src/lib/feature-notifications.module.d.ts.map +1 -0
- package/libs/feature/notifications/src/lib/notification.model.d.ts +7 -0
- package/libs/feature/notifications/src/lib/notification.model.d.ts.map +1 -0
- package/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.d.ts +12 -0
- package/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.d.ts.map +1 -0
- package/libs/feature/notifications/src/lib/notifications.service.d.ts +15 -0
- package/libs/feature/notifications/src/lib/notifications.service.d.ts.map +1 -0
- package/libs/ui/elements/src/index.d.ts +14 -14
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts +13 -0
- package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/notification/notification.component.d.ts +13 -0
- package/libs/ui/elements/src/lib/notification/notification.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/thumbnail/thumbnail.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/thumbnail/thumbnail.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +20 -20
- package/libs/ui/inputs/src/index.d.ts +0 -1
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/files-drop/files-drop.directive.d.ts +14 -0
- package/libs/ui/inputs/src/lib/files-drop/files-drop.directive.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts +44 -0
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +26 -33
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
- package/libs/ui/layout/src/index.d.ts +5 -4
- package/libs/ui/layout/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts +8 -0
- package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts.map +1 -0
- package/libs/util/shared/src/lib/utils/bytes-convert.d.ts +2 -0
- package/libs/util/shared/src/lib/utils/bytes-convert.d.ts.map +1 -0
- package/libs/util/shared/src/lib/utils/image-resize.d.ts +3 -0
- package/libs/util/shared/src/lib/utils/image-resize.d.ts.map +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts +7 -5
- package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +6 -0
- package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +43 -12
- package/src/libs/data-access/gn4/src/openapi/model/models.ts +0 -1
- package/src/libs/data-access/gn4/src/spec.yaml +1 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +1 -1
- package/src/libs/feature/editor/src/index.ts +1 -1
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +8 -1
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +8 -0
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +70 -0
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.ts +1 -0
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.ts +4 -1
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.ts +1 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.html +20 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +44 -0
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.ts +4 -1
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +1 -0
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.ts +1 -0
- package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.component.html +28 -4
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +121 -0
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.css +0 -0
- package/src/libs/feature/editor/src/lib/{record-form → components/record-form}/record-form.component.html +1 -0
- package/src/libs/feature/editor/src/lib/{record-form → components/record-form}/record-form.component.ts +4 -4
- package/src/libs/feature/editor/src/lib/feature-editor.module.ts +9 -9
- package/src/libs/feature/editor/src/lib/models/fields.model.ts +1 -1
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.html +1 -1
- package/src/libs/feature/notifications/src/index.ts +3 -0
- package/src/libs/feature/notifications/src/lib/feature-notifications.module.ts +10 -0
- package/src/libs/feature/notifications/src/lib/notification.model.ts +6 -0
- package/src/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.css +0 -0
- package/src/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.html +17 -0
- package/src/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.ts +44 -0
- package/src/libs/feature/notifications/src/lib/notifications.service.ts +27 -0
- package/src/libs/feature/search/src/lib/results-table/results-table.component.html +3 -3
- package/src/libs/ui/catalog/src/lib/organisation-preview/organisation-preview.component.html +5 -5
- package/src/libs/ui/elements/src/index.ts +14 -14
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html +1 -1
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.css +0 -5
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +0 -21
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +1 -14
- package/src/libs/ui/elements/src/lib/notification/notification.component.css +0 -0
- package/src/libs/ui/elements/src/lib/notification/notification.component.html +52 -0
- package/src/libs/ui/elements/src/lib/notification/notification.component.ts +31 -0
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +1 -1
- package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.ts +5 -3
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +1 -1
- package/src/libs/ui/inputs/src/index.ts +0 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.ts +1 -1
- package/src/libs/ui/inputs/src/lib/files-drop/files-drop.directive.ts +45 -0
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.css +0 -0
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.html +146 -0
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.ts +193 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +3 -19
- package/src/libs/ui/layout/src/index.ts +5 -4
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.css +0 -0
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +18 -0
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.ts +16 -0
- package/src/libs/util/shared/src/lib/utils/bytes-convert.ts +3 -0
- package/src/libs/util/shared/src/lib/utils/image-resize.ts +72 -0
- package/src/libs/util/shared/src/lib/utils/index.ts +7 -5
- package/tailwind.base.css +36 -0
- package/translations/de.json +18 -0
- package/translations/en.json +18 -0
- package/translations/es.json +18 -0
- package/translations/fr.json +18 -0
- package/translations/it.json +18 -0
- package/translations/nl.json +18 -0
- package/translations/pt.json +18 -0
- package/translations/sk.json +18 -0
- package/esm2022/libs/data-access/gn4/src/openapi/model/inlineObject3.api.model.mjs +0 -13
- package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +0 -30
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-array/form-field-array.component.mjs +0 -11
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-file/form-field-file.component.mjs +0 -27
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-object/form-field-object.component.mjs +0 -11
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.mjs +0 -27
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-simple/form-field-simple.component.mjs +0 -49
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +0 -11
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-temporal-extent/form-field-temporal-extent.component.mjs +0 -11
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.component.mjs +0 -76
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.model.mjs +0 -2
- package/esm2022/libs/ui/inputs/src/lib/form-field/index.mjs +0 -10
- package/libs/data-access/gn4/src/openapi/model/inlineObject3.api.model.d.ts +0 -18
- package/libs/data-access/gn4/src/openapi/model/inlineObject3.api.model.d.ts.map +0 -1
- package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-array/form-field-array.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-file/form-field-file.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-object/form-field-object.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.d.ts +0 -11
- package/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-simple/form-field-simple.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field-temporal-extent/form-field-temporal-extent.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field.component.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field.model.d.ts.map +0 -1
- package/libs/ui/inputs/src/lib/form-field/index.d.ts.map +0 -1
- package/src/libs/data-access/gn4/src/openapi/model/inlineObject3.api.model.ts +0 -18
- package/src/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.html +0 -11
- package/src/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.ts +0 -15
- package/src/libs/ui/inputs/src/lib/form-field/form-field.component.ts +0 -80
- /package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.model.d.ts +0 -0
- /package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/index.d.ts +0 -0
- /package/src/libs/feature/editor/src/lib/{record-form/record-form.component.css → components/overview-upload/overview-upload.component.css} +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.html +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.html +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.html +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-rich/form-field-rich.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.html +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.html +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.component.css +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.model.ts +0 -0
- /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/index.ts +0 -0
|
@@ -15,7 +15,7 @@ import { propagateToDocumentOnly } from '../../../../../../libs/util/shared/src'
|
|
|
15
15
|
standalone: true,
|
|
16
16
|
})
|
|
17
17
|
export class ButtonComponent {
|
|
18
|
-
private btnClass
|
|
18
|
+
private btnClass = 'gn-ui-btn-default'
|
|
19
19
|
|
|
20
20
|
@Input() set type(
|
|
21
21
|
value: 'primary' | 'secondary' | 'default' | 'outline' | 'light'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Directive, HostListener, Output, EventEmitter } from '@angular/core'
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[gnUiFilesDrop]',
|
|
5
|
+
standalone: true,
|
|
6
|
+
})
|
|
7
|
+
export class FilesDropDirective {
|
|
8
|
+
@Output() dragFilesOver: EventEmitter<boolean> = new EventEmitter()
|
|
9
|
+
@Output() dropFiles: EventEmitter<File[]> = new EventEmitter()
|
|
10
|
+
|
|
11
|
+
dragEnterCounter = 0
|
|
12
|
+
|
|
13
|
+
@HostListener('dragenter', ['$event'])
|
|
14
|
+
_onDragEnter(event: DragEvent) {
|
|
15
|
+
event.preventDefault()
|
|
16
|
+
this.dragEnterCounter++
|
|
17
|
+
this.dragFilesOver.emit(true)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@HostListener('dragover', ['$event'])
|
|
21
|
+
_onDragOver(event: DragEvent) {
|
|
22
|
+
event.preventDefault()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@HostListener('dragleave', ['$event'])
|
|
26
|
+
_onDragLeave(event: DragEvent) {
|
|
27
|
+
event.preventDefault()
|
|
28
|
+
this.dragEnterCounter = Math.max(0, this.dragEnterCounter - 1)
|
|
29
|
+
if (this.dragEnterCounter === 0) {
|
|
30
|
+
this.dragFilesOver.emit(false)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@HostListener('drop', ['$event'])
|
|
35
|
+
_onDrop(event: DragEvent) {
|
|
36
|
+
event.preventDefault()
|
|
37
|
+
this.dragEnterCounter = 0
|
|
38
|
+
this.dragFilesOver.emit(false)
|
|
39
|
+
|
|
40
|
+
const files = Array.from(event.dataTransfer.files)
|
|
41
|
+
if (files.length > 0) {
|
|
42
|
+
this.dropFiles.emit(files)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<ng-container *ngIf="previewUrl; then withImage; else withoutImage">
|
|
2
|
+
</ng-container>
|
|
3
|
+
|
|
4
|
+
<ng-template #withImage>
|
|
5
|
+
<div class="w-full h-full flex flex-col gap-2">
|
|
6
|
+
<div class="flex-1 group relative">
|
|
7
|
+
<img
|
|
8
|
+
class="w-full h-full object-cover border-2 border-gray-300 rounded-lg"
|
|
9
|
+
[alt]="altText"
|
|
10
|
+
loading="lazy"
|
|
11
|
+
[src]="previewUrl"
|
|
12
|
+
/>
|
|
13
|
+
<gn-ui-button
|
|
14
|
+
[extraClass]="
|
|
15
|
+
'bg-gray-200 absolute right-2 bottom-2 invisible group-hover:visible'
|
|
16
|
+
"
|
|
17
|
+
(buttonClick)="handleDelete()"
|
|
18
|
+
>
|
|
19
|
+
<mat-icon class="material-symbols-outlined">delete</mat-icon>
|
|
20
|
+
</gn-ui-button>
|
|
21
|
+
</div>
|
|
22
|
+
<input
|
|
23
|
+
*ngIf="showAltTextInput"
|
|
24
|
+
type="text"
|
|
25
|
+
class="py-3 px-2 border-2 border-gray-300 rounded-lg text-sm font-medium"
|
|
26
|
+
[placeholder]="'input.image.altTextPlaceholder' | translate"
|
|
27
|
+
[value]="altText"
|
|
28
|
+
(change)="handleAltTextChange($event)"
|
|
29
|
+
/>
|
|
30
|
+
<div class="flex flex-row gap-2">
|
|
31
|
+
<gn-ui-button
|
|
32
|
+
[extraClass]="'bg-gray-200 font-bold'"
|
|
33
|
+
(buttonClick)="handleDelete()"
|
|
34
|
+
>
|
|
35
|
+
<mat-icon class="material-symbols-outlined me-1">delete</mat-icon>
|
|
36
|
+
{{ 'input.image.delete' | translate }}
|
|
37
|
+
</gn-ui-button>
|
|
38
|
+
<gn-ui-button
|
|
39
|
+
*ngIf="!showAltTextInput"
|
|
40
|
+
[extraClass]="'bg-gray-200 font-bold'"
|
|
41
|
+
(buttonClick)="toggleAltTextInput()"
|
|
42
|
+
>
|
|
43
|
+
<mat-icon class="material-symbols-outlined me-1">add</mat-icon>
|
|
44
|
+
{{ 'input.image.displayAltTextInput' | translate }}
|
|
45
|
+
</gn-ui-button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</ng-template>
|
|
49
|
+
|
|
50
|
+
<ng-template #withoutImage>
|
|
51
|
+
<div class="w-full h-full flex flex-col gap-2">
|
|
52
|
+
<label
|
|
53
|
+
gnUiFilesDrop
|
|
54
|
+
class="block flex-1 border-2 border-dashed border-gray-300 rounded-lg p-6 flex flex-col items-center justify-center gap-4"
|
|
55
|
+
(dragFilesOver)="handleDragFilesOver($event)"
|
|
56
|
+
(dropFiles)="handleDropFiles($event)"
|
|
57
|
+
>
|
|
58
|
+
<div class="w-14 h-14 rounded-md bg-gray-200 grid">
|
|
59
|
+
<mat-icon
|
|
60
|
+
*ngIf="!dragFilesOver && !uploadProgress && !uploadError"
|
|
61
|
+
class="material-symbols-outlined place-self-center text-blue-500"
|
|
62
|
+
>image</mat-icon
|
|
63
|
+
>
|
|
64
|
+
<mat-icon
|
|
65
|
+
*ngIf="dragFilesOver && !uploadProgress && !uploadError"
|
|
66
|
+
class="material-symbols-outlined place-self-center text-blue-500"
|
|
67
|
+
>add_box</mat-icon
|
|
68
|
+
>
|
|
69
|
+
<div *ngIf="uploadProgress">
|
|
70
|
+
<mat-progress-spinner
|
|
71
|
+
class="place-self-center"
|
|
72
|
+
[diameter]="56"
|
|
73
|
+
[mode]="'determinate'"
|
|
74
|
+
[value]="uploadProgress"
|
|
75
|
+
></mat-progress-spinner>
|
|
76
|
+
<span
|
|
77
|
+
class="text-sm font-medium relative inline-block width-[30px] bottom-[40px] left-[15px]"
|
|
78
|
+
>
|
|
79
|
+
{{ uploadProgress }}%
|
|
80
|
+
</span>
|
|
81
|
+
</div>
|
|
82
|
+
<mat-icon
|
|
83
|
+
*ngIf="uploadError"
|
|
84
|
+
class="material-symbols-outlined place-self-center text-rose-500"
|
|
85
|
+
>broken_image</mat-icon
|
|
86
|
+
>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="flex flex-col items-center gap-1">
|
|
89
|
+
<p class="font-medium">{{ getPrimaryText() | translate }}</p>
|
|
90
|
+
<p
|
|
91
|
+
class="text-sm"
|
|
92
|
+
[class]="
|
|
93
|
+
uploadProgress || uploadError
|
|
94
|
+
? 'font-bold text-blue-500 cursor-pointer'
|
|
95
|
+
: 'font-medium text-gray-500'
|
|
96
|
+
"
|
|
97
|
+
(click)="handleSecondaryTextClick()"
|
|
98
|
+
>
|
|
99
|
+
{{ getSecondaryText() | translate }}
|
|
100
|
+
</p>
|
|
101
|
+
</div>
|
|
102
|
+
<input
|
|
103
|
+
type="file"
|
|
104
|
+
class="hidden"
|
|
105
|
+
(change)="handleFileInput($event)"
|
|
106
|
+
[disabled]="showUrlInput || uploadProgress || uploadError"
|
|
107
|
+
/>
|
|
108
|
+
</label>
|
|
109
|
+
<div *ngIf="!showUrlInput" class="flex-none">
|
|
110
|
+
<gn-ui-button
|
|
111
|
+
[extraClass]="'bg-gray-200 font-bold'"
|
|
112
|
+
(buttonClick)="displayUrlInput()"
|
|
113
|
+
>
|
|
114
|
+
<mat-icon class="material-symbols-outlined me-1">link</mat-icon>
|
|
115
|
+
{{ 'input.image.displayUrlInput' | translate }}
|
|
116
|
+
</gn-ui-button>
|
|
117
|
+
</div>
|
|
118
|
+
<div *ngIf="showUrlInput" class="flex-none flex flex-col gap-2">
|
|
119
|
+
<div class="h-2"></div>
|
|
120
|
+
<div class="flex gap-2 items-center">
|
|
121
|
+
<div class="flex-1 flex rounded-lg">
|
|
122
|
+
<span
|
|
123
|
+
class="material-symbols-outlined px-4 inline-flex items-center min-w-fit rounded-s-lg border-2 border-e-0 border-gray-300"
|
|
124
|
+
>link</span
|
|
125
|
+
>
|
|
126
|
+
<input
|
|
127
|
+
type="text"
|
|
128
|
+
class="py-3 ps-1 block w-full border-2 border-s-0 border-e-0 border-gray-300 text-sm font-medium"
|
|
129
|
+
placeholder="https://exemple.com/image.jpg"
|
|
130
|
+
(change)="handleUrlChange($event)"
|
|
131
|
+
/>
|
|
132
|
+
<gn-ui-button
|
|
133
|
+
class="px-1 inline-flex items-center min-w-fit rounded-e-lg border-2 border-s-0 border-gray-300 text-white"
|
|
134
|
+
[extraClass]="
|
|
135
|
+
urlInputValue && !downloadError ? 'bg-blue-500' : 'bg-gray-500'
|
|
136
|
+
"
|
|
137
|
+
[disabled]="!urlInputValue || downloadError"
|
|
138
|
+
(buttonClick)="downloadUrl()"
|
|
139
|
+
>
|
|
140
|
+
<mat-icon class="material-symbols-outlined">arrow_upward</mat-icon>
|
|
141
|
+
</gn-ui-button>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</ng-template>
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import { HttpClient } from '@angular/common/http'
|
|
3
|
+
import {
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
ChangeDetectorRef,
|
|
6
|
+
Component,
|
|
7
|
+
EventEmitter,
|
|
8
|
+
Input,
|
|
9
|
+
Output,
|
|
10
|
+
} from '@angular/core'
|
|
11
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
12
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'
|
|
13
|
+
import { downgradeImage, megabytesToBytes } from '../../../../../../libs/util/shared/src'
|
|
14
|
+
import { firstValueFrom } from 'rxjs'
|
|
15
|
+
import { ButtonComponent } from '../button/button.component'
|
|
16
|
+
import { FilesDropDirective } from '../files-drop/files-drop.directive'
|
|
17
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
18
|
+
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'gn-ui-image-input',
|
|
22
|
+
templateUrl: './image-input.component.html',
|
|
23
|
+
styleUrls: ['./image-input.component.css'],
|
|
24
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
|
+
standalone: true,
|
|
26
|
+
imports: [
|
|
27
|
+
CommonModule,
|
|
28
|
+
ButtonComponent,
|
|
29
|
+
MatIconModule,
|
|
30
|
+
FilesDropDirective,
|
|
31
|
+
MatProgressSpinnerModule,
|
|
32
|
+
TranslateModule,
|
|
33
|
+
],
|
|
34
|
+
})
|
|
35
|
+
export class ImageInputComponent {
|
|
36
|
+
@Input() maxSizeMB: number
|
|
37
|
+
@Input() previewUrl?: string
|
|
38
|
+
@Input() altText?: string
|
|
39
|
+
@Input() uploadProgress?: number
|
|
40
|
+
@Input() uploadError?: boolean
|
|
41
|
+
@Output() fileChange: EventEmitter<File> = new EventEmitter()
|
|
42
|
+
@Output() urlChange: EventEmitter<string> = new EventEmitter()
|
|
43
|
+
@Output() uploadCancel: EventEmitter<void> = new EventEmitter()
|
|
44
|
+
@Output() delete: EventEmitter<void> = new EventEmitter()
|
|
45
|
+
@Output() altTextChange: EventEmitter<string> = new EventEmitter()
|
|
46
|
+
|
|
47
|
+
dragFilesOver = false
|
|
48
|
+
showUrlInput = false
|
|
49
|
+
downloadError = false
|
|
50
|
+
showAltTextInput = false
|
|
51
|
+
|
|
52
|
+
urlInputValue?: string
|
|
53
|
+
lastUploadType?: 'file' | 'url'
|
|
54
|
+
lastUploadContent?: string | File
|
|
55
|
+
|
|
56
|
+
constructor(private http: HttpClient, private cd: ChangeDetectorRef) {}
|
|
57
|
+
|
|
58
|
+
getPrimaryText() {
|
|
59
|
+
if (this.uploadError) {
|
|
60
|
+
return marker('input.image.uploadErrorLabel')
|
|
61
|
+
}
|
|
62
|
+
if (this.uploadProgress) {
|
|
63
|
+
return marker('input.image.uploadProgressLabel')
|
|
64
|
+
}
|
|
65
|
+
return marker('input.image.selectFileLabel')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
getSecondaryText() {
|
|
69
|
+
if (this.uploadError) {
|
|
70
|
+
return marker('input.image.uploadErrorRetry')
|
|
71
|
+
}
|
|
72
|
+
if (this.uploadProgress) {
|
|
73
|
+
return marker('input.image.uploadProgressCancel')
|
|
74
|
+
}
|
|
75
|
+
return marker('input.image.dropFileLabel')
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
handleDragFilesOver(dragFilesOver: boolean) {
|
|
79
|
+
if (!this.showUrlInput) {
|
|
80
|
+
this.dragFilesOver = dragFilesOver
|
|
81
|
+
this.cd.markForCheck()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
handleDropFiles(files: File[]) {
|
|
86
|
+
if (!this.showUrlInput) {
|
|
87
|
+
const validFiles = this.filterTypeImage(files)
|
|
88
|
+
if (validFiles.length > 0) {
|
|
89
|
+
this.resizeAndEmit(validFiles[0])
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
handleFileInput(event: Event) {
|
|
95
|
+
const inputFiles = Array.from((event.target as HTMLInputElement).files)
|
|
96
|
+
const validFiles = this.filterTypeImage(inputFiles)
|
|
97
|
+
if (validFiles.length > 0) {
|
|
98
|
+
this.resizeAndEmit(validFiles[0])
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
displayUrlInput() {
|
|
103
|
+
this.uploadCancel.emit()
|
|
104
|
+
this.showUrlInput = true
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
handleUrlChange(event: Event) {
|
|
108
|
+
this.downloadError = false
|
|
109
|
+
this.urlInputValue = (event.target as HTMLInputElement).value
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async downloadUrl() {
|
|
113
|
+
const name = this.urlInputValue.split('/').pop()
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
const response = await firstValueFrom(
|
|
117
|
+
this.http.head(this.urlInputValue, { observe: 'response' })
|
|
118
|
+
)
|
|
119
|
+
if (
|
|
120
|
+
response.headers.get('content-type')?.startsWith('image/') &&
|
|
121
|
+
parseInt(response.headers.get('content-length')) <
|
|
122
|
+
megabytesToBytes(this.maxSizeMB)
|
|
123
|
+
) {
|
|
124
|
+
this.http.get(this.urlInputValue, { responseType: 'blob' }).subscribe({
|
|
125
|
+
next: (blob) => {
|
|
126
|
+
this.cd.markForCheck()
|
|
127
|
+
const file = new File([blob], name)
|
|
128
|
+
this.fileChange.emit(file)
|
|
129
|
+
},
|
|
130
|
+
error: () => {
|
|
131
|
+
this.downloadError = true
|
|
132
|
+
this.cd.markForCheck()
|
|
133
|
+
this.urlChange.emit(this.urlInputValue)
|
|
134
|
+
},
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
this.downloadError = true
|
|
139
|
+
this.cd.markForCheck()
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
handleSecondaryTextClick() {
|
|
145
|
+
if (this.uploadError) {
|
|
146
|
+
this.handleRetry()
|
|
147
|
+
} else if (this.uploadProgress) {
|
|
148
|
+
this.handleCancel()
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
handleCancel() {
|
|
153
|
+
this.uploadCancel.emit()
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
handleRetry() {
|
|
157
|
+
switch (this.lastUploadType) {
|
|
158
|
+
case 'file':
|
|
159
|
+
this.fileChange.emit(this.lastUploadContent as File)
|
|
160
|
+
break
|
|
161
|
+
case 'url':
|
|
162
|
+
this.urlChange.emit(this.lastUploadContent as string)
|
|
163
|
+
break
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
handleDelete() {
|
|
168
|
+
this.delete.emit()
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
toggleAltTextInput() {
|
|
172
|
+
this.showAltTextInput = !this.showAltTextInput
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
handleAltTextChange(event: Event) {
|
|
176
|
+
const input = event.target as HTMLInputElement
|
|
177
|
+
this.altTextChange.emit(input.value)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
private filterTypeImage(files: File[]) {
|
|
181
|
+
return files.filter((file) => {
|
|
182
|
+
return file.type.startsWith('image/')
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
private resizeAndEmit(imageToResize: File) {
|
|
187
|
+
const maxSizeBytes = megabytesToBytes(this.maxSizeMB)
|
|
188
|
+
downgradeImage(imageToResize, maxSizeBytes).then((resizedImage) => {
|
|
189
|
+
const fileToEmit = new File([resizedImage], imageToResize.name)
|
|
190
|
+
this.fileChange.emit(fileToEmit)
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -20,16 +20,6 @@ import { UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
|
|
|
20
20
|
import { OverlayModule } from '@angular/cdk/overlay'
|
|
21
21
|
import { MatCheckboxModule } from '@angular/material/checkbox'
|
|
22
22
|
import { ViewportIntersectorComponent } from './viewport-intersector/viewport-intersector.component'
|
|
23
|
-
import {
|
|
24
|
-
FormFieldArrayComponent,
|
|
25
|
-
FormFieldComponent,
|
|
26
|
-
FormFieldFileComponent,
|
|
27
|
-
FormFieldObjectComponent,
|
|
28
|
-
FormFieldRichComponent,
|
|
29
|
-
FormFieldSimpleComponent,
|
|
30
|
-
FormFieldSpatialExtentComponent,
|
|
31
|
-
FormFieldTemporalExtentComponent,
|
|
32
|
-
} from './form-field'
|
|
33
23
|
import { CheckToggleComponent } from './check-toggle/check-toggle.component'
|
|
34
24
|
import { CopyTextButtonComponent } from './copy-text-button/copy-text-button.component'
|
|
35
25
|
import { MatTooltipModule } from '@angular/material/tooltip'
|
|
@@ -42,6 +32,7 @@ import { MatInputModule } from '@angular/material/input'
|
|
|
42
32
|
import { MatDatepickerModule } from '@angular/material/datepicker'
|
|
43
33
|
import { MatNativeDateModule } from '@angular/material/core'
|
|
44
34
|
import { EditableLabelDirective } from './editable-label/editable-label.directive'
|
|
35
|
+
import { ImageInputComponent } from './image-input/image-input.component'
|
|
45
36
|
|
|
46
37
|
@NgModule({
|
|
47
38
|
declarations: [
|
|
@@ -54,14 +45,6 @@ import { EditableLabelDirective } from './editable-label/editable-label.directiv
|
|
|
54
45
|
StarToggleComponent,
|
|
55
46
|
DropdownMultiselectComponent,
|
|
56
47
|
ViewportIntersectorComponent,
|
|
57
|
-
FormFieldComponent,
|
|
58
|
-
FormFieldSimpleComponent,
|
|
59
|
-
FormFieldArrayComponent,
|
|
60
|
-
FormFieldObjectComponent,
|
|
61
|
-
FormFieldRichComponent,
|
|
62
|
-
FormFieldFileComponent,
|
|
63
|
-
FormFieldSpatialExtentComponent,
|
|
64
|
-
FormFieldTemporalExtentComponent,
|
|
65
48
|
CheckToggleComponent,
|
|
66
49
|
CopyTextButtonComponent,
|
|
67
50
|
CheckboxComponent,
|
|
@@ -89,6 +72,7 @@ import { EditableLabelDirective } from './editable-label/editable-label.directiv
|
|
|
89
72
|
EditableLabelDirective,
|
|
90
73
|
TextAreaComponent,
|
|
91
74
|
ButtonComponent,
|
|
75
|
+
ImageInputComponent,
|
|
92
76
|
],
|
|
93
77
|
exports: [
|
|
94
78
|
DropdownSelectorComponent,
|
|
@@ -102,13 +86,13 @@ import { EditableLabelDirective } from './editable-label/editable-label.directiv
|
|
|
102
86
|
StarToggleComponent,
|
|
103
87
|
DropdownMultiselectComponent,
|
|
104
88
|
ViewportIntersectorComponent,
|
|
105
|
-
FormFieldComponent,
|
|
106
89
|
CheckToggleComponent,
|
|
107
90
|
CopyTextButtonComponent,
|
|
108
91
|
CheckboxComponent,
|
|
109
92
|
SearchInputComponent,
|
|
110
93
|
DateRangePickerComponent,
|
|
111
94
|
EditableLabelDirective,
|
|
95
|
+
ImageInputComponent,
|
|
112
96
|
],
|
|
113
97
|
})
|
|
114
98
|
export class UiInputsModule {}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './lib/ui-layout.module'
|
|
2
1
|
export * from './lib/anchor-link/anchor-link.directive'
|
|
3
2
|
export * from './lib/carousel/carousel.component'
|
|
4
|
-
export * from './lib/expandable-panel/expandable-panel.component'
|
|
5
|
-
export * from './lib/sticky-header/sticky-header.component'
|
|
6
3
|
export * from './lib/expandable-panel-button/expandable-panel-button.component'
|
|
7
|
-
export * from './lib/
|
|
4
|
+
export * from './lib/expandable-panel/expandable-panel.component'
|
|
5
|
+
export * from './lib/form-field-wrapper/form-field-wrapper.component'
|
|
8
6
|
export * from './lib/interactive-table/interactive-table-column/interactive-table-column.component'
|
|
7
|
+
export * from './lib/interactive-table/interactive-table.component'
|
|
8
|
+
export * from './lib/sticky-header/sticky-header.component'
|
|
9
|
+
export * from './lib/ui-layout.module'
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="h-full flex flex-col">
|
|
2
|
+
<div class="flex-none w-full flex flex-row items-center">
|
|
3
|
+
<span class="flex-none font-bold">{{ label }}</span>
|
|
4
|
+
<div class="flex-1 flex justify-end items-center">
|
|
5
|
+
<ng-content select="[form-field-interaction]"></ng-content>
|
|
6
|
+
<span
|
|
7
|
+
class="material-symbols-outlined m-2 gn-ui-icon-small"
|
|
8
|
+
[matTooltip]="hint"
|
|
9
|
+
matTooltipPosition="above"
|
|
10
|
+
>
|
|
11
|
+
help
|
|
12
|
+
</span>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex-1">
|
|
16
|
+
<ng-content></ng-content>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
3
|
+
import { MatTooltipModule } from '@angular/material/tooltip'
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'gn-ui-form-field-wrapper',
|
|
7
|
+
templateUrl: './form-field-wrapper.component.html',
|
|
8
|
+
styleUrls: ['./form-field-wrapper.component.css'],
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [MatIconModule, MatTooltipModule],
|
|
12
|
+
})
|
|
13
|
+
export class FormFieldWrapperComponent {
|
|
14
|
+
@Input() label: string
|
|
15
|
+
@Input() hint: string
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export function downsizeImage(
|
|
2
|
+
blob: Blob,
|
|
3
|
+
maxWidth: number,
|
|
4
|
+
maxHeight: number
|
|
5
|
+
): Promise<Blob> {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const image = new Image()
|
|
8
|
+
image.src = URL.createObjectURL(blob)
|
|
9
|
+
image.onload = () => {
|
|
10
|
+
let width = image.width
|
|
11
|
+
let height = image.height
|
|
12
|
+
|
|
13
|
+
if (width > maxWidth || height > maxHeight) {
|
|
14
|
+
if (width > height) {
|
|
15
|
+
height = height * (maxWidth / width)
|
|
16
|
+
width = maxWidth
|
|
17
|
+
} else {
|
|
18
|
+
width = width * (maxHeight / height)
|
|
19
|
+
height = maxHeight
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const canvas = document.createElement('canvas')
|
|
24
|
+
canvas.width = width
|
|
25
|
+
canvas.height = height
|
|
26
|
+
|
|
27
|
+
const context = canvas.getContext('2d')
|
|
28
|
+
context.drawImage(image, 0, 0, width, height)
|
|
29
|
+
|
|
30
|
+
canvas.toBlob(resolve, blob.type)
|
|
31
|
+
}
|
|
32
|
+
image.onerror = reject
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function downgradeImage(
|
|
37
|
+
blob: Blob,
|
|
38
|
+
maxSizeBytes: number
|
|
39
|
+
): Promise<Blob> {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const image = new Image()
|
|
42
|
+
image.src = URL.createObjectURL(blob)
|
|
43
|
+
image.onload = () => {
|
|
44
|
+
const width = image.width
|
|
45
|
+
const height = image.height
|
|
46
|
+
let quality = 1.0
|
|
47
|
+
|
|
48
|
+
const canvas = document.createElement('canvas')
|
|
49
|
+
canvas.width = width
|
|
50
|
+
canvas.height = height
|
|
51
|
+
|
|
52
|
+
const context = canvas.getContext('2d')
|
|
53
|
+
context.drawImage(image, 0, 0, width, height)
|
|
54
|
+
|
|
55
|
+
const compressAndResolveBlob = (blobToCompress: Blob) => {
|
|
56
|
+
if (blobToCompress.size <= maxSizeBytes) {
|
|
57
|
+
resolve(blobToCompress)
|
|
58
|
+
} else {
|
|
59
|
+
quality -= 0.1
|
|
60
|
+
if (quality >= 0) {
|
|
61
|
+
canvas.toBlob(compressAndResolveBlob, blob.type, quality)
|
|
62
|
+
} else {
|
|
63
|
+
reject('Unable to compress image below max size')
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
canvas.toBlob(compressAndResolveBlob, blob.type, quality)
|
|
69
|
+
}
|
|
70
|
+
image.onerror = reject
|
|
71
|
+
})
|
|
72
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
export * from './bytes-convert'
|
|
2
|
+
export * from './event'
|
|
3
|
+
export * from './fuzzy-filter'
|
|
4
|
+
export * from './geojson'
|
|
5
|
+
export * from './image-resize'
|
|
1
6
|
export * from './parse'
|
|
2
|
-
export * from './strip-html'
|
|
3
7
|
export * from './remove-whitespace'
|
|
4
|
-
export * from './geojson'
|
|
5
8
|
export * from './sort-by'
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './event'
|
|
8
|
-
export * from './fuzzy-filter'
|
|
9
|
+
export * from './strip-html'
|
|
9
10
|
export * from './temporal-extent-union'
|
|
11
|
+
export * from './url'
|
package/tailwind.base.css
CHANGED
|
@@ -9,6 +9,42 @@
|
|
|
9
9
|
@apply shadow-xl hover:shadow-xl-hover transition-shadow;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* ICON CLASSES */
|
|
13
|
+
.gn-ui-icon-small {
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
width: 16px;
|
|
16
|
+
height: 16px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* LINK CLASSES */
|
|
20
|
+
.gn-ui-link {
|
|
21
|
+
@apply text-blue-600 hover:text-blue-700 hover:underline;
|
|
22
|
+
text-underline-offset: 0.2em;
|
|
23
|
+
text-decoration-thickness: 1px;
|
|
24
|
+
}
|
|
25
|
+
.gn-ui-link-external-icon {
|
|
26
|
+
content: 'open_in_new';
|
|
27
|
+
font-family: 'Material Symbols Outlined';
|
|
28
|
+
font-size: 0.9em;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
vertical-align: top;
|
|
31
|
+
padding-top: 0.1em;
|
|
32
|
+
}
|
|
33
|
+
.gn-ui-link-external {
|
|
34
|
+
@apply gn-ui-link;
|
|
35
|
+
}
|
|
36
|
+
.gn-ui-link-external::before {
|
|
37
|
+
@apply gn-ui-link-external-icon;
|
|
38
|
+
padding-right: 0.2em;
|
|
39
|
+
}
|
|
40
|
+
.gn-ui-link-external-after {
|
|
41
|
+
@apply gn-ui-link;
|
|
42
|
+
}
|
|
43
|
+
.gn-ui-link-external-after::after {
|
|
44
|
+
@apply gn-ui-link-external-icon;
|
|
45
|
+
padding-left: 0.2em;
|
|
46
|
+
}
|
|
47
|
+
|
|
12
48
|
/* BUTTON CLASSES */
|
|
13
49
|
/* these are used behind the scenes by the `gn-ui-button` component */
|
|
14
50
|
|
package/translations/de.json
CHANGED
|
@@ -144,7 +144,15 @@
|
|
|
144
144
|
"downloads.format.unknown": "unbekannt",
|
|
145
145
|
"downloads.wfs.featuretype.not.found": "Der Layer wurde nicht gefunden",
|
|
146
146
|
"dropFile": "Datei ablegen",
|
|
147
|
+
"editor.record.loadError.body": "",
|
|
148
|
+
"editor.record.loadError.closeMessage": "",
|
|
149
|
+
"editor.record.loadError.title": "",
|
|
147
150
|
"editor.record.publish": "",
|
|
151
|
+
"editor.record.publishError.body": "",
|
|
152
|
+
"editor.record.publishError.closeMessage": "",
|
|
153
|
+
"editor.record.publishError.title": "",
|
|
154
|
+
"editor.record.publishSuccess.body": "",
|
|
155
|
+
"editor.record.publishSuccess.title": "",
|
|
148
156
|
"editor.record.upToDate": "",
|
|
149
157
|
"externalviewer.dataset.unnamed": "Datensatz aus dem Datahub",
|
|
150
158
|
"facets.block.title.OrgForResource": "Organisation",
|
|
@@ -159,6 +167,16 @@
|
|
|
159
167
|
"facets.block.title.tag.default": "Stichwort",
|
|
160
168
|
"facets.block.title.th_regions_tree.default": "Regionen",
|
|
161
169
|
"favorite.not.authenticated.tooltip": "<div><a href=' {link} '>Anmelden</a>, um auf diese Funktion zuzugreifen</div>",
|
|
170
|
+
"input.image.altTextPlaceholder": "",
|
|
171
|
+
"input.image.delete": "",
|
|
172
|
+
"input.image.displayAltTextInput": "",
|
|
173
|
+
"input.image.displayUrlInput": "",
|
|
174
|
+
"input.image.dropFileLabel": "",
|
|
175
|
+
"input.image.selectFileLabel": "",
|
|
176
|
+
"input.image.uploadErrorLabel": "",
|
|
177
|
+
"input.image.uploadErrorRetry": "",
|
|
178
|
+
"input.image.uploadProgressCancel": "",
|
|
179
|
+
"input.image.uploadProgressLabel": "",
|
|
162
180
|
"language.ca": "Katalanisch",
|
|
163
181
|
"language.cs": "Tschechisch",
|
|
164
182
|
"language.de": "Deutsch",
|