@3t-transform/threeteeui 0.1.52 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/cjs/{domsanitiser.options-b2d88e35.js → domsanitiser.options-cd2932a9.js} +17 -17
  2. package/dist/cjs/tttx-button.cjs.entry.js +23 -23
  3. package/dist/cjs/tttx-dialog-box.cjs.entry.js +69 -69
  4. package/dist/cjs/tttx-filter.cjs.entry.js +182 -180
  5. package/dist/cjs/tttx-form.cjs.entry.js +457 -457
  6. package/dist/cjs/tttx-icon.cjs.entry.js +10 -10
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +58 -58
  8. package/dist/cjs/tttx-list.cjs.entry.js +31 -31
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +15 -15
  10. package/dist/cjs/tttx-qrcode.cjs.entry.js +27 -27
  11. package/dist/cjs/tttx-sorter.cjs.entry.js +107 -104
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +78 -78
  13. package/dist/cjs/tttx-toolbar.cjs.entry.js +9 -9
  14. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  16. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  17. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  18. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  19. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  20. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  22. package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.js +81 -81
  23. package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.stories.js +22 -22
  24. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +172 -172
  25. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +289 -289
  26. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +416 -400
  27. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +80 -80
  28. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
  29. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -61
  30. package/dist/collection/components/molecules/tttx-form/tttx-form.js +479 -479
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +272 -272
  32. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  33. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  34. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +253 -236
  35. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
  36. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
  37. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
  38. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  39. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  40. package/dist/collection/components/palette.stories.js +7 -7
  41. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  42. package/dist/collection/icons.js +2838 -2838
  43. package/dist/collection/index.js +1 -1
  44. package/dist/collection/shared/domsanitiser.options.js +14 -14
  45. package/dist/components/domsanitiser.options.js +17 -17
  46. package/dist/components/tttx-button2.js +48 -48
  47. package/dist/components/tttx-dialog-box.js +97 -97
  48. package/dist/components/tttx-filter.js +217 -215
  49. package/dist/components/tttx-form.js +475 -475
  50. package/dist/components/tttx-icon2.js +28 -28
  51. package/dist/components/tttx-keyvalue-block.js +76 -76
  52. package/dist/components/tttx-list.js +53 -53
  53. package/dist/components/tttx-loading-spinner.js +33 -33
  54. package/dist/components/tttx-qrcode.js +45 -45
  55. package/dist/components/tttx-sorter.js +136 -133
  56. package/dist/components/tttx-standalone-input.js +130 -130
  57. package/dist/components/tttx-toolbar.js +26 -26
  58. package/dist/esm/{domsanitiser.options-81611f82.js → domsanitiser.options-563c1cf3.js} +17 -17
  59. package/dist/esm/polyfills/core-js.js +0 -0
  60. package/dist/esm/polyfills/dom.js +0 -0
  61. package/dist/esm/polyfills/es5-html-element.js +0 -0
  62. package/dist/esm/polyfills/index.js +0 -0
  63. package/dist/esm/polyfills/system.js +0 -0
  64. package/dist/esm/tttx-button.entry.js +23 -23
  65. package/dist/esm/tttx-dialog-box.entry.js +69 -69
  66. package/dist/esm/tttx-filter.entry.js +182 -180
  67. package/dist/esm/tttx-form.entry.js +457 -457
  68. package/dist/esm/tttx-icon.entry.js +10 -10
  69. package/dist/esm/tttx-keyvalue-block.entry.js +58 -58
  70. package/dist/esm/tttx-list.entry.js +31 -31
  71. package/dist/esm/tttx-loading-spinner.entry.js +15 -15
  72. package/dist/esm/tttx-qrcode.entry.js +27 -27
  73. package/dist/esm/tttx-sorter.entry.js +107 -104
  74. package/dist/esm/tttx-standalone-input.entry.js +78 -78
  75. package/dist/esm/tttx-toolbar.entry.js +9 -9
  76. package/dist/tttx/p-225e6fa6.entry.js +1 -0
  77. package/dist/tttx/{p-bc3b9283.entry.js → p-58d7c978.entry.js} +1 -1
  78. package/dist/tttx/{p-c751ebc2.entry.js → p-8b511fff.entry.js} +1 -1
  79. package/dist/tttx/{p-6a6ff7b7.entry.js → p-909c090d.entry.js} +1 -1
  80. package/dist/tttx/p-a658e1ac.entry.js +1 -0
  81. package/dist/tttx/{p-0b25ac9c.js → p-d3835fde.js} +2 -2
  82. package/dist/tttx/tttx.esm.js +1 -1
  83. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  84. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  85. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  86. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  87. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  88. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  89. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  90. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  91. package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.d.ts +8 -8
  92. package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.stories.d.ts +23 -23
  93. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.d.ts +18 -18
  94. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.d.ts +24 -24
  95. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +44 -43
  96. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +76 -0
  97. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  98. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  99. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +133 -133
  100. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +278 -0
  101. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  102. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -0
  103. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +21 -20
  104. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -0
  105. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
  106. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
  107. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  108. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  109. package/dist/types/components/palette.stories.d.ts +6 -6
  110. package/dist/types/components.d.ts +2 -0
  111. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  112. package/dist/types/icons.d.ts +2 -2
  113. package/dist/types/index.d.ts +1 -1
  114. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  115. package/package.json +1 -1
  116. package/dist/tttx/p-3b29e8af.entry.js +0 -1
  117. package/dist/tttx/p-637e7e88.entry.js +0 -1
