@dao-style/core 0.0.1-beta.7 → 0.0.1-beta.8

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.
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, createElementVNode, createBlock, unref, resolveComponent, Fragment, createTextVNode, toDisplayString, ref, inject, watchEffect, mergeProps, provide, toRefs, createVNode, withCtx, watch, Transition, withModifiers, normalizeStyle, withKeys, withDirectives, vShow, getCurrentInstance, onMounted, onBeforeUnmount, Teleport, nextTick, renderList, reactive, vModelText, onUnmounted, h } from "vue";
20
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, createElementVNode, createBlock, unref, resolveComponent, Fragment, createTextVNode, toDisplayString, ref, inject, watchEffect, mergeProps, provide, toRefs, createVNode, withCtx, watch, Transition, withModifiers, normalizeStyle, withDirectives, vShow, withKeys, getCurrentInstance, onMounted, onBeforeUnmount, Teleport, nextTick, renderList, reactive, vModelText, onUnmounted, h } from "vue";
21
21
  import { isArray, isSet, looseIndexOf, looseEqual, isFunction, NOOP } from "@vue/shared";
22
22
  var actionIcon_vue_vue_type_style_index_0_lang = "";
23
23
  var _export_sfc = (sfc, props) => {
@@ -26,7 +26,7 @@ var _export_sfc = (sfc, props) => {
26
26
  }
27
27
  return sfc;
28
28
  };
29
- const _sfc_main$G = defineComponent({
29
+ const _sfc_main$H = defineComponent({
30
30
  name: "DaoActionIcon",
31
31
  props: {
32
32
  name: {
@@ -55,8 +55,8 @@ const _sfc_main$G = defineComponent({
55
55
  };
56
56
  }
57
57
  });
58
- const _hoisted_1$u = ["disabled"];
59
- function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
58
+ const _hoisted_1$v = ["disabled"];
59
+ function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
60
60
  return openBlock(), createElementBlock("button", {
61
61
  class: normalizeClass(["dao-action-icon", `dao-action-icon--type-${_ctx.type}`]),
62
62
  disabled: _ctx.realDisabled,
@@ -68,9 +68,9 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
68
68
  class: normalizeClass(["dao-action-icon__iconfont", _ctx.name])
69
69
  }, null, 2)) : createCommentVNode("", true)
70
70
  ])
71
- ], 10, _hoisted_1$u);
71
+ ], 10, _hoisted_1$v);
72
72
  }
73
- var actionIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$C]]);
73
+ var actionIcon = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$D]]);
74
74
  const BUTTON_TYPES = ["primary", "secondary", "tertiary", "ghost", "danger"];
