@mantine-vue/core 2.3.1 → 2.4.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.
Files changed (50) hide show
  1. package/cjs/index.cjs +991 -132
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +986 -133
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/components/Accordion/Accordion.d.ts +24 -4
  6. package/lib/components/Accordion/index.d.ts +1 -1
  7. package/lib/components/Cascader/Cascader.d.ts +314 -0
  8. package/lib/components/Cascader/cascader-utils.d.ts +11 -0
  9. package/lib/components/Cascader/index.d.ts +4 -0
  10. package/lib/components/ColorInput/ColorInput.d.ts +7 -2
  11. package/lib/components/ColorInput/index.d.ts +1 -1
  12. package/lib/components/Combobox/OptionsDropdown/OptionsDropdown.d.ts +1 -0
  13. package/lib/components/ComboboxPopover/ComboboxPopover.d.ts +4 -0
  14. package/lib/components/Drawer/Drawer.d.ts +33 -0
  15. package/lib/components/FloatingWindow/FloatingWindow.context.d.ts +23 -0
  16. package/lib/components/FloatingWindow/FloatingWindow.d.ts +37 -0
  17. package/lib/components/FloatingWindow/FloatingWindowResizeHandle.d.ts +27 -0
  18. package/lib/components/FloatingWindow/index.d.ts +2 -0
  19. package/lib/components/InputBase/index.d.ts +1 -1
  20. package/lib/components/Menu/Menu.context.d.ts +1 -0
  21. package/lib/components/Modal/Modal.d.ts +33 -0
  22. package/lib/components/MultiSelect/MultiSelect.d.ts +7 -0
  23. package/lib/components/MultiSelect/index.d.ts +1 -1
  24. package/lib/components/PasswordInput/PasswordInput.d.ts +4 -0
  25. package/lib/components/PasswordInput/index.d.ts +1 -1
  26. package/lib/components/ScrollArea/ScrollArea.d.ts +25 -0
  27. package/lib/components/Scroller/Scroller.d.ts +9 -2
  28. package/lib/components/Scroller/index.d.ts +1 -1
  29. package/lib/components/Select/Select.d.ts +1 -0
  30. package/lib/components/Select/index.d.ts +1 -1
  31. package/lib/components/Slider/index.d.ts +2 -1
  32. package/lib/components/Splitter/Splitter.d.ts +8 -3
  33. package/lib/components/Splitter/index.d.ts +1 -1
  34. package/lib/components/Stepper/Stepper.d.ts +2 -1
  35. package/lib/components/Tabs/Tabs.context.d.ts +0 -1
  36. package/lib/components/Tabs/Tabs.d.ts +0 -15
  37. package/lib/components/TagsInput/TagsInput.d.ts +7 -0
  38. package/lib/components/TagsInput/index.d.ts +1 -1
  39. package/lib/components/Textarea/Textarea.d.ts +7 -2
  40. package/lib/components/Textarea/index.d.ts +1 -0
  41. package/lib/components/Timeline/Timeline.d.ts +19 -1
  42. package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts +20 -1
  43. package/lib/components/Tree/Tree.d.ts +7 -2
  44. package/lib/components/Tree/index.d.ts +1 -1
  45. package/lib/components/TreeSelect/TreeSelect.d.ts +2 -0
  46. package/lib/components/TreeSelect/index.d.ts +1 -1
  47. package/lib/components/index.d.ts +1 -0
  48. package/package.json +3 -3
  49. package/styles.css +471 -129
  50. package/styles.layer.css +471 -129
package/cjs/index.cjs CHANGED
@@ -5108,7 +5108,7 @@ var varsResolver$70 = createVarsResolver((theme, { radius, color, gradient, vari
5108
5108
  "--button-hover-color": color || variant ? colors.hoverColor : void 0
5109
5109
  } };
5110
5110
  });
