@mediafly/js-ui 50.0.7 → 50.0.9

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +19 -9
  3. package/lib/auto-complete/auto-complete-match-renderer.component.d.ts +3 -3
  4. package/lib/auto-complete/auto-complete-match-renderer.component.js +59 -17
  5. package/lib/auto-complete/auto-complete-match-renderer.component.js.map +1 -1
  6. package/lib/auto-complete/auto-complete.component.d.ts +4 -4
  7. package/lib/auto-complete/auto-complete.component.js +62 -21
  8. package/lib/auto-complete/auto-complete.component.js.map +1 -1
  9. package/lib/auto-focus/auto-focus.js +2 -2
  10. package/lib/auto-focus/auto-focus.js.map +1 -1
  11. package/lib/auto-focus/index.d.ts +2 -1
  12. package/lib/auto-focus/index.js.map +1 -1
  13. package/lib/badge/badge.js.map +1 -1
  14. package/lib/color-utils/color-utils.service.js.map +1 -1
  15. package/lib/decorators/index.js +5 -4
  16. package/lib/decorators/index.js.map +1 -1
  17. package/lib/dropdown-menu/dropdown-menu-action.component.d.ts +1 -1
  18. package/lib/dropdown-menu/dropdown-menu-action.component.js +4 -4
  19. package/lib/dropdown-menu/dropdown-menu-action.component.js.map +1 -1
  20. package/lib/dropdown-menu/dropdown-menu-contents.js +33 -16
  21. package/lib/dropdown-menu/dropdown-menu-contents.js.map +1 -1
  22. package/lib/dropdown-menu/dropdown-menu.d.ts +7 -5
  23. package/lib/dropdown-menu/dropdown-menu.js +49 -16
  24. package/lib/dropdown-menu/dropdown-menu.js.map +1 -1
  25. package/lib/feedback/feedback.component.js +1 -1
  26. package/lib/feedback/feedback.component.js.map +1 -1
  27. package/lib/font-selector/font-selector.js.map +1 -1
  28. package/lib/icon/icon.service.js.map +1 -1
  29. package/lib/metadata-form/metadata-form.component.d.ts +1 -0
  30. package/lib/metadata-form/metadata-form.component.js.map +1 -1
  31. package/lib/metadata-form/metadata-form.html +29 -29
  32. package/lib/modal/modal.service.js +24 -3
  33. package/lib/modal/modal.service.js.map +1 -1
  34. package/lib/progress-circle/progress-circle.d.ts +10 -1
  35. package/lib/progress-circle/progress-circle.js +23 -14
  36. package/lib/progress-circle/progress-circle.js.map +1 -1
  37. package/lib/response-handlers/api-success-handlers.d.ts +1 -1
  38. package/lib/response-handlers/api-success-handlers.js.map +1 -1
  39. package/lib/response-handlers/error-response.service.js.map +1 -1
  40. package/lib/response-handlers/feedback-error-handler.d.ts +1 -1
  41. package/lib/response-handlers/feedback-error-handler.js.map +1 -1
  42. package/lib/response-handlers/log-error-handler.d.ts +1 -1
  43. package/lib/response-handlers/log-error-handler.js.map +1 -1
  44. package/lib/rich-text/rich-text.component.d.ts +3 -3
  45. package/lib/rich-text/rich-text.component.js +42 -15
  46. package/lib/rich-text/rich-text.component.js.map +1 -1
  47. package/lib/tabs/tab-html-title.js.map +1 -1
  48. package/lib/tabs/tab.js.map +1 -1
  49. package/lib/tag-input/tag-input.component.d.ts +7 -7
  50. package/lib/tag-input/tag-input.component.js +56 -20
  51. package/lib/tag-input/tag-input.component.js.map +1 -1
  52. package/lib/tsconfig.deploy.tsbuildinfo +75 -70
  53. package/lib/url-modification/url-modification.service.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/components/auto-complete/auto-complete-match-renderer.component.ts +19 -29
  56. package/src/components/auto-complete/auto-complete.component.ts +17 -30
  57. package/src/components/auto-focus/{auto-focus.js → auto-focus.ts} +5 -9
  58. package/src/components/badge/{badge.js → badge.ts} +2 -2
  59. package/src/components/color-utils/color-utils.service.ts +3 -4
  60. package/src/components/decorators/index.ts +19 -9
  61. package/src/components/dropdown-menu/dropdown-menu-action.component.ts +5 -2
  62. package/src/components/dropdown-menu/dropdown-menu-contents.ts +15 -19
  63. package/src/components/dropdown-menu/dropdown-menu.ts +14 -25
  64. package/src/components/feedback/feedback.component.ts +1 -2
  65. package/src/components/font-selector/font-selector.ts +0 -1
  66. package/src/components/icon/icon.service.ts +2 -0
  67. package/src/components/metadata-form/metadata-form.component.ts +1 -0
  68. package/src/components/metadata-form/metadata-form.html +29 -29
  69. package/src/components/modal/modal.service.ts +7 -9
  70. package/src/components/progress-circle/{progress-circle.js → progress-circle.ts} +9 -15
  71. package/src/components/response-handlers/api-success-handlers.ts +1 -2
  72. package/src/components/response-handlers/error-response.service.ts +2 -2
  73. package/src/components/response-handlers/feedback-error-handler.ts +4 -4
  74. package/src/components/response-handlers/log-error-handler.ts +3 -3
  75. package/src/components/rich-text/rich-text.component.ts +18 -23
  76. package/src/components/tabs/tab-html-title.ts +0 -1
  77. package/src/components/tabs/tab.ts +0 -1
  78. package/src/components/tag-input/tag-input.component.ts +19 -30
  79. package/src/components/url-modification/url-modification.service.ts +1 -1
  80. package/tsconfig.tsbuildinfo +25 -26
  81. package/.certs/ca.crt +0 -33
  82. package/.certs/localhost.crt +0 -33
  83. package/.certs/localhost.key +0 -28
  84. package/.certs/localhost.pfx +0 -0
  85. /package/src/components/auto-focus/{index.js → index.ts} +0 -0
