@varlet/ui 2.1.0 → 2.2.0-alpha.1667670228109
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/checkbox/checkbox.css +1 -1
- package/es/counter/Counter.js +5 -5
- package/es/counter/counter.css +1 -1
- package/es/form/index.js +4 -0
- package/es/form-details/FormDetails.js +39 -8
- package/es/form-details/formDetails.css +1 -1
- package/es/form-details/props.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/input/Input.js +3 -3
- package/es/input/input.css +1 -1
- package/es/locale/en-US.d.ts +5 -5
- package/es/locale/zh-CN.d.ts +5 -5
- package/es/radio/radio.css +1 -1
- package/es/select/select.css +1 -1
- package/es/style.css +1 -1
- package/es/themes/dark/index.d.ts +5 -5
- package/es/uploader/Uploader.js +2 -2
- package/es/varlet.esm.js +1971 -1933
- package/highlight/attributes.json +820 -0
- package/highlight/tags.json +265 -30
- package/highlight/web-types.json +3344 -1050
- package/json/area.json +10706 -10706
- package/lib/checkbox/checkbox.css +1 -1
- package/lib/counter/Counter.js +5 -5
- package/lib/counter/counter.css +1 -1
- 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/form/index.js +6 -0
- package/lib/form-details/FormDetails.js +38 -7
- package/lib/form-details/formDetails.css +1 -1
- package/lib/form-details/props.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/input/Input.js +3 -3
- package/lib/input/input.css +1 -1
- package/lib/locale/en-US.d.ts +5 -5
- package/lib/locale/zh-CN.d.ts +5 -5
- package/lib/radio/radio.css +1 -1
- package/lib/select/select.css +1 -1
- package/lib/style.css +1 -1
- package/lib/themes/dark/index.d.ts +5 -5
- package/lib/uploader/Uploader.js +2 -2
- package/package.json +5 -5
- package/types/form.d.ts +28 -1
- package/types/formDetails.d.ts +12 -0
- package/types/index.d.ts +2 -0
- package/types/lazy.d.ts +5 -5
- package/types/ripple.d.ts +5 -5
- package/types/varDirective.d.ts +12 -12
- package/umd/varlet.js +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --checkbox-checked-color: var(--color-primary); --checkbox-unchecked-color: #555; --checkbox-disabled-color: var(--color-text-disabled); --checkbox-error-color: var(--color-danger); --checkbox-action-padding: 6px; --checkbox-icon-size: 24px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-checkbox { display: flex; align-items: center; transform: translateX(calc(-1 * var(--checkbox-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-checkbox__wrap { display: inline-flex; flex-direction: column;}.var-checkbox__action { display: flex; justify-content: center; align-items: center; padding: var(--checkbox-action-padding); border-radius: 50%;}.var-checkbox__icon[var-checkbox-cover] { display: block; font-size: var(--checkbox-icon-size);}.var-checkbox--with-animation { animation: var-vibrate-animation 0.25s;}.var-checkbox--checked { color: var(--checkbox-checked-color);}.var-checkbox--unchecked { color: var(--checkbox-unchecked-color);}.var-checkbox--disabled { color: var(--checkbox-disabled-color);}.var-checkbox--error { color: var(--checkbox-error-color);}
|
|
1
|
+
:root { --checkbox-checked-color: var(--color-primary); --checkbox-unchecked-color: #555; --checkbox-disabled-color: var(--color-text-disabled); --checkbox-error-color: var(--color-danger); --checkbox-action-padding: 6px; --checkbox-icon-size: 24px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-checkbox { display: flex; align-items: center; transform: translateX(calc(-1 * var(--checkbox-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-checkbox__wrap { display: inline-flex; flex-direction: column;}.var-checkbox__action { display: flex; justify-content: center; align-items: center; padding: var(--checkbox-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-checkbox__icon[var-checkbox-cover] { display: block; font-size: var(--checkbox-icon-size);}.var-checkbox--with-animation { animation: var-vibrate-animation 0.25s;}.var-checkbox--checked { color: var(--checkbox-checked-color);}.var-checkbox--unchecked { color: var(--checkbox-unchecked-color);}.var-checkbox--disabled { color: var(--checkbox-disabled-color); cursor: not-allowed;}.var-checkbox--error { color: var(--checkbox-error-color);}
|
package/lib/counter/Counter.js
CHANGED
|
@@ -54,7 +54,7 @@ function render(_ctx, _cache) {
|
|
|
54
54
|
}, _ctx.$attrs), [(0, _vue.withDirectives)((0, _vue.createVNode)(_component_var_icon, {
|
|
55
55
|
"var-counter-cover": "",
|
|
56
56
|
name: "minus",
|
|
57
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('decrement-button'), [!_ctx.decrementButton, _ctx.n('--hidden')])),
|
|
57
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('decrement-button'), [!_ctx.decrementButton, _ctx.n('--hidden')], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--text-disabled') + " " + _ctx.n('--not-allowed')])),
|
|
58
58
|
style: (0, _vue.normalizeStyle)({
|
|
59
59
|
width: _ctx.toSizeUnit(_ctx.buttonSize),
|
|
60
60
|
height: _ctx.toSizeUnit(_ctx.buttonSize)
|
|
@@ -66,9 +66,9 @@ function render(_ctx, _cache) {
|
|
|
66
66
|
}, null, 8
|
|
67
67
|
/* PROPS */
|
|
68
68
|
, ["class", "style", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]), [[_directive_ripple, {
|
|
69
|
-
disabled: !_ctx.ripple || _ctx.disabled || _ctx.readonly || _ctx.disableDecrement || !_ctx.decrementButton || _ctx.isMin
|
|
69
|
+
disabled: !_ctx.ripple || _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly || _ctx.disableDecrement || !_ctx.decrementButton || _ctx.isMin
|
|
70
70
|
}]]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("input", {
|
|
71
|
-
class: (0, _vue.normalizeClass)(_ctx.n('input')),
|
|
71
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('input'), [_ctx.disabled || _ctx.formDisabled, _ctx.n('--text-disabled') + " " + _ctx.n('--not-allowed')])),
|
|
72
72
|
style: (0, _vue.normalizeStyle)({
|
|
73
73
|
width: _ctx.toSizeUnit(_ctx.inputWidth),
|
|
74
74
|
fontSize: _ctx.toSizeUnit(_ctx.inputTextSize)
|
|
@@ -85,7 +85,7 @@ function render(_ctx, _cache) {
|
|
|
85
85
|
, _hoisted_1), [[_vue.vModelText, _ctx.inputValue]]), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_var_icon, {
|
|
86
86
|
"var-counter-cover": "",
|
|
87
87
|
name: "plus",
|
|
88
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('increment-button'), [!_ctx.incrementButton, _ctx.n('--hidden')])),
|
|
88
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('increment-button'), [!_ctx.incrementButton, _ctx.n('--hidden')], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--text-disabled') + " " + _ctx.n('--not-allowed')])),
|
|
89
89
|
style: (0, _vue.normalizeStyle)({
|
|
90
90
|
width: _ctx.toSizeUnit(_ctx.buttonSize),
|
|
91
91
|
height: _ctx.toSizeUnit(_ctx.buttonSize)
|
|
@@ -97,7 +97,7 @@ function render(_ctx, _cache) {
|
|
|
97
97
|
}, null, 8
|
|
98
98
|
/* PROPS */
|
|
99
99
|
, ["class", "style", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]), [[_directive_ripple, {
|
|
100
|
-
disabled: !_ctx.ripple || _ctx.disabled || _ctx.readonly || _ctx.disableIncrement || !_ctx.incrementButton || _ctx.isMax
|
|
100
|
+
disabled: !_ctx.ripple || _ctx.disabled || _ctx.readonly || _ctx.formDisabled || _ctx.formReadonly || _ctx.disableIncrement || !_ctx.incrementButton || _ctx.isMax
|
|
101
101
|
}]])], 16
|
|
102
102
|
/* FULL_PROPS */
|
|
103
103
|
), (0, _vue.createVNode)(_component_var_form_details, {
|
package/lib/counter/counter.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-text-disabled); --
|
|
1
|
+
:root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-disabled); --counter-disabled-text-color: var(--color-text-disabled); --counter-error-color: var(--color-danger);}.var-counter { display: inline-flex; flex-direction: column; align-items: flex-start;}.var-counter__controller { display: flex; align-items: center; color: var(--counter-font-color); border-radius: var(--counter-button-size); padding: var(--counter-padding); background: var(--counter-background); transition: color 0.25s, background-color 0.25s;}.var-counter__decrement-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-select: none; user-select: none;}.var-counter__input { width: var(--counter-input-width); font-size: var(--counter-input-font-size); outline: none; border: none; background: transparent; padding: 0; text-align: center; color: var(--counter-font-color); margin: var(--counter-input-margin);}.var-counter__input[disabled] { background: transparent;}.var-counter__increment-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-select: none; user-select: none;}.var-counter--disabled { background: var(--counter-disabled-color); cursor: not-allowed;}.var-counter--text-disabled,.var-counter--text-disabled[var-counter-cover] { color: var(--counter-disabled-text-color);}.var-counter--not-allowed { cursor: not-allowed !important;}.var-counter--hidden { opacity: 0;}.var-counter--error { background: var(--counter-error-color);}
|
|
@@ -4,11 +4,11 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
exports.render = render;
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
8
8
|
|
|
9
|
-
var _isSameOrBefore = _interopRequireDefault(require("dayjs/
|
|
9
|
+
var _isSameOrBefore = _interopRequireDefault(require("dayjs/plugin/isSameOrBefore"));
|
|
10
10
|
|
|
11
|
-
var _isSameOrAfter = _interopRequireDefault(require("dayjs/
|
|
11
|
+
var _isSameOrAfter = _interopRequireDefault(require("dayjs/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
|
+
_dayjs.default.extend(_isSameOrBefore.default);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
_dayjs.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, _dayjs.default)(previewYear + "-" + previewMonth.index).daysInMonth();
|
|
190
|
+
var firstDayToWeek = (0, _dayjs.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, _dayjs.default)(date).isSameOrBefore((0, _dayjs.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, _dayjs.default)(_date).isSameOrAfter((0, _dayjs.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, _dayjs.default)(previewDate).isSameOrBefore((0, _dayjs.default)(max), 'day');
|
|
234
|
+
if (min) isAfterMin = (0, _dayjs.default)(previewDate).isSameOrAfter((0, _dayjs.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, _dayjs.default)(val).isSameOrBefore((0, _dayjs.default)(chooseRangeDay[1]), 'day');
|
|
252
|
+
var isAfterMin = (0, _dayjs.default)(val).isSameOrAfter((0, _dayjs.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 _dayjs = _interopRequireDefault(require("dayjs"));
|
|
10
10
|
|
|
11
|
-
var _isSameOrBefore = _interopRequireDefault(require("dayjs/
|
|
11
|
+
var _isSameOrBefore = _interopRequireDefault(require("dayjs/plugin/isSameOrBefore"));
|
|
12
12
|
|
|
13
|
-
var _isSameOrAfter = _interopRequireDefault(require("dayjs/
|
|
13
|
+
var _isSameOrAfter = _interopRequireDefault(require("dayjs/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
|
+
_dayjs.default.extend(_isSameOrBefore.default);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
_dayjs.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, _dayjs.default)(previewDate).isSameOrBefore((0, _dayjs.default)(max), 'month');
|
|
166
|
+
if (min) isAfterMin = (0, _dayjs.default)(previewDate).isSameOrAfter((0, _dayjs.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, _dayjs.default)(val).isSameOrBefore((0, _dayjs.default)(chooseRangeMonth[1]), 'month');
|
|
186
|
+
var isAfterMin = (0, _dayjs.default)(val).isSameOrAfter((0, _dayjs.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, _dayjs.default)("" + ((0, _shared.toNumber)(year) + 1)).isSameOrBefore((0, _dayjs.default)(max), 'year');
|
|
285
|
+
if (min) panelBtnDisabled.left = !(0, _dayjs.default)("" + ((0, _shared.toNumber)(year) - 1)).isSameOrAfter((0, _dayjs.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 _dayjs = _interopRequireDefault(require("dayjs"));
|
|
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, _dayjs.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, _dayjs.default)(min).format('YYYY-MM-D');
|
|
86
86
|
|
|
87
87
|
var _year = (0, _shared.toNumber)(formatMin.split('-')[0]);
|
|
88
88
|
|
package/lib/form/index.js
CHANGED
|
@@ -5,12 +5,18 @@ exports.default = exports._FormComponent = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _Form = _interopRequireDefault(require("./Form.js"));
|
|
7
7
|
|
|
8
|
+
var _components = require("../utils/components");
|
|
9
|
+
|
|
10
|
+
var _provide = require("./provide");
|
|
11
|
+
|
|
8
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
13
|
|
|
10
14
|
_Form.default.install = function (app) {
|
|
11
15
|
app.component(_Form.default.name, _Form.default);
|
|
12
16
|
};
|
|
13
17
|
|
|
18
|
+
_Form.default.useValidation = _components.useValidation;
|
|
19
|
+
_Form.default.useForm = _provide.useForm;
|
|
14
20
|
var _FormComponent = _Form.default;
|
|
15
21
|
exports._FormComponent = _FormComponent;
|
|
16
22
|
var _default = _Form.default;
|
|
@@ -14,21 +14,52 @@ var {
|
|
|
14
14
|
n
|
|
15
15
|
} = (0, _components.createNamespace)('form-details');
|
|
16
16
|
|
|
17
|
+
var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
|
|
18
|
+
|
|
19
|
+
var _hoisted_1 = {
|
|
20
|
+
key: 0
|
|
21
|
+
};
|
|
22
|
+
var _hoisted_2 = {
|
|
23
|
+
key: 0
|
|
24
|
+
};
|
|
25
|
+
|
|
17
26
|
function render(_ctx, _cache) {
|
|
18
27
|
return (0, _vue.openBlock)(), (0, _vue.createBlock)(_vue.Transition, {
|
|
19
28
|
name: _ctx.n()
|
|
20
29
|
}, {
|
|
21
|
-
default: (0, _vue.withCtx)(() => [_ctx.errorMessage || _ctx.
|
|
30
|
+
default: (0, _vue.withCtx)(() => [_ctx.errorMessage || _ctx.extraMessage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
22
31
|
key: 0,
|
|
23
32
|
class: (0, _vue.normalizeClass)(_ctx.n())
|
|
24
33
|
}, [(0, _vue.createElementVNode)("div", {
|
|
25
|
-
class: (0, _vue.normalizeClass)(_ctx.n('message'))
|
|
26
|
-
}, (0, _vue.
|
|
27
|
-
|
|
34
|
+
class: (0, _vue.normalizeClass)(_ctx.n('error-message'))
|
|
35
|
+
}, [(0, _vue.createVNode)(_vue.Transition, {
|
|
36
|
+
name: _ctx.n('message')
|
|
37
|
+
}, {
|
|
38
|
+
default: (0, _vue.withCtx)(() => [_ctx.errorMessage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, (0, _vue.toDisplayString)(_ctx.errorMessage), 1
|
|
39
|
+
/* TEXT */
|
|
40
|
+
)) : (0, _vue.createCommentVNode)("v-if", true)]),
|
|
41
|
+
_: 1
|
|
42
|
+
/* STABLE */
|
|
43
|
+
|
|
44
|
+
}, 8
|
|
45
|
+
/* PROPS */
|
|
46
|
+
, ["name"])], 2
|
|
47
|
+
/* CLASS */
|
|
28
48
|
), (0, _vue.createElementVNode)("div", {
|
|
29
|
-
class: (0, _vue.normalizeClass)(_ctx.n('
|
|
30
|
-
}, (0, _vue.
|
|
31
|
-
|
|
49
|
+
class: (0, _vue.normalizeClass)(_ctx.n('extra-message'))
|
|
50
|
+
}, [(0, _vue.createVNode)(_vue.Transition, {
|
|
51
|
+
name: _ctx.n('message')
|
|
52
|
+
}, {
|
|
53
|
+
default: (0, _vue.withCtx)(() => [_ctx.extraMessage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_2, (0, _vue.toDisplayString)(_ctx.extraMessage), 1
|
|
54
|
+
/* TEXT */
|
|
55
|
+
)) : (0, _vue.createCommentVNode)("v-if", true)]),
|
|
56
|
+
_: 1
|
|
57
|
+
/* STABLE */
|
|
58
|
+
|
|
59
|
+
}, 8
|
|
60
|
+
/* PROPS */
|
|
61
|
+
, ["name"])], 2
|
|
62
|
+
/* CLASS */
|
|
32
63
|
)], 2
|
|
33
64
|
/* CLASS */
|
|
34
65
|
)) : (0, _vue.createCommentVNode)("v-if", true)]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --form-details-error-color: var(--color-danger); --form-details-
|
|
1
|
+
:root { --form-details-error-message-color: var(--color-danger); --form-details-extra-message-color: #888; --form-details-margin-top: 6px; --form-details-font-size: 12px; --form-details-message-margin-right: 4px;}.var-form-details { display: flex; justify-content: space-between; font-size: var(--form-details-font-size); margin-top: var(--form-details-margin-top);}.var-form-details-enter-from,.var-form-details-leave-to { opacity: 0; margin-top: 2px !important;}.var-form-details-enter-active,.var-form-details-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-form-details__message-enter-from,.var-form-details__message-leave-to { opacity: 0;}.var-form-details__message-enter-active,.var-form-details__message-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-form-details__error-message { flex-grow: 1; color: var(--form-details-error-message-color); margin-right: var(--form-details-message-margin-right); user-select: none; text-align: left;}.var-form-details__extra-message { flex-shrink: 0; color: var(--form-details-extra-message-color); user-select: none; text-align: right;}
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../types'
|
package/lib/input/Input.js
CHANGED
|
@@ -122,7 +122,7 @@ function render(_ctx, _cache) {
|
|
|
122
122
|
}, null, 46
|
|
123
123
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
124
124
|
, _hoisted_2)), (0, _vue.createElementVNode)("label", {
|
|
125
|
-
class: (0, _vue.normalizeClass)(_ctx.classes('var--ellipsis', [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.textarea, _ctx.n('textarea-placeholder'), _ctx.n('placeholder')], _ctx.computePlaceholderState(), [!_ctx.hint, _ctx.n('--placeholder-non-hint')])),
|
|
125
|
+
class: (0, _vue.normalizeClass)(_ctx.classes('var--ellipsis', [_ctx.isFocus, _ctx.n('--focus')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.textarea, _ctx.n('textarea-placeholder'), _ctx.n('placeholder')], _ctx.computePlaceholderState(), [!_ctx.hint, _ctx.n('--placeholder-non-hint')])),
|
|
126
126
|
style: (0, _vue.normalizeStyle)({
|
|
127
127
|
color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
|
|
128
128
|
}),
|
|
@@ -163,10 +163,10 @@ function render(_ctx, _cache) {
|
|
|
163
163
|
/* CLASS, STYLE */
|
|
164
164
|
)) : (0, _vue.createCommentVNode)("v-if", true), (0, _vue.createVNode)(_component_var_form_details, {
|
|
165
165
|
"error-message": _ctx.errorMessage,
|
|
166
|
-
"
|
|
166
|
+
"extra-message": _ctx.maxlengthText
|
|
167
167
|
}, null, 8
|
|
168
168
|
/* PROPS */
|
|
169
|
-
, ["error-message", "
|
|
169
|
+
, ["error-message", "extra-message"])], 2
|
|
170
170
|
/* CLASS */
|
|
171
171
|
);
|
|
172
172
|
}
|
package/lib/input/input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --input-input-text-color: #555; --input-error-color: var(--color-danger); --input-blur-color: #888; --input-focus-color: var(--color-primary); --input-placeholder-size: 16px; --input-textarea-height: auto; --input-textarea-padding-top: 8px; --input-icon-padding: 16px 0 0; --input-icon-size: 20px; --input-line-size: 1px; --input-line-spread-size: 2px; --input-disabled-color: var(--color-text-disabled);}.var-input-footer-margin-enter-from,.var-input-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-input-footer-margin-enter-active,.var-input-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-input { width: 100%; color: var(--input-input-text-color);}.var-input__controller { width: 100%; display: flex; position: relative;}.var-input__wrap { position: relative; flex-grow: 1; display: flex; flex-direction: column; padding-top: var(--input-placeholder-size);}.var-input__icon { display: flex; align-items: center; padding: var(--input-icon-padding); font-size: 20px;}.var-input__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition
|
|
1
|
+
:root { --input-input-text-color: #555; --input-error-color: var(--color-danger); --input-blur-color: #888; --input-focus-color: var(--color-primary); --input-placeholder-size: 16px; --input-textarea-height: auto; --input-textarea-padding-top: 8px; --input-icon-padding: 16px 0 0; --input-icon-size: 20px; --input-line-size: 1px; --input-line-spread-size: 2px; --input-disabled-color: var(--color-text-disabled);}.var-input-footer-margin-enter-from,.var-input-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-input-footer-margin-enter-active,.var-input-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-input { width: 100%; color: var(--input-input-text-color);}.var-input__controller { width: 100%; display: flex; position: relative;}.var-input__wrap { position: relative; flex-grow: 1; display: flex; flex-direction: column; padding-top: var(--input-placeholder-size);}.var-input__icon { display: flex; align-items: center; padding: var(--input-icon-padding); font-size: 20px;}.var-input__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition: top 0.3s, transform 0.3s, width 0.3s, color 0.25s; transform: translate(0, calc(-50% + var(--input-placeholder-size) / 2)) scale(1); font-size: var(--input-placeholder-size); color: var(--input-blur-color); cursor: inherit;}.var-input__textarea-placeholder { position: absolute; top: 0; left: 0; width: 100%; transform-origin: left; transition: transform 0.3s, width 0.3s, color 0.25s; transform: translate(0, calc(var(--input-textarea-padding-top) + var(--input-placeholder-size))) scale(1); font-size: var(--input-placeholder-size); color: var(--input-blur-color); cursor: inherit;}.var-input__autocomplete { width: 0; height: 0; padding: 0; border: none; outline: none; font-size: 0;}.var-input__input { width: 100%; height: 32px; padding: 0; outline: none; border: none; background: transparent; color: var(--input-input-text-color); caret-color: var(--input-focus-color); transition: color 0.25s; font: inherit;}.var-input__line { width: 100%; height: var(--input-line-size); background: var(--input-blur-color); transition: background-color 0.25s;}.var-input__dot { width: 100%; height: var(--input-line-spread-size); background: var(--input-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier), background-color 0.25s;}.var-input__clear-icon[var-input-cover] { display: flex; margin-left: 4px;}.var-input--textarea { padding-top: var(--input-textarea-padding-top); height: var(--input-textarea-height);}.var-input--placeholder-hint { top: 0; width: 133.33%; transform: translate(0, 0) scale(0.75);}.var-input--placeholder-non-hint { top: 50%; transform: translate(0, -50%) scale(1);}.var-input--non-hint { padding-top: 0;}.var-input--placeholder-hidden { visibility: hidden;}.var-input--focus { color: var(--input-focus-color);}.var-input--spread { transform: scaleX(1);}.var-input--disabled { color: var(--input-disabled-color); cursor: not-allowed;}.var-input--error { color: var(--input-error-color);}.var-input--line-disabled { background: var(--input-disabled-color);}.var-input--line-error { background: var(--input-error-color);}.var-input--caret-error { caret-color: var(--input-error-color);}
|
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
|
package/lib/radio/radio.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --radio-checked-color: var(--color-primary); --radio-unchecked-color: #555; --radio-disabled-color: var(--color-text-disabled); --radio-error-color: var(--color-danger); --radio-icon-size: 24px; --radio-action-padding: 6px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-radio { display: flex; align-items: center; transform: translateX(calc(-1 * var(--radio-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-radio__wrap { display: inline-flex; flex-direction: column;}.var-radio__action { display: flex; justify-content: center; align-items: center; padding: var(--radio-action-padding); border-radius: 50%;}.var-radio__icon[var-radio-cover] { display: block; font-size: var(--radio-icon-size);}.var-radio--with-animation[var-radio-cover] { animation: var-vibrate-animation 0.25s;}.var-radio--checked { color: var(--radio-checked-color);}.var-radio--unchecked { color: var(--radio-unchecked-color);}.var-radio--disabled { color: var(--radio-disabled-color);}.var-radio--error { color: var(--radio-error-color);}
|
|
1
|
+
:root { --radio-checked-color: var(--color-primary); --radio-unchecked-color: #555; --radio-disabled-color: var(--color-text-disabled); --radio-error-color: var(--color-danger); --radio-icon-size: 24px; --radio-action-padding: 6px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-radio { display: flex; align-items: center; transform: translateX(calc(-1 * var(--radio-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-radio__wrap { display: inline-flex; flex-direction: column;}.var-radio__action { display: flex; justify-content: center; align-items: center; padding: var(--radio-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-radio__icon[var-radio-cover] { display: block; font-size: var(--radio-icon-size);}.var-radio--with-animation[var-radio-cover] { animation: var-vibrate-animation 0.25s;}.var-radio--checked { color: var(--radio-checked-color);}.var-radio--unchecked { color: var(--radio-unchecked-color);}.var-radio--disabled { color: var(--radio-disabled-color); cursor: not-allowed;}.var-radio--error { color: var(--radio-error-color);}
|
package/lib/select/select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --select-select-text-color: #555; --select-select-padding: 5px 0; --select-error-color: var(--color-danger); --select-blur-color: #888; --select-focus-color: var(--color-primary); --select-scroller-background: #fff; --select-scroller-padding: 6px 0; --select-scroller-margin: 8px 0 0 0; --select-scroller-max-height: 278px; --select-placeholder-size: 16px; --select-icon-padding: 16px 0 0; --select-icon-size: 20px; --select-chip-margin: 5px 5px 0; --select-line-size: 1px; --select-line-spread-size: 2px; --select-arrow-size: 20px; --select-disabled-color: var(--color-text-disabled);}.var-select-footer-margin-enter-from,.var-select-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-select-footer-margin-enter-active,.var-select-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-select { width: 100%; color: var(--select-select-text-color);}.var-select__controller { width: 100%; display: flex; position: relative;}.var-select__menu[var-select-cover] { flex-grow: 1; background: transparent;}.var-select__chip[var-select-cover] { margin: var(--select-chip-margin);}.var-select__scroller { max-height: var(--select-scroller-max-height); background: var(--select-scroller-background); padding: var(--select-scroller-padding); overflow-y: auto; margin: var(--select-scroller-margin);}.var-select__wrap { position: relative; display: flex; flex-direction: column; width: 100%; padding-top: var(--select-placeholder-size);}.var-select__icon { display: flex; align-items: center; padding: var(--select-icon-padding); font-size: 20px;}.var-select__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition
|
|
1
|
+
:root { --select-select-text-color: #555; --select-select-padding: 5px 0; --select-error-color: var(--color-danger); --select-blur-color: #888; --select-focus-color: var(--color-primary); --select-scroller-background: #fff; --select-scroller-padding: 6px 0; --select-scroller-margin: 8px 0 0 0; --select-scroller-max-height: 278px; --select-placeholder-size: 16px; --select-icon-padding: 16px 0 0; --select-icon-size: 20px; --select-chip-margin: 5px 5px 0; --select-line-size: 1px; --select-line-spread-size: 2px; --select-arrow-size: 20px; --select-disabled-color: var(--color-text-disabled);}.var-select-footer-margin-enter-from,.var-select-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-select-footer-margin-enter-active,.var-select-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-select { width: 100%; color: var(--select-select-text-color);}.var-select__controller { width: 100%; display: flex; position: relative;}.var-select__menu[var-select-cover] { flex-grow: 1; background: transparent;}.var-select__chip[var-select-cover] { margin: var(--select-chip-margin);}.var-select__scroller { max-height: var(--select-scroller-max-height); background: var(--select-scroller-background); padding: var(--select-scroller-padding); overflow-y: auto; margin: var(--select-scroller-margin); transition: background-color 0.25s;}.var-select__wrap { position: relative; display: flex; flex-direction: column; width: 100%; padding-top: var(--select-placeholder-size);}.var-select__icon { display: flex; align-items: center; padding: var(--select-icon-padding); font-size: 20px;}.var-select__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition: top 0.3s, transform 0.3s, width 0.3s, color 0.25s; transform: translate(0, calc(-50% + var(--select-placeholder-size) / 2)) scale(1); font-size: var(--select-placeholder-size); color: var(--select-blur-color);}.var-select__select { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 32px; padding: var(--select-select-padding); outline: none; border: none; font-size: inherit; color: var(--select-select-text-color); word-break: break-all; overflow-x: hidden; transition: color 0.25s;}.var-select__arrow[var-select-cover] { flex-shrink: 0; font-size: var(--select-arrow-size);}.var-select__line { width: 100%; height: var(--select-line-size); background: var(--select-blur-color); transition: background-color 0.25s;}.var-select__dot { width: 100%; height: var(--select-line-spread-size); background: var(--select-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier), background-color 0.25s;}.var-select--placeholder-hint { top: 0; width: 133.33%; transform: translate(0, 0) scale(0.75);}.var-select--placeholder-non-hint { top: 50%; transform: translate(0, -50%) scale(1);}.var-select--non-hint { padding-top: 0;}.var-select--placeholder-hidden { visibility: hidden;}.var-select--focus { color: var(--select-focus-color);}.var-select--spread { transform: scaleX(1);}.var-select--disabled { color: var(--select-disabled-color); cursor: not-allowed;}.var-select--error { color: var(--select-error-color);}.var-select--line-disabled { background: var(--select-disabled-color);}.var-select--line-error { background: var(--select-error-color);}.var-select--arrow-rotate { transform: rotate(180deg);}
|