bj-custom
Version:
### 安装 * npm install --save bj-custom
259 lines (258 loc) • 6.41 kB
text/typescript
import { defineComponent as v, ref as u, computed as p, useAttrs as k, resolveComponent as w, openBlock as x, createBlock as T, mergeProps as C, withCtx as D, renderSlot as P } from "vue";
const i = /* @__PURE__ */ v({
__name: "index",
props: {
time: {
type: Number,
default: void 0
},
type: {
type: String,
default: "default"
},
icon: {
type: String,
default: ""
}
},
emits: ["click"],
setup(t, { emit: o }) {
const e = u(!1), a = t, g = o, c = {
add: { type: "primary", icon: "CirclePlus" },
import: { type: "default", icon: "Upload" },
export: { type: "default", icon: "Download" },
delete: { type: "danger", icon: "Delete" }
}, s = p(() => {
const n = { type: a.type, icon: a.icon || "" }, r = c[a.type] || n, l = e.value ? "Loading" : a.type in c ? r.icon : a.icon || "";
return {
type: r.type,
icon: l
};
}), d = u(null), f = (n) => {
var r, l;
e.value || (a.time && (e.value = !0, setTimeout(() => {
e.value = !1;
}, a.time)), g("click", n), (l = (r = d.value) == null ? void 0 : r.ref) == null || l.blur());
}, y = k(), b = p(() => e.value || y.disabled);
return (n, r) => {
const l = w("el-button");
return x(), T(l, C({
ref_key: "buttonRef",
ref: d
}, n.$attrs, {
type: s.value.type,
icon: s.value.icon,
disabled: b.value,
onClick: f
}), {
default: D(() => [
P(n.$slots, "default")
]),
_: 3
}, 16, ["type", "icon", "disabled"]);
};
}
});
i.install = function(t) {
t.component("fyList", i);
};
var N = {
name: "en",
el: {
breadcrumb: {
label: "Breadcrumb"
},
colorpicker: {
confirm: "OK",
clear: "Clear",
defaultLabel: "color picker",
description: "current color is {color}. press enter to select a new color.",
alphaLabel: "pick alpha value"
},
datepicker: {
now: "Now",
today: "Today",
cancel: "Cancel",
clear: "Clear",
confirm: "OK",
dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
monthTablePrompt: "Use the arrow keys and enter to select the month",
yearTablePrompt: "Use the arrow keys and enter to select the year",
selectedDate: "Selected date",
selectDate: "Select date",
selectTime: "Select time",
startDate: "Start Date",
startTime: "Start Time",
endDate: "End Date",
endTime: "End Time",
prevYear: "Previous Year",
nextYear: "Next Year",
prevMonth: "Previous Month",
nextMonth: "Next Month",
year: "",
month1: "January",
month2: "February",
month3: "March",
month4: "April",
month5: "May",
month6: "June",
month7: "July",
month8: "August",
month9: "September",
month10: "October",
month11: "November",
month12: "December",
week: "week",
weeks: {
sun: "Sun",
mon: "Mon",
tue: "Tue",
wed: "Wed",
thu: "Thu",
fri: "Fri",
sat: "Sat"
},
weeksFull: {
sun: "Sunday",
mon: "Monday",
tue: "Tuesday",
wed: "Wednesday",
thu: "Thursday",
fri: "Friday",
sat: "Saturday"
},
months: {
jan: "Jan",
feb: "Feb",
mar: "Mar",
apr: "Apr",
may: "May",
jun: "Jun",
jul: "Jul",
aug: "Aug",
sep: "Sep",
oct: "Oct",
nov: "Nov",
dec: "Dec"
}
},
inputNumber: {
decrease: "decrease number",
increase: "increase number"
},
select: {
loading: "Loading",
noMatch: "No matching data",
noData: "No data",
placeholder: "Select"
},
mention: {
loading: "Loading"
},
dropdown: {
toggleDropdown: "Toggle Dropdown"
},
cascader: {
noMatch: "No matching data",
loading: "Loading",
placeholder: "Select",
noData: "No data"
},
pagination: {
goto: "Go to",
pagesize: "/page",
total: "Total {total}",
pageClassifier: "",
page: "Page",
prev: "Go to previous page",
next: "Go to next page",
currentPage: "page {pager}",
prevPages: "Previous {pager} pages",
nextPages: "Next {pager} pages",
deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
},
dialog: {
close: "Close this dialog"
},
drawer: {
close: "Close this dialog"
},
messagebox: {
title: "Message",
confirm: "OK",
cancel: "Cancel",
error: "Illegal input",
close: "Close this dialog"
},
upload: {
deleteTip: "press delete to remove",
delete: "Delete",
preview: "Preview",
continue: "Continue"
},
slider: {
defaultLabel: "slider between {min} and {max}",
defaultRangeStartLabel: "pick start value",
defaultRangeEndLabel: "pick end value"
},
table: {
emptyText: "No Data",
confirmFilter: "Confirm",
resetFilter: "Reset",
clearFilter: "All",
sumText: "Sum"
},
tour: {
next: "Next",
previous: "Previous",
finish: "Finish"
},
tree: {
emptyText: "No Data"
},
transfer: {
noMatch: "No matching data",
noData: "No data",
titles: ["List 1", "List 2"],
filterPlaceholder: "Enter keyword",
noCheckedFormat: "{total} items",
hasCheckedFormat: "{checked}/{total} checked"
},
image: {
error: "FAILED"
},
pageHeader: {
title: "Back"
},
popconfirm: {
confirmButtonText: "Yes",
cancelButtonText: "No"
},
carousel: {
leftArrow: "Carousel arrow left",
rightArrow: "Carousel arrow right",
indicator: "Carousel switch to index {index}"
}
}
};
const S = (t, o = {}) => {
t.provide("$locale", o.locale ? o.locale : N);
}, M = {
install: S
}, m = {
elementPlus: M
}, h = {
bjButton: i
}, L = function(t, o = {}) {
for (let e in m)
t.use(m[e], o);
Object.keys(h).forEach((e) => {
t.component(e, h[e]);
});
}, _ = {
install: L
};
export {
i as bjButton,
_ as default
};