@histoire/controls 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, withScopeId, resolveComponent, createElementBlock, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, renderSlot, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h, toDisplayString, withDirectives, createTextVNode, unref, computed, watch, withModifiers, onUnmounted, isRef, vModelText, renderList, getCurrentScope, onScopeDispose } from "vue";
32
+ import { defineComponent, pushScopeId, popScopeId, nextTick, openBlock, createBlock, createElementBlock, mergeProps, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, createCommentVNode, withCtx, createVNode, ref, createApp, h, toDisplayString, withDirectives, createTextVNode, unref, computed, watch, withModifiers, onUnmounted, isRef, vModelText, renderList, getCurrentScope, onScopeDispose } from "vue";
33
33
  function getBasePlacement(placement) {
34
34
  return placement.split("-")[0];
35
35
  }
@@ -1495,8 +1495,8 @@ var PrivatePopper = () => defineComponent({
1495
1495
  return (_a2 = this[PROVIDE_KEY]) == null ? void 0 : _a2.parentPopper;
1496
1496
  },
1497
1497
  hasPopperShowTriggerHover() {
1498
- var _a2, _b2;
1499
- return ((_a2 = this.popperTriggers) == null ? void 0 : _a2.includes("hover")) || ((_b2 = this.popperShowTriggers) == null ? void 0 : _b2.includes("hover"));
1498
+ var _a2, _b;
1499
+ return ((_a2 = this.popperTriggers) == null ? void 0 : _a2.includes("hover")) || ((_b = this.popperShowTriggers) == null ? void 0 : _b.includes("hover"));
1500
1500
  }
1501
1501
  },
