@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":"PlNumberField.js","names":[],"sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Number input field with increment/decrement buttons, validation, and min/max constraints.\n *\n * @example\n * <PlNumberField v-model=\"price\" :step=\"0.01\" :min-value=\"0\" label=\"Price\" />\n *\n * @example\n * <PlNumberField\n * v-model=\"evenNumber\"\n * :validate=\"(v) => v % 2 !== 0 ? 'Number must be even' : undefined\"\n * label=\"Even Number\"\n * />\n */\nexport default {\n name: \"PlNumberField\",\n};\n</script>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n R extends true | false,\n V extends undefined | number,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport \"./pl-number-field.scss\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { computed, ref, useSlots, watch } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { tryParseNumber, numberToDecimalString, validateNumber } from \"./parseNumber\";\n\nconst modelValue = defineModel<V>({ required: true });\n\nconst emit = defineEmits<{\n blur: [value: V];\n focus: [value: V];\n enter: [value: V];\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /** If `true`, the field is required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** Label on the top border of the field, empty by default */\n label?: string;\n /** Input placeholder, empty by default */\n placeholder?: string;\n /** Step for increment/decrement buttons, 1 by default */\n step?: number;\n /** If defined - show an error if value is lower */\n minValue?: number;\n /** If defined - show an error if value is higher */\n maxValue?: number;\n /** Input is disabled if true */\n disabled?: boolean;\n /** If true - remove buttons on the right */\n disableSteps?: boolean;\n /** Error message that shows always when it's provided, without other checks */\n errorMessage?: string;\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: number) => string | undefined;\n /** If `true`, shows a clear button that resets value to `undefined`. If a function, calls it to get the reset value. */\n clearable?: BooleanPropUnless<R> | (() => C);\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 { step: 1 },\n);\n\nconst slots = useSlots();\n\nconst rootRef = ref<HTMLElement>();\n\nuseLabelNotch(rootRef);\n\nconst displayText = ref(numberToDecimalString(modelValue.value));\n\n// Sync display when model changes externally (parent, increment/decrement).\n// Skip if the current input already represents the same value.\nwatch(modelValue, (newVal) => {\n const parsed = tryParseNumber(displayText.value);\n if (parsed.value === newVal) return;\n displayText.value = numberToDecimalString(newVal);\n});\n\nfunction handleInput(event: Event) {\n const input = event.target as HTMLInputElement;\n displayText.value = input.value;\n\n const result = tryParseNumber(input.value);\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n }\n}\n\n// On Enter or blur: if parseable, replace display with canonical decimal string.\n// Converts exponential (1e-5) to plain form (0.00001).\nfunction commitValue() {\n const text = displayText.value.trim();\n const result = tryParseNumber(text);\n\n // Empty or partial (-, ., -.) → clear display and reset model for non-required fields\n if (text === \"\" || (result.value === undefined && result.error === undefined)) {\n displayText.value = \"\";\n if (!props.required) {\n modelValue.value = undefined as V;\n }\n return;\n }\n\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n displayText.value = numberToDecimalString(result.value);\n }\n}\n\nconst error = computed(() => {\n if (props.errorMessage) return props.errorMessage;\n\n const result = tryParseNumber(displayText.value);\n if (result.error) return result.error;\n if (result.value !== undefined) {\n return validateNumber(result.value, props);\n }\n\n if (props.required && displayText.value.trim() === \"\") {\n return \"Value is required\";\n }\n\n return undefined;\n});\n\nconst canShowClearable = computed(\n () =>\n props.clearable &&\n (modelValue.value !== undefined || displayText.value.trim() !== \"\") &&\n !props.disabled,\n);\n\nfunction clear() {\n if (typeof props.clearable === \"function\") {\n modelValue.value = props.clearable();\n displayText.value = numberToDecimalString(modelValue.value);\n } else {\n modelValue.value = undefined as V;\n displayText.value = \"\";\n }\n}\n\nconst isIncrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.maxValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value >= props.maxValue\n );\n});\n\nconst isDecrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.minValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value <= props.minValue\n );\n});\n\nconst multiplier = computed(() => 10 ** (props.step.toString().split(\".\").at(1)?.length ?? 0));\n\nfunction increment() {\n if (isIncrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = props.minValue ?? 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value + props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.maxValue !== undefined ? Math.min(props.maxValue, nV) : nV) as V;\n}\n\nfunction decrement() {\n if (isDecrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value - props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.minValue !== undefined ? Math.max(props.minValue, nV) : nV) as V;\n}\n\nfunction handleBlur() {\n commitValue();\n emit(\"blur\", modelValue.value);\n}\n\nfunction handleFocus() {\n emit(\"focus\", modelValue.value);\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n if (e.code === \"Enter\") {\n commitValue();\n emit(\"enter\", modelValue.value);\n }\n\n if ([\"ArrowDown\", \"ArrowUp\"].includes(e.code)) {\n e.preventDefault();\n }\n\n if (!props.disableSteps && e.code === \"ArrowUp\") {\n increment();\n }\n\n if (!props.disableSteps && e.code === \"ArrowDown\") {\n decrement();\n }\n}\n\n// Prevent selecting beyond input content on triple-click etc.\nfunction handleMousedown(ev: MouseEvent) {\n if (ev.detail > 1) {\n ev.preventDefault();\n }\n}\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n :class=\"{ error: !!error, disabled: disabled }\"\n class=\"pl-number-field d-flex-column\"\n @keydown=\"handleKeyDown\"\n >\n <div class=\"pl-number-field__main-wrapper d-flex\">\n <DoubleContour class=\"pl-number-field__contour\" :group-position=\"groupPosition\" />\n <div class=\"pl-number-field__wrapper flex-grow d-flex flex-align-center\">\n <label v-if=\"label\" class=\"text-description\">\n {{ label }}\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <input\n ref=\"inputRef\"\n type=\"text\"\n inputmode=\"numeric\"\n :value=\"displayText\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n class=\"text-s flex-grow\"\n @input=\"handleInput\"\n @focusout=\"handleBlur\"\n @focusin=\"handleFocus\"\n />\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-number-field__clearable\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n </div>\n <div\n v-if=\"!props.disableSteps\"\n class=\"pl-number-field__icons d-flex-column\"\n @mousedown=\"handleMousedown\"\n >\n <div\n :class=\"{ disabled: isIncrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"increment\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n <div\n :class=\"{ disabled: isDecrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"decrement\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div v-if=\"error\" class=\"pl-number-field__error\">\n {{ error }}\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlNumberField.js","names":[],"sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Number input field with increment/decrement buttons, validation, and min/max constraints.\n *\n * @example\n * <PlNumberField v-model=\"price\" :step=\"0.01\" :min-value=\"0\" label=\"Price\" />\n *\n * @example\n * <PlNumberField\n * v-model=\"evenNumber\"\n * :validate=\"(v) => v % 2 !== 0 ? 'Number must be even' : undefined\"\n * label=\"Even Number\"\n * />\n */\nexport default {\n name: \"PlNumberField\",\n};\n</script>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n R extends true | false,\n V extends undefined | number,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport \"./pl-number-field.scss\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { computed, ref, useSlots, watch } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { tryParseNumber, numberToDecimalString, validateNumber } from \"./parseNumber\";\n\nconst modelValue = defineModel<V>({ required: true });\n\nconst emit = defineEmits<{\n blur: [value: V];\n focus: [value: V];\n enter: [value: V];\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /** If `true`, the field is required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** Label on the top border of the field, empty by default */\n label?: string;\n /** Input placeholder, empty by default */\n placeholder?: string;\n /** Step for increment/decrement buttons, 1 by default */\n step?: number;\n /** If defined - show an error if value is lower */\n minValue?: number;\n /** If defined - show an error if value is higher */\n maxValue?: number;\n /** Input is disabled if true */\n disabled?: boolean;\n /** If true - remove buttons on the right */\n disableSteps?: boolean;\n /** Error message that shows always when it's provided, without other checks */\n errorMessage?: string;\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: number) => string | undefined;\n /** If `true`, shows a clear button that resets value to `undefined`. If a function, calls it to get the reset value. */\n clearable?: BooleanPropUnless<R> | (() => C);\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 { step: 1 },\n);\n\nconst slots = useSlots();\n\nconst rootRef = ref<HTMLElement>();\n\nuseLabelNotch(rootRef);\n\nconst displayText = ref(numberToDecimalString(modelValue.value));\n\n// Sync display when model changes externally (parent, increment/decrement).\n// Skip if the current input already represents the same value.\nwatch(modelValue, (newVal) => {\n const parsed = tryParseNumber(displayText.value);\n if (parsed.value === newVal) return;\n displayText.value = numberToDecimalString(newVal);\n});\n\nfunction handleInput(event: Event) {\n const input = event.target as HTMLInputElement;\n displayText.value = input.value;\n\n const result = tryParseNumber(input.value);\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n }\n}\n\n// On Enter or blur: if parseable, replace display with canonical decimal string.\n// Converts exponential (1e-5) to plain form (0.00001).\nfunction commitValue() {\n const text = displayText.value.trim();\n const result = tryParseNumber(text);\n\n // Empty or partial (-, ., -.) → clear display and reset model for non-required fields\n if (text === \"\" || (result.value === undefined && result.error === undefined)) {\n displayText.value = \"\";\n if (!props.required) {\n modelValue.value = undefined as V;\n }\n return;\n }\n\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n displayText.value = numberToDecimalString(result.value);\n }\n}\n\nconst error = computed(() => {\n if (props.errorMessage) return props.errorMessage;\n\n const result = tryParseNumber(displayText.value);\n if (result.error) return result.error;\n if (result.value !== undefined) {\n return validateNumber(result.value, props);\n }\n\n if (props.required && displayText.value.trim() === \"\") {\n return \"Value is required\";\n }\n\n return undefined;\n});\n\nconst canShowClearable = computed(\n () =>\n props.clearable &&\n (modelValue.value !== undefined || displayText.value.trim() !== \"\") &&\n !props.disabled,\n);\n\nfunction clear() {\n if (typeof props.clearable === \"function\") {\n modelValue.value = props.clearable();\n displayText.value = numberToDecimalString(modelValue.value);\n } else {\n modelValue.value = undefined as V;\n displayText.value = \"\";\n }\n}\n\nconst isIncrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.maxValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value >= props.maxValue\n );\n});\n\nconst isDecrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.minValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value <= props.minValue\n );\n});\n\nconst multiplier = computed(() => 10 ** (props.step.toString().split(\".\").at(1)?.length ?? 0));\n\nfunction increment() {\n if (isIncrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = props.minValue ?? 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value + props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.maxValue !== undefined ? Math.min(props.maxValue, nV) : nV) as V;\n}\n\nfunction decrement() {\n if (isDecrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value - props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.minValue !== undefined ? Math.max(props.minValue, nV) : nV) as V;\n}\n\nfunction handleBlur() {\n commitValue();\n emit(\"blur\", modelValue.value);\n}\n\nfunction handleFocus() {\n emit(\"focus\", modelValue.value);\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n if (e.code === \"Enter\") {\n commitValue();\n emit(\"enter\", modelValue.value);\n }\n\n if ([\"ArrowDown\", \"ArrowUp\"].includes(e.code)) {\n e.preventDefault();\n }\n\n if (!props.disableSteps && e.code === \"ArrowUp\") {\n increment();\n }\n\n if (!props.disableSteps && e.code === \"ArrowDown\") {\n decrement();\n }\n}\n\n// Prevent selecting beyond input content on triple-click etc.\nfunction handleMousedown(ev: MouseEvent) {\n if (ev.detail > 1) {\n ev.preventDefault();\n }\n}\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n :class=\"{ error: !!error, disabled: disabled }\"\n class=\"pl-number-field d-flex-column\"\n data-testid=\"pl-number-field\"\n @keydown=\"handleKeyDown\"\n >\n <div class=\"pl-number-field__main-wrapper d-flex\">\n <DoubleContour class=\"pl-number-field__contour\" :group-position=\"groupPosition\" />\n <div class=\"pl-number-field__wrapper flex-grow d-flex flex-align-center\">\n <label v-if=\"label\" class=\"text-description\" data-testid=\"pl-number-field-label\">\n {{ label }}\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-number-field-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <input\n ref=\"inputRef\"\n type=\"text\"\n inputmode=\"numeric\"\n :value=\"displayText\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n class=\"text-s flex-grow\"\n data-testid=\"pl-number-field-input\"\n @input=\"handleInput\"\n @focusout=\"handleBlur\"\n @focusin=\"handleFocus\"\n />\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-number-field__clearable\"\n data-testid=\"pl-number-field-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n </div>\n <div\n v-if=\"!props.disableSteps\"\n class=\"pl-number-field__icons d-flex-column\"\n data-testid=\"pl-number-field-steps\"\n @mousedown=\"handleMousedown\"\n >\n <div\n :class=\"{ disabled: isIncrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n data-testid=\"pl-number-field-increment\"\n @click=\"increment\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n <div\n :class=\"{ disabled: isDecrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n data-testid=\"pl-number-field-decrement\"\n @click=\"decrement\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div v-if=\"error\" class=\"pl-number-field__error\" data-testid=\"pl-number-field-error\">\n {{ error }}\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlNumberField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlNumberField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"names":[],"mappings":"AAiWA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,aAAa,GACb,cAAc,GACd,QAAQ;;oBA8KJ,CAAC;;;;;;KAwO8E,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;;kBAXG,CAAC,KAAK,IAAiB,KAAK,GAAG;;UAatC,gKAAoC;EAEvC,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"}
|
|
@@ -10,14 +10,16 @@ import { computed as s, createBlock as c, createCommentVNode as l, createElement
|
|
|
10
10
|
//#region src/components/PlNumberField/PlNumberField.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-number-field__wrapper flex-grow d-flex flex-align-center" }, k = {
|
|
12
12
|
key: 0,
|
|
13
|
-
class: "text-description"
|
|
13
|
+
class: "text-description",
|
|
14
|
+
"data-testid": "pl-number-field-label"
|
|
14
15
|
}, A = [
|
|
15
16
|
"value",
|
|
16
17
|
"disabled",
|
|
17
18
|
"placeholder"
|
|
18
19
|
], j = {
|
|
19
20
|
key: 0,
|
|
20
|
-
class: "pl-number-field__error"
|
|
21
|
+
class: "pl-number-field__error",
|
|
22
|
+
"data-testid": "pl-number-field-error"
|
|
21
23
|
}, M = /* @__PURE__ */ m({
|
|
22
24
|
name: "PlNumberField",
|
|
23
25
|
props: /* @__PURE__ */ h({
|
|
@@ -103,6 +105,7 @@ var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-numb
|
|
|
103
105
|
error: !!B.value,
|
|
104
106
|
disabled: m.disabled
|
|
105
107
|
}, "pl-number-field d-flex-column"]),
|
|
108
|
+
"data-testid": "pl-number-field",
|
|
106
109
|
onKeydown: X
|
|
107
110
|
}, [d("div", D, [
|
|
108
111
|
p(n, {
|
|
@@ -113,7 +116,8 @@ var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-numb
|
|
|
113
116
|
m.label ? (_(), u("label", k, [f(b(m.label) + " ", 1), x(F).tooltip ? (_(), c(x(e), {
|
|
114
117
|
key: 0,
|
|
115
118
|
class: "info",
|
|
116
|
-
position: "top"
|
|
119
|
+
position: "top",
|
|
120
|
+
"data-testid": "pl-number-field-tooltip"
|
|
117
121
|
}, {
|
|
118
122
|
tooltip: T(() => [y(r.$slots, "tooltip")]),
|
|
119
123
|
_: 3
|
|
@@ -126,6 +130,7 @@ var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-numb
|
|
|
126
130
|
disabled: m.disabled,
|
|
127
131
|
placeholder: m.placeholder,
|
|
128
132
|
class: "text-s flex-grow",
|
|
133
|
+
"data-testid": "pl-number-field-input",
|
|
129
134
|
onInput: R,
|
|
130
135
|
onFocusout: J,
|
|
131
136
|
onFocusin: Y
|
|
@@ -133,6 +138,7 @@ var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-numb
|
|
|
133
138
|
V.value ? (_(), c(x(t), {
|
|
134
139
|
key: 1,
|
|
135
140
|
class: "pl-number-field__clearable",
|
|
141
|
+
"data-testid": "pl-number-field-clear",
|
|
136
142
|
name: "delete-clear",
|
|
137
143
|
onClick: E(H, ["stop"])
|
|
138
144
|
})) : l("", !0)
|
|
@@ -140,9 +146,11 @@ var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-numb
|
|
|
140
146
|
P.disableSteps ? l("", !0) : (_(), u("div", {
|
|
141
147
|
key: 0,
|
|
142
148
|
class: "pl-number-field__icons d-flex-column",
|
|
149
|
+
"data-testid": "pl-number-field-steps",
|
|
143
150
|
onMousedown: Z
|
|
144
151
|
}, [d("div", {
|
|
145
152
|
class: g([{ disabled: U.value }, "pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),
|
|
153
|
+
"data-testid": "pl-number-field-increment",
|
|
146
154
|
onClick: K
|
|
147
155
|
}, [...i[0] ||= [d("svg", {
|
|
148
156
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -157,6 +165,7 @@ var D = { class: "pl-number-field__main-wrapper d-flex" }, O = { class: "pl-numb
|
|
|
157
165
|
fill: "#110529"
|
|
158
166
|
})], -1)]], 2), d("div", {
|
|
159
167
|
class: g([{ disabled: W.value }, "pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),
|
|
168
|
+
"data-testid": "pl-number-field-decrement",
|
|
160
169
|
onClick: q
|
|
161
170
|
}, [...i[1] ||= [d("svg", {
|
|
162
171
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlNumberField.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Number input field with increment/decrement buttons, validation, and min/max constraints.\n *\n * @example\n * <PlNumberField v-model=\"price\" :step=\"0.01\" :min-value=\"0\" label=\"Price\" />\n *\n * @example\n * <PlNumberField\n * v-model=\"evenNumber\"\n * :validate=\"(v) => v % 2 !== 0 ? 'Number must be even' : undefined\"\n * label=\"Even Number\"\n * />\n */\nexport default {\n name: \"PlNumberField\",\n};\n</script>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n R extends true | false,\n V extends undefined | number,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport \"./pl-number-field.scss\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { computed, ref, useSlots, watch } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { tryParseNumber, numberToDecimalString, validateNumber } from \"./parseNumber\";\n\nconst modelValue = defineModel<V>({ required: true });\n\nconst emit = defineEmits<{\n blur: [value: V];\n focus: [value: V];\n enter: [value: V];\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /** If `true`, the field is required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** Label on the top border of the field, empty by default */\n label?: string;\n /** Input placeholder, empty by default */\n placeholder?: string;\n /** Step for increment/decrement buttons, 1 by default */\n step?: number;\n /** If defined - show an error if value is lower */\n minValue?: number;\n /** If defined - show an error if value is higher */\n maxValue?: number;\n /** Input is disabled if true */\n disabled?: boolean;\n /** If true - remove buttons on the right */\n disableSteps?: boolean;\n /** Error message that shows always when it's provided, without other checks */\n errorMessage?: string;\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: number) => string | undefined;\n /** If `true`, shows a clear button that resets value to `undefined`. If a function, calls it to get the reset value. */\n clearable?: BooleanPropUnless<R> | (() => C);\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 { step: 1 },\n);\n\nconst slots = useSlots();\n\nconst rootRef = ref<HTMLElement>();\n\nuseLabelNotch(rootRef);\n\nconst displayText = ref(numberToDecimalString(modelValue.value));\n\n// Sync display when model changes externally (parent, increment/decrement).\n// Skip if the current input already represents the same value.\nwatch(modelValue, (newVal) => {\n const parsed = tryParseNumber(displayText.value);\n if (parsed.value === newVal) return;\n displayText.value = numberToDecimalString(newVal);\n});\n\nfunction handleInput(event: Event) {\n const input = event.target as HTMLInputElement;\n displayText.value = input.value;\n\n const result = tryParseNumber(input.value);\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n }\n}\n\n// On Enter or blur: if parseable, replace display with canonical decimal string.\n// Converts exponential (1e-5) to plain form (0.00001).\nfunction commitValue() {\n const text = displayText.value.trim();\n const result = tryParseNumber(text);\n\n // Empty or partial (-, ., -.) → clear display and reset model for non-required fields\n if (text === \"\" || (result.value === undefined && result.error === undefined)) {\n displayText.value = \"\";\n if (!props.required) {\n modelValue.value = undefined as V;\n }\n return;\n }\n\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n displayText.value = numberToDecimalString(result.value);\n }\n}\n\nconst error = computed(() => {\n if (props.errorMessage) return props.errorMessage;\n\n const result = tryParseNumber(displayText.value);\n if (result.error) return result.error;\n if (result.value !== undefined) {\n return validateNumber(result.value, props);\n }\n\n if (props.required && displayText.value.trim() === \"\") {\n return \"Value is required\";\n }\n\n return undefined;\n});\n\nconst canShowClearable = computed(\n () =>\n props.clearable &&\n (modelValue.value !== undefined || displayText.value.trim() !== \"\") &&\n !props.disabled,\n);\n\nfunction clear() {\n if (typeof props.clearable === \"function\") {\n modelValue.value = props.clearable();\n displayText.value = numberToDecimalString(modelValue.value);\n } else {\n modelValue.value = undefined as V;\n displayText.value = \"\";\n }\n}\n\nconst isIncrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.maxValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value >= props.maxValue\n );\n});\n\nconst isDecrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.minValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value <= props.minValue\n );\n});\n\nconst multiplier = computed(() => 10 ** (props.step.toString().split(\".\").at(1)?.length ?? 0));\n\nfunction increment() {\n if (isIncrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = props.minValue ?? 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value + props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.maxValue !== undefined ? Math.min(props.maxValue, nV) : nV) as V;\n}\n\nfunction decrement() {\n if (isDecrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value - props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.minValue !== undefined ? Math.max(props.minValue, nV) : nV) as V;\n}\n\nfunction handleBlur() {\n commitValue();\n emit(\"blur\", modelValue.value);\n}\n\nfunction handleFocus() {\n emit(\"focus\", modelValue.value);\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n if (e.code === \"Enter\") {\n commitValue();\n emit(\"enter\", modelValue.value);\n }\n\n if ([\"ArrowDown\", \"ArrowUp\"].includes(e.code)) {\n e.preventDefault();\n }\n\n if (!props.disableSteps && e.code === \"ArrowUp\") {\n increment();\n }\n\n if (!props.disableSteps && e.code === \"ArrowDown\") {\n decrement();\n }\n}\n\n// Prevent selecting beyond input content on triple-click etc.\nfunction handleMousedown(ev: MouseEvent) {\n if (ev.detail > 1) {\n ev.preventDefault();\n }\n}\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n :class=\"{ error: !!error, disabled: disabled }\"\n class=\"pl-number-field d-flex-column\"\n @keydown=\"handleKeyDown\"\n >\n <div class=\"pl-number-field__main-wrapper d-flex\">\n <DoubleContour class=\"pl-number-field__contour\" :group-position=\"groupPosition\" />\n <div class=\"pl-number-field__wrapper flex-grow d-flex flex-align-center\">\n <label v-if=\"label\" class=\"text-description\">\n {{ label }}\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <input\n ref=\"inputRef\"\n type=\"text\"\n inputmode=\"numeric\"\n :value=\"displayText\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n class=\"text-s flex-grow\"\n @input=\"handleInput\"\n @focusout=\"handleBlur\"\n @focusin=\"handleFocus\"\n />\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-number-field__clearable\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n </div>\n <div\n v-if=\"!props.disableSteps\"\n class=\"pl-number-field__icons d-flex-column\"\n @mousedown=\"handleMousedown\"\n >\n <div\n :class=\"{ disabled: isIncrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"increment\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n <div\n :class=\"{ disabled: isDecrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n @click=\"decrement\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div v-if=\"error\" class=\"pl-number-field__error\">\n {{ error }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;CAeE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EAsBR,IAAM,IAAa,EAAc,GAAA,aAAoB,EAE/C,IAAO,GAMP,IAAQ,GAuCR,IAAQ,GAAU,EAElB,IAAU,GAAkB;AAElC,IAAc,EAAQ;EAEtB,IAAM,IAAc,EAAI,EAAsB,EAAW,MAAM,CA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P,SAAQ;IACR,MAAK;OAEL,EAKE,QAAA;IAJA,aAAU;IACV,aAAU;IACV,GAAE;IACF,MAAK;;MAMJ,EAAA,SAAA,GAAA,EAAX,EAEM,OAFN,GAEM,EADD,EAAA,MAAK,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,EAAA,GAAA"}
|
|
1
|
+
{"version":3,"file":"PlNumberField.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlNumberField/PlNumberField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Number input field with increment/decrement buttons, validation, and min/max constraints.\n *\n * @example\n * <PlNumberField v-model=\"price\" :step=\"0.01\" :min-value=\"0\" label=\"Price\" />\n *\n * @example\n * <PlNumberField\n * v-model=\"evenNumber\"\n * :validate=\"(v) => v % 2 !== 0 ? 'Number must be even' : undefined\"\n * label=\"Even Number\"\n * />\n */\nexport default {\n name: \"PlNumberField\",\n};\n</script>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n R extends true | false,\n V extends undefined | number,\n C extends Exclude<V, [R] extends [true] ? undefined : never>\n \"\n>\nimport \"./pl-number-field.scss\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport type { BooleanProp, BooleanPropUnless } from \"../../utils/booleanProps\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport { computed, ref, useSlots, watch } from \"vue\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { tryParseNumber, numberToDecimalString, validateNumber } from \"./parseNumber\";\n\nconst modelValue = defineModel<V>({ required: true });\n\nconst emit = defineEmits<{\n blur: [value: V];\n focus: [value: V];\n enter: [value: V];\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /** If `true`, the field is required and will show an error if left empty. */\n required?: BooleanProp<R>;\n /** Label on the top border of the field, empty by default */\n label?: string;\n /** Input placeholder, empty by default */\n placeholder?: string;\n /** Step for increment/decrement buttons, 1 by default */\n step?: number;\n /** If defined - show an error if value is lower */\n minValue?: number;\n /** If defined - show an error if value is higher */\n maxValue?: number;\n /** Input is disabled if true */\n disabled?: boolean;\n /** If true - remove buttons on the right */\n disableSteps?: boolean;\n /** Error message that shows always when it's provided, without other checks */\n errorMessage?: string;\n /** Additional validity check for input value that must return an error text if failed */\n validate?: (v: number) => string | undefined;\n /** If `true`, shows a clear button that resets value to `undefined`. If a function, calls it to get the reset value. */\n clearable?: BooleanPropUnless<R> | (() => C);\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 { step: 1 },\n);\n\nconst slots = useSlots();\n\nconst rootRef = ref<HTMLElement>();\n\nuseLabelNotch(rootRef);\n\nconst displayText = ref(numberToDecimalString(modelValue.value));\n\n// Sync display when model changes externally (parent, increment/decrement).\n// Skip if the current input already represents the same value.\nwatch(modelValue, (newVal) => {\n const parsed = tryParseNumber(displayText.value);\n if (parsed.value === newVal) return;\n displayText.value = numberToDecimalString(newVal);\n});\n\nfunction handleInput(event: Event) {\n const input = event.target as HTMLInputElement;\n displayText.value = input.value;\n\n const result = tryParseNumber(input.value);\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n }\n}\n\n// On Enter or blur: if parseable, replace display with canonical decimal string.\n// Converts exponential (1e-5) to plain form (0.00001).\nfunction commitValue() {\n const text = displayText.value.trim();\n const result = tryParseNumber(text);\n\n // Empty or partial (-, ., -.) → clear display and reset model for non-required fields\n if (text === \"\" || (result.value === undefined && result.error === undefined)) {\n displayText.value = \"\";\n if (!props.required) {\n modelValue.value = undefined as V;\n }\n return;\n }\n\n if (result.value !== undefined) {\n modelValue.value = result.value as V;\n displayText.value = numberToDecimalString(result.value);\n }\n}\n\nconst error = computed(() => {\n if (props.errorMessage) return props.errorMessage;\n\n const result = tryParseNumber(displayText.value);\n if (result.error) return result.error;\n if (result.value !== undefined) {\n return validateNumber(result.value, props);\n }\n\n if (props.required && displayText.value.trim() === \"\") {\n return \"Value is required\";\n }\n\n return undefined;\n});\n\nconst canShowClearable = computed(\n () =>\n props.clearable &&\n (modelValue.value !== undefined || displayText.value.trim() !== \"\") &&\n !props.disabled,\n);\n\nfunction clear() {\n if (typeof props.clearable === \"function\") {\n modelValue.value = props.clearable();\n displayText.value = numberToDecimalString(modelValue.value);\n } else {\n modelValue.value = undefined as V;\n displayText.value = \"\";\n }\n}\n\nconst isIncrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.maxValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value >= props.maxValue\n );\n});\n\nconst isDecrementDisabled = computed(() => {\n if (error.value) return true;\n return (\n props.minValue !== undefined &&\n modelValue.value !== undefined &&\n modelValue.value <= props.minValue\n );\n});\n\nconst multiplier = computed(() => 10 ** (props.step.toString().split(\".\").at(1)?.length ?? 0));\n\nfunction increment() {\n if (isIncrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = props.minValue ?? 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value + props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.maxValue !== undefined ? Math.min(props.maxValue, nV) : nV) as V;\n}\n\nfunction decrement() {\n if (isDecrementDisabled.value) return;\n\n let nV: number;\n if (modelValue.value === undefined) {\n nV = 0;\n } else {\n nV =\n ((modelValue.value || 0) * multiplier.value - props.step * multiplier.value) /\n multiplier.value;\n }\n\n modelValue.value = (props.minValue !== undefined ? Math.max(props.minValue, nV) : nV) as V;\n}\n\nfunction handleBlur() {\n commitValue();\n emit(\"blur\", modelValue.value);\n}\n\nfunction handleFocus() {\n emit(\"focus\", modelValue.value);\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n if (e.code === \"Enter\") {\n commitValue();\n emit(\"enter\", modelValue.value);\n }\n\n if ([\"ArrowDown\", \"ArrowUp\"].includes(e.code)) {\n e.preventDefault();\n }\n\n if (!props.disableSteps && e.code === \"ArrowUp\") {\n increment();\n }\n\n if (!props.disableSteps && e.code === \"ArrowDown\") {\n decrement();\n }\n}\n\n// Prevent selecting beyond input content on triple-click etc.\nfunction handleMousedown(ev: MouseEvent) {\n if (ev.detail > 1) {\n ev.preventDefault();\n }\n}\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n :class=\"{ error: !!error, disabled: disabled }\"\n class=\"pl-number-field d-flex-column\"\n data-testid=\"pl-number-field\"\n @keydown=\"handleKeyDown\"\n >\n <div class=\"pl-number-field__main-wrapper d-flex\">\n <DoubleContour class=\"pl-number-field__contour\" :group-position=\"groupPosition\" />\n <div class=\"pl-number-field__wrapper flex-grow d-flex flex-align-center\">\n <label v-if=\"label\" class=\"text-description\" data-testid=\"pl-number-field-label\">\n {{ label }}\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-number-field-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <input\n ref=\"inputRef\"\n type=\"text\"\n inputmode=\"numeric\"\n :value=\"displayText\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n class=\"text-s flex-grow\"\n data-testid=\"pl-number-field-input\"\n @input=\"handleInput\"\n @focusout=\"handleBlur\"\n @focusin=\"handleFocus\"\n />\n <PlIcon16\n v-if=\"canShowClearable\"\n class=\"pl-number-field__clearable\"\n data-testid=\"pl-number-field-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n </div>\n <div\n v-if=\"!props.disableSteps\"\n class=\"pl-number-field__icons d-flex-column\"\n data-testid=\"pl-number-field-steps\"\n @mousedown=\"handleMousedown\"\n >\n <div\n :class=\"{ disabled: isIncrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n data-testid=\"pl-number-field-increment\"\n @click=\"increment\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n <div\n :class=\"{ disabled: isDecrementDisabled }\"\n class=\"pl-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center\"\n data-testid=\"pl-number-field-decrement\"\n @click=\"decrement\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z\"\n fill=\"#110529\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div v-if=\"error\" class=\"pl-number-field__error\" data-testid=\"pl-number-field-error\">\n {{ error }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;CAeE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EAsBR,IAAM,IAAa,EAAc,GAAA,aAAoB,EAE/C,IAAO,GAMP,IAAQ,GAuCR,IAAQ,GAAU,EAElB,IAAU,GAAkB;AAElC,IAAc,EAAQ;EAEtB,IAAM,IAAc,EAAI,EAAsB,EAAW,MAAM,CAAC;AAIhE,IAAM,IAAa,MAAW;AACb,KAAe,EAAY,MAAM,CACrC,UAAU,MACrB,EAAY,QAAQ,EAAsB,EAAO;IACjD;EAEF,SAAS,EAAY,GAAc;GACjC,IAAM,IAAQ,EAAM;AACpB,KAAY,QAAQ,EAAM;GAE1B,IAAM,IAAS,EAAe,EAAM,MAAM;AAC1C,GAAI,EAAO,UAAU,KAAA,MACnB,EAAW,QAAQ,EAAO;;EAM9B,SAAS,IAAc;GACrB,I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
|
1
|
-
{"version":3,"file":"PlProgressBar.js","names":[],"sources":["../../../src/components/PlProgressBar/PlProgressBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n loading: boolean;\n progress: number;\n completeMessage: string;\n }>(),\n { progress: 0, completeMessage: \"Completed\" },\n);\n\nconst readyMsg = computed(() => (props.progress === 100 ? props.completeMessage : \"\"));\n</script>\n\n<template>\n <div v-if=\"loading\" class=\"ui-progress-bar\">\n <div
|
|
1
|
+
{"version":3,"file":"PlProgressBar.js","names":[],"sources":["../../../src/components/PlProgressBar/PlProgressBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n loading: boolean;\n progress: number;\n completeMessage: string;\n }>(),\n { progress: 0, completeMessage: \"Completed\" },\n);\n\nconst readyMsg = computed(() => (props.progress === 100 ? props.completeMessage : \"\"));\n</script>\n\n<template>\n <div v-if=\"loading\" data-testid=\"pl-progress-bar\" class=\"ui-progress-bar\">\n <div\n data-testid=\"pl-progress-bar-indicator\"\n class=\"ui-progress-bar__indicator\"\n :style=\"{ width: progress + '%' }\"\n />\n <div class=\"ui-progress-bar__messages d-flex align-center pl-6 pr-6\">\n <div data-testid=\"pl-progress-bar-message\" class=\"ui-progress-bar__message flex-grow-1\">\n {{ readyMsg }}\n </div>\n <div data-testid=\"pl-progress-bar-percent\" class=\"ui-progress-bar__percent\">\n {{ progress + \"%\" }}\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlProgressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlProgressBar/PlProgressBar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlProgressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlProgressBar/PlProgressBar.vue"],"names":[],"mappings":"AAqCA,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAgEJ,QAAA,MAAM,YAAY;cAlEJ,MAAM;qBACC,MAAM;6EAoEzB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,8 +2,15 @@ import { computed as e, createCommentVNode as t, createElementBlock as n, create
|
|
|
2
2
|
//#region src/components/PlProgressBar/PlProgressBar.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var c = {
|
|
4
4
|
key: 0,
|
|
5
|
+
"data-testid": "pl-progress-bar",
|
|
5
6
|
class: "ui-progress-bar"
|
|
6
|
-
}, l = { class: "ui-progress-bar__messages d-flex align-center pl-6 pr-6" }, u = {
|
|
7
|
+
}, l = { class: "ui-progress-bar__messages d-flex align-center pl-6 pr-6" }, u = {
|
|
8
|
+
"data-testid": "pl-progress-bar-message",
|
|
9
|
+
class: "ui-progress-bar__message flex-grow-1"
|
|
10
|
+
}, d = {
|
|
11
|
+
"data-testid": "pl-progress-bar-percent",
|
|
12
|
+
class: "ui-progress-bar__percent"
|
|
13
|
+
}, f = /* @__PURE__ */ i({
|
|
7
14
|
__name: "PlProgressBar",
|
|
8
15
|
props: {
|
|
9
16
|
loading: { type: Boolean },
|
|
@@ -13,6 +20,7 @@ var c = {
|
|
|
13
20
|
setup(i) {
|
|
14
21
|
let f = i, p = e(() => f.progress === 100 ? f.completeMessage : "");
|
|
15
22
|
return (e, f) => i.loading ? (o(), n("div", c, [r("div", {
|
|
23
|
+
"data-testid": "pl-progress-bar-indicator",
|
|
16
24
|
class: "ui-progress-bar__indicator",
|
|
17
25
|
style: a({ width: i.progress + "%" })
|
|
18
26
|
}, null, 4), r("div", l, [r("div", u, s(p.value), 1), r("div", d, s(i.progress + "%"), 1)])])) : t("", !0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlProgressBar.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlProgressBar/PlProgressBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n loading: boolean;\n progress: number;\n completeMessage: string;\n }>(),\n { progress: 0, completeMessage: \"Completed\" },\n);\n\nconst readyMsg = computed(() => (props.progress === 100 ? props.completeMessage : \"\"));\n</script>\n\n<template>\n <div v-if=\"loading\" class=\"ui-progress-bar\">\n <div
|
|
1
|
+
{"version":3,"file":"PlProgressBar.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlProgressBar/PlProgressBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n loading: boolean;\n progress: number;\n completeMessage: string;\n }>(),\n { progress: 0, completeMessage: \"Completed\" },\n);\n\nconst readyMsg = computed(() => (props.progress === 100 ? props.completeMessage : \"\"));\n</script>\n\n<template>\n <div v-if=\"loading\" data-testid=\"pl-progress-bar\" class=\"ui-progress-bar\">\n <div\n data-testid=\"pl-progress-bar-indicator\"\n class=\"ui-progress-bar__indicator\"\n :style=\"{ width: progress + '%' }\"\n />\n <div class=\"ui-progress-bar__messages d-flex align-center pl-6 pr-6\">\n <div data-testid=\"pl-progress-bar-message\" class=\"ui-progress-bar__message flex-grow-1\">\n {{ readyMsg }}\n </div>\n <div data-testid=\"pl-progress-bar-percent\" class=\"ui-progress-bar__percent\">\n {{ progress + \"%\" }}\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAGA,IAAM,IAAQ,GASR,IAAW,QAAgB,EAAM,aAAa,MAAM,EAAM,kBAAkB,GAAI;mBAIzE,EAAA,WAAA,GAAA,EAAX,EAcM,OAdN,GAcM,CAbJ,EAIE,OAAA;GAHA,eAAY;GACZ,OAAM;GACL,OAAK,EAAA,EAAA,OAAW,EAAA,WAAQ,KAAA,CAAA;eAE3B,EAOM,OAPN,GAOM,CANJ,EAEM,OAFN,GAEM,EADD,EAAA,MAAQ,EAAA,EAAA,EAEb,EAEM,OAFN,GAEM,EADD,EAAA,WAAQ,IAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlProgressCell.js","names":[],"sources":["../../../src/components/PlProgressCell/PlProgressCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport \"./pl-progress-cell.scss\";\nimport { computed } from \"vue\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport type { PlProgressCellProps } from \"./types\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\n\nconst props = withDefaults(defineProps<PlProgressCellProps>(), {\n stage: \"not_started\",\n step: \"\", // main text (left)\n progressString: \"\", // appended text on the right side (right)\n progress: undefined,\n error: undefined,\n});\n\nconst canShowWhiteBg = computed(() => props.stage !== \"not_started\");\n\nconst currentProgress = computed(() =>\n props.stage === \"done\" ? 100 : Math.min(100, props.progress || 0),\n);\n\nconst canShowInfinityLoader = computed(\n () =>\n props.progress === undefined &&\n props.stage !== \"done\" &&\n props.stage !== \"not_started\" &&\n !props.error,\n);\n</script>\n\n<template>\n <div\n :class=\"{\n 'progress-cell': true,\n 'progress-cell__white-bg': canShowWhiteBg,\n error,\n 'not-started': props.stage === 'not_started',\n }\"\n >\n <div
|
|
1
|
+
{"version":3,"file":"PlProgressCell.js","names":[],"sources":["../../../src/components/PlProgressCell/PlProgressCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport \"./pl-progress-cell.scss\";\nimport { computed } from \"vue\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport type { PlProgressCellProps } from \"./types\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\n\nconst props = withDefaults(defineProps<PlProgressCellProps>(), {\n stage: \"not_started\",\n step: \"\", // main text (left)\n progressString: \"\", // appended text on the right side (right)\n progress: undefined,\n error: undefined,\n});\n\nconst canShowWhiteBg = computed(() => props.stage !== \"not_started\");\n\nconst currentProgress = computed(() =>\n props.stage === \"done\" ? 100 : Math.min(100, props.progress || 0),\n);\n\nconst canShowInfinityLoader = computed(\n () =>\n props.progress === undefined &&\n props.stage !== \"done\" &&\n props.stage !== \"not_started\" &&\n !props.error,\n);\n</script>\n\n<template>\n <div\n data-testid=\"pl-progress-cell\"\n :class=\"{\n 'progress-cell': true,\n 'progress-cell__white-bg': canShowWhiteBg,\n error,\n 'not-started': props.stage === 'not_started',\n }\"\n >\n <div\n v-if=\"canShowInfinityLoader\"\n data-testid=\"pl-progress-cell-infinity-loader\"\n class=\"progress-cell__infinity-loader\"\n >\n <div class=\"progress-cell__infinity-gradient\" />\n </div>\n <div\n v-if=\"!canShowInfinityLoader && !error\"\n data-testid=\"pl-progress-cell-indicator\"\n class=\"progress-cell__indicator\"\n :style=\"{ width: currentProgress + '%' }\"\n />\n <div class=\"progress-cell__body\">\n <div data-testid=\"pl-progress-cell-stage\" class=\"progress-cell__stage text-s\">\n {{ error ? getErrorMessage(error) : step }}\n </div>\n <div\n data-testid=\"pl-progress-cell-percentage\"\n class=\"progress-cell__percentage text-s d-flex align-center justify-end\"\n >\n <PlMaskIcon24 v-if=\"error\" data-testid=\"pl-progress-cell-error-icon\" name=\"error\" />\n <template v-if=\"!error\">\n {{ progressString }}\n </template>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlProgressCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlProgressCell/PlProgressCell.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlProgressCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlProgressCell/PlProgressCell.vue"],"names":[],"mappings":"AAwEA,OAAO,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA+HnD,QAAA,MAAM,YAAY;;;;;;6EAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -6,8 +6,15 @@ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a
|
|
|
6
6
|
//#region src/components/PlProgressCell/PlProgressCell.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var h = {
|
|
8
8
|
key: 0,
|
|
9
|
+
"data-testid": "pl-progress-cell-infinity-loader",
|
|
9
10
|
class: "progress-cell__infinity-loader"
|
|
10
|
-
}, g = { class: "progress-cell__body" }, _ = {
|
|
11
|
+
}, g = { class: "progress-cell__body" }, _ = {
|
|
12
|
+
"data-testid": "pl-progress-cell-stage",
|
|
13
|
+
class: "progress-cell__stage text-s"
|
|
14
|
+
}, v = {
|
|
15
|
+
"data-testid": "pl-progress-cell-percentage",
|
|
16
|
+
class: "progress-cell__percentage text-s d-flex align-center justify-end"
|
|
17
|
+
}, y = /* @__PURE__ */ l({
|
|
11
18
|
__name: "PlProgressCell",
|
|
12
19
|
props: {
|
|
13
20
|
stage: { default: "not_started" },
|
|
@@ -18,20 +25,25 @@ var h = {
|
|
|
18
25
|
},
|
|
19
26
|
setup(l) {
|
|
20
27
|
let y = l, b = r(() => y.stage !== "not_started"), x = r(() => y.stage === "done" ? 100 : Math.min(100, y.progress || 0)), S = r(() => y.progress === void 0 && y.stage !== "done" && y.stage !== "not_started" && !y.error);
|
|
21
|
-
return (r, C) => (f(), o("div", {
|
|
22
|
-
"progress-cell"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
return (r, C) => (f(), o("div", {
|
|
29
|
+
"data-testid": "pl-progress-cell",
|
|
30
|
+
class: u({
|
|
31
|
+
"progress-cell": !0,
|
|
32
|
+
"progress-cell__white-bg": b.value,
|
|
33
|
+
error: l.error,
|
|
34
|
+
"not-started": y.stage === "not_started"
|
|
35
|
+
})
|
|
36
|
+
}, [
|
|
27
37
|
S.value ? (f(), o("div", h, [...C[0] ||= [s("div", { class: "progress-cell__infinity-gradient" }, null, -1)]])) : a("", !0),
|
|
28
38
|
!S.value && !l.error ? (f(), o("div", {
|
|
29
39
|
key: 1,
|
|
40
|
+
"data-testid": "pl-progress-cell-indicator",
|
|
30
41
|
class: "progress-cell__indicator",
|
|
31
42
|
style: d({ width: x.value + "%" })
|
|
32
43
|
}, null, 4)) : a("", !0),
|
|
33
44
|
s("div", g, [s("div", _, p(l.error ? m(e)(l.error) : l.step), 1), s("div", v, [l.error ? (f(), i(m(t), {
|
|
34
45
|
key: 0,
|
|
46
|
+
"data-testid": "pl-progress-cell-error-icon",
|
|
35
47
|
name: "error"
|
|
36
48
|
})) : a("", !0), l.error ? a("", !0) : (f(), o(n, { key: 1 }, [c(p(l.progressString), 1)], 64))])])
|
|
37
49
|
], 2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlProgressCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlProgressCell/PlProgressCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport \"./pl-progress-cell.scss\";\nimport { computed } from \"vue\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport type { PlProgressCellProps } from \"./types\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\n\nconst props = withDefaults(defineProps<PlProgressCellProps>(), {\n stage: \"not_started\",\n step: \"\", // main text (left)\n progressString: \"\", // appended text on the right side (right)\n progress: undefined,\n error: undefined,\n});\n\nconst canShowWhiteBg = computed(() => props.stage !== \"not_started\");\n\nconst currentProgress = computed(() =>\n props.stage === \"done\" ? 100 : Math.min(100, props.progress || 0),\n);\n\nconst canShowInfinityLoader = computed(\n () =>\n props.progress === undefined &&\n props.stage !== \"done\" &&\n props.stage !== \"not_started\" &&\n !props.error,\n);\n</script>\n\n<template>\n <div\n :class=\"{\n 'progress-cell': true,\n 'progress-cell__white-bg': canShowWhiteBg,\n error,\n 'not-started': props.stage === 'not_started',\n }\"\n >\n <div
|
|
1
|
+
{"version":3,"file":"PlProgressCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlProgressCell/PlProgressCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport \"./pl-progress-cell.scss\";\nimport { computed } from \"vue\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport type { PlProgressCellProps } from \"./types\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\n\nconst props = withDefaults(defineProps<PlProgressCellProps>(), {\n stage: \"not_started\",\n step: \"\", // main text (left)\n progressString: \"\", // appended text on the right side (right)\n progress: undefined,\n error: undefined,\n});\n\nconst canShowWhiteBg = computed(() => props.stage !== \"not_started\");\n\nconst currentProgress = computed(() =>\n props.stage === \"done\" ? 100 : Math.min(100, props.progress || 0),\n);\n\nconst canShowInfinityLoader = computed(\n () =>\n props.progress === undefined &&\n props.stage !== \"done\" &&\n props.stage !== \"not_started\" &&\n !props.error,\n);\n</script>\n\n<template>\n <div\n data-testid=\"pl-progress-cell\"\n :class=\"{\n 'progress-cell': true,\n 'progress-cell__white-bg': canShowWhiteBg,\n error,\n 'not-started': props.stage === 'not_started',\n }\"\n >\n <div\n v-if=\"canShowInfinityLoader\"\n data-testid=\"pl-progress-cell-infinity-loader\"\n class=\"progress-cell__infinity-loader\"\n >\n <div class=\"progress-cell__infinity-gradient\" />\n </div>\n <div\n v-if=\"!canShowInfinityLoader && !error\"\n data-testid=\"pl-progress-cell-indicator\"\n class=\"progress-cell__indicator\"\n :style=\"{ width: currentProgress + '%' }\"\n />\n <div class=\"progress-cell__body\">\n <div data-testid=\"pl-progress-cell-stage\" class=\"progress-cell__stage text-s\">\n {{ error ? getErrorMessage(error) : step }}\n </div>\n <div\n data-testid=\"pl-progress-cell-percentage\"\n class=\"progress-cell__percentage text-s d-flex align-center justify-end\"\n >\n <PlMaskIcon24 v-if=\"error\" data-testid=\"pl-progress-cell-error-icon\" name=\"error\" />\n <template v-if=\"!error\">\n {{ progressString }}\n </template>\n </div>\n </div>\n </div>\n</template>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=\"ts\" generic=\"M\">\nimport { inject } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nimport type PlRadioGroup from \"./PlRadioGroup.vue\";\n\nconst standaloneModel = defineModel<M>();\n\nconst { name: standaloneName, ...props } = defineProps<{\n /** Used to group multiple radio controls. Will be ignored if this component is a descendant of a {@link PlRadioGroup}. */\n name?: string;\n /** Value that goes into `v-model`. */\n value?: M;\n /** Whether the radio control is disabled. */\n disabled?: boolean;\n}>();\n\ndefineSlots<{\n /** Label of the radio control. */\n default?(): unknown;\n}>();\n\nconst name = inject(radioGroupNameKey, standaloneName);\nconst model = inject<typeof standaloneModel>(radioGroupModelKey, standaloneModel);\n</script>\n\n<template>\n <label :class=\"$style.container\">\n <input
|
|
1
|
+
{"version":3,"file":"PlRadio.js","names":[],"sources":["../../../src/components/PlRadio/PlRadio.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { inject } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nimport type PlRadioGroup from \"./PlRadioGroup.vue\";\n\nconst standaloneModel = defineModel<M>();\n\nconst { name: standaloneName, ...props } = defineProps<{\n /** Used to group multiple radio controls. Will be ignored if this component is a descendant of a {@link PlRadioGroup}. */\n name?: string;\n /** Value that goes into `v-model`. */\n value?: M;\n /** Whether the radio control is disabled. */\n disabled?: boolean;\n}>();\n\ndefineSlots<{\n /** Label of the radio control. */\n default?(): unknown;\n}>();\n\nconst name = inject(radioGroupNameKey, standaloneName);\nconst model = inject<typeof standaloneModel>(radioGroupModelKey, standaloneModel);\n</script>\n\n<template>\n <label :class=\"$style.container\" data-testid=\"pl-radio\">\n <input\n v-model=\"model\"\n :class=\"$style.input\"\n type=\"radio\"\n :name\n data-testid=\"pl-radio-input\"\n v-bind=\"props\"\n />\n <span :class=\"$style.label\" data-testid=\"pl-radio-label\"><slot /></span>\n </label>\n</template>\n\n<style module>\n.container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px;\n border-radius: 6px;\n transition: all 200ms ease-in-out;\n color: var(--txt-01);\n user-select: none;\n &:hover:not(:has(:disabled)) {\n background: var(--btn-sec-hover-grey);\n }\n &:has(:disabled) {\n color: var(--dis-01);\n }\n}\n\n.input {\n appearance: none;\n position: relative;\n block-size: 24px;\n aspect-ratio: 1;\n margin: 0;\n border-radius: 50%;\n outline: 2px solid transparent;\n color: inherit;\n transition: inherit;\n &:focus {\n outline-color: var(--border-color-focus);\n }\n &::before {\n content: \"\";\n position: absolute;\n inset: 2px;\n border-radius: 50%;\n border: 2px solid;\n }\n &::after {\n content: \"\";\n position: absolute;\n inset: 7.5px;\n border-radius: 50%;\n background-color: currentColor;\n scale: 0;\n transition: inherit;\n }\n &:checked::after {\n scale: 1;\n }\n}\n\n.label {\n padding-inline: 4px;\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadio.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlRadio/PlRadio.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { inject } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nimport type PlRadioGroup from \"./PlRadioGroup.vue\";\n\nconst standaloneModel = defineModel<M>();\n\nconst { name: standaloneName, ...props } = defineProps<{\n /** Used to group multiple radio controls. Will be ignored if this component is a descendant of a {@link PlRadioGroup}. */\n name?: string;\n /** Value that goes into `v-model`. */\n value?: M;\n /** Whether the radio control is disabled. */\n disabled?: boolean;\n}>();\n\ndefineSlots<{\n /** Label of the radio control. */\n default?(): unknown;\n}>();\n\nconst name = inject(radioGroupNameKey, standaloneName);\nconst model = inject<typeof standaloneModel>(radioGroupModelKey, standaloneModel);\n</script>\n\n<template>\n <label :class=\"$style.container\">\n <input
|
|
1
|
+
{"version":3,"file":"PlRadio.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlRadio/PlRadio.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { inject } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nimport type PlRadioGroup from \"./PlRadioGroup.vue\";\n\nconst standaloneModel = defineModel<M>();\n\nconst { name: standaloneName, ...props } = defineProps<{\n /** Used to group multiple radio controls. Will be ignored if this component is a descendant of a {@link PlRadioGroup}. */\n name?: string;\n /** Value that goes into `v-model`. */\n value?: M;\n /** Whether the radio control is disabled. */\n disabled?: boolean;\n}>();\n\ndefineSlots<{\n /** Label of the radio control. */\n default?(): unknown;\n}>();\n\nconst name = inject(radioGroupNameKey, standaloneName);\nconst model = inject<typeof standaloneModel>(radioGroupModelKey, standaloneModel);\n</script>\n\n<template>\n <label :class=\"$style.container\" data-testid=\"pl-radio\">\n <input\n v-model=\"model\"\n :class=\"$style.input\"\n type=\"radio\"\n :name\n data-testid=\"pl-radio-input\"\n v-bind=\"props\"\n />\n <span :class=\"$style.label\" data-testid=\"pl-radio-label\"><slot /></span>\n </label>\n</template>\n\n<style module>\n.container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px;\n border-radius: 6px;\n transition: all 200ms ease-in-out;\n color: var(--txt-01);\n user-select: none;\n &:hover:not(:has(:disabled)) {\n background: var(--btn-sec-hover-grey);\n }\n &:has(:disabled) {\n color: var(--dis-01);\n }\n}\n\n.input {\n appearance: none;\n position: relative;\n block-size: 24px;\n aspect-ratio: 1;\n margin: 0;\n border-radius: 50%;\n outline: 2px solid transparent;\n color: inherit;\n transition: inherit;\n &:focus {\n outline-color: var(--border-color-focus);\n }\n &::before {\n content: \"\";\n position: absolute;\n inset: 2px;\n border-radius: 50%;\n border: 2px solid;\n }\n &::after {\n content: \"\";\n position: absolute;\n inset: 7.5px;\n border-radius: 50%;\n background-color: currentColor;\n scale: 0;\n transition: inherit;\n }\n &:checked::after {\n scale: 1;\n }\n}\n\n.label {\n padding-inline: 4px;\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadio.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlRadio/PlRadio.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlRadio.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlRadio/PlRadio.vue"],"names":[],"mappings":"AA2GA,QAAA,MAAM,YAAY,GAAK,CAAC,EACvB,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;WAgFO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;QA5EtD,0HAA0H;eACnH,MAAM;QACb,sCAAsC;gBAC9B,CAAC;QACT,6CAA6C;mBAClC,OAAO;;qBAgBP,CAAC;;;KAuD6E,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;;QAnET,kCAAkC;oBACtB,OAAO;;;EAsEjB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAAI,CAAC;wBACpE,OAAO,YAAY;AAAxC,wBAAyC;AACzC,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"}
|
|
@@ -14,12 +14,19 @@ var _ = ["name"], v = /* @__PURE__ */ a({
|
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
15
|
setup(a) {
|
|
16
16
|
let c = m(a, "modelValue"), v = i(a, ["name"]), y = o(t, a.name), b = o(e, c);
|
|
17
|
-
return (e, t) => (d(), n("label", {
|
|
17
|
+
return (e, t) => (d(), n("label", {
|
|
18
|
+
class: u(e.$style.container),
|
|
19
|
+
"data-testid": "pl-radio"
|
|
20
|
+
}, [g(r("input", l({
|
|
18
21
|
"onUpdate:modelValue": t[0] ||= (e) => s(b) ? b.value = e : null,
|
|
19
22
|
class: e.$style.input,
|
|
20
23
|
type: "radio",
|
|
21
|
-
name: p(y)
|
|
22
|
-
|
|
24
|
+
name: p(y),
|
|
25
|
+
"data-testid": "pl-radio-input"
|
|
26
|
+
}, v), null, 16, _), [[h, p(b)]]), r("span", {
|
|
27
|
+
class: u(e.$style.label),
|
|
28
|
+
"data-testid": "pl-radio-label"
|
|
29
|
+
}, [f(e.$slots, "default")], 2)], 2));
|
|
23
30
|
}
|
|
24
31
|
});
|
|
25
32
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadio.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlRadio/PlRadio.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { inject } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nimport type PlRadioGroup from \"./PlRadioGroup.vue\";\n\nconst standaloneModel = defineModel<M>();\n\nconst { name: standaloneName, ...props } = defineProps<{\n /** Used to group multiple radio controls. Will be ignored if this component is a descendant of a {@link PlRadioGroup}. */\n name?: string;\n /** Value that goes into `v-model`. */\n value?: M;\n /** Whether the radio control is disabled. */\n disabled?: boolean;\n}>();\n\ndefineSlots<{\n /** Label of the radio control. */\n default?(): unknown;\n}>();\n\nconst name = inject(radioGroupNameKey, standaloneName);\nconst model = inject<typeof standaloneModel>(radioGroupModelKey, standaloneModel);\n</script>\n\n<template>\n <label :class=\"$style.container\">\n <input
|
|
1
|
+
{"version":3,"file":"PlRadio.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlRadio/PlRadio.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { inject } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nimport type PlRadioGroup from \"./PlRadioGroup.vue\";\n\nconst standaloneModel = defineModel<M>();\n\nconst { name: standaloneName, ...props } = defineProps<{\n /** Used to group multiple radio controls. Will be ignored if this component is a descendant of a {@link PlRadioGroup}. */\n name?: string;\n /** Value that goes into `v-model`. */\n value?: M;\n /** Whether the radio control is disabled. */\n disabled?: boolean;\n}>();\n\ndefineSlots<{\n /** Label of the radio control. */\n default?(): unknown;\n}>();\n\nconst name = inject(radioGroupNameKey, standaloneName);\nconst model = inject<typeof standaloneModel>(radioGroupModelKey, standaloneModel);\n</script>\n\n<template>\n <label :class=\"$style.container\" data-testid=\"pl-radio\">\n <input\n v-model=\"model\"\n :class=\"$style.input\"\n type=\"radio\"\n :name\n data-testid=\"pl-radio-input\"\n v-bind=\"props\"\n />\n <span :class=\"$style.label\" data-testid=\"pl-radio-label\"><slot /></span>\n </label>\n</template>\n\n<style module>\n.container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px;\n border-radius: 6px;\n transition: all 200ms ease-in-out;\n color: var(--txt-01);\n user-select: none;\n &:hover:not(:has(:disabled)) {\n background: var(--btn-sec-hover-grey);\n }\n &:has(:disabled) {\n color: var(--dis-01);\n }\n}\n\n.input {\n appearance: none;\n position: relative;\n block-size: 24px;\n aspect-ratio: 1;\n margin: 0;\n border-radius: 50%;\n outline: 2px solid transparent;\n color: inherit;\n transition: inherit;\n &:focus {\n outline-color: var(--border-color-focus);\n }\n &::before {\n content: \"\";\n position: absolute;\n inset: 2px;\n border-radius: 50%;\n border: 2px solid;\n }\n &::after {\n content: \"\";\n position: absolute;\n inset: 7.5px;\n border-radius: 50%;\n background-color: currentColor;\n scale: 0;\n transition: inherit;\n }\n &:checked::after {\n scale: 1;\n }\n}\n\n.label {\n padding-inline: 4px;\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;EAMA,IAAM,IAAkB,EAAc,GAAA,aAAE,EAElC,IAAqC,EAAA,GAAA,CAAA,OAAA,CAOvC,EAOE,IAAO,EAAO,GAAmB,EAAA,KAAe,EAChD,IAAQ,EAA+B,GAAoB,EAAgB;yBAI/E,EAUQ,SAAA;GAVA,OAAK,EAAEA,EAAAA,OAAO,UAAS;GAAE,eAAY;QAC3C,EAOE,SAPF,EAOE;mDANc,QAAA,IAAA;GACb,OAAOA,EAAAA,OAAO;GACf,MAAK;GACJ,MAAA,EAAA,EAAI;GACL,eAAY;KACJ,EAAK,EAAA,MAAA,IAAA,EAAA,EAAA,CAAA,CAAA,GALJ,EAAA,EAAK,CAAA,CAAA,CAAA,EAOhB,EAAwE,QAAA;GAAjE,OAAK,EAAEA,EAAAA,OAAO,MAAK;GAAE,eAAY;MAAiB,EAAQ,EAAA,QAAA,UAAA,CAAA,EAAA,EAAA,CAAA,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadioGroup.js","names":[],"sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { provide } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\nimport PlRadio from \"./PlRadio.vue\";\n\ntype RadioGroupOption = {\n label: string;\n value: M;\n disabled?: boolean;\n};\n\nconst model = defineModel<M>();\n\nconst props = defineProps<{\n /** Name of the radio group. */\n name?: string;\n /**\n * List of available options.\n * Renders a list of {@link PlRadio} components before the {@link slots.default | default} slot.\n */\n options?: Readonly<RadioGroupOption[]>;\n /** Function to get option's unique key. Use if default mechanism (key = index) is unstable. */\n keyExtractor?: (value: M, index: number) => PropertyKey;\n}>();\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nconst slots = defineSlots<{\n /**\n * Can be anything, but usually an array of {@link PlRadio} components.\n * If {@link props.options|options} are provided, they will be rendered before this slot.\n */\n default?(): unknown;\n /** Label of the radio group. */\n label?(): unknown;\n}>();\n\nconst keyExtractor = props.keyExtractor ?? ((_, i) => i);\n\nprovide(radioGroupNameKey, props.name);\nprovide(radioGroupModelKey, model);\n</script>\n\n<template>\n <fieldset :class=\"$style.container\">\n <legend :class=\"$style.label\">\n <slot name=\"label\" />\n </legend>\n <PlRadio\n v-for=\"(option, i) in options\"\n :key=\"keyExtractor(option.value, i)\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n {{ option.label }}\n </PlRadio>\n <slot />\n </fieldset>\n</template>\n\n<style module>\n.container {\n margin: 0;\n padding: 0;\n border: none;\n}\n.label {\n margin-block-end: 12px;\n padding: 0;\n color: var(--txt-01);\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlRadioGroup.js","names":[],"sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { provide } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\nimport PlRadio from \"./PlRadio.vue\";\n\ntype RadioGroupOption = {\n label: string;\n value: M;\n disabled?: boolean;\n};\n\nconst model = defineModel<M>();\n\nconst props = defineProps<{\n /** Name of the radio group. */\n name?: string;\n /**\n * List of available options.\n * Renders a list of {@link PlRadio} components before the {@link slots.default | default} slot.\n */\n options?: Readonly<RadioGroupOption[]>;\n /** Function to get option's unique key. Use if default mechanism (key = index) is unstable. */\n keyExtractor?: (value: M, index: number) => PropertyKey;\n}>();\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nconst slots = defineSlots<{\n /**\n * Can be anything, but usually an array of {@link PlRadio} components.\n * If {@link props.options|options} are provided, they will be rendered before this slot.\n */\n default?(): unknown;\n /** Label of the radio group. */\n label?(): unknown;\n}>();\n\nconst keyExtractor = props.keyExtractor ?? ((_, i) => i);\n\nprovide(radioGroupNameKey, props.name);\nprovide(radioGroupModelKey, model);\n</script>\n\n<template>\n <fieldset :class=\"$style.container\" data-testid=\"pl-radio-group\">\n <legend :class=\"$style.label\" data-testid=\"pl-radio-group-label\">\n <slot name=\"label\" />\n </legend>\n <PlRadio\n v-for=\"(option, i) in options\"\n :key=\"keyExtractor(option.value, i)\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n data-testid=\"pl-radio-group-option\"\n >\n {{ option.label }}\n </PlRadio>\n <slot />\n </fieldset>\n</template>\n\n<style module>\n.container {\n margin: 0;\n padding: 0;\n border: none;\n}\n.label {\n margin-block-end: 12px;\n padding: 0;\n color: var(--txt-01);\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadioGroup.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { provide } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\nimport PlRadio from \"./PlRadio.vue\";\n\ntype RadioGroupOption = {\n label: string;\n value: M;\n disabled?: boolean;\n};\n\nconst model = defineModel<M>();\n\nconst props = defineProps<{\n /** Name of the radio group. */\n name?: string;\n /**\n * List of available options.\n * Renders a list of {@link PlRadio} components before the {@link slots.default | default} slot.\n */\n options?: Readonly<RadioGroupOption[]>;\n /** Function to get option's unique key. Use if default mechanism (key = index) is unstable. */\n keyExtractor?: (value: M, index: number) => PropertyKey;\n}>();\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nconst slots = defineSlots<{\n /**\n * Can be anything, but usually an array of {@link PlRadio} components.\n * If {@link props.options|options} are provided, they will be rendered before this slot.\n */\n default?(): unknown;\n /** Label of the radio group. */\n label?(): unknown;\n}>();\n\nconst keyExtractor = props.keyExtractor ?? ((_, i) => i);\n\nprovide(radioGroupNameKey, props.name);\nprovide(radioGroupModelKey, model);\n</script>\n\n<template>\n <fieldset :class=\"$style.container\">\n <legend :class=\"$style.label\">\n <slot name=\"label\" />\n </legend>\n <PlRadio\n v-for=\"(option, i) in options\"\n :key=\"keyExtractor(option.value, i)\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n {{ option.label }}\n </PlRadio>\n <slot />\n </fieldset>\n</template>\n\n<style module>\n.container {\n margin: 0;\n padding: 0;\n border: none;\n}\n.label {\n margin-block-end: 12px;\n padding: 0;\n color: var(--txt-01);\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlRadioGroup.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { provide } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\nimport PlRadio from \"./PlRadio.vue\";\n\ntype RadioGroupOption = {\n label: string;\n value: M;\n disabled?: boolean;\n};\n\nconst model = defineModel<M>();\n\nconst props = defineProps<{\n /** Name of the radio group. */\n name?: string;\n /**\n * List of available options.\n * Renders a list of {@link PlRadio} components before the {@link slots.default | default} slot.\n */\n options?: Readonly<RadioGroupOption[]>;\n /** Function to get option's unique key. Use if default mechanism (key = index) is unstable. */\n keyExtractor?: (value: M, index: number) => PropertyKey;\n}>();\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nconst slots = defineSlots<{\n /**\n * Can be anything, but usually an array of {@link PlRadio} components.\n * If {@link props.options|options} are provided, they will be rendered before this slot.\n */\n default?(): unknown;\n /** Label of the radio group. */\n label?(): unknown;\n}>();\n\nconst keyExtractor = props.keyExtractor ?? ((_, i) => i);\n\nprovide(radioGroupNameKey, props.name);\nprovide(radioGroupModelKey, model);\n</script>\n\n<template>\n <fieldset :class=\"$style.container\" data-testid=\"pl-radio-group\">\n <legend :class=\"$style.label\" data-testid=\"pl-radio-group-label\">\n <slot name=\"label\" />\n </legend>\n <PlRadio\n v-for=\"(option, i) in options\"\n :key=\"keyExtractor(option.value, i)\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n data-testid=\"pl-radio-group-option\"\n >\n {{ option.label }}\n </PlRadio>\n <slot />\n </fieldset>\n</template>\n\n<style module>\n.container {\n margin: 0;\n padding: 0;\n border: none;\n}\n.label {\n margin-block-end: 12px;\n padding: 0;\n color: var(--txt-01);\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadioGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlRadioGroup.vue.d.ts","source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C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -17,12 +17,19 @@ var b = /* @__PURE__ */ c({
|
|
|
17
17
|
let l = _(c, "modelValue"), b = c;
|
|
18
18
|
v();
|
|
19
19
|
let x = b.keyExtractor ?? ((e, t) => t);
|
|
20
|
-
return f(t, b.name), f(e, l), (e, t) => (d(), a("fieldset", {
|
|
21
|
-
|
|
20
|
+
return f(t, b.name), f(e, l), (e, t) => (d(), a("fieldset", {
|
|
21
|
+
class: u(e.$style.container),
|
|
22
|
+
"data-testid": "pl-radio-group"
|
|
23
|
+
}, [
|
|
24
|
+
o("legend", {
|
|
25
|
+
class: u(e.$style.label),
|
|
26
|
+
"data-testid": "pl-radio-group-label"
|
|
27
|
+
}, [m(e.$slots, "label")], 2),
|
|
22
28
|
(d(!0), a(r, null, p(c.options, (e, t) => (d(), i(n, {
|
|
23
29
|
key: g(x)(e.value, t),
|
|
24
30
|
value: e.value,
|
|
25
|
-
disabled: e.disabled
|
|
31
|
+
disabled: e.disabled,
|
|
32
|
+
"data-testid": "pl-radio-group-option"
|
|
26
33
|
}, {
|
|
27
34
|
default: y(() => [s(h(e.label), 1)]),
|
|
28
35
|
_: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlRadioGroup.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { provide } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\nimport PlRadio from \"./PlRadio.vue\";\n\ntype RadioGroupOption = {\n label: string;\n value: M;\n disabled?: boolean;\n};\n\nconst model = defineModel<M>();\n\nconst props = defineProps<{\n /** Name of the radio group. */\n name?: string;\n /**\n * List of available options.\n * Renders a list of {@link PlRadio} components before the {@link slots.default | default} slot.\n */\n options?: Readonly<RadioGroupOption[]>;\n /** Function to get option's unique key. Use if default mechanism (key = index) is unstable. */\n keyExtractor?: (value: M, index: number) => PropertyKey;\n}>();\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nconst slots = defineSlots<{\n /**\n * Can be anything, but usually an array of {@link PlRadio} components.\n * If {@link props.options|options} are provided, they will be rendered before this slot.\n */\n default?(): unknown;\n /** Label of the radio group. */\n label?(): unknown;\n}>();\n\nconst keyExtractor = props.keyExtractor ?? ((_, i) => i);\n\nprovide(radioGroupNameKey, props.name);\nprovide(radioGroupModelKey, model);\n</script>\n\n<template>\n <fieldset :class=\"$style.container\">\n <legend :class=\"$style.label\">\n <slot name=\"label\" />\n </legend>\n <PlRadio\n v-for=\"(option, i) in options\"\n :key=\"keyExtractor(option.value, i)\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n {{ option.label }}\n </PlRadio>\n <slot />\n </fieldset>\n</template>\n\n<style module>\n.container {\n margin: 0;\n padding: 0;\n border: none;\n}\n.label {\n margin-block-end: 12px;\n padding: 0;\n color: var(--txt-01);\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EAWA,IAAM,IAAQ,EAAc,GAAA,aAAE,EAExB,IAAQ;AAaA,KAQV;EAEJ,IAAM,IAAe,EAAM,kBAAkB,GAAG,MAAM;SAEtD,EAAQ,GAAmB,EAAM,KAAK,EACtC,EAAQ,GAAoB,EAAM,kBAIhC,
|
|
1
|
+
{"version":3,"file":"PlRadioGroup.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlRadio/PlRadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M\">\nimport { provide } from \"vue\";\nimport { radioGroupModelKey, radioGroupNameKey } from \"./keys\";\nimport PlRadio from \"./PlRadio.vue\";\n\ntype RadioGroupOption = {\n label: string;\n value: M;\n disabled?: boolean;\n};\n\nconst model = defineModel<M>();\n\nconst props = defineProps<{\n /** Name of the radio group. */\n name?: string;\n /**\n * List of available options.\n * Renders a list of {@link PlRadio} components before the {@link slots.default | default} slot.\n */\n options?: Readonly<RadioGroupOption[]>;\n /** Function to get option's unique key. Use if default mechanism (key = index) is unstable. */\n keyExtractor?: (value: M, index: number) => PropertyKey;\n}>();\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the props documentation\nconst slots = defineSlots<{\n /**\n * Can be anything, but usually an array of {@link PlRadio} components.\n * If {@link props.options|options} are provided, they will be rendered before this slot.\n */\n default?(): unknown;\n /** Label of the radio group. */\n label?(): unknown;\n}>();\n\nconst keyExtractor = props.keyExtractor ?? ((_, i) => i);\n\nprovide(radioGroupNameKey, props.name);\nprovide(radioGroupModelKey, model);\n</script>\n\n<template>\n <fieldset :class=\"$style.container\" data-testid=\"pl-radio-group\">\n <legend :class=\"$style.label\" data-testid=\"pl-radio-group-label\">\n <slot name=\"label\" />\n </legend>\n <PlRadio\n v-for=\"(option, i) in options\"\n :key=\"keyExtractor(option.value, i)\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n data-testid=\"pl-radio-group-option\"\n >\n {{ option.label }}\n </PlRadio>\n <slot />\n </fieldset>\n</template>\n\n<style module>\n.container {\n margin: 0;\n padding: 0;\n border: none;\n}\n.label {\n margin-block-end: 12px;\n padding: 0;\n color: var(--txt-01);\n line-height: calc(20 / 14);\n font-weight: 500;\n text-box: trim-both cap alphabetic;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EAWA,IAAM,IAAQ,EAAc,GAAA,aAAE,EAExB,IAAQ;AAaA,KAQV;EAEJ,IAAM,IAAe,EAAM,kBAAkB,GAAG,MAAM;SAEtD,EAAQ,GAAmB,EAAM,KAAK,EACtC,EAAQ,GAAoB,EAAM,kBAIhC,EAcW,YAAA;GAdA,OAAK,EAAEA,EAAAA,OAAO,UAAS;GAAE,eAAY;;GAC9C,EAES,UAAA;IAFA,OAAK,EAAEA,EAAAA,OAAO,MAAK;IAAE,eAAY;OACxC,EAAqB,EAAA,QAAA,QAAA,CAAA,EAAA,EAAA;WAEvB,EAQU,GAAA,MAAA,EAPc,EAAA,UAAd,GAAQ,YADlB,EAQU,GAAA;IANP,KAAK,EAAA,EAAY,CAAC,EAAO,OAAO,EAAC;IACjC,OAAO,EAAO;IACd,UAAU,EAAO;IAClB,eAAY;;qBAEM,CAAA,EAAA,EAAf,EAAO,MAAK,EAAA,EAAA,CAAA,CAAA;;;GAEjB,EAAQ,EAAA,QAAA,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlSearchField.js","names":[],"sources":["../../../src/components/PlSearchField/PlSearchField.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"V extends undefined | string, C extends V\">\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { computed } from \"vue\";\nimport PlTooltip from \"../PlTooltip/PlTooltip.vue\";\n\nconst model = defineModel<V>({ required: true });\n\nconst props = defineProps<{\n modelValue?: string;\n clearable?: boolean | (() => C);\n placeholder?: string;\n disabled?: boolean;\n helper?: string;\n}>();\nconst slots = defineSlots<{\n helper: () => unknown;\n}>();\n\nconst nonEmpty = computed(() => model.value != null && model.value.length > 0);\nconst hasHelper = computed(() => props.helper != null || slots.helper != null);\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n</script>\n\n<template>\n <div ref=\"root\" :class=\"$style.component\">\n <PlIcon24 name=\"search\" />\n <input\n ref=\"input\"\n v-model=\"model\"\n :disabled=\"props.disabled\"\n :placeholder=\"props.placeholder || 'Find...'\"\n type=\"text\"\n spellcheck=\"false\"\n />\n <PlIcon16\n v-if=\"props.clearable && nonEmpty\"\n :class=\"$style.clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n\n <PlTooltip v-if=\"hasHelper\" class=\"info\" position=\"bottom\">\n <template #tooltip>\n <slot name=\"helper\">\n {{ props.helper }}\n </slot>\n </template>\n </PlTooltip>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n.component {\n --pl-search-field-border-bottom-color: var(--txt-01);\n --pl-search-field-bg: transparent;\n --pl-search-field-caret-color: auto;\n --pl-search-field-clear-display: none;\n\n position: relative;\n display: flex;\n align-items: center;\n min-height: calc(var(--control-height) - 2px);\n line-height: calc(var(--control-height) - 2px);\n background-color: var(--pl-search-field-bg);\n padding: 0 0 0 0;\n border-bottom: 1px solid var(--pl-search-field-border-bottom-color);\n\n input {\n margin-left: 8px;\n width: 100%;\n height: 20px;\n border: none;\n outline: none;\n background-color: transparent;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n caret-color: var(--pl-search-field-caret-color);\n }\n\n &:focus-within {\n --pl-search-field-border-bottom-color: var(--txt-focus);\n --pl-search-field-caret-color: var(--border-color-focus);\n --pl-search-field-clear-display: block;\n }\n\n &:hover {\n --pl-search-field-clear-display: block;\n }\n\n .clear {\n --icon-color: var(--ic-02);\n cursor: pointer;\n margin-left: auto;\n display: var(--pl-search-field-clear-display);\n }\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlSearchField.js","names":[],"sources":["../../../src/components/PlSearchField/PlSearchField.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"V extends undefined | string, C extends V\">\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { computed } from \"vue\";\nimport PlTooltip from \"../PlTooltip/PlTooltip.vue\";\n\nconst model = defineModel<V>({ required: true });\n\nconst props = defineProps<{\n modelValue?: string;\n clearable?: boolean | (() => C);\n placeholder?: string;\n disabled?: boolean;\n helper?: string;\n}>();\nconst slots = defineSlots<{\n helper: () => unknown;\n}>();\n\nconst nonEmpty = computed(() => model.value != null && model.value.length > 0);\nconst hasHelper = computed(() => props.helper != null || slots.helper != null);\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n</script>\n\n<template>\n <div ref=\"root\" :class=\"$style.component\" data-testid=\"pl-search-field\">\n <PlIcon24 name=\"search\" data-testid=\"pl-search-field-icon\" />\n <input\n ref=\"input\"\n v-model=\"model\"\n :disabled=\"props.disabled\"\n :placeholder=\"props.placeholder || 'Find...'\"\n type=\"text\"\n spellcheck=\"false\"\n data-testid=\"pl-search-field-input\"\n />\n <PlIcon16\n v-if=\"props.clearable && nonEmpty\"\n :class=\"$style.clear\"\n name=\"delete-clear\"\n data-testid=\"pl-search-field-clear\"\n @click.stop=\"clear\"\n />\n\n <PlTooltip v-if=\"hasHelper\" class=\"info\" position=\"bottom\" data-testid=\"pl-search-field-helper\">\n <template #tooltip>\n <slot name=\"helper\">\n {{ props.helper }}\n </slot>\n </template>\n </PlTooltip>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n.component {\n --pl-search-field-border-bottom-color: var(--txt-01);\n --pl-search-field-bg: transparent;\n --pl-search-field-caret-color: auto;\n --pl-search-field-clear-display: none;\n\n position: relative;\n display: flex;\n align-items: center;\n min-height: calc(var(--control-height) - 2px);\n line-height: calc(var(--control-height) - 2px);\n background-color: var(--pl-search-field-bg);\n padding: 0 0 0 0;\n border-bottom: 1px solid var(--pl-search-field-border-bottom-color);\n\n input {\n margin-left: 8px;\n width: 100%;\n height: 20px;\n border: none;\n outline: none;\n background-color: transparent;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n caret-color: var(--pl-search-field-caret-color);\n }\n\n &:focus-within {\n --pl-search-field-border-bottom-color: var(--txt-focus);\n --pl-search-field-caret-color: var(--border-color-focus);\n --pl-search-field-clear-display: block;\n }\n\n &:hover {\n --pl-search-field-clear-display: block;\n }\n\n .clear {\n --icon-color: var(--ic-02);\n cursor: pointer;\n margin-left: auto;\n display: var(--pl-search-field-clear-display);\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlSearchField.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlSearchField/PlSearchField.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"V extends undefined | string, C extends V\">\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { computed } from \"vue\";\nimport PlTooltip from \"../PlTooltip/PlTooltip.vue\";\n\nconst model = defineModel<V>({ required: true });\n\nconst props = defineProps<{\n modelValue?: string;\n clearable?: boolean | (() => C);\n placeholder?: string;\n disabled?: boolean;\n helper?: string;\n}>();\nconst slots = defineSlots<{\n helper: () => unknown;\n}>();\n\nconst nonEmpty = computed(() => model.value != null && model.value.length > 0);\nconst hasHelper = computed(() => props.helper != null || slots.helper != null);\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n</script>\n\n<template>\n <div ref=\"root\" :class=\"$style.component\">\n <PlIcon24 name=\"search\" />\n <input\n ref=\"input\"\n v-model=\"model\"\n :disabled=\"props.disabled\"\n :placeholder=\"props.placeholder || 'Find...'\"\n type=\"text\"\n spellcheck=\"false\"\n />\n <PlIcon16\n v-if=\"props.clearable && nonEmpty\"\n :class=\"$style.clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n\n <PlTooltip v-if=\"hasHelper\" class=\"info\" position=\"bottom\">\n <template #tooltip>\n <slot name=\"helper\">\n {{ props.helper }}\n </slot>\n </template>\n </PlTooltip>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n.component {\n --pl-search-field-border-bottom-color: var(--txt-01);\n --pl-search-field-bg: transparent;\n --pl-search-field-caret-color: auto;\n --pl-search-field-clear-display: none;\n\n position: relative;\n display: flex;\n align-items: center;\n min-height: calc(var(--control-height) - 2px);\n line-height: calc(var(--control-height) - 2px);\n background-color: var(--pl-search-field-bg);\n padding: 0 0 0 0;\n border-bottom: 1px solid var(--pl-search-field-border-bottom-color);\n\n input {\n margin-left: 8px;\n width: 100%;\n height: 20px;\n border: none;\n outline: none;\n background-color: transparent;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n caret-color: var(--pl-search-field-caret-color);\n }\n\n &:focus-within {\n --pl-search-field-border-bottom-color: var(--txt-focus);\n --pl-search-field-caret-color: var(--border-color-focus);\n --pl-search-field-clear-display: block;\n }\n\n &:hover {\n --pl-search-field-clear-display: block;\n }\n\n .clear {\n --icon-color: var(--ic-02);\n cursor: pointer;\n margin-left: auto;\n display: var(--pl-search-field-clear-display);\n }\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlSearchField.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlSearchField/PlSearchField.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"V extends undefined | string, C extends V\">\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { computed } from \"vue\";\nimport PlTooltip from \"../PlTooltip/PlTooltip.vue\";\n\nconst model = defineModel<V>({ required: true });\n\nconst props = defineProps<{\n modelValue?: string;\n clearable?: boolean | (() => C);\n placeholder?: string;\n disabled?: boolean;\n helper?: string;\n}>();\nconst slots = defineSlots<{\n helper: () => unknown;\n}>();\n\nconst nonEmpty = computed(() => model.value != null && model.value.length > 0);\nconst hasHelper = computed(() => props.helper != null || slots.helper != null);\n\nconst clear = () => {\n if (props.clearable) {\n model.value = (typeof props.clearable === \"function\" ? props.clearable() : \"\") as V;\n }\n};\n</script>\n\n<template>\n <div ref=\"root\" :class=\"$style.component\" data-testid=\"pl-search-field\">\n <PlIcon24 name=\"search\" data-testid=\"pl-search-field-icon\" />\n <input\n ref=\"input\"\n v-model=\"model\"\n :disabled=\"props.disabled\"\n :placeholder=\"props.placeholder || 'Find...'\"\n type=\"text\"\n spellcheck=\"false\"\n data-testid=\"pl-search-field-input\"\n />\n <PlIcon16\n v-if=\"props.clearable && nonEmpty\"\n :class=\"$style.clear\"\n name=\"delete-clear\"\n data-testid=\"pl-search-field-clear\"\n @click.stop=\"clear\"\n />\n\n <PlTooltip v-if=\"hasHelper\" class=\"info\" position=\"bottom\" data-testid=\"pl-search-field-helper\">\n <template #tooltip>\n <slot name=\"helper\">\n {{ props.helper }}\n </slot>\n </template>\n </PlTooltip>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n.component {\n --pl-search-field-border-bottom-color: var(--txt-01);\n --pl-search-field-bg: transparent;\n --pl-search-field-caret-color: auto;\n --pl-search-field-clear-display: none;\n\n position: relative;\n display: flex;\n align-items: center;\n min-height: calc(var(--control-height) - 2px);\n line-height: calc(var(--control-height) - 2px);\n background-color: var(--pl-search-field-bg);\n padding: 0 0 0 0;\n border-bottom: 1px solid var(--pl-search-field-border-bottom-color);\n\n input {\n margin-left: 8px;\n width: 100%;\n height: 20px;\n border: none;\n outline: none;\n background-color: transparent;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n caret-color: var(--pl-search-field-caret-color);\n }\n\n &:focus-within {\n --pl-search-field-border-bottom-color: var(--txt-focus);\n --pl-search-field-caret-color: var(--border-color-focus);\n --pl-search-field-clear-display: block;\n }\n\n &:hover {\n --pl-search-field-clear-display: block;\n }\n\n .clear {\n --icon-color: var(--ic-02);\n cursor: pointer;\n margin-left: auto;\n display: var(--pl-search-field-clear-display);\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlSearchField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlSearchField/PlSearchField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlSearchField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlSearchField/PlSearchField.vue"],"names":[],"mappings":"AAkHA,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS,SAAS,GAAG,MAAM,EAAE,CAAC,SAAS,CAAC,EAC/D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI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