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,42 @@
.layui-space {
display: inline-flex;
&-horizontal {
.layui-space-item {
display: flex;
align-items: center;
}
}
&-vertical {
flex-direction: column;
}
&-wrap {
flex-wrap: wrap;
}
&-fill {
display: flex;
}
&-align-start {
align-items: flex-start;
}
&-align-center {
align-items: center;
}
&-align-end {
align-items: flex-end;
}
&-align-baseline {
align-items: baseline;
}
&-item {
width: inherit;
}
}

View File

@@ -0,0 +1,109 @@
import { w as withInstall } from "../badge/index2.js";
import { defineComponent, onMounted, provide, reactive, toRefs, openBlock, createElementBlock, renderSlot } from "vue";
var index = /* @__PURE__ */ (() => '.layui-form-item{margin-bottom:20px;clear:both}.layui-form-item-right .layui-form-label{text-align:right}.layui-form-item-left .layui-form-label{text-align:left}.layui-form-item-top .layui-form-label{text-align:left;float:none}.layui-form-item-top>div{margin-left:0}.layui-form-item:after{content:" ";clear:both;display:block;height:0}.layui-form-label{float:left;display:block;width:95px;padding-right:15px;line-height:38px;font-weight:400}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#ff5722!important}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-required{color:#ff5722;font-size:12px;line-height:1}.layui-form .layui-form-item .layui-input-block .layui-form-danger,.layui-form .layui-form-item .layui-input-inline .layui-form-danger,.layui-form .layui-form-item .layui-input-block .layui-form-danger .layui-textarea,.layui-form .layui-form-item .layui-input-inline .layui-form-danger .layui-textarea,.layui-form .layui-form-item .layui-input-block .layui-form-danger .layui-tag-input,.layui-form .layui-form-item .layui-input-inline .layui-form-danger .layui-tag-input,.layui-form .layui-form-item .layui-input-block .layui-form-danger .layui-input,.layui-form .layui-form-item .layui-input-inline .layui-form-danger .layui-input{border-color:#ff5722!important}.layui-error-message{color:#ff5722;font-size:12px;line-height:1;padding-top:5px;position:absolute;top:100%;left:0}.layui-error-message-anim{-ms-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-animation:layui-top-show-anim .3s ease 1;animation:layui-top-show-anim .3s ease 1}@keyframes layui-top-show-anim{0%{opacity:.3;transform:rotateX(45deg)}to{opacity:1;transform:rotateX(0)}}\n')();
const __default__ = {
name: "LayForm"
};
const _sfc_main = defineComponent({
...__default__,
props: {
model: { default: function() {
return {};
} },
required: { type: Boolean },
rules: null,
initValidate: { type: Boolean, default: false },
requiredIcons: { default: "" },
requiredErrorMessage: null,
validateMessage: null,
useCN: { type: Boolean, default: true }
},
emits: ["submit"],
setup(__props, { expose, emit }) {
const props = __props;
const formItems = [];
const formItemMap = {};
onMounted(() => {
var _a;
props.initValidate && ((_a = validate()) == null ? void 0 : _a.catch((err) => {
}));
});
const submit = function() {
let _isValidate = false;
validate((isValidate, model, errors) => {
_isValidate = isValidate;
emit("submit", isValidate, model, errors);
});
return _isValidate;
};
const validate = function(fields, callback) {
let validateItems = formItems;
if (typeof fields === "function") {
callback = fields;
} else if (typeof fields === "string" || Array.isArray(fields) && fields.length > 0) {
validateItems = [];
const validateFields = !fields ? [] : [].concat(fields);
validateFields.forEach((field) => formItemMap[field] && validateItems.push(formItemMap[field]));
}
let errorsArrs = [];
validateItems.forEach((filed) => {
filed.validate((errors, _fields) => {
errorsArrs = errorsArrs.concat(errors);
});
});
const isValidate = errorsArrs.length === 0;
if (typeof callback === "function") {
isValidate ? callback(true, props.model, null) : callback(false, props.model, errorsArrs);
return null;
}
return new Promise((resolve, reject) => {
const callbackParams = {
isValidate,
model: props.model,
errors: isValidate ? null : errorsArrs
};
callbackParams.isValidate ? resolve(callbackParams) : reject(callbackParams);
});
};
const clearValidate = function(fields) {
const clearFields = !fields ? [] : [].concat(fields);
if (clearFields.length === 0) {
formItems.forEach((filed) => filed.clearValidate());
} else {
clearFields.forEach((field) => formItemMap[field] && formItemMap[field].clearValidate());
}
};
const reset = function() {
for (const key in props.model) {
props.model[key] = null;
}
setTimeout(() => {
var _a;
return (_a = validate()) == null ? void 0 : _a.catch((err) => {
});
}, 0);
};
const addField = function(item) {
formItems.push(item);
formItemMap[item.prop] = item;
};
expose({ validate, clearValidate, reset });
provide("LayForm", reactive({
formItems,
addField,
clearValidate,
validate,
...toRefs(props)
}));
return (_ctx, _cache) => {
return openBlock(), createElementBlock("form", {
class: "layui-form",
onsubmit: submit
}, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component = withInstall(_sfc_main);
export { component as default };

View File

@@ -0,0 +1,98 @@
import { w as withInstall } from "../badge/index2.js";
import { defineComponent, ref, computed, onMounted, watch, openBlock, createElementBlock, mergeProps, toHandlerKey, createElementVNode, normalizeClass, unref, normalizeStyle, renderSlot } from "vue";
var index = /* @__PURE__ */ (() => ".layui-water-ripples-container{position:relative;display:inline-block}.layui-water-ripples-container .layui-slot-container{position:relative;z-index:2}.layui-water-ripples-container .layui-out-ripples{position:absolute;left:0;top:0;height:100%;opacity:1;z-index:1;pointer-events:none}.layui-water-ripples-container .layui-animate-once--out{animation:ripple-effect 1s forwards}.layui-water-ripples-container .layui-animate-always--out{animation:ripple-effect 1s infinite}@keyframes ripple-effect{0%{box-shadow:0 0 0 0 var(--layui-ripple-color);opacity:.4}to{box-shadow:0 0 0 var(--layui-spread-width) var(--layui-ripple-color);opacity:0}}.layui-water-ripples-container .layui-inset-ripples{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);opacity:1;width:0px;height:0px;background:var(--layui-ripple-color);pointer-events:none}@keyframes size-effect{0%{width:0px;height:0px;opacity:.8}to{width:var(--layui-spread-size);height:var(--layui-spread-size);opacity:0}}.layui-water-ripples-container .layui-animate-once--inset{animation:size-effect 1s forwards}.layui-water-ripples-container .layui-animate-always--inset{animation:size-effect 1s infinite}\n")();
const __default__ = {
name: "LayRipple"
};
const _sfc_main = defineComponent({
...__default__,
props: {
type: { default: "inset" },
color: { default: "currentColor" },
borderRadius: { default: "0" },
spreadWidth: { default: "6px" },
spreadSize: null,
trigger: { default: "click" },
center: { type: Boolean, default: false }
},
setup(__props) {
const props = __props;
const isActiveRef = ref(false);
const spreadSizeRef = ref("0px");
const ripplesRefEl = ref(null);
const waterRipplesContainerRefEl = ref(null);
const isOut = computed(() => {
return props.type === "out";
});
const rippleX = ref(void 0);
const rippleY = ref(void 0);
const onActive = function(event) {
isActiveRef.value = true;
if (props.type === "inset" && !props.spreadSize && !props.center) {
const el = event.currentTarget;
const rect = el.getBoundingClientRect();
const rippleOffsetLeft = event.clientX - rect.left;
const rippleOffsetTop = event.clientY - rect.top;
const sizeX = Math.max(rippleOffsetLeft, rect.width - rippleOffsetLeft);
const sizeY = Math.max(rippleOffsetTop, rect.height - rippleOffsetTop);
rippleX.value = rippleOffsetLeft + "px";
rippleY.value = rippleOffsetTop + "px";
spreadSizeRef.value = Math.sqrt(sizeX ** 2 + sizeY ** 2) * 2 + "px";
}
};
const initWidth = function() {
let container = waterRipplesContainerRefEl.value;
let ripples = ripplesRefEl.value;
if (!container || !ripples)
return;
if (props.type == "out") {
ripples.style.width = container.clientWidth + "px";
} else {
container.style.overflow = "hidden";
if (!props.spreadSize || props.center) {
spreadSizeRef.value = container.clientWidth * 1.1 + "px";
} else {
spreadSizeRef.value = props.spreadSize;
}
}
ripples.addEventListener("animationend", () => {
isActiveRef.value = false;
}, false);
};
onMounted(() => {
initWidth();
});
watch(() => props.trigger, (val) => isActiveRef.value = val === "always", { immediate: true });
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", mergeProps({
class: "layui-water-ripples-container",
ref_key: "waterRipplesContainerRefEl",
ref: waterRipplesContainerRefEl
}, { [toHandlerKey(__props.trigger)]: onActive }), [
createElementVNode("div", {
ref_key: "ripplesRefEl",
ref: ripplesRefEl,
class: normalizeClass({
"layui-out-ripples": unref(isOut),
"layui-inset-ripples": __props.type == "inset",
"layui-animate-always--out": isActiveRef.value && __props.trigger == "always" && __props.type == "out",
"layui-animate-once--out": isActiveRef.value && (__props.trigger == "mouseenter" || __props.trigger == "click") && __props.type == "out",
"layui-animate-always--inset": isActiveRef.value && __props.trigger == "always" && __props.type == "inset",
"layui-animate-once--inset": isActiveRef.value && (__props.trigger == "mouseenter" || __props.trigger == "click") && __props.type == "inset"
}),
style: normalizeStyle({
borderRadius: unref(isOut) ? __props.borderRadius : "50%",
left: rippleX.value,
top: rippleY.value,
"--layui-ripple-color": __props.color,
"--layui-spread-width": __props.spreadWidth,
"--layui-spread-size": spreadSizeRef.value
})
}, null, 6),
renderSlot(_ctx.$slots, "default")
], 16);
};
}
});
const component = withInstall(_sfc_main);
export { component as default };

View File

@@ -0,0 +1,163 @@
import { w as withInstall } from "../badge/index2.js";
import { defineComponent, ref, inject, getCurrentInstance, computed, reactive, onMounted, onBeforeUnmount, unref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createBlock, Fragment, toDisplayString, createTextVNode } from "vue";
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
const _hoisted_1 = { key: 0 };
const _hoisted_2 = { class: "lay-step-item-content-title" };
const __default__ = {
name: "LayStepItem"
};
const _sfc_main = defineComponent({
...__default__,
props: {
title: { default: "" },
content: { default: "" },
icon: { default: "" },
status: { default: "" }
},
setup(__props) {
const index = ref(-1);
const parents = inject("LayStep");
const currentInstance = getCurrentInstance();
const setIndex = (val) => {
index.value = val;
};
const onChange = (index2) => {
parents.change(index2);
};
const stepsCount = computed(() => {
return parents.steps.value.length;
});
const currentStatus = computed(() => {
return parents.props.currentStatus;
});
const simple = computed(() => {
return parents.props.simple;
});
const composition = computed(() => {
return parents.props.composition;
});
const isCurrent = computed(() => {
return parents.props.active;
});
const isCurrentBorder = computed(() => {
return parents.props.active + 1;
});
const space = computed(() => {
return parents.props.space;
});
const isVertical = computed(() => {
return parents.props.direction === "vertical";
});
const isCenter = computed(() => {
return parents.props.center;
});
const isLineActive = computed(() => {
return index.value <= parents.props.active - 1;
});
const isWait = computed(() => {
return index.value === parents.props.active + 1;
});
const isSimpleActive = computed(() => {
return index.value - 1 <= parents.props.active;
});
const isActive = computed(() => {
return index.value <= parents.props.active;
});
const isLast = computed(() => {
var _a;
return ((_a = parents.steps.value[stepsCount.value - 1]) == null ? void 0 : _a.itemId) === currentInstance.uid;
});
const isStart = computed(() => {
var _a;
return ((_a = parents.steps.value[0]) == null ? void 0 : _a.itemId) === currentInstance.uid;
});
const stepItemState = reactive({
itemId: computed(() => currentInstance == null ? void 0 : currentInstance.uid),
setIndex
});
parents.steps.value = [...parents.steps.value, stepItemState];
onMounted(() => {
});
onBeforeUnmount(() => {
parents.steps.value = parents.steps.value.filter((instance) => instance.itemId !== currentInstance.uid);
});
return (_ctx, _cache) => {
return !unref(simple) ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass([
"lay-step-item",
unref(isLast) && !unref(isCenter) && unref(composition) !== "row" ? "lay-step-item-last" : "",
unref(isCenter) ? "is-item-center" : "",
unref(isVertical) ? "is-vertical" : ""
]),
style: normalizeStyle({ flexBasis: unref(space), flexGrow: unref(space) === "auto" ? 1 : 0 })
}, [
createElementVNode("div", {
class: normalizeClass([
!unref(isLast) ? unref(isLineActive) ? `lay-step-item-line lay-step-item-line-${__props.status || "active"}` : "lay-step-item-line" : "",
unref(isCenter) ? "is-line-center" : ""
])
}, [
createElementVNode("div", {
class: normalizeClass([
"lay-step-item-pace",
unref(isActive) ? `lay-step-item-active` : "",
unref(isCurrent) === index.value ? `lay-step-item--${unref(currentStatus)}` : "",
__props.status ? `lay-step-item-${__props.status}` : "",
unref(isWait) ? "lay-step-item-wait" : "",
unref(isCenter) ? "is-center" : ""
]),
onClick: _cache[0] || (_cache[0] = ($event) => onChange(index.value + 1))
}, [
renderSlot(_ctx.$slots, "pace", {}, () => [
__props.icon ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 0,
type: __props.icon
}, null, 8, ["type"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
!unref(isActive) ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(index.value + 1), 1)) : (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 1,
type: __props.status === "fail" ? "layui-icon-close" : "layui-icon-ok"
}, null, 8, ["type"]))
], 64))
])
], 2)
], 2),
createElementVNode("div", {
class: normalizeClass([
"lay-step-item-content",
unref(composition) === "row" ? "lay-step-item-content-row" : "",
unref(isActive) ? `lay-step-item-content-active` : "",
unref(isCurrent) === index.value ? `lay-step-item-content--${unref(currentStatus)}` : "",
__props.status ? `lay-step-item-content-${__props.status}` : "",
unref(isWait) ? "lay-step-item-content-wait" : ""
]),
onClick: _cache[1] || (_cache[1] = ($event) => onChange(index.value + 1))
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createElementVNode("div", _hoisted_2, toDisplayString(__props.title), 1),
createElementVNode("p", null, toDisplayString(__props.content), 1)
])
], 2)
], 6)) : (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass([
"lay-step-item",
"lay-step-simple",
!unref(isStart) ? "lay-step-item-simple" : "",
"lay-step-item-simple-border",
unref(isActive) ? "lay-step-item-simple-active" : "",
unref(isCurrent) === index.value ? `lay-step-item-simple-${unref(currentStatus)}` : "",
unref(isCurrentBorder) === index.value ? `lay-step-item-simple-${unref(currentStatus)}-border` : "",
unref(isSimpleActive) ? "lay-step-item-simple-active-border" : ""
]),
onClick: _cache[2] || (_cache[2] = ($event) => onChange(index.value + 1))
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString(index.value + 1) + "." + toDisplayString(__props.title), 1)
])
], 2));
};
}
});
const component = withInstall(_sfc_main);
export { component as default };

