@eclipse-scout/svg 22.0.41 → 23.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +277 -210
- package/package.json +14 -11
- package/src/main/js/index.less +6 -7
- package/src/main/js/index.ts +21 -0
- package/src/main/js/svg/SvgField.less +6 -7
- package/src/main/js/svg/SvgField.ts +62 -0
- package/src/main/js/svg/SvgFieldAdapter.ts +29 -0
- package/src/main/js/svg/SvgFieldEventMap.ts +19 -0
- package/src/main/js/svg/SvgFieldModel.ts +14 -0
- package/target/dist/d.ts/index.d.ts +7 -0
- package/target/dist/d.ts/index.d.ts.map +1 -0
- package/target/dist/d.ts/svg/SvgField.d.ts +14 -0
- package/target/dist/d.ts/svg/SvgField.d.ts.map +1 -0
- package/target/dist/d.ts/svg/SvgFieldAdapter.d.ts +8 -0
- package/target/dist/d.ts/svg/SvgFieldAdapter.d.ts.map +1 -0
- package/target/dist/d.ts/svg/SvgFieldEventMap.d.ts +9 -0
- package/target/dist/d.ts/svg/SvgFieldEventMap.d.ts.map +1 -0
- package/target/dist/d.ts/svg/SvgFieldModel.d.ts +5 -0
- package/target/dist/d.ts/svg/SvgFieldModel.d.ts.map +1 -0
- package/target/dist/dev/eclipse-scout-svg.js +273 -0
- package/target/dist/dev/eclipse-scout-svg.js.map +1 -0
- package/target/dist/prod/eclipse-scout-svg-91e2d79d7c56c352ec4e.min.js +3 -0
- package/target/dist/prod/eclipse-scout-svg-91e2d79d7c56c352ec4e.min.js.map +1 -0
- package/src/main/js/index.js +0 -17
- package/src/main/js/svg/SvgField.js +0 -65
- package/src/main/js/svg/SvgFieldAdapter.js +0 -32
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
3
|
-
* All rights reserved. This program and the accompanying materials
|
|
4
|
-
* are made available under the terms of the Eclipse Public License v1.0
|
|
5
|
-
* which accompanies this distribution, and is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-v10.html
|
|
2
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
7
3
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
10
9
|
*/
|
|
11
10
|
.svg-field > .field {
|
|
12
11
|
overflow: hidden;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import {AppLinkKeyStroke, FormField} from '@eclipse-scout/core';
|
|
11
|
+
import $ from 'jquery';
|
|
12
|
+
import {SvgFieldEventMap, SvgFieldModel} from '../index';
|
|
13
|
+
|
|
14
|
+
export class SvgField extends FormField implements SvgFieldModel {
|
|
15
|
+
declare model: SvgFieldModel;
|
|
16
|
+
declare eventMap: SvgFieldEventMap;
|
|
17
|
+
|
|
18
|
+
svgDocument: string;
|
|
19
|
+
|
|
20
|
+
protected override _render() {
|
|
21
|
+
this.addContainer(this.$parent, 'svg-field');
|
|
22
|
+
this.addLabel();
|
|
23
|
+
this.addField(this.$parent.makeDiv());
|
|
24
|
+
this.addMandatoryIndicator();
|
|
25
|
+
this.addStatus();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected override _renderProperties() {
|
|
29
|
+
super._renderProperties();
|
|
30
|
+
this._renderSvgDocument();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
protected override _initKeyStrokeContext() {
|
|
34
|
+
super._initKeyStrokeContext();
|
|
35
|
+
this.keyStrokeContext.registerKeyStroke(new AppLinkKeyStroke(this, this._onAppLinkAction));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
protected _renderSvgDocument() {
|
|
39
|
+
if (!this.svgDocument) {
|
|
40
|
+
this.$field.empty();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.$field.html(this.svgDocument);
|
|
44
|
+
this.$field.find('.app-link')
|
|
45
|
+
.on('click', this._onAppLinkAction.bind(this))
|
|
46
|
+
.attr('tabindex', '0')
|
|
47
|
+
.unfocusable();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected _onAppLinkAction(event: JQuery.KeyboardEventBase | JQuery.ClickEvent) {
|
|
51
|
+
let $target = $(event.delegateTarget);
|
|
52
|
+
let ref = $target.data('ref') as string;
|
|
53
|
+
this._triggerAppLinkAction(ref);
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
protected _triggerAppLinkAction(ref: string) {
|
|
58
|
+
this.trigger('appLinkAction', {
|
|
59
|
+
ref: ref
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import {Event, FormFieldAdapter} from '@eclipse-scout/core';
|
|
11
|
+
import {SvgFieldAppLinkActionEvent} from './SvgFieldEventMap';
|
|
12
|
+
import {SvgField} from '../index';
|
|
13
|
+
|
|
14
|
+
export class SvgFieldAdapter extends FormFieldAdapter {
|
|
15
|
+
|
|
16
|
+
protected _onWidgetAppLinkAction(event: SvgFieldAppLinkActionEvent) {
|
|
17
|
+
this._send('appLinkAction', {
|
|
18
|
+
ref: event.ref
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
protected override _onWidgetEvent(event: Event<SvgField>) {
|
|
23
|
+
if (event.type === 'appLinkAction') {
|
|
24
|
+
this._onWidgetAppLinkAction(event as SvgFieldAppLinkActionEvent);
|
|
25
|
+
} else {
|
|
26
|
+
super._onWidgetEvent(event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import {Event, FormFieldEventMap} from '@eclipse-scout/core';
|
|
11
|
+
import {SvgField} from '../index';
|
|
12
|
+
|
|
13
|
+
export interface SvgFieldAppLinkActionEvent<T = SvgField> extends Event<T> {
|
|
14
|
+
ref: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SvgFieldEventMap extends FormFieldEventMap {
|
|
18
|
+
'appLinkAction': SvgFieldAppLinkActionEvent;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import {FormFieldModel} from '@eclipse-scout/core';
|
|
11
|
+
|
|
12
|
+
export interface SvgFieldModel extends FormFieldModel {
|
|
13
|
+
svgDocument?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/js/index.ts"],"names":[],"mappings":"AAWA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAEtC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormField } from '@eclipse-scout/core';
|
|
2
|
+
import { SvgFieldEventMap, SvgFieldModel } from '../index';
|
|
3
|
+
export declare class SvgField extends FormField implements SvgFieldModel {
|
|
4
|
+
model: SvgFieldModel;
|
|
5
|
+
eventMap: SvgFieldEventMap;
|
|
6
|
+
svgDocument: string;
|
|
7
|
+
protected _render(): void;
|
|
8
|
+
protected _renderProperties(): void;
|
|
9
|
+
protected _initKeyStrokeContext(): void;
|
|
10
|
+
protected _renderSvgDocument(): void;
|
|
11
|
+
protected _onAppLinkAction(event: JQuery.KeyboardEventBase | JQuery.ClickEvent): void;
|
|
12
|
+
protected _triggerAppLinkAction(ref: string): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SvgField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgField.d.ts","sourceRoot":"","sources":["../../../../src/main/js/svg/SvgField.ts"],"names":[],"mappings":"AASA,OAAO,EAAmB,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAEzD,qBAAa,QAAS,SAAQ,SAAU,YAAW,aAAa;IACtD,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC;IAEnC,WAAW,EAAE,MAAM,CAAC;cAED,OAAO;cAQP,iBAAiB;cAKjB,qBAAqB;IAKxC,SAAS,CAAC,kBAAkB;IAY5B,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC,UAAU;IAO9E,SAAS,CAAC,qBAAqB,CAAC,GAAG,EAAE,MAAM;CAK5C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Event, FormFieldAdapter } from '@eclipse-scout/core';
|
|
2
|
+
import { SvgFieldAppLinkActionEvent } from './SvgFieldEventMap';
|
|
3
|
+
import { SvgField } from '../index';
|
|
4
|
+
export declare class SvgFieldAdapter extends FormFieldAdapter {
|
|
5
|
+
protected _onWidgetAppLinkAction(event: SvgFieldAppLinkActionEvent): void;
|
|
6
|
+
protected _onWidgetEvent(event: Event<SvgField>): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SvgFieldAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgFieldAdapter.d.ts","sourceRoot":"","sources":["../../../../src/main/js/svg/SvgFieldAdapter.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAElC,qBAAa,eAAgB,SAAQ,gBAAgB;IAEnD,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,0BAA0B;cAM/C,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC;CAOzD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event, FormFieldEventMap } from '@eclipse-scout/core';
|
|
2
|
+
import { SvgField } from '../index';
|
|
3
|
+
export interface SvgFieldAppLinkActionEvent<T = SvgField> extends Event<T> {
|
|
4
|
+
ref: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SvgFieldEventMap extends FormFieldEventMap {
|
|
7
|
+
'appLinkAction': SvgFieldAppLinkActionEvent;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=SvgFieldEventMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgFieldEventMap.d.ts","sourceRoot":"","sources":["../../../../src/main/js/svg/SvgFieldEventMap.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,KAAK,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,0BAA0B,CAAC,CAAC,GAAG,QAAQ,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACxE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,eAAe,EAAE,0BAA0B,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgFieldModel.d.ts","sourceRoot":"","sources":["../../../../src/main/js/svg/SvgFieldModel.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__eclipse_scout_core_ec9759ad__ from "@eclipse-scout/core";
|
|
2
|
+
/******/ var __webpack_modules__ = ({
|
|
3
|
+
|
|
4
|
+
/***/ "./src/main/js/index.ts":
|
|
5
|
+
/*!******************************!*\
|
|
6
|
+
!*** ./src/main/js/index.ts ***!
|
|
7
|
+
\******************************/
|
|
8
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9
|
+
|
|
10
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12
|
+
/* harmony export */ "SvgField": () => (/* reexport safe */ _svg_SvgField__WEBPACK_IMPORTED_MODULE_1__.SvgField),
|
|
13
|
+
/* harmony export */ "SvgFieldAdapter": () => (/* reexport safe */ _svg_SvgFieldAdapter__WEBPACK_IMPORTED_MODULE_4__.SvgFieldAdapter),
|
|
14
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
15
|
+
/* harmony export */ });
|
|
16
|
+
/* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
|
|
17
|
+
/* harmony import */ var _svg_SvgField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./svg/SvgField */ "./src/main/js/svg/SvgField.ts");
|
|
18
|
+
/* harmony import */ var _svg_SvgFieldModel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./svg/SvgFieldModel */ "./src/main/js/svg/SvgFieldModel.ts");
|
|
19
|
+
/* harmony import */ var _svg_SvgFieldEventMap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./svg/SvgFieldEventMap */ "./src/main/js/svg/SvgFieldEventMap.ts");
|
|
20
|
+
/* harmony import */ var _svg_SvgFieldAdapter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./svg/SvgFieldAdapter */ "./src/main/js/svg/SvgFieldAdapter.ts");
|
|
21
|
+
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ "./src/main/js/index.ts");
|
|
22
|
+
/*
|
|
23
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
24
|
+
*
|
|
25
|
+
* This program and the accompanying materials are made
|
|
26
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
27
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
28
|
+
*
|
|
29
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_index__WEBPACK_IMPORTED_MODULE_5__);
|
|
38
|
+
_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.ObjectFactory.get().registerNamespace('scout', _index__WEBPACK_IMPORTED_MODULE_5__);
|
|
39
|
+
|
|
40
|
+
/***/ }),
|
|
41
|
+
|
|
42
|
+
/***/ "./src/main/js/svg/SvgField.ts":
|
|
43
|
+
/*!*************************************!*\
|
|
44
|
+
!*** ./src/main/js/svg/SvgField.ts ***!
|
|
45
|
+
\*************************************/
|
|
46
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
47
|
+
|
|
48
|
+
__webpack_require__.r(__webpack_exports__);
|
|
49
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
50
|
+
/* harmony export */ "SvgField": () => (/* binding */ SvgField)
|
|
51
|
+
/* harmony export */ });
|
|
52
|
+
/* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
|
|
53
|
+
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ "jquery");
|
|
54
|
+
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);
|
|
55
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
56
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
57
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
58
|
+
/*
|
|
59
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
60
|
+
*
|
|
61
|
+
* This program and the accompanying materials are made
|
|
62
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
63
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
64
|
+
*
|
|
65
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class SvgField extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.FormField {
|
|
70
|
+
constructor() {
|
|
71
|
+
super(...arguments);
|
|
72
|
+
_defineProperty(this, "svgDocument", void 0);
|
|
73
|
+
}
|
|
74
|
+
_render() {
|
|
75
|
+
this.addContainer(this.$parent, 'svg-field');
|
|
76
|
+
this.addLabel();
|
|
77
|
+
this.addField(this.$parent.makeDiv());
|
|
78
|
+
this.addMandatoryIndicator();
|
|
79
|
+
this.addStatus();
|
|
80
|
+
}
|
|
81
|
+
_renderProperties() {
|
|
82
|
+
super._renderProperties();
|
|
83
|
+
this._renderSvgDocument();
|
|
84
|
+
}
|
|
85
|
+
_initKeyStrokeContext() {
|
|
86
|
+
super._initKeyStrokeContext();
|
|
87
|
+
this.keyStrokeContext.registerKeyStroke(new _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.AppLinkKeyStroke(this, this._onAppLinkAction));
|
|
88
|
+
}
|
|
89
|
+
_renderSvgDocument() {
|
|
90
|
+
if (!this.svgDocument) {
|
|
91
|
+
this.$field.empty();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.$field.html(this.svgDocument);
|
|
95
|
+
this.$field.find('.app-link').on('click', this._onAppLinkAction.bind(this)).attr('tabindex', '0').unfocusable();
|
|
96
|
+
}
|
|
97
|
+
_onAppLinkAction(event) {
|
|
98
|
+
let $target = jquery__WEBPACK_IMPORTED_MODULE_1___default()(event.delegateTarget);
|
|
99
|
+
let ref = $target.data('ref');
|
|
100
|
+
this._triggerAppLinkAction(ref);
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
}
|
|
103
|
+
_triggerAppLinkAction(ref) {
|
|
104
|
+
this.trigger('appLinkAction', {
|
|
105
|
+
ref: ref
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/***/ }),
|
|
111
|
+
|
|
112
|
+
/***/ "./src/main/js/svg/SvgFieldAdapter.ts":
|
|
113
|
+
/*!********************************************!*\
|
|
114
|
+
!*** ./src/main/js/svg/SvgFieldAdapter.ts ***!
|
|
115
|
+
\********************************************/
|
|
116
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
117
|
+
|
|
118
|
+
__webpack_require__.r(__webpack_exports__);
|
|
119
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120
|
+
/* harmony export */ "SvgFieldAdapter": () => (/* binding */ SvgFieldAdapter)
|
|
121
|
+
/* harmony export */ });
|
|
122
|
+
/* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
|
|
123
|
+
/*
|
|
124
|
+
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
125
|
+
*
|
|
126
|
+
* This program and the accompanying materials are made
|
|
127
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
128
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
129
|
+
*
|
|
130
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
class SvgFieldAdapter extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.FormFieldAdapter {
|
|
134
|
+
_onWidgetAppLinkAction(event) {
|
|
135
|
+
this._send('appLinkAction', {
|
|
136
|
+
ref: event.ref
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
_onWidgetEvent(event) {
|
|
140
|
+
if (event.type === 'appLinkAction') {
|
|
141
|
+
this._onWidgetAppLinkAction(event);
|
|
142
|
+
} else {
|
|
143
|
+
super._onWidgetEvent(event);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/***/ }),
|
|
149
|
+
|
|
150
|
+
/***/ "./src/main/js/svg/SvgFieldEventMap.ts":
|
|
151
|
+
/*!*********************************************!*\
|
|
152
|
+
!*** ./src/main/js/svg/SvgFieldEventMap.ts ***!
|
|
153
|
+
\*********************************************/
|
|
154
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
155
|
+
|
|
156
|
+
__webpack_require__.r(__webpack_exports__);
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
/***/ }),
|
|
160
|
+
|
|
161
|
+
/***/ "./src/main/js/svg/SvgFieldModel.ts":
|
|
162
|
+
/*!******************************************!*\
|
|
163
|
+
!*** ./src/main/js/svg/SvgFieldModel.ts ***!
|
|
164
|
+
\******************************************/
|
|
165
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
166
|
+
|
|
167
|
+
__webpack_require__.r(__webpack_exports__);
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
/***/ }),
|
|
171
|
+
|
|
172
|
+
/***/ "jquery":
|
|
173
|
+
/*!*************************!*\
|
|
174
|
+
!*** external "jquery" ***!
|
|
175
|
+
\*************************/
|
|
176
|
+
/***/ ((module) => {
|
|
177
|
+
|
|
178
|
+
module.exports = require("jquery");
|
|
179
|
+
|
|
180
|
+
/***/ }),
|
|
181
|
+
|
|
182
|
+
/***/ "@eclipse-scout/core":
|
|
183
|
+
/*!**************************************!*\
|
|
184
|
+
!*** external "@eclipse-scout/core" ***!
|
|
185
|
+
\**************************************/
|
|
186
|
+
/***/ ((module) => {
|
|
187
|
+
|
|
188
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
189
|
+
var y = x => () => x
|
|
190
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__eclipse_scout_core_ec9759ad__;
|
|
191
|
+
|
|
192
|
+
/***/ })
|
|
193
|
+
|
|
194
|
+
/******/ });
|
|
195
|
+
/************************************************************************/
|
|
196
|
+
/******/ // The module cache
|
|
197
|
+
/******/ var __webpack_module_cache__ = {};
|
|
198
|
+
/******/
|
|
199
|
+
/******/ // The require function
|
|
200
|
+
/******/ function __webpack_require__(moduleId) {
|
|
201
|
+
/******/ // Check if module is in cache
|
|
202
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
203
|
+
/******/ if (cachedModule !== undefined) {
|
|
204
|
+
/******/ return cachedModule.exports;
|
|
205
|
+
/******/ }
|
|
206
|
+
/******/ // Create a new module (and put it into the cache)
|
|
207
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
208
|
+
/******/ // no module.id needed
|
|
209
|
+
/******/ // no module.loaded needed
|
|
210
|
+
/******/ exports: {}
|
|
211
|
+
/******/ };
|
|
212
|
+
/******/
|
|
213
|
+
/******/ // Execute the module function
|
|
214
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
215
|
+
/******/
|
|
216
|
+
/******/ // Return the exports of the module
|
|
217
|
+
/******/ return module.exports;
|
|
218
|
+
/******/ }
|
|
219
|
+
/******/
|
|
220
|
+
/************************************************************************/
|
|
221
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
222
|
+
/******/ (() => {
|
|
223
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
224
|
+
/******/ __webpack_require__.n = (module) => {
|
|
225
|
+
/******/ var getter = module && module.__esModule ?
|
|
226
|
+
/******/ () => (module['default']) :
|
|
227
|
+
/******/ () => (module);
|
|
228
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
229
|
+
/******/ return getter;
|
|
230
|
+
/******/ };
|
|
231
|
+
/******/ })();
|
|
232
|
+
/******/
|
|
233
|
+
/******/ /* webpack/runtime/define property getters */
|
|
234
|
+
/******/ (() => {
|
|
235
|
+
/******/ // define getter functions for harmony exports
|
|
236
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
237
|
+
/******/ for(var key in definition) {
|
|
238
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
239
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
240
|
+
/******/ }
|
|
241
|
+
/******/ }
|
|
242
|
+
/******/ };
|
|
243
|
+
/******/ })();
|
|
244
|
+
/******/
|
|
245
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
246
|
+
/******/ (() => {
|
|
247
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
248
|
+
/******/ })();
|
|
249
|
+
/******/
|
|
250
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
251
|
+
/******/ (() => {
|
|
252
|
+
/******/ // define __esModule on exports
|
|
253
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
254
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
255
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
256
|
+
/******/ }
|
|
257
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
258
|
+
/******/ };
|
|
259
|
+
/******/ })();
|
|
260
|
+
/******/
|
|
261
|
+
/************************************************************************/
|
|
262
|
+
/******/
|
|
263
|
+
/******/ // startup
|
|
264
|
+
/******/ // Load entry module and return exports
|
|
265
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
266
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/main/js/index.ts");
|
|
267
|
+
/******/ var __webpack_exports__SvgField = __webpack_exports__.SvgField;
|
|
268
|
+
/******/ var __webpack_exports__SvgFieldAdapter = __webpack_exports__.SvgFieldAdapter;
|
|
269
|
+
/******/ var __webpack_exports__default = __webpack_exports__["default"];
|
|
270
|
+
/******/ export { __webpack_exports__SvgField as SvgField, __webpack_exports__SvgFieldAdapter as SvgFieldAdapter, __webpack_exports__default as default };
|
|
271
|
+
/******/
|
|
272
|
+
|
|
273
|
+
//# sourceMappingURL=eclipse-scout-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eclipse-scout-svg.js","mappings":"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","sources":["webpack:///./src/main/js/index.ts","webpack:///./src/main/js/svg/SvgField.ts","webpack:///./src/main/js/svg/SvgFieldAdapter.ts","webpack:///external commonjs \"jquery\"","webpack:///external module \"@eclipse-scout/core\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/before-startup","webpack:///webpack/startup","webpack:///webpack/after-startup"],"sourcesContent":["/*\n * Copyright (c) 2010, 2023 BSI Business Systems Integration AG\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {ObjectFactory} from '@eclipse-scout/core';\n\nexport * from './svg/SvgField';\nexport * from './svg/SvgFieldModel';\nexport * from './svg/SvgFieldEventMap';\nexport * from './svg/SvgFieldAdapter';\n\nimport * as self from './index';\n\nexport default self;\n\nObjectFactory.get().registerNamespace('scout', self);\n","/*\n * Copyright (c) 2010, 2023 BSI Business Systems Integration AG\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {AppLinkKeyStroke, FormField} from '@eclipse-scout/core';\nimport $ from 'jquery';\nimport {SvgFieldEventMap, SvgFieldModel} from '../index';\n\nexport class SvgField extends FormField implements SvgFieldModel {\n declare model: SvgFieldModel;\n declare eventMap: SvgFieldEventMap;\n\n svgDocument: string;\n\n protected override _render() {\n this.addContainer(this.$parent, 'svg-field');\n this.addLabel();\n this.addField(this.$parent.makeDiv());\n this.addMandatoryIndicator();\n this.addStatus();\n }\n\n protected override _renderProperties() {\n super._renderProperties();\n this._renderSvgDocument();\n }\n\n protected override _initKeyStrokeContext() {\n super._initKeyStrokeContext();\n this.keyStrokeContext.registerKeyStroke(new AppLinkKeyStroke(this, this._onAppLinkAction));\n }\n\n protected _renderSvgDocument() {\n if (!this.svgDocument) {\n this.$field.empty();\n return;\n }\n this.$field.html(this.svgDocument);\n this.$field.find('.app-link')\n .on('click', this._onAppLinkAction.bind(this))\n .attr('tabindex', '0')\n .unfocusable();\n }\n\n protected _onAppLinkAction(event: JQuery.KeyboardEventBase | JQuery.ClickEvent) {\n let $target = $(event.delegateTarget);\n let ref = $target.data('ref') as string;\n this._triggerAppLinkAction(ref);\n event.preventDefault();\n }\n\n protected _triggerAppLinkAction(ref: string) {\n this.trigger('appLinkAction', {\n ref: ref\n });\n }\n}\n","/*\n * Copyright (c) 2010, 2023 BSI Business Systems Integration AG\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Event, FormFieldAdapter} from '@eclipse-scout/core';\nimport {SvgFieldAppLinkActionEvent} from './SvgFieldEventMap';\nimport {SvgField} from '../index';\n\nexport class SvgFieldAdapter extends FormFieldAdapter {\n\n protected _onWidgetAppLinkAction(event: SvgFieldAppLinkActionEvent) {\n this._send('appLinkAction', {\n ref: event.ref\n });\n }\n\n protected override _onWidgetEvent(event: Event<SvgField>) {\n if (event.type === 'appLinkAction') {\n this._onWidgetAppLinkAction(event as SvgFieldAppLinkActionEvent);\n } else {\n super._onWidgetEvent(event);\n }\n }\n}\n","module.exports = require(\"jquery\");","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__eclipse_scout_core_ec9759ad__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/main/js/index.ts\");\n",""],"names":["ObjectFactory","self","get","registerNamespace","AppLinkKeyStroke","FormField","$","SvgField","_render","addContainer","$parent","addLabel","addField","makeDiv","addMandatoryIndicator","addStatus","_renderProperties","_renderSvgDocument","_initKeyStrokeContext","keyStrokeContext","registerKeyStroke","_onAppLinkAction","svgDocument","$field","empty","html","find","on","bind","attr","unfocusable","event","$target","delegateTarget","ref","data","_triggerAppLinkAction","preventDefault","trigger","FormFieldAdapter","SvgFieldAdapter","_onWidgetAppLinkAction","_send","_onWidgetEvent","type"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import*as o from"@eclipse-scout/core";var r={};r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{SvgField:()=>s,SvgFieldAdapter:()=>_,default:()=>l});var d={};r.r(d),r.d(d,{SvgField:()=>s,SvgFieldAdapter:()=>_,default:()=>l});var c=t=>{var e={};return r.d(e,t),e},b=t=>()=>t;const p=c({AppLinkKeyStroke:()=>o.AppLinkKeyStroke,FormField:()=>o.FormField,FormFieldAdapter:()=>o.FormFieldAdapter,ObjectFactory:()=>o.ObjectFactory}),u=require("jquery");var g=r.n(u);function f(t,e,i){return e=v(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function v(t){var e=m(t,"string");return typeof e=="symbol"?e:String(e)}function m(t,e){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var a=i.call(t,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class s extends p.FormField{constructor(){super(...arguments),f(this,"svgDocument",void 0)}_render(){this.addContainer(this.$parent,"svg-field"),this.addLabel(),this.addField(this.$parent.makeDiv()),this.addMandatoryIndicator(),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderSvgDocument()}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new p.AppLinkKeyStroke(this,this._onAppLinkAction))}_renderSvgDocument(){if(!this.svgDocument){this.$field.empty();return}this.$field.html(this.svgDocument),this.$field.find(".app-link").on("click",this._onAppLinkAction.bind(this)).attr("tabindex","0").unfocusable()}_onAppLinkAction(e){let a=g()(e.delegateTarget).data("ref");this._triggerAppLinkAction(a),e.preventDefault()}_triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}}class _ extends p.FormFieldAdapter{_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}const l=d;p.ObjectFactory.get().registerNamespace("scout",d);var A=n.SvgField,y=n.SvgFieldAdapter,S=n.default;export{A as SvgField,y as SvgFieldAdapter,S as default};
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=eclipse-scout-svg-91e2d79d7c56c352ec4e.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eclipse-scout-svg-91e2d79d7c56c352ec4e.min.js","mappings":"sCACA,IAAIA,EAAsB,CAAC,ECA3BA,EAAoB,EAAKC,GAAW,CACnC,IAAIC,EAASD,GAAUA,EAAO,WAC7B,IAAOA,EAAO,QACd,IAAOA,EACR,OAAAD,EAAoB,EAAEE,EAAQ,CAAE,EAAGA,CAAO,CAAC,EACpCA,CACR,ECNAF,EAAoB,EAAI,CAACG,EAASC,IAAe,CAChD,QAAQC,KAAOD,EACXJ,EAAoB,EAAEI,EAAYC,CAAG,GAAK,CAACL,EAAoB,EAAEG,EAASE,CAAG,GAC/E,OAAO,eAAeF,EAASE,EAAK,CAAE,WAAY,GAAM,IAAKD,EAAWC,EAAK,CAAC,CAGjF,ECPAL,EAAoB,EAAI,CAACM,EAAKC,IAAU,OAAO,UAAU,eAAe,KAAKD,EAAKC,CAAI,ECCtFP,EAAoB,EAAKG,GAAY,CACjC,OAAO,OAAW,KAAe,OAAO,aAC1C,OAAO,eAAeA,EAAS,OAAO,YAAa,CAAE,MAAO,QAAS,CAAC,EAEvE,OAAO,eAAeA,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,CAC7D,E,wJCNA,IAAIK,EAAIC,GAAK,CAAE,IAAID,EAAI,CAAC,EAAG,OAAAR,EAAoB,EAAEQ,EAAGC,CAAC,EAAUD,CAAG,EAC9DC,EAAID,GAAK,IAAMA,EACnB,MAAM,EAA+BA,EAAE,CAAG,iBAAqB,IAAME,EAAyD,iBAAmB,UAAc,IAAMA,EAAyD,UAAY,iBAAqB,IAAMA,EAAyD,iBAAmB,cAAkB,IAAMA,EAAyD,aAAc,CAAC,ECF3a,EAA+B,QAAQ,QAAQ,E,8dCa/C,MAAOC,UAAiBC,EAAAA,SAAU,CAAD,+DAMlBC,SAAU,CAC3B,KAAKC,aAAa,KAAKC,QAAS,WAAW,EAC3C,KAAKC,SAAS,EACd,KAAKC,SAAS,KAAKF,QAAQG,QAAQ,CAAC,EACpC,KAAKC,sBAAsB,EAC3B,KAAKC,UAAU,CACjB,CAEmBC,mBAAoB,CACrC,MAAMA,kBAAkB,EACxB,KAAKC,mBAAmB,CAC1B,CAEmBC,uBAAwB,CACzC,MAAMA,sBAAsB,EAC5B,KAAKC,iBAAiBC,kBAAkB,IAAIC,EAAAA,iBAAiB,KAAM,KAAKC,gBAAgB,CAAC,CAC3F,CAEUL,oBAAqB,CAC7B,GAAI,CAAC,KAAKM,YAAa,CACrB,KAAKC,OAAOC,MAAM,EAClB,M,CAEF,KAAKD,OAAOE,KAAK,KAAKH,WAAW,EACjC,KAAKC,OAAOG,KAAK,WAAW,EACzBC,GAAG,QAAS,KAAKN,iBAAiBO,KAAK,IAAI,CAAC,EAC5CC,KAAK,WAAY,GAAG,EACpBC,YAAY,CACjB,CAEUT,iBAAiBU,EAAqD,CAE9E,IAAIC,EADUC,EAAAA,EAAEF,EAAMG,cAAc,EAClBC,KAAK,KAAK,EAC5B,KAAKC,sBAAsBJ,CAAG,EAC9BD,EAAMM,eAAe,CACvB,CAEUD,sBAAsBJ,EAAa,CAC3C,KAAKM,QAAQ,gBAAiB,CAC5BN,IAAKA,C,CACN,CACH,C,CC/CI,MAAOO,UAAwBC,EAAAA,gBAAiB,CAE1CC,uBAAuBV,EAAmC,CAClE,KAAKW,MAAM,gBAAiB,CAC1BV,IAAKD,EAAMC,G,CACZ,CACH,CAEmBW,eAAeZ,EAAwB,CACpDA,EAAMa,OAAS,gBACjB,KAAKH,uBAAuBV,CAAmC,EAE/D,MAAMY,eAAeZ,CAAK,CAE9B,C,CCTF,QAAec,EAEfC,EAAAA,cAAAA,IAAkB,EAAEC,kBAAkB,QAASF,CAAI,E","sources":["bootstrap","compat get default export","define property getters","hasOwnProperty shorthand","make namespace object","core\"","external commonjs \"jquery\"","SvgField.ts","SvgFieldAdapter.ts","index.ts"],"names":["__webpack_require__","module","getter","exports","definition","key","obj","prop","x","y","__WEBPACK_EXTERNAL_MODULE__eclipse_scout_core_ec9759ad__","SvgField","FormField","_render","addContainer","$parent","addLabel","addField","makeDiv","addMandatoryIndicator","addStatus","_renderProperties","_renderSvgDocument","_initKeyStrokeContext","keyStrokeContext","registerKeyStroke","AppLinkKeyStroke","_onAppLinkAction","svgDocument","$field","empty","html","find","on","bind","attr","unfocusable","event","ref","$","delegateTarget","data","_triggerAppLinkAction","preventDefault","trigger","SvgFieldAdapter","FormFieldAdapter","_onWidgetAppLinkAction","_send","_onWidgetEvent","type","self","ObjectFactory","registerNamespace"],"sourceRoot":""}
|
package/src/main/js/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2010-2021 BSI Business Systems Integration AG.
|
|
3
|
-
* All rights reserved. This program and the accompanying materials
|
|
4
|
-
* are made available under the terms of the Eclipse Public License v1.0
|
|
5
|
-
* which accompanies this distribution, and is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-v10.html
|
|
7
|
-
*
|
|
8
|
-
* Contributors:
|
|
9
|
-
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
|
-
*/
|
|
11
|
-
export {default as SvgField} from './svg/SvgField';
|
|
12
|
-
export {default as SvgFieldAdapter} from './svg/SvgFieldAdapter';
|
|
13
|
-
|
|
14
|
-
import * as self from './index.js';
|
|
15
|
-
|
|
16
|
-
export default self;
|
|
17
|
-
window.scout = Object.assign(window.scout || {}, self);
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2014-2017 BSI Business Systems Integration AG.
|
|
3
|
-
* All rights reserved. This program and the accompanying materials
|
|
4
|
-
* are made available under the terms of the Eclipse Public License v1.0
|
|
5
|
-
* which accompanies this distribution, and is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-v10.html
|
|
7
|
-
*
|
|
8
|
-
* Contributors:
|
|
9
|
-
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
|
-
*/
|
|
11
|
-
import {AppLinkKeyStroke, ValueField} from '@eclipse-scout/core';
|
|
12
|
-
import $ from 'jquery';
|
|
13
|
-
|
|
14
|
-
export default class SvgField extends ValueField {
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
_render() {
|
|
21
|
-
this.addContainer(this.$parent, 'svg-field');
|
|
22
|
-
this.addLabel();
|
|
23
|
-
this.addField(this.$parent.makeDiv());
|
|
24
|
-
this.addMandatoryIndicator();
|
|
25
|
-
this.addStatus();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
_renderProperties() {
|
|
29
|
-
super._renderProperties();
|
|
30
|
-
this._renderSvgDocument();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @override FormField.js
|
|
35
|
-
*/
|
|
36
|
-
_initKeyStrokeContext() {
|
|
37
|
-
super._initKeyStrokeContext();
|
|
38
|
-
this.keyStrokeContext.registerKeyStroke(new AppLinkKeyStroke(this, this._onAppLinkAction));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
_renderSvgDocument() {
|
|
42
|
-
if (!this.svgDocument) {
|
|
43
|
-
this.$field.empty();
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
this.$field.html(this.svgDocument);
|
|
47
|
-
this.$field.find('.app-link')
|
|
48
|
-
.on('click', this._onAppLinkAction.bind(this))
|
|
49
|
-
.attr('tabindex', '0')
|
|
50
|
-
.unfocusable();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
_onAppLinkAction(event) {
|
|
54
|
-
let $target = $(event.delegateTarget);
|
|
55
|
-
let ref = $target.data('ref');
|
|
56
|
-
this._triggerAppLinkAction(ref);
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_triggerAppLinkAction(ref) {
|
|
61
|
-
this.trigger('appLinkAction', {
|
|
62
|
-
ref: ref
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2014-2017 BSI Business Systems Integration AG.
|
|
3
|
-
* All rights reserved. This program and the accompanying materials
|
|
4
|
-
* are made available under the terms of the Eclipse Public License v1.0
|
|
5
|
-
* which accompanies this distribution, and is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-v10.html
|
|
7
|
-
*
|
|
8
|
-
* Contributors:
|
|
9
|
-
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
|
-
*/
|
|
11
|
-
import {ValueFieldAdapter} from '@eclipse-scout/core';
|
|
12
|
-
|
|
13
|
-
export default class SvgFieldAdapter extends ValueFieldAdapter {
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
_onWidgetAppLinkAction(event) {
|
|
20
|
-
this._send('appLinkAction', {
|
|
21
|
-
ref: event.ref
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
_onWidgetEvent(event) {
|
|
26
|
-
if (event.type === 'appLinkAction') {
|
|
27
|
-
this._onWidgetAppLinkAction(event);
|
|
28
|
-
} else {
|
|
29
|
-
super._onWidgetEvent(event);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|