@@ -1,50 +1,50 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
- export default {
3
- title: 'molecules/Filter',
4
- component: 'tttx-filter',
5
- argTypes: {
6
- filterOptions: {
7
- control: { type: 'object' }
8
- },
9
- filterButtonStyle: {
10
- table: { defaultValue: { summary: 'list filter' } },
11
- control: { type: 'select' },
12
- options: ['list filter', 'list icon', 'table icon'],
13
- },
14
- showSearchField: {
15
- table: { defaultValue: { summary: false } },
16
- control: { type: 'boolean' },
17
- },
18
- showSelectAll: {
19
- table: { defaultValue: { summary: true } },
20
- control: { type: 'boolean' },
21
- },
22
- showOptionIcons: {
23
- table: { defaultValue: { summary: true } },
24
- control: { type: 'boolean' },
25
- },
26
- filterHeader: {
27
- control: { type: 'text' },
28
- },
29
- popoverWidth: {
30
- control: { type: 'text' },
31
- },
32
- },
33
- parameters: {
34
- actions: {
35
- handles: ['filterChangeEvent'],
36
- },
37
- },
38
- decorators: [withActions],
39
- };
40
- const filterOptions = [
41
- { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
42
- { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
43
- { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
44
- ];
45
- const ExampleFilter = args => {
46
- const filterHeader = args.filterHeader || 'Qualification status';
47
- const jsonFilterOptions = args.filterOptions ? JSON.stringify(args.filterOptions) : undefined;
1
+ import { withActions } from '@storybook/addon-actions/decorator';
2
+ export default {
3
+ title: 'molecules/Filter',
4
+ component: 'tttx-filter',
5
+ argTypes: {
6
+ filterOptions: {
7
+ control: { type: 'object' }
8
+ },
9
+ filterButtonStyle: {
10
+ table: { defaultValue: { summary: 'list filter' } },
11
+ control: { type: 'select' },
12
+ options: ['list filter', 'list icon', 'table icon'],
13
+ },
14
+ showSearchField: {
15
+ table: { defaultValue: { summary: false } },
16
+ control: { type: 'boolean' },
17
+ },
18
+ showSelectAll: {
19
+ table: { defaultValue: { summary: true } },
20
+ control: { type: 'boolean' },
21
+ },
22
+ showOptionIcons: {
23
+ table: { defaultValue: { summary: true } },
24
+ control: { type: 'boolean' },
25
+ },
26
+ filterHeader: {
27
+ control: { type: 'text' },
28
+ },
29
+ popoverWidth: {
30
+ control: { type: 'text' },
31
+ },
32
+ },
33
+ parameters: {
34
+ actions: {
35
+ handles: ['filterChangeEvent'],
36
+ },
37
+ },
38
+ decorators: [withActions],
39
+ };
40
+ const filterOptions = [
41
+ { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
42
+ { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
43
+ { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
44
+ ];
45
+ const ExampleFilter = args => {
46
+ const filterHeader = args.filterHeader || 'Qualification status';
47
+ const jsonFilterOptions = args.filterOptions ? JSON.stringify(args.filterOptions) : undefined;
48
48
  return `<tttx-filter
49
49
  ${jsonFilterOptions ? 'filter-options=\'' + jsonFilterOptions + '\'' : ''}
50
50
  ${args.showSearchField ? 'show-search-field=\'' + args.showSearchField + '\'' : ''}
@@ -55,36 +55,36 @@ const ExampleFilter = args => {
55
55
  ${args.popoverWidth ? 'popover-width=\'' + args.popoverWidth + '\'' : ''}
56
56
  filter-header='${filterHeader}'
57
57
  filter-key='basic-filter'
58
- ></tttx-filter>`;
59
- };
60
- export const Default = ExampleFilter.bind({});
61
- export const CustomFilterOptions = ExampleFilter.bind({});
62
- CustomFilterOptions.args = {
63
- filterOptions
64
- };
65
- export const DefaultFilterOptions = ExampleFilter.bind({});
66
- DefaultFilterOptions.args = {
67
- filterOptions,
68
- defaultFilterOptions: JSON.stringify(['Active'])
69
- };
70
- export const EverythingDefaultFilterOptions = ExampleFilter.bind({});
71
- EverythingDefaultFilterOptions.args = {
72
- filterOptions,
73
- defaultFilterOptions: JSON.stringify(['Active', 'Expiring soon', 'Expired'])
74
- };
75
- export const ListFilterWithoutSearchField = ExampleFilter.bind({});
76
- ListFilterWithoutSearchField.args = {
77
- filterOptions,
78
- showSearchField: false
79
- };
80
- export const TableIconWithoutOptionIconsOrSelectAll = ExampleFilter.bind({});
81
- TableIconWithoutOptionIconsOrSelectAll.args = {
82
- filterOptions,
83
- showOptionIcons: false,
84
- showSelectAll: false
85
- };
86
- export const WithCustomWidth = ExampleFilter.bind({});
87
- WithCustomWidth.args = {
88
- filterOptions,
89
- popoverWidth: '300px'
90
- };
58
+ ></tttx-filter>`;
59
+ };
60
+ export const Default = ExampleFilter.bind({});
61
+ export const CustomFilterOptions = ExampleFilter.bind({});
62
+ CustomFilterOptions.args = {
63
+ filterOptions
64
+ };
65
+ export const DefaultFilterOptions = ExampleFilter.bind({});
66
+ DefaultFilterOptions.args = {
67
+ filterOptions,
68
+ defaultFilterOptions: JSON.stringify(['Active'])
69
+ };
70
+ export const EverythingDefaultFilterOptions = ExampleFilter.bind({});
71
+ EverythingDefaultFilterOptions.args = {
72
+ filterOptions,
73
+ defaultFilterOptions: JSON.stringify(['Active', 'Expiring soon', 'Expired'])
74
+ };
75
+ export const ListFilterWithoutSearchField = ExampleFilter.bind({});
76
+ ListFilterWithoutSearchField.args = {
77
+ filterOptions,
78
+ showSearchField: false
79
+ };
80
+ export const TableIconWithoutOptionIconsOrSelectAll = ExampleFilter.bind({});
81
+ TableIconWithoutOptionIconsOrSelectAll.args = {
82
+ filterOptions,
83
+ showOptionIcons: false,
84
+ showSelectAll: false
85
+ };
86
+ export const WithCustomWidth = ExampleFilter.bind({});
87
+ WithCustomWidth.args = {
88
+ filterOptions,
89
+ popoverWidth: '300px'
90
+ };
@@ -1,37 +1,37 @@
1
- /**
2
- * Sets the error state of an input field by updating its class and error message.
3
- * If an error was detected, it sets the input field's class to "invalid" and
4
- * displays the error message in an error bubble. If no error was detected,
5
- * it removes the "invalid" class from the input field and clears the error bubble.
6
- *
7
- * @param {HTMLInputElement} target - The input field to update.
8
- * @param {boolean} hasError - Whether an error was detected in the field.
9
- * @param {string} errorMessage - The error message to display (if any).
10
- * @return {void}
11
- */
12
- function setErrorState(target, hasError, errorMessage) {
13
- // Find the error bubble element for the input field
14
- const errorBubble = target.parentElement.querySelector('.errorBubble');
15
- // If an error was detected, set the input field's class to "invalid" and display the error message in the error bubble
16
- if (hasError) {
17
- target.classList.add('invalid');
18
- errorBubble.classList.add('visible');
19
- const errorIcon = document.createElement('span');
20
- // Set the class of the error icon to a pre-defined CSS class that specifies the icon's appearance
21
- errorIcon.className = 'material-symbols-rounded';
22
- // Set the text content of the error icon to the word "warning"
23
- errorIcon.textContent = 'warning';
24
- // errorBubble.replaceChildren cannot be used here because the tests don't support this new feature :(
25
- errorBubble.innerHTML = '';
26
- errorBubble.append(errorIcon);
27
- errorBubble.append(errorMessage);
28
- // errorBubble.replaceChildren(errorIcon, errorMessage);
29
- }
30
- // If no error was detected, remove the "invalid" class from the input field and clear the error bubble
31
- else {
32
- errorBubble.classList.remove('visible');
33
- target.classList.remove('invalid');
34
- errorBubble.innerHTML = '';
35
- }
36
- }
37
- export default setErrorState;
1
+ /**
2
+ * Sets the error state of an input field by updating its class and error message.
3
+ * If an error was detected, it sets the input field's class to "invalid" and
4
+ * displays the error message in an error bubble. If no error was detected,
5
+ * it removes the "invalid" class from the input field and clears the error bubble.
6
+ *
7
+ * @param {HTMLInputElement} target - The input field to update.
8
+ * @param {boolean} hasError - Whether an error was detected in the field.
9
+ * @param {string} errorMessage - The error message to display (if any).
10
+ * @return {void}
11
+ */
12
+ function setErrorState(target, hasError, errorMessage) {
13
+ // Find the error bubble element for the input field
14
+ const errorBubble = target.parentElement.querySelector('.errorBubble');
15
+ // If an error was detected, set the input field's class to "invalid" and display the error message in the error bubble
16
+ if (hasError) {
17
+ target.classList.add('invalid');
18
+ errorBubble.classList.add('visible');
19
+ const errorIcon = document.createElement('span');
20
+ // Set the class of the error icon to a pre-defined CSS class that specifies the icon's appearance
21
+ errorIcon.className = 'material-symbols-rounded';
22
+ // Set the text content of the error icon to the word "warning"
23
+ errorIcon.textContent = 'warning';
24
+ // errorBubble.replaceChildren cannot be used here because the tests don't support this new feature :(
25
+ errorBubble.innerHTML = '';
26
+ errorBubble.append(errorIcon);
27
+ errorBubble.append(errorMessage);
28
+ // errorBubble.replaceChildren(errorIcon, errorMessage);
29
+ }
30
+ // If no error was detected, remove the "invalid" class from the input field and clear the error bubble
31
+ else {
32
+ errorBubble.classList.remove('visible');
33
+ target.classList.remove('invalid');
34
+ errorBubble.innerHTML = '';
35
+ }
36
+ }
37
+ export default setErrorState;
@@ -1,61 +1,61 @@
1
- /**
2
- * Validates the input field on focusout event by checking its validity state,
3
- * sets an error message if there's an issue, and emits a "dataChanged" event to
4
- * the parent component with the field name and its new value.
5
- *
6
- * @param {Event} event - The focusout event triggered by the input field.
7
- * @return {void}
8
- */
9
- function validityCheck(event) {
10
- var _a, _b, _c, _d;
11
- event.preventDefault();
12
- const target = event.target;
13
- let hasError = true;
14
- let errorMessage = '';
15
- // validity object on HTML5 inputs has the following options
16
- // badInput
17
- // customError
18
- // patternMismatch
19
- // rangeOverflow
20
- // rangeUnderflow
21
- // stepMismatch
22
- // tooLong
23
- // tooShort
24
- // typeMismatch
25
- // valid
26
- // valueMissing
27
- // customErrors can be set with
28
- // target.setCustomValidity('custom error!');
29
- // and cleared with
30
- // target.setCustomValidity('');
31
- // Check the validity of the input field and set an error message if needed
32
- switch (true) {
33
- // The field is required, but has no value
34
- case target.validity.valueMissing:
35
- errorMessage = (_a = target.dataset.required) !== null && _a !== void 0 ? _a : 'This field is required';
36
- break;
37
- // The field's value does not match the expected pattern
38
- case target.validity.patternMismatch:
39
- errorMessage = (_b = target.dataset.pattern) !== null && _b !== void 0 ? _b : 'Incorrect format';
40
- break;
41
- // The field's value is not of the correct input type
42
- case target.validity.badInput:
43
- // IE string in a number field
44
- errorMessage = (_c = target.dataset.badinput) !== null && _c !== void 0 ? _c : 'Wrong input type';
45
- break;
46
- // The field's value is above or below the range set in the "min" and "max" attributes
47
- case target.validity.rangeOverflow || target.validity.rangeUnderflow:
48
- // IE date or number is above or below value set in min or max tags
49
- errorMessage = (_d = target.dataset.range) !== null && _d !== void 0 ? _d : 'Invalid value';
50
- break;
51
- case target.validity.customError:
52
- errorMessage = target.validationMessage;
53
- break;
54
- // No error detected
55
- default:
56
- hasError = false;
57
- }
58
- // Return the error state
59
- return { target, hasError, errorMessage };
60
- }
61
- export default validityCheck;
1
+ /**
2
+ * Validates the input field on focusout event by checking its validity state,
3
+ * sets an error message if there's an issue, and emits a "dataChanged" event to
4
+ * the parent component with the field name and its new value.
5
+ *
6
+ * @param {Event} event - The focusout event triggered by the input field.
7
+ * @return {void}
8
+ */
9
+ function validityCheck(event) {
10
+ var _a, _b, _c, _d;
11
+ event.preventDefault();
12
+ const target = event.target;
13
+ let hasError = true;
14
+ let errorMessage = '';
15
+ // validity object on HTML5 inputs has the following options
16
+ // badInput
17
+ // customError
18
+ // patternMismatch
19
+ // rangeOverflow
20
+ // rangeUnderflow
21
+ // stepMismatch
22
+ // tooLong
23
+ // tooShort
24
+ // typeMismatch
25
+ // valid
26
+ // valueMissing
27
+ // customErrors can be set with
28
+ // target.setCustomValidity('custom error!');
29
+ // and cleared with
30
+ // target.setCustomValidity('');
31
+ // Check the validity of the input field and set an error message if needed
32
+ switch (true) {
33
+ // The field is required, but has no value
34
+ case target.validity.valueMissing:
35
+ errorMessage = (_a = target.dataset.required) !== null && _a !== void 0 ? _a : 'This field is required';
36
+ break;
37
+ // The field's value does not match the expected pattern
38
+ case target.validity.patternMismatch:
39
+ errorMessage = (_b = target.dataset.pattern) !== null && _b !== void 0 ? _b : 'Incorrect format';
40
+ break;
41
+ // The field's value is not of the correct input type
42
+ case target.validity.badInput:
43
+ // IE string in a number field
44
+ errorMessage = (_c = target.dataset.badinput) !== null && _c !== void 0 ? _c : 'Wrong input type';
45
+ break;
46
+ // The field's value is above or below the range set in the "min" and "max" attributes
47
+ case target.validity.rangeOverflow || target.validity.rangeUnderflow:
48
+ // IE date or number is above or below value set in min or max tags
49
+ errorMessage = (_d = target.dataset.range) !== null && _d !== void 0 ? _d : 'Invalid value';
50
+ break;
51
+ case target.validity.customError:
52
+ errorMessage = target.validationMessage;
53
+ break;
54
+ // No error detected
55
+ default:
56
+ hasError = false;
57
+ }
58
+ // Return the error state
59
+ return { target, hasError, errorMessage };
60
+ }
61
+ export default validityCheck;