@milaboratories/uikit 2.15.36 → 2.15.38
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/.turbo/turbo-build.log +175 -175
- package/.turbo/turbo-formatter$colon$check.log +2 -2
- package/.turbo/turbo-linter$colon$check.log +2 -2
- package/.turbo/turbo-types$colon$check.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/__tests__/default-testid.test.d.ts +2 -0
- package/dist/__tests__/default-testid.test.d.ts.map +1 -0
- package/dist/base/BtnBase.js.map +1 -1
- package/dist/base/BtnBase.vue.d.ts.map +1 -1
- package/dist/base/BtnBase.vue2.js +6 -1
- package/dist/base/BtnBase.vue2.js.map +1 -1
- package/dist/components/DropdownListItem.js.map +1 -1
- package/dist/components/DropdownListItem.vue.d.ts.map +1 -1
- package/dist/components/DropdownListItem.vue2.js +13 -4
- package/dist/components/DropdownListItem.vue2.js.map +1 -1
- package/dist/components/InputRange.js.map +1 -1
- package/dist/components/InputRange.vue.d.ts.map +1 -1
- package/dist/components/InputRange.vue2.js +10 -2
- package/dist/components/InputRange.vue2.js.map +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.js.map +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.style.js.map +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue.d.ts.map +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +7 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js.map +1 -1
- package/dist/components/PlAlert/PlAlert.js.map +1 -1
- package/dist/components/PlAlert/PlAlert.vue.d.ts.map +1 -1
- package/dist/components/PlAlert/PlAlert.vue2.js +10 -1
- package/dist/components/PlAlert/PlAlert.vue2.js.map +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.js.map +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts.map +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue2.js +29 -11
- package/dist/components/PlAutocomplete/PlAutocomplete.vue2.js.map +1 -1
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.js.map +1 -1
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.d.ts.map +1 -1
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue2.js +30 -9
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue2.js.map +1 -1
- package/dist/components/PlBtnAccent/PlBtnAccent.js.map +1 -1
- package/dist/components/PlBtnAccent/PlBtnAccent.vue.d.ts.map +1 -1
- package/dist/components/PlBtnAccent/PlBtnAccent.vue2.js +4 -1
- package/dist/components/PlBtnAccent/PlBtnAccent.vue2.js.map +1 -1
- package/dist/components/PlBtnDanger/PlBtnDanger.js.map +1 -1
- package/dist/components/PlBtnDanger/PlBtnDanger.vue.d.ts.map +1 -1
- package/dist/components/PlBtnDanger/PlBtnDanger.vue2.js +4 -1
- package/dist/components/PlBtnDanger/PlBtnDanger.vue2.js.map +1 -1
- package/dist/components/PlBtnGhost/PlBtnGhost.js.map +1 -1
- package/dist/components/PlBtnGhost/PlBtnGhost.vue.d.ts.map +1 -1
- package/dist/components/PlBtnGhost/PlBtnGhost.vue2.js +7 -1
- package/dist/components/PlBtnGhost/PlBtnGhost.vue2.js.map +1 -1
- package/dist/components/PlBtnGroup/PlBtnGroup.js.map +1 -1
- package/dist/components/PlBtnGroup/PlBtnGroup.vue.d.ts.map +1 -1
- package/dist/components/PlBtnGroup/PlBtnGroup.vue2.js +19 -6
- package/dist/components/PlBtnGroup/PlBtnGroup.vue2.js.map +1 -1
- package/dist/components/PlBtnLink/PlBtnLink.js.map +1 -1
- package/dist/components/PlBtnLink/PlBtnLink.vue.d.ts.map +1 -1
- package/dist/components/PlBtnLink/PlBtnLink.vue2.js +2 -0
- package/dist/components/PlBtnLink/PlBtnLink.vue2.js.map +1 -1
- package/dist/components/PlBtnPrimary/PlBtnPrimary.js.map +1 -1
- package/dist/components/PlBtnPrimary/PlBtnPrimary.vue.d.ts.map +1 -1
- package/dist/components/PlBtnPrimary/PlBtnPrimary.vue2.js +4 -1
- package/dist/components/PlBtnPrimary/PlBtnPrimary.vue2.js.map +1 -1
- package/dist/components/PlBtnSecondary/PlBtnSecondary.js.map +1 -1
- package/dist/components/PlBtnSecondary/PlBtnSecondary.vue.d.ts.map +1 -1
- package/dist/components/PlBtnSecondary/PlBtnSecondary.vue2.js +1 -1
- package/dist/components/PlBtnSecondary/PlBtnSecondary.vue2.js.map +1 -1
- package/dist/components/PlBtnSplit/PlBtnSplit.js.map +1 -1
- package/dist/components/PlBtnSplit/PlBtnSplit.vue.d.ts.map +1 -1
- package/dist/components/PlBtnSplit/PlBtnSplit.vue2.js +6 -0
- package/dist/components/PlBtnSplit/PlBtnSplit.vue2.js.map +1 -1
- package/dist/components/PlChartHistogram/PlChartHistogram.js.map +1 -1
- package/dist/components/PlChartHistogram/PlChartHistogram.style.js.map +1 -1
- package/dist/components/PlChartHistogram/PlChartHistogram.vue.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js +7 -2
- package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js.map +1 -1
- package/dist/components/PlChartHistogram/createGridlines.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/createGridlines.js +1 -1
- package/dist/components/PlChartHistogram/createGridlines.js.map +1 -1
- package/dist/components/PlChartHistogram/createLabels.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/createLabels.js +1 -1
- package/dist/components/PlChartHistogram/createLabels.js.map +1 -1
- package/dist/components/PlChartHistogram/createSvgContainer.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/createSvgContainer.js +1 -1
- package/dist/components/PlChartHistogram/createSvgContainer.js.map +1 -1
- package/dist/components/PlChartHistogram/drawBins.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/drawBins.js +2 -2
- package/dist/components/PlChartHistogram/drawBins.js.map +1 -1
- package/dist/components/PlChartHistogram/drawThreshold.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/drawThreshold.js +1 -1
- package/dist/components/PlChartHistogram/drawThreshold.js.map +1 -1
- package/dist/components/PlChartHistogram/histogram.d.ts.map +1 -1
- package/dist/components/PlChartHistogram/histogram.js +1 -1
- package/dist/components/PlChartHistogram/histogram.js.map +1 -1
- package/dist/components/PlChartStackedBar/Legends.js.map +1 -1
- package/dist/components/PlChartStackedBar/Legends.style.js.map +1 -1
- package/dist/components/PlChartStackedBar/Legends.vue.d.ts.map +1 -1
- package/dist/components/PlChartStackedBar/Legends.vue2.js +7 -1
- package/dist/components/PlChartStackedBar/Legends.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBar.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBar.style.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBar.vue.d.ts.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js +5 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.style.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue.d.ts.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js +4 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRow.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRow.style.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRow.vue.d.ts.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRow.vue2.js +13 -3
- package/dist/components/PlChartStackedBar/StackedRow.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRowCompact.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRowCompact.style.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRowCompact.vue.d.ts.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js +8 -2
- package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js.map +1 -1
- package/dist/components/PlCheckbox/PlCheckbox.js.map +1 -1
- package/dist/components/PlCheckbox/PlCheckbox.vue.d.ts.map +1 -1
- package/dist/components/PlCheckbox/PlCheckbox.vue2.js +9 -2
- package/dist/components/PlCheckbox/PlCheckbox.vue2.js.map +1 -1
- package/dist/components/PlCheckbox/PlCheckboxBase.js.map +1 -1
- package/dist/components/PlCheckbox/PlCheckboxBase.vue.d.ts.map +1 -1
- package/dist/components/PlCheckbox/PlCheckboxBase.vue2.js +1 -0
- package/dist/components/PlCheckbox/PlCheckboxBase.vue2.js.map +1 -1
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.js.map +1 -1
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue2.js +19 -5
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue2.js.map +1 -1
- package/dist/components/PlChip/PlChip.js.map +1 -1
- package/dist/components/PlChip/PlChip.vue.d.ts.map +1 -1
- package/dist/components/PlChip/PlChip.vue2.js +7 -1
- package/dist/components/PlChip/PlChip.vue2.js.map +1 -1
- package/dist/components/PlClipboard/PlClipboard.js.map +1 -1
- package/dist/components/PlClipboard/PlClipboard.style.js.map +1 -1
- package/dist/components/PlClipboard/PlClipboard.vue.d.ts.map +1 -1
- package/dist/components/PlClipboard/PlClipboard.vue2.js +1 -0
- package/dist/components/PlClipboard/PlClipboard.vue2.js.map +1 -1
- package/dist/components/PlConfirmDialog.js.map +1 -1
- package/dist/components/PlConfirmDialog.vue.d.ts.map +1 -1
- package/dist/components/PlConfirmDialog.vue2.js +9 -2
- package/dist/components/PlConfirmDialog.vue2.js.map +1 -1
- package/dist/components/PlDialogModal/PlDialogModal.js.map +1 -1
- package/dist/components/PlDialogModal/PlDialogModal.vue.d.ts.map +1 -1
- package/dist/components/PlDialogModal/PlDialogModal.vue2.js +12 -5
- package/dist/components/PlDialogModal/PlDialogModal.vue2.js.map +1 -1
- package/dist/components/PlDropdown/OptionList.js.map +1 -1
- package/dist/components/PlDropdown/OptionList.vue.d.ts.map +1 -1
- package/dist/components/PlDropdown/OptionList.vue2.js +11 -5
- package/dist/components/PlDropdown/OptionList.vue2.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue2.js +26 -10
- package/dist/components/PlDropdown/PlDropdown.vue2.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue2.js +32 -10
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue2.js.map +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.js.map +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue2.js +17 -3
- package/dist/components/PlDropdownLine/PlDropdownLine.vue2.js.map +1 -1
- package/dist/components/PlDropdownLine/ResizableInput.js.map +1 -1
- package/dist/components/PlDropdownLine/ResizableInput.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownLine/ResizableInput.vue2.js +5 -2
- package/dist/components/PlDropdownLine/ResizableInput.vue2.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js +31 -10
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js.map +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.js.map +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.js.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue2.js +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue2.js.map +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.js.map +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts.map +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.vue2.js +9 -3
- package/dist/components/PlEditableTitle/PlEditableTitle.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementList.js.map +1 -1
- package/dist/components/PlElementList/PlElementList.style.js.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue.d.ts.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue2.js +6 -1
- package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.style.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue2.js +34 -13
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
- package/dist/components/PlErrorAlert/PlErrorAlert.js.map +1 -1
- package/dist/components/PlErrorAlert/PlErrorAlert.style.js.map +1 -1
- package/dist/components/PlErrorAlert/PlErrorAlert.vue.d.ts.map +1 -1
- package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js +15 -3
- package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js.map +1 -1
- package/dist/components/PlErrorBoundary/PlErrorBoundary.js.map +1 -1
- package/dist/components/PlErrorBoundary/PlErrorBoundary.vue.d.ts.map +1 -1
- package/dist/components/PlErrorBoundary/PlErrorBoundary.vue2.js +1 -0
- package/dist/components/PlErrorBoundary/PlErrorBoundary.vue2.js.map +1 -1
- package/dist/components/PlFileDialog/Local.js.map +1 -1
- package/dist/components/PlFileDialog/Local.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/Local.vue2.js +23 -20
- package/dist/components/PlFileDialog/Local.vue2.js.map +1 -1
- package/dist/components/PlFileDialog/PlFileDialog.js.map +1 -1
- package/dist/components/PlFileDialog/PlFileDialog.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/PlFileDialog.vue2.js +5 -1
- package/dist/components/PlFileDialog/PlFileDialog.vue2.js.map +1 -1
- package/dist/components/PlFileDialog/Remote.js.map +1 -1
- package/dist/components/PlFileDialog/Remote.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/Remote.vue2.js +108 -94
- package/dist/components/PlFileDialog/Remote.vue2.js.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.js.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.style.js.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.vue2.js +2 -1
- package/dist/components/PlFileDialog/Shortcuts.vue2.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.d.ts.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue2.js +92 -71
- package/dist/components/PlFileInput/PlFileInput.vue2.js.map +1 -1
- package/dist/components/PlLoaderCircular/PlLoaderCircular.js.map +1 -1
- package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.d.ts.map +1 -1
- package/dist/components/PlLoaderCircular/PlLoaderCircular.vue2.js +4 -1
- package/dist/components/PlLoaderCircular/PlLoaderCircular.vue2.js.map +1 -1
- package/dist/components/PlLoaderLogo.js.map +1 -1
- package/dist/components/PlLoaderLogo.style.js.map +1 -1
- package/dist/components/PlLoaderLogo.vue.css +1 -1
- package/dist/components/PlLoaderLogo.vue.d.ts.map +1 -1
- package/dist/components/PlLoaderLogo.vue2.js +4 -3
- package/dist/components/PlLoaderLogo.vue2.js.map +1 -1
- package/dist/components/PlLogView/PlLogView.js.map +1 -1
- package/dist/components/PlLogView/PlLogView.vue.d.ts.map +1 -1
- package/dist/components/PlLogView/PlLogView.vue2.js +13 -1
- package/dist/components/PlLogView/PlLogView.vue2.js.map +1 -1
- package/dist/components/PlNotificationAlert/PlNotificationAlert.js.map +1 -1
- package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.d.ts.map +1 -1
- package/dist/components/PlNotificationAlert/PlNotificationAlert.vue2.js +8 -2
- package/dist/components/PlNotificationAlert/PlNotificationAlert.vue2.js.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.js.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue.d.ts.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue2.js +12 -3
- package/dist/components/PlNumberField/PlNumberField.vue2.js.map +1 -1
- package/dist/components/PlProgressBar/PlProgressBar.js.map +1 -1
- package/dist/components/PlProgressBar/PlProgressBar.vue.d.ts.map +1 -1
- package/dist/components/PlProgressBar/PlProgressBar.vue2.js +9 -1
- package/dist/components/PlProgressBar/PlProgressBar.vue2.js.map +1 -1
- package/dist/components/PlProgressCell/PlProgressCell.js.map +1 -1
- package/dist/components/PlProgressCell/PlProgressCell.vue.d.ts.map +1 -1
- package/dist/components/PlProgressCell/PlProgressCell.vue2.js +19 -7
- package/dist/components/PlProgressCell/PlProgressCell.vue2.js.map +1 -1
- package/dist/components/PlRadio/PlRadio.js.map +1 -1
- package/dist/components/PlRadio/PlRadio.style.js.map +1 -1
- package/dist/components/PlRadio/PlRadio.vue.d.ts.map +1 -1
- package/dist/components/PlRadio/PlRadio.vue2.js +10 -3
- package/dist/components/PlRadio/PlRadio.vue2.js.map +1 -1
- package/dist/components/PlRadio/PlRadioGroup.js.map +1 -1
- package/dist/components/PlRadio/PlRadioGroup.style.js.map +1 -1
- package/dist/components/PlRadio/PlRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/PlRadio/PlRadioGroup.vue2.js +10 -3
- package/dist/components/PlRadio/PlRadioGroup.vue2.js.map +1 -1
- package/dist/components/PlSearchField/PlSearchField.js.map +1 -1
- package/dist/components/PlSearchField/PlSearchField.style.js.map +1 -1
- package/dist/components/PlSearchField/PlSearchField.vue.d.ts.map +1 -1
- package/dist/components/PlSearchField/PlSearchField.vue2.js +11 -4
- package/dist/components/PlSearchField/PlSearchField.vue2.js.map +1 -1
- package/dist/components/PlSectionSeparator/PlSectionSeparator.js.map +1 -1
- package/dist/components/PlSectionSeparator/PlSectionSeparator.style.js.map +1 -1
- package/dist/components/PlSectionSeparator/PlSectionSeparator.vue.d.ts.map +1 -1
- package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js +7 -1
- package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarGroup.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarGroup.style.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/PlSidebar/PlSidebarGroup.vue2.js +5 -1
- package/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarItem.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarItem.style.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarItem.vue.d.ts.map +1 -1
- package/dist/components/PlSidebar/PlSidebarItem.vue2.js +7 -1
- package/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.d.ts.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js +4 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.js.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.style.js.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.vue.d.ts.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.vue2.js +7 -2
- package/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -1
- package/dist/components/PlSpacer/PlSpacer.vue.d.ts.map +1 -1
- package/dist/components/PlSplash/PlSplash.js.map +1 -1
- package/dist/components/PlSplash/PlSplash.vue.d.ts.map +1 -1
- package/dist/components/PlSplash/PlSplash.vue2.js +13 -5
- package/dist/components/PlSplash/PlSplash.vue2.js.map +1 -1
- package/dist/components/PlStatusTag/PlStatusTag.js.map +1 -1
- package/dist/components/PlStatusTag/PlStatusTag.vue.d.ts.map +1 -1
- package/dist/components/PlStatusTag/PlStatusTag.vue2.js +4 -1
- package/dist/components/PlStatusTag/PlStatusTag.vue2.js.map +1 -1
- package/dist/components/PlTabs/PlTabs.js.map +1 -1
- package/dist/components/PlTabs/PlTabs.vue.d.ts.map +1 -1
- package/dist/components/PlTabs/PlTabs.vue2.js +16 -11
- package/dist/components/PlTabs/PlTabs.vue2.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.d.ts.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue2.js +21 -8
- package/dist/components/PlTextArea/PlTextArea.vue2.js.map +1 -1
- package/dist/components/PlTextField/PlTextField.js.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue.d.ts.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue2.js +23 -9
- package/dist/components/PlTextField/PlTextField.vue2.js.map +1 -1
- package/dist/components/PlToggleSwitch/PlToggleSwitch.js.map +1 -1
- package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.d.ts.map +1 -1
- package/dist/components/PlToggleSwitch/PlToggleSwitch.vue2.js +10 -2
- package/dist/components/PlToggleSwitch/PlToggleSwitch.vue2.js.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.js.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.style.js.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue.css +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue.d.ts.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue2.js +7 -2
- package/dist/components/PlTooltip/PlTooltip.vue2.js.map +1 -1
- package/dist/components/Slider.js.map +1 -1
- package/dist/components/Slider.vue.d.ts.map +1 -1
- package/dist/components/Slider.vue2.js +13 -1
- package/dist/components/Slider.vue2.js.map +1 -1
- package/dist/components/SliderRange.js.map +1 -1
- package/dist/components/SliderRange.vue.d.ts.map +1 -1
- package/dist/components/SliderRange.vue2.js +14 -1
- package/dist/components/SliderRange.vue2.js.map +1 -1
- package/dist/components/SliderRangeTriple.js.map +1 -1
- package/dist/components/SliderRangeTriple.vue.d.ts.map +1 -1
- package/dist/components/SliderRangeTriple.vue2.js +13 -1
- package/dist/components/SliderRangeTriple.vue2.js.map +1 -1
- package/dist/components/TabItem.js.map +1 -1
- package/dist/components/TabItem.vue.d.ts.map +1 -1
- package/dist/components/TabItem.vue2.js +8 -2
- package/dist/components/TabItem.vue2.js.map +1 -1
- package/dist/components/contextMenu/Menu.js +1 -1
- package/dist/components/contextMenu/Menu.js.map +1 -1
- package/dist/components/contextMenu/Menu.style.css +1 -1
- package/dist/components/contextMenu/Menu.vue.d.ts.map +1 -1
- package/dist/components/contextMenu/Menu.vue2.js +12 -8
- package/dist/components/contextMenu/Menu.vue2.js.map +1 -1
- package/dist/layout/PlBlockPage/PlBlockPage.js.map +1 -1
- package/dist/layout/PlBlockPage/PlBlockPage.style.js.map +1 -1
- package/dist/layout/PlBlockPage/PlBlockPage.vue.d.ts.map +1 -1
- package/dist/layout/PlBlockPage/PlBlockPage.vue2.js +45 -25
- package/dist/layout/PlBlockPage/PlBlockPage.vue2.js.map +1 -1
- package/dist/layout/PlContainer/PlContainer.js.map +1 -1
- package/dist/layout/PlContainer/PlContainer.vue.d.ts.map +1 -1
- package/dist/layout/PlContainer/PlContainer.vue2.js +1 -0
- package/dist/layout/PlContainer/PlContainer.vue2.js.map +1 -1
- package/dist/layout/PlGrid/PlGrid.js.map +1 -1
- package/dist/layout/PlGrid/PlGrid.vue.d.ts.map +1 -1
- package/dist/layout/PlGrid/PlGrid.vue2.js +1 -0
- package/dist/layout/PlGrid/PlGrid.vue2.js.map +1 -1
- package/dist/layout/PlPlaceholder/PlPlaceholder.js.map +1 -1
- package/dist/layout/PlPlaceholder/PlPlaceholder.style.js.map +1 -1
- package/dist/layout/PlPlaceholder/PlPlaceholder.vue.d.ts.map +1 -1
- package/dist/layout/PlPlaceholder/PlPlaceholder.vue2.js +25 -6
- package/dist/layout/PlPlaceholder/PlPlaceholder.vue2.js.map +1 -1
- package/dist/layout/PlRow/PlRow.js.map +1 -1
- package/dist/layout/PlRow/PlRow.vue.d.ts.map +1 -1
- package/dist/layout/PlRow/PlRow.vue2.js +7 -4
- package/dist/layout/PlRow/PlRow.vue2.js.map +1 -1
- package/dist/layout/PlSpacer/PlSpacer.js.map +1 -1
- package/dist/layout/PlSpacer/PlSpacer.vue.d.ts.map +1 -1
- package/dist/layout/PlSpacer/PlSpacer.vue2.js +1 -0
- package/dist/layout/PlSpacer/PlSpacer.vue2.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/default-testid.test.ts +95 -0
- package/src/base/BtnBase.vue +3 -3
- package/src/components/DropdownListItem.vue +14 -4
- package/src/components/InputRange.vue +6 -2
- package/src/components/PlAccordion/PlAccordionSection.vue +13 -4
- package/src/components/PlAlert/PlAlert.vue +5 -3
- package/src/components/PlAutocomplete/PlAutocomplete.vue +47 -11
- package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +53 -11
- package/src/components/PlBtnAccent/PlBtnAccent.vue +1 -1
- package/src/components/PlBtnDanger/PlBtnDanger.vue +1 -1
- package/src/components/PlBtnGhost/PlBtnGhost.vue +4 -3
- package/src/components/PlBtnGroup/PlBtnGroup.vue +16 -6
- package/src/components/PlBtnLink/PlBtnLink.vue +2 -1
- package/src/components/PlBtnPrimary/PlBtnPrimary.vue +1 -1
- package/src/components/PlBtnSecondary/PlBtnSecondary.vue +1 -1
- package/src/components/PlBtnSplit/PlBtnSplit.vue +12 -2
- package/src/components/PlChartHistogram/PlChartHistogram.vue +9 -3
- package/src/components/PlChartHistogram/createGridlines.ts +2 -0
- package/src/components/PlChartHistogram/createLabels.ts +2 -0
- package/src/components/PlChartHistogram/createSvgContainer.ts +2 -0
- package/src/components/PlChartHistogram/drawBins.ts +2 -0
- package/src/components/PlChartHistogram/drawThreshold.ts +1 -0
- package/src/components/PlChartHistogram/histogram.ts +6 -1
- package/src/components/PlChartStackedBar/Legends.vue +18 -4
- package/src/components/PlChartStackedBar/PlChartStackedBar.vue +4 -2
- package/src/components/PlChartStackedBar/PlChartStackedBarCompact.vue +1 -1
- package/src/components/PlChartStackedBar/StackedRow.vue +12 -4
- package/src/components/PlChartStackedBar/StackedRowCompact.vue +10 -3
- package/src/components/PlCheckbox/PlCheckbox.vue +15 -4
- package/src/components/PlCheckbox/PlCheckboxBase.vue +1 -0
- package/src/components/PlCheckboxGroup/PlCheckboxGroup.vue +15 -4
- package/src/components/PlChip/PlChip.vue +4 -3
- package/src/components/PlClipboard/PlClipboard.vue +7 -1
- package/src/components/PlConfirmDialog.vue +8 -3
- package/src/components/PlDialogModal/PlDialogModal.vue +15 -2
- package/src/components/PlDropdown/OptionList.vue +13 -3
- package/src/components/PlDropdown/PlDropdown.vue +35 -11
- package/src/components/PlDropdownLegacy/PlDropdownLegacy.vue +51 -12
- package/src/components/PlDropdownLine/PlDropdownLine.vue +29 -5
- package/src/components/PlDropdownLine/ResizableInput.vue +2 -1
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +47 -11
- package/src/components/PlDropdownMultiRef/PlDropdownMultiRef.vue +1 -0
- package/src/components/PlDropdownRef/PlDropdownRef.vue +1 -0
- package/src/components/PlEditableTitle/PlEditableTitle.vue +11 -3
- package/src/components/PlElementList/PlElementList.vue +8 -3
- package/src/components/PlElementList/PlElementListItem.vue +16 -5
- package/src/components/PlErrorAlert/PlErrorAlert.vue +8 -6
- package/src/components/PlErrorBoundary/PlErrorBoundary.vue +7 -1
- package/src/components/PlFileDialog/Local.vue +12 -4
- package/src/components/PlFileDialog/PlFileDialog.vue +13 -3
- package/src/components/PlFileDialog/Remote.vue +39 -11
- package/src/components/PlFileDialog/Shortcuts.vue +7 -1
- package/src/components/PlFileInput/PlFileInput.vue +44 -19
- package/src/components/PlLoaderCircular/PlLoaderCircular.vue +1 -1
- package/src/components/PlLoaderLogo.vue +6 -1
- package/src/components/PlLogView/PlLogView.vue +30 -8
- package/src/components/PlNotificationAlert/PlNotificationAlert.vue +15 -3
- package/src/components/PlNumberField/PlNumberField.vue +14 -3
- package/src/components/PlProgressBar/PlProgressBar.vue +12 -4
- package/src/components/PlProgressCell/PlProgressCell.vue +13 -4
- package/src/components/PlRadio/PlRadio.vue +10 -3
- package/src/components/PlRadio/PlRadioGroup.vue +3 -2
- package/src/components/PlSearchField/PlSearchField.vue +5 -3
- package/src/components/PlSectionSeparator/PlSectionSeparator.vue +6 -2
- package/src/components/PlSidebar/PlSidebarGroup.vue +2 -2
- package/src/components/PlSidebar/PlSidebarItem.vue +12 -4
- package/src/components/PlSlideModal/PlPureSlideModal.vue +7 -1
- package/src/components/PlSlideModal/PlSlideModal.vue +4 -3
- package/src/components/PlSpacer/PlSpacer.vue +1 -1
- package/src/components/PlSplash/PlSplash.vue +6 -3
- package/src/components/PlStatusTag/PlStatusTag.vue +1 -0
- package/src/components/PlTabs/PlTabs.vue +6 -2
- package/src/components/PlTextArea/PlTextArea.vue +21 -8
- package/src/components/PlTextField/PlTextField.vue +23 -8
- package/src/components/PlToggleSwitch/PlToggleSwitch.vue +4 -3
- package/src/components/PlTooltip/PlTooltip.vue +3 -0
- package/src/components/Slider.vue +27 -7
- package/src/components/SliderRange.vue +28 -7
- package/src/components/SliderRangeTriple.vue +19 -5
- package/src/components/TabItem.vue +2 -2
- package/src/components/contextMenu/Menu.vue +8 -3
- package/src/layout/PlBlockPage/PlBlockPage.vue +40 -11
- package/src/layout/PlContainer/PlContainer.vue +1 -0
- package/src/layout/PlGrid/PlGrid.vue +1 -1
- package/src/layout/PlPlaceholder/PlPlaceholder.vue +20 -8
- package/src/layout/PlRow/PlRow.vue +5 -1
- package/src/layout/PlSpacer/PlSpacer.vue +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTabs/PlTabs.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlTabs\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M extends string\">\nimport style from \"./pl-tabs.module.scss\";\nimport type { TabOption } from \"./types\";\nimport Tab from \"./Tab.vue\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M): void;\n}>();\n\nconst emitModel = (v: M) => emit(\"update:modelValue\", v);\n\ndefineProps<{\n /**\n * The current selected tab value.\n */\n modelValue?: M;\n /**\n * List of available options for the component\n */\n options: Readonly<TabOption<M>[]>;\n /**\n * If `true`, the component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the `active` line appears on the top of element.\n */\n topLine?: boolean;\n /**\n * Maximum tab width (css value), can be overridden for each option\n */\n maxTabWidth?: string;\n}>();\n</script>\n\n<template>\n <div
|
|
1
|
+
{"version":3,"file":"PlTabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTabs/PlTabs.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlTabs\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M extends string\">\nimport style from \"./pl-tabs.module.scss\";\nimport type { TabOption } from \"./types\";\nimport Tab from \"./Tab.vue\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M): void;\n}>();\n\nconst emitModel = (v: M) => emit(\"update:modelValue\", v);\n\ndefineProps<{\n /**\n * The current selected tab value.\n */\n modelValue?: M;\n /**\n * List of available options for the component\n */\n options: Readonly<TabOption<M>[]>;\n /**\n * If `true`, the component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the `active` line appears on the top of element.\n */\n topLine?: boolean;\n /**\n * Maximum tab width (css value), can be overridden for each option\n */\n maxTabWidth?: string;\n}>();\n</script>\n\n<template>\n <div\n data-testid=\"pl-tabs\"\n :class=\"[style.component, { [style.disabled]: disabled, [style.topLine]: topLine }]\"\n >\n <Tab\n v-for=\"(opt, i) in options\"\n :key=\"i\"\n data-testid=\"pl-tabs-tab\"\n :tabindex=\"modelValue === opt.value || disabled || opt.disabled ? undefined : 0\"\n :option=\"opt\"\n :class=\"[\n { [style.active]: modelValue === opt.value, [style.disabled]: opt.disabled },\n style.tab,\n ]\"\n :style=\"{ '--pl-tabs-item-max-width': opt.maxWidth ?? maxTabWidth }\"\n @keydown.enter=\"emitModel(opt.value)\"\n @click=\"emitModel(opt.value)\"\n >\n <slot :name=\"opt.value\" :option=\"opt\">\n <span data-testid=\"pl-tabs-tab-label\">{{ opt.label }}</span>\n </slot>\n </Tab>\n </div>\n</template>\n"],"mappings":";;;;;CAKE,MAAM;;;;;;;;;;EASR,IAAM,IAAO,GAOP,KAAa,MAAS,EAAK,qBAAqB,EAAE;yBA2BtD,EAsBM,OAAA;GArBJ,eAAY;GACX,OAAK,EAAA,CAAG,EAAA,EAAK,CAAC,WAAS;KAAK,EAAA,EAAK,CAAC,WAAW,EAAA;KAAW,EAAA,EAAK,CAAC,UAAU,EAAA;IAAO,CAAA,CAAA;cAEhF,EAiBM,GAAA,MAAA,EAhBe,EAAA,UAAX,GAAK,YADf,EAiBM,GAAA;GAfH,KAAK;GACN,eAAY;GACX,UAAU,EAAA,eAAe,EAAI,SAAS,EAAA,YAAY,EAAI,WAAW,KAAA,IAAS;GAC1E,QAAQ;GACR,OAAK,EAAA,CAAA;KAAe,EAAA,EAAK,CAAC,SAAS,EAAA,eAAe,EAAI;KAAQ,EAAA,EAAK,CAAC,WAAW,EAAI;IAAQ,EAAY,EAAA,EAAK,CAAC,IAAA,CAAA;GAI7G,OAAK,EAAA,EAAA,4BAAgC,EAAI,YAAY,EAAA,aAAW,CAAA;GAChE,WAAO,GAAA,MAAQ,EAAU,EAAI,MAAK,EAAA,CAAA,QAAA,CAAA;GAClC,UAAK,MAAE,EAAU,EAAI,MAAK;;oBAIpB,CAFP,EAEO,EAAA,QAFM,EAAI,OAAK,EAAG,QAAQ,GAAG,QAE7B,CADL,EAA4D,QAA5D,GAA4D,EAAnB,EAAI,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextArea.js","names":[],"sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Component for multi-line string data manipulation */\nexport default {\n name: \"PlTextArea\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-textarea.scss\";\nimport { computed, onMounted, ref, useSlots } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { useValidation } from \"../../utils/useValidation\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst slots = useSlots();\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: string): void;\n}>();\n\nconst props = defineProps<{\n /**\n * The current value of the texarea.\n */\n modelValue?: string;\n /**\n * The label to display above the texarea.\n */\n label?: string;\n /**\n * If `true`, the textarea is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the textarea.\n */\n error?: unknown;\n /**\n * A helper text to display below the textarea when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the textarea when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the textarea is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the textarea is in a read-only state and cannot be edited, but it can still be focused and text can be selected.\n */\n readonly?: boolean;\n /**\n * If `true`, applies a dashed border style to the textarea, likely used for stylistic purposes or to indicate a certain state.\n */\n dashed?: boolean;\n /**\n * The number of visible text lines for the textarea, which controls the height of the textarea.\n */\n rows?: number;\n /**\n * If `true`, the textarea automatically adjusts its height to fit the content as the user types.\n */\n autogrow?: boolean;\n /**\n * An array of validation rules that are applied to the textarea input. Each rule is a function that receives the input value and returns `true` for valid input or an error message string for invalid input.\n */\n rules?: ((v: string) => boolean | string)[];\n}>();\n\nconst root = ref<HTMLInputElement>();\nconst input = ref<HTMLTextAreaElement>();\n\nconst value = computed({\n get() {\n return props.modelValue ?? \"\";\n },\n set(v) {\n emit(\"update:modelValue\", v);\n },\n});\n\nconst nonEmpty = computed(() => !!props.modelValue);\nconst validationData = useValidation(value, props.rules || []);\n\nuseLabelNotch(root);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n\n if (propsError) {\n errors.push(propsError);\n }\n\n errors.push(...validationData.value.errors);\n\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst adjustHeight = () => {\n if (!props.autogrow) {\n return;\n }\n const el = input.value;\n if (el) {\n el.style.height = \"auto\"; // it works, do not delete it\n el.style.height = `${el.scrollHeight}px`; // Set height based on scrollHeight\n }\n};\n\nonMounted(() => {\n adjustHeight();\n});\n</script>\n\n<template>\n <div class=\"ui-text-area__envelope\">\n <div
|
|
1
|
+
{"version":3,"file":"PlTextArea.js","names":[],"sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Component for multi-line string data manipulation */\nexport default {\n name: \"PlTextArea\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-textarea.scss\";\nimport { computed, onMounted, ref, useSlots } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { useValidation } from \"../../utils/useValidation\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst slots = useSlots();\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: string): void;\n}>();\n\nconst props = defineProps<{\n /**\n * The current value of the texarea.\n */\n modelValue?: string;\n /**\n * The label to display above the texarea.\n */\n label?: string;\n /**\n * If `true`, the textarea is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the textarea.\n */\n error?: unknown;\n /**\n * A helper text to display below the textarea when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the textarea when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the textarea is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the textarea is in a read-only state and cannot be edited, but it can still be focused and text can be selected.\n */\n readonly?: boolean;\n /**\n * If `true`, applies a dashed border style to the textarea, likely used for stylistic purposes or to indicate a certain state.\n */\n dashed?: boolean;\n /**\n * The number of visible text lines for the textarea, which controls the height of the textarea.\n */\n rows?: number;\n /**\n * If `true`, the textarea automatically adjusts its height to fit the content as the user types.\n */\n autogrow?: boolean;\n /**\n * An array of validation rules that are applied to the textarea input. Each rule is a function that receives the input value and returns `true` for valid input or an error message string for invalid input.\n */\n rules?: ((v: string) => boolean | string)[];\n}>();\n\nconst root = ref<HTMLInputElement>();\nconst input = ref<HTMLTextAreaElement>();\n\nconst value = computed({\n get() {\n return props.modelValue ?? \"\";\n },\n set(v) {\n emit(\"update:modelValue\", v);\n },\n});\n\nconst nonEmpty = computed(() => !!props.modelValue);\nconst validationData = useValidation(value, props.rules || []);\n\nuseLabelNotch(root);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n\n if (propsError) {\n errors.push(propsError);\n }\n\n errors.push(...validationData.value.errors);\n\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst adjustHeight = () => {\n if (!props.autogrow) {\n return;\n }\n const el = input.value;\n if (el) {\n el.style.height = \"auto\"; // it works, do not delete it\n el.style.height = `${el.scrollHeight}px`; // Set height based on scrollHeight\n }\n};\n\nonMounted(() => {\n adjustHeight();\n});\n</script>\n\n<template>\n <div class=\"ui-text-area__envelope\" data-testid=\"pl-text-area\">\n <div\n ref=\"root\"\n class=\"ui-text-area\"\n :class=\"{ error: hasErrors, disabled, dashed, nonEmpty }\"\n data-testid=\"pl-text-area-control\"\n >\n <label v-if=\"label\" ref=\"label\" data-testid=\"pl-text-area-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-text-area-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-text-area-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <textarea\n ref=\"input\"\n v-model=\"value\"\n :readonly=\"readonly\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder ?? '...'\"\n spellcheck=\"false\"\n data-testid=\"pl-text-area-input\"\n @input=\"adjustHeight\"\n />\n <div class=\"ui-text-area__append\" data-testid=\"pl-text-area-append\">\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"ui-text-area__contour\" />\n </div>\n <div v-if=\"hasErrors\" class=\"ui-text-area__error\" data-testid=\"pl-text-area-error\">\n {{ displayErrors.join(\" \") }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-text-area__helper\" data-testid=\"pl-text-area-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextArea.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlTextArea.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"names":[],"mappings":"AA+KA,OAAO,oBAAoB,CAAC;AAW5B,wDAAwD;wBACnC,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAYhB;;OAEG;iBACU,MAAM;IACnB;;OAEG;YACK,MAAM;IACd;;OAEG;eACQ,OAAO;IAClB;;OAEG;YACK,OAAO;IACf;;OAEG;aACM,MAAM;IACf;;OAEG;kBACW,MAAM;IACpB;;OAEG;eACQ,OAAO;IAClB;;OAEG;eACQ,OAAO;IAClB;;OAEG;aACM,OAAO;IAChB;;OAEG;WACI,MAAM;IACb;;OAEG;eACQ,OAAO;IAClB;;OAEG;YACK,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAAC,EAAE;;;;IA/C3C;;OAEG;iBACU,MAAM;IACnB;;OAEG;YACK,MAAM;IACd;;OAEG;eACQ,OAAO;IAClB;;OAEG;YACK,OAAO;IACf;;OAEG;aACM,MAAM;IACf;;OAEG;kBACW,MAAM;IACpB;;OAEG;eACQ,OAAO;IAClB;;OAEG;eACQ,OAAO;IAClB;;OAEG;aACM,OAAO;IAChB;;OAEG;WACI,MAAM;IACb;;OAEG;eACQ,OAAO;IAClB;;OAEG;YACK,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAAC,EAAE;;;;cA+L/B,CAAC,KAAK,IAAiB,KAAK,GAAG;;aAChC,CAAC,KAAK,IAAiB,KAAK,GAAG;EAcxC,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -10,20 +10,29 @@ import './pl-textarea.css';/* empty css */
|
|
|
10
10
|
import { useValidation as o } from "../../utils/useValidation.js";
|
|
11
11
|
import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, onMounted as h, openBlock as g, ref as _, renderSlot as v, toDisplayString as y, unref as b, useSlots as x, vModelText as S, withCtx as C, withDirectives as w } from "vue";
|
|
12
12
|
//#region src/components/PlTextArea/PlTextArea.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var T = {
|
|
13
|
+
var T = {
|
|
14
|
+
class: "ui-text-area__envelope",
|
|
15
|
+
"data-testid": "pl-text-area"
|
|
16
|
+
}, E = {
|
|
14
17
|
key: 0,
|
|
15
|
-
ref: "label"
|
|
18
|
+
ref: "label",
|
|
19
|
+
"data-testid": "pl-text-area-label"
|
|
16
20
|
}, D = [
|
|
17
21
|
"readonly",
|
|
18
22
|
"rows",
|
|
19
23
|
"disabled",
|
|
20
24
|
"placeholder"
|
|
21
|
-
], O = {
|
|
25
|
+
], O = {
|
|
26
|
+
class: "ui-text-area__append",
|
|
27
|
+
"data-testid": "pl-text-area-append"
|
|
28
|
+
}, k = {
|
|
22
29
|
key: 0,
|
|
23
|
-
class: "ui-text-area__error"
|
|
30
|
+
class: "ui-text-area__error",
|
|
31
|
+
"data-testid": "pl-text-area-error"
|
|
24
32
|
}, A = {
|
|
25
33
|
key: 1,
|
|
26
|
-
class: "ui-text-area__helper"
|
|
34
|
+
class: "ui-text-area__helper",
|
|
35
|
+
"data-testid": "pl-text-area-helper"
|
|
27
36
|
}, j = /* @__PURE__ */ p({
|
|
28
37
|
name: "PlTextArea",
|
|
29
38
|
props: {
|
|
@@ -69,18 +78,21 @@ var T = { class: "ui-text-area__envelope" }, E = {
|
|
|
69
78
|
disabled: p.disabled,
|
|
70
79
|
dashed: p.dashed,
|
|
71
80
|
nonEmpty: R.value
|
|
72
|
-
}])
|
|
81
|
+
}]),
|
|
82
|
+
"data-testid": "pl-text-area-control"
|
|
73
83
|
}, [
|
|
74
84
|
p.label ? (g(), u("label", E, [
|
|
75
85
|
p.required ? (g(), c(b(n), {
|
|
76
86
|
key: 0,
|
|
77
|
-
uri: b(a)
|
|
87
|
+
uri: b(a),
|
|
88
|
+
"data-testid": "pl-text-area-required"
|
|
78
89
|
}, null, 8, ["uri"])) : l("", !0),
|
|
79
90
|
d("span", null, y(p.label), 1),
|
|
80
91
|
b(M).tooltip ? (g(), c(b(e), {
|
|
81
92
|
key: 1,
|
|
82
93
|
class: "info",
|
|
83
|
-
position: "top"
|
|
94
|
+
position: "top",
|
|
95
|
+
"data-testid": "pl-text-area-tooltip"
|
|
84
96
|
}, {
|
|
85
97
|
tooltip: C(() => [v(t.$slots, "tooltip")]),
|
|
86
98
|
_: 3
|
|
@@ -95,6 +107,7 @@ var T = { class: "ui-text-area__envelope" }, E = {
|
|
|
95
107
|
disabled: p.disabled,
|
|
96
108
|
placeholder: p.placeholder ?? "...",
|
|
97
109
|
spellcheck: "false",
|
|
110
|
+
"data-testid": "pl-text-area-input",
|
|
98
111
|
onInput: H
|
|
99
112
|
}, null, 40, D), [[S, L.value]]),
|
|
100
113
|
d("div", O, [v(t.$slots, "append")]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextArea.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Component for multi-line string data manipulation */\nexport default {\n name: \"PlTextArea\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-textarea.scss\";\nimport { computed, onMounted, ref, useSlots } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { useValidation } from \"../../utils/useValidation\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst slots = useSlots();\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: string): void;\n}>();\n\nconst props = defineProps<{\n /**\n * The current value of the texarea.\n */\n modelValue?: string;\n /**\n * The label to display above the texarea.\n */\n label?: string;\n /**\n * If `true`, the textarea is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the textarea.\n */\n error?: unknown;\n /**\n * A helper text to display below the textarea when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the textarea when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the textarea is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the textarea is in a read-only state and cannot be edited, but it can still be focused and text can be selected.\n */\n readonly?: boolean;\n /**\n * If `true`, applies a dashed border style to the textarea, likely used for stylistic purposes or to indicate a certain state.\n */\n dashed?: boolean;\n /**\n * The number of visible text lines for the textarea, which controls the height of the textarea.\n */\n rows?: number;\n /**\n * If `true`, the textarea automatically adjusts its height to fit the content as the user types.\n */\n autogrow?: boolean;\n /**\n * An array of validation rules that are applied to the textarea input. Each rule is a function that receives the input value and returns `true` for valid input or an error message string for invalid input.\n */\n rules?: ((v: string) => boolean | string)[];\n}>();\n\nconst root = ref<HTMLInputElement>();\nconst input = ref<HTMLTextAreaElement>();\n\nconst value = computed({\n get() {\n return props.modelValue ?? \"\";\n },\n set(v) {\n emit(\"update:modelValue\", v);\n },\n});\n\nconst nonEmpty = computed(() => !!props.modelValue);\nconst validationData = useValidation(value, props.rules || []);\n\nuseLabelNotch(root);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n\n if (propsError) {\n errors.push(propsError);\n }\n\n errors.push(...validationData.value.errors);\n\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst adjustHeight = () => {\n if (!props.autogrow) {\n return;\n }\n const el = input.value;\n if (el) {\n el.style.height = \"auto\"; // it works, do not delete it\n el.style.height = `${el.scrollHeight}px`; // Set height based on scrollHeight\n }\n};\n\nonMounted(() => {\n adjustHeight();\n});\n</script>\n\n<template>\n <div class=\"ui-text-area__envelope\">\n <div
|
|
1
|
+
{"version":3,"file":"PlTextArea.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Component for multi-line string data manipulation */\nexport default {\n name: \"PlTextArea\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-textarea.scss\";\nimport { computed, onMounted, ref, useSlots } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { useValidation } from \"../../utils/useValidation\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst slots = useSlots();\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: string): void;\n}>();\n\nconst props = defineProps<{\n /**\n * The current value of the texarea.\n */\n modelValue?: string;\n /**\n * The label to display above the texarea.\n */\n label?: string;\n /**\n * If `true`, the textarea is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the textarea.\n */\n error?: unknown;\n /**\n * A helper text to display below the textarea when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the textarea when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the textarea is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the textarea is in a read-only state and cannot be edited, but it can still be focused and text can be selected.\n */\n readonly?: boolean;\n /**\n * If `true`, applies a dashed border style to the textarea, likely used for stylistic purposes or to indicate a certain state.\n */\n dashed?: boolean;\n /**\n * The number of visible text lines for the textarea, which controls the height of the textarea.\n */\n rows?: number;\n /**\n * If `true`, the textarea automatically adjusts its height to fit the content as the user types.\n */\n autogrow?: boolean;\n /**\n * An array of validation rules that are applied to the textarea input. Each rule is a function that receives the input value and returns `true` for valid input or an error message string for invalid input.\n */\n rules?: ((v: string) => boolean | string)[];\n}>();\n\nconst root = ref<HTMLInputElement>();\nconst input = ref<HTMLTextAreaElement>();\n\nconst value = computed({\n get() {\n return props.modelValue ?? \"\";\n },\n set(v) {\n emit(\"update:modelValue\", v);\n },\n});\n\nconst nonEmpty = computed(() => !!props.modelValue);\nconst validationData = useValidation(value, props.rules || []);\n\nuseLabelNotch(root);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n\n if (propsError) {\n errors.push(propsError);\n }\n\n errors.push(...validationData.value.errors);\n\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst adjustHeight = () => {\n if (!props.autogrow) {\n return;\n }\n const el = input.value;\n if (el) {\n el.style.height = \"auto\"; // it works, do not delete it\n el.style.height = `${el.scrollHeight}px`; // Set height based on scrollHeight\n }\n};\n\nonMounted(() => {\n adjustHeight();\n});\n</script>\n\n<template>\n <div class=\"ui-text-area__envelope\" data-testid=\"pl-text-area\">\n <div\n ref=\"root\"\n class=\"ui-text-area\"\n :class=\"{ error: hasErrors, disabled, dashed, nonEmpty }\"\n data-testid=\"pl-text-area-control\"\n >\n <label v-if=\"label\" ref=\"label\" data-testid=\"pl-text-area-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-text-area-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-text-area-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <textarea\n ref=\"input\"\n v-model=\"value\"\n :readonly=\"readonly\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder ?? '...'\"\n spellcheck=\"false\"\n data-testid=\"pl-text-area-input\"\n @input=\"adjustHeight\"\n />\n <div class=\"ui-text-area__append\" data-testid=\"pl-text-area-append\">\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"ui-text-area__contour\" />\n </div>\n <div v-if=\"hasErrors\" class=\"ui-text-area__error\" data-testid=\"pl-text-area-error\">\n {{ displayErrors.join(\" \") }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-text-area__helper\" data-testid=\"pl-text-area-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGE,MAAM;;;;;;;;;;;;;;;;;EAeR,IAAM,IAAQ,GAAU,EAElB,IAAO,GAOP,IAAQ,GAmDR,IAAO,GAAuB,EAC9B,IAAQ,GAA0B,EAElC,IAAQ,EAAS;GACrB,MAAM;AACJ,WAAO,EAAM,cAAc;;GAE7B,IAAI,GAAG;AACL,MAAK,qBAAqB,EAAE;;GAE/B,CAAC,EAEI,IAAW,QAAe,CAAC,CAAC,EAAM,WAAW,EAC7C,IAAiB,EAAc,GAAO,EAAM,SAAS,EAAE,CAAC;AAE9D,IAAc,EAAK;EAEnB,IAAM,IAAgB,QAAe;GACnC,IAAM,IAAmB,EAAE,EACrB,IAAa,EAAgB,EAAM,MAAM;AAQ/C,UANI,KACF,EAAO,KAAK,EAAW,EAGzB,EAAO,KAAK,GAAG,EAAe,MAAM,OAAO,EAEpC;IACP,EAEI,IAAY,QAAe,EAAc,MAAM,SAAS,EAAE,EAE1D,UAAqB;AACzB,OAAI,CAAC,EAAM,SACT;GAEF,IAAM,IAAK,EAAM;AACjB,GAAI,MACF,EAAG,MAAM,SAAS,QAClB,EAAG,MAAM,SAAS,GAAG,EAAG,aAAa;;SAIzC,QAAgB;AACd,MAAc;IACd,kBAIA,EA2CM,OA3CN,GA2CM,CA1CJ,EAmCM,OAAA;YAlCA;GAAJ,KAAI;GACJ,OAAK,EAAA,CAAC,gBAAc;IAAA,OACH,EAAA;IAAS,UAAE,EAAA;IAAQ,QAAE,EAAA;IAAM,UAAE,EAAA;IAAQ,CAAA,CAAA;GACtD,eAAY;;GAEC,EAAA,SAAA,GAAA,EAAb,EAaQ,SAbR,GAaQ;IAZO,EAAA,YAAA,GAAA,EAAb,EAAgF,EAAA,EAAA,EAAA;;KAAxD,KAAK,EAAA,EAAW;KAAE,eAAY;;IACtD,EAAwB,QAAA,MAAA,EAAf,EAAA,MAAK,EAAA,EAAA;IAEN,EAAA,EAAK,CAAC,WAAA,GAAA,EADd,EASY,EAAA,EAAA,EAAA;;KAPV,OAAM;KACN,UAAS;KACT,eAAY;;KAED,SAAO,QACO,CAAvB,EAAuB,EAAA,QAAA,UAAA,CAAA,CAAA;;;;KAI7B,EAUE,YAAA;aATI;IAAJ,KAAI;6CACU,QAAA;IACb,UAAU,EAAA;IACV,MAAM,EAAA;IACN,UAAU,EAAA;IACV,aAAa,EAAA,eAAW;IACzB,YAAW;IACX,eAAY;IACX,SAAO;yBAPC,EAAA,MAAK,CAAA,CAAA;GAShB,EAEM,OAFN,GAEM,CADJ,EAAsB,EAAA,QAAA,SAAA,CAAA,CAAA;GAExB,EAA+C,GAAA,EAAhC,OAAM,yBAAuB,CAAA;SAEnC,EAAA,SAAA,GAAA,EAAX,EAEM,OAFN,GAEM,EADD,EAAA,MAAc,KAAI,IAAA,CAAA,EAAA,EAAA,IAEP,EAAA,UAAA,GAAA,EAAhB,EAEM,OAFN,GAEM,EADD,EAAA,OAAM,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextField.js","names":[],"sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: \"PlTextField\",\n};\n</script>\n\n<script\n lang=\"ts\"\n setup\n generic=\"\n R extends true | false,\n V extends undefined | string,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport { computed, ref, useSlots } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport \"./pl-text-field.scss\";\n\nconst slots = useSlots();\n\n/**\n * The current value of the input field.\n */\nconst model = defineModel<V>({\n required: true,\n});\n\nconst props = defineProps<{\n /** The string specifies whether the field should be a password or not, value could be \"password\" or undefined. */\n type?: \"password\";\n /** The label to display above the input field. */\n label?: string;\n /** If `true`, the input field is marked as required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** An error message to display below the input field. */\n error?: unknown;\n /** A helper text to display below the input field when there are no errors. */\n helper?: string;\n /** A placeholder text to display inside the input field when it is empty. */\n placeholder?: string;\n /** If `true`, the input field is disabled and cannot be interacted with. */\n disabled?: boolean;\n /** If `true`, the input field has a dashed border. */\n dashed?: boolean;\n /** A prefix text to display inside the input field before the value. */\n prefix?: string;\n /**\n * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).\n * If a function, calls it to get the reset value.\n */\n clearable?: BooleanPropUnless<R> | (() => C);\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: V) => string | undefined;\n /** Makes some of corners not rounded */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n}>();\n\nconst rootRef = ref<HTMLInputElement | undefined>(undefined);\n\nconst inputRef = ref<HTMLInputElement | undefined>();\n\nconst showPassword = ref(false);\n\nconst fieldType = computed(() => {\n if (props.type && props.type === \"password\") {\n return showPassword.value ? \"text\" : props.type;\n } else {\n return \"text\";\n }\n});\n\nconst passwordIcon = computed(() => (showPassword.value ? \"view-show\" : \"view-hide\"));\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n\nconst isEmpty = computed(() => model.value === \"\");\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n if (propsError) {\n errors.push(propsError);\n }\n if (props.validate) {\n const error = props.validate(model.value as V);\n if (error) {\n errors.push(error);\n }\n }\n if (props.required && isEmpty.value) {\n errors.push(\"Value is required\");\n }\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst canShowClearable = computed(\n () => props.clearable && !isEmpty.value && props.type !== \"password\" && !props.disabled,\n);\n\nconst togglePasswordVisibility = () => (showPassword.value = !showPassword.value);\n\nconst setFocusOnInput = () => inputRef.value?.focus();\n\nuseLabelNotch(rootRef);\n</script>\n\n<template>\n <div class=\"pl-text-field__envelope\">\n <div\n ref=\"rootRef\"\n class=\"pl-text-field\"\n :class=\"{\n error: hasErrors,\n disabled,\n dashed,\n nonEmpty: !isEmpty,\n }\"\n >\n <label v-if=\"label\" ref=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip
|
|
1
|
+
{"version":3,"file":"PlTextField.js","names":[],"sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: \"PlTextField\",\n};\n</script>\n\n<script\n lang=\"ts\"\n setup\n generic=\"\n R extends true | false,\n V extends undefined | string,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport { computed, ref, useSlots } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport \"./pl-text-field.scss\";\n\nconst slots = useSlots();\n\n/**\n * The current value of the input field.\n */\nconst model = defineModel<V>({\n required: true,\n});\n\nconst props = defineProps<{\n /** The string specifies whether the field should be a password or not, value could be \"password\" or undefined. */\n type?: \"password\";\n /** The label to display above the input field. */\n label?: string;\n /** If `true`, the input field is marked as required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** An error message to display below the input field. */\n error?: unknown;\n /** A helper text to display below the input field when there are no errors. */\n helper?: string;\n /** A placeholder text to display inside the input field when it is empty. */\n placeholder?: string;\n /** If `true`, the input field is disabled and cannot be interacted with. */\n disabled?: boolean;\n /** If `true`, the input field has a dashed border. */\n dashed?: boolean;\n /** A prefix text to display inside the input field before the value. */\n prefix?: string;\n /**\n * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).\n * If a function, calls it to get the reset value.\n */\n clearable?: BooleanPropUnless<R> | (() => C);\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: V) => string | undefined;\n /** Makes some of corners not rounded */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n}>();\n\nconst rootRef = ref<HTMLInputElement | undefined>(undefined);\n\nconst inputRef = ref<HTMLInputElement | undefined>();\n\nconst showPassword = ref(false);\n\nconst fieldType = computed(() => {\n if (props.type && props.type === \"password\") {\n return showPassword.value ? \"text\" : props.type;\n } else {\n return \"text\";\n }\n});\n\nconst passwordIcon = computed(() => (showPassword.value ? \"view-show\" : \"view-hide\"));\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n\nconst isEmpty = computed(() => model.value === \"\");\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n if (propsError) {\n errors.push(propsError);\n }\n if (props.validate) {\n const error = props.validate(model.value as V);\n if (error) {\n errors.push(error);\n }\n }\n if (props.required && isEmpty.value) {\n errors.push(\"Value is required\");\n }\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst canShowClearable = computed(\n () => props.clearable && !isEmpty.value && props.type !== \"password\" && !props.disabled,\n);\n\nconst togglePasswordVisibility = () => (showPassword.value = !showPassword.value);\n\nconst setFocusOnInput = () => inputRef.value?.focus();\n\nuseLabelNotch(rootRef);\n</script>\n\n<template>\n <div class=\"pl-text-field__envelope\" data-testid=\"pl-text-field\">\n <div\n ref=\"rootRef\"\n class=\"pl-text-field\"\n data-testid=\"pl-text-field-control\"\n :class=\"{\n error: hasErrors,\n disabled,\n dashed,\n nonEmpty: !isEmpty,\n }\"\n >\n <label v-if=\"label\" ref=\"label\" data-testid=\"pl-text-field-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-text-field-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-text-field-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"prefix\" class=\"pl-text-field__prefix\" data-testid=\"pl-text-field-prefix\">\n {{ prefix }}\n </div>\n <input\n ref=\"inputRef\"\n v-model=\"model\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder || '...'\"\n :type=\"fieldType\"\n spellcheck=\"false\"\n data-testid=\"pl-text-field-input\"\n />\n <div\n class=\"pl-text-field__append\"\n data-testid=\"pl-text-field-append\"\n @click=\"setFocusOnInput\"\n >\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-text-field__clearable\"\n data-testid=\"pl-text-field-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <PlIcon24\n v-if=\"type === 'password'\"\n :name=\"passwordIcon\"\n style=\"cursor: pointer\"\n data-testid=\"pl-text-field-password-toggle\"\n @click.stop=\"togglePasswordVisibility\"\n />\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"pl-text-field__contour\" :group-position=\"groupPosition\" />\n </div>\n <div v-if=\"hasErrors\" class=\"pl-text-field__error\" data-testid=\"pl-text-field-error\">\n {{ displayErrors.join(\" \") }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-text-field__helper\" data-testid=\"pl-text-field-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTextField/PlTextField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlTextField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTextField/PlTextField.vue"],"names":[],"mappings":"AAkNA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAM/E,OAAO,sBAAsB,CAAC;AAG9B;;GAEG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,GACd,CAAC,SAAS,IAAI,GAAG,KAAK,EACtB,CAAC,SAAS,SAAS,GAAG,MAAM,EAC5B,CAAC,SAAS,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,EAE/D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAiVO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;QAtUtD,kHAAkH;eAC3G,UAAU;QACjB,kDAAkD;gBAC1C,MAAM;QACd,6FAA6F;mBAClF,WAAW,CAAC,CAAC,CAAC;QACzB,yDAAyD;gBACjD,OAAO;QACf,+EAA+E;iBACtE,MAAM;QACf,6EAA6E;sBAC/D,MAAM;QACpB,4EAA4E;mBACjE,OAAO;QAClB,sDAAsD;iBAC7C,OAAO;QAChB,wEAAwE;iBAC/D,MAAM;QACf;;;WAGG;oBACS,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,yFAAyF;mBAC9E,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS;QACvC,wCAAwC;wBAEpC,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,QAAQ;;QA4Dd;;WAEG;oBACS,CAAC;;;KAoO8E,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;kBAbG,CAAC,KAAK,IAAiB,KAAK,GAAG;;iBAChC,CAAC,KAAK,IAAiB,KAAK,GAAG;;;EAgBxC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAAI,CAAC;AACzF,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -13,22 +13,29 @@ import s from "../../assets/images/required.js";
|
|
|
13
13
|
import './pl-text-field.css';/* empty css */
|
|
14
14
|
import { computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, mergeModels as h, normalizeClass as g, openBlock as _, ref as v, renderSlot as y, toDisplayString as b, unref as x, useModel as S, useSlots as C, vModelDynamic as w, withCtx as T, withDirectives as E, withModifiers as D } from "vue";
|
|
15
15
|
//#region src/components/PlTextField/PlTextField.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
-
var O = {
|
|
16
|
+
var O = {
|
|
17
|
+
class: "pl-text-field__envelope",
|
|
18
|
+
"data-testid": "pl-text-field"
|
|
19
|
+
}, k = {
|
|
17
20
|
key: 0,
|
|
18
|
-
ref: "label"
|
|
21
|
+
ref: "label",
|
|
22
|
+
"data-testid": "pl-text-field-label"
|
|
19
23
|
}, A = {
|
|
20
24
|
key: 1,
|
|
21
|
-
class: "pl-text-field__prefix"
|
|
25
|
+
class: "pl-text-field__prefix",
|
|
26
|
+
"data-testid": "pl-text-field-prefix"
|
|
22
27
|
}, j = [
|
|
23
28
|
"disabled",
|
|
24
29
|
"placeholder",
|
|
25
30
|
"type"
|
|
26
31
|
], M = {
|
|
27
32
|
key: 0,
|
|
28
|
-
class: "pl-text-field__error"
|
|
33
|
+
class: "pl-text-field__error",
|
|
34
|
+
"data-testid": "pl-text-field-error"
|
|
29
35
|
}, N = {
|
|
30
36
|
key: 1,
|
|
31
|
-
class: "pl-text-field__helper"
|
|
37
|
+
class: "pl-text-field__helper",
|
|
38
|
+
"data-testid": "pl-text-field-helper"
|
|
32
39
|
}, P = /* @__PURE__ */ m({
|
|
33
40
|
name: "PlTextField",
|
|
34
41
|
props: /* @__PURE__ */ h({
|
|
@@ -68,18 +75,21 @@ var O = { class: "pl-text-field__envelope" }, k = {
|
|
|
68
75
|
disabled: m.disabled,
|
|
69
76
|
dashed: m.dashed,
|
|
70
77
|
nonEmpty: !H.value
|
|
71
|
-
}])
|
|
78
|
+
}]),
|
|
79
|
+
"data-testid": "pl-text-field-control"
|
|
72
80
|
}, [
|
|
73
81
|
m.label ? (_(), d("label", k, [
|
|
74
82
|
m.required ? (_(), l(x(n), {
|
|
75
83
|
key: 0,
|
|
76
|
-
uri: x(s)
|
|
84
|
+
uri: x(s),
|
|
85
|
+
"data-testid": "pl-text-field-required"
|
|
77
86
|
}, null, 8, ["uri"])) : u("", !0),
|
|
78
87
|
f("span", null, b(m.label), 1),
|
|
79
88
|
x(h).tooltip ? (_(), l(x(e), {
|
|
80
89
|
key: 1,
|
|
81
90
|
class: "info",
|
|
82
|
-
position: "top"
|
|
91
|
+
position: "top",
|
|
92
|
+
"data-testid": "pl-text-field-tooltip"
|
|
83
93
|
}, {
|
|
84
94
|
tooltip: T(() => [y(t.$slots, "tooltip")]),
|
|
85
95
|
_: 3
|
|
@@ -93,15 +103,18 @@ var O = { class: "pl-text-field__envelope" }, k = {
|
|
|
93
103
|
disabled: m.disabled,
|
|
94
104
|
placeholder: m.placeholder || "...",
|
|
95
105
|
type: z.value,
|
|
96
|
-
spellcheck: "false"
|
|
106
|
+
spellcheck: "false",
|
|
107
|
+
"data-testid": "pl-text-field-input"
|
|
97
108
|
}, null, 8, j), [[w, P.value]]),
|
|
98
109
|
f("div", {
|
|
99
110
|
class: "pl-text-field__append",
|
|
111
|
+
"data-testid": "pl-text-field-append",
|
|
100
112
|
onClick: q
|
|
101
113
|
}, [
|
|
102
114
|
G.value ? (_(), l(x(i), {
|
|
103
115
|
key: 0,
|
|
104
116
|
class: "pl-text-field__clearable",
|
|
117
|
+
"data-testid": "pl-text-field-clear",
|
|
105
118
|
name: "delete-clear",
|
|
106
119
|
onClick: D(V, ["stop"])
|
|
107
120
|
})) : u("", !0),
|
|
@@ -109,6 +122,7 @@ var O = { class: "pl-text-field__envelope" }, k = {
|
|
|
109
122
|
key: 1,
|
|
110
123
|
name: B.value,
|
|
111
124
|
style: { cursor: "pointer" },
|
|
125
|
+
"data-testid": "pl-text-field-password-toggle",
|
|
112
126
|
onClick: D(K, ["stop"])
|
|
113
127
|
}, null, 8, ["name"])) : u("", !0),
|
|
114
128
|
y(t.$slots, "append")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextField.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: \"PlTextField\",\n};\n</script>\n\n<script\n lang=\"ts\"\n setup\n generic=\"\n R extends true | false,\n V extends undefined | string,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport { computed, ref, useSlots } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport \"./pl-text-field.scss\";\n\nconst slots = useSlots();\n\n/**\n * The current value of the input field.\n */\nconst model = defineModel<V>({\n required: true,\n});\n\nconst props = defineProps<{\n /** The string specifies whether the field should be a password or not, value could be \"password\" or undefined. */\n type?: \"password\";\n /** The label to display above the input field. */\n label?: string;\n /** If `true`, the input field is marked as required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** An error message to display below the input field. */\n error?: unknown;\n /** A helper text to display below the input field when there are no errors. */\n helper?: string;\n /** A placeholder text to display inside the input field when it is empty. */\n placeholder?: string;\n /** If `true`, the input field is disabled and cannot be interacted with. */\n disabled?: boolean;\n /** If `true`, the input field has a dashed border. */\n dashed?: boolean;\n /** A prefix text to display inside the input field before the value. */\n prefix?: string;\n /**\n * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).\n * If a function, calls it to get the reset value.\n */\n clearable?: BooleanPropUnless<R> | (() => C);\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: V) => string | undefined;\n /** Makes some of corners not rounded */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n}>();\n\nconst rootRef = ref<HTMLInputElement | undefined>(undefined);\n\nconst inputRef = ref<HTMLInputElement | undefined>();\n\nconst showPassword = ref(false);\n\nconst fieldType = computed(() => {\n if (props.type && props.type === \"password\") {\n return showPassword.value ? \"text\" : props.type;\n } else {\n return \"text\";\n }\n});\n\nconst passwordIcon = computed(() => (showPassword.value ? \"view-show\" : \"view-hide\"));\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n\nconst isEmpty = computed(() => model.value === \"\");\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n if (propsError) {\n errors.push(propsError);\n }\n if (props.validate) {\n const error = props.validate(model.value as V);\n if (error) {\n errors.push(error);\n }\n }\n if (props.required && isEmpty.value) {\n errors.push(\"Value is required\");\n }\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst canShowClearable = computed(\n () => props.clearable && !isEmpty.value && props.type !== \"password\" && !props.disabled,\n);\n\nconst togglePasswordVisibility = () => (showPassword.value = !showPassword.value);\n\nconst setFocusOnInput = () => inputRef.value?.focus();\n\nuseLabelNotch(rootRef);\n</script>\n\n<template>\n <div class=\"pl-text-field__envelope\">\n <div\n ref=\"rootRef\"\n class=\"pl-text-field\"\n :class=\"{\n error: hasErrors,\n disabled,\n dashed,\n nonEmpty: !isEmpty,\n }\"\n >\n <label v-if=\"label\" ref=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip
|
|
1
|
+
{"version":3,"file":"PlTextField.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: \"PlTextField\",\n};\n</script>\n\n<script\n lang=\"ts\"\n setup\n generic=\"\n R extends true | false,\n V extends undefined | string,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport { computed, ref, useSlots } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport \"./pl-text-field.scss\";\n\nconst slots = useSlots();\n\n/**\n * The current value of the input field.\n */\nconst model = defineModel<V>({\n required: true,\n});\n\nconst props = defineProps<{\n /** The string specifies whether the field should be a password or not, value could be \"password\" or undefined. */\n type?: \"password\";\n /** The label to display above the input field. */\n label?: string;\n /** If `true`, the input field is marked as required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** An error message to display below the input field. */\n error?: unknown;\n /** A helper text to display below the input field when there are no errors. */\n helper?: string;\n /** A placeholder text to display inside the input field when it is empty. */\n placeholder?: string;\n /** If `true`, the input field is disabled and cannot be interacted with. */\n disabled?: boolean;\n /** If `true`, the input field has a dashed border. */\n dashed?: boolean;\n /** A prefix text to display inside the input field before the value. */\n prefix?: string;\n /**\n * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).\n * If a function, calls it to get the reset value.\n */\n clearable?: BooleanPropUnless<R> | (() => C);\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: V) => string | undefined;\n /** Makes some of corners not rounded */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n}>();\n\nconst rootRef = ref<HTMLInputElement | undefined>(undefined);\n\nconst inputRef = ref<HTMLInputElement | undefined>();\n\nconst showPassword = ref(false);\n\nconst fieldType = computed(() => {\n if (props.type && props.type === \"password\") {\n return showPassword.value ? \"text\" : props.type;\n } else {\n return \"text\";\n }\n});\n\nconst passwordIcon = computed(() => (showPassword.value ? \"view-show\" : \"view-hide\"));\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n\nconst isEmpty = computed(() => model.value === \"\");\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n if (propsError) {\n errors.push(propsError);\n }\n if (props.validate) {\n const error = props.validate(model.value as V);\n if (error) {\n errors.push(error);\n }\n }\n if (props.required && isEmpty.value) {\n errors.push(\"Value is required\");\n }\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst canShowClearable = computed(\n () => props.clearable && !isEmpty.value && props.type !== \"password\" && !props.disabled,\n);\n\nconst togglePasswordVisibility = () => (showPassword.value = !showPassword.value);\n\nconst setFocusOnInput = () => inputRef.value?.focus();\n\nuseLabelNotch(rootRef);\n</script>\n\n<template>\n <div class=\"pl-text-field__envelope\" data-testid=\"pl-text-field\">\n <div\n ref=\"rootRef\"\n class=\"pl-text-field\"\n data-testid=\"pl-text-field-control\"\n :class=\"{\n error: hasErrors,\n disabled,\n dashed,\n nonEmpty: !isEmpty,\n }\"\n >\n <label v-if=\"label\" ref=\"label\" data-testid=\"pl-text-field-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-text-field-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-text-field-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"prefix\" class=\"pl-text-field__prefix\" data-testid=\"pl-text-field-prefix\">\n {{ prefix }}\n </div>\n <input\n ref=\"inputRef\"\n v-model=\"model\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder || '...'\"\n :type=\"fieldType\"\n spellcheck=\"false\"\n data-testid=\"pl-text-field-input\"\n />\n <div\n class=\"pl-text-field__append\"\n data-testid=\"pl-text-field-append\"\n @click=\"setFocusOnInput\"\n >\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-text-field__clearable\"\n data-testid=\"pl-text-field-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <PlIcon24\n v-if=\"type === 'password'\"\n :name=\"passwordIcon\"\n style=\"cursor: pointer\"\n data-testid=\"pl-text-field-password-toggle\"\n @click.stop=\"togglePasswordVisibility\"\n />\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"pl-text-field__contour\" :group-position=\"groupPosition\" />\n </div>\n <div v-if=\"hasErrors\" class=\"pl-text-field__error\" data-testid=\"pl-text-field-error\">\n {{ displayErrors.join(\" \") }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-text-field__helper\" data-testid=\"pl-text-field-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKE,MAAM;;;;;;;;;;;;;;;;;;;;EAyBR,IAAM,IAAQ,GAAU,EAKlB,IAAQ,EAAc,GAAA,aAE1B,EAEI,IAAQ,GAuCR,IAAU,EAAkC,KAAA,EAAU,EAEtD,IAAW,GAAmC,EAE9C,IAAe,EAAI,GAAM,EAEzB,IAAY,QACZ,EAAM,QAAQ,EAAM,SAAS,aACxB,EAAa,QAAQ,SAAS,EAAM,OAEpC,OAET,EAEI,IAAe,QAAgB,EAAa,QAAQ,cAAc,YAAa,EAE/E,UAAc;AAClB,GAAI,EAAM,cACR,EAAM,QAAS,OAAO,EAAM,aAAc,aAAa,EAAM,WAAW,GAAG;KAIzE,IAAU,QAAe,EAAM,UAAU,GAAG,EAE5C,IAAgB,QAAe;GACnC,IAAM,IAAmB,EAAE,EACrB,IAAa,EAAgB,EAAM,MAAM;AAI/C,OAHI,KACF,EAAO,KAAK,EAAW,EAErB,EAAM,UAAU;IAClB,IAAM,IAAQ,EAAM,SAAS,EAAM,MAAW;AAC9C,IAAI,KACF,EAAO,KAAK,EAAM;;AAMtB,UAHI,EAAM,YAAY,EAAQ,SAC5B,EAAO,KAAK,oBAAoB,EAE3B;IACP,EAEI,IAAY,QAAe,EAAc,MAAM,SAAS,EAAE,EAE1D,IAAmB,QACjB,EAAM,aAAa,CAAC,EAAQ,SAAS,EAAM,SAAS,cAAc,CAAC,EAAM,SAChF,EAEK,UAAkC,EAAa,QAAQ,CAAC,EAAa,OAErE,UAAwB,EAAS,OAAO,OAAO;SAErD,EAAc,EAAQ,kBAIpB,EAmEM,OAnEN,GAmEM,CAlEJ,EA2DM,OAAA;YA1DA;GAAJ,KAAI;GACJ,OAAK,EAAA,CAAC,iBAAe;WAEI,EAAA;cAAmB,EAAA;YAAkB,EAAA;eAA2B,EAAA;;GADzF,eAAY;;GAQC,EAAA,SAAA,GAAA,EAAb,EAaQ,SAbR,GAaQ;IAZO,EAAA,YAAA,GAAA,EAAb,EAAiF,EAAA,EAAA,EAAA;;KAAzD,KAAK,EAAA,EAAW;KAAE,eAAY;;IACtD,EAAwB,QAAA,MAAA,EAAf,EAAA,MAAK,EAAA,EAAA;IAEN,EAAA,EAAK,CAAC,WAAA,GAAA,EADd,EASY,EAAA,EAAA,EAAA;;KAPV,OAAM;KACN,UAAS;KACT,eAAY;;KAED,SAAO,QACO,CAAvB,EAAuB,EAAA,QAAA,UAAA,CAAA,CAAA;;;;GAIlB,EAAA,UAAA,GAAA,EAAX,EAEM,OAFN,GAEM,EADD,EAAA,OAAM,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA;KAEX,EAQE,SAAA;aAPI;IAAJ,KAAI;6CACU,QAAA;IACb,UAAU,EAAA;IACV,aAAa,EAAA,eAAW;IACxB,MAAM,EAAA;IACP,YAAW;IACX,eAAY;wBALH,EAAA,MAAK,CAAA,CAAA;GAOhB,EAoBM,OAAA;IAnBJ,OAAM;IACN,eAAY;IACX,SAAO;;IAGA,EAAA,SAAA,GAAA,EADR,EAME,EAAA,EAAA,EAAA;;KAJA,OAAM;KACN,eAAY;KACZ,MAAK;KACJ,SAAK,EAAO,GAAK,CAAA,OAAA,CAAA;;IAGZ,EAAA,SAAI,cAAA,GAAA,EADZ,EAME,EAAA,EAAA,EAAA;;KAJC,MAAM,EAAA;KACP,OAAA,EAAA,QAAA,WAAuB;KACvB,eAAY;KACX,SAAK,EAAO,GAAwB,CAAA,OAAA,CAAA;;IAEvC,EAAsB,EAAA,QAAA,SAAA;;GAExB,EAAgF,GAAA;IAAjE,OAAM;IAA0B,kBAAgB,EAAA;;SAEtD,EAAA,SAAA,GAAA,EAAX,EAEM,OAFN,GAEM,EADD,EAAA,MAAc,KAAI,IAAA,CAAA,EAAA,EAAA,IAEP,EAAA,UAAA,GAAA,EAAhB,EAEM,OAFN,GAEM,EADD,EAAA,OAAM,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlToggleSwitch.js","names":[],"sources":["../../../src/components/PlToggleSwitch/PlToggleSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for manipulating a boolean value\n */\nexport default {\n name: \"PlToggleSwitch\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-toggle-switch.scss\";\n\ndefineEmits<{\n /**\n * Emitted when the model value is updated\n *\n * @param value - The new boolean value of the model\n */\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n\ndefineProps<{\n /**\n * The label text for the component (optional)\n */\n label?: string;\n /**\n * The current boolean value of the component (represents 'on' | 'off' states generally).\n */\n modelValue?: boolean;\n}>();\n</script>\n\n<template>\n <div\n tabindex=\"0\"\n class=\"ui-toggle-switch\"\n :class=\"{ active: modelValue }\"\n @click=\"$emit('update:modelValue', !modelValue)\"\n @keydown.enter=\"$emit('update:modelValue', !modelValue)\"\n >\n <div class=\"ui-toggle-switch__body\">\n <div class=\"ui-toggle-switch__handle\" />\n </div>\n <span v-if=\"label\" class=\"label\">{{ label }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlToggleSwitch.js","names":[],"sources":["../../../src/components/PlToggleSwitch/PlToggleSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for manipulating a boolean value\n */\nexport default {\n name: \"PlToggleSwitch\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-toggle-switch.scss\";\n\ndefineEmits<{\n /**\n * Emitted when the model value is updated\n *\n * @param value - The new boolean value of the model\n */\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n\ndefineProps<{\n /**\n * The label text for the component (optional)\n */\n label?: string;\n /**\n * The current boolean value of the component (represents 'on' | 'off' states generally).\n */\n modelValue?: boolean;\n}>();\n</script>\n\n<template>\n <div\n tabindex=\"0\"\n class=\"ui-toggle-switch\"\n data-testid=\"pl-toggle-switch\"\n :class=\"{ active: modelValue }\"\n @click=\"$emit('update:modelValue', !modelValue)\"\n @keydown.enter=\"$emit('update:modelValue', !modelValue)\"\n >\n <div class=\"ui-toggle-switch__body\" data-testid=\"pl-toggle-switch-body\">\n <div class=\"ui-toggle-switch__handle\" data-testid=\"pl-toggle-switch-handle\" />\n </div>\n <span v-if=\"label\" class=\"label\" data-testid=\"pl-toggle-switch-label\">{{ label }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlToggleSwitch.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlToggleSwitch/PlToggleSwitch.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlToggleSwitch.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlToggleSwitch/PlToggleSwitch.vue"],"names":[],"mappings":"AAmDA,OAAO,yBAAyB,CAAC;AAGjC;;GAEG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAYhB;;OAEG;YACK,MAAM;IACd;;OAEG;iBACU,OAAO;;;;IAPpB;;OAEG;YACK,MAAM;IACd;;OAEG;iBACU,OAAO;;;kFA+DlB,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { createCommentVNode as e, createElementBlock as t, createElementVNode as
|
|
|
3
3
|
//#region src/components/PlToggleSwitch/PlToggleSwitch.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var c = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "label"
|
|
6
|
+
class: "label",
|
|
7
|
+
"data-testid": "pl-toggle-switch-label"
|
|
7
8
|
}, l = /* @__PURE__ */ r({
|
|
8
9
|
name: "PlToggleSwitch",
|
|
9
10
|
props: {
|
|
@@ -15,9 +16,16 @@ var c = {
|
|
|
15
16
|
return (l, u) => (a(), t("div", {
|
|
16
17
|
tabindex: "0",
|
|
17
18
|
class: i(["ui-toggle-switch", { active: r.modelValue }]),
|
|
19
|
+
"data-testid": "pl-toggle-switch",
|
|
18
20
|
onClick: u[0] ||= (e) => l.$emit("update:modelValue", !r.modelValue),
|
|
19
21
|
onKeydown: u[1] ||= s((e) => l.$emit("update:modelValue", !r.modelValue), ["enter"])
|
|
20
|
-
}, [u[2] ||= n("div", {
|
|
22
|
+
}, [u[2] ||= n("div", {
|
|
23
|
+
class: "ui-toggle-switch__body",
|
|
24
|
+
"data-testid": "pl-toggle-switch-body"
|
|
25
|
+
}, [n("div", {
|
|
26
|
+
class: "ui-toggle-switch__handle",
|
|
27
|
+
"data-testid": "pl-toggle-switch-handle"
|
|
28
|
+
})], -1), r.label ? (a(), t("span", c, o(r.label), 1)) : e("", !0)], 34));
|
|
21
29
|
}
|
|
22
30
|
});
|
|
23
31
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlToggleSwitch.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/components/PlToggleSwitch/PlToggleSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for manipulating a boolean value\n */\nexport default {\n name: \"PlToggleSwitch\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-toggle-switch.scss\";\n\ndefineEmits<{\n /**\n * Emitted when the model value is updated\n *\n * @param value - The new boolean value of the model\n */\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n\ndefineProps<{\n /**\n * The label text for the component (optional)\n */\n label?: string;\n /**\n * The current boolean value of the component (represents 'on' | 'off' states generally).\n */\n modelValue?: boolean;\n}>();\n</script>\n\n<template>\n <div\n tabindex=\"0\"\n class=\"ui-toggle-switch\"\n :class=\"{ active: modelValue }\"\n @click=\"$emit('update:modelValue', !modelValue)\"\n @keydown.enter=\"$emit('update:modelValue', !modelValue)\"\n >\n <div class=\"ui-toggle-switch__body\">\n <div class=\"ui-toggle-switch__handle\" />\n </div>\n <span v-if=\"label\" class=\"label\">{{ label }}</span>\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlToggleSwitch.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/components/PlToggleSwitch/PlToggleSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for manipulating a boolean value\n */\nexport default {\n name: \"PlToggleSwitch\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport \"./pl-toggle-switch.scss\";\n\ndefineEmits<{\n /**\n * Emitted when the model value is updated\n *\n * @param value - The new boolean value of the model\n */\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n\ndefineProps<{\n /**\n * The label text for the component (optional)\n */\n label?: string;\n /**\n * The current boolean value of the component (represents 'on' | 'off' states generally).\n */\n modelValue?: boolean;\n}>();\n</script>\n\n<template>\n <div\n tabindex=\"0\"\n class=\"ui-toggle-switch\"\n data-testid=\"pl-toggle-switch\"\n :class=\"{ active: modelValue }\"\n @click=\"$emit('update:modelValue', !modelValue)\"\n @keydown.enter=\"$emit('update:modelValue', !modelValue)\"\n >\n <div class=\"ui-toggle-switch__body\" data-testid=\"pl-toggle-switch-body\">\n <div class=\"ui-toggle-switch__handle\" data-testid=\"pl-toggle-switch-handle\" />\n </div>\n <span v-if=\"label\" class=\"label\" data-testid=\"pl-toggle-switch-label\">{{ label }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;CAKE,MAAM;;;;;;;yBA6BN,EAYM,OAAA;GAXJ,UAAS;GACT,OAAK,EAAA,CAAC,oBAAkB,EAAA,QAEN,EAAA,YAAU,CAAA,CAAA;GAD5B,eAAY;GAEX,SAAK,AAAA,EAAA,QAAA,MAAEA,EAAAA,MAAK,qBAAA,CAAuB,EAAA,WAAU;GAC7C,WAAO,AAAA,EAAA,OAAA,GAAA,MAAQA,EAAAA,MAAK,qBAAA,CAAuB,EAAA,WAAU,EAAA,CAAA,QAAA,CAAA;eAEtD,EAEM,OAAA;GAFD,OAAM;GAAyB,eAAY;MAC9C,EAA8E,OAAA;GAAzE,OAAM;GAA2B,eAAY;YAExC,EAAA,SAAA,GAAA,EAAZ,EAAwF,QAAxF,GAAwF,EAAf,EAAA,MAAK,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,EAAA,GAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTooltip.js","names":[],"sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Simple tooltip on mouseover */\nexport default {\n name: \"PlTooltip\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport { uniqueId } from \"@milaboratories/helpers\";\nimport { onUnmounted, reactive, ref, watch } from \"vue\";\nimport { tMap } from \"./global\";\nimport * as utils from \"../../helpers/utils\";\nimport { useClickOutside } from \"../../composition/useClickOutside\";\n\nconst emit = defineEmits([\"tooltip:close\"]);\n\nconst tKey = Symbol();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * delay in milliseconds before the tooltip opens\n */\n openDelay?: number;\n /**\n * delay in milliseconds before the tooltip disappears\n */\n closeDelay?: number;\n /**\n * Tooltip position\n */\n position?: \"top\" | \"left\" | \"bottom\" | \"right\" | \"top-left\";\n /**\n * external prop to hide tooltips\n */\n hide?: boolean;\n /**\n * The gap in pixels between the tooltip and the target element\n */\n gap?: number;\n\n /**\n * The minimum offset in pixels from the edge of the screen to the tooltip\n */\n offsetToTheEdge?: number;\n /**\n * base html element for tooltip\n */\n element?: \"div\" | \"span\" | \"a\" | \"p\" | \"h1\" | \"h2\" | \"h3\";\n /**\n * Max width (css value) of the tooltip container (default is 300px)\n */\n maxWidth?: string;\n /**\n * The container to insert the tooltip to (body by default)\n */\n container?: \"body\" | HTMLElement;\n /**\n * Whether the tooltip is shown on hover (default is true); otherwise, it is shown when hide is set to false\n */\n hoverable?: boolean;\n }>(),\n {\n openDelay: 100,\n closeDelay: 1000,\n gap: 8,\n offsetToTheEdge: 8,\n position: \"top\",\n element: \"div\",\n maxWidth: \"300px\",\n container: \"body\",\n hoverable: true,\n },\n);\n\nconst data = reactive({\n open: false,\n over: false,\n tooltipOpen: false,\n key: Symbol(),\n});\n\ntMap.set(tKey, () => closeTooltip());\n\n// Hook to avoid the need to immediately teleport into the body (better performance)\nwatch(\n () => data.open,\n (v) => {\n requestAnimationFrame(() => {\n data.tooltipOpen = v;\n });\n },\n);\n\nlet clearTimeout = () => {};\n\nconst showTooltip = () => {\n data.open = true;\n\n for (const [k, f] of tMap.entries()) {\n if (k !== tKey) {\n f();\n }\n }\n};\n\nconst closeTooltip = () => {\n data.open = false;\n emit(\"tooltip:close\");\n};\n\nconst onOver = async () => {\n if (props.hide || !props.hoverable) {\n return;\n }\n\n data.over = true;\n\n clearTimeout();\n\n await utils.delay(props.openDelay ?? 100);\n\n if (data.over) {\n showTooltip();\n }\n};\n\nconst onLeave = () => {\n if (!props.hoverable) {\n return;\n }\n\n data.over = false;\n clearTimeout = utils.timeout(() => {\n if (!data.over) {\n closeTooltip();\n }\n }, props.closeDelay);\n};\n\nwatch(\n () => props.hide,\n (hide) => {\n if (hide) {\n closeTooltip();\n } else if (!props.hoverable) {\n showTooltip();\n }\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst tooltip = ref<HTMLElement | undefined>();\n\nuseClickOutside([rootRef, tooltip], () => closeTooltip());\n\nonUnmounted(() => {\n tMap.delete(tKey);\n});\nconst anchorName = `--anchor-${uniqueId()}`;\n</script>\n\n<template>\n <component\n :class=\"$style.plTooltipAnchorWrapper\"\n :is=\"element\"\n v-bind=\"$attrs\"\n ref=\"rootRef\"\n @click=\"onOver\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- anchor element here -->\n <slot />\n <Transition name=\"pl-tooltip-fade\">\n <Teleport v-if=\"$slots['tooltip'] && data.tooltipOpen\" :to=\"container\">\n <div\n :class=\"[\n $style.plTooltipContainer,\n {\n [$style.top]: props.position === 'top',\n [$style.bottom]: props.position === 'bottom',\n [$style.left]: props.position === 'left',\n [$style.right]: props.position === 'right',\n [$style.topLeft]: props.position === 'top-left',\n },\n ]\"\n :style=\"{\n '--anchorName': anchorName,\n '--gap': gap + 'px',\n '--offsetToTheEdge': offsetToTheEdge + 'px',\n '--plTooltipMaxWidth': maxWidth,\n }\"\n >\n <div :class=\"$style.plTooltipBox\" @click.stop>\n <div\n ref=\"tooltip\"\n :class=\"[$style.plTooltipContent, position]\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- should be one line -->\n <div><slot name=\"tooltip\" /></div>\n </div>\n </div>\n <div :class=\"$style.plTooltipBeak\" />\n </div>\n </Teleport>\n </Transition>\n </component>\n</template>\n\n<style module>\n.plTooltipAnchorWrapper {\n display: inline-block;\n}\n/* just to set anchor-name for the anchor */\n.plTooltipAnchorWrapper > :first-child {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipAnchorWrapper:global(.info) {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipContainer {\n --plTooltipMaxWidth: 300px;\n --gap: 8px;\n --tailWidth: 8px;\n --tailHeight: calc(var(--gap) + 2px);\n\n --tailClipTop: polygon(\n 0 0,\n 100% 0,\n 100% calc(100% - var(--gap)),\n 50% calc(100% - 3px),\n 0 calc(100% - var(--gap))\n );\n --tailClipBottom: polygon(0 100%, 100% 100%, 100% var(--gap), 50% 3px, 0 var(--gap));\n --tailClipLeft: polygon(0 0, 0 100%, 2px 100%, calc(100% - 3px) 50%, 2px 0);\n --tailClipRight: polygon(100% 0, 100% 100%, calc(100% - 2px) 100%, 3px 50%, calc(100% - 2px) 0);\n\n z-index: var(--z-tooltip);\n}\n\n.plTooltipContent {\n display: inline-block;\n padding: 8px 12px 9px 12px;\n background: var(--tooltip-bg);\n border-radius: 6px;\n width: max-content;\n word-break: normal;\n max-width: var(--plTooltipMaxWidth);\n color: #fff;\n}\n\n.plTooltipBox {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 1;\n}\n\n.plTooltipBeak {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 0;\n background: var(--tooltip-bg);\n width: var(--tailWidth);\n height: var(--tailHeight);\n}\n\n/* top */\n.plTooltipContainer.top .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.top .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n/* bottom */\n.plTooltipContainer.bottom .plTooltipBox {\n position-area: bottom;\n top: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.bottom .plTooltipBeak {\n position-area: bottom;\n top: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipBottom);\n}\n\n/* left */\n.plTooltipContainer.left .plTooltipBox {\n position-area: left;\n right: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.left .plTooltipBeak {\n position-area: left;\n right: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipLeft);\n}\n\n/* right */\n.plTooltipContainer.right .plTooltipBox {\n position-area: right;\n left: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.right .plTooltipBeak {\n position-area: right;\n left: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipRight);\n}\n\n/* top left */\n.plTooltipContainer.topLeft .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: anchor(var(--anchorName) left);\n}\n.plTooltipContainer.topLeft .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n:global(.pl-tooltip-fade-leave-active),\n:global(.pl-tooltip-fade-enter-active) {\n z-index: var(--z-tooltip);\n transition: opacity 0.2s ease-in-out;\n}\n:global(.pl-tooltip-fade-enter-from),\n:global(.pl-tooltip-fade-leave-to) {\n opacity: 0;\n}\n\n.plTooltipContent a {\n color: var(--tooltip-link-color);\n}\n\n.plTooltipContent p {\n margin-bottom: 8px;\n}\n\n.plTooltipContent ul,\n.plTooltipContent li {\n margin-left: 6px;\n padding-left: 6px;\n}\n\n.plTooltipContent li {\n margin-bottom: 4px;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlTooltip.js","names":[],"sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Simple tooltip on mouseover */\nexport default {\n name: \"PlTooltip\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport { uniqueId } from \"@milaboratories/helpers\";\nimport { onUnmounted, reactive, ref, watch } from \"vue\";\nimport { tMap } from \"./global\";\nimport * as utils from \"../../helpers/utils\";\nimport { useClickOutside } from \"../../composition/useClickOutside\";\n\nconst emit = defineEmits([\"tooltip:close\"]);\n\nconst tKey = Symbol();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * delay in milliseconds before the tooltip opens\n */\n openDelay?: number;\n /**\n * delay in milliseconds before the tooltip disappears\n */\n closeDelay?: number;\n /**\n * Tooltip position\n */\n position?: \"top\" | \"left\" | \"bottom\" | \"right\" | \"top-left\";\n /**\n * external prop to hide tooltips\n */\n hide?: boolean;\n /**\n * The gap in pixels between the tooltip and the target element\n */\n gap?: number;\n\n /**\n * The minimum offset in pixels from the edge of the screen to the tooltip\n */\n offsetToTheEdge?: number;\n /**\n * base html element for tooltip\n */\n element?: \"div\" | \"span\" | \"a\" | \"p\" | \"h1\" | \"h2\" | \"h3\";\n /**\n * Max width (css value) of the tooltip container (default is 300px)\n */\n maxWidth?: string;\n /**\n * The container to insert the tooltip to (body by default)\n */\n container?: \"body\" | HTMLElement;\n /**\n * Whether the tooltip is shown on hover (default is true); otherwise, it is shown when hide is set to false\n */\n hoverable?: boolean;\n }>(),\n {\n openDelay: 100,\n closeDelay: 1000,\n gap: 8,\n offsetToTheEdge: 8,\n position: \"top\",\n element: \"div\",\n maxWidth: \"300px\",\n container: \"body\",\n hoverable: true,\n },\n);\n\nconst data = reactive({\n open: false,\n over: false,\n tooltipOpen: false,\n key: Symbol(),\n});\n\ntMap.set(tKey, () => closeTooltip());\n\n// Hook to avoid the need to immediately teleport into the body (better performance)\nwatch(\n () => data.open,\n (v) => {\n requestAnimationFrame(() => {\n data.tooltipOpen = v;\n });\n },\n);\n\nlet clearTimeout = () => {};\n\nconst showTooltip = () => {\n data.open = true;\n\n for (const [k, f] of tMap.entries()) {\n if (k !== tKey) {\n f();\n }\n }\n};\n\nconst closeTooltip = () => {\n data.open = false;\n emit(\"tooltip:close\");\n};\n\nconst onOver = async () => {\n if (props.hide || !props.hoverable) {\n return;\n }\n\n data.over = true;\n\n clearTimeout();\n\n await utils.delay(props.openDelay ?? 100);\n\n if (data.over) {\n showTooltip();\n }\n};\n\nconst onLeave = () => {\n if (!props.hoverable) {\n return;\n }\n\n data.over = false;\n clearTimeout = utils.timeout(() => {\n if (!data.over) {\n closeTooltip();\n }\n }, props.closeDelay);\n};\n\nwatch(\n () => props.hide,\n (hide) => {\n if (hide) {\n closeTooltip();\n } else if (!props.hoverable) {\n showTooltip();\n }\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst tooltip = ref<HTMLElement | undefined>();\n\nuseClickOutside([rootRef, tooltip], () => closeTooltip());\n\nonUnmounted(() => {\n tMap.delete(tKey);\n});\nconst anchorName = `--anchor-${uniqueId()}`;\n</script>\n\n<template>\n <component\n :class=\"$style.plTooltipAnchorWrapper\"\n :is=\"element\"\n data-testid=\"pl-tooltip\"\n v-bind=\"$attrs\"\n ref=\"rootRef\"\n @click=\"onOver\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- anchor element here -->\n <slot />\n <Transition name=\"pl-tooltip-fade\">\n <Teleport v-if=\"$slots['tooltip'] && data.tooltipOpen\" :to=\"container\">\n <div\n data-testid=\"pl-tooltip-popup\"\n :class=\"[\n $style.plTooltipContainer,\n {\n [$style.top]: props.position === 'top',\n [$style.bottom]: props.position === 'bottom',\n [$style.left]: props.position === 'left',\n [$style.right]: props.position === 'right',\n [$style.topLeft]: props.position === 'top-left',\n },\n ]\"\n :style=\"{\n '--anchorName': anchorName,\n '--gap': gap + 'px',\n '--offsetToTheEdge': offsetToTheEdge + 'px',\n '--plTooltipMaxWidth': maxWidth,\n }\"\n >\n <div :class=\"$style.plTooltipBox\" @click.stop>\n <div\n ref=\"tooltip\"\n data-testid=\"pl-tooltip-content\"\n :class=\"[$style.plTooltipContent, position]\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- should be one line -->\n <div><slot name=\"tooltip\" /></div>\n </div>\n </div>\n <div :class=\"$style.plTooltipBeak\" />\n </div>\n </Teleport>\n </Transition>\n </component>\n</template>\n\n<style module>\n.plTooltipAnchorWrapper {\n display: inline-block;\n}\n/* just to set anchor-name for the anchor */\n.plTooltipAnchorWrapper > :first-child {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipAnchorWrapper:global(.info) {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipContainer {\n --plTooltipMaxWidth: 300px;\n --gap: 8px;\n --tailWidth: 8px;\n --tailHeight: calc(var(--gap) + 2px);\n\n --tailClipTop: polygon(\n 0 0,\n 100% 0,\n 100% calc(100% - var(--gap)),\n 50% calc(100% - 3px),\n 0 calc(100% - var(--gap))\n );\n --tailClipBottom: polygon(0 100%, 100% 100%, 100% var(--gap), 50% 3px, 0 var(--gap));\n --tailClipLeft: polygon(0 0, 0 100%, 2px 100%, calc(100% - 3px) 50%, 2px 0);\n --tailClipRight: polygon(100% 0, 100% 100%, calc(100% - 2px) 100%, 3px 50%, calc(100% - 2px) 0);\n\n z-index: var(--z-tooltip);\n}\n\n.plTooltipContent {\n display: inline-block;\n padding: 8px 12px 9px 12px;\n background: var(--tooltip-bg);\n border-radius: 6px;\n width: max-content;\n word-break: normal;\n max-width: var(--plTooltipMaxWidth);\n color: #fff;\n}\n\n.plTooltipBox {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 1;\n}\n\n.plTooltipBeak {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 0;\n background: var(--tooltip-bg);\n width: var(--tailWidth);\n height: var(--tailHeight);\n}\n\n/* top */\n.plTooltipContainer.top .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.top .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n/* bottom */\n.plTooltipContainer.bottom .plTooltipBox {\n position-area: bottom;\n top: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.bottom .plTooltipBeak {\n position-area: bottom;\n top: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipBottom);\n}\n\n/* left */\n.plTooltipContainer.left .plTooltipBox {\n position-area: left;\n right: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.left .plTooltipBeak {\n position-area: left;\n right: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipLeft);\n}\n\n/* right */\n.plTooltipContainer.right .plTooltipBox {\n position-area: right;\n left: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.right .plTooltipBeak {\n position-area: right;\n left: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipRight);\n}\n\n/* top left */\n.plTooltipContainer.topLeft .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: anchor(var(--anchorName) left);\n}\n.plTooltipContainer.topLeft .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n:global(.pl-tooltip-fade-leave-active),\n:global(.pl-tooltip-fade-enter-active) {\n z-index: var(--z-tooltip);\n transition: opacity 0.2s ease-in-out;\n}\n:global(.pl-tooltip-fade-enter-from),\n:global(.pl-tooltip-fade-leave-to) {\n opacity: 0;\n}\n\n.plTooltipContent a {\n color: var(--tooltip-link-color);\n}\n\n.plTooltipContent p {\n margin-bottom: 8px;\n}\n\n.plTooltipContent ul,\n.plTooltipContent li {\n margin-left: 6px;\n padding-left: 6px;\n}\n\n.plTooltipContent li {\n margin-bottom: 4px;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTooltip.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Simple tooltip on mouseover */\nexport default {\n name: \"PlTooltip\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport { uniqueId } from \"@milaboratories/helpers\";\nimport { onUnmounted, reactive, ref, watch } from \"vue\";\nimport { tMap } from \"./global\";\nimport * as utils from \"../../helpers/utils\";\nimport { useClickOutside } from \"../../composition/useClickOutside\";\n\nconst emit = defineEmits([\"tooltip:close\"]);\n\nconst tKey = Symbol();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * delay in milliseconds before the tooltip opens\n */\n openDelay?: number;\n /**\n * delay in milliseconds before the tooltip disappears\n */\n closeDelay?: number;\n /**\n * Tooltip position\n */\n position?: \"top\" | \"left\" | \"bottom\" | \"right\" | \"top-left\";\n /**\n * external prop to hide tooltips\n */\n hide?: boolean;\n /**\n * The gap in pixels between the tooltip and the target element\n */\n gap?: number;\n\n /**\n * The minimum offset in pixels from the edge of the screen to the tooltip\n */\n offsetToTheEdge?: number;\n /**\n * base html element for tooltip\n */\n element?: \"div\" | \"span\" | \"a\" | \"p\" | \"h1\" | \"h2\" | \"h3\";\n /**\n * Max width (css value) of the tooltip container (default is 300px)\n */\n maxWidth?: string;\n /**\n * The container to insert the tooltip to (body by default)\n */\n container?: \"body\" | HTMLElement;\n /**\n * Whether the tooltip is shown on hover (default is true); otherwise, it is shown when hide is set to false\n */\n hoverable?: boolean;\n }>(),\n {\n openDelay: 100,\n closeDelay: 1000,\n gap: 8,\n offsetToTheEdge: 8,\n position: \"top\",\n element: \"div\",\n maxWidth: \"300px\",\n container: \"body\",\n hoverable: true,\n },\n);\n\nconst data = reactive({\n open: false,\n over: false,\n tooltipOpen: false,\n key: Symbol(),\n});\n\ntMap.set(tKey, () => closeTooltip());\n\n// Hook to avoid the need to immediately teleport into the body (better performance)\nwatch(\n () => data.open,\n (v) => {\n requestAnimationFrame(() => {\n data.tooltipOpen = v;\n });\n },\n);\n\nlet clearTimeout = () => {};\n\nconst showTooltip = () => {\n data.open = true;\n\n for (const [k, f] of tMap.entries()) {\n if (k !== tKey) {\n f();\n }\n }\n};\n\nconst closeTooltip = () => {\n data.open = false;\n emit(\"tooltip:close\");\n};\n\nconst onOver = async () => {\n if (props.hide || !props.hoverable) {\n return;\n }\n\n data.over = true;\n\n clearTimeout();\n\n await utils.delay(props.openDelay ?? 100);\n\n if (data.over) {\n showTooltip();\n }\n};\n\nconst onLeave = () => {\n if (!props.hoverable) {\n return;\n }\n\n data.over = false;\n clearTimeout = utils.timeout(() => {\n if (!data.over) {\n closeTooltip();\n }\n }, props.closeDelay);\n};\n\nwatch(\n () => props.hide,\n (hide) => {\n if (hide) {\n closeTooltip();\n } else if (!props.hoverable) {\n showTooltip();\n }\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst tooltip = ref<HTMLElement | undefined>();\n\nuseClickOutside([rootRef, tooltip], () => closeTooltip());\n\nonUnmounted(() => {\n tMap.delete(tKey);\n});\nconst anchorName = `--anchor-${uniqueId()}`;\n</script>\n\n<template>\n <component\n :class=\"$style.plTooltipAnchorWrapper\"\n :is=\"element\"\n v-bind=\"$attrs\"\n ref=\"rootRef\"\n @click=\"onOver\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- anchor element here -->\n <slot />\n <Transition name=\"pl-tooltip-fade\">\n <Teleport v-if=\"$slots['tooltip'] && data.tooltipOpen\" :to=\"container\">\n <div\n :class=\"[\n $style.plTooltipContainer,\n {\n [$style.top]: props.position === 'top',\n [$style.bottom]: props.position === 'bottom',\n [$style.left]: props.position === 'left',\n [$style.right]: props.position === 'right',\n [$style.topLeft]: props.position === 'top-left',\n },\n ]\"\n :style=\"{\n '--anchorName': anchorName,\n '--gap': gap + 'px',\n '--offsetToTheEdge': offsetToTheEdge + 'px',\n '--plTooltipMaxWidth': maxWidth,\n }\"\n >\n <div :class=\"$style.plTooltipBox\" @click.stop>\n <div\n ref=\"tooltip\"\n :class=\"[$style.plTooltipContent, position]\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- should be one line -->\n <div><slot name=\"tooltip\" /></div>\n </div>\n </div>\n <div :class=\"$style.plTooltipBeak\" />\n </div>\n </Teleport>\n </Transition>\n </component>\n</template>\n\n<style module>\n.plTooltipAnchorWrapper {\n display: inline-block;\n}\n/* just to set anchor-name for the anchor */\n.plTooltipAnchorWrapper > :first-child {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipAnchorWrapper:global(.info) {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipContainer {\n --plTooltipMaxWidth: 300px;\n --gap: 8px;\n --tailWidth: 8px;\n --tailHeight: calc(var(--gap) + 2px);\n\n --tailClipTop: polygon(\n 0 0,\n 100% 0,\n 100% calc(100% - var(--gap)),\n 50% calc(100% - 3px),\n 0 calc(100% - var(--gap))\n );\n --tailClipBottom: polygon(0 100%, 100% 100%, 100% var(--gap), 50% 3px, 0 var(--gap));\n --tailClipLeft: polygon(0 0, 0 100%, 2px 100%, calc(100% - 3px) 50%, 2px 0);\n --tailClipRight: polygon(100% 0, 100% 100%, calc(100% - 2px) 100%, 3px 50%, calc(100% - 2px) 0);\n\n z-index: var(--z-tooltip);\n}\n\n.plTooltipContent {\n display: inline-block;\n padding: 8px 12px 9px 12px;\n background: var(--tooltip-bg);\n border-radius: 6px;\n width: max-content;\n word-break: normal;\n max-width: var(--plTooltipMaxWidth);\n color: #fff;\n}\n\n.plTooltipBox {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 1;\n}\n\n.plTooltipBeak {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 0;\n background: var(--tooltip-bg);\n width: var(--tailWidth);\n height: var(--tailHeight);\n}\n\n/* top */\n.plTooltipContainer.top .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.top .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n/* bottom */\n.plTooltipContainer.bottom .plTooltipBox {\n position-area: bottom;\n top: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.bottom .plTooltipBeak {\n position-area: bottom;\n top: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipBottom);\n}\n\n/* left */\n.plTooltipContainer.left .plTooltipBox {\n position-area: left;\n right: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.left .plTooltipBeak {\n position-area: left;\n right: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipLeft);\n}\n\n/* right */\n.plTooltipContainer.right .plTooltipBox {\n position-area: right;\n left: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.right .plTooltipBeak {\n position-area: right;\n left: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipRight);\n}\n\n/* top left */\n.plTooltipContainer.topLeft .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: anchor(var(--anchorName) left);\n}\n.plTooltipContainer.topLeft .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n:global(.pl-tooltip-fade-leave-active),\n:global(.pl-tooltip-fade-enter-active) {\n z-index: var(--z-tooltip);\n transition: opacity 0.2s ease-in-out;\n}\n:global(.pl-tooltip-fade-enter-from),\n:global(.pl-tooltip-fade-leave-to) {\n opacity: 0;\n}\n\n.plTooltipContent a {\n color: var(--tooltip-link-color);\n}\n\n.plTooltipContent p {\n margin-bottom: 8px;\n}\n\n.plTooltipContent ul,\n.plTooltipContent li {\n margin-left: 6px;\n padding-left: 6px;\n}\n\n.plTooltipContent li {\n margin-bottom: 4px;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlTooltip.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Simple tooltip on mouseover */\nexport default {\n name: \"PlTooltip\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport { uniqueId } from \"@milaboratories/helpers\";\nimport { onUnmounted, reactive, ref, watch } from \"vue\";\nimport { tMap } from \"./global\";\nimport * as utils from \"../../helpers/utils\";\nimport { useClickOutside } from \"../../composition/useClickOutside\";\n\nconst emit = defineEmits([\"tooltip:close\"]);\n\nconst tKey = Symbol();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * delay in milliseconds before the tooltip opens\n */\n openDelay?: number;\n /**\n * delay in milliseconds before the tooltip disappears\n */\n closeDelay?: number;\n /**\n * Tooltip position\n */\n position?: \"top\" | \"left\" | \"bottom\" | \"right\" | \"top-left\";\n /**\n * external prop to hide tooltips\n */\n hide?: boolean;\n /**\n * The gap in pixels between the tooltip and the target element\n */\n gap?: number;\n\n /**\n * The minimum offset in pixels from the edge of the screen to the tooltip\n */\n offsetToTheEdge?: number;\n /**\n * base html element for tooltip\n */\n element?: \"div\" | \"span\" | \"a\" | \"p\" | \"h1\" | \"h2\" | \"h3\";\n /**\n * Max width (css value) of the tooltip container (default is 300px)\n */\n maxWidth?: string;\n /**\n * The container to insert the tooltip to (body by default)\n */\n container?: \"body\" | HTMLElement;\n /**\n * Whether the tooltip is shown on hover (default is true); otherwise, it is shown when hide is set to false\n */\n hoverable?: boolean;\n }>(),\n {\n openDelay: 100,\n closeDelay: 1000,\n gap: 8,\n offsetToTheEdge: 8,\n position: \"top\",\n element: \"div\",\n maxWidth: \"300px\",\n container: \"body\",\n hoverable: true,\n },\n);\n\nconst data = reactive({\n open: false,\n over: false,\n tooltipOpen: false,\n key: Symbol(),\n});\n\ntMap.set(tKey, () => closeTooltip());\n\n// Hook to avoid the need to immediately teleport into the body (better performance)\nwatch(\n () => data.open,\n (v) => {\n requestAnimationFrame(() => {\n data.tooltipOpen = v;\n });\n },\n);\n\nlet clearTimeout = () => {};\n\nconst showTooltip = () => {\n data.open = true;\n\n for (const [k, f] of tMap.entries()) {\n if (k !== tKey) {\n f();\n }\n }\n};\n\nconst closeTooltip = () => {\n data.open = false;\n emit(\"tooltip:close\");\n};\n\nconst onOver = async () => {\n if (props.hide || !props.hoverable) {\n return;\n }\n\n data.over = true;\n\n clearTimeout();\n\n await utils.delay(props.openDelay ?? 100);\n\n if (data.over) {\n showTooltip();\n }\n};\n\nconst onLeave = () => {\n if (!props.hoverable) {\n return;\n }\n\n data.over = false;\n clearTimeout = utils.timeout(() => {\n if (!data.over) {\n closeTooltip();\n }\n }, props.closeDelay);\n};\n\nwatch(\n () => props.hide,\n (hide) => {\n if (hide) {\n closeTooltip();\n } else if (!props.hoverable) {\n showTooltip();\n }\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst tooltip = ref<HTMLElement | undefined>();\n\nuseClickOutside([rootRef, tooltip], () => closeTooltip());\n\nonUnmounted(() => {\n tMap.delete(tKey);\n});\nconst anchorName = `--anchor-${uniqueId()}`;\n</script>\n\n<template>\n <component\n :class=\"$style.plTooltipAnchorWrapper\"\n :is=\"element\"\n data-testid=\"pl-tooltip\"\n v-bind=\"$attrs\"\n ref=\"rootRef\"\n @click=\"onOver\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- anchor element here -->\n <slot />\n <Transition name=\"pl-tooltip-fade\">\n <Teleport v-if=\"$slots['tooltip'] && data.tooltipOpen\" :to=\"container\">\n <div\n data-testid=\"pl-tooltip-popup\"\n :class=\"[\n $style.plTooltipContainer,\n {\n [$style.top]: props.position === 'top',\n [$style.bottom]: props.position === 'bottom',\n [$style.left]: props.position === 'left',\n [$style.right]: props.position === 'right',\n [$style.topLeft]: props.position === 'top-left',\n },\n ]\"\n :style=\"{\n '--anchorName': anchorName,\n '--gap': gap + 'px',\n '--offsetToTheEdge': offsetToTheEdge + 'px',\n '--plTooltipMaxWidth': maxWidth,\n }\"\n >\n <div :class=\"$style.plTooltipBox\" @click.stop>\n <div\n ref=\"tooltip\"\n data-testid=\"pl-tooltip-content\"\n :class=\"[$style.plTooltipContent, position]\"\n @mouseover=\"onOver\"\n @mouseleave=\"onLeave\"\n >\n <!-- should be one line -->\n <div><slot name=\"tooltip\" /></div>\n </div>\n </div>\n <div :class=\"$style.plTooltipBeak\" />\n </div>\n </Teleport>\n </Transition>\n </component>\n</template>\n\n<style module>\n.plTooltipAnchorWrapper {\n display: inline-block;\n}\n/* just to set anchor-name for the anchor */\n.plTooltipAnchorWrapper > :first-child {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipAnchorWrapper:global(.info) {\n --anchorName: v-bind(\"anchorName\");\n anchor-name: var(--anchorName);\n}\n\n.plTooltipContainer {\n --plTooltipMaxWidth: 300px;\n --gap: 8px;\n --tailWidth: 8px;\n --tailHeight: calc(var(--gap) + 2px);\n\n --tailClipTop: polygon(\n 0 0,\n 100% 0,\n 100% calc(100% - var(--gap)),\n 50% calc(100% - 3px),\n 0 calc(100% - var(--gap))\n );\n --tailClipBottom: polygon(0 100%, 100% 100%, 100% var(--gap), 50% 3px, 0 var(--gap));\n --tailClipLeft: polygon(0 0, 0 100%, 2px 100%, calc(100% - 3px) 50%, 2px 0);\n --tailClipRight: polygon(100% 0, 100% 100%, calc(100% - 2px) 100%, 3px 50%, calc(100% - 2px) 0);\n\n z-index: var(--z-tooltip);\n}\n\n.plTooltipContent {\n display: inline-block;\n padding: 8px 12px 9px 12px;\n background: var(--tooltip-bg);\n border-radius: 6px;\n width: max-content;\n word-break: normal;\n max-width: var(--plTooltipMaxWidth);\n color: #fff;\n}\n\n.plTooltipBox {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 1;\n}\n\n.plTooltipBeak {\n position: absolute;\n position-anchor: var(--anchorName);\n z-index: 0;\n background: var(--tooltip-bg);\n width: var(--tailWidth);\n height: var(--tailHeight);\n}\n\n/* top */\n.plTooltipContainer.top .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.top .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n/* bottom */\n.plTooltipContainer.bottom .plTooltipBox {\n position-area: bottom;\n top: var(--gap);\n left: var(--offsetToTheEdge);\n right: var(--offsetToTheEdge);\n}\n.plTooltipContainer.bottom .plTooltipBeak {\n position-area: bottom;\n top: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipBottom);\n}\n\n/* left */\n.plTooltipContainer.left .plTooltipBox {\n position-area: left;\n right: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.left .plTooltipBeak {\n position-area: left;\n right: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipLeft);\n}\n\n/* right */\n.plTooltipContainer.right .plTooltipBox {\n position-area: right;\n left: var(--gap);\n top: var(--offsetToTheEdge);\n bottom: var(--offsetToTheEdge);\n}\n\n.plTooltipContainer.right .plTooltipBeak {\n position-area: right;\n left: 0;\n top: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n width: var(--tailHeight);\n height: var(--tailWidth);\n clip-path: var(--tailClipRight);\n}\n\n/* top left */\n.plTooltipContainer.topLeft .plTooltipBox {\n position-area: top;\n bottom: var(--gap);\n left: anchor(var(--anchorName) left);\n}\n.plTooltipContainer.topLeft .plTooltipBeak {\n position-area: top;\n bottom: 0;\n left: calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);\n clip-path: var(--tailClipTop);\n}\n\n:global(.pl-tooltip-fade-leave-active),\n:global(.pl-tooltip-fade-enter-active) {\n z-index: var(--z-tooltip);\n transition: opacity 0.2s ease-in-out;\n}\n:global(.pl-tooltip-fade-enter-from),\n:global(.pl-tooltip-fade-leave-to) {\n opacity: 0;\n}\n\n.plTooltipContent a {\n color: var(--tooltip-link-color);\n}\n\n.plTooltipContent p {\n margin-bottom: 8px;\n}\n\n.plTooltipContent ul,\n.plTooltipContent li {\n margin-left: 6px;\n padding-left: 6px;\n}\n\n.plTooltipContent li {\n margin-bottom: 4px;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._plTooltipAnchorWrapper_ttgyk_2{display:inline-block}._plTooltipAnchorWrapper_ttgyk_2>:first-child,._plTooltipAnchorWrapper_ttgyk_2.info{--anchorName:var(--
|
|
1
|
+
._plTooltipAnchorWrapper_ttgyk_2{display:inline-block}._plTooltipAnchorWrapper_ttgyk_2>:first-child,._plTooltipAnchorWrapper_ttgyk_2.info{--anchorName:var(--v65bd5cda);anchor-name:var(--anchorName)}._plTooltipContainer_ttgyk_16{--plTooltipMaxWidth:300px;--gap:8px;--tailWidth:8px;--tailHeight:calc(var(--gap) + 2px);--tailClipTop:polygon(0 0, 100% 0, 100% calc(100% - var(--gap)), 50% calc(100% - 3px), 0 calc(100% - var(--gap)));--tailClipBottom:polygon(0 100%, 100% 100%, 100% var(--gap), 50% 3px, 0 var(--gap));--tailClipLeft:polygon(0 0, 0 100%, 2px 100%, calc(100% - 3px) 50%, 2px 0);--tailClipRight:polygon(100% 0, 100% 100%, calc(100% - 2px) 100%, 3px 50%, calc(100% - 2px) 0);z-index:var(--z-tooltip)}._plTooltipContent_ttgyk_36{background:var(--tooltip-bg);word-break:normal;width:max-content;max-width:var(--plTooltipMaxWidth);color:#fff;border-radius:6px;padding:8px 12px 9px;display:inline-block}._plTooltipBox_ttgyk_47{position-anchor:var(--anchorName);z-index:1;position:absolute}._plTooltipBeak_ttgyk_53{position-anchor:var(--anchorName);z-index:0;background:var(--tooltip-bg);width:var(--tailWidth);height:var(--tailHeight);position:absolute}._plTooltipContainer_ttgyk_16._top_ttgyk_63 ._plTooltipBox_ttgyk_47{position-area:top;bottom:var(--gap);left:var(--offsetToTheEdge);right:var(--offsetToTheEdge)}._plTooltipContainer_ttgyk_16._top_ttgyk_63 ._plTooltipBeak_ttgyk_53{position-area:top;bottom:0;left:calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);clip-path:var(--tailClipTop)}._plTooltipContainer_ttgyk_16._bottom_ttgyk_77 ._plTooltipBox_ttgyk_47{position-area:bottom;top:var(--gap);left:var(--offsetToTheEdge);right:var(--offsetToTheEdge)}._plTooltipContainer_ttgyk_16._bottom_ttgyk_77 ._plTooltipBeak_ttgyk_53{position-area:bottom;top:0;left:calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);clip-path:var(--tailClipBottom)}._plTooltipContainer_ttgyk_16._left_ttgyk_91 ._plTooltipBox_ttgyk_47{position-area:left;right:var(--gap);top:var(--offsetToTheEdge);bottom:var(--offsetToTheEdge)}._plTooltipContainer_ttgyk_16._left_ttgyk_91 ._plTooltipBeak_ttgyk_53{position-area:left;right:0;top:calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);width:var(--tailHeight);height:var(--tailWidth);clip-path:var(--tailClipLeft)}._plTooltipContainer_ttgyk_16._right_ttgyk_108 ._plTooltipBox_ttgyk_47{position-area:right;left:var(--gap);top:var(--offsetToTheEdge);bottom:var(--offsetToTheEdge)}._plTooltipContainer_ttgyk_16._right_ttgyk_108 ._plTooltipBeak_ttgyk_53{position-area:right;left:0;top:calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);width:var(--tailHeight);height:var(--tailWidth);clip-path:var(--tailClipRight)}._plTooltipContainer_ttgyk_16._topLeft_ttgyk_125 ._plTooltipBox_ttgyk_47{position-area:top;bottom:var(--gap);left:anchor(var(--anchorName) left)}._plTooltipContainer_ttgyk_16._topLeft_ttgyk_125 ._plTooltipBeak_ttgyk_53{position-area:top;bottom:0;left:calc(anchor(var(--anchorName) center) - var(--tailWidth) / 2);clip-path:var(--tailClipTop)}.pl-tooltip-fade-leave-active,.pl-tooltip-fade-enter-active{z-index:var(--z-tooltip);transition:opacity .2s ease-in-out}.pl-tooltip-fade-enter-from,.pl-tooltip-fade-leave-to{opacity:0}._plTooltipContent_ttgyk_36 a{color:var(--tooltip-link-color)}._plTooltipContent_ttgyk_36 p{margin-bottom:8px}._plTooltipContent_ttgyk_36 ul,._plTooltipContent_ttgyk_36 li{margin-left:6px;padding-left:6px}._plTooltipContent_ttgyk_36 li{margin-bottom:4px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTooltip.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlTooltip.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"names":[],"mappings":"AAqYA,kCAAkC;wBACb,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAMd;;OAEG;gBACS,MAAM;IAClB;;OAEG;iBACU,MAAM;IACnB;;OAEG;eACQ,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU;IAC3D;;OAEG;WACI,OAAO;IACd;;OAEG;UACG,MAAM;IAEZ;;OAEG;sBACe,MAAM;IACxB;;OAEG;cACO,KAAK,GAAG,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;IACzD;;OAEG;eACQ,MAAM;IACjB;;OAEG;gBACS,MAAM,GAAG,WAAW;IAChC;;OAEG;gBACS,OAAO;;;;IAxCnB;;OAEG;gBACS,MAAM;IAClB;;OAEG;iBACU,MAAM;IACnB;;OAEG;eACQ,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU;IAC3D;;OAEG;WACI,OAAO;IACd;;OAEG;UACG,MAAM;IAEZ;;OAEG;sBACe,MAAM;IACxB;;OAEG;cACO,KAAK,GAAG,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;IACzD;;OAEG;eACQ,MAAM;IACjB;;OAEG;gBACS,MAAM,GAAG,WAAW;IAChC;;OAEG;gBACS,OAAO;;;;SArBb,MAAM;eAiBA,MAAM,GAAG,WAAW;eAjCpB,MAAM;gBAIL,MAAM;cAIR,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU;qBAazC,MAAM;aAId,KAAK,GAAG,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;cAI9C,MAAM;eAQL,OAAO;;cA6ST,CAAC,KAAK,IAAiB,KAAK,GAAG;;cAC/B,CAAC,KAAK,IAAiB,KAAK,GAAG;EAczC,CAAC;AAWL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -22,7 +22,7 @@ var T = /* @__PURE__ */ u({
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["tooltip:close"],
|
|
24
24
|
setup(u, { emit: T }) {
|
|
25
|
-
b((e) => ({
|
|
25
|
+
b((e) => ({ v65bd5cda: L }));
|
|
26
26
|
let E = T, D = Symbol(), O = u, k = g({
|
|
27
27
|
open: !1,
|
|
28
28
|
over: !1,
|
|
@@ -54,7 +54,10 @@ var T = /* @__PURE__ */ u({
|
|
|
54
54
|
e.delete(D);
|
|
55
55
|
});
|
|
56
56
|
let L = `--anchor-${w()}`;
|
|
57
|
-
return (e, t) => (h(), o(y(u.element), d({
|
|
57
|
+
return (e, t) => (h(), o(y(u.element), d({
|
|
58
|
+
class: e.$style.plTooltipAnchorWrapper,
|
|
59
|
+
"data-testid": "pl-tooltip"
|
|
60
|
+
}, e.$attrs, {
|
|
58
61
|
ref_key: "rootRef",
|
|
59
62
|
ref: F,
|
|
60
63
|
onClick: N,
|
|
@@ -66,6 +69,7 @@ var T = /* @__PURE__ */ u({
|
|
|
66
69
|
key: 0,
|
|
67
70
|
to: u.container
|
|
68
71
|
}, [c("div", {
|
|
72
|
+
"data-testid": "pl-tooltip-popup",
|
|
69
73
|
class: f([e.$style.plTooltipContainer, {
|
|
70
74
|
[e.$style.top]: O.position === "top",
|
|
71
75
|
[e.$style.bottom]: O.position === "bottom",
|
|
@@ -85,6 +89,7 @@ var T = /* @__PURE__ */ u({
|
|
|
85
89
|
}, [c("div", {
|
|
86
90
|
ref_key: "tooltip",
|
|
87
91
|
ref: I,
|
|
92
|
+
"data-testid": "pl-tooltip-content",
|
|
88
93
|
class: f([e.$style.plTooltipContent, u.position]),
|
|
89
94
|
onMouseover: N,
|
|
90
95
|
onMouseleave: P
|