@histoire/controls 0.15.1 → 0.15.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/components/HstCopyIcon.vue.d.ts +3 -2
- package/dist/components/button/HstButtonGroup.vue.d.ts +2 -2
- package/dist/components/checkbox/HstCheckbox.vue.d.ts +2 -2
- package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +2 -2
- package/dist/components/number/HstNumber.vue.d.ts +2 -2
- package/dist/components/radio/HstRadio.vue.d.ts +2 -2
- package/dist/components/select/HstSelect.vue.d.ts +2 -2
- package/dist/components/slider/HstSlider.vue.d.ts +2 -2
- package/dist/components/text/HstText.vue.d.ts +2 -2
- package/dist/components/textarea/HstTextarea.vue.d.ts +2 -2
- package/dist/index.d.ts +688 -748
- package/dist/index.es.js +5 -2
- package/package.json +3 -2
- package/src/components/HstCopyIcon.vue +6 -2
- package/src/components/button/HstButtonGroup.vue +1 -1
- package/src/components/checkbox/HstCheckbox.vue +1 -1
- package/src/components/checkbox/HstSimpleCheckbox.vue +1 -1
- package/src/components/number/HstNumber.vue +1 -1
- package/src/components/radio/HstRadio.vue +1 -1
- package/src/components/select/HstSelect.vue +1 -1
- package/src/components/slider/HstSlider.vue +1 -1
- package/src/components/text/HstText.vue +1 -1
- package/src/components/textarea/HstTextarea.vue +1 -1
package/dist/index.es.js
CHANGED
|
@@ -525,10 +525,13 @@ const Qa = {
|
|
|
525
525
|
}, Me = /* @__PURE__ */ tt({
|
|
526
526
|
...Xa,
|
|
527
527
|
props: {
|
|
528
|
-
content:
|
|
528
|
+
content: { type: [String, Function] }
|
|
529
529
|
},
|
|
530
530
|
setup(s) {
|
|
531
|
-
const t = s, { copy: e, copied: i } = da(), n = () =>
|
|
531
|
+
const t = s, { copy: e, copied: i } = da(), n = async () => {
|
|
532
|
+
const r = typeof t.content == "function" ? await t.content() : t.content;
|
|
533
|
+
e(r);
|
|
534
|
+
};
|
|
532
535
|
return (r, o) => Wt((C(), Q(H(zs), {
|
|
533
536
|
icon: "carbon:copy-file",
|
|
534
537
|
class: "htw-w-4 htw-h-4 htw-opacity-50 hover:htw-opacity-100 hover:htw-text-primary-500 htw-cursor-pointer",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/controls",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Prebuilt controls components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"@codemirror/state": "^6.1.2",
|
|
39
39
|
"@codemirror/theme-one-dark": "^6.1.0",
|
|
40
40
|
"@codemirror/view": "^6.3.0",
|
|
41
|
-
"@histoire/
|
|
41
|
+
"@histoire/shared": "^0.15.2",
|
|
42
|
+
"@histoire/vendors": "^0.15.2"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@peeky/server": "^0.14.0",
|
|
@@ -8,14 +8,18 @@ export default {
|
|
|
8
8
|
import { Icon } from '@iconify/vue'
|
|
9
9
|
import { useClipboard } from '@vueuse/core'
|
|
10
10
|
import { VTooltip as vTooltip } from 'floating-vue'
|
|
11
|
+
import type { Awaitable } from '@histoire/shared'
|
|
11
12
|
|
|
12
13
|
const props = defineProps<{
|
|
13
|
-
content: string
|
|
14
|
+
content: string | (() => Awaitable<string>)
|
|
14
15
|
}>()
|
|
15
16
|
|
|
16
17
|
const { copy, copied } = useClipboard()
|
|
17
18
|
|
|
18
|
-
const action = () =>
|
|
19
|
+
const action = async () => {
|
|
20
|
+
const content = typeof props.content === 'function' ? await props.content() : props.content
|
|
21
|
+
copy(content)
|
|
22
|
+
}
|
|
19
23
|
</script>
|
|
20
24
|
|
|
21
25
|
<template>
|