SFilterToolbar.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { ref as S, resolveComponent as s, openBlock as o, createElementBlock as r, createElementVNode as a, createVNode as l, withCtx as n, renderSlot as d, createTextVNode as B, toDisplayString as p, createBlock as m, createCommentVNode as c, withDirectives as C, vShow as F } from "vue";
  2. import { n as D, y as M, B as N } from "./index2.js";
  3. const T = { class: "s-filter-container" }, V = {
  4. key: 0,
  5. class: "filter-content"
  6. }, x = { class: "filter" }, E = { class: "reset-wrap" }, z = {
  7. key: 1,
  8. class: "filter-more-content"
  9. }, j = /* @__PURE__ */ Object.assign({ name: "SFilterToolbar" }, {
  10. __name: "SFilterToolbar",
  11. emits: ["reset", "toggle"],
  12. setup(I, { expose: v, emit: y }) {
  13. const i = y, e = S(!1);
  14. function u() {
  15. e.value = !e.value, i("toggle", e.value);
  16. }
  17. function _() {
  18. i("reset");
  19. }
  20. function g() {
  21. e.value && (e.value = !1, i("toggle", !1));
  22. }
  23. return v({ isMoreFilter: e, toggleFilter: u, filterReset: _, collapse: g }), (t, L) => {
  24. const f = s("s-filter-wrap"), h = s("down-outlined"), k = s("up-outlined"), w = s("sync-outlined"), $ = N, b = M;
  25. return o(), r("div", T, [
  26. t.$slots.filter ? (o(), r("div", V, [
  27. a("div", x, [
  28. l(f, null, {
  29. default: n(() => [
  30. d(t.$slots, "filter", {}, void 0, !0)
  31. ]),
  32. _: 3
  33. })
  34. ]),
  35. t.$slots.filterMore ? (o(), r("a", {
  36. key: 0,
  37. class: "filter-more-btn",
  38. onClick: u
  39. }, [
  40. B(p(e.value ? t.$l("收起") : t.$l("更多")) + " ", 1),
  41. e.value ? (o(), m(k, {
  42. key: 1,
  43. style: { "font-size": "12px" }
  44. })) : (o(), m(h, {
  45. key: 0,
  46. style: { "font-size": "12px" }
  47. }))
  48. ])) : c("", !0),
  49. a("div", E, [
  50. l(b, {
  51. placement: "top",
  52. overlayStyle: { maxWidth: "500px" },
  53. mouseEnterDelay: 1.5,
  54. mouseLeaveDelay: 0.5
  55. }, {
  56. title: n(() => [
  57. a("span", null, p(t.$l("条件重置")), 1)
  58. ]),
  59. default: n(() => [
  60. l($, {
  61. style: { "padding-bottom": "2px" },
  62. onClick: _
  63. }, {
  64. icon: n(() => [
  65. l(w)
  66. ]),
  67. _: 1
  68. })
  69. ]),
  70. _: 1
  71. })
  72. ])
  73. ])) : c("", !0),
  74. t.$slots.filterMore ? C((o(), r("div", z, [
  75. l(f, { type: "filter-more" }, {
  76. default: n(() => [
  77. d(t.$slots, "filterMore", {}, void 0, !0)
  78. ]),
  79. _: 3
  80. })
  81. ], 512)), [
  82. [F, e.value]
  83. ]) : c("", !0)
  84. ]);
  85. };
  86. }
  87. }), W = /* @__PURE__ */ D(j, [["__scopeId", "data-v-fa4ff7fc"]]);
  88. export {
  89. W as default
  90. };