vue-markdown-design 0.3.1 → 0.3.2

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 (72) hide show
  1. package/README.md +5 -1
  2. package/README.zh-CN.md +4 -0
  3. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.mjs +27 -0
  4. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.mjs +12 -0
  5. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.mjs +25 -0
  6. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.mjs +13 -0
  7. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.mjs +12 -0
  8. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.mjs +14 -0
  9. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.mjs +9 -0
  10. package/es/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.mjs +11 -0
  11. package/es/hooks/use-element/index.mjs +21 -18
  12. package/es/hooks/use-scroll-element/index.mjs +44 -45
  13. package/es/index.mjs +7 -18
  14. package/es/markdown/Markdown.mjs +221 -316
  15. package/es/markdown/index.css +3 -0
  16. package/es/markdown/index2.mjs +6 -0
  17. package/es/render/Render.mjs +143 -173
  18. package/es/render/index.css +37 -21
  19. package/es/render/index2.mjs +6 -0
  20. package/es/search/Search.mjs +236 -285
  21. package/es/search/index.css +4 -0
  22. package/es/search/index2.mjs +6 -0
  23. package/es/sticky/Sticky.mjs +66 -99
  24. package/es/sticky/index2.mjs +6 -0
  25. package/es/toc/Toc.mjs +253 -347
  26. package/es/toc/index2.mjs +6 -0
  27. package/es/utils/constant.mjs +4 -4
  28. package/es/utils/dom.mjs +44 -68
  29. package/es/utils/format.mjs +33 -39
  30. package/es/utils/functions.mjs +5 -5
  31. package/es/utils/vue.mjs +10 -32
  32. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.js +27 -0
  33. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js +12 -0
  34. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.js +25 -0
  35. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.js +13 -0
  36. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js +12 -0
  37. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.js +14 -0
  38. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.js +9 -0
  39. package/lib/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.js +16 -0
  40. package/lib/_virtual/_rolldown/runtime.js +23 -0
  41. package/lib/hooks/use-element/index.js +23 -19
  42. package/lib/hooks/use-scroll-element/index.js +45 -45
  43. package/lib/index.js +24 -22
  44. package/lib/markdown/Markdown.js +224 -317
  45. package/lib/markdown/index.css +3 -0
  46. package/lib/markdown/index2.js +6 -0
  47. package/lib/render/Render.js +152 -176
  48. package/lib/render/index.css +37 -21
  49. package/lib/render/index2.js +6 -0
  50. package/lib/search/Search.js +242 -287
  51. package/lib/search/index.css +4 -0
  52. package/lib/search/index2.js +6 -0
  53. package/lib/sticky/Sticky.js +68 -99
  54. package/lib/sticky/index2.js +6 -0
  55. package/lib/toc/Toc.js +259 -349
  56. package/lib/toc/index2.js +6 -0
  57. package/lib/utils/constant.js +3 -3
  58. package/lib/utils/dom.js +46 -69
  59. package/lib/utils/format.js +33 -33
  60. package/lib/utils/functions.js +4 -4
  61. package/lib/utils/vue.js +10 -31
  62. package/package.json +4 -9
  63. package/es/markdown/index.mjs +0 -9
  64. package/es/render/index.mjs +0 -9
  65. package/es/search/index.mjs +0 -9
  66. package/es/sticky/index.mjs +0 -7
  67. package/es/toc/index.mjs +0 -9
  68. package/lib/markdown/index.js +0 -8
  69. package/lib/render/index.js +0 -8
  70. package/lib/search/index.js +0 -8
  71. package/lib/sticky/index.js +0 -7
  72. package/lib/toc/index.js +0 -8
@@ -1,292 +1,243 @@
1
- import './index.css';var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
- import { defineComponent, computed, ref, watch, withKeys, watchEffect, onBeforeUnmount, shallowRef, createVNode, withDirectives, mergeProps, vModelText, Fragment, nextTick } from "vue";
41
- /* empty css */
42
- import Mark from "mark.js";
1
+ import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.mjs";
43
2
  import { createNamespace } from "../utils/format.mjs";
44
- import { useVModel, toValue } from "@vueuse/core";
45
- import { isNumber, isString, chain, upperFirst, omit, escapeRegExp, debounce, last } from "lodash";
3
+ import './index.css';/* empty css */
46
4
  import { useElement } from "../hooks/use-element/index.mjs";