75
75
  var buttonProps = {
76
76
  type: {
@@ -109,7 +109,7 @@ var buttonProps = {
109
109
  }
110
110
  };
111
111
  var icon_scss_vue_type_style_index_0_src_lang = "";
112
- const _sfc_main$F = defineComponent({
112
+ const _sfc_main$G = defineComponent({
113
113
  name: "DaoIcon",
114
114
  props: {
115
115
  name: {
@@ -122,23 +122,23 @@ const _sfc_main$F = defineComponent({
122
122
  }
123
123
  }
124
124
  });
125
- const _hoisted_1$t = {
125
+ const _hoisted_1$u = {
126
126
  key: 1,
127
- class: "dao-icon"
127
+ class: "dao-icon dao-svg-icon"
128
128
  };
129
- const _hoisted_2$j = ["xlink:href"];
130
- function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
129
+ const _hoisted_2$k = ["xlink:href"];
130
+ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
131
131
  return _ctx.useFont ? (openBlock(), createElementBlock("i", {
132
132
  key: 0,
133
133
  class: normalizeClass(["dao-icon dao-iconfont", _ctx.name])
134
- }, null, 2)) : (openBlock(), createElementBlock("svg", _hoisted_1$t, [
134
+ }, null, 2)) : (openBlock(), createElementBlock("svg", _hoisted_1$u, [
135
135
  createElementVNode("use", {
136
136
  "xlink:href": `#${_ctx.name}`
137
- }, null, 8, _hoisted_2$j)
137
+ }, null, 8, _hoisted_2$k)
138
138
  ]));
139
139
  }
140
- var DaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$B]]);
141
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
140
+ var DaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$C]]);
141
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
142
142
  props: {
143
143
  useFont: {
144
144
  type: Boolean,
@@ -167,10 +167,10 @@ const NO_ICON = Symbol(0);
167
167
  const RIGHT_ICON = Symbol(1);
168
168
  const LEFT_ICON = Symbol(2);
169
169
  const BOTH_ICON = Symbol(3);
170
- const _sfc_main$D = defineComponent({
170
+ const _sfc_main$E = defineComponent({
171
171
  name: "DaoButton",
172
172
  components: {
173
- DaoButtonIcon: _sfc_main$E
173
+ DaoButtonIcon: _sfc_main$F
174
174
  },
175
175
  props: buttonProps,
176
176
  emits: ["click"],
@@ -254,12 +254,12 @@ const _sfc_main$D = defineComponent({
254
254
  };
255
255
  }
256
256
  });
257
- const _hoisted_1$s = ["disabled"];
258
- const _hoisted_2$i = {
257
+ const _hoisted_1$t = ["disabled"];
258
+ const _hoisted_2$j = {
259
259
  key: 1,
260
260
  class: "dao-btn__text"
261
261
  };
262
- function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
262
+ function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
263
263
  const _component_dao_button_icon = resolveComponent("dao-button-icon");
264
264
  return openBlock(), createElementBlock("button", {
265
265
  class: normalizeClass(_ctx.classList),
@@ -272,7 +272,7 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
272
272
  "use-font": _ctx.isIconLeftFont,
273
273
  "icon-name": _ctx.realIconLeft
274
274
  }, null, 8, ["use-font", "icon-name"])) : createCommentVNode("", true),
275
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_2$i, [
275
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_2$j, [
276
276
  renderSlot(_ctx.$slots, "default")
277
277
  ])) : createCommentVNode("", true),
278
278
  _ctx.realIconRight ? (openBlock(), createBlock(_component_dao_button_icon, {
@@ -281,22 +281,22 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
281
281
  "icon-name": _ctx.realIconRight
282
282
  }, null, 8, ["use-font", "icon-name"])) : createCommentVNode("", true)
283
283
  ], 64))
284
- ], 10, _hoisted_1$s);
284
+ ], 10, _hoisted_1$t);
285
285
  }
286
- var DaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$A]]);
286
+ var DaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$B]]);
287
287
  var buttonGroup_vue_vue_type_style_index_0_lang = "";
288
- const _sfc_main$C = defineComponent({
288
+ const _sfc_main$D = defineComponent({
289
289
  name: "DaoButtonGroup"
290
290
  });
291
- const _hoisted_1$r = { class: "dao-btn-group" };
292
- function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
293
- return openBlock(), createElementBlock("div", _hoisted_1$r, [
291
+ const _hoisted_1$s = { class: "dao-btn-group" };
292
+ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
293
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [
294
294
  renderSlot(_ctx.$slots, "default")
295
295
  ]);
296
296
  }
297
- var buttonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$z]]);
297
+ var buttonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$A]]);
298
298
  var card_scss_vue_type_style_index_0_src_lang = "";
