yc-design-vue 1.7.9 → 1.8.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/es/Calendar/Calendar.vue.js +15 -14
- package/es/Calendar/CalendarMonth.vue.js +11 -1
- package/es/Calendar/CalendarYear.vue.js +20 -16
- package/es/ColorPicker/ColorList.vue.js +4 -2
- package/es/ColorPicker/ColorPanel.vue.js +6 -4
- package/es/ConfigProvider/index.d.ts +3 -0
- package/es/ConfigProvider/index.vue.d.ts +1 -0
- package/es/ConfigProvider/index.vue.js +13 -2
- package/es/ConfigProvider/type.d.ts +1 -0
- package/es/Drawer/Drawer.vue.js +6 -4
- package/es/Drawer/DrawerService.vue.js +2 -2
- package/es/Empty/index.vue.js +11 -4
- package/es/Image/Image.vue.js +4 -2
- package/es/Image/ImagePreviewToolbar.vue.js +13 -29
- package/es/Layout/hooks/useTheme.js +0 -1
- package/es/Modal/Modal.vue.js +6 -4
- package/es/Modal/ModalService.vue.js +2 -2
- package/es/Pagination/Pagination.vue.js +5 -3
- package/es/Pagination/hooks/useContext.d.ts +5 -0
- package/es/Pagination/hooks/useContext.js +5 -2
- package/es/Popconfirm/index.vue.js +6 -4
- package/es/Transfer/TransferPanel.vue.js +2 -2
- package/es/Typography/TypographyBase.vue.js +7 -6
- package/es/_shared/icons/IconCopy.vue.js +1 -17
- package/es/_shared/icons/IconCopy.vue2.js +17 -1
- package/es/_shared/icons/IconDelete.vue.js +1 -17
- package/es/_shared/icons/IconDelete.vue2.js +17 -1
- package/es/_shared/icons/IconEdit.vue.js +1 -17
- package/es/_shared/icons/IconEdit.vue2.js +17 -1
- package/es/_shared/icons/IconSearch.vue.js +1 -17
- package/es/_shared/icons/IconSearch.vue2.js +17 -1
- package/es/_shared/locale/i18n.d.ts +256 -0
- package/es/_shared/locale/i18n.js +35 -0
- package/es/_shared/locale/lang/ar-eg.d.ts +205 -0
- package/es/_shared/locale/lang/ar-eg.js +153 -0
- package/es/_shared/locale/lang/de-de.d.ts +205 -0
- package/es/_shared/locale/lang/de-de.js +153 -0
- package/es/_shared/locale/lang/en-us.d.ts +253 -0
- package/es/_shared/locale/lang/en-us.js +158 -0
- package/es/_shared/locale/lang/es-es.d.ts +205 -0
- package/es/_shared/locale/lang/es-es.js +153 -0
- package/es/_shared/locale/lang/fr-fr.d.ts +205 -0
- package/es/_shared/locale/lang/fr-fr.js +153 -0
- package/es/_shared/locale/lang/id-id.d.ts +205 -0
- package/es/_shared/locale/lang/id-id.js +153 -0
- package/es/_shared/locale/lang/it-it.d.ts +205 -0
- package/es/_shared/locale/lang/it-it.js +153 -0
- package/es/_shared/locale/lang/ja-jp.d.ts +253 -0
- package/es/_shared/locale/lang/ja-jp.js +201 -0
- package/es/_shared/locale/lang/km-kh.d.ts +205 -0
- package/es/_shared/locale/lang/km-kh.js +153 -0
- package/es/_shared/locale/lang/ko-kr.d.ts +205 -0
- package/es/_shared/locale/lang/ko-kr.js +153 -0
- package/es/_shared/locale/lang/ms-my.d.ts +205 -0
- package/es/_shared/locale/lang/ms-my.js +153 -0
- package/es/_shared/locale/lang/nl-nl.d.ts +253 -0
- package/es/_shared/locale/lang/nl-nl.js +201 -0
- package/es/_shared/locale/lang/pt-pt.d.ts +205 -0
- package/es/_shared/locale/lang/pt-pt.js +153 -0
- package/es/_shared/locale/lang/ru-ru.d.ts +253 -0
- package/es/_shared/locale/lang/ru-ru.js +201 -0
- package/es/_shared/locale/lang/th-th.d.ts +205 -0
- package/es/_shared/locale/lang/th-th.js +153 -0
- package/es/_shared/locale/lang/vi-vn.d.ts +205 -0
- package/es/_shared/locale/lang/vi-vn.js +153 -0
- package/es/_shared/locale/lang/zh-cn.d.ts +253 -0
- package/es/_shared/locale/lang/zh-cn.js +201 -0
- package/es/_shared/locale/lang/zh-tw.d.ts +253 -0
- package/es/_shared/locale/lang/zh-tw.js +201 -0
- package/es/_shared/utils/time.js +1 -1
- package/es/_virtual/dynamic-import-helper.js +19 -0
- package/es/index.js +2 -0
- package/es/node_modules/@intlify/core-base/dist/core-base.js +1129 -0
- package/es/node_modules/@intlify/message-compiler/dist/message-compiler.js +65 -0
- package/es/node_modules/@intlify/shared/dist/shared.js +199 -0
- package/es/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +1381 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/const.js +6 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/env.js +12 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/index.js +26 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/proxy.js +103 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/time.js +25 -0
- package/es/node_modules/b-validate/es/is.js +27 -0
- package/es/node_modules/b-validate/es/locale/en-US.js +50 -0
- package/es/node_modules/b-validate/es/rules/base.js +86 -0
- package/es/node_modules/b-validate/es/util.js +25 -0
- package/lib/Calendar/Calendar.vue.js +1 -1
- package/lib/Calendar/CalendarMonth.vue.js +1 -1
- package/lib/Calendar/CalendarYear.vue.js +1 -1
- package/lib/ColorPicker/ColorList.vue.js +1 -1
- package/lib/ColorPicker/ColorPanel.vue.js +1 -1
- package/lib/ConfigProvider/index.d.ts +3 -0
- package/lib/ConfigProvider/index.vue.d.ts +1 -0
- package/lib/ConfigProvider/index.vue.js +1 -1
- package/lib/ConfigProvider/type.d.ts +1 -0
- package/lib/Drawer/Drawer.vue.js +1 -1
- package/lib/Drawer/DrawerService.vue.js +1 -1
- package/lib/Empty/index.vue.js +1 -1
- package/lib/Image/Image.vue.js +1 -1
- package/lib/Image/ImagePreviewToolbar.vue.js +1 -1
- package/lib/Modal/Modal.vue.js +1 -1
- package/lib/Modal/ModalService.vue.js +1 -1
- package/lib/Pagination/Pagination.vue.js +1 -1
- package/lib/Pagination/hooks/useContext.d.ts +5 -0
- package/lib/Pagination/hooks/useContext.js +1 -1
- package/lib/Popconfirm/index.vue.js +1 -1
- package/lib/Transfer/TransferPanel.vue.js +1 -1
- package/lib/Typography/TypographyBase.vue.js +1 -1
- package/lib/_shared/icons/IconCopy.vue.js +1 -1
- package/lib/_shared/icons/IconCopy.vue2.js +1 -1
- package/lib/_shared/icons/IconDelete.vue.js +1 -1
- package/lib/_shared/icons/IconDelete.vue2.js +1 -1
- package/lib/_shared/icons/IconEdit.vue.js +1 -1
- package/lib/_shared/icons/IconEdit.vue2.js +1 -1
- package/lib/_shared/icons/IconSearch.vue.js +1 -1
- package/lib/_shared/icons/IconSearch.vue2.js +1 -1
- package/lib/_shared/locale/i18n.d.ts +256 -0
- package/lib/_shared/locale/i18n.js +1 -0
- package/lib/_shared/locale/lang/ar-eg.d.ts +205 -0
- package/lib/_shared/locale/lang/ar-eg.js +1 -0
- package/lib/_shared/locale/lang/de-de.d.ts +205 -0
- package/lib/_shared/locale/lang/de-de.js +1 -0
- package/lib/_shared/locale/lang/en-us.d.ts +253 -0
- package/lib/_shared/locale/lang/en-us.js +1 -0
- package/lib/_shared/locale/lang/es-es.d.ts +205 -0
- package/lib/_shared/locale/lang/es-es.js +1 -0
- package/lib/_shared/locale/lang/fr-fr.d.ts +205 -0
- package/lib/_shared/locale/lang/fr-fr.js +1 -0
- package/lib/_shared/locale/lang/id-id.d.ts +205 -0
- package/lib/_shared/locale/lang/id-id.js +1 -0
- package/lib/_shared/locale/lang/it-it.d.ts +205 -0
- package/lib/_shared/locale/lang/it-it.js +1 -0
- package/lib/_shared/locale/lang/ja-jp.d.ts +253 -0
- package/lib/_shared/locale/lang/ja-jp.js +1 -0
- package/lib/_shared/locale/lang/km-kh.d.ts +205 -0
- package/lib/_shared/locale/lang/km-kh.js +1 -0
- package/lib/_shared/locale/lang/ko-kr.d.ts +205 -0
- package/lib/_shared/locale/lang/ko-kr.js +1 -0
- package/lib/_shared/locale/lang/ms-my.d.ts +205 -0
- package/lib/_shared/locale/lang/ms-my.js +1 -0
- package/lib/_shared/locale/lang/nl-nl.d.ts +253 -0
- package/lib/_shared/locale/lang/nl-nl.js +1 -0
- package/lib/_shared/locale/lang/pt-pt.d.ts +205 -0
- package/lib/_shared/locale/lang/pt-pt.js +1 -0
- package/lib/_shared/locale/lang/ru-ru.d.ts +253 -0
- package/lib/_shared/locale/lang/ru-ru.js +1 -0
- package/lib/_shared/locale/lang/th-th.d.ts +205 -0
- package/lib/_shared/locale/lang/th-th.js +1 -0
- package/lib/_shared/locale/lang/vi-vn.d.ts +205 -0
- package/lib/_shared/locale/lang/vi-vn.js +1 -0
- package/lib/_shared/locale/lang/zh-cn.d.ts +253 -0
- package/lib/_shared/locale/lang/zh-cn.js +1 -0
- package/lib/_shared/locale/lang/zh-tw.d.ts +253 -0
- package/lib/_shared/locale/lang/zh-tw.js +1 -0
- package/lib/_shared/utils/time.js +1 -1
- package/lib/_virtual/dynamic-import-helper.js +1 -0
- package/lib/index.js +1 -1
- package/lib/node_modules/@intlify/core-base/dist/core-base.js +1 -0
- package/lib/node_modules/@intlify/message-compiler/dist/message-compiler.js +6 -0
- package/lib/node_modules/@intlify/shared/dist/shared.js +7 -0
- package/lib/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/const.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/env.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/index.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/proxy.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/time.js +1 -0
- package/lib/node_modules/b-validate/es/is.js +1 -0
- package/lib/node_modules/b-validate/es/locale/en-US.js +1 -0
- package/lib/node_modules/b-validate/es/rules/base.js +1 -0
- package/lib/node_modules/b-validate/es/util.js +1 -0
- package/package.json +3 -2
@@ -0,0 +1,12 @@
|
|
1
|
+
function getDevtoolsGlobalHook() {
|
2
|
+
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
3
|
+
}
|
4
|
+
function getTarget() {
|
5
|
+
return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : {};
|
6
|
+
}
|
7
|
+
const isProxyAvailable = typeof Proxy === "function";
|
8
|
+
export {
|
9
|
+
getDevtoolsGlobalHook,
|
10
|
+
getTarget,
|
11
|
+
isProxyAvailable
|
12
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { getTarget, getDevtoolsGlobalHook, isProxyAvailable } from "./env.js";
|
2
|
+
import { HOOK_SETUP } from "./const.js";
|
3
|
+
import { ApiProxy } from "./proxy.js";
|
4
|
+
function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
|
5
|
+
const descriptor = pluginDescriptor;
|
6
|
+
const target = getTarget();
|
7
|
+
const hook = getDevtoolsGlobalHook();
|
8
|
+
const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
|
9
|
+
if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
|
10
|
+
hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
|
11
|
+
} else {
|
12
|
+
const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
|
13
|
+
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
|
14
|
+
list.push({
|
15
|
+
pluginDescriptor: descriptor,
|
16
|
+
setupFn,
|
17
|
+
proxy
|
18
|
+
});
|
19
|
+
if (proxy) {
|
20
|
+
setupFn(proxy.proxiedTarget);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
export {
|
25
|
+
setupDevtoolsPlugin
|
26
|
+
};
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { HOOK_PLUGIN_SETTINGS_SET } from "./const.js";
|
2
|
+
import { now } from "./time.js";
|
3
|
+
class ApiProxy {
|
4
|
+
constructor(plugin, hook) {
|
5
|
+
this.target = null;
|
6
|
+
this.targetQueue = [];
|
7
|
+
this.onQueue = [];
|
8
|
+
this.plugin = plugin;
|
9
|
+
this.hook = hook;
|
10
|
+
const defaultSettings = {};
|
11
|
+
if (plugin.settings) {
|
12
|
+
for (const id in plugin.settings) {
|
13
|
+
const item = plugin.settings[id];
|
14
|
+
defaultSettings[id] = item.defaultValue;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
|
18
|
+
let currentSettings = Object.assign({}, defaultSettings);
|
19
|
+
try {
|
20
|
+
const raw = localStorage.getItem(localSettingsSaveId);
|
21
|
+
const data = JSON.parse(raw);
|
22
|
+
Object.assign(currentSettings, data);
|
23
|
+
} catch (e) {
|
24
|
+
}
|
25
|
+
this.fallbacks = {
|
26
|
+
getSettings() {
|
27
|
+
return currentSettings;
|
28
|
+
},
|
29
|
+
setSettings(value) {
|
30
|
+
try {
|
31
|
+
localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
|
32
|
+
} catch (e) {
|
33
|
+
}
|
34
|
+
currentSettings = value;
|
35
|
+
},
|
36
|
+
now() {
|
37
|
+
return now();
|
38
|
+
}
|
39
|
+
};
|
40
|
+
if (hook) {
|
41
|
+
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
|
42
|
+
if (pluginId === this.plugin.id) {
|
43
|
+
this.fallbacks.setSettings(value);
|
44
|
+
}
|
45
|
+
});
|
46
|
+
}
|
47
|
+
this.proxiedOn = new Proxy({}, {
|
48
|
+
get: (_target, prop) => {
|
49
|
+
if (this.target) {
|
50
|
+
return this.target.on[prop];
|
51
|
+
} else {
|
52
|
+
return (...args) => {
|
53
|
+
this.onQueue.push({
|
54
|
+
method: prop,
|
55
|
+
args
|
56
|
+
});
|
57
|
+
};
|
58
|
+
}
|
59
|
+
}
|
60
|
+
});
|
61
|
+
this.proxiedTarget = new Proxy({}, {
|
62
|
+
get: (_target, prop) => {
|
63
|
+
if (this.target) {
|
64
|
+
return this.target[prop];
|
65
|
+
} else if (prop === "on") {
|
66
|
+
return this.proxiedOn;
|
67
|
+
} else if (Object.keys(this.fallbacks).includes(prop)) {
|
68
|
+
return (...args) => {
|
69
|
+
this.targetQueue.push({
|
70
|
+
method: prop,
|
71
|
+
args,
|
72
|
+
resolve: () => {
|
73
|
+
}
|
74
|
+
});
|
75
|
+
return this.fallbacks[prop](...args);
|
76
|
+
};
|
77
|
+
} else {
|
78
|
+
return (...args) => {
|
79
|
+
return new Promise((resolve) => {
|
80
|
+
this.targetQueue.push({
|
81
|
+
method: prop,
|
82
|
+
args,
|
83
|
+
resolve
|
84
|
+
});
|
85
|
+
});
|
86
|
+
};
|
87
|
+
}
|
88
|
+
}
|
89
|
+
});
|
90
|
+
}
|
91
|
+
async setRealTarget(target) {
|
92
|
+
this.target = target;
|
93
|
+
for (const item of this.onQueue) {
|
94
|
+
this.target.on[item.method](...item.args);
|
95
|
+
}
|
96
|
+
for (const item of this.targetQueue) {
|
97
|
+
item.resolve(await this.target[item.method](...item.args));
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
export {
|
102
|
+
ApiProxy
|
103
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
let supported;
|
2
|
+
let perf;
|
3
|
+
function isPerformanceSupported() {
|
4
|
+
var _a;
|
5
|
+
if (supported !== void 0) {
|
6
|
+
return supported;
|
7
|
+
}
|
8
|
+
if (typeof window !== "undefined" && window.performance) {
|
9
|
+
supported = true;
|
10
|
+
perf = window.performance;
|
11
|
+
} else if (typeof globalThis !== "undefined" && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
|
12
|
+
supported = true;
|
13
|
+
perf = globalThis.perf_hooks.performance;
|
14
|
+
} else {
|
15
|
+
supported = false;
|
16
|
+
}
|
17
|
+
return supported;
|
18
|
+
}
|
19
|
+
function now() {
|
20
|
+
return isPerformanceSupported() ? perf.now() : Date.now();
|
21
|
+
}
|
22
|
+
export {
|
23
|
+
isPerformanceSupported,
|
24
|
+
now
|
25
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
var opt = Object.prototype.toString;
|
2
|
+
function isArray(obj) {
|
3
|
+
return opt.call(obj) === "[object Array]";
|
4
|
+
}
|
5
|
+
function isObject(obj) {
|
6
|
+
return opt.call(obj) === "[object Object]";
|
7
|
+
}
|
8
|
+
function isString(obj) {
|
9
|
+
return opt.call(obj) === "[object String]";
|
10
|
+
}
|
11
|
+
function isFunction(obj) {
|
12
|
+
return opt.call(obj) === "[object Function]";
|
13
|
+
}
|
14
|
+
function isEmptyValue(obj) {
|
15
|
+
return obj === void 0 || obj === null || obj === "";
|
16
|
+
}
|
17
|
+
function isEmptyArray(obj) {
|
18
|
+
return isArray(obj) && !obj.length;
|
19
|
+
}
|
20
|
+
export {
|
21
|
+
isArray,
|
22
|
+
isEmptyArray,
|
23
|
+
isEmptyValue,
|
24
|
+
isFunction,
|
25
|
+
isObject,
|
26
|
+
isString
|
27
|
+
};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
var defaultTypeTemplate = "#{field} is not a #{type} type";
|
2
|
+
var defaultValidateLocale = {
|
3
|
+
required: "#{field} is required",
|
4
|
+
type: {
|
5
|
+
ip: defaultTypeTemplate,
|
6
|
+
email: defaultTypeTemplate,
|
7
|
+
url: defaultTypeTemplate,
|
8
|
+
string: defaultTypeTemplate,
|
9
|
+
number: defaultTypeTemplate,
|
10
|
+
array: defaultTypeTemplate,
|
11
|
+
object: defaultTypeTemplate,
|
12
|
+
boolean: defaultTypeTemplate
|
13
|
+
},
|
14
|
+
number: {
|
15
|
+
min: "`#{value}` is not greater than `#{min}`",
|
16
|
+
max: "`#{value}` is not less than `#{max}`",
|
17
|
+
equal: "`#{value}` is not equal to `#{equal}`",
|
18
|
+
range: "`#{value}` is not in range `#{min} ~ #{max}`",
|
19
|
+
positive: "`#{value}` is not a positive number",
|
20
|
+
negative: "`#{value}` is not a negative number"
|
21
|
+
},
|
22
|
+
string: {
|
23
|
+
maxLength: "#{field} cannot be longer than #{maxLength} characters",
|
24
|
+
minLength: "#{field} must be at least #{minLength} characters",
|
25
|
+
length: "#{field} must be exactly #{length} characters",
|
26
|
+
match: "`#{value}` does not match pattern #{pattern}",
|
27
|
+
uppercase: "`#{value}` must be all uppercase",
|
28
|
+
lowercase: "`#{value}` must be all lowercased"
|
29
|
+
},
|
30
|
+
array: {
|
31
|
+
length: "#{field} must be exactly #{length} in length",
|
32
|
+
minLength: "#{field} cannot be less than #{minLength} in length",
|
33
|
+
maxLength: "#{field} cannot be greater than #{maxLength} in length",
|
34
|
+
includes: "#{field} is not includes #{includes}",
|
35
|
+
deepEqual: "#{field} is not deep equal with #{deepEqual}",
|
36
|
+
empty: "#{field} is not an empty array"
|
37
|
+
},
|
38
|
+
object: {
|
39
|
+
deepEqual: "#{field} is not deep equal to expected value",
|
40
|
+
hasKeys: "#{field} does not contain required fields",
|
41
|
+
empty: "#{field} is not an empty object"
|
42
|
+
},
|
43
|
+
boolean: {
|
44
|
+
true: "Expect true but got `#{value}`",
|
45
|
+
false: "Expect false but got `#{value}`"
|
46
|
+
}
|
47
|
+
};
|
48
|
+
export {
|
49
|
+
defaultValidateLocale as default
|
50
|
+
};
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { isObject, isFunction, isString, isArray, isEmptyValue, isEmptyArray } from "../is.js";
|
2
|
+
import { getTemplate, mergeTemplate } from "../util.js";
|
3
|
+
import defaultValidateLocale from "../locale/en-US.js";
|
4
|
+
var Base = function Base2(obj, options) {
|
5
|
+
var this$1$1 = this;
|
6
|
+
this.getValidateMsg = function(keyPath, info) {
|
7
|
+
if (info === void 0) info = {};
|
8
|
+
var data = Object.assign(Object.assign({}, info), { value: this$1$1.obj, field: this$1$1.field, type: this$1$1.type });
|
9
|
+
var template = getTemplate(this$1$1.validateMessages, keyPath);
|
10
|
+
if (isFunction(template)) {
|
11
|
+
return template(data);
|
12
|
+
}
|
13
|
+
if (isString(template)) {
|
14
|
+
return template.replace(/\#\{.+?\}/g, function(variable) {
|
15
|
+
var key = variable.slice(2, -1);
|
16
|
+
if (key in data) {
|
17
|
+
if (isObject(data[key]) || isArray(data[key])) {
|
18
|
+
try {
|
19
|
+
return JSON.stringify(data[key]);
|
20
|
+
} catch (_) {
|
21
|
+
return data[key];
|
22
|
+
}
|
23
|
+
}
|
24
|
+
return String(data[key]);
|
25
|
+
}
|
26
|
+
return variable;
|
27
|
+
});
|
28
|
+
}
|
29
|
+
return template;
|
30
|
+
};
|
31
|
+
if (isObject(options) && isString(obj) && options.trim) {
|
32
|
+
this.obj = obj.trim();
|
33
|
+
} else if (isObject(options) && options.ignoreEmptyString && obj === "") {
|
34
|
+
this.obj = void 0;
|
35
|
+
} else {
|
36
|
+
this.obj = obj;
|
37
|
+
}
|
38
|
+
this.message = options.message;
|
39
|
+
this.type = options.type;
|
40
|
+
this.error = null;
|
41
|
+
this.field = options.field || options.type;
|
42
|
+
this.validateMessages = mergeTemplate(defaultValidateLocale, options.validateMessages);
|
43
|
+
};
|
44
|
+
var prototypeAccessors = { not: { configurable: true }, isRequired: { configurable: true }, end: { configurable: true } };
|
45
|
+
prototypeAccessors.not.get = function() {
|
46
|
+
this._not = !this._not;
|
47
|
+
return this;
|
48
|
+
};
|
49
|
+
prototypeAccessors.isRequired.get = function() {
|
50
|
+
if (isEmptyValue(this.obj) || isEmptyArray(this.obj)) {
|
51
|
+
var message = this.getValidateMsg("required");
|
52
|
+
this.error = {
|
53
|
+
value: this.obj,
|
54
|
+
type: this.type,
|
55
|
+
requiredError: true,
|
56
|
+
message: this.message || (isObject(message) ? message : (this._not ? "[NOT MODE]:" : "") + message)
|
57
|
+
};
|
58
|
+
}
|
59
|
+
return this;
|
60
|
+
};
|
61
|
+
prototypeAccessors.end.get = function() {
|
62
|
+
return this.error;
|
63
|
+
};
|
64
|
+
Base.prototype.addError = function addError(message) {
|
65
|
+
if (!this.error && message) {
|
66
|
+
this.error = {
|
67
|
+
value: this.obj,
|
68
|
+
type: this.type,
|
69
|
+
message: this.message || (isObject(message) ? message : (this._not ? "[NOT MODE]:" : "") + message)
|
70
|
+
};
|
71
|
+
}
|
72
|
+
};
|
73
|
+
Base.prototype.validate = function validate(expression, errorMessage) {
|
74
|
+
var _expression = this._not ? expression : !expression;
|
75
|
+
if (_expression) {
|
76
|
+
this.addError(errorMessage);
|
77
|
+
}
|
78
|
+
return this;
|
79
|
+
};
|
80
|
+
Base.prototype.collect = function collect(callback) {
|
81
|
+
callback && callback(this.error);
|
82
|
+
};
|
83
|
+
Object.defineProperties(Base.prototype, prototypeAccessors);
|
84
|
+
export {
|
85
|
+
Base as default
|
86
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { isObject } from "./is.js";
|
2
|
+
var mergeTemplate = function(defaultValidateMessages, validateMessages) {
|
3
|
+
var result = Object.assign({}, defaultValidateMessages);
|
4
|
+
Object.keys(validateMessages || {}).forEach(function(key) {
|
5
|
+
var defaultValue = result[key];
|
6
|
+
var newValue = validateMessages === null || validateMessages === void 0 ? void 0 : validateMessages[key];
|
7
|
+
result[key] = isObject(defaultValue) ? Object.assign(Object.assign({}, defaultValue), newValue) : newValue || defaultValue;
|
8
|
+
});
|
9
|
+
return result;
|
10
|
+
};
|
11
|
+
var getTemplate = function(validateMessages, keyPath) {
|
12
|
+
var keys = keyPath.split(".");
|
13
|
+
var result = validateMessages;
|
14
|
+
for (var i = 0; i < keys.length; i++) {
|
15
|
+
result = result && result[keys[i]];
|
16
|
+
if (result === void 0) {
|
17
|
+
return result;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
return result;
|
21
|
+
};
|
22
|
+
export {
|
23
|
+
getTemplate,
|
24
|
+
mergeTemplate
|
25
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue"),a=require("../node_modules/dayjs/dayjs.min.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js"),require("../Empty/index.js");/* empty css */const t=require("../_shared/icons/IconArrowRight.vue.js"),r=require("../_shared/utils/control.js"),o=require("../_shared/components/IconButton.vue.js");,/* empty css */;/* empty css */const l=require("../Button/index.js");require("../Radio/index.js");const n=require("./CalendarMonth.vue.js");;/* empty css */const
|
1
|
+
"use strict";const e=require("vue"),a=require("../node_modules/dayjs/dayjs.min.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js"),require("../Empty/index.js");/* empty css */const t=require("../_shared/icons/IconArrowRight.vue.js"),r=require("../_shared/utils/control.js"),o=require("../_shared/components/IconButton.vue.js");,/* empty css */;/* empty css */const l=require("../Button/index.js");require("../Radio/index.js");const n=require("./CalendarMonth.vue.js");;/* empty css */const d=require("./CalendarYear.vue.js");;/* empty css */const u=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),s=require("../Radio/RadioGroup.vue.js");;/* empty css */const c={class:"yc-calendar-header"},i={class:"yc-calendar-header-left"},m={class:"yc-calendar-header-value"},v={class:"yc-calendar-header-right"},f={class:"yc-calendar-body"},h=e.defineComponent({name:"Calendar",__name:"Calendar",props:{modelValue:{default:void 0},defaultValue:{default:()=>new Date},mode:{default:void 0},defaultMode:{default:"month"},modes:{default:()=>["month","year"]}},emits:["update:modelValue","update:mode","change","panel-change"],setup(h,{emit:y}){const p=h,j=y,{modelValue:V,defaultValue:q,mode:C,defaultMode:_,modes:x}=e.toRefs(p),{t:k}=u.useI18n(),N=r(V,q.value,e=>{j("update:modelValue",e),j("change",e)}),w=e.ref({}),g=e.computed(()=>{const{year:e,month:t}=w.value;return a().set("year",e).set("month",t).format(k("calendar.formatMonth"))});e.watch(()=>N.value,e=>{const t=e?a(e):a();w.value={year:t.year(),month:t.month()+1,day:t.date()}},{immediate:!0});const R=r(C,_.value,e=>{j("update:mode",e),j("panel-change",N.value)}),z=e.computed(()=>x.value.map(e=>({label:k(`calendar.view.${e}`),value:e}))),B=e=>{N.value=new Date(e.fullDate)},D=e=>{if("today"==e)return void(N.value=new Date);const{year:a,month:t}=w.value;if("next"==e){const e=t+1>12?1:t+1,r=t+1>12||"year"==R.value?1:0;if(w.value.year=a+r,"year"==R.value)return;w.value.month=e}else{const e=t-1<1?12:t-1,r=t-1<1||"year"==R.value?-1:0;if(w.value.year=a+r,"year"==R.value)return;w.value.month=e}};return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yc-calendar",`yc-calendar-mode-${e.unref(R)}`])},[e.createElementVNode("div",c,[e.createElementVNode("div",i,[e.createVNode(e.unref(o),{class:"yc-calendar-header-icon",role:"button",tabindex:"0",size:28,"hover-size":28,onClick:r[0]||(r[0]=e=>D("pre"))},{default:e.withCtx(()=>[e.createVNode(e.unref(t),{rotate:180})]),_:1}),e.createElementVNode("div",m,[e.renderSlot(a.$slots,"header",{year:w.value.year,month:w.value.month},()=>[e.createTextVNode(e.toDisplayString(g.value),1)])]),e.createVNode(e.unref(o),{role:"button",tabindex:"0",class:"yc-calendar-header-icon",size:28,"hover-size":28,onClick:r[1]||(r[1]=e=>D("next"))},{default:e.withCtx(()=>[e.createVNode(e.unref(t))]),_:1}),e.createVNode(e.unref(l.default),{onClick:r[2]||(r[2]=e=>D("today")),size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k)("calendar.today")),1)]),_:1})]),e.createElementVNode("div",v,[e.createVNode(e.unref(s),{modelValue:e.unref(R),"onUpdate:modelValue":r[3]||(r[3]=a=>e.isRef(R)?R.value=a:null),options:z.value,type:"button",size:"small"},null,8,["modelValue","options"])])]),e.createElementVNode("div",f,["month"==e.unref(R)?(e.openBlock(),e.createBlock(n,{key:0,"computed-value":e.unref(N),recordDate:w.value,onCellClick:B},e.createSlots({_:2},[a.$slots.default?{name:"default",fn:e.withCtx(t=>[e.renderSlot(a.$slots,"default",e.normalizeProps(e.guardReactiveProps(t)))]),key:"0"}:void 0]),1032,["computed-value","recordDate"])):(e.openBlock(),e.createBlock(d,{key:1,"computed-value":e.unref(N),"record-date":w.value,onCellClick:B},e.createSlots({_:2},[a.$slots.default?{name:"default",fn:e.withCtx(t=>[e.renderSlot(a.$slots,"default",e.normalizeProps(e.guardReactiveProps(t)))]),key:"0"}:void 0]),1032,["computed-value","record-date"]))])],2))}});module.exports=h;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue"),l=require("../node_modules/dayjs/dayjs.min.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js");const a=require("../_shared/utils/time.js");require("../Empty/index.js");/* empty css */const t=require("../_shared/utils/control.js"),n={class:"yc-calendar-week-list"},c={class:"yc-calendar-month-cell-body"},
|
1
|
+
"use strict";const e=require("vue"),l=require("../node_modules/dayjs/dayjs.min.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js");const a=require("../_shared/utils/time.js");require("../Empty/index.js");/* empty css */const t=require("../_shared/utils/control.js"),n=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),r={class:"yc-calendar-week-list"},c={class:"yc-calendar-month-cell-body"},o=["onClick"],d={class:"yc-calendar-date"},s={class:"yc-calendar-date-value"},i={class:"yc-calendar-date-circle"},u=e.defineComponent({__name:"CalendarMonth",props:{computedValue:{},recordDate:{},calendar:{default:void 0},small:{type:Boolean,default:!1}},emits:["cell-click"],setup(u){const m=u,{computedValue:y,calendar:v,small:k,recordDate:h}=e.toRefs(m),{t:p}=n.useI18n(),B=e.computed(()=>["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>p(`calendar.week.${k.value?"short":"long"}.${e}`))),E=t(v,[]);e.watch(()=>h.value.month,()=>{if(v.value)return;const{year:e,month:l}=h.value;E.value=a.generateMonthCalendar(e,l)},{immediate:!0});const f=e=>{const{day:a,year:t,month:n}=e,r=l(),c=r.date(),o=r.month(),d=r.year();return a==c&&n==o&&t==d},g=e=>{const l=y.value.getFullYear(),a=y.value.getMonth(),t=y.value.getDate(),{day:n,year:r,month:c,isCurrentMonth:o}=e,d=t==n&&a==c&&l==r;return k.value?d&&o:d};return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yc-calendar-month",{"yc-calendar-month-small":e.unref(k)}])},[e.createElementVNode("div",r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,l=>(e.openBlock(),e.createElementBlock("div",{class:"yc-calendar-week-list-item",key:l},e.toDisplayString(l),1))),128))]),e.createElementVNode("div",c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(E),(a,t)=>(e.openBlock(),e.createElementBlock("div",{key:t,class:"yc-calendar-month-row"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(a,t)=>(e.openBlock(),e.createElementBlock("div",{key:t,class:e.normalizeClass(["yc-calendar-cell",{"yc-calendar-cell-today":f(a),"yc-calendar-cell-selected":g(a),"yc-calendar-cell-in-view":a.isCurrentMonth}]),onClick:e=>l.$emit("cell-click",a)},[e.renderSlot(l.$slots,"default",{year:a.year,month:a.month,day:a.day},()=>[e.createElementVNode("div",d,[e.createElementVNode("div",s,[e.createElementVNode("div",i,e.toDisplayString(a.day),1)])])])],10,o))),128))]))),128))])],2))}});module.exports=u;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js");const
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js");const r=require("../_shared/utils/time.js");require("../Empty/index.js");/* empty css */const l=require("./CalendarMonth.vue.js");;/* empty css */const a=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),t={class:"yc-calendar-year"},c={class:"yc-calendar-year-cell-title"},o=e.defineComponent({__name:"CalendarYear",props:{computedValue:{},recordDate:{}},emits:["cell-click"],setup(o){const n=o,{computedValue:s,recordDate:u}=e.toRefs(n),{t:d}=a.useI18n(),i=e.ref([]),m=e.computed(()=>["January","February","March","April","May","June","July","August","September","October","November","December"].map(e=>d(`calendar.month.short.${e}`)));return e.watch(()=>u.value.year,()=>{const{year:e}=u.value;i.value=[];const l=[];for(let a=1;a<=12;a++)l.push(r.generateMonthCalendar(e,a)),4==l.length&&(i.value.push([...l]),l.splice(0))},{immediate:!0}),(r,a)=>(e.openBlock(),e.createElementBlock("div",t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(t,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"yc-calendar-year-row"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(t,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"yc-calendar-year-cell"},[e.createElementVNode("div",c,e.toDisplayString(m.value[4*o+n]),1),e.createVNode(l,{"computed-value":e.unref(s),calendar:t,"record-date":e.unref(u),small:"",class:"yc-calendar-year-cell-body",onCellClick:a[0]||(a[0]=e=>r.$emit("cell-click",e))},e.createSlots({_:2},[r.$slots.default?{name:"default",fn:e.withCtx(({year:l,month:a,day:t})=>[e.renderSlot(r.$slots,"default",{year:l,month:a,day:t})]),key:"0"}:void 0]),1032,["computed-value","calendar","record-date"])]))),128))]))),128))]))}});module.exports=o;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue"),o={class:"yc-color-picker-colors-section"},
|
1
|
+
"use strict";const e=require("vue"),o=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),l={class:"yc-color-picker-colors-section"},c={class:"yc-color-picker-colors-text"},r={key:0,class:"yc-color-picker-colors-empty"},t={class:"yc-color-picker-colors-list"},n=["onClick"],s=e.defineComponent({__name:"ColorList",props:{label:{},colors:{}},emits:["colorClick"],setup(s){const{t:i}=o.useI18n();return(o,s)=>(e.openBlock(),e.createElementBlock("div",l,[e.createElementVNode("div",c,e.toDisplayString(o.label),1),o.colors.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",r,e.toDisplayString(e.unref(i)("colorPicker.empty")),1)),e.createElementVNode("div",t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.colors,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:"yc-color-picker-color-block",style:e.normalizeStyle({backgroundColor:l}),onClick:e=>o.$emit("colorClick",l)},[e.createElementVNode("div",{class:"yc-color-picker-block",style:e.normalizeStyle({backgroundColor:l})},null,4)],12,n))),128))])]))}});module.exports=s;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue"),o=require("./hooks/useContext.js"),l=require("./ColorPalette.vue.js");;/* empty css */const r=require("./ColorInput.vue.js");;/* empty css */const a=require("./ColorList.vue.js");;/* empty css */const n=require("./ColorControl.vue.js");;/* empty css */const u={class:"yc-color-picker-panel-control"},
|
1
|
+
"use strict";const e=require("vue"),o=require("./hooks/useContext.js"),l=require("./ColorPalette.vue.js");;/* empty css */const r=require("./ColorInput.vue.js");;/* empty css */const a=require("./ColorList.vue.js");;/* empty css */const n=require("./ColorControl.vue.js");;/* empty css */const u=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),s={class:"yc-color-picker-panel-control"},i={class:"yc-color-picker-control-wrapper"},c={class:"yc-color-picker-control-bar-bg"},t={key:0,class:"yc-color-picker-panel-colors"},d=e.defineComponent({__name:"ColorPanel",setup(d){const{popupVisible:p,computedColor:f,baseColor:v,alpha:b,disabled:C,disabledAlpha:h,showHistory:k,showPreset:m,hideTrigger:y,presetColors:g,historyColors:P}=o().inject(),{t:V}=u.useI18n(),N=e.ref(),j=e.ref(),q=e.ref(),R=e=>{var o,l,r;C.value||(f.value=e,v.value=e,null==(o=N.value)||o.setPosition(e),null==(l=j.value)||l.setPosition(e),null==(r=q.value)||r.setPosition(e))},B=(e,o)=>{var l,r,a;"alpha"==o?null==(l=j.value)||l.setPosition(e):(null==(r=N.value)||r.setPosition(e),null==(a=q.value)||a.setPosition(e))};return(o,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yc-color-picker-panel",{"yc-color-picker-panel-disabled":e.unref(C)}])},[e.createVNode(l,{color:e.unref(f),"onUpdate:color":u[0]||(u[0]=o=>e.isRef(f)?f.value=o:null),"base-color":e.unref(v),"popup-visible":e.unref(p),"hide-trigger":e.unref(y),disabled:e.unref(C),ref_key:"paletteRef",ref:q},null,8,["color","base-color","popup-visible","hide-trigger","disabled"]),e.createElementVNode("div",s,[e.createElementVNode("div",i,[e.createElementVNode("div",null,[e.createVNode(n,{mode:"color",color:e.unref(f),"onUpdate:color":u[1]||(u[1]=o=>e.isRef(f)?f.value=o:null),"base-color":e.unref(v),"onUpdate:baseColor":u[2]||(u[2]=o=>e.isRef(v)?v.value=o:null),"popup-visible":e.unref(p),disabled:e.unref(C),"hide-trigger":e.unref(y),ref_key:"colorBarRef",ref:N,onChange:u[3]||(u[3]=e=>{var o;return null==(o=q.value)?void 0:o.setPosition(e)})},null,8,["color","base-color","popup-visible","disabled","hide-trigger"]),e.createElementVNode("div",c,[e.createVNode(n,{mode:"alpha",color:e.unref(f),"onUpdate:color":u[4]||(u[4]=o=>e.isRef(f)?f.value=o:null),alpha:e.unref(b),"onUpdate:alpha":u[5]||(u[5]=o=>e.isRef(b)?b.value=o:null),"base-color":e.unref(v),"popup-visible":e.unref(p),disabled:e.unref(C),"hide-trigger":e.unref(y),ref_key:"alphaBarRef",ref:j},null,8,["color","alpha","base-color","popup-visible","disabled","hide-trigger"])])]),e.createElementVNode("div",{class:"yc-color-picker-preview",style:e.normalizeStyle({backgroundColor:e.unref(f)})},null,4)]),e.createVNode(r,{color:e.unref(f),"onUpdate:color":u[6]||(u[6]=o=>e.isRef(f)?f.value=o:null),"base-color":e.unref(v),"onUpdate:baseColor":u[7]||(u[7]=o=>e.isRef(v)?v.value=o:null),alpha:e.unref(b),"onUpdate:alpha":u[8]||(u[8]=o=>e.isRef(b)?b.value=o:null),disabled:e.unref(C),"disabled-alpha":e.unref(h),onChange:B},null,8,["color","base-color","alpha","disabled","disabled-alpha"])]),e.unref(k)||e.unref(m)?(e.openBlock(),e.createElementBlock("div",t,[e.unref(k)?(e.openBlock(),e.createBlock(a,{key:0,label:e.unref(V)("colorPicker.history"),colors:e.unref(P),onColorClick:R},null,8,["label","colors"])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createBlock(a,{key:1,label:e.unref(V)("colorPicker.preset"),colors:e.unref(g),onColorClick:R},null,8,["label","colors"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}});module.exports=d;
|
@@ -9,6 +9,7 @@ declare const ConfigProvider: {
|
|
9
9
|
updateAtScroll: boolean;
|
10
10
|
scrollToClose: boolean;
|
11
11
|
zIndex: number;
|
12
|
+
locale: "ar-EG" | "de-DE" | "en-US" | "es-ES" | "fr-FR" | "id-ID" | "it-it" | "ja-JP" | "km-KH" | "ko-KR" | "ms-MY" | "nl-NL" | "pt-PT" | "ru-RU" | "th-TH" | "vi-VN" | "zh-CN" | "zh-TW";
|
12
13
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
13
14
|
P: {};
|
14
15
|
B: {};
|
@@ -22,6 +23,7 @@ declare const ConfigProvider: {
|
|
22
23
|
updateAtScroll: boolean;
|
23
24
|
scrollToClose: boolean;
|
24
25
|
zIndex: number;
|
26
|
+
locale: "ar-EG" | "de-DE" | "en-US" | "es-ES" | "fr-FR" | "id-ID" | "it-it" | "ja-JP" | "km-KH" | "ko-KR" | "ms-MY" | "nl-NL" | "pt-PT" | "ru-RU" | "th-TH" | "vi-VN" | "zh-CN" | "zh-TW";
|
25
27
|
}>;
|
26
28
|
__isFragment?: never;
|
27
29
|
__isTeleport?: never;
|
@@ -32,6 +34,7 @@ declare const ConfigProvider: {
|
|
32
34
|
updateAtScroll: boolean;
|
33
35
|
scrollToClose: boolean;
|
34
36
|
zIndex: number;
|
37
|
+
locale: "ar-EG" | "de-DE" | "en-US" | "es-ES" | "fr-FR" | "id-ID" | "it-it" | "ja-JP" | "km-KH" | "ko-KR" | "ms-MY" | "nl-NL" | "pt-PT" | "ru-RU" | "th-TH" | "vi-VN" | "zh-CN" | "zh-TW";
|
35
38
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
36
39
|
$slots: Readonly<import('./type').ConfigconfigSlots> & import('./type').ConfigconfigSlots;
|
37
40
|
}) & {
|
@@ -12,6 +12,7 @@ declare const __VLS_component: import('vue').DefineComponent<ConfigProviderProps
|
|
12
12
|
updateAtScroll: boolean;
|
13
13
|
scrollToClose: boolean;
|
14
14
|
zIndex: number;
|
15
|
+
locale: "ar-EG" | "de-DE" | "en-US" | "es-ES" | "fr-FR" | "id-ID" | "it-it" | "ja-JP" | "km-KH" | "ko-KR" | "ms-MY" | "nl-NL" | "pt-PT" | "ru-RU" | "th-TH" | "vi-VN" | "zh-CN" | "zh-TW";
|
15
16
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
16
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
17
18
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js");const o=require("../_shared/utils/global-config.js"),t=e.defineComponent({name:"ConfigProvider",__name:"index",props:{zIndex:{default:1001},size:{default:"medium"},popupContainer:{default:"body"},updateAtScroll:{type:Boolean,default:!0},scrollToClose:{type:Boolean,default:!1}},setup(t){const
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js");const o=require("../_shared/utils/global-config.js"),l=require("../_shared/locale/i18n.js"),t=e.defineComponent({name:"ConfigProvider",__name:"index",props:{locale:{default:"zh-CN"},zIndex:{default:1001},size:{default:"medium"},popupContainer:{default:"body"},updateAtScroll:{type:Boolean,default:!0},scrollToClose:{type:Boolean,default:!1}},setup(t){const s=e.useSlots(),r=t,{locale:u,zIndex:a,size:d,updateAtScroll:n,scrollToClose:i,popupContainer:p}=e.toRefs(r);return e.provide(o.CONFIG_PROVIDER_PROVIDE_KEY,{slots:s,zIndex:a,size:d,updateAtScroll:n,scrollToClose:i,popupContainer:p}),e.watch(()=>u.value,e=>{l.loadLanguageAsync(e)},{immediate:!0}),(o,l)=>e.renderSlot(o.$slots,"default")}});module.exports=t;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Size, PopupContainer } from '../_shared/type';
|
2
2
|
import { VNode } from 'vue';
|
3
3
|
export interface ConfigProviderProps {
|
4
|
+
locale?: 'ar-EG' | 'de-DE' | 'en-US' | 'es-ES' | 'fr-FR' | 'id-ID' | 'it-it' | 'ja-JP' | 'km-KH' | 'ko-KR' | 'ms-MY' | 'nl-NL' | 'pt-PT' | 'ru-RU' | 'th-TH' | 'vi-VN' | 'zh-CN' | 'zh-TW';
|
4
5
|
zIndex?: number;
|
5
6
|
size?: Size;
|
6
7
|
popupContainer?: PopupContainer;
|
package/lib/Drawer/Drawer.vue.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js");const o=require("../_shared/utils/dom.js");require("../_shared/utils/time.js");const t=require("../_shared/utils/global-config.js"),l=require("../Modal/hooks/useModalClose.js"),
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js");const o=require("../_shared/utils/dom.js");require("../_shared/utils/time.js");const t=require("../_shared/utils/global-config.js"),l=require("../Modal/hooks/useModalClose.js"),r=require("../Button/index.js"),n=require("../_shared/components/IconButton.vue.js");,/* empty css */,/* empty css */;/* empty css */const a=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),s={key:0,class:"yc-drawer-header"},i={class:"yc-drawer-title text-ellipsis"},d={class:"yc-drawer-body"},c={key:0,class:"yc-drawer-footer"},u=e.defineComponent({name:"Drawer",inheritAttrs:!1,__name:"Drawer",props:{visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},placement:{default:"right"},title:{default:""},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:{default:""},cancelText:{default:""},okLoading:{type:Boolean,default:!1},okButtonProps:{default:()=>({})},cancelButtonProps:{default:()=>({})},unmountOnClose:{type:Boolean,default:!1},width:{default:250},height:{default:250},popupContainer:{default:void 0},drawerStyle:{default:()=>({})},escToClose:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1},onBeforeCancel:{type:Function,default:()=>!0},onBeforeOk:{type:Function,default:()=>!0}},emits:["update:visible","ok","cancel","before-open","open","before-close","close"],setup(u,{emit:f}){const p=u,m=f,{visible:y,defaultVisible:B,width:k,height:v,placement:h,maskClosable:C,escToClose:w,drawerStyle:b,renderToBody:x,popupContainer:g}=e.toRefs(p),{onBeforeOk:T,onBeforeCancel:V}=p,{zIndex:N,popupContainer:_}=t.getGlobalConfig(p),{t:S}=a.useI18n(),q=e.computed(()=>({height:"left"==h.value||"right"==h.value?"":o.valueToPx(v.value),width:"left"==h.value||"right"==h.value?o.valueToPx(k.value):"",...b.value})),{outerVisible:j,innerVisible:$,asyncLoading:E,handleClose:D,handleAfterLeave:P}=l({visible:y,defaultVisible:B,escToClose:w,maskClosable:C,onBeforeCancel:V,onBeforeOk:T,emits:m});return(o,t)=>(e.openBlock(),e.createBlock(e.Teleport,{to:e.unref(_),disabled:!e.unref(x)},[!o.unmountOnClose||e.unref(j)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["yc-drawer-wrapper",`yc-drawer-placement-${e.unref(h)}`,o.$attrs.class,{"yc-drawer-position-absolute":e.unref(g)||!e.unref(x)}]),style:e.normalizeStyle({zIndex:e.unref(N),...o.$attrs.style??{}})},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[o.mask?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:"yc-drawer-mask",onClick:t[0]||(t[0]=o=>e.unref(D)("mask",o))},null,512)),[[e.vShow,e.unref($)]]):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:`slide-drawer-${e.unref(h)}`,onBeforeEnter:t[4]||(t[4]=e=>o.$emit("before-open")),onBeforeLeave:t[5]||(t[5]=e=>o.$emit("before-close")),onAfterEnter:t[6]||(t[6]=e=>o.$emit("open")),onAfterLeave:e.unref(P)},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"yc-drawer-container",style:e.normalizeStyle(q.value)},[e.renderSlot(o.$slots,"header",{},()=>[o.header?(e.openBlock(),e.createElementBlock("div",s,[e.createElementVNode("div",i,[e.renderSlot(o.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])]),o.closable?(e.openBlock(),e.createBlock(e.unref(n),{key:0,class:"yc-modal-close-button",onClick:t[1]||(t[1]=o=>e.unref(D)("closeBtn",o))})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",d,[e.renderSlot(o.$slots,"default")]),e.renderSlot(o.$slots,"footer",{},()=>[o.footer?(e.openBlock(),e.createElementBlock("div",c,[o.hideCancel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r.default),e.mergeProps({key:0},o.cancelButtonProps,{onClick:t[2]||(t[2]=o=>e.unref(D)("cancelBtn",o))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.cancelText||e.unref(S)("drawer.cancelText")),1)]),_:1},16)),e.createVNode(e.unref(r.default),e.mergeProps({type:"primary",loading:o.okLoading||e.unref(E)},o.okButtonProps,{onClick:t[3]||(t[3]=o=>e.unref(D)("confirmBtn",o))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.okText||e.unref(S)("drawer.okText")),1)]),_:1},16,["loading"])])):e.createCommentVNode("",!0)])],4),[[e.vShow,e.unref($)]])]),_:3},8,["name","onAfterLeave"])],6)),[[e.vShow,e.unref(j)]]):e.createCommentVNode("",!0)],8,["to","disabled"]))}});module.exports=u;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js");const o=require("../_shared/utils/vue-utils.js");require("../Empty/index.js");/* empty css */const n=require("./Drawer.vue.js");;/* empty css */const t={class:"yc-drawer-body-content"},l=e.defineComponent({__name:"DrawerService",props:{placement:{default:"right"},title:{type:[String,Array,Function],default:""},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:{default:"
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js");const o=require("../_shared/utils/vue-utils.js");require("../Empty/index.js");/* empty css */const n=require("./Drawer.vue.js");;/* empty css */const t={class:"yc-drawer-body-content"},l=e.defineComponent({__name:"DrawerService",props:{placement:{default:"right"},title:{type:[String,Array,Function],default:""},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:{default:""},cancelText:{default:""},okLoading:{type:Boolean,default:!1},okButtonProps:{default:()=>({})},cancelButtonProps:{default:()=>({})},unmountOnClose:{type:Boolean,default:!1},width:{default:250},height:{default:250},drawerStyle:{default:()=>({})},escToClose:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!1},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1},onBeforeCancel:{type:Function,default:()=>!0},onBeforeOk:{type:Function,default:()=>!0},content:{},onOk:{},onCancel:{},onOpen:{},onClose:{},onBeforeOpen:{},onBeforeClose:{},serviceClose:{}},setup(l){const r=l,{onClose:a,serviceClose:u}=r,s=e.ref(!1),i=()=>{null==u||u(),null==a||a()};return e.onMounted(()=>{s.value=!0}),(l,a)=>(e.openBlock(),e.createBlock(n,e.mergeProps(r,{visible:s.value,"onUpdate:visible":a[0]||(a[0]=e=>s.value=e),style:{position:"fixed"},"popup-container":".yc-overlay-drawer",onOk:a[1]||(a[1]=e=>{var o;return null==(o=l.onOk)?void 0:o.call(l)}),onCancel:a[2]||(a[2]=e=>{var o;return null==(o=l.onCancel)?void 0:o.call(l)}),onBeforeOpen:a[3]||(a[3]=e=>{var o;return null==(o=l.onBeforeOpen)?void 0:o.call(l)}),onBeforeClose:a[4]||(a[4]=e=>{var o;return null==(o=l.onBeforeClose)?void 0:o.call(l)}),onOpen:a[5]||(a[5]=e=>{var o;return null==(o=l.onOpen)?void 0:o.call(l)}),onClose:i}),{title:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o.getSlotFunction)(l.title))))]),default:e.withCtx(()=>[e.createElementVNode("div",t,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o.getSlotFunction)(l.content))))])]),_:1},16,["visible"]))}});module.exports=l;
|
package/lib/Empty/index.vue.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js"),require("./index.js");/* empty css */const t=require("../_shared/icons/IconEmpty.vue.js"),r={class:"yc-empty"},
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js"),require("./index.js");/* empty css */const t=require("../_shared/icons/IconEmpty.vue.js"),r=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),o={class:"yc-empty"},s={class:"yc-empty-image"},c=["src"],i={key:0,class:"yc-empty-description"},n=e.defineComponent({name:"Empty",__name:"index",props:{description:{default:""},imgSrc:{default:""}},setup(n){const l=n,{description:d}=e.toRefs(l),{t:m}=r.useI18n(),u=e.computed(()=>d.value||m("empty.description"));return(r,n)=>(e.openBlock(),e.createElementBlock("div",o,[e.createElementVNode("div",s,[e.renderSlot(r.$slots,"image",{},()=>[r.imgSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.imgSrc,alt:"图片加载失败"},null,8,c)):e.createCommentVNode("",!0),e.createVNode(e.unref(t))])]),u.value?(e.openBlock(),e.createElementBlock("div",i,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(u.value),1)])])):e.createCommentVNode("",!0)]))}});module.exports=n;
|
package/lib/Image/Image.vue.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js");const t=require("../_shared/utils/dom.js");require("../_shared/utils/time.js"),require("../Empty/index.js");/* empty css */const
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js");const t=require("../_shared/utils/dom.js");require("../_shared/utils/time.js"),require("../Empty/index.js");/* empty css */const i=require("../_shared/icons/IconImageClose.vue.js"),o=require("../_shared/utils/control.js"),r=require("./hooks/useContext.js"),l=require("../Spin/index.js"),a=require("./ImagePreview.vue.js");;/* empty css */const s=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),n=["src","title","alt"],c={key:1,class:"yc-image-overlay"},d={class:"yc-image-loader"},u={key:2,class:"yc-image-overlay"},m={class:"yc-image-error"},v={class:"yc-image-error-icon"},p={class:"yc-image-error-alt"},f={class:"yc-image-footer-caption"},y=["title"],g=["title"],h={key:0,class:"yc-image-footer-extra"},w=e.defineComponent({name:"Image",__name:"Image",props:{src:{default:""},width:{},height:{},title:{default:""},description:{default:""},fit:{},alt:{},hideFooter:{type:[Boolean,String],default:!1},footerPosition:{default:"inner"},showLoader:{type:Boolean,default:!1},preview:{type:Boolean,default:!0},previewVisible:{type:Boolean,default:void 0},defaultPreviewVisible:{type:Boolean,default:!1},previewProps:{default:()=>({})},footerClass:{default:""}},emits:["update:previewVisible","preview-visible-change"],setup(w,{emit:k}){const V=w,B=k,{src:E,preview:N,previewVisible:j,defaultPreviewVisible:C}=e.toRefs(V),{hasGroupFather:q,handleClick:x}=r().inject(),{t:P}=s.useI18n(),S=o(j,C.value,e=>{B("update:previewVisible",e),B("preview-visible-change",e)}),b=e.ref(!1),_=e.ref(!1),$=()=>{_.value=!1,b.value=!1},I=()=>{_.value=!1,b.value=!0},z=()=>{if(q.value)return x(E.value);N.value&&(S.value=!0)};return e.watch(()=>E.value,()=>{_.value=!0,b.value=!1},{immediate:!0}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"yc-image",style:e.normalizeStyle({width:e.unref(t.valueToPx)(o.width),height:e.unref(t.valueToPx)(o.height)})},[e.createElementVNode("img",{src:e.unref(E),title:o.title,alt:o.alt??o.description,style:e.normalizeStyle({width:e.unref(t.valueToPx)(o.width),height:e.unref(t.valueToPx)(o.height),objectFit:o.fit}),class:"yc-image-img",onLoad:$,onError:I,onClick:z},null,44,n),e.unref(N)?(e.openBlock(),e.createBlock(a,e.mergeProps({key:0,visible:e.unref(S),"onUpdate:visible":r[0]||(r[0]=t=>e.isRef(S)?S.value=t:null),src:e.unref(E)},o.previewProps),e.createSlots({_:2},[o.$slots["preview-actions"]?{name:"actions",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"preview-actions")]),key:"0"}:void 0]),1040,["visible","src"])):e.createCommentVNode("",!0),(o.showLoader||o.$slots.loader)&&_.value?(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",d,[e.renderSlot(o.$slots,"loader",{},()=>[e.createVNode(e.unref(l),{size:30,tip:e.unref(P)("image.loading")},null,8,["tip"])])])])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(o.$slots,"error",{},()=>[e.createElementVNode("div",m,[e.renderSlot(o.$slots,"error-icon",{},()=>[e.createElementVNode("div",v,[e.createVNode(e.unref(i),{size:60})])]),e.createElementVNode("div",p,e.toDisplayString(o.alt??o.description),1)])])])):e.createCommentVNode("",!0),!o.hideFooter&&(o.title||o.description||o.$slots.extra)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["yc-image-footer","inner"==o.footerPosition?"yc-image-footer-inner":"yc-image-footer-outer",o.footerClass])},[e.createElementVNode("div",f,[e.createElementVNode("div",{class:"yc-image-footer-caption-title",title:o.title},e.toDisplayString(o.title),9,y),e.createElementVNode("div",{class:"yc-image-footer-caption-description",title:o.description},e.toDisplayString(o.description),9,g)]),o.$slots.extra?(e.openBlock(),e.createElementBlock("div",h,[e.renderSlot(o.$slots,"extra")])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],4))}});module.exports=w;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js"),require("../Empty/index.js");/* empty css */const o=require("../_shared/icons/IconFullScreen.vue2.js"),
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js"),require("../Empty/index.js");/* empty css */const o=require("../_shared/icons/IconFullScreen.vue2.js"),r=require("../_shared/icons/IconOriginSize.vue2.js"),n=require("../_shared/icons/IconRotateLeft.vue2.js"),t=require("../_shared/icons/IconRotateRight.vue2.js"),i=require("../_shared/icons/IconZoomIn.vue2.js"),c=require("../_shared/icons/IconZoomOut.vue2.js"),s=require("./ImagePreviewAction.vue.js");;/* empty css */const u=require("../node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js"),a={key:0,class:"yc-image-preview-toolbar"},l=e.defineComponent({__name:"ImagePreviewToolbar",props:{actionsLayout:{default:()=>[]}},emits:["click"],setup(l){const{t:m}=u.useI18n(),d={fullScreen:o,rotateRight:t,rotateLeft:n,zoomIn:i,zoomOut:c,originalSize:r};return(o,r)=>o.actionsLayout.length?(e.openBlock(),e.createElementBlock("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.actionsLayout,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[d[r]?(e.openBlock(),e.createBlock(s,{key:0,name:e.unref(m)(`imagePreview.${r}`),onClick:e=>o.$emit("click",r,e)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d[r])))]),_:2},1032,["name","onClick"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(o.$slots,"actions")])):e.createCommentVNode("",!0)}});module.exports=l;
|