1502
1502
  watch: __spreadValues2(__spreadValues2({
@@ -1561,12 +1561,12 @@ var PrivatePopper = () => defineComponent({
1561
1561
  },
1562
1562
  methods: {
1563
1563
  show({ event = null, skipDelay = false, force = false } = {}) {
1564
- var _a2, _b2;
1564
+ var _a2, _b;
1565
1565
  if (((_a2 = this.parentPopper) == null ? void 0 : _a2.lockedChild) && this.parentPopper.lockedChild !== this)
1566
1566
  return;
1567
1567
  this.$_pendingHide = false;
1568
1568
  if (force || !this.disabled) {
1569
- if (((_b2 = this.parentPopper) == null ? void 0 : _b2.lockedChild) === this) {
1569
+ if (((_b = this.parentPopper) == null ? void 0 : _b.lockedChild) === this) {
1570
1570
  this.parentPopper.lockedChild = null;
1571
1571
  }
1572
1572
  this.$_scheduleShow(event, skipDelay);
@@ -2164,6 +2164,29 @@ function lineIntersectsLine(x1, y1, x2, y2, x3, y3, x4, y4) {
2164
2164
  const uB = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));
2165
2165
  return uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1;
2166
2166
  }
2167
+ var _export_sfc = (sfc, props) => {
2168
+ const target = sfc.__vccOpts || sfc;
2169
+ for (const [key, val] of props) {
2170
+ target[key] = val;
2171
+ }
2172
+ return target;
2173
+ };
2174
+ const _sfc_main$6$1 = {
2175
+ extends: PrivatePopper()
2176
+ };
2177
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
2178
+ return openBlock(), createElementBlock("div", mergeProps({
2179
+ ref: "reference",
2180
+ class: "v-popper"
2181
+ }, _ctx.$attrs, {
2182
+ class: {
2183
+ "v-popper--shown": _ctx.slotData.isShown
2184
+ }
2185
+ }), [
2186
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(_ctx.slotData)))
2187
+ ], 16);
2188
+ }
2189
+ var Popper$1 = /* @__PURE__ */ _export_sfc(_sfc_main$6$1, [["render", _sfc_render$3]]);
2167
2190
  function getInternetExplorerVersion() {
2168
2191
  var ua = window.navigator.userAgent;
2169
2192
  var msie = ua.indexOf("MSIE ");
@@ -2283,13 +2306,6 @@ var PrivateThemeClass = (prop = "theme") => ({
2283
2306
  }
2284
2307
  }
2285
2308
  });
2286
- var _export_sfc = (sfc, props) => {
2287
- const target = sfc.__vccOpts || sfc;
2288
- for (const [key, val] of props) {
2289
- target[key] = val;
2290
- }
2291
- return target;
2292
- };
2293
2309
  const _sfc_main$5$1 = defineComponent({
2294
2310
  name: "VPopperContent",
2295
2311
  components: {
@@ -2327,11 +2343,11 @@ const _hoisted_2$1$1 = {
2327
2343
  ref: "inner",
2328
2344
  class: "v-popper__inner"
2329
2345
  };
2330
- const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-outer" }, null, -1);
2331
- const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-inner" }, null, -1);
2346
+ const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-outer" }, null, -1);
2347
+ const _hoisted_4$5 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-inner" }, null, -1);
2332
2348
  const _hoisted_5$3 = [
2333
- _hoisted_3$5,
2334
- _hoisted_4$3
2349
+ _hoisted_3$6,
2350
+ _hoisted_4$5
2335
2351
  ];
2336
2352
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
2337
2353
  const _component_ResizeObserver = resolveComponent("ResizeObserver");
@@ -2414,14 +2430,13 @@ var PrivatePopperMethods = {
2414
2430
  const _sfc_main$4$1 = defineComponent({
2415
2431
  name: "VPopperWrapper",
2416
2432
  components: {
2417
- Popper: PrivatePopper(),
2433
+ Popper: Popper$1,
2418
2434
  PopperContent: PrivatePopperContent
2419
2435
  },
2420
2436
  mixins: [
2421
2437
  PrivatePopperMethods,
2422
2438
  PrivateThemeClass("finalTheme")
2423
2439
  ],
2424
- inheritAttrs: false,
2425
2440
  props: {
2426
2441
  theme: {
2427
2442
  type: String,
@@ -2432,29 +2447,27 @@ const _sfc_main$4$1 = defineComponent({
2432
2447
  finalTheme() {
2433
2448
  var _a2;
2434
2449
  return (_a2 = this.theme) != null ? _a2 : this.$options.vPopperTheme;
2435
- },
2436
- popperAttrs() {
2437
- const result = __spreadValues2({}, this.$attrs);
2438
- delete result.class;
2439
- delete result.style;
2440
- return result;
2441
2450
  }
2442
2451
  },
2443
2452
  methods: {
2444
2453
  getTargetNodes() {
2445
- return Array.from(this.$refs.reference.children).filter((node) => node !== this.$refs.popperContent.$el);
2454
+ return Array.from(this.$refs.popper.$el.children).filter((node) => node !== this.$refs.popperContent.$el);
2446
2455
  }
2447
2456
  }
2448
2457
  });
2449
2458
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
2450
2459
  const _component_PopperContent = resolveComponent("PopperContent");
2451
2460
  const _component_Popper = resolveComponent("Popper");
2452
- return openBlock(), createBlock(_component_Popper, mergeProps({ ref: "popper" }, _ctx.popperAttrs, {
2461
+ return openBlock(), createBlock(_component_Popper, {
2462
+ ref: "popper",
2453
2463
  theme: _ctx.finalTheme,
2454
2464
  "target-nodes": _ctx.getTargetNodes,
2455
- "reference-node": () => _ctx.$refs.reference,
2456
- "popper-node": () => _ctx.$refs.popperContent.$el
2457
- }), {
2465
+ "reference-node": () => _ctx.$refs.popper.$el,
2466
+ "popper-node": () => _ctx.$refs.popperContent.$el,
2467
+ class: normalizeClass([
2468
+ _ctx.themeClass
2469
+ ])
2470
+ }, {
2458
2471
  default: withCtx(({
2459
2472
  popperId,
2460
2473
  isShown,
@@ -2466,56 +2479,41 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
2466
2479
  handleResize,
2467
2480
  onResize,
2468
2481
  classes,
2469
- result,
2470
- attrs
2482
+ result
2471
2483
  }) => [
2472
- createElementVNode("div", mergeProps({
2473
- ref: "reference",
2474
- class: "v-popper"
2475
- }, attrs, {
2476
- class: [
2477
- _ctx.$attrs.class,
2478
- _ctx.themeClass,
2479
- {
2480
- "v-popper--shown": isShown
2481
- }
2482
- ],
2483
- style: _ctx.$attrs.style
2484
- }), [
2485
- renderSlot(_ctx.$slots, "default", {
2486
- shown: isShown,
2487
- show,
2488
- hide
2489
- }),
2490
- createVNode(_component_PopperContent, {
2491
- ref: "popperContent",
2492
- "popper-id": popperId,
2493
- theme: _ctx.finalTheme,
2494
- shown: isShown,
2495
- mounted: shouldMountContent,
2496
- "skip-transition": skipTransition,
2497
- "auto-hide": autoHide,
2498
- "handle-resize": handleResize,
2499
- classes,
2500
- result,
2501
- onHide: hide,
2502
- onResize
2503
- }, {
2504
- default: withCtx(() => [
2505
- renderSlot(_ctx.$slots, "popper", {
2506
- shown: isShown,
2507
- hide
2508
- })
2509
- ]),
2510
- _: 2
2511
- }, 1032, ["popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
2512
- ], 16)
2484
+ renderSlot(_ctx.$slots, "default", {
2485
+ shown: isShown,
2486
+ show,
2487
+ hide
2488
+ }),
2489
+ createVNode(_component_PopperContent, {
2490
+ ref: "popperContent",
2491
+ "popper-id": popperId,
2492
+ theme: _ctx.finalTheme,
2493
+ shown: isShown,
2494
+ mounted: shouldMountContent,
2495
+ "skip-transition": skipTransition,
2496
+ "auto-hide": autoHide,
2497
+ "handle-resize": handleResize,
2498
+ classes,
2499
+ result,
2500
+ onHide: hide,
2501
+ onResize
2502
+ }, {
2503
+ default: withCtx(() => [
2504
+ renderSlot(_ctx.$slots, "popper", {
2505
+ shown: isShown,
2506
+ hide
2507
+ })
2508
+ ]),
2509
+ _: 2
2510
+ }, 1032, ["popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
2513
2511
  ]),
2514
2512
  _: 3
2515
- }, 16, ["theme", "target-nodes", "reference-node", "popper-node"]);
2513
+ }, 8, ["theme", "target-nodes", "reference-node", "popper-node", "class"]);
2516
2514
  }
2517
2515
  var PrivatePopperWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["render", _sfc_render$1]]);
2518
- defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
2516
+ const _sfc_main$3$1 = defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
2519
2517
  name: "VDropdown",
2520
2518
  vPopperTheme: "dropdown"
2521
2519
  }));
@@ -2527,7 +2525,7 @@ defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
2527
2525
  name: "VTooltip",
2528
2526
  vPopperTheme: "tooltip"
2529
2527
  }));
2530
- const _sfc_main$a = defineComponent({
2528
+ const _sfc_main$b = defineComponent({
2531
2529
  name: "VTooltipDirective",
2532
2530
  components: {
2533
2531
  Popper: PrivatePopper(),
@@ -2673,7 +2671,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2673
2671
  _: 1
2674
2672
  }, 16, ["theme", "popper-node", "onApplyShow", "onApplyHide"]);
2675
2673
  }
2676
- var PrivateTooltipDirective = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render]]);
2674
+ var PrivateTooltipDirective = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render]]);
2677
2675
  const TARGET_CLASS = "v-popper--has-tooltip";