299
- const _sfc_main$B = defineComponent({
299
+ const _sfc_main$C = defineComponent({
300
300
  name: "DaoCard",
301
301
  components: {
302
302
  DaoIcon
@@ -324,25 +324,25 @@ const _sfc_main$B = defineComponent({
324
324
  }
325
325
  }
326
326
  });
327
- const _hoisted_1$q = {
327
+ const _hoisted_1$r = {
328
328
  key: 0,
329
329
  class: "dao-card-header"
330
330
  };
331
- const _hoisted_2$h = {
331
+ const _hoisted_2$i = {
332
332
  key: 0,
333
333
  class: "dao-card-header-item"
334
334
  };
335
- const _hoisted_3$b = { class: "dao-card-header-item dao-card-header-title" };
336
- const _hoisted_4$a = { class: "dao-card-header-item dao-card-header-action" };
337
- function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
335
+ const _hoisted_3$c = { class: "dao-card-header-item dao-card-header-title" };
336
+ const _hoisted_4$b = { class: "dao-card-header-item dao-card-header-action" };
337
+ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
338
338
  const _component_dao_icon = resolveComponent("dao-icon");
339
339
  return openBlock(), createElementBlock("div", {
340
340
  class: normalizeClass(["dao-card", `dao-card--${_ctx.type}`])
341
341
  }, [
342
- _ctx.type !== "headless" ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
342
+ _ctx.type !== "headless" ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
343
343
  renderSlot(_ctx.$slots, "header", {}, () => [
344
344
  renderSlot(_ctx.$slots, "header-prefix"),
345
- _ctx.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
345
+ _ctx.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$i, [
346
346
  renderSlot(_ctx.$slots, "icon", {}, () => [
347
347
  _ctx.icon ? (openBlock(), createBlock(_component_dao_icon, {
348
348
  key: 0,
@@ -352,12 +352,12 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
352
352
  }, null, 8, ["name", "use-font"])) : createCommentVNode("", true)
353
353
  ])
354
354
  ])) : createCommentVNode("", true),
355
- createElementVNode("div", _hoisted_3$b, [
355
+ createElementVNode("div", _hoisted_3$c, [
356
356
  renderSlot(_ctx.$slots, "title", {}, () => [
357
357
  createTextVNode(toDisplayString(_ctx.title), 1)
358
358
  ])
359
359
  ]),
360
- createElementVNode("div", _hoisted_4$a, [
360
+ createElementVNode("div", _hoisted_4$b, [
361
361
  renderSlot(_ctx.$slots, "action")
362
362
  ]),
363
363
  renderSlot(_ctx.$slots, "header-suffix")
@@ -379,18 +379,18 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
379
379
  ], 2)
380
380
  ], 2);
381
381
  }
382
- var card = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$y]]);
382
+ var card = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$z]]);
383
383
  var cardItem_scss_vue_type_style_index_0_src_lang = "";
384
- const _sfc_main$A = defineComponent({
384
+ const _sfc_main$B = defineComponent({
385
385
  name: "DaoCardItem"
386
386
  });
387
- const _hoisted_1$p = { class: "dao-card-item" };
388
- function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
389
- return openBlock(), createElementBlock("div", _hoisted_1$p, [
387
+ const _hoisted_1$q = { class: "dao-card-item" };
388
+ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
389
+ return openBlock(), createElementBlock("div", _hoisted_1$q, [
390
390
  renderSlot(_ctx.$slots, "default")
391
391
  ]);
392
392
  }
393
- var cardItem = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$x]]);
393
+ var cardItem = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$y]]);
394
394
  function isNullish(val) {
395
395
  return val === null || val === void 0;
396
396
  }
@@ -424,7 +424,7 @@ const navSubKey = Symbol("subNav");
424
424
  const breadcrumbKey = Symbol("breadcrumbKey");
425
425
  var checkbox_vue_vue_type_style_index_0_lang = "";
426
426
  const modelValueAny = [String, Number, Boolean, Symbol, Object, Set, Array];
427
- const _sfc_main$z = defineComponent({
427
+ const _sfc_main$A = defineComponent({
428
428
  name: "DaoCheckbox",
429
429
  props: {
430
430
  modelValue: {
@@ -557,21 +557,21 @@ const _sfc_main$z = defineComponent({
557
557
  }
558
558
  }
559
559
  });
560
- const _hoisted_1$o = ["disabled", "indeterminate", "checked"];
561
- const _hoisted_2$g = /* @__PURE__ */ createElementVNode("span", { class: "dao-checkbox-inner" }, null, -1);
562
- const _hoisted_3$a = {
560
+ const _hoisted_1$p = ["disabled", "indeterminate", "checked"];
561
+ const _hoisted_2$h = /* @__PURE__ */ createElementVNode("span", { class: "dao-checkbox-inner" }, null, -1);
562
+ const _hoisted_3$b = {
563
563
  key: 0,
564
564
  class: "dao-checkbox__label"
565
565
  };
566
- const _hoisted_4$9 = {
566
+ const _hoisted_4$a = {
567
567
  key: 0,
568
568
  class: "dao-checkbox__label-text"
569
569
  };
570
- const _hoisted_5$5 = {
570
+ const _hoisted_5$6 = {
571
571
  key: 1,
572
572
  class: "dao-checkbox__label-helper"
573
573
  };
574
- function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
574
+ function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
575
575
  return openBlock(), createElementBlock("label", {
576
576
  class: normalizeClass(_ctx.wrapClasses)
577
577
  }, [
@@ -586,14 +586,14 @@ function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
586
586
  }, _ctx.$attrs, {
587
587
  checked: _ctx.currentChecked,
588
588
  onChange: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args))
589
- }), null, 16, _hoisted_1$o),
590
- _hoisted_2$g
589
+ }), null, 16, _hoisted_1$p),
590
+ _hoisted_2$h
591
591
  ], 2),