47
5
  import { scrollToEl } from "../utils/dom.mjs";
6
+ import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.mjs";
7
+ import { chain, debounce, escapeRegExp, isNumber, isString, last, omit, upperFirst } from "lodash";
8
+ import { Fragment, computed, createVNode, defineComponent, mergeProps, nextTick, onBeforeUnmount, ref, shallowRef, vModelText, watch, watchEffect, withDirectives, withKeys } from "vue";
9
+ import Mark from "mark.js";
10
+ import { toValue, useVModel } from "@vueuse/core";
48
11
  import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
49
- import { faCircleXmark, faAngleUp, faAngleDown, faXmark } from "@fortawesome/free-solid-svg-icons";
50
- let inputId = 0;
51
- const {
52
- name,
53
- addPrefix
54
- } = createNamespace("search");
55
- const searchProps = {
56
- modelValue: {
57
- type: [String, Number],
58
- default: ""
59
- },
60
- clearable: {
61
- type: Boolean,
62
- default: true
63
- },
64
- border: {
65
- type: Boolean,
66
- default: true
67
- },
68
- size: {
69
- type: String,
70
- default: "huge"
71
- },
72
- disabled: {
73
- type: Boolean,
74
- default: false
75
- },
76
- placeholder: String,
77
- target: [String, Object, Function],
78
- offset: {
79
- type: [String, Number, Function],
80
- default: "center"
81
- },
82
- smooth: Boolean,
83
- closeIcon: {
84
- type: Boolean,
85
- default: true
86
- },
87
- inputAttrs: {
88
- type: Object,
89
- default: () => ({})
90
- }
12
+ import { faAngleDown, faAngleUp, faCircleXmark, faXmark } from "@fortawesome/free-solid-svg-icons";
13
+ //#region src/search/Search.tsx
14
+ var inputId = 0;
15
+ var { name, addPrefix } = createNamespace("search");
16
+ var searchProps = {
17
+ modelValue: {
18
+ type: [String, Number],
19
+ default: ""
20
+ },
21
+ clearable: {
22
+ type: Boolean,
23
+ default: true
24
+ },
25
+ border: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ size: {
30
+ type: String,
31
+ default: "huge"
32
+ },
33
+ disabled: {
34
+ type: Boolean,
35
+ default: false
36
+ },
37
+ placeholder: String,
38
+ target: [
39
+ String,
40
+ Object,
41
+ Function
42
+ ],
43
+ offset: {
44
+ type: [
45
+ String,
46
+ Number,
47
+ Function
48
+ ],
49
+ default: "center"
50
+ },
51
+ smooth: Boolean,
52
+ closeIcon: {
53
+ type: Boolean,
54
+ default: true
55
+ },
56
+ inputAttrs: {
57
+ type: Object,
58
+ default: () => ({})
59
+ }
91
60
  };
92
- const searchEmits = {
93
- "update:modelValue": (payload) => isString(payload),
94
- input: (payload) => payload instanceof Event,
95
- blur: (payload) => payload instanceof FocusEvent,
96
- focus: (payload) => payload instanceof FocusEvent,
97
- change: (payload) => payload instanceof Event,
98
- clear: () => true,
99
- close: () => true,
100
- stepClick: (payload) => ["prev", "next"].includes(payload),
101
- totalChange: (payload) => isNumber(payload),
102
- indexChange: (payload) => isNumber(payload)
61
+ var searchEmits = {
62
+ "update:modelValue": (payload) => isString(payload),
63
+ input: (payload) => payload instanceof Event,
64
+ blur: (payload) => payload instanceof FocusEvent,
65
+ focus: (payload) => payload instanceof FocusEvent,
66
+ change: (payload) => payload instanceof Event,
67
+ clear: () => true,
68
+ close: () => true,
69
+ stepClick: (payload) => ["prev", "next"].includes(payload),
70
+ totalChange: (payload) => isNumber(payload),
71
+ indexChange: (payload) => isNumber(payload)
103
72
  };
104
- const _Search = /* @__PURE__ */ defineComponent({
105
- name,
106
- props: searchProps,
107
- emits: searchEmits,
108
- setup(props, {
109
- emit,
110
- expose,
111
- attrs
112
- }) {
113
- const modelValue = useVModel(props, "modelValue", emit, {
114
- passive: true
115
- });
116
- const rootClass = computed(() => {
117
- const {
118
- size,
119
- disabled,
120
- border
121
- } = props;
122
- return [name, addPrefix(`--${size}`), {
123
- [addPrefix("--disabled")]: disabled,
124
- [addPrefix("--border")]: border
125
- }];
126
- });
127
- const id = `${name}-${inputId++}`;
128
- const eventAttrs = chain(["input", "blur", "focus", "change"]).map((key) => [`on${upperFirst(key)}`, (...arg) => emit(key, ...arg)]).fromPairs().value();
129
- const inputAttrs = computed(() => {
130
- const {
131
- inputAttrs: inputAttrs2,
132
- disabled,
133
- placeholder
134
- } = props;
135
- return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
136
- id
137
- }, omit(attrs, ["class", "style"])), inputAttrs2), eventAttrs), {
138
- disabled,
139
- placeholder
140
- });
141
- });
142
- const onClear = () => {
143
- if (props.disabled) return;
144
- modelValue.value = "";
145
- emit("clear");
146
- };
147
- const rawIndex = ref(0);
148
- const markList = ref([]);
149
- const escapedVal = computed(() => escapeRegExp(String(modelValue.value)));
150
- const setMarkList = (el) => {
151
- const item = last(markList.value);
152
- const keyword = (item == null ? void 0 : item.map((item2) => item2.innerText).join("")) || "";
153
- const regexp = new RegExp(`^${escapedVal.value}$`, "i");
154
- !item || regexp.test(keyword) ? markList.value.push([el]) : item.push(el);
155
- };
156
- const total = computed(() => markList.value.length);
157
- watch(total, (val) => emit("totalChange", val));
158
- const matchesIndex = computed(() => {
159
- return total.value && (rawIndex.value % total.value + total.value) % total.value;
160
- });
161
- watch(matchesIndex, (val) => emit("indexChange", val));
162
- const matchesCount = computed(
163
- // modelValue.value !== '' 不直接判断防止值为0的情况
164
- () => modelValue.value !== "" && total.value && `${matchesIndex.value + 1}/${total.value}`
165
- );
166
- const stepMap = /* @__PURE__ */ new Map([["prev", -1], ["next", 1]]);
167
- const toggle = (index, ignoreDisabled = true) => {
168
- if (!ignoreDisabled && props.disabled) return;
169
- const offsetVal = stepMap.get(String(index));
170
- rawIndex.value = offsetVal ? matchesIndex.value + offsetVal : Number(index);
171
- };
172
- const onStepClick = (direction) => {
173
- if (props.disabled) return;
174
- toggle(direction);
175
- emit("stepClick", direction);
176
- };
177
- const onKeydown = withKeys(
178
- (event) => {
179
- var _a;
180
- return !((_a = event.target) == null ? void 0 : _a.composing) && onStepClick("next");
181
- },
182
- // composing 此处的值为vue3源码中的赋值
183
- ["enter"]
184
- );
185
- const target = computed(() => toValue(props.target));
186
- const {
187
- targetEl
188
- } = useElement(target);
189
- const markInstance = computed(() => {
190
- return targetEl.value instanceof HTMLElement ? new Mark(targetEl.value) : void 0;
191
- });
192
- watch(targetEl, (el) => {
193
- if (el && !(el instanceof HTMLElement)) {
194
- console.error("[vue-markdown-design] Target is not of the HTMLElement type.");
195
- }
196
- });
197
- const highlightClass = addPrefix("--highlight");
198
- watchEffect(() => {
199
- var _a;
200
- (_a = targetEl.value) == null ? void 0 : _a.querySelectorAll(`.${highlightClass}`).forEach((el) => el.classList.remove(highlightClass));
201
- const currentMark = markList.value.find((_, index) => index === matchesIndex.value);
202
- if (!currentMark) return;
203
- currentMark.forEach((el) => el.classList.add(highlightClass));
204
- const {
205
- offset,
206
- smooth
207
- } = props;
208
- scrollToEl(currentMark[0], {
209
- offset,
210
- smooth,
211
- scrollMode: "if-needed"
212
- });
213
- });
214
- const resetMark = () => {
215
- var _a;
216
- (_a = markInstance.value) == null ? void 0 : _a.unmark();
217
- markList.value = [];
218
- };
219
- const setMark = debounce(() => {
220
- var _a;
221
- resetMark();
222
- if (!targetEl.value) return;
223
- const regexp = new RegExp(escapedVal.value, "gi");
224
- (_a = markInstance.value) == null ? void 0 : _a.markRegExp(regexp, {
225
- className: addPrefix("--mark"),
226
- acrossElements: true,
227
- each: setMarkList
228
- });
229
- }, 200);
230
- const resetAndMark = () => {
231
- rawIndex.value = 0;
232
- setMark();
233
- };
234
- watch(modelValue, resetAndMark);
235
- onBeforeUnmount(resetMark);
236
- const refresh = (resetIndex = true) => __async(this, null, function* () {
237
- yield nextTick();
238
- resetIndex ? resetAndMark() : setMark();
239
- });
240
- watch([targetEl, () => {
241
- var _a;
242
- return (_a = target.value) == null ? void 0 : _a.htmlStr;
243
- }], () => refresh(), {
244
- immediate: true
245
- });
246
- const inputRef = shallowRef();
247
- expose(__spreadProps(__spreadValues({}, chain(["focus", "blur"]).map((key) => [key, () => {
248
- var _a;
249
- return (_a = inputRef.value) == null ? void 0 : _a[key]();
250
- }]).fromPairs().value()), {
251
- clear: onClear,
252
- toggle,
253
- refresh
254
- }));
255
- return () => createVNode("div", {
256
- "class": rootClass.value
257
- }, [withDirectives(createVNode("input", mergeProps(inputAttrs.value, {
258
- "onUpdate:modelValue": ($event) => modelValue.value = $event,
259
- "class": addPrefix("__input"),
260
- "ref": inputRef,
261
- "onKeydown": onKeydown
262
- }), null), [[vModelText, modelValue.value]]), modelValue.value && createVNode(Fragment, null, [props.clearable && createVNode("span", {
263
- "class": [addPrefix("__clearable"), addPrefix("__btn")],
264
- "onClick": onClear
265
- }, [createVNode(FontAwesomeIcon, {
266
- "size": "xs",
267
- "icon": faCircleXmark
268
- }, null)]), createVNode("span", {
269
- "class": addPrefix("__count")
270
- }, [matchesCount.value]), createVNode("span", {
271
- "class": [addPrefix("__prev"), addPrefix("__btn")],
272
- "onClick": () => onStepClick("prev")
273
- }, [createVNode(FontAwesomeIcon, {
274
- "icon": faAngleUp
275
- }, null)]), createVNode("span", {
276
- "class": [addPrefix("__next"), addPrefix("__btn")],
277
- "onClick": () => onStepClick("next")
278
- }, [createVNode(FontAwesomeIcon, {
279
- "icon": faAngleDown
280
- }, null)])]), props.closeIcon && createVNode("span", {
281
- "class": [addPrefix("__close"), addPrefix("__btn")],
282
- "onClick": () => emit("close")
283
- }, [createVNode(FontAwesomeIcon, {
284
- "icon": faXmark
285
- }, null)])]);
286
- }
73
+ var Search_default = /* @__PURE__ */ defineComponent({
74
+ name,
75
+ props: searchProps,
76
+ emits: searchEmits,
77
+ setup(props, { emit, expose, attrs }) {
78
+ const modelValue = useVModel(props, "modelValue", emit, { passive: true });
79
+ const rootClass = computed(() => {
80
+ const { size, disabled, border } = props;
81
+ return [
82
+ name,
83
+ addPrefix(`--${size}`),
84
+ {
85
+ [addPrefix("--disabled")]: disabled,
86
+ [addPrefix("--border")]: border
87
+ }
88
+ ];
89
+ });
90
+ const id = `${name}-${inputId++}`;
91
+ const eventAttrs = chain([
92
+ "input",
93
+ "blur",
94
+ "focus",
95
+ "change"
96
+ ]).map((key) => [`on${upperFirst(key)}`, (...arg) => emit(key, ...arg)]).fromPairs().value();
97
+ const inputAttrs = computed(() => {
98
+ const { inputAttrs, disabled, placeholder } = props;
99
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({ id }, omit(attrs, ["class", "style"])), inputAttrs), eventAttrs), {}, {
100
+ disabled,
101
+ placeholder
102
+ });
103
+ });
104
+ const onClear = () => {
105
+ if (props.disabled) return;
106
+ modelValue.value = "";
107
+ emit("clear");
108
+ };
109
+ const rawIndex = ref(0);
110
+ const markList = ref([]);
111
+ const escapedVal = computed(() => escapeRegExp(String(modelValue.value)));
112
+ const setMarkList = (el) => {
113
+ const item = last(markList.value);
114
+ const keyword = (item === null || item === void 0 ? void 0 : item.map((item) => item.innerText).join("")) || "";
115
+ const regexp = new RegExp(`^${escapedVal.value}$`, "i");
116
+ !item || regexp.test(keyword) ? markList.value.push([el]) : item.push(el);
117
+ };
118
+ const total = computed(() => markList.value.length);
119
+ watch(total, (val) => emit("totalChange", val));
120
+ const matchesIndex = computed(() => {
121
+ return total.value && (rawIndex.value % total.value + total.value) % total.value;
122
+ });
123
+ watch(matchesIndex, (val) => emit("indexChange", val));
124
+ const matchesCount = computed(() => modelValue.value !== "" && total.value && `${matchesIndex.value + 1}/${total.value}`);
125
+ const stepMap = new Map([["prev", -1], ["next", 1]]);
126
+ const toggle = (index, ignoreDisabled = true) => {
127
+ if (!ignoreDisabled && props.disabled) return;
128
+ const offsetVal = stepMap.get(String(index));
129
+ rawIndex.value = offsetVal ? matchesIndex.value + offsetVal : Number(index);
130
+ };
131
+ const onStepClick = (direction) => {
132
+ if (props.disabled) return;
133
+ toggle(direction);
134
+ emit("stepClick", direction);
135
+ };
136
+ const onKeydown = withKeys((event) => {
137
+ var _event$target;
138
+ return !((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.composing) && onStepClick("next");
139
+ }, ["enter"]);
140
+ const target = computed(() => toValue(props.target));
141
+ const { targetEl } = useElement(target);
142
+ const markInstance = computed(() => {
143
+ return targetEl.value instanceof HTMLElement ? new Mark(targetEl.value) : void 0;
144
+ });
145
+ watch(targetEl, (el) => {
146
+ if (el && !(el instanceof HTMLElement)) console.error("[vue-markdown-design] Target is not of the HTMLElement type.");
147
+ });
148
+ const highlightClass = addPrefix("--highlight");
149
+ watchEffect(() => {
150
+ var _targetEl$value;
151
+ (_targetEl$value = targetEl.value) === null || _targetEl$value === void 0 || _targetEl$value.querySelectorAll(`.${highlightClass}`).forEach((el) => el.classList.remove(highlightClass));
152
+ const currentMark = markList.value.find((_, index) => index === matchesIndex.value);
153
+ if (!currentMark) return;
154
+ currentMark.forEach((el) => el.classList.add(highlightClass));
155
+ const { offset, smooth } = props;
156
+ scrollToEl(currentMark[0], {
157
+ offset,
158
+ smooth,
159
+ scrollMode: "if-needed"
160
+ });
161
+ });
162
+ const resetMark = () => {
163
+ var _markInstance$value;
164
+ (_markInstance$value = markInstance.value) === null || _markInstance$value === void 0 || _markInstance$value.unmark();
165
+ markList.value = [];
166
+ };
167
+ const setMark = debounce(() => {
168
+ var _markInstance$value2;
169
+ resetMark();
170
+ if (!targetEl.value) return;
171
+ const regexp = new RegExp(escapedVal.value, "gi");
172
+ (_markInstance$value2 = markInstance.value) === null || _markInstance$value2 === void 0 || _markInstance$value2.markRegExp(regexp, {
173
+ className: addPrefix("--mark"),
174
+ acrossElements: true,
175
+ each: setMarkList
176
+ });
177
+ }, 200);
178
+ const resetAndMark = () => {
179
+ rawIndex.value = 0;
180
+ setMark();
181
+ };
182
+ watch(modelValue, resetAndMark);
183
+ onBeforeUnmount(resetMark);
184
+ const refresh = function() {
185
+ var _ref = _asyncToGenerator(function* (resetIndex = true) {
186
+ yield nextTick();
187
+ resetIndex ? resetAndMark() : setMark();
188
+ });
189
+ return function refresh() {
190
+ return _ref.apply(this, arguments);
191
+ };
192
+ }();
193
+ watch([targetEl, () => {
194
+ var _target$value;
195
+ return (_target$value = target.value) === null || _target$value === void 0 ? void 0 : _target$value.htmlStr;
196
+ }], () => refresh(), { immediate: true });
197
+ const inputRef = shallowRef();
198
+ expose(_objectSpread2(_objectSpread2({}, chain(["focus", "blur"]).map((key) => [key, () => {
199
+ var _inputRef$value;
200
+ return (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value[key]();
201
+ }]).fromPairs().value()), {}, {
202
+ clear: onClear,
203
+ toggle,
204
+ refresh
205
+ }));
206
+ return () => createVNode("div", { "class": rootClass.value }, [
207
+ withDirectives(createVNode("input", mergeProps(inputAttrs.value, {
208
+ "onUpdate:modelValue": ($event) => modelValue.value = $event,
209
+ "class": addPrefix("__input"),
210
+ "ref": inputRef,
211
+ "onKeydown": onKeydown
212
+ }), null), [[vModelText, modelValue.value]]),
213
+ modelValue.value && createVNode(Fragment, null, [
214
+ props.clearable && createVNode("button", {
215
+ "aria-label": "Clear",
216
+ "class": [addPrefix("__clearable"), addPrefix("__btn")],
217
+ "onClick": onClear
218
+ }, [createVNode(FontAwesomeIcon, {
219
+ "size": "xs",
220
+ "icon": faCircleXmark
221
+ }, null)]),
222
+ createVNode("span", { "class": addPrefix("__count") }, [matchesCount.value]),
223
+ createVNode("button", {
224
+ "aria-label": "Previous",
225
+ "class": [addPrefix("__prev"), addPrefix("__btn")],
226
+ "onClick": () => onStepClick("prev")
227
+ }, [createVNode(FontAwesomeIcon, { "icon": faAngleUp }, null)]),
228
+ createVNode("button", {
229
+ "aria-label": "Next",
230
+ "class": [addPrefix("__next"), addPrefix("__btn")],
231
+ "onClick": () => onStepClick("next")
232
+ }, [createVNode(FontAwesomeIcon, { "icon": faAngleDown }, null)])
233
+ ]),
234
+ props.closeIcon && createVNode("button", {
235
+ "aria-label": "Close",
236
+ "class": [addPrefix("__close"), addPrefix("__btn")],
237
+ "onClick": () => emit("close")
238
+ }, [createVNode(FontAwesomeIcon, { "icon": faXmark }, null)])
239
+ ]);
240
+ }
287
241
  });