2678
2676
  function getPlacement(options2, modifiers) {
2679
2677
  let result = options2.placement;
@@ -2798,13 +2796,15 @@ var PrivateVTooltip = {
2798
2796
  }
2799
2797
  };
2800
2798
  const VTooltip = PrivateVTooltip;
2799
+ const Dropdown = _sfc_main$3$1;
2801
2800
  const _hoisted_1$7 = { class: "htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap" };
2802
2801
  const _hoisted_2$5 = { class: "htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0" };
2803
- const _hoisted_3$4 = { class: "htw-block htw-grow" };
2804
- const __default__$9 = {
2802
+ const _hoisted_3$5 = { class: "htw-grow htw-flex htw-items-center htw-gap-1" };
2803
+ const _hoisted_4$4 = { class: "htw-block htw-grow" };
2804
+ const __default__$a = {
2805
2805
  name: "HstWrapper"
2806
2806
  };
2807
- const _sfc_main$9 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$9), {
2807
+ const _sfc_main$a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$a), {
2808
2808
  props: {
2809
2809
  title: null
2810
2810
  },
@@ -2820,8 +2820,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2820
2820
  distance: 12
2821
2821
  }]
2822
2822
  ]),
2823
- createElementVNode("span", _hoisted_3$4, [
2824
- renderSlot(_ctx.$slots, "default")
2823
+ createElementVNode("span", _hoisted_3$5, [
2824
+ createElementVNode("span", _hoisted_4$4, [
2825
+ renderSlot(_ctx.$slots, "default")
2826
+ ]),
2827
+ renderSlot(_ctx.$slots, "actions")
2825
2828
  ])
2826
2829
  ]);
