origam 2.40.1 → 2.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/dist/src/components/Alert/OrigamAlert.vue +1 -2
- package/dist/src/components/Audio/OrigamAudio.vue +15 -14
- package/dist/src/components/Badge/OrigamBadge.vue +6 -1
- package/dist/src/components/Bracket/OrigamBracket.vue +5 -5
- package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +2 -1
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +1 -2
- package/dist/src/components/Btn/OrigamBtn.vue +14 -15
- package/dist/src/components/Card/OrigamCard.vue +2 -1
- package/dist/src/components/Carousel/OrigamCarousel.vue +14 -13
- package/dist/src/components/Chart/OrigamChartBullet.vue +4 -1
- package/dist/src/components/Chart/OrigamChartCartesian.vue +1 -2
- package/dist/src/components/Chart/OrigamChartPictorial.vue +3 -6
- package/dist/src/components/Chart/OrigamChartPolar.vue +2 -1
- package/dist/src/components/Chart/OrigamChartPolarBar.vue +3 -1
- package/dist/src/components/Chart/OrigamChartSankey.vue +9 -167
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +14 -12
- package/dist/src/components/Chart/OrigamChartSunburst.vue +10 -2
- package/dist/src/components/Chart/OrigamChartWordCloud.vue +39 -36
- package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +3 -4
- package/dist/src/components/Chip/OrigamChip.vue +2 -3
- package/dist/src/components/Chip/OrigamChipGroup.vue +2 -3
- package/dist/src/components/Clipboard/OrigamClipboard.vue +1 -1
- package/dist/src/components/Code/OrigamCode.vue +9 -18
- package/dist/src/components/ColorPicker/OrigamColorPicker.vue +5 -1
- package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +1 -2
- package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +1 -2
- package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +1 -2
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +6 -2
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +2 -4
- package/dist/src/components/Counter/OrigamCounter.vue +1 -0
- package/dist/src/components/DataTable/OrigamDataTable.vue +6 -8
- package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +1 -2
- package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +3 -2
- package/dist/src/components/DataTable/OrigamDataTableRow.vue +2 -3
- package/dist/src/components/DataTable/OrigamDataTableRows.vue +43 -39
- package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +3 -4
- package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +1 -1
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1 -2
- package/dist/src/components/Dialog/OrigamDialog.vue +4 -12
- package/dist/src/components/Drawer/OrigamDrawer.vue +4 -2
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +2 -3
- package/dist/src/components/Field/OrigamField.vue +2 -6
- package/dist/src/components/FileField/OrigamFileField.vue +23 -6
- package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +3 -4
- package/dist/src/components/FileField/OrigamFileFieldListItem.vue +3 -4
- package/dist/src/components/Form/OrigamForm.vue +0 -2
- package/dist/src/components/Grids/OrigamRow.vue +8 -11
- package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +7 -7
- package/dist/src/components/Input/OrigamInput.vue +3 -11
- package/dist/src/components/List/OrigamListGroup.vue +2 -3
- package/dist/src/components/List/OrigamListItem.vue +4 -5
- package/dist/src/components/Media/OrigamMediaController.vue +15 -15
- package/dist/src/components/Media/OrigamMediaScrubber.vue +15 -12
- package/dist/src/components/Media/OrigamMediaVolumeControl.vue +4 -5
- package/dist/src/components/Menu/OrigamMenu.vue +1 -2
- package/dist/src/components/NumberField/OrigamNumberField.vue +7 -10
- package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +7 -1
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1 -1
- package/dist/src/components/Overlay/OrigamOverlay.vue +3 -4
- package/dist/src/components/Pagination/OrigamPagination.vue +4 -5
- package/dist/src/components/Parallax/OrigamParallaxElement.vue +1 -4
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +9 -7
- package/dist/src/components/Radio/OrigamRadioBtn.vue +2 -3
- package/dist/src/components/RatingField/OrigamRatingField.vue +1 -2
- package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +2 -3
- package/dist/src/components/Select/OrigamSelect.vue +135 -105
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +7 -2
- package/dist/src/components/Slide/OrigamSlideGroup.vue +7 -10
- package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +9 -10
- package/dist/src/components/Stepper/OrigamStepper.vue +7 -11
- package/dist/src/components/Stepper/OrigamStepperItem.vue +2 -3
- package/dist/src/components/Switch/OrigamSwitch.vue +0 -9
- package/dist/src/components/Tabs/OrigamTabs.vue +1 -1
- package/dist/src/components/TextField/OrigamTextField.vue +2 -5
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +3 -2
- package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +13 -14
- package/dist/src/components/Transition/OrigamExpandX.vue +4 -10
- package/dist/src/components/Transition/OrigamExpandY.vue +4 -10
- package/dist/src/components/Transition/OrigamSnack.vue +2 -8
- package/dist/src/components/Transition/OrigamTranslateScale.vue +4 -1
- package/dist/src/components/Treeview/OrigamTreeviewNode.vue +24 -18
- package/dist/src/components/Video/OrigamVideo.vue +14 -19
- package/dist/src/components/Window/OrigamWindow.vue +4 -6
- package/dist/src/composables/Audio/use-waveform.composable.cjs +24 -19
- package/dist/src/composables/Audio/use-waveform.composable.js +24 -19
- package/dist/src/composables/Calendar/calendar.composable.cjs +11 -11
- package/dist/src/composables/Calendar/calendar.composable.js +1 -1
- package/dist/src/composables/Chart/chart.composable.cjs +541 -415
- package/dist/src/composables/Chart/chart.composable.d.ts +2 -5
- package/dist/src/composables/Chart/chart.composable.js +392 -338
- package/dist/src/composables/Code/code.composable.cjs +4 -4
- package/dist/src/composables/Code/code.composable.js +1 -1
- package/dist/src/composables/Commons/accessibleCommand.composable.cjs +2 -1
- package/dist/src/composables/Commons/accessibleCommand.composable.js +2 -1
- package/dist/src/composables/Commons/backButton.composable.cjs +14 -18
- package/dist/src/composables/Commons/backButton.composable.d.ts +4 -2
- package/dist/src/composables/Commons/backButton.composable.js +14 -18
- package/dist/src/composables/Commons/backgroundColor.composable.cjs +7 -3
- package/dist/src/composables/Commons/backgroundColor.composable.js +6 -3
- package/dist/src/composables/Commons/bothColor.composable.cjs +6 -2
- package/dist/src/composables/Commons/bothColor.composable.js +7 -4
- package/dist/src/composables/Commons/color.composable.cjs +106 -48
- package/dist/src/composables/Commons/color.composable.js +55 -48
- package/dist/src/composables/Commons/colorEffect.composable.cjs +2 -1
- package/dist/src/composables/Commons/colorEffect.composable.js +3 -1
- package/dist/src/composables/Commons/createLayout.composable.cjs +3 -2
- package/dist/src/composables/Commons/createLayout.composable.js +3 -2
- package/dist/src/composables/Commons/cssSupportClient.composable.d.ts +2 -1
- package/dist/src/composables/Commons/display.composable.cjs +7 -1
- package/dist/src/composables/Commons/display.composable.js +2 -2
- package/dist/src/composables/Commons/dragResizer.composable.cjs +16 -18
- package/dist/src/composables/Commons/dragResizer.composable.d.ts +2 -2
- package/dist/src/composables/Commons/dragResizer.composable.js +9 -11
- package/dist/src/composables/Commons/elevation.composable.cjs +2 -1
- package/dist/src/composables/Commons/elevation.composable.js +2 -1
- package/dist/src/composables/Commons/group.composable.cjs +17 -14
- package/dist/src/composables/Commons/group.composable.js +19 -15
- package/dist/src/composables/Commons/locationStrategies.composable.d.ts +1 -1
- package/dist/src/composables/Commons/nested.composable.cjs +16 -16
- package/dist/src/composables/Commons/nested.composable.d.ts +1 -1
- package/dist/src/composables/Commons/nested.composable.js +1 -1
- package/dist/src/composables/Commons/nestedItem.composable.cjs +3 -3
- package/dist/src/composables/Commons/nestedItem.composable.d.ts +1 -1
- package/dist/src/composables/Commons/nestedItem.composable.js +1 -1
- package/dist/src/composables/Commons/passedProps.composable.cjs +1 -1
- package/dist/src/composables/Commons/passedProps.composable.js +1 -1
- package/dist/src/composables/Commons/size.composable.cjs +1 -1
- package/dist/src/composables/Commons/size.composable.js +1 -1
- package/dist/src/composables/Commons/stateEffect.composable.cjs +54 -32
- package/dist/src/composables/Commons/stateEffect.composable.js +43 -33
- package/dist/src/composables/Commons/teleport.composable.cjs +2 -1
- package/dist/src/composables/Commons/teleport.composable.js +4 -1
- package/dist/src/composables/Commons/textColor.composable.cjs +7 -3
- package/dist/src/composables/Commons/textColor.composable.js +6 -3
- package/dist/src/composables/Commons/touch.composable.cjs +80 -20
- package/dist/src/composables/Commons/touch.composable.js +80 -20
- package/dist/src/composables/Commons/vModel.composable.cjs +1 -1
- package/dist/src/composables/Commons/vModel.composable.js +1 -1
- package/dist/src/composables/Commons/validation.composable.cjs +1 -1
- package/dist/src/composables/Commons/validation.composable.js +1 -1
- package/dist/src/composables/Commons/velocity.composable.cjs +5 -1
- package/dist/src/composables/Commons/velocity.composable.js +5 -1
- package/dist/src/composables/DataTable/headers.composable.cjs +36 -30
- package/dist/src/composables/DataTable/headers.composable.d.ts +1 -1
- package/dist/src/composables/DataTable/headers.composable.js +29 -23
- package/dist/src/composables/DataTable/headersCell.composable.cjs +2 -2
- package/dist/src/composables/DataTable/headersCell.composable.js +1 -1
- package/dist/src/composables/DataTable/select.composable.cjs +4 -4
- package/dist/src/composables/DataTable/select.composable.js +1 -1
- package/dist/src/composables/DataTable/sort.composable.cjs +6 -6
- package/dist/src/composables/DataTable/sort.composable.js +1 -1
- package/dist/src/composables/Form/form.composable.cjs +1 -1
- package/dist/src/composables/Form/form.composable.js +3 -1
- package/dist/src/composables/Masonry/masonry.composable.cjs +29 -20
- package/dist/src/composables/Masonry/masonry.composable.d.ts +0 -14
- package/dist/src/composables/Masonry/masonry.composable.js +29 -20
- package/dist/src/composables/NumberFormat/number-format.composable.cjs +28 -23
- package/dist/src/composables/NumberFormat/number-format.composable.js +28 -23
- package/dist/src/composables/Parallax/parallax.composable.cjs +11 -19
- package/dist/src/composables/Parallax/parallax.composable.js +5 -13
- package/dist/src/composables/Parallax/transform.composable.cjs +14 -13
- package/dist/src/composables/Parallax/transform.composable.js +2 -1
- package/dist/src/composables/PasswordField/passwordStrength.composable.cjs +2 -2
- package/dist/src/composables/PasswordField/passwordStrength.composable.js +1 -1
- package/dist/src/composables/QrCode/qr-code.composable.cjs +1 -1
- package/dist/src/composables/QrCode/qr-code.composable.js +1 -1
- package/dist/src/composables/Sheet/sheetSwipe.composable.cjs +3 -4
- package/dist/src/composables/Sheet/sheetSwipe.composable.js +4 -4
- package/dist/src/composables/TextareaField/textarea-field-rich.composable.cjs +31 -31
- package/dist/src/composables/TextareaField/textarea-field-rich.composable.js +1 -1
- package/dist/src/composables/Watermark/watermark.composable.cjs +1 -1
- package/dist/src/composables/Watermark/watermark.composable.js +1 -1
- package/dist/src/consts/Audio/audio.const.cjs +5 -4
- package/dist/src/consts/Audio/audio.const.d.ts +2 -1
- package/dist/src/consts/Audio/audio.const.js +2 -1
- package/dist/src/consts/Blockquote/blockquote.const.cjs +3 -3
- package/dist/src/consts/Blockquote/blockquote.const.js +1 -1
- package/dist/src/consts/Bracket/bracket.const.cjs +4 -3
- package/dist/src/consts/Bracket/bracket.const.js +2 -1
- package/dist/src/consts/Code/code.const.cjs +3 -3
- package/dist/src/consts/Code/code.const.d.ts +1 -1
- package/dist/src/consts/Code/code.const.js +1 -1
- package/dist/src/consts/Commons/autocomplete.const.cjs +2 -2
- package/dist/src/consts/Commons/autocomplete.const.d.ts +1 -1
- package/dist/src/consts/Commons/autocomplete.const.js +1 -1
- package/dist/src/consts/Commons/border.const.cjs +5 -1
- package/dist/src/consts/Commons/border.const.js +5 -1
- package/dist/src/consts/Commons/display.const.cjs +2 -2
- package/dist/src/consts/Commons/display.const.js +1 -1
- package/dist/src/consts/Commons/hotkey.const.cjs +2 -2
- package/dist/src/consts/Commons/hotkey.const.js +1 -1
- package/dist/src/consts/Commons/margin.const.cjs +1 -1
- package/dist/src/consts/Commons/margin.const.js +1 -1
- package/dist/src/consts/Commons/padding.const.cjs +1 -1
- package/dist/src/consts/Commons/padding.const.js +1 -1
- package/dist/src/consts/Commons/rounded.const.cjs +6 -2
- package/dist/src/consts/Commons/rounded.const.js +6 -2
- package/dist/src/consts/EmptyState/empty-state.const.cjs +12 -12
- package/dist/src/consts/EmptyState/empty-state.const.js +6 -6
- package/dist/src/consts/PasswordField/password-field.const.cjs +1 -1
- package/dist/src/consts/PasswordField/password-field.const.js +1 -1
- package/dist/src/consts/QrCode/qr-code.const.cjs +2 -2
- package/dist/src/consts/QrCode/qr-code.const.js +1 -1
- package/dist/src/consts/TextField/text-field.const.cjs +21 -21
- package/dist/src/consts/TextField/text-field.const.d.ts +1 -2
- package/dist/src/consts/TextField/text-field.const.js +1 -2
- package/dist/src/consts/TextareaField/textarea-field.const.cjs +32 -4
- package/dist/src/consts/TextareaField/textarea-field.const.d.ts +1 -0
- package/dist/src/consts/TextareaField/textarea-field.const.js +29 -1
- package/dist/src/directives/Contrast/contrast.directive.cjs +6 -4
- package/dist/src/directives/Contrast/contrast.directive.js +6 -4
- package/dist/src/directives/Intersect/intersect.directive.cjs +2 -1
- package/dist/src/directives/Intersect/intersect.directive.js +2 -1
- package/dist/src/enums/BottomNav/bottom-nav.enum.cjs +4 -5
- package/dist/src/enums/BottomNav/bottom-nav.enum.js +4 -5
- package/dist/src/interfaces/Blockquote/blockquote.interface.d.ts +1 -1
- package/dist/src/interfaces/Chart/chart-map.interface.d.ts +5 -4
- package/dist/src/interfaces/Chart/chart.interface.d.ts +70 -1
- package/dist/src/interfaces/ColorPicker/color-picker.interface.d.ts +1 -1
- package/dist/src/interfaces/Commons/activator.interface.d.ts +1 -1
- package/dist/src/interfaces/Commons/border.interface.d.ts +11 -10
- package/dist/src/interfaces/Commons/filters.interface.d.ts +7 -0
- package/dist/src/interfaces/Commons/margin.interface.d.ts +12 -11
- package/dist/src/interfaces/Commons/padding.interface.d.ts +12 -11
- package/dist/src/interfaces/Commons/ripple.interface.d.ts +1 -3
- package/dist/src/interfaces/Commons/rounded.interface.d.ts +10 -9
- package/dist/src/interfaces/DataTable/sort.interface.d.ts +6 -0
- package/dist/src/interfaces/Grid/grid.interface.d.ts +4 -4
- package/dist/src/interfaces/Parallax/parallax.interface.d.ts +3 -2
- package/dist/src/interfaces/SliderField/slider-field.interface.d.ts +4 -4
- package/dist/src/origam-core.cjs +52 -34
- package/dist/src/origam-core.js +22 -28
- package/dist/src/types/Commons/box-value.type.cjs +1 -0
- package/dist/src/types/Commons/box-value.type.d.ts +1 -0
- package/dist/src/types/Commons/box-value.type.js +0 -0
- package/dist/src/types/Commons/location.type.d.ts +13 -0
- package/dist/src/types/Commons/point.type.d.ts +1 -1
- package/dist/src/types/DataTable/data-table.type.d.ts +1 -0
- package/dist/src/types/Grid/grid.type.d.ts +7 -0
- package/dist/src/types/Grids/row.type.d.ts +2 -1
- package/dist/src/types/Parallax/parallax.type.d.ts +1 -2
- package/dist/src/types/SliderField/slider-field.type.d.ts +8 -0
- package/dist/src/types/TextField/text-field.type.d.ts +2 -1
- package/dist/src/utils/Bracket/bracket-surface.util.cjs +9 -2
- package/dist/src/utils/Bracket/bracket-surface.util.js +9 -2
- package/dist/src/utils/Calendar/rrule.util.cjs +12 -7
- package/dist/src/utils/Calendar/rrule.util.js +12 -7
- package/dist/src/utils/Chart/chart-point.util.cjs +15 -0
- package/dist/src/utils/Chart/chart-point.util.d.ts +11 -0
- package/dist/src/utils/Chart/chart-point.util.js +8 -0
- package/dist/src/utils/Chart/sankey-layout.util.cjs +144 -0
- package/dist/src/utils/Chart/sankey-layout.util.d.ts +27 -0
- package/dist/src/utils/Chart/sankey-layout.util.js +130 -0
- package/dist/src/utils/Code/parse-highlight-lines.util.cjs +17 -14
- package/dist/src/utils/Code/parse-highlight-lines.util.js +17 -14
- package/dist/src/utils/CommandPalette/fuzzy-match.util.cjs +13 -9
- package/dist/src/utils/CommandPalette/fuzzy-match.util.js +13 -9
- package/dist/src/utils/Commons/anchor.util.cjs +6 -1
- package/dist/src/utils/Commons/anchor.util.js +6 -1
- package/dist/src/utils/Commons/animation.util.cjs +7 -4
- package/dist/src/utils/Commons/animation.util.js +4 -1
- package/dist/src/utils/Commons/apply-mask.util.cjs +11 -14
- package/dist/src/utils/Commons/apply-mask.util.js +7 -10
- package/dist/src/utils/Commons/apply-theme.util.cjs +6 -4
- package/dist/src/utils/Commons/apply-theme.util.js +6 -4
- package/dist/src/utils/Commons/bindProps.util.cjs +3 -5
- package/dist/src/utils/Commons/bindProps.util.js +3 -5
- package/dist/src/utils/Commons/color.util.cjs +43 -36
- package/dist/src/utils/Commons/color.util.js +44 -31
- package/dist/src/utils/Commons/commons.util.cjs +3 -3
- package/dist/src/utils/Commons/commons.util.js +3 -3
- package/dist/src/utils/Commons/console.util.cjs +6 -0
- package/dist/src/utils/Commons/console.util.d.ts +11 -0
- package/dist/src/utils/Commons/console.util.js +5 -0
- package/dist/src/utils/Commons/date.util.cjs +2 -27
- package/dist/src/utils/Commons/date.util.js +2 -27
- package/dist/src/utils/Commons/display.util.cjs +10 -1
- package/dist/src/utils/Commons/display.util.d.ts +8 -1
- package/dist/src/utils/Commons/display.util.js +9 -1
- package/dist/src/utils/Commons/eventListener.util.cjs +1 -2
- package/dist/src/utils/Commons/eventListener.util.js +1 -2
- package/dist/src/utils/Commons/filters.util.cjs +48 -34
- package/dist/src/utils/Commons/filters.util.d.ts +3 -8
- package/dist/src/utils/Commons/filters.util.js +47 -34
- package/dist/src/utils/Commons/forwardRefs.util.cjs +44 -40
- package/dist/src/utils/Commons/forwardRefs.util.js +44 -40
- package/dist/src/utils/Commons/group.util.cjs +1 -1
- package/dist/src/utils/Commons/group.util.js +1 -1
- package/dist/src/utils/Commons/hotkey.util.cjs +65 -61
- package/dist/src/utils/Commons/hotkey.util.js +56 -53
- package/dist/src/utils/Commons/hover.util.cjs +2 -2
- package/dist/src/utils/Commons/hover.util.js +2 -2
- package/dist/src/utils/Commons/locale.util.cjs +1 -1
- package/dist/src/utils/Commons/locale.util.js +1 -1
- package/dist/src/utils/Commons/location.util.cjs +87 -92
- package/dist/src/utils/Commons/location.util.js +75 -83
- package/dist/src/utils/Commons/nested.util.cjs +12 -10
- package/dist/src/utils/Commons/nested.util.js +5 -2
- package/dist/src/utils/Commons/point.util.cjs +16 -14
- package/dist/src/utils/Commons/point.util.js +13 -8
- package/dist/src/utils/Commons/ripple.util.cjs +4 -4
- package/dist/src/utils/Commons/ripple.util.js +4 -4
- package/dist/src/utils/Commons/scroll.util.cjs +9 -6
- package/dist/src/utils/Commons/scroll.util.js +9 -6
- package/dist/src/utils/Commons/spacing.util.cjs +1 -1
- package/dist/src/utils/Commons/spacing.util.js +1 -1
- package/dist/src/utils/Commons/token-name.util.cjs +31 -27
- package/dist/src/utils/Commons/token-name.util.js +31 -27
- package/dist/src/utils/Commons/validate-pattern.util.cjs +6 -6
- package/dist/src/utils/Commons/validate-pattern.util.js +1 -1
- package/dist/src/utils/DataTable/headers.util.cjs +20 -26
- package/dist/src/utils/DataTable/headers.util.js +18 -26
- package/dist/src/utils/DataTable/sort.util.cjs +41 -47
- package/dist/src/utils/DataTable/sort.util.d.ts +2 -7
- package/dist/src/utils/DataTable/sort.util.js +49 -47
- package/dist/src/utils/List/list-item.util.cjs +6 -1
- package/dist/src/utils/List/list-item.util.js +6 -1
- package/dist/src/utils/Parallax/parallax-element.util.cjs +13 -14
- package/dist/src/utils/Parallax/parallax-element.util.js +10 -11
- package/dist/src/utils/Slide/slide-group.util.cjs +4 -4
- package/dist/src/utils/Slide/slide-group.util.js +4 -4
- package/dist/src/utils/TextareaField/html-to-markdown.util.cjs +5 -36
- package/dist/src/utils/TextareaField/html-to-markdown.util.js +5 -36
- package/dist/src/utils/TextareaField/sanitize-html.util.cjs +18 -22
- package/dist/src/utils/TextareaField/sanitize-html.util.js +19 -23
- package/dist/src/utils/index.cjs +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/package.json +1 -1
|
@@ -6,49 +6,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useDragResizer = useDragResizer;
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _eventListener = require("./eventListener.composable.cjs");
|
|
9
|
-
var
|
|
10
|
-
var _commons = require("../../
|
|
9
|
+
var _drag = require("../../enums/Commons/drag.enum.cjs");
|
|
10
|
+
var _commons = require("../../enums/Commons/commons.enum.cjs");
|
|
11
|
+
var _commons2 = require("../../utils/Commons/commons.util.cjs");
|
|
11
12
|
function useDragResizer(el, value, min, max, axis) {
|
|
12
13
|
const resizing = (0, _vue.ref)(false);
|
|
13
14
|
const removeListeners = [];
|
|
14
15
|
const onUnmountedCleanupFns = [];
|
|
15
|
-
(0,
|
|
16
|
+
(0, _commons2.tryOnScopeDispose)(() => {
|
|
16
17
|
onUnmountedCleanupFns.forEach(fn => fn());
|
|
17
18
|
});
|
|
18
19
|
const isHorizontal = (0, _vue.computed)(() => {
|
|
19
|
-
return axis ===
|
|
20
|
+
return axis === _drag.AXIS.X;
|
|
20
21
|
});
|
|
21
22
|
const onDragEnd = () => {
|
|
22
23
|
removeListeners.forEach(fn => fn());
|
|
23
24
|
resizing.value = false;
|
|
24
25
|
};
|
|
26
|
+
const moveHandler = (start, initialStart) => e => {
|
|
27
|
+
const clickOffset = (0, _commons2.getPosition)(e, isHorizontal.value ? _commons.CLIENT_POSITION.X : _commons.CLIENT_POSITION.Y);
|
|
28
|
+
const delta = clickOffset - start;
|
|
29
|
+
value.value = (0, _commons2.clamp)(initialStart + delta, (0, _vue.toValue)(min), (0, _vue.toValue)(max));
|
|
30
|
+
};
|
|
25
31
|
const onMouseDown = e => {
|
|
26
32
|
e.preventDefault();
|
|
27
33
|
e.stopPropagation();
|
|
28
|
-
const start = (0,
|
|
34
|
+
const start = (0, _commons2.getPosition)(e, isHorizontal.value ? _commons.CLIENT_POSITION.X : _commons.CLIENT_POSITION.Y);
|
|
29
35
|
const initialStart = value.value;
|
|
30
36
|
resizing.value = true;
|
|
31
|
-
const onMouseMove =
|
|
32
|
-
const clickOffset = (0, _commons.getPosition)(e2, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
|
|
33
|
-
const delta = clickOffset - start;
|
|
34
|
-
value.value = (0, _commons.clamp)(initialStart + delta, (0, _vue.toValue)(min), (0, _vue.toValue)(max));
|
|
35
|
-
};
|
|
37
|
+
const onMouseMove = moveHandler(start, initialStart);
|
|
36
38
|
const onMouseUp = onDragEnd;
|
|
37
|
-
removeListeners.push(...[(0,
|
|
39
|
+
removeListeners.push(...[(0, _commons2.addWindowListener)("mousemove", onMouseMove, onUnmountedCleanupFns), (0, _commons2.addWindowListener)("mouseup", onMouseUp, onUnmountedCleanupFns)]);
|
|
38
40
|
};
|
|
39
41
|
const onTouchStart = e => {
|
|
40
42
|
e.preventDefault();
|
|
41
43
|
e.stopPropagation();
|
|
42
|
-
const start = (0,
|
|
44
|
+
const start = (0, _commons2.getPosition)(e, isHorizontal.value ? _commons.CLIENT_POSITION.X : _commons.CLIENT_POSITION.Y);
|
|
43
45
|
const initialStart = value.value;
|
|
44
46
|
resizing.value = true;
|
|
45
|
-
const onTouchMove =
|
|
46
|
-
const clickOffset = (0, _commons.getPosition)(e2, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
|
|
47
|
-
const delta = clickOffset - start;
|
|
48
|
-
value.value = (0, _commons.clamp)(initialStart + delta, (0, _vue.toValue)(min), (0, _vue.toValue)(max));
|
|
49
|
-
};
|
|
47
|
+
const onTouchMove = moveHandler(start, initialStart);
|
|
50
48
|
const onTouchEnd = onDragEnd;
|
|
51
|
-
removeListeners.push(...[(0,
|
|
49
|
+
removeListeners.push(...[(0, _commons2.addWindowListener)("touchmove", onTouchMove, onUnmountedCleanupFns), (0, _commons2.addWindowListener)("touchend", onTouchEnd, onUnmountedCleanupFns), (0, _commons2.addWindowListener)("touchcancel", onTouchEnd, onUnmountedCleanupFns)]);
|
|
52
50
|
};
|
|
53
51
|
if (el) {
|
|
54
52
|
(0, _eventListener.useEventListener)(el, "mousedown", onMouseDown);
|
|
@@ -12,8 +12,8 @@ import type { TAxis } from '../../types/Commons/axis.type';
|
|
|
12
12
|
*
|
|
13
13
|
* @description
|
|
14
14
|
* ⛔ Seul l'axe `X` (`AXIS.X`) est reellement gere : `isVertical` est
|
|
15
|
-
* commente en mort dans le code et un
|
|
16
|
-
* l'annonce explicitement. Passer `AXIS.Y` fait juste tomber dans la
|
|
15
|
+
* commente en mort dans le code et un commentaire de rework (« Rework for
|
|
16
|
+
* both axis ») l'annonce explicitement. Passer `AXIS.Y` fait juste tomber dans la
|
|
17
17
|
* branche verticale de `getPosition` sans etre teste par ce composable.
|
|
18
18
|
*
|
|
19
19
|
* @description
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { computed, ref, toValue } from "vue";
|
|
2
2
|
import { useEventListener } from "./eventListener.composable.js";
|
|
3
|
-
import { AXIS
|
|
3
|
+
import { AXIS } from "../../enums/Commons/drag.enum.js";
|
|
4
|
+
import { CLIENT_POSITION } from "../../enums/Commons/commons.enum.js";
|
|
4
5
|
import { addWindowListener, clamp, getPosition, tryOnScopeDispose } from "../../utils/Commons/commons.util.js";
|
|
5
6
|
export function useDragResizer(el, value, min, max, axis) {
|
|
6
7
|
const resizing = ref(false);
|
|
@@ -16,17 +17,18 @@ export function useDragResizer(el, value, min, max, axis) {
|
|
|
16
17
|
removeListeners.forEach((fn) => fn());
|
|
17
18
|
resizing.value = false;
|
|
18
19
|
};
|
|
20
|
+
const moveHandler = (start, initialStart) => (e) => {
|
|
21
|
+
const clickOffset = getPosition(e, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
22
|
+
const delta = clickOffset - start;
|
|
23
|
+
value.value = clamp(initialStart + delta, toValue(min), toValue(max));
|
|
24
|
+
};
|
|
19
25
|
const onMouseDown = (e) => {
|
|
20
26
|
e.preventDefault();
|
|
21
27
|
e.stopPropagation();
|
|
22
28
|
const start = getPosition(e, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
23
29
|
const initialStart = value.value;
|
|
24
30
|
resizing.value = true;
|
|
25
|
-
const onMouseMove = (
|
|
26
|
-
const clickOffset = getPosition(e2, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
27
|
-
const delta = clickOffset - start;
|
|
28
|
-
value.value = clamp(initialStart + delta, toValue(min), toValue(max));
|
|
29
|
-
};
|
|
31
|
+
const onMouseMove = moveHandler(start, initialStart);
|
|
30
32
|
const onMouseUp = onDragEnd;
|
|
31
33
|
removeListeners.push(...[
|
|
32
34
|
addWindowListener("mousemove", onMouseMove, onUnmountedCleanupFns),
|
|
@@ -39,11 +41,7 @@ export function useDragResizer(el, value, min, max, axis) {
|
|
|
39
41
|
const start = getPosition(e, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
40
42
|
const initialStart = value.value;
|
|
41
43
|
resizing.value = true;
|
|
42
|
-
const onTouchMove = (
|
|
43
|
-
const clickOffset = getPosition(e2, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
44
|
-
const delta = clickOffset - start;
|
|
45
|
-
value.value = clamp(initialStart + delta, toValue(min), toValue(max));
|
|
46
|
-
};
|
|
44
|
+
const onTouchMove = moveHandler(start, initialStart);
|
|
47
45
|
const onTouchEnd = onDragEnd;
|
|
48
46
|
removeListeners.push(...[
|
|
49
47
|
addWindowListener("touchmove", onTouchMove, onUnmountedCleanupFns),
|
|
@@ -21,7 +21,8 @@ function isUtilityRung(value) {
|
|
|
21
21
|
}
|
|
22
22
|
function shadowVar(rung) {
|
|
23
23
|
const fallback = _elevation.SHADOW_RUNG_FALLBACK[rung];
|
|
24
|
-
|
|
24
|
+
const fallbackArg = fallback ? `, ${fallback}` : "";
|
|
25
|
+
return `var(${_elevation.SHADOW_TOKEN_PREFIX}${rung}${fallbackArg})`;
|
|
25
26
|
}
|
|
26
27
|
const _bgWarned = /* @__PURE__ */new WeakSet();
|
|
27
28
|
function warnBgColorUsage(bgColor) {
|
|
@@ -24,7 +24,8 @@ function isUtilityRung(value) {
|
|
|
24
24
|
}
|
|
25
25
|
function shadowVar(rung) {
|
|
26
26
|
const fallback = SHADOW_RUNG_FALLBACK[rung];
|
|
27
|
-
|
|
27
|
+
const fallbackArg = fallback ? `, ${fallback}` : "";
|
|
28
|
+
return `var(${SHADOW_TOKEN_PREFIX}${rung}${fallbackArg})`;
|
|
28
29
|
}
|
|
29
30
|
const _bgWarned = /* @__PURE__ */ new WeakSet();
|
|
30
31
|
function warnBgColorUsage(bgColor) {
|
|
@@ -53,23 +53,26 @@ function useGroup(props, injectKey) {
|
|
|
53
53
|
(0, _vue.onBeforeUnmount)(() => {
|
|
54
54
|
isUnmounted = true;
|
|
55
55
|
});
|
|
56
|
+
const selectMultiple = (id, value) => {
|
|
57
|
+
const internalValue = selected.value.slice();
|
|
58
|
+
const index = internalValue.findIndex(v => v === id);
|
|
59
|
+
const isSelected = ~index;
|
|
60
|
+
const newValue = value ?? !isSelected;
|
|
61
|
+
if (isSelected && props.mandatory && internalValue.length <= 1) return;
|
|
62
|
+
if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
|
|
63
|
+
if (index < 0 && newValue) internalValue.push(id);else if (index >= 0 && !newValue) internalValue.splice(index, 1);
|
|
64
|
+
selected.value = internalValue;
|
|
65
|
+
};
|
|
66
|
+
const selectSingle = (id, value) => {
|
|
67
|
+
const isSelected = selected.value.includes(id);
|
|
68
|
+
if (props.mandatory && isSelected) return;
|
|
69
|
+
const shouldSelect = value ?? !isSelected;
|
|
70
|
+
selected.value = shouldSelect ? [id] : [];
|
|
71
|
+
};
|
|
56
72
|
const select = (id, value) => {
|
|
57
73
|
const item = items.find(item2 => item2.id === id);
|
|
58
74
|
if (value && item?.disabled) return;
|
|
59
|
-
if (props.multiple)
|
|
60
|
-
const internalValue = selected.value.slice();
|
|
61
|
-
const index = internalValue.findIndex(v => v === id);
|
|
62
|
-
const isSelected = ~index;
|
|
63
|
-
const newValue = value !== void 0 ? value : !isSelected;
|
|
64
|
-
if (isSelected && props.mandatory && internalValue.length <= 1) return;
|
|
65
|
-
if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
|
|
66
|
-
if (index < 0 && newValue) internalValue.push(id);else if (index >= 0 && !newValue) internalValue.splice(index, 1);
|
|
67
|
-
selected.value = internalValue;
|
|
68
|
-
} else {
|
|
69
|
-
const isSelected = selected.value.includes(id);
|
|
70
|
-
if (props.mandatory && isSelected) return;
|
|
71
|
-
selected.value = (value !== void 0 ? value : !isSelected) ? [id] : [];
|
|
72
|
-
}
|
|
75
|
+
if (props.multiple) selectMultiple(id, value);else selectSingle(id, value);
|
|
73
76
|
};
|
|
74
77
|
const step = offset => {
|
|
75
78
|
if (props.multiple) (0, _console.consoleWarn)('This method is not supported when using "multiple" prop');
|
|
@@ -53,24 +53,28 @@ export function useGroup(props, injectKey) {
|
|
|
53
53
|
onBeforeUnmount(() => {
|
|
54
54
|
isUnmounted = true;
|
|
55
55
|
});
|
|
56
|
+
const selectMultiple = (id, value) => {
|
|
57
|
+
const internalValue = selected.value.slice();
|
|
58
|
+
const index = internalValue.findIndex((v) => v === id);
|
|
59
|
+
const isSelected = ~index;
|
|
60
|
+
const newValue = value ?? !isSelected;
|
|
61
|
+
if (isSelected && props.mandatory && internalValue.length <= 1) return;
|
|
62
|
+
if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
|
|
63
|
+
if (index < 0 && newValue) internalValue.push(id);
|
|
64
|
+
else if (index >= 0 && !newValue) internalValue.splice(index, 1);
|
|
65
|
+
selected.value = internalValue;
|
|
66
|
+
};
|
|
67
|
+
const selectSingle = (id, value) => {
|
|
68
|
+
const isSelected = selected.value.includes(id);
|
|
69
|
+
if (props.mandatory && isSelected) return;
|
|
70
|
+
const shouldSelect = value ?? !isSelected;
|
|
71
|
+
selected.value = shouldSelect ? [id] : [];
|
|
72
|
+
};
|
|
56
73
|
const select = (id, value) => {
|
|
57
74
|
const item = items.find((item2) => item2.id === id);
|
|
58
75
|
if (value && item?.disabled) return;
|
|
59
|
-
if (props.multiple)
|
|
60
|
-
|
|
61
|
-
const index = internalValue.findIndex((v) => v === id);
|
|
62
|
-
const isSelected = ~index;
|
|
63
|
-
const newValue = value !== void 0 ? value : !isSelected;
|
|
64
|
-
if (isSelected && props.mandatory && internalValue.length <= 1) return;
|
|
65
|
-
if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
|
|
66
|
-
if (index < 0 && newValue) internalValue.push(id);
|
|
67
|
-
else if (index >= 0 && !newValue) internalValue.splice(index, 1);
|
|
68
|
-
selected.value = internalValue;
|
|
69
|
-
} else {
|
|
70
|
-
const isSelected = selected.value.includes(id);
|
|
71
|
-
if (props.mandatory && isSelected) return;
|
|
72
|
-
selected.value = (value !== void 0 ? value : !isSelected) ? [id] : [];
|
|
73
|
-
}
|
|
76
|
+
if (props.multiple) selectMultiple(id, value);
|
|
77
|
+
else selectSingle(id, value);
|
|
74
78
|
};
|
|
75
79
|
const step = (offset) => {
|
|
76
80
|
if (props.multiple) consoleWarn('This method is not supported when using "multiple" prop');
|
|
@@ -11,7 +11,7 @@ import type { ILocationStrategyData, ILocationStrategyProps } from '../../interf
|
|
|
11
11
|
*
|
|
12
12
|
* @description
|
|
13
13
|
* ⛔ `locationStrategy="static"` NE POSITIONNE RIEN. `staticLocationStrategy`
|
|
14
|
-
* (utils/Commons/location.util.ts) a un corps reduit a
|
|
14
|
+
* (utils/Commons/location.util.ts) a un corps reduit a un commentaire de tache restante : elle rend
|
|
15
15
|
* `undefined`, donc `updateLocation` reste `undefined` et `contentStyles`
|
|
16
16
|
* reste `{}`. Mesure, contenu et cible reels attaches au document :
|
|
17
17
|
* `static` → `contentStyles = {}` / `updateLocation = undefined` ;
|
|
@@ -7,9 +7,9 @@ exports.useNested = void 0;
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _vModel = require("./vModel.composable.cjs");
|
|
9
9
|
var _nested = require("../../consts/Commons/nested.const.cjs");
|
|
10
|
-
var
|
|
10
|
+
var _nested2 = require("../../enums/Commons/nested.enum.cjs");
|
|
11
11
|
var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.cjs");
|
|
12
|
-
var
|
|
12
|
+
var _nested3 = require("../../utils/Commons/nested.util.cjs");
|
|
13
13
|
const useNested = props => {
|
|
14
14
|
let isUnmounted = false;
|
|
15
15
|
let openedTouchedBeforeMount = false;
|
|
@@ -27,27 +27,27 @@ const useNested = props => {
|
|
|
27
27
|
const selectStrategy = (0, _vue.computed)(() => {
|
|
28
28
|
if (typeof props.selectStrategy === "object") return props.selectStrategy;
|
|
29
29
|
switch (props.selectStrategy) {
|
|
30
|
-
case
|
|
31
|
-
return (0,
|
|
32
|
-
case
|
|
33
|
-
return (0,
|
|
34
|
-
case
|
|
35
|
-
return (0,
|
|
36
|
-
case
|
|
37
|
-
return (0,
|
|
38
|
-
case
|
|
30
|
+
case _nested2.SELECT_STRATEGY.SINGLE_LEAF:
|
|
31
|
+
return (0, _nested3.leafSingleSelectStrategy)(props.mandatory);
|
|
32
|
+
case _nested2.SELECT_STRATEGY.LEAF:
|
|
33
|
+
return (0, _nested3.leafSelectStrategy)(props.mandatory);
|
|
34
|
+
case _nested2.SELECT_STRATEGY.INDEPENDENT:
|
|
35
|
+
return (0, _nested3.independentSelectStrategy)(props.mandatory);
|
|
36
|
+
case _nested2.SELECT_STRATEGY.SINGLE_INDEPENDENT:
|
|
37
|
+
return (0, _nested3.independentSingleSelectStrategy)(props.mandatory);
|
|
38
|
+
case _nested2.SELECT_STRATEGY.CLASSIC:
|
|
39
39
|
default:
|
|
40
|
-
return (0,
|
|
40
|
+
return (0, _nested3.classicSelectStrategy)(props.mandatory);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
const openStrategy = (0, _vue.computed)(() => {
|
|
44
44
|
if (typeof props.openStrategy === "object") return props.openStrategy;
|
|
45
45
|
switch (props.openStrategy) {
|
|
46
|
-
case
|
|
46
|
+
case _nested2.OPEN_STRATEGY.LIST:
|
|
47
47
|
return _nested.LIST_OPEN_STRATEGY;
|
|
48
|
-
case
|
|
48
|
+
case _nested2.OPEN_STRATEGY.SINGLE:
|
|
49
49
|
return _nested.SINGLE_OPEN_STRATEGY;
|
|
50
|
-
case
|
|
50
|
+
case _nested2.OPEN_STRATEGY.MULTIPLE:
|
|
51
51
|
default:
|
|
52
52
|
return _nested.MULTIPLE_OPEN_STRATEGY;
|
|
53
53
|
}
|
|
@@ -75,7 +75,7 @@ const useNested = props => {
|
|
|
75
75
|
const arr = [];
|
|
76
76
|
if (selected.value) {
|
|
77
77
|
for (const [key, value] of selected.value.entries()) {
|
|
78
|
-
if (value ===
|
|
78
|
+
if (value === _nested2.SELECTED.ON) arr.push(key);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
return arr;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, onBeforeUnmount, onMounted, provide, ref, shallowRef, watch } from "vue";
|
|
2
2
|
import { useVModel } from "./vModel.composable.js";
|
|
3
3
|
import { LIST_OPEN_STRATEGY, MULTIPLE_OPEN_STRATEGY, ORIGAM_NESTED_KEY, SINGLE_OPEN_STRATEGY } from "../../consts/Commons/nested.const.js";
|
|
4
|
-
import { OPEN_STRATEGY, SELECTED, SELECT_STRATEGY } from "../../enums/
|
|
4
|
+
import { OPEN_STRATEGY, SELECTED, SELECT_STRATEGY } from "../../enums/Commons/nested.enum.js";
|
|
5
5
|
import { getCurrentInstance } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
6
6
|
import { classicSelectStrategy, independentSelectStrategy, independentSingleSelectStrategy, leafSelectStrategy, leafSingleSelectStrategy } from "../../utils/Commons/nested.util.js";
|
|
7
7
|
export const useNested = (props) => {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useNestedItem = useNestedItem;
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _nested = require("../../consts/Commons/nested.const.cjs");
|
|
9
|
-
var
|
|
9
|
+
var _nested2 = require("../../enums/Commons/nested.enum.cjs");
|
|
10
10
|
var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.cjs");
|
|
11
11
|
function useNestedItem(id, isGroup) {
|
|
12
12
|
const parent = (0, _vue.inject)(_nested.ORIGAM_NESTED_KEY, _nested.EMPTY_NESTED);
|
|
@@ -32,8 +32,8 @@ function useNestedItem(id, isGroup) {
|
|
|
32
32
|
parent.root.select(computedId.value, selected, e);
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
isSelected: (0, _vue.computed)(() => Boolean(parent?.root?.selected.value.get((0, _vue.toRaw)(computedId.value)) ===
|
|
36
|
-
isIndeterminate: (0, _vue.computed)(() => Boolean(parent?.root?.selected.value.get(computedId.value) ===
|
|
35
|
+
isSelected: (0, _vue.computed)(() => Boolean(parent?.root?.selected.value.get((0, _vue.toRaw)(computedId.value)) === _nested2.SELECTED.ON)),
|
|
36
|
+
isIndeterminate: (0, _vue.computed)(() => Boolean(parent?.root?.selected.value.get(computedId.value) === _nested2.SELECTED.INDETERMINATE)),
|
|
37
37
|
isLeaf: (0, _vue.computed)(() => Boolean(!parent?.root?.children.value.get(computedId.value))),
|
|
38
38
|
isGroupActivator: parent?.isGroupActivator
|
|
39
39
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, inject, onBeforeUnmount, provide, toRaw } from "vue";
|
|
2
2
|
import { EMPTY_NESTED, ORIGAM_NESTED_KEY } from "../../consts/Commons/nested.const.js";
|
|
3
|
-
import { SELECTED } from "../../enums/
|
|
3
|
+
import { SELECTED } from "../../enums/Commons/nested.enum.js";
|
|
4
4
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
5
5
|
export function useNestedItem(id, isGroup) {
|
|
6
6
|
const parent = inject(ORIGAM_NESTED_KEY, EMPTY_NESTED);
|
|
@@ -9,7 +9,7 @@ var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.c
|
|
|
9
9
|
function usePassedProps(_props, instanceLabel = "usePassedProps") {
|
|
10
10
|
const vm = (0, _getCurrentInstance.getCurrentInstance)(instanceLabel);
|
|
11
11
|
return key => {
|
|
12
|
-
const vnodeProps = vm.vnode.props
|
|
12
|
+
const vnodeProps = vm.vnode.props ?? {};
|
|
13
13
|
for (const k in vnodeProps) {
|
|
14
14
|
if (k === key || (0, _commons.camelize)(k) === key) return vnodeProps[k] !== void 0;
|
|
15
15
|
}
|
|
@@ -3,7 +3,7 @@ import { getCurrentInstance } from "../../utils/Commons/getCurrentInstance.util.
|
|
|
3
3
|
export function usePassedProps(_props, instanceLabel = "usePassedProps") {
|
|
4
4
|
const vm = getCurrentInstance(instanceLabel);
|
|
5
5
|
return (key) => {
|
|
6
|
-
const vnodeProps = vm.vnode.props
|
|
6
|
+
const vnodeProps = vm.vnode.props ?? {};
|
|
7
7
|
for (const k in vnodeProps) {
|
|
8
8
|
if (k === key || camelize(k) === key) return vnodeProps[k] !== void 0;
|
|
9
9
|
}
|
|
@@ -19,7 +19,7 @@ function useSize(props, name = (0, _getCurrentInstance.getCurrentInstanceName)()
|
|
|
19
19
|
const sizeClasses = (0, _vue.computed)(() => {
|
|
20
20
|
const size = (0, _vue.isRef)(props) ? props.value : props.size;
|
|
21
21
|
const classes = [];
|
|
22
|
-
if (size && _size.SIZES_ARRAY.includes(size)) {
|
|
22
|
+
if (typeof size === "string" && _size.SIZES_ARRAY.includes(size)) {
|
|
23
23
|
classes.push(`${name}--size-${size}`);
|
|
24
24
|
const utilityRung = LEGACY_SIZE_TO_UTILITY[size];
|
|
25
25
|
if (utilityRung) {
|
|
@@ -13,7 +13,7 @@ export function useSize(props, name = getCurrentInstanceName()) {
|
|
|
13
13
|
const sizeClasses = computed(() => {
|
|
14
14
|
const size = isRef(props) ? props.value : props.size;
|
|
15
15
|
const classes = [];
|
|
16
|
-
if (size && SIZES_ARRAY.includes(size)) {
|
|
16
|
+
if (typeof size === "string" && SIZES_ARRAY.includes(size)) {
|
|
17
17
|
classes.push(`${name}--size-${size}`);
|
|
18
18
|
const utilityRung = LEGACY_SIZE_TO_UTILITY[size];
|
|
19
19
|
if (utilityRung) {
|
|
@@ -24,6 +24,54 @@ function pickEffective(rest, isHover, isActive, hoverState, activeState, key) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
const noopRef = (0, _vue.computed)(() => false);
|
|
27
|
+
function resolveBgRole(isHover, isActive, hoverHasOwnBg, activeHasOwnBg) {
|
|
28
|
+
if (isHover && !hoverHasOwnBg) return "hover";
|
|
29
|
+
if (isActive && !activeHasOwnBg) return "active";
|
|
30
|
+
return "default";
|
|
31
|
+
}
|
|
32
|
+
function resolveBackground(bgColor, bgRole) {
|
|
33
|
+
if (bgColor && (0, _color.isIntent)(bgColor)) {
|
|
34
|
+
const m = (0, _color.tokenStylesForIntent)(bgColor, bgRole);
|
|
35
|
+
return {
|
|
36
|
+
bgDecl: `background-color: ${m["background-color"]}`,
|
|
37
|
+
bgIntentFg: (0, _color.tokenStylesForIntent)(bgColor, "default").color
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (bgColor === "transparent") {
|
|
41
|
+
return {
|
|
42
|
+
bgDecl: `background-color: ${(0, _color.rawBgExprWithState)("transparent", bgRole)}`,
|
|
43
|
+
bgIntentFg: null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (bgColor && typeof bgColor === "string" && (0, _color.isCssColor)(bgColor)) {
|
|
47
|
+
(0, _color.warnLegacyColor)("bgColor", bgColor);
|
|
48
|
+
return {
|
|
49
|
+
bgDecl: `background-color: ${(0, _color.rawBgExprWithState)(bgColor, bgRole)}`,
|
|
50
|
+
bgIntentFg: null
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
bgDecl: null,
|
|
55
|
+
bgIntentFg: null
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function resolveForeground(color, bgColor, bgIntentFg) {
|
|
59
|
+
if (color && (0, _color.isIntent)(color)) {
|
|
60
|
+
const clash = bgIntentFg && bgColor && (0, _color.isIntent)(bgColor) && color === bgColor;
|
|
61
|
+
return `color: ${clash ? bgIntentFg : (0, _color.tokenForegroundForIntent)(color)}`;
|
|
62
|
+
}
|
|
63
|
+
if (color && typeof color === "string" && (0, _color.isCssColor)(color)) {
|
|
64
|
+
if (color !== "transparent") (0, _color.warnLegacyColor)("color", color);
|
|
65
|
+
return `color: ${color}`;
|
|
66
|
+
}
|
|
67
|
+
if (color) return null;
|
|
68
|
+
if (bgIntentFg) return `color: ${bgIntentFg}`;
|
|
69
|
+
if (bgColor && typeof bgColor === "string" && bgColor !== "transparent" && (0, _color.isParsableColor)(bgColor)) {
|
|
70
|
+
const parsed = (0, _color.parseColor)(bgColor);
|
|
71
|
+
if (parsed.a == null || parsed.a === 1) return `color: ${(0, _color.getForeground)(parsed)}`;
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
27
75
|
function useStateEffect(props, isHover = noopRef, isActive = noopRef, hoverState = (0, _vue.computed)(() => void 0), activeState = (0, _vue.computed)(() => void 0), isDisabled = noopRef, flat = noopRef) {
|
|
28
76
|
const statusToIntent = {
|
|
29
77
|
success: "success",
|
|
@@ -63,43 +111,17 @@ function useStateEffect(props, isHover = noopRef, isActive = noopRef, hoverState
|
|
|
63
111
|
void isDisabled.value;
|
|
64
112
|
const hoverHasOwnBg = hoverState.value?.bgColor != null && !sameIntent(hoverState.value.bgColor, props.bgColor);
|
|
65
113
|
const activeHasOwnBg = activeState.value?.bgColor != null && !sameIntent(activeState.value.bgColor, props.bgColor);
|
|
66
|
-
const bgRole = isHover.value
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
bgDecl = `background-color: ${m["background-color"]}`;
|
|
73
|
-
bgIntentFg = (0, _color.tokenStylesForIntent)(bgColor.value, "default").color;
|
|
74
|
-
} else if (bgColor.value === "transparent") {
|
|
75
|
-
bgDecl = `background-color: ${(0, _color.rawBgExprWithState)("transparent", bgRole)}`;
|
|
76
|
-
} else if (bgColor.value && typeof bgColor.value === "string" && (0, _color.isCssColor)(bgColor.value)) {
|
|
77
|
-
(0, _color.warnLegacyColor)("bgColor", bgColor.value);
|
|
78
|
-
bgDecl = `background-color: ${(0, _color.rawBgExprWithState)(bgColor.value, bgRole)}`;
|
|
79
|
-
}
|
|
80
|
-
if (color.value && (0, _color.isIntent)(color.value)) {
|
|
81
|
-
if (bgIntentFg && bgColor.value && (0, _color.isIntent)(bgColor.value) && color.value === bgColor.value) {
|
|
82
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
83
|
-
} else {
|
|
84
|
-
fgDecl = `color: ${(0, _color.tokenForegroundForIntent)(color.value)}`;
|
|
85
|
-
}
|
|
86
|
-
} else if (color.value && typeof color.value === "string" && (0, _color.isCssColor)(color.value)) {
|
|
87
|
-
if (color.value !== "transparent") (0, _color.warnLegacyColor)("color", color.value);
|
|
88
|
-
fgDecl = `color: ${color.value}`;
|
|
89
|
-
} else if (!color.value && bgIntentFg) {
|
|
90
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
91
|
-
} else if (!color.value && bgColor.value && typeof bgColor.value === "string" && bgColor.value !== "transparent" && (0, _color.isParsableColor)(bgColor.value)) {
|
|
92
|
-
const parsed = (0, _color.parseColor)(bgColor.value);
|
|
93
|
-
if (parsed.a == null || parsed.a === 1) {
|
|
94
|
-
fgDecl = `color: ${(0, _color.getForeground)(parsed)}`;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
114
|
+
const bgRole = resolveBgRole(isHover.value, isActive.value, hoverHasOwnBg, activeHasOwnBg);
|
|
115
|
+
const {
|
|
116
|
+
bgDecl,
|
|
117
|
+
bgIntentFg
|
|
118
|
+
} = resolveBackground(bgColor.value, bgRole);
|
|
119
|
+
const fgDecl = resolveForeground(color.value, bgColor.value, bgIntentFg);
|
|
97
120
|
const styles = [];
|
|
98
121
|
if (bgDecl) styles.push(bgDecl);
|
|
99
122
|
if (fgDecl) styles.push(fgDecl);
|
|
100
123
|
return styles;
|
|
101
124
|
});
|
|
102
|
-
void _color.intentBgExpr;
|
|
103
125
|
const {
|
|
104
126
|
borderClasses,
|
|
105
127
|
borderStyles
|
|
@@ -5,7 +5,7 @@ import { useMargin } from "./margin.composable.js";
|
|
|
5
5
|
import { useOpacity } from "./opacity.composable.js";
|
|
6
6
|
import { usePadding } from "./padding.composable.js";
|
|
7
7
|
import { useRounded } from "./rounded.composable.js";
|
|
8
|
-
import { getForeground,
|
|
8
|
+
import { getForeground, isCssColor, isIntent, isParsableColor, isUtilityIntent, parseColor, rawBgExprWithState, tokenForegroundForIntent, tokenStylesForIntent, warnLegacyColor } from "../../utils/Commons/color.util.js";
|
|
9
9
|
function pickEffective(rest, isHover, isActive, hoverState, activeState, key) {
|
|
10
10
|
return computed(() => {
|
|
11
11
|
if (isHover.value && hoverState.value?.[key] != null) {
|
|
@@ -18,6 +18,45 @@ function pickEffective(rest, isHover, isActive, hoverState, activeState, key) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
const noopRef = computed(() => false);
|
|
21
|
+
function resolveBgRole(isHover, isActive, hoverHasOwnBg, activeHasOwnBg) {
|
|
22
|
+
if (isHover && !hoverHasOwnBg) return "hover";
|
|
23
|
+
if (isActive && !activeHasOwnBg) return "active";
|
|
24
|
+
return "default";
|
|
25
|
+
}
|
|
26
|
+
function resolveBackground(bgColor, bgRole) {
|
|
27
|
+
if (bgColor && isIntent(bgColor)) {
|
|
28
|
+
const m = tokenStylesForIntent(bgColor, bgRole);
|
|
29
|
+
return {
|
|
30
|
+
bgDecl: `background-color: ${m["background-color"]}`,
|
|
31
|
+
bgIntentFg: tokenStylesForIntent(bgColor, "default").color
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (bgColor === "transparent") {
|
|
35
|
+
return { bgDecl: `background-color: ${rawBgExprWithState("transparent", bgRole)}`, bgIntentFg: null };
|
|
36
|
+
}
|
|
37
|
+
if (bgColor && typeof bgColor === "string" && isCssColor(bgColor)) {
|
|
38
|
+
warnLegacyColor("bgColor", bgColor);
|
|
39
|
+
return { bgDecl: `background-color: ${rawBgExprWithState(bgColor, bgRole)}`, bgIntentFg: null };
|
|
40
|
+
}
|
|
41
|
+
return { bgDecl: null, bgIntentFg: null };
|
|
42
|
+
}
|
|
43
|
+
function resolveForeground(color, bgColor, bgIntentFg) {
|
|
44
|
+
if (color && isIntent(color)) {
|
|
45
|
+
const clash = bgIntentFg && bgColor && isIntent(bgColor) && color === bgColor;
|
|
46
|
+
return `color: ${clash ? bgIntentFg : tokenForegroundForIntent(color)}`;
|
|
47
|
+
}
|
|
48
|
+
if (color && typeof color === "string" && isCssColor(color)) {
|
|
49
|
+
if (color !== "transparent") warnLegacyColor("color", color);
|
|
50
|
+
return `color: ${color}`;
|
|
51
|
+
}
|
|
52
|
+
if (color) return null;
|
|
53
|
+
if (bgIntentFg) return `color: ${bgIntentFg}`;
|
|
54
|
+
if (bgColor && typeof bgColor === "string" && bgColor !== "transparent" && isParsableColor(bgColor)) {
|
|
55
|
+
const parsed = parseColor(bgColor);
|
|
56
|
+
if (parsed.a == null || parsed.a === 1) return `color: ${getForeground(parsed)}`;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
21
60
|
export function useStateEffect(props, isHover = noopRef, isActive = noopRef, hoverState = computed(() => void 0), activeState = computed(() => void 0), isDisabled = noopRef, flat = noopRef) {
|
|
22
61
|
const statusToIntent = {
|
|
23
62
|
success: "success",
|
|
@@ -71,43 +110,14 @@ export function useStateEffect(props, isHover = noopRef, isActive = noopRef, hov
|
|
|
71
110
|
void isDisabled.value;
|
|
72
111
|
const hoverHasOwnBg = hoverState.value?.bgColor != null && !sameIntent(hoverState.value.bgColor, props.bgColor);
|
|
73
112
|
const activeHasOwnBg = activeState.value?.bgColor != null && !sameIntent(activeState.value.bgColor, props.bgColor);
|
|
74
|
-
const bgRole = isHover.value
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
let bgIntentFg = null;
|
|
78
|
-
if (bgColor.value && isIntent(bgColor.value)) {
|
|
79
|
-
const m = tokenStylesForIntent(bgColor.value, bgRole);
|
|
80
|
-
bgDecl = `background-color: ${m["background-color"]}`;
|
|
81
|
-
bgIntentFg = tokenStylesForIntent(bgColor.value, "default").color;
|
|
82
|
-
} else if (bgColor.value === "transparent") {
|
|
83
|
-
bgDecl = `background-color: ${rawBgExprWithState("transparent", bgRole)}`;
|
|
84
|
-
} else if (bgColor.value && typeof bgColor.value === "string" && isCssColor(bgColor.value)) {
|
|
85
|
-
warnLegacyColor("bgColor", bgColor.value);
|
|
86
|
-
bgDecl = `background-color: ${rawBgExprWithState(bgColor.value, bgRole)}`;
|
|
87
|
-
}
|
|
88
|
-
if (color.value && isIntent(color.value)) {
|
|
89
|
-
if (bgIntentFg && bgColor.value && isIntent(bgColor.value) && color.value === bgColor.value) {
|
|
90
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
91
|
-
} else {
|
|
92
|
-
fgDecl = `color: ${tokenForegroundForIntent(color.value)}`;
|
|
93
|
-
}
|
|
94
|
-
} else if (color.value && typeof color.value === "string" && isCssColor(color.value)) {
|
|
95
|
-
if (color.value !== "transparent") warnLegacyColor("color", color.value);
|
|
96
|
-
fgDecl = `color: ${color.value}`;
|
|
97
|
-
} else if (!color.value && bgIntentFg) {
|
|
98
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
99
|
-
} else if (!color.value && bgColor.value && typeof bgColor.value === "string" && bgColor.value !== "transparent" && isParsableColor(bgColor.value)) {
|
|
100
|
-
const parsed = parseColor(bgColor.value);
|
|
101
|
-
if (parsed.a == null || parsed.a === 1) {
|
|
102
|
-
fgDecl = `color: ${getForeground(parsed)}`;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
113
|
+
const bgRole = resolveBgRole(isHover.value, isActive.value, hoverHasOwnBg, activeHasOwnBg);
|
|
114
|
+
const { bgDecl, bgIntentFg } = resolveBackground(bgColor.value, bgRole);
|
|
115
|
+
const fgDecl = resolveForeground(color.value, bgColor.value, bgIntentFg);
|
|
105
116
|
const styles = [];
|
|
106
117
|
if (bgDecl) styles.push(bgDecl);
|
|
107
118
|
if (fgDecl) styles.push(fgDecl);
|
|
108
119
|
return styles;
|
|
109
120
|
});
|
|
110
|
-
void intentBgExpr;
|
|
111
121
|
const { borderClasses, borderStyles } = useBorder(
|
|
112
122
|
reactive({
|
|
113
123
|
get border() {
|
|
@@ -14,7 +14,8 @@ function useTeleport(target) {
|
|
|
14
14
|
const _target = target.value;
|
|
15
15
|
if (_target === true || !_commons.IN_BROWSER) return void 0;
|
|
16
16
|
if (!isHydrated.value) return void 0;
|
|
17
|
-
|
|
17
|
+
let targetElement;
|
|
18
|
+
if (_target === false) targetElement = document.body;else if (typeof _target === "string") targetElement = document.querySelector(_target);else targetElement = _target;
|
|
18
19
|
if (targetElement == null) {
|
|
19
20
|
(0, _console.consoleWarn)(`Unable to locate target ${_target}`);
|
|
20
21
|
return void 0;
|
|
@@ -8,7 +8,10 @@ export function useTeleport(target) {
|
|
|
8
8
|
const _target = target.value;
|
|
9
9
|
if (_target === true || !IN_BROWSER) return void 0;
|
|
10
10
|
if (!isHydrated.value) return void 0;
|
|
11
|
-
|
|
11
|
+
let targetElement;
|
|
12
|
+
if (_target === false) targetElement = document.body;
|
|
13
|
+
else if (typeof _target === "string") targetElement = document.querySelector(_target);
|
|
14
|
+
else targetElement = _target;
|
|
12
15
|
if (targetElement == null) {
|
|
13
16
|
consoleWarn(`Unable to locate target ${_target}`);
|
|
14
17
|
return void 0;
|