@@ -4,40 +4,46 @@ import 'reflect-metadata'
4
4
 
5
5
  export function Component(options: { selector: string } & ng.IComponentOptions) {
6
6
 
7
- return function(target: any) {
7
+ return function(target) {
8
8
 
9
9
  const bindings = Reflect.getMetadata('angular:bindings', target) || {}
10
10
  const injections = Reflect.getMetadata('angular:injections', target) || []
11
- const componentOptions = { controller: target, ...options, bindings }
11
+
12
+ const controllerWithDI = injections.concat(target)
13
+
14
+ const componentOptions = { controller: controllerWithDI, ...options, bindings }
12
15
 
13
16
  if (options.selector.indexOf('-') !== -1) {
14
17
  throw new Error(`The @Component selector "${options.selector}" must be camelCased.`)
15
18
  }
16
19
 
17
- angular.module('app')
18
- .component(options.selector, componentOptions)
20
+ angular.module('app').component(options.selector, componentOptions)
19
21
 
20
22
  target.$inject = injections
21
23
  return target
22
24
  }
23
25
  }
24
26
 
27
+
25
28
  export function Injectable(name: string) {
26
29
 
27
- return function(target: any) {
30
+ return function(target) {
28
31
 
29
32
  const injections = Reflect.getMetadata('angular:injections', target) || []
30
33
  Reflect.defineMetadata('angular:service', name, target)
31
34
 
32
35
  target.$inject = injections
33
36
 
34
- angular.module('app').service(name, target)
37
+ const serviceWithDI = injections.concat(target)
38
+
39
+ angular.module('app').service(name, serviceWithDI)
35
40
  }
36
41
  }
37
42
 
43
+
38
44
  export function Inject(dependency?: string) {
39
45
 
40
- return function(target: any, _propertyKey: string, _propertyIndex: number) {
46
+ return function(target, _propertyKey: string, _propertyIndex: number) {
41
47
 
42
48
  const injections: string[] = Reflect.getMetadata('angular:injections', target) || []
43
49
 
@@ -48,19 +54,23 @@ export function Inject(dependency?: string) {
48
54
  Reflect.defineMetadata('angular:injections', injections, target)
49
55
  }
50
56
  }
57
+
58
+
51
59
  export function Input(binding: '<' | '=' | '=?' | '@' = '<') {
52
60
 
53
- return function(target: any, propertyKey: string) {
61
+ return function(target, propertyKey: string) {
54
62
 
55
63
  const bindings = Reflect.getMetadata('angular:bindings', target.constructor) || {}
56
64
  bindings[propertyKey] = binding
65
+
57
66
  Reflect.defineMetadata('angular:bindings', bindings, target.constructor)
58
67
  }
59
68
  }
60
69
 
70
+
61
71
  export function Output(binding: '&' | '&?' = '&') {
62
72
 
63
- return function(target: any, propertyKey: string) {
73
+ return function(target, propertyKey: string) {
64
74
 
65
75
  const bindings = Reflect.getMetadata('angular:bindings', target.constructor) || {}
66
76
  bindings[propertyKey] = binding
@@ -2,6 +2,7 @@ import { StateOrName } from '@uirouter/angularjs'
2
2
  import { Component, Inject, Input, Output } from '../decorators'
3
3
  import DropdownMenuController from './dropdown-menu'
4
4
 
5
+
5
6
  @Component({
6
7
  require: {
7
8
  parent: '^mflyDropdownMenu'
@@ -11,19 +12,21 @@ import DropdownMenuController from './dropdown-menu'
11
12
  transclude: true
12
13
  })
13
14
  export default class MflyDropdownMenuAction implements ng.IComponentController {
14
- @Output() action?: () => void
15
+
15
16
  @Input('@') actionHref!: string
16
17
  @Input('@') actionHrefTarget!: string
17
18
  @Input() actionSref!: { state: StateOrName, params: {}, options: {} }
18
19
  @Input() disable!: boolean
19
20
 
21
+ @Output() action?: () => void
22
+
20
23
  private parent: DropdownMenuController
21
24
 
22
25
  constructor(
23
26
  @Inject('$attrs') private $attrs: ng.IAttributes,
24
27
  @Inject('$element') private $element: JQuery,
25
28
  @Inject('$rootScope') private $rootScope: JSUIRootScope,
26
- ) { }
29
+ ) {}
27
30
 
28
31
  $onInit() {
29
32
 
@@ -1,9 +1,18 @@
1
- import angular from 'angular'
1
+ import { Component, Inject, Input } from '../decorators'
2
2
  import DropdownMenuController from './dropdown-menu'
3
3
 
4
4
 
5
+ @Component({
6
+ selector: 'mflyDropdownMenuContents',
7
+ require: {
8
+ mflyDropdownMenu: '^mflyDropdownMenu',
9
+ },
10
+ template: require('./dropdown-menu-contents.html'),
11
+ transclude: true,
12
+ })
5
13
  export default class DropdownMenuContentsController implements ng.IComponentController {
6
- containerHeight?: number
14
+
15
+ @Input() containerHeight?: number
7
16
 
8
17
  private deregisterCloseHandler: () => void
9
18
  private deregisterOpenHandler: () => void
@@ -11,10 +20,10 @@ export default class DropdownMenuContentsController implements ng.IComponentCont
11
20
  private mflyDropdownMenu: DropdownMenuController
12
21
 
13
22
  constructor(
14
- private $document: ng.IDocumentService,
15
- private $element: ng.IAugmentedJQuery,
16
- private $rootScope: JSUIRootScope,
17
- private $scope: ng.IScope,
23
+ @Inject('$document') private $document: ng.IDocumentService,
24
+ @Inject('$element') private $element: ng.IAugmentedJQuery,
25
+ @Inject('$rootScope') private $rootScope: JSUIRootScope,
26
+ @Inject('$scope') private $scope: ng.IScope,
18
27
  ) {}
19
28
 
20
29
  $onDestroy() {
@@ -108,16 +117,3 @@ export default class DropdownMenuContentsController implements ng.IComponentCont
108
117
  element[0].style.removeProperty('transform')
109
118
  }
110
119
  }
111
-
112
-
113
- angular.module('app').component('mflyDropdownMenuContents', {
114
- bindings: {
115
- containerHeight: '<'
116
- },
117
- controller: DropdownMenuContentsController,
118
- require: {
119
- mflyDropdownMenu: '^mflyDropdownMenu',
120
- },
121
- template: require('./dropdown-menu-contents.html'),
122
- transclude: true
123
- })
@@ -1,22 +1,26 @@
1
- import angular from 'angular'
2
1
  import _ from 'lodash'
2
+ import { Component, Inject, Input, Output } from '../decorators'
3
3
 
4
4
 
5
+ @Component({
6
+ selector: 'mflyDropdownMenu',
7
+ template: require('./dropdown-menu.html'),
8
+ transclude: true,
9
+ })
5
10
  export default class DropdownMenuController implements ng.IComponentController {
6
11
 
7
- menuStaysOpen?: boolean
8
-
9
- protected isDisabled?: boolean
10
- protected menuTheme?: string
11
- protected pinsTo?: string
12
- protected onOpen?: () => void
12
+ @Input() isDisabled?: boolean
13
+ @Input() menuStaysOpen?: boolean
14
+ @Input('@') menuTheme?: string
15
+ @Input('@') pinsTo?: string
16
+ @Output() onOpen?: () => void
17
+ @Output() onToggle: ({ isOpen }: { isOpen: boolean }) => void
13
18
 
14
19
  private open: boolean
15
- private onToggle: ({ isOpen }: { isOpen: boolean }) => void
16
20
 
17
21
  constructor(
18
- private $element: ng.IAugmentedJQuery,
19
- private $timeout: ng.ITimeoutService,
22
+ @Inject('$element') private $element: ng.IAugmentedJQuery,
23
+ @Inject('$timeout') private $timeout: ng.ITimeoutService,
20
24
  ) {}
21
25
 
22
26
  $onChanges(changes: { isDisabled: ng.IChangesObject<boolean> }) {
@@ -78,18 +82,3 @@ export default class DropdownMenuController implements ng.IComponentController {
78
82
  return !!this.open
79
83
  }
80
84
  }
81
-
82
-
83
- angular.module('app').component('mflyDropdownMenu', {
84
- bindings: {
85
- isDisabled: '<',
86
- menuStaysOpen: '<',
87
- menuTheme: '@',
88
- pinsTo: '@',
89
- onOpen: '&',
90
- onToggle: '&'
91
- },
92
- controller: DropdownMenuController,
93
- template: require('./dropdown-menu.html'),
94
- transclude: true
95
- })
@@ -20,9 +20,8 @@ export interface FeedbackOptions {
20
20
 
21
21
  @Component({
22
22
  selector: 'feedbackManager',
23
- template: require('./feedback.component.html')
23
+ template: require('./feedback.component.html'),
24
24
  })
25
-
26
25
  export default class FeedbackManager implements ng.IComponentController {
27
26
  protected alerts: object[] = []
28
27
  private timer: ng.IPromise<any> | undefined
@@ -12,7 +12,6 @@ export interface FontFamilyStyle {
12
12
  selector: 'mflyFontSelector',
13
13
  template: require('./font-selector.html')
14
14
  })
15
-
16
15
  export default class FontSelectorController implements ng.IComponentController {
17
16
 
18
17
  @Input('<') inputId!: string
@@ -2,7 +2,9 @@ import { Injectable } from '../decorators'
2
2
 
3
3
  @Injectable('iconService')
4
4
  export default class IconService {
5
+
5
6
  static getCssClassForKind(kind?: string): string {
7
+
6
8
  if (!kind) {
7
9
  kind = ''
8
10
  }
@@ -15,6 +15,7 @@ export interface MetadataDefinition {
15
15
  objectDefinition?: MetadataDefinition[]
16
16
  placeholder?: string
17
17
  required: boolean
18
+ readOnly?: boolean
18
19
  type: 'boolean' | 'date' | 'datetime' | 'int' | 'object' | 'string'
19
20
  }
20
21
 
@@ -53,7 +53,7 @@
53
53
  auto-focus="{{ $ctrl.autoFocus && $first }}"
54
54
  input-id="{{ schemaField.name }}"
55
55
  input-type="{{ schemaField.format === 'password' ? 'password' : 'text' }}"
56
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
56
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name] || schemaField.readOnly)"
57
57
  ng-if="!schemaField.isArray"
58
58
  on-change="$ctrl.change({ [schemaField.name]: value })"
59
59
  on-click="$ctrl.inputClick(schemaField.name)"
@@ -71,7 +71,7 @@
71
71
  auto-focus="{{ $ctrl.autoFocus && $first }}"
72
72
  input-id="{{ schemaField.name }}-0"
73
73
  input-type="{{ schemaField.format === 'password' ? 'password' : 'text' }}"
74
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
74
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
75
75
  ng-model-options="{ debounce: 500 }"
76
76
  on-change="$ctrl.change({ [schemaField.name]: value })"
77
77
  on-click="$ctrl.inputClick(schemaField.name)"
@@ -91,7 +91,7 @@
91
91
  <mfly:textinput
92
92
  input-id="{{ schemaField.name }}-{{ $index }}"
93
93
  input-type="{{ schemaField.format === 'password' ? 'password' : 'text' }}"
94
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
94
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
95
95
  on-change="$ctrl.change({ [schemaField.name]: value })"
96
96
  on-click="$ctrl.inputClick(schemaField.name)"
97
97
  on-enter="$ctrl.addArrayMetadata(schemaField)"
@@ -102,7 +102,7 @@
102
102
 
103
103
  <div
104
104
  class="c-metadata-form__add-or-remove__wrapper"
105
- ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}">
105
+ ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])} || schemaField.readOnly">
106
106
  <a class="o-link c-metadata-form__array-row__remove c-metadata-form__remove"
107
107
  id="{{ schemaField.name }}-removeLink-{{ $index }}"
108
108
  ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}"
@@ -114,7 +114,7 @@
114
114
 
115
115
  <div
116
116
  class="c-metadata-form__add-or-remove__wrapper"
117
- ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}">
117
+ ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])} || schemaField.readOnly">
118
118
  <a class="o-link has-icon c-metadata-form__add-or-remove__link"
119
119
  id="{{ schemaField.name }}-addAnotherLink"
120
120
  ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}"
@@ -130,7 +130,7 @@
130
130
  <span ng-if="schemaField.format === 'color'">
131
131
  <mfly:color-input
132
132
  input-id="{{ schemaField.name }}"
133
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
133
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
134
134
  ng-if="!schemaField.isArray"
135
135
  on-change="$ctrl.change({ [schemaField.name]: value })"
136
136
  on-click="$ctrl.inputClick(schemaField.name)"
@@ -146,7 +146,7 @@
146
146
  <mfly:dropdown
147
147
  enum-options="schemaField.enum"
148
148
  input-id="{{ schemaField.name }}"
149
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
149
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
150
150
  is-selected="$ctrl.bulkEnabled[schemaField.name]"
151
151
  ng-if="!schemaField.isArray"
152
152
  on-change="$ctrl.change({ [schemaField.name]: value })"
@@ -163,7 +163,7 @@
163
163
  <mfly:dropdown
164
164
  enum-options="schemaField.enum"
165
165
  input-id="{{ schemaField.name }}-0"
166
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
166
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
167
167
  is-selected="$ctrl.bulkEnabled[schemaField.name]"
168
168
  on-change="$ctrl.change({ [schemaField.name]: value })"
169
169
  on-click="$ctrl.inputClick(schemaField.name)"
@@ -186,7 +186,7 @@
186
186
  <mfly:dropdown
187
187
  enum-options="schemaField.enum"
188
188
  input-id="{{ schemaField.name }}-{{ $index }}"
189
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
189
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
190
190
  is-selected="$ctrl.bulkEnabled[schemaField.name]"
191
191
  on-change="$ctrl.change({ [schemaField.name]: value })"
192
192
  on-click="$ctrl.inputClick(schemaField.name)"
@@ -204,10 +204,10 @@
204
204
 
205
205
  <div
206
206
  class="c-metadata-form__add-or-remove__wrapper"
207
- ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}">
207
+ ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])} || schemaField.readOnly">
208
208
  <a class="o-link has-icon c-metadata-form__add-or-remove__link"