2827
2830
  };
@@ -2834,11 +2837,11 @@ const _hoisted_2$4 = {
2834
2837
  viewBox: "0 0 24 24",
2835
2838
  class: "htw-relative htw-z-10"
2836
2839
  };
2837
- const _hoisted_3$3 = ["stroke-dasharray", "stroke-dashoffset"];
2838
- const __default__$8 = {
2840
+ const _hoisted_3$4 = ["stroke-dasharray", "stroke-dashoffset"];
2841
+ const __default__$9 = {
2839
2842
  name: "HstCheckbox"
2840
2843
  };
2841
- const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$8), {
2844
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$9), {
2842
2845
  props: {
2843
2846
  modelValue: { type: Boolean },
2844
2847
  title: null
@@ -2858,11 +2861,11 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2858
2861
  const dashoffset = computed(() => (1 - progress.value) * dasharray.value);
2859
2862
  const animationEnabled = ref(false);
2860
2863
  watch(path, (value) => {
2861
- var _a2, _b2, _c;
2862
- dasharray.value = (_c = (_b2 = (_a2 = path.value).getTotalLength) == null ? void 0 : _b2.call(_a2)) != null ? _c : 21.21;
2864
+ var _a2, _b, _c;
2865
+ dasharray.value = (_c = (_b = (_a2 = path.value).getTotalLength) == null ? void 0 : _b.call(_a2)) != null ? _c : 21.21;
2863
2866
  });
2864
2867
  return (_ctx, _cache) => {
2865
- return openBlock(), createBlock(_sfc_main$9, {
2868
+ return openBlock(), createBlock(_sfc_main$a, {
2866
2869
  role: "checkbox",
2867
2870
  tabindex: "0",
2868
2871
  class: "htw-cursor-pointer htw-items-center",
@@ -2873,6 +2876,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2873
2876
  _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => toggle(), ["prevent"]), ["space"]))
2874
2877
  ]
2875
2878
  }, {
2879
+ actions: withCtx(() => [
2880
+ renderSlot(_ctx.$slots, "actions")
2881
+ ]),
2876
2882
  default: withCtx(() => [
2877
2883
  createElementVNode("div", _hoisted_1$6, [
2878
2884
  createElementVNode("div", {
@@ -2894,20 +2900,20 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2894
2900
  ]]),
2895
2901
  "stroke-dasharray": dasharray.value,
2896
2902
  "stroke-dashoffset": unref(dashoffset)
2897
- }, null, 10, _hoisted_3$3)
2903
+ }, null, 10, _hoisted_3$4)
2898
2904
  ]))