592
- _ctx.hasLabel ? (openBlock(), createElementBlock("span", _hoisted_3$a, [
593
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$9, [
592
+ _ctx.hasLabel ? (openBlock(), createElementBlock("span", _hoisted_3$b, [
593
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$a, [
594
594
  renderSlot(_ctx.$slots, "default")
595
595
  ])) : createCommentVNode("", true),
596
- _ctx.hasHelper ? (openBlock(), createElementBlock("span", _hoisted_5$5, [
596
+ _ctx.hasHelper ? (openBlock(), createElementBlock("span", _hoisted_5$6, [
597
597
  renderSlot(_ctx.$slots, "helper", {}, () => [
598
598
  createTextVNode(toDisplayString(_ctx.helper), 1)
599
599
  ])
@@ -601,9 +601,9 @@ function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
601
601
  ])) : createCommentVNode("", true)
602
602
  ], 2);
603
603
  }
604
- var DaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$w]]);
604
+ var DaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$x]]);
605
605
  var checkboxGroup_vue_vue_type_style_index_0_lang = "";
606
- const _sfc_main$y = defineComponent({
606
+ const _sfc_main$z = defineComponent({
607
607
  name: "DaoCheckboxGroup",
608
608
  props: {
609
609
  modelValue: {
@@ -637,15 +637,15 @@ const _sfc_main$y = defineComponent({
637
637
  };
638
638
  }
639
639
  });
640
- function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
640
+ function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
641
641
  return openBlock(), createElementBlock("div", {
642
642
  class: normalizeClass(_ctx.checkboxGroupClasses)
643
643
  }, [
644
644
  renderSlot(_ctx.$slots, "default")
645
645
  ], 2);
646
646
  }
647
- var checkboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$v]]);
648
- const _sfc_main$x = defineComponent({
647
+ var checkboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$w]]);
648
+ const _sfc_main$y = defineComponent({
649
649
  name: "DaoDialogHeader",
650
650
  components: {
651
651
  DaoButton
@@ -668,10 +668,10 @@ const _sfc_main$x = defineComponent({
668
668
  };
669
669
  }
670
670
  });
671
- const _hoisted_1$n = { class: "dao-dialog-header" };
672
- function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
671
+ const _hoisted_1$o = { class: "dao-dialog-header" };
672
+ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
673
673
  const _component_dao_button = resolveComponent("dao-button");
674
- return openBlock(), createElementBlock("div", _hoisted_1$n, [
674
+ return openBlock(), createElementBlock("div", _hoisted_1$o, [
675
675
  renderSlot(_ctx.$slots, "default", {}, () => [
676
676
  createElementVNode("span", null, [
677
677
  renderSlot(_ctx.$slots, "title", {}, () => [
@@ -688,8 +688,8 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
688
688
  ])
689
689
  ]);
690
690
  }
691
- var DialogHeader = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$u]]);
692
- const _sfc_main$w = defineComponent({
691
+ var DialogHeader = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$v]]);
692
+ const _sfc_main$x = defineComponent({
693
693
  name: "DaoDialogFooter",
694
694
  components: {
695
695
  DaoButton
@@ -725,10 +725,10 @@ const _sfc_main$w = defineComponent({
725
725
  };
726
726
  }
727
727
  });
728
- const _hoisted_1$m = { class: "dao-dialog-footer" };
729
- function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
728
+ const _hoisted_1$n = { class: "dao-dialog-footer" };
729
+ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
730
730
  const _component_dao_button = resolveComponent("dao-button");
731
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
731
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
732
732
  renderSlot(_ctx.$slots, "default", {}, () => [
733
733
  createVNode(_component_dao_button, {
734
734
  type: "ghost",
@@ -753,13 +753,13 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
753
753
  ])
754
754
  ]);
755
755
  }
756
- var DialogFooter = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$t]]);
756
+ var DialogFooter = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$u]]);
757
757
  var dialog_scss_vue_type_style_index_0_src_lang = "";