209
209
  id="{{ schemaField.name }}-addAnotherLink"
210
- ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}"
210
+ ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])} || schemaField.readOnly"
211
211
  ng-click="$ctrl.addArrayMetadata(schemaField)"
212
212
  tabindex="0">
213
213
  <span class="far fa-plus-circle"></span>
@@ -237,7 +237,7 @@
237
237
  <!-- Text -->
238
238
  <mfly:textinput
239
239
  input-id="{{ schemaField.name }}-{{ objectField.name }}"
240
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
240
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
241
241
  ng-if="objectField.format !== 'dropdown' && objectField.type !== 'int'"
242
242
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
243
243
  placeholder="{{ objectField.placeholder }}"
@@ -249,7 +249,7 @@
249
249
  <mfly:textinput
250
250
  ng-if="objectField.type === 'int'"
251
251
  input-id="{{ schemaField.name }}-{{ objectField.name }}"
252
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
252
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
253
253
  input-type="number"
254
254
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
255
255
  placeholder="{{ objectField.placeholder }}"
@@ -261,7 +261,7 @@
261
261
  <mfly:dropdown
262
262
  enum-options="objectField.enum"
263
263
  input-id="{{ schemaField.name }}-{{ objectField.name }}"
264
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
264
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
265
265
  ng-if="objectField.format === 'dropdown'"