5111
- function renderContent$5(content) {
5111
+ function renderContent$4(content) {
5112
5112
  return typeof content === "function" ? content() : content;
5113
5113
  }
5114
5114
  var ButtonBase = (0, vue.defineComponent)({
@@ -5237,7 +5237,7 @@ var ButtonBase = (0, vue.defineComponent)({
5237
5237
  component: "span",
5238
5238
  ...getStyles("section"),
5239
5239
  mod: { position }
5240
- }, () => renderContent$5(content)) : null;
5240
+ }, () => renderContent$4(content)) : null;
5241
5241
  return () => {
5242
5242
  const leftSection = resolveNode(props.leftSection, slots.leftSection);
5243
5243
  const rightSection = resolveNode(props.rightSection, slots.rightSection);
@@ -8017,13 +8017,13 @@ var ScrollAreaViewport = withBoxProps((0, vue.defineComponent)({
8017
8017
  }
8018
8018
  }));
8019
8019
  var ScrollArea_module_default = {
8020
- root: "_root_kwra0_1",
8021
- content: "_content_kwra0_7",
8022
- viewport: "_viewport_kwra0_12",
8023
- viewportInner: "_viewportInner_kwra0_59",
8024
- scrollbar: "_scrollbar_kwra0_64",
8025
- thumb: "_thumb_kwra0_81",
8026
- corner: "_corner_kwra0_144"
8020
+ root: "_root_1sy9q_1",
8021
+ content: "_content_1sy9q_7",
8022
+ viewport: "_viewport_1sy9q_12",
8023
+ viewportInner: "_viewportInner_1sy9q_71",
8024
+ scrollbar: "_scrollbar_1sy9q_76",
8025
+ thumb: "_thumb_1sy9q_93",
8026
+ corner: "_corner_1sy9q_182"
8027
8027
  };
8028
8028
  //#endregion
8029
8029
  //#region src/components/ScrollArea/ScrollArea.ts
@@ -8099,6 +8099,10 @@ var ScrollAreaBase = (0, vue.defineComponent)({
8099
8099
  type: Object,
8100
8100
  default: void 0
8101
8101
  },
8102
+ verticalScrollbarPosition: {
8103
+ type: String,
8104
+ default: void 0
8105
+ },
8102
8106
  classNames: {
8103
8107
  type: [Object, Function],
8104
8108
  default: void 0
@@ -8257,11 +8261,13 @@ var ScrollAreaBase = (0, vue.defineComponent)({
8257
8261
  },
8258
8262
  "data-offset-scrollbars": toOffsetScrollbars(props.offsetScrollbars),
8259
8263
  "data-scrollbars": props.scrollbars || void 0,
8264
+ "data-vertical-scrollbar-position": props.verticalScrollbarPosition,
8260
8265
  onScroll: handleScroll
8261
8266
  }, () => slots.default?.()),
8262
8267
  (props.scrollbars === "xy" || props.scrollbars === "x") && (0, vue.h)(ScrollAreaScrollbar, {
8263
8268
  ...getStyles("scrollbar"),
8264
8269
  orientation: "horizontal",
8270
+ "data-vertical-scrollbar-position": props.verticalScrollbarPosition,
8265
8271
  "data-hidden": props.type === "never" ? true : void 0,
8266
8272
  "data-state": getScrollbarState("horizontal"),
8267
8273
  forceMount: true
@@ -8269,12 +8275,14 @@ var ScrollAreaBase = (0, vue.defineComponent)({
8269
8275
  (props.scrollbars === "xy" || props.scrollbars === "y") && (0, vue.h)(ScrollAreaScrollbar, {
8270
8276
  ...getStyles("scrollbar"),
8271
8277
  orientation: "vertical",
8278
+ "data-vertical-scrollbar-position": props.verticalScrollbarPosition,
8272
8279
  "data-hidden": props.type === "never" ? true : void 0,
8273
8280
  "data-state": getScrollbarState("vertical"),
8274
8281
  forceMount: true
8275
8282
  }, () => (0, vue.h)(ScrollAreaThumb, getStyles("thumb"))),
8276
8283
  (0, vue.h)(ScrollAreaCorner, {
8277
8284
  ...getStyles("corner"),
8285
+ "data-vertical-scrollbar-position": props.verticalScrollbarPosition,
8278
8286
  "data-hidden": props.type === "never" ? true : void 0
8279
8287
  })
8280
8288
  ]);
@@ -8595,6 +8603,7 @@ var defaultProps$35 = {
8595
8603
  multiple: false,
8596
8604
  loop: true,
8597
8605
  disableChevronRotation: false,
8606
+ disableCollapse: false,
8598
8607
  chevronPosition: "right",
8599
8608
  variant: "default",
8600
8609
  chevronSize: "auto",
@@ -8606,7 +8615,7 @@ function getSafeId$2(prefix) {
8606
8615
  return `${prefix}-${value}`;
8607
8616
  };
8608
8617
  }
8609
- function renderContent$4(content) {
8618
+ function renderContent$3(content) {
8610
8619
  return typeof content === "function" ? content() : content;
8611
8620
  }
8612
8621
  var varsResolver$57 = createVarsResolver((_, { transitionDuration, chevronSize, radius }) => ({ root: {
@@ -8617,6 +8626,7 @@ var varsResolver$57 = createVarsResolver((_, { transitionDuration, chevronSize,
8617
8626
  var AccordionBase = (0, vue.defineComponent)({
8618
8627
  name: "Accordion",
8619
8628
  inheritAttrs: false,
8629
+ slots: Object,
8620
8630
  props: {
8621
8631
  multiple: {
8622
8632
  type: Boolean,
@@ -8650,6 +8660,10 @@ var AccordionBase = (0, vue.defineComponent)({
8650
8660
  type: Boolean,
8651
8661
  default: void 0
8652
8662
  },
8663
+ disableCollapse: {
8664
+ type: Boolean,
8665
+ default: void 0
8666
+ },
8653
8667
  chevronPosition: {
8654
8668
  type: String,
8655
8669
  default: void 0
@@ -8729,6 +8743,7 @@ var AccordionBase = (0, vue.defineComponent)({
8729
8743
  const isItemActive = (itemValue) => Array.isArray(currentValue.value) ? currentValue.value.includes(itemValue) : itemValue === currentValue.value;
8730
8744
  const handleItemChange = (itemValue) => {
8731
8745
  const value = currentValue.value;
8746
+ if (!Array.isArray(value) && props.disableCollapse && itemValue === value) return;
8732
8747
  setCurrentValue(Array.isArray(value) ? value.includes(itemValue) ? value.filter((selectedValue) => selectedValue !== itemValue) : [...value, itemValue] : itemValue === value ? null : itemValue);
8733
8748
  };
8734
8749
  provideAccordionContext((0, vue.reactive)({
@@ -8748,7 +8763,8 @@ var AccordionBase = (0, vue.defineComponent)({
8748
8763
  return props.order;
8749
8764
  },
8750
8765
  get chevron() {
8751
- return props.chevron === null ? null : props.chevron ?? (() => (0, vue.h)(AccordionChevron, { size: props.chevronIconSize }));
8766
+ if (props.chevron === null) return null;
8767
+ return props.chevron ?? slots.chevron ?? (() => (0, vue.h)(AccordionChevron, { size: props.chevronIconSize }));
8752
8768
  },
8753
8769
  onChange: handleItemChange,
8754
8770
  isItemActive,
@@ -8778,7 +8794,7 @@ var AccordionBase = (0, vue.defineComponent)({
8778
8794
  id: uid.value,
8779
8795
  variant: props.variant,
8780
8796
  "data-accordion": true
8781
- }, () => renderContent$4(slots.default));
8797
+ }, () => renderContent$3(slots.default));
8782
8798
  }
8783
8799
  });
8784
8800
  var Accordion = Object.assign(AccordionBase, {
@@ -8806,12 +8822,10 @@ var varsResolver$56 = createVarsResolver((theme, { controlSize, edgeGradientColo
8806
8822
  "--scroller-control-size": controlSize === void 0 ? void 0 : rem(controlSize),
8807
8823
  "--scroller-background-color": edgeGradientColor ? getThemeColor(edgeGradientColor, theme) : void 0
8808
8824
  } }));
8809
- function renderContent$3(content) {
8810
- return typeof content === "function" ? content() : content;
8811
- }
8812
8825
  var Scroller = withBoxProps((0, vue.defineComponent)({
8813
8826
  name: "Scroller",
8814
8827
  inheritAttrs: false,
8828
+ slots: Object,
8815
8829
  props: {
8816
8830
  scrollAmount: {
8817
8831
  type: Number,
@@ -8916,7 +8930,7 @@ var Scroller = withBoxProps((0, vue.defineComponent)({
8916
8930
  "data-hidden": !showStart || void 0,
8917
8931
  "aria-label": "Scroll left",
8918
8932
  tabindex: showStart ? 0 : -1
8919
- }, () => renderContent$3(props.startControlIcon) || (0, vue.h)(AccordionChevron, getStyles("chevron"))),
8933
+ }, () => resolveNode(props.startControlIcon, slots.startControlIcon) || (0, vue.h)(AccordionChevron, getStyles("chevron"))),
8920
8934
  (0, vue.h)("div", {
8921
8935
  ...getStyles("container"),
8922
8936
  ref: scroller.ref,
@@ -8932,7 +8946,7 @@ var Scroller = withBoxProps((0, vue.defineComponent)({
8932
8946
  "data-hidden": !showEnd || void 0,
8933
8947
  "aria-label": "Scroll right",
8934
8948
  tabindex: showEnd ? 0 : -1
8935
- }, () => renderContent$3(props.endControlIcon) || (0, vue.h)(AccordionChevron, getStyles("chevron")))
8949
+ }, () => resolveNode(props.endControlIcon, slots.endControlIcon) || (0, vue.h)(AccordionChevron, getStyles("chevron")))
8936
8950
  ]);
8937
8951
  };
8938
8952
  }
@@ -9911,8 +9925,9 @@ function getDigitParts({ value, decimalScale, fixedDecimalScale }) {
9911
9925
  const dotIdx = str.indexOf(".");
9912
9926
  const intStr = dotIdx >= 0 ? str.slice(0, dotIdx) : str;
9913
9927
  const fracStr = dotIdx >= 0 ? str.slice(dotIdx + 1) : "";
9928
+ const roundedToZero = !/[1-9]/.test(str);
9914
9929
  return {
9915
- negative: value < 0,
9930
+ negative: value < 0 && !roundedToZero,
9916
9931
  intDigits: intStr.split(""),
9917
9932
  fracDigits: fracStr ? fracStr.split("") : [],
9918
9933
  hasDecimal: dotIdx >= 0
@@ -10258,11 +10273,12 @@ Object.assign(RollingNumber, {
10258
10273
  //#region src/components/Timeline/Timeline.context.ts
10259
10274
  var [provideTimelineContext, useTimelineContext] = createSafeContext("Timeline component was not found in tree");
10260
10275
  var Timeline_module_default = {
10261
- root: "_root_x5q16_1",
10262
- itemTitle: "_itemTitle_x5q16_17",
10263
- item: "_item_x5q16_17",
10264
- itemBullet: "_itemBullet_x5q16_84",
10265
- itemBody: "_itemBody_x5q16_139"
10276
+ root: "_root_1p5xp_1",
10277
+ itemTitle: "_itemTitle_1p5xp_19",
10278
+ item: "_item_1p5xp_19",
10279
+ itemBullet: "_itemBullet_1p5xp_96",
10280
+ itemBody: "_itemBody_1p5xp_159",
10281
+ itemOpposite: "_itemOpposite_1p5xp_199"
10266
10282
  };
10267
10283
  //#endregion
10268
10284
  //#region src/components/Timeline/TimelineItem/TimelineItem.ts
@@ -10299,6 +10315,14 @@ var TimelineItem = withBoxProps((0, vue.defineComponent)({
10299
10315
  type: null,
10300
10316
  default: void 0
10301
10317
  },
10318
+ opposite: {
10319
+ type: null,
10320
+ default: void 0
10321
+ },
10322
+ alternate: {
10323
+ type: Boolean,
10324
+ default: false
10325
+ },
10302
10326
  radius: {
10303
10327
  type: [String, Number],
10304
10328
  default: void 0
@@ -10349,6 +10373,7 @@ var TimelineItem = withBoxProps((0, vue.defineComponent)({
10349
10373
  const lineActive = props.lineActive ?? props.__lineActive;
10350
10374
  const bullet = resolveNode(props.bullet, slots.bullet);
10351
10375
  const title = resolveNode(props.title, slots.title);
10376
+ const opposite = resolveNode(props.opposite, slots.opposite);
10352
10377
  const stylesApiProps = {
10353
10378
  className: props.className ?? attrs.class,
10354
10379
  props
@@ -10357,7 +10382,8 @@ var TimelineItem = withBoxProps((0, vue.defineComponent)({
10357
10382
  ...attrs,
10358
10383
  mod: [{
10359
10384
  lineActive,
10360
- active
10385
+ active,
10386
+ alternate: props.alternate
10361
10387
  }, props.mod],
10362
10388
  ...ctx.getStyles("item", {
10363
10389
  ...stylesApiProps,
@@ -10369,14 +10395,18 @@ var TimelineItem = withBoxProps((0, vue.defineComponent)({
10369
10395
  ...attrs.style
10370
10396
  }
10371
10397
  })
10372
- }, () => [(0, vue.h)(Box, {
10373
- ...ctx.getStyles("itemBullet", { props }),
10374
- mod: {
10375
- withChild: hasNode(bullet),
10376
- align: props.__align,
10377
- active
10378
- }
10379
- }, () => bullet), (0, vue.h)("div", ctx.getStyles("itemBody", { props }), [hasNode(title) ? (0, vue.h)("div", ctx.getStyles("itemTitle", { props }), title) : null, (0, vue.h)("div", ctx.getStyles("itemContent", { props }), slots.default?.())])]);
10398
+ }, () => [
10399
+ (0, vue.h)(Box, {
10400
+ ...ctx.getStyles("itemBullet", { props }),
10401
+ mod: {
10402
+ withChild: hasNode(bullet),
10403
+ align: props.__align,
10404
+ active
10405
+ }
10406
+ }, () => bullet),
10407
+ hasNode(opposite) ? (0, vue.h)("div", ctx.getStyles("itemOpposite", { props }), opposite) : null,
10408
+ (0, vue.h)("div", ctx.getStyles("itemBody", { props }), [hasNode(title) ? (0, vue.h)("div", ctx.getStyles("itemTitle", { props }), title) : null, (0, vue.h)("div", ctx.getStyles("itemContent", { props }), slots.default?.())])
10409
+ ]);
10380
10410
  };
10381
10411
  }
10382
10412
  }));
@@ -10472,6 +10502,10 @@ var TimelineBase = (0, vue.defineComponent)({
10472
10502
  provideTimelineContext({ getStyles });
10473
10503
  return () => {
10474
10504
  const children = (slots.default?.() ?? []).filter(Boolean);
10505
+ const hasOpposite = children.some((item) => {
10506
+ const childSlots = item.children;
10507
+ return item.props?.opposite != null || childSlots?.opposite != null;
10508
+ });
10475
10509
  const active = props.active ?? defaultProps$28.active;
10476
10510
  const items = children.map((item, index) => (0, vue.cloneVNode)(item, {
10477
10511
  unstyled: props.unstyled,
@@ -10481,7 +10515,10 @@ var TimelineBase = (0, vue.defineComponent)({
10481
10515
  }, true));
10482
10516
  return (0, vue.h)(Box, {
10483
10517
  ...attrs,
10484
- mod: [{ align: props.align }, props.mod],
10518
+ mod: [{
10519
+ align: props.align,
10520
+ opposite: hasOpposite
10521
+ }, props.mod],
10485
10522
  ...getStyles("root", {
10486
10523
  className: attrs.class,
10487
10524
  style: attrs.style
@@ -16265,7 +16302,6 @@ var Tabs_module_default = {
16265
16302
  var VALUE_ERROR = "Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value";
16266
16303
  var defaultProps$13 = {
16267
16304
  keepMounted: true,
16268
- keepMountedMode: "activity",
16269
16305
  orientation: "horizontal",
16270
16306
  loop: true,
16271
16307
  activateTabWithKeyboard: true,
@@ -16347,10 +16383,6 @@ var TabsBase = (0, vue.defineComponent)({
16347
16383
  type: Boolean,
16348
16384
  default: void 0
16349
16385
  },
16350
- keepMountedMode: {
16351
- type: String,
16352
- default: void 0
16353
- },
16354
16386
  autoContrast: {
16355
16387
  type: Boolean,
16356
16388
  default: void 0
@@ -16426,9 +16458,6 @@ var TabsBase = (0, vue.defineComponent)({
16426
16458
  get keepMounted() {
16427
16459
  return props.keepMounted;
16428
16460
  },
16429
- get keepMountedMode() {
16430
- return props.keepMountedMode;
16431
- },
16432
16461
  get placement() {
16433
16462
  return props.placement;
16434
16463
  },
@@ -16640,6 +16669,7 @@ var TextareaAutosize = (0, vue.defineComponent)({
16640
16669
  var Textarea = (0, vue.defineComponent)({
16641
16670
  name: "Textarea",
16642
16671
  inheritAttrs: false,
16672
+ slots: Object,
16643
16673
  props: {
16644
16674
  autosize: {
16645
16675
  type: Boolean,
@@ -16688,7 +16718,7 @@ var Textarea = (0, vue.defineComponent)({
16688
16718
  __staticSelector: props.__staticSelector || "Textarea",
16689
16719
  multiline: true,
16690
16720
  "data-no-overflow": shouldAutosize && props.maxRows === void 0 ? true : void 0,
16691
- __bottomSection: props.bottomSection,
16721
+ __bottomSection: resolveNode(props.bottomSection, slots.bottomSection),
16692
16722
  __bottomSectionProps: props.bottomSectionProps,
16693
16723
  style: [{ "--input-resize": props.resize }, attrs.style],
16694
16724
  ...autosizeProps
@@ -17071,7 +17101,11 @@ var PasswordInput = (0, vue.defineComponent)({
17071
17101
  const hasError = props.error !== void 0 ? Boolean(props.error) && typeof props.error !== "boolean" : Boolean(slots.error);
17072
17102
  const hasDescription = props.description !== void 0 ? props.description !== null : Boolean(slots.description);
17073
17103
  const describedBy = `${hasError ? errorId : ""} ${hasDescription ? descriptionId : ""}`.trim() || void 0;
17074
- const VisibilityToggleIcon = props.visibilityToggleIcon || PasswordToggleIcon;
17104
+ const renderVisibilityToggleIcon = () => {
17105
+ if (props.visibilityToggleIcon) return (0, vue.h)(props.visibilityToggleIcon, { reveal: visible.value });
17106
+ if (slots.visibilityToggleIcon) return slots.visibilityToggleIcon({ reveal: visible.value });
17107
+ return (0, vue.h)(PasswordToggleIcon, { reveal: visible.value });
17108
+ };
17075
17109
  const visibilityToggleButton = (0, vue.h)(ActionIcon, {
17076
17110
  ...getStyles("visibilityToggle"),
17077
17111
  ...props.visibilityToggleButtonProps,
@@ -17100,7 +17134,7 @@ var PasswordInput = (0, vue.defineComponent)({
17100
17134
  toggleVisibility();
17101
17135
  }
17102
17136
  }
17103
- }, () => (0, vue.h)(VisibilityToggleIcon, { reveal: visible.value }));
17137
+ }, renderVisibilityToggleIcon);
17104
17138
  return (0, vue.h)(Input.Wrapper, {
17105
17139
  ...props.wrapperProps,
17106
17140
  id,
@@ -20275,16 +20309,17 @@ var StepperBase = (0, vue.defineComponent)({
20275
20309
  const items = [];
20276
20310
  steps.forEach((item, index) => {
20277
20311
  const itemProps = item.props ?? {};
20312
+ const itemSlots = item.children ?? {};
20278
20313
  const state = props.active === index ? "stepProgress" : props.active > index ? "stepCompleted" : "stepInactive";
20279
20314
  const selectable = typeof props.onStepClick === "function" && (typeof itemProps.allowStepSelect === "boolean" ? itemProps.allowStepSelect : state === "stepCompleted" || props.allowNextStepsSelect);
20280
20315
  items.push((0, vue.cloneVNode)(item, {
20281
- icon: itemProps.icon ?? props.icon ?? (slots.icon ? (payload) => slots.icon(payload) : index + 1),
20316
+ icon: itemSlots.icon ? itemProps.icon : itemProps.icon ?? props.icon ?? (slots.icon ? (payload) => slots.icon(payload) : index + 1),
20282
20317
  step: index,
20283
20318
  state,
20284
20319
  onClick: () => selectable && props.onStepClick?.(index),
20285
20320
  allowStepClick: selectable,
20286
- completedIcon: itemProps.completedIcon ?? props.completedIcon ?? (slots.completedIcon ? (payload) => slots.completedIcon(payload) : void 0),
20287
- progressIcon: itemProps.progressIcon ?? props.progressIcon ?? (slots.progressIcon ? (payload) => slots.progressIcon(payload) : void 0),
20321
+ completedIcon: itemSlots.completedIcon ? itemProps.completedIcon : itemProps.completedIcon ?? props.completedIcon ?? (slots.completedIcon ? (payload) => slots.completedIcon(payload) : void 0),
20322
+ progressIcon: itemSlots.progressIcon ? itemProps.progressIcon : itemProps.progressIcon ?? props.progressIcon ?? (slots.progressIcon ? (payload) => slots.progressIcon(payload) : void 0),
20288
20323
  color: itemProps.color ?? props.color,
20289
20324
  iconSize: props.iconSize,
20290
20325
  iconPosition: itemProps.iconPosition ?? props.iconPosition,
@@ -20740,9 +20775,154 @@ Object.assign(TableOfContents, {
20740
20775
  classes: TableOfContents_module_default,
20741
20776
  varsResolver: varsResolver$14
20742
20777
  });
20743
- var FloatingWindow_module_default = { root: "_root_kejg3_1" };
20778
+ //#endregion
20779
+ //#region src/components/FloatingWindow/FloatingWindow.context.ts
20780
+ var [provideFloatingWindowContext, useFloatingWindowContext] = createSafeContext("FloatingWindow.ResizeHandle must be used within FloatingWindow");
20781
+ //#endregion
20782
+ //#region src/components/FloatingWindow/FloatingWindowResizeHandle.ts
20783
+ var KEYBOARD_STEP = 10;
20784
+ function clampDimension$1(value, min, max, viewportMax) {
20785
+ let result = value;
20786
+ if (min != null) result = Math.max(result, min);
20787
+ if (max != null) result = Math.min(result, max);
20788
+ if (viewportMax != null) result = Math.min(result, viewportMax);
20789
+ return result;
20790
+ }
20791
+ var FloatingWindowResizeHandle = withBoxProps((0, vue.defineComponent)({
20792
+ name: "FloatingWindowResizeHandle",
20793
+ inheritAttrs: false,
20794
+ props: {
20795
+ ariaLabel: {
20796
+ type: String,
20797
+ default: "Resize window"
20798
+ },
20799
+ tabindex: {
20800
+ type: Number,
20801
+ default: 0
20802
+ },
20803
+ onKeydown: Function
20804
+ },
20805
+ setup(props, { attrs, slots }) {
20806
+ const ctx = useFloatingWindowContext();
20807
+ let handle = null;
20808
+ let isResizing = false;
20809
+ let startX = 0;
20810
+ let startY = 0;
20811
+ let startWidth = 0;
20812
+ let startHeight = 0;
20813
+ const hasWidth = () => ctx.dimensions?.initialWidth != null || ctx.dimensions?.minWidth != null || ctx.dimensions?.maxWidth != null;
20814
+ const hasHeight = () => ctx.dimensions?.initialHeight != null || ctx.dimensions?.minHeight != null || ctx.dimensions?.maxHeight != null;
20815
+ const applySize = (width, height) => {
20816
+ const root = ctx.rootRef.value;
20817
+ if (!root || width === null && height === null) return;
20818
+ const rect = root.getBoundingClientRect();
20819
+ const offset = ctx.constrainOffset ?? 0;
20820
+ const maxViewportWidth = ctx.constrainToViewport ? window.innerWidth - rect.left - offset : void 0;
20821
+ const maxViewportHeight = ctx.constrainToViewport ? window.innerHeight - rect.top - offset : void 0;
20822
+ if (width !== null) root.style.width = `${clampDimension$1(width, ctx.dimensions?.minWidth, ctx.dimensions?.maxWidth, maxViewportWidth)}px`;
20823
+ if (height !== null) root.style.height = `${clampDimension$1(height, ctx.dimensions?.minHeight, ctx.dimensions?.maxHeight, maxViewportHeight)}px`;
20824
+ const resized = root.getBoundingClientRect();
20825
+ if (width !== null) handle?.setAttribute("aria-valuenow", String(Math.round(resized.width)));
20826
+ ctx.onSizeChange?.({
20827
+ width: resized.width,
20828
+ height: resized.height
20829
+ });
20830
+ };
20831
+ const end = () => {
20832
+ if (!isResizing) return;
20833
+ isResizing = false;
20834
+ document.body.style.userSelect = "";
20835
+ document.body.style.webkitUserSelect = "";
20836
+ ctx.onResizeEnd?.();
20837
+ document.removeEventListener("mousemove", move);
20838
+ document.removeEventListener("mouseup", end);
20839
+ document.removeEventListener("touchmove", move);
20840
+ document.removeEventListener("touchend", end);
20841
+ document.removeEventListener("touchcancel", end);
20842
+ };
20843
+ const move = (event) => {
20844
+ if (!isResizing) return;
20845
+ event.preventDefault();
20846
+ const point = "touches" in event ? event.touches[0] : event;
20847
+ applySize(hasWidth() ? startWidth + point.clientX - startX : null, hasHeight() ? startHeight + point.clientY - startY : null);
20848
+ };
20849
+ const start = (event) => {
20850
+ if ("button" in event && event.button !== 0) return;
20851
+ event.stopPropagation();
20852
+ event.preventDefault();
20853
+ if (!hasWidth() && !hasHeight()) return;
20854
+ const root = ctx.rootRef.value;
20855
+ if (!root) return;
20856
+ const point = "touches" in event ? event.touches[0] : event;
20857
+ const rect = root.getBoundingClientRect();
20858
+ startX = point.clientX;
20859
+ startY = point.clientY;
20860
+ startWidth = rect.width;
20861
+ startHeight = rect.height;
20862
+ isResizing = true;
20863
+ document.body.style.userSelect = "none";
20864
+ document.body.style.webkitUserSelect = "none";
20865
+ ctx.onResizeStart?.();
20866
+ document.addEventListener("mousemove", move);
20867
+ document.addEventListener("mouseup", end);
20868
+ document.addEventListener("touchmove", move, { passive: false });
20869
+ document.addEventListener("touchend", end);
20870
+ document.addEventListener("touchcancel", end);
20871
+ };
20872
+ const onKeydown = (event) => {
20873
+ props.onKeydown?.(event);
20874
+ if (event.defaultPrevented) return;
20875
+ const root = ctx.rootRef.value;
20876
+ if (!root) return;
20877
+ const rect = root.getBoundingClientRect();
20878
+ let width = null;
20879
+ let height = null;
20880
+ if (event.key === "ArrowRight" && hasWidth()) width = rect.width + KEYBOARD_STEP;
20881
+ else if (event.key === "ArrowLeft" && hasWidth()) width = rect.width - KEYBOARD_STEP;
20882
+ else if (event.key === "ArrowDown" && hasHeight()) height = rect.height + KEYBOARD_STEP;
20883
+ else if (event.key === "ArrowUp" && hasHeight()) height = rect.height - KEYBOARD_STEP;
20884
+ else if (event.key === "Home") {
20885
+ if (hasWidth()) width = ctx.dimensions?.minWidth ?? rect.width;
20886
+ if (hasHeight()) height = ctx.dimensions?.minHeight ?? rect.height;
20887
+ } else if (event.key === "End") {
20888
+ if (hasWidth()) width = ctx.dimensions?.maxWidth ?? rect.width;
20889
+ if (hasHeight()) height = ctx.dimensions?.maxHeight ?? rect.height;
20890
+ }
20891
+ if (width !== null || height !== null) {
20892
+ event.preventDefault();
20893
+ applySize(width, height);
20894
+ }
20895
+ };
20896
+ (0, vue.onMounted)(() => {
20897
+ if (hasWidth() && ctx.dimensions?.initialWidth != null) handle?.setAttribute("aria-valuenow", String(Math.round(clampDimension$1(ctx.dimensions.initialWidth, ctx.dimensions.minWidth, ctx.dimensions.maxWidth, void 0))));
20898
+ });
20899
+ (0, vue.onBeforeUnmount)(end);
20900
+ return () => (0, vue.h)(Box, {
20901
+ ...attrs,
20902
+ ref: (node) => {
20903
+ handle = node?.$el ?? node;
20904
+ },
20905
+ role: "separator",
20906
+ "aria-label": attrs["aria-label"] ?? props.ariaLabel,
20907
+ "aria-valuemin": ctx.dimensions?.minWidth,
20908
+ "aria-valuemax": ctx.dimensions?.maxWidth,
20909
+ tabindex: props.tabindex,
20910
+ style: [{ touchAction: "none" }, attrs.style],
20911
+ onMousedown: start,
20912
+ onTouchstart: start,
20913
+ onKeydown
20914
+ }, () => slots.default?.());
20915
+ }
20916
+ }));
20917
+ var FloatingWindow_module_default = { root: "_root_mstr0_1" };
20744
20918
  //#endregion
20745
20919
  //#region src/components/FloatingWindow/FloatingWindow.ts
20920
+ function clampDimension(value, min, max) {
20921
+ let result = value;
20922
+ if (min != null) result = Math.max(result, min);
20923
+ if (max != null) result = Math.min(result, max);
20924
+ return result;
20925
+ }
20746
20926
  var defaultProps$7 = {
20747
20927
  constrainToViewport: true,
20748
20928
  withinPortal: true,
@@ -20808,6 +20988,22 @@ var FloatingWindow = (0, vue.defineComponent)({
20808
20988
  type: [String, Number],
20809
20989
  default: void 0
20810
20990
  },
20991
+ dimensions: {
20992
+ type: Object,
20993
+ default: void 0
20994
+ },
20995
+ onSizeChange: {
20996
+ type: Function,
20997
+ default: void 0
20998
+ },
20999
+ onResizeStart: {
21000
+ type: Function,
21001
+ default: void 0
21002
+ },
21003
+ onResizeEnd: {
21004
+ type: Function,
21005
+ default: void 0
21006
+ },
20811
21007
  shadow: {
20812
21008
  type: String,
20813
21009
  default: void 0
@@ -20844,6 +21040,7 @@ var FloatingWindow = (0, vue.defineComponent)({
20844
21040
  setup(rawProps, { attrs, slots, expose }) {
20845
21041
  const props = useProps("FloatingWindow", defaultProps$7, rawProps);
20846
21042
  const floating = (0, _mantine_vue_hooks.useFloatingWindow)(props);
21043
+ const rootRef = (0, vue.ref)(null);
20847
21044
  (0, _mantine_vue_hooks.assignRef)(props.setPositionRef, floating.setPosition);
20848
21045
  expose({ setPosition: floating.setPosition });
20849
21046
  const getStyles = useStyles({
@@ -20857,12 +21054,37 @@ var FloatingWindow = (0, vue.defineComponent)({
20857
21054
  vars: props.vars,
20858
21055
  unstyled: props.unstyled
20859
21056
  });
21057
+ provideFloatingWindowContext({
21058
+ rootRef,
21059
+ get dimensions() {
21060
+ return props.dimensions;
21061
+ },
21062
+ get constrainToViewport() {
21063
+ return props.constrainToViewport;
21064
+ },
21065
+ get constrainOffset() {
21066
+ return props.constrainOffset;
21067
+ },
21068
+ get onSizeChange() {
21069
+ return props.onSizeChange;
21070
+ },
21071
+ get onResizeStart() {
21072
+ return props.onResizeStart;
21073
+ },
21074
+ get onResizeEnd() {
21075
+ return props.onResizeEnd;
21076
+ }
21077
+ });
20860
21078
  return () => (0, vue.h)(OptionalPortal, {
20861
21079
  withinPortal: props.withinPortal,
20862
21080
  ...props.portalProps
20863
21081
  }, () => (0, vue.h)(Paper, {
20864
21082
  ...attrs,
20865
- ref: ((value) => floating.ref(value?.$el ?? value)),
21083
+ ref: ((value) => {
21084
+ const node = value?.$el ?? value;
21085
+ rootRef.value = node;
21086
+ floating.ref(node);
21087
+ }),
20866
21088
  shadow: props.shadow,
20867
21089
  radius: props.radius,
20868
21090
  withBorder: props.withBorder,
@@ -20873,13 +21095,20 @@ var FloatingWindow = (0, vue.defineComponent)({
20873
21095
  }),
20874
21096
  style: [
20875
21097
  getStyles("root").style,
20876
- { "--floating-window-z-index": String(props.zIndex) },
21098
+ {
21099
+ "--floating-window-z-index": String(props.zIndex),
21100
+ "--floating-window-width": props.dimensions?.initialWidth == null ? void 0 : `${clampDimension(props.dimensions.initialWidth, props.dimensions.minWidth, props.dimensions.maxWidth)}px`,
21101
+ "--floating-window-height": props.dimensions?.initialHeight == null ? void 0 : `${clampDimension(props.dimensions.initialHeight, props.dimensions.minHeight, props.dimensions.maxHeight)}px`
21102
+ },
20877
21103
  attrs.style
20878
21104
  ]
20879
21105
  }, () => slots.default?.()));
20880
21106
  }
20881
21107
  });
20882
- Object.assign(FloatingWindow, { classes: FloatingWindow_module_default });
21108
+ Object.assign(FloatingWindow, {
21109
+ classes: FloatingWindow_module_default,
21110
+ ResizeHandle: FloatingWindowResizeHandle
21111
+ });
20883
21112
  //#endregion
20884
21113
  //#region src/components/Slider/Slider.context.ts
20885
21114
  var [provideSliderContext, useSliderContext] = createSafeContext("SliderProvider was not found in tree");
@@ -21222,15 +21451,15 @@ var Track = (0, vue.defineComponent)({
21222
21451
  }
21223
21452
  });
21224
21453
  var Slider_module_default = {
21225
- root: "_root_16d42_1",
21226
- label: "_label_16d42_39",
21227
- thumb: "_thumb_16d42_65",
21228
- trackContainer: "_trackContainer_16d42_131",
21229
- track: "_track_16d42_131",
21230
- bar: "_bar_16d42_187",
21231
- markWrapper: "_markWrapper_16d42_215",
21232
- mark: "_mark_16d42_215",
21233
- markLabel: "_markLabel_16d42_257"
21454
+ root: "_root_1osrz_1",
21455
+ label: "_label_1osrz_39",
21456
+ thumb: "_thumb_1osrz_65",
21457
+ trackContainer: "_trackContainer_1osrz_131",
21458
+ track: "_track_1osrz_131",
21459
+ bar: "_bar_1osrz_187",
21460
+ markWrapper: "_markWrapper_1osrz_215",
21461
+ mark: "_mark_1osrz_215",
21462
+ markLabel: "_markLabel_1osrz_257"
21234
21463
  };
21235
21464
  //#endregion
21236
21465
  //#region src/components/Slider/Slider/Slider.ts
@@ -21467,7 +21696,7 @@ var Slider = withBoxProps((0, vue.defineComponent)({
21467
21696
  max: domain.value[1]
21468
21697
  });
21469
21698
  const scaled = props.scale(current.value);
21470
- const label = slots.label ? slots.label({ value: scaled }) : typeof props.label === "function" ? props.label(scaled) : props.label;
21699
+ const label = rawProps.label !== void 0 ? typeof props.label === "function" ? props.label(scaled) : props.label : slots.label?.({ value: scaled }) ?? (typeof props.label === "function" ? props.label(scaled) : props.label);
21471
21700
  const start = typeof props.startPointValue === "number" && !props.inverted ? getPosition$1({
21472
21701
  value: props.startPointValue,
21473
21702
  min: domain.value[0],
@@ -21800,10 +22029,10 @@ var RangeSlider = (0, vue.defineComponent)({
21800
22029
  value: props.scale(current.value[index]),
21801
22030
  position: positions[index],
21802
22031
  dragging: move.active.value && activeThumb.value === index,
21803
- label: slots.label ? slots.label({
22032
+ label: rawProps.label !== void 0 ? typeof props.label === "function" ? props.label(props.scale(current.value[index])) : props.label : slots.label?.({
21804
22033
  value: props.scale(current.value[index]),
21805
22034
  index
21806
- }) : typeof props.label === "function" ? props.label(props.scale(current.value[index])) : props.label,
22035
+ }) ?? (typeof props.label === "function" ? props.label(props.scale(current.value[index])) : props.label),
21807
22036
  labelAlwaysOn: props.labelAlwaysOn,
21808
22037
  thumbLabel: props.thumbLabel?.[index],
21809
22038
  thumbValueText: props.thumbValueText,
@@ -21814,7 +22043,7 @@ var RangeSlider = (0, vue.defineComponent)({
21814
22043
  onMousedown: () => activeThumb.value = index,
21815
22044
  onFocus: () => focused.value = index,
21816
22045
  onKeydown: (event) => keydown(index, event)
21817
- }, () => slots.thumbChildren ? slots.thumbChildren({ index }) : props.thumbChildren?.[index])) }), props.name ? [(0, vue.h)("input", {
22046
+ }, () => props.thumbChildren !== void 0 ? props.thumbChildren[index] : slots.thumbChildren?.({ index }))) }), props.name ? [(0, vue.h)("input", {
21818
22047
  type: "hidden",
21819
22048
  name: `${props.name}_from`,
21820
22049
  value: current.value[0],
@@ -24090,6 +24319,7 @@ function flattenChildren$1(children) {
24090
24319
  var SplitterBase = (0, vue.defineComponent)({
24091
24320
  name: "Splitter",
24092
24321
  inheritAttrs: false,
24322
+ slots: Object,
24093
24323
  props: {
24094
24324
  orientation: {
24095
24325
  type: String,
@@ -24236,7 +24466,7 @@ var SplitterBase = (0, vue.defineComponent)({
24236
24466
  ...getStyles("thumb"),
24237
24467
  "data-orientation": props.orientation,
24238
24468
  "data-active": splitter.activeHandle === handleIndex || void 0
24239
- }, [props.handleIcon !== void 0 ? props.handleIcon : (0, vue.h)(props.orientation === "vertical" ? GripHorizontalIcon : GripVerticalIcon)]) : void 0));
24469
+ }, [props.handleIcon !== void 0 || slots.handleIcon ? resolveNode(props.handleIcon, slots.handleIcon) : (0, vue.h)(props.orientation === "vertical" ? GripHorizontalIcon : GripVerticalIcon)]) : void 0));
24240
24470
  }
24241
24471
  items.push((0, vue.cloneVNode)(child, {
24242
24472
  key: `pane-${index}`,
@@ -24496,7 +24726,10 @@ var TreeNode = (0, vue.defineComponent)({
24496
24726
  },
24497
24727
  setup(props) {
24498
24728
  const element = (0, vue.ref)(null);
24499
- const hasChildren = () => Array.isArray(props.node.children) || !!props.node.hasChildren && !Array.isArray(props.node.children);
24729
+ const hasChildren = () => {
24730
+ const hasLoadedChildren = Array.isArray(props.node.children) && props.node.children.length > 0;
24731
+ return hasLoadedChildren || !!props.node.hasChildren && !hasLoadedChildren;
24732
+ };
24500
24733
  const expanded = () => props.controller.expandedState.value[props.node.value] || false;
24501
24734
  const dnd = useTreeNodeDragDrop({
24502
24735
  nodeValue: props.node.value,
@@ -24512,13 +24745,20 @@ var TreeNode = (0, vue.defineComponent)({
24512
24745
  if (event.code === "ArrowRight") {
24513
24746
  event.stopPropagation();
24514
24747
  event.preventDefault();
24515
- if (expanded()) element.value?.querySelector("[role=treeitem]")?.focus();
24516
- else if (hasChildren()) props.controller.expand(props.node.value);
24748
+ if (expanded()) {
24749
+ const nextNode = element.value?.querySelector("[role=treeitem]");
24750
+ nextNode?.setAttribute("data-focus-ring", "true");
24751
+ nextNode?.focus();
24752
+ } else if (hasChildren()) props.controller.expand(props.node.value);
24517
24753
  } else if (event.code === "ArrowLeft") {
24518
24754
  event.stopPropagation();
24519
24755
  event.preventDefault();
24520
24756
  if (expanded() && hasChildren()) props.controller.collapse(props.node.value);
24521
- else if (props.isSubtree) element.value?.parentElement?.closest("[role=treeitem]")?.focus();
24757
+ else if (props.isSubtree) {
24758
+ const parentNode = element.value?.parentElement?.closest("[role=treeitem]");
24759
+ parentNode?.setAttribute("data-focus-ring", "true");
24760
+ parentNode?.focus();
24761
+ }
24522
24762
  } else if (event.code === "ArrowDown" || event.code === "ArrowUp") {
24523
24763
  const root = element.value?.closest("[data-tree-root]");
24524
24764
  if (!root || !element.value) return;
@@ -24527,6 +24767,7 @@ var TreeNode = (0, vue.defineComponent)({
24527
24767
  const nodes = Array.from(root.querySelectorAll("[role=treeitem]")).filter((node) => visible(node, root));
24528
24768
  const index = nodes.indexOf(element.value);
24529
24769
  const next = nodes[event.code === "ArrowDown" ? index + 1 : index - 1];
24770
+ next?.setAttribute("data-focus-ring", "true");
24530
24771
  next?.focus();
24531
24772
  if (event.shiftKey && next) props.controller.setSelectedState(getValuesRange(props.controller.anchorNode.value, next.dataset.value, props.flatValues));
24532
24773
  } else if (event.code === "Space") {
@@ -24611,6 +24852,10 @@ var TreeNode = (0, vue.defineComponent)({
24611
24852
  "data-level": props.level,
24612
24853
  tabindex: props.rootIndex === 0 ? 0 : -1,
24613
24854
  onKeydown,
24855
+ onBlur: (event) => {
24856
+ const currentTarget = event.currentTarget;
24857
+ if (!currentTarget.contains(event.relatedTarget)) currentTarget.removeAttribute("data-focus-ring");
24858
+ },
24614
24859
  ref: element
24615
24860
  }, [
24616
24861
  label,
@@ -24871,12 +25116,12 @@ function useTree(input = {}) {
24871
25116
  };
24872
25117
  }
24873
25118
  var Tree_module_default = {
24874
- root: "_root_42z3r_7",
24875
- subtree: "_subtree_42z3r_13",
24876
- node: "_node_42z3r_18",
24877
- label: "_label_42z3r_26",
24878
- flatLine: "_flatLine_42z3r_125",
24879
- flatLineClosing: "_flatLineClosing_42z3r_151"
25119
+ root: "_root_ea12t_7",
25120
+ subtree: "_subtree_ea12t_13",
25121
+ node: "_node_ea12t_18",
25122
+ label: "_label_ea12t_27",
25123
+ flatLine: "_flatLine_ea12t_126",
25124
+ flatLineClosing: "_flatLineClosing_ea12t_152"
24880
25125
  };
24881
25126
  //#endregion
24882
25127
  //#region src/components/Tree/Tree.ts
@@ -24887,6 +25132,7 @@ var varsResolver$8 = createVarsResolver((_, { levelOffset }) => ({ root: { "--le
24887
25132
  var Tree = withBoxProps((0, vue.defineComponent)({
24888
25133
  name: "Tree",
24889
25134
  inheritAttrs: false,
25135
+ slots: Object,
24890
25136
  props: {
24891
25137
  component: {
24892
25138
  type: [
@@ -25002,7 +25248,7 @@ var Tree = withBoxProps((0, vue.defineComponent)({
25002
25248
  (0, vue.onBeforeUnmount)(() => document.removeEventListener("mousedown", outside));
25003
25249
  return () => {
25004
25250
  const flatValues = getFlatValues(props.data);
25005
- const renderNode = props.renderNode || (slots.node ? (payload) => slots.node?.(payload) : void 0);
25251
+ const renderNode = props.renderNode || (slots.renderNode ? (payload) => slots.renderNode?.(payload) : slots.node ? (payload) => slots.node?.(payload) : void 0);
25006
25252
  const nodes = props.data.map((node, index) => (0, vue.h)(TreeNode, {
25007
25253
  key: node.value,
25008
25254
  node,
@@ -25289,7 +25535,7 @@ function filterTreeData(data, query, filter = defaultTreeNodeFilter) {
25289
25535
  function flattenTo$1(acc, data, state, parent, level, ancestorIsLast) {
25290
25536
  data.forEach((node, index) => {
25291
25537
  const isLast = index === data.length - 1;
25292
- const loaded = Array.isArray(node.children);
25538
+ const loaded = Array.isArray(node.children) && node.children.length > 0;
25293
25539
  const hasChildren = loaded || !!node.hasChildren && !loaded;
25294
25540
  const expanded = state[node.value] || false;
25295
25541
  const linesPath = [];
@@ -25783,6 +26029,10 @@ var ModalRoot = (0, vue.defineComponent)({
25783
26029
  type: Function,
25784
26030
  required: true
25785
26031
  },
26032
+ keepMounted: {
26033
+ type: Boolean,
26034
+ default: false
26035
+ },
25786
26036
  centered: Boolean,
25787
26037
  fullScreen: Boolean,
25788
26038
  radius: [String, Number],
@@ -25845,6 +26095,7 @@ var ModalRoot = (0, vue.defineComponent)({
25845
26095
  ...attrs,
25846
26096
  opened: props.opened,
25847
26097
  onClose: props.onClose,
26098
+ keepMounted: props.keepMounted,
25848
26099
  unstyled: props.unstyled,
25849
26100
  ...getStyles("root"),
25850
26101
  mod: {
@@ -25899,6 +26150,10 @@ var ModalBaseComponent = (0, vue.defineComponent)({
25899
26150
  type: Function,
25900
26151
  required: true
25901
26152
  },
26153
+ keepMounted: {
26154
+ type: Boolean,
26155
+ default: false
26156
+ },
25902
26157
  title: {
25903
26158
  type: null,
25904
26159
  default: void 0
@@ -25921,7 +26176,8 @@ var ModalBaseComponent = (0, vue.defineComponent)({
25921
26176
  return (0, vue.h)(ModalRoot, {
25922
26177
  ...attrs,
25923
26178
  opened: props.opened,
25924
- onClose: props.onClose
26179
+ onClose: props.onClose,
26180
+ keepMounted: props.keepMounted
25925
26181
  }, { default: () => [props.withOverlay && (0, vue.h)(ModalOverlay, props.overlayProps), (0, vue.h)(ModalContent, null, { default: () => [header && (0, vue.h)(ModalHeader, null, { default: () => [hasNode(title) && (0, vue.h)(ModalTitle, null, { default: () => title }), props.withCloseButton && (0, vue.h)(ModalCloseButton, props.closeButtonProps)] }), (0, vue.h)(ModalBody, null, { default: () => slots.default?.() })] })] });
25926
26182
  };
25927
26183
  }
@@ -26046,6 +26302,10 @@ var DrawerRoot = (0, vue.defineComponent)({
26046
26302
  type: Function,
26047
26303
  required: true
26048
26304
  },
26305
+ keepMounted: {
26306
+ type: Boolean,
26307
+ default: false
26308
+ },
26049
26309
  position: {
26050
26310
  type: String,
26051
26311
  default: "left"
@@ -26105,6 +26365,7 @@ var DrawerRoot = (0, vue.defineComponent)({
26105
26365
  ...attrs,
26106
26366
  opened: props.opened,
26107
26367
  onClose: props.onClose,
26368
+ keepMounted: props.keepMounted,
26108
26369
  unstyled: props.unstyled,
26109
26370
  ...getStyles("root"),
26110
26371
  transitionProps: {
@@ -26163,6 +26424,10 @@ var DrawerBaseComponent = (0, vue.defineComponent)({
26163
26424
  type: Function,
26164
26425
  required: true
26165
26426
  },
26427
+ keepMounted: {
26428
+ type: Boolean,
26429
+ default: false
26430
+ },
26166
26431
  title: {
26167
26432
  type: null,
26168
26433
  default: void 0
@@ -26220,6 +26485,7 @@ var DrawerBaseComponent = (0, vue.defineComponent)({
26220
26485
  ...attrs,
26221
26486
  opened: props.opened,
26222
26487
  onClose: props.onClose,
26488
+ keepMounted: props.keepMounted,
26223
26489
  zIndex: resolvedZIndex.value,
26224
26490
  ...stackProps.value
26225
26491
  }, { default: () => [props.withOverlay && (0, vue.h)(DrawerOverlay, {
@@ -26421,7 +26687,7 @@ function useDelayedHover(input) {
26421
26687
  }
26422
26688
  //#endregion
26423
26689
  //#region src/utils/Floating/use-context-menu-handlers.ts
26424
- function call$3(handler, event) {
26690
+ function call$4(handler, event) {
26425
26691
  if (Array.isArray(handler)) handler.forEach((item) => typeof item === "function" && item(event));
26426
26692
  else if (typeof handler === "function") handler(event);
26427
26693
  }
@@ -26473,11 +26739,11 @@ function useContextMenuHandlers(options) {
26473
26739
  });
26474
26740
  return {
26475
26741
  onMousedown: (event) => {
26476
- call$3(options.childProps.onMousedown ?? options.childProps.onMouseDown, event);
26742
+ call$4(options.childProps.onMousedown ?? options.childProps.onMouseDown, event);
26477
26743
  if (!options.disabled && event.button === 2) event.stopPropagation();
26478
26744
  },
26479
26745
  onContextmenu: (event) => {
26480
- call$3(options.childProps.onContextmenu ?? options.childProps.onContextMenu, event);
26746
+ call$4(options.childProps.onContextmenu ?? options.childProps.onContextMenu, event);
26481
26747
  if (options.disabled || event.defaultPrevented) return;
26482
26748
  event.preventDefault();
26483
26749
  if (gestureHandled.value) return;
@@ -26485,19 +26751,19 @@ function useContextMenuHandlers(options) {
26485
26751
  if (touchActive.value) gestureHandled.value = true;
26486
26752
  },
26487
26753
  onTouchstart: (event) => {
26488
- call$3(options.childProps.onTouchstart ?? options.childProps.onTouchStart, event);
26754
+ call$4(options.childProps.onTouchstart ?? options.childProps.onTouchStart, event);
26489
26755
  longPress.onTouchstart?.(event);
26490
26756
  },
26491
26757
  onTouchend: (event) => {
26492
- call$3(options.childProps.onTouchend ?? options.childProps.onTouchEnd, event);
26758
+ call$4(options.childProps.onTouchend ?? options.childProps.onTouchEnd, event);
26493
26759
  longPress.onTouchend?.(event);
26494
26760
  },
26495
26761
  onTouchcancel: (event) => {
26496
- call$3(options.childProps.onTouchcancel ?? options.childProps.onTouchCancel, event);
26762
+ call$4(options.childProps.onTouchcancel ?? options.childProps.onTouchCancel, event);
26497
26763
  longPress.onTouchcancel?.(event);
26498
26764
  },
26499
26765
  onTouchmove: (event) => {
26500
- call$3(options.childProps.onTouchmove ?? options.childProps.onTouchMove, event);
26766
+ call$4(options.childProps.onTouchmove ?? options.childProps.onTouchMove, event);
26501
26767
  longPress.onTouchmove?.(event);
26502
26768
  },
26503
26769
  style: options.disabled ? options.childProps.style : {
@@ -26553,7 +26819,7 @@ function one$3(slots, name) {
26553
26819
  if (children.length !== 1) throw new Error(`${name} component children should be a single element or component that accepts ref`);
26554
26820
  return children[0];
26555
26821
  }
26556
- function call$2(handler, event) {
26822
+ function call$3(handler, event) {
26557
26823
  if (Array.isArray(handler)) handler.forEach((fn) => fn?.(event));
26558
26824
  else handler?.(event);
26559
26825
  }
@@ -26593,7 +26859,7 @@ var PopoverTarget = (0, vue.defineComponent)({
26593
26859
  });
26594
26860
  if (!ctx.controlled) forwarded.onClick = (event) => {
26595
26861
  ctx.onToggle();
26596
- call$2(childProps.onClick, event);
26862
+ call$3(childProps.onClick, event);
26597
26863
  };
26598
26864
  return (0, vue.cloneVNode)(child, forwarded, true);
26599
26865
  };
@@ -26669,7 +26935,7 @@ var PopoverDropdown = (0, vue.defineComponent)({
26669
26935
  "data-position": ctx.placement,
26670
26936
  "data-fixed": ctx.floatingStrategy === "fixed" || void 0,
26671
26937
  onKeydownCapture: (event) => {
26672
- call$2(attrs.onKeydownCapture, event);
26938
+ call$3(attrs.onKeydownCapture, event);
26673
26939
  if (event.key === "Escape" && ctx.closeOnEscape) {
26674
26940
  ctx.onClose();
26675
26941
  ctx.onDismiss?.();
@@ -27505,7 +27771,7 @@ var Tooltip = Object.assign(TooltipBase, {
27505
27771
  var [provideHoverCardContext, useHoverCardContext] = createSafeContext("HoverCard component was not found in the tree");
27506
27772
  //#endregion
27507
27773
  //#region src/components/HoverCard/HoverCardDropdown/HoverCardDropdown.ts
27508
- function call$1(handler, event) {
27774
+ function call$2(handler, event) {
27509
27775
  if (Array.isArray(handler)) handler.forEach((fn) => fn?.(event));
27510
27776
  else handler?.(event);
27511
27777
  }
@@ -27517,11 +27783,11 @@ var HoverCardDropdown = (0, vue.defineComponent)({
27517
27783
  return () => (0, vue.h)(PopoverDropdown, {
27518
27784
  ...attrs,
27519
27785
  onMouseenter: (event) => {
27520
- call$1(attrs.onMouseenter ?? attrs.onMouseEnter, event);
27786
+ call$2(attrs.onMouseenter ?? attrs.onMouseEnter, event);
27521
27787
  ctx.openDropdown();
27522
27788
  },
27523
27789
  onMouseleave: (event) => {
27524
- call$1(attrs.onMouseleave ?? attrs.onMouseLeave, event);
27790
+ call$2(attrs.onMouseleave ?? attrs.onMouseLeave, event);
27525
27791
  ctx.closeDropdown();
27526
27792
  }
27527
27793
  }, slots);
@@ -27724,7 +27990,7 @@ var Menu_module_default = {
27724
27990
  };
27725
27991
  //#endregion
27726
27992
  //#region src/components/Menu/Menu.ts
27727
- function call(handler, event) {
27993
+ function call$1(handler, event) {
27728
27994
  if (Array.isArray(handler)) handler.forEach((fn) => fn?.(event));
27729
27995
  else handler?.(event);
27730
27996
  }
@@ -27845,6 +28111,9 @@ var MenuBase = (0, vue.defineComponent)({
27845
28111
  get hasSearch() {
27846
28112
  return searchCount.value > 0;
27847
28113
  },
28114
+ get withInitialFocusPlaceholder() {
28115
+ return props.withInitialFocusPlaceholder;
28116
+ },
27848
28117
  registerSearch: () => {
27849
28118
  searchCount.value += 1;
27850
28119
  return () => {
@@ -27944,7 +28213,7 @@ var MenuDropdown = (0, vue.defineComponent)({
27944
28213
  onMouseenter: ctx.trigger !== "click" ? ctx.openDropdown : void 0,
27945
28214
  onMouseleave: ctx.trigger !== "click" ? ctx.closeDropdown : void 0,
27946
28215
  onKeydown: (event) => {
27947
- call(attrs.onKeydown, event);
28216
+ call$1(attrs.onKeydown, event);
27948
28217
  if (event.defaultPrevented || ctx.hasSearch) return;
27949
28218
  const root = event.currentTarget;
27950
28219
  const active = document.activeElement;
@@ -27967,7 +28236,13 @@ var MenuDropdown = (0, vue.defineComponent)({
27967
28236
  menuItems(root).find((item) => item.textContent?.trim().toLowerCase().startsWith(query))?.focus();
27968
28237
  }
27969
28238
  }
27970
- }, slots);
28239
+ }, () => [ctx.withInitialFocusPlaceholder && !ctx.hasSearch ? (0, vue.h)("div", {
28240
+ role: "presentation",
28241
+ tabindex: -1,
28242
+ "data-autofocus": true,
28243
+ "data-mantine-stop-propagation": true,
28244
+ style: { outline: 0 }
28245
+ }) : null, slots.default?.()]);
27971
28246
  }
27972
28247
  });
27973
28248
  var MenuItem = (0, vue.defineComponent)({
@@ -28026,7 +28301,7 @@ var MenuItem = (0, vue.defineComponent)({
28026
28301
  }),
28027
28302
  onMousedown: (event) => event.preventDefault(),
28028
28303
  onClick: (event) => {
28029
- call(attrs.onClick, event);
28304
+ call$1(attrs.onClick, event);
28030
28305
  if (!props.disabled && !attrs["data-disabled"] && (props.closeMenuOnClick ?? ctx.closeOnItemClick)) ctx.closeDropdownImmediately();
28031
28306
  }
28032
28307
  }, () => [
@@ -28128,16 +28403,16 @@ var MenuSearch = (0, vue.defineComponent)({
28128
28403
  }
28129
28404
  },
28130
28405
  onInput: (event) => {
28131
- call(attrs.onInput, event);
28132
- call(attrs.onChange, event);
28406
+ call$1(attrs.onInput, event);
28407
+ call$1(attrs.onChange, event);
28133
28408
  clearActive(event.currentTarget.closest("[data-menu-dropdown]"));
28134
28409
  },
28135
28410
  onChange: (event) => {
28136
- call(attrs.onChange, event);
28411
+ call$1(attrs.onChange, event);
28137
28412
  clearActive(event.currentTarget.closest("[data-menu-dropdown]"));
28138
28413
  },
28139
28414
  onKeydown: (event) => {
28140
- call(attrs.onKeydown ?? attrs.onKeyDown, event);
28415
+ call$1(attrs.onKeydown ?? attrs.onKeyDown, event);
28141
28416
  if (event.defaultPrevented) return;
28142
28417
  const root = event.currentTarget.closest("[data-menu-dropdown]");
28143
28418
  const items = menuItems(root);
@@ -28410,13 +28685,13 @@ var MenuSubTarget = (0, vue.defineComponent)({
28410
28685
  const childProps = child.props ?? {};
28411
28686
  return (0, vue.cloneVNode)(child, {
28412
28687
  onClick: (event) => {
28413
- call(childProps.onClick, event);
28688
+ call$1(childProps.onClick, event);
28414
28689
  ctx.toggleDropdown();
28415
28690
  },
28416
28691
  onMouseenter: ctx.openDropdown,
28417
28692
  onMouseleave: ctx.closeDropdown,
28418
28693
  onKeydown: (event) => {
28419
- call(childProps.onKeydown ?? childProps.onKeyDown, event);
28694
+ call$1(childProps.onKeydown ?? childProps.onKeyDown, event);
28420
28695
  if (event.defaultPrevented) return;
28421
28696
  if (event.key === "ArrowRight") {
28422
28697
  event.preventDefault();
@@ -28436,7 +28711,7 @@ var MenuSubDropdown = (0, vue.defineComponent)({
28436
28711
  return () => (0, vue.h)(MenuDropdown, {
28437
28712
  ...attrs,
28438
28713
  onKeydown: (event) => {
28439
- call(attrs.onKeydown, event);
28714
+ call$1(attrs.onKeydown, event);
28440
28715
  if (event.defaultPrevented) return;
28441
28716
  const currentDropdown = event.currentTarget;
28442
28717
  const focused = event.target;
@@ -29918,7 +30193,8 @@ var OptionsDropdown = (0, vue.defineComponent)({
29918
30193
  return () => {
29919
30194
  validateOptions(props.data);
29920
30195
  const renderOption = props.renderOption ?? (slots.renderOption ? (input) => slots.renderOption(input) : void 0);
29921
- const nothingFound = props.nothingFoundMessage ?? (slots.nothingFound ? slots.nothingFound() : void 0);
30196
+ const nothingFoundSlot = slots.nothingFoundMessage ?? slots.nothingFound;
30197
+ const nothingFound = props.nothingFoundMessage ?? (nothingFoundSlot ? nothingFoundSlot() : void 0);
29922
30198
  const data = typeof props.search === "string" ? (props.filter || defaultOptionsFilter)({
29923
30199
  options: props.data,
29924
30200
  search: props.filterOptions ? props.search : "",
@@ -30282,8 +30558,8 @@ var ComboboxPopoverBase = (0, vue.defineComponent)({
30282
30558
  }
30283
30559
  if (props.searchable) handleSearchChange("");
30284
30560
  };
30285
- const resolveRenderOption = () => props.renderOption ?? (slots.option ? (input) => slots.option(input) : void 0);
30286
- const resolveNothingFound = () => resolveNode(props.nothingFoundMessage, slots.nothingFound);
30561
+ const resolveRenderOption = () => props.renderOption ?? (slots.renderOption ?? slots.option ? (input) => (slots.renderOption ?? slots.option)(input) : void 0);
30562
+ const resolveNothingFound = () => resolveNode(props.nothingFoundMessage, slots.nothingFoundMessage ?? slots.nothingFound);
30287
30563
  const renderSearchableDropdown = () => {
30288
30564
  const filteredData = (props.filter || defaultOptionsFilter)({
30289
30565
  options: parsedData.value,
@@ -31135,7 +31411,7 @@ var Select = (0, vue.defineComponent)({
31135
31411
  scrollAreaProps: props.scrollAreaProps
31136
31412
  }, {
31137
31413
  renderOption: slots.renderOption,
31138
- nothingFound: slots.nothingFound
31414
+ nothingFound: slots.nothingFoundMessage ?? slots.nothingFound
31139
31415
  })]), (0, vue.h)(Combobox.HiddenInput, {
31140
31416
  value: current(),
31141
31417
  name: attrs.name,
@@ -31497,12 +31773,13 @@ var MultiSelect = (0, vue.defineComponent)({
31497
31773
  label: String(item)
31498
31774
  };
31499
31775
  const onRemove = () => remove(item);
31500
- return props.renderPill ? props.renderPill({
31776
+ const renderPillInput = {
31501
31777
  option,
31502
31778
  value: item,
31503
31779
  onRemove,
31504
31780
  disabled
31505
- }) : (0, vue.h)(Pill, {
31781
+ };
31782
+ return props.renderPill ? props.renderPill(renderPillInput) : slots.renderPill ? slots.renderPill(renderPillInput) : (0, vue.h)(Pill, {
31506
31783
  key: `${String(item)}-${index}`,
31507
31784
  withRemoveButton: !readOnly && !option.disabled,
31508
31785
  disabled,
@@ -31541,7 +31818,7 @@ var MultiSelect = (0, vue.defineComponent)({
31541
31818
  filter: props.filter,
31542
31819
  limit: props.limit,
31543
31820
  filterOptions: props.searchable,
31544
- hiddenWhenEmpty: props.nothingFoundMessage == null && !slots.nothingFound,
31821
+ hiddenWhenEmpty: props.nothingFoundMessage == null && !slots.nothingFoundMessage && !slots.nothingFound,
31545
31822
  nothingFoundMessage: props.nothingFoundMessage,
31546
31823
  value: values,
31547
31824
  withCheckIcon: props.withCheckIcon,
@@ -31553,7 +31830,7 @@ var MultiSelect = (0, vue.defineComponent)({
31553
31830
  scrollAreaProps: props.scrollAreaProps
31554
31831
  }, {
31555
31832
  renderOption: slots.renderOption,
31556
- nothingFound: slots.nothingFound
31833
+ nothingFound: slots.nothingFoundMessage ?? slots.nothingFound
31557
31834
  })]), (0, vue.h)(Combobox.HiddenInput, {
31558
31835
  value: values,
31559
31836
  valuesDivider: props.hiddenInputValuesDivider,
@@ -31772,17 +32049,17 @@ var TagsInput = (0, vue.defineComponent)({
31772
32049
  rightSection: slots.rightSection,
31773
32050
  default: () => (0, vue.h)(Pill.Group, null, () => [...current.map((item, index) => {
31774
32051
  const onRemove = () => removeAt(index);
31775
- const option = lockup.value[item] ?? {
31776
- value: item,
31777
- label: item,
31778
- disabled: false
31779
- };
31780
- return props.renderPill ? props.renderPill({
31781
- option,
32052
+ const renderPillInput = {
32053
+ option: lockup.value[item] ?? {
32054
+ value: item,
32055
+ label: item,
32056
+ disabled: false
32057
+ },
31782
32058
  value: item,
31783
32059
  onRemove,
31784
32060
  disabled
31785
- }) : (0, vue.h)(Pill, {
32061
+ };
32062
+ return props.renderPill ? props.renderPill(renderPillInput) : slots.renderPill ? slots.renderPill(renderPillInput) : (0, vue.h)(Pill, {
31786
32063
  key: `${item}-${index}`,
31787
32064
  withRemoveButton: !readOnly,
31788
32065
  disabled,
@@ -31833,7 +32110,7 @@ var TagsInput = (0, vue.defineComponent)({
31833
32110
  search: search(),
31834
32111
  filter: props.filter,
31835
32112
  limit: props.limit,
31836
- hiddenWhenEmpty: props.nothingFoundMessage == null && !slots.nothingFound,
32113
+ hiddenWhenEmpty: props.nothingFoundMessage == null && !slots.nothingFoundMessage && !slots.nothingFound,
31837
32114
  nothingFoundMessage: props.nothingFoundMessage,
31838
32115
  withScrollArea: props.withScrollArea,
31839
32116
  maxDropdownHeight: props.maxDropdownHeight,
@@ -31841,7 +32118,7 @@ var TagsInput = (0, vue.defineComponent)({
31841
32118
  scrollAreaProps: props.scrollAreaProps
31842
32119
  }, {
31843
32120
  renderOption: slots.renderOption,
31844
- nothingFound: slots.nothingFound
32121
+ nothingFound: slots.nothingFoundMessage ?? slots.nothingFound
31845
32122
  })]), (0, vue.h)(Combobox.HiddenInput, {
31846
32123
  value: current,
31847
32124
  valuesDivider: props.hiddenInputValuesDivider,
@@ -31903,6 +32180,7 @@ var ColorInput_module_default = {
31903
32180
  var ColorInput = (0, vue.defineComponent)({
31904
32181
  name: "ColorInput",
31905
32182
  inheritAttrs: false,
32183
+ slots: Object,
31906
32184
  props: {
31907
32185
  modelValue: String,
31908
32186
  value: String,
@@ -31997,7 +32275,7 @@ var ColorInput = (0, vue.defineComponent)({
31997
32275
  class: ColorInput_module_default.eyeDropperButton,
31998
32276
  "aria-label": "Pick color from screen",
31999
32277
  onClick: useEyeDropper
32000
- }, () => props.eyeDropperIcon ?? (0, vue.h)(EyeDropperIcon, { class: ColorInput_module_default.eyeDropperIcon })) : void 0;
32278
+ }, () => resolveNode(props.eyeDropperIcon, slots.eyeDropperIcon) ?? (0, vue.h)(EyeDropperIcon, { class: ColorInput_module_default.eyeDropperIcon })) : void 0;
32001
32279
  return (0, vue.h)(Popover, {
32002
32280
  position: "bottom-start",
32003
32281
  offset: 5,
@@ -32080,7 +32358,7 @@ function flattenTo(acc, data, expandedSet, parent, level, parentGuides) {
32080
32358
  for (let i = 0; i < data.length; i++) {
32081
32359
  const node = data[i];
32082
32360
  const isLast = i === data.length - 1;
32083
- const hasLoadedChildren = Array.isArray(node.children);
32361
+ const hasLoadedChildren = Array.isArray(node.children) && node.children.length > 0;
32084
32362
  const hasAsyncChildren = !!node.hasChildren && !hasLoadedChildren;
32085
32363
  const hasChildren = hasLoadedChildren || hasAsyncChildren;
32086
32364
  const expanded = expandedSet.has(node.value);
@@ -32193,6 +32471,11 @@ var TreeSelectOption = (0, vue.defineComponent)({
32193
32471
  const paddingInlineStart = BASE_PADDING + (props.level - 1) * LEVEL_OFFSET + (props.withLines && props.level > 1 ? LINE_CONTENT_GAP : 0) + (!props.hasChildren ? OPTION_GAP : 0);
32194
32472
  const isActive = props.selected || props.checked;
32195
32473
  const ariaChecked = props.showCheckbox ? props.indeterminate && !props.checked ? "mixed" : props.checked : void 0;
32474
+ const expand = (event) => {
32475
+ event?.preventDefault();
32476
+ event?.stopPropagation();
32477
+ if (props.hasChildren) props.onToggleExpand?.(props.node.value);
32478
+ };
32196
32479
  const payload = {
32197
32480
  node: props.node,
32198
32481
  level: props.level,
@@ -32200,7 +32483,8 @@ var TreeSelectOption = (0, vue.defineComponent)({
32200
32483
  hasChildren: props.hasChildren,
32201
32484
  selected: props.selected,
32202
32485
  checked: props.checked,
32203
- indeterminate: props.indeterminate
32486
+ indeterminate: props.indeterminate,
32487
+ expand
32204
32488
  };
32205
32489
  const lineElements = props.withLines && props.level > 1 ? [
32206
32490
  ...props.lineGuides.map((show, g) => show ? (0, vue.h)("span", {
@@ -32243,16 +32527,10 @@ var TreeSelectOption = (0, vue.defineComponent)({
32243
32527
  "aria-label": props.expanded ? props.chevronAriaLabels?.collapse ?? "Collapse" : props.chevronAriaLabels?.expand ?? "Expand",
32244
32528
  onMousedown: (event) => event.preventDefault(),
32245
32529
  onClick: (event) => {
32246
- event.preventDefault();
32247
- event.stopPropagation();
32248
- props.onToggleExpand?.(props.node.value);
32530
+ expand(event);
32249
32531
  },
32250
32532
  onKeydown: (event) => {
32251
- if (event.key === "Enter") {
32252
- event.preventDefault();
32253
- event.stopPropagation();
32254
- props.onToggleExpand?.(props.node.value);
32255
- }
32533
+ if (event.key === "Enter") expand(event);
32256
32534
  }
32257
32535
  }, (0, vue.h)(AccordionChevron, { size: "80%" })) : null,
32258
32536
  props.showCheckbox ? (0, vue.h)(CheckboxIndicator, {
@@ -32467,7 +32745,8 @@ var TreeSelect = (0, vue.defineComponent)({
32467
32745
  const multiValues = selectedArray();
32468
32746
  const hasValue = isMulti() ? multiValues.length > 0 : current() != null;
32469
32747
  const canClear = props.clearable && hasValue && !disabled && !readOnly;
32470
- const nothingFound = props.nothingFoundMessage ?? (slots.nothingFound ? slots.nothingFound() : void 0);
32748
+ const nothingFoundSlot = slots.nothingFoundMessage ?? slots.nothingFound;
32749
+ const nothingFound = props.nothingFoundMessage ?? (nothingFoundSlot ? nothingFoundSlot() : void 0);
32471
32750
  const renderNode = props.renderNode ?? (slots.renderNode ? (payload) => slots.renderNode(payload) : void 0);
32472
32751
  const clear = (event) => {
32473
32752
  event.stopPropagation();
@@ -32606,6 +32885,580 @@ Object.assign(TreeSelect, { classes: {
32606
32885
  ...Combobox.classes,
32607
32886
  ...TreeSelect_module_default
32608
32887
  } });
32888
+ var Cascader_module_default = {
32889
+ columnsList: "_columnsList_1xc8g_1",
32890
+ column: "_column_1xc8g_1",
32891
+ columnScroll: "_columnScroll_1xc8g_21",
32892
+ columnsOverflow: "_columnsOverflow_1xc8g_26",
32893
+ columnOption: "_columnOption_1xc8g_78",
32894
+ flatOption: "_flatOption_1xc8g_127",
32895
+ columnOptionLabel: "_columnOptionLabel_1xc8g_134",
32896
+ columnOptionIcon: "_columnOptionIcon_1xc8g_141",
32897
+ columnOptionCheck: "_columnOptionCheck_1xc8g_160",
32898
+ columnEmpty: "_columnEmpty_1xc8g_172"
32899
+ };
32900
+ //#endregion
32901
+ //#region src/components/Cascader/cascader-utils.ts
32902
+ function cascaderOptionHasChildren(option) {
32903
+ return Array.isArray(option.children) && option.children.length > 0;
32904
+ }
32905
+ function getCascaderColumns(data, activePath) {
32906
+ const columns = [data];
32907
+ let level = data;
32908
+ for (let index = 0; index < activePath.length; index++) {
32909
+ const node = level.find((option) => option.value === activePath[index]);
32910
+ if (!node) break;
32911
+ if (cascaderOptionHasChildren(node) && index < activePath.length - 1) {
32912
+ columns.push(node.children);
32913
+ level = node.children;
32914
+ } else break;
32915
+ }
32916
+ return columns;
32917
+ }
32918
+ function getCascaderPathOptions(data, value) {
32919
+ if (!value?.length) return [];
32920
+ const result = [];
32921
+ let level = data;
32922
+ for (const current of value) {
32923
+ const option = level?.find((item) => item.value === current);
32924
+ if (!option) break;
32925
+ result.push(option);
32926
+ level = option.children;
32927
+ }
32928
+ return result;
32929
+ }
32930
+ function flattenCascaderPaths(data) {
32931
+ const result = [];
32932
+ const walk = (nodes, parentPath, parentOptions, parentDisabled) => {
32933
+ nodes.forEach((node) => {
32934
+ const path = [...parentPath, node.value];
32935
+ const options = [...parentOptions, node];
32936
+ const disabled = parentDisabled || !!node.disabled;
32937
+ const leaf = !cascaderOptionHasChildren(node);
32938
+ result.push({
32939
+ path,
32940
+ options,
32941
+ leaf,
32942
+ disabled
32943
+ });
32944
+ if (!leaf) walk(node.children, path, options, disabled);
32945
+ });
32946
+ };
32947
+ walk(data, [], [], false);
32948
+ return result;
32949
+ }
32950
+ //#endregion
32951
+ //#region src/components/Cascader/Cascader.ts
32952
+ var optionLabelToString = (option) => typeof option.label === "string" || typeof option.label === "number" ? String(option.label) : option.value;
32953
+ var pathsEqual = (first, second) => !!first && !!second && first.length === second.length && first.every((item, index) => item === second[index]);
32954
+ var findEnabledIndex = (options, from, direction) => {
32955
+ let index = from + direction;
32956
+ while (index >= 0 && index < options.length) {
32957
+ if (!options[index].disabled) return index;
32958
+ index += direction;
32959
+ }
32960
+ return -1;
32961
+ };
32962
+ var call = (handler, event) => {
32963
+ if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
32964
+ else if (typeof handler === "function") handler(event);
32965
+ };
32966
+ var Cascader = (0, vue.defineComponent)({
32967
+ name: "Cascader",
32968
+ inheritAttrs: false,
32969
+ slots: Object,
32970
+ props: {
32971
+ data: {
32972
+ type: Array,
32973
+ required: true
32974
+ },
32975
+ modelValue: Array,
32976
+ value: Array,
32977
+ defaultValue: Array,
32978
+ onChange: Function,
32979
+ changeOnSelect: Boolean,
32980
+ closeOnSelect: {
32981
+ type: Boolean,
32982
+ default: void 0
32983
+ },
32984
+ allowDeselect: {
32985
+ type: Boolean,
32986
+ default: true
32987
+ },
32988
+ withCheckIcon: {
32989
+ type: Boolean,
32990
+ default: true
32991
+ },
32992
+ checkIconPosition: {
32993
+ type: String,
32994
+ default: "right"
32995
+ },
32996
+ withColumns: {
32997
+ type: Boolean,
32998
+ default: true
32999
+ },
33000
+ expandTrigger: {
33001
+ type: String,
33002
+ default: "click"
33003
+ },
33004
+ searchable: Boolean,
33005
+ searchValue: String,
33006
+ defaultSearchValue: String,
33007
+ onSearchChange: Function,
33008
+ filter: Function,
33009
+ renderSearchOption: Function,
33010
+ formatValue: Function,
33011
+ renderOption: Function,
33012
+ separator: {
33013
+ type: null,
33014
+ default: void 0
33015
+ },
33016
+ columnWidth: {
33017
+ type: [Number, String],
33018
+ default: 200
33019
+ },
33020
+ maxDisplayedLevels: {
33021
+ type: Number,
33022
+ default: 3
33023
+ },
33024
+ previousLevelsControlLabel: {
33025
+ type: String,
33026
+ default: "Show previous levels"
33027
+ },
33028
+ nextLevelsControlLabel: {
33029
+ type: String,
33030
+ default: "Show next levels"
33031
+ },
33032
+ maxDropdownHeight: {
33033
+ type: [Number, String],
33034
+ default: 260
33035
+ },
33036
+ nothingFoundMessage: {
33037
+ type: null,
33038
+ default: void 0
33039
+ },
33040
+ clearable: Boolean,
33041
+ clearSectionMode: {
33042
+ type: String,
33043
+ default: "both"
33044
+ },
33045
+ clearButtonProps: Object,
33046
+ onClear: Function,
33047
+ dropdownOpened: {
33048
+ type: Boolean,
33049
+ default: void 0
33050
+ },
33051
+ defaultDropdownOpened: Boolean,
33052
+ onDropdownOpen: Function,
33053
+ onDropdownClose: Function,
33054
+ comboboxProps: Object,
33055
+ scrollAreaProps: Object,
33056
+ chevronColor: String,
33057
+ hiddenInputProps: Object,
33058
+ openOnFocus: {
33059
+ type: Boolean,
33060
+ default: true
33061
+ },
33062
+ readOnly: Boolean,
33063
+ disabled: Boolean,
33064
+ size: {
33065
+ type: [String, Number],
33066
+ default: "sm"
33067
+ },
33068
+ classNames: [Object, Function],
33069
+ styles: [Object, Function],
33070
+ unstyled: Boolean
33071
+ },
33072
+ emits: ["update:modelValue", "update:searchValue"],
33073
+ setup(props, { attrs, emit, slots }) {
33074
+ const id = (0, _mantine_vue_hooks.useId)(attrs.id);
33075
+ const internalValue = (0, vue.ref)(props.defaultValue ?? null);
33076
+ const currentValue = (0, vue.computed)(() => props.modelValue ?? props.value ?? internalValue.value);
33077
+ const pathOptions = (0, vue.computed)(() => getCascaderPathOptions(props.data, currentValue.value));
33078
+ const separatorString = (0, vue.computed)(() => typeof props.separator === "string" || typeof props.separator === "number" ? String(props.separator) : "/");
33079
+ const separatorContent = () => resolveNode(props.separator, slots.separator) ?? "/";
33080
+ const nothingFoundContent = () => resolveNode(props.nothingFoundMessage, slots.nothingFoundMessage ?? slots.nothingFound);
33081
+ const displayString = (0, vue.computed)(() => {
33082
+ if (!currentValue.value || pathOptions.value.length === 0) return "";
33083
+ const formatted = props.formatValue?.({
33084
+ value: currentValue.value,
33085
+ options: pathOptions.value
33086
+ });
33087
+ if (typeof formatted === "string" || typeof formatted === "number") return String(formatted);
33088
+ return pathOptions.value.map(optionLabelToString).join(` ${separatorString.value} `);
33089
+ });
33090
+ const internalSearch = (0, vue.ref)(props.defaultSearchValue ?? (props.searchable && props.defaultValue ? getCascaderPathOptions(props.data, props.defaultValue).map(optionLabelToString).join(` ${separatorString.value} `) : ""));
33091
+ const search = (0, vue.computed)(() => props.searchValue ?? internalSearch.value);
33092
+ const activePath = (0, vue.ref)(currentValue.value ? [...currentValue.value] : []);
33093
+ const keyboardNav = (0, vue.ref)(false);
33094
+ const windowOffset = (0, vue.ref)(0);
33095
+ const canInteract = (0, vue.computed)(() => !props.readOnly && !props.disabled);
33096
+ const shouldCloseOnSelect = (0, vue.computed)(() => props.closeOnSelect ?? !props.allowDeselect);
33097
+ const setSearch = (value) => {
33098
+ if (props.searchValue === void 0) internalSearch.value = value;
33099
+ props.onSearchChange?.(value);
33100
+ emit("update:searchValue", value);
33101
+ };
33102
+ const setValue = (value) => {
33103
+ if (props.modelValue === void 0 && props.value === void 0) internalValue.value = value;
33104
+ props.onChange?.(value, getCascaderPathOptions(props.data, value));
33105
+ emit("update:modelValue", value);
33106
+ };
33107
+ const resetActivePath = () => {
33108
+ activePath.value = currentValue.value ? [...currentValue.value] : [];
33109
+ };
33110
+ const combobox = useCombobox({
33111
+ opened: () => props.dropdownOpened,
33112
+ defaultOpened: props.defaultDropdownOpened,
33113
+ onDropdownOpen: () => {
33114
+ props.onDropdownOpen?.();
33115
+ resetActivePath();
33116
+ },
33117
+ onDropdownClose: () => {
33118
+ props.onDropdownClose?.();
33119
+ if (props.searchable) setSearch(currentValue.value ? displayString.value : "");
33120
+ }
33121
+ });
33122
+ (0, vue.watch)(currentValue, (value) => {
33123
+ if (props.searchable) setSearch(value ? displayString.value : "");
33124
+ }, { deep: true });
33125
+ (0, vue.watch)(activePath, () => windowOffset.value = 0, { deep: true });
33126
+ const selectPath = (path) => {
33127
+ setValue(props.allowDeselect && pathsEqual(currentValue.value, path) ? null : path);
33128
+ };
33129
+ const expandOption = (level, option) => {
33130
+ const optionPath = [...activePath.value.slice(0, level), option.value];
33131
+ if (cascaderOptionHasChildren(option)) {
33132
+ const first = findEnabledIndex(option.children, -1, 1);
33133
+ activePath.value = first >= 0 ? [...optionPath, option.children[first].value] : optionPath;
33134
+ } else activePath.value = optionPath;
33135
+ };
33136
+ const finishSelection = () => {
33137
+ if (shouldCloseOnSelect.value) combobox.closeDropdown("mouse");
33138
+ };
33139
+ const handleOptionClick = (level, option) => {
33140
+ if (option.disabled) return;
33141
+ keyboardNav.value = false;
33142
+ const path = [...activePath.value.slice(0, level), option.value];
33143
+ if (cascaderOptionHasChildren(option)) {
33144
+ if (props.changeOnSelect) {
33145
+ selectPath(path);
33146
+ finishSelection();
33147
+ }
33148
+ expandOption(level, option);
33149
+ } else {
33150
+ selectPath(path);
33151
+ finishSelection();
33152
+ }
33153
+ };
33154
+ const handleOptionMouseEnter = (level, option) => {
33155
+ if (option.disabled) return;
33156
+ keyboardNav.value = false;
33157
+ if (props.expandTrigger !== "hover") return;
33158
+ if (cascaderOptionHasChildren(option)) expandOption(level, option);
33159
+ else activePath.value = [...activePath.value.slice(0, level), option.value];
33160
+ };
33161
+ const flatPaths = (0, vue.computed)(() => flattenCascaderPaths(props.data));
33162
+ const isSearching = (0, vue.computed)(() => props.searchable && search.value.trim().length > 0 && search.value !== displayString.value);
33163
+ const showFlatList = (0, vue.computed)(() => isSearching.value || !props.withColumns);
33164
+ const flatListItems = (0, vue.computed)(() => {
33165
+ const base = flatPaths.value.filter((path) => props.changeOnSelect || path.leaf);
33166
+ if (!isSearching.value) return base;
33167
+ return base.filter((path) => props.filter ? props.filter(search.value, path.options) : path.options.map(optionLabelToString).join(` ${separatorString.value} `).toLowerCase().includes(search.value.trim().toLowerCase()));
33168
+ });
33169
+ const renderSearchLabel = (options) => {
33170
+ if (props.renderSearchOption) return props.renderSearchOption(search.value, options);
33171
+ if (slots.renderSearchOption) return slots.renderSearchOption({
33172
+ query: search.value,
33173
+ options
33174
+ });
33175
+ return options.flatMap((option, index) => [index ? (0, vue.h)("span", { "data-cascader-separator": true }, [
33176
+ " ",
33177
+ separatorContent(),
33178
+ " "
33179
+ ]) : null, option.label ?? option.value]);
33180
+ };
33181
+ const renderFlatList = () => (0, vue.h)(Combobox.Options, { "aria-label": typeof attrs.label === "string" ? attrs.label : void 0 }, () => [(0, vue.h)(ScrollArea.Autosize, {
33182
+ mah: props.maxDropdownHeight,
33183
+ type: "scroll",
33184
+ scrollbarSize: "var(--combobox-padding)",
33185
+ offsetScrollbars: "y",
33186
+ ...props.scrollAreaProps
33187
+ }, () => flatListItems.value.map((item, index) => {
33188
+ const selected = pathsEqual(currentValue.value, item.path);
33189
+ return (0, vue.h)(Combobox.Option, {
33190
+ value: index,
33191
+ active: selected,
33192
+ disabled: item.disabled
33193
+ }, () => (0, vue.h)("span", { class: Cascader_module_default.flatOption }, [
33194
+ selected && props.withCheckIcon && props.checkIconPosition === "left" ? (0, vue.h)(CheckIcon, { class: Cascader_module_default.columnOptionCheck }) : null,
33195
+ (0, vue.h)("span", { class: Cascader_module_default.columnOptionLabel }, [renderSearchLabel(item.options)]),
33196
+ selected && props.withCheckIcon && props.checkIconPosition !== "left" ? (0, vue.h)(CheckIcon, { class: Cascader_module_default.columnOptionCheck }) : null
33197
+ ]));
33198
+ })), flatListItems.value.length === 0 && (props.nothingFoundMessage !== void 0 || slots.nothingFoundMessage || slots.nothingFound) ? (0, vue.h)(Combobox.Empty, {}, nothingFoundContent) : null]);
33199
+ const optionId = (level, value) => id.value ? `${id.value}-cascader-list-${level}-${value}` : void 0;
33200
+ const renderColumns = () => {
33201
+ const allColumns = getCascaderColumns(props.data, activePath.value);
33202
+ const totalColumns = allColumns.length;
33203
+ const maxLevels = props.maxDisplayedLevels > 0 ? props.maxDisplayedLevels : totalColumns;
33204
+ const maxOffset = Math.max(0, totalColumns - maxLevels);
33205
+ const clampedOffset = Math.min(windowOffset.value, maxOffset);
33206
+ const windowStart = Math.max(0, maxOffset - clampedOffset);
33207
+ const windowEnd = Math.min(totalColumns, windowStart + maxLevels);
33208
+ const visibleColumns = allColumns.slice(windowStart, windowEnd);
33209
+ const hiddenBefore = windowStart;
33210
+ const hiddenAfter = totalColumns - windowEnd;
33211
+ const focusedLevel = activePath.value.length - 1;
33212
+ const overflowControl = (position) => (0, vue.h)(UnstyledButton, {
33213
+ class: Cascader_module_default.columnsOverflow,
33214
+ "data-position": position,
33215
+ tabindex: -1,
33216
+ "aria-label": position === "start" ? props.previousLevelsControlLabel : props.nextLevelsControlLabel,
33217
+ title: position === "start" ? props.previousLevelsControlLabel : props.nextLevelsControlLabel,
33218
+ onMousedown: (event) => event.preventDefault(),
33219
+ onClick: () => {
33220
+ windowOffset.value = position === "start" ? Math.min(maxOffset, windowOffset.value + 1) : Math.max(0, windowOffset.value - 1);
33221
+ }
33222
+ }, () => (0, vue.h)(AccordionChevron));
33223
+ return (0, vue.h)("div", {
33224
+ class: Cascader_module_default.columnsList,
33225
+ role: "presentation",
33226
+ onMouseleave: () => {
33227
+ if (props.expandTrigger === "hover") resetActivePath();
33228
+ },
33229
+ onMousemove: () => keyboardNav.value = false
33230
+ }, [
33231
+ hiddenBefore > 0 ? overflowControl("start") : null,
33232
+ ...visibleColumns.map((options, index) => {
33233
+ const level = windowStart + index;
33234
+ const isLast = index === visibleColumns.length - 1 && hiddenAfter === 0;
33235
+ return (0, vue.h)("div", {
33236
+ class: Cascader_module_default.column,
33237
+ "data-last": isLast || void 0,
33238
+ style: {
33239
+ width: typeof props.columnWidth === "number" ? `${props.columnWidth}px` : props.columnWidth,
33240
+ minWidth: typeof props.columnWidth === "number" ? `${props.columnWidth}px` : props.columnWidth
33241
+ }
33242
+ }, [(0, vue.h)(ScrollArea.Autosize, {
33243
+ class: Cascader_module_default.columnScroll,
33244
+ mah: props.maxDropdownHeight,
33245
+ type: "scroll",
33246
+ scrollbarSize: "var(--combobox-padding)",
33247
+ role: "listbox",
33248
+ ...props.scrollAreaProps
33249
+ }, () => options.length ? options.map((option) => {
33250
+ const active = activePath.value[level] === option.value;
33251
+ const current = active && level === focusedLevel && keyboardNav.value;
33252
+ const inPath = active && level < focusedLevel;
33253
+ const selected = !!currentValue.value && currentValue.value.length === level + 1 && currentValue.value[level] === option.value;
33254
+ return (0, vue.h)(UnstyledButton, {
33255
+ id: optionId(level, option.value),
33256
+ class: Cascader_module_default.columnOption,
33257
+ role: "option",
33258
+ tabindex: -1,
33259
+ "aria-selected": current || void 0,
33260
+ "aria-disabled": option.disabled || void 0,
33261
+ "data-active": current || void 0,
33262
+ "data-in-path": inPath || void 0,
33263
+ "data-selected": selected || void 0,
33264
+ "data-disabled": option.disabled || void 0,
33265
+ onMousedown: (event) => event.preventDefault(),
33266
+ onClick: () => handleOptionClick(level, option),
33267
+ onMouseenter: () => handleOptionMouseEnter(level, option)
33268
+ }, () => [
33269
+ selected && props.withCheckIcon && props.checkIconPosition === "left" ? (0, vue.h)(CheckIcon, { class: Cascader_module_default.columnOptionCheck }) : null,
33270
+ (0, vue.h)("span", { class: Cascader_module_default.columnOptionLabel }, [props.renderOption ? props.renderOption(option, level) : slots.renderOption?.({
33271
+ option,
33272
+ level
33273
+ }) ?? option.label ?? option.value]),
33274
+ selected && props.withCheckIcon && props.checkIconPosition !== "left" ? (0, vue.h)(CheckIcon, { class: Cascader_module_default.columnOptionCheck }) : null,
33275
+ cascaderOptionHasChildren(option) ? (0, vue.h)("span", { class: Cascader_module_default.columnOptionIcon }, (0, vue.h)(AccordionChevron)) : null
33276
+ ]);
33277
+ }) : (0, vue.h)("div", { class: Cascader_module_default.columnEmpty }, [nothingFoundContent()]))]);
33278
+ }),
33279
+ hiddenAfter > 0 ? overflowControl("end") : null
33280
+ ]);
33281
+ };
33282
+ const handleColumnsKeyDown = (event) => {
33283
+ keyboardNav.value = true;
33284
+ const columns = getCascaderColumns(props.data, activePath.value);
33285
+ const focusedLevel = Math.max(0, activePath.value.length - 1);
33286
+ const currentColumn = columns[focusedLevel] ?? columns[0] ?? [];
33287
+ const focusedIndex = currentColumn.findIndex((item) => item.value === activePath.value[focusedLevel]);
33288
+ const focusedOption = focusedIndex >= 0 ? currentColumn[focusedIndex] : void 0;
33289
+ if (event.key === "ArrowDown") {
33290
+ const next = findEnabledIndex(currentColumn, focusedIndex, 1);
33291
+ if (next >= 0) activePath.value = [...activePath.value.slice(0, focusedLevel), currentColumn[next].value];
33292
+ return true;
33293
+ }
33294
+ if (event.key === "ArrowUp") {
33295
+ const previous = findEnabledIndex(currentColumn, focusedIndex < 0 ? currentColumn.length : focusedIndex, -1);
33296
+ if (previous >= 0) activePath.value = [...activePath.value.slice(0, focusedLevel), currentColumn[previous].value];
33297
+ return true;
33298
+ }
33299
+ if (event.key === "ArrowRight") {
33300
+ if (focusedOption && cascaderOptionHasChildren(focusedOption)) expandOption(focusedLevel, focusedOption);
33301
+ return true;
33302
+ }
33303
+ if (event.key === "ArrowLeft") {
33304
+ if (activePath.value.length > 1) activePath.value = activePath.value.slice(0, -1);
33305
+ return true;
33306
+ }
33307
+ if (event.key === "Enter" && focusedOption) {
33308
+ const path = [...activePath.value.slice(0, focusedLevel), focusedOption.value];
33309
+ if (cascaderOptionHasChildren(focusedOption)) {
33310
+ if (props.changeOnSelect) {
33311
+ selectPath(path);
33312
+ finishSelection();
33313
+ }
33314
+ expandOption(focusedLevel, focusedOption);
33315
+ } else {
33316
+ selectPath(path);
33317
+ finishSelection();
33318
+ }
33319
+ return true;
33320
+ }
33321
+ return false;
33322
+ };
33323
+ const handleKeydown = (event) => {
33324
+ call(attrs.onKeydown, event);
33325
+ if (event.defaultPrevented) return;
33326
+ if (event.key === "Escape") {
33327
+ combobox.closeDropdown("keyboard");
33328
+ return;
33329
+ }
33330
+ if (showFlatList.value || !canInteract.value) return;
33331
+ if (!combobox.dropdownOpened) {
33332
+ if ([
33333
+ "ArrowDown",
33334
+ "ArrowUp",
33335
+ "ArrowRight",
33336
+ "Enter"
33337
+ ].includes(event.key) || !props.searchable && event.key === " ") {
33338
+ event.preventDefault();
33339
+ keyboardNav.value = true;
33340
+ combobox.openDropdown("keyboard");
33341
+ if (!currentValue.value && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
33342
+ const rootIndex = event.key === "ArrowDown" ? findEnabledIndex(props.data, -1, 1) : findEnabledIndex(props.data, props.data.length, -1);
33343
+ if (rootIndex >= 0) activePath.value = [props.data[rootIndex].value];
33344
+ }
33345
+ }
33346
+ return;
33347
+ }
33348
+ if (handleColumnsKeyDown(event)) event.preventDefault();
33349
+ else if (!props.searchable && event.key === " ") event.preventDefault();
33350
+ };
33351
+ return () => {
33352
+ const inputAttrs = { ...attrs };
33353
+ delete inputAttrs.name;
33354
+ delete inputAttrs.onKeydown;
33355
+ delete inputAttrs.onFocus;
33356
+ delete inputAttrs.onBlur;
33357
+ delete inputAttrs.onClick;
33358
+ delete inputAttrs.onInput;
33359
+ const clearButton = (0, vue.h)(Combobox.ClearButton, {
33360
+ ...props.clearButtonProps,
33361
+ onMousedown: (event) => event.preventDefault(),
33362
+ onClick: () => {
33363
+ props.onClear?.();
33364
+ setValue(null);
33365
+ activePath.value = [];
33366
+ setSearch("");
33367
+ combobox.focusTarget();
33368
+ }
33369
+ });
33370
+ const hasValue = !!currentValue.value?.length;
33371
+ const listId = id.value ? `${id.value}-cascader-list` : void 0;
33372
+ const focusedLevel = activePath.value.length - 1;
33373
+ const activeDescendant = keyboardNav.value && focusedLevel >= 0 ? optionId(focusedLevel, activePath.value[focusedLevel]) : void 0;
33374
+ return (0, vue.h)("div", { style: { display: "contents" } }, [(0, vue.h)(Combobox, {
33375
+ store: combobox,
33376
+ __staticSelector: "Cascader",
33377
+ classNames: props.classNames,
33378
+ styles: props.styles,
33379
+ unstyled: props.unstyled,
33380
+ readOnly: props.readOnly,
33381
+ size: String(props.size),
33382
+ width: showFlatList.value ? "target" : "max-content",
33383
+ position: "bottom-start",
33384
+ ...props.comboboxProps,
33385
+ onOptionSubmit: (raw) => {
33386
+ const item = flatListItems.value[Number(raw)];
33387
+ if (!item || item.disabled) return;
33388
+ selectPath(item.path);
33389
+ activePath.value = [...item.path];
33390
+ finishSelection();
33391
+ }
33392
+ }, { default: () => [(0, vue.h)(Combobox.Target, {
33393
+ targetType: props.searchable ? "input" : "button",
33394
+ withKeyboardNavigation: showFlatList.value
33395
+ }, () => (0, vue.h)(InputBase, {
33396
+ ...inputAttrs,
33397
+ id: id.value,
33398
+ __staticSelector: "Cascader",
33399
+ size: props.size,
33400
+ classNames: props.classNames,
33401
+ styles: props.styles,
33402
+ unstyled: props.unstyled,
33403
+ disabled: props.disabled,
33404
+ readonly: props.readOnly || !props.searchable,
33405
+ pointer: !props.searchable,
33406
+ value: props.searchable ? search.value : displayString.value,
33407
+ "aria-controls": listId,
33408
+ "aria-activedescendant": activeDescendant,
33409
+ __defaultRightSection: (0, vue.h)(Combobox.Chevron, {
33410
+ size: String(props.size),
33411
+ color: props.chevronColor
33412
+ }),
33413
+ __clearSection: clearButton,
33414
+ __clearable: props.clearable && hasValue && !props.disabled && !props.readOnly,
33415
+ __clearSectionMode: props.clearSectionMode,
33416
+ rightSectionPointerEvents: attrs.rightSectionPointerEvents || "none",
33417
+ onInput: (event) => {
33418
+ setSearch(event.target.value);
33419
+ if (canInteract.value) combobox.openDropdown("keyboard");
33420
+ },
33421
+ onFocus: (event) => {
33422
+ if (props.openOnFocus && props.searchable && canInteract.value) combobox.openDropdown("keyboard");
33423
+ call(attrs.onFocus, event);
33424
+ },
33425
+ onBlur: (event) => {
33426
+ combobox.closeDropdown("unknown");
33427
+ call(attrs.onBlur, event);
33428
+ },
33429
+ onClick: (event) => {
33430
+ if (canInteract.value) {
33431
+ keyboardNav.value = false;
33432
+ if (props.searchable) combobox.openDropdown("mouse");
33433
+ else combobox.toggleDropdown("mouse");
33434
+ }
33435
+ call(attrs.onClick, event);
33436
+ },
33437
+ onKeydown: handleKeydown
33438
+ }, {
33439
+ label: slots.label,
33440
+ description: slots.description,
33441
+ error: slots.error,
33442
+ leftSection: slots.leftSection,
33443
+ rightSection: slots.rightSection
33444
+ })), (0, vue.h)(Combobox.Dropdown, {
33445
+ hidden: props.readOnly || props.disabled,
33446
+ style: showFlatList.value ? void 0 : { padding: 0 }
33447
+ }, () => showFlatList.value ? renderFlatList() : renderColumns())] }), (0, vue.h)(Combobox.HiddenInput, {
33448
+ name: attrs.name,
33449
+ form: attrs.form,
33450
+ disabled: props.disabled,
33451
+ value: currentValue.value,
33452
+ ...props.hiddenInputProps
33453
+ })]);
33454
+ };
33455
+ }
33456
+ });
33457
+ Object.assign(Cascader, { classes: {
33458
+ ...InputBase.classes,
33459
+ ...Combobox.classes,
33460
+ ...Cascader_module_default
33461
+ } });
32609
33462
  //#endregion
32610
33463
  exports.Accordion = Accordion;
32611
33464
  exports.AccordionChevron = AccordionChevron;
@@ -32644,6 +33497,7 @@ exports.ButtonGroup = ButtonGroup;
32644
33497
  exports.ButtonGroupSection = ButtonGroupSection;
32645
33498
  exports.Card = Card;
32646
33499
  exports.CardSection = CardSection;
33500
+ exports.Cascader = Cascader;
32647
33501
  exports.Center = Center;
32648
33502
  exports.CheckIcon = CheckIcon;
32649
33503
  exports.Checkbox = Checkbox;
@@ -32713,6 +33567,7 @@ exports.FlatTreeNode = FlatTreeNode;
32713
33567
  exports.Flex = Flex;
32714
33568
  exports.FloatingIndicator = FloatingIndicator;
32715
33569
  exports.FloatingWindow = FloatingWindow;
33570
+ exports.FloatingWindowResizeHandle = FloatingWindowResizeHandle;
32716
33571
  exports.FocusTrap = FocusTrap;
32717
33572
  exports.FocusTrapInitialFocus = FocusTrapInitialFocus;
32718
33573
  exports.Grid = Grid;
@@ -32896,6 +33751,7 @@ exports.VisuallyHidden = VisuallyHidden;
32896
33751
  exports.alpha = alpha;
32897
33752
  exports.buildValue = buildValue;
32898
33753
  exports.camelToKebabCase = camelToKebabCase;
33754
+ exports.cascaderOptionHasChildren = cascaderOptionHasChildren;
32899
33755
  exports.colorsTuple = colorsTuple;
32900
33756
  exports.convertCssVariables = convertCssVariables;
32901
33757
  exports.convertHsvaTo = convertHsvaTo;
@@ -32918,6 +33774,7 @@ exports.factory = factory;
32918
33774
  exports.filterProps = filterProps;
32919
33775
  exports.filterTreeData = filterTreeData;
32920
33776
  exports.findClosestNumber = findClosestNumber;
33777
+ exports.flattenCascaderPaths = flattenCascaderPaths;
32921
33778
  exports.flattenTreeData = flattenTreeData;
32922
33779
  exports.foldAccents = foldAccents;
32923
33780
  exports.formatNumber = formatNumber;
@@ -32925,6 +33782,8 @@ exports.getAppShellVariables = getVariables;
32925
33782
  exports.getAutoContrastValue = getAutoContrastValue;
32926
33783
  exports.getBaseValue = getBaseValue;
32927
33784
  exports.getBreakpointValue = getBreakpointValue;
33785
+ exports.getCascaderColumns = getCascaderColumns;
33786
+ exports.getCascaderPathOptions = getCascaderPathOptions;
32928
33787
  exports.getContrastColor = getContrastColor;
32929
33788
  exports.getDefaultZIndex = getDefaultZIndex;
32930
33789
  exports.getDigitParts = getDigitParts;