@opentinyvue/vue-date-range 3.21.0 → 3.22.1

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/lib/index.js CHANGED
@@ -7,7 +7,7 @@ function _extends() {
7
7
  return n;
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
- import { defineComponent, $prefix, $props, $setup } from "@opentinyvue/vue-common";
10
+ import { defineComponent, $props, $setup, $prefix } from "@opentinyvue/vue-common";
11
11
  import PcTemplate from "./pc.js";
12
12
  import MobileFirstTemplate from "./mobile-first.js";
13
13
  import "@opentinyvue/vue-theme/date-range/index.css";
@@ -55,6 +55,42 @@ var DateRange = defineComponent({
55
55
  timeEditable: {
56
56
  type: Boolean,
57
57
  default: true
58
+ },
59
+ type: {
60
+ type: String,
61
+ default: "daterange"
62
+ },
63
+ modelValue: {
64
+ type: Array,
65
+ default: function _default3() {
66
+ return [];
67
+ }
68
+ },
69
+ format: {
70
+ type: String,
71
+ default: ""
72
+ },
73
+ readonly: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ shortcuts: {
78
+ type: Array,
79
+ default: function _default4() {
80
+ return [];
81
+ }
82
+ },
83
+ disabledDate: {
84
+ type: Function,
85
+ default: null
86
+ },
87
+ popperClass: {
88
+ type: String,
89
+ default: ""
90
+ },
91
+ unlinkPanels: {
92
+ type: Boolean,
93
+ default: false
58
94
  }
59
95
  }),
60
96
  setup: function setup(props, context) {
@@ -65,7 +101,7 @@ var DateRange = defineComponent({
65
101
  });
66
102
  }
67
103
  });
68
- var version = "3.21.0";
104
+ var version = "3.undefined";
69
105
  DateRange.install = function(Vue) {
70
106
  Vue.component(DateRange.name, DateRange);
71
107
  };
@@ -1,6 +1,6 @@
1
1
  import { renderless, api } from '@opentinyvue/vue-renderless/date-range/vue';
2
2
  import { defineComponent, directive, props, setup } from '@opentinyvue/vue-common';
3
- import Clickoutside from '@opentinyvue/vue-renderless/common/deps/clickoutside';
3
+ import { Clickoutside } from '@opentinyvue/vue-directive';
4
4
  import Time from '@opentinyvue/vue-time';
5
5
  import DateTable from '@opentinyvue/vue-date-table';
6
6
  import Input from '@opentinyvue/vue-input';
@@ -131,6 +131,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
131
131
  persisted: ""
