@ccn-ui-kit/date-picker 0.1.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/index.cjs +1 -0
- package/dist/index.js +369 -0
- package/dist/packages/components/__tests__/loading.spec.d.ts +1 -0
- package/dist/packages/components/badge/index.d.ts +10 -0
- package/dist/packages/components/badge/src/badge.d.ts +25 -0
- package/dist/packages/components/breadcrumb/index.d.ts +12 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb-item.d.ts +13 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb.d.ts +10 -0
- package/dist/packages/components/button/index.d.ts +10 -0
- package/dist/packages/components/button/src/button.d.ts +25 -0
- package/dist/packages/components/date-picker/index.d.ts +10 -0
- package/dist/packages/components/date-picker/src/date-panel.vue.d.ts +19 -0
- package/dist/packages/components/date-picker/src/date-picker.d.ts +20 -0
- package/dist/packages/components/date-picker/src/date-picker.vue.d.ts +37 -0
- package/dist/packages/components/descriptions/index.d.ts +12 -0
- package/dist/packages/components/descriptions/src/descriptions-item.d.ts +13 -0
- package/dist/packages/components/descriptions/src/descriptions.d.ts +17 -0
- package/dist/packages/components/divider/index.d.ts +10 -0
- package/dist/packages/components/divider/src/divider.d.ts +20 -0
- package/dist/packages/components/dropdown/index.d.ts +12 -0
- package/dist/packages/components/dropdown/src/dropdown-item.d.ts +20 -0
- package/dist/packages/components/dropdown/src/dropdown.d.ts +46 -0
- package/dist/packages/components/form/index.d.ts +12 -0
- package/dist/packages/components/form/src/form-item.d.ts +45 -0
- package/dist/packages/components/form/src/form.d.ts +96 -0
- package/dist/packages/components/icon/index.d.ts +11 -0
- package/dist/packages/components/icon/src/icon.d.ts +18 -0
- package/dist/packages/components/icon/src/icons.d.ts +50 -0
- package/dist/packages/components/input/index.d.ts +10 -0
- package/dist/packages/components/input/src/input.d.ts +25 -0
- package/dist/packages/components/link/index.d.ts +10 -0
- package/dist/packages/components/link/src/link.d.ts +25 -0
- package/dist/packages/components/loading/index.d.ts +10 -0
- package/dist/packages/components/loading/src/loading.d.ts +15 -0
- package/dist/packages/components/menu/index.d.ts +14 -0
- package/dist/packages/components/menu/src/menu-item.d.ts +12 -0
- package/dist/packages/components/menu/src/menu.d.ts +40 -0
- package/dist/packages/components/menu/src/sub-menu.d.ts +12 -0
- package/dist/packages/components/message/index.d.ts +12 -0
- package/dist/packages/components/message/src/manager.d.ts +14 -0
- package/dist/packages/components/message/src/message.d.ts +28 -0
- package/dist/packages/components/modal/index.d.ts +10 -0
- package/dist/packages/components/modal/src/modal.d.ts +46 -0
- package/dist/packages/components/notification/index.d.ts +12 -0
- package/dist/packages/components/notification/src/manager.d.ts +14 -0
- package/dist/packages/components/notification/src/notification.d.ts +44 -0
- package/dist/packages/components/pagination/index.d.ts +10 -0
- package/dist/packages/components/pagination/src/pagination.d.ts +30 -0
- package/dist/packages/components/popconfirm/index.d.ts +10 -0
- package/dist/packages/components/popconfirm/src/popconfirm.d.ts +56 -0
- package/dist/packages/components/rich-editor/index.d.ts +10 -0
- package/dist/packages/components/rich-editor/src/rich-editor.d.ts +36 -0
- package/dist/packages/components/select/index.d.ts +10 -0
- package/dist/packages/components/select/src/select.d.ts +45 -0
- package/dist/packages/components/space/index.d.ts +10 -0
- package/dist/packages/components/space/src/space.d.ts +33 -0
- package/dist/packages/components/steps/index.d.ts +12 -0
- package/dist/packages/components/steps/src/step.d.ts +28 -0
- package/dist/packages/components/steps/src/steps.d.ts +46 -0
- package/dist/packages/components/table/index.d.ts +10 -0
- package/dist/packages/components/table/src/table.d.ts +56 -0
- package/dist/packages/components/tabs/index.d.ts +12 -0
- package/dist/packages/components/tabs/src/tab-pane.d.ts +22 -0
- package/dist/packages/components/tabs/src/tabs.d.ts +43 -0
- package/dist/packages/components/tree/index.d.ts +10 -0
- package/dist/packages/components/tree/src/tree.d.ts +134 -0
- package/dist/packages/components/upload/index.d.ts +10 -0
- package/dist/packages/components/upload/src/upload.d.ts +103 -0
- package/dist/packages/directives/index.d.ts +2 -0
- package/dist/packages/directives/loading/index.d.ts +11 -0
- package/dist/packages/directives/permission/index.d.ts +3 -0
- package/dist/packages/ui-kit/index.d.ts +34 -0
- package/dist/packages/utils/dom.d.ts +5 -0
- package/dist/packages/utils/index.d.ts +3 -0
- package/dist/packages/utils/types.d.ts +7 -0
- package/dist/packages/utils/vue-helper.d.ts +9 -0
- package/dist/play/main.d.ts +1 -0
- package/dist/play/vite.config.d.ts +2 -0
- package/package.json +27 -0
- package/style/index.scss +172 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D={modelValue:{type:String,default:void 0},placeholder:{type:String,default:"请选择日期"},disabled:Boolean,clearable:Boolean},w={"update:modelValue":r=>typeof r=="string",change:r=>typeof r=="string",clear:()=>!0},R={class:"ui-date-panel"},I={class:"ui-date-panel__header"},U={class:"ui-date-panel__title"},x={class:"ui-date-panel__week"},K={class:"ui-date-panel__body"},j=["onClick"],q={class:"ui-date-panel__year-body"},A=["onClick"],O={class:"ui-date-panel__month-body"},W=["onClick"],G=e.defineComponent({__name:"date-panel",props:{modelValue:{}},emits:["select"],setup(r,{emit:V}){const y=r,f=V,h=["日","一","二","三","四","五","六"],v=Array.from({length:12},(l,i)=>`${i+1} 月`),s=new Date,t=e.ref(s.getFullYear()),n=e.ref(s.getMonth());if(y.modelValue){const l=y.modelValue.split("-").map(Number);l.length===3&&(t.value=l[0],n.value=l[1]-1)}const c=e.ref("date"),u=e.ref(t.value-5),C=e.computed(()=>{const l=[];for(let i=0;i<12;i++)l.push(u.value+i);return l});function k(l,i,a){const d=m=>String(m).padStart(2,"0");return`${l}-${d(i+1)}-${d(a)}`}const g=e.computed(()=>{const l=k(s.getFullYear(),s.getMonth(),s.getDate()),i=new Date(t.value,n.value+1,0).getDate(),a=new Date(t.value,n.value,1).getDay(),d=new Date(t.value,n.value,0).getDate(),m=[];for(let p=a-1;p>=0;p--){const _=d-p;m.push({key:`p-${_}`,day:_,value:k(t.value,n.value-1,_),otherMonth:!0,isToday:!1})}for(let p=1;p<=i;p++){const _=k(t.value,n.value,p);m.push({key:`c-${p}`,day:p,value:_,otherMonth:!1,isToday:_===l})}let B=1;for(;m.length<42;)m.push({key:`n-${B}`,day:B,value:k(t.value,n.value+1,B),otherMonth:!0,isToday:!1}),B++;return m});function o(){n.value===0?(n.value=11,t.value--):n.value--}function E(){n.value===11?(n.value=0,t.value++):n.value++}function M(){u.value=t.value-5,c.value="year"}function S(){c.value="month"}function N(){c.value="date"}function P(l){t.value=l,c.value="date"}function F(){u.value-=12}function $(){u.value+=12}function T(l){n.value=l,c.value="date"}function Y(){t.value--}function L(){t.value++}function z(l){f("select",l.value)}return(l,i)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",I,[e.createCommentVNode(" 日历视图:‹ › 切月,点年份/月份进入对应网格 "),c.value==="date"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",class:"ui-date-panel__arrow",onClick:o},"‹"),e.createElementVNode("span",U,[e.createElementVNode("span",{class:"ui-date-panel__year-link",onClick:M},e.toDisplayString(t.value)+" 年",1),e.createElementVNode("span",{class:"ui-date-panel__month-link",onClick:S},e.toDisplayString(n.value+1)+" 月",1)]),e.createElementVNode("button",{type:"button",class:"ui-date-panel__arrow",onClick:E},"›")],64)):c.value==="year"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" 年网格:‹ › 切年段,点标题返回 "),e.createElementVNode("button",{type:"button",class:"ui-date-panel__arrow",onClick:F},"‹"),e.createElementVNode("span",{class:"ui-date-panel__title ui-date-panel__title--back",onClick:N},e.toDisplayString(u.value)+" - "+e.toDisplayString(u.value+11)+" 年 ",1),e.createElementVNode("button",{type:"button",class:"ui-date-panel__arrow",onClick:$},"›")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createCommentVNode(" 月网格:‹ › 切年,点标题返回 "),e.createElementVNode("button",{type:"button",class:"ui-date-panel__arrow",onClick:Y},"‹"),e.createElementVNode("span",{class:"ui-date-panel__title ui-date-panel__title--back",onClick:N},e.toDisplayString(t.value)+" 年 ",1),e.createElementVNode("button",{type:"button",class:"ui-date-panel__arrow",onClick:L},"›")],64))]),e.createCommentVNode(" 日历视图:星期 + 日期格 "),c.value==="date"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",x,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,a=>e.createElementVNode("span",{key:a,class:"ui-date-panel__week-cell"},e.toDisplayString(a),1)),64))]),e.createElementVNode("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("span",{key:a.key,class:e.normalizeClass(["ui-date-panel__cell",{"is-other":a.otherMonth,"is-today":a.isToday,"is-selected":a.value===r.modelValue}]),onClick:d=>z(a)},e.toDisplayString(a.day),11,j))),128))])],64)):c.value==="year"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" 年网格:12 年 "),e.createElementVNode("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,a=>(e.openBlock(),e.createElementBlock("span",{key:a,class:e.normalizeClass(["ui-date-panel__year-cell",{"is-current":a===t.value}]),onClick:d=>P(a)},e.toDisplayString(a),11,A))),128))])],2112)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createCommentVNode(" 月网格:12 个月 "),e.createElementVNode("div",O,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(a,d)=>(e.openBlock(),e.createElementBlock("span",{key:a,class:e.normalizeClass(["ui-date-panel__month-cell",{"is-current":d===n.value}]),onClick:m=>T(d)},e.toDisplayString(a),11,W))),128))])],2112))]))}}),H=["value","placeholder","disabled"],b=e.defineComponent({__name:"date-picker",props:D,emits:w,setup(r,{emit:V}){const y=r,f=V,h=e.ref(""),v=e.computed({get:()=>y.modelValue??h.value,set:o=>{h.value=o,f("update:modelValue",o)}}),s=e.ref(!1),t=e.ref();function n(){y.disabled||(s.value=!0)}function c(){s.value=!1}function u(){s.value?c():n()}function C(o){v.value=o,f("change",o),c()}function k(){v.value="",f("clear")}function g(o){t.value&&!t.value.contains(o.target)&&c()}return e.onMounted(()=>document.addEventListener("click",g)),e.onBeforeUnmount(()=>document.removeEventListener("click",g)),(o,E)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:t,class:e.normalizeClass(["ui-date-picker",{"is-disabled":o.disabled}])},[e.createElementVNode("div",{class:"ui-date-picker__trigger",onClick:u,onKeydown:e.withKeys(u,["enter"])},[e.createElementVNode("input",{class:"ui-date-picker__inner",value:v.value,placeholder:o.placeholder,disabled:o.disabled,readonly:""},null,8,H),o.clearable&&v.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"ui-date-picker__clear",onClick:e.withModifiers(k,["stop"])},"×")):e.createCommentVNode("v-if",!0)],32),e.createCommentVNode(" @click.stop:面板内部点击不冒泡到 document,避免内部节点因视图切换被移除时误触发「点击外部关闭」 "),s.value?(e.openBlock(),e.createBlock(G,{key:0,"model-value":v.value,onSelect:C,onClick:E[0]||(E[0]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value"])):e.createCommentVNode("v-if",!0)],2))}}),J={name:"UiDatePicker",install(r){r.component("UiDatePicker",b)}};exports.DatePicker=b;exports.DatePickerPlugin=J;exports.datePickerEmits=w;exports.datePickerProps=D;exports.default=b;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { defineComponent as R, ref as b, computed as E, openBlock as o, createElementBlock as u, createElementVNode as a, createCommentVNode as y, Fragment as v, toDisplayString as h, renderList as S, normalizeClass as Y, unref as q, onMounted as G, onBeforeUnmount as H, withKeys as J, withModifiers as L, createBlock as O } from "vue";
|
|
2
|
+
const Q = {
|
|
3
|
+
modelValue: { type: String, default: void 0 },
|
|
4
|
+
placeholder: { type: String, default: "请选择日期" },
|
|
5
|
+
disabled: Boolean,
|
|
6
|
+
clearable: Boolean
|
|
7
|
+
}, X = {
|
|
8
|
+
"update:modelValue": (c) => typeof c == "string",
|
|
9
|
+
change: (c) => typeof c == "string",
|
|
10
|
+
clear: () => !0
|
|
11
|
+
}, Z = { class: "ui-date-panel" }, ee = { class: "ui-date-panel__header" }, te = { class: "ui-date-panel__title" }, ae = { class: "ui-date-panel__week" }, ne = { class: "ui-date-panel__body" }, le = ["onClick"], oe = { class: "ui-date-panel__year-body" }, ue = ["onClick"], se = { class: "ui-date-panel__month-body" }, ie = ["onClick"], ce = /* @__PURE__ */ R({
|
|
12
|
+
__name: "date-panel",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {}
|
|
15
|
+
},
|
|
16
|
+
emits: ["select"],
|
|
17
|
+
setup(c, { emit: T }) {
|
|
18
|
+
const w = c, M = T, D = ["日", "一", "二", "三", "四", "五", "六"], m = Array.from({ length: 12 }, (l, d) => `${d + 1} 月`), r = /* @__PURE__ */ new Date(), e = b(r.getFullYear()), n = b(r.getMonth());
|
|
19
|
+
if (w.modelValue) {
|
|
20
|
+
const l = w.modelValue.split("-").map(Number);
|
|
21
|
+
l.length === 3 && (e.value = l[0], n.value = l[1] - 1);
|
|
22
|
+
}
|
|
23
|
+
const i = b("date"), p = b(e.value - 5), B = E(() => {
|
|
24
|
+
const l = [];
|
|
25
|
+
for (let d = 0; d < 12; d++) l.push(p.value + d);
|
|
26
|
+
return l;
|
|
27
|
+
});
|
|
28
|
+
function g(l, d, t) {
|
|
29
|
+
const _ = (f) => String(f).padStart(2, "0");
|
|
30
|
+
return `${l}-${_(d + 1)}-${_(t)}`;
|
|
31
|
+
}
|
|
32
|
+
const $ = E(() => {
|
|
33
|
+
const l = g(r.getFullYear(), r.getMonth(), r.getDate()), d = new Date(e.value, n.value + 1, 0).getDate(), t = new Date(e.value, n.value, 1).getDay(), _ = new Date(e.value, n.value, 0).getDate(), f = [];
|
|
34
|
+
for (let k = t - 1; k >= 0; k--) {
|
|
35
|
+
const C = _ - k;
|
|
36
|
+
f.push({
|
|
37
|
+
key: `p-${C}`,
|
|
38
|
+
day: C,
|
|
39
|
+
value: g(e.value, n.value - 1, C),
|
|
40
|
+
otherMonth: !0,
|
|
41
|
+
isToday: !1
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
for (let k = 1; k <= d; k++) {
|
|
45
|
+
const C = g(e.value, n.value, k);
|
|
46
|
+
f.push({ key: `c-${k}`, day: k, value: C, otherMonth: !1, isToday: C === l });
|
|
47
|
+
}
|
|
48
|
+
let P = 1;
|
|
49
|
+
for (; f.length < 42; )
|
|
50
|
+
f.push({
|
|
51
|
+
key: `n-${P}`,
|
|
52
|
+
day: P,
|
|
53
|
+
value: g(e.value, n.value + 1, P),
|
|
54
|
+
otherMonth: !0,
|
|
55
|
+
isToday: !1
|
|
56
|
+
}), P++;
|
|
57
|
+
return f;
|
|
58
|
+
});
|
|
59
|
+
function s() {
|
|
60
|
+
n.value === 0 ? (n.value = 11, e.value--) : n.value--;
|
|
61
|
+
}
|
|
62
|
+
function V() {
|
|
63
|
+
n.value === 11 ? (n.value = 0, e.value++) : n.value++;
|
|
64
|
+
}
|
|
65
|
+
function x() {
|
|
66
|
+
p.value = e.value - 5, i.value = "year";
|
|
67
|
+
}
|
|
68
|
+
function F() {
|
|
69
|
+
i.value = "month";
|
|
70
|
+
}
|
|
71
|
+
function N() {
|
|
72
|
+
i.value = "date";
|
|
73
|
+
}
|
|
74
|
+
function I(l) {
|
|
75
|
+
e.value = l, i.value = "date";
|
|
76
|
+
}
|
|
77
|
+
function U() {
|
|
78
|
+
p.value -= 12;
|
|
79
|
+
}
|
|
80
|
+
function K() {
|
|
81
|
+
p.value += 12;
|
|
82
|
+
}
|
|
83
|
+
function z(l) {
|
|
84
|
+
n.value = l, i.value = "date";
|
|
85
|
+
}
|
|
86
|
+
function A() {
|
|
87
|
+
e.value--;
|
|
88
|
+
}
|
|
89
|
+
function W() {
|
|
90
|
+
e.value++;
|
|
91
|
+
}
|
|
92
|
+
function j(l) {
|
|
93
|
+
M("select", l.value);
|
|
94
|
+
}
|
|
95
|
+
return (l, d) => (o(), u("div", Z, [
|
|
96
|
+
a("div", ee, [
|
|
97
|
+
y(" 日历视图:‹ › 切月,点年份/月份进入对应网格 "),
|
|
98
|
+
i.value === "date" ? (o(), u(
|
|
99
|
+
v,
|
|
100
|
+
{ key: 0 },
|
|
101
|
+
[
|
|
102
|
+
a("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
class: "ui-date-panel__arrow",
|
|
105
|
+
onClick: s
|
|
106
|
+
}, "‹"),
|
|
107
|
+
a("span", te, [
|
|
108
|
+
a(
|
|
109
|
+
"span",
|
|
110
|
+
{
|
|
111
|
+
class: "ui-date-panel__year-link",
|
|
112
|
+
onClick: x
|
|
113
|
+
},
|
|
114
|
+
h(e.value) + " 年",
|
|
115
|
+
1
|
|
116
|
+
/* TEXT */
|
|
117
|
+
),
|
|
118
|
+
a(
|
|
119
|
+
"span",
|
|
120
|
+
{
|
|
121
|
+
class: "ui-date-panel__month-link",
|
|
122
|
+
onClick: F
|
|
123
|
+
},
|
|
124
|
+
h(n.value + 1) + " 月",
|
|
125
|
+
1
|
|
126
|
+
/* TEXT */
|
|
127
|
+
)
|
|
128
|
+
]),
|
|
129
|
+
a("button", {
|
|
130
|
+
type: "button",
|
|
131
|
+
class: "ui-date-panel__arrow",
|
|
132
|
+
onClick: V
|
|
133
|
+
}, "›")
|
|
134
|
+
],
|
|
135
|
+
64
|
|
136
|
+
/* STABLE_FRAGMENT */
|
|
137
|
+
)) : i.value === "year" ? (o(), u(
|
|
138
|
+
v,
|
|
139
|
+
{ key: 1 },
|
|
140
|
+
[
|
|
141
|
+
y(" 年网格:‹ › 切年段,点标题返回 "),
|
|
142
|
+
a("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
class: "ui-date-panel__arrow",
|
|
145
|
+
onClick: U
|
|
146
|
+
}, "‹"),
|
|
147
|
+
a(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
class: "ui-date-panel__title ui-date-panel__title--back",
|
|
151
|
+
onClick: N
|
|
152
|
+
},
|
|
153
|
+
h(p.value) + " - " + h(p.value + 11) + " 年 ",
|
|
154
|
+
1
|
|
155
|
+
/* TEXT */
|
|
156
|
+
),
|
|
157
|
+
a("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
class: "ui-date-panel__arrow",
|
|
160
|
+
onClick: K
|
|
161
|
+
}, "›")
|
|
162
|
+
],
|
|
163
|
+
64
|
|
164
|
+
/* STABLE_FRAGMENT */
|
|
165
|
+
)) : (o(), u(
|
|
166
|
+
v,
|
|
167
|
+
{ key: 2 },
|
|
168
|
+
[
|
|
169
|
+
y(" 月网格:‹ › 切年,点标题返回 "),
|
|
170
|
+
a("button", {
|
|
171
|
+
type: "button",
|
|
172
|
+
class: "ui-date-panel__arrow",
|
|
173
|
+
onClick: A
|
|
174
|
+
}, "‹"),
|
|
175
|
+
a(
|
|
176
|
+
"span",
|
|
177
|
+
{
|
|
178
|
+
class: "ui-date-panel__title ui-date-panel__title--back",
|
|
179
|
+
onClick: N
|
|
180
|
+
},
|
|
181
|
+
h(e.value) + " 年 ",
|
|
182
|
+
1
|
|
183
|
+
/* TEXT */
|
|
184
|
+
),
|
|
185
|
+
a("button", {
|
|
186
|
+
type: "button",
|
|
187
|
+
class: "ui-date-panel__arrow",
|
|
188
|
+
onClick: W
|
|
189
|
+
}, "›")
|
|
190
|
+
],
|
|
191
|
+
64
|
|
192
|
+
/* STABLE_FRAGMENT */
|
|
193
|
+
))
|
|
194
|
+
]),
|
|
195
|
+
y(" 日历视图:星期 + 日期格 "),
|
|
196
|
+
i.value === "date" ? (o(), u(
|
|
197
|
+
v,
|
|
198
|
+
{ key: 0 },
|
|
199
|
+
[
|
|
200
|
+
a("div", ae, [
|
|
201
|
+
(o(), u(
|
|
202
|
+
v,
|
|
203
|
+
null,
|
|
204
|
+
S(D, (t) => a(
|
|
205
|
+
"span",
|
|
206
|
+
{
|
|
207
|
+
key: t,
|
|
208
|
+
class: "ui-date-panel__week-cell"
|
|
209
|
+
},
|
|
210
|
+
h(t),
|
|
211
|
+
1
|
|
212
|
+
/* TEXT */
|
|
213
|
+
)),
|
|
214
|
+
64
|
|
215
|
+
/* STABLE_FRAGMENT */
|
|
216
|
+
))
|
|
217
|
+
]),
|
|
218
|
+
a("div", ne, [
|
|
219
|
+
(o(!0), u(
|
|
220
|
+
v,
|
|
221
|
+
null,
|
|
222
|
+
S($.value, (t) => (o(), u("span", {
|
|
223
|
+
key: t.key,
|
|
224
|
+
class: Y(["ui-date-panel__cell", {
|
|
225
|
+
"is-other": t.otherMonth,
|
|
226
|
+
"is-today": t.isToday,
|
|
227
|
+
"is-selected": t.value === c.modelValue
|
|
228
|
+
}]),
|
|
229
|
+
onClick: (_) => j(t)
|
|
230
|
+
}, h(t.day), 11, le))),
|
|
231
|
+
128
|
|
232
|
+
/* KEYED_FRAGMENT */
|
|
233
|
+
))
|
|
234
|
+
])
|
|
235
|
+
],
|
|
236
|
+
64
|
|
237
|
+
/* STABLE_FRAGMENT */
|
|
238
|
+
)) : i.value === "year" ? (o(), u(
|
|
239
|
+
v,
|
|
240
|
+
{ key: 1 },
|
|
241
|
+
[
|
|
242
|
+
y(" 年网格:12 年 "),
|
|
243
|
+
a("div", oe, [
|
|
244
|
+
(o(!0), u(
|
|
245
|
+
v,
|
|
246
|
+
null,
|
|
247
|
+
S(B.value, (t) => (o(), u("span", {
|
|
248
|
+
key: t,
|
|
249
|
+
class: Y(["ui-date-panel__year-cell", { "is-current": t === e.value }]),
|
|
250
|
+
onClick: (_) => I(t)
|
|
251
|
+
}, h(t), 11, ue))),
|
|
252
|
+
128
|
|
253
|
+
/* KEYED_FRAGMENT */
|
|
254
|
+
))
|
|
255
|
+
])
|
|
256
|
+
],
|
|
257
|
+
2112
|
|
258
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
259
|
+
)) : (o(), u(
|
|
260
|
+
v,
|
|
261
|
+
{ key: 2 },
|
|
262
|
+
[
|
|
263
|
+
y(" 月网格:12 个月 "),
|
|
264
|
+
a("div", se, [
|
|
265
|
+
(o(!0), u(
|
|
266
|
+
v,
|
|
267
|
+
null,
|
|
268
|
+
S(q(m), (t, _) => (o(), u("span", {
|
|
269
|
+
key: t,
|
|
270
|
+
class: Y(["ui-date-panel__month-cell", { "is-current": _ === n.value }]),
|
|
271
|
+
onClick: (f) => z(_)
|
|
272
|
+
}, h(t), 11, ie))),
|
|
273
|
+
128
|
|
274
|
+
/* KEYED_FRAGMENT */
|
|
275
|
+
))
|
|
276
|
+
])
|
|
277
|
+
],
|
|
278
|
+
2112
|
|
279
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
280
|
+
))
|
|
281
|
+
]));
|
|
282
|
+
}
|
|
283
|
+
}), re = ["value", "placeholder", "disabled"], de = /* @__PURE__ */ R({
|
|
284
|
+
__name: "date-picker",
|
|
285
|
+
props: Q,
|
|
286
|
+
emits: X,
|
|
287
|
+
setup(c, { emit: T }) {
|
|
288
|
+
const w = c, M = T, D = b(""), m = E({
|
|
289
|
+
get: () => w.modelValue ?? D.value,
|
|
290
|
+
set: (s) => {
|
|
291
|
+
D.value = s, M("update:modelValue", s);
|
|
292
|
+
}
|
|
293
|
+
}), r = b(!1), e = b();
|
|
294
|
+
function n() {
|
|
295
|
+
w.disabled || (r.value = !0);
|
|
296
|
+
}
|
|
297
|
+
function i() {
|
|
298
|
+
r.value = !1;
|
|
299
|
+
}
|
|
300
|
+
function p() {
|
|
301
|
+
r.value ? i() : n();
|
|
302
|
+
}
|
|
303
|
+
function B(s) {
|
|
304
|
+
m.value = s, M("change", s), i();
|
|
305
|
+
}
|
|
306
|
+
function g() {
|
|
307
|
+
m.value = "", M("clear");
|
|
308
|
+
}
|
|
309
|
+
function $(s) {
|
|
310
|
+
e.value && !e.value.contains(s.target) && i();
|
|
311
|
+
}
|
|
312
|
+
return G(() => document.addEventListener("click", $)), H(() => document.removeEventListener("click", $)), (s, V) => (o(), u(
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
ref_key: "wrapperRef",
|
|
316
|
+
ref: e,
|
|
317
|
+
class: Y(["ui-date-picker", { "is-disabled": s.disabled }])
|
|
318
|
+
},
|
|
319
|
+
[
|
|
320
|
+
a(
|
|
321
|
+
"div",
|
|
322
|
+
{
|
|
323
|
+
class: "ui-date-picker__trigger",
|
|
324
|
+
onClick: p,
|
|
325
|
+
onKeydown: J(p, ["enter"])
|
|
326
|
+
},
|
|
327
|
+
[
|
|
328
|
+
a("input", {
|
|
329
|
+
class: "ui-date-picker__inner",
|
|
330
|
+
value: m.value,
|
|
331
|
+
placeholder: s.placeholder,
|
|
332
|
+
disabled: s.disabled,
|
|
333
|
+
readonly: ""
|
|
334
|
+
}, null, 8, re),
|
|
335
|
+
s.clearable && m.value ? (o(), u("span", {
|
|
336
|
+
key: 0,
|
|
337
|
+
class: "ui-date-picker__clear",
|
|
338
|
+
onClick: L(g, ["stop"])
|
|
339
|
+
}, "×")) : y("v-if", !0)
|
|
340
|
+
],
|
|
341
|
+
32
|
|
342
|
+
/* NEED_HYDRATION */
|
|
343
|
+
),
|
|
344
|
+
y(" @click.stop:面板内部点击不冒泡到 document,避免内部节点因视图切换被移除时误触发「点击外部关闭」 "),
|
|
345
|
+
r.value ? (o(), O(ce, {
|
|
346
|
+
key: 0,
|
|
347
|
+
"model-value": m.value,
|
|
348
|
+
onSelect: B,
|
|
349
|
+
onClick: V[0] || (V[0] = L(() => {
|
|
350
|
+
}, ["stop"]))
|
|
351
|
+
}, null, 8, ["model-value"])) : y("v-if", !0)
|
|
352
|
+
],
|
|
353
|
+
2
|
|
354
|
+
/* CLASS */
|
|
355
|
+
));
|
|
356
|
+
}
|
|
357
|
+
}), pe = {
|
|
358
|
+
name: "UiDatePicker",
|
|
359
|
+
install(c) {
|
|
360
|
+
c.component("UiDatePicker", de);
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
export {
|
|
364
|
+
de as DatePicker,
|
|
365
|
+
pe as DatePickerPlugin,
|
|
366
|
+
X as datePickerEmits,
|
|
367
|
+
Q as datePickerProps,
|
|
368
|
+
de as default
|
|
369
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const badgeProps: {
|
|
4
|
+
readonly value: {
|
|
5
|
+
readonly type: [NumberConstructor, StringConstructor];
|
|
6
|
+
readonly default: 0;
|
|
7
|
+
};
|
|
8
|
+
readonly max: {
|
|
9
|
+
readonly type: NumberConstructor;
|
|
10
|
+
readonly default: undefined;
|
|
11
|
+
};
|
|
12
|
+
readonly isDot: {
|
|
13
|
+
readonly type: BooleanConstructor;
|
|
14
|
+
readonly default: false;
|
|
15
|
+
};
|
|
16
|
+
readonly hidden: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: false;
|
|
19
|
+
};
|
|
20
|
+
readonly type: {
|
|
21
|
+
readonly type: StringConstructor;
|
|
22
|
+
readonly default: "danger";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type BadgeProps = ExtractPropTypes<typeof badgeProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Breadcrumb } from './src/breadcrumb.vue';
|
|
3
|
+
import { default as BreadcrumbItem } from './src/breadcrumb-item.vue';
|
|
4
|
+
|
|
5
|
+
export declare const BreadcrumbPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
install(app: App): void;
|
|
8
|
+
};
|
|
9
|
+
export { Breadcrumb, BreadcrumbItem };
|
|
10
|
+
export default Breadcrumb;
|
|
11
|
+
export * from './src/breadcrumb';
|
|
12
|
+
export * from './src/breadcrumb-item';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const breadcrumbItemProps: {
|
|
4
|
+
readonly to: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "";
|
|
7
|
+
};
|
|
8
|
+
readonly replace: {
|
|
9
|
+
readonly type: BooleanConstructor;
|
|
10
|
+
readonly default: false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExtractPropTypes, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const breadcrumbProps: {
|
|
4
|
+
readonly separator: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "/";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type BreadcrumbProps = ExtractPropTypes<typeof breadcrumbProps>;
|
|
10
|
+
export declare const breadcrumbSeparatorKey: InjectionKey<string>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const buttonProps: {
|
|
4
|
+
readonly type: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "default";
|
|
7
|
+
};
|
|
8
|
+
readonly size: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "medium";
|
|
11
|
+
};
|
|
12
|
+
readonly plain: BooleanConstructor;
|
|
13
|
+
readonly round: BooleanConstructor;
|
|
14
|
+
readonly disabled: BooleanConstructor;
|
|
15
|
+
readonly loading: BooleanConstructor;
|
|
16
|
+
/** 原生 button 的 type,默认 button(避免误触发表单提交) */
|
|
17
|
+
readonly 'native-type': {
|
|
18
|
+
readonly type: StringConstructor;
|
|
19
|
+
readonly default: "button";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const buttonEmits: {
|
|
23
|
+
click: (e: MouseEvent) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ButtonProps = ExtractPropTypes<typeof buttonProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as DatePicker } from './src/date-picker.vue';
|
|
3
|
+
|
|
4
|
+
export declare const DatePickerPlugin: {
|
|
5
|
+
name: string;
|
|
6
|
+
install(app: App): void;
|
|
7
|
+
};
|
|
8
|
+
export { DatePicker };
|
|
9
|
+
export default DatePicker;
|
|
10
|
+
export * from './src/date-picker';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
+
select: (date: string) => void;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
modelValue?: string;
|
|
7
|
+
}>>> & Readonly<{
|
|
8
|
+
onSelect?: ((date: string) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const datePickerProps: {
|
|
4
|
+
readonly modelValue: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: undefined;
|
|
7
|
+
};
|
|
8
|
+
readonly placeholder: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "请选择日期";
|
|
11
|
+
};
|
|
12
|
+
readonly disabled: BooleanConstructor;
|
|
13
|
+
readonly clearable: BooleanConstructor;
|
|
14
|
+
};
|
|
15
|
+
export declare const datePickerEmits: {
|
|
16
|
+
'update:modelValue': (val: string) => boolean;
|
|
17
|
+
change: (val: string) => boolean;
|
|
18
|
+
clear: () => boolean;
|
|
19
|
+
};
|
|
20
|
+
export type DatePickerProps = ExtractPropTypes<typeof datePickerProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
readonly modelValue: {
|
|
3
|
+
readonly type: StringConstructor;
|
|
4
|
+
readonly default: undefined;
|
|
5
|
+
};
|
|
6
|
+
readonly placeholder: {
|
|
7
|
+
readonly type: StringConstructor;
|
|
8
|
+
readonly default: "请选择日期";
|
|
9
|
+
};
|
|
10
|
+
readonly disabled: BooleanConstructor;
|
|
11
|
+
readonly clearable: BooleanConstructor;
|
|
12
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (val: string) => void;
|
|
14
|
+
change: (val: string) => void;
|
|
15
|
+
clear: () => void;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
17
|
+
readonly modelValue: {
|
|
18
|
+
readonly type: StringConstructor;
|
|
19
|
+
readonly default: undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly placeholder: {
|
|
22
|
+
readonly type: StringConstructor;
|
|
23
|
+
readonly default: "请选择日期";
|
|
24
|
+
};
|
|
25
|
+
readonly disabled: BooleanConstructor;
|
|
26
|
+
readonly clearable: BooleanConstructor;
|
|
27
|
+
}>> & Readonly<{
|
|
28
|
+
"onUpdate:modelValue"?: ((val: string) => any) | undefined;
|
|
29
|
+
onChange?: ((val: string) => any) | undefined;
|
|
30
|
+
onClear?: (() => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
readonly disabled: boolean;
|
|
33
|
+
readonly modelValue: string;
|
|
34
|
+
readonly placeholder: string;
|
|
35
|
+
readonly clearable: boolean;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Descriptions } from './src/descriptions.vue';
|
|
3
|
+
import { default as DescriptionsItem } from './src/descriptions-item.vue';
|
|
4
|
+
|
|
5
|
+
export declare const DescriptionsPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
install(app: App): void;
|
|
8
|
+
};
|
|
9
|
+
export { Descriptions, DescriptionsItem };
|
|
10
|
+
export default Descriptions;
|
|
11
|
+
export * from './src/descriptions';
|
|
12
|
+
export * from './src/descriptions-item';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const descriptionsItemProps: {
|
|
4
|
+
readonly label: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "";
|
|
7
|
+
};
|
|
8
|
+
readonly span: {
|
|
9
|
+
readonly type: NumberConstructor;
|
|
10
|
+
readonly default: 1;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type DescriptionsItemProps = ExtractPropTypes<typeof descriptionsItemProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const descriptionsProps: {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "";
|
|
7
|
+
};
|
|
8
|
+
readonly column: {
|
|
9
|
+
readonly type: NumberConstructor;
|
|
10
|
+
readonly default: 3;
|
|
11
|
+
};
|
|
12
|
+
readonly border: {
|
|
13
|
+
readonly type: BooleanConstructor;
|
|
14
|
+
readonly default: false;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type DescriptionsProps = ExtractPropTypes<typeof descriptionsProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const dividerProps: {
|
|
4
|
+
/** 分割线方向 */
|
|
5
|
+
readonly direction: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "horizontal";
|
|
8
|
+
};
|
|
9
|
+
/** 文案在分割线上的位置 */
|
|
10
|
+
readonly contentPosition: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "center";
|
|
13
|
+
};
|
|
14
|
+
/** 是否使用虚线 */
|
|
15
|
+
readonly dashed: {
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly default: false;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type DividerProps = ExtractPropTypes<typeof dividerProps>;
|