@yuuvis/client-framework 2.0.0-beta.0 → 2.0.0-beta.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/actions/lib/actions/delete-action/delete/delete.component.d.ts +3 -3
- package/actions/lib/actions/delete-action/delete-action.d.ts +1 -1
- package/actions/lib/actions.service.d.ts +7 -3
- package/actions/lib/components/contextmenu/contextmenu.component.d.ts +3 -1
- package/autocomplete/README.md +3 -0
- package/autocomplete/index.d.ts +3 -0
- package/autocomplete/lib/autocomplete.component.d.ts +72 -0
- package/autocomplete/lib/autocomplete.interface.d.ts +4 -0
- package/autocomplete/lib/autocomplete.module.d.ts +7 -0
- package/common/index.d.ts +4 -4
- package/common/lib/common.module.d.ts +19 -0
- package/common/lib/common.utils.d.ts +2 -0
- package/common/lib/components/confirm/confirm.component.d.ts +7 -0
- package/common/lib/components/confirm/confirm.interface.d.ts +7 -0
- package/common/lib/components/confirm/confirm.service.d.ts +9 -0
- package/common/lib/components/dialog/dialog.component.d.ts +6 -0
- package/common/lib/components/dialog/dialog.options.d.ts +7 -0
- package/common/lib/components/index.d.ts +5 -0
- package/common/lib/directives/autofocus-child.directive.d.ts +13 -0
- package/common/lib/directives/autofocus-delayed.directive.d.ts +18 -0
- package/common/lib/directives/drag-scroll.directive.d.ts +20 -0
- package/common/lib/directives/index.d.ts +8 -4
- package/common/lib/directives/noop-value-accessor.directive.d.ts +2 -2
- package/common/lib/mat-form-field.abstract.d.ts +41 -0
- package/common/lib/services/index.d.ts +1 -1
- package/common/lib/services/layout-settings/layout-settings.service.d.ts +18 -0
- package/datepicker/README.md +3 -0
- package/datepicker/index.d.ts +5 -0
- package/datepicker/lib/calendar/calendar.component.d.ts +72 -0
- package/datepicker/lib/date-input/date-input-element/date-input-element.component.d.ts +43 -0
- package/datepicker/lib/date-input/date-input-hour-element/date-input-hour-element.component.d.ts +11 -0
- package/datepicker/lib/date-input/date-input.component.d.ts +61 -0
- package/datepicker/lib/datepicker-calendar/datepicker-calendar-trigger.component.d.ts +7 -0
- package/datepicker/lib/datepicker-calendar/datepicker-calendar.component.d.ts +12 -0
- package/datepicker/lib/datepicker.component.d.ts +80 -0
- package/datepicker/lib/datepicker.interface.d.ts +34 -0
- package/datepicker/lib/datepicker.module.d.ts +9 -0
- package/datepicker/lib/datepicker.service.d.ts +46 -0
- package/datepicker/lib/datepicker.utils.d.ts +23 -0
- package/datepicker/lib/time-input/time-input.component.d.ts +36 -0
- package/datepicker/lib/time-input/time-input.interface.d.ts +6 -0
- package/fesm2022/yuuvis-client-framework-actions.mjs +147 -105
- package/fesm2022/yuuvis-client-framework-actions.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-app-bar.mjs +7 -8
- package/fesm2022/yuuvis-client-framework-app-bar.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-autocomplete.mjs +210 -0
- package/fesm2022/yuuvis-client-framework-autocomplete.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-clipboard.mjs +9 -9
- package/fesm2022/yuuvis-client-framework-clipboard.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-common.mjs +853 -780
- package/fesm2022/yuuvis-client-framework-common.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-datepicker.mjs +1688 -0
- package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-forms.mjs +945 -1157
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-icons.mjs +85 -12
- package/fesm2022/yuuvis-client-framework-icons.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-list.mjs +81 -45
- package/fesm2022/yuuvis-client-framework-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-master-details.mjs +112 -0
- package/fesm2022/yuuvis-client-framework-master-details.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +60 -0
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs +125 -100
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs +49 -59
- package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs +188 -77
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-form.mjs +99 -184
- package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-preview.mjs +11 -11
- package/fesm2022/yuuvis-client-framework-object-preview.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-summary.mjs +46 -42
- package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-overflow-menu.mjs +126 -0
- package/fesm2022/yuuvis-client-framework-overflow-menu.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-pagination.mjs +7 -9
- package/fesm2022/yuuvis-client-framework-pagination.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-panel.mjs +8 -7
- package/fesm2022/yuuvis-client-framework-panel.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-popout.mjs +212 -0
- package/fesm2022/yuuvis-client-framework-popout.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-renderer.mjs +99 -72
- package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-sequence-list.mjs +29 -112
- package/fesm2022/yuuvis-client-framework-sequence-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-simple-search.mjs +40 -21
- package/fesm2022/yuuvis-client-framework-simple-search.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-split-view.mjs +188 -0
- package/fesm2022/yuuvis-client-framework-split-view.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-tile-list.mjs +100 -93
- package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-tree.mjs +15 -15
- package/fesm2022/yuuvis-client-framework-tree.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-upload-progress.mjs +16 -21
- package/fesm2022/yuuvis-client-framework-upload-progress.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework.mjs +4 -4
- package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
- package/forms/index.d.ts +7 -1
- package/forms/lib/elements/catalog/catalog.component.d.ts +17 -56
- package/forms/lib/elements/data-grid/edit-table-data/edit-data.component.d.ts +5 -4
- package/forms/lib/elements/datetime/datetime.component.d.ts +19 -10
- package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +12 -27
- package/forms/lib/elements/index.d.ts +0 -1
- package/forms/lib/elements/number/number.component.d.ts +21 -30
- package/forms/lib/elements/number-range/number-range.component.d.ts +12 -7
- package/forms/lib/elements/organization/organization.component.d.ts +23 -51
- package/forms/lib/elements/range-select-date/range-select-date.component.d.ts +12 -7
- package/forms/lib/elements/range-select-filesize/range-select-filesize.component.d.ts +12 -7
- package/forms/lib/elements/string/string.component.d.ts +15 -20
- package/forms/lib/forms.module.d.ts +8 -11
- package/icons/index.d.ts +1 -0
- package/icons/lib/icon.component.d.ts +20 -0
- package/lib/assets/i18n/de.json +7 -23
- package/lib/assets/i18n/en.json +10 -26
- package/list/index.d.ts +1 -0
- package/list/lib/list-item.directive.d.ts +5 -4
- package/list/lib/list.component.d.ts +6 -3
- package/list/lib/list.module.d.ts +8 -0
- package/master-details/README.md +3 -0
- package/master-details/index.d.ts +2 -0
- package/master-details/lib/master-details.component.d.ts +58 -0
- package/master-details/lib/master-details.interface.d.ts +7 -0
- package/master-details/lib/master-details.module.d.ts +7 -0
- package/metadata-form/index.d.ts +4 -1
- package/metadata-form/lib/metadata-form-field/metadata-form-field.component.d.ts +4 -17
- package/metadata-form/lib/metadata-form-field/metadata-form-field.interface.d.ts +11 -0
- package/metadata-form/lib/object-metadata-element-error.directive.d.ts +13 -0
- package/metadata-form/lib/object-metadata-element-label.directive.d.ts +10 -0
- package/metadata-form/lib/object-metadata-element-template.directive.d.ts +3 -3
- package/metadata-form-defaults/README.md +3 -0
- package/metadata-form-defaults/index.d.ts +2 -0
- package/metadata-form-defaults/lib/metadata-form-defaults.module.d.ts +7 -0
- package/object-details/lib/object-audit/object-audit.component.d.ts +3 -9
- package/object-details/lib/object-details.component.d.ts +0 -2
- package/object-details/lib/object-metadata/object-metadata.component.d.ts +4 -3
- package/object-details/lib/retention-badge/retention-badge.component.d.ts +0 -3
- package/object-flavor/index.d.ts +1 -0
- package/object-flavor/lib/abstract-apply-create-flavor/abstract-apply-create-flavor.component.d.ts +1 -2
- package/object-flavor/lib/abstract-apply-object-flavor/abstract-apply-object-flavor.component.d.ts +3 -2
- package/object-flavor/lib/default-apply-flavor/default-apply-flavor.component.d.ts +19 -0
- package/object-flavor/lib/flavor-chip/flavor-chip.component.d.ts +1 -1
- package/object-flavor/lib/object-flavor/object-flavor.component.d.ts +3 -6
- package/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.d.ts +0 -1
- package/object-form/index.d.ts +1 -1
- package/object-form/lib/object-form-element/object-form-element.component.d.ts +2 -2
- package/object-form/lib/object-form-group/object-form-group.component.d.ts +1 -3
- package/object-form/lib/object-form.component.d.ts +2 -2
- package/object-form/lib/object-form.interface.d.ts +0 -44
- package/object-form/lib/object-form.module.d.ts +7 -0
- package/object-form/lib/object-form.service.d.ts +1 -2
- package/object-form/lib/object-form.utils.d.ts +1 -1
- package/object-summary/lib/object-summary/object-summary.component.d.ts +13 -15
- package/overflow-menu/README.md +3 -0
- package/overflow-menu/index.d.ts +3 -0
- package/overflow-menu/lib/overflow-menu.component.d.ts +31 -0
- package/overflow-menu/lib/overflow-menu.interface.d.ts +9 -0
- package/overflow-menu/lib/overflow-menu.module.d.ts +7 -0
- package/package.json +43 -69
- package/popout/README.md +3 -0
- package/popout/index.d.ts +3 -0
- package/popout/lib/popout.component.d.ts +58 -0
- package/popout/lib/popout.interface.d.ts +17 -0
- package/popout/lib/popout.module.d.ts +7 -0
- package/renderer/lib/property-renderer/abstract.renderer.d.ts +4 -4
- package/renderer/lib/property-renderer/icon.renderer.component.d.ts +2 -0
- package/renderer/lib/renderer.directive.d.ts +4 -3
- package/sequence-list/index.d.ts +0 -1
- package/sequence-list/lib/sequence-list.component.d.ts +0 -4
- package/simple-search/index.d.ts +0 -1
- package/simple-search/lib/simple-search/simple-search.component.d.ts +6 -10
- package/split-view/README.md +3 -0
- package/split-view/index.d.ts +4 -0
- package/split-view/lib/split-area.directive.d.ts +16 -0
- package/split-view/lib/split-view.component.d.ts +76 -0
- package/split-view/lib/split-view.interface.d.ts +10 -0
- package/split-view/lib/split-view.module.d.ts +8 -0
- package/styles/client-framework.scss +21 -67
- package/tile-list/lib/tile/tile.component.d.ts +1 -2
- package/tile-list/lib/tile-config/property-select/property-select.component.d.ts +0 -1
- package/tile-list/lib/tile-config/tile-config-trigger/tile-config-trigger.component.d.ts +1 -2
- package/tile-list/lib/tile-config/tile-config.component.d.ts +0 -3
- package/tile-list/lib/tile-list/tile-list.component.d.ts +5 -5
- package/upload-progress/lib/upload-progress/upload-progress-overlay/upload-progress-overlay.component.d.ts +0 -5
- package/upload-progress/lib/upload-progress/upload-progress.component.d.ts +0 -4
- package/common/lib/components/focus-indicator/focus-indicator.component.d.ts +0 -7
- package/common/lib/components/token-input/token-input.component.d.ts +0 -55
- package/common/lib/components/token-input/token-input.interface.d.ts +0 -8
- package/common/lib/services/error-messages/error-messages.service.d.ts +0 -7
- package/esm2022/actions/index.mjs +0 -7
- package/esm2022/actions/lib/actions/copy-action/copy-action.mjs +0 -31
- package/esm2022/actions/lib/actions/cut-action/cut-action.mjs +0 -30
- package/esm2022/actions/lib/actions/delete-action/delete/delete.component.mjs +0 -67
- package/esm2022/actions/lib/actions/delete-action/delete-action.mjs +0 -38
- package/esm2022/actions/lib/actions/download-action/download-action.mjs +0 -33
- package/esm2022/actions/lib/actions.icon.mjs +0 -8
- package/esm2022/actions/lib/actions.interface.mjs +0 -19
- package/esm2022/actions/lib/actions.module.mjs +0 -16
- package/esm2022/actions/lib/actions.service.mjs +0 -89
- package/esm2022/actions/lib/components/contextmenu/contextmenu.component.mjs +0 -27
- package/esm2022/actions/yuuvis-client-framework-actions.mjs +0 -5
- package/esm2022/app-bar/index.mjs +0 -2
- package/esm2022/app-bar/lib/app-bar.component.mjs +0 -89
- package/esm2022/app-bar/yuuvis-client-framework-app-bar.mjs +0 -5
- package/esm2022/clipboard/index.mjs +0 -2
- package/esm2022/clipboard/lib/clipboard.component.mjs +0 -48
- package/esm2022/clipboard/yuuvis-client-framework-clipboard.mjs +0 -5
- package/esm2022/common/index.mjs +0 -7
- package/esm2022/common/lib/components/focus-indicator/focus-indicator.component.mjs +0 -41
- package/esm2022/common/lib/components/token-input/token-input.component.mjs +0 -324
- package/esm2022/common/lib/components/token-input/token-input.interface.mjs +0 -2
- package/esm2022/common/lib/directives/busy-overlay.directive.mjs +0 -88
- package/esm2022/common/lib/directives/click-double.directive.mjs +0 -61
- package/esm2022/common/lib/directives/container-size.directive.mjs +0 -56
- package/esm2022/common/lib/directives/drag-select.directive.mjs +0 -114
- package/esm2022/common/lib/directives/file-drop-zone/file-drop-zone.directive.mjs +0 -153
- package/esm2022/common/lib/directives/file-drop-zone/file-drop-zone.interface.mjs +0 -2
- package/esm2022/common/lib/directives/focus-within.directive.mjs +0 -81
- package/esm2022/common/lib/directives/index.mjs +0 -9
- package/esm2022/common/lib/directives/light-dismiss.directive.mjs +0 -44
- package/esm2022/common/lib/directives/longpress.directive.mjs +0 -36
- package/esm2022/common/lib/directives/noop-value-accessor.directive.mjs +0 -42
- package/esm2022/common/lib/services/error-messages/error-messages.service.mjs +0 -68
- package/esm2022/common/lib/services/index.mjs +0 -2
- package/esm2022/common/yuuvis-client-framework-common.mjs +0 -5
- package/esm2022/forms/index.mjs +0 -24
- package/esm2022/forms/lib/elements/catalog/catalog.component.mjs +0 -118
- package/esm2022/forms/lib/elements/data-grid/data-grid/data-grid.component.mjs +0 -172
- package/esm2022/forms/lib/elements/data-grid/edit-table-data/edit-data.component.mjs +0 -95
- package/esm2022/forms/lib/elements/data-grid/model/data-grid.interface.mjs +0 -9
- package/esm2022/forms/lib/elements/datetime/datetime.component.mjs +0 -82
- package/esm2022/forms/lib/elements/datetime-range/datetime-range.component.mjs +0 -166
- package/esm2022/forms/lib/elements/index.mjs +0 -11
- package/esm2022/forms/lib/elements/number/number.component.mjs +0 -195
- package/esm2022/forms/lib/elements/number-range/number-range.component.mjs +0 -176
- package/esm2022/forms/lib/elements/organization/organization.component.mjs +0 -286
- package/esm2022/forms/lib/elements/range-select-date/date-range-picker/date-range-picker.component.mjs +0 -38
- package/esm2022/forms/lib/elements/range-select-date/range-select-date.component.mjs +0 -181
- package/esm2022/forms/lib/elements/range-select-date/range-select-date.interface.mjs +0 -2
- package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.component.mjs +0 -98
- package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.interface.mjs +0 -2
- package/esm2022/forms/lib/elements/string/string.component.mjs +0 -261
- package/esm2022/forms/lib/form-input/form-input.component.mjs +0 -88
- package/esm2022/forms/lib/forms.module.mjs +0 -58
- package/esm2022/forms/yuuvis-client-framework-forms.mjs +0 -5
- package/esm2022/icons/index.mjs +0 -4
- package/esm2022/icons/lib/icon.service.mjs +0 -59
- package/esm2022/icons/lib/icons.mjs +0 -32
- package/esm2022/icons/lib/object-type-icon/object-type-icon.component.mjs +0 -29
- package/esm2022/icons/yuuvis-client-framework-icons.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/lib/yuuvis-client-framework.module.mjs +0 -15
- package/esm2022/list/index.mjs +0 -3
- package/esm2022/list/lib/list-item.directive.mjs +0 -72
- package/esm2022/list/lib/list.component.mjs +0 -135
- package/esm2022/list/yuuvis-client-framework-list.mjs +0 -5
- package/esm2022/metadata-form/index.mjs +0 -4
- package/esm2022/metadata-form/lib/metadata-default-templates/metadata-default-templates.component.mjs +0 -32
- package/esm2022/metadata-form/lib/metadata-form-element-registry.service.mjs +0 -99
- package/esm2022/metadata-form/lib/metadata-form-field/metadata-form-field.component.mjs +0 -83
- package/esm2022/metadata-form/lib/object-metadata-element-template.directive.mjs +0 -52
- package/esm2022/metadata-form/yuuvis-client-framework-metadata-form.mjs +0 -5
- package/esm2022/object-details/index.mjs +0 -8
- package/esm2022/object-details/lib/object-audit/object-audit.component.mjs +0 -195
- package/esm2022/object-details/lib/object-details-shell/object-details-shell.component.mjs +0 -127
- package/esm2022/object-details/lib/object-details.component.mjs +0 -61
- package/esm2022/object-details/lib/object-metadata/form-section-group.pipe.mjs +0 -17
- package/esm2022/object-details/lib/object-metadata/object-metadata.component.mjs +0 -202
- package/esm2022/object-details/lib/object-metadata/object-metadata.interface.mjs +0 -2
- package/esm2022/object-details/lib/retention-badge/retention-badge.component.mjs +0 -27
- package/esm2022/object-details/yuuvis-client-framework-object-details.mjs +0 -5
- package/esm2022/object-flavor/index.mjs +0 -6
- package/esm2022/object-flavor/lib/abstract-apply-create-flavor/abstract-apply-create-flavor.component.mjs +0 -25
- package/esm2022/object-flavor/lib/abstract-apply-object-flavor/abstract-apply-object-flavor.component.mjs +0 -21
- package/esm2022/object-flavor/lib/flavor-chip/flavor-chip.component.mjs +0 -35
- package/esm2022/object-flavor/lib/object-flavor/object-flavor.component.mjs +0 -93
- package/esm2022/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.mjs +0 -43
- package/esm2022/object-flavor/yuuvis-client-framework-object-flavor.mjs +0 -5
- package/esm2022/object-form/index.mjs +0 -5
- package/esm2022/object-form/lib/form-scripting.api.interface.mjs +0 -2
- package/esm2022/object-form/lib/form-scripting.service.mjs +0 -160
- package/esm2022/object-form/lib/object-form-element/object-form-element.component.mjs +0 -87
- package/esm2022/object-form/lib/object-form-extension.interface.mjs +0 -36
- package/esm2022/object-form/lib/object-form-group/object-form-group.component.mjs +0 -85
- package/esm2022/object-form/lib/object-form-script/form-scripting-element-extension/form-scripting-element-extension.component.mjs +0 -23
- package/esm2022/object-form/lib/object-form-script/object-form-script.service.mjs +0 -115
- package/esm2022/object-form/lib/object-form-script/object-form-scripting-scope.mjs +0 -251
- package/esm2022/object-form/lib/object-form-translate.service.mjs +0 -73
- package/esm2022/object-form/lib/object-form.component.mjs +0 -628
- package/esm2022/object-form/lib/object-form.interface.mjs +0 -9
- package/esm2022/object-form/lib/object-form.model.mjs +0 -20
- package/esm2022/object-form/lib/object-form.service.mjs +0 -130
- package/esm2022/object-form/lib/object-form.utils.mjs +0 -55
- package/esm2022/object-form/lib/object-form.validation.mjs +0 -48
- package/esm2022/object-form/yuuvis-client-framework-object-form.mjs +0 -5
- package/esm2022/object-preview/index.mjs +0 -3
- package/esm2022/object-preview/lib/components/index.mjs +0 -3
- package/esm2022/object-preview/lib/components/object-email-preview/object-email-preview.component.mjs +0 -45
- package/esm2022/object-preview/lib/components/object-preview/object-preview.component.mjs +0 -78
- package/esm2022/object-preview/lib/services/object-preview.service.mjs +0 -119
- package/esm2022/object-preview/yuuvis-client-framework-object-preview.mjs +0 -5
- package/esm2022/object-summary/index.mjs +0 -5
- package/esm2022/object-summary/lib/multi-object-summary/multi-object-summary.component.mjs +0 -33
- package/esm2022/object-summary/lib/object-summary/object-summary.component.mjs +0 -275
- package/esm2022/object-summary/lib/object-summary-data/object-summary-data.component.mjs +0 -80
- package/esm2022/object-summary/lib/object-summary.module.mjs +0 -15
- package/esm2022/object-summary/yuuvis-client-framework-object-summary.mjs +0 -5
- package/esm2022/pagination/index.mjs +0 -3
- package/esm2022/pagination/lib/pagination.component.mjs +0 -46
- package/esm2022/pagination/lib/pagination.interface.mjs +0 -2
- package/esm2022/pagination/yuuvis-client-framework-pagination.mjs +0 -5
- package/esm2022/panel/index.mjs +0 -2
- package/esm2022/panel/lib/panel.component.mjs +0 -20
- package/esm2022/panel/yuuvis-client-framework-panel.mjs +0 -5
- package/esm2022/renderer/index.mjs +0 -11
- package/esm2022/renderer/lib/property-renderer/abstract.renderer.mjs +0 -29
- package/esm2022/renderer/lib/property-renderer/datetime.renderer.mjs +0 -13
- package/esm2022/renderer/lib/property-renderer/decimal.renderer.component.mjs +0 -12
- package/esm2022/renderer/lib/property-renderer/filesize.renderer.component.mjs +0 -28
- package/esm2022/renderer/lib/property-renderer/icon.renderer.component.mjs +0 -23
- package/esm2022/renderer/lib/property-renderer/integer.renderer.component.mjs +0 -12
- package/esm2022/renderer/lib/property-renderer/organization.renderer.mjs +0 -19
- package/esm2022/renderer/lib/property-renderer/string.renderer.component.mjs +0 -12
- package/esm2022/renderer/lib/property-renderer/unknown.renderer.mjs +0 -12
- package/esm2022/renderer/lib/renderer.directive.mjs +0 -51
- package/esm2022/renderer/lib/services/renderer/renderer.interface.mjs +0 -2
- package/esm2022/renderer/lib/services/renderer/renderer.service.mjs +0 -84
- package/esm2022/renderer/yuuvis-client-framework-renderer.mjs +0 -5
- package/esm2022/sequence-list/index.mjs +0 -4
- package/esm2022/sequence-list/lib/due-date-picker/due-date-picker.component.mjs +0 -99
- package/esm2022/sequence-list/lib/sequence-list.component.mjs +0 -141
- package/esm2022/sequence-list/lib/sequence-list.interface.mjs +0 -2
- package/esm2022/sequence-list/yuuvis-client-framework-sequence-list.mjs +0 -5
- package/esm2022/simple-search/index.mjs +0 -3
- package/esm2022/simple-search/lib/simple-search/simple-search.component.mjs +0 -111
- package/esm2022/simple-search/lib/simple-search/simple-search.interface.mjs +0 -2
- package/esm2022/simple-search/yuuvis-client-framework-simple-search.mjs +0 -5
- package/esm2022/tile-list/index.mjs +0 -11
- package/esm2022/tile-list/lib/tile/tile.component.mjs +0 -53
- package/esm2022/tile-list/lib/tile-config/action-select/action-select.component.mjs +0 -25
- package/esm2022/tile-list/lib/tile-config/icon-select/icon-select.component.mjs +0 -33
- package/esm2022/tile-list/lib/tile-config/property-select/property-select.component.mjs +0 -91
- package/esm2022/tile-list/lib/tile-config/tile-config-tile/tile-config-tile.component.mjs +0 -66
- package/esm2022/tile-list/lib/tile-config/tile-config-trigger/tile-config-trigger.component.mjs +0 -46
- package/esm2022/tile-list/lib/tile-config/tile-config.component.mjs +0 -156
- package/esm2022/tile-list/lib/tile-extension/directive/tile-extension.directive.mjs +0 -37
- package/esm2022/tile-list/lib/tile-extension/extensions/email.extension.mjs +0 -42
- package/esm2022/tile-list/lib/tile-extension/tile-extension.service.mjs +0 -35
- package/esm2022/tile-list/lib/tile-list/tile-list.component.mjs +0 -510
- package/esm2022/tile-list/lib/tile-list/tile-list.interface.mjs +0 -2
- package/esm2022/tile-list/yuuvis-client-framework-tile-list.mjs +0 -5
- package/esm2022/token-search/index.mjs +0 -3
- package/esm2022/token-search/token-search.component.mjs +0 -78
- package/esm2022/token-search/token-search.interface.mjs +0 -2
- package/esm2022/token-search/yuuvis-client-framework-token-search.mjs +0 -5
- package/esm2022/tree/index.mjs +0 -3
- package/esm2022/tree/lib/tree-node/tree-node.component.mjs +0 -65
- package/esm2022/tree/lib/tree.component.mjs +0 -148
- package/esm2022/tree/lib/tree.interface.mjs +0 -2
- package/esm2022/tree/lib/tree.service.mjs +0 -95
- package/esm2022/tree/yuuvis-client-framework-tree.mjs +0 -5
- package/esm2022/upload-progress/index.mjs +0 -2
- package/esm2022/upload-progress/lib/upload-progress/upload-progress-overlay/upload-progress-overlay.component.mjs +0 -49
- package/esm2022/upload-progress/lib/upload-progress/upload-progress.component.mjs +0 -37
- package/esm2022/upload-progress/yuuvis-client-framework-upload-progress.mjs +0 -5
- package/esm2022/user-avatar/index.mjs +0 -3
- package/esm2022/user-avatar/lib/user-avatar.component.mjs +0 -69
- package/esm2022/user-avatar/lib/user-avatar.module.mjs +0 -24
- package/esm2022/user-avatar/yuuvis-client-framework-user-avatar.mjs +0 -5
- package/esm2022/yuuvis-client-framework.mjs +0 -5
- package/fesm2022/yuuvis-client-framework-token-search.mjs +0 -85
- package/fesm2022/yuuvis-client-framework-token-search.mjs.map +0 -1
- package/fesm2022/yuuvis-client-framework-user-avatar.mjs +0 -96
- package/fesm2022/yuuvis-client-framework-user-avatar.mjs.map +0 -1
- package/forms/lib/form-input/form-input.component.d.ts +0 -48
- package/object-form/lib/object-form-translate.service.d.ts +0 -15
- package/object-form/lib/object-form.model.d.ts +0 -18
- package/sequence-list/lib/due-date-picker/due-date-picker.component.d.ts +0 -28
- package/simple-search/lib/simple-search/simple-search.interface.d.ts +0 -4
- package/token-search/README.md +0 -3
- package/token-search/index.d.ts +0 -2
- package/token-search/token-search.component.d.ts +0 -22
- package/token-search/token-search.interface.d.ts +0 -4
- package/user-avatar/README.md +0 -3
- package/user-avatar/index.d.ts +0 -2
- package/user-avatar/lib/user-avatar.component.d.ts +0 -44
- package/user-avatar/lib/user-avatar.module.d.ts +0 -8
- /package/{metadata-form → metadata-form-defaults}/lib/metadata-default-templates/metadata-default-templates.component.d.ts +0 -0
|
@@ -1,15 +1,143 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component, inject, ElementRef, Input, Directive, computed, EnvironmentInjector, ApplicationRef, createComponent, HostBinding, EventEmitter, HostListener, Output, NgZone, output, contentChildren, forwardRef, NgModule, Injectable, signal } from '@angular/core';
|
|
3
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
4
|
+
import * as i1 from '@angular/material/button';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import * as i2 from '@angular/material/dialog';
|
|
7
|
+
import { MatDialogActions, MatDialogTitle, MatDialogContent, MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
8
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
9
|
+
import { Utils } from '@yuuvis/client-core';
|
|
10
|
+
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
4
11
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { Subject, fromEvent, merge, timer, of
|
|
6
|
-
import { debounceTime, filter, map,
|
|
7
|
-
import * as i1 from '@angular/common';
|
|
8
|
-
import { CommonModule } from '@angular/common';
|
|
9
|
-
import { YvcOverlayService } from '@yuuvis/components/overlay';
|
|
10
|
-
import * as i2 from '@yuuvis/components/autocomplete';
|
|
11
|
-
import { YvcAutocompleteModule } from '@yuuvis/components/autocomplete';
|
|
12
|
+
import { Subject, fromEvent, merge, timer, of } from 'rxjs';
|
|
13
|
+
import { debounceTime, tap, filter, switchMap, map, takeUntil } from 'rxjs/operators';
|
|
12
14
|
import { NG_VALUE_ACCESSOR, NgControl, FormControlDirective, FormControlName, NgModel } from '@angular/forms';
|
|
15
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
16
|
+
|
|
17
|
+
class DialogComponent {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.headertitel = input(null);
|
|
20
|
+
}
|
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: DialogComponent, isStandalone: true, selector: "yuv-dialog", inputs: { headertitel: { classPropertyName: "headertitel", publicName: "headertitel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
23
|
+
@let title = headertitel();
|
|
24
|
+
@if (title) {
|
|
25
|
+
<h2 mat-dialog-title>
|
|
26
|
+
{{ title }}
|
|
27
|
+
</h2>
|
|
28
|
+
}
|
|
29
|
+
<mat-dialog-content>
|
|
30
|
+
<ng-content select="main"></ng-content>
|
|
31
|
+
</mat-dialog-content>
|
|
32
|
+
|
|
33
|
+
<mat-dialog-actions align="end" class="footer">
|
|
34
|
+
<ng-content select="footer"></ng-content>
|
|
35
|
+
</mat-dialog-actions>
|
|
36
|
+
`, isInline: true, styles: [":host{display:contents}h2{border-bottom:1px solid var(--ymt-outline-variant);font-size:var(--yuv-font-size-headline);font-weight:500}.mat-mdc-dialog-container{height:100%}mat-dialog-content{display:var(--ymt-dialog-content-display)}.footer{border-top:1px solid var(--ymt-outline-variant);gap:calc(var(--ymt-font-body) / 2)}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DialogComponent, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'yuv-dialog', imports: [TranslateModule, MatDialogActions, MatDialogTitle, MatDialogContent], template: `
|
|
41
|
+
@let title = headertitel();
|
|
42
|
+
@if (title) {
|
|
43
|
+
<h2 mat-dialog-title>
|
|
44
|
+
{{ title }}
|
|
45
|
+
</h2>
|
|
46
|
+
}
|
|
47
|
+
<mat-dialog-content>
|
|
48
|
+
<ng-content select="main"></ng-content>
|
|
49
|
+
</mat-dialog-content>
|
|
50
|
+
|
|
51
|
+
<mat-dialog-actions align="end" class="footer">
|
|
52
|
+
<ng-content select="footer"></ng-content>
|
|
53
|
+
</mat-dialog-actions>
|
|
54
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}h2{border-bottom:1px solid var(--ymt-outline-variant);font-size:var(--yuv-font-size-headline);font-weight:500}.mat-mdc-dialog-container{height:100%}mat-dialog-content{display:var(--ymt-dialog-content-display)}.footer{border-top:1px solid var(--ymt-outline-variant);gap:calc(var(--ymt-font-body) / 2)}\n"] }]
|
|
55
|
+
}] });
|
|
56
|
+
|
|
57
|
+
class ConfirmComponent {
|
|
58
|
+
constructor() {
|
|
59
|
+
this.dialogData = inject(MAT_DIALOG_DATA);
|
|
60
|
+
}
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: ConfirmComponent, isStandalone: true, selector: "yuv-confirm", ngImport: i0, template: "<yuv-dialog [headertitel]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button mat-stroked-button mat-dialog-close class=\"secondary\" type=\"button\">\n {{ dialogData.cancelLabel || 'Cancel' }}\n </button>\n }\n <button mat-flat-button class=\"primary\" type=\"button\" [mat-dialog-close]=\"true\">{{ dialogData.confirmLabel || 'Confirm' }}</button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitel"] }] }); }
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmComponent, decorators: [{
|
|
65
|
+
type: Component,
|
|
66
|
+
args: [{ selector: 'yuv-confirm', imports: [CommonModule, MatButtonModule, MatDialogModule, DialogComponent], template: "<yuv-dialog [headertitel]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button mat-stroked-button mat-dialog-close class=\"secondary\" type=\"button\">\n {{ dialogData.cancelLabel || 'Cancel' }}\n </button>\n }\n <button mat-flat-button class=\"primary\" type=\"button\" [mat-dialog-close]=\"true\">{{ dialogData.confirmLabel || 'Confirm' }}</button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"] }]
|
|
67
|
+
}] });
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Directive putting focus on a 'focusable' child element.
|
|
71
|
+
* By default the first focusable child will receive focus.
|
|
72
|
+
*/
|
|
73
|
+
class AutofocusChildDirective {
|
|
74
|
+
#elRef = inject(ElementRef);
|
|
75
|
+
#targetIndex = 0;
|
|
76
|
+
set yuvAutofocusChild(s) {
|
|
77
|
+
const i = parseInt(s);
|
|
78
|
+
this.#targetIndex = !isNaN(i) ? i : 0;
|
|
79
|
+
}
|
|
80
|
+
#getFirstFocusableChild() {
|
|
81
|
+
const focusableElements = [
|
|
82
|
+
...this.#elRef.nativeElement.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')
|
|
83
|
+
].filter((el) => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden'));
|
|
84
|
+
return focusableElements[this.#targetIndex];
|
|
85
|
+
}
|
|
86
|
+
ngAfterViewInit() {
|
|
87
|
+
setTimeout(() => {
|
|
88
|
+
const focusEl = this.#getFirstFocusableChild();
|
|
89
|
+
if (focusEl)
|
|
90
|
+
focusEl.focus();
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusChildDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
94
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: AutofocusChildDirective, isStandalone: true, selector: "[yuvAutofocusChild]", inputs: { yuvAutofocusChild: "yuvAutofocusChild" }, ngImport: i0 }); }
|
|
95
|
+
}
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusChildDirective, decorators: [{
|
|
97
|
+
type: Directive,
|
|
98
|
+
args: [{
|
|
99
|
+
selector: '[yuvAutofocusChild]',
|
|
100
|
+
standalone: true
|
|
101
|
+
}]
|
|
102
|
+
}], propDecorators: { yuvAutofocusChild: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}] } });
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Directive putting delayed focus on an element. If no
|
|
108
|
+
* delay is set, the focus will be set immediately.
|
|
109
|
+
*
|
|
110
|
+
* You have to ensure that the element is focusable when adding this directive to it.
|
|
111
|
+
*/
|
|
112
|
+
class AutofocusDelayedDirective {
|
|
113
|
+
constructor() {
|
|
114
|
+
this.#elRef = inject(ElementRef);
|
|
115
|
+
/**
|
|
116
|
+
* Sets the delay in milliseconds. If no delay is set, the focus will be set immediately.
|
|
117
|
+
*/
|
|
118
|
+
this.yuvAutofocusDelayed = input(0);
|
|
119
|
+
this.#delay = computed(() => {
|
|
120
|
+
const d = this.yuvAutofocusDelayed();
|
|
121
|
+
return typeof d === 'string' ? parseInt(d) : d;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
#elRef;
|
|
125
|
+
#delay;
|
|
126
|
+
ngAfterViewInit() {
|
|
127
|
+
setTimeout(() => {
|
|
128
|
+
this.#elRef.nativeElement.focus();
|
|
129
|
+
}, this.#delay());
|
|
130
|
+
}
|
|
131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusDelayedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
132
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.1", type: AutofocusDelayedDirective, isStandalone: true, selector: "[yuvAutofocusDelayed]", inputs: { yuvAutofocusDelayed: { classPropertyName: "yuvAutofocusDelayed", publicName: "yuvAutofocusDelayed", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
133
|
+
}
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusDelayedDirective, decorators: [{
|
|
135
|
+
type: Directive,
|
|
136
|
+
args: [{
|
|
137
|
+
selector: '[yuvAutofocusDelayed]',
|
|
138
|
+
standalone: true
|
|
139
|
+
}]
|
|
140
|
+
}] });
|
|
13
141
|
|
|
14
142
|
/**
|
|
15
143
|
* A directive that will overlay its host component with a translucent background
|
|
@@ -27,9 +155,13 @@ class BusyOverlayDirective {
|
|
|
27
155
|
constructor() {
|
|
28
156
|
this.stylePosition = 'initial';
|
|
29
157
|
this.#elRef = inject(ElementRef);
|
|
158
|
+
this.#environmentInjector = inject(EnvironmentInjector);
|
|
159
|
+
this.#applicationRef = inject(ApplicationRef);
|
|
30
160
|
this.#overlayId = null;
|
|
31
161
|
}
|
|
32
162
|
#elRef;
|
|
163
|
+
#environmentInjector;
|
|
164
|
+
#applicationRef;
|
|
33
165
|
#overlayId;
|
|
34
166
|
/**
|
|
35
167
|
* The Boolean expression to evaluate as the condition for showing the busy overlay
|
|
@@ -42,6 +174,18 @@ class BusyOverlayDirective {
|
|
|
42
174
|
this.#removeBusyOverlay();
|
|
43
175
|
}
|
|
44
176
|
}
|
|
177
|
+
#createSpinner(mode = 'indeterminate', value = 0, color) {
|
|
178
|
+
const componentRef = createComponent(MatProgressSpinner, {
|
|
179
|
+
environmentInjector: this.#environmentInjector,
|
|
180
|
+
});
|
|
181
|
+
this.#applicationRef.attachView(componentRef.hostView);
|
|
182
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
183
|
+
componentRef.setInput('mode', mode);
|
|
184
|
+
componentRef.setInput('value', value);
|
|
185
|
+
componentRef.setInput('color', color);
|
|
186
|
+
componentRef.location.nativeElement.classList.add('ymt-progress-spinner--giant');
|
|
187
|
+
return componentRef;
|
|
188
|
+
}
|
|
45
189
|
#addBusyOverlay() {
|
|
46
190
|
this.stylePosition = 'relative';
|
|
47
191
|
const overlay = document.createElement('div');
|
|
@@ -53,12 +197,13 @@ class BusyOverlayDirective {
|
|
|
53
197
|
overlay.style.alignItems = 'center';
|
|
54
198
|
overlay.style.justifyContent = 'center';
|
|
55
199
|
overlay.style.zIndex = '5';
|
|
56
|
-
overlay.style.backgroundColor = 'var(--busy-overlay-background)';
|
|
200
|
+
overlay.style.backgroundColor = 'var(--busy-overlay-background, rgba(0, 0, 0, 0.32))';
|
|
57
201
|
this.#overlayId = `p${Utils.uuid()}`;
|
|
58
202
|
overlay.setAttribute('id', this.#overlayId);
|
|
59
|
-
const spinner = document.createElement('div');
|
|
60
|
-
spinner.setAttribute('class', 'yuv-loader');
|
|
61
|
-
overlay.append(spinner);
|
|
203
|
+
// const spinner = document.createElement('div');
|
|
204
|
+
// spinner.setAttribute('class', 'yuv-loader');
|
|
205
|
+
// overlay.append(spinner);
|
|
206
|
+
overlay.append(this.#createSpinner('indeterminate').location.nativeElement);
|
|
62
207
|
const el = this.#elRef.nativeElement;
|
|
63
208
|
el.setAttribute('inert', '');
|
|
64
209
|
el.append(overlay);
|
|
@@ -80,10 +225,10 @@ class BusyOverlayDirective {
|
|
|
80
225
|
ngOnInit() {
|
|
81
226
|
this.stylePosition = getComputedStyle(this.#elRef.nativeElement).position;
|
|
82
227
|
}
|
|
83
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
84
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
228
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BusyOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
229
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: BusyOverlayDirective, isStandalone: true, selector: "[yuvBusyOverlay]", inputs: { yuvBusyOverlay: "yuvBusyOverlay" }, host: { properties: { "style.position": "this.stylePosition" } }, ngImport: i0 }); }
|
|
85
230
|
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BusyOverlayDirective, decorators: [{
|
|
87
232
|
type: Directive,
|
|
88
233
|
args: [{
|
|
89
234
|
selector: '[yuvBusyOverlay]',
|
|
@@ -97,416 +242,194 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
97
242
|
}] } });
|
|
98
243
|
|
|
99
244
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* host component in order to allow styling it while beeing focused. Furthermore you can
|
|
103
|
-
* register callbacks once the component gets or looses focus.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* // just set the css class
|
|
107
|
-
* <some-component yuvFocusWithin></some-component>
|
|
108
|
-
* // set the css class and listen to focus changes
|
|
109
|
-
* <some-component (yuvFocusWithin)="onFocusEnter()" (yuvFocusWithinBlur)="onFocusLeave()"></some-component>
|
|
245
|
+
* Fixes the issue of 'click' event beeing triggered on 'doubleclick' by defining new outputs that
|
|
246
|
+
* distinguish between single and double click.
|
|
110
247
|
*/
|
|
111
|
-
class
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
248
|
+
class ClickDoubleDirective {
|
|
249
|
+
constructor() {
|
|
250
|
+
this.debounceTime = 200;
|
|
251
|
+
this.doubleClick = new EventEmitter();
|
|
252
|
+
this.singleClick = new EventEmitter();
|
|
253
|
+
this.clicksSubject = new Subject();
|
|
254
|
+
this.clicksSubject.pipe(takeUntilDestroyed(), debounceTime(this.debounceTime)).subscribe({
|
|
255
|
+
next: (event) => {
|
|
256
|
+
if (event.type === 'click') {
|
|
257
|
+
this.singleClick.emit(event);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this.doubleClick.emit(event);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
});
|
|
125
264
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
this.elRef = elRef;
|
|
131
|
-
this.eventCount = 0;
|
|
132
|
-
this.hasFocusWithin = false;
|
|
133
|
-
/**
|
|
134
|
-
* Emitted once the component or any of its child components gains focus.
|
|
135
|
-
*/
|
|
136
|
-
this.yuvFocusWithin = new EventEmitter();
|
|
137
|
-
/**
|
|
138
|
-
* Emitted once the component (incl. any of its child components) looses focus.
|
|
139
|
-
*/
|
|
140
|
-
this.yuvFocusWithinBlur = new EventEmitter();
|
|
265
|
+
clickEvent(event) {
|
|
266
|
+
event.preventDefault();
|
|
267
|
+
event.stopPropagation();
|
|
268
|
+
this.clicksSubject.next(event);
|
|
141
269
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var nativeMatches = node.matches || node.msMatchesSelector;
|
|
147
|
-
try {
|
|
148
|
-
return nativeMatches.call(node, ':focus-within');
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
270
|
+
doubleClickEvent(event) {
|
|
271
|
+
event.preventDefault();
|
|
272
|
+
event.stopPropagation();
|
|
273
|
+
this.clicksSubject.next(event);
|
|
153
274
|
}
|
|
154
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
155
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
275
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ClickDoubleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
276
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: ClickDoubleDirective, isStandalone: true, selector: "[click.single],[click.double]", inputs: { debounceTime: "debounceTime" }, outputs: { doubleClick: "click.double", singleClick: "click.single" }, host: { listeners: { "click": "clickEvent($event)", "dblclick": "doubleClickEvent($event)" } }, ngImport: i0 }); }
|
|
156
277
|
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ClickDoubleDirective, decorators: [{
|
|
158
279
|
type: Directive,
|
|
159
280
|
args: [{
|
|
160
|
-
selector: '[
|
|
281
|
+
selector: '[click.single],[click.double]',
|
|
161
282
|
standalone: true
|
|
162
283
|
}]
|
|
163
|
-
}], ctorParameters: () => [
|
|
164
|
-
type:
|
|
165
|
-
|
|
166
|
-
|
|
284
|
+
}], ctorParameters: () => [], propDecorators: { debounceTime: [{
|
|
285
|
+
type: Input
|
|
286
|
+
}], doubleClick: [{
|
|
287
|
+
type: Output,
|
|
288
|
+
args: ['click.double']
|
|
289
|
+
}], singleClick: [{
|
|
290
|
+
type: Output,
|
|
291
|
+
args: ['click.single']
|
|
292
|
+
}], clickEvent: [{
|
|
167
293
|
type: HostListener,
|
|
168
|
-
args: ['
|
|
169
|
-
}],
|
|
294
|
+
args: ['click', ['$event']]
|
|
295
|
+
}], doubleClickEvent: [{
|
|
170
296
|
type: HostListener,
|
|
171
|
-
args: ['
|
|
172
|
-
}], yuvFocusWithin: [{
|
|
173
|
-
type: Output
|
|
174
|
-
}], yuvFocusWithinBlur: [{
|
|
175
|
-
type: Output
|
|
297
|
+
args: ['dblclick', ['$event']]
|
|
176
298
|
}] } });
|
|
177
299
|
|
|
178
|
-
|
|
300
|
+
/**
|
|
301
|
+
* Directive to watch the size of an element inside the DOM. Usefull for example to provide
|
|
302
|
+
* a different layout (different components) depending on the available screen estate. You
|
|
303
|
+
* should first try to use CSS container queries but somtimes you need a different set of
|
|
304
|
+
* components to be loaded for a certain component size.
|
|
305
|
+
*
|
|
306
|
+
* Let's say you have components designed for bigger screens. You do not want to load them
|
|
307
|
+
* if there is not enough space for them. So you rather load components that are designed to
|
|
308
|
+
* take less space by providing the best user experience on smaller devices.
|
|
309
|
+
*
|
|
310
|
+
* ```html
|
|
311
|
+
* <div yuvContainerSize (containerHeight)="onContainerResize($event)" (containerWidth)="onContainerResize($event)"></div>
|
|
312
|
+
* ```
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
315
|
+
class ContainerSizeDirective {
|
|
179
316
|
constructor() {
|
|
180
|
-
this
|
|
181
|
-
this
|
|
182
|
-
this
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
'justify-content': 'center',
|
|
189
|
-
'outline-offset': '-2px',
|
|
190
|
-
'background-color': 'rgba(var(--color-accent-rgb), .5)'
|
|
191
|
-
};
|
|
192
|
-
this.#defaultDragOverCoverLabelStyles = {
|
|
193
|
-
outline: '1px solid var(--color-accent)',
|
|
194
|
-
padding: 'var(--app-pane-padding, 16px)',
|
|
195
|
-
'background-color': 'rgba(var(--color-accent-rgb), .9)',
|
|
196
|
-
color: 'var(--color-accent-tone)'
|
|
197
|
-
};
|
|
198
|
-
this.yuvFileDropZone = input();
|
|
199
|
-
this.fileDropDisabled = input(false);
|
|
200
|
-
this.fileDrop = output();
|
|
201
|
-
this.fileDropOver = output();
|
|
202
|
-
}
|
|
203
|
-
#elRef;
|
|
204
|
-
#coverElement;
|
|
205
|
-
#fileOver;
|
|
206
|
-
set fileOver(fo) {
|
|
207
|
-
if (fo !== this.#fileOver) {
|
|
208
|
-
this.#fileOver = fo;
|
|
209
|
-
this.fileDropOver.emit(fo);
|
|
210
|
-
this.#toggleCover();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
get fileOver() {
|
|
214
|
-
return this.#fileOver;
|
|
215
|
-
}
|
|
216
|
-
#defaultDragOverCoverStyles;
|
|
217
|
-
#defaultDragOverCoverLabelStyles;
|
|
218
|
-
onDrop(event) {
|
|
219
|
-
if (this.fileDropDisabled())
|
|
220
|
-
return;
|
|
221
|
-
event.preventDefault();
|
|
222
|
-
event.stopPropagation();
|
|
223
|
-
this.fileOver = false;
|
|
224
|
-
const dataTransfer = event.dataTransfer;
|
|
225
|
-
if (dataTransfer) {
|
|
226
|
-
if (dataTransfer?.items) {
|
|
227
|
-
const files = [];
|
|
228
|
-
for (let i = 0; i < dataTransfer.items.length; i++) {
|
|
229
|
-
// If dropped items aren't files, reject them
|
|
230
|
-
if (dataTransfer.items[i].kind === 'file') {
|
|
231
|
-
const file = dataTransfer.items[i].getAsFile();
|
|
232
|
-
if (file)
|
|
233
|
-
files.push(file);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
dataTransfer.items.clear();
|
|
237
|
-
this.fileDrop.emit(files);
|
|
317
|
+
this.elRef = inject(ElementRef);
|
|
318
|
+
this.ngZone = inject(NgZone);
|
|
319
|
+
this.containerHeight = output();
|
|
320
|
+
this.containerWidth = output();
|
|
321
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
322
|
+
const size = entries[0].borderBoxSize[0];
|
|
323
|
+
if (!this._size || size.blockSize !== this._size.blockSize) {
|
|
324
|
+
this._emit(size.blockSize, true);
|
|
238
325
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
dataTransfer.clearData();
|
|
242
|
-
this.fileDrop.emit(Array.from(files));
|
|
326
|
+
if (!this._size || size.inlineSize !== this._size.inlineSize) {
|
|
327
|
+
this._emit(size.inlineSize);
|
|
243
328
|
}
|
|
244
|
-
|
|
329
|
+
this._size = size;
|
|
330
|
+
});
|
|
331
|
+
this._resizeObserver.observe(this.elRef.nativeElement);
|
|
245
332
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
333
|
+
_emit(value, isHeight = false) {
|
|
334
|
+
// ResizeObserver callback is not covered by change detection
|
|
335
|
+
// so it has to be executed withing ngZone
|
|
336
|
+
this.ngZone.run(() => {
|
|
337
|
+
(isHeight ? this.containerHeight : this.containerWidth).emit(value);
|
|
338
|
+
});
|
|
252
339
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return;
|
|
256
|
-
if (event.target.getAttribute('id') === this.#coverElement?.getAttribute('id')) {
|
|
257
|
-
this.fileOver = false;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
onBodyDragOver(event) {
|
|
261
|
-
event.preventDefault();
|
|
262
|
-
event.stopPropagation();
|
|
263
|
-
}
|
|
264
|
-
onBodyDrop(event) {
|
|
265
|
-
event.preventDefault();
|
|
266
|
-
}
|
|
267
|
-
#toggleCover() {
|
|
268
|
-
const el = this.#elRef.nativeElement;
|
|
269
|
-
if (this.#coverElement) {
|
|
270
|
-
el.style.position = 'initial';
|
|
271
|
-
this.#coverElement.remove();
|
|
272
|
-
this.#coverElement = undefined;
|
|
273
|
-
}
|
|
274
|
-
if (this.#fileOver) {
|
|
275
|
-
el.style.position = 'relative';
|
|
276
|
-
this.#coverElement = this.#createCoverElement();
|
|
277
|
-
el.append(this.#coverElement);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
#createCoverElement() {
|
|
281
|
-
const coverElement = document.createElement('div');
|
|
282
|
-
coverElement.setAttribute('id', Utils.uuid());
|
|
283
|
-
coverElement.style.position = 'absolute';
|
|
284
|
-
coverElement.style.inset = '0';
|
|
285
|
-
const styles = this.yuvFileDropZone()?.coverStyles || this.#defaultDragOverCoverStyles;
|
|
286
|
-
Object.keys(styles).forEach((k) => {
|
|
287
|
-
coverElement.style[k] = styles[k];
|
|
288
|
-
});
|
|
289
|
-
const label = this.yuvFileDropZone()?.label;
|
|
290
|
-
if (label) {
|
|
291
|
-
const coverLabelElement = document.createElement('div');
|
|
292
|
-
coverLabelElement.innerText = label;
|
|
293
|
-
const labelStyles = this.yuvFileDropZone()?.coverLabelStyles || this.#defaultDragOverCoverLabelStyles;
|
|
294
|
-
Object.keys(labelStyles).forEach((k) => {
|
|
295
|
-
coverLabelElement.style[k] = labelStyles[k];
|
|
296
|
-
});
|
|
297
|
-
coverLabelElement.style.pointerEvents = 'none';
|
|
298
|
-
coverElement.append(coverLabelElement);
|
|
299
|
-
}
|
|
300
|
-
return coverElement;
|
|
301
|
-
}
|
|
302
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FileDropZoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
303
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: FileDropZoneDirective, isStandalone: true, selector: "[yuvFileDropZone]", inputs: { yuvFileDropZone: { classPropertyName: "yuvFileDropZone", publicName: "yuvFileDropZone", isSignal: true, isRequired: false, transformFunction: null }, fileDropDisabled: { classPropertyName: "fileDropDisabled", publicName: "fileDropDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileDrop: "fileDrop", fileDropOver: "fileDropOver" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "body:dragover": "onBodyDragOver($event)", "body:drop": "onBodyDrop($event)" } }, ngImport: i0 }); }
|
|
304
|
-
}
|
|
305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FileDropZoneDirective, decorators: [{
|
|
306
|
-
type: Directive,
|
|
307
|
-
args: [{
|
|
308
|
-
selector: '[yuvFileDropZone]',
|
|
309
|
-
standalone: true
|
|
310
|
-
}]
|
|
311
|
-
}], propDecorators: { onDrop: [{
|
|
312
|
-
type: HostListener,
|
|
313
|
-
args: ['drop', ['$event']]
|
|
314
|
-
}], onDragOver: [{
|
|
315
|
-
type: HostListener,
|
|
316
|
-
args: ['dragover', ['$event']]
|
|
317
|
-
}], onDragLeave: [{
|
|
318
|
-
type: HostListener,
|
|
319
|
-
args: ['dragleave', ['$event']]
|
|
320
|
-
}], onBodyDragOver: [{
|
|
321
|
-
type: HostListener,
|
|
322
|
-
args: ['body:dragover', ['$event']]
|
|
323
|
-
}], onBodyDrop: [{
|
|
324
|
-
type: HostListener,
|
|
325
|
-
args: ['body:drop', ['$event']]
|
|
326
|
-
}] } });
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Fixes the issue of 'click' event beeing triggered on 'doubleclick' by defining new outputs that
|
|
330
|
-
* distinguish between single and double click.
|
|
331
|
-
*/
|
|
332
|
-
class ClickDoubleDirective {
|
|
333
|
-
constructor() {
|
|
334
|
-
this.debounceTime = 200;
|
|
335
|
-
this.doubleClick = new EventEmitter();
|
|
336
|
-
this.singleClick = new EventEmitter();
|
|
337
|
-
this.clicksSubject = new Subject();
|
|
338
|
-
this.clicksSubject.pipe(takeUntilDestroyed(), debounceTime(this.debounceTime)).subscribe({
|
|
339
|
-
next: (event) => {
|
|
340
|
-
if (event.type === 'click') {
|
|
341
|
-
this.singleClick.emit(event);
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
this.doubleClick.emit(event);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
clickEvent(event) {
|
|
350
|
-
event.preventDefault();
|
|
351
|
-
event.stopPropagation();
|
|
352
|
-
this.clicksSubject.next(event);
|
|
353
|
-
}
|
|
354
|
-
doubleClickEvent(event) {
|
|
355
|
-
event.preventDefault();
|
|
356
|
-
event.stopPropagation();
|
|
357
|
-
this.clicksSubject.next(event);
|
|
340
|
+
ngOnDestroy() {
|
|
341
|
+
this._resizeObserver.unobserve(this.elRef.nativeElement);
|
|
358
342
|
}
|
|
359
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
360
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ContainerSizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
344
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: ContainerSizeDirective, isStandalone: true, selector: "[yuvContainerSize]", outputs: { containerHeight: "containerHeight", containerWidth: "containerWidth" }, ngImport: i0 }); }
|
|
361
345
|
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ContainerSizeDirective, decorators: [{
|
|
363
347
|
type: Directive,
|
|
364
348
|
args: [{
|
|
365
|
-
selector: '[
|
|
349
|
+
selector: '[yuvContainerSize]',
|
|
366
350
|
standalone: true
|
|
367
351
|
}]
|
|
368
|
-
}], ctorParameters: () => []
|
|
369
|
-
type: Input
|
|
370
|
-
}], doubleClick: [{
|
|
371
|
-
type: Output,
|
|
372
|
-
args: ['click.double']
|
|
373
|
-
}], singleClick: [{
|
|
374
|
-
type: Output,
|
|
375
|
-
args: ['click.single']
|
|
376
|
-
}], clickEvent: [{
|
|
377
|
-
type: HostListener,
|
|
378
|
-
args: ['click', ['$event']]
|
|
379
|
-
}], doubleClickEvent: [{
|
|
380
|
-
type: HostListener,
|
|
381
|
-
args: ['dblclick', ['$event']]
|
|
382
|
-
}] } });
|
|
352
|
+
}], ctorParameters: () => [] });
|
|
383
353
|
|
|
384
354
|
/**
|
|
385
|
-
* Directive for
|
|
386
|
-
*
|
|
355
|
+
* Directive for adding drag scroll behaviour to a container element. Elements that overlow will then
|
|
356
|
+
* be 'scrollable' by dragging the list of children.
|
|
387
357
|
*
|
|
388
|
-
*
|
|
389
|
-
* <div
|
|
358
|
+
* @example
|
|
359
|
+
* <div yuvDragScroll>
|
|
360
|
+
* <div class="tile">#1</div>
|
|
361
|
+
* <div class="tile">#2</div>
|
|
362
|
+
* <div class="tile">#3</div>
|
|
390
363
|
* ...
|
|
391
364
|
* </div>
|
|
392
|
-
* ```
|
|
393
|
-
*/
|
|
394
|
-
class LightDismissDirective {
|
|
395
|
-
constructor() {
|
|
396
|
-
this.elRef = inject(ElementRef);
|
|
397
|
-
this.yuvLightDismiss = output();
|
|
398
|
-
}
|
|
399
|
-
onKeydownHandler(event) {
|
|
400
|
-
if (!event.defaultPrevented) {
|
|
401
|
-
this.yuvLightDismiss.emit();
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
onMousedown(event) {
|
|
405
|
-
if (!this.elRef.nativeElement.contains(event.target)) {
|
|
406
|
-
this.yuvLightDismiss.emit();
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LightDismissDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
410
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: LightDismissDirective, isStandalone: true, selector: "[yuvLightDismiss]", outputs: { yuvLightDismiss: "yuvLightDismiss" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)", "document:mousedown": "onMousedown($event)" } }, ngImport: i0 }); }
|
|
411
|
-
}
|
|
412
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LightDismissDirective, decorators: [{
|
|
413
|
-
type: Directive,
|
|
414
|
-
args: [{
|
|
415
|
-
selector: '[yuvLightDismiss]',
|
|
416
|
-
standalone: true
|
|
417
|
-
}]
|
|
418
|
-
}], propDecorators: { onKeydownHandler: [{
|
|
419
|
-
type: HostListener,
|
|
420
|
-
args: ['document:keydown.escape', ['$event']]
|
|
421
|
-
}], onMousedown: [{
|
|
422
|
-
type: HostListener,
|
|
423
|
-
args: ['document:mousedown', ['$event']]
|
|
424
|
-
}] } });
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Directive to watch the size of an element inside the DOM. Usefull for example to provide
|
|
428
|
-
* a different layout (different components) depending on the available screen estate. You
|
|
429
|
-
* should first try to use CSS container queries but somtimes you need a different set of
|
|
430
|
-
* components to be loaded for a certain component size.
|
|
431
|
-
*
|
|
432
|
-
* Let's say you have components designed for bigger screens. You do not want to load them
|
|
433
|
-
* if there is not enough space for them. So you rather load components that are designed to
|
|
434
|
-
* take less space by providing the best user experience on smaller devices.
|
|
435
|
-
*
|
|
436
|
-
* ```html
|
|
437
|
-
* <div yuvContainerSize (containerHeight)="onContainerResize($event)" (containerWidth)="onContainerResize($event)"></div>
|
|
438
|
-
* ```
|
|
439
|
-
*
|
|
440
365
|
*/
|
|
441
|
-
class
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
366
|
+
class DragScrollDirective {
|
|
367
|
+
#document = inject(DOCUMENT);
|
|
368
|
+
#element = inject(ElementRef);
|
|
369
|
+
#dragging = false;
|
|
370
|
+
#applyDraggingStyles(el, remove) {
|
|
371
|
+
const draggingStyles = {
|
|
372
|
+
cursor: 'grabbing'
|
|
373
|
+
};
|
|
374
|
+
Object.keys(draggingStyles).forEach((property) => {
|
|
375
|
+
if (remove) {
|
|
376
|
+
el.style.removeProperty(property);
|
|
451
377
|
}
|
|
452
|
-
|
|
453
|
-
|
|
378
|
+
else {
|
|
379
|
+
el.style.setProperty(property, draggingStyles[property]);
|
|
454
380
|
}
|
|
455
|
-
this._size = size;
|
|
456
|
-
});
|
|
457
|
-
this._resizeObserver.observe(this.elRef.nativeElement);
|
|
458
|
-
}
|
|
459
|
-
_emit(value, isHeight = false) {
|
|
460
|
-
// ResizeObserver callback is not covered by change detection
|
|
461
|
-
// so it has to be executed withing ngZone
|
|
462
|
-
this.ngZone.run(() => {
|
|
463
|
-
(isHeight ? this.containerHeight : this.containerWidth).emit(value);
|
|
464
381
|
});
|
|
465
382
|
}
|
|
466
|
-
|
|
467
|
-
this.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
383
|
+
ngAfterViewInit() {
|
|
384
|
+
const nativeElement = this.#element.nativeElement;
|
|
385
|
+
const mouseDown$ = fromEvent(nativeElement, 'mousedown');
|
|
386
|
+
const mouseMove$ = fromEvent(this.#document, 'mousemove');
|
|
387
|
+
const mouseUp$ = fromEvent(this.#document, 'mouseup').pipe(tap((e) => {
|
|
388
|
+
if (this.#dragging) {
|
|
389
|
+
e.preventDefault();
|
|
390
|
+
e.stopPropagation();
|
|
391
|
+
this.#dragging = false;
|
|
392
|
+
this.#applyDraggingStyles(nativeElement, true);
|
|
393
|
+
}
|
|
394
|
+
}));
|
|
395
|
+
const dragMove$ = mouseDown$.pipe(filter(() =>
|
|
396
|
+
// only calculate new scroll position if the container is actually overflowing
|
|
397
|
+
nativeElement.scrollHeight > nativeElement.clientHeight || nativeElement.scrollWidth > nativeElement.clientWidth), tap((startEvent) => {
|
|
398
|
+
this.#applyDraggingStyles(nativeElement);
|
|
399
|
+
startEvent.preventDefault();
|
|
400
|
+
startEvent.stopPropagation();
|
|
401
|
+
}), switchMap((startEvent) => {
|
|
402
|
+
this.#dragging = true;
|
|
403
|
+
const scrollPos = {
|
|
404
|
+
left: nativeElement.scrollLeft,
|
|
405
|
+
top: nativeElement.scrollTop
|
|
406
|
+
};
|
|
407
|
+
return mouseMove$.pipe(map((moveEvent) => {
|
|
408
|
+
moveEvent.preventDefault();
|
|
409
|
+
moveEvent.stopPropagation();
|
|
410
|
+
return {
|
|
411
|
+
startEvent,
|
|
412
|
+
moveEvent,
|
|
413
|
+
scrollPos
|
|
414
|
+
};
|
|
415
|
+
}), takeUntil(mouseUp$));
|
|
416
|
+
}), tap(({ startEvent, moveEvent, scrollPos }) => {
|
|
417
|
+
const diffX = moveEvent.clientX - startEvent.clientX;
|
|
418
|
+
const diffY = moveEvent.clientY - startEvent.clientY;
|
|
419
|
+
nativeElement.scrollLeft = scrollPos.left - diffX;
|
|
420
|
+
nativeElement.scrollTop = scrollPos.top - diffY;
|
|
421
|
+
}));
|
|
422
|
+
dragMove$.subscribe();
|
|
499
423
|
}
|
|
500
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
501
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
424
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
425
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: DragScrollDirective, isStandalone: true, selector: "[yuvDragScroll]", ngImport: i0 }); }
|
|
502
426
|
}
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragScrollDirective, decorators: [{
|
|
504
428
|
type: Directive,
|
|
505
429
|
args: [{
|
|
506
|
-
selector: '[
|
|
507
|
-
standalone: true
|
|
430
|
+
selector: '[yuvDragScroll]'
|
|
508
431
|
}]
|
|
509
|
-
}]
|
|
432
|
+
}] });
|
|
510
433
|
|
|
511
434
|
class DragSelectDirective {
|
|
512
435
|
constructor() {
|
|
@@ -535,7 +458,7 @@ class DragSelectDirective {
|
|
|
535
458
|
this.#selector.style.top = diffY < 0 ? this.#selectStartY + diffY + 'px' : this.#selectStartY + 'px';
|
|
536
459
|
this.#selector.style.height = Math.abs(diffY) + 'px';
|
|
537
460
|
this.#selector.style.width = Math.abs(diffX) + 'px';
|
|
538
|
-
this.#selector.style.border = `1px solid ${this.yuvDragSelect()?.selectorColor || 'var(--
|
|
461
|
+
this.#selector.style.border = `1px solid ${this.yuvDragSelect()?.selectorColor || 'var(--ymt-primary'}`;
|
|
539
462
|
this.#checkSelected();
|
|
540
463
|
};
|
|
541
464
|
this.#checkSelected = () => {
|
|
@@ -590,10 +513,10 @@ class DragSelectDirective {
|
|
|
590
513
|
#resize;
|
|
591
514
|
#checkSelected;
|
|
592
515
|
#checkRectIntersection;
|
|
593
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
594
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
516
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
517
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.1", type: DragSelectDirective, isStandalone: true, selector: "[yuvDragSelect]", inputs: { yuvDragSelect: { classPropertyName: "yuvDragSelect", publicName: "yuvDragSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dragSelectChange: "dragSelectChange", dragSelect: "dragSelect" }, host: { listeners: { "pointerdown": "onPointerDown($event)" } }, queries: [{ propertyName: "items", predicate: DragSelectItemDirective, isSignal: true }], ngImport: i0 }); }
|
|
595
518
|
}
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectDirective, decorators: [{
|
|
597
520
|
type: Directive,
|
|
598
521
|
args: [{
|
|
599
522
|
selector: '[yuvDragSelect]',
|
|
@@ -609,10 +532,10 @@ class DragSelectItemDirective {
|
|
|
609
532
|
this.el = this.#elRef.nativeElement;
|
|
610
533
|
}
|
|
611
534
|
#elRef;
|
|
612
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
613
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
535
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
536
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: DragSelectItemDirective, isStandalone: true, selector: "[yuvDragSelectItem]", ngImport: i0 }); }
|
|
614
537
|
}
|
|
615
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
538
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectItemDirective, decorators: [{
|
|
616
539
|
type: Directive,
|
|
617
540
|
args: [{
|
|
618
541
|
selector: '[yuvDragSelectItem]',
|
|
@@ -620,357 +543,306 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
620
543
|
}]
|
|
621
544
|
}] });
|
|
622
545
|
|
|
623
|
-
|
|
624
|
-
class TokenInputComponent {
|
|
546
|
+
class FileDropZoneDirective {
|
|
625
547
|
constructor() {
|
|
626
|
-
this
|
|
627
|
-
this
|
|
628
|
-
this
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
this
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
this.
|
|
645
|
-
this.
|
|
646
|
-
this.
|
|
647
|
-
|
|
648
|
-
onArrowUpKey(event) {
|
|
649
|
-
event.preventDefault();
|
|
650
|
-
event.stopPropagation();
|
|
651
|
-
if (this.autocompleteSelectedIndex > 0)
|
|
652
|
-
this.autocompleteSelectedIndex--;
|
|
653
|
-
}
|
|
654
|
-
onArrowDownKey(event) {
|
|
655
|
-
event.preventDefault();
|
|
656
|
-
event.stopPropagation();
|
|
657
|
-
if (this.autocompleteValues && this.autocompleteSelectedIndex < this.autocompleteValues.length - 1)
|
|
658
|
-
this.autocompleteSelectedIndex++;
|
|
659
|
-
}
|
|
660
|
-
onEnterKey(event) {
|
|
661
|
-
if (this.autocompleteValues.length && this.autocompleteSelectedIndex >= 0) {
|
|
662
|
-
event.preventDefault();
|
|
663
|
-
event.stopPropagation();
|
|
664
|
-
this.onOptionSelect(this.autocompleteValues[this.autocompleteSelectedIndex]);
|
|
665
|
-
}
|
|
548
|
+
this.#elRef = inject(ElementRef);
|
|
549
|
+
this.#fileOver = false;
|
|
550
|
+
this.#defaultDragOverCoverStyles = {
|
|
551
|
+
outline: '2px dashed var(--ymt-primary)',
|
|
552
|
+
display: 'flex',
|
|
553
|
+
transition: 'background-color .3s ease-in-out',
|
|
554
|
+
'z-index': '500',
|
|
555
|
+
'align-items': 'center',
|
|
556
|
+
'justify-content': 'center',
|
|
557
|
+
'outline-offset': '-2px',
|
|
558
|
+
'background-color': 'rgb(from var(--ymt-primary) r g b / .5)'
|
|
559
|
+
};
|
|
560
|
+
this.#defaultDragOverCoverLabelStyles = {
|
|
561
|
+
outline: '1px solid var(--ymt-primary)',
|
|
562
|
+
padding: 'var(--ymt-spacing-m, 16px)',
|
|
563
|
+
'background-color': 'rgb(from var(--ymt-primary) r g b / 0.9)',
|
|
564
|
+
color: 'var(--ymt-on-primary)'
|
|
565
|
+
};
|
|
566
|
+
this.yuvFileDropZone = input();
|
|
567
|
+
this.fileDropDisabled = input(false);
|
|
568
|
+
this.fileDrop = output();
|
|
569
|
+
this.fileDropOver = output();
|
|
666
570
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
// console.log('FIndex: ' + this.focusedTokenIndex);
|
|
676
|
-
}
|
|
677
|
-
onInput(e) {
|
|
678
|
-
this._processValue();
|
|
679
|
-
this._emitChange();
|
|
680
|
-
}
|
|
681
|
-
onArrowLeft(e) {
|
|
682
|
-
const cp = this._getCaretPos(e.target);
|
|
683
|
-
if (cp === 0) {
|
|
684
|
-
e.stopPropagation();
|
|
685
|
-
e.preventDefault();
|
|
686
|
-
this._focusInput(-1);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
onArrowRight(e) {
|
|
690
|
-
const cp = this._getCaretPos(e.target);
|
|
691
|
-
if (cp === e.target.innerText.length) {
|
|
692
|
-
e.stopPropagation();
|
|
693
|
-
e.preventDefault();
|
|
694
|
-
this._focusInput(1);
|
|
571
|
+
#elRef;
|
|
572
|
+
#coverElement;
|
|
573
|
+
#fileOver;
|
|
574
|
+
set fileOver(fo) {
|
|
575
|
+
if (fo !== this.#fileOver) {
|
|
576
|
+
this.#fileOver = fo;
|
|
577
|
+
this.fileDropOver.emit(fo);
|
|
578
|
+
this.#toggleCover();
|
|
695
579
|
}
|
|
696
580
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
el.innerText = mergedToken.label;
|
|
719
|
-
this._setCaretPos(el, content.length);
|
|
581
|
+
get fileOver() {
|
|
582
|
+
return this.#fileOver;
|
|
583
|
+
}
|
|
584
|
+
#defaultDragOverCoverStyles;
|
|
585
|
+
#defaultDragOverCoverLabelStyles;
|
|
586
|
+
onDrop(event) {
|
|
587
|
+
if (this.fileDropDisabled())
|
|
588
|
+
return;
|
|
589
|
+
event.preventDefault();
|
|
590
|
+
event.stopPropagation();
|
|
591
|
+
this.fileOver = false;
|
|
592
|
+
const dataTransfer = event.dataTransfer;
|
|
593
|
+
if (dataTransfer) {
|
|
594
|
+
if (dataTransfer?.items) {
|
|
595
|
+
const files = [];
|
|
596
|
+
for (let i = 0; i < dataTransfer.items.length; i++) {
|
|
597
|
+
// If dropped items aren't files, reject them
|
|
598
|
+
if (dataTransfer.items[i].kind === 'file') {
|
|
599
|
+
const file = dataTransfer.items[i].getAsFile();
|
|
600
|
+
if (file)
|
|
601
|
+
files.push(file);
|
|
720
602
|
}
|
|
721
603
|
}
|
|
722
|
-
|
|
604
|
+
dataTransfer.items.clear();
|
|
605
|
+
this.fileDrop.emit(files);
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
const files = dataTransfer.files;
|
|
609
|
+
dataTransfer.clearData();
|
|
610
|
+
this.fileDrop.emit(Array.from(files));
|
|
723
611
|
}
|
|
724
612
|
}
|
|
725
613
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
const prevContent = this.formTokens[prevIdx].label;
|
|
739
|
-
const mergedToken = {
|
|
740
|
-
id: this.formTokens[prevIdx].id,
|
|
741
|
-
label: `${prevContent} ${content}`,
|
|
742
|
-
type: this.TEXT_TOKEN_TYPE
|
|
743
|
-
};
|
|
744
|
-
this.formTokens.splice(prevIdx, 2, mergedToken);
|
|
745
|
-
const el = this.elRef.nativeElement.querySelector(`[data-id="${this.formTokens[prevIdx].id}"]`);
|
|
746
|
-
if (el) {
|
|
747
|
-
el.innerText = mergedToken.label;
|
|
748
|
-
this._setCaretPos(el, prevContent.length);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
this._focusFirst();
|
|
753
|
-
}
|
|
754
|
-
this._emitChange();
|
|
755
|
-
}
|
|
614
|
+
onDragOver(event) {
|
|
615
|
+
if (this.fileDropDisabled())
|
|
616
|
+
return;
|
|
617
|
+
event.stopPropagation();
|
|
618
|
+
event.preventDefault();
|
|
619
|
+
this.fileOver = true;
|
|
620
|
+
}
|
|
621
|
+
onDragLeave(event) {
|
|
622
|
+
if (this.fileDropDisabled())
|
|
623
|
+
return;
|
|
624
|
+
if (event.target.getAttribute('id') === this.#coverElement?.getAttribute('id')) {
|
|
625
|
+
this.fileOver = false;
|
|
756
626
|
}
|
|
757
627
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
628
|
+
onBodyDragOver(event) {
|
|
629
|
+
event.preventDefault();
|
|
630
|
+
event.stopPropagation();
|
|
631
|
+
}
|
|
632
|
+
onBodyDrop(event) {
|
|
633
|
+
event.preventDefault();
|
|
764
634
|
}
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
if (i < 0)
|
|
772
|
-
i = inputs.length - 1;
|
|
773
|
-
this.ngZone.run(() => inputs[i].focus());
|
|
774
|
-
this._setCaretPos(inputs[i], offset > 0 || inputs[i].innerText.length === 0 ? 0 : inputs[i].innerText.length);
|
|
775
|
-
}
|
|
776
|
-
_setCaretPos(element, pos) {
|
|
777
|
-
const targetNode = element.childNodes.length ? element.childNodes[0] : element;
|
|
778
|
-
const range = document.createRange();
|
|
779
|
-
range.selectNode(element);
|
|
780
|
-
range.setStart(targetNode, pos);
|
|
781
|
-
range.setEnd(targetNode, pos);
|
|
782
|
-
const selection = window.getSelection();
|
|
783
|
-
selection.removeAllRanges();
|
|
784
|
-
selection.addRange(range);
|
|
785
|
-
}
|
|
786
|
-
_getCaretPos(node) {
|
|
787
|
-
const selection = window.getSelection();
|
|
788
|
-
const range = selection.getRangeAt(0);
|
|
789
|
-
const clonedRange = range.cloneRange();
|
|
790
|
-
clonedRange.selectNodeContents(node);
|
|
791
|
-
clonedRange.setEnd(range.endContainer, range.endOffset);
|
|
792
|
-
return clonedRange.toString().length;
|
|
793
|
-
}
|
|
794
|
-
onOptionSelect(o) {
|
|
795
|
-
let tokensAdded = 0;
|
|
796
|
-
let tokensRemoved = 0;
|
|
797
|
-
const inputValue = this._getInputValue();
|
|
798
|
-
const wordTokens = this._tokenize(inputValue);
|
|
799
|
-
const lastWord = wordTokens[wordTokens.length - 1];
|
|
800
|
-
if (lastWord.length === inputValue.length) {
|
|
801
|
-
this.formTokens.pop();
|
|
802
|
-
tokensRemoved++;
|
|
635
|
+
#toggleCover() {
|
|
636
|
+
const el = this.#elRef.nativeElement;
|
|
637
|
+
if (this.#coverElement) {
|
|
638
|
+
el.style.position = 'initial';
|
|
639
|
+
this.#coverElement.remove();
|
|
640
|
+
this.#coverElement = undefined;
|
|
803
641
|
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
let txtTokenCount = -1;
|
|
809
|
-
this.formTokens.forEach((t, i) => {
|
|
810
|
-
if (t.type === this.TEXT_TOKEN_TYPE) {
|
|
811
|
-
txtTokenCount++;
|
|
812
|
-
t.id = this._textTokenId(txtTokenCount);
|
|
813
|
-
}
|
|
814
|
-
shadowTokens.push(t);
|
|
815
|
-
const nextToken = this.formTokens[i + 1];
|
|
816
|
-
if (t.type !== this.TEXT_TOKEN_TYPE && nextToken && nextToken.type !== this.TEXT_TOKEN_TYPE) {
|
|
817
|
-
// add inbetween token
|
|
818
|
-
txtTokenCount++;
|
|
819
|
-
shadowTokens.push(this._newTextToken(txtTokenCount));
|
|
820
|
-
tokensAdded++;
|
|
821
|
-
}
|
|
822
|
-
});
|
|
823
|
-
if (this.formTokens[this.formTokens.length - 1].type !== this.TEXT_TOKEN_TYPE) {
|
|
824
|
-
// add empty text token at the end
|
|
825
|
-
txtTokenCount++;
|
|
826
|
-
shadowTokens.push(this._newTextToken(txtTokenCount));
|
|
827
|
-
tokensAdded++;
|
|
642
|
+
if (this.#fileOver) {
|
|
643
|
+
el.style.position = 'relative';
|
|
644
|
+
this.#coverElement = this.#createCoverElement();
|
|
645
|
+
el.append(this.#coverElement);
|
|
828
646
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
647
|
+
}
|
|
648
|
+
#createCoverElement() {
|
|
649
|
+
const coverElement = document.createElement('div');
|
|
650
|
+
coverElement.setAttribute('id', Utils.uuid());
|
|
651
|
+
coverElement.style.position = 'absolute';
|
|
652
|
+
coverElement.style.inset = '0';
|
|
653
|
+
const styles = this.yuvFileDropZone()?.coverStyles || this.#defaultDragOverCoverStyles;
|
|
654
|
+
Object.keys(styles).forEach((k) => {
|
|
655
|
+
coverElement.style[k] = styles[k];
|
|
835
656
|
});
|
|
836
|
-
this.
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
// const lastInput: HTMLElement = (
|
|
847
|
-
// this.elRef.nativeElement as HTMLElement
|
|
848
|
-
// ).querySelector('[contenteditable]:last-child') as HTMLElement;
|
|
849
|
-
// lastInput.focus();
|
|
850
|
-
// return lastInput;
|
|
851
|
-
// }
|
|
852
|
-
openOptions() {
|
|
853
|
-
if (this._overlayRef || !this.autocompleteValues.length)
|
|
854
|
-
return;
|
|
855
|
-
this._overlayRef = this.overlay.open(this.optionsTemplate(), null, {
|
|
856
|
-
lightDismiss: true,
|
|
857
|
-
maxHeight: '97vh'
|
|
858
|
-
}, this.elRef);
|
|
859
|
-
}
|
|
860
|
-
closeOptions() {
|
|
861
|
-
if (this._overlayRef) {
|
|
862
|
-
this._overlayRef.close();
|
|
863
|
-
this._overlayRef = undefined;
|
|
657
|
+
const label = this.yuvFileDropZone()?.label;
|
|
658
|
+
if (label) {
|
|
659
|
+
const coverLabelElement = document.createElement('div');
|
|
660
|
+
coverLabelElement.innerText = label;
|
|
661
|
+
const labelStyles = this.yuvFileDropZone()?.coverLabelStyles || this.#defaultDragOverCoverLabelStyles;
|
|
662
|
+
Object.keys(labelStyles).forEach((k) => {
|
|
663
|
+
coverLabelElement.style[k] = labelStyles[k];
|
|
664
|
+
});
|
|
665
|
+
coverLabelElement.style.pointerEvents = 'none';
|
|
666
|
+
coverElement.append(coverLabelElement);
|
|
864
667
|
}
|
|
865
|
-
|
|
866
|
-
this.autocompleteValues = [];
|
|
668
|
+
return coverElement;
|
|
867
669
|
}
|
|
868
|
-
|
|
869
|
-
|
|
670
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FileDropZoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
671
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.1", type: FileDropZoneDirective, isStandalone: true, selector: "[yuvFileDropZone]", inputs: { yuvFileDropZone: { classPropertyName: "yuvFileDropZone", publicName: "yuvFileDropZone", isSignal: true, isRequired: false, transformFunction: null }, fileDropDisabled: { classPropertyName: "fileDropDisabled", publicName: "fileDropDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileDrop: "fileDrop", fileDropOver: "fileDropOver" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "body:dragover": "onBodyDragOver($event)", "body:drop": "onBodyDrop($event)" } }, ngImport: i0 }); }
|
|
672
|
+
}
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FileDropZoneDirective, decorators: [{
|
|
674
|
+
type: Directive,
|
|
675
|
+
args: [{
|
|
676
|
+
selector: '[yuvFileDropZone]',
|
|
677
|
+
standalone: true
|
|
678
|
+
}]
|
|
679
|
+
}], propDecorators: { onDrop: [{
|
|
680
|
+
type: HostListener,
|
|
681
|
+
args: ['drop', ['$event']]
|
|
682
|
+
}], onDragOver: [{
|
|
683
|
+
type: HostListener,
|
|
684
|
+
args: ['dragover', ['$event']]
|
|
685
|
+
}], onDragLeave: [{
|
|
686
|
+
type: HostListener,
|
|
687
|
+
args: ['dragleave', ['$event']]
|
|
688
|
+
}], onBodyDragOver: [{
|
|
689
|
+
type: HostListener,
|
|
690
|
+
args: ['body:dragover', ['$event']]
|
|
691
|
+
}], onBodyDrop: [{
|
|
692
|
+
type: HostListener,
|
|
693
|
+
args: ['body:drop', ['$event']]
|
|
694
|
+
}] } });
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Directive keeping track of the focus beeing within a component. Once the component or
|
|
698
|
+
* any of its child components gain focus, a class of `focusWithin` will be set on the
|
|
699
|
+
* host component in order to allow styling it while beeing focused. Furthermore you can
|
|
700
|
+
* register callbacks once the component gets or looses focus.
|
|
701
|
+
*
|
|
702
|
+
* @example
|
|
703
|
+
* // just set the css class
|
|
704
|
+
* <some-component yuvFocusWithin></some-component>
|
|
705
|
+
* // set the css class and listen to focus changes
|
|
706
|
+
* <some-component (yuvFocusWithin)="onFocusEnter()" (yuvFocusWithinBlur)="onFocusLeave()"></some-component>
|
|
707
|
+
*/
|
|
708
|
+
class FocusWithinDirective {
|
|
709
|
+
onFocusIn(evt) {
|
|
710
|
+
const hadFocusWithin = this.hasFocusWithin;
|
|
711
|
+
this.hasFocusWithin = this.matchesFocusWithin();
|
|
712
|
+
if (!hadFocusWithin && this.hasFocusWithin) {
|
|
713
|
+
this.yuvFocusWithin.emit();
|
|
714
|
+
}
|
|
870
715
|
}
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
if (el)
|
|
878
|
-
t.label = el.innerText;
|
|
879
|
-
}
|
|
880
|
-
});
|
|
881
|
-
this.change.emit(this.formTokens
|
|
882
|
-
.filter((t) => t.type !== this.TEXT_TOKEN_TYPE || t.label.length > 0)
|
|
883
|
-
.map((t) => ({
|
|
884
|
-
id: t.id,
|
|
885
|
-
label: t.label,
|
|
886
|
-
type: t.type
|
|
887
|
-
})));
|
|
888
|
-
if (focusFirst)
|
|
889
|
-
this._focusFirst();
|
|
890
|
-
});
|
|
716
|
+
onFocusOut(evt) {
|
|
717
|
+
const hadFocusWithin = this.hasFocusWithin;
|
|
718
|
+
this.hasFocusWithin = this.matchesFocusWithin();
|
|
719
|
+
if (hadFocusWithin && !this.hasFocusWithin) {
|
|
720
|
+
this.yuvFocusWithinBlur.emit();
|
|
721
|
+
}
|
|
891
722
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
723
|
+
/**
|
|
724
|
+
* @ignore
|
|
725
|
+
*/
|
|
726
|
+
constructor(elRef) {
|
|
727
|
+
this.elRef = elRef;
|
|
728
|
+
this.eventCount = 0;
|
|
729
|
+
this.hasFocusWithin = false;
|
|
730
|
+
/**
|
|
731
|
+
* Emitted once the component or any of its child components gains focus.
|
|
732
|
+
*/
|
|
733
|
+
this.yuvFocusWithin = new EventEmitter();
|
|
734
|
+
/**
|
|
735
|
+
* Emitted once the component (incl. any of its child components) looses focus.
|
|
736
|
+
*/
|
|
737
|
+
this.yuvFocusWithinBlur = new EventEmitter();
|
|
899
738
|
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
const wordTokens = this._tokenize(this._getInputValue());
|
|
912
|
-
const lastWord = wordTokens[wordTokens.length - 1];
|
|
913
|
-
this.autocompleteValues =
|
|
914
|
-
!lastWord || lastWord.length < 2
|
|
915
|
-
? []
|
|
916
|
-
: this.tokens().filter((t) => lastWord && new RegExp(lastWord, this.caseSensitive() ? '' : 'i').test(t.label));
|
|
917
|
-
this.autocompleteSelectedIndex = this.autocompleteValues.length ? 0 : -1;
|
|
918
|
-
if (this.autocompleteValues.length)
|
|
919
|
-
this.openOptions();
|
|
920
|
-
else
|
|
921
|
-
this.closeOptions();
|
|
739
|
+
// Determine if the given node matches the given selector.
|
|
740
|
+
// @see: https://www.bennadel.com/blog/3476-checking-to-see-if-an-element-has-a-css-pseudo-class-in-javascript.htm
|
|
741
|
+
matchesFocusWithin() {
|
|
742
|
+
const node = this.elRef.nativeElement;
|
|
743
|
+
const nativeMatches = node.matches || node.msMatchesSelector;
|
|
744
|
+
try {
|
|
745
|
+
return nativeMatches.call(node, ':focus-within');
|
|
746
|
+
}
|
|
747
|
+
catch (error) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
922
750
|
}
|
|
923
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
924
|
-
static { this.ɵ
|
|
751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FocusWithinDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
752
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: FocusWithinDirective, isStandalone: true, selector: "[yuvFocusWithin]", outputs: { yuvFocusWithin: "yuvFocusWithin", yuvFocusWithinBlur: "yuvFocusWithinBlur" }, host: { listeners: { "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)" }, properties: { "class.focusWithin": "this.hasFocusWithin" } }, ngImport: i0 }); }
|
|
925
753
|
}
|
|
926
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
927
|
-
type:
|
|
928
|
-
args: [{
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FocusWithinDirective, decorators: [{
|
|
755
|
+
type: Directive,
|
|
756
|
+
args: [{
|
|
757
|
+
selector: '[yuvFocusWithin]',
|
|
758
|
+
standalone: true
|
|
759
|
+
}]
|
|
760
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { hasFocusWithin: [{
|
|
761
|
+
type: HostBinding,
|
|
762
|
+
args: ['class.focusWithin']
|
|
763
|
+
}], onFocusIn: [{
|
|
933
764
|
type: HostListener,
|
|
934
|
-
args: ['
|
|
935
|
-
}],
|
|
765
|
+
args: ['focusin', ['$event']]
|
|
766
|
+
}], onFocusOut: [{
|
|
936
767
|
type: HostListener,
|
|
937
|
-
args: ['
|
|
768
|
+
args: ['focusout', ['$event']]
|
|
769
|
+
}], yuvFocusWithin: [{
|
|
770
|
+
type: Output
|
|
771
|
+
}], yuvFocusWithinBlur: [{
|
|
772
|
+
type: Output
|
|
938
773
|
}] } });
|
|
939
774
|
|
|
940
|
-
|
|
941
|
-
|
|
775
|
+
/**
|
|
776
|
+
* Directive for applying light dismiss actions. Adding this directive will trigger
|
|
777
|
+
* the given function when the user clicks outside the component or hits escape.
|
|
778
|
+
*
|
|
779
|
+
* ```ts
|
|
780
|
+
* <div class="notifications" (yuvLightDismiss)="close()">
|
|
781
|
+
* ...
|
|
782
|
+
* </div>
|
|
783
|
+
* ```
|
|
784
|
+
*/
|
|
785
|
+
class LightDismissDirective {
|
|
942
786
|
constructor() {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
.subscribe(() => this.#position());
|
|
946
|
-
fromEvent(document, 'focusout')
|
|
947
|
-
.pipe(takeUntilDestroyed())
|
|
948
|
-
.subscribe(() => {
|
|
949
|
-
const fi = this.#elRef.nativeElement;
|
|
950
|
-
fi.classList.remove('visible');
|
|
951
|
-
});
|
|
787
|
+
this.elRef = inject(ElementRef);
|
|
788
|
+
this.yuvLightDismiss = output();
|
|
952
789
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
790
|
+
onKeydownHandler(event) {
|
|
791
|
+
if (!event.defaultPrevented) {
|
|
792
|
+
this.yuvLightDismiss.emit();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
onMousedown(event) {
|
|
796
|
+
if (!this.elRef.nativeElement.contains(event.target)) {
|
|
797
|
+
this.yuvLightDismiss.emit();
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LightDismissDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
801
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: LightDismissDirective, isStandalone: true, selector: "[yuvLightDismiss]", outputs: { yuvLightDismiss: "yuvLightDismiss" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)", "document:mousedown": "onMousedown($event)" } }, ngImport: i0 }); }
|
|
802
|
+
}
|
|
803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LightDismissDirective, decorators: [{
|
|
804
|
+
type: Directive,
|
|
805
|
+
args: [{
|
|
806
|
+
selector: '[yuvLightDismiss]',
|
|
807
|
+
standalone: true
|
|
808
|
+
}]
|
|
809
|
+
}], propDecorators: { onKeydownHandler: [{
|
|
810
|
+
type: HostListener,
|
|
811
|
+
args: ['document:keydown.escape', ['$event']]
|
|
812
|
+
}], onMousedown: [{
|
|
813
|
+
type: HostListener,
|
|
814
|
+
args: ['document:mousedown', ['$event']]
|
|
815
|
+
}] } });
|
|
816
|
+
|
|
817
|
+
class LongPressDirective {
|
|
818
|
+
constructor() {
|
|
819
|
+
this.elRef = inject(ElementRef);
|
|
820
|
+
this.threshold = 500;
|
|
821
|
+
this.yuvLongPress = input({
|
|
822
|
+
enabled: false
|
|
964
823
|
});
|
|
824
|
+
this.longpress = output();
|
|
825
|
+
const mousedown = fromEvent(this.elRef.nativeElement, 'mousedown').pipe(takeUntilDestroyed(), filter((event) => event.button == 0), // Only allow left button (Primary button)
|
|
826
|
+
map(() => true) // turn on threshold counter
|
|
827
|
+
);
|
|
828
|
+
const touchstart = fromEvent(this.elRef.nativeElement, 'touchstart').pipe(takeUntilDestroyed(), map(() => true));
|
|
829
|
+
const touchEnd = fromEvent(this.elRef.nativeElement, 'touchend').pipe(takeUntilDestroyed(), map(() => false));
|
|
830
|
+
const mouseup = fromEvent(window, 'mouseup').pipe(takeUntilDestroyed(), filter((event) => event.button == 0), // Only allow left button (Primary button)
|
|
831
|
+
map(() => false) // reset threshold counter
|
|
832
|
+
);
|
|
833
|
+
merge(mousedown, mouseup, touchstart, touchEnd)
|
|
834
|
+
.pipe(takeUntilDestroyed(), switchMap((state) => (state ? timer(this.threshold, 100) : of(null))), filter((value) => !!value))
|
|
835
|
+
.subscribe(() => this.longpress.emit());
|
|
965
836
|
}
|
|
966
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
967
|
-
static { this.ɵ
|
|
837
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LongPressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
838
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.1", type: LongPressDirective, isStandalone: true, selector: "[yuvLongPress]", inputs: { yuvLongPress: { classPropertyName: "yuvLongPress", publicName: "yuvLongPress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { longpress: "longpress" }, ngImport: i0 }); }
|
|
968
839
|
}
|
|
969
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
970
|
-
type:
|
|
971
|
-
args: [{
|
|
972
|
-
|
|
973
|
-
|
|
840
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LongPressDirective, decorators: [{
|
|
841
|
+
type: Directive,
|
|
842
|
+
args: [{
|
|
843
|
+
selector: '[yuvLongPress]',
|
|
844
|
+
standalone: true
|
|
845
|
+
}]
|
|
974
846
|
}], ctorParameters: () => [] });
|
|
975
847
|
|
|
976
848
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -980,16 +852,16 @@ class NoopValueAccessorDirective {
|
|
|
980
852
|
writeValue(obj) { }
|
|
981
853
|
registerOnChange(fn) { }
|
|
982
854
|
registerOnTouched(fn) { }
|
|
983
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
984
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
855
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NoopValueAccessorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
856
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: NoopValueAccessorDirective, isStandalone: true, providers: [
|
|
985
857
|
{
|
|
986
858
|
provide: NG_VALUE_ACCESSOR,
|
|
987
859
|
multi: true,
|
|
988
|
-
useExisting: forwardRef(() => NoopValueAccessorDirective)
|
|
989
|
-
}
|
|
860
|
+
useExisting: forwardRef(() => NoopValueAccessorDirective)
|
|
861
|
+
}
|
|
990
862
|
], ngImport: i0 }); }
|
|
991
863
|
}
|
|
992
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NoopValueAccessorDirective, decorators: [{
|
|
993
865
|
type: Directive,
|
|
994
866
|
args: [{
|
|
995
867
|
standalone: true,
|
|
@@ -997,80 +869,281 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
997
869
|
{
|
|
998
870
|
provide: NG_VALUE_ACCESSOR,
|
|
999
871
|
multi: true,
|
|
1000
|
-
useExisting: forwardRef(() => NoopValueAccessorDirective)
|
|
1001
|
-
}
|
|
1002
|
-
]
|
|
872
|
+
useExisting: forwardRef(() => NoopValueAccessorDirective)
|
|
873
|
+
}
|
|
874
|
+
]
|
|
1003
875
|
}]
|
|
1004
876
|
}] });
|
|
1005
|
-
function injectNgControl() {
|
|
877
|
+
function injectNgControl(cva) {
|
|
1006
878
|
const ngControl = inject(NgControl, { self: true, optional: true });
|
|
1007
879
|
if (!ngControl)
|
|
1008
|
-
|
|
880
|
+
return null;
|
|
1009
881
|
if (ngControl instanceof FormControlDirective || ngControl instanceof FormControlName || ngControl instanceof NgModel) {
|
|
882
|
+
if (cva)
|
|
883
|
+
ngControl.valueAccessor = cva;
|
|
1010
884
|
return ngControl;
|
|
1011
885
|
}
|
|
1012
886
|
throw new Error('...');
|
|
1013
887
|
}
|
|
1014
888
|
|
|
1015
|
-
|
|
889
|
+
const directives = [
|
|
890
|
+
BusyOverlayDirective,
|
|
891
|
+
FocusWithinDirective,
|
|
892
|
+
FileDropZoneDirective,
|
|
893
|
+
ClickDoubleDirective,
|
|
894
|
+
LightDismissDirective,
|
|
895
|
+
ContainerSizeDirective,
|
|
896
|
+
LongPressDirective,
|
|
897
|
+
DragSelectDirective,
|
|
898
|
+
DragScrollDirective,
|
|
899
|
+
NoopValueAccessorDirective,
|
|
900
|
+
AutofocusChildDirective,
|
|
901
|
+
AutofocusDelayedDirective
|
|
902
|
+
];
|
|
903
|
+
const components = [ConfirmComponent];
|
|
904
|
+
class YuvCommonModule {
|
|
905
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
906
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, imports: [BusyOverlayDirective,
|
|
907
|
+
FocusWithinDirective,
|
|
908
|
+
FileDropZoneDirective,
|
|
909
|
+
ClickDoubleDirective,
|
|
910
|
+
LightDismissDirective,
|
|
911
|
+
ContainerSizeDirective,
|
|
912
|
+
LongPressDirective,
|
|
913
|
+
DragSelectDirective,
|
|
914
|
+
DragScrollDirective,
|
|
915
|
+
NoopValueAccessorDirective,
|
|
916
|
+
AutofocusChildDirective,
|
|
917
|
+
AutofocusDelayedDirective, ConfirmComponent], exports: [BusyOverlayDirective,
|
|
918
|
+
FocusWithinDirective,
|
|
919
|
+
FileDropZoneDirective,
|
|
920
|
+
ClickDoubleDirective,
|
|
921
|
+
LightDismissDirective,
|
|
922
|
+
ContainerSizeDirective,
|
|
923
|
+
LongPressDirective,
|
|
924
|
+
DragSelectDirective,
|
|
925
|
+
DragScrollDirective,
|
|
926
|
+
NoopValueAccessorDirective,
|
|
927
|
+
AutofocusChildDirective,
|
|
928
|
+
AutofocusDelayedDirective, ConfirmComponent] }); }
|
|
929
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, imports: [components] }); }
|
|
930
|
+
}
|
|
931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, decorators: [{
|
|
932
|
+
type: NgModule,
|
|
933
|
+
args: [{
|
|
934
|
+
imports: [...directives, ...components],
|
|
935
|
+
exports: [...directives, ...components]
|
|
936
|
+
}]
|
|
937
|
+
}] });
|
|
938
|
+
|
|
939
|
+
function getFocusableChildren(element) {
|
|
940
|
+
return [...Array.from(element.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'))].filter((el) => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden'));
|
|
941
|
+
}
|
|
942
|
+
function getFirstFocusableChild(element) {
|
|
943
|
+
return getFocusableChildren(element)[0];
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* Service to store and retrieve layout settings. Those
|
|
948
|
+
* settings are stored on the users device because in
|
|
949
|
+
* general layout settings like panel widths are highly
|
|
950
|
+
* dependent on the current device.
|
|
951
|
+
*/
|
|
952
|
+
class LayoutSettingsService {
|
|
953
|
+
#STORAGE_PREFIX = 'yuv.layout:';
|
|
954
|
+
saveSettings(key, settings) {
|
|
955
|
+
if (typeof settings === 'object') {
|
|
956
|
+
localStorage.setItem(this.#getKey(key), JSON.stringify(settings));
|
|
957
|
+
return true;
|
|
958
|
+
}
|
|
959
|
+
else
|
|
960
|
+
return false;
|
|
961
|
+
}
|
|
962
|
+
getSettings(key) {
|
|
963
|
+
try {
|
|
964
|
+
const v = localStorage.getItem(this.#getKey(key));
|
|
965
|
+
return v ? JSON.parse(v) : undefined;
|
|
966
|
+
}
|
|
967
|
+
catch (e) {
|
|
968
|
+
console.error('Error while parsing layout settings', e);
|
|
969
|
+
return undefined;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
#getKey(key) {
|
|
973
|
+
return `${this.#STORAGE_PREFIX}${key}`;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Clears all layout settings.
|
|
977
|
+
*/
|
|
978
|
+
clearSettings() {
|
|
979
|
+
Object.keys(localStorage).forEach((key) => {
|
|
980
|
+
if (key.startsWith(this.#STORAGE_PREFIX)) {
|
|
981
|
+
localStorage.removeItem(key);
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LayoutSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
986
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LayoutSettingsService, providedIn: 'root' }); }
|
|
987
|
+
}
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LayoutSettingsService, decorators: [{
|
|
989
|
+
type: Injectable,
|
|
990
|
+
args: [{
|
|
991
|
+
providedIn: 'root'
|
|
992
|
+
}]
|
|
993
|
+
}] });
|
|
994
|
+
|
|
995
|
+
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
996
|
+
class AbstractMatFormField {
|
|
1016
997
|
constructor() {
|
|
1017
|
-
this.
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
998
|
+
this.stateChanges = new Subject();
|
|
999
|
+
this.elRef = inject(ElementRef);
|
|
1000
|
+
this.#value = signal(null);
|
|
1001
|
+
this.#id = signal('');
|
|
1002
|
+
this.#placeholder = signal('');
|
|
1003
|
+
this.ngControl = null;
|
|
1004
|
+
this.#focused = signal(false);
|
|
1005
|
+
this.#empty = signal(false);
|
|
1006
|
+
this.#required = signal(false);
|
|
1007
|
+
this.#disabled = signal(false);
|
|
1008
|
+
this.focusHandled = signal(false);
|
|
1009
|
+
this.#errorState = signal(false);
|
|
1010
|
+
}
|
|
1011
|
+
onFocusIn() {
|
|
1012
|
+
this.focused = true;
|
|
1013
|
+
}
|
|
1014
|
+
onFocusout() {
|
|
1015
|
+
this.focused = false;
|
|
1016
|
+
}
|
|
1017
|
+
#value;
|
|
1018
|
+
set value(v) {
|
|
1019
|
+
this.#value.set(v);
|
|
1020
|
+
this.empty = !v;
|
|
1021
|
+
this.stateChanges.next();
|
|
1022
|
+
}
|
|
1023
|
+
get value() {
|
|
1024
|
+
return this.#value();
|
|
1025
|
+
}
|
|
1026
|
+
#id;
|
|
1027
|
+
set id(v) {
|
|
1028
|
+
this.#id.set(v);
|
|
1029
|
+
this.stateChanges.next();
|
|
1030
|
+
}
|
|
1031
|
+
get id() {
|
|
1032
|
+
return this.#id();
|
|
1033
|
+
}
|
|
1034
|
+
#placeholder;
|
|
1035
|
+
set placeholder(v) {
|
|
1036
|
+
this.#placeholder.set(v);
|
|
1037
|
+
this.stateChanges.next();
|
|
1038
|
+
}
|
|
1039
|
+
get placeholder() {
|
|
1040
|
+
return this.#placeholder();
|
|
1041
|
+
}
|
|
1042
|
+
#focused;
|
|
1043
|
+
set focused(f) {
|
|
1044
|
+
this.#focused.set(f);
|
|
1045
|
+
this.stateChanges.next();
|
|
1046
|
+
}
|
|
1047
|
+
get focused() {
|
|
1048
|
+
return this.#focused();
|
|
1049
|
+
}
|
|
1050
|
+
// #shouldLabelFloat = signal<boolean>(false);
|
|
1051
|
+
// set shouldLabelFloat(f: boolean) {
|
|
1052
|
+
// this.#shouldLabelFloat.set(f);
|
|
1053
|
+
// this.stateChanges.next();
|
|
1054
|
+
// }
|
|
1055
|
+
get shouldLabelFloat() {
|
|
1056
|
+
return this.focused || !this.empty || !!this.ngControl?.invalid;
|
|
1057
|
+
}
|
|
1058
|
+
#empty;
|
|
1059
|
+
set empty(f) {
|
|
1060
|
+
this.#empty.set(f);
|
|
1061
|
+
this.stateChanges.next();
|
|
1062
|
+
}
|
|
1063
|
+
get empty() {
|
|
1064
|
+
return this.#empty();
|
|
1065
|
+
}
|
|
1066
|
+
#required;
|
|
1067
|
+
set required(f) {
|
|
1068
|
+
this.#required.set(coerceBooleanProperty(f));
|
|
1069
|
+
this.stateChanges.next();
|
|
1070
|
+
}
|
|
1071
|
+
get required() {
|
|
1072
|
+
return this.#required();
|
|
1073
|
+
}
|
|
1074
|
+
#disabled;
|
|
1075
|
+
set disabled(f) {
|
|
1076
|
+
this.#disabled.set(coerceBooleanProperty(f));
|
|
1077
|
+
this.stateChanges.next();
|
|
1078
|
+
}
|
|
1079
|
+
get disabled() {
|
|
1080
|
+
return this.#disabled();
|
|
1081
|
+
}
|
|
1082
|
+
#errorState;
|
|
1083
|
+
set errorState(f) {
|
|
1084
|
+
this.#errorState.set(coerceBooleanProperty(f));
|
|
1085
|
+
this.stateChanges.next();
|
|
1086
|
+
}
|
|
1087
|
+
get errorState() {
|
|
1088
|
+
return this.#errorState();
|
|
1089
|
+
}
|
|
1090
|
+
setDescribedByIds(ids) {
|
|
1091
|
+
// this.describedBy = ids.join(' ');
|
|
1092
|
+
}
|
|
1093
|
+
onContainerClick(event) {
|
|
1094
|
+
if (this.focusHandled())
|
|
1095
|
+
return;
|
|
1096
|
+
const fe = getFocusableChildren(this.elRef.nativeElement);
|
|
1097
|
+
if (!fe.includes(event.target)) {
|
|
1098
|
+
fe[0].focus();
|
|
1068
1099
|
}
|
|
1069
1100
|
}
|
|
1070
|
-
|
|
1071
|
-
|
|
1101
|
+
onNgOnDestroy() {
|
|
1102
|
+
this.stateChanges.complete();
|
|
1103
|
+
}
|
|
1104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AbstractMatFormField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: AbstractMatFormField, isStandalone: true, selector: "ng-component", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { listeners: { "focusin": "onFocusIn()", "focusout": "onFocusout()" } }, ngImport: i0, template: '', isInline: true }); }
|
|
1106
|
+
}
|
|
1107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AbstractMatFormField, decorators: [{
|
|
1108
|
+
type: Component,
|
|
1109
|
+
args: [{ template: '' }]
|
|
1110
|
+
}], propDecorators: { onFocusIn: [{
|
|
1111
|
+
type: HostListener,
|
|
1112
|
+
args: ['focusin']
|
|
1113
|
+
}], onFocusout: [{
|
|
1114
|
+
type: HostListener,
|
|
1115
|
+
args: ['focusout']
|
|
1116
|
+
}], placeholder: [{
|
|
1117
|
+
type: Input
|
|
1118
|
+
}], required: [{
|
|
1119
|
+
type: Input
|
|
1120
|
+
}], disabled: [{
|
|
1121
|
+
type: Input
|
|
1122
|
+
}] } });
|
|
1123
|
+
|
|
1124
|
+
var DialogSize;
|
|
1125
|
+
(function (DialogSize) {
|
|
1126
|
+
DialogSize["SMALL"] = "small";
|
|
1127
|
+
DialogSize["MEDIUM"] = "medium";
|
|
1128
|
+
DialogSize["LARGE"] = "large";
|
|
1129
|
+
DialogSize["EXTRA_LARGE"] = "extra-large";
|
|
1130
|
+
DialogSize["FULL_SCREEN"] = "full-screen";
|
|
1131
|
+
})(DialogSize || (DialogSize = {}));
|
|
1132
|
+
|
|
1133
|
+
class ConfirmService {
|
|
1134
|
+
#dialog = inject(MatDialog);
|
|
1135
|
+
confirm(data) {
|
|
1136
|
+
return this.#dialog
|
|
1137
|
+
.open(ConfirmComponent, {
|
|
1138
|
+
data
|
|
1139
|
+
})
|
|
1140
|
+
.afterClosed()
|
|
1141
|
+
.pipe(map((result) => !!result));
|
|
1142
|
+
}
|
|
1143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1144
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmService, providedIn: 'root' }); }
|
|
1072
1145
|
}
|
|
1073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmService, decorators: [{
|
|
1074
1147
|
type: Injectable,
|
|
1075
1148
|
args: [{
|
|
1076
1149
|
providedIn: 'root'
|
|
@@ -1081,5 +1154,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1081
1154
|
* Generated bundle index. Do not edit.
|
|
1082
1155
|
*/
|
|
1083
1156
|
|
|
1084
|
-
export { BusyOverlayDirective, ClickDoubleDirective, ContainerSizeDirective,
|
|
1157
|
+
export { AbstractMatFormField, AutofocusChildDirective, AutofocusDelayedDirective, BusyOverlayDirective, ClickDoubleDirective, ConfirmComponent, ConfirmService, ContainerSizeDirective, DialogComponent, DialogSize, DragScrollDirective, DragSelectDirective, DragSelectItemDirective, FileDropZoneDirective, FocusWithinDirective, LayoutSettingsService, LightDismissDirective, LongPressDirective, NoopValueAccessorDirective, YuvCommonModule, getFirstFocusableChild, getFocusableChildren, injectNgControl };
|
|
1085
1158
|
//# sourceMappingURL=yuuvis-client-framework-common.mjs.map
|