View File

@@ -0,0 +1,5 @@
import "../badge/index2.js";
export { c as default } from "./index2.js";
import "vue";
import "../checkbox/index2.js";
import "../dropdownMenu/index2.js";

View File

@@ -0,0 +1,20 @@
<script lang="ts">
export default {
name: "DialogueIcon",
};
</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-dialogue"
/>
</template>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
export declare type StringObject = Record<string, unknown>;
export interface InstallOptions extends StringObject {
}

View File

@@ -0,0 +1,16 @@
<script lang="ts">
export default {
name: "ChartIcon",
};
</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-chart" />
</template>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 309 KiB

View File

@@ -0,0 +1,3 @@
x<01>P<EFBFBD>j<EFBFBD>0 <0C>s<EFBFBD>B0݃<>nk<6E>x_#׉c<D789>ZAvza<7A><61>g;i<><69><EFBFBD>0FH:::Gʑ<47><CA91>n<EFBFBD>$<24>(<28>O Ĉ<>sB<11><>Ş<1C><>#<23>J<08><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>|<7C>zc<>v
ws <0B><>KS<4B>M<EFBFBD>:<3A>Lv^Y<>/<2F><><EFBFBD>q<EFBFBD><71>><3E>3<EFBFBD>R <0C><>: <09><>չ|@6<>'<27>1<EFBFBD>!<21><><15><>P<EFBFBD><50>)<29>QW6+l<><14>
<EFBFBD>߆i<EFBFBD><EFBFBD>z<EFBFBD><EFBFBD><EFBFBD><11><><EFBFBD>H<EFBFBD>Xg w<>Z<1B>@<40>t<EFBFBD>0<EFBFBD><30><EFBFBD>,<2C><><EFBFBD>|-f<><66>oRd<52>Vk<56><6B>