@formio/vpat 2.6.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/README.md +12 -0
- package/dist/vpat.js +1410 -0
- package/dist/vpat.min.js +1 -0
- package/lib/Webform.d.ts +2 -0
- package/lib/Webform.js +105 -0
- package/lib/WebformBuilder.d.ts +2 -0
- package/lib/WebformBuilder.js +145 -0
- package/lib/Wizard.d.ts +2 -0
- package/lib/Wizard.js +87 -0
- package/lib/builders/Builders.d.ts +4 -0
- package/lib/builders/Builders.js +9 -0
- package/lib/builders/index.d.ts +2 -0
- package/lib/builders/index.js +7 -0
- package/lib/components/address/Address.d.ts +5 -0
- package/lib/components/address/Address.js +10 -0
- package/lib/components/button/Button.d.ts +6 -0
- package/lib/components/button/Button.form.d.ts +1 -0
- package/lib/components/button/Button.form.js +25 -0
- package/lib/components/button/Button.js +12 -0
- package/lib/components/button/editForm/Button.edit.display.d.ts +5 -0
- package/lib/components/button/editForm/Button.edit.display.js +32 -0
- package/lib/components/checkbox/Checkbox.d.ts +17 -0
- package/lib/components/checkbox/Checkbox.form.d.ts +1 -0
- package/lib/components/checkbox/Checkbox.form.js +22 -0
- package/lib/components/checkbox/Checkbox.js +33 -0
- package/lib/components/checkbox/editForm/Checkbox.edit.data.d.ts +5 -0
- package/lib/components/checkbox/editForm/Checkbox.edit.data.js +12 -0
- package/lib/components/checkbox/editForm/Checkbox.edit.display.d.ts +5 -0
- package/lib/components/checkbox/editForm/Checkbox.edit.display.js +44 -0
- package/lib/components/columns/Columns.d.ts +6 -0
- package/lib/components/columns/Columns.form.d.ts +1 -0
- package/lib/components/columns/Columns.form.js +17 -0
- package/lib/components/columns/Columns.js +12 -0
- package/lib/components/columns/editForm/Columns.edit.display.d.ts +5 -0
- package/lib/components/columns/editForm/Columns.edit.display.js +16 -0
- package/lib/components/component/Component.d.ts +2 -0
- package/lib/components/component/Component.js +316 -0
- package/lib/components/componentmodal/ComponentModal.d.ts +2 -0
- package/lib/components/componentmodal/ComponentModal.js +217 -0
- package/lib/components/container/Container.d.ts +6 -0
- package/lib/components/container/Container.form.d.ts +1 -0
- package/lib/components/container/Container.form.js +22 -0
- package/lib/components/container/Container.js +12 -0
- package/lib/components/container/editForm/Container.edit.data.d.ts +5 -0
- package/lib/components/container/editForm/Container.edit.data.js +8 -0
- package/lib/components/container/editForm/Container.edit.display.d.ts +5 -0
- package/lib/components/container/editForm/Container.edit.display.js +12 -0
- package/lib/components/content/Content.d.ts +6 -0
- package/lib/components/content/Content.form.d.ts +1 -0
- package/lib/components/content/Content.form.js +8 -0
- package/lib/components/content/Content.js +12 -0
- package/lib/components/currency/Currency.d.ts +6 -0
- package/lib/components/currency/Currency.form.d.ts +1 -0
- package/lib/components/currency/Currency.form.js +26 -0
- package/lib/components/currency/Currency.js +12 -0
- package/lib/components/currency/editForm/Currency.edit.data.d.ts +17 -0
- package/lib/components/currency/editForm/Currency.edit.data.js +188 -0
- package/lib/components/currency/editForm/Currency.edit.display.d.ts +5 -0
- package/lib/components/currency/editForm/Currency.edit.display.js +8 -0
- package/lib/components/currency/editForm/Currency.edit.validation.d.ts +5 -0
- package/lib/components/currency/editForm/Currency.edit.validation.js +24 -0
- package/lib/components/datagrid/DataGrid.d.ts +5 -0
- package/lib/components/datagrid/DataGrid.js +10 -0
- package/lib/components/datamap/DataMap.d.ts +5 -0
- package/lib/components/datamap/DataMap.js +10 -0
- package/lib/components/datatable/DataTable.d.ts +3 -0
- package/lib/components/datatable/DataTable.js +8 -0
- package/lib/components/datetime/DateTime.d.ts +6 -0
- package/lib/components/datetime/DateTime.form.d.ts +1 -0
- package/lib/components/datetime/DateTime.form.js +27 -0
- package/lib/components/datetime/DateTime.js +12 -0
- package/lib/components/datetime/editForm/DateTime.edit.data.d.ts +5 -0
- package/lib/components/datetime/editForm/DateTime.edit.data.js +8 -0
- package/lib/components/datetime/editForm/DateTime.edit.display.d.ts +5 -0
- package/lib/components/datetime/editForm/DateTime.edit.display.js +32 -0
- package/lib/components/datetime/editForm/DateTime.edit.validation.d.ts +5 -0
- package/lib/components/datetime/editForm/DateTime.edit.validation.js +8 -0
- package/lib/components/day/Day.d.ts +13 -0
- package/lib/components/day/Day.form.d.ts +1 -0
- package/lib/components/day/Day.form.js +41 -0
- package/lib/components/day/Day.js +16 -0
- package/lib/components/day/editForm/Day.edit.data.d.ts +5 -0
- package/lib/components/day/editForm/Day.edit.data.js +16 -0
- package/lib/components/day/editForm/Day.edit.day.d.ts +40 -0
- package/lib/components/day/editForm/Day.edit.day.js +48 -0
- package/lib/components/day/editForm/Day.edit.display.d.ts +18 -0
- package/lib/components/day/editForm/Day.edit.display.js +36 -0
- package/lib/components/day/editForm/Day.edit.month.d.ts +40 -0
- package/lib/components/day/editForm/Day.edit.month.js +40 -0
- package/lib/components/day/editForm/Day.edit.validation.d.ts +29 -0
- package/lib/components/day/editForm/Day.edit.validation.js +58 -0
- package/lib/components/day/editForm/Day.edit.year.d.ts +10 -0
- package/lib/components/day/editForm/Day.edit.year.js +22 -0
- package/lib/components/dynamicwizard/DynamicWizard.d.ts +3 -0
- package/lib/components/dynamicwizard/DynamicWizard.js +8 -0
- package/lib/components/editgrid/EditGrid.d.ts +5 -0
- package/lib/components/editgrid/EditGrid.js +10 -0
- package/lib/components/email/Email.d.ts +6 -0
- package/lib/components/email/Email.form.d.ts +1 -0
- package/lib/components/email/Email.form.js +21 -0
- package/lib/components/email/Email.js +12 -0
- package/lib/components/email/editForm/Email.edit.display.d.ts +5 -0
- package/lib/components/email/editForm/Email.edit.display.js +8 -0
- package/lib/components/email/editForm/Email.edit.validation.d.ts +5 -0
- package/lib/components/email/editForm/Email.edit.validation.js +12 -0
- package/lib/components/fieldset/Fieldset.d.ts +6 -0
- package/lib/components/fieldset/Fieldset.form.d.ts +1 -0
- package/lib/components/fieldset/Fieldset.form.js +22 -0
- package/lib/components/fieldset/Fieldset.js +12 -0
- package/lib/components/file/File.d.ts +20 -0
- package/lib/components/file/File.form.d.ts +1 -0
- package/lib/components/file/File.form.js +17 -0
- package/lib/components/file/File.js +87 -0
- package/lib/components/file/editForm/File.edit.display.d.ts +5 -0
- package/lib/components/file/editForm/File.edit.display.js +24 -0
- package/lib/components/form/Form.d.ts +5 -0
- package/lib/components/form/Form.js +10 -0
- package/lib/components/hidden/Hidden.d.ts +6 -0
- package/lib/components/hidden/Hidden.form.d.ts +1 -0
- package/lib/components/hidden/Hidden.form.js +8 -0
- package/lib/components/hidden/Hidden.js +12 -0
- package/lib/components/html/HTML.d.ts +6 -0
- package/lib/components/html/HTML.form.d.ts +1 -0
- package/lib/components/html/HTML.form.js +8 -0
- package/lib/components/html/HTML.js +12 -0
- package/lib/components/index.d.ts +87 -0
- package/lib/components/index.js +95 -0
- package/lib/components/input/Input.d.ts +2 -0
- package/lib/components/input/Input.js +20 -0
- package/lib/components/nested/NestedComponent.d.ts +2 -0
- package/lib/components/nested/NestedComponent.js +18 -0
- package/lib/components/number/Number.d.ts +6 -0
- package/lib/components/number/Number.form.d.ts +1 -0
- package/lib/components/number/Number.form.js +26 -0
- package/lib/components/number/Number.js +12 -0
- package/lib/components/number/editForm/Number.edit.data.d.ts +18 -0
- package/lib/components/number/editForm/Number.edit.data.js +32 -0
- package/lib/components/number/editForm/Number.edit.display.d.ts +5 -0
- package/lib/components/number/editForm/Number.edit.display.js +12 -0
- package/lib/components/number/editForm/Number.edit.validation.d.ts +20 -0
- package/lib/components/number/editForm/Number.edit.validation.js +46 -0
- package/lib/components/panel/Panel.d.ts +6 -0
- package/lib/components/panel/Panel.form.d.ts +1 -0
- package/lib/components/panel/Panel.form.js +17 -0
- package/lib/components/panel/Panel.js +12 -0
- package/lib/components/panel/editForm/Panel.edit.display.d.ts +21 -0
- package/lib/components/panel/editForm/Panel.edit.display.js +29 -0
- package/lib/components/password/Password.d.ts +6 -0
- package/lib/components/password/Password.form.d.ts +1 -0
- package/lib/components/password/Password.form.js +26 -0
- package/lib/components/password/Password.js +12 -0
- package/lib/components/password/editForm/Password.edit.data.d.ts +18 -0
- package/lib/components/password/editForm/Password.edit.data.js +48 -0
- package/lib/components/password/editForm/Password.edit.display.d.ts +5 -0
- package/lib/components/password/editForm/Password.edit.display.js +8 -0
- package/lib/components/password/editForm/Password.edit.validation.d.ts +5 -0
- package/lib/components/password/editForm/Password.edit.validation.js +16 -0
- package/lib/components/phonenumber/PhoneNumber.d.ts +6 -0
- package/lib/components/phonenumber/PhoneNumber.form.d.ts +1 -0
- package/lib/components/phonenumber/PhoneNumber.form.js +21 -0
- package/lib/components/phonenumber/PhoneNumber.js +12 -0
- package/lib/components/phonenumber/editForm/PhoneNumber.edit.display.d.ts +5 -0
- package/lib/components/phonenumber/editForm/PhoneNumber.edit.display.js +8 -0
- package/lib/components/phonenumber/editForm/PhoneNumber.edit.validation.d.ts +5 -0
- package/lib/components/phonenumber/editForm/PhoneNumber.edit.validation.js +28 -0
- package/lib/components/radio/Radio.d.ts +2 -0
- package/lib/components/radio/Radio.form.d.ts +1 -0
- package/lib/components/radio/Radio.form.js +22 -0
- package/lib/components/radio/Radio.js +45 -0
- package/lib/components/radio/editForm/Radio.edit.data.d.ts +13 -0
- package/lib/components/radio/editForm/Radio.edit.data.js +25 -0
- package/lib/components/radio/editForm/Radio.edit.display.d.ts +5 -0
- package/lib/components/radio/editForm/Radio.edit.display.js +32 -0
- package/lib/components/recaptcha/ReCaptcha.d.ts +5 -0
- package/lib/components/recaptcha/ReCaptcha.js +10 -0
- package/lib/components/select/Select.d.ts +17 -0
- package/lib/components/select/Select.form.d.ts +1 -0
- package/lib/components/select/Select.form.js +27 -0
- package/lib/components/select/Select.js +39 -0
- package/lib/components/select/editForm/Select.edit.data.d.ts +5 -0
- package/lib/components/select/editForm/Select.edit.data.js +16 -0
- package/lib/components/select/editForm/Select.edit.display.d.ts +5 -0
- package/lib/components/select/editForm/Select.edit.display.js +32 -0
- package/lib/components/select/editForm/Select.edit.validation.d.ts +5 -0
- package/lib/components/select/editForm/Select.edit.validation.js +8 -0
- package/lib/components/selectboxes/SelectBoxes.d.ts +6 -0
- package/lib/components/selectboxes/SelectBoxes.form.d.ts +1 -0
- package/lib/components/selectboxes/SelectBoxes.form.js +25 -0
- package/lib/components/selectboxes/SelectBoxes.js +12 -0
- package/lib/components/selectboxes/editForm/SelectBoxes.edit.validation.d.ts +9 -0
- package/lib/components/selectboxes/editForm/SelectBoxes.edit.validation.js +36 -0
- package/lib/components/signature/Signature.d.ts +5 -0
- package/lib/components/signature/Signature.js +10 -0
- package/lib/components/sketchpad/Sketchpad.d.ts +3 -0
- package/lib/components/sketchpad/Sketchpad.js +8 -0
- package/lib/components/survey/Survey.d.ts +5 -0
- package/lib/components/survey/Survey.js +10 -0
- package/lib/components/table/Table.d.ts +6 -0
- package/lib/components/table/Table.form.d.ts +1 -0
- package/lib/components/table/Table.form.js +17 -0
- package/lib/components/table/Table.js +12 -0
- package/lib/components/table/editForm/Table.edit.display.d.ts +5 -0
- package/lib/components/table/editForm/Table.edit.display.js +24 -0
- package/lib/components/tabs/Tabs.d.ts +5 -0
- package/lib/components/tabs/Tabs.js +10 -0
- package/lib/components/tagpad/Tagpad.d.ts +3 -0
- package/lib/components/tagpad/Tagpad.js +8 -0
- package/lib/components/tags/Tags.d.ts +5 -0
- package/lib/components/tags/Tags.js +10 -0
- package/lib/components/textarea/TextArea.d.ts +6 -0
- package/lib/components/textarea/TextArea.form.d.ts +1 -0
- package/lib/components/textarea/TextArea.form.js +16 -0
- package/lib/components/textarea/TextArea.js +12 -0
- package/lib/components/textarea/editForm/TextArea.edit.display.d.ts +20 -0
- package/lib/components/textarea/editForm/TextArea.edit.display.js +20 -0
- package/lib/components/textfield/TextField.d.ts +7 -0
- package/lib/components/textfield/TextField.form.d.ts +1 -0
- package/lib/components/textfield/TextField.form.js +27 -0
- package/lib/components/textfield/TextField.js +16 -0
- package/lib/components/textfield/editForm/TextField.edit.data.d.ts +5 -0
- package/lib/components/textfield/editForm/TextField.edit.data.js +16 -0
- package/lib/components/textfield/editForm/TextField.edit.display.d.ts +5 -0
- package/lib/components/textfield/editForm/TextField.edit.display.js +52 -0
- package/lib/components/textfield/editForm/TextField.edit.validation.d.ts +5 -0
- package/lib/components/textfield/editForm/TextField.edit.validation.js +8 -0
- package/lib/components/time/Time.d.ts +10 -0
- package/lib/components/time/Time.form.d.ts +1 -0
- package/lib/components/time/Time.form.js +31 -0
- package/lib/components/time/Time.js +16 -0
- package/lib/components/time/editForm/Time.edit.data.d.ts +5 -0
- package/lib/components/time/editForm/Time.edit.data.js +16 -0
- package/lib/components/time/editForm/Time.edit.display.d.ts +5 -0
- package/lib/components/time/editForm/Time.edit.display.js +28 -0
- package/lib/components/tooltip/Tooltip.d.ts +35 -0
- package/lib/components/tooltip/Tooltip.js +259 -0
- package/lib/components/unknown/Unknown.d.ts +5 -0
- package/lib/components/unknown/Unknown.js +10 -0
- package/lib/components/url/Url.d.ts +6 -0
- package/lib/components/url/Url.form.d.ts +1 -0
- package/lib/components/url/Url.form.js +26 -0
- package/lib/components/url/Url.js +12 -0
- package/lib/components/url/editForm/Url.edit.data.d.ts +5 -0
- package/lib/components/url/editForm/Url.edit.data.js +8 -0
- package/lib/components/url/editForm/Url.edit.display.d.ts +5 -0
- package/lib/components/url/editForm/Url.edit.display.js +8 -0
- package/lib/components/url/editForm/Url.edit.validation.d.ts +5 -0
- package/lib/components/url/editForm/Url.edit.validation.js +12 -0
- package/lib/components/well/Well.d.ts +6 -0
- package/lib/components/well/Well.form.d.ts +1 -0
- package/lib/components/well/Well.form.js +18 -0
- package/lib/components/well/Well.js +12 -0
- package/lib/displays/index.d.ts +5 -0
- package/lib/displays/index.js +11 -0
- package/lib/index.d.ts +65 -0
- package/lib/index.js +21 -0
- package/lib/plugins/index.d.ts +2 -0
- package/lib/plugins/index.js +3 -0
- package/lib/providers/auth/index.d.ts +2 -0
- package/lib/providers/auth/index.js +3 -0
- package/lib/providers/index.d.ts +5 -0
- package/lib/providers/index.js +11 -0
- package/lib/providers/storage/index.d.ts +2 -0
- package/lib/providers/storage/index.js +3 -0
- package/lib/templates/index.d.ts +2 -0
- package/lib/templates/index.js +3 -0
- package/lib/util/index.d.ts +4 -0
- package/lib/util/index.js +23 -0
- package/lib/util/modalUtils.d.ts +3 -0
- package/lib/util/modalUtils.js +62 -0
- package/lib/widgets/CalendarWidget.d.ts +3 -0
- package/lib/widgets/CalendarWidget.js +116 -0
- package/lib/widgets/index.d.ts +4 -0
- package/lib/widgets/index.js +9 -0
- package/package.json +61 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = [
|
|
4
|
+
{
|
|
5
|
+
key: 'placeholder',
|
|
6
|
+
ignore: true,
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
key: 'labelPosition',
|
|
10
|
+
ignore: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'tabindex',
|
|
14
|
+
ignore: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: 'hidden',
|
|
18
|
+
ignore: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 'hideLabel',
|
|
22
|
+
ignore: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'autofocus',
|
|
26
|
+
ignore: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: 'widget.type',
|
|
30
|
+
ignore: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: 'inputMask',
|
|
34
|
+
ignore: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'inputMaskPlaceholderChar',
|
|
38
|
+
ignore: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'allowMultipleMasks',
|
|
42
|
+
ignore: true,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'mask',
|
|
46
|
+
ignore: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'showWordCount',
|
|
50
|
+
ignore: true,
|
|
51
|
+
},
|
|
52
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import editForm from './Time.form';
|
|
2
|
+
declare const Time: any;
|
|
3
|
+
export default class TimeComponent extends Time {
|
|
4
|
+
static editForm: typeof editForm;
|
|
5
|
+
refs: any;
|
|
6
|
+
setRawValue: any;
|
|
7
|
+
getRawValue: any;
|
|
8
|
+
setValueAt(index: any, value: any): void;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (...extend: any[]): any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_1 = require("@formio/js");
|
|
7
|
+
const baseEditForm = js_1.Components.components.time.editForm;
|
|
8
|
+
const Time_edit_data_1 = __importDefault(require("./editForm/Time.edit.data"));
|
|
9
|
+
const Time_edit_display_1 = __importDefault(require("./editForm/Time.edit.display"));
|
|
10
|
+
function default_1(...extend) {
|
|
11
|
+
return baseEditForm([
|
|
12
|
+
{
|
|
13
|
+
key: 'data',
|
|
14
|
+
components: Time_edit_data_1.default,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: 'display',
|
|
18
|
+
components: Time_edit_display_1.default,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 'validation',
|
|
22
|
+
components: [
|
|
23
|
+
{
|
|
24
|
+
key: 'validateOn',
|
|
25
|
+
ignore: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
], ...extend);
|
|
30
|
+
}
|
|
31
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_1 = require("@formio/js");
|
|
7
|
+
const Time_form_1 = __importDefault(require("./Time.form"));
|
|
8
|
+
const Time = js_1.Components.components.time;
|
|
9
|
+
class TimeComponent extends Time {
|
|
10
|
+
setValueAt(index, value) {
|
|
11
|
+
this.setRawValue(this.getValueAsString(value), index);
|
|
12
|
+
this.refs.input[index].value = this.getRawValue(index);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = TimeComponent;
|
|
16
|
+
TimeComponent.editForm = Time_form_1.default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = [
|
|
4
|
+
{
|
|
5
|
+
key: 'labelPosition',
|
|
6
|
+
ignore: true,
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
key: 'placeholder',
|
|
10
|
+
ignore: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'tabindex',
|
|
14
|
+
ignore: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: 'hidden',
|
|
18
|
+
ignore: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 'hideLabel',
|
|
22
|
+
ignore: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'autofocus',
|
|
26
|
+
ignore: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface IPosition {
|
|
2
|
+
top: number;
|
|
3
|
+
right: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
left: number;
|
|
6
|
+
}
|
|
7
|
+
export default class Tooltip {
|
|
8
|
+
tooltipTrigger: HTMLElement;
|
|
9
|
+
tooltipLabelId: string;
|
|
10
|
+
wrapper: HTMLElement;
|
|
11
|
+
position: string;
|
|
12
|
+
tooltipBody: HTMLElement;
|
|
13
|
+
tooltipContent: string;
|
|
14
|
+
config: any;
|
|
15
|
+
showTooltipListener: any;
|
|
16
|
+
hideTooltipListener: any;
|
|
17
|
+
isResized: boolean;
|
|
18
|
+
constructor(triggerElement: HTMLElement, config: any);
|
|
19
|
+
init(): void;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
addListeners(element: HTMLElement | Document, eventNames: string, listener: any): void;
|
|
23
|
+
removeListeners(element: HTMLElement | Document, eventNames: string, listener: any): void;
|
|
24
|
+
getRandomId(): string;
|
|
25
|
+
createTooltip(): void;
|
|
26
|
+
getTooltipOffsetParent(element: HTMLElement): HTMLElement;
|
|
27
|
+
getRelativePosition(child: HTMLElement, parent: HTMLElement): IPosition;
|
|
28
|
+
isElementInViewport(element: HTMLElement, isYAxis: boolean): boolean;
|
|
29
|
+
adjustHorizontalPosition(element: HTMLElement): number;
|
|
30
|
+
positionTooltip(): void;
|
|
31
|
+
show(): void;
|
|
32
|
+
hide(): void;
|
|
33
|
+
hideTooltipHandler(event: any): void;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const TOOLTIP_WRAPPER_CLASS = 'formio-tooltip__wrapper';
|
|
4
|
+
const TOOLTIP_TRIGGER_CLASS = 'formio-tooltip__trigger';
|
|
5
|
+
const TOOLTIP_BODY_CLASS = 'formio-tooltip__body';
|
|
6
|
+
const SET_CLASS = 'formio-tooltip--is-set';
|
|
7
|
+
const ADJUST_WHITESPACE_CLASS = 'formio-tooltip__body--whitespace';
|
|
8
|
+
const MODAL_CLASS = 'formio-dialog-content';
|
|
9
|
+
const VERTICAL_SPACER = 5;
|
|
10
|
+
const SPACER = 2;
|
|
11
|
+
const ESC_KEYCODE = 27;
|
|
12
|
+
class Tooltip {
|
|
13
|
+
constructor(triggerElement, config) {
|
|
14
|
+
this.isResized = false;
|
|
15
|
+
this.tooltipTrigger = triggerElement;
|
|
16
|
+
this.config = config;
|
|
17
|
+
if (this.config.title && !this.tooltipTrigger.classList.contains(TOOLTIP_TRIGGER_CLASS)) {
|
|
18
|
+
this.init();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
init() {
|
|
22
|
+
this.createTooltip();
|
|
23
|
+
this.showTooltipListener = this.show.bind(this);
|
|
24
|
+
this.hideTooltipListener = this.hideTooltipHandler.bind(this);
|
|
25
|
+
this.addListeners(this.tooltipTrigger, 'mouseenter focus', this.showTooltipListener);
|
|
26
|
+
this.addListeners(this.tooltipTrigger, 'mouseleave blur', this.hideTooltipListener);
|
|
27
|
+
this.addListeners(document, 'keydown', this.hideTooltipListener);
|
|
28
|
+
}
|
|
29
|
+
dispose() {
|
|
30
|
+
return this.destroy();
|
|
31
|
+
}
|
|
32
|
+
destroy() {
|
|
33
|
+
if (this.tooltipContent) {
|
|
34
|
+
this.removeListeners(this.tooltipTrigger, 'mouseenter focus', this.showTooltipListener);
|
|
35
|
+
this.removeListeners(this.tooltipTrigger, 'mouseleave blur', this.hideTooltipListener);
|
|
36
|
+
this.removeListeners(document, 'keydown', this.hideTooltipListener);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
addListeners(element, eventNames, listener) {
|
|
40
|
+
const events = eventNames.split(' ');
|
|
41
|
+
events.forEach((item) => {
|
|
42
|
+
element.addEventListener(item, listener);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
removeListeners(element, eventNames, listener) {
|
|
46
|
+
const events = eventNames.split(' ');
|
|
47
|
+
events.forEach((item) => {
|
|
48
|
+
element.removeEventListener(item, listener);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
getRandomId() {
|
|
52
|
+
return Math.random().toString(36).substr(2, 10);
|
|
53
|
+
}
|
|
54
|
+
createTooltip() {
|
|
55
|
+
const tooltipTriggerLabel = this.tooltipTrigger.getAttribute('aria-label');
|
|
56
|
+
const tooltipLabelId = `tooltip_${this.getRandomId()}`;
|
|
57
|
+
this.tooltipContent = this.config.title;
|
|
58
|
+
this.wrapper = document.createElement('span');
|
|
59
|
+
this.tooltipBody = document.createElement('span');
|
|
60
|
+
this.position = this.config.position ? this.config.position : 'right';
|
|
61
|
+
if (tooltipTriggerLabel) {
|
|
62
|
+
this.tooltipTrigger.setAttribute('aria-label', `${tooltipTriggerLabel}. ${this.tooltipContent}`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.tooltipTrigger.setAttribute('aria-labelledby', tooltipLabelId);
|
|
66
|
+
}
|
|
67
|
+
this.tooltipTrigger.classList.add(TOOLTIP_TRIGGER_CLASS);
|
|
68
|
+
this.tooltipTrigger.parentNode.insertBefore(this.wrapper, this.tooltipTrigger);
|
|
69
|
+
this.wrapper.classList.add(TOOLTIP_WRAPPER_CLASS);
|
|
70
|
+
this.wrapper.appendChild(this.tooltipTrigger);
|
|
71
|
+
this.wrapper.appendChild(this.tooltipBody);
|
|
72
|
+
this.tooltipBody.classList.add(TOOLTIP_BODY_CLASS);
|
|
73
|
+
this.tooltipBody.setAttribute('id', tooltipLabelId);
|
|
74
|
+
this.tooltipBody.setAttribute('role', 'tooltip');
|
|
75
|
+
this.tooltipBody.setAttribute('aria-hidden', 'true');
|
|
76
|
+
this.tooltipBody.innerHTML = this.tooltipContent;
|
|
77
|
+
}
|
|
78
|
+
getTooltipOffsetParent(element) {
|
|
79
|
+
const offsetParent = element.offsetParent;
|
|
80
|
+
return offsetParent ? offsetParent.offsetParent : null;
|
|
81
|
+
}
|
|
82
|
+
getRelativePosition(child, parent) {
|
|
83
|
+
const childPosition = child.getBoundingClientRect();
|
|
84
|
+
const parentPosition = parent.getBoundingClientRect();
|
|
85
|
+
const relativeOffset = { top: 0, right: 0, left: 0, bottom: 0 };
|
|
86
|
+
relativeOffset.top = childPosition.top - parentPosition.top;
|
|
87
|
+
relativeOffset.right = childPosition.right - parentPosition.right;
|
|
88
|
+
relativeOffset.left = childPosition.left - parentPosition.left;
|
|
89
|
+
relativeOffset.bottom = childPosition.bottom - parentPosition.bottom;
|
|
90
|
+
return relativeOffset;
|
|
91
|
+
}
|
|
92
|
+
isElementInViewport(element, isYAxis) {
|
|
93
|
+
const docElement = document.documentElement;
|
|
94
|
+
const rect = element.getBoundingClientRect();
|
|
95
|
+
const offsetParent = this.getTooltipOffsetParent(element);
|
|
96
|
+
const clientSize = isYAxis ? docElement.clientHeight : docElement.clientWidth;
|
|
97
|
+
if (offsetParent && offsetParent.className === MODAL_CLASS) {
|
|
98
|
+
const offsets = this.getRelativePosition(element, offsetParent);
|
|
99
|
+
return isYAxis
|
|
100
|
+
? (offsets.top > 0 && offsets.bottom < 0)
|
|
101
|
+
: (offsets.left > 0 && offsets.right < 0);
|
|
102
|
+
}
|
|
103
|
+
return isYAxis
|
|
104
|
+
? (rect.top >= 0 && rect.bottom <= clientSize)
|
|
105
|
+
: (rect.left >= 0 && rect.right <= clientSize);
|
|
106
|
+
}
|
|
107
|
+
adjustHorizontalPosition(element) {
|
|
108
|
+
const rect = element.getBoundingClientRect();
|
|
109
|
+
const offsetParent = this.getTooltipOffsetParent(element);
|
|
110
|
+
const clientWidth = document.documentElement.clientWidth;
|
|
111
|
+
let offset = 0;
|
|
112
|
+
if (offsetParent && offsetParent.className === MODAL_CLASS) {
|
|
113
|
+
const offsets = this.getRelativePosition(element, offsetParent);
|
|
114
|
+
if (offsets.left < 0) {
|
|
115
|
+
return offsets.left - SPACER;
|
|
116
|
+
}
|
|
117
|
+
if (offsets.right > 0) {
|
|
118
|
+
return -offsets.right + SPACER;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (rect.left < 0 && rect.right > clientWidth) {
|
|
122
|
+
return offset;
|
|
123
|
+
}
|
|
124
|
+
if (rect.left < 0) {
|
|
125
|
+
offset = rect.left - SPACER;
|
|
126
|
+
}
|
|
127
|
+
if (rect.right > clientWidth) {
|
|
128
|
+
offset = rect.right - clientWidth + SPACER;
|
|
129
|
+
}
|
|
130
|
+
return offset;
|
|
131
|
+
}
|
|
132
|
+
positionTooltip() {
|
|
133
|
+
this.tooltipBody.setAttribute('aria-hidden', 'false');
|
|
134
|
+
this.tooltipBody.classList.add(SET_CLASS);
|
|
135
|
+
const tooltipWidth = this.tooltipTrigger.offsetWidth;
|
|
136
|
+
const tooltipHeight = this.tooltipTrigger.offsetHeight;
|
|
137
|
+
const leftOffset = this.tooltipTrigger.offsetLeft;
|
|
138
|
+
const adjustHorizontalCenter = tooltipWidth / 2 + leftOffset;
|
|
139
|
+
const adjustToEdgeX = tooltipWidth + SPACER;
|
|
140
|
+
const adjustToEdgeY = tooltipHeight + VERTICAL_SPACER + SPACER;
|
|
141
|
+
const setPositionClass = (position) => {
|
|
142
|
+
this.isResized = false;
|
|
143
|
+
this.tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--top`);
|
|
144
|
+
this.tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--bottom`);
|
|
145
|
+
this.tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--right`);
|
|
146
|
+
this.tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--left`);
|
|
147
|
+
this.tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--whitespace`);
|
|
148
|
+
this.tooltipBody.classList.add(`${TOOLTIP_BODY_CLASS}--${position}`);
|
|
149
|
+
};
|
|
150
|
+
const adjustTooltipBody = (element, updateMargins) => {
|
|
151
|
+
if (!this.isElementInViewport(element, false)) {
|
|
152
|
+
element.classList.add(ADJUST_WHITESPACE_CLASS);
|
|
153
|
+
this.isResized = true;
|
|
154
|
+
if (updateMargins) {
|
|
155
|
+
updateMargins();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const positionTop = (element) => {
|
|
160
|
+
setPositionClass('top');
|
|
161
|
+
const setMargins = () => {
|
|
162
|
+
const offset = this.isResized ? this.adjustHorizontalPosition(element) : 0;
|
|
163
|
+
element.style.marginLeft = `${adjustHorizontalCenter - offset}px`;
|
|
164
|
+
element.style.marginBottom = `${adjustToEdgeY}px`;
|
|
165
|
+
element.style.bottom = '0';
|
|
166
|
+
};
|
|
167
|
+
setMargins();
|
|
168
|
+
adjustTooltipBody(element, setMargins);
|
|
169
|
+
};
|
|
170
|
+
const positionBottom = (element) => {
|
|
171
|
+
setPositionClass('bottom');
|
|
172
|
+
const setMargins = () => {
|
|
173
|
+
const offset = this.isResized ? this.adjustHorizontalPosition(element) : 0;
|
|
174
|
+
element.style.marginLeft = `${adjustHorizontalCenter - offset}px`;
|
|
175
|
+
element.style.marginTop = `${adjustToEdgeY}px`;
|
|
176
|
+
element.style.bottom = '';
|
|
177
|
+
};
|
|
178
|
+
setMargins();
|
|
179
|
+
adjustTooltipBody(element, setMargins);
|
|
180
|
+
};
|
|
181
|
+
const positionRight = (element) => {
|
|
182
|
+
setPositionClass('right');
|
|
183
|
+
const setMargins = () => {
|
|
184
|
+
element.style.marginBottom = '0';
|
|
185
|
+
element.style.marginLeft = `${adjustToEdgeX + leftOffset + SPACER}px`;
|
|
186
|
+
element.style.bottom = `${(adjustToEdgeY - this.tooltipBody.offsetHeight) / 2}px`;
|
|
187
|
+
};
|
|
188
|
+
setMargins();
|
|
189
|
+
adjustTooltipBody(element, setMargins);
|
|
190
|
+
};
|
|
191
|
+
const positionLeft = (element) => {
|
|
192
|
+
setPositionClass('left');
|
|
193
|
+
const setMargins = () => {
|
|
194
|
+
element.style.marginBottom = '0';
|
|
195
|
+
element.style.marginLeft = `${leftOffset - this.tooltipBody.offsetWidth - SPACER}px`;
|
|
196
|
+
element.style.bottom = `${(adjustToEdgeY - this.tooltipBody.offsetHeight) / 2}px`;
|
|
197
|
+
};
|
|
198
|
+
setMargins();
|
|
199
|
+
adjustTooltipBody(element, setMargins);
|
|
200
|
+
};
|
|
201
|
+
const changePositionAxis = (element) => {
|
|
202
|
+
positionTop(element);
|
|
203
|
+
if (!this.isElementInViewport(element, true)) {
|
|
204
|
+
positionBottom(element);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
switch (this.position) {
|
|
208
|
+
case 'top':
|
|
209
|
+
positionTop(this.tooltipBody);
|
|
210
|
+
if (!this.isElementInViewport(this.tooltipBody, true)) {
|
|
211
|
+
positionBottom(this.tooltipBody);
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
case 'bottom':
|
|
215
|
+
positionBottom(this.tooltipBody);
|
|
216
|
+
if (!this.isElementInViewport(this.tooltipBody, true)) {
|
|
217
|
+
positionTop(this.tooltipBody);
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
case 'right':
|
|
221
|
+
positionRight(this.tooltipBody);
|
|
222
|
+
if (!this.isElementInViewport(this.tooltipBody, false)) {
|
|
223
|
+
positionLeft(this.tooltipBody);
|
|
224
|
+
if (!this.isElementInViewport(this.tooltipBody, false)) {
|
|
225
|
+
changePositionAxis(this.tooltipBody);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (!this.isElementInViewport(this.tooltipBody, true)) {
|
|
229
|
+
changePositionAxis(this.tooltipBody);
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
case 'left':
|
|
233
|
+
positionLeft(this.tooltipBody);
|
|
234
|
+
if (!this.isElementInViewport(this.tooltipBody, false)) {
|
|
235
|
+
positionRight(this.tooltipBody);
|
|
236
|
+
if (!this.isElementInViewport(this.tooltipBody, false)) {
|
|
237
|
+
changePositionAxis(this.tooltipBody);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!this.isElementInViewport(this.tooltipBody, true)) {
|
|
241
|
+
changePositionAxis(this.tooltipBody);
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
show() {
|
|
247
|
+
this.positionTooltip();
|
|
248
|
+
}
|
|
249
|
+
hide() {
|
|
250
|
+
this.tooltipBody.classList.remove(SET_CLASS);
|
|
251
|
+
this.tooltipBody.setAttribute('aria-hidden', 'true');
|
|
252
|
+
}
|
|
253
|
+
hideTooltipHandler(event) {
|
|
254
|
+
if (!(event.type === 'keydown' && event.keyCode !== ESC_KEYCODE)) {
|
|
255
|
+
this.hide();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
exports.default = Tooltip;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const js_1 = require("@formio/js");
|
|
4
|
+
const Unknown = js_1.Components.components.unknown;
|
|
5
|
+
class UnknownComponent extends Unknown {
|
|
6
|
+
static get builderInfo() {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.default = UnknownComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (...extend: any[]): any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const TextField_form_1 = __importDefault(require("../textfield/TextField.form"));
|
|
7
|
+
const Url_edit_display_1 = __importDefault(require("./editForm/Url.edit.display"));
|
|
8
|
+
const Url_edit_data_1 = __importDefault(require("./editForm/Url.edit.data"));
|
|
9
|
+
const Url_edit_validation_1 = __importDefault(require("./editForm/Url.edit.validation"));
|
|
10
|
+
function default_1(...extend) {
|
|
11
|
+
return (0, TextField_form_1.default)([
|
|
12
|
+
{
|
|
13
|
+
key: 'display',
|
|
14
|
+
components: Url_edit_display_1.default
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: 'data',
|
|
18
|
+
components: Url_edit_data_1.default
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 'validation',
|
|
22
|
+
components: Url_edit_validation_1.default
|
|
23
|
+
},
|
|
24
|
+
], ...extend);
|
|
25
|
+
}
|
|
26
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_1 = require("@formio/js");
|
|
7
|
+
const Url_form_1 = __importDefault(require("./Url.form"));
|
|
8
|
+
const Url = js_1.Components.components.url;
|
|
9
|
+
class UrlComponent extends Url {
|
|
10
|
+
}
|
|
11
|
+
exports.default = UrlComponent;
|
|
12
|
+
UrlComponent.editForm = Url_form_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (...extend: any[]): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const js_1 = require("@formio/js");
|
|
4
|
+
const baseEditForm = js_1.Components.components.well.editForm;
|
|
5
|
+
function default_1(...extend) {
|
|
6
|
+
return baseEditForm([
|
|
7
|
+
{
|
|
8
|
+
key: 'display',
|
|
9
|
+
components: [
|
|
10
|
+
{
|
|
11
|
+
key: 'hideLabel',
|
|
12
|
+
ignore: true
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
], ...extend);
|
|
17
|
+
}
|
|
18
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_1 = require("@formio/js");
|
|
7
|
+
const Well_form_1 = __importDefault(require("./Well.form"));
|
|
8
|
+
const Well = js_1.Components.components.well;
|
|
9
|
+
class WellComponent extends Well {
|
|
10
|
+
}
|
|
11
|
+
exports.default = WellComponent;
|
|
12
|
+
WellComponent.editForm = Well_form_1.default;
|