758
758
  const DIALOG_NUM_ATTR = "dao-dialog-num";
759
759
  const DIALOG_MINIMUM_PADDING = "20px";
760
760
  const DIALOG_DEFAULT_PADDING_TOP = "100px";
761
761
  const DIALOG_DEFAULT_PADDING_BOTTOM = "20px";
762
- const _sfc_main$v = defineComponent({
762
+ const _sfc_main$w = defineComponent({
763
763
  name: "DaoDialog",
764
764
  components: {
765
765
  DialogHeader,
@@ -934,8 +934,8 @@ const _sfc_main$v = defineComponent({
934
934
  };
935
935
  }
936
936
  });
937
- const _hoisted_1$l = { class: "dao-dialog-body" };
938
- function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
937
+ const _hoisted_1$m = { class: "dao-dialog-body" };
938
+ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
939
939
  const _component_dialog_header = resolveComponent("dialog-header");
940
940
  const _component_dialog_footer = resolveComponent("dialog-footer");
941
941
  return openBlock(), createBlock(Transition, {
@@ -970,7 +970,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
970
970
  ]),
971
971
  _: 3
972
972
  }, 8, ["title", "show-close", "onClose"])) : createCommentVNode("", true),
973
- createElementVNode("div", _hoisted_1$l, [
973
+ createElementVNode("div", _hoisted_1$m, [
974
974
  renderSlot(_ctx.$slots, "default")
975
975
  ]),
976
976
  _ctx.footer ? (openBlock(), createBlock(_component_dialog_footer, {
@@ -992,7 +992,279 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
992
992
  _: 3
993
993
  }, 8, ["onBeforeEnter", "onAfterEnter", "onBeforeLeave", "onAfterLeave"]);
994
994
  }
995
- var dialog = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$s]]);
995
+ var dialog = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$t]]);
996
+ const drawerProps = {
997
+ modelValue: {
998
+ type: Boolean,
999
+ default: false
1000
+ },
1001
+ hideHeader: {
1002
+ type: Boolean,
1003
+ default: false
1004
+ },
1005
+ hideFooter: {
1006
+ type: Boolean,
1007
+ default: false
1008
+ },
1009
+ hideMask: {
1010
+ type: Boolean,
1011
+ default: false
1012
+ },
1013
+ hideCloseIcon: {
1014
+ type: Boolean,
1015
+ default: false
1016
+ },
1017
+ title: {
1018
+ type: String,
1019
+ default: ""
1020
+ },
1021
+ size: {
1022
+ type: String,
1023
+ default: "md"
1024
+ },
1025
+ cancelText: {
1026
+ type: String,
1027
+ default: "cancel"
1028
+ },
1029
+ confirmText: {
1030
+ type: String,
1031
+ default: "ok"
1032
+ }
1033
+ };
1034
+ const getFocusElementRange = (elementNode) => {
1035
+ const focusedElementOrigin = document.activeElement;
1036
+ let firstTab = null;
1037
+ let lastTab = null;
1038
+ const focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
1039
+ if (elementNode) {
1040
+ const focusableElements = Array.from(elementNode.querySelectorAll(focusableElementsString));
1041
+ firstTab = focusableElements[0];
1042
+ lastTab = focusableElements[focusableElements.length - 1];
1043
+ firstTab == null ? void 0 : firstTab.focus();
1044
+ }
1045
+ return {
1046
+ lastTab,
1047
+ firstTab,
1048
+ focusedElementOrigin
1049
+ };
1050
+ };
1051
+ const trapTabKey = (e, firstTab, lastTab) => {
1052
+ if (e.code === "Tab") {
1053
+ if (e.shiftKey) {
1054
+ if (document.activeElement === firstTab) {
1055
+ e.preventDefault();
1056
+ lastTab.focus();
1057
+ }
1058
+ } else if (document.activeElement === lastTab) {
1059
+ e.preventDefault();
1060
+ firstTab.focus();
1061
+ }
1062
+ }
1063
+ };
1064
+ var drawer_vue_vue_type_style_index_0_lang = "";
1065
+ const _sfc_main$v = defineComponent({
1066
+ name: "DaoDrawer",
1067
+ components: {
1068
+ DaoButton
1069
+ },
1070
+ props: drawerProps,
1071
+ emits: ["close", "confirm"],
1072
+ setup(props, { emit }) {
1073
+ const { modelValue, size } = toRefs(props);
1074
+ const visible = ref(false);
1075
+ const wrapVisible = ref(false);
1076
+ const drawerRef = ref(null);
1077
+ let focusElement = {
1078
+ firstTab: null,
1079
+ lastTab: null,
1080
+ focusedElementOrigin: null
1081
+ };
1082
+ const wrapClassList = computed(() => [
1083
+ "dao-drawer__wrap",
1084
+ {
1085
+ "dao-drawer__wrap--hide": !wrapVisible.value
1086
+ }
1087
+ ]);
1088
+ const contentClassList = computed(() => [
1089
+ "dao-drawer",
1090
+ `dao-drawer-${size.value}`
1091
+ ]);
1092
+ const checkMasksVisible = () => {
1093
+ const masks = document.getElementsByClassName("dao-drawer__mask") || [];
1094
+ return Array.from(masks).some((v) => v.style.display === "block");
1095
+ };
1096
+ const lockWindowScroll = () => {
1097
+ document.body.style.overflow = "hidden";
1098
+ document.body.tabIndex = -1;
1099
+ };
1100
+ const unLockWindowScroll = () => {
1101
+ if (checkMasksVisible()) {
1102
+ document.body.style.overflow = "";
1103
+ }
1104
+ };
1105
+ const close = () => {
1106
+ visible.value = false;
1107
+ emit("close");
1108
+ };
1109
+ const handleWrapClick = (event) => {
1110
+ const { target } = event;
1111
+ const className = target.getAttribute("class");
1112
+ if (className && className.indexOf("dao-drawer__wrap") > -1) {
1113
+ close();
1114
+ }
1115
+ };
1116
+ const handleWrapVisible = (v) => {
1117
+ if (!v) {
1118
+ setTimeout(() => {
1119
+ wrapVisible.value = v;
1120
+ }, 100);
1121
+ } else {
1122
+ wrapVisible.value = v;
1123
+ }
1124
+ };
1125
+ const confirm = () => {
1126
+ visible.value = false;
1127
+ emit("confirm");
1128
+ };
1129
+ const setLastFocusElement = () => {
1130
+ if (focusElement.focusedElementOrigin instanceof HTMLElement) {
1131
+ focusElement.focusedElementOrigin.focus();
1132
+ }
1133
+ };
1134
+ const onHandleKeyDown = (e) => {
1135
+ if (e.code === "Escape") {
1136
+ close();
1137
+ }
1138
+ if (!focusElement.firstTab || !focusElement.lastTab) {
1139
+ return;
1140
+ }
1141
+ trapTabKey(e, focusElement.firstTab, focusElement.lastTab);
1142
+ };
1143
+ const onBeforeEnter = () => {
1144
+ focusElement = getFocusElementRange(drawerRef.value);
1145
+ lockWindowScroll();
1146
+ document.addEventListener("keydown", onHandleKeyDown);
1147
+ };
1148
+ const onAfterLeave = () => {
1149
+ setLastFocusElement();
1150
+ unLockWindowScroll();
1151
+ document.removeEventListener("keydown", onHandleKeyDown);
1152
+ };
1153
+ watch(modelValue, (v) => {
1154
+ visible.value = v;
1155
+ handleWrapVisible(v);
1156
+ }, { immediate: true });
1157
+ return {
1158
+ visible,
1159
+ drawerRef,
1160
+ wrapClassList,
1161
+ contentClassList,
1162
+ close,
1163
+ confirm,
1164
+ handleWrapClick,
1165
+ onBeforeEnter,
1166
+ onAfterLeave
1167
+ };
1168
+ }
1169
+ });
1170
+ const _hoisted_1$l = { class: "dao-drawer__content" };
1171
+ const _hoisted_2$g = {
1172
+ key: 0,
1173
+ class: "dao-drawer__header"
1174
+ };
1175
+ const _hoisted_3$a = { class: "dao-drawer__header-group" };
1176
+ const _hoisted_4$9 = { class: "dao-drawer__body" };
1177
+ const _hoisted_5$5 = {
1178
+ key: 1,
1179
+ class: "dao-drawer__footer"
1180
+ };
1181
+ const _hoisted_6$3 = { class: "dao-drawer__footer-group" };
1182
+ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
1183
+ const _component_dao_button = resolveComponent("dao-button");
1184
+ return openBlock(), createElementBlock(Fragment, null, [
1185
+ createVNode(Transition, { name: "fade-in" }, {
1186
+ default: withCtx(() => [
1187
+ !_ctx.hideMask ? withDirectives((openBlock(), createElementBlock("div", {
1188
+ key: 0,
1189
+ class: "dao-drawer__mask",
1190
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args)),
1191
+ onKeydown: _cache[1] || (_cache[1] = (...args) => _ctx.close && _ctx.close(...args))
1192
+ }, null, 544)), [
1193
+ [vShow, _ctx.visible]
1194
+ ]) : createCommentVNode("", true)
1195
+ ]),
1196
+ _: 1
1197
+ }),
1198
+ createElementVNode("div", {
1199
+ ref: "drawerRef",
1200
+ class: normalizeClass(_ctx.wrapClassList),
1201
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleWrapClick && _ctx.handleWrapClick(...args)),
1202
+ onKeydown: _cache[3] || (_cache[3] = (...args) => _ctx.handleWrapClick && _ctx.handleWrapClick(...args))
1203
+ }, [
1204
+ createVNode(Transition, {
1205
+ name: "slide-in-right",
1206
+ onAfterEnter: _ctx.onBeforeEnter,
1207
+ onAfterLeave: _ctx.onAfterLeave
1208
+ }, {
1209
+ default: withCtx(() => [
1210
+ withDirectives(createElementVNode("div", {
1211
+ class: normalizeClass(_ctx.contentClassList)
1212
+ }, [
1213
+ createElementVNode("div", _hoisted_1$l, [
1214
+ !_ctx.hideHeader ? (openBlock(), createElementBlock("div", _hoisted_2$g, [
1215
+ renderSlot(_ctx.$slots, "header", {}, () => [
1216
+ createElementVNode("div", _hoisted_3$a, [
1217
+ createElementVNode("span", null, toDisplayString(_ctx.title), 1),
1218
+ !_ctx.hideCloseIcon ? (openBlock(), createBlock(_component_dao_button, {
1219
+ key: 0,
1220
+ size: "sm",
1221
+ type: "ghost",
1222
+ "icon-left": "icon-close",
1223
+ "use-font": "",
1224
+ onClick: _ctx.close
1225
+ }, null, 8, ["onClick"])) : createCommentVNode("", true)
1226
+ ])
1227
+ ])
1228
+ ])) : createCommentVNode("", true),
1229
+ createElementVNode("div", _hoisted_4$9, [
1230
+ renderSlot(_ctx.$slots, "default")
1231
+ ]),
1232
+ !_ctx.hideFooter ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
1233
+ renderSlot(_ctx.$slots, "footer", {}, () => [
1234
+ createElementVNode("div", _hoisted_6$3, [
1235
+ createVNode(_component_dao_button, {
1236
+ type: "ghost",
1237
+ class: "footer-cancel-btn footer-btn",
1238
+ onClick: _ctx.close
1239
+ }, {
1240
+ default: withCtx(() => [
1241
+ createTextVNode(toDisplayString(_ctx.cancelText), 1)
1242
+ ]),
1243
+ _: 1
1244
+ }, 8, ["onClick"]),
1245
+ createVNode(_component_dao_button, {
1246
+ class: "footer-btn",
1247
+ onClick: _ctx.confirm
1248
+ }, {
1249
+ default: withCtx(() => [
1250
+ createTextVNode(toDisplayString(_ctx.confirmText), 1)
1251
+ ]),
1252
+ _: 1
1253
+ }, 8, ["onClick"])
1254
+ ])
1255
+ ])
1256
+ ])) : createCommentVNode("", true)
1257
+ ])
1258
+ ], 2), [
1259
+ [vShow, _ctx.visible]
1260
+ ])
1261
+ ]),
1262
+ _: 3
1263
+ }, 8, ["onAfterEnter", "onAfterLeave"])
1264
+ ], 34)
1265
+ ], 64);
1266
+ }
1267
+ var drawer = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$s]]);
996
1268
  var top = "top";
