@elmethis/core 1.0.0-alpha.188 → 1.0.0-alpha.189
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
try {
|
|
4
4
|
if (typeof document != "undefined") {
|
|
5
5
|
var elementStyle = document.createElement("style");
|
|
6
|
-
elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-
|
|
6
|
+
elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-2613cb18],.v-leave-from[data-v-2613cb18]{opacity:1}.v-enter-active[data-v-2613cb18],.v-leave-active[data-v-2613cb18]{transition:opacity .1s}.v-enter-from[data-v-2613cb18],.v-leave-to[data-v-2613cb18]{opacity:0}"));
|
|
7
7
|
document.head.appendChild(elementStyle);
|
|
8
8
|
}
|
|
9
9
|
} catch (e) {
|
|
@@ -17,7 +17,7 @@ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
|
17
17
|
const cssModules = {
|
|
18
18
|
"$style": style0
|
|
19
19
|
};
|
|
20
|
-
const ElmButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-
|
|
20
|
+
const ElmButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-2613cb18"]]);
|
|
21
21
|
export {
|
|
22
22
|
ElmButton as default
|
|
23
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createVNode, Transition, withCtx, createBlock, renderSlot } from "vue";
|
|
1
|
+
import { defineComponent, ref, onUnmounted, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, createVNode, Transition, withCtx, createBlock, renderSlot } from "vue";
|
|
2
2
|
import ElmDotLoadingIcon from "../icon/ElmDotLoadingIcon.vue.mjs";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "ElmButton",
|
|
@@ -11,11 +11,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
},
|
|
12
12
|
setup(__props) {
|
|
13
13
|
const props = __props;
|
|
14
|
+
const clicked = ref(false);
|
|
15
|
+
const id = ref();
|
|
14
16
|
const handleClick = () => {
|
|
15
17
|
if (!props.loading && !props.disabled && props.onClick) {
|
|
18
|
+
clicked.value = true;
|
|
19
|
+
id.value = window.setTimeout(() => clicked.value = false, 300);
|
|
16
20
|
props.onClick();
|
|
17
21
|
}
|
|
18
22
|
};
|
|
23
|
+
onUnmounted(() => {
|
|
24
|
+
if (id.value) clearTimeout(id.value);
|
|
25
|
+
});
|
|
19
26
|
return (_ctx, _cache) => {
|
|
20
27
|
return openBlock(), createElementBlock("button", {
|
|
21
28
|
class: normalizeClass([
|
|
@@ -34,6 +41,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
41
|
}),
|
|
35
42
|
onClick: handleClick
|
|
36
43
|
}, [
|
|
44
|
+
clicked.value ? (openBlock(), createElementBlock("div", {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: normalizeClass(_ctx.$style.ripple)
|
|
47
|
+
}, null, 2)) : createCommentVNode("", true),
|
|
37
48
|
createVNode(Transition, { mode: "out-in" }, {
|
|
38
49
|
default: withCtx(() => [
|
|
39
50
|
_ctx.loading ? (openBlock(), createBlock(ElmDotLoadingIcon, {
|
|
@@ -3,24 +3,27 @@
|
|
|
3
3
|
try {
|
|
4
4
|
if (typeof document != "undefined") {
|
|
5
5
|
var elementStyle = document.createElement("style");
|
|
6
|
-
elementStyle.appendChild(document.createTextNode(".
|
|
6
|
+
elementStyle.appendChild(document.createTextNode("._button_mdlzb_1{all:unset;position:relative;overflow:hidden;min-height:2.75rem;justify-content:center;align-items:center;gap:.5rem;border-radius:.25rem;box-sizing:border-box;padding:.5rem 1.5rem;line-height:1.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;transition:opacity .2s,transform .2s;opacity:var(--opacity)}._normal_mdlzb_19{box-shadow:0 0 .25rem #0003;color:#0009;background-color:#fffc}[data-theme=dark] ._normal_mdlzb_19{box-shadow:0 0 .25rem #0009;color:#fff9;background-color:#ffffff1a}._primary_mdlzb_30{box-shadow:0 0 .25rem #0003;color:#fff9;background-color:#000c}[data-theme=dark] ._primary_mdlzb_30{box-shadow:0 0 .25rem #0009;color:#0009;background-color:#fffc}._enable_mdlzb_41{transition:opacity .2s,transform .2s}[data-theme=dark] ._enable_mdlzb_41:hover{transform:translate(-1px) translateY(-1px);opacity:.7;opacity:var(--opacity, .7)}[data-theme=dark] ._enable_mdlzb_41:active{transform:translate(1px) translateY(1px);opacity:.5;opacity:var(--opacity, .5)}._enable_mdlzb_41:hover{transform:translate(-1px) translateY(-1px);opacity:.7;opacity:var(--opacity, .7)}._enable_mdlzb_41:active{transform:translate(1px) translateY(1px);opacity:.5;opacity:var(--opacity, .5)}._flex_mdlzb_61{display:flex;justify-content:center;align-items:center;gap:.5rem}@keyframes _button-ripple_mdlzb_1{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:0}}._ripple_mdlzb_78{position:absolute;pointer-events:none;border-radius:50%;background-color:#80808059;width:100%;aspect-ratio:1/1;transition:none;opacity:0;animation-name:_button-ripple_mdlzb_1;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:ease-out}"));
|
|
7
7
|
document.head.appendChild(elementStyle);
|
|
8
8
|
}
|
|
9
9
|
} catch (e) {
|
|
10
10
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
|
-
const button = "
|
|
14
|
-
const normal = "
|
|
15
|
-
const primary = "
|
|
16
|
-
const enable = "
|
|
17
|
-
const flex = "
|
|
13
|
+
const button = "_button_mdlzb_1";
|
|
14
|
+
const normal = "_normal_mdlzb_19";
|
|
15
|
+
const primary = "_primary_mdlzb_30";
|
|
16
|
+
const enable = "_enable_mdlzb_41";
|
|
17
|
+
const flex = "_flex_mdlzb_61";
|
|
18
|
+
const ripple = "_ripple_mdlzb_78";
|
|
18
19
|
const style0 = {
|
|
19
20
|
button,
|
|
20
21
|
normal,
|
|
21
22
|
primary,
|
|
22
23
|
enable,
|
|
23
|
-
flex
|
|
24
|
+
flex,
|
|
25
|
+
ripple,
|
|
26
|
+
"button-ripple": "_button-ripple_mdlzb_1"
|
|
24
27
|
};
|
|
25
28
|
export {
|
|
26
29
|
button,
|
|
@@ -28,5 +31,6 @@ export {
|
|
|
28
31
|
enable,
|
|
29
32
|
flex,
|
|
30
33
|
normal,
|
|
31
|
-
primary
|
|
34
|
+
primary,
|
|
35
|
+
ripple
|
|
32
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elmethis/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.189",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@notionhq/client": "^2.3.0",
|
|
37
|
+
"@storybook/vue3": "^8.6.12",
|
|
37
38
|
"@types/json-schema": "^7.0.15",
|
|
38
39
|
"@types/katex": "^0.16.7",
|
|
39
40
|
"@types/lodash-es": "^4.17.12",
|