@uzum-tech/ui 1.12.10 → 1.12.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +40 -7
- package/dist/index.prod.js +2 -2
- package/es/_internal/clear/src/Clear.js +1 -1
- package/es/_utils/composable/use-expose-proxy.d.ts +2 -0
- package/es/_utils/composable/use-expose-proxy.js +27 -0
- package/es/create.js +14 -6
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/clear/src/Clear.js +1 -1
- package/lib/_utils/composable/use-expose-proxy.d.ts +2 -0
- package/lib/_utils/composable/use-expose-proxy.js +30 -0
- package/lib/create.js +13 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
31
31
|
h(UIconSwitchTransition, null, {
|
|
32
32
|
default: () => {
|
|
33
33
|
var _a, _b;
|
|
34
|
-
return this.show ? (h("div", { key: "dismiss", class: `${clsPrefix}-base-clear__clear`,
|
|
34
|
+
return this.show ? (h("div", { key: "dismiss", class: `${clsPrefix}-base-clear__clear`, onMousedown: this.handleMouseDown, "data-clear": true }, resolveSlot(this.$slots.icon, () => [
|
|
35
35
|
h(UBaseIcon, { clsPrefix: clsPrefix }, {
|
|
36
36
|
default: () => h(ClearIcon, null)
|
|
37
37
|
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default function useExposeProxy(targetRef) {
|
|
2
|
+
return new Proxy({}, {
|
|
3
|
+
get(_, prop) {
|
|
4
|
+
const target = targetRef.value;
|
|
5
|
+
if (!target)
|
|
6
|
+
return undefined;
|
|
7
|
+
const value = target[prop];
|
|
8
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
9
|
+
},
|
|
10
|
+
has(_, prop) {
|
|
11
|
+
return !!targetRef.value && prop in targetRef.value;
|
|
12
|
+
},
|
|
13
|
+
ownKeys() {
|
|
14
|
+
return targetRef.value ? Reflect.ownKeys(targetRef.value) : [];
|
|
15
|
+
},
|
|
16
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
17
|
+
if (!targetRef.value || !(prop in targetRef.value)) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
value: targetRef.value[prop]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
package/es/create.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { computed, getCurrentInstance, h } from 'vue';
|
|
1
|
+
import { computed, getCurrentInstance, h, ref, defineComponent } from 'vue';
|
|
2
2
|
import version from './version';
|
|
3
3
|
import { configProviderInjectionKey } from './config-provider/src/context';
|
|
4
|
+
import useExposeProxy from './_utils/composable/use-expose-proxy';
|
|
4
5
|
function create({ componentPrefix = 'U', components = [] } = {}) {
|
|
5
6
|
const installTargets = [];
|
|
6
7
|
function findConfig(instance) {
|
|
@@ -15,22 +16,29 @@ function create({ componentPrefix = 'U', components = [] } = {}) {
|
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
18
|
function wrap(component) {
|
|
18
|
-
|
|
19
|
+
if (component._n_icon__) {
|
|
20
|
+
return component;
|
|
21
|
+
}
|
|
22
|
+
const wrapped = defineComponent({
|
|
19
23
|
name: component.name,
|
|
20
24
|
inheritAttrs: false,
|
|
21
25
|
setup(props, ctx) {
|
|
22
26
|
const instance = getCurrentInstance();
|
|
23
27
|
const config = instance ? findConfig(instance) : null;
|
|
28
|
+
const componentRef = ref(null);
|
|
24
29
|
const mergedProps = computed(() => {
|
|
25
|
-
var _a, _b;
|
|
30
|
+
var _a, _b, _c;
|
|
26
31
|
if (!config)
|
|
27
32
|
return props;
|
|
28
|
-
const defaults = ((_b = (_a = config.mergedComponentPropsRef) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b[component.name])
|
|
33
|
+
const defaults = (_c = (_b = (_a = config.mergedComponentPropsRef) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b[component.name]) !== null && _c !== void 0 ? _c : {};
|
|
29
34
|
return Object.assign(Object.assign({}, defaults), props);
|
|
30
35
|
});
|
|
31
|
-
|
|
36
|
+
if (ctx.expose) {
|
|
37
|
+
ctx.expose(useExposeProxy(componentRef));
|
|
38
|
+
}
|
|
39
|
+
return () => h(component, Object.assign(Object.assign({ ref: componentRef }, mergedProps.value), ctx.attrs), ctx.slots);
|
|
32
40
|
}
|
|
33
|
-
};
|
|
41
|
+
});
|
|
34
42
|
return wrapped;
|
|
35
43
|
}
|
|
36
44
|
function registerComponent(app, name, component) {
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.12-beta.1";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.12.
|
|
1
|
+
export default '1.12.12-beta.1';
|
|
@@ -36,7 +36,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
36
36
|
(0, vue_1.h)(icon_switch_transition_1.default, null, {
|
|
37
37
|
default: () => {
|
|
38
38
|
var _a, _b;
|
|
39
|
-
return this.show ? ((0, vue_1.h)("div", { key: "dismiss", class: `${clsPrefix}-base-clear__clear`,
|
|
39
|
+
return this.show ? ((0, vue_1.h)("div", { key: "dismiss", class: `${clsPrefix}-base-clear__clear`, onMousedown: this.handleMouseDown, "data-clear": true }, (0, _utils_1.resolveSlot)(this.$slots.icon, () => [
|
|
40
40
|
(0, vue_1.h)(icon_1.UBaseIcon, { clsPrefix: clsPrefix }, {
|
|
41
41
|
default: () => (0, vue_1.h)(icons_1.ClearIcon, null)
|
|
42
42
|
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useExposeProxy;
|
|
4
|
+
function useExposeProxy(targetRef) {
|
|
5
|
+
return new Proxy({}, {
|
|
6
|
+
get(_, prop) {
|
|
7
|
+
const target = targetRef.value;
|
|
8
|
+
if (!target)
|
|
9
|
+
return undefined;
|
|
10
|
+
const value = target[prop];
|
|
11
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
12
|
+
},
|
|
13
|
+
has(_, prop) {
|
|
14
|
+
return !!targetRef.value && prop in targetRef.value;
|
|
15
|
+
},
|
|
16
|
+
ownKeys() {
|
|
17
|
+
return targetRef.value ? Reflect.ownKeys(targetRef.value) : [];
|
|
18
|
+
},
|
|
19
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
20
|
+
if (!targetRef.value || !(prop in targetRef.value)) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
value: targetRef.value[prop]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
package/lib/create.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const vue_1 = require("vue");
|
|
7
7
|
const version_1 = __importDefault(require("./version"));
|
|
8
8
|
const context_1 = require("./config-provider/src/context");
|
|
9
|
+
const use_expose_proxy_1 = __importDefault(require("./_utils/composable/use-expose-proxy"));
|
|
9
10
|
function create({ componentPrefix = 'U', components = [] } = {}) {
|
|
10
11
|
const installTargets = [];
|
|
11
12
|
function findConfig(instance) {
|
|
@@ -20,22 +21,29 @@ function create({ componentPrefix = 'U', components = [] } = {}) {
|
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
function wrap(component) {
|
|
23
|
-
|
|
24
|
+
if (component._n_icon__) {
|
|
25
|
+
return component;
|
|
26
|
+
}
|
|
27
|
+
const wrapped = (0, vue_1.defineComponent)({
|
|
24
28
|
name: component.name,
|
|
25
29
|
inheritAttrs: false,
|
|
26
30
|
setup(props, ctx) {
|
|
27
31
|
const instance = (0, vue_1.getCurrentInstance)();
|
|
28
32
|
const config = instance ? findConfig(instance) : null;
|
|
33
|
+
const componentRef = (0, vue_1.ref)(null);
|
|
29
34
|
const mergedProps = (0, vue_1.computed)(() => {
|
|
30
|
-
var _a, _b;
|
|
35
|
+
var _a, _b, _c;
|
|
31
36
|
if (!config)
|
|
32
37
|
return props;
|
|
33
|
-
const defaults = ((_b = (_a = config.mergedComponentPropsRef) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b[component.name])
|
|
38
|
+
const defaults = (_c = (_b = (_a = config.mergedComponentPropsRef) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b[component.name]) !== null && _c !== void 0 ? _c : {};
|
|
34
39
|
return Object.assign(Object.assign({}, defaults), props);
|
|
35
40
|
});
|
|
36
|
-
|
|
41
|
+
if (ctx.expose) {
|
|
42
|
+
ctx.expose((0, use_expose_proxy_1.default)(componentRef));
|
|
43
|
+
}
|
|
44
|
+
return () => (0, vue_1.h)(component, Object.assign(Object.assign({ ref: componentRef }, mergedProps.value), ctx.attrs), ctx.slots);
|
|
37
45
|
}
|
|
38
|
-
};
|
|
46
|
+
});
|
|
39
47
|
return wrapped;
|
|
40
48
|
}
|
|
41
49
|
function registerComponent(app, name, component) {
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.12-beta.1";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@uzum-tech/ui",
|
|
5
|
-
"version": "1.12.
|
|
5
|
+
"version": "1.12.12-beta.1",
|
|
6
6
|
"js-types-syntax": "typescript",
|
|
7
7
|
"contributions": {
|
|
8
8
|
"html": {
|