2899
2905
  ])
2900
2906
  ]),
2901
- _: 1
2907
+ _: 3
2902
2908
  }, 8, ["title"]);
2903
2909
  };
2904
2910
  }
2905
2911
  }));
2906
2912
  const _hoisted_1$5 = ["value"];
2907
- const __default__$7 = {
2913
+ const __default__$8 = {
2908
2914
  name: "HstText"
2909
2915
  };
2910
- const _sfc_main$7 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$7), {
2916
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$8), {
2911
2917
  props: {
2912
2918
  title: null,
2913
2919
  modelValue: null
@@ -2918,12 +2924,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2918
2924
  setup(__props, { emit }) {
2919
2925
  const input = ref();
2920
2926
  return (_ctx, _cache) => {
2921
- return openBlock(), createBlock(_sfc_main$9, {
2927
+ return openBlock(), createBlock(_sfc_main$a, {
2922
2928
  title: __props.title,
2923
2929
  class: normalizeClass(["htw-cursor-text htw-items-center", _ctx.$attrs.class]),
2924
2930
  style: normalizeStyle(_ctx.$attrs.style),
2925
2931
  onClick: _cache[1] || (_cache[1] = ($event) => input.value.focus())
2926
2932
  }, {
2933
+ actions: withCtx(() => [
2934
+ renderSlot(_ctx.$slots, "actions")
2935
+ ]),
2927
2936
  default: withCtx(() => [
2928
2937
  createElementVNode("input", mergeProps({
2929
2938
  ref_key: "input",
@@ -2935,16 +2944,16 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2935
2944
  onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value))
2936
2945
  }), null, 16, _hoisted_1$5)
2937
2946
  ]),
2938
- _: 1
2947
+ _: 3
2939
2948
  }, 8, ["title", "class", "style"]);
2940
2949
  };
2941
2950
  }
2942
2951
  }));
2943
- const __default__$6 = {
2952
+ const __default__$7 = {
2944
2953
  name: "HstNumber",
2945
2954
  inheritAttrs: false
2946
2955
  };
2947
- const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$6), {
2956
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$7), {
2948
2957
  props: {
2949
2958
  title: null,
2950
2959
  modelValue: null
@@ -2991,7 +3000,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2991
3000
  stopDragging();
2992
3001
  });
