@keyblade/pro-components 1.13.6 → 1.13.7-alpha.0

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.
@@ -1,16 +1,6 @@
1
1
  import { App } from 'vue';
2
2
  declare const ProDateRangePicker: {
3
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
4
- modelValue: import('./type').IModelValue;
5
- startField?: string;
6
- endField?: string;
7
- startPlaceholder?: string;
8
- endPlaceholder?: string;
9
- separator?: string;
10
- hideLabel?: boolean;
11
- formItemProps?: import('@arco-design/web-vue').FormItemInstance;
12
- datePickerProps?: import('@arco-design/web-vue').DatePickerInstance;
13
- }> & Readonly<{
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').IProDateRangePickerProps> & Readonly<{
14
4
  "onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
15
5
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
6
  "update:modelValue": (value: import('./type').IModelValue) => any;
@@ -31,17 +21,7 @@ declare const ProDateRangePicker: {
31
21
  C: {};
32
22
  M: {};
33
23
  Defaults: {};
34
- }, Readonly<{
35
- modelValue: import('./type').IModelValue;
36
- startField?: string;
37
- endField?: string;
38
- startPlaceholder?: string;
39
- endPlaceholder?: string;
40
- separator?: string;
41
- hideLabel?: boolean;
42
- formItemProps?: import('@arco-design/web-vue').FormItemInstance;
43
- datePickerProps?: import('@arco-design/web-vue').DatePickerInstance;
44
- }> & Readonly<{
24
+ }, Readonly<import('./type').IProDateRangePickerProps> & Readonly<{
45
25
  "onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
46
26
  }>, {}, {}, {}, {}, {
47
27
  hideLabel: boolean;
@@ -54,17 +34,7 @@ declare const ProDateRangePicker: {
54
34
  __isFragment?: never;
55
35
  __isTeleport?: never;
56
36
  __isSuspense?: never;
57
- } & import('vue').ComponentOptionsBase<Readonly<{
58
- modelValue: import('./type').IModelValue;
59
- startField?: string;
60
- endField?: string;
61
- startPlaceholder?: string;
62
- endPlaceholder?: string;
63
- separator?: string;
64
- hideLabel?: boolean;
65
- formItemProps?: import('@arco-design/web-vue').FormItemInstance;
66
- datePickerProps?: import('@arco-design/web-vue').DatePickerInstance;
67
- }> & Readonly<{
37
+ } & import('vue').ComponentOptionsBase<Readonly<import('./type').IProDateRangePickerProps> & Readonly<{
68
38
  "onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
69
39
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
70
40
  "update:modelValue": (value: import('./type').IModelValue) => any;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 装载禁用时间
3
+ * @param start
4
+ * @param end
5
+ * @returns
6
+ */
7
+ export declare const range: (start: number, end: number) => number[];
@@ -0,0 +1,9 @@
1
+ const o = (e, n) => {
2
+ const t = [];
3
+ for (let r = e; r < n; r++)
4
+ t.push(r);
5
+ return t;
6
+ };
7
+ export {
8
+ o as range
9
+ };
@@ -1,19 +1,7 @@
1
- import { IModelValue } from './type.ts';
2
- import { DatePickerInstance, FormItemInstance } from '@arco-design/web-vue';
3
- type __VLS_Props = {
4
- modelValue: IModelValue;
5
- startField?: string;
6
- endField?: string;
7
- startPlaceholder?: string;
8
- endPlaceholder?: string;
9
- separator?: string;
10
- hideLabel?: boolean;
11
- formItemProps?: FormItemInstance;
12
- datePickerProps?: DatePickerInstance;
13
- };
14
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
1
+ import { IModelValue, IProDateRangePickerProps } from './type.ts';
2
+ declare const _default: import('vue').DefineComponent<IProDateRangePickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
15
3
  "update:modelValue": (value: IModelValue) => any;
16
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
4
+ }, string, import('vue').PublicProps, Readonly<IProDateRangePickerProps> & Readonly<{
17
5
  "onUpdate:modelValue"?: ((value: IModelValue) => any) | undefined;
18
6
  }>, {
19
7
  hideLabel: boolean;
@@ -1,7 +1,7 @@
1
1
  import o from "./pro-date-range-picker.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ccbc7e81"]]);