997
1269
  var bottom = "bottom";
998
1270
  var right = "right";
@@ -6005,6 +6277,7 @@ var components = /* @__PURE__ */ Object.freeze({
6005
6277
  Dialog: dialog,
6006
6278
  DialogFooter,
6007
6279
  DialogHeader,
6280
+ Drawer: drawer,
6008
6281
  Dropdown: dropdown,
6009
6282
  DropdownMenu: dropdownMenu,
6010
6283
  DropdownItem: dropdownItem,
@@ -6042,15 +6315,10 @@ const plugin = (app) => {
6042
6315
  app.component(c.name, c);
6043
6316
  });
6044
6317
  };
6045
- let installed = false;
6046
6318
  const install = (Vue) => {
6047
- if (installed) {
6048
- return;
6049
- }
6050
6319
  Vue.use(plugin);
6051
- installed = true;
6052
6320
  };
6053
6321
  var index = {
6054
6322
  install
6055
6323
  };
6056
- export { actionIcon as ActionIcon, breadcrumb as Breadcrumb, DaoBreadcrumbItem as BreadcrumbItem, DaoButton as Button, buttonGroup as ButtonGroup, card as Card, cardItem as CardItem, DaoCheckbox as Checkbox, checkboxGroup as CheckboxGroup, dialog as Dialog, DialogFooter, DialogHeader, dropdown as Dropdown, dropdownItem as DropdownItem, dropdownMenu as DropdownMenu, form as Form, formGroup as FormGroup, formItem as FormItem, header as Header, DaoIcon as Icon, input as Input, message as Message, nav as Nav, navHead as NavHead, navItem as NavItem, navSub as NavSub, DaoOption as Option, DaoPagination as Pagination, _sfc_main$9 as Popover, Popper, progress as Progress, radio as Radio, radioGroup as RadioGroup, DaoSelect as Select, _switch as Switch, tabItem as TabItem, _sfc_main$2 as TabNav, table as Table, tabs as Tabs, _sfc_main$o as Tooltip, index as default };
6324
+ export { actionIcon as ActionIcon, breadcrumb as Breadcrumb, DaoBreadcrumbItem as BreadcrumbItem, DaoButton as Button, buttonGroup as ButtonGroup, card as Card, cardItem as CardItem, DaoCheckbox as Checkbox, checkboxGroup as CheckboxGroup, dialog as Dialog, DialogFooter, DialogHeader, drawer as Drawer, dropdown as Dropdown, dropdownItem as DropdownItem, dropdownMenu as DropdownMenu, form as Form, formGroup as FormGroup, formItem as FormItem, header as Header, DaoIcon as Icon, input as Input, message as Message, nav as Nav, navHead as NavHead, navItem as NavItem, navSub as NavSub, DaoOption as Option, DaoPagination as Pagination, _sfc_main$9 as Popover, Popper, progress as Progress, radio as Radio, radioGroup as RadioGroup, DaoSelect as Select, _switch as Switch, tabItem as TabItem, _sfc_main$2 as TabNav, table as Table, tabs as Tabs, _sfc_main$o as Tooltip, index as default };