origam 2.41.0 → 2.42.0
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 +103 -0
- package/dist/src/assets/locales/en.json +10 -1
- package/dist/src/assets/locales/fr.json +10 -1
- 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/OrigamBreadcrumbDivider.vue +1 -2
- package/dist/src/components/Btn/OrigamBtn.vue +71 -27
- 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/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 +14 -15
- 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 +4 -2
- 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 +2 -3
- 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 +1 -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/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 +11 -5
- package/dist/src/components/Media/OrigamMediaController.vue +12 -13
- 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/Pagination/OrigamPagination.vue +4 -5
- package/dist/src/components/Parallax/OrigamParallaxElement.vue +1 -4
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +37 -15
- package/dist/src/components/Progress/OrigamProgressLinear.vue +7 -6
- package/dist/src/components/Radio/OrigamRadio.vue +5 -2
- package/dist/src/components/Radio/OrigamRadioBtn.vue +7 -5
- 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 +174 -107
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +7 -2
- package/dist/src/components/Slide/OrigamSlideGroup.vue +7 -10
- package/dist/src/components/SliderField/OrigamSliderField.vue +1 -2
- 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/Treeview/OrigamTreeviewNode.vue +24 -18
- package/dist/src/components/Video/OrigamVideo.vue +14 -19
- package/dist/src/components/Window/OrigamWindow.vue +2 -3
- 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/color.composable.cjs +106 -48
- package/dist/src/composables/Commons/color.composable.js +55 -48
- 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 +11 -10
- package/dist/src/composables/Commons/dragResizer.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/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/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/touch.composable.cjs +77 -33
- package/dist/src/composables/Commons/touch.composable.js +77 -33
- 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 +9 -9
- package/dist/src/composables/Parallax/parallax.composable.js +3 -3
- 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/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 +20 -11
- package/dist/src/consts/PasswordField/password-field.const.d.ts +10 -5
- package/dist/src/consts/PasswordField/password-field.const.js +17 -10
- 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.js +1 -1
- 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 +5 -3
- package/dist/src/directives/Contrast/contrast.directive.js +5 -3
- package/dist/src/directives/Intersect/intersect.directive.cjs +2 -1
- package/dist/src/directives/Intersect/intersect.directive.js +2 -1
- 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/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/PasswordField/password-field.interface.d.ts +5 -1
- package/dist/src/interfaces/PasswordField/password-requirement.interface.d.ts +8 -0
- package/dist/src/interfaces/Radio/radio-btn.interface.d.ts +2 -2
- package/dist/src/interfaces/Radio/radio.interface.d.ts +2 -1
- package/dist/src/interfaces/Select/select.interface.d.ts +1 -0
- package/dist/src/interfaces/SelectionControl/selection-control.interface.d.ts +5 -1
- package/dist/src/interfaces/SliderField/slider-field.interface.d.ts +4 -4
- package/dist/src/origam-core.cjs +51 -33
- package/dist/src/origam-core.js +21 -27
- 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/SliderField/slider-field.type.d.ts +8 -0
- 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/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 +11 -11
- package/dist/src/utils/Commons/nested.util.js +1 -1
- 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/token-name.util.cjs +22 -21
- package/dist/src/utils/Commons/token-name.util.js +22 -21
- 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
|
@@ -8,28 +8,23 @@ exports.splitKeyCombination = splitKeyCombination;
|
|
|
8
8
|
exports.splitKeySequence = splitKeySequence;
|
|
9
9
|
var _hotkey = require("../../consts/Commons/hotkey.const.cjs");
|
|
10
10
|
var _console = require("./console.util.cjs");
|
|
11
|
-
function
|
|
12
|
-
if (!combination) {
|
|
13
|
-
if (!isInternal) (0, _console.consoleWarn)("Invalid hotkey combination: empty string provided");
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
11
|
+
function hasInvalidCombinationStructure(combination) {
|
|
16
12
|
const startsWithPlusOrUnderscore = combination.startsWith("+") || combination.startsWith("_");
|
|
17
13
|
const hasInvalidLeadingSeparator =
|
|
18
14
|
// Starts with a single '+' or '_' followed by a non-separator character (e.g. '+a', '_a')
|
|
19
15
|
startsWithPlusOrUnderscore && !(combination.startsWith("++") || combination.startsWith("__"));
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
16
|
+
return (
|
|
17
|
+
// Invalid leading separator patterns
|
|
18
|
+
combination.length > 1 && hasInvalidLeadingSeparator ||
|
|
19
|
+
// Disallow literal + or _ keys (they require shift)
|
|
20
|
+
combination.includes("++") || combination.includes("__") || combination === "+" || combination === "_" ||
|
|
21
|
+
// Ends with a separator that is not part of a doubled literal
|
|
22
|
+
combination.length > 1 && (combination.endsWith("+") || combination.endsWith("_")) && combination.at(-2) !== combination.at(-1) ||
|
|
23
|
+
// Stand-alone doubled separators (dangling)
|
|
24
|
+
combination === "++" || combination === "--" || combination === "__"
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function parseCombinationKeys(combination) {
|
|
33
28
|
const keys = [];
|
|
34
29
|
let buffer = "";
|
|
35
30
|
const flushBuffer = () => {
|
|
@@ -41,74 +36,71 @@ function splitKeyCombination(combination, isInternal = false) {
|
|
|
41
36
|
for (let i = 0; i < combination.length; i++) {
|
|
42
37
|
const char = combination[i];
|
|
43
38
|
const nextChar = combination[i + 1];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
52
|
-
buffer += char;
|
|
53
|
-
}
|
|
39
|
+
const isSeparator = char === "+" || char === "_" || char === "-";
|
|
40
|
+
if (isSeparator && char === nextChar) {
|
|
41
|
+
flushBuffer();
|
|
42
|
+
keys.push(char);
|
|
43
|
+
i++;
|
|
44
|
+
} else if (char === "+" || char === "_") {
|
|
45
|
+
flushBuffer();
|
|
54
46
|
} else {
|
|
55
47
|
buffer += char;
|
|
56
48
|
}
|
|
57
49
|
}
|
|
58
50
|
flushBuffer();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
return keys;
|
|
52
|
+
}
|
|
53
|
+
function splitKeyCombination(combination, isInternal = false) {
|
|
54
|
+
if (!combination) {
|
|
55
|
+
if (!isInternal) (0, _console.consoleWarn)("Invalid hotkey combination: empty string provided");
|
|
62
56
|
return [];
|
|
63
57
|
}
|
|
58
|
+
const warnInvalidStructure = () => {
|
|
59
|
+
if (!isInternal) (0, _console.consoleWarn)(`Invalid hotkey combination: "${combination}" has invalid structure`);
|
|
60
|
+
return [];
|
|
61
|
+
};
|
|
62
|
+
if (hasInvalidCombinationStructure(combination)) return warnInvalidStructure();
|
|
63
|
+
const keys = parseCombinationKeys(combination);
|
|
64
|
+
const hasInvalidMinus = keys.some(key => key.length > 1 && key.includes("-") && key !== "--");
|
|
65
|
+
if (hasInvalidMinus) return warnInvalidStructure();
|
|
64
66
|
if (keys.length === 0 && combination) {
|
|
65
67
|
return [normalizeKey(combination)];
|
|
66
68
|
}
|
|
67
69
|
return keys;
|
|
68
70
|
}
|
|
69
|
-
function
|
|
70
|
-
if (!str) {
|
|
71
|
-
(0, _console.consoleWarn)("Invalid hotkey sequence: empty string provided");
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
71
|
+
function hasInvalidSequenceEdges(str) {
|
|
74
72
|
const hasInvalidStart = str.startsWith("-") && !["---", "--+"].includes(str);
|
|
75
73
|
const hasInvalidEnd = str.endsWith("-") && !str.endsWith("+-") && !str.endsWith("_-") && str !== "-" && str !== "---";
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
return hasInvalidStart || hasInvalidEnd;
|
|
75
|
+
}
|
|
76
|
+
function isHyphenInCombination(str, i) {
|
|
77
|
+
const prevChar = str[i - 1];
|
|
78
|
+
const prevPrevChar = i > 1 ? str[i - 2] : void 0;
|
|
79
|
+
return (prevChar === "+" || prevChar === "_") && prevPrevChar !== "+";
|
|
80
|
+
}
|
|
81
|
+
function tokenizeSequence(str) {
|
|
80
82
|
const result = [];
|
|
81
83
|
let buffer = "";
|
|
82
|
-
let i = 0;
|
|
83
|
-
while (i < str.length) {
|
|
84
|
+
for (let i = 0; i < str.length; i++) {
|
|
84
85
|
const char = str[i];
|
|
85
|
-
if (char
|
|
86
|
-
const prevChar = str[i - 1];
|
|
87
|
-
const prevPrevChar = i > 1 ? str[i - 2] : void 0;
|
|
88
|
-
const precededBySinglePlusOrUnderscore = (prevChar === "+" || prevChar === "_") && prevPrevChar !== "+";
|
|
89
|
-
if (precededBySinglePlusOrUnderscore) {
|
|
90
|
-
buffer += char;
|
|
91
|
-
i++;
|
|
92
|
-
} else {
|
|
93
|
-
if (buffer) {
|
|
94
|
-
result.push(buffer);
|
|
95
|
-
buffer = "";
|
|
96
|
-
} else {
|
|
97
|
-
result.push("-");
|
|
98
|
-
}
|
|
99
|
-
i++;
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
86
|
+
if (char !== "-" || isHyphenInCombination(str, i)) {
|
|
102
87
|
buffer += char;
|
|
103
|
-
|
|
88
|
+
} else if (buffer) {
|
|
89
|
+
result.push(buffer);
|
|
90
|
+
buffer = "";
|
|
91
|
+
} else {
|
|
92
|
+
result.push("-");
|
|
104
93
|
}
|
|
105
94
|
}
|
|
106
95
|
if (buffer) {
|
|
107
96
|
result.push(buffer);
|
|
108
97
|
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
function collapseMinusRuns(parts) {
|
|
109
101
|
const collapsed = [];
|
|
110
102
|
let minusCount = 0;
|
|
111
|
-
for (const part of
|
|
103
|
+
for (const part of parts) {
|
|
112
104
|
if (part === "-") {
|
|
113
105
|
if (minusCount % 2 === 0) collapsed.push("-");
|
|
114
106
|
minusCount++;
|
|
@@ -117,6 +109,18 @@ function splitKeySequence(str) {
|
|
|
117
109
|
collapsed.push(part);
|
|
118
110
|
}
|
|
119
111
|
}
|
|
112
|
+
return collapsed;
|
|
113
|
+
}
|
|
114
|
+
function splitKeySequence(str) {
|
|
115
|
+
if (!str) {
|
|
116
|
+
(0, _console.consoleWarn)("Invalid hotkey sequence: empty string provided");
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
if (hasInvalidSequenceEdges(str)) {
|
|
120
|
+
(0, _console.consoleWarn)(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
const collapsed = collapseMinusRuns(tokenizeSequence(str));
|
|
120
124
|
const areAllValid = collapsed.every(s => splitKeyCombination(s, true).length > 0);
|
|
121
125
|
if (!areAllValid) {
|
|
122
126
|
(0, _console.consoleWarn)(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import { KEYBOARD_ALIASES } from "../../consts/Commons/hotkey.const.js";
|
|
2
2
|
import { consoleWarn } from "./console.util.js";
|
|
3
|
-
|
|
4
|
-
if (!combination) {
|
|
5
|
-
if (!isInternal) consoleWarn("Invalid hotkey combination: empty string provided");
|
|
6
|
-
return [];
|
|
7
|
-
}
|
|
3
|
+
function hasInvalidCombinationStructure(combination) {
|
|
8
4
|
const startsWithPlusOrUnderscore = combination.startsWith("+") || combination.startsWith("_");
|
|
9
5
|
const hasInvalidLeadingSeparator = (
|
|
10
6
|
// Starts with a single '+' or '_' followed by a non-separator character (e.g. '+a', '_a')
|
|
11
7
|
startsWithPlusOrUnderscore && !(combination.startsWith("++") || combination.startsWith("__"))
|
|
12
8
|
);
|
|
13
|
-
|
|
9
|
+
return (
|
|
14
10
|
// Invalid leading separator patterns
|
|
15
11
|
combination.length > 1 && hasInvalidLeadingSeparator || // Disallow literal + or _ keys (they require shift)
|
|
16
12
|
combination.includes("++") || combination.includes("__") || combination === "+" || combination === "_" || // Ends with a separator that is not part of a doubled literal
|
|
17
13
|
combination.length > 1 && (combination.endsWith("+") || combination.endsWith("_")) && combination.at(-2) !== combination.at(-1) || // Stand-alone doubled separators (dangling)
|
|
18
14
|
combination === "++" || combination === "--" || combination === "__"
|
|
19
15
|
);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
16
|
+
}
|
|
17
|
+
function parseCombinationKeys(combination) {
|
|
24
18
|
const keys = [];
|
|
25
19
|
let buffer = "";
|
|
26
20
|
const flushBuffer = () => {
|
|
@@ -32,74 +26,71 @@ export function splitKeyCombination(combination, isInternal = false) {
|
|
|
32
26
|
for (let i = 0; i < combination.length; i++) {
|
|
33
27
|
const char = combination[i];
|
|
34
28
|
const nextChar = combination[i + 1];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} else {
|
|
43
|
-
buffer += char;
|
|
44
|
-
}
|
|
29
|
+
const isSeparator = char === "+" || char === "_" || char === "-";
|
|
30
|
+
if (isSeparator && char === nextChar) {
|
|
31
|
+
flushBuffer();
|
|
32
|
+
keys.push(char);
|
|
33
|
+
i++;
|
|
34
|
+
} else if (char === "+" || char === "_") {
|
|
35
|
+
flushBuffer();
|
|
45
36
|
} else {
|
|
46
37
|
buffer += char;
|
|
47
38
|
}
|
|
48
39
|
}
|
|
49
40
|
flushBuffer();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
export function splitKeyCombination(combination, isInternal = false) {
|
|
44
|
+
if (!combination) {
|
|
45
|
+
if (!isInternal) consoleWarn("Invalid hotkey combination: empty string provided");
|
|
53
46
|
return [];
|
|
54
47
|
}
|
|
48
|
+
const warnInvalidStructure = () => {
|
|
49
|
+
if (!isInternal) consoleWarn(`Invalid hotkey combination: "${combination}" has invalid structure`);
|
|
50
|
+
return [];
|
|
51
|
+
};
|
|
52
|
+
if (hasInvalidCombinationStructure(combination)) return warnInvalidStructure();
|
|
53
|
+
const keys = parseCombinationKeys(combination);
|
|
54
|
+
const hasInvalidMinus = keys.some((key) => key.length > 1 && key.includes("-") && key !== "--");
|
|
55
|
+
if (hasInvalidMinus) return warnInvalidStructure();
|
|
55
56
|
if (keys.length === 0 && combination) {
|
|
56
57
|
return [normalizeKey(combination)];
|
|
57
58
|
}
|
|
58
59
|
return keys;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
if (!str) {
|
|
62
|
-
consoleWarn("Invalid hotkey sequence: empty string provided");
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
61
|
+
function hasInvalidSequenceEdges(str) {
|
|
65
62
|
const hasInvalidStart = str.startsWith("-") && !["---", "--+"].includes(str);
|
|
66
63
|
const hasInvalidEnd = str.endsWith("-") && !str.endsWith("+-") && !str.endsWith("_-") && str !== "-" && str !== "---";
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
return hasInvalidStart || hasInvalidEnd;
|
|
65
|
+
}
|
|
66
|
+
function isHyphenInCombination(str, i) {
|
|
67
|
+
const prevChar = str[i - 1];
|
|
68
|
+
const prevPrevChar = i > 1 ? str[i - 2] : void 0;
|
|
69
|
+
return (prevChar === "+" || prevChar === "_") && prevPrevChar !== "+";
|
|
70
|
+
}
|
|
71
|
+
function tokenizeSequence(str) {
|
|
71
72
|
const result = [];
|
|
72
73
|
let buffer = "";
|
|
73
|
-
let i = 0;
|
|
74
|
-
while (i < str.length) {
|
|
74
|
+
for (let i = 0; i < str.length; i++) {
|
|
75
75
|
const char = str[i];
|
|
76
|
-
if (char
|
|
77
|
-
const prevChar = str[i - 1];
|
|
78
|
-
const prevPrevChar = i > 1 ? str[i - 2] : void 0;
|
|
79
|
-
const precededBySinglePlusOrUnderscore = (prevChar === "+" || prevChar === "_") && prevPrevChar !== "+";
|
|
80
|
-
if (precededBySinglePlusOrUnderscore) {
|
|
81
|
-
buffer += char;
|
|
82
|
-
i++;
|
|
83
|
-
} else {
|
|
84
|
-
if (buffer) {
|
|
85
|
-
result.push(buffer);
|
|
86
|
-
buffer = "";
|
|
87
|
-
} else {
|
|
88
|
-
result.push("-");
|
|
89
|
-
}
|
|
90
|
-
i++;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
76
|
+
if (char !== "-" || isHyphenInCombination(str, i)) {
|
|
93
77
|
buffer += char;
|
|
94
|
-
|
|
78
|
+
} else if (buffer) {
|
|
79
|
+
result.push(buffer);
|
|
80
|
+
buffer = "";
|
|
81
|
+
} else {
|
|
82
|
+
result.push("-");
|
|
95
83
|
}
|
|
96
84
|
}
|
|
97
85
|
if (buffer) {
|
|
98
86
|
result.push(buffer);
|
|
99
87
|
}
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
function collapseMinusRuns(parts) {
|
|
100
91
|
const collapsed = [];
|
|
101
92
|
let minusCount = 0;
|
|
102
|
-
for (const part of
|
|
93
|
+
for (const part of parts) {
|
|
103
94
|
if (part === "-") {
|
|
104
95
|
if (minusCount % 2 === 0) collapsed.push("-");
|
|
105
96
|
minusCount++;
|
|
@@ -108,6 +99,18 @@ export function splitKeySequence(str) {
|
|
|
108
99
|
collapsed.push(part);
|
|
109
100
|
}
|
|
110
101
|
}
|
|
102
|
+
return collapsed;
|
|
103
|
+
}
|
|
104
|
+
export function splitKeySequence(str) {
|
|
105
|
+
if (!str) {
|
|
106
|
+
consoleWarn("Invalid hotkey sequence: empty string provided");
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
if (hasInvalidSequenceEdges(str)) {
|
|
110
|
+
consoleWarn(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const collapsed = collapseMinusRuns(tokenizeSequence(str));
|
|
111
114
|
const areAllValid = collapsed.every((s) => splitKeyCombination(s, true).length > 0);
|
|
112
115
|
if (!areAllValid) {
|
|
113
116
|
consoleWarn(`Invalid hotkey sequence: "${str}" contains invalid combinations`);
|
|
@@ -66,8 +66,8 @@ function hoverShow(e) {
|
|
|
66
66
|
if ((0, _ripple.isTouchEvent)(e)) {
|
|
67
67
|
element._hover.touched = true;
|
|
68
68
|
element._hover.isTouch = true;
|
|
69
|
-
} else {
|
|
70
|
-
|
|
69
|
+
} else if (element._hover.isTouch) {
|
|
70
|
+
return;
|
|
71
71
|
}
|
|
72
72
|
if (element._hover.class) {
|
|
73
73
|
value.class = element._hover.class;
|
|
@@ -42,8 +42,8 @@ export function hoverShow(e) {
|
|
|
42
42
|
if (isTouchEvent(e)) {
|
|
43
43
|
element._hover.touched = true;
|
|
44
44
|
element._hover.isTouch = true;
|
|
45
|
-
} else {
|
|
46
|
-
|
|
45
|
+
} else if (element._hover.isTouch) {
|
|
46
|
+
return;
|
|
47
47
|
}
|
|
48
48
|
if (element._hover.class) {
|
|
49
49
|
value.class = element._hover.class;
|
|
@@ -12,7 +12,7 @@ var _vModel = require("../../composables/Commons/vModel.composable.cjs");
|
|
|
12
12
|
function callI18nT(fn, key, params) {
|
|
13
13
|
if (typeof key !== "string" || !key) return key;
|
|
14
14
|
if (!params.length) return fn(key);
|
|
15
|
-
const list = params.map(p => p
|
|
15
|
+
const list = params.map(p => p ?? "");
|
|
16
16
|
return fn(key, list);
|
|
17
17
|
}
|
|
18
18
|
function createVueI18nAdapter({
|
|
@@ -3,7 +3,7 @@ import { useVModel } from "../../composables/Commons/vModel.composable.js";
|
|
|
3
3
|
function callI18nT(fn, key, params) {
|
|
4
4
|
if (typeof key !== "string" || !key) return key;
|
|
5
5
|
if (!params.length) return fn(key);
|
|
6
|
-
const list = params.map((p) => p
|
|
6
|
+
const list = params.map((p) => p ?? "");
|
|
7
7
|
return fn(key, list);
|
|
8
8
|
}
|
|
9
9
|
export function createVueI18nAdapter({ i18n, useI18n }) {
|
|
@@ -34,7 +34,7 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
34
34
|
preferredOrigin
|
|
35
35
|
} = (0, _commons.destructComputed)(() => {
|
|
36
36
|
const parsedAnchor = (0, _anchor.parseAnchor)(props.location);
|
|
37
|
-
const parsedOrigin = props.origin
|
|
37
|
+
const parsedOrigin = resolveOrigin(props.origin, parsedAnchor);
|
|
38
38
|
if (parsedAnchor.side === parsedOrigin.side && parsedAnchor.align === (0, _anchor.flipAlign)(parsedOrigin).align) {
|
|
39
39
|
return {
|
|
40
40
|
preferredAnchor: (0, _anchor.flipCorner)(parsedAnchor),
|
|
@@ -107,24 +107,7 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
107
107
|
contentBox.y -= parseFloat(document.documentElement.style.getPropertyValue("--origam-body-scroll-y") || "0");
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
const viewport = scrollParents
|
|
111
|
-
const rect = el.getBoundingClientRect();
|
|
112
|
-
const scrollBox = new _box.Box({
|
|
113
|
-
x: el === document.documentElement ? 0 : rect.x,
|
|
114
|
-
y: el === document.documentElement ? 0 : rect.y,
|
|
115
|
-
width: el.clientWidth,
|
|
116
|
-
height: el.clientHeight
|
|
117
|
-
});
|
|
118
|
-
if (box) {
|
|
119
|
-
return new _box.Box({
|
|
120
|
-
x: Math.max(box.left, scrollBox.left),
|
|
121
|
-
y: Math.max(box.top, scrollBox.top),
|
|
122
|
-
width: Math.min(box.right, scrollBox.right) - Math.max(box.left, scrollBox.left),
|
|
123
|
-
height: Math.min(box.bottom, scrollBox.bottom) - Math.max(box.top, scrollBox.top)
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return scrollBox;
|
|
127
|
-
}, void 0);
|
|
110
|
+
const viewport = intersectScrollParents(scrollParents);
|
|
128
111
|
viewport.x += viewportMargin;
|
|
129
112
|
viewport.y += viewportMargin;
|
|
130
113
|
viewport.width -= viewportMargin * 2;
|
|
@@ -141,34 +124,8 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
141
124
|
x: x2,
|
|
142
125
|
y: y2
|
|
143
126
|
} = (0, _point.getOffset)(targetPoint, contentPoint);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
y2 -= offset.value[0];
|
|
147
|
-
break;
|
|
148
|
-
case "bottom":
|
|
149
|
-
y2 += offset.value[0];
|
|
150
|
-
break;
|
|
151
|
-
case "left":
|
|
152
|
-
x2 -= offset.value[0];
|
|
153
|
-
break;
|
|
154
|
-
case "right":
|
|
155
|
-
x2 += offset.value[0];
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
switch (_placement.anchor.align) {
|
|
159
|
-
case "top":
|
|
160
|
-
y2 -= offset.value[1];
|
|
161
|
-
break;
|
|
162
|
-
case "bottom":
|
|
163
|
-
y2 += offset.value[1];
|
|
164
|
-
break;
|
|
165
|
-
case "left":
|
|
166
|
-
x2 -= offset.value[1];
|
|
167
|
-
break;
|
|
168
|
-
case "right":
|
|
169
|
-
x2 += offset.value[1];
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
127
|
+
[x2, y2] = applyEdgeOffset(x2, y2, _placement.anchor.side, offset.value[0]);
|
|
128
|
+
[x2, y2] = applyEdgeOffset(x2, y2, _placement.anchor.align, offset.value[1]);
|
|
172
129
|
box.x += x2;
|
|
173
130
|
box.y += y2;
|
|
174
131
|
box.width = Math.min(box.width, maxWidth.value);
|
|
@@ -205,51 +162,13 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
205
162
|
y += _y;
|
|
206
163
|
contentBox.x += _x;
|
|
207
164
|
contentBox.y += _y;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const newPlacement = {
|
|
216
|
-
anchor: {
|
|
217
|
-
...placement.anchor
|
|
218
|
-
},
|
|
219
|
-
origin: {
|
|
220
|
-
...placement.origin
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const flip = key === _drag.AXIS.X ? axis2 === _drag.AXIS.Y ? _anchor.flipAlign : _anchor.flipSide : axis2 === _drag.AXIS.Y ? _anchor.flipSide : _anchor.flipAlign;
|
|
224
|
-
newPlacement.anchor = flip(newPlacement.anchor);
|
|
225
|
-
newPlacement.origin = flip(newPlacement.origin);
|
|
226
|
-
const {
|
|
227
|
-
overflows: newOverflows
|
|
228
|
-
} = checkOverflow(newPlacement);
|
|
229
|
-
if (newOverflows[key].before <= overflows[key].before && newOverflows[key].after <= overflows[key].after || newOverflows[key].before + newOverflows[key].after < (overflows[key].before + overflows[key].after) / 2) {
|
|
230
|
-
placement = newPlacement;
|
|
231
|
-
reset = flipped[key] = true;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
if (reset) continue;
|
|
236
|
-
}
|
|
237
|
-
if (overflows.x.before) {
|
|
238
|
-
x += overflows.x.before;
|
|
239
|
-
contentBox.x += overflows.x.before;
|
|
240
|
-
}
|
|
241
|
-
if (overflows.x.after) {
|
|
242
|
-
x -= overflows.x.after;
|
|
243
|
-
contentBox.x -= overflows.x.after;
|
|
244
|
-
}
|
|
245
|
-
if (overflows.y.before) {
|
|
246
|
-
y += overflows.y.before;
|
|
247
|
-
contentBox.y += overflows.y.before;
|
|
248
|
-
}
|
|
249
|
-
if (overflows.y.after) {
|
|
250
|
-
y -= overflows.y.after;
|
|
251
|
-
contentBox.y -= overflows.y.after;
|
|
252
|
-
}
|
|
165
|
+
const flip = flipPlacement(placement, overflows, flipped, checkOverflow);
|
|
166
|
+
placement = flip.placement;
|
|
167
|
+
if (flip.reset) continue;
|
|
168
|
+
x = shiftAxis(x, overflows.x);
|
|
169
|
+
contentBox.x = shiftAxis(contentBox.x, overflows.x);
|
|
170
|
+
y = shiftAxis(y, overflows.y);
|
|
171
|
+
contentBox.y = shiftAxis(contentBox.y, overflows.y);
|
|
253
172
|
{
|
|
254
173
|
const overflows2 = (0, _box2.getOverflow)(contentBox, viewport);
|
|
255
174
|
available.x = viewport.width - overflows2.x.before - overflows2.x.after;
|
|
@@ -299,6 +218,82 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
299
218
|
updateLocation
|
|
300
219
|
};
|
|
301
220
|
}
|
|
221
|
+
function resolveOrigin(origin, anchor) {
|
|
222
|
+
if (origin === "overlap") return anchor;
|
|
223
|
+
if (origin === "auto") return (0, _anchor.flipSide)(anchor);
|
|
224
|
+
return (0, _anchor.parseAnchor)(origin);
|
|
225
|
+
}
|
|
226
|
+
function intersectScrollParents(scrollParents) {
|
|
227
|
+
return scrollParents.reduce((box, el) => {
|
|
228
|
+
const rect = el.getBoundingClientRect();
|
|
229
|
+
const scrollBox = new _box.Box({
|
|
230
|
+
x: el === document.documentElement ? 0 : rect.x,
|
|
231
|
+
y: el === document.documentElement ? 0 : rect.y,
|
|
232
|
+
width: el.clientWidth,
|
|
233
|
+
height: el.clientHeight
|
|
234
|
+
});
|
|
235
|
+
if (box) {
|
|
236
|
+
return new _box.Box({
|
|
237
|
+
x: Math.max(box.left, scrollBox.left),
|
|
238
|
+
y: Math.max(box.top, scrollBox.top),
|
|
239
|
+
width: Math.min(box.right, scrollBox.right) - Math.max(box.left, scrollBox.left),
|
|
240
|
+
height: Math.min(box.bottom, scrollBox.bottom) - Math.max(box.top, scrollBox.top)
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return scrollBox;
|
|
244
|
+
}, void 0);
|
|
245
|
+
}
|
|
246
|
+
function applyEdgeOffset(x, y, edge, amount) {
|
|
247
|
+
switch (edge) {
|
|
248
|
+
case "top":
|
|
249
|
+
return [x, y - amount];
|
|
250
|
+
case "bottom":
|
|
251
|
+
return [x, y + amount];
|
|
252
|
+
case "left":
|
|
253
|
+
return [x - amount, y];
|
|
254
|
+
case "right":
|
|
255
|
+
return [x + amount, y];
|
|
256
|
+
default:
|
|
257
|
+
return [x, y];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function shiftAxis(value, overflow) {
|
|
261
|
+
if (overflow.before) value += overflow.before;
|
|
262
|
+
if (overflow.after) value -= overflow.after;
|
|
263
|
+
return value;
|
|
264
|
+
}
|
|
265
|
+
function flipPlacement(initial, overflows, flipped, checkOverflow) {
|
|
266
|
+
let placement = initial;
|
|
267
|
+
let reset = false;
|
|
268
|
+
const axis = (0, _anchor.getAxis)(placement.anchor);
|
|
269
|
+
const hasOverflow = {
|
|
270
|
+
x: overflows.x.before || overflows.x.after,
|
|
271
|
+
y: overflows.y.before || overflows.y.after
|
|
272
|
+
};
|
|
273
|
+
for (const key of [_drag.AXIS.X, _drag.AXIS.Y]) {
|
|
274
|
+
if (!hasOverflow[key] || flipped[key]) continue;
|
|
275
|
+
const flip = key === _drag.AXIS.X === (axis === _drag.AXIS.Y) ? _anchor.flipAlign : _anchor.flipSide;
|
|
276
|
+
const newPlacement = {
|
|
277
|
+
anchor: flip({
|
|
278
|
+
...placement.anchor
|
|
279
|
+
}),
|
|
280
|
+
origin: flip({
|
|
281
|
+
...placement.origin
|
|
282
|
+
})
|
|
283
|
+
};
|
|
284
|
+
const {
|
|
285
|
+
overflows: newOverflows
|
|
286
|
+
} = checkOverflow(newPlacement);
|
|
287
|
+
if (newOverflows[key].before <= overflows[key].before && newOverflows[key].after <= overflows[key].after || newOverflows[key].before + newOverflows[key].after < (overflows[key].before + overflows[key].after) / 2) {
|
|
288
|
+
placement = newPlacement;
|
|
289
|
+
reset = flipped[key] = true;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return {
|
|
293
|
+
placement,
|
|
294
|
+
reset
|
|
295
|
+
};
|
|
296
|
+
}
|
|
302
297
|
function getIntrinsicSize(el) {
|
|
303
298
|
el.style.removeProperty("right");
|
|
304
299
|
const contentBox = (0, _animation.nullifyTransforms)(el);
|