132
132
  }, {
133
133
  default: withCtx(function() {
134
+ var _ctx$state$shortcuts;
134
135
  return [withDirectives(createElementVNode(
135
136
  "div",
136
137
  {
@@ -141,7 +142,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
141
142
  [createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "sidebar", {
142
143
  dataTag: "tiny-picker-panel__sidebar",
143
144
  class: normalizeClass(_ctx.gcls("sidebar"))
144
- }), _ctx.state.shortcuts ? (openBlock(), createElementBlock(
145
+ }), (_ctx$state$shortcuts = _ctx.state.shortcuts) != null && _ctx$state$shortcuts.length ? (openBlock(), createElementBlock(
145
146
  "div",
146
147
  {
147
148
  key: 0,
package/lib/pc.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { renderless, api } from '@opentinyvue/vue-renderless/date-range/vue';
2
2
  import { defineComponent, directive, props, setup } from '@opentinyvue/vue-common';
3
- import Clickoutside from '@opentinyvue/vue-renderless/common/deps/clickoutside';
3
+ import { Clickoutside } from '@opentinyvue/vue-directive';
4
4
  import Time from '@opentinyvue/vue-time';
5
5
  import DateTable from '@opentinyvue/vue-date-table';
6
6
  import Input from '@opentinyvue/vue-input';
7
7
  import Button from '@opentinyvue/vue-button';
8
8
  import { iconDoubleRight, iconDoubleLeft, iconChevronLeft, iconChevronRight } from '@opentinyvue/vue-icon';
9
- import { resolveComponent, resolveDirective, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, renderSlot, createElementBlock, Fragment, renderList, toDisplayString, createCommentVNode, createVNode, createTextVNode, vShow } from 'vue';
9
+ import { resolveComponent, resolveDirective, openBlock, createBlock, Transition, withCtx, createElementVNode, normalizeClass, renderSlot, createElementBlock, Fragment, renderList, toDisplayString, createCommentVNode, createVNode, withDirectives, createTextVNode } from 'vue';
10
10
 
11
11
  function _createForOfIteratorHelperLoose(r, e) {
12
12
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -55,8 +55,8 @@ var _sfc_main = defineComponent({
55
55
  IconChevronLeft: iconChevronLeft(),
56
56
  IconChevronRight: iconChevronRight()
57
57
  },
58
- props: [].concat(props, ["emitter", "step", "showWeekNumber", "formatWeeks", "timeEditable"]),
59
- emits: ["dodestroy", "pick"],
58
+ props: [].concat(props, ["emitter", "step", "showWeekNumber", "formatWeeks", "timeEditable", "type", "modelValue", "format", "readonly", "shortcuts", "disabledDate", "popperClass", "unlinkPanels"]),
59
+ emits: ["dodestroy", "pick", "select-change", "update:modelValue"],
60
60
  setup: function setup$1(props2, context) {
61
61
  return setup({
62
62
  props: props2,
@@ -149,11 +149,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
149
149
  name: "tiny-zoom-in-top",
150
150
  onAfterLeave: _cache[19] || (_cache[19] = function($event) {
151
151
  return _ctx.$emit("dodestroy");
152
- }),
153
- persisted: ""
152
+ })
154
153
  }, {
155
154
  default: withCtx(function() {
156
- return [withDirectives(createElementVNode(
155
+ var _ctx$state$shortcuts;
156
+ return [createElementVNode(
157
157
  "div",
158
158
  {
159
159
  class: normalizeClass(["tiny-picker-panel tiny-date-range-picker tiny-popper", [{
@@ -164,7 +164,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
164
164
  },
165
165
  [createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "sidebar", {
166
166
  class: "tiny-picker-panel__sidebar"
167
- }), _ctx.state.shortcuts ? (openBlock(), createElementBlock(
167
+ }), (_ctx$state$shortcuts = _ctx.state.shortcuts) != null && _ctx$state$shortcuts.length ? (openBlock(), createElementBlock(
168
168
  "div",
169
169
  _hoisted_2,
170
170
  [(openBlock(true), createElementBlock(
@@ -195,20 +195,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
195
195
  placeholder: _ctx.t("ui.datepicker.startDate"),
196
196
  class: "tiny-date-range-picker__editor",
197
197
  modelValue: _ctx.state.minVisibleDate,
198
+ readonly: _ctx.readonly,
198
199
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function(val) {
199
200
  return _ctx.handleDateInput(val, "min");
200
201
  }),
201
202
  onChange: _cache[1] || (_cache[1] = function(val) {
202
203
  return _ctx.handleDateChange(val, "min");
203
204
  })
204
- }, null, 8, ["disabled", "placeholder", "modelValue"])]), withDirectives((openBlock(), createElementBlock("span", _hoisted_8, [createVNode(_component_tiny_input, {
205
+ }, null, 8, ["disabled", "placeholder", "modelValue", "readonly"])]), withDirectives((openBlock(), createElementBlock("span", _hoisted_8, [createVNode(_component_tiny_input, {
205
206
  size: "small",
206
207
  class: "tiny-date-range-picker__editor",
207
208
  disabled: _ctx.state.rangeState.selecting,
208
209
  placeholder: _ctx.t("ui.datepicker.startTime"),
209
210
  modelValue: _ctx.state.minVisibleTime,
210
211
  onFocus: _cache[2] || (_cache[2] = function($event) {
211
- return _ctx.state.minTimePickerVisible = true;
212
+ return !_ctx.readonly && (_ctx.state.minTimePickerVisible = true);
212
213
  }),
213
214
  "onUpdate:modelValue": _cache[3] || (_cache[3] = function(val) {
214
215
  return _ctx.handleTimeInput(val, "min");
@@ -216,7 +217,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
216
217
  onChange: _cache[4] || (_cache[4] = function(val) {
217
218
  return _ctx.handleTimeChange(val, "min");
218
219
  }),
219
- readonly: !_ctx.timeEditable
220
+ readonly: !_ctx.timeEditable || _ctx.readonly
220
221
  }, null, 8, ["disabled", "placeholder", "modelValue", "readonly"]), createVNode(_component_time_picker, {
221
222
  ref: "minTimePicker",
222
223
  step: _ctx.step,
@@ -230,7 +231,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
230
231
  disabled: _ctx.state.rangeState.selecting,
231
232
  placeholder: _ctx.t("ui.datepicker.endDate"),
232
233
  modelValue: _ctx.state.maxVisibleDate,
233
- readonly: !_ctx.state.minDate,
234
+ readonly: _ctx.readonly || !_ctx.state.minDate,
234
235
  "onUpdate:modelValue": _cache[5] || (_cache[5] = function(val) {
235
236
  return _ctx.handleDateInput(val, "max");
236
237
  }),
@@ -243,9 +244,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
243
244
  disabled: _ctx.state.rangeState.selecting,
244
245
  placeholder: _ctx.t("ui.datepicker.endTime"),
245
246
  modelValue: _ctx.state.maxVisibleTime,
246
- readonly: !_ctx.state.minDate || !_ctx.timeEditable,
247
+ readonly: _ctx.readonly || !_ctx.state.minDate || !_ctx.timeEditable,
247
248
  onFocus: _cache[7] || (_cache[7] = function($event) {
248
- return _ctx.state.minDate && (_ctx.state.maxTimePickerVisible = true);
249
+ return _ctx.state.minDate && !_ctx.readonly && (_ctx.state.maxTimePickerVisible = true);
249
250
  }),
250
251
  "onUpdate:modelValue": _cache[8] || (_cache[8] = function(val) {
251
252
  return _ctx.handleTimeInput(val, "max");
@@ -311,8 +312,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
311
312
  "first-day-of-week": _ctx.state.firstDayOfWeek,
312
313
  "show-week-number": _ctx.showWeekNumber,
313
314
  "format-weeks": _ctx.formatWeeks,
314
- onPick: _ctx.handleRangePick
315
- }, null, 8, ["date", "default-value", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "first-day-of-week", "show-week-number", "format-weeks", "onPick"])])]), createElementVNode("div", _hoisted_18, [createElementVNode("div", _hoisted_19, [_ctx.state.unlinkPanels ? (openBlock(), createElementBlock("button", {
315
+ onPick: _ctx.handleRangePick,
316
+ readonly: _ctx.readonly
317
+ }, null, 8, ["date", "default-value", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "first-day-of-week", "show-week-number", "format-weeks", "onPick", "readonly"])])]), createElementVNode("div", _hoisted_18, [createElementVNode("div", _hoisted_19, [_ctx.state.unlinkPanels ? (openBlock(), createElementBlock("button", {
316
318
  key: 0,
317
319
  type: "button",
318
320
  onClick: _cache[14] || (_cache[14] = function() {
@@ -363,8 +365,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
363
365
  "first-day-of-week": _ctx.state.firstDayOfWeek,
364
366
  "show-week-number": _ctx.showWeekNumber,
365
367
  "format-weeks": _ctx.formatWeeks,
366
- onPick: _ctx.handleRangePick
367
- }, null, 8, ["date", "default-value", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "first-day-of-week", "show-week-number", "format-weeks", "onPick"])])])])]), _ctx.state.showTime ? (openBlock(), createElementBlock("div", _hoisted_23, [createVNode(_component_tiny_button, {
368
+ onPick: _ctx.handleRangePick,
369
+ readonly: _ctx.readonly
370
+ }, null, 8, ["date", "default-value", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "first-day-of-week", "show-week-number", "format-weeks", "onPick", "readonly"])])])])]), _ctx.state.showTime && !_ctx.readonly ? (openBlock(), createElementBlock("div", _hoisted_23, [createVNode(_component_tiny_button, {
368
371
  type: "text",
369
372
  class: "tiny-picker-panel__link-btn",
370
373
  onClick: _ctx.handleClear
@@ -399,7 +402,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
399
402
  }, 8, ["plain", "type", "disabled"])])) : createCommentVNode("v-if", true)],
400
403
  2
401
404
  /* CLASS */
402
- ), [[vShow, _ctx.state.visible]])];
405
+ )];
403
406
  }),
404
407
  _: 3
405
408
  /* FORWARDED */
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-date-range",
3
- "version": "3.21.0",
3
+ "type": "module",
4
+ "version": "3.22.1",
4
5
  "description": "",
6
+ "license": "MIT",
7
+ "sideEffects": false,
5
8
  "main": "./lib/index.js",
6
9
  "module": "./lib/index.js",
7
- "sideEffects": false,
8
- "type": "module",
9
10
  "dependencies": {
10
- "@opentinyvue/vue-common": "~3.21.0",
11
- "@opentinyvue/vue-renderless": "~3.21.0",
12
- "@opentinyvue/vue-input": "~3.21.0",
13
- "@opentinyvue/vue-button": "~3.21.0",
14
- "@opentinyvue/vue-time": "~3.21.0",
15
- "@opentinyvue/vue-date-table": "~3.21.0",
16
- "@opentinyvue/vue-theme": "~3.21.0",
17
- "@opentinyvue/vue-icon": "~3.21.0"
11
+ "@opentinyvue/vue-button": "~3.22.0",
12
+ "@opentinyvue/vue-common": "~3.22.0",
13
+ "@opentinyvue/vue-date-table": "~3.22.0",
14
+ "@opentinyvue/vue-directive": "~3.22.0",
15
+ "@opentinyvue/vue-icon": "~3.22.0",
16
+ "@opentinyvue/vue-input": "~3.22.0",
17
+ "@opentinyvue/vue-renderless": "~3.22.0",
18
+ "@opentinyvue/vue-theme": "~3.22.0",
19
+ "@opentinyvue/vue-time": "~3.22.0"
18
20
  },
19
- "license": "MIT",
20
21
  "types": "index.d.ts",
21
22
  "scripts": {
22
23
  "build": "pnpm -w build:ui $npm_package_name",
package/src/index.d.ts CHANGED
@@ -24,6 +24,38 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
24
24
  type: BooleanConstructor;
25
25
  default: boolean;
26
26
  };
27
+ type: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ modelValue: {
32
+ type: ArrayConstructor;
33
+ default: () => never[];
34
+ };
35
+ format: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ readonly: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
43
+ shortcuts: {
44
+ type: ArrayConstructor;
45
+ default: () => never[];
46
+ };
47
+ disabledDate: {
48
+ type: FunctionConstructor;
49
+ default: null;
50
+ };
51
+ popperClass: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ unlinkPanels: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
27
59
  tiny_mode: StringConstructor;
28
60
  tiny_mode_root: BooleanConstructor;
29
61
  tiny_template: (ObjectConstructor | FunctionConstructor)[];
@@ -58,6 +90,38 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
58
90
  type: BooleanConstructor;
59
91
  default: boolean;
60
92
  };
93
+ type: {
94
+ type: StringConstructor;
95
+ default: string;
96
+ };
97
+ modelValue: {
98
+ type: ArrayConstructor;
99
+ default: () => never[];
100
+ };
101
+ format: {
102
+ type: StringConstructor;
103
+ default: string;
104
+ };
105
+ readonly: {
106
+ type: BooleanConstructor;
107
+ default: boolean;
108
+ };
109
+ shortcuts: {
110
+ type: ArrayConstructor;
111
+ default: () => never[];
112
+ };
113
+ disabledDate: {
114
+ type: FunctionConstructor;
115
+ default: null;
116
+ };
117
+ popperClass: {
118
+ type: StringConstructor;
119
+ default: string;
120
+ };
121
+ unlinkPanels: {
122
+ type: BooleanConstructor;
123
+ default: boolean;
124
+ };
61
125
  tiny_mode: StringConstructor;
62
126
  tiny_mode_root: BooleanConstructor;
63
127
  tiny_template: (ObjectConstructor | FunctionConstructor)[];
@@ -65,10 +129,18 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
65
129
  tiny_theme: StringConstructor;
66
130
  tiny_chart_theme: ObjectConstructor;
67
131
  }>>, {
132
+ format: string;
133
+ type: string;
68
134
  tiny_mode_root: boolean;
69
135
  _constants: Record<string, any>;
136
+ modelValue: unknown[];
137
+ popperClass: string;
138
+ readonly: boolean;
70
139
  timeEditable: boolean;
140
+ unlinkPanels: boolean;
71
141
  step: Record<string, any>;
72
142
  showWeekNumber: boolean;
143
+ disabledDate: Function;
144
+ shortcuts: unknown[];
73
145
  }, {}>;
74
146
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
2
+ format?: any;
3
+ type?: any;
2
4
  tiny_mode?: any;
3
5
  tiny_mode_root?: any;
4
6
  tiny_template?: any;
@@ -6,11 +8,17 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
6
8
  _constants?: any;
7
9
  tiny_theme?: any;
8
10
  tiny_chart_theme?: any;
11
+ modelValue?: any;
12
+ popperClass?: any;
13
+ readonly?: any;
9
14
  timeEditable?: any;
15
+ unlinkPanels?: any;
10
16
  step?: any;
11
17
  showWeekNumber?: any;
12
18
  formatWeeks?: any;
19
+ disabledDate?: any;
13
20
  emitter?: any;
21
+ shortcuts?: any;
14
22
  }>, {
15
23
  t: (this: any, path: any, options?: any) => any;
16
24
  vm: any;
@@ -20,7 +28,9 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
20
28
  dp: (props: any) => void;
21
29
  gcls: (key: any) => any;
22
30
  m: (...cssClasses: any[]) => string;
23
- }, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("pick" | "dodestroy")[], "pick" | "dodestroy", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
31
+ }, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("update:modelValue" | "select-change" | "pick" | "dodestroy")[], "update:modelValue" | "select-change" | "pick" | "dodestroy", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
32
+ format?: any;
33
+ type?: any;
24
34
  tiny_mode?: any;
25
35
  tiny_mode_root?: any;
26
36
  tiny_template?: any;
@@ -28,15 +38,25 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
28
38
  _constants?: any;
29
39
  tiny_theme?: any;
30
40
  tiny_chart_theme?: any;
41
+ modelValue?: any;
42
+ popperClass?: any;
43
+ readonly?: any;
31
44
  timeEditable?: any;
45
+ unlinkPanels?: any;
32
46
  step?: any;
33
47
  showWeekNumber?: any;
34
48
  formatWeeks?: any;
49
+ disabledDate?: any;
35
50
  emitter?: any;
51
+ shortcuts?: any;
36
52
  }>>> & {
53
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
37
54
  onPick?: ((...args: any[]) => any) | undefined;
55
+ "onSelect-change"?: ((...args: any[]) => any) | undefined;
38
56
  onDodestroy?: ((...args: any[]) => any) | undefined;
39
57
  }, {
58
+ readonly format?: any;
59
+ readonly type?: any;
40
60
  readonly tiny_mode?: any;
41
61
  readonly tiny_mode_root?: any;
42
62
  readonly tiny_template?: any;
@@ -44,10 +64,16 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
44
64
  readonly _constants?: any;
45
65
  readonly tiny_theme?: any;
46
66
  readonly tiny_chart_theme?: any;
67
+ readonly modelValue?: any;
68
+ readonly popperClass?: any;
69
+ readonly readonly?: any;
47
70
  readonly timeEditable?: any;
71
+ readonly unlinkPanels?: any;
48
72
  readonly step?: any;
49
73
  readonly showWeekNumber?: any;
50
74
  readonly formatWeeks?: any;
75
+ readonly disabledDate?: any;
51
76
  readonly emitter?: any;
77
+ readonly shortcuts?: any;
52
78
  }, {}>;
53
79
  export default _default;