266
266
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
267
267
  required="{{ objectField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name]) }}"
@@ -288,7 +288,7 @@
288
288
  <!-- Text -->
289
289
  <mfly:textinput
290
290
  input-id="{{ schemaField.name }}-{{ objectField.name }}-0"
291
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
291
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
292
292
  ng-if="objectField.format !== 'dropdown'"
293
293
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
294
294
  placeholder="{{ objectField.placeholder }}"
@@ -304,7 +304,7 @@
304
304
  <mfly:dropdown
305
305
  enum-options="objectField.enum"
306
306
  input-id="{{ schemaField.name }}-{{ objectField.name }}-0"
307
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
307
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
308
308
  ng-if="objectField.format === 'dropdown'"
309
309
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
310
310
  required="{{
@@ -335,7 +335,7 @@
335
335
  <!-- Text -->
336
336
  <mfly:textinput
337
337
  input-id="{{ schemaField.name }}-{{ objectField.name }}-{{ entryIndex }}"
338
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
338
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
339
339
  ng-if="objectField.format !== 'dropdown'"
340
340
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
341
341
  placeholder="{{ objectField.placeholder }}"
@@ -347,7 +347,7 @@
347
347
  <mfly:dropdown
348
348
  enum-options="objectField.enum"
349
349
  input-id="{{ schemaField.name }}-{{ objectField.name }}-{{ entryIndex }}"
