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
|
@@ -186,6 +186,7 @@ import { useMargin } from "../../composables/Commons/margin.composable";
|
|
|
186
186
|
import { usePadding } from "../../composables/Commons/padding.composable";
|
|
187
187
|
import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
188
188
|
import { intentBgExpr, isIntent } from "../../utils/Commons/color.util";
|
|
189
|
+
import { buildSankeyLinkSpecs, groupSankeyColumns, orderSankeyColumns, sankeyNodeHeight, sankeyRibbonPath, stackSankeyBands, sumSankeyFlows } from "../../utils/Chart/sankey-layout.util";
|
|
189
190
|
/*********************************************************
|
|
190
191
|
* Global
|
|
191
192
|
*
|
|
@@ -743,16 +744,7 @@ const layoutNodes = computed(() => {
|
|
|
743
744
|
}));
|
|
744
745
|
const columns = topoColumns(nodeNames, edges);
|
|
745
746
|
const totalColumns = Math.max(...Array.from(columns.values())) + 1;
|
|
746
|
-
const incomingSum =
|
|
747
|
-
const outgoingSum = new Map();
|
|
748
|
-
for (const name of nodeNames) {
|
|
749
|
-
incomingSum.set(name, 0);
|
|
750
|
-
outgoingSum.set(name, 0);
|
|
751
|
-
}
|
|
752
|
-
for (const d of data) {
|
|
753
|
-
outgoingSum.set(d.from, (outgoingSum.get(d.from) ?? 0) + d.value);
|
|
754
|
-
incomingSum.set(d.to, (incomingSum.get(d.to) ?? 0) + d.value);
|
|
755
|
-
}
|
|
747
|
+
const { incomingSum, outgoingSum } = sumSankeyFlows(data, nodeNames);
|
|
756
748
|
const nodeValues = new Map();
|
|
757
749
|
for (const name of nodeNames) {
|
|
758
750
|
nodeValues.set(name, Math.max(incomingSum.get(name) ?? 0, outgoingSum.get(name) ?? 0));
|
|
@@ -764,61 +756,8 @@ const layoutNodes = computed(() => {
|
|
|
764
756
|
const plotWidth = plotRight - plotLeft;
|
|
765
757
|
const plotHeight = plotBottom - plotTop;
|
|
766
758
|
const colXStep = totalColumns > 1 ? (plotWidth - props.nodeWidth) / (totalColumns - 1) : 0;
|
|
767
|
-
const byColumn =
|
|
768
|
-
|
|
769
|
-
if (!byColumn.has(col)) byColumn.set(col, []);
|
|
770
|
-
byColumn.get(col).push(name);
|
|
771
|
-
}
|
|
772
|
-
/*
|
|
773
|
-
* Barycentric node ordering — sort each column so each node
|
|
774
|
-
* sits near the average position of its neighbours. Two
|
|
775
|
-
* sweeps (left-to-right then right-to-left, applied twice)
|
|
776
|
-
* are enough to minimise crossings on the typical 3-5
|
|
777
|
-
* column funnel without paying for a full LP solver.
|
|
778
|
-
*/
|
|
779
|
-
const orderIndex = new Map();
|
|
780
|
-
const sortedColumns = Array.from(byColumn.keys()).sort((a, b) => a - b);
|
|
781
|
-
for (const col of sortedColumns) {
|
|
782
|
-
const names = byColumn.get(col);
|
|
783
|
-
names.forEach((n, i) => orderIndex.set(n, i));
|
|
784
|
-
}
|
|
785
|
-
const predecessors = new Map();
|
|
786
|
-
const successors = new Map();
|
|
787
|
-
for (const name of nodeNames) {
|
|
788
|
-
predecessors.set(name, []);
|
|
789
|
-
successors.set(name, []);
|
|
790
|
-
}
|
|
791
|
-
for (const { from, to } of edges) {
|
|
792
|
-
successors.get(from).push(to);
|
|
793
|
-
predecessors.get(to).push(from);
|
|
794
|
-
}
|
|
795
|
-
const barycenter = (neighbours) => {
|
|
796
|
-
if (!neighbours.length) return Number.POSITIVE_INFINITY;
|
|
797
|
-
let sum = 0;
|
|
798
|
-
let count = 0;
|
|
799
|
-
for (const n of neighbours) {
|
|
800
|
-
const idx = orderIndex.get(n);
|
|
801
|
-
if (idx !== undefined) {
|
|
802
|
-
sum += idx;
|
|
803
|
-
count++;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
return count ? sum / count : Number.POSITIVE_INFINITY;
|
|
807
|
-
};
|
|
808
|
-
const sweep = (direction) => {
|
|
809
|
-
const cols = direction === "down" ? sortedColumns : [...sortedColumns].reverse();
|
|
810
|
-
for (const col of cols) {
|
|
811
|
-
const names = byColumn.get(col);
|
|
812
|
-
if (names.length < 2) continue;
|
|
813
|
-
const neighbours = direction === "down" ? predecessors : successors;
|
|
814
|
-
names.sort((a, b) => barycenter(neighbours.get(a)) - barycenter(neighbours.get(b)));
|
|
815
|
-
names.forEach((n, i) => orderIndex.set(n, i));
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
for (let pass = 0; pass < 2; pass++) {
|
|
819
|
-
sweep("down");
|
|
820
|
-
sweep("up");
|
|
821
|
-
}
|
|
759
|
+
const byColumn = groupSankeyColumns(columns);
|
|
760
|
+
orderSankeyColumns(byColumn, edges, nodeNames);
|
|
822
761
|
const nodes = [];
|
|
823
762
|
for (const [col, names] of byColumn.entries()) {
|
|
824
763
|
const colTotal = names.reduce((sum, n) => sum + (nodeValues.get(n) ?? 0), 0);
|
|
@@ -828,7 +767,7 @@ const layoutNodes = computed(() => {
|
|
|
828
767
|
const xPos = plotLeft + col * colXStep;
|
|
829
768
|
for (const name of names) {
|
|
830
769
|
const val = nodeValues.get(name) ?? 0;
|
|
831
|
-
const nodeH =
|
|
770
|
+
const nodeH = sankeyNodeHeight(val, colTotal, availableHeight, names.length);
|
|
832
771
|
const colIndex = col;
|
|
833
772
|
nodes.push({
|
|
834
773
|
name,
|
|
@@ -856,95 +795,9 @@ const layoutLinks = computed(() => {
|
|
|
856
795
|
for (const node of layoutNodes.value) {
|
|
857
796
|
nodeMap.set(node.name, node);
|
|
858
797
|
}
|
|
859
|
-
const
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
incomingSum.set(name, 0);
|
|
863
|
-
outgoingSum.set(name, 0);
|
|
864
|
-
}
|
|
865
|
-
for (const d of data) {
|
|
866
|
-
outgoingSum.set(d.from, (outgoingSum.get(d.from) ?? 0) + d.value);
|
|
867
|
-
incomingSum.set(d.to, (incomingSum.get(d.to) ?? 0) + d.value);
|
|
868
|
-
}
|
|
869
|
-
/*
|
|
870
|
-
* Pre-compute per-link source / target band heights and
|
|
871
|
-
* sort the links so ribbons leave each source in target-Y
|
|
872
|
-
* order and arrive at each target in source-Y order. Without
|
|
873
|
-
* this sort, ribbons cross themselves on the same node and
|
|
874
|
-
* produce the swirl-from-hell visual.
|
|
875
|
-
*/
|
|
876
|
-
const specs = [];
|
|
877
|
-
for (let i = 0; i < data.length; i++) {
|
|
878
|
-
const d = data[i];
|
|
879
|
-
const sourceNode = nodeMap.get(d.from);
|
|
880
|
-
const targetNode = nodeMap.get(d.to);
|
|
881
|
-
if (!sourceNode || !targetNode) continue;
|
|
882
|
-
const srcOutTotal = outgoingSum.get(d.from) ?? 1;
|
|
883
|
-
const tgtInTotal = incomingSum.get(d.to) ?? 1;
|
|
884
|
-
const srcBandH = srcOutTotal > 0 ? d.value / srcOutTotal * sourceNode.height : 0;
|
|
885
|
-
const tgtBandH = tgtInTotal > 0 ? d.value / tgtInTotal * targetNode.height : 0;
|
|
886
|
-
const linkColor = d.color ? resolveColor(d.color) : sourceNode.color ?? "currentColor";
|
|
887
|
-
specs.push({
|
|
888
|
-
index: i,
|
|
889
|
-
from: d.from,
|
|
890
|
-
to: d.to,
|
|
891
|
-
value: d.value,
|
|
892
|
-
color: linkColor,
|
|
893
|
-
srcBandH,
|
|
894
|
-
tgtBandH,
|
|
895
|
-
srcY: sourceNode.y,
|
|
896
|
-
tgtY: targetNode.y
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
/*
|
|
900
|
-
* Assign source-side Y offsets: for each source node, sort
|
|
901
|
-
* its outgoing links by target Y ascending so the topmost
|
|
902
|
-
* link leaves the node from the top of its outgoing band.
|
|
903
|
-
* We store the band TOP (not its centre) — the ribbon is
|
|
904
|
-
* drawn as a filled path with explicit top + bottom edges,
|
|
905
|
-
* so we need the exact vertical extent.
|
|
906
|
-
*/
|
|
907
|
-
const srcOffsetMap = new Map();
|
|
908
|
-
const bySource = new Map();
|
|
909
|
-
for (const s of specs) {
|
|
910
|
-
if (!bySource.has(s.from)) bySource.set(s.from, []);
|
|
911
|
-
bySource.get(s.from).push(s);
|
|
912
|
-
}
|
|
913
|
-
for (const [from, group] of bySource.entries()) {
|
|
914
|
-
group.sort((a, b) => a.tgtY - b.tgtY);
|
|
915
|
-
const source = nodeMap.get(from);
|
|
916
|
-
let acc = source.y;
|
|
917
|
-
for (const link of group) {
|
|
918
|
-
srcOffsetMap.set(link.index, {
|
|
919
|
-
yTop: acc,
|
|
920
|
-
srcBandH: link.srcBandH
|
|
921
|
-
});
|
|
922
|
-
acc += link.srcBandH;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
/*
|
|
926
|
-
* Same on the receiving side. Incoming bands stack from
|
|
927
|
-
* the target's top edge, sorted by source Y so the topmost
|
|
928
|
-
* band on the target came from the topmost source.
|
|
929
|
-
*/
|
|
930
|
-
const tgtOffsetMap = new Map();
|
|
931
|
-
const byTarget = new Map();
|
|
932
|
-
for (const s of specs) {
|
|
933
|
-
if (!byTarget.has(s.to)) byTarget.set(s.to, []);
|
|
934
|
-
byTarget.get(s.to).push(s);
|
|
935
|
-
}
|
|
936
|
-
for (const [to, group] of byTarget.entries()) {
|
|
937
|
-
group.sort((a, b) => a.srcY - b.srcY);
|
|
938
|
-
const target = nodeMap.get(to);
|
|
939
|
-
let acc = target.y;
|
|
940
|
-
for (const link of group) {
|
|
941
|
-
tgtOffsetMap.set(link.index, {
|
|
942
|
-
yTop: acc,
|
|
943
|
-
tgtBandH: link.tgtBandH
|
|
944
|
-
});
|
|
945
|
-
acc += link.tgtBandH;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
798
|
+
const specs = buildSankeyLinkSpecs(data, nodeMap, sumSankeyFlows(data, nodeMap.keys()), resolveColor);
|
|
799
|
+
const srcOffsetMap = stackSankeyBands(specs, nodeMap, "source");
|
|
800
|
+
const tgtOffsetMap = stackSankeyBands(specs, nodeMap, "target");
|
|
948
801
|
/*
|
|
949
802
|
* Filled ribbon path — two Bezier curves (top + bottom)
|
|
950
803
|
* joined by short vertical segments at each node face.
|
|
@@ -963,18 +816,7 @@ const layoutLinks = computed(() => {
|
|
|
963
816
|
const targetNode = nodeMap.get(s.to);
|
|
964
817
|
const x0 = sourceNode.x + props.nodeWidth;
|
|
965
818
|
const x1 = targetNode.x;
|
|
966
|
-
const
|
|
967
|
-
const y0Bot = srcOff.yTop + srcOff.srcBandH;
|
|
968
|
-
const y1Top = tgtOff.yTop;
|
|
969
|
-
const y1Bot = tgtOff.yTop + tgtOff.tgtBandH;
|
|
970
|
-
const cp = (x1 - x0) * .5;
|
|
971
|
-
const pathD = [
|
|
972
|
-
`M ${x0},${y0Top}`,
|
|
973
|
-
`C ${x0 + cp},${y0Top} ${x1 - cp},${y1Top} ${x1},${y1Top}`,
|
|
974
|
-
`L ${x1},${y1Bot}`,
|
|
975
|
-
`C ${x1 - cp},${y1Bot} ${x0 + cp},${y0Bot} ${x0},${y0Bot}`,
|
|
976
|
-
"Z"
|
|
977
|
-
].join(" ");
|
|
819
|
+
const pathD = sankeyRibbonPath(x0, x1, srcOff, tgtOff);
|
|
978
820
|
links.push({
|
|
979
821
|
index: s.index,
|
|
980
822
|
from: s.from,
|
|
@@ -758,6 +758,7 @@ const computeOffsets = computed(() => {
|
|
|
758
758
|
/*********************************************************
|
|
759
759
|
* Y scale — map data values to SVG coordinates
|
|
760
760
|
********************************************************/
|
|
761
|
+
const shareOf = (value, total) => total > 0 ? value / total : 0;
|
|
761
762
|
const dataExtents = computed(() => {
|
|
762
763
|
const layers = numericValues.value;
|
|
763
764
|
const n = columnCount.value;
|
|
@@ -774,10 +775,11 @@ const dataExtents = computed(() => {
|
|
|
774
775
|
const total = layers.reduce((s, layer) => s + layer[i], 0);
|
|
775
776
|
let cumulative = 0;
|
|
776
777
|
for (let j = 0; j < L; j++) {
|
|
777
|
-
const v = isExpand ?
|
|
778
|
+
const v = isExpand ? shareOf(layers[j][i], total) : layers[j][i];
|
|
779
|
+
const step = isExpand ? v * plot.value.height : v;
|
|
778
780
|
const bot = offsets[i] + cumulative;
|
|
779
|
-
const top = bot +
|
|
780
|
-
cumulative +=
|
|
781
|
+
const top = bot + step;
|
|
782
|
+
cumulative += step;
|
|
781
783
|
yMin = Math.min(yMin, bot);
|
|
782
784
|
yMax = Math.max(yMax, top);
|
|
783
785
|
}
|
|
@@ -857,6 +859,13 @@ const buildPath = (topPts, botPts) => {
|
|
|
857
859
|
/*********************************************************
|
|
858
860
|
* Ribbon geometry computation
|
|
859
861
|
********************************************************/
|
|
862
|
+
const stackedBelow = (layers, j, i, total, isExpand) => {
|
|
863
|
+
let cumulative = 0;
|
|
864
|
+
for (let k = 0; k < j; k++) {
|
|
865
|
+
cumulative += isExpand ? shareOf(layers[k][i], total) * plot.value.height : layers[k][i];
|
|
866
|
+
}
|
|
867
|
+
return cumulative;
|
|
868
|
+
};
|
|
860
869
|
const ribbons = computed(() => {
|
|
861
870
|
const layers = numericValues.value;
|
|
862
871
|
const n = columnCount.value;
|
|
@@ -871,16 +880,9 @@ const ribbons = computed(() => {
|
|
|
871
880
|
const botPts = [];
|
|
872
881
|
for (let i = 0; i < n; i++) {
|
|
873
882
|
const total = layers.reduce((sum, layer) => sum + layer[i], 0);
|
|
874
|
-
|
|
875
|
-
for (let k = 0; k < j; k++) {
|
|
876
|
-
if (isExpand) {
|
|
877
|
-
cumulative += total > 0 ? layers[k][i] / total * plot.value.height : 0;
|
|
878
|
-
} else {
|
|
879
|
-
cumulative += layers[k][i];
|
|
880
|
-
}
|
|
881
|
-
}
|
|
883
|
+
const cumulative = stackedBelow(layers, j, i, total, isExpand);
|
|
882
884
|
const rawV = layers[j][i];
|
|
883
|
-
const v = isExpand ?
|
|
885
|
+
const v = isExpand ? shareOf(rawV, total) * plot.value.height : rawV;
|
|
884
886
|
const botData = offsets[i] + cumulative;
|
|
885
887
|
const topData = botData + v;
|
|
886
888
|
topPts.push({
|
|
@@ -660,6 +660,14 @@ const childColor = (parentColor, depth) => {
|
|
|
660
660
|
const pct = cappedDepth * 15;
|
|
661
661
|
return `color-mix(in srgb, ${parentColor} calc(100% - ${pct}%), white)`;
|
|
662
662
|
};
|
|
663
|
+
const nodeColorFor = (datum, depth, parentColor) => {
|
|
664
|
+
if (datum.color) return resolveColor(datum.color);
|
|
665
|
+
return depth === 0 ? parentColor : childColor(parentColor, depth);
|
|
666
|
+
};
|
|
667
|
+
const labelModeForSpan = (arcSpan) => {
|
|
668
|
+
if (arcSpan >= LABEL_ANGLE_INLINE) return "inline";
|
|
669
|
+
return arcSpan >= LABEL_ANGLE_ROTATED ? "rotated" : "leader";
|
|
670
|
+
};
|
|
663
671
|
/*********************************************************
|
|
664
672
|
* Tree value resolution — fill in missing internal values
|
|
665
673
|
********************************************************/
|
|
@@ -790,10 +798,10 @@ const allNodes = computed(() => {
|
|
|
790
798
|
const isHidden = hiddenRoots.value.has(depth === 0 ? datum.name : nodePath.split(" > ")[0]);
|
|
791
799
|
const innerR = holeR + depth * (ringWidth + props.ringPadding);
|
|
792
800
|
const outerR = innerR + ringWidth;
|
|
793
|
-
const nodeColor =
|
|
801
|
+
const nodeColor = nodeColorFor(datum, depth, parentColor);
|
|
794
802
|
const d = arcPath(innerR, outerR, parentStartAngle, parentEndAngle);
|
|
795
803
|
const arcSpan = parentEndAngle - parentStartAngle;
|
|
796
|
-
const labelMode = arcSpan
|
|
804
|
+
const labelMode = labelModeForSpan(arcSpan);
|
|
797
805
|
result.push({
|
|
798
806
|
id: nodePath,
|
|
799
807
|
name: datum.name,
|
|
@@ -692,8 +692,39 @@ const angleFor = (index) => {
|
|
|
692
692
|
/*********************************************************
|
|
693
693
|
* AABB overlap test
|
|
694
694
|
********************************************************/
|
|
695
|
-
const overlaps = (
|
|
696
|
-
return Math.abs(
|
|
695
|
+
const overlaps = (a, b) => {
|
|
696
|
+
return Math.abs(a.x - b.x) < (a.width + b.width) / 2 + 2 && Math.abs(a.y - b.y) < (a.height + b.height) / 2 + 2;
|
|
697
|
+
};
|
|
698
|
+
/*********************************************************
|
|
699
|
+
* Spiral slot search — first collision-free, in-bounds point on the
|
|
700
|
+
* Archimedean spiral for a word box; `null` when none within
|
|
701
|
+
* MAX_SPIRAL_ITERATIONS. The first word sits at the centre.
|
|
702
|
+
********************************************************/
|
|
703
|
+
const findSpiralSlot = (placed, wordW, wordH) => {
|
|
704
|
+
if (placed.length === 0) return {
|
|
705
|
+
x: centerX.value,
|
|
706
|
+
y: centerY.value
|
|
707
|
+
};
|
|
708
|
+
let theta = 0;
|
|
709
|
+
for (let iter = 0; iter < MAX_SPIRAL_ITERATIONS; iter++) {
|
|
710
|
+
const r = SPIRAL_A * theta;
|
|
711
|
+
const cx = centerX.value + r * Math.cos(theta);
|
|
712
|
+
const cy = centerY.value + r * Math.sin(theta);
|
|
713
|
+
const outOfBounds = cx < wordW / 2 || cx > svgWidth.value - wordW / 2 || cy < wordH / 2 || cy > svgHeight.value - wordH / 2;
|
|
714
|
+
if (!outOfBounds && !placed.some((p) => overlaps({
|
|
715
|
+
x: cx,
|
|
716
|
+
y: cy,
|
|
717
|
+
width: wordW,
|
|
718
|
+
height: wordH
|
|
719
|
+
}, p))) {
|
|
720
|
+
return {
|
|
721
|
+
x: cx,
|
|
722
|
+
y: cy
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
theta += SPIRAL_STEP;
|
|
726
|
+
}
|
|
727
|
+
return null;
|
|
697
728
|
};
|
|
698
729
|
/*********************************************************
|
|
699
730
|
* Word cloud placement — Archimedean spiral
|
|
@@ -717,46 +748,18 @@ const placedWords = computed(() => {
|
|
|
717
748
|
const wordW = isVertical ? estimatedH : estimatedW;
|
|
718
749
|
const wordH = isVertical ? estimatedW : estimatedH;
|
|
719
750
|
const color = colorFor(idx);
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
placed_ = true;
|
|
725
|
-
} else {
|
|
726
|
-
let theta = 0;
|
|
727
|
-
for (let iter = 0; iter < MAX_SPIRAL_ITERATIONS; iter++) {
|
|
728
|
-
const r = SPIRAL_A * theta;
|
|
729
|
-
cx = centerX.value + r * Math.cos(theta);
|
|
730
|
-
cy = centerY.value + r * Math.sin(theta);
|
|
731
|
-
if (cx < wordW / 2 || cx > svgWidth.value - wordW / 2 || cy < wordH / 2 || cy > svgHeight.value - wordH / 2) {
|
|
732
|
-
theta += SPIRAL_STEP;
|
|
733
|
-
continue;
|
|
734
|
-
}
|
|
735
|
-
let collision = false;
|
|
736
|
-
for (const p of placed) {
|
|
737
|
-
if (overlaps(cx, cy, wordW, wordH, p.x, p.y, p.width, p.height)) {
|
|
738
|
-
collision = true;
|
|
739
|
-
break;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
if (!collision) {
|
|
743
|
-
placed_ = true;
|
|
744
|
-
break;
|
|
745
|
-
}
|
|
746
|
-
theta += SPIRAL_STEP;
|
|
747
|
-
}
|
|
748
|
-
if (!placed_) {
|
|
749
|
-
console.warn(`[OrigamChartWordCloud] Could not place word "${datum.text}" within ${MAX_SPIRAL_ITERATIONS} iterations — skipped.`);
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
751
|
+
const slot = findSpiralSlot(placed, wordW, wordH);
|
|
752
|
+
if (!slot) {
|
|
753
|
+
console.warn(`[OrigamChartWordCloud] Could not place word "${datum.text}" within ${MAX_SPIRAL_ITERATIONS} iterations — skipped.`);
|
|
754
|
+
return;
|
|
752
755
|
}
|
|
753
756
|
const word = {
|
|
754
757
|
text: datum.text,
|
|
755
758
|
value: datum.value,
|
|
756
759
|
color,
|
|
757
760
|
fontSize,
|
|
758
|
-
x:
|
|
759
|
-
y:
|
|
761
|
+
x: slot.x,
|
|
762
|
+
y: slot.y,
|
|
760
763
|
angle,
|
|
761
764
|
index: idx,
|
|
762
765
|
width: wordW,
|
|
@@ -47,7 +47,6 @@ import { useProps } from "../../composables/Commons/props.composable";
|
|
|
47
47
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
48
48
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
49
49
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
50
|
-
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
51
50
|
import { computed, ref, StyleValue, useSlots } from "vue";
|
|
52
51
|
/*********************************************************
|
|
53
52
|
* Global
|
|
@@ -63,7 +62,7 @@ const props = defineProps({
|
|
|
63
62
|
indeterminateIcon: {
|
|
64
63
|
type: null,
|
|
65
64
|
required: false,
|
|
66
|
-
default:
|
|
65
|
+
default: "mdi:mdi-minus-box"
|
|
67
66
|
},
|
|
68
67
|
id: {
|
|
69
68
|
type: String,
|
|
@@ -139,12 +138,12 @@ const props = defineProps({
|
|
|
139
138
|
falseIcon: {
|
|
140
139
|
type: null,
|
|
141
140
|
required: false,
|
|
142
|
-
default:
|
|
141
|
+
default: "mdi:mdi-checkbox-blank-outline"
|
|
143
142
|
},
|
|
144
143
|
trueIcon: {
|
|
145
144
|
type: null,
|
|
146
145
|
required: false,
|
|
147
|
-
default:
|
|
146
|
+
default: "mdi:mdi-checkbox-marked-outline"
|
|
148
147
|
},
|
|
149
148
|
multiple: {
|
|
150
149
|
type: Boolean,
|
|
@@ -151,7 +151,6 @@ import { ORIGAM_CHIP_GROUP_KEY } from "../../consts/Chip/chip-group.const";
|
|
|
151
151
|
import vContrast from "../../directives/Contrast/contrast.directive";
|
|
152
152
|
import vRipple from "../../directives/Ripple/ripple.directive";
|
|
153
153
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
|
|
154
|
-
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
155
154
|
import { SIZES } from "../../enums/Commons/size.enum";
|
|
156
155
|
import { computed, StyleValue, toRef, useAttrs, useSlots } from "vue";
|
|
157
156
|
/*********************************************************
|
|
@@ -169,7 +168,7 @@ const props = defineProps({
|
|
|
169
168
|
closeIcon: {
|
|
170
169
|
type: null,
|
|
171
170
|
required: false,
|
|
172
|
-
default:
|
|
171
|
+
default: "mdi:mdi-close-circle-outline"
|
|
173
172
|
},
|
|
174
173
|
closeLabel: {
|
|
175
174
|
type: String,
|
|
@@ -187,7 +186,7 @@ const props = defineProps({
|
|
|
187
186
|
filterIcon: {
|
|
188
187
|
type: null,
|
|
189
188
|
required: false,
|
|
190
|
-
default:
|
|
189
|
+
default: "mdi:mdi-check"
|
|
191
190
|
},
|
|
192
191
|
label: {
|
|
193
192
|
type: Boolean,
|
|
@@ -1251,40 +1250,40 @@ defineExpose({
|
|
|
1251
1250
|
&--size-x-small {
|
|
1252
1251
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-xs, 0.625rem));
|
|
1253
1252
|
line-height: 1;
|
|
1254
|
-
height: var(--origam-chip---height-xs, 20px);
|
|
1253
|
+
height: calc(var(--origam-chip---height-xs, 20px) + var(--origam-chip---density, 0px));
|
|
1255
1254
|
padding: 0 var(--origam-chip---padding-xs, 8px);
|
|
1256
1255
|
}
|
|
1257
1256
|
|
|
1258
1257
|
&--size-small {
|
|
1259
1258
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-sm, 0.75rem));
|
|
1260
1259
|
line-height: 1;
|
|
1261
|
-
height: var(--origam-chip---height-sm, 24px);
|
|
1260
|
+
height: calc(var(--origam-chip---height-sm, 24px) + var(--origam-chip---density, 0px));
|
|
1262
1261
|
padding: 0 var(--origam-chip---padding-sm, 10px);
|
|
1263
1262
|
}
|
|
1264
1263
|
|
|
1265
1264
|
&--size-default {
|
|
1266
1265
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-md, 0.875rem));
|
|
1267
1266
|
line-height: 1;
|
|
1268
|
-
height: var(--origam-chip---height-md, 32px);
|
|
1267
|
+
height: calc(var(--origam-chip---height-md, 32px) + var(--origam-chip---density, 0px));
|
|
1269
1268
|
padding: 0 var(--origam-chip---padding-md, 12px);
|
|
1270
1269
|
}
|
|
1271
1270
|
|
|
1272
1271
|
&--size-large {
|
|
1273
1272
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-lg, 1rem));
|
|
1274
1273
|
line-height: 1;
|
|
1275
|
-
height: var(--origam-chip---height-lg, 38px);
|
|
1274
|
+
height: calc(var(--origam-chip---height-lg, 38px) + var(--origam-chip---density, 0px));
|
|
1276
1275
|
padding: 0 var(--origam-chip---padding-lg, 14px);
|
|
1277
1276
|
}
|
|
1278
1277
|
|
|
1279
1278
|
&--size-x-large {
|
|
1280
1279
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-xl, 1.125rem));
|
|
1281
1280
|
line-height: 1;
|
|
1282
|
-
height: var(--origam-chip---height-xl, 44px);
|
|
1281
|
+
height: calc(var(--origam-chip---height-xl, 44px) + var(--origam-chip---density, 0px));
|
|
1283
1282
|
padding: 0 var(--origam-chip---padding-xl, 17px);
|
|
1284
1283
|
}
|
|
1285
1284
|
|
|
1286
1285
|
/*
|
|
1287
|
-
* ⛔ #595 —
|
|
1286
|
+
* ⛔ #595 — QUATORZE tokens `--origam-chip--*` que les feuilles declarent
|
|
1288
1287
|
* et que ce SCSS ne lit PAS. Ils restent en baseline
|
|
1289
1288
|
* `token-var-channels-dormant.json`, voici pourquoi :
|
|
1290
1289
|
*
|
|
@@ -1298,13 +1297,13 @@ defineExpose({
|
|
|
1298
1297
|
* `!important` — empecherait la prop de peindre : c est exactement
|
|
1299
1298
|
* l incident qui a produit l ADR-005 et le garde `no-variant-css`.
|
|
1300
1299
|
* La classe emise reste un point d accroche CONSOMMATEUR ;
|
|
1301
|
-
* · `---density`
|
|
1302
|
-
*
|
|
1303
|
-
* distinct de C2 — la prop `density` de Chip est inerte, aucune
|
|
1304
|
-
* hauteur ni marge ne consomme la variable — et le corriger
|
|
1305
|
-
* changerait le rendu de `density="compact"`. Hors perimetre de ce
|
|
1306
|
-
* lot, signale sans ticket ouvert (consigne du lot).
|
|
1300
|
+
* · `---density` est desormais LU par les cinq `height` (#1105), comme
|
|
1301
|
+
* `--origam-btn---density` : `calc(height-palier + density)`.
|
|
1307
1302
|
*/
|
|
1303
|
+
&--density-comfortable {
|
|
1304
|
+
--origam-chip---density: 8px;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1308
1307
|
&--density-default {
|
|
1309
1308
|
--origam-chip---density: 0px;
|
|
1310
1309
|
}
|
|
@@ -28,7 +28,6 @@ import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
|
28
28
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
29
29
|
import { ORIGAM_CHIP_GROUP_KEY } from "../../consts/Chip/chip-group.const";
|
|
30
30
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
31
|
-
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
32
31
|
import { omitUndefined } from "../../utils/Commons/commons.util";
|
|
33
32
|
import { computed, ref, StyleValue } from "vue";
|
|
34
33
|
/*********************************************************
|
|
@@ -566,12 +565,12 @@ const props = defineProps({
|
|
|
566
565
|
nextIcon: {
|
|
567
566
|
type: null,
|
|
568
567
|
required: false,
|
|
569
|
-
default:
|
|
568
|
+
default: "mdi:mdi-chevron-right"
|
|
570
569
|
},
|
|
571
570
|
prevIcon: {
|
|
572
571
|
type: null,
|
|
573
572
|
required: false,
|
|
574
|
-
default:
|
|
573
|
+
default: "mdi:mdi-chevron-left"
|
|
575
574
|
},
|
|
576
575
|
showArrows: {
|
|
577
576
|
type: [Boolean, String],
|
|
@@ -626,7 +626,7 @@ const resolvedFeedbackText = computed(() => props.successText ?? props.feedbackT
|
|
|
626
626
|
*
|
|
627
627
|
* @description
|
|
628
628
|
* Both sides are now props (`icon` / `copiedIcon`) instead of the
|
|
629
|
-
* module-level `
|
|
629
|
+
* module-level `'mdi:mdi-content-copy'` constant this component used
|
|
630
630
|
* to hardcode: an icon a consumer could not pick was a dead surface,
|
|
631
631
|
* and a theme could not reach it either.
|
|
632
632
|
*
|
|
@@ -103,6 +103,7 @@ import { CODE_DEFAULTS } from "../../consts/Code/code.const";
|
|
|
103
103
|
import { CODE_LANG } from "../../enums/Code/code.enum";
|
|
104
104
|
import { parseHighlightLines } from "../../utils/Code/parse-highlight-lines.util";
|
|
105
105
|
import { trimBlankLines } from "../../utils/Code/trim-blank-lines.util";
|
|
106
|
+
import { warnAsyncRejection } from "../../utils/Commons/console.util";
|
|
106
107
|
/*********************************************************
|
|
107
108
|
* Global
|
|
108
109
|
*
|
|
@@ -843,6 +844,7 @@ const highlightedLines = computed(() => {
|
|
|
843
844
|
const arr = parseHighlightLines(props.highlightLines);
|
|
844
845
|
return new Set(arr);
|
|
845
846
|
});
|
|
847
|
+
const onRebuildRejection = (err) => warnAsyncRejection("OrigamCode", err);
|
|
846
848
|
async function rebuild() {
|
|
847
849
|
const token = ++_renderToken;
|
|
848
850
|
isHighlighting.value = true;
|
|
@@ -904,7 +906,7 @@ function paintIntoDom(rawHtml) {
|
|
|
904
906
|
target.innerHTML = rows;
|
|
905
907
|
}
|
|
906
908
|
watch([formattedCode, () => props.lang], () => {
|
|
907
|
-
|
|
909
|
+
rebuild().catch(onRebuildRejection);
|
|
908
910
|
}, { immediate: false });
|
|
909
911
|
// Highlight-lines is purely a class swap on already-rendered rows — no
|
|
910
912
|
// shiki re-render needed.
|
|
@@ -917,7 +919,7 @@ watch(highlightedLines, () => {
|
|
|
917
919
|
});
|
|
918
920
|
});
|
|
919
921
|
onMounted(() => {
|
|
920
|
-
|
|
922
|
+
rebuild().catch(onRebuildRejection);
|
|
921
923
|
});
|
|
922
924
|
/*********************************************************
|
|
923
925
|
* Copy-to-clipboard with feedback.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<origam-btn
|
|
24
24
|
:aria-label="cycleModeAriaLabel"
|
|
25
25
|
:disabled="disabled"
|
|
26
|
-
:icon="
|
|
26
|
+
:icon="'mdi:mdi-unfold-less-horizontal'"
|
|
27
27
|
size="x-small"
|
|
28
28
|
@click="handleUpdateMode"
|
|
29
29
|
/>
|
|
@@ -38,7 +38,6 @@ import { useProps } from "../../composables/Commons/props.composable";
|
|
|
38
38
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
39
39
|
import { COLOR_NULL, COLOR_PICKER_MODES } from "../../consts/ColorPicker/color-picker.const";
|
|
40
40
|
import { COLOR_MODES_NAMES } from "../../enums/ColorPicker/color-picker.enum";
|
|
41
|
-
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
42
41
|
import { computed, StyleValue } from "vue";
|
|
43
42
|
/*********************************************************
|
|
44
43
|
* Global
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
:aria-label="eyeDropperAriaLabel"
|
|
14
14
|
:density="DENSITY.DEFAULT"
|
|
15
15
|
:disabled="disabled"
|
|
16
|
-
:icon="
|
|
16
|
+
:icon="'mdi:mdi-eyedropper'"
|
|
17
17
|
@click="openEyeDropper"
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
@@ -74,7 +74,6 @@ import { useStyle } from "../../composables/Commons/style.composable";
|
|
|
74
74
|
import { COLOR_NULL } from "../../consts/ColorPicker/color-picker.const";
|
|
75
75
|
import { SUPPORTS_EYE_DROPPER } from "../../consts/Commons/commons.const";
|
|
76
76
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
77
|
-
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
78
77
|
import { consoleWarn } from "../../utils/Commons/console.util";
|
|
79
78
|
import { HSVtoCSS, parseColor, RGBtoHSV } from "../../utils/Commons/color.util";
|
|
80
79
|
import { computed, onUnmounted, StyleValue } from "vue";
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<template v-if="isSelected(color)">
|
|
26
26
|
<origam-icon
|
|
27
27
|
:color="getContrast(color, '#FFFFFF') > 2 ? 'white' : 'black'"
|
|
28
|
-
:icon="
|
|
28
|
+
:icon="'mdi:mdi-check-circle-outline'"
|
|
29
29
|
aria-hidden="true"
|
|
30
30
|
size="x-small"
|
|
31
31
|
/>
|
|
@@ -44,7 +44,6 @@ import { useDimension } from "../../composables/Commons/dimension.composable";
|
|
|
44
44
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
45
45
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
46
46
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
47
|
-
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
48
47
|
import { convertToUnit, deepEqual } from "../../utils/Commons/commons.util";
|
|
49
48
|
import { getContrast, parseColor, RGBtoCSS, RGBtoHSV } from "../../utils/Commons/color.util";
|
|
50
49
|
import { computed, StyleValue } from "vue";
|