@demos-europe/demosplan-ui 0.4.12 → 0.4.13
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +10 -0
- package/babel.config.js +9 -9
- package/dist/demosplan-ui.umd.js +1 -1
- package/eslint.config.js +104 -0
- package/jest/shallowMountWithGlobalMocks.js +8 -6
- package/jest.config.js +4 -4
- package/package.json +12 -5
- package/scripts/buildTokens.js +1 -1
- package/scripts/utils/transformTokens.js +2 -2
- package/src/components/DpAccordion/DpAccordion.vue +4 -4
- package/src/components/DpAnonymizeText/DpAnonymizeText.vue +4 -4
- package/src/components/DpBulkEditHeader/DpBulkEditHeader.stories.tsx +1 -1
- package/src/components/DpButton/DpButton.vue +51 -43
- package/src/components/DpButtonIcon/DpButtonIcon.vue +5 -5
- package/src/components/DpButtonRow/DpButtonRow.vue +5 -5
- package/src/components/DpCheckbox/DpCheckbox.vue +2 -2
- package/src/components/DpCheckboxGroup/DpCheckboxGroup.vue +4 -4
- package/src/components/DpColumnSelector/DpColumnSelector.vue +1 -1
- package/src/components/DpContextualHelp/DpContextualHelp.vue +4 -4
- package/src/components/DpDataTable/DpDataTable.vue +53 -49
- package/src/components/DpDataTable/DpResizableColumn.vue +1 -1
- package/src/components/DpDataTable/DpTableHeader.vue +6 -4
- package/src/components/DpDataTable/DpTableRow.vue +1 -1
- package/src/components/DpDataTableExtended/DpDataTableExtended.vue +8 -8
- package/src/components/DpDataTableExtended/DpSelectPageItemCount.vue +2 -2
- package/src/components/DpDatetimePicker/DpDatetimePicker.vue +6 -6
- package/src/components/DpDetails/DpDetails.vue +1 -1
- package/src/components/DpDraggable/DpDraggable.vue +10 -12
- package/src/components/DpEditor/DpEditor.vue +45 -45
- package/src/components/DpEditor/DpResizableImage.vue +6 -6
- package/src/components/DpEditor/DpUploadModal.vue +11 -12
- package/src/components/DpEditor/MentionList.vue +5 -3
- package/src/components/DpEditor/libs/editorObscure.js +2 -2
- package/src/components/DpFlyout/DpFlyout.vue +5 -5
- package/src/components/DpIcon/util/iconConfig.ts +28 -28
- package/src/components/DpInlineNotification/DpInlineNotification.vue +2 -2
- package/src/components/DpLabel/DpLabel.vue +5 -3
- package/src/components/DpModal/DpModal.vue +5 -5
- package/src/components/DpMultiselect/DpMultiselect.vue +23 -25
- package/src/components/DpMultistepNav/DpMultistepNav.vue +2 -2
- package/src/components/DpPager/DpPager.vue +12 -12
- package/src/components/DpResettableInput/DpResettableInput.vue +3 -3
- package/src/components/DpSearchField/DpSearchField.vue +7 -2
- package/src/components/DpSelect/DpSelect.vue +3 -3
- package/src/components/DpSkeletonBox/DpSkeletonBox.vue +1 -1
- package/src/components/DpSlidebar/DpSlidebar.vue +2 -2
- package/src/components/DpSplitButton/DpSplitButton.vue +2 -2
- package/src/components/DpStickyElement/DpStickyElement.vue +1 -1
- package/src/components/DpTabs/DpTabs.vue +1 -1
- package/src/components/DpTextArea/DpTextArea.vue +4 -4
- package/src/components/DpTimePicker/DpTimePicker.vue +14 -14
- package/src/components/DpToggle/DpToggle.vue +1 -1
- package/src/components/DpTooltip/DpTooltip.vue +4 -2
- package/src/components/DpTooltip/utils/tooltip.js +4 -4
- package/src/components/DpTooltipIcon/DpTooltipIcon.vue +2 -2
- package/src/components/DpTransitionExpand/DpTransitionExpand.vue +1 -1
- package/src/components/DpTreeList/DpTreeList.vue +4 -4
- package/src/components/DpTreeList/DpTreeListCheckbox.vue +1 -1
- package/src/components/DpTreeList/DpTreeListNode.vue +12 -12
- package/src/components/DpUploadFiles/DpUpload.vue +2 -2
- package/src/components/DpUploadFiles/DpUploadFiles.vue +10 -10
- package/src/components/DpUploadFiles/DpUploadedFile.vue +6 -6
- package/src/components/DpUploadFiles/DpUploadedFileList.vue +4 -4
- package/src/components/DpVideoPlayer/DpVideoPlayer.vue +7 -7
- package/src/directives/CleanHtml/CleanHtml.js +1 -1
- package/src/directives/Tooltip/Tooltip.js +1 -1
- package/src/lib/ActionMenu.js +48 -48
- package/src/lib/DpApi.js +2 -2
- package/src/lib/FileInfo.js +15 -15
- package/src/lib/validation/utils/assignHandlerForTrigger.js +8 -8
- package/src/lib/validation/utils/assignHandlersForInputs.js +51 -51
- package/src/lib/validation/utils/assignObserver.js +29 -29
- package/src/lib/validation/utils/helpers.js +4 -4
- package/src/lib/validation/utils/validateForm.js +15 -15
- package/src/lib/validation/utils/validateInputField.js +11 -11
- package/src/utils/index.js +2 -2
- package/tokens/dist/js/boxShadow.js +1 -1
- package/tokens/dist/js/breakpoints.js +1 -1
- package/tokens/dist/js/color.brand.js +1 -1
- package/tokens/dist/js/color.data.js +1 -1
- package/tokens/dist/js/color.palette.js +1 -1
- package/tokens/dist/js/color.ui.js +1 -1
- package/tokens/dist/js/fontSize.js +1 -1
- package/tokens/dist/js/rounded.js +1 -1
- package/tokens/dist/js/space.js +1 -1
- package/tokens/dist/js/zIndex.js +1 -1
- package/tokens/dist/scss/_boxShadow.scss +1 -1
- package/tokens/dist/scss/_breakpoints.scss +1 -1
- package/tokens/dist/scss/_color.brand.scss +1 -1
- package/tokens/dist/scss/_color.data.scss +1 -1
- package/tokens/dist/scss/_color.palette.scss +1 -1
- package/tokens/dist/scss/_color.ui.scss +1 -1
- package/tokens/dist/scss/_fontSize.scss +1 -1
- package/tokens/dist/scss/_rounded.scss +1 -1
- package/tokens/dist/scss/_space.scss +1 -1
- package/tokens/dist/scss/_zIndex.scss +1 -1
- package/types/icons.ts +26 -26
- package/coverage/clover.xml +0 -6
- package/coverage/coverage-final.json +0 -1
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/components/DpContextualHelp/DpContextualHelp.vue.html +0 -271
- package/coverage/lcov-report/components/DpContextualHelp/index.html +0 -116
- package/coverage/lcov-report/components/DpDataTableExtended/DataTableSearch.js.html +0 -190
- package/coverage/lcov-report/components/DpDataTableExtended/index.html +0 -116
- package/coverage/lcov-report/components/DpEditor/libs/handleWordPaste.js.html +0 -1138
- package/coverage/lcov-report/components/DpEditor/libs/index.html +0 -116
- package/coverage/lcov-report/components/DpIcon/DpIcon.vue.html +0 -256
- package/coverage/lcov-report/components/DpIcon/index.html +0 -131
- package/coverage/lcov-report/components/DpIcon/index.ts.html +0 -91
- package/coverage/lcov-report/components/DpIcon/util/iconVariables.js.html +0 -682
- package/coverage/lcov-report/components/DpIcon/util/index.html +0 -116
- package/coverage/lcov-report/components/DpTooltip/utils/index.html +0 -116
- package/coverage/lcov-report/components/DpTooltip/utils/tooltip.js.html +0 -490
- package/coverage/lcov-report/components/shared/index.html +0 -116
- package/coverage/lcov-report/components/shared/translations.js.html +0 -490
- package/coverage/lcov-report/directives/CleanHtml/CleanHtml.js.html +0 -265
- package/coverage/lcov-report/directives/CleanHtml/index.html +0 -116
- package/coverage/lcov-report/directives/Tooltip/Tooltip.js.html +0 -349
- package/coverage/lcov-report/directives/Tooltip/index.html +0 -116
- package/coverage/lcov-report/directives/index.html +0 -116
- package/coverage/lcov-report/directives/index.js.html +0 -109
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -101
- package/coverage/lcov-report/jest/index.html +0 -116
- package/coverage/lcov-report/jest/shallowMountWithGlobalMocks.js.html +0 -208
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/components/DpCheckbox/DpCheckbox.vue.html +0 -424
- package/coverage/lcov-report/src/components/DpCheckbox/index.html +0 -116
- package/coverage/lcov-report/src/components/DpContextualHelp/DpContextualHelp.vue.html +0 -361
- package/coverage/lcov-report/src/components/DpContextualHelp/index.html +0 -131
- package/coverage/lcov-report/src/components/DpContextualHelp/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpDataTableExtended/DataTableSearch.js.html +0 -190
- package/coverage/lcov-report/src/components/DpDataTableExtended/index.html +0 -116
- package/coverage/lcov-report/src/components/DpDraggable/DpDraggable.vue.html +0 -499
- package/coverage/lcov-report/src/components/DpDraggable/index.html +0 -131
- package/coverage/lcov-report/src/components/DpDraggable/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpEditor/libs/handleWordPaste.js.html +0 -1153
- package/coverage/lcov-report/src/components/DpEditor/libs/index.html +0 -116
- package/coverage/lcov-report/src/components/DpIcon/DpIcon.vue.html +0 -256
- package/coverage/lcov-report/src/components/DpIcon/index.html +0 -131
- package/coverage/lcov-report/src/components/DpIcon/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpIcon/util/iconVariables.js.html +0 -706
- package/coverage/lcov-report/src/components/DpIcon/util/index.html +0 -116
- package/coverage/lcov-report/src/components/DpInput/DpInput.vue.html +0 -937
- package/coverage/lcov-report/src/components/DpInput/index.html +0 -131
- package/coverage/lcov-report/src/components/DpInput/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpLabel/DpLabel.vue.html +0 -409
- package/coverage/lcov-report/src/components/DpLabel/index.html +0 -131
- package/coverage/lcov-report/src/components/DpLabel/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpModal/DpModal.vue.html +0 -739
- package/coverage/lcov-report/src/components/DpModal/index.html +0 -131
- package/coverage/lcov-report/src/components/DpModal/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpNotification/DpNotification.vue.html +0 -343
- package/coverage/lcov-report/src/components/DpNotification/index.html +0 -131
- package/coverage/lcov-report/src/components/DpNotification/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpObscure/DpObscure.vue.html +0 -148
- package/coverage/lcov-report/src/components/DpObscure/index.html +0 -131
- package/coverage/lcov-report/src/components/DpObscure/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpSelect/DpSelect.vue.html +0 -559
- package/coverage/lcov-report/src/components/DpSelect/index.html +0 -131
- package/coverage/lcov-report/src/components/DpSelect/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpTooltip/utils/index.html +0 -116
- package/coverage/lcov-report/src/components/DpTooltip/utils/tooltip.js.html +0 -490
- package/coverage/lcov-report/src/components/DpTreeList/DpTreeList.vue.html +0 -1099
- package/coverage/lcov-report/src/components/DpTreeList/DpTreeListCheckbox.vue.html +0 -301
- package/coverage/lcov-report/src/components/DpTreeList/DpTreeListNode.vue.html +0 -1144
- package/coverage/lcov-report/src/components/DpTreeList/DpTreeListToggle.vue.html +0 -382
- package/coverage/lcov-report/src/components/DpTreeList/index.html +0 -161
- package/coverage/lcov-report/src/components/DpTreeList/utils/constants.js.html +0 -100
- package/coverage/lcov-report/src/components/DpTreeList/utils/index.html +0 -116
- package/coverage/lcov-report/src/components/DpUploadFiles/DpUpload.vue.html +0 -979
- package/coverage/lcov-report/src/components/DpUploadFiles/DpUploadFiles.vue.html +0 -970
- package/coverage/lcov-report/src/components/DpUploadFiles/DpUploadedFile.vue.html +0 -340
- package/coverage/lcov-report/src/components/DpUploadFiles/DpUploadedFileList.vue.html +0 -202
- package/coverage/lcov-report/src/components/DpUploadFiles/index.html +0 -176
- package/coverage/lcov-report/src/components/DpUploadFiles/index.ts.html +0 -91
- package/coverage/lcov-report/src/components/DpUploadFiles/utils/UppyTranslations.js.html +0 -151
- package/coverage/lcov-report/src/components/DpUploadFiles/utils/index.html +0 -116
- package/coverage/lcov-report/src/components/shared/index.html +0 -116
- package/coverage/lcov-report/src/components/shared/translations.js.html +0 -508
- package/coverage/lcov-report/src/directives/CleanHtml/CleanHtml.js.html +0 -265
- package/coverage/lcov-report/src/directives/CleanHtml/index.html +0 -116
- package/coverage/lcov-report/src/directives/Tooltip/Tooltip.js.html +0 -349
- package/coverage/lcov-report/src/directives/Tooltip/index.html +0 -116
- package/coverage/lcov-report/src/directives/index.html +0 -116
- package/coverage/lcov-report/src/directives/index.js.html +0 -109
- package/coverage/lcov-report/src/lib/ActionMenu.js.html +0 -610
- package/coverage/lcov-report/src/lib/Detabinator.js.html +0 -304
- package/coverage/lcov-report/src/lib/DpApi.js.html +0 -748
- package/coverage/lcov-report/src/lib/DpConfirm.js.html +0 -118
- package/coverage/lcov-report/src/lib/DpGetCssVariable.js.html +0 -103
- package/coverage/lcov-report/src/lib/FileInfo.js.html +0 -574
- package/coverage/lcov-report/src/lib/HighlightHashLink.js.html +0 -160
- package/coverage/lcov-report/src/lib/MatchMedia.js.html +0 -220
- package/coverage/lcov-report/src/lib/SideNav.js.html +0 -712
- package/coverage/lcov-report/src/lib/Sticky.js.html +0 -223
- package/coverage/lcov-report/src/lib/TableWrapper.js.html +0 -214
- package/coverage/lcov-report/src/lib/index.html +0 -281
- package/coverage/lcov-report/src/lib/index.js.html +0 -190
- package/coverage/lcov-report/src/lib/validation/utils/assignHandlersForInputs.js.html +0 -400
- package/coverage/lcov-report/src/lib/validation/utils/helpers.js.html +0 -523
- package/coverage/lcov-report/src/lib/validation/utils/index.html +0 -236
- package/coverage/lcov-report/src/lib/validation/utils/validateDatepicker.js.html +0 -160
- package/coverage/lcov-report/src/lib/validation/utils/validateEmail.js.html +0 -136
- package/coverage/lcov-report/src/lib/validation/utils/validateFieldset.js.html +0 -163
- package/coverage/lcov-report/src/lib/validation/utils/validateForm.js.html +0 -205
- package/coverage/lcov-report/src/lib/validation/utils/validateInputField.js.html +0 -403
- package/coverage/lcov-report/src/lib/validation/utils/validateMultiselect.js.html +0 -121
- package/coverage/lcov-report/src/lib/validation/utils/validateTiptap.js.html +0 -160
- package/coverage/lcov-report/src/mixins/dpSelectAllMixin.js.html +0 -232
- package/coverage/lcov-report/src/mixins/dpValidateMixin.js.html +0 -460
- package/coverage/lcov-report/src/mixins/index.html +0 -176
- package/coverage/lcov-report/src/mixins/index.js.html +0 -124
- package/coverage/lcov-report/src/mixins/prefixClassMixin/index.html +0 -116
- package/coverage/lcov-report/src/mixins/prefixClassMixin/prefixClassMixin.js.html +0 -121
- package/coverage/lcov-report/src/mixins/sessionStorageMixin.js.html +0 -160
- package/coverage/lcov-report/src/mixins/tableSelectAllItems.js.html +0 -427
- package/coverage/lcov-report/src/shared/index.html +0 -116
- package/coverage/lcov-report/src/shared/index.js.html +0 -103
- package/coverage/lcov-report/src/shared/props/index.html +0 -116
- package/coverage/lcov-report/src/shared/props/props.js.html +0 -310
- package/coverage/lcov-report/src/utils/date.js.html +0 -208
- package/coverage/lcov-report/src/utils/debounce.js.html +0 -163
- package/coverage/lcov-report/src/utils/deepMerge.js.html +0 -175
- package/coverage/lcov-report/src/utils/formatBytes.js.html +0 -133
- package/coverage/lcov-report/src/utils/formatString.js.html +0 -109
- package/coverage/lcov-report/src/utils/fullscreen.js.html +0 -253
- package/coverage/lcov-report/src/utils/getAnimationEventName.js.html +0 -157
- package/coverage/lcov-report/src/utils/getScrollTop.js.html +0 -109
- package/coverage/lcov-report/src/utils/hasOwnProp.js.html +0 -142
- package/coverage/lcov-report/src/utils/hasPermission.js.html +0 -214
- package/coverage/lcov-report/src/utils/index.html +0 -341
- package/coverage/lcov-report/src/utils/index.js.html +0 -217
- package/coverage/lcov-report/src/utils/lengthHint/index.html +0 -116
- package/coverage/lcov-report/src/utils/lengthHint/lengthHint.js.html +0 -268
- package/coverage/lcov-report/src/utils/prefixClass.js.html +0 -199
- package/coverage/lcov-report/src/utils/resistFingerprintingDuckTest.js.html +0 -232
- package/coverage/lcov-report/src/utils/sortAlphabetically.js.html +0 -193
- package/coverage/lcov-report/src/utils/throttle.js.html +0 -145
- package/coverage/lcov-report/src/utils/uniqueArrayByObjectKey.js.html +0 -151
- package/coverage/lcov-report/utils/date.js.html +0 -208
- package/coverage/lcov-report/utils/debounce.js.html +0 -163
- package/coverage/lcov-report/utils/deepMerge.js.html +0 -175
- package/coverage/lcov-report/utils/formatBytes.js.html +0 -133
- package/coverage/lcov-report/utils/fullscreen.js.html +0 -253
- package/coverage/lcov-report/utils/getAnimationEventName.js.html +0 -157
- package/coverage/lcov-report/utils/getScrollTop.js.html +0 -109
- package/coverage/lcov-report/utils/hasOwnProp.js.html +0 -142
- package/coverage/lcov-report/utils/hasPermission.js.html +0 -214
- package/coverage/lcov-report/utils/index.html +0 -326
- package/coverage/lcov-report/utils/index.js.html +0 -211
- package/coverage/lcov-report/utils/lengthHint/index.html +0 -116
- package/coverage/lcov-report/utils/lengthHint/lengthHint.js.html +0 -268
- package/coverage/lcov-report/utils/prefixClass.js.html +0 -199
- package/coverage/lcov-report/utils/resistFingerprintingDuckTest.js.html +0 -232
- package/coverage/lcov-report/utils/sortAlphabetically.js.html +0 -193
- package/coverage/lcov-report/utils/throttle.js.html +0 -145
- package/coverage/lcov-report/utils/uniqueArrayByObjectKey.js.html +0 -151
- package/coverage/lcov.info +0 -0
- package/style/style.css +0 -1002
|
@@ -23,10 +23,10 @@ function assignHandlersForSingleInput (input) {
|
|
|
23
23
|
const matchers = condition.split(comparisonType === 'isNotEqual' ? '!==' : '===')
|
|
24
24
|
const validationContainer = input.closest('[data-dp-validate]')
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
* Use the form as the validation container. This is necessary because in some cases, such as wizard,
|
|
27
|
+
* the value of the 'data-dp-validate-if' attribute may refer to a different fieldset.
|
|
28
|
+
* By using the form, this condition can be found throughout the entire form.
|
|
29
|
+
*/
|
|
30
30
|
const form = validationContainer.tagName === 'FIELDSET' && validationContainer.form ? validationContainer.form : validationContainer
|
|
31
31
|
|
|
32
32
|
try {
|
|
@@ -49,56 +49,56 @@ function assignHandlersForSingleInput (input) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
switch (type) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// If input has error remove it on focus
|
|
58
|
-
if (tiptapField.classList.contains(errorClass)) {
|
|
59
|
-
tiptapField.classList.remove(errorClass)
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
observeValidationRelations(input, () => validateTiptap(input))
|
|
63
|
-
})
|
|
64
|
-
break
|
|
65
|
-
case 'fieldset':
|
|
66
|
-
checkboxes = Array.from(input.querySelectorAll('input[type="checkbox"]'))
|
|
67
|
-
radios = Array.from(input.querySelectorAll('input[type="radio"]'))
|
|
68
|
-
|
|
69
|
-
if (checkboxes.length > 0) {
|
|
70
|
-
fieldsToCheck = checkboxes
|
|
71
|
-
} else if (radios.length > 0) {
|
|
72
|
-
fieldsToCheck = radios
|
|
73
|
-
} else {
|
|
74
|
-
fieldsToCheck = []
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
fieldsToCheck.forEach(checkbox => checkbox.addEventListener('blur', () => validateFieldset(input)))
|
|
78
|
-
fieldsToCheck.forEach(checkbox => checkbox.addEventListener('change', () => validateFieldset(input)))
|
|
79
|
-
observeValidationRelations(input, () => validateFieldset(input))
|
|
80
|
-
break
|
|
81
|
-
case 'datepicker':
|
|
82
|
-
input.addEventListener('focus', () => {
|
|
52
|
+
case 'tiptap':
|
|
53
|
+
awaitElement('div[contenteditable="true"]', input.parentNode).then(() => {
|
|
54
|
+
const tiptapField = input.parentNode.querySelector('div[contenteditable="true"]')
|
|
55
|
+
tiptapField.addEventListener('blur', () => validateTiptap(input))
|
|
56
|
+
tiptapField.addEventListener('focus', () => {
|
|
83
57
|
// If input has error remove it on focus
|
|
84
|
-
if (
|
|
85
|
-
|
|
58
|
+
if (tiptapField.classList.contains(errorClass)) {
|
|
59
|
+
tiptapField.classList.remove(errorClass)
|
|
86
60
|
}
|
|
87
61
|
})
|
|
88
|
-
input
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
62
|
+
observeValidationRelations(input, () => validateTiptap(input))
|
|
63
|
+
})
|
|
64
|
+
break
|
|
65
|
+
case 'fieldset':
|
|
66
|
+
checkboxes = Array.from(input.querySelectorAll('input[type="checkbox"]'))
|
|
67
|
+
radios = Array.from(input.querySelectorAll('input[type="radio"]'))
|
|
68
|
+
|
|
69
|
+
if (checkboxes.length > 0) {
|
|
70
|
+
fieldsToCheck = checkboxes
|
|
71
|
+
} else if (radios.length > 0) {
|
|
72
|
+
fieldsToCheck = radios
|
|
73
|
+
} else {
|
|
74
|
+
fieldsToCheck = []
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
fieldsToCheck.forEach(checkbox => checkbox.addEventListener('blur', () => validateFieldset(input)))
|
|
78
|
+
fieldsToCheck.forEach(checkbox => checkbox.addEventListener('change', () => validateFieldset(input)))
|
|
79
|
+
observeValidationRelations(input, () => validateFieldset(input))
|
|
80
|
+
break
|
|
81
|
+
case 'datepicker':
|
|
82
|
+
input.addEventListener('focus', () => {
|
|
83
|
+
// If input has error remove it on focus
|
|
84
|
+
if (input.classList.contains(errorClass)) {
|
|
85
|
+
input.classList.remove(errorClass)
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
input.addEventListener('blur', () => validateDatepicker(input))
|
|
89
|
+
observeValidationRelations(input, () => validateDatepicker(input))
|
|
90
|
+
break
|
|
91
|
+
case 'input':
|
|
92
|
+
input.addEventListener('focus', () => {
|
|
93
|
+
// If input has error remove it on focus
|
|
94
|
+
if (input.classList.contains(errorClass)) {
|
|
95
|
+
input.classList.remove(errorClass)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
input.addEventListener('blur', () => validateInput(input))
|
|
99
|
+
observeValidationRelations(input, () => validateInput(input))
|
|
100
|
+
break
|
|
101
|
+
default:
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -8,37 +8,37 @@ export default function assignObserver (form) {
|
|
|
8
8
|
mutations.forEach((mutation) => {
|
|
9
9
|
// Handle mutations here
|
|
10
10
|
switch (mutation.type) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
if (shouldValidate(addedNode)) {
|
|
18
|
-
// If the node itself is an input add handlers directly to it
|
|
19
|
-
assignHandlersForSingleInput(addedNode)
|
|
20
|
-
} else if (addedNode.children.length > 0 && getAllInputsArray(addedNode).length > 0) {
|
|
21
|
-
// If it's not an input then look through its children and find all inputs that we want to validate
|
|
22
|
-
getAllInputsArray(addedNode).forEach(childNode => {
|
|
23
|
-
assignHandlersForSingleInput(childNode)
|
|
24
|
-
})
|
|
25
|
-
}
|
|
11
|
+
case 'childList':
|
|
12
|
+
if (mutation.addedNodes.length > 0) {
|
|
13
|
+
const addedNode = Array.from(mutation.addedNodes).filter(node => node.nodeType === 1)[0]
|
|
14
|
+
if (!addedNode) {
|
|
15
|
+
return false
|
|
26
16
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
nodeClone.setCustomValidity('')
|
|
36
|
-
mutation.target.parentNode.replaceChild(nodeClone, mutation.target)
|
|
37
|
-
}
|
|
17
|
+
if (shouldValidate(addedNode)) {
|
|
18
|
+
// If the node itself is an input add handlers directly to it
|
|
19
|
+
assignHandlersForSingleInput(addedNode)
|
|
20
|
+
} else if (addedNode.children.length > 0 && getAllInputsArray(addedNode).length > 0) {
|
|
21
|
+
// If it's not an input then look through its children and find all inputs that we want to validate
|
|
22
|
+
getAllInputsArray(addedNode).forEach(childNode => {
|
|
23
|
+
assignHandlersForSingleInput(childNode)
|
|
24
|
+
})
|
|
38
25
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
}
|
|
27
|
+
break
|
|
28
|
+
case 'attributes':
|
|
29
|
+
if ((mutation.target.tagName === 'INPUT' || mutation.target.tagName === 'TEXTAREA') && (mutation.attributeName === 'required' || mutation.attributeName === 'pattern')) {
|
|
30
|
+
if (mutation.oldValue === null) { // If required is now set, assign validation handlers
|
|
31
|
+
assignHandlersForSingleInput(mutation.target)
|
|
32
|
+
} else if (wasAttributeRemoved(mutation)) { // If required was removed, replace the node with it's clone to remove all event listeners
|
|
33
|
+
const nodeClone = mutation.target.cloneNode()
|
|
34
|
+
nodeClone.classList.remove(errorClass)
|
|
35
|
+
nodeClone.setCustomValidity('')
|
|
36
|
+
mutation.target.parentNode.replaceChild(nodeClone, mutation.target)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
break
|
|
40
|
+
default:
|
|
41
|
+
break
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
}
|
|
@@ -16,7 +16,7 @@ function shouldValidate (input) {
|
|
|
16
16
|
isRequired ||
|
|
17
17
|
input.hasAttribute('pattern') ||
|
|
18
18
|
input.getAttribute('type') === 'email' ||
|
|
19
|
-
input.hasAttribute('data-ad-id') || /*
|
|
19
|
+
input.hasAttribute('data-ad-id') || /* This attribute is used to get the input of the Datepicker */
|
|
20
20
|
input.hasAttribute('minlength') ||
|
|
21
21
|
input.hasAttribute('maxlength') ||
|
|
22
22
|
input.hasAttribute('data-dp-validate-maxlength') ||
|
|
@@ -32,9 +32,9 @@ function validateConditionsFulfilled (input) {
|
|
|
32
32
|
const matchers = condition.split(comparisonType === 'isNotEqual' ? '!==' : '===')
|
|
33
33
|
const validationContainer = input.closest('[data-dp-validate]')
|
|
34
34
|
/**
|
|
35
|
-
Use the form as the validation container. This is necessary because in some cases, such as wizard,
|
|
36
|
-
the value of the 'data-dp-validate-if' attribute may refer to a different fieldset.
|
|
37
|
-
By using the form, this condition can be found throughout the entire form.
|
|
35
|
+
*Use the form as the validation container. This is necessary because in some cases, such as wizard,
|
|
36
|
+
*the value of the 'data-dp-validate-if' attribute may refer to a different fieldset.
|
|
37
|
+
*By using the form, this condition can be found throughout the entire form.
|
|
38
38
|
*/
|
|
39
39
|
const form = validationContainer.tagName === 'FIELDSET' && validationContainer.form ? validationContainer.form : validationContainer
|
|
40
40
|
|
|
@@ -13,21 +13,21 @@ export default function validateForm (form) {
|
|
|
13
13
|
const type = getInputType(input)
|
|
14
14
|
let isInputValid = true
|
|
15
15
|
switch (type) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
case 'multiselect':
|
|
17
|
+
isInputValid = validateMultiselect(input)
|
|
18
|
+
break
|
|
19
|
+
case 'tiptap':
|
|
20
|
+
isInputValid = validateTiptap(input)
|
|
21
|
+
break
|
|
22
|
+
case 'fieldset':
|
|
23
|
+
isInputValid = validateFieldset(input)
|
|
24
|
+
break
|
|
25
|
+
case 'datepicker':
|
|
26
|
+
isInputValid = validateDatepicker(input)
|
|
27
|
+
break
|
|
28
|
+
case 'input':
|
|
29
|
+
default:
|
|
30
|
+
isInputValid = validateInput(input)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
if (isInputValid === false) {
|
|
@@ -82,17 +82,17 @@ export default function validateInput (input) {
|
|
|
82
82
|
} else if (inputPattern) {
|
|
83
83
|
// Error label based on pattern
|
|
84
84
|
switch (inputPattern) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
case '^[0-9]{5}$':
|
|
86
|
+
input.setCustomValidity(de.validation.error.zipCode)
|
|
87
|
+
break
|
|
88
|
+
case '[A-Za-zÄäÜüÖöß ]+':
|
|
89
|
+
input.setCustomValidity(de.validation.error.city)
|
|
90
|
+
break
|
|
91
|
+
case 'email':
|
|
92
|
+
input.setCustomValidity(de.validation.error.email)
|
|
93
|
+
break
|
|
94
|
+
default:
|
|
95
|
+
input.setCustomValidity(de.validation.error.format)
|
|
96
96
|
}
|
|
97
97
|
} else {
|
|
98
98
|
input.setCustomValidity(de.validation.error.default) // Theoretically this must not happen hence its not that helpful
|
package/src/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DATE_FORMAT_LONG, formatDate, toDate } from './date'
|
|
2
2
|
import { exactlengthHint, maxlengthHint, minlengthHint } from './lengthHint/lengthHint'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { hasAllPermissions, hasAnyPermissions, hasPermission } from './hasPermission'
|
|
4
|
+
import { bindFullScreenChange, isActiveFullScreen, toggleFullscreen, unbindFullScreenChange } from './fullscreen'
|
|
5
5
|
import { capitalizeFirstLetter } from './formatString'
|
|
6
6
|
import debounce from './debounce'
|
|
7
7
|
import deepMerge from './deepMerge'
|
package/tokens/dist/js/space.js
CHANGED
package/tokens/dist/js/zIndex.js
CHANGED
package/types/icons.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
export type IconAlias =
|
|
2
|
-
'ai' //
|
|
3
|
-
| 'cancel' //
|
|
4
|
-
| 'chevron-down' //
|
|
5
|
-
| 'chevron-left' //
|
|
6
|
-
| 'chevron-right' //
|
|
7
|
-
| 'chevron-up' //
|
|
8
|
-
| 'close' //
|
|
9
|
-
| 'compress' //
|
|
10
|
-
| 'delete' //
|
|
11
|
-
| 'download' //
|
|
12
|
-
| 'drag-handle' //
|
|
13
|
-
| 'edit' //
|
|
14
|
-
| 'expand' //
|
|
15
|
-
| 'history' //
|
|
16
|
-
| 'lock' //
|
|
17
|
-
| 'mail' //
|
|
18
|
-
| 'refresh' //
|
|
19
|
-
| 'remove' //
|
|
20
|
-
| 'search' //
|
|
21
|
-
| 'settings' //
|
|
22
|
-
| 'severe' //
|
|
23
|
-
| 'spinner' //
|
|
24
|
-
| 'success' //
|
|
25
|
-
| 'unlock' //
|
|
26
|
-
| 'userSolid' //
|
|
27
|
-
| 'xmark' //
|
|
2
|
+
'ai' // Alias for 'robot'
|
|
3
|
+
| 'cancel' // Alias for 'xmark' -> 'x'
|
|
4
|
+
| 'chevron-down' // Alias for 'caret-down'
|
|
5
|
+
| 'chevron-left' // Alias for 'caret-left'
|
|
6
|
+
| 'chevron-right' // Alias for 'caret-right'
|
|
7
|
+
| 'chevron-up' // Alias for 'caret-up'
|
|
8
|
+
| 'close' // Alias for 'xmark' -> 'x'
|
|
9
|
+
| 'compress' // Alias for 'corners-in'
|
|
10
|
+
| 'delete' // Alias for 'trash-simple'
|
|
11
|
+
| 'download' // Alias for 'download-simple'
|
|
12
|
+
| 'drag-handle' // Alias for 'dots-six-vertical'
|
|
13
|
+
| 'edit' // Alias for 'pencil-simple'
|
|
14
|
+
| 'expand' // Alias for 'corners-out'
|
|
15
|
+
| 'history' // Alias for 'clock-counter-clockwise'
|
|
16
|
+
| 'lock' // Alias for 'lock-simple'
|
|
17
|
+
| 'mail' // Alias for 'envelope-simple'
|
|
18
|
+
| 'refresh' // Alias for 'arrows-clockwise'
|
|
19
|
+
| 'remove' // Alias for 'xmark' -> 'x'
|
|
20
|
+
| 'search' // Alias for magnifying-glass
|
|
21
|
+
| 'settings' // Alias for 'gear-six', weight: fill
|
|
22
|
+
| 'severe' // Alias for 'warning-diamond'
|
|
23
|
+
| 'spinner' // Alias for 'circle-notch'
|
|
24
|
+
| 'success' // Alias for 'check-circle'
|
|
25
|
+
| 'unlock' // Alias for 'lock-simple-open'
|
|
26
|
+
| 'userSolid' // Alias for 'user', weight: fill
|
|
27
|
+
| 'xmark' // Alias for 'x'
|
|
28
28
|
|
|
29
29
|
export type AliasedPhosphorIconName =
|
|
30
30
|
'arrows-clockwise'
|
package/coverage/clover.xml
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1733218267203" clover="3.2.0">
|
|
3
|
-
<project timestamp="1733218267203" name="All files">
|
|
4
|
-
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
|
|
5
|
-
</project>
|
|
6
|
-
</coverage>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|