350
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
350
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
351
351
  ng-if="objectField.format === 'dropdown'"
352
352
  on-change="$ctrl.change({ [schemaField.name]: { [objectField.name]: value }})"
353
353
  required="{{ objectField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name]) }}"
@@ -367,10 +367,10 @@
367
367
 
368
368
  <div
369
369
  class="c-metadata-form__add-or-remove__wrapper"
370
- ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}">
370
+ ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])} || schemaField.readOnly">
371
371
  <a class="o-link has-icon c-metadata-form__add-or-remove__link"
372
372
  id="{{ schemaField.name }}-addAnotherLink"
373
- ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])}"
373
+ ng-class="{'is-disabled': $ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])} || schemaField.readOnly"
374
374
  ng-click="$ctrl.addArrayMetadata(schemaField)"
375
375
  ng-if="schemaField.isArray">
376
376
  <span class="far fa-plus-circle"></span>
@@ -382,7 +382,7 @@
382
382
  <!-- Tags -->
383
383
  <span ng-if="schemaField.format === 'tag'">
384
384
  <mfly:tag-input
385
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
385
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
386
386
  input-id="{{ schemaField.name }}"
387
387
  ng-model="$ctrl.metadata[schemaField.name]"
388
388
  ng-model-options="{ allowInvalid: true }"
