@wirekyt/vue 0.0.1 → 0.0.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.
- package/dist/accordion.cjs +273 -0
- package/dist/accordion.d.cts +195 -0
- package/dist/accordion.d.ts +195 -0
- package/dist/accordion.js +250 -0
- package/dist/angle-slider.cjs +268 -0
- package/dist/angle-slider.d.cts +228 -0
- package/dist/angle-slider.d.ts +228 -0
- package/dist/angle-slider.js +244 -0
- package/dist/avatar.cjs +145 -0
- package/dist/avatar.d.cts +114 -0
- package/dist/avatar.d.ts +114 -0
- package/dist/avatar.js +126 -0
- package/dist/boolean-BCaEpMxQ.js +6 -0
- package/dist/boolean-Dyu9-5Wp.cjs +11 -0
- package/dist/carousel.cjs +342 -0
- package/dist/carousel.d.cts +303 -0
- package/dist/carousel.d.ts +303 -0
- package/dist/carousel.js +320 -0
- package/dist/checkbox.cjs +345 -0
- package/dist/checkbox.d.cts +272 -0
- package/dist/checkbox.d.ts +272 -0
- package/dist/checkbox.js +324 -0
- package/dist/clean-props--1kqQE0Y.js +8 -0
- package/dist/clean-props-MyKqus13.cjs +13 -0
- package/dist/client-only.cjs +17 -0
- package/dist/client-only.d.cts +18 -0
- package/dist/client-only.d.ts +18 -0
- package/dist/client-only.js +16 -0
- package/dist/clipboard.cjs +229 -0
- package/dist/clipboard.d.cts +203 -0
- package/dist/clipboard.d.ts +203 -0
- package/dist/clipboard.js +206 -0
- package/dist/collapsible-CEjnJlpm.js +179 -0
- package/dist/collapsible-aSz4kYqo.cjs +232 -0
- package/dist/collapsible.cjs +23 -0
- package/dist/collapsible.d.cts +161 -0
- package/dist/collapsible.d.ts +161 -0
- package/dist/collapsible.js +2 -0
- package/dist/collection-1IjtyI-g.cjs +254 -0
- package/dist/collection-Ea6ZCZKK.js +211 -0
- package/dist/collection.cjs +9 -0
- package/dist/collection.d.cts +2 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +2 -0
- package/dist/color-picker.cjs +804 -0
- package/dist/color-picker.d.cts +605 -0
- package/dist/color-picker.d.ts +605 -0
- package/dist/color-picker.js +759 -0
- package/dist/combobox.cjs +552 -0
- package/dist/combobox.d.cts +442 -0
- package/dist/combobox.d.ts +442 -0
- package/dist/combobox.js +521 -0
- package/dist/create-split-props-BBxrD7TV.js +10 -0
- package/dist/create-split-props-Jx-IEwdk.cjs +15 -0
- package/dist/date-input.cjs +293 -0
- package/dist/date-input.d.cts +212 -0
- package/dist/date-input.d.ts +212 -0
- package/dist/date-input.js +270 -0
- package/dist/date-picker.cjs +821 -0
- package/dist/date-picker.d.cts +637 -0
- package/dist/date-picker.d.ts +637 -0
- package/dist/date-picker.js +776 -0
- package/dist/dialog.cjs +333 -0
- package/dist/dialog.d.cts +272 -0
- package/dist/dialog.d.ts +272 -0
- package/dist/dialog.js +308 -0
- package/dist/download-trigger.cjs +65 -0
- package/dist/download-trigger.d.cts +34 -0
- package/dist/download-trigger.d.ts +34 -0
- package/dist/download-trigger.js +63 -0
- package/dist/drawer.cjs +448 -0
- package/dist/drawer.d.cts +346 -0
- package/dist/drawer.d.ts +346 -0
- package/dist/drawer.js +415 -0
- package/dist/editable.cjs +331 -0
- package/dist/editable.d.cts +285 -0
- package/dist/editable.d.ts +285 -0
- package/dist/editable.js +306 -0
- package/dist/factory-8Ao0DEy3.js +34 -0
- package/dist/factory-BNwuanv4.d.cts +21 -0
- package/dist/factory-BNwuanv4.d.ts +21 -0
- package/dist/factory-JL7MPjkk.cjs +45 -0
- package/dist/field-C3pLqz1S.js +435 -0
- package/dist/field-DRz-v4rB.cjs +524 -0
- package/dist/field.cjs +22 -0
- package/dist/field.d.cts +344 -0
- package/dist/field.d.ts +344 -0
- package/dist/field.js +2 -0
- package/dist/fieldset-ByP_r1Uq.js +216 -0
- package/dist/fieldset-C5aj6Ims.cjs +275 -0
- package/dist/fieldset.cjs +17 -0
- package/dist/fieldset.d.cts +159 -0
- package/dist/fieldset.d.ts +159 -0
- package/dist/fieldset.js +2 -0
- package/dist/file-upload.cjs +421 -0
- package/dist/file-upload.d.cts +327 -0
- package/dist/file-upload.d.ts +327 -0
- package/dist/file-upload.js +392 -0
- package/dist/floating-panel.cjs +412 -0
- package/dist/floating-panel.d.cts +337 -0
- package/dist/floating-panel.d.ts +337 -0
- package/dist/floating-panel.js +383 -0
- package/dist/focus-trap.cjs +79 -0
- package/dist/focus-trap.d.cts +46 -0
- package/dist/focus-trap.d.ts +46 -0
- package/dist/focus-trap.js +78 -0
- package/dist/format.cjs +116 -0
- package/dist/format.d.cts +46 -0
- package/dist/format.d.ts +46 -0
- package/dist/format.js +106 -0
- package/dist/frame.cjs +93 -0
- package/dist/frame.d.cts +37 -0
- package/dist/frame.d.ts +37 -0
- package/dist/frame.js +92 -0
- package/dist/highlight.cjs +44 -0
- package/dist/highlight.d.cts +32 -0
- package/dist/highlight.d.ts +32 -0
- package/dist/highlight.js +42 -0
- package/dist/hover-card.cjs +269 -0
- package/dist/hover-card.d.cts +202 -0
- package/dist/hover-card.d.ts +202 -0
- package/dist/hover-card.js +246 -0
- package/dist/image-cropper.cjs +252 -0
- package/dist/image-cropper.d.cts +207 -0
- package/dist/image-cropper.d.ts +207 -0
- package/dist/image-cropper.js +235 -0
- package/dist/index-B-o8jLyV.d.cts +31 -0
- package/dist/index-BSoF1D-v.d.ts +31 -0
- package/dist/index-BTNfeIXf.d.ts +104 -0
- package/dist/index-C6Q2DqG6.d.ts +37 -0
- package/dist/index-CG9mpPgL.d.cts +444 -0
- package/dist/index-Cc4qS0rQ.d.cts +38 -0
- package/dist/index-Cc4qS0rQ.d.ts +38 -0
- package/dist/index-DB2uALlJ.d.cts +74 -0
- package/dist/index-DXb0W_NP.d.cts +37 -0
- package/dist/index-Zc9P69Ka.d.cts +104 -0
- package/dist/index-aMWdJRGL.d.ts +444 -0
- package/dist/index-uLE-tXSk.d.ts +74 -0
- package/dist/index.cjs +43 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/json-tree-view.cjs +346 -0
- package/dist/json-tree-view.d.cts +86 -0
- package/dist/json-tree-view.d.ts +86 -0
- package/dist/json-tree-view.js +336 -0
- package/dist/listbox.cjs +386 -0
- package/dist/listbox.d.cts +323 -0
- package/dist/listbox.d.ts +323 -0
- package/dist/listbox.js +361 -0
- package/dist/marquee.cjs +256 -0
- package/dist/marquee.d.cts +208 -0
- package/dist/marquee.d.ts +208 -0
- package/dist/marquee.js +235 -0
- package/dist/menu.cjs +650 -0
- package/dist/menu.d.cts +501 -0
- package/dist/menu.d.ts +501 -0
- package/dist/menu.js +613 -0
- package/dist/navigation-menu.cjs +408 -0
- package/dist/navigation-menu.d.cts +271 -0
- package/dist/navigation-menu.d.ts +271 -0
- package/dist/navigation-menu.js +380 -0
- package/dist/number-input.cjs +298 -0
- package/dist/number-input.d.cts +253 -0
- package/dist/number-input.d.ts +253 -0
- package/dist/number-input.js +274 -0
- package/dist/pagination.cjs +249 -0
- package/dist/pagination.d.cts +209 -0
- package/dist/pagination.d.ts +209 -0
- package/dist/pagination.js +226 -0
- package/dist/password-input.cjs +232 -0
- package/dist/password-input.d.cts +208 -0
- package/dist/password-input.d.ts +208 -0
- package/dist/password-input.js +210 -0
- package/dist/pin-input.cjs +245 -0
- package/dist/pin-input.d.cts +199 -0
- package/dist/pin-input.d.ts +199 -0
- package/dist/pin-input.js +224 -0
- package/dist/popover.cjs +377 -0
- package/dist/popover.d.cts +324 -0
- package/dist/popover.d.ts +324 -0
- package/dist/popover.js +349 -0
- package/dist/presence-DD3l4Tgb.cjs +60 -0
- package/dist/presence-jaHZaD_O.js +43 -0
- package/dist/presence.cjs +7 -0
- package/dist/presence.d.cts +3 -0
- package/dist/presence.d.ts +3 -0
- package/dist/presence.js +3 -0
- package/dist/progress.cjs +270 -0
- package/dist/progress.d.cts +229 -0
- package/dist/progress.d.ts +229 -0
- package/dist/progress.js +245 -0
- package/dist/providers-5QhcwgSd.cjs +190 -0
- package/dist/providers-C3XQH-uu.js +119 -0
- package/dist/qr-code.cjs +195 -0
- package/dist/qr-code.d.cts +157 -0
- package/dist/qr-code.d.ts +157 -0
- package/dist/qr-code.js +174 -0
- package/dist/radio-group.cjs +274 -0
- package/dist/radio-group.d.cts +230 -0
- package/dist/radio-group.d.ts +230 -0
- package/dist/radio-group.js +249 -0
- package/dist/rating-group.cjs +243 -0
- package/dist/rating-group.d.cts +200 -0
- package/dist/rating-group.d.ts +200 -0
- package/dist/rating-group.js +220 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
- package/dist/scroll-area.cjs +206 -0
- package/dist/scroll-area.d.cts +169 -0
- package/dist/scroll-area.d.ts +169 -0
- package/dist/scroll-area.js +184 -0
- package/dist/segment-group.cjs +318 -0
- package/dist/segment-group.d.cts +229 -0
- package/dist/segment-group.d.ts +229 -0
- package/dist/segment-group.js +298 -0
- package/dist/select.cjs +560 -0
- package/dist/select.d.cts +430 -0
- package/dist/select.d.ts +430 -0
- package/dist/select.js +523 -0
- package/dist/signature-pad.cjs +260 -0
- package/dist/signature-pad.d.cts +200 -0
- package/dist/signature-pad.d.ts +200 -0
- package/dist/signature-pad.js +237 -0
- package/dist/slider.cjs +350 -0
- package/dist/slider.d.cts +299 -0
- package/dist/slider.d.ts +299 -0
- package/dist/slider.js +323 -0
- package/dist/splitter.cjs +225 -0
- package/dist/splitter.d.cts +166 -0
- package/dist/splitter.d.ts +166 -0
- package/dist/splitter.js +198 -0
- package/dist/steps.cjs +348 -0
- package/dist/steps.d.cts +289 -0
- package/dist/steps.d.ts +289 -0
- package/dist/steps.js +319 -0
- package/dist/swap.cjs +154 -0
- package/dist/swap.d.cts +98 -0
- package/dist/swap.d.ts +98 -0
- package/dist/swap.js +141 -0
- package/dist/switch.cjs +213 -0
- package/dist/switch.d.cts +177 -0
- package/dist/switch.d.ts +177 -0
- package/dist/switch.js +192 -0
- package/dist/tabs.cjs +240 -0
- package/dist/tabs.d.cts +179 -0
- package/dist/tabs.d.ts +179 -0
- package/dist/tabs.js +218 -0
- package/dist/tags-input.cjs +405 -0
- package/dist/tags-input.d.cts +340 -0
- package/dist/tags-input.d.ts +340 -0
- package/dist/tags-input.js +376 -0
- package/dist/timer.cjs +221 -0
- package/dist/timer.d.cts +176 -0
- package/dist/timer.d.ts +176 -0
- package/dist/timer.js +199 -0
- package/dist/toast.cjs +211 -0
- package/dist/toast.d.cts +157 -0
- package/dist/toast.d.ts +157 -0
- package/dist/toast.js +189 -0
- package/dist/toggle-group.cjs +150 -0
- package/dist/toggle-group.d.cts +122 -0
- package/dist/toggle-group.d.ts +122 -0
- package/dist/toggle-group.js +132 -0
- package/dist/toggle.cjs +107 -0
- package/dist/toggle.d.cts +98 -0
- package/dist/toggle.d.ts +98 -0
- package/dist/toggle.js +94 -0
- package/dist/tooltip.cjs +265 -0
- package/dist/tooltip.d.cts +204 -0
- package/dist/tooltip.d.ts +204 -0
- package/dist/tooltip.js +242 -0
- package/dist/tour.cjs +418 -0
- package/dist/tour.d.cts +304 -0
- package/dist/tour.d.ts +304 -0
- package/dist/tour.js +374 -0
- package/dist/tree-view-CWH9tv7s.cjs +651 -0
- package/dist/tree-view-CZcXMwi6.js +508 -0
- package/dist/tree-view.cjs +41 -0
- package/dist/tree-view.d.cts +3 -0
- package/dist/tree-view.d.ts +3 -0
- package/dist/tree-view.js +3 -0
- package/dist/types-rSRkzyd6.d.cts +13 -0
- package/dist/types-rSRkzyd6.d.ts +13 -0
- package/dist/use-presence-BSp_dR-C.d.cts +22 -0
- package/dist/use-presence-CtEY6ZT8.cjs +49 -0
- package/dist/use-presence-DkGU_j9h.d.ts +22 -0
- package/dist/use-presence-oNdFU2c2.js +42 -0
- package/dist/utils-D95V66v9.js +548 -0
- package/dist/utils-XrBZd2Yk.cjs +625 -0
- package/package.json +278 -6
package/dist/format.cjs
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
3
|
+
const require_providers = require("./providers-5QhcwgSd.cjs");
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
let _wirekyt_dom_i18n_utils = require("@wirekyt/dom/i18n-utils");
|
|
6
|
+
//#region src/components/format/byte.vue
|
|
7
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
8
|
+
__name: "byte",
|
|
9
|
+
props: {
|
|
10
|
+
unit: {},
|
|
11
|
+
unitDisplay: {},
|
|
12
|
+
unitSystem: {},
|
|
13
|
+
value: {}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const locale = require_providers.useLocaleContext(require_providers.DEFAULT_LOCALE);
|
|
18
|
+
const text = (0, vue.computed)(() => {
|
|
19
|
+
const { value, ...otherProps } = props;
|
|
20
|
+
return (0, _wirekyt_dom_i18n_utils.formatBytes)(value, locale.value.locale, otherProps);
|
|
21
|
+
});
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return (0, vue.toDisplayString)(text.value);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/format/number.vue
|
|
29
|
+
const _sfc_main$1 = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
30
|
+
__name: "number",
|
|
31
|
+
props: {
|
|
32
|
+
value: {},
|
|
33
|
+
compactDisplay: {},
|
|
34
|
+
notation: {},
|
|
35
|
+
signDisplay: {},
|
|
36
|
+
unit: {},
|
|
37
|
+
unitDisplay: {},
|
|
38
|
+
currencyDisplay: {},
|
|
39
|
+
currencySign: {}
|
|
40
|
+
},
|
|
41
|
+
setup(__props) {
|
|
42
|
+
const props = __props;
|
|
43
|
+
const locale = require_providers.useLocaleContext(require_providers.DEFAULT_LOCALE);
|
|
44
|
+
const text = (0, vue.computed)(() => {
|
|
45
|
+
const { value, ...intlProps } = props;
|
|
46
|
+
return (0, _wirekyt_dom_i18n_utils.formatNumber)(value, locale.value.locale, intlProps);
|
|
47
|
+
});
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return (0, vue.toDisplayString)(text.value);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/format/relative-time.vue
|
|
55
|
+
const _sfc_main$2 = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
56
|
+
__name: "relative-time",
|
|
57
|
+
props: {
|
|
58
|
+
value: {},
|
|
59
|
+
localeMatcher: {},
|
|
60
|
+
numeric: {},
|
|
61
|
+
style: {}
|
|
62
|
+
},
|
|
63
|
+
setup(__props) {
|
|
64
|
+
const props = __props;
|
|
65
|
+
const locale = require_providers.useLocaleContext(require_providers.DEFAULT_LOCALE);
|
|
66
|
+
const text = (0, vue.computed)(() => {
|
|
67
|
+
const { value, ...intlProps } = props;
|
|
68
|
+
return (0, _wirekyt_dom_i18n_utils.formatRelativeTime)(value, locale.value.locale, intlProps);
|
|
69
|
+
});
|
|
70
|
+
return (_ctx, _cache) => {
|
|
71
|
+
return (0, vue.toDisplayString)(text.value);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/format/time.vue
|
|
77
|
+
const _sfc_main$3 = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
78
|
+
__name: "time",
|
|
79
|
+
props: {
|
|
80
|
+
value: {},
|
|
81
|
+
format: {},
|
|
82
|
+
amLabel: {},
|
|
83
|
+
pmLabel: {},
|
|
84
|
+
withSeconds: { type: Boolean }
|
|
85
|
+
},
|
|
86
|
+
setup(__props) {
|
|
87
|
+
const props = __props;
|
|
88
|
+
const locale = require_providers.useLocaleContext(require_providers.DEFAULT_LOCALE);
|
|
89
|
+
const text = (0, vue.computed)(() => {
|
|
90
|
+
const { value, ...intlProps } = props;
|
|
91
|
+
return (0, _wirekyt_dom_i18n_utils.formatTime)(value, locale.value.locale, intlProps);
|
|
92
|
+
});
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return (0, vue.toDisplayString)(text.value);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/format/format.ts
|
|
100
|
+
var format_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
101
|
+
Byte: () => _sfc_main,
|
|
102
|
+
Number: () => _sfc_main$1,
|
|
103
|
+
RelativeTime: () => _sfc_main$2,
|
|
104
|
+
Time: () => _sfc_main$3
|
|
105
|
+
});
|
|
106
|
+
//#endregion
|
|
107
|
+
Object.defineProperty(exports, "Format", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function() {
|
|
110
|
+
return format_exports;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
exports.FormatByte = _sfc_main;
|
|
114
|
+
exports.FormatNumber = _sfc_main$1;
|
|
115
|
+
exports.FormatRelativeTime = _sfc_main$2;
|
|
116
|
+
exports.FormatTime = _sfc_main$3;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FormatTimeOptions } from "@wirekyt/dom/i18n-utils";
|
|
2
|
+
//#region src/components/format/byte.vue.d.ts
|
|
3
|
+
interface FormatByteProps {
|
|
4
|
+
unit?: "bit" | "byte";
|
|
5
|
+
unitDisplay?: "long" | "short" | "narrow";
|
|
6
|
+
unitSystem?: "decimal" | "binary";
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: typeof __VLS_export$3;
|
|
10
|
+
declare const __VLS_export$3: import("vue").DefineComponent<FormatByteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatByteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/format/number.vue.d.ts
|
|
13
|
+
interface FormatNumberProps {
|
|
14
|
+
value: number;
|
|
15
|
+
compactDisplay?: "short" | "long" | undefined;
|
|
16
|
+
notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
|
|
17
|
+
signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined;
|
|
18
|
+
unit?: string | undefined;
|
|
19
|
+
unitDisplay?: "short" | "long" | "narrow" | undefined;
|
|
20
|
+
currencyDisplay?: string | undefined;
|
|
21
|
+
currencySign?: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
declare const _default$1: typeof __VLS_export$2;
|
|
24
|
+
declare const __VLS_export$2: import("vue").DefineComponent<FormatNumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatNumberProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/format/relative-time.vue.d.ts
|
|
27
|
+
interface FormatRelativeTimeProps {
|
|
28
|
+
value: Date;
|
|
29
|
+
localeMatcher?: Intl.RelativeTimeFormatLocaleMatcher;
|
|
30
|
+
numeric?: Intl.RelativeTimeFormatNumeric;
|
|
31
|
+
style?: Intl.RelativeTimeFormatStyle;
|
|
32
|
+
}
|
|
33
|
+
declare const _default$2: typeof __VLS_export$1;
|
|
34
|
+
declare const __VLS_export$1: import("vue").DefineComponent<FormatRelativeTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatRelativeTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/format/time.vue.d.ts
|
|
37
|
+
interface FormatTimeProps extends FormatTimeOptions {
|
|
38
|
+
value: string | Date;
|
|
39
|
+
}
|
|
40
|
+
declare const _default$3: typeof __VLS_export;
|
|
41
|
+
declare const __VLS_export: import("vue").DefineComponent<FormatTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare namespace format_d_exports {
|
|
43
|
+
export { _default as Byte, FormatByteProps as ByteBaseProps, FormatByteProps as ByteProps, _default$1 as Number, FormatNumberProps as NumberBaseProps, FormatNumberProps as NumberProps, _default$2 as RelativeTime, FormatRelativeTimeProps as RelativeTimeBaseProps, FormatRelativeTimeProps as RelativeTimeProps, _default$3 as Time, FormatTimeProps as TimeBaseProps, FormatTimeProps as TimeProps };
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { format_d_exports as Format, _default as FormatByte, type FormatByteProps, _default$1 as FormatNumber, type FormatNumberProps, _default$2 as FormatRelativeTime, type FormatRelativeTimeProps, _default$3 as FormatTime, type FormatTimeProps };
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FormatTimeOptions } from "@wirekyt/dom/i18n-utils";
|
|
2
|
+
//#region src/components/format/byte.vue.d.ts
|
|
3
|
+
interface FormatByteProps {
|
|
4
|
+
unit?: "bit" | "byte";
|
|
5
|
+
unitDisplay?: "long" | "short" | "narrow";
|
|
6
|
+
unitSystem?: "decimal" | "binary";
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: typeof __VLS_export$3;
|
|
10
|
+
declare const __VLS_export$3: import("vue").DefineComponent<FormatByteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatByteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/format/number.vue.d.ts
|
|
13
|
+
interface FormatNumberProps {
|
|
14
|
+
value: number;
|
|
15
|
+
compactDisplay?: "short" | "long" | undefined;
|
|
16
|
+
notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
|
|
17
|
+
signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined;
|
|
18
|
+
unit?: string | undefined;
|
|
19
|
+
unitDisplay?: "short" | "long" | "narrow" | undefined;
|
|
20
|
+
currencyDisplay?: string | undefined;
|
|
21
|
+
currencySign?: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
declare const _default$1: typeof __VLS_export$2;
|
|
24
|
+
declare const __VLS_export$2: import("vue").DefineComponent<FormatNumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatNumberProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/format/relative-time.vue.d.ts
|
|
27
|
+
interface FormatRelativeTimeProps {
|
|
28
|
+
value: Date;
|
|
29
|
+
localeMatcher?: Intl.RelativeTimeFormatLocaleMatcher;
|
|
30
|
+
numeric?: Intl.RelativeTimeFormatNumeric;
|
|
31
|
+
style?: Intl.RelativeTimeFormatStyle;
|
|
32
|
+
}
|
|
33
|
+
declare const _default$2: typeof __VLS_export$1;
|
|
34
|
+
declare const __VLS_export$1: import("vue").DefineComponent<FormatRelativeTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatRelativeTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/format/time.vue.d.ts
|
|
37
|
+
interface FormatTimeProps extends FormatTimeOptions {
|
|
38
|
+
value: string | Date;
|
|
39
|
+
}
|
|
40
|
+
declare const _default$3: typeof __VLS_export;
|
|
41
|
+
declare const __VLS_export: import("vue").DefineComponent<FormatTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormatTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare namespace format_d_exports {
|
|
43
|
+
export { _default as Byte, FormatByteProps as ByteBaseProps, FormatByteProps as ByteProps, _default$1 as Number, FormatNumberProps as NumberBaseProps, FormatNumberProps as NumberProps, _default$2 as RelativeTime, FormatRelativeTimeProps as RelativeTimeBaseProps, FormatRelativeTimeProps as RelativeTimeProps, _default$3 as Time, FormatTimeProps as TimeBaseProps, FormatTimeProps as TimeProps };
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { format_d_exports as Format, _default as FormatByte, type FormatByteProps, _default$1 as FormatNumber, type FormatNumberProps, _default$2 as FormatRelativeTime, type FormatRelativeTimeProps, _default$3 as FormatTime, type FormatTimeProps };
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as DEFAULT_LOCALE, o as useLocaleContext } from "./providers-C3XQH-uu.js";
|
|
3
|
+
import { computed, defineComponent, toDisplayString } from "vue";
|
|
4
|
+
import { formatBytes, formatNumber, formatRelativeTime, formatTime } from "@wirekyt/dom/i18n-utils";
|
|
5
|
+
//#region src/components/format/byte.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
__name: "byte",
|
|
8
|
+
props: {
|
|
9
|
+
unit: {},
|
|
10
|
+
unitDisplay: {},
|
|
11
|
+
unitSystem: {},
|
|
12
|
+
value: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
17
|
+
const text = computed(() => {
|
|
18
|
+
const { value, ...otherProps } = props;
|
|
19
|
+
return formatBytes(value, locale.value.locale, otherProps);
|
|
20
|
+
});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return toDisplayString(text.value);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/format/number.vue
|
|
28
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
29
|
+
__name: "number",
|
|
30
|
+
props: {
|
|
31
|
+
value: {},
|
|
32
|
+
compactDisplay: {},
|
|
33
|
+
notation: {},
|
|
34
|
+
signDisplay: {},
|
|
35
|
+
unit: {},
|
|
36
|
+
unitDisplay: {},
|
|
37
|
+
currencyDisplay: {},
|
|
38
|
+
currencySign: {}
|
|
39
|
+
},
|
|
40
|
+
setup(__props) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
43
|
+
const text = computed(() => {
|
|
44
|
+
const { value, ...intlProps } = props;
|
|
45
|
+
return formatNumber(value, locale.value.locale, intlProps);
|
|
46
|
+
});
|
|
47
|
+
return (_ctx, _cache) => {
|
|
48
|
+
return toDisplayString(text.value);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/format/relative-time.vue
|
|
54
|
+
const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
55
|
+
__name: "relative-time",
|
|
56
|
+
props: {
|
|
57
|
+
value: {},
|
|
58
|
+
localeMatcher: {},
|
|
59
|
+
numeric: {},
|
|
60
|
+
style: {}
|
|
61
|
+
},
|
|
62
|
+
setup(__props) {
|
|
63
|
+
const props = __props;
|
|
64
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
65
|
+
const text = computed(() => {
|
|
66
|
+
const { value, ...intlProps } = props;
|
|
67
|
+
return formatRelativeTime(value, locale.value.locale, intlProps);
|
|
68
|
+
});
|
|
69
|
+
return (_ctx, _cache) => {
|
|
70
|
+
return toDisplayString(text.value);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/format/time.vue
|
|
76
|
+
const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
77
|
+
__name: "time",
|
|
78
|
+
props: {
|
|
79
|
+
value: {},
|
|
80
|
+
format: {},
|
|
81
|
+
amLabel: {},
|
|
82
|
+
pmLabel: {},
|
|
83
|
+
withSeconds: { type: Boolean }
|
|
84
|
+
},
|
|
85
|
+
setup(__props) {
|
|
86
|
+
const props = __props;
|
|
87
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
88
|
+
const text = computed(() => {
|
|
89
|
+
const { value, ...intlProps } = props;
|
|
90
|
+
return formatTime(value, locale.value.locale, intlProps);
|
|
91
|
+
});
|
|
92
|
+
return (_ctx, _cache) => {
|
|
93
|
+
return toDisplayString(text.value);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/format/format.ts
|
|
99
|
+
var format_exports = /* @__PURE__ */ __exportAll({
|
|
100
|
+
Byte: () => _sfc_main,
|
|
101
|
+
Number: () => _sfc_main$1,
|
|
102
|
+
RelativeTime: () => _sfc_main$2,
|
|
103
|
+
Time: () => _sfc_main$3
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
export { format_exports as Format, _sfc_main as FormatByte, _sfc_main$1 as FormatNumber, _sfc_main$2 as FormatRelativeTime, _sfc_main$3 as FormatTime };
|
package/dist/frame.cjs
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_providers = require("./providers-5QhcwgSd.cjs");
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
//#region src/components/frame/content.vue
|
|
5
|
+
const _sfc_main$1 = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
6
|
+
__name: "content",
|
|
7
|
+
emits: ["mount", "unmount"],
|
|
8
|
+
setup(__props, { emit: __emit }) {
|
|
9
|
+
const emit = __emit;
|
|
10
|
+
(0, vue.onMounted)(() => {
|
|
11
|
+
emit("mount");
|
|
12
|
+
});
|
|
13
|
+
(0, vue.onBeforeUnmount)(() => {
|
|
14
|
+
emit("unmount");
|
|
15
|
+
});
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return (0, vue.renderSlot)(_ctx.$slots, "default");
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/frame/frame.vue
|
|
23
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
24
|
+
__name: "frame",
|
|
25
|
+
props: {
|
|
26
|
+
head: {},
|
|
27
|
+
srcDoc: { default: "<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class=\"frame-root\"></div></body></html>" }
|
|
28
|
+
},
|
|
29
|
+
emits: ["mount", "unmount"],
|
|
30
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
31
|
+
const emit = __emit;
|
|
32
|
+
const props = __props;
|
|
33
|
+
const frameRef = (0, vue.ref)(null);
|
|
34
|
+
const mountNode = (0, vue.ref)(null);
|
|
35
|
+
__expose({ frameRef });
|
|
36
|
+
function getMountNode(frame) {
|
|
37
|
+
const doc = frame.contentWindow?.document;
|
|
38
|
+
if (!doc) return null;
|
|
39
|
+
return doc.body.querySelector(".frame-root") || doc.body;
|
|
40
|
+
}
|
|
41
|
+
(0, vue.watch)(frameRef, (node) => {
|
|
42
|
+
if (!node) return;
|
|
43
|
+
const doc = node.contentWindow?.document;
|
|
44
|
+
if (!doc) return;
|
|
45
|
+
doc.open();
|
|
46
|
+
doc.write(props.srcDoc);
|
|
47
|
+
doc.close();
|
|
48
|
+
mountNode.value = getMountNode(node);
|
|
49
|
+
});
|
|
50
|
+
(0, vue.watch)(() => [frameRef.value, mountNode.value], ([frameNode, mountNode], _oldValue, onCleanup) => {
|
|
51
|
+
if (!frameNode || !frameNode.contentDocument) return;
|
|
52
|
+
const win = frameNode.contentWindow;
|
|
53
|
+
if (!win) return;
|
|
54
|
+
const exec = () => {
|
|
55
|
+
win.requestAnimationFrame(() => {
|
|
56
|
+
if (!frameNode.contentDocument?.documentElement || !mountNode) return;
|
|
57
|
+
frameNode.style.setProperty("--width", `${mountNode.scrollWidth}px`);
|
|
58
|
+
frameNode.style.setProperty("--height", `${mountNode.scrollHeight}px`);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const resizeObserver = new win.ResizeObserver(exec);
|
|
62
|
+
exec();
|
|
63
|
+
if (mountNode) resizeObserver.observe(mountNode);
|
|
64
|
+
onCleanup(() => {
|
|
65
|
+
resizeObserver.disconnect();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const env = () => frameRef.value?.contentDocument ?? document;
|
|
69
|
+
return (_ctx, _cache) => {
|
|
70
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_providers._sfc_main$1), { value: env }, {
|
|
71
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("iframe", (0, vue.mergeProps)({
|
|
72
|
+
ref_key: "frameRef",
|
|
73
|
+
ref: frameRef
|
|
74
|
+
}, _ctx.$attrs), [mountNode.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
|
|
75
|
+
key: 0,
|
|
76
|
+
to: mountNode.value
|
|
77
|
+
}, [(0, vue.createVNode)(_sfc_main$1, {
|
|
78
|
+
onMount: _cache[0] || (_cache[0] = ($event) => emit("mount")),
|
|
79
|
+
onUnmount: _cache[1] || (_cache[1] = ($event) => emit("unmount"))
|
|
80
|
+
}, {
|
|
81
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
82
|
+
_: 3
|
|
83
|
+
})], 8, ["to"])) : (0, vue.createCommentVNode)("v-if", true), frameRef.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
|
|
84
|
+
key: 1,
|
|
85
|
+
to: frameRef.value.contentDocument.head
|
|
86
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "head")], 8, ["to"])) : (0, vue.createCommentVNode)("v-if", true)], 16)]),
|
|
87
|
+
_: 3
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
//#endregion
|
|
93
|
+
exports.Frame = _sfc_main;
|
package/dist/frame.d.cts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IframeHTMLAttributes, VNode } from "vue";
|
|
2
|
+
//#region src/components/frame/frame.vue.d.ts
|
|
3
|
+
interface FrameBaseProps {
|
|
4
|
+
head?: VNode | VNode[];
|
|
5
|
+
srcDoc?: string;
|
|
6
|
+
}
|
|
7
|
+
interface FrameProps extends FrameBaseProps,
|
|
8
|
+
/**
|
|
9
|
+
* @vue-ignore
|
|
10
|
+
*/
|
|
11
|
+
IframeHTMLAttributes {}
|
|
12
|
+
declare var __VLS_23: {}, __VLS_31: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
default?: (props: typeof __VLS_23) => any;
|
|
15
|
+
} & {
|
|
16
|
+
head?: (props: typeof __VLS_31) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<FrameProps, {
|
|
19
|
+
frameRef: import("vue").Ref<HTMLIFrameElement | null, HTMLIFrameElement | null>;
|
|
20
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
|
+
mount: () => any;
|
|
22
|
+
unmount: () => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<FrameProps> & Readonly<{
|
|
24
|
+
onMount?: (() => any) | undefined;
|
|
25
|
+
onUnmount?: (() => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
srcDoc: string;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { _default as Frame, type FrameBaseProps, type FrameProps };
|
package/dist/frame.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IframeHTMLAttributes, VNode } from "vue";
|
|
2
|
+
//#region src/components/frame/frame.vue.d.ts
|
|
3
|
+
interface FrameBaseProps {
|
|
4
|
+
head?: VNode | VNode[];
|
|
5
|
+
srcDoc?: string;
|
|
6
|
+
}
|
|
7
|
+
interface FrameProps extends FrameBaseProps,
|
|
8
|
+
/**
|
|
9
|
+
* @vue-ignore
|
|
10
|
+
*/
|
|
11
|
+
IframeHTMLAttributes {}
|
|
12
|
+
declare var __VLS_23: {}, __VLS_31: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
default?: (props: typeof __VLS_23) => any;
|
|
15
|
+
} & {
|
|
16
|
+
head?: (props: typeof __VLS_31) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<FrameProps, {
|
|
19
|
+
frameRef: import("vue").Ref<HTMLIFrameElement | null, HTMLIFrameElement | null>;
|
|
20
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
|
+
mount: () => any;
|
|
22
|
+
unmount: () => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<FrameProps> & Readonly<{
|
|
24
|
+
onMount?: (() => any) | undefined;
|
|
25
|
+
onUnmount?: (() => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
srcDoc: string;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { _default as Frame, type FrameBaseProps, type FrameProps };
|
package/dist/frame.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { l as _sfc_main$2 } from "./providers-C3XQH-uu.js";
|
|
2
|
+
import { Teleport, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, mergeProps, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, unref, watch, withCtx } from "vue";
|
|
3
|
+
//#region src/components/frame/content.vue
|
|
4
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
5
|
+
__name: "content",
|
|
6
|
+
emits: ["mount", "unmount"],
|
|
7
|
+
setup(__props, { emit: __emit }) {
|
|
8
|
+
const emit = __emit;
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
emit("mount");
|
|
11
|
+
});
|
|
12
|
+
onBeforeUnmount(() => {
|
|
13
|
+
emit("unmount");
|
|
14
|
+
});
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return renderSlot(_ctx.$slots, "default");
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/frame/frame.vue
|
|
22
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
23
|
+
__name: "frame",
|
|
24
|
+
props: {
|
|
25
|
+
head: {},
|
|
26
|
+
srcDoc: { default: "<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class=\"frame-root\"></div></body></html>" }
|
|
27
|
+
},
|
|
28
|
+
emits: ["mount", "unmount"],
|
|
29
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const props = __props;
|
|
32
|
+
const frameRef = ref(null);
|
|
33
|
+
const mountNode = ref(null);
|
|
34
|
+
__expose({ frameRef });
|
|
35
|
+
function getMountNode(frame) {
|
|
36
|
+
const doc = frame.contentWindow?.document;
|
|
37
|
+
if (!doc) return null;
|
|
38
|
+
return doc.body.querySelector(".frame-root") || doc.body;
|
|
39
|
+
}
|
|
40
|
+
watch(frameRef, (node) => {
|
|
41
|
+
if (!node) return;
|
|
42
|
+
const doc = node.contentWindow?.document;
|
|
43
|
+
if (!doc) return;
|
|
44
|
+
doc.open();
|
|
45
|
+
doc.write(props.srcDoc);
|
|
46
|
+
doc.close();
|
|
47
|
+
mountNode.value = getMountNode(node);
|
|
48
|
+
});
|
|
49
|
+
watch(() => [frameRef.value, mountNode.value], ([frameNode, mountNode], _oldValue, onCleanup) => {
|
|
50
|
+
if (!frameNode || !frameNode.contentDocument) return;
|
|
51
|
+
const win = frameNode.contentWindow;
|
|
52
|
+
if (!win) return;
|
|
53
|
+
const exec = () => {
|
|
54
|
+
win.requestAnimationFrame(() => {
|
|
55
|
+
if (!frameNode.contentDocument?.documentElement || !mountNode) return;
|
|
56
|
+
frameNode.style.setProperty("--width", `${mountNode.scrollWidth}px`);
|
|
57
|
+
frameNode.style.setProperty("--height", `${mountNode.scrollHeight}px`);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const resizeObserver = new win.ResizeObserver(exec);
|
|
61
|
+
exec();
|
|
62
|
+
if (mountNode) resizeObserver.observe(mountNode);
|
|
63
|
+
onCleanup(() => {
|
|
64
|
+
resizeObserver.disconnect();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
const env = () => frameRef.value?.contentDocument ?? document;
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return openBlock(), createBlock(unref(_sfc_main$2), { value: env }, {
|
|
70
|
+
default: withCtx(() => [createElementVNode("iframe", mergeProps({
|
|
71
|
+
ref_key: "frameRef",
|
|
72
|
+
ref: frameRef
|
|
73
|
+
}, _ctx.$attrs), [mountNode.value ? (openBlock(), createBlock(Teleport, {
|
|
74
|
+
key: 0,
|
|
75
|
+
to: mountNode.value
|
|
76
|
+
}, [createVNode(_sfc_main$1, {
|
|
77
|
+
onMount: _cache[0] || (_cache[0] = ($event) => emit("mount")),
|
|
78
|
+
onUnmount: _cache[1] || (_cache[1] = ($event) => emit("unmount"))
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
81
|
+
_: 3
|
|
82
|
+
})], 8, ["to"])) : createCommentVNode("v-if", true), frameRef.value ? (openBlock(), createBlock(Teleport, {
|
|
83
|
+
key: 1,
|
|
84
|
+
to: frameRef.value.contentDocument.head
|
|
85
|
+
}, [renderSlot(_ctx.$slots, "head")], 8, ["to"])) : createCommentVNode("v-if", true)], 16)]),
|
|
86
|
+
_: 3
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { _sfc_main as Frame };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./utils-XrBZd2Yk.cjs");
|
|
3
|
+
const require_clean_props = require("./clean-props-MyKqus13.cjs");
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
let _wirekyt_dom_highlight_word = require("@wirekyt/dom/highlight-word");
|
|
6
|
+
//#region src/components/highlight/use-highlight.ts
|
|
7
|
+
const useHighlight = (props) => {
|
|
8
|
+
return (0, vue.computed)(() => (0, _wirekyt_dom_highlight_word.highlightWord)(require_clean_props.cleanProps((0, vue.toValue)(props))));
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/highlight/highlight.vue
|
|
12
|
+
const _hoisted_1 = { key: 0 };
|
|
13
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
14
|
+
__name: "highlight",
|
|
15
|
+
props: {
|
|
16
|
+
text: {},
|
|
17
|
+
query: {},
|
|
18
|
+
ignoreCase: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
matchAll: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: void 0
|
|
25
|
+
},
|
|
26
|
+
exactMatch: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: void 0
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(__props) {
|
|
32
|
+
const props = __props;
|
|
33
|
+
if (typeof props.text !== "string") throw new Error("[ark-ui/highlight] text must be a string");
|
|
34
|
+
const chunks = useHighlight(props);
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(chunks), (chunk) => {
|
|
37
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [chunk.match ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("mark", _hoisted_1, (0, vue.toDisplayString)(chunk.text), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(chunk.text), 1)], 64))], 64);
|
|
38
|
+
}), 256);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.Highlight = _sfc_main;
|
|
44
|
+
exports.useHighlight = useHighlight;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTMLAttributes, MaybeRef } from "vue";
|
|
2
|
+
//#region src/components/highlight/types.d.ts
|
|
3
|
+
interface UseHighlightProps {
|
|
4
|
+
text: string;
|
|
5
|
+
query: string | string[];
|
|
6
|
+
ignoreCase?: boolean;
|
|
7
|
+
matchAll?: boolean;
|
|
8
|
+
exactMatch?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface HighlightChunk {
|
|
11
|
+
text: string;
|
|
12
|
+
match: boolean;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/highlight/use-highlight.d.ts
|
|
16
|
+
declare const useHighlight: (props: MaybeRef<UseHighlightProps>) => import("vue").ComputedRef<import("@wirekyt/dom/highlight-word").HighlightChunk[]>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/highlight/highlight.vue.d.ts
|
|
19
|
+
interface HighlightBaseProps extends UseHighlightProps {}
|
|
20
|
+
interface HighlightProps extends HighlightBaseProps,
|
|
21
|
+
/**
|
|
22
|
+
* @vue-ignore
|
|
23
|
+
*/
|
|
24
|
+
HTMLAttributes {}
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
declare const __VLS_export: import("vue").DefineComponent<HighlightProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<HighlightProps> & Readonly<{}>, {
|
|
27
|
+
ignoreCase: boolean;
|
|
28
|
+
matchAll: boolean;
|
|
29
|
+
exactMatch: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { _default as Highlight, type HighlightChunk, type HighlightProps, type UseHighlightProps, useHighlight };
|