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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDisplayOptions, IDisplayPlatform, IInternalDisplayOptions } from '../../interfaces/Commons/display.interface';
|
|
2
|
-
import type { TSSROptions } from '../../types/Commons/display.type';
|
|
2
|
+
import type { TBreakpoint, TSSROptions } from '../../types/Commons/display.type';
|
|
3
3
|
/**
|
|
4
4
|
* Parse display options.
|
|
5
5
|
*
|
|
@@ -19,6 +19,13 @@ export declare function getClientWidth(ssr?: TSSROptions): number;
|
|
|
19
19
|
* @param ssr …
|
|
20
20
|
*/
|
|
21
21
|
export declare function getClientHeight(ssr?: TSSROptions): number;
|
|
22
|
+
/*********************************************************
|
|
23
|
+
* getBreakpointName
|
|
24
|
+
*
|
|
25
|
+
* @description
|
|
26
|
+
* Name of the active breakpoint from the exclusive per-breakpoint flags (`xxl` when none of the smaller ones matches).
|
|
27
|
+
********************************************************/
|
|
28
|
+
export declare function getBreakpointName(flags: Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', boolean>): TBreakpoint;
|
|
22
29
|
/**
|
|
23
30
|
* Get platform.
|
|
24
31
|
*
|
|
@@ -13,10 +13,18 @@ export function getClientWidth(ssr) {
|
|
|
13
13
|
export function getClientHeight(ssr) {
|
|
14
14
|
return IN_BROWSER && !ssr ? window.innerHeight : typeof ssr === "object" && ssr.clientHeight || 0;
|
|
15
15
|
}
|
|
16
|
+
export function getBreakpointName(flags) {
|
|
17
|
+
if (flags.xs) return "xs";
|
|
18
|
+
if (flags.sm) return "sm";
|
|
19
|
+
if (flags.md) return "md";
|
|
20
|
+
if (flags.lg) return "lg";
|
|
21
|
+
if (flags.xl) return "xl";
|
|
22
|
+
return "xxl";
|
|
23
|
+
}
|
|
16
24
|
export function getPlatform(ssr) {
|
|
17
25
|
const userAgent = IN_BROWSER && !ssr ? window.navigator.userAgent : "ssr";
|
|
18
26
|
const match = (regexp) => {
|
|
19
|
-
return
|
|
27
|
+
return regexp.test(userAgent);
|
|
20
28
|
};
|
|
21
29
|
const android = match(/android/i);
|
|
22
30
|
const ios = match(/iphone|ipad|ipod/i);
|
|
@@ -10,7 +10,6 @@ function resolveUnref(r) {
|
|
|
10
10
|
return typeof r === "function" ? r() : (0, _vue.unref)(r);
|
|
11
11
|
}
|
|
12
12
|
function unrefElement(elRef) {
|
|
13
|
-
let _a;
|
|
14
13
|
const plain = resolveUnref(elRef);
|
|
15
|
-
return
|
|
14
|
+
return plain?.$el ?? plain;
|
|
16
15
|
}
|
|
@@ -3,7 +3,6 @@ export function resolveUnref(r) {
|
|
|
3
3
|
return typeof r === "function" ? r() : unref(r);
|
|
4
4
|
}
|
|
5
5
|
export function unrefElement(elRef) {
|
|
6
|
-
let _a;
|
|
7
6
|
const plain = resolveUnref(elRef);
|
|
8
|
-
return
|
|
7
|
+
return plain?.$el ?? plain;
|
|
9
8
|
}
|
|
@@ -10,48 +10,62 @@ function defaultFilter(value, query) {
|
|
|
10
10
|
if (value == null || query == null) return -1;
|
|
11
11
|
return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase());
|
|
12
12
|
}
|
|
13
|
+
function isMatch(match) {
|
|
14
|
+
return match !== -1 && match !== false;
|
|
15
|
+
}
|
|
16
|
+
function matchObjectKeys(item, transformed, query, keys, filter, options, customMatches, defaultMatches) {
|
|
17
|
+
const filterKeys = keys || Object.keys(transformed);
|
|
18
|
+
for (const key of filterKeys) {
|
|
19
|
+
const value = (0, _commons.getPropertyFromItem)(transformed, key);
|
|
20
|
+
const keyFilter = options?.customKeyFilter?.[key];
|
|
21
|
+
const match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
|
22
|
+
if (isMatch(match)) {
|
|
23
|
+
if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
|
|
24
|
+
} else if (options?.filterMode === "every") {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function satisfiesFilterMode(filterMode, defaultMatchesLength, customMatchesLength, customFiltersLength) {
|
|
31
|
+
if (!defaultMatchesLength && !customMatchesLength) return false;
|
|
32
|
+
if (filterMode === "union") {
|
|
33
|
+
return customMatchesLength === customFiltersLength || !!defaultMatchesLength;
|
|
34
|
+
}
|
|
35
|
+
if (filterMode === "intersection") {
|
|
36
|
+
return customMatchesLength === customFiltersLength && !!defaultMatchesLength;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function matchItem(item, transformed, query, keys, filter, options, customFiltersLength) {
|
|
41
|
+
const customMatches = {};
|
|
42
|
+
const defaultMatches = {};
|
|
43
|
+
if (typeof item === "object") {
|
|
44
|
+
if (!matchObjectKeys(item, transformed, query, keys, filter, options, customMatches, defaultMatches)) return null;
|
|
45
|
+
} else {
|
|
46
|
+
const match = filter(item, query, item);
|
|
47
|
+
if (isMatch(match)) defaultMatches.title = match;
|
|
48
|
+
}
|
|
49
|
+
const defaultMatchesLength = Object.keys(defaultMatches).length;
|
|
50
|
+
const customMatchesLength = Object.keys(customMatches).length;
|
|
51
|
+
if (!satisfiesFilterMode(options?.filterMode, defaultMatchesLength, customMatchesLength, customFiltersLength)) return null;
|
|
52
|
+
return {
|
|
53
|
+
...defaultMatches,
|
|
54
|
+
...customMatches
|
|
55
|
+
};
|
|
56
|
+
}
|
|
13
57
|
function filterItems(items, query, options) {
|
|
14
58
|
const array = [];
|
|
15
59
|
const filter = options?.default ?? defaultFilter;
|
|
16
60
|
const keys = options?.filterKeys ? (0, _commons.wrapInArray)(options.filterKeys) : false;
|
|
17
61
|
const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length;
|
|
18
62
|
if (!items?.length) return array;
|
|
19
|
-
|
|
63
|
+
for (let i = 0; i < items.length; i++) {
|
|
20
64
|
const [item, transformed = item] = (0, _commons.wrapInArray)(items[i]);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
let match = -1;
|
|
24
|
-
if (query && !options?.noFilter) {
|
|
25
|
-
if (typeof item === "object") {
|
|
26
|
-
const filterKeys = keys || Object.keys(transformed);
|
|
27
|
-
for (const key of filterKeys) {
|
|
28
|
-
const value = (0, _commons.getPropertyFromItem)(transformed, key);
|
|
29
|
-
const keyFilter = options?.customKeyFilter?.[key];
|
|
30
|
-
match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
|
31
|
-
if (match !== -1 && match !== false) {
|
|
32
|
-
if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
|
|
33
|
-
} else if (options?.filterMode === "every") {
|
|
34
|
-
continue loop;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
match = filter(item, query, item);
|
|
39
|
-
if (match !== -1 && match !== false) {
|
|
40
|
-
defaultMatches.title = match;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const defaultMatchesLength = Object.keys(defaultMatches).length;
|
|
44
|
-
const customMatchesLength = Object.keys(customMatches).length;
|
|
45
|
-
if (!defaultMatchesLength && !customMatchesLength) continue;
|
|
46
|
-
if (options?.filterMode === "union" && customMatchesLength !== customFiltersLength && !defaultMatchesLength) continue;
|
|
47
|
-
if (options?.filterMode === "intersection" && (customMatchesLength !== customFiltersLength || !defaultMatchesLength)) continue;
|
|
48
|
-
}
|
|
49
|
-
array.push({
|
|
65
|
+
const matches = query && !options?.noFilter ? matchItem(item, transformed, query, keys, filter, options, customFiltersLength) : {};
|
|
66
|
+
if (matches) array.push({
|
|
50
67
|
index: i,
|
|
51
|
-
matches
|
|
52
|
-
...defaultMatches,
|
|
53
|
-
...customMatches
|
|
54
|
-
}
|
|
68
|
+
matches
|
|
55
69
|
});
|
|
56
70
|
}
|
|
57
71
|
return array;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { IFilterItemsOptions } from '../../interfaces/Commons/filters.interface';
|
|
1
2
|
import type { IInternalItem } from '../../interfaces/List/list-children.interface';
|
|
2
|
-
import type {
|
|
3
|
+
import type { TFilterMatch } from '../../types/Commons/filters.type';
|
|
3
4
|
/**
|
|
4
5
|
* Default filter.
|
|
5
6
|
*
|
|
@@ -14,13 +15,7 @@ export declare function defaultFilter(value: string | number, query: string | nu
|
|
|
14
15
|
* @param query …
|
|
15
16
|
* @param options …
|
|
16
17
|
*/
|
|
17
|
-
export declare function filterItems(items: readonly (readonly [item: IInternalItem, transformed: Record<string, unknown>])[] | readonly IInternalItem[], query: string, options?: {
|
|
18
|
-
customKeyFilter?: TFilterKeyFunctions;
|
|
19
|
-
default?: TFilterFunction;
|
|
20
|
-
filterKeys?: TFilterKeys;
|
|
21
|
-
filterMode?: TFilterMode;
|
|
22
|
-
noFilter?: boolean;
|
|
23
|
-
}): {
|
|
18
|
+
export declare function filterItems(items: readonly (readonly [item: IInternalItem, transformed: Record<string, unknown>])[] | readonly IInternalItem[], query: string, options?: IFilterItemsOptions): {
|
|
24
19
|
index: number;
|
|
25
20
|
matches: Record<string, TFilterMatch>;
|
|
26
21
|
}[];
|
|
@@ -3,45 +3,58 @@ export function defaultFilter(value, query) {
|
|
|
3
3
|
if (value == null || query == null) return -1;
|
|
4
4
|
return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase());
|
|
5
5
|
}
|
|
6
|
+
function isMatch(match) {
|
|
7
|
+
return match !== -1 && match !== false;
|
|
8
|
+
}
|
|
9
|
+
function matchObjectKeys(item, transformed, query, keys, filter, options, customMatches, defaultMatches) {
|
|
10
|
+
const filterKeys = keys || Object.keys(transformed);
|
|
11
|
+
for (const key of filterKeys) {
|
|
12
|
+
const value = getPropertyFromItem(transformed, key);
|
|
13
|
+
const keyFilter = options?.customKeyFilter?.[key];
|
|
14
|
+
const match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
|
15
|
+
if (isMatch(match)) {
|
|
16
|
+
if (keyFilter) customMatches[key] = match;
|
|
17
|
+
else defaultMatches[key] = match;
|
|
18
|
+
} else if (options?.filterMode === "every") {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function satisfiesFilterMode(filterMode, defaultMatchesLength, customMatchesLength, customFiltersLength) {
|
|
25
|
+
if (!defaultMatchesLength && !customMatchesLength) return false;
|
|
26
|
+
if (filterMode === "union") {
|
|
27
|
+
return customMatchesLength === customFiltersLength || !!defaultMatchesLength;
|
|
28
|
+
}
|
|
29
|
+
if (filterMode === "intersection") {
|
|
30
|
+
return customMatchesLength === customFiltersLength && !!defaultMatchesLength;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
function matchItem(item, transformed, query, keys, filter, options, customFiltersLength) {
|
|
35
|
+
const customMatches = {};
|
|
36
|
+
const defaultMatches = {};
|
|
37
|
+
if (typeof item === "object") {
|
|
38
|
+
if (!matchObjectKeys(item, transformed, query, keys, filter, options, customMatches, defaultMatches)) return null;
|
|
39
|
+
} else {
|
|
40
|
+
const match = filter(item, query, item);
|
|
41
|
+
if (isMatch(match)) defaultMatches.title = match;
|
|
42
|
+
}
|
|
43
|
+
const defaultMatchesLength = Object.keys(defaultMatches).length;
|
|
44
|
+
const customMatchesLength = Object.keys(customMatches).length;
|
|
45
|
+
if (!satisfiesFilterMode(options?.filterMode, defaultMatchesLength, customMatchesLength, customFiltersLength)) return null;
|
|
46
|
+
return { ...defaultMatches, ...customMatches };
|
|
47
|
+
}
|
|
6
48
|
export function filterItems(items, query, options) {
|
|
7
49
|
const array = [];
|
|
8
50
|
const filter = options?.default ?? defaultFilter;
|
|
9
51
|
const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false;
|
|
10
52
|
const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length;
|
|
11
53
|
if (!items?.length) return array;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let match = -1;
|
|
18
|
-
if (query && !options?.noFilter) {
|
|
19
|
-
if (typeof item === "object") {
|
|
20
|
-
const filterKeys = keys || Object.keys(transformed);
|
|
21
|
-
for (const key of filterKeys) {
|
|
22
|
-
const value = getPropertyFromItem(transformed, key);
|
|
23
|
-
const keyFilter = options?.customKeyFilter?.[key];
|
|
24
|
-
match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
|
25
|
-
if (match !== -1 && match !== false) {
|
|
26
|
-
if (keyFilter) customMatches[key] = match;
|
|
27
|
-
else defaultMatches[key] = match;
|
|
28
|
-
} else if (options?.filterMode === "every") {
|
|
29
|
-
continue loop;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
match = filter(item, query, item);
|
|
34
|
-
if (match !== -1 && match !== false) {
|
|
35
|
-
defaultMatches.title = match;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const defaultMatchesLength = Object.keys(defaultMatches).length;
|
|
39
|
-
const customMatchesLength = Object.keys(customMatches).length;
|
|
40
|
-
if (!defaultMatchesLength && !customMatchesLength) continue;
|
|
41
|
-
if (options?.filterMode === "union" && customMatchesLength !== customFiltersLength && !defaultMatchesLength) continue;
|
|
42
|
-
if (options?.filterMode === "intersection" && (customMatchesLength !== customFiltersLength || !defaultMatchesLength)) continue;
|
|
43
|
-
}
|
|
44
|
-
array.push({ index: i, matches: { ...defaultMatches, ...customMatches } });
|
|
45
|
-
}
|
|
54
|
+
for (let i = 0; i < items.length; i++) {
|
|
55
|
+
const [item, transformed = item] = wrapInArray(items[i]);
|
|
56
|
+
const matches = query && !options?.noFilter ? matchItem(item, transformed, query, keys, filter, options, customFiltersLength) : {};
|
|
57
|
+
if (matches) array.push({ index: i, matches });
|
|
58
|
+
}
|
|
46
59
|
return array;
|
|
47
60
|
}
|
|
@@ -6,6 +6,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.forwardRefs = forwardRefs;
|
|
7
7
|
exports.getDescriptor = getDescriptor;
|
|
8
8
|
var _forwardRefs = require("../../consts/Commons/forwardRefs.const.cjs");
|
|
9
|
+
function isInternalKey(key) {
|
|
10
|
+
return typeof key === "symbol" || key.startsWith("$") || key.startsWith("__");
|
|
11
|
+
}
|
|
12
|
+
function findRefValueWith(refs, key) {
|
|
13
|
+
for (const ref of refs) {
|
|
14
|
+
if (ref.value && Reflect.has(ref.value, key)) return ref.value;
|
|
15
|
+
}
|
|
16
|
+
return void 0;
|
|
17
|
+
}
|
|
18
|
+
function findDescriptorInRefs(refs, key) {
|
|
19
|
+
for (const ref of refs) {
|
|
20
|
+
if (!ref.value) continue;
|
|
21
|
+
const descriptor = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
|
|
22
|
+
if (descriptor) return descriptor;
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
function findDescriptorInForwardedRefs(refs, key) {
|
|
27
|
+
for (const ref of refs) {
|
|
28
|
+
const childRefs = ref.value && ref.value[_forwardRefs.FORWARD_REFS];
|
|
29
|
+
if (!childRefs) continue;
|
|
30
|
+
const queue = childRefs.slice();
|
|
31
|
+
while (queue.length) {
|
|
32
|
+
const ref2 = queue.shift();
|
|
33
|
+
const descriptor = getDescriptor(ref2.value, key);
|
|
34
|
+
if (descriptor) return descriptor;
|
|
35
|
+
const childRefs2 = ref2.value?.[_forwardRefs.FORWARD_REFS];
|
|
36
|
+
if (childRefs2) queue.push(...childRefs2);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
9
41
|
function forwardRefs(target, ...refs) {
|
|
10
42
|
target[_forwardRefs.FORWARD_REFS] = refs;
|
|
11
43
|
return new Proxy(target, {
|
|
@@ -13,60 +45,32 @@ function forwardRefs(target, ...refs) {
|
|
|
13
45
|
if (Reflect.has(target2, key)) {
|
|
14
46
|
return Reflect.get(target2, key);
|
|
15
47
|
}
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
48
|
+
if (isInternalKey(key)) return;
|
|
49
|
+
const owner = findRefValueWith(refs, key);
|
|
50
|
+
if (!owner) return;
|
|
51
|
+
const val = Reflect.get(owner, key);
|
|
52
|
+
return typeof val === "function" ? val.bind(owner) : val;
|
|
23
53
|
},
|
|
24
54
|
has(target2, key) {
|
|
25
55
|
if (Reflect.has(target2, key)) {
|
|
26
56
|
return true;
|
|
27
57
|
}
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
if (ref.value && Reflect.has(ref.value, key)) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
58
|
+
if (isInternalKey(key)) return false;
|
|
59
|
+
return findRefValueWith(refs, key) !== void 0;
|
|
35
60
|
},
|
|
36
61
|
set(target2, key, value) {
|
|
37
62
|
if (Reflect.has(target2, key)) {
|
|
38
63
|
return Reflect.set(target2, key, value);
|
|
39
64
|
}
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return Reflect.set(ref.value, key, value);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
65
|
+
if (isInternalKey(key)) return false;
|
|
66
|
+
const owner = findRefValueWith(refs, key);
|
|
67
|
+
return owner ? Reflect.set(owner, key, value) : false;
|
|
47
68
|
},
|
|
48
69
|
getOwnPropertyDescriptor(target2, key) {
|
|
49
70
|
const descriptor = Reflect.getOwnPropertyDescriptor(target2, key);
|
|
50
71
|
if (descriptor) return descriptor;
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
if (!ref.value) continue;
|
|
54
|
-
const descriptor2 = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
|
|
55
|
-
if (descriptor2) return descriptor2;
|
|
56
|
-
}
|
|
57
|
-
for (const ref of refs) {
|
|
58
|
-
const childRefs = ref.value && ref.value[_forwardRefs.FORWARD_REFS];
|
|
59
|
-
if (!childRefs) continue;
|
|
60
|
-
const queue = childRefs.slice();
|
|
61
|
-
while (queue.length) {
|
|
62
|
-
const ref2 = queue.shift();
|
|
63
|
-
const descriptor2 = getDescriptor(ref2.value, key);
|
|
64
|
-
if (descriptor2) return descriptor2;
|
|
65
|
-
const childRefs2 = ref2.value?.[_forwardRefs.FORWARD_REFS];
|
|
66
|
-
if (childRefs2) queue.push(...childRefs2);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return void 0;
|
|
72
|
+
if (isInternalKey(key)) return;
|
|
73
|
+
return findDescriptorInRefs(refs, key) ?? findDescriptorInForwardedRefs(refs, key);
|
|
70
74
|
}
|
|
71
75
|
});
|
|
72
76
|
}
|
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
import { FORWARD_REFS } from "../../consts/Commons/forwardRefs.const.js";
|
|
2
|
+
function isInternalKey(key) {
|
|
3
|
+
return typeof key === "symbol" || key.startsWith("$") || key.startsWith("__");
|
|
4
|
+
}
|
|
5
|
+
function findRefValueWith(refs, key) {
|
|
6
|
+
for (const ref of refs) {
|
|
7
|
+
if (ref.value && Reflect.has(ref.value, key)) return ref.value;
|
|
8
|
+
}
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
function findDescriptorInRefs(refs, key) {
|
|
12
|
+
for (const ref of refs) {
|
|
13
|
+
if (!ref.value) continue;
|
|
14
|
+
const descriptor = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
|
|
15
|
+
if (descriptor) return descriptor;
|
|
16
|
+
}
|
|
17
|
+
return void 0;
|
|
18
|
+
}
|
|
19
|
+
function findDescriptorInForwardedRefs(refs, key) {
|
|
20
|
+
for (const ref of refs) {
|
|
21
|
+
const childRefs = ref.value && ref.value[FORWARD_REFS];
|
|
22
|
+
if (!childRefs) continue;
|
|
23
|
+
const queue = childRefs.slice();
|
|
24
|
+
while (queue.length) {
|
|
25
|
+
const ref2 = queue.shift();
|
|
26
|
+
const descriptor = getDescriptor(ref2.value, key);
|
|
27
|
+
if (descriptor) return descriptor;
|
|
28
|
+
const childRefs2 = ref2.value?.[FORWARD_REFS];
|
|
29
|
+
if (childRefs2) queue.push(...childRefs2);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return void 0;
|
|
33
|
+
}
|
|
2
34
|
export function forwardRefs(target, ...refs) {
|
|
3
35
|
target[FORWARD_REFS] = refs;
|
|
4
36
|
return new Proxy(target, {
|
|
@@ -6,60 +38,32 @@ export function forwardRefs(target, ...refs) {
|
|
|
6
38
|
if (Reflect.has(target2, key)) {
|
|
7
39
|
return Reflect.get(target2, key);
|
|
8
40
|
}
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
41
|
+
if (isInternalKey(key)) return;
|
|
42
|
+
const owner = findRefValueWith(refs, key);
|
|
43
|
+
if (!owner) return;
|
|
44
|
+
const val = Reflect.get(owner, key);
|
|
45
|
+
return typeof val === "function" ? val.bind(owner) : val;
|
|
16
46
|
},
|
|
17
47
|
has(target2, key) {
|
|
18
48
|
if (Reflect.has(target2, key)) {
|
|
19
49
|
return true;
|
|
20
50
|
}
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
if (ref.value && Reflect.has(ref.value, key)) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
51
|
+
if (isInternalKey(key)) return false;
|
|
52
|
+
return findRefValueWith(refs, key) !== void 0;
|
|
28
53
|
},
|
|
29
54
|
set(target2, key, value) {
|
|
30
55
|
if (Reflect.has(target2, key)) {
|
|
31
56
|
return Reflect.set(target2, key, value);
|
|
32
57
|
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return Reflect.set(ref.value, key, value);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
58
|
+
if (isInternalKey(key)) return false;
|
|
59
|
+
const owner = findRefValueWith(refs, key);
|
|
60
|
+
return owner ? Reflect.set(owner, key, value) : false;
|
|
40
61
|
},
|
|
41
62
|
getOwnPropertyDescriptor(target2, key) {
|
|
42
63
|
const descriptor = Reflect.getOwnPropertyDescriptor(target2, key);
|
|
43
64
|
if (descriptor) return descriptor;
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
if (!ref.value) continue;
|
|
47
|
-
const descriptor2 = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor(ref.value._?.setupState, key) : void 0);
|
|
48
|
-
if (descriptor2) return descriptor2;
|
|
49
|
-
}
|
|
50
|
-
for (const ref of refs) {
|
|
51
|
-
const childRefs = ref.value && ref.value[FORWARD_REFS];
|
|
52
|
-
if (!childRefs) continue;
|
|
53
|
-
const queue = childRefs.slice();
|
|
54
|
-
while (queue.length) {
|
|
55
|
-
const ref2 = queue.shift();
|
|
56
|
-
const descriptor2 = getDescriptor(ref2.value, key);
|
|
57
|
-
if (descriptor2) return descriptor2;
|
|
58
|
-
const childRefs2 = ref2.value?.[FORWARD_REFS];
|
|
59
|
-
if (childRefs2) queue.push(...childRefs2);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return void 0;
|
|
65
|
+
if (isInternalKey(key)) return;
|
|
66
|
+
return findDescriptorInRefs(refs, key) ?? findDescriptorInForwardedRefs(refs, key);
|
|
63
67
|
}
|
|
64
68
|
});
|
|
65
69
|
}
|
|
@@ -31,7 +31,7 @@ function getValues(items, ids) {
|
|
|
31
31
|
const itemIndex = items.findIndex(item => item.id === id);
|
|
32
32
|
if (~itemIndex) {
|
|
33
33
|
const item = items[itemIndex];
|
|
34
|
-
values.push(item.value
|
|
34
|
+
values.push(item.value ?? itemIndex);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
return values;
|
|
@@ -23,7 +23,7 @@ export function getValues(items, ids) {
|
|
|
23
23
|
const itemIndex = items.findIndex((item) => item.id === id);
|
|
24
24
|
if (~itemIndex) {
|
|
25
25
|
const item = items[itemIndex];
|
|
26
|
-
values.push(item.value
|
|
26
|
+
values.push(item.value ?? itemIndex);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
return values;
|