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
|
@@ -7,7 +7,7 @@ exports.resetCodeHighlighterForTesting = resetCodeHighlighterForTesting;
|
|
|
7
7
|
exports.useCode = useCode;
|
|
8
8
|
var _vue = require("vue");
|
|
9
9
|
var _code = require("../../consts/Code/code.const.cjs");
|
|
10
|
-
var
|
|
10
|
+
var _code2 = require("../../enums/Code/code.enum.cjs");
|
|
11
11
|
let _highlighterPromise = null;
|
|
12
12
|
let _highlighterReady = false;
|
|
13
13
|
let _highlighterUnavailable = false;
|
|
@@ -63,9 +63,9 @@ function resolveLang(lang, hasCustomHighlighter, extraLangs) {
|
|
|
63
63
|
if (extraLangs?.includes(lang)) return lang;
|
|
64
64
|
if (!_unsupportedLangWarned.has(lang)) {
|
|
65
65
|
_unsupportedLangWarned.add(lang);
|
|
66
|
-
console.warn(`[origam] OrigamCode: lang="${lang}" is not in the bundled grammar set. Falling back to "${
|
|
66
|
+
console.warn(`[origam] OrigamCode: lang="${lang}" is not in the bundled grammar set. Falling back to "${_code2.CODE_LANG.PLAINTEXT}". Supported: ${[..._code.SUPPORTED_LANGS, ...(extraLangs ?? [])].join(", ")}. Add it with createOrigam({ code: { langs } }) or supply a code.highlighter.`);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return _code2.CODE_LANG.PLAINTEXT;
|
|
69
69
|
}
|
|
70
70
|
function useCode() {
|
|
71
71
|
const codeOptions = (0, _vue.inject)(_code.ORIGAM_CODE_KEY);
|
|
@@ -100,7 +100,7 @@ function useCode() {
|
|
|
100
100
|
}
|
|
101
101
|
html = highlighter.codeToHtml(code, {
|
|
102
102
|
...opts,
|
|
103
|
-
lang:
|
|
103
|
+
lang: _code2.CODE_LANG.PLAINTEXT
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
lruSet(key, html);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject } from "vue";
|
|
2
2
|
import { CODE_CACHE_MAX_ENTRIES, CODE_DARK_THEME as DARK_THEME, CODE_LIGHT_THEME as LIGHT_THEME, ORIGAM_CODE_KEY, SUPPORTED_LANGS } from "../../consts/Code/code.const.js";
|
|
3
|
-
import { CODE_LANG } from "../../enums/
|
|
3
|
+
import { CODE_LANG } from "../../enums/Code/code.enum.js";
|
|
4
4
|
let _highlighterPromise = null;
|
|
5
5
|
let _highlighterReady = false;
|
|
6
6
|
let _highlighterUnavailable = false;
|
|
@@ -12,7 +12,8 @@ function useAccessibleCommand(options) {
|
|
|
12
12
|
return (0, _vue.computed)(() => {
|
|
13
13
|
if (!options.active.value) return {};
|
|
14
14
|
const raw = options.label();
|
|
15
|
-
const
|
|
15
|
+
const translated = raw && locale ? locale.t(raw) : raw;
|
|
16
|
+
const name = translated ?? "";
|
|
16
17
|
if (!name) {
|
|
17
18
|
(0, _a11y.warnMissingAccessibleName)(options.component, options.zone, options.prop);
|
|
18
19
|
return {};
|
|
@@ -6,7 +6,8 @@ export function useAccessibleCommand(options) {
|
|
|
6
6
|
return computed(() => {
|
|
7
7
|
if (!options.active.value) return {};
|
|
8
8
|
const raw = options.label();
|
|
9
|
-
const
|
|
9
|
+
const translated = raw && locale ? locale.t(raw) : raw;
|
|
10
|
+
const name = translated ?? "";
|
|
10
11
|
if (!name) {
|
|
11
12
|
warnMissingAccessibleName(options.component, options.zone, options.prop);
|
|
12
13
|
return {};
|
|
@@ -12,28 +12,24 @@ function useBackButton(router, cb) {
|
|
|
12
12
|
let removeBefore;
|
|
13
13
|
let removeAfter;
|
|
14
14
|
let poppedReset;
|
|
15
|
+
const decide = () => popped ? cb() : void 0;
|
|
16
|
+
const guard = () => {
|
|
17
|
+
let result;
|
|
18
|
+
if (!inTransition) {
|
|
19
|
+
result = new Promise(resolve => {
|
|
20
|
+
setTimeout(() => resolve(decide()));
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
result = decide();
|
|
24
|
+
}
|
|
25
|
+
inTransition = true;
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
15
28
|
if (_commons.IN_BROWSER) {
|
|
16
29
|
(0, _vue.nextTick)(() => {
|
|
17
30
|
window.addEventListener("popstate", onPopstate);
|
|
18
31
|
if (router) {
|
|
19
|
-
removeBefore = router.beforeEach(
|
|
20
|
-
if (!inTransition) {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
if (popped) {
|
|
23
|
-
cb(next);
|
|
24
|
-
} else {
|
|
25
|
-
next();
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
if (popped) {
|
|
30
|
-
cb(next);
|
|
31
|
-
} else {
|
|
32
|
-
next();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
inTransition = true;
|
|
36
|
-
});
|
|
32
|
+
removeBefore = router.beforeEach(guard);
|
|
37
33
|
removeAfter = router.afterEach(() => {
|
|
38
34
|
inTransition = false;
|
|
39
35
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Router } from 'vue-router';
|
|
2
2
|
/*********************************************************
|
|
3
3
|
* useBackButton
|
|
4
4
|
*
|
|
@@ -7,7 +7,9 @@ import type { NavigationGuardNext, Router } from 'vue-router';
|
|
|
7
7
|
* (e.g. a Dialog / Sheet / Bottom-sheet) can intercept the native
|
|
8
8
|
* back-button gesture and run its own close callback instead of
|
|
9
9
|
* letting the browser navigate away.
|
|
10
|
+
* `cb` suit la convention des gardes vue-router : elle renvoie `false` pour
|
|
11
|
+
* ANNULER la navigation, toute autre valeur la laisse passer (plus de `next`).
|
|
10
12
|
* Independent from `useRoute` / `useRouter` / `useLink` — does not
|
|
11
13
|
* delegate to any of them.
|
|
12
14
|
********************************************************/
|
|
13
|
-
export declare function useBackButton(router: Router | undefined, cb: (
|
|
15
|
+
export declare function useBackButton(router: Router | undefined, cb: () => boolean | void): void;
|
|
@@ -6,28 +6,24 @@ export function useBackButton(router, cb) {
|
|
|
6
6
|
let removeBefore;
|
|
7
7
|
let removeAfter;
|
|
8
8
|
let poppedReset;
|
|
9
|
+
const decide = () => popped ? cb() : void 0;
|
|
10
|
+
const guard = () => {
|
|
11
|
+
let result;
|
|
12
|
+
if (!inTransition) {
|
|
13
|
+
result = new Promise((resolve) => {
|
|
14
|
+
setTimeout(() => resolve(decide()));
|
|
15
|
+
});
|
|
16
|
+
} else {
|
|
17
|
+
result = decide();
|
|
18
|
+
}
|
|
19
|
+
inTransition = true;
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
9
22
|
if (IN_BROWSER) {
|
|
10
23
|
nextTick(() => {
|
|
11
24
|
window.addEventListener("popstate", onPopstate);
|
|
12
25
|
if (router) {
|
|
13
|
-
removeBefore = router.beforeEach(
|
|
14
|
-
if (!inTransition) {
|
|
15
|
-
setTimeout(() => {
|
|
16
|
-
if (popped) {
|
|
17
|
-
cb(next);
|
|
18
|
-
} else {
|
|
19
|
-
next();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
if (popped) {
|
|
24
|
-
cb(next);
|
|
25
|
-
} else {
|
|
26
|
-
next();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
inTransition = true;
|
|
30
|
-
});
|
|
26
|
+
removeBefore = router.beforeEach(guard);
|
|
31
27
|
removeAfter = router.afterEach(() => {
|
|
32
28
|
inTransition = false;
|
|
33
29
|
});
|
|
@@ -7,9 +7,13 @@ exports.useBackgroundColor = useBackgroundColor;
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _color = require("./color.composable.cjs");
|
|
9
9
|
function useBackgroundColor(props, name) {
|
|
10
|
-
const colors = (0, _vue.computed)(() =>
|
|
11
|
-
background
|
|
12
|
-
|
|
10
|
+
const colors = (0, _vue.computed)(() => {
|
|
11
|
+
let background = null;
|
|
12
|
+
if ((0, _vue.isRef)(props)) background = props.value;else if (name) background = props[name];
|
|
13
|
+
return {
|
|
14
|
+
background
|
|
15
|
+
};
|
|
16
|
+
});
|
|
13
17
|
const {
|
|
14
18
|
colorClasses: backgroundColorClasses,
|
|
15
19
|
colorStyles: backgroundColorStyles
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { computed, isRef } from "vue";
|
|
2
2
|
import { useColor } from "./color.composable.js";
|
|
3
3
|
export function useBackgroundColor(props, name) {
|
|
4
|
-
const colors = computed(() =>
|
|
5
|
-
background
|
|
6
|
-
|
|
4
|
+
const colors = computed(() => {
|
|
5
|
+
let background = null;
|
|
6
|
+
if (isRef(props)) background = props.value;
|
|
7
|
+
else if (name) background = props[name];
|
|
8
|
+
return { background };
|
|
9
|
+
});
|
|
7
10
|
const { colorClasses: backgroundColorClasses, colorStyles: backgroundColorStyles } = useColor(colors);
|
|
8
11
|
return { backgroundColorClasses, backgroundColorStyles };
|
|
9
12
|
}
|
|
@@ -8,9 +8,13 @@ var _vue = require("vue");
|
|
|
8
8
|
var _color = require("./color.composable.cjs");
|
|
9
9
|
function useBothColor(bgColorProps, colorProps, name) {
|
|
10
10
|
const bothColors = (0, _vue.computed)(() => {
|
|
11
|
+
let text = null;
|
|
12
|
+
if ((0, _vue.isRef)(colorProps)) text = colorProps.value;else if (name) text = colorProps[name];
|
|
13
|
+
let background = null;
|
|
14
|
+
if ((0, _vue.isRef)(bgColorProps)) background = bgColorProps.value;else if (name) background = bgColorProps[name];
|
|
11
15
|
return {
|
|
12
|
-
text
|
|
13
|
-
background
|
|
16
|
+
text,
|
|
17
|
+
background
|
|
14
18
|
};
|
|
15
19
|
});
|
|
16
20
|
return (0, _color.useColor)(bothColors);
|
|
@@ -2,10 +2,13 @@ import { computed, isRef } from "vue";
|
|
|
2
2
|
import { useColor } from "./color.composable.js";
|
|
3
3
|
export function useBothColor(bgColorProps, colorProps, name) {
|
|
4
4
|
const bothColors = computed(() => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let text = null;
|
|
6
|
+
if (isRef(colorProps)) text = colorProps.value;
|
|
7
|
+
else if (name) text = colorProps[name];
|
|
8
|
+
let background = null;
|
|
9
|
+
if (isRef(bgColorProps)) background = bgColorProps.value;
|
|
10
|
+
else if (name) background = bgColorProps[name];
|
|
11
|
+
return { text, background };
|
|
9
12
|
});
|
|
10
13
|
return useColor(bothColors);
|
|
11
14
|
}
|
|
@@ -7,6 +7,102 @@ exports.useColor = useColor;
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _color = require("../../utils/Commons/color.util.cjs");
|
|
9
9
|
var _gradient = require("../../utils/Commons/gradient.util.cjs");
|
|
10
|
+
function resolveBackground(background) {
|
|
11
|
+
const none = {
|
|
12
|
+
bgDecl: null,
|
|
13
|
+
bgIntentFg: null,
|
|
14
|
+
bgIsGradient: false
|
|
15
|
+
};
|
|
16
|
+
if (!background) return none;
|
|
17
|
+
if ((0, _gradient.isGradient)(background)) {
|
|
18
|
+
const grad = (0, _gradient.resolveGradient)(background);
|
|
19
|
+
return grad ? {
|
|
20
|
+
bgDecl: `background-image: ${grad}`,
|
|
21
|
+
bgIntentFg: null,
|
|
22
|
+
bgIsGradient: true
|
|
23
|
+
} : none;
|
|
24
|
+
}
|
|
25
|
+
if ((0, _color.isIntent)(background)) {
|
|
26
|
+
const m = (0, _color.tokenStylesForIntent)(background, "default");
|
|
27
|
+
return {
|
|
28
|
+
bgDecl: `background-color: ${m["background-color"]}`,
|
|
29
|
+
bgIntentFg: m.color,
|
|
30
|
+
bgIsGradient: false
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (background === "transparent") {
|
|
34
|
+
return {
|
|
35
|
+
bgDecl: `background-color: ${background}`,
|
|
36
|
+
bgIntentFg: null,
|
|
37
|
+
bgIsGradient: false
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (typeof background === "string" && (0, _color.isCssColor)(background)) {
|
|
41
|
+
return {
|
|
42
|
+
bgDecl: `background-color: ${background}`,
|
|
43
|
+
bgIntentFg: null,
|
|
44
|
+
bgIsGradient: false
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return none;
|
|
48
|
+
}
|
|
49
|
+
function resolveTextGradient(text) {
|
|
50
|
+
const grad = (0, _gradient.resolveGradient)(text);
|
|
51
|
+
if (!grad) return {
|
|
52
|
+
fgDecl: null,
|
|
53
|
+
gradientStyles: []
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
fgDecl: "color: transparent",
|
|
57
|
+
gradientStyles: [`background-image: ${grad}`, "background-clip: text", "-webkit-background-clip: text"]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function resolveIntentText(colors, bgIntentFg) {
|
|
61
|
+
if (bgIntentFg && (0, _color.isIntent)(colors.background) && colors.text === colors.background) {
|
|
62
|
+
return `color: ${bgIntentFg}`;
|
|
63
|
+
}
|
|
64
|
+
return `color: ${(0, _color.tokenForegroundForIntent)(colors.text)}`;
|
|
65
|
+
}
|
|
66
|
+
function resolveAutoContrast(background) {
|
|
67
|
+
if (typeof background === "string" && background !== "transparent" && (0, _color.isParsableColor)(background)) {
|
|
68
|
+
const parsed = (0, _color.parseColor)(background);
|
|
69
|
+
if (parsed.a == null || parsed.a === 1) return `color: ${(0, _color.getForeground)(parsed)}`;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function resolveForeground(colors, bgDecl, bgIntentFg, bgIsGradient) {
|
|
74
|
+
const {
|
|
75
|
+
background,
|
|
76
|
+
text
|
|
77
|
+
} = colors;
|
|
78
|
+
if (text) {
|
|
79
|
+
if ((0, _gradient.isGradient)(text)) return resolveTextGradient(text);
|
|
80
|
+
if ((0, _color.isIntent)(text)) return {
|
|
81
|
+
fgDecl: resolveIntentText(colors, bgIntentFg),
|
|
82
|
+
gradientStyles: []
|
|
83
|
+
};
|
|
84
|
+
if (typeof text === "string" && (0, _color.isCssColor)(text)) return {
|
|
85
|
+
fgDecl: `color: ${text}`,
|
|
86
|
+
gradientStyles: []
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
fgDecl: null,
|
|
90
|
+
gradientStyles: []
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (bgIntentFg && !bgIsGradient) return {
|
|
94
|
+
fgDecl: `color: ${bgIntentFg}`,
|
|
95
|
+
gradientStyles: []
|
|
96
|
+
};
|
|
97
|
+
if (bgDecl && !bgIsGradient) return {
|
|
98
|
+
fgDecl: resolveAutoContrast(background),
|
|
99
|
+
gradientStyles: []
|
|
100
|
+
};
|
|
101
|
+
return {
|
|
102
|
+
fgDecl: null,
|
|
103
|
+
gradientStyles: []
|
|
104
|
+
};
|
|
105
|
+
}
|
|
10
106
|
function useColor(colors) {
|
|
11
107
|
const colorClasses = (0, _vue.computed)(() => {
|
|
12
108
|
const classes = [];
|
|
@@ -19,54 +115,16 @@ function useColor(colors) {
|
|
|
19
115
|
return classes;
|
|
20
116
|
});
|
|
21
117
|
const colorStyles = (0, _vue.computed)(() => {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
} else if ((0, _color.isIntent)(colors.value.background)) {
|
|
34
|
-
const m = (0, _color.tokenStylesForIntent)(colors.value.background, "default");
|
|
35
|
-
bgDecl = `background-color: ${m["background-color"]}`;
|
|
36
|
-
bgIntentFg = m.color;
|
|
37
|
-
} else if (colors.value.background === "transparent") {
|
|
38
|
-
bgDecl = `background-color: ${colors.value.background}`;
|
|
39
|
-
} else if (typeof colors.value.background === "string" && (0, _color.isCssColor)(colors.value.background)) {
|
|
40
|
-
bgDecl = `background-color: ${colors.value.background}`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
let fgDecl = null;
|
|
44
|
-
if (colors.value.text) {
|
|
45
|
-
if ((0, _gradient.isGradient)(colors.value.text)) {
|
|
46
|
-
const grad = (0, _gradient.resolveGradient)(colors.value.text);
|
|
47
|
-
if (grad) {
|
|
48
|
-
fgDecl = "color: transparent";
|
|
49
|
-
styles.push(`background-image: ${grad}`);
|
|
50
|
-
styles.push("background-clip: text");
|
|
51
|
-
styles.push("-webkit-background-clip: text");
|
|
52
|
-
}
|
|
53
|
-
} else if ((0, _color.isIntent)(colors.value.text)) {
|
|
54
|
-
if (bgIntentFg && (0, _color.isIntent)(colors.value.background) && colors.value.text === colors.value.background) {
|
|
55
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
56
|
-
} else {
|
|
57
|
-
fgDecl = `color: ${(0, _color.tokenForegroundForIntent)(colors.value.text)}`;
|
|
58
|
-
}
|
|
59
|
-
} else if (typeof colors.value.text === "string" && (0, _color.isCssColor)(colors.value.text)) {
|
|
60
|
-
fgDecl = `color: ${colors.value.text}`;
|
|
61
|
-
}
|
|
62
|
-
} else if (bgIntentFg && !bgIsGradient) {
|
|
63
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
64
|
-
} else if (bgDecl && !bgIsGradient && colors.value.background && typeof colors.value.background === "string" && colors.value.background !== "transparent" && (0, _color.isParsableColor)(colors.value.background)) {
|
|
65
|
-
const parsed = (0, _color.parseColor)(colors.value.background);
|
|
66
|
-
if (parsed.a == null || parsed.a === 1) {
|
|
67
|
-
fgDecl = `color: ${(0, _color.getForeground)(parsed)}`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
118
|
+
const {
|
|
119
|
+
bgDecl,
|
|
120
|
+
bgIntentFg,
|
|
121
|
+
bgIsGradient
|
|
122
|
+
} = resolveBackground(colors.value.background);
|
|
123
|
+
const {
|
|
124
|
+
fgDecl,
|
|
125
|
+
gradientStyles
|
|
126
|
+
} = resolveForeground(colors.value, bgDecl, bgIntentFg, bgIsGradient);
|
|
127
|
+
const styles = [...gradientStyles];
|
|
70
128
|
if (bgDecl) styles.push(bgDecl);
|
|
71
129
|
if (fgDecl) styles.push(fgDecl);
|
|
72
130
|
return styles;
|
|
@@ -10,6 +10,58 @@ import {
|
|
|
10
10
|
tokenStylesForIntent
|
|
11
11
|
} from "../../utils/Commons/color.util.js";
|
|
12
12
|
import { isGradient, resolveGradient } from "../../utils/Commons/gradient.util.js";
|
|
13
|
+
function resolveBackground(background) {
|
|
14
|
+
const none = { bgDecl: null, bgIntentFg: null, bgIsGradient: false };
|
|
15
|
+
if (!background) return none;
|
|
16
|
+
if (isGradient(background)) {
|
|
17
|
+
const grad = resolveGradient(background);
|
|
18
|
+
return grad ? { bgDecl: `background-image: ${grad}`, bgIntentFg: null, bgIsGradient: true } : none;
|
|
19
|
+
}
|
|
20
|
+
if (isIntent(background)) {
|
|
21
|
+
const m = tokenStylesForIntent(background, "default");
|
|
22
|
+
return { bgDecl: `background-color: ${m["background-color"]}`, bgIntentFg: m.color, bgIsGradient: false };
|
|
23
|
+
}
|
|
24
|
+
if (background === "transparent") {
|
|
25
|
+
return { bgDecl: `background-color: ${background}`, bgIntentFg: null, bgIsGradient: false };
|
|
26
|
+
}
|
|
27
|
+
if (typeof background === "string" && isCssColor(background)) {
|
|
28
|
+
return { bgDecl: `background-color: ${background}`, bgIntentFg: null, bgIsGradient: false };
|
|
29
|
+
}
|
|
30
|
+
return none;
|
|
31
|
+
}
|
|
32
|
+
function resolveTextGradient(text) {
|
|
33
|
+
const grad = resolveGradient(text);
|
|
34
|
+
if (!grad) return { fgDecl: null, gradientStyles: [] };
|
|
35
|
+
return {
|
|
36
|
+
fgDecl: "color: transparent",
|
|
37
|
+
gradientStyles: [`background-image: ${grad}`, "background-clip: text", "-webkit-background-clip: text"]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function resolveIntentText(colors, bgIntentFg) {
|
|
41
|
+
if (bgIntentFg && isIntent(colors.background) && colors.text === colors.background) {
|
|
42
|
+
return `color: ${bgIntentFg}`;
|
|
43
|
+
}
|
|
44
|
+
return `color: ${tokenForegroundForIntent(colors.text)}`;
|
|
45
|
+
}
|
|
46
|
+
function resolveAutoContrast(background) {
|
|
47
|
+
if (typeof background === "string" && background !== "transparent" && isParsableColor(background)) {
|
|
48
|
+
const parsed = parseColor(background);
|
|
49
|
+
if (parsed.a == null || parsed.a === 1) return `color: ${getForeground(parsed)}`;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function resolveForeground(colors, bgDecl, bgIntentFg, bgIsGradient) {
|
|
54
|
+
const { background, text } = colors;
|
|
55
|
+
if (text) {
|
|
56
|
+
if (isGradient(text)) return resolveTextGradient(text);
|
|
57
|
+
if (isIntent(text)) return { fgDecl: resolveIntentText(colors, bgIntentFg), gradientStyles: [] };
|
|
58
|
+
if (typeof text === "string" && isCssColor(text)) return { fgDecl: `color: ${text}`, gradientStyles: [] };
|
|
59
|
+
return { fgDecl: null, gradientStyles: [] };
|
|
60
|
+
}
|
|
61
|
+
if (bgIntentFg && !bgIsGradient) return { fgDecl: `color: ${bgIntentFg}`, gradientStyles: [] };
|
|
62
|
+
if (bgDecl && !bgIsGradient) return { fgDecl: resolveAutoContrast(background), gradientStyles: [] };
|
|
63
|
+
return { fgDecl: null, gradientStyles: [] };
|
|
64
|
+
}
|
|
13
65
|
export function useColor(colors) {
|
|
14
66
|
const colorClasses = computed(() => {
|
|
15
67
|
const classes = [];
|
|
@@ -22,54 +74,9 @@ export function useColor(colors) {
|
|
|
22
74
|
return classes;
|
|
23
75
|
});
|
|
24
76
|
const colorStyles = computed(() => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let bgIsGradient = false;
|
|
29
|
-
if (colors.value.background) {
|
|
30
|
-
if (isGradient(colors.value.background)) {
|
|
31
|
-
const grad = resolveGradient(colors.value.background);
|
|
32
|
-
if (grad) {
|
|
33
|
-
bgDecl = `background-image: ${grad}`;
|
|
34
|
-
bgIsGradient = true;
|
|
35
|
-
}
|
|
36
|
-
} else if (isIntent(colors.value.background)) {
|
|
37
|
-
const m = tokenStylesForIntent(colors.value.background, "default");
|
|
38
|
-
bgDecl = `background-color: ${m["background-color"]}`;
|
|
39
|
-
bgIntentFg = m.color;
|
|
40
|
-
} else if (colors.value.background === "transparent") {
|
|
41
|
-
bgDecl = `background-color: ${colors.value.background}`;
|
|
42
|
-
} else if (typeof colors.value.background === "string" && isCssColor(colors.value.background)) {
|
|
43
|
-
bgDecl = `background-color: ${colors.value.background}`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
let fgDecl = null;
|
|
47
|
-
if (colors.value.text) {
|
|
48
|
-
if (isGradient(colors.value.text)) {
|
|
49
|
-
const grad = resolveGradient(colors.value.text);
|
|
50
|
-
if (grad) {
|
|
51
|
-
fgDecl = "color: transparent";
|
|
52
|
-
styles.push(`background-image: ${grad}`);
|
|
53
|
-
styles.push("background-clip: text");
|
|
54
|
-
styles.push("-webkit-background-clip: text");
|
|
55
|
-
}
|
|
56
|
-
} else if (isIntent(colors.value.text)) {
|
|
57
|
-
if (bgIntentFg && isIntent(colors.value.background) && colors.value.text === colors.value.background) {
|
|
58
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
59
|
-
} else {
|
|
60
|
-
fgDecl = `color: ${tokenForegroundForIntent(colors.value.text)}`;
|
|
61
|
-
}
|
|
62
|
-
} else if (typeof colors.value.text === "string" && isCssColor(colors.value.text)) {
|
|
63
|
-
fgDecl = `color: ${colors.value.text}`;
|
|
64
|
-
}
|
|
65
|
-
} else if (bgIntentFg && !bgIsGradient) {
|
|
66
|
-
fgDecl = `color: ${bgIntentFg}`;
|
|
67
|
-
} else if (bgDecl && !bgIsGradient && colors.value.background && typeof colors.value.background === "string" && colors.value.background !== "transparent" && isParsableColor(colors.value.background)) {
|
|
68
|
-
const parsed = parseColor(colors.value.background);
|
|
69
|
-
if (parsed.a == null || parsed.a === 1) {
|
|
70
|
-
fgDecl = `color: ${getForeground(parsed)}`;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
77
|
+
const { bgDecl, bgIntentFg, bgIsGradient } = resolveBackground(colors.value.background);
|
|
78
|
+
const { fgDecl, gradientStyles } = resolveForeground(colors.value, bgDecl, bgIntentFg, bgIsGradient);
|
|
79
|
+
const styles = [...gradientStyles];
|
|
73
80
|
if (bgDecl) styles.push(bgDecl);
|
|
74
81
|
if (fgDecl) styles.push(fgDecl);
|
|
75
82
|
return styles;
|
|
@@ -79,7 +79,8 @@ function useColorEffect(props, isHover = (0, _vue.ref)(false), isActive = (0, _v
|
|
|
79
79
|
});
|
|
80
80
|
const colorStyles = (0, _vue.computed)(() => {
|
|
81
81
|
trackReactiveDependency(isDisabled.value);
|
|
82
|
-
|
|
82
|
+
let bgRole = "default";
|
|
83
|
+
if (isHover.value) bgRole = "hover";else if (isActive.value) bgRole = "active";
|
|
83
84
|
const [bgDeclBase, bgIntentFg, bgIsGradient] = resolveBackground(bgColor.value, bgRole);
|
|
84
85
|
const [fgDecl, bgDeclOverride, clipText] = resolveForeground(color.value, bgColor.value, bgIntentFg, bgIsGradient);
|
|
85
86
|
const bgDecl = bgDeclOverride ?? bgDeclBase;
|
|
@@ -92,7 +92,9 @@ export function useColorEffect(props, isHover = ref(false), isActive = ref(false
|
|
|
92
92
|
});
|
|
93
93
|
const colorStyles = computed(() => {
|
|
94
94
|
trackReactiveDependency(isDisabled.value);
|
|
95
|
-
|
|
95
|
+
let bgRole = "default";
|
|
96
|
+
if (isHover.value) bgRole = "hover";
|
|
97
|
+
else if (isActive.value) bgRole = "active";
|
|
96
98
|
const [bgDeclBase, bgIntentFg, bgIsGradient] = resolveBackground(bgColor.value, bgRole);
|
|
97
99
|
const [fgDecl, bgDeclOverride, clipText] = resolveForeground(
|
|
98
100
|
color.value,
|
|
@@ -142,6 +142,7 @@ function useCreateLayout(props) {
|
|
|
142
142
|
const index = (0, _vue.computed)(() => items.value.findIndex(i => i.id === id));
|
|
143
143
|
const zIndex = (0, _vue.computed)(() => rootZIndex.value + layers.value.length * _layout.LAYOUT_ITEM_ZINDEX_STEP - index.value * _layout.LAYOUT_ITEM_ZINDEX_STEP);
|
|
144
144
|
const isHorizontalPosition = () => position.value === "left" || position.value === "right";
|
|
145
|
+
const fixedSize = () => elementSize.value ? `${(0, _commons.convertToUnit)(elementSize.value)}` : void 0;
|
|
145
146
|
const baseItemStyles = () => {
|
|
146
147
|
const isOpposite = position.value === "right" || position.value === "bottom";
|
|
147
148
|
return {
|
|
@@ -158,12 +159,12 @@ function useCreateLayout(props) {
|
|
|
158
159
|
const isHorizontal = isHorizontalPosition();
|
|
159
160
|
const isOppositeHorizontal = position.value === "right";
|
|
160
161
|
return {
|
|
161
|
-
"height": isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.top)} - ${(0, _commons.convertToUnit)(item.bottom)})` :
|
|
162
|
+
"height": isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.top)} - ${(0, _commons.convertToUnit)(item.bottom)})` : fixedSize(),
|
|
162
163
|
left: isOppositeHorizontal ? void 0 : (0, _commons.convertToUnit)(item.left),
|
|
163
164
|
right: isOppositeHorizontal ? (0, _commons.convertToUnit)(item.right) : void 0,
|
|
164
165
|
top: position.value !== "bottom" ? (0, _commons.convertToUnit)(item.top) : void 0,
|
|
165
166
|
bottom: position.value !== "top" ? (0, _commons.convertToUnit)(item.bottom) : void 0,
|
|
166
|
-
"width": !isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.left)} - ${(0, _commons.convertToUnit)(item.right)})` :
|
|
167
|
+
"width": !isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.left)} - ${(0, _commons.convertToUnit)(item.right)})` : fixedSize()
|
|
167
168
|
};
|
|
168
169
|
};
|
|
169
170
|
const layoutItemStyles = (0, _vue.computed)(() => {
|
|
@@ -137,6 +137,7 @@ export function useCreateLayout(props) {
|
|
|
137
137
|
const index = computed(() => items.value.findIndex((i) => i.id === id));
|
|
138
138
|
const zIndex = computed(() => rootZIndex.value + layers.value.length * LAYOUT_ITEM_ZINDEX_STEP - index.value * LAYOUT_ITEM_ZINDEX_STEP);
|
|
139
139
|
const isHorizontalPosition = () => position.value === "left" || position.value === "right";
|
|
140
|
+
const fixedSize = () => elementSize.value ? `${convertToUnit(elementSize.value)}` : void 0;
|
|
140
141
|
const baseItemStyles = () => {
|
|
141
142
|
const isOpposite = position.value === "right" || position.value === "bottom";
|
|
142
143
|
return {
|
|
@@ -151,12 +152,12 @@ export function useCreateLayout(props) {
|
|
|
151
152
|
const isHorizontal = isHorizontalPosition();
|
|
152
153
|
const isOppositeHorizontal = position.value === "right";
|
|
153
154
|
return {
|
|
154
|
-
"height": isHorizontal ? `calc(100% - ${convertToUnit(item.top)} - ${convertToUnit(item.bottom)})` :
|
|
155
|
+
"height": isHorizontal ? `calc(100% - ${convertToUnit(item.top)} - ${convertToUnit(item.bottom)})` : fixedSize(),
|
|
155
156
|
left: isOppositeHorizontal ? void 0 : convertToUnit(item.left),
|
|
156
157
|
right: isOppositeHorizontal ? convertToUnit(item.right) : void 0,
|
|
157
158
|
top: position.value !== "bottom" ? convertToUnit(item.top) : void 0,
|
|
158
159
|
bottom: position.value !== "top" ? convertToUnit(item.bottom) : void 0,
|
|
159
|
-
"width": !isHorizontal ? `calc(100% - ${convertToUnit(item.left)} - ${convertToUnit(item.right)})` :
|
|
160
|
+
"width": !isHorizontal ? `calc(100% - ${convertToUnit(item.left)} - ${convertToUnit(item.right)})` : fixedSize()
|
|
160
161
|
};
|
|
161
162
|
};
|
|
162
163
|
const layoutItemStyles = computed(() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { IUseCssSupportClientOptions } from '../../interfaces/Commons/css-support.interface';
|
|
3
3
|
import type { TCssFeatureName } from '../../types/Commons/css-support.type';
|
|
4
|
+
import type { TAnyString } from '../../types/Commons/commons.type';
|
|
4
5
|
/*********************************************************
|
|
5
6
|
* useCssSupportClient
|
|
6
7
|
*
|
|
@@ -16,4 +17,4 @@ import type { TCssFeatureName } from '../../types/Commons/css-support.type';
|
|
|
16
17
|
* // <div v-if="supportsContainer">…CSS path…</div>
|
|
17
18
|
* // <div v-else>…JS fallback path…</div>
|
|
18
19
|
********************************************************/
|
|
19
|
-
export declare function useCssSupportClient(feature: TCssFeatureName |
|
|
20
|
+
export declare function useCssSupportClient(feature: TCssFeatureName | TAnyString, options?: IUseCssSupportClientOptions): Ref<boolean>;
|
|
@@ -54,7 +54,13 @@ function createDisplay(options, ssr) {
|
|
|
54
54
|
const lg = width.value < thresholds.xl && !(md || sm || xs);
|
|
55
55
|
const xl = width.value < thresholds.xxl && !(lg || md || sm || xs);
|
|
56
56
|
const xxl = width.value >= thresholds.xxl;
|
|
57
|
-
const name =
|
|
57
|
+
const name = (0, _display2.getBreakpointName)({
|
|
58
|
+
xs,
|
|
59
|
+
sm,
|
|
60
|
+
md,
|
|
61
|
+
lg,
|
|
62
|
+
xl
|
|
63
|
+
});
|
|
58
64
|
const breakpointValue = typeof mobileBreakpoint === "number" ? mobileBreakpoint : thresholds[mobileBreakpoint];
|
|
59
65
|
const mobile = width.value < breakpointValue;
|
|
60
66
|
state.xs = xs;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, inject, reactive, shallowRef, toRefs, watchEffect } from "vue";
|
|
2
2
|
import { IN_BROWSER } from "../../consts/Commons/commons.const.js";
|
|
3
3
|
import { ORIGAM_DISPLAY_KEY } from "../../consts/Commons/display.const.js";
|
|
4
|
-
import { getClientHeight, getClientWidth, getPlatform, parseDisplayOptions } from "../../utils/Commons/display.util.js";
|
|
4
|
+
import { getBreakpointName, getClientHeight, getClientWidth, getPlatform, parseDisplayOptions } from "../../utils/Commons/display.util.js";
|
|
5
5
|
import { getCurrentInstanceName } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
6
6
|
export function useDisplay(props = {}, name = getCurrentInstanceName()) {
|
|
7
7
|
const display = inject(ORIGAM_DISPLAY_KEY);
|
|
@@ -38,7 +38,7 @@ export function createDisplay(options, ssr) {
|
|
|
38
38
|
const lg = width.value < thresholds.xl && !(md || sm || xs);
|
|
39
39
|
const xl = width.value < thresholds.xxl && !(lg || md || sm || xs);
|
|
40
40
|
const xxl = width.value >= thresholds.xxl;
|
|
41
|
-
const name =
|
|
41
|
+
const name = getBreakpointName({ xs, sm, md, lg, xl });
|
|
42
42
|
const breakpointValue = typeof mobileBreakpoint === "number" ? mobileBreakpoint : thresholds[mobileBreakpoint];
|
|
43
43
|
const mobile = width.value < breakpointValue;
|
|
44
44
|
state.xs = xs;
|