@@ -395,7 +395,7 @@
395
395
  <span ng-if="schemaField.format === 'multiline'">
396
396
  <mfly:textarea
397
397
  input-id="{{ schemaField.name }}"
398
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
398
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
399
399
  on-change="$ctrl.change({ [schemaField.name]: value })"
400
400
  on-click="$ctrl.inputClick(schemaField.name)"
401
401
  required="{{ schemaField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name]) }}"
@@ -407,7 +407,7 @@
407
407
  <div ng-if="schemaField.type === 'date' && !schemaField.required" class="c-metadata-form__date-input">
408
408
  <mfly:date-input
409
409
  input-id="{{ schemaField.name }}"
410
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
410
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
411
411
  ng-model="$ctrl.metadata[schemaField.name]"
412
412
  on-change="$ctrl.change({ [schemaField.name]: value })">
413
413
  </mfly:date-input>
@@ -416,7 +416,7 @@
416
416
  <div ng-if="schemaField.type === 'date' && schemaField.required" class="c-metadata-form__date-input">
417
417
  <mfly:date-input
418
418
  input-id="{{ schemaField.name }}"
419
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
419
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
420
420
  ng-model="$ctrl.metadata[schemaField.name]"
421
421
  on-change="$ctrl.change({ [schemaField.name]: value })"