2993
3002
  return (_ctx, _cache) => {
2994
- return openBlock(), createBlock(_sfc_main$9, {
3003
+ return openBlock(), createBlock(_sfc_main$a, {
2995
3004
  class: normalizeClass(["htw-cursor-ew-resize htw-items-center", [
2996
3005
  _ctx.$attrs.class,
2997
3006
  { "htw-select-none": isDragging.value }
@@ -3001,6 +3010,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3001
3010
  onClick: focusAndSelect,
3002
3011
  onMousedown: onMouseDown
3003
3012
  }, {
3013
+ actions: withCtx(() => [
3014
+ renderSlot(_ctx.$slots, "actions")
3015
+ ]),
3004
3016
  default: withCtx(() => [
3005
3017
  withDirectives(createElementVNode("input", mergeProps({
3006
3018
  ref_key: "input",
@@ -3020,17 +3032,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3020
3032
  ]
3021
3033
  ])
3022
3034
  ]),
3023
- _: 1
3035
+ _: 3
3024
3036
  }, 8, ["title", "class", "style"]);
3025
3037
  };
3026
3038
  }
3027
3039
  }));
3028
3040
  const _hoisted_1$4 = ["value"];
3029
- const __default__$5 = {
3041
+ const __default__$6 = {
3030
3042
  name: "HstTextarea",
3031
3043
  inheritAttrs: false
3032
3044
  };
3033
- const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
3045
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$6), {
3034
3046
  props: {
3035
3047
  title: null,
3036
3048
  modelValue: null
@@ -3041,12 +3053,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3041
3053
  setup(__props, { emit }) {
3042
3054
  const input = ref();
3043
3055
  return (_ctx, _cache) => {
3044
- return openBlock(), createBlock(_sfc_main$9, {
3056
+ return openBlock(), createBlock(_sfc_main$a, {
3045
3057
  title: __props.title,
3046
3058
  class: normalizeClass(["htw-cursor-text", _ctx.$attrs.class]),
3047
3059
  style: normalizeStyle(_ctx.$attrs.style),
3048
3060
  onClick: _cache[1] || (_cache[1] = ($event) => input.value.focus())
3049
3061
  }, {
3062
+ actions: withCtx(() => [
3063
+ renderSlot(_ctx.$slots, "actions")
3064
+ ]),
3050
3065
  default: withCtx(() => [
3051
3066
  createElementVNode("textarea", mergeProps({
3052
3067
  ref_key: "input",
@@ -3057,64 +3072,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3057
3072
  onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value))
3058
3073
  }), null, 16, _hoisted_1$4)
3059
3074
  ]),
3060
- _: 1
3061
- }, 8, ["title", "class", "style"]);
3062
- };
3063
- }
3064
- }));
3065
- const _hoisted_1$3 = ["value"];
3066
- const _hoisted_2$3 = ["value"];
3067
- const __default__$4 = {
3068
- name: "HstSelect"
3069
- };
3070
- const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
3071
- props: {
3072
- title: {
3073
- type: String,
3074
- default: ""
3075
- },
3076
- modelValue: {
3077
- type: String,
3078
- default: null
3079
- },
3080
- options: {
3081
- type: Array,
3082
- required: true,
3083
- default: () => []
3084
- }
3085
- },
3086
- emits: {
3087
- "update:modelValue": (newValue) => true
3088
- },
3089
- setup(__props, { emit }) {
3090
- const props = __props;
3091
- const formattedOtions = computed(() => props.options.map((option) => typeof option === "string" ? { label: option, value: option } : option));
3092
- const select = ref();
3093
- return (_ctx, _cache) => {
3094
- return openBlock(), createBlock(_sfc_main$9, {
3095
- title: __props.title,
3096
- class: normalizeClass(["htw-cursor-text htw-items-center", _ctx.$attrs.class]),
3097
- style: normalizeStyle(_ctx.$attrs.style),
3098
- onClick: _cache[1] || (_cache[1] = ($event) => select.value.focus())
3099
- }, {
3100
- default: withCtx(() => [
3101
- createElementVNode("select", {
3102
- ref_key: "select",
3103
- ref: select,
3104
- class: "htw-text-inherit htw-bg-transparent htw-w-full htw-outline-none htw-px-2 htw-py-1 -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 focus:htw-border-primary-500 dark:focus:htw-border-primary-500 htw-rounded-sm",
3105
- value: __props.modelValue,
3106
- onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value))
3107
- }, [
3108
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(formattedOtions), ({ label, value }) => {
3109
- return openBlock(), createElementBlock("option", mergeProps(__spreadProps(__spreadValues({}, _ctx.$attrs), { class: null, style: null }), {
3110
- key: label,
3111
- class: "dark:htw-bg-gray-600",
3112
- value
3113
- }), toDisplayString(label), 17, _hoisted_2$3);
3114
- }), 128))
3115
- ], 40, _hoisted_1$3)
3116
- ]),
3117
- _: 1
3075
+ _: 3
3118
3076
  }, 8, ["title", "class", "style"]);
3119
3077
  };
3120
3078
  }
@@ -3204,7 +3162,7 @@ function mergeIconData(icon, alias) {
3204
3162
  }
3205
3163
  return result;
3206
3164
  }