4
+ const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7db07ed0"]]);
5
5
  export {
6
- a as default
6
+ _ as default
7
7
  };
@@ -1,6 +1,7 @@
1
- import { defineComponent as v, ref as V, computed as h, resolveComponent as k, createElementBlock as _, openBlock as E, normalizeClass as S, createVNode as d, mergeProps as i, withCtx as n, createTextVNode as B, toDisplayString as R, nextTick as P } from "vue";
1
+ import { defineComponent as R, ref as u, computed as y, resolveComponent as D, createElementBlock as N, openBlock as q, normalizeClass as H, createVNode as o, mergeProps as m, withCtx as c, createTextVNode as I, toDisplayString as L, nextTick as F } from "vue";
2
2
  import r from "dayjs";
3
- const T = "keyblade-pro-date-range-picker", I = /* @__PURE__ */ v({
3
+ import { range as p } from "./pro-date-range-picker.js";
4
+ const M = "keyblade-pro-date-range-picker", w = /* @__PURE__ */ R({
4
5
  __name: "pro-date-range-picker",
5
6
  props: {
6
7
  modelValue: {},
@@ -9,94 +10,109 @@ const T = "keyblade-pro-date-range-picker", I = /* @__PURE__ */ v({
9
10
  startPlaceholder: { default: "开始日期" },
10
11
  endPlaceholder: { default: "结束日期" },
11
12
  separator: { default: "至" },
13
+ intraday: { type: Boolean },
12
14
  hideLabel: { type: Boolean, default: !0 },
13
15
  formItemProps: {},
14
16
  datePickerProps: {}
15
17
  },
16
18
  emits: ["update:modelValue"],
17
- setup(g, { emit: F }) {
18
- const e = g, s = F, u = V(), m = V(), p = h({
19
+ setup(P, { emit: g }) {
20
+ const e = P, f = g, V = u(), b = u(), n = u(), k = y({
19
21
  get: () => e.modelValue[e.startField],
20
- set: (l) => {
21
- s("update:modelValue", {
22
+ set: (t) => {
23
+ f("update:modelValue", {
22
24
  ...e.modelValue,
23
- [e.startField]: l
25
+ [e.startField]: t
24
26
  });
25
27
  }
26
- }), f = h({
28
+ }), h = y({
27
29
  get: () => e.modelValue[e.endField],
28
- set: (l) => {
29
- s("update:modelValue", {
30
+ set: (t) => {
31
+ f("update:modelValue", {
30
32
  ...e.modelValue,
31
- [e.endField]: l
33
+ [e.endField]: t
32
34
  });
33
35
  }
34
- }), b = (l) => e.modelValue[e.endField] ? r(l).isAfter(r(e.modelValue[e.endField])) : !1, D = (l) => e.modelValue[e.startField] ? r(l).isBefore(r(e.modelValue[e.startField])) : !1, y = () => {
36
+ }), v = (t) => e.modelValue[e.endField] ? r(t).isAfter(r(e.modelValue[e.endField])) : !1, S = (t) => e.modelValue[e.startField] ? (e.intraday && t.setDate(t.getDate() + 1), r(t).isBefore(r(e.modelValue[e.startField]))) : !1, C = (t) => {
37
+ if (!e.modelValue[e.startField] || !t || !e.intraday) {
38
+ n.value = {};
39
+ return;
40
+ }
41
+ const a = r(e.modelValue[e.startField]), i = r(t);
42
+ if (!a.isSame(i, "day")) {
43
+ n.value = {};
44
+ return;
45
+ }
46
+ const d = a.hour(), l = a.minute(), B = a.second();
47
+ n.value = {
48
+ disabledHours: () => p(0, d),
49
+ disabledMinutes: (s) => s === d ? p(0, l) : [],
50
+ disabledSeconds: (s, T) => s === d && T === l ? p(0, B) : []
51
+ };
52
+ }, E = () => {
35
53
  setTimeout(() => {
36
- e.modelValue[e.startField] && !e.modelValue[e.endField] && P(() => {
37
- var t;
38
- const l = (t = m.value) == null ? void 0 : t.$el.parentElement.querySelector("input");
39
- l && l.click();
54
+ e.modelValue[e.startField] && !e.modelValue[e.endField] && F(() => {
55
+ var a;
56
+ const t = (a = b.value) == null ? void 0 : a.$el.parentElement.querySelector("input");
57
+ t && t.click();
40
58
  });
41
59
  });
42
- }, C = () => {
60
+ }, _ = () => {
43
61
  setTimeout(() => {
44
- e.modelValue[e.endField] && !e.modelValue[e.startField] && P(() => {
45
- var t;
46
- const l = (t = u.value) == null ? void 0 : t.$el.parentElement.querySelector("input");
47
- l && l.click();
62
+ e.modelValue[e.endField] && !e.modelValue[e.startField] && F(() => {
63
+ var a;
64
+ const t = (a = V.value) == null ? void 0 : a.$el.parentElement.querySelector("input");
65
+ t && t.click();
48
66
  });
49
67
  });
50
68
  };
51
- return (l, t) => {
52
- const c = k("a-date-picker"), o = k("a-form-item");
53
- return E(), _("div", {
54
- class: S(T)
69
+ return (t, a) => {
70
+ const i = D("a-date-picker"), d = D("a-form-item");
71
+ return q(), N("div", {
72
+ class: H(M)
55
73
  }, [
56
- d(o, i(l.formItemProps, {
57
- field: l.startField,
58
- style: { "margin-right": "8px" },
59
- "hide-label": l.hideLabel
74
+ o(d, m(t.formItemProps, {
75
+ field: t.startField,
76
+ "hide-label": t.hideLabel
60
77
  }), {
61
- default: n(() => [
62
- d(c, i({
78
+ default: c(() => [
79
+ o(i, m({
63
80
  ref_key: "startDatePickerRef",
64
- ref: u,
65
- modelValue: p.value,
66
- "onUpdate:modelValue": t[0] || (t[0] = (a) => p.value = a)
67
- }, l.datePickerProps, {
68
- placeholder: l.startPlaceholder,
69
- "disabled-date": (a) => b(a),
70
- onChange: y
81
+ ref: V,
82
+ modelValue: k.value,
83
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => k.value = l)
84
+ }, t.datePickerProps, {
85
+ placeholder: t.startPlaceholder,
86
+ "disabled-date": (l) => v(l),
87
+ onChange: E
71
88
  }), null, 16, ["modelValue", "placeholder", "disabled-date"])
72
89
  ]),
73
90
  _: 1
74
91
  }, 16, ["field", "hide-label"]),
75
- d(o, {
76
- "hide-label": "",
77
- style: { "margin-right": "8px" }
78
- }, {
79
- default: n(() => [
80
- B(R(l.separator), 1)
92
+ o(d, { "hide-label": "" }, {
93
+ default: c(() => [
94
+ I(L(t.separator), 1)
81
95
  ]),
82
96
  _: 1
83
97
  }),
84
- d(o, {
85
- field: l.endField,
98
+ o(d, {
99
+ field: t.endField,
86
100
  "hide-label": "",
87
101
  style: { "margin-right": "0px" }
88
102
  }, {
89
- default: n(() => [
90
- d(c, i({
103
+ default: c(() => [
104
+ o(i, m({
91
105
  ref_key: "endDatePickerRef",
92
- ref: m,
93
- modelValue: f.value,
94
- "onUpdate:modelValue": t[1] || (t[1] = (a) => f.value = a)
95
- }, l.datePickerProps, {
96
- placeholder: l.endPlaceholder,
97
- "disabled-date": (a) => D(a),
98
- onChange: C
99
- }), null, 16, ["modelValue", "placeholder", "disabled-date"])
106
+ ref: b,
107
+ modelValue: h.value,
108
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => h.value = l)
109
+ }, t.datePickerProps, {
110
+ placeholder: t.endPlaceholder,
111
+ "disabled-date": (l) => S(l),
112
+ "disabled-time": () => n.value,
113
+ onSelect: C,
114
+ onChange: _
115
+ }), null, 16, ["modelValue", "placeholder", "disabled-date", "disabled-time"])
100
116
  ]),
101
117
  _: 1
102
118
  }, 8, ["field"])
@@ -105,5 +121,5 @@ const T = "keyblade-pro-date-range-picker", I = /* @__PURE__ */ v({
105
121
  }
106
122
  });
107
123
  export {
108
- I as default
124
+ w as default
109
125
  };
@@ -1,3 +1,22 @@
1
+ import { DatePickerInstance, FormItemInstance } from '@arco-design/web-vue';
1
2
  export interface IModelValue {
2
3
  [key: string]: any;
3
4
  }
5
+ export interface IProDateRangePickerProps {
6
+ modelValue: IModelValue;
7
+ /** 开始时间绑定字段 */
8
+ startField?: string;
9
+ /** 结束开始时间绑定字段 */
10
+ endField?: string;
11
+ /** 提示文本:开始日期 */
12
+ startPlaceholder?: string;
13
+ /** 提示文本:结束日期 */
14
+ endPlaceholder?: string;
15
+ /** 提示文本:至 */
16
+ separator?: string;
17
+ /** 是否可以选择当天 */
18
+ intraday?: boolean;
19
+ hideLabel?: boolean;
20
+ formItemProps?: FormItemInstance;
21
+ datePickerProps?: DatePickerInstance;
22
+ }
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .keyblade-pro-page-header{background:var(--color-bg-2);padding:16px 32px}.keyblade-pro-page-header .keyblade-pro-page-header-section-breadcrumb .arco-breadcrumb-item:first-child{padding-left:0}.keyblade-pro-page-header .keyblade-pro-page-header-title.arco-typography{padding-top:4px;margin-top:0}.keyblade-pro-layout{width:100%;height:100%}.keyblade-pro-layout .keyblade-pro-layout-header{position:fixed;top:0;left:0;width:100%;height:var(--4a477a1a);z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 20px;background-color:var(--color-bg-2);border-bottom:1px solid var(--color-border);transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-header-left{cursor:pointer;display:flex;align-items:center}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-img{width:28px;height:28px}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout .keyblade-pro-layout-header-center{flex:1}.keyblade-pro-layout .keyblade-pro-layout-sider{padding-top:var(--4a477a1a);position:fixed;top:0;left:0;z-index:99;height:100%;transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-sider-content{position:relative;height:100%;overflow:auto}.keyblade-pro-layout .keyblade-pro-layout-sider-collapse-btn.arco-btn{position:absolute;right:12px;bottom:12px}.keyblade-pro-layout .keyblade-pro-layout-body{padding-top:var(--4a477a1a);padding-left:var(--3599ef93);min-height:100vh;overflow-y:hidden;background-color:var(--color-fill-2);transition:padding .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-body-hide-sider{padding-left:0}.keyblade-pro-layout .keyblade-pro-layout-body-affix .arco-affix{z-index:98}.keyblade-pro-layout .keyblade-pro-layout-body-footer{display:flex;align-items:center;justify-content:center;height:40px;color:var(--color-text-2);text-align:center}.keyblade-pro-layout .keyblade-pro-layout-body-collapsed{padding-left:var(--5b478c92)}.keyblade-pro-layout-side .keyblade-pro-layout-header{z-index:98;left:var(--3599ef93);width:calc(100% - var(--3599ef93))}.keyblade-pro-layout-side .keyblade-pro-layout-header-collapsed{left:var(--5b478c92);width:calc(100% - var(--5b478c92))}.keyblade-pro-layout-side .keyblade-pro-layout-sider{padding-top:0}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo{position:relative;display:flex;align-items:center;padding:16px;cursor:pointer;transition:padding .3s cubic-bezier(.645,.045,.355,1)}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-img{width:28px;height:28px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-collapsed .keyblade-pro-layout-sider-content-logo{padding:16px 10px}.keyblade-pro-menu .keyblade-pro-menu-item-img{width:14px;height:auto}.keyblade-pro-reuse-tabs{position:relative;background-color:var(--color-bg-2);padding:4px 20px}.keyblade-pro-page-container .keyblade-pro-page-container-content{padding:20px}.keyblade-pro-image-upload-cropper-dialog-cropper-wrapper[data-v-1bddf267]{width:100%;height:400px}.keyblade-pro-image-upload-cropper-dialog-operate[data-v-1bddf267]{margin-top:24px;display:flex;align-items:center;justify-content:center}.keyblade-pro-image-upload-cropper-dialog-footer[data-v-1bddf267]{margin-top:24px;display:flex;align-items:center;justify-content:flex-end}.keyblade-pro-image-upload-cropper-dialog-footer-left[data-v-1bddf267]{display:flex;align-items:center;justify-content:flex-start;margin-right:12px}.keyblade-pro-image-upload-cropper-dialog-footer-right[data-v-1bddf267]{flex:1;display:flex;align-items:center;justify-content:flex-end}.keyblade-pro-date-range-picker[data-v-ccbc7e81]{display:flex;align-items:center}
1
+ .keyblade-pro-page-header{background:var(--color-bg-2);padding:16px 32px}.keyblade-pro-page-header .keyblade-pro-page-header-section-breadcrumb .arco-breadcrumb-item:first-child{padding-left:0}.keyblade-pro-page-header .keyblade-pro-page-header-title.arco-typography{padding-top:4px;margin-top:0}.keyblade-pro-layout{width:100%;height:100%}.keyblade-pro-layout .keyblade-pro-layout-header{position:fixed;top:0;left:0;width:100%;height:var(--4a477a1a);z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 20px;background-color:var(--color-bg-2);border-bottom:1px solid var(--color-border);transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-header-left{cursor:pointer;display:flex;align-items:center}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-img{width:28px;height:28px}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout .keyblade-pro-layout-header-center{flex:1}.keyblade-pro-layout .keyblade-pro-layout-sider{padding-top:var(--4a477a1a);position:fixed;top:0;left:0;z-index:99;height:100%;transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-sider-content{position:relative;height:100%;overflow:auto}.keyblade-pro-layout .keyblade-pro-layout-sider-collapse-btn.arco-btn{position:absolute;right:12px;bottom:12px}.keyblade-pro-layout .keyblade-pro-layout-body{padding-top:var(--4a477a1a);padding-left:var(--3599ef93);min-height:100vh;overflow-y:hidden;background-color:var(--color-fill-2);transition:padding .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-body-hide-sider{padding-left:0}.keyblade-pro-layout .keyblade-pro-layout-body-affix .arco-affix{z-index:98}.keyblade-pro-layout .keyblade-pro-layout-body-footer{display:flex;align-items:center;justify-content:center;height:40px;color:var(--color-text-2);text-align:center}.keyblade-pro-layout .keyblade-pro-layout-body-collapsed{padding-left:var(--5b478c92)}.keyblade-pro-layout-side .keyblade-pro-layout-header{z-index:98;left:var(--3599ef93);width:calc(100% - var(--3599ef93))}.keyblade-pro-layout-side .keyblade-pro-layout-header-collapsed{left:var(--5b478c92);width:calc(100% - var(--5b478c92))}.keyblade-pro-layout-side .keyblade-pro-layout-sider{padding-top:0}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo{position:relative;display:flex;align-items:center;padding:16px;cursor:pointer;transition:padding .3s cubic-bezier(.645,.045,.355,1)}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-img{width:28px;height:28px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-collapsed .keyblade-pro-layout-sider-content-logo{padding:16px 10px}.keyblade-pro-menu .keyblade-pro-menu-item-img{width:14px;height:auto}.keyblade-pro-reuse-tabs{position:relative;background-color:var(--color-bg-2);padding:4px 20px}.keyblade-pro-page-container .keyblade-pro-page-container-content{padding:20px}.keyblade-pro-image-upload-cropper-dialog-cropper-wrapper[data-v-1bddf267]{width:100%;height:400px}.keyblade-pro-image-upload-cropper-dialog-operate[data-v-1bddf267]{margin-top:24px;display:flex;align-items:center;justify-content:center}.keyblade-pro-image-upload-cropper-dialog-footer[data-v-1bddf267]{margin-top:24px;display:flex;align-items:center;justify-content:flex-end}.keyblade-pro-image-upload-cropper-dialog-footer-left[data-v-1bddf267]{display:flex;align-items:center;justify-content:flex-start;margin-right:12px}.keyblade-pro-image-upload-cropper-dialog-footer-right[data-v-1bddf267]{flex:1;display:flex;align-items:center;justify-content:flex-end}.keyblade-pro-date-range-picker[data-v-7db07ed0]{display:flex;align-items:center}.keyblade-pro-date-range-picker[data-v-7db07ed0] .arco-form-item{margin-right:8px;margin-bottom:0}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@keyblade/pro-components",
3
3
  "description": "KeyBlade Pro Components",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "1.13.6",
5
+ "version": "1.13.7-alpha.0",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",