422
422
  required="schemaField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name])">
@@ -429,7 +429,7 @@
429
429
  input-id="{{ schemaField.name }}"
430
430
  ng-model="$ctrl.metadata[schemaField.name]"
431
431
  type="'datetime'"
432
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
432
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
433
433
  is-required="{{ schemaField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name]) }}"
434
434
  on-open="$ctrl.inputClick(schemaField.name)">
435
435
  </mfly:date-time-zone-picker>
@@ -444,7 +444,7 @@
444
444
  class="o-form-control"
445
445
  id="{{ schemaField.name }}"
446
446
  ng-change="$ctrl.spinnerCheck($viewValue)"
447
- ng-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
447
+ ng-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
448
448
  ng-model="$ctrl.lookupName[schemaField.name]"
449
449
  ng-init="$ctrl.initLookup(schemaField, $ctrl.metadata[schemaField.name])"
450
450
  placeholder="{{ schemaField.placeholder }}"
@@ -464,7 +464,7 @@
464
464
  checkbox-changed="$ctrl.change({ [schemaField.name]: value })"
465
465
  description="{{ schemaField.description }}"
466
466
  input-id="{{ schemaField.name }}"
467
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
467
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
468
468
  label="{{ schemaField.label }}"
469
469
  on-click="$ctrl.inputClick(schemaField.name)"
470
470
  required="{{ schemaField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name]) }}"
@@ -511,7 +511,7 @@
511
511
  <mfly:textinput
512
512
  input-id="{{ schemaField.name }}"
513
513
  input-type="number"
514
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
514
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
515
515
  on-change="$ctrl.change({ [schemaField.name]: value })"
516
516
  on-click="$ctrl.inputClick(schemaField.name)"
517
517
  required="{{ schemaField.required && (!$ctrl.isBulkEdit || $ctrl.bulkEnabled[schemaField.name]) }}"
@@ -523,7 +523,7 @@
523
523
  <div ng-if="schemaField.format === 'lookup' && schemaField.type === 'object'" class="u-position-relative">
524
524
  <mfly:tag-input
525
525
  external-input="true"
526
- is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name])"
526
+ is-disabled="$ctrl.isDisabled || ($ctrl.isBulkEdit && !$ctrl.bulkEnabled[schemaField.name]) || schemaField.readOnly"
527
527
  inline-tags="true"
528
528
  input-id="{{ schemaField.name }}"
529
529
  ng-model="$ctrl.metadata[schemaField.name]"
@@ -1,5 +1,6 @@
1
1
  import angular from 'angular'
2
2
  import _ from 'lodash'
3
+ import { Inject, Injectable } from '../decorators'
3
4
 