3207
- function getIconData$1(data, name, full = false) {
3165
+ function getIconData$1(data, name, full) {
3208
3166
  function getIcon(name2, iteration) {
3209
3167
  if (data.icons[name2] !== void 0) {
3210
3168
  return Object.assign({}, data.icons[name2]);
@@ -4046,7 +4004,7 @@ function storeCallback(callback, icons, pendingSources) {
4046
4004
  });
4047
4005
  return abort;
4048
4006
  }
4049
- function listToIcons(list, validate = true, simpleNames2 = false) {
4007
+ function listToIcons(list, validate, simpleNames2 = false) {
4050
4008
  const result = [];
4051
4009
  list.forEach((item) => {
4052
4010
  const icon = typeof item === "string" ? stringToIcon(item, false, simpleNames2) : item;
@@ -4937,6 +4895,105 @@ const Icon = defineComponent({
4937
4895
  return render(icon.data, newProps);
4938
4896
  }
4939
4897
  });
4898
+ var CustomSelect_vue_vue_type_style_index_0_lang = "";
4899
+ const _hoisted_1$3 = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw-h-[27px] -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 hover:htw-border-primary-500 dark:hover:htw-border-primary-500 htw-rounded-sm htw-flex htw-gap-2 htw-items-center htw-leading-normal" };
4900
+ const _hoisted_2$3 = { class: "htw-flex-1 htw-truncate" };
4901
+ const _hoisted_3$3 = { class: "htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700" };
4902
+ const _hoisted_4$3 = ["onClick"];
4903
+ const __default__$5 = {
4904
+ name: "CustomSelect"
4905
+ };
4906
+ const _sfc_main$5 = defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
4907
+ props: {
4908
+ modelValue: null,
4909
+ options: null
4910
+ },
4911
+ emits: ["update:modelValue"],
4912
+ setup(__props, { emit: emits }) {
4913
+ const props = __props;
4914
+ const formattedOptions = computed(() => {
4915
+ if (Array.isArray(props.options)) {
4916
+ return Object.fromEntries(props.options.map((value) => {
4917
+ if (typeof value === "string") {
4918
+ return [value, value];
4919
+ } else {
4920
+ return [value.value, value.label];
4921
+ }
4922
+ }));
4923
+ }
4924
+ return props.options;
4925
+ });
4926
+ const selectedLabel = computed(() => formattedOptions.value[props.modelValue]);
4927
+ function selectValue(value, hide) {
4928
+ emits("update:modelValue", value);
4929
+ hide();
4930
+ }
4931
+ return (_ctx, _cache) => {
4932
+ return openBlock(), createBlock(unref(Dropdown), { "auto-size": "" }, {
4933
+ popper: withCtx(({ hide }) => [
4934
+ createElementVNode("div", _hoisted_3$3, [
4935
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(formattedOptions), (label, value) => {
4936
+ return openBlock(), createElementBlock("div", mergeProps(__spreadProps(__spreadValues({}, _ctx.$attrs), { class: null, style: null }), {
4937
+ key: label,
4938
+ class: ["htw-px-2 htw-py-1 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700", {
4939
+ "htw-bg-primary-200 dark:htw-bg-primary-800": props.modelValue === value
4940
+ }],
4941
+ onClick: ($event) => selectValue(value, hide)
4942
+ }), toDisplayString(label), 17, _hoisted_4$3);
4943
+ }), 128))
4944
+ ])
4945
+ ]),
4946
+ default: withCtx(() => [
4947
+ createElementVNode("div", _hoisted_1$3, [
4948
+ createElementVNode("div", _hoisted_2$3, [
4949
+ renderSlot(_ctx.$slots, "default", { label: unref(selectedLabel) }, () => [
4950
+ createTextVNode(toDisplayString(unref(selectedLabel)), 1)
4951
+ ])
4952
+ ]),
4953
+ createVNode(unref(Icon), {
4954
+ icon: "carbon:chevron-sort",
4955
+ class: "htw-w-4 htw-h-4 htw-flex-none htw-ml-auto"
4956
+ })
4957
+ ])
4958
+ ]),
4959
+ _: 3
4960
+ });
4961
+ };
4962
+ }
4963
+ }));
4964
+ const __default__$4 = {
4965
+ name: "HstSelect"
4966
+ };
4967
+ const _sfc_main$4 = defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
4968
+ props: {
4969
+ title: null,
4970
+ modelValue: null,
4971
+ options: null
4972
+ },
4973
+ emits: ["update:modelValue"],
4974
+ setup(__props, { emit: emits }) {
4975
+ ref();
4976
+ return (_ctx, _cache) => {
4977
+ return openBlock(), createBlock(_sfc_main$a, {
4978
+ title: __props.title,
4979
+ class: normalizeClass(["htw-cursor-text htw-items-center", _ctx.$attrs.class]),
4980
+ style: normalizeStyle(_ctx.$attrs.style)
4981
+ }, {
4982
+ actions: withCtx(() => [
4983
+ renderSlot(_ctx.$slots, "actions")
4984
+ ]),
4985
+ default: withCtx(() => [
4986
+ createVNode(_sfc_main$5, {
4987
+ options: __props.options,
4988
+ "model-value": __props.modelValue,
4989
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emits("update:modelValue", $event))
4990
+ }, null, 8, ["options", "model-value"])
4991
+ ]),
4992
+ _: 3
4993
+ }, 8, ["title", "class", "style"]);
4994
+ };
4995
+ }
4996
+ }));
4940
4997
  function tryOnScopeDispose(fn) {
4941
4998
  if (getCurrentScope()) {
4942
4999
  onScopeDispose(fn);
@@ -4944,10 +5001,12 @@ function tryOnScopeDispose(fn) {
4944
5001
  }
4945
5002
  return false;
4946
5003
  }
5004
+ var _a;
4947
5005
  const isClient = typeof window !== "undefined";
4948
5006
  const isString = (val) => typeof val === "string";
4949
5007
  const noop = () => {
4950
5008
  };
5009
+ isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
4951
5010
  function useTimeoutFn(cb, interval, options = {}) {
4952
5011
  const {
4953
5012
  immediate = true
@@ -5065,8 +5124,6 @@ const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !
5065
5124
  const globalKey = "__vueuse_ssr_handlers__";
5066
5125
  _global[globalKey] = _global[globalKey] || {};
5067
5126
  _global[globalKey];
5068
- var _a, _b;
5069
- isClient && (window == null ? void 0 : window.navigator) && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.platform) && /iP(ad|hone|od)/.test((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.platform);
5070
5127
  const __default__$3 = {
5071
5128
  name: "HstCopyIcon"
5072
5129
  };
@@ -5326,20 +5383,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
5326
5383
  };
5327
5384
  }
5328
5385
  }));
