This commit is contained in:
2022-12-09 16:41:41 +08:00
parent c1cce5a7c2
commit ff7aa8774f
2003 changed files with 156639 additions and 140 deletions

View File

@@ -0,0 +1,16 @@
<script lang="ts">
export default {
name: "AppIcon",
};
</script>
<script setup lang="ts">
import LayIcon from "../component/icon/index";
const props = defineProps<{
color?: string;
size?: string;
}>();
</script>
<template>
<lay-icon :color="props.color" :size="props.size" type="layui-icon-app" />
</template>

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}
readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi
readonly husky_skip_init=1
export husky_skip_init
sh -e "$0" "$@"
exitCode="$?"
if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi
if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi
exit $exitCode
fi

View File

@@ -0,0 +1,38 @@
{
"name": "@layui/icons-vue",
"version": "1.0.9",
"description": "a component library for Vue 3 base on layui-vue",
"homepage": "http://www.layui-vue.com",
"module": "lib/icons-vue.es.js",
"main": "lib/icons-vue.umd.js",
"exports": {
".": {
"import": "./lib/icons-vue.es.js",
"require": "./lib/icons-vue.umd.js"
},
"./lib/": "./lib/"
},
"types": "types/index.d.ts",
"style": "lib/index.css",
"scripts": {
"generate": "node ./scripts/generate.ts",
"build": "vite build --emptyOutDir && npm run build:types",
"build:types": "rimraf types && tsc -d"
},
"keywords": [
"layui-icon",
"icons-vue",
"vue"
],
"author": "就眠儀式",
"license": "MIT",
"files": [
"lib",
"types"
],
"browserslist": [
"current node",
"last 2 versions and > 2%",
"ie > 10"
]
}

View File

@@ -0,0 +1,104 @@
import { w as withInstall } from "../badge/index2.js";
import { defineComponent, inject, computed, openBlock, createElementBlock, createElementVNode, unref, normalizeClass, withModifiers, renderSlot, createTextVNode, toDisplayString } from "vue";
var index = /* @__PURE__ */ (() => ".layui-radio[size=lg] .layui-form-radio>i{font-size:24px}.layui-radio[size=md] .layui-form-radio>i{font-size:22px}.layui-radio[size=sm] .layui-form-radio>i{font-size:20px}.layui-radio[size=xs] .layui-form-radio>i{font-size:18px}.layui-radio input[type=radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:var(--global-neutral-color-8)}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:var(--global-checked-color)}.layui-radio-disabled>i{color:var(--global-neutral-color-3)!important}.layui-radio-disabled *{color:var(--global-neutral-color-8)!important}\n")();
const _hoisted_1 = ["size"];
const _hoisted_2 = ["value", "name"];
const _hoisted_3 = ["onClick"];
const _hoisted_4 = {
key: 0,
class: "layui-anim layui-icon layui-anim-scaleSpring"
};
const _hoisted_5 = {
key: 1,
class: "layui-icon layui-form-radioed"
};
const __default__ = {
name: "LayRadio"
};
const _sfc_main = defineComponent({
...__default__,
props: {
name: null,
size: { default: "md" },
disabled: { type: Boolean },
modelValue: { type: [String, Boolean, Number] },
value: { type: [String, Boolean, Number] },
label: null
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const radioGroup = inject("radioGroup", {});
const isGroup = computed(() => {
return radioGroup != void 0 && (radioGroup == null ? void 0 : radioGroup.name) === "LayRadioGroup";
});
const naiveName = computed(() => {
if (radioGroup.naiveName) {
return radioGroup.naiveName;
} else {
return props.name;
}
});
const isChecked = computed({
get() {
if (isGroup.value) {
return radioGroup.modelValue.value === props.value;
} else {
return props.modelValue === props.value;
}
},
set(val) {
if (isGroup.value) {
radioGroup.modelValue.value = props.value;
} else {
if (val) {
emit("change", props.value);
emit("update:modelValue", props.value);
}
}
}
});
const handleClick = function() {
if (!ifDisabled.value) {
isChecked.value = !isChecked.value;
}
};
const ifDisabled = computed(() => {
if (props.disabled) {
return true;
}
if (radioGroup.hasOwnProperty("disabled") && radioGroup.disabled.value) {
return true;
}
return false;
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
class: "layui-radio",
size: __props.size
}, [
createElementVNode("input", {
type: "radio",
value: __props.value,
name: unref(naiveName)
}, null, 8, _hoisted_2),
createElementVNode("div", {
class: normalizeClass(["layui-unselect layui-form-radio", {
"layui-form-radioed": unref(isChecked),
"layui-radio-disabled layui-disabled": unref(ifDisabled)
}]),
onClick: withModifiers(handleClick, ["stop"])
}, [
unref(isChecked) ? (openBlock(), createElementBlock("i", _hoisted_4, "\uE643")) : (openBlock(), createElementBlock("i", _hoisted_5, "\uE63F")),
createElementVNode("span", null, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString(__props.label), 1)
])
])
], 10, _hoisted_3)
], 8, _hoisted_1);
};
}
});
const component = withInstall(_sfc_main);
export { _sfc_main as _, component as c };