4
5
  interface Modal {
5
6
  element: JQuery
@@ -12,17 +13,17 @@ interface ModalScope extends ng.IScope {
12
13
  $ctrl?: ng.IController
13
14
  }
14
15
 
15
-
16
+ @Injectable('mflyModalService')
16
17
  export default class MflyModalService {
17
18
 
18
19
  currentModal: Modal | undefined
19
20
 
20
21
  constructor(
21
- private $compile: ng.ICompileService,
22
- private $document: ng.IDocumentService,
23
- private $q: ng.IQService,
24
- private $rootScope: ng.IRootScopeService,
25
- private $timeout: ng.ITimeoutService,
22
+ @Inject('$compile') private $compile: ng.ICompileService,
23
+ @Inject('$document') private $document: ng.IDocumentService,
24
+ @Inject('$q') private $q: ng.IQService,
25
+ @Inject('$rootScope') private $rootScope: ng.IRootScopeService,
26
+ @Inject('$timeout') private $timeout: ng.ITimeoutService,
26
27
  ) {}
27
28
 
28
29
  /**
@@ -166,6 +167,3 @@ export default class MflyModalService {
166
167
  return `<${_.kebabCase(tagName)}${attributesString}></${_.kebabCase(tagName)}>`
167
168
  }
168
169
  }
169
-
170
-
171
- angular.module('app').service('mflyModalService', MflyModalService)
@@ -1,12 +1,15 @@
1
- import angular from 'angular'
2
- import template from './progress-circle.html'
1
+ import { Component, Input } from '../decorators'
3
2
 
4
3
 
5
- class MflyProgressCircleController {
4
+ @Component({
5
+ selector: 'mflyProgressCircle',
6
+ template: require('./progress-circle.html'),
7
+ })
8
+ export default class MflyProgressCircleController {
6
9
 
7
- constructor () {
8
- this.rotationTransformStyle = { transform: `rotate(0deg)` }
9
- }
10
+ @Input() percent: number
11
+
12
+ protected rotationStyle = { transform: `rotate(0deg)` }
10
13
 
11
14
  // Takes a number on 0-100 scale (will clamp outliers).
12
15
  // Returns a style object containing a CSS rotation transform.
@@ -25,12 +28,3 @@ class MflyProgressCircleController {
25
28
  }
26
29
  }
27
30
  }
28
-
29
-
30
- angular.module('app').component('mflyProgressCircle', {
31
- template,
32
- bindings: {
33
- percent: '<'
34
- },
35
- controller: MflyProgressCircleController
36
- })
@@ -1,10 +1,9 @@
1
1
  import { Injectable } from '../decorators'
2
2
 
3
3
  @Injectable('apiSuccessHandler')
4
-
5
4
  export default class ApiSuccessHandler {
6
5
 
7
- response<T>(response: ng.IHttpPromiseCallbackArg<T>): T {
6
+ response<T>(response: ng.IHttpResponse<T>): T {
8
7
 
9
8
  if (response.data === undefined) {
10
9
  throw new Error('Response data is undefined.')
@@ -1,12 +1,12 @@
1
1
  import { Inject, Injectable } from '../decorators'
2
2
 
3
- @Injectable('errorResponseService')
4
3
 
4
+ @Injectable('errorResponseService')
5
5
  export default class ErrorResponseService {
6
6
 
7
7
  constructor(
8
8
  @Inject('translateFactory') private translateFactory,
9
- ) { }
9
+ ) {}
10
10
 
11
11
  getErrorMessage(response: { data?: { message?: string, Message?: string } }) {
12
12
 
@@ -2,17 +2,17 @@ import { Inject, Injectable } from '../decorators'
2
2
  import FeedbackService from '../feedback/feedback.service'
3
3
  import ErrorResponseService from './error-response.service'
4
4
 
5
- @Injectable('feedbackErrorHandler')
6
5
 
6
+ @Injectable('feedbackErrorHandler')
7
7
  export default class FeedbackErrorHandler {
8
8
 
9
9
  constructor(
10
10
  @Inject('$q') private $q: ng.IQService,
11
11
  @Inject('errorResponseService') private errorResponseService: ErrorResponseService,
12
- @Inject('feedbackService') private feedbackService: FeedbackService
13
- ) { }
12
+ @Inject('feedbackService') private feedbackService: FeedbackService,
13
+ ) {}
14
14
 
15
- responseError(response: ng.IHttpPromiseCallbackArg<{ message?: string }>) {
15
+ responseError(response: ng.IHttpResponse<{ message?: string }>) {
16
16
 
17
17
  if (this.errorResponseService.shouldHandleError(response)) {
18
18
 
@@ -1,14 +1,14 @@
1
1
  import { Inject, Injectable } from '../decorators'
2
2
 
3
- @Injectable('logErrorHandler')
4
3
 
4
+ @Injectable('logErrorHandler')
5
5
  export default class LogErrorHandler {
6
6
 
7
7
  constructor(
8
8
  @Inject('$log') private $log: ng.ILogService,
9
- ) { }
9
+ ) {}
10
10
 
11
- responseError(response: ng.IHttpPromiseCallbackArg<{ message?: string }>) {
11
+ responseError(response: ng.IHttpResponse<{ message?: string }>) {
12
12
 
13
13
  this.$log.error(response)
14
14
  }