@varlet/ui 2.1.0-alpha.1667210582672 → 2.1.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.
- package/CHANGELOG.md +1885 -1885
- package/es/index.d.ts +1 -1
- package/es/locale/en-US.d.ts +5 -5
- package/es/locale/zh-CN.d.ts +5 -5
- package/es/themes/dark/index.d.ts +5 -5
- package/highlight/attributes.json +0 -820
- package/highlight/tags.json +30 -265
- package/highlight/web-types.json +1206 -3500
- package/json/area.json +10706 -10706
- package/lib/date-picker/src/day-picker-panel.js +13 -13
- package/lib/date-picker/src/month-picker-panel.js +11 -11
- package/lib/date-picker/src/year-picker-panel.js +3 -3
- package/lib/index.d.ts +1 -1
- package/lib/locale/en-US.d.ts +5 -5
- package/lib/locale/zh-CN.d.ts +5 -5
- package/lib/themes/dark/index.d.ts +5 -5
- package/package.json +5 -5
- package/types/lazy.d.ts +5 -5
- package/types/ripple.d.ts +5 -5
- package/types/varDirective.d.ts +12 -12
|
@@ -4,11 +4,11 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
exports.render = render;
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _esm = _interopRequireDefault(require("dayjs/esm"));
|
|
8
8
|
|
|
9
|
-
var _isSameOrBefore = _interopRequireDefault(require("dayjs/plugin/isSameOrBefore"));
|
|
9
|
+
var _isSameOrBefore = _interopRequireDefault(require("dayjs/esm/plugin/isSameOrBefore"));
|
|
10
10
|
|
|
11
|
-
var _isSameOrAfter = _interopRequireDefault(require("dayjs/plugin/isSameOrAfter"));
|
|
11
|
+
var _isSameOrAfter = _interopRequireDefault(require("dayjs/esm/plugin/isSameOrAfter"));
|
|
12
12
|
|
|
13
13
|
var _panelHeader = _interopRequireDefault(require("./panel-header.js"));
|
|
14
14
|
|
|
@@ -28,9 +28,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
28
|
|
|
29
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
_esm.default.extend(_isSameOrBefore.default);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
_esm.default.extend(_isSameOrAfter.default);
|
|
34
34
|
|
|
35
35
|
var {
|
|
36
36
|
n,
|
|
@@ -186,8 +186,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
186
186
|
previewYear
|
|
187
187
|
}
|
|
188
188
|
} = props;
|
|
189
|
-
var monthNum = (0,
|
|
190
|
-
var firstDayToWeek = (0,
|
|
189
|
+
var monthNum = (0, _esm.default)(previewYear + "-" + previewMonth.index).daysInMonth();
|
|
190
|
+
var firstDayToWeek = (0, _esm.default)(previewYear + "-" + previewMonth.index + "-01").day();
|
|
191
191
|
var index = sortWeekList.value.findIndex(week => week.index === "" + firstDayToWeek);
|
|
192
192
|
days.value = [...Array(index).fill(-1), ...Array.from(Array(monthNum + 1).keys())].filter(value => value);
|
|
193
193
|
};
|
|
@@ -206,13 +206,13 @@ var _default = (0, _vue.defineComponent)({
|
|
|
206
206
|
|
|
207
207
|
if (max) {
|
|
208
208
|
var date = previewYear + "-" + ((0, _shared.toNumber)(previewMonth.index) + 1);
|
|
209
|
-
panelBtnDisabled.right = !(0,
|
|
209
|
+
panelBtnDisabled.right = !(0, _esm.default)(date).isSameOrBefore((0, _esm.default)(max), 'month');
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
if (min) {
|
|
213
213
|
var _date = previewYear + "-" + ((0, _shared.toNumber)(previewMonth.index) - 1);
|
|
214
214
|
|
|
215
|
-
panelBtnDisabled.left = !(0,
|
|
215
|
+
panelBtnDisabled.left = !(0, _esm.default)(_date).isSameOrAfter((0, _esm.default)(min), 'month');
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
|
|
@@ -230,8 +230,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
230
230
|
var isBeforeMax = true;
|
|
231
231
|
var isAfterMin = true;
|
|
232
232
|
var previewDate = previewYear + "-" + previewMonth.index + "-" + day;
|
|
233
|
-
if (max) isBeforeMax = (0,
|
|
234
|
-
if (min) isAfterMin = (0,
|
|
233
|
+
if (max) isBeforeMax = (0, _esm.default)(previewDate).isSameOrBefore((0, _esm.default)(max), 'day');
|
|
234
|
+
if (min) isAfterMin = (0, _esm.default)(previewDate).isSameOrAfter((0, _esm.default)(min), 'day');
|
|
235
235
|
return isBeforeMax && isAfterMin;
|
|
236
236
|
};
|
|
237
237
|
|
|
@@ -248,8 +248,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
248
248
|
|
|
249
249
|
if (range) {
|
|
250
250
|
if (!chooseRangeDay.length) return false;
|
|
251
|
-
var isBeforeMax = (0,
|
|
252
|
-
var isAfterMin = (0,
|
|
251
|
+
var isBeforeMax = (0, _esm.default)(val).isSameOrBefore((0, _esm.default)(chooseRangeDay[1]), 'day');
|
|
252
|
+
var isAfterMin = (0, _esm.default)(val).isSameOrAfter((0, _esm.default)(chooseRangeDay[0]), 'day');
|
|
253
253
|
return isBeforeMax && isAfterMin;
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -6,11 +6,11 @@ exports.render = render;
|
|
|
6
6
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _esm = _interopRequireDefault(require("dayjs/esm"));
|
|
10
10
|
|
|
11
|
-
var _isSameOrBefore = _interopRequireDefault(require("dayjs/plugin/isSameOrBefore"));
|
|
11
|
+
var _isSameOrBefore = _interopRequireDefault(require("dayjs/esm/plugin/isSameOrBefore"));
|
|
12
12
|
|
|
13
|
-
var _isSameOrAfter = _interopRequireDefault(require("dayjs/plugin/isSameOrAfter"));
|
|
13
|
+
var _isSameOrAfter = _interopRequireDefault(require("dayjs/esm/plugin/isSameOrAfter"));
|
|
14
14
|
|
|
15
15
|
var _props = require("../props");
|
|
16
16
|
|
|
@@ -28,9 +28,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
28
|
|
|
29
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
_esm.default.extend(_isSameOrBefore.default);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
_esm.default.extend(_isSameOrAfter.default);
|
|
34
34
|
|
|
35
35
|
var {
|
|
36
36
|
n,
|
|
@@ -162,8 +162,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
162
162
|
var isBeforeMax = true;
|
|
163
163
|
var isAfterMin = true;
|
|
164
164
|
var previewDate = previewYear + "-" + key;
|
|
165
|
-
if (max) isBeforeMax = (0,
|
|
166
|
-
if (min) isAfterMin = (0,
|
|
165
|
+
if (max) isBeforeMax = (0, _esm.default)(previewDate).isSameOrBefore((0, _esm.default)(max), 'month');
|
|
166
|
+
if (min) isAfterMin = (0, _esm.default)(previewDate).isSameOrAfter((0, _esm.default)(min), 'month');
|
|
167
167
|
return isBeforeMax && isAfterMin;
|
|
168
168
|
};
|
|
169
169
|
|
|
@@ -182,8 +182,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
182
182
|
|
|
183
183
|
if (range) {
|
|
184
184
|
if (!chooseRangeMonth.length) return false;
|
|
185
|
-
var isBeforeMax = (0,
|
|
186
|
-
var isAfterMin = (0,
|
|
185
|
+
var isBeforeMax = (0, _esm.default)(val).isSameOrBefore((0, _esm.default)(chooseRangeMonth[1]), 'month');
|
|
186
|
+
var isAfterMin = (0, _esm.default)(val).isSameOrAfter((0, _esm.default)(chooseRangeMonth[0]), 'month');
|
|
187
187
|
return isBeforeMax && isAfterMin;
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -281,8 +281,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
281
281
|
max
|
|
282
282
|
}
|
|
283
283
|
} = props;
|
|
284
|
-
if (max) panelBtnDisabled.right = !(0,
|
|
285
|
-
if (min) panelBtnDisabled.left = !(0,
|
|
284
|
+
if (max) panelBtnDisabled.right = !(0, _esm.default)("" + ((0, _shared.toNumber)(year) + 1)).isSameOrBefore((0, _esm.default)(max), 'year');
|
|
285
|
+
if (min) panelBtnDisabled.left = !(0, _esm.default)("" + ((0, _shared.toNumber)(year) - 1)).isSameOrAfter((0, _esm.default)(min), 'year');
|
|
286
286
|
}, {
|
|
287
287
|
immediate: true
|
|
288
288
|
});
|
|
@@ -6,7 +6,7 @@ exports.render = render;
|
|
|
6
6
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _esm = _interopRequireDefault(require("dayjs/esm"));
|
|
10
10
|
|
|
11
11
|
var _shared = require("@varlet/shared");
|
|
12
12
|
|
|
@@ -75,14 +75,14 @@ var _default = (0, _vue.defineComponent)({
|
|
|
75
75
|
var yearRange = [(0, _shared.toNumber)(preview) + 100, (0, _shared.toNumber)(preview) - 100];
|
|
76
76
|
|
|
77
77
|
if (max) {
|
|
78
|
-
var formatMax = (0,
|
|
78
|
+
var formatMax = (0, _esm.default)(max).format('YYYY-MM-D');
|
|
79
79
|
var year = (0, _shared.toNumber)(formatMax.split('-')[0]);
|
|
80
80
|
if (year < yearRange[0] && year > yearRange[1]) yearRange = [year, yearRange[1]];
|
|
81
81
|
if (year <= yearRange[1]) return [year];
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (min) {
|
|
85
|
-
var formatMin = (0,
|
|
85
|
+
var formatMin = (0, _esm.default)(min).format('YYYY-MM-D');
|
|
86
86
|
|
|
87
87
|
var _year = (0, _shared.toNumber)(formatMin.split('-')[0]);
|
|
88
88
|
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '..\types'
|
package/lib/locale/en-US.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Pack } from '../../types'
|
|
2
|
-
|
|
3
|
-
declare const enUS: Pack
|
|
4
|
-
|
|
5
|
-
export default enUS
|
|
1
|
+
import type { Pack } from '../../types'
|
|
2
|
+
|
|
3
|
+
declare const enUS: Pack
|
|
4
|
+
|
|
5
|
+
export default enUS
|
package/lib/locale/zh-CN.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Pack } from '../../types'
|
|
2
|
-
|
|
3
|
-
declare const zhCN: Pack
|
|
4
|
-
|
|
5
|
-
export default zhCN
|
|
1
|
+
import type { Pack } from '../../types'
|
|
2
|
+
|
|
3
|
+
declare const zhCN: Pack
|
|
4
|
+
|
|
5
|
+
export default zhCN
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleVars } from '../../../types'
|
|
2
|
-
|
|
3
|
-
declare const dark: StyleVars
|
|
4
|
-
|
|
5
|
-
export default dark
|
|
1
|
+
import { StyleVars } from '../../../types'
|
|
2
|
+
|
|
3
|
+
declare const dark: StyleVars
|
|
4
|
+
|
|
5
|
+
export default dark
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
|
-
"@varlet/icons": "2.1.0
|
|
50
|
-
"@varlet/shared": "2.1.0
|
|
49
|
+
"@varlet/icons": "2.1.0",
|
|
50
|
+
"@varlet/shared": "2.1.0",
|
|
51
51
|
"dayjs": "^1.10.4",
|
|
52
52
|
"decimal.js": "^10.2.1"
|
|
53
53
|
},
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@types/jest": "^26.0.15",
|
|
56
56
|
"@types/lodash-es": "^4.17.6",
|
|
57
57
|
"@types/node": "^18.7.18",
|
|
58
|
-
"@varlet/cli": "2.1.0
|
|
59
|
-
"@varlet/touch-emulator": "2.1.0
|
|
58
|
+
"@varlet/cli": "2.1.0",
|
|
59
|
+
"@varlet/touch-emulator": "2.1.0",
|
|
60
60
|
"@vue/runtime-core": "3.2.25",
|
|
61
61
|
"@vue/test-utils": "^2.0.2",
|
|
62
62
|
"clipboard": "^2.0.6",
|
package/types/lazy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VarDirective } from './varDirective'
|
|
2
|
-
|
|
3
|
-
export class Lazy extends VarDirective {}
|
|
4
|
-
|
|
5
|
-
export class _LazyComponent extends Lazy {}
|
|
1
|
+
import { VarDirective } from './varDirective'
|
|
2
|
+
|
|
3
|
+
export class Lazy extends VarDirective {}
|
|
4
|
+
|
|
5
|
+
export class _LazyComponent extends Lazy {}
|
package/types/ripple.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VarDirective } from './varDirective'
|
|
2
|
-
|
|
3
|
-
export class Ripple extends VarDirective {}
|
|
4
|
-
|
|
5
|
-
export class _RippleComponent extends Ripple {}
|
|
1
|
+
import { VarDirective } from './varDirective'
|
|
2
|
+
|
|
3
|
+
export class Ripple extends VarDirective {}
|
|
4
|
+
|
|
5
|
+
export class _RippleComponent extends Ripple {}
|
package/types/varDirective.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { App } from 'vue'
|
|
2
|
-
import { DirectiveBinding } from '@vue/runtime-core'
|
|
3
|
-
|
|
4
|
-
export class VarDirective {
|
|
5
|
-
static install(app: App): void
|
|
6
|
-
|
|
7
|
-
static mounted(el: HTMLElement, binding: DirectiveBinding): void
|
|
8
|
-
|
|
9
|
-
static updated(el: HTMLElement, binding: DirectiveBinding): void
|
|
10
|
-
|
|
11
|
-
static unmounted(el: HTMLElement, binding: DirectiveBinding): void
|
|
12
|
-
}
|
|
1
|
+
import type { App } from 'vue'
|
|
2
|
+
import { DirectiveBinding } from '@vue/runtime-core'
|
|
3
|
+
|
|
4
|
+
export class VarDirective {
|
|
5
|
+
static install(app: App): void
|
|
6
|
+
|
|
7
|
+
static mounted(el: HTMLElement, binding: DirectiveBinding): void
|
|
8
|
+
|
|
9
|
+
static updated(el: HTMLElement, binding: DirectiveBinding): void
|
|
10
|
+
|
|
11
|
+
static unmounted(el: HTMLElement, binding: DirectiveBinding): void
|
|
12
|
+
}
|