@chayns-components/core 5.0.0-beta.403 → 5.0.0-beta.407
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/lib/api/signature/delete.d.ts +1 -0
- package/lib/api/signature/delete.js +30 -0
- package/lib/api/signature/delete.js.map +1 -0
- package/lib/api/signature/get.d.ts +1 -0
- package/lib/api/signature/get.js +40 -0
- package/lib/api/signature/get.js.map +1 -0
- package/lib/api/signature/put.d.ts +1 -0
- package/lib/api/signature/put.js +34 -0
- package/lib/api/signature/put.js.map +1 -0
- package/lib/components/select-button/SelectButton.d.ts +34 -0
- package/lib/components/select-button/SelectButton.js +65 -0
- package/lib/components/select-button/SelectButton.js.map +1 -0
- package/lib/components/select-button/SelectButton.styles.d.ts +2 -0
- package/lib/components/select-button/SelectButton.styles.js +10 -0
- package/lib/components/select-button/SelectButton.styles.js.map +1 -0
- package/lib/components/select-button/types.d.ts +4 -0
- package/lib/components/select-button/types.js +2 -0
- package/lib/components/select-button/types.js.map +1 -0
- package/lib/components/signature/Signature.d.ts +33 -0
- package/lib/components/signature/Signature.js +114 -0
- package/lib/components/signature/Signature.js.map +1 -0
- package/lib/components/signature/Signature.styles.d.ts +5 -0
- package/lib/components/signature/Signature.styles.js +21 -0
- package/lib/components/signature/Signature.styles.js.map +1 -0
- package/lib/constants/serverUrls.d.ts +1 -0
- package/lib/constants/serverUrls.js +8 -0
- package/lib/constants/serverUrls.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -1
- package/lib/types/chayns.d.ts +8 -1
- package/lib/types/chayns.js.map +1 -1
- package/lib/types/signature.d.ts +5 -0
- package/lib/types/signature.js +2 -0
- package/lib/types/signature.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deleteUserSignature: () => Promise<boolean>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deleteUserSignature = void 0;
|
|
7
|
+
var _serverUrls = require("../../constants/serverUrls");
|
|
8
|
+
const deleteUserSignature = async () => {
|
|
9
|
+
if (!chayns.env.user.isAuthenticated) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const response = await fetch(_serverUrls.SIGNATURE_SERVER_URL, {
|
|
14
|
+
method: 'DELETE',
|
|
15
|
+
headers: {
|
|
16
|
+
accept: 'application/json',
|
|
17
|
+
authorization: `bearer ${chayns.env.user.tobitAccessToken}`
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
if (response.ok || response.status === 304) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
console.error('[chayns components] Signature: failed to delete user signature', response.status);
|
|
24
|
+
} catch (ex) {
|
|
25
|
+
console.error('[chayns components] Signature: failed to delete user signature', ex);
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
exports.deleteUserSignature = deleteUserSignature;
|
|
30
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","names":["_serverUrls","require","deleteUserSignature","chayns","env","user","isAuthenticated","response","fetch","SIGNATURE_SERVER_URL","method","headers","accept","authorization","tobitAccessToken","ok","status","console","error","ex","exports"],"sources":["../../../src/api/signature/delete.ts"],"sourcesContent":["import { SIGNATURE_SERVER_URL } from '../../constants/serverUrls';\n\nexport const deleteUserSignature = async () => {\n if (!chayns.env.user.isAuthenticated) {\n return false;\n }\n\n try {\n const response = await fetch(SIGNATURE_SERVER_URL, {\n method: 'DELETE',\n headers: {\n accept: 'application/json',\n authorization: `bearer ${chayns.env.user.tobitAccessToken}`,\n },\n });\n\n if (response.ok || response.status === 304) {\n return true;\n }\n\n console.error(\n '[chayns components] Signature: failed to delete user signature',\n response.status\n );\n } catch (ex) {\n console.error('[chayns components] Signature: failed to delete user signature', ex);\n }\n\n return false;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,mBAAmB,GAAG,MAAAA,CAAA,KAAY;EAC3C,IAAI,CAACC,MAAM,CAACC,GAAG,CAACC,IAAI,CAACC,eAAe,EAAE;IAClC,OAAO,KAAK;EAChB;EAEA,IAAI;IACA,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAACC,gCAAoB,EAAE;MAC/CC,MAAM,EAAE,QAAQ;MAChBC,OAAO,EAAE;QACLC,MAAM,EAAE,kBAAkB;QAC1BC,aAAa,EAAG,UAASV,MAAM,CAACC,GAAG,CAACC,IAAI,CAACS,gBAAiB;MAC9D;IACJ,CAAC,CAAC;IAEF,IAAIP,QAAQ,CAACQ,EAAE,IAAIR,QAAQ,CAACS,MAAM,KAAK,GAAG,EAAE;MACxC,OAAO,IAAI;IACf;IAEAC,OAAO,CAACC,KAAK,CACT,gEAAgE,EAChEX,QAAQ,CAACS,MACb,CAAC;EACL,CAAC,CAAC,OAAOG,EAAE,EAAE;IACTF,OAAO,CAACC,KAAK,CAAC,gEAAgE,EAAEC,EAAE,CAAC;EACvF;EAEA,OAAO,KAAK;AAChB,CAAC;AAACC,OAAA,CAAAlB,mBAAA,GAAAA,mBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUserSignature: () => Promise<string | undefined>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getUserSignature = void 0;
|
|
7
|
+
var _chaynsApi = require("chayns-api");
|
|
8
|
+
var _serverUrls = require("../../constants/serverUrls");
|
|
9
|
+
const getUserSignature = async () => {
|
|
10
|
+
const {
|
|
11
|
+
accessToken
|
|
12
|
+
} = await (0, _chaynsApi.getAccessToken)();
|
|
13
|
+
if (!accessToken) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const response = await fetch(_serverUrls.SIGNATURE_SERVER_URL, {
|
|
18
|
+
method: 'GET',
|
|
19
|
+
headers: {
|
|
20
|
+
accept: 'application/json',
|
|
21
|
+
authorization: `bearer ${accessToken}`
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
if (response.status === 200) {
|
|
25
|
+
const {
|
|
26
|
+
value
|
|
27
|
+
} = await response.json();
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
if (response.status === 204) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
console.error('[chayns components] Signature: failed to get user signature', response.status);
|
|
34
|
+
} catch (ex) {
|
|
35
|
+
console.error('[chayns components] Signature: failed to get user signature', ex);
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
};
|
|
39
|
+
exports.getUserSignature = getUserSignature;
|
|
40
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","names":["_chaynsApi","require","_serverUrls","getUserSignature","accessToken","getAccessToken","undefined","response","fetch","SIGNATURE_SERVER_URL","method","headers","accept","authorization","status","value","json","console","error","ex","exports"],"sources":["../../../src/api/signature/get.ts"],"sourcesContent":["import { getAccessToken } from 'chayns-api';\nimport type { GetUserSignatureResult } from '../../types/signature';\nimport { SIGNATURE_SERVER_URL } from '../../constants/serverUrls';\n\nexport const getUserSignature = async (): Promise<string | undefined> => {\n const { accessToken } = await getAccessToken();\n\n if (!accessToken) {\n return undefined;\n }\n\n try {\n const response = await fetch(SIGNATURE_SERVER_URL, {\n method: 'GET',\n headers: {\n accept: 'application/json',\n authorization: `bearer ${accessToken}`,\n },\n });\n\n if (response.status === 200) {\n const { value } = (await response.json()) as GetUserSignatureResult;\n\n return value;\n }\n\n if (response.status === 204) {\n return undefined;\n }\n\n console.error(\n '[chayns components] Signature: failed to get user signature',\n response.status\n );\n } catch (ex) {\n console.error('[chayns components] Signature: failed to get user signature', ex);\n }\n\n return undefined;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,GAAG,MAAAA,CAAA,KAAyC;EACrE,MAAM;IAAEC;EAAY,CAAC,GAAG,MAAM,IAAAC,yBAAc,EAAC,CAAC;EAE9C,IAAI,CAACD,WAAW,EAAE;IACd,OAAOE,SAAS;EACpB;EAEA,IAAI;IACA,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAACC,gCAAoB,EAAE;MAC/CC,MAAM,EAAE,KAAK;MACbC,OAAO,EAAE;QACLC,MAAM,EAAE,kBAAkB;QAC1BC,aAAa,EAAG,UAAST,WAAY;MACzC;IACJ,CAAC,CAAC;IAEF,IAAIG,QAAQ,CAACO,MAAM,KAAK,GAAG,EAAE;MACzB,MAAM;QAAEC;MAAM,CAAC,GAAI,MAAMR,QAAQ,CAACS,IAAI,CAAC,CAA4B;MAEnE,OAAOD,KAAK;IAChB;IAEA,IAAIR,QAAQ,CAACO,MAAM,KAAK,GAAG,EAAE;MACzB,OAAOR,SAAS;IACpB;IAEAW,OAAO,CAACC,KAAK,CACT,6DAA6D,EAC7DX,QAAQ,CAACO,MACb,CAAC;EACL,CAAC,CAAC,OAAOK,EAAE,EAAE;IACTF,OAAO,CAACC,KAAK,CAAC,6DAA6D,EAAEC,EAAE,CAAC;EACpF;EAEA,OAAOb,SAAS;AACpB,CAAC;AAACc,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const putUserSignature: (dataURL: string) => Promise<boolean>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.putUserSignature = void 0;
|
|
7
|
+
var _serverUrls = require("../../constants/serverUrls");
|
|
8
|
+
const putUserSignature = async dataURL => {
|
|
9
|
+
if (!chayns.env.user.isAuthenticated) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const response = await fetch(_serverUrls.SIGNATURE_SERVER_URL, {
|
|
14
|
+
method: 'PUT',
|
|
15
|
+
headers: {
|
|
16
|
+
accept: 'application/json',
|
|
17
|
+
authorization: `bearer ${chayns.env.user.tobitAccessToken}`,
|
|
18
|
+
'content-type': 'application/json'
|
|
19
|
+
},
|
|
20
|
+
body: JSON.stringify({
|
|
21
|
+
value: dataURL
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
if (response.ok) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
console.error('[chayns components] Signature: failed to put user signature', response.status);
|
|
28
|
+
} catch (ex) {
|
|
29
|
+
console.error('[chayns components] Signature: failed to put user signature', ex);
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
};
|
|
33
|
+
exports.putUserSignature = putUserSignature;
|
|
34
|
+
//# sourceMappingURL=put.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"put.js","names":["_serverUrls","require","putUserSignature","dataURL","chayns","env","user","isAuthenticated","response","fetch","SIGNATURE_SERVER_URL","method","headers","accept","authorization","tobitAccessToken","body","JSON","stringify","value","ok","console","error","status","ex","exports"],"sources":["../../../src/api/signature/put.ts"],"sourcesContent":["import { SIGNATURE_SERVER_URL } from '../../constants/serverUrls';\n\nexport const putUserSignature = async (dataURL: string) => {\n if (!chayns.env.user.isAuthenticated) {\n return false;\n }\n\n try {\n const response = await fetch(SIGNATURE_SERVER_URL, {\n method: 'PUT',\n headers: {\n accept: 'application/json',\n authorization: `bearer ${chayns.env.user.tobitAccessToken}`,\n 'content-type': 'application/json',\n },\n body: JSON.stringify({ value: dataURL }),\n });\n\n if (response.ok) {\n return true;\n }\n\n console.error(\n '[chayns components] Signature: failed to put user signature',\n response.status\n );\n } catch (ex) {\n console.error('[chayns components] Signature: failed to put user signature', ex);\n }\n\n return false;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAG,MAAOC,OAAe,IAAK;EACvD,IAAI,CAACC,MAAM,CAACC,GAAG,CAACC,IAAI,CAACC,eAAe,EAAE;IAClC,OAAO,KAAK;EAChB;EAEA,IAAI;IACA,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAACC,gCAAoB,EAAE;MAC/CC,MAAM,EAAE,KAAK;MACbC,OAAO,EAAE;QACLC,MAAM,EAAE,kBAAkB;QAC1BC,aAAa,EAAG,UAASV,MAAM,CAACC,GAAG,CAACC,IAAI,CAACS,gBAAiB,EAAC;QAC3D,cAAc,EAAE;MACpB,CAAC;MACDC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;QAAEC,KAAK,EAAEhB;MAAQ,CAAC;IAC3C,CAAC,CAAC;IAEF,IAAIK,QAAQ,CAACY,EAAE,EAAE;MACb,OAAO,IAAI;IACf;IAEAC,OAAO,CAACC,KAAK,CACT,6DAA6D,EAC7Dd,QAAQ,CAACe,MACb,CAAC;EACL,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTH,OAAO,CAACC,KAAK,CAAC,6DAA6D,EAAEE,EAAE,CAAC;EACpF;EAEA,OAAO,KAAK;AAChB,CAAC;AAACC,OAAA,CAAAvB,gBAAA,GAAAA,gBAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { SelectButtonItem } from './types';
|
|
3
|
+
export type SelectButtonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The text that should be displayed inside the button.
|
|
6
|
+
*/
|
|
7
|
+
buttonText: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the button should be disabled.
|
|
10
|
+
*/
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A list of item that could be selected.
|
|
14
|
+
*/
|
|
15
|
+
list: SelectButtonItem[];
|
|
16
|
+
/**
|
|
17
|
+
* Function to be executed after an item is selected.
|
|
18
|
+
*/
|
|
19
|
+
onSelect?: (ids: number[]) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The id of an item that should be preselected.
|
|
22
|
+
*/
|
|
23
|
+
selectedItemIds?: number[];
|
|
24
|
+
/**
|
|
25
|
+
* Whether more than one item should be selectable.
|
|
26
|
+
*/
|
|
27
|
+
shouldAllowMultiSelect?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the search should be displayed inside the dialog.
|
|
30
|
+
*/
|
|
31
|
+
shouldShowSearch?: boolean;
|
|
32
|
+
};
|
|
33
|
+
declare const SelectButton: FC<SelectButtonProps>;
|
|
34
|
+
export default SelectButton;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _SelectButton = require("./SelectButton.styles");
|
|
9
|
+
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
10
|
+
var _chaynsApi = require("chayns-api");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const SelectButton = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
onSelect,
|
|
17
|
+
selectedItemIds,
|
|
18
|
+
shouldAllowMultiSelect,
|
|
19
|
+
buttonText,
|
|
20
|
+
shouldShowSearch,
|
|
21
|
+
list,
|
|
22
|
+
isDisabled
|
|
23
|
+
} = _ref;
|
|
24
|
+
const itemList = (0, _react.useMemo)(() => {
|
|
25
|
+
const items = [];
|
|
26
|
+
list.forEach(_ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
text,
|
|
29
|
+
id
|
|
30
|
+
} = _ref2;
|
|
31
|
+
const isSelected = selectedItemIds ? selectedItemIds.includes(id) : false;
|
|
32
|
+
items.push({
|
|
33
|
+
name: text,
|
|
34
|
+
id,
|
|
35
|
+
isSelected
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
return items;
|
|
39
|
+
}, [list, selectedItemIds]);
|
|
40
|
+
const handleClick = () => {
|
|
41
|
+
void (0, _chaynsApi.createDialog)({
|
|
42
|
+
type: _chaynsApi.DialogType.SELECT,
|
|
43
|
+
list: itemList,
|
|
44
|
+
multiselect: shouldAllowMultiSelect,
|
|
45
|
+
quickfind: shouldShowSearch
|
|
46
|
+
}).open().then(result => {
|
|
47
|
+
// Ignore because there is no type
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
if (result && result.buttonType === 1 && typeof onSelect === 'function') {
|
|
51
|
+
// Ignore because there is no type
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
onSelect(result.result.map(Number));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_SelectButton.StyledSelectButton, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
59
|
+
onClick: handleClick,
|
|
60
|
+
isDisabled: isDisabled
|
|
61
|
+
}, buttonText));
|
|
62
|
+
};
|
|
63
|
+
SelectButton.displayName = 'SelectButton';
|
|
64
|
+
var _default = exports.default = SelectButton;
|
|
65
|
+
//# sourceMappingURL=SelectButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectButton.js","names":["_react","_interopRequireWildcard","require","_SelectButton","_Button","_interopRequireDefault","_chaynsApi","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SelectButton","_ref","onSelect","selectedItemIds","shouldAllowMultiSelect","buttonText","shouldShowSearch","list","isDisabled","itemList","useMemo","items","forEach","_ref2","text","id","isSelected","includes","push","name","handleClick","createDialog","type","DialogType","SELECT","multiselect","quickfind","open","then","result","buttonType","map","Number","createElement","StyledSelectButton","onClick","displayName","_default","exports"],"sources":["../../../src/components/select-button/SelectButton.tsx"],"sourcesContent":["import React, { type FC, useMemo } from 'react';\nimport { StyledSelectButton } from './SelectButton.styles';\nimport Button from '../button/Button';\nimport type { SelectButtonItem } from './types';\nimport { createDialog, type DialogSelectListItemType, DialogType } from 'chayns-api';\n\nexport type SelectButtonProps = {\n /**\n * The text that should be displayed inside the button.\n */\n buttonText: string;\n /**\n * Whether the button should be disabled.\n */\n isDisabled?: boolean;\n /**\n * A list of item that could be selected.\n */\n list: SelectButtonItem[];\n /**\n * Function to be executed after an item is selected.\n */\n onSelect?: (ids: number[]) => void;\n /**\n * The id of an item that should be preselected.\n */\n selectedItemIds?: number[];\n /**\n * Whether more than one item should be selectable.\n */\n shouldAllowMultiSelect?: boolean;\n /**\n * Whether the search should be displayed inside the dialog.\n */\n shouldShowSearch?: boolean;\n};\n\nconst SelectButton: FC<SelectButtonProps> = ({\n onSelect,\n selectedItemIds,\n shouldAllowMultiSelect,\n buttonText,\n shouldShowSearch,\n list,\n isDisabled,\n}) => {\n const itemList = useMemo(() => {\n const items: DialogSelectListItemType[] = [];\n\n list.forEach(({ text, id }) => {\n const isSelected = selectedItemIds ? selectedItemIds.includes(id) : false;\n\n items.push({\n name: text,\n id,\n isSelected,\n });\n });\n\n return items;\n }, [list, selectedItemIds]);\n\n const handleClick = () => {\n void createDialog({\n type: DialogType.SELECT,\n list: itemList,\n multiselect: shouldAllowMultiSelect,\n quickfind: shouldShowSearch,\n })\n .open()\n .then((result) => {\n // Ignore because there is no type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (result && result.buttonType === 1 && typeof onSelect === 'function') {\n // Ignore because there is no type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n onSelect((result.result as string[]).map(Number));\n }\n });\n };\n\n return (\n <StyledSelectButton>\n <Button onClick={handleClick} isDisabled={isDisabled}>\n {buttonText}\n </Button>\n </StyledSelectButton>\n );\n};\n\nSelectButton.displayName = 'SelectButton';\n\nexport default SelectButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAAqF,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAA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AGb,eAAe,GAAGA,eAAe,CAACc,QAAQ,CAACF,EAAE,CAAC,GAAG,KAAK;MAEzEJ,KAAK,CAACO,IAAI,CAAC;QACPC,IAAI,EAAEL,IAAI;QACVC,EAAE;QACFC;MACJ,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,OAAOL,KAAK;EAChB,CAAC,EAAE,CAACJ,IAAI,EAAEJ,eAAe,CAAC,CAAC;EAE3B,MAAMiB,WAAW,GAAGA,CAAA,KAAM;IACtB,KAAK,IAAAC,uBAAY,EAAC;MACdC,IAAI,EAAEC,qBAAU,CAACC,MAAM;MACvBjB,IAAI,EAAEE,QAAQ;MACdgB,WAAW,EAAErB,sBAAsB;MACnCsB,SAAS,EAAEpB;IACf,CAAC,CAAC,CACGqB,IAAI,CAAC,CAAC,CACNC,IAAI,CAAEC,MAAM,IAAK;MACd;MACA;MACA;MACA,IAAIA,MAAM,IAAIA,MAAM,CAACC,UAAU,KAAK,CAAC,IAAI,OAAO5B,QAAQ,KAAK,UAAU,EAAE;QACrE;QACA;QACA;QACAA,QAAQ,CAAE2B,MAAM,CAACA,MAAM,CAAcE,GAAG,CAACC,MAAM,CAAC,CAAC;MACrD;IACJ,CAAC,CAAC;EACV,CAAC;EAED,oBACI7D,MAAA,CAAAS,OAAA,CAAAqD,aAAA,CAAC3D,aAAA,CAAA4D,kBAAkB,qBACf/D,MAAA,CAAAS,OAAA,CAAAqD,aAAA,CAAC1D,OAAA,CAAAK,OAAM;IAACuD,OAAO,EAAEf,WAAY;IAACZ,UAAU,EAAEA;EAAW,GAChDH,UACG,CACQ,CAAC;AAE7B,CAAC;AAEDL,YAAY,CAACoC,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1D,OAAA,GAE3BoB,YAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledSelectButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSelectButton = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledSelectButton = exports.StyledSelectButton = _styledComponents.default.div``;
|
|
10
|
+
//# sourceMappingURL=SelectButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectButton.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledSelectButton","exports","styled","div"],"sources":["../../../src/components/select-button/SelectButton.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledSelectButton = styled.div``;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAAI,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/components/select-button/types.ts"],"sourcesContent":["export interface SelectButtonItem {\n text: string;\n id: number;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SignatureRef {
|
|
3
|
+
edit: VoidFunction;
|
|
4
|
+
delete: VoidFunction;
|
|
5
|
+
}
|
|
6
|
+
export type SignatureProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The text that should be displayed inside the button.
|
|
9
|
+
*/
|
|
10
|
+
buttonText: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button is disabled.
|
|
13
|
+
*/
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Function to be executed when the signature is edited.
|
|
17
|
+
*/
|
|
18
|
+
onEdit?: (signature: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Function to be executed when the user deletes the signature.
|
|
21
|
+
*/
|
|
22
|
+
onRemove?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Function to be executed when the user subscribes.
|
|
25
|
+
*/
|
|
26
|
+
onSubscribe?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Function to be executed when the user unsubscribes.
|
|
29
|
+
*/
|
|
30
|
+
onUnsubscribe?: () => void;
|
|
31
|
+
};
|
|
32
|
+
declare const Signature: React.ForwardRefExoticComponent<SignatureProps & React.RefAttributes<SignatureRef>>;
|
|
33
|
+
export default Signature;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
9
|
+
var _Signature = require("./Signature.styles");
|
|
10
|
+
var _put = require("../../api/signature/put");
|
|
11
|
+
var _delete = require("../../api/signature/delete");
|
|
12
|
+
var _get = require("../../api/signature/get");
|
|
13
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
const Signature = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
18
|
+
let {
|
|
19
|
+
onEdit,
|
|
20
|
+
onRemove,
|
|
21
|
+
onUnsubscribe,
|
|
22
|
+
onSubscribe,
|
|
23
|
+
buttonText,
|
|
24
|
+
isDisabled
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [signatureUrl, setSignatureUrl] = (0, _react.useState)(undefined);
|
|
27
|
+
const [hasSubscribed, setHasSubscribed] = (0, _react.useState)(false);
|
|
28
|
+
(0, _react.useEffect)(() => {
|
|
29
|
+
const loadUserSignature = async () => {
|
|
30
|
+
await (0, _get.getUserSignature)().then(signature => {
|
|
31
|
+
console.debug('getUserSignature', signature);
|
|
32
|
+
setSignatureUrl(signature);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
void loadUserSignature();
|
|
36
|
+
}, []);
|
|
37
|
+
const handleCallDialog = (0, _react.useCallback)(async shouldSubscribe => {
|
|
38
|
+
// ToDo replace with new dialog if ready
|
|
39
|
+
await chayns.dialog.signature({
|
|
40
|
+
buttons: [{
|
|
41
|
+
text: 'Speichern',
|
|
42
|
+
buttonType: 1
|
|
43
|
+
}, {
|
|
44
|
+
text: 'Abbrechen',
|
|
45
|
+
buttonType: 0
|
|
46
|
+
}]
|
|
47
|
+
}).then(async result => {
|
|
48
|
+
console.debug('Dialog result', result);
|
|
49
|
+
if (result.buttonType === 1 && result.value) {
|
|
50
|
+
await (0, _put.putUserSignature)(result.value).then(success => {
|
|
51
|
+
console.debug('putUserSignature', success);
|
|
52
|
+
if (success) {
|
|
53
|
+
setSignatureUrl(result.value);
|
|
54
|
+
if (shouldSubscribe) {
|
|
55
|
+
if (typeof onSubscribe === 'function') {
|
|
56
|
+
onSubscribe();
|
|
57
|
+
}
|
|
58
|
+
} else if (typeof onEdit === 'function') {
|
|
59
|
+
onEdit(result.value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}, [onEdit, onSubscribe]);
|
|
66
|
+
const handleEdit = (0, _react.useCallback)(() => {
|
|
67
|
+
void handleCallDialog(false);
|
|
68
|
+
}, [handleCallDialog]);
|
|
69
|
+
const handleDelete = (0, _react.useCallback)(async () => {
|
|
70
|
+
await (0, _delete.deleteUserSignature)().then(success => {
|
|
71
|
+
console.debug('deleteUserSignature', success);
|
|
72
|
+
if (success) {
|
|
73
|
+
setSignatureUrl(undefined);
|
|
74
|
+
if (typeof onRemove === 'function') {
|
|
75
|
+
onRemove();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}, [onRemove]);
|
|
80
|
+
const handleClick = (0, _react.useCallback)(() => {
|
|
81
|
+
if (signatureUrl) {
|
|
82
|
+
setHasSubscribed(true);
|
|
83
|
+
if (typeof onSubscribe === 'function') {
|
|
84
|
+
onSubscribe();
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
void handleCallDialog(true);
|
|
88
|
+
}
|
|
89
|
+
}, [handleCallDialog, onSubscribe, signatureUrl]);
|
|
90
|
+
const handleUnSubscribe = () => {
|
|
91
|
+
setHasSubscribed(false);
|
|
92
|
+
setSignatureUrl(undefined);
|
|
93
|
+
if (typeof onUnsubscribe === 'function') {
|
|
94
|
+
onUnsubscribe();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
98
|
+
edit: handleEdit,
|
|
99
|
+
delete: handleDelete
|
|
100
|
+
}), [handleDelete, handleEdit]);
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_Signature.StyledSignature, null, !hasSubscribed ? /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
102
|
+
isDisabled: isDisabled,
|
|
103
|
+
onClick: handleClick
|
|
104
|
+
}, buttonText) : /*#__PURE__*/_react.default.createElement(_Signature.StyledSignatureImageWrapper, null, /*#__PURE__*/_react.default.createElement(_Signature.StyledSignatureImage, {
|
|
105
|
+
src: signatureUrl
|
|
106
|
+
}), /*#__PURE__*/_react.default.createElement(_Signature.StyledSignatureDeleteIconWrapper, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
107
|
+
icons: ['ts-wrong'],
|
|
108
|
+
size: 20,
|
|
109
|
+
onClick: handleUnSubscribe
|
|
110
|
+
}))));
|
|
111
|
+
});
|
|
112
|
+
Signature.displayName = 'Signature';
|
|
113
|
+
var _default = exports.default = Signature;
|
|
114
|
+
//# sourceMappingURL=Signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Signature.js","names":["_react","_interopRequireWildcard","require","_Button","_interopRequireDefault","_Signature","_put","_delete","_get","_Icon","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Signature","forwardRef","_ref","ref","onEdit","onRemove","onUnsubscribe","onSubscribe","buttonText","isDisabled","signatureUrl","setSignatureUrl","useState","undefined","hasSubscribed","setHasSubscribed","useEffect","loadUserSignature","getUserSignature","then","signature","console","debug","handleCallDialog","useCallback","shouldSubscribe","chayns","dialog","buttons","text","buttonType","result","value","putUserSignature","success","handleEdit","handleDelete","deleteUserSignature","handleClick","handleUnSubscribe","useImperativeHandle","edit","delete","createElement","StyledSignature","onClick","StyledSignatureImageWrapper","StyledSignatureImage","src","StyledSignatureDeleteIconWrapper","icons","size","displayName","_default","exports"],"sources":["../../../src/components/signature/Signature.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';\nimport Button from '../button/Button';\nimport {\n StyledSignature,\n StyledSignatureDeleteIconWrapper,\n StyledSignatureImage,\n StyledSignatureImageWrapper,\n} from './Signature.styles';\nimport { putUserSignature } from '../../api/signature/put';\nimport { deleteUserSignature } from '../../api/signature/delete';\nimport { getUserSignature } from '../../api/signature/get';\nimport Icon from '../icon/Icon';\n\nexport interface SignatureRef {\n edit: VoidFunction;\n delete: VoidFunction;\n}\n\nexport type SignatureProps = {\n /**\n * The text that should be displayed inside the button.\n */\n buttonText: string;\n /**\n * Whether the button is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the signature is edited.\n */\n onEdit?: (signature: string) => void;\n /**\n * Function to be executed when the user deletes the signature.\n */\n onRemove?: () => void;\n /**\n * Function to be executed when the user subscribes.\n */\n onSubscribe?: () => void;\n /**\n * Function to be executed when the user unsubscribes.\n */\n onUnsubscribe?: () => void;\n};\n\nconst Signature = forwardRef<SignatureRef, SignatureProps>(\n ({ onEdit, onRemove, onUnsubscribe, onSubscribe, buttonText, isDisabled }, ref) => {\n const [signatureUrl, setSignatureUrl] = useState<string | undefined>(undefined);\n const [hasSubscribed, setHasSubscribed] = useState(false);\n\n useEffect(() => {\n const loadUserSignature = async () => {\n await getUserSignature().then((signature) => {\n console.debug('getUserSignature', signature);\n setSignatureUrl(signature);\n });\n };\n\n void loadUserSignature();\n }, []);\n\n const handleCallDialog = useCallback(\n async (shouldSubscribe: boolean) => {\n // ToDo replace with new dialog if ready\n await chayns.dialog\n .signature({\n buttons: [\n {\n text: 'Speichern',\n buttonType: 1,\n },\n {\n text: 'Abbrechen',\n buttonType: 0,\n },\n ],\n })\n .then(async (result) => {\n console.debug('Dialog result', result);\n if (result.buttonType === 1 && result.value) {\n await putUserSignature(result.value).then((success) => {\n console.debug('putUserSignature', success);\n if (success) {\n setSignatureUrl(result.value);\n\n if (shouldSubscribe) {\n if (typeof onSubscribe === 'function') {\n onSubscribe();\n }\n } else if (typeof onEdit === 'function') {\n onEdit(result.value);\n }\n }\n });\n }\n });\n },\n [onEdit, onSubscribe]\n );\n\n const handleEdit = useCallback(() => {\n void handleCallDialog(false);\n }, [handleCallDialog]);\n\n const handleDelete = useCallback(async () => {\n await deleteUserSignature().then((success) => {\n console.debug('deleteUserSignature', success);\n if (success) {\n setSignatureUrl(undefined);\n\n if (typeof onRemove === 'function') {\n onRemove();\n }\n }\n });\n }, [onRemove]);\n\n const handleClick = useCallback(() => {\n if (signatureUrl) {\n setHasSubscribed(true);\n\n if (typeof onSubscribe === 'function') {\n onSubscribe();\n }\n } else {\n void handleCallDialog(true);\n }\n }, [handleCallDialog, onSubscribe, signatureUrl]);\n\n const handleUnSubscribe = () => {\n setHasSubscribed(false);\n setSignatureUrl(undefined);\n\n if (typeof onUnsubscribe === 'function') {\n onUnsubscribe();\n }\n };\n\n useImperativeHandle(\n ref,\n () => ({\n edit: handleEdit,\n delete: handleDelete,\n }),\n [handleDelete, handleEdit]\n );\n\n return (\n <StyledSignature>\n {!hasSubscribed ? (\n <Button isDisabled={isDisabled} onClick={handleClick}>\n {buttonText}\n </Button>\n ) : (\n <StyledSignatureImageWrapper>\n <StyledSignatureImage src={signatureUrl} />\n <StyledSignatureDeleteIconWrapper>\n <Icon icons={['ts-wrong']} size={20} onClick={handleUnSubscribe} />\n </StyledSignatureDeleteIconWrapper>\n </StyledSignatureImageWrapper>\n )}\n </StyledSignature>\n );\n }\n);\n\nSignature.displayName = 'Signature';\n\nexport default Signature;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAMA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAA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|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledSignature: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
3
|
+
export declare const StyledSignatureImageWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
4
|
+
export declare const StyledSignatureImage: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>>;
|
|
5
|
+
export declare const StyledSignatureDeleteIconWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSignatureImageWrapper = exports.StyledSignatureImage = exports.StyledSignatureDeleteIconWrapper = exports.StyledSignature = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledSignature = exports.StyledSignature = _styledComponents.default.div``;
|
|
10
|
+
const StyledSignatureImageWrapper = exports.StyledSignatureImageWrapper = _styledComponents.default.div`
|
|
11
|
+
position: relative;
|
|
12
|
+
aspect-ratio: 3.8;
|
|
13
|
+
width: 100%;
|
|
14
|
+
`;
|
|
15
|
+
const StyledSignatureImage = exports.StyledSignatureImage = _styledComponents.default.img``;
|
|
16
|
+
const StyledSignatureDeleteIconWrapper = exports.StyledSignatureDeleteIconWrapper = _styledComponents.default.div`
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
`;
|
|
21
|
+
//# sourceMappingURL=Signature.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Signature.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledSignature","exports","styled","div","StyledSignatureImageWrapper","StyledSignatureImage","img","StyledSignatureDeleteIconWrapper"],"sources":["../../../src/components/signature/Signature.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledSignature = styled.div``;\nexport const StyledSignatureImageWrapper = styled.div`\n position: relative;\n aspect-ratio: 3.8;\n width: 100%;\n`;\nexport const StyledSignatureImage = styled.img``;\nexport const StyledSignatureDeleteIconWrapper = styled.div`\n position: absolute;\n top: 0;\n right: 0;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,yBAAM,CAACC,GAAI,EAAC;AACpC,MAAMC,2BAA2B,GAAAH,OAAA,CAAAG,2BAAA,GAAGF,yBAAM,CAACC,GAAI;AACtD;AACA;AACA;AACA,CAAC;AACM,MAAME,oBAAoB,GAAAJ,OAAA,CAAAI,oBAAA,GAAGH,yBAAM,CAACI,GAAI,EAAC;AACzC,MAAMC,gCAAgC,GAAAN,OAAA,CAAAM,gCAAA,GAAGL,yBAAM,CAACC,GAAI;AAC3D;AACA;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SIGNATURE_SERVER_URL = "https://webapi.tobit.com/AccountService/v1.0/General/PersonKeyValue/signature";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SIGNATURE_SERVER_URL = void 0;
|
|
7
|
+
const SIGNATURE_SERVER_URL = exports.SIGNATURE_SERVER_URL = 'https://webapi.tobit.com/AccountService/v1.0/General/PersonKeyValue/signature';
|
|
8
|
+
//# sourceMappingURL=serverUrls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverUrls.js","names":["SIGNATURE_SERVER_URL","exports"],"sources":["../../src/constants/serverUrls.ts"],"sourcesContent":["export const SIGNATURE_SERVER_URL =\n 'https://webapi.tobit.com/AccountService/v1.0/General/PersonKeyValue/signature';\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAC7B,+EAA+E"}
|
package/lib/index.d.ts
CHANGED
|
@@ -53,3 +53,7 @@ export type { FileItem, Image, Meta, Video } from './types/file';
|
|
|
53
53
|
export { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';
|
|
54
54
|
export { isTobitEmployee } from './utils/isTobitEmployee';
|
|
55
55
|
export { uploadFile } from './utils/uploadFile';
|
|
56
|
+
export { default as SelectButton } from './components/select-button/SelectButton';
|
|
57
|
+
export type { SelectButtonItem } from './components/select-button/types';
|
|
58
|
+
export { default as Signature } from './components/signature/Signature';
|
|
59
|
+
export type { SignatureRef } from './components/signature/Signature';
|
package/lib/index.js
CHANGED
|
@@ -213,6 +213,12 @@ Object.defineProperty(exports, "SearchInput", {
|
|
|
213
213
|
return _SearchInput.default;
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
|
+
Object.defineProperty(exports, "SelectButton", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _SelectButton.default;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
216
222
|
Object.defineProperty(exports, "SetupWizard", {
|
|
217
223
|
enumerable: true,
|
|
218
224
|
get: function () {
|
|
@@ -231,6 +237,12 @@ Object.defineProperty(exports, "SharingBar", {
|
|
|
231
237
|
return _SharingBar.default;
|
|
232
238
|
}
|
|
233
239
|
});
|
|
240
|
+
Object.defineProperty(exports, "Signature", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _Signature.default;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
234
246
|
Object.defineProperty(exports, "Slider", {
|
|
235
247
|
enumerable: true,
|
|
236
248
|
get: function () {
|
|
@@ -343,6 +355,8 @@ var _comboBox = require("./types/comboBox");
|
|
|
343
355
|
var _fileDialog = require("./utils/fileDialog");
|
|
344
356
|
var _isTobitEmployee = require("./utils/isTobitEmployee");
|
|
345
357
|
var _uploadFile = require("./utils/uploadFile");
|
|
358
|
+
var _SelectButton = _interopRequireDefault(require("./components/select-button/SelectButton"));
|
|
359
|
+
var _Signature = _interopRequireDefault(require("./components/signature/Signature"));
|
|
346
360
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
347
361
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
348
362
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_Badge","_Button","_Checkbox","_CodeHighlighter","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_DateInfo","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","_NumberInput","_Popup","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SetupWizardItem","_SetupWizard","_SharingBar","_Slider","_SmallWaitCursor","_interopRequireWildcard","_TextArea","_Tooltip","_Truncation","_codeHighlighter","_comboBox","_fileDialog","_isTobitEmployee","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as CodeHighlighter } from './components/code-highlighter/CodeHighlighter';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as DateInfo } from './components/date-info/DateInfo';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport type {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem as FilterButtonItem,\n} from './components/filter-buttons/types';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport type { PopupRef } from './components/popup/types';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport type { ISearchBoxItem as SearchBoxItem } from './components/search-box/types';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { CodeHighlighterTheme } from './types/codeHighlighter';\nexport type { CodeHighlighterLanguage, HighlightedLines } from './types/codeHighlighter';\nexport { ComboBoxDirection } from './types/comboBox';\nexport type { FileItem, Image, Meta, Video } from './types/file';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_Badge","_Button","_Checkbox","_CodeHighlighter","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_DateInfo","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","_NumberInput","_Popup","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SetupWizardItem","_SetupWizard","_SharingBar","_Slider","_SmallWaitCursor","_interopRequireWildcard","_TextArea","_Tooltip","_Truncation","_codeHighlighter","_comboBox","_fileDialog","_isTobitEmployee","_uploadFile","_SelectButton","_Signature","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as CodeHighlighter } from './components/code-highlighter/CodeHighlighter';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as DateInfo } from './components/date-info/DateInfo';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport type {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem as FilterButtonItem,\n} from './components/filter-buttons/types';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport type { PopupRef } from './components/popup/types';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport type { ISearchBoxItem as SearchBoxItem } from './components/search-box/types';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { CodeHighlighterTheme } from './types/codeHighlighter';\nexport type { CodeHighlighterLanguage, HighlightedLines } from './types/codeHighlighter';\nexport { ComboBoxDirection } from './types/comboBox';\nexport type { FileItem, Image, Meta, Video } from './types/file';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport type { SelectButtonItem } from './components/select-button/types';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GA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AC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,SAAA3D,uBAAAuE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAhB,UAAA,GAAAgB,GAAA,KAAAf,OAAA,EAAAe,GAAA"}
|
package/lib/types/chayns.d.ts
CHANGED
|
@@ -49,12 +49,19 @@ export interface Dialog {
|
|
|
49
49
|
width?: number;
|
|
50
50
|
customTransitionTimeout?: number;
|
|
51
51
|
}): Promise<any>;
|
|
52
|
+
signature(config: {
|
|
53
|
+
buttons?: DialogButton[];
|
|
54
|
+
}): Promise<{
|
|
55
|
+
buttonType: ButtonType;
|
|
56
|
+
value: string;
|
|
57
|
+
}>;
|
|
52
58
|
}
|
|
53
59
|
declare enum ButtonText {
|
|
54
60
|
Cancel = "Abbrechen",
|
|
55
61
|
No = "Nein",
|
|
56
62
|
Ok = "OK",
|
|
57
|
-
Yes = "Ja"
|
|
63
|
+
Yes = "Ja",
|
|
64
|
+
Save = "Speichern"
|
|
58
65
|
}
|
|
59
66
|
export declare enum ButtonType {
|
|
60
67
|
Cancel = -1,
|
package/lib/types/chayns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chayns.js","names":["ButtonType","exports"],"sources":["../../src/types/chayns.ts"],"sourcesContent":["declare global {\n let chayns: Chayns;\n}\n\nexport interface Chayns {\n dialog: Dialog;\n env: Env;\n openImage(urls: string | string[], start?: number): Promise<undefined>;\n openVideo(url: string): Promise<void>;\n register(config: object): any;\n getWindowMetrics(): Promise<WindowMetrics>;\n addDesignSettingsChangeListener(callback: () => any): Promise<any>;\n removeDesignSettingsChangeListener(callback: () => any): Promise<any>;\n}\n\nexport interface WindowMetrics {\n bottomBarHeight: number;\n coverHeight: 0;\n frameX: number;\n frameY: number;\n height: number;\n menuHeight: number;\n offsetTop: number;\n pageYOffset: number;\n scrollTop: number;\n windowHeight: number;\n windowWidth: number;\n}\n\nexport interface Dialog {\n select(config: {\n title?: string;\n message?: string;\n list: Array<SelectDialogItem>;\n multiselect?: boolean;\n type?: SelectType;\n preventCloseOnClick?: boolean;\n buttons?: DialogButton[];\n selectAllButton?: string;\n }): Promise<SelectDialogResult>;\n alert(headline: string, text: string): Promise<ButtonType>;\n iFrame(config: {\n url: string;\n input?: object;\n title?: string;\n message?: string;\n buttons?: DialogButton[];\n seamless?: boolean;\n transparent?: boolean;\n waitCursor?: boolean;\n maxHeight?: string;\n width?: number;\n customTransitionTimeout?: number;\n }): Promise<any>;\n}\n\ndeclare enum ButtonText {\n Cancel = 'Abbrechen',\n No = 'Nein',\n Ok = 'OK',\n Yes = 'Ja',\n}\n\nexport enum ButtonType {\n Cancel = -1,\n Negative = 0,\n Positive = 1,\n}\n\nexport interface DialogButton {\n text: ButtonText | string;\n buttonType: ButtonType | number;\n collapseTime?: number;\n textColor?: string;\n backgroundColor?: string;\n}\n\nexport interface SelectDialogItem {\n name: string;\n value: string | number;\n isSelected?: boolean;\n}\n\nexport interface SelectDialogResult {\n buttonType: ButtonType | number;\n selection: Array<SelectDialogItem>;\n}\n\ndeclare enum SelectType {\n Default = 0,\n Icon = 1,\n IconAndText,\n}\n\nexport interface Group {\n id: number;\n isActive: boolean;\n}\n\nexport interface User {\n name: string;\n firstName: string;\n gender: number;\n lastName: string;\n id: number;\n personId: string;\n tobitAccessToken: string;\n groups: Group[];\n isAuthenticated: boolean;\n adminMode: boolean;\n isAdmin: boolean;\n}\n\nexport interface Site {\n id: string;\n colorMode: 0 | 1 | 2;\n}\n\nexport interface Env {\n site: Site;\n user: User;\n language: any;\n parameters: any;\n isApp: boolean;\n isMobile: boolean;\n isTablet: boolean;\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"chayns.js","names":["ButtonType","exports"],"sources":["../../src/types/chayns.ts"],"sourcesContent":["declare global {\n let chayns: Chayns;\n}\n\nexport interface Chayns {\n dialog: Dialog;\n env: Env;\n openImage(urls: string | string[], start?: number): Promise<undefined>;\n openVideo(url: string): Promise<void>;\n register(config: object): any;\n getWindowMetrics(): Promise<WindowMetrics>;\n addDesignSettingsChangeListener(callback: () => any): Promise<any>;\n removeDesignSettingsChangeListener(callback: () => any): Promise<any>;\n}\n\nexport interface WindowMetrics {\n bottomBarHeight: number;\n coverHeight: 0;\n frameX: number;\n frameY: number;\n height: number;\n menuHeight: number;\n offsetTop: number;\n pageYOffset: number;\n scrollTop: number;\n windowHeight: number;\n windowWidth: number;\n}\n\nexport interface Dialog {\n select(config: {\n title?: string;\n message?: string;\n list: Array<SelectDialogItem>;\n multiselect?: boolean;\n type?: SelectType;\n preventCloseOnClick?: boolean;\n buttons?: DialogButton[];\n selectAllButton?: string;\n }): Promise<SelectDialogResult>;\n alert(headline: string, text: string): Promise<ButtonType>;\n iFrame(config: {\n url: string;\n input?: object;\n title?: string;\n message?: string;\n buttons?: DialogButton[];\n seamless?: boolean;\n transparent?: boolean;\n waitCursor?: boolean;\n maxHeight?: string;\n width?: number;\n customTransitionTimeout?: number;\n }): Promise<any>;\n signature(config: {\n buttons?: DialogButton[];\n }): Promise<{ buttonType: ButtonType; value: string }>;\n}\n\ndeclare enum ButtonText {\n Cancel = 'Abbrechen',\n No = 'Nein',\n Ok = 'OK',\n Yes = 'Ja',\n Save = 'Speichern',\n}\n\nexport enum ButtonType {\n Cancel = -1,\n Negative = 0,\n Positive = 1,\n}\n\nexport interface DialogButton {\n text: ButtonText | string;\n buttonType: ButtonType | number;\n collapseTime?: number;\n textColor?: string;\n backgroundColor?: string;\n}\n\nexport interface SelectDialogItem {\n name: string;\n value: string | number;\n isSelected?: boolean;\n}\n\nexport interface SelectDialogResult {\n buttonType: ButtonType | number;\n selection: Array<SelectDialogItem>;\n}\n\ndeclare enum SelectType {\n Default = 0,\n Icon = 1,\n IconAndText,\n}\n\nexport interface Group {\n id: number;\n isActive: boolean;\n}\n\nexport interface User {\n name: string;\n firstName: string;\n gender: number;\n lastName: string;\n id: number;\n personId: string;\n tobitAccessToken: string;\n groups: Group[];\n isAuthenticated: boolean;\n adminMode: boolean;\n isAdmin: boolean;\n}\n\nexport interface Site {\n id: string;\n colorMode: 0 | 1 | 2;\n}\n\nexport interface Env {\n site: Site;\n user: User;\n language: any;\n parameters: any;\n isApp: boolean;\n isMobile: boolean;\n isTablet: boolean;\n}\n"],"mappings":";;;;;;IAmEYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","names":[],"sources":["../../src/types/signature.ts"],"sourcesContent":["export interface GetUserSignatureResult {\n key: string;\n personId: string;\n value: string;\n}\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.407",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chayns",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "437356de51e9ddeca34f2d451938dda1150977b9"
|
|
74
74
|
}
|