5329
- const HstCheckbox = _sfc_main$8;
5330
- const HstText = _sfc_main$7;
5331
- const HstNumber = _sfc_main$6;
5332
- const HstTextarea = _sfc_main$5;
5386
+ const HstCheckbox = _sfc_main$9;
5387
+ const HstText = _sfc_main$8;
5388
+ const HstNumber = _sfc_main$7;
5389
+ const HstTextarea = _sfc_main$6;
5333
5390
  const HstColorShades = _sfc_main$2;
5334
5391
  const HstTokenList = _sfc_main$1;
5335
5392
  const HstTokenGrid = _sfc_main;
5336
5393
  const HstCopyIcon = _sfc_main$3;
5337
5394
  function registerVueComponents(app) {
5338
- app.component("HstCheckbox", _sfc_main$8);
5339
- app.component("HstText", _sfc_main$7);
5340
- app.component("HstNumber", _sfc_main$6);
5395
+ app.component("HstCheckbox", _sfc_main$9);
5396
+ app.component("HstText", _sfc_main$8);
5397
+ app.component("HstNumber", _sfc_main$7);
5341
5398
  app.component("HstSelect", _sfc_main$4);
5342
- app.component("HstTextarea", _sfc_main$5);
5399
+ app.component("HstTextarea", _sfc_main$6);
5343
5400
  app.component("HstColorShades", _sfc_main$2);
5344
5401
  app.component("HstTokenList", _sfc_main$1);
5345
5402
  app.component("HstTokenGrid", _sfc_main);