origam 2.41.0 → 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 +49 -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/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/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 +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 +4 -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 +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/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 +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.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/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,6 +8,40 @@ exports.useHeaders = useHeaders;
|
|
|
8
8
|
var _vue = require("vue");
|
|
9
9
|
var _dataTable = require("../../consts/DataTable/data-table.const.cjs");
|
|
10
10
|
var _headers2 = require("../../utils/DataTable/headers.util.cjs");
|
|
11
|
+
function addSyntheticColumns(items, keys, options) {
|
|
12
|
+
if (options?.groupBy?.value?.length && !keys.has("data-table-group")) {
|
|
13
|
+
items.unshift({
|
|
14
|
+
key: "data-table-group",
|
|
15
|
+
title: "Group"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (options?.showSelect?.value && !keys.has("data-table-select")) {
|
|
19
|
+
items.unshift({
|
|
20
|
+
key: "data-table-select"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (options?.showExpand?.value && !keys.has("data-table-expand")) {
|
|
24
|
+
items.push({
|
|
25
|
+
key: "data-table-expand"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function registerHeaderFunctions(flatHeaders, sortFunctions, sortRawFunctions, filterFunctions) {
|
|
30
|
+
for (const header of flatHeaders) {
|
|
31
|
+
if (!header.key) continue;
|
|
32
|
+
if (header.sortable) {
|
|
33
|
+
if (header.sort) {
|
|
34
|
+
sortFunctions[header.key] = header.sort;
|
|
35
|
+
}
|
|
36
|
+
if (header.sortRaw) {
|
|
37
|
+
sortRawFunctions[header.key] = header.sortRaw;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (header.filter) {
|
|
41
|
+
filterFunctions[header.key] = header.filter;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
11
45
|
function createHeaders(props, options) {
|
|
12
46
|
const headers = (0, _vue.ref)([]);
|
|
13
47
|
const columns = (0, _vue.ref)([]);
|
|
@@ -21,22 +55,7 @@ function createHeaders(props, options) {
|
|
|
21
55
|
}));
|
|
22
56
|
const items = _headers.slice();
|
|
23
57
|
const keys = (0, _headers2.extractKeys)(items);
|
|
24
|
-
|
|
25
|
-
items.unshift({
|
|
26
|
-
key: "data-table-group",
|
|
27
|
-
title: "Group"
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (options?.showSelect?.value && !keys.has("data-table-select")) {
|
|
31
|
-
items.unshift({
|
|
32
|
-
key: "data-table-select"
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (options?.showExpand?.value && !keys.has("data-table-expand")) {
|
|
36
|
-
items.push({
|
|
37
|
-
key: "data-table-expand"
|
|
38
|
-
});
|
|
39
|
-
}
|
|
58
|
+
addSyntheticColumns(items, keys, options);
|
|
40
59
|
const internalHeaders = (0, _headers2.convertToInternalHeaders)(items);
|
|
41
60
|
(0, _headers2.parseFixedColumns)(internalHeaders);
|
|
42
61
|
const maxDepth = Math.max(...internalHeaders.map(item => (0, _headers2.getHeaderDepth)(item))) + 1;
|
|
@@ -44,20 +63,7 @@ function createHeaders(props, options) {
|
|
|
44
63
|
headers.value = parsed.headers;
|
|
45
64
|
columns.value = parsed.columns;
|
|
46
65
|
const flatHeaders = parsed.headers.flat(1);
|
|
47
|
-
|
|
48
|
-
if (!header.key) continue;
|
|
49
|
-
if (header.sortable) {
|
|
50
|
-
if (header.sort) {
|
|
51
|
-
sortFunctions.value[header.key] = header.sort;
|
|
52
|
-
}
|
|
53
|
-
if (header.sortRaw) {
|
|
54
|
-
sortRawFunctions.value[header.key] = header.sortRaw;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (header.filter) {
|
|
58
|
-
filterFunctions.value[header.key] = header.filter;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
66
|
+
registerHeaderFunctions(flatHeaders, sortFunctions.value, sortRawFunctions.value, filterFunctions.value);
|
|
61
67
|
});
|
|
62
68
|
const data = {
|
|
63
69
|
headers,
|
|
@@ -16,7 +16,7 @@ import type { TDataTableCompareFunction } from '../../types/DataTable/data-table
|
|
|
16
16
|
* instead, not on this injection.
|
|
17
17
|
********************************************************/
|
|
18
18
|
export declare function createHeaders(props: IDataTableHeaderProps, options?: {
|
|
19
|
-
groupBy?: Ref<Array<IDataTableSortItem
|
|
19
|
+
groupBy?: Ref<Array<IDataTableSortItem>>;
|
|
20
20
|
showSelect?: Ref<boolean>;
|
|
21
21
|
showExpand?: Ref<boolean>;
|
|
22
22
|
}): {
|
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import { capitalize, inject, provide, ref, watchEffect } from "vue";
|
|
2
2
|
import { ORIGAM_DATA_TABLE_HEADERS_KEY } from "../../consts/DataTable/data-table.const.js";
|
|
3
3
|
import { convertToInternalHeaders, extractKeys, getHeaderDepth, parseFixedColumns, parseHeaderItems } from "../../utils/DataTable/headers.util.js";
|
|
4
|
+
function addSyntheticColumns(items, keys, options) {
|
|
5
|
+
if (options?.groupBy?.value?.length && !keys.has("data-table-group")) {
|
|
6
|
+
items.unshift({ key: "data-table-group", title: "Group" });
|
|
7
|
+
}
|
|
8
|
+
if (options?.showSelect?.value && !keys.has("data-table-select")) {
|
|
9
|
+
items.unshift({ key: "data-table-select" });
|
|
10
|
+
}
|
|
11
|
+
if (options?.showExpand?.value && !keys.has("data-table-expand")) {
|
|
12
|
+
items.push({ key: "data-table-expand" });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function registerHeaderFunctions(flatHeaders, sortFunctions, sortRawFunctions, filterFunctions) {
|
|
16
|
+
for (const header of flatHeaders) {
|
|
17
|
+
if (!header.key) continue;
|
|
18
|
+
if (header.sortable) {
|
|
19
|
+
if (header.sort) {
|
|
20
|
+
sortFunctions[header.key] = header.sort;
|
|
21
|
+
}
|
|
22
|
+
if (header.sortRaw) {
|
|
23
|
+
sortRawFunctions[header.key] = header.sortRaw;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (header.filter) {
|
|
27
|
+
filterFunctions[header.key] = header.filter;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
4
31
|
export function createHeaders(props, options) {
|
|
5
32
|
const headers = ref([]);
|
|
6
33
|
const columns = ref([]);
|
|
@@ -11,15 +38,7 @@ export function createHeaders(props, options) {
|
|
|
11
38
|
const _headers = props.headers || Object.keys(props.items[0] ?? {}).map((key) => ({ key, title: capitalize(key) }));
|
|
12
39
|
const items = _headers.slice();
|
|
13
40
|
const keys = extractKeys(items);
|
|
14
|
-
|
|
15
|
-
items.unshift({ key: "data-table-group", title: "Group" });
|
|
16
|
-
}
|
|
17
|
-
if (options?.showSelect?.value && !keys.has("data-table-select")) {
|
|
18
|
-
items.unshift({ key: "data-table-select" });
|
|
19
|
-
}
|
|
20
|
-
if (options?.showExpand?.value && !keys.has("data-table-expand")) {
|
|
21
|
-
items.push({ key: "data-table-expand" });
|
|
22
|
-
}
|
|
41
|
+
addSyntheticColumns(items, keys, options);
|
|
23
42
|
const internalHeaders = convertToInternalHeaders(items);
|
|
24
43
|
parseFixedColumns(internalHeaders);
|
|
25
44
|
const maxDepth = Math.max(...internalHeaders.map((item) => getHeaderDepth(item))) + 1;
|
|
@@ -27,20 +46,7 @@ export function createHeaders(props, options) {
|
|
|
27
46
|
headers.value = parsed.headers;
|
|
28
47
|
columns.value = parsed.columns;
|
|
29
48
|
const flatHeaders = parsed.headers.flat(1);
|
|
30
|
-
|
|
31
|
-
if (!header.key) continue;
|
|
32
|
-
if (header.sortable) {
|
|
33
|
-
if (header.sort) {
|
|
34
|
-
sortFunctions.value[header.key] = header.sort;
|
|
35
|
-
}
|
|
36
|
-
if (header.sortRaw) {
|
|
37
|
-
sortRawFunctions.value[header.key] = header.sortRaw;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (header.filter) {
|
|
41
|
-
filterFunctions.value[header.key] = header.filter;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
49
|
+
registerHeaderFunctions(flatHeaders, sortFunctions.value, sortRawFunctions.value, filterFunctions.value);
|
|
44
50
|
});
|
|
45
51
|
const data = { headers, columns, sortFunctions, sortRawFunctions, filterFunctions };
|
|
46
52
|
provide(ORIGAM_DATA_TABLE_HEADERS_KEY, data);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useHeadersCell = useHeadersCell;
|
|
7
7
|
var _sort = require("./sort.composable.cjs");
|
|
8
|
-
var
|
|
8
|
+
var _sort2 = require("../../enums/Commons/sort.enum.cjs");
|
|
9
9
|
function useHeadersCell(props) {
|
|
10
10
|
const {
|
|
11
11
|
sortBy
|
|
@@ -15,7 +15,7 @@ function useHeadersCell(props) {
|
|
|
15
15
|
return sortByItem.key === column.key;
|
|
16
16
|
});
|
|
17
17
|
if (!item) return props.sortAscIcon;
|
|
18
|
-
return item.order ===
|
|
18
|
+
return item.order === _sort2.SORT_DIRECTION.ASC ? props.sortAscIcon : props.sortDescIcon;
|
|
19
19
|
};
|
|
20
20
|
return {
|
|
21
21
|
getSortIcon
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSort } from "./sort.composable.js";
|
|
2
|
-
import { SORT_DIRECTION } from "../../enums/
|
|
2
|
+
import { SORT_DIRECTION } from "../../enums/Commons/sort.enum.js";
|
|
3
3
|
export function useHeadersCell(props) {
|
|
4
4
|
const { sortBy } = useSort();
|
|
5
5
|
const getSortIcon = (column) => {
|
|
@@ -7,7 +7,7 @@ exports.provideSelection = provideSelection;
|
|
|
7
7
|
exports.useSelection = useSelection;
|
|
8
8
|
var _vModel = require("../Commons/vModel.composable.cjs");
|
|
9
9
|
var _dataTable = require("../../consts/DataTable/data-table.const.cjs");
|
|
10
|
-
var
|
|
10
|
+
var _dataTable2 = require("../../enums/DataTable/data-table.enum.cjs");
|
|
11
11
|
var _commons = require("../../utils/Commons/commons.util.cjs");
|
|
12
12
|
var _vue = require("vue");
|
|
13
13
|
function provideSelection(props, {
|
|
@@ -22,11 +22,11 @@ function provideSelection(props, {
|
|
|
22
22
|
const selectStrategy = (0, _vue.computed)(() => {
|
|
23
23
|
if (typeof props.selectStrategy === "object") return props.selectStrategy;
|
|
24
24
|
switch (props.selectStrategy) {
|
|
25
|
-
case
|
|
25
|
+
case _dataTable2.DATATABLE_SELECT_STRATEGY.SINGLE:
|
|
26
26
|
return _dataTable.singleSelectStrategy;
|
|
27
|
-
case
|
|
27
|
+
case _dataTable2.DATATABLE_SELECT_STRATEGY.ALL:
|
|
28
28
|
return _dataTable.allSelectStrategy;
|
|
29
|
-
case
|
|
29
|
+
case _dataTable2.DATATABLE_SELECT_STRATEGY.PAGE:
|
|
30
30
|
default:
|
|
31
31
|
return _dataTable.pageSelectStrategy;
|
|
32
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useVModel } from "../Commons/vModel.composable.js";
|
|
2
2
|
import { allSelectStrategy, ORIGAM_DATA_TABLE_SELECT_KEY, pageSelectStrategy, singleSelectStrategy } from "../../consts/DataTable/data-table.const.js";
|
|
3
|
-
import { DATATABLE_SELECT_STRATEGY } from "../../enums/
|
|
3
|
+
import { DATATABLE_SELECT_STRATEGY } from "../../enums/DataTable/data-table.enum.js";
|
|
4
4
|
import { deepEqual, wrapInArray } from "../../utils/Commons/commons.util.js";
|
|
5
5
|
import { computed, inject, provide } from "vue";
|
|
6
6
|
export function provideSelection(props, { allItems, currentPage }) {
|
|
@@ -9,7 +9,7 @@ exports.useSort = useSort;
|
|
|
9
9
|
var _vue = require("vue");
|
|
10
10
|
var _vModel = require("../Commons/vModel.composable.cjs");
|
|
11
11
|
var _dataTable = require("../../consts/DataTable/data-table.const.cjs");
|
|
12
|
-
var
|
|
12
|
+
var _sort = require("../../enums/Commons/sort.enum.cjs");
|
|
13
13
|
function createSort(props) {
|
|
14
14
|
const sortBy = (0, _vModel.useVModel)(props, "sortBy", []);
|
|
15
15
|
const mustSort = (0, _vue.toRef)(props, "mustSort");
|
|
@@ -36,19 +36,19 @@ function provideSort(options) {
|
|
|
36
36
|
if (!item) {
|
|
37
37
|
if (multiSort.value) newSortBy = [...newSortBy, {
|
|
38
38
|
key: column.key,
|
|
39
|
-
order:
|
|
39
|
+
order: _sort.SORT_DIRECTION.ASC
|
|
40
40
|
}];else newSortBy = [{
|
|
41
41
|
key: column.key,
|
|
42
|
-
order:
|
|
42
|
+
order: _sort.SORT_DIRECTION.ASC
|
|
43
43
|
}];
|
|
44
|
-
} else if (item.order ===
|
|
44
|
+
} else if (item.order === _sort.SORT_DIRECTION.DESC) {
|
|
45
45
|
if (mustSort.value) {
|
|
46
|
-
item.order =
|
|
46
|
+
item.order = _sort.SORT_DIRECTION.ASC;
|
|
47
47
|
} else {
|
|
48
48
|
newSortBy = newSortBy.filter(x => x.key !== column.key);
|
|
49
49
|
}
|
|
50
50
|
} else {
|
|
51
|
-
item.order =
|
|
51
|
+
item.order = _sort.SORT_DIRECTION.DESC;
|
|
52
52
|
}
|
|
53
53
|
sortBy.value = newSortBy;
|
|
54
54
|
if (page) page.value = 1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inject, provide, toRef } from "vue";
|
|
2
2
|
import { useVModel } from "../Commons/vModel.composable.js";
|
|
3
3
|
import { ORIGAM_DATA_TABLE_SORT_KEY } from "../../consts/DataTable/data-table.const.js";
|
|
4
|
-
import { SORT_DIRECTION } from "../../enums/
|
|
4
|
+
import { SORT_DIRECTION } from "../../enums/Commons/sort.enum.js";
|
|
5
5
|
export function createSort(props) {
|
|
6
6
|
const sortBy = useVModel(props, "sortBy", []);
|
|
7
7
|
const mustSort = toRef(props, "mustSort");
|
|
@@ -62,7 +62,7 @@ function useForm(props) {
|
|
|
62
62
|
} else if (item.isValid === true) valid++;
|
|
63
63
|
}
|
|
64
64
|
errors.value = results;
|
|
65
|
-
|
|
65
|
+
if (invalid > 0) model.value = false;else if (valid === items.value.length) model.value = true;else model.value = null;
|
|
66
66
|
}, {
|
|
67
67
|
deep: true,
|
|
68
68
|
flush: "post"
|
|
@@ -53,7 +53,9 @@ export function useForm(props) {
|
|
|
53
53
|
} else if (item.isValid === true) valid++;
|
|
54
54
|
}
|
|
55
55
|
errors.value = results;
|
|
56
|
-
|
|
56
|
+
if (invalid > 0) model.value = false;
|
|
57
|
+
else if (valid === items.value.length) model.value = true;
|
|
58
|
+
else model.value = null;
|
|
57
59
|
}, { deep: true, flush: "post" });
|
|
58
60
|
provide(ORIGAM_FORM_KEY, {
|
|
59
61
|
register: ({ id, vm, validate: validate2, reset: reset2, resetValidation: resetValidation2 }) => {
|
|
@@ -16,6 +16,29 @@ function pickColumnsForWidth(width, breakpoints, defaultColumns) {
|
|
|
16
16
|
}
|
|
17
17
|
return resolved;
|
|
18
18
|
}
|
|
19
|
+
function shortestColumn(columnHeights) {
|
|
20
|
+
let col = 0;
|
|
21
|
+
let min = columnHeights[0];
|
|
22
|
+
for (let c = 1; c < columnHeights.length; c++) {
|
|
23
|
+
if (columnHeights[c] < min) {
|
|
24
|
+
min = columnHeights[c];
|
|
25
|
+
col = c;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return col;
|
|
29
|
+
}
|
|
30
|
+
function columnContentHeight(columnHeight, gap) {
|
|
31
|
+
return columnHeight > 0 ? columnHeight - gap : 0;
|
|
32
|
+
}
|
|
33
|
+
function centerColumns(items, columnHeights, gap, maxHeight) {
|
|
34
|
+
const columnUsed = new Array(columnHeights.length).fill(0);
|
|
35
|
+
for (const item of items) {
|
|
36
|
+
const colHeight = columnContentHeight(columnHeights[item.column], gap);
|
|
37
|
+
const shift = Math.max(0, (maxHeight - colHeight) / 2);
|
|
38
|
+
if (columnUsed[item.column] === 0) columnUsed[item.column] = shift;
|
|
39
|
+
item.top += columnUsed[item.column];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
19
42
|
function bucketFill(heights, containerWidth, gap, columns, align = "top") {
|
|
20
43
|
const cols = Math.max(1, Math.floor(columns));
|
|
21
44
|
const totalGap = (cols - 1) * gap;
|
|
@@ -23,14 +46,7 @@ function bucketFill(heights, containerWidth, gap, columns, align = "top") {
|
|
|
23
46
|
const columnHeights = new Array(cols).fill(0);
|
|
24
47
|
const items = [];
|
|
25
48
|
for (let i = 0; i < heights.length; i++) {
|
|
26
|
-
|
|
27
|
-
let min = columnHeights[0];
|
|
28
|
-
for (let c = 1; c < cols; c++) {
|
|
29
|
-
if (columnHeights[c] < min) {
|
|
30
|
-
min = columnHeights[c];
|
|
31
|
-
col = c;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
49
|
+
const col = shortestColumn(columnHeights);
|
|
34
50
|
const left = col * (itemWidth + gap);
|
|
35
51
|
const top = columnHeights[col];
|
|
36
52
|
const height = Math.max(0, heights[i]);
|
|
@@ -44,19 +60,12 @@ function bucketFill(heights, containerWidth, gap, columns, align = "top") {
|
|
|
44
60
|
});
|
|
45
61
|
columnHeights[col] = top + height + gap;
|
|
46
62
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
63
|
+
const maxHeight = columnHeights.reduce((max, h) => {
|
|
64
|
+
const content = columnContentHeight(h, gap);
|
|
65
|
+
return content > max ? content : max;
|
|
66
|
+
}, 0);
|
|
52
67
|
if (align === "center" && maxHeight > 0) {
|
|
53
|
-
|
|
54
|
-
for (const item of items) {
|
|
55
|
-
const colHeight = columnHeights[item.column] > 0 ? columnHeights[item.column] - gap : 0;
|
|
56
|
-
const shift = Math.max(0, (maxHeight - colHeight) / 2);
|
|
57
|
-
if (columnUsed[item.column] === 0) columnUsed[item.column] = shift;
|
|
58
|
-
item.top += columnUsed[item.column];
|
|
59
|
-
}
|
|
68
|
+
centerColumns(items, columnHeights, gap, maxHeight);
|
|
60
69
|
}
|
|
61
70
|
return {
|
|
62
71
|
containerHeight: maxHeight,
|
|
@@ -15,20 +15,6 @@ export type { IMasonryItemRect, IMasonryLayoutResult, IUseMasonryOptions } from
|
|
|
15
15
|
* pickColumnsForWidth(400, { 600: 2, 900: 3, 1200: 4 }, 1) → 1
|
|
16
16
|
*/
|
|
17
17
|
export declare function pickColumnsForWidth(width: number, breakpoints: TMasonryColumnBreakpoints | undefined, defaultColumns: number): number;
|
|
18
|
-
/**
|
|
19
|
-
* Pure bucket-fill algorithm. Given an ordered list of item heights, a
|
|
20
|
-
* container width, a gap in px, and a column count, returns the layout
|
|
21
|
-
* coordinates of every item and the final container height.
|
|
22
|
-
*
|
|
23
|
-
* Algorithm:
|
|
24
|
-
* 1. Compute item width = (containerWidth - (cols - 1) * gap) / cols.
|
|
25
|
-
* 2. Track `columnHeights[i]` — running sum of item heights + gaps.
|
|
26
|
-
* 3. For each item, place it in the column with the SMALLEST current
|
|
27
|
-
* height (ties → leftmost column). Update that column's height.
|
|
28
|
-
* 4. `containerHeight` = max(columnHeights).
|
|
29
|
-
*
|
|
30
|
-
* No DOM access. Fully deterministic. Easy to unit-test.
|
|
31
|
-
*/
|
|
32
18
|
export declare function bucketFill(heights: ReadonlyArray<number>, containerWidth: number, gap: number, columns: number, align?: TMasonryAlign): IMasonryLayoutResult;
|
|
33
19
|
/**
|
|
34
20
|
* Public composable used by `<OrigamMasonry>` when the CSS-native
|
|
@@ -8,6 +8,29 @@ export function pickColumnsForWidth(width, breakpoints, defaultColumns) {
|
|
|
8
8
|
}
|
|
9
9
|
return resolved;
|
|
10
10
|
}
|
|
11
|
+
function shortestColumn(columnHeights) {
|
|
12
|
+
let col = 0;
|
|
13
|
+
let min = columnHeights[0];
|
|
14
|
+
for (let c = 1; c < columnHeights.length; c++) {
|
|
15
|
+
if (columnHeights[c] < min) {
|
|
16
|
+
min = columnHeights[c];
|
|
17
|
+
col = c;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return col;
|
|
21
|
+
}
|
|
22
|
+
function columnContentHeight(columnHeight, gap) {
|
|
23
|
+
return columnHeight > 0 ? columnHeight - gap : 0;
|
|
24
|
+
}
|
|
25
|
+
function centerColumns(items, columnHeights, gap, maxHeight) {
|
|
26
|
+
const columnUsed = new Array(columnHeights.length).fill(0);
|
|
27
|
+
for (const item of items) {
|
|
28
|
+
const colHeight = columnContentHeight(columnHeights[item.column], gap);
|
|
29
|
+
const shift = Math.max(0, (maxHeight - colHeight) / 2);
|
|
30
|
+
if (columnUsed[item.column] === 0) columnUsed[item.column] = shift;
|
|
31
|
+
item.top += columnUsed[item.column];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
export function bucketFill(heights, containerWidth, gap, columns, align = "top") {
|
|
12
35
|
const cols = Math.max(1, Math.floor(columns));
|
|
13
36
|
const totalGap = (cols - 1) * gap;
|
|
@@ -15,14 +38,7 @@ export function bucketFill(heights, containerWidth, gap, columns, align = "top")
|
|
|
15
38
|
const columnHeights = new Array(cols).fill(0);
|
|
16
39
|
const items = [];
|
|
17
40
|
for (let i = 0; i < heights.length; i++) {
|
|
18
|
-
|
|
19
|
-
let min = columnHeights[0];
|
|
20
|
-
for (let c = 1; c < cols; c++) {
|
|
21
|
-
if (columnHeights[c] < min) {
|
|
22
|
-
min = columnHeights[c];
|
|
23
|
-
col = c;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
41
|
+
const col = shortestColumn(columnHeights);
|
|
26
42
|
const left = col * (itemWidth + gap);
|
|
27
43
|
const top = columnHeights[col];
|
|
28
44
|
const height = Math.max(0, heights[i]);
|
|
@@ -36,19 +52,12 @@ export function bucketFill(heights, containerWidth, gap, columns, align = "top")
|
|
|
36
52
|
});
|
|
37
53
|
columnHeights[col] = top + height + gap;
|
|
38
54
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
55
|
+
const maxHeight = columnHeights.reduce((max, h) => {
|
|
56
|
+
const content = columnContentHeight(h, gap);
|
|
57
|
+
return content > max ? content : max;
|
|
58
|
+
}, 0);
|
|
44
59
|
if (align === "center" && maxHeight > 0) {
|
|
45
|
-
|
|
46
|
-
for (const item of items) {
|
|
47
|
-
const colHeight = columnHeights[item.column] > 0 ? columnHeights[item.column] - gap : 0;
|
|
48
|
-
const shift = Math.max(0, (maxHeight - colHeight) / 2);
|
|
49
|
-
if (columnUsed[item.column] === 0) columnUsed[item.column] = shift;
|
|
50
|
-
item.top += columnUsed[item.column];
|
|
51
|
-
}
|
|
60
|
+
centerColumns(items, columnHeights, gap, maxHeight);
|
|
52
61
|
}
|
|
53
62
|
return {
|
|
54
63
|
containerHeight: maxHeight,
|
|
@@ -69,32 +69,12 @@ function buildIntlOptions(options) {
|
|
|
69
69
|
if (options.notation !== void 0) {
|
|
70
70
|
intl.notation = options.notation;
|
|
71
71
|
}
|
|
72
|
-
if (intl.style === "currency")
|
|
73
|
-
|
|
74
|
-
if (options.currencyDisplay !== void 0) {
|
|
75
|
-
intl.currencyDisplay = options.currencyDisplay;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (intl.style === "unit") {
|
|
79
|
-
if (options.unit) {
|
|
80
|
-
intl.unit = options.unit;
|
|
81
|
-
if (options.unitDisplay !== void 0) {
|
|
82
|
-
intl.unitDisplay = options.unitDisplay;
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
if (typeof console !== "undefined") {
|
|
86
|
-
console.warn('[origam] useNumberFormat: format="unit" requires a `unit` option (e.g. "kilometer-per-hour"). Falling back to decimal.');
|
|
87
|
-
}
|
|
88
|
-
intl.style = "decimal";
|
|
89
|
-
}
|
|
90
|
-
}
|
|
72
|
+
if (intl.style === "currency") applyCurrency(intl, options);
|
|
73
|
+
if (intl.style === "unit") applyUnit(intl, options);
|
|
91
74
|
if (intl.notation === "compact" && options.compactDisplay !== void 0) {
|
|
92
75
|
intl.compactDisplay = options.compactDisplay;
|
|
93
76
|
}
|
|
94
|
-
|
|
95
|
-
if (options.maximumFractionDigits !== void 0) intl.maximumFractionDigits = options.maximumFractionDigits;
|
|
96
|
-
if (options.minimumSignificantDigits !== void 0) intl.minimumSignificantDigits = options.minimumSignificantDigits;
|
|
97
|
-
if (options.maximumSignificantDigits !== void 0) intl.maximumSignificantDigits = options.maximumSignificantDigits;
|
|
77
|
+
applyDigits(intl, options);
|
|
98
78
|
const grouping = resolveUseGrouping(options.useGrouping);
|
|
99
79
|
if (grouping !== void 0) {
|
|
100
80
|
intl.useGrouping = grouping;
|
|
@@ -104,6 +84,31 @@ function buildIntlOptions(options) {
|
|
|
104
84
|
}
|
|
105
85
|
return intl;
|
|
106
86
|
}
|
|
87
|
+
function applyCurrency(intl, options) {
|
|
88
|
+
intl.currency = options.currency || _numberFormat.NUMBER_FORMAT_DEFAULT_CURRENCY;
|
|
89
|
+
if (options.currencyDisplay !== void 0) {
|
|
90
|
+
intl.currencyDisplay = options.currencyDisplay;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function applyUnit(intl, options) {
|
|
94
|
+
if (options.unit) {
|
|
95
|
+
intl.unit = options.unit;
|
|
96
|
+
if (options.unitDisplay !== void 0) {
|
|
97
|
+
intl.unitDisplay = options.unitDisplay;
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (typeof console !== "undefined") {
|
|
102
|
+
console.warn('[origam] useNumberFormat: format="unit" requires a `unit` option (e.g. "kilometer-per-hour"). Falling back to decimal.');
|
|
103
|
+
}
|
|
104
|
+
intl.style = "decimal";
|
|
105
|
+
}
|
|
106
|
+
function applyDigits(intl, options) {
|
|
107
|
+
if (options.minimumFractionDigits !== void 0) intl.minimumFractionDigits = options.minimumFractionDigits;
|
|
108
|
+
if (options.maximumFractionDigits !== void 0) intl.maximumFractionDigits = options.maximumFractionDigits;
|
|
109
|
+
if (options.minimumSignificantDigits !== void 0) intl.minimumSignificantDigits = options.minimumSignificantDigits;
|
|
110
|
+
if (options.maximumSignificantDigits !== void 0) intl.maximumSignificantDigits = options.maximumSignificantDigits;
|
|
111
|
+
}
|
|
107
112
|
function getIntl(locale, options) {
|
|
108
113
|
const cacheKey = JSON.stringify({
|
|
109
114
|
l: locale,
|
|
@@ -53,32 +53,12 @@ function buildIntlOptions(options) {
|
|
|
53
53
|
if (options.notation !== void 0) {
|
|
54
54
|
intl.notation = options.notation;
|
|
55
55
|
}
|
|
56
|
-
if (intl.style === "currency")
|
|
57
|
-
|
|
58
|
-
if (options.currencyDisplay !== void 0) {
|
|
59
|
-
intl.currencyDisplay = options.currencyDisplay;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (intl.style === "unit") {
|
|
63
|
-
if (options.unit) {
|
|
64
|
-
intl.unit = options.unit;
|
|
65
|
-
if (options.unitDisplay !== void 0) {
|
|
66
|
-
intl.unitDisplay = options.unitDisplay;
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
if (typeof console !== "undefined") {
|
|
70
|
-
console.warn('[origam] useNumberFormat: format="unit" requires a `unit` option (e.g. "kilometer-per-hour"). Falling back to decimal.');
|
|
71
|
-
}
|
|
72
|
-
intl.style = "decimal";
|
|
73
|
-
}
|
|
74
|
-
}
|
|
56
|
+
if (intl.style === "currency") applyCurrency(intl, options);
|
|
57
|
+
if (intl.style === "unit") applyUnit(intl, options);
|
|
75
58
|
if (intl.notation === "compact" && options.compactDisplay !== void 0) {
|
|
76
59
|
intl.compactDisplay = options.compactDisplay;
|
|
77
60
|
}
|
|
78
|
-
|
|
79
|
-
if (options.maximumFractionDigits !== void 0) intl.maximumFractionDigits = options.maximumFractionDigits;
|
|
80
|
-
if (options.minimumSignificantDigits !== void 0) intl.minimumSignificantDigits = options.minimumSignificantDigits;
|
|
81
|
-
if (options.maximumSignificantDigits !== void 0) intl.maximumSignificantDigits = options.maximumSignificantDigits;
|
|
61
|
+
applyDigits(intl, options);
|
|
82
62
|
const grouping = resolveUseGrouping(options.useGrouping);
|
|
83
63
|
if (grouping !== void 0) {
|
|
84
64
|
intl.useGrouping = grouping;
|
|
@@ -88,6 +68,31 @@ function buildIntlOptions(options) {
|
|
|
88
68
|
}
|
|
89
69
|
return intl;
|
|
90
70
|
}
|
|
71
|
+
function applyCurrency(intl, options) {
|
|
72
|
+
intl.currency = options.currency || NUMBER_FORMAT_DEFAULT_CURRENCY;
|
|
73
|
+
if (options.currencyDisplay !== void 0) {
|
|
74
|
+
intl.currencyDisplay = options.currencyDisplay;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function applyUnit(intl, options) {
|
|
78
|
+
if (options.unit) {
|
|
79
|
+
intl.unit = options.unit;
|
|
80
|
+
if (options.unitDisplay !== void 0) {
|
|
81
|
+
intl.unitDisplay = options.unitDisplay;
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (typeof console !== "undefined") {
|
|
86
|
+
console.warn('[origam] useNumberFormat: format="unit" requires a `unit` option (e.g. "kilometer-per-hour"). Falling back to decimal.');
|
|
87
|
+
}
|
|
88
|
+
intl.style = "decimal";
|
|
89
|
+
}
|
|
90
|
+
function applyDigits(intl, options) {
|
|
91
|
+
if (options.minimumFractionDigits !== void 0) intl.minimumFractionDigits = options.minimumFractionDigits;
|
|
92
|
+
if (options.maximumFractionDigits !== void 0) intl.maximumFractionDigits = options.maximumFractionDigits;
|
|
93
|
+
if (options.minimumSignificantDigits !== void 0) intl.minimumSignificantDigits = options.minimumSignificantDigits;
|
|
94
|
+
if (options.maximumSignificantDigits !== void 0) intl.maximumSignificantDigits = options.maximumSignificantDigits;
|
|
95
|
+
}
|
|
91
96
|
function getIntl(locale, options) {
|
|
92
97
|
const cacheKey = JSON.stringify({ l: locale, o: options });
|
|
93
98
|
const hit = intlCache.get(cacheKey);
|
|
@@ -8,7 +8,7 @@ var _vue = require("vue");
|
|
|
8
8
|
var _cssSupport = require("../Commons/cssSupport.composable.cjs");
|
|
9
9
|
var _parallax = require("../../consts/Parallax/parallax.const.cjs");
|
|
10
10
|
var _parallaxLayer = require("../../consts/Parallax/parallax-layer.const.cjs");
|
|
11
|
-
var
|
|
11
|
+
var _parallax2 = require("../../enums/Parallax/parallax.enum.cjs");
|
|
12
12
|
function usePrefersReducedMotion() {
|
|
13
13
|
const flag = (0, _vue.ref)(false);
|
|
14
14
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
@@ -30,14 +30,14 @@ function composeLayerTransform(progress, mouseRatio, direction, layer, hostHeigh
|
|
|
30
30
|
let tx = layer.offsetX;
|
|
31
31
|
let ty = layer.offsetY;
|
|
32
32
|
switch (direction) {
|
|
33
|
-
case
|
|
33
|
+
case _parallax2.PARALLAX_DIRECTION.HORIZONTAL:
|
|
34
34
|
tx += centred * hostWidth * layer.speed;
|
|
35
35
|
break;
|
|
36
|
-
case
|
|
36
|
+
case _parallax2.PARALLAX_DIRECTION.BOTH:
|
|
37
37
|
tx += mouseRatio.x * hostWidth * _parallax.PARALLAX_MOUSE_AMPLITUDE_FACTOR * layer.speed;
|
|
38
38
|
ty += centred * hostHeight * layer.speed;
|
|
39
39
|
break;
|
|
40
|
-
case
|
|
40
|
+
case _parallax2.PARALLAX_DIRECTION.VERTICAL:
|
|
41
41
|
default:
|
|
42
42
|
ty += centred * hostHeight * layer.speed;
|
|
43
43
|
break;
|
|
@@ -48,7 +48,7 @@ function useParallaxRuntime(options) {
|
|
|
48
48
|
const {
|
|
49
49
|
supports
|
|
50
50
|
} = (0, _cssSupport.useCssSupport)();
|
|
51
|
-
const cssScrollDriven = (0, _vue.computed)(() => supports("animation-timeline: scroll()") && options.easing.value ===
|
|
51
|
+
const cssScrollDriven = (0, _vue.computed)(() => supports("animation-timeline: scroll()") && options.easing.value === _parallax2.PARALLAX_EASING.LINEAR);
|
|
52
52
|
const reducedMotion = usePrefersReducedMotion();
|
|
53
53
|
const layers = (0, _vue.ref)([]);
|
|
54
54
|
const progress = (0, _vue.ref)(0);
|
|
@@ -107,7 +107,7 @@ function useParallaxRuntime(options) {
|
|
|
107
107
|
const rect = host.getBoundingClientRect();
|
|
108
108
|
const dir = options.direction.value;
|
|
109
109
|
const easing = options.easing.value;
|
|
110
|
-
const isSpring = easing ===
|
|
110
|
+
const isSpring = easing === _parallax2.PARALLAX_EASING.SPRING;
|
|
111
111
|
for (const layer of layers.value) {
|
|
112
112
|
if (options.disabled.value || reducedMotion.value) {
|
|
113
113
|
layer.target.style.transform = `translate3d(${layer.offsetX}px, ${layer.offsetY}px, 0)`;
|
|
@@ -158,7 +158,7 @@ function useParallaxRuntime(options) {
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
const onMouseMove = event => {
|
|
161
|
-
if (options.direction.value !==
|
|
161
|
+
if (options.direction.value !== _parallax2.PARALLAX_DIRECTION.BOTH) return;
|
|
162
162
|
const host = options.target.value;
|
|
163
163
|
if (!host) return;
|
|
164
164
|
const rect = host.getBoundingClientRect();
|
|
@@ -229,8 +229,8 @@ function useParallaxRuntime(options) {
|
|
|
229
229
|
const host = options.target.value;
|
|
230
230
|
host?.removeEventListener("mousemove", onMouseMove);
|
|
231
231
|
});
|
|
232
|
-
(0, _vue.watch)(cssScrollDriven,
|
|
233
|
-
if (
|
|
232
|
+
(0, _vue.watch)(cssScrollDriven, () => {
|
|
233
|
+
if (cssScrollDriven.value) {
|
|
234
234
|
if (rafId != null) {
|
|
235
235
|
cancelAnimationFrame(rafId);
|
|
236
236
|
rafId = null;
|