288
- export {
289
- _Search as default,
290
- searchEmits,
291
- searchProps
292
- };
242
+ //#endregion
243
+ export { Search_default as default, searchEmits, searchProps };
@@ -16,6 +16,7 @@
16
16
  --vmd-search-clearable-color: var(--vmd-text-secondary-color);
17
17
  --vmd-search-count-font-size: 12px;
18
18
  --vmd-search-count-color: var(--vmd-text-secondary-color);
19
+ --vmd-search-btn-icon-size: 14px;
19
20
  --vmd-search-btn-hover-opacity: 0.5;
20
21
  --vmd-search-mark: mark;
21
22
  --vmd-search-highlight: orange;
@@ -77,6 +78,9 @@
77
78
  .vmd-search__btn {
78
79
  cursor: pointer;
79
80
  color: var(--vmd-icon-color);
81
+ background: none;
82
+ border: none;
83
+ font-size: var(--vmd-search-btn-icon-size);
80
84
  }
81
85
  .vmd-search__btn:hover {
82
86
  opacity: var(--vmd-search-btn-hover-opacity);
@@ -0,0 +1,6 @@
1
+ import { withInstall } from "../utils/vue.mjs";
2
+ import Search_default from "./Search.mjs";
3
+ //#region src/search/index.ts
4
+ var VmdSearch = withInstall(Search_default);
5
+ //#endregion
6
+ export { VmdSearch as default };