cc1-ui 1.0.0 → 1.0.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/cc1-ui.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineAsyncComponent } from 'vue';
|
|
2
2
|
|
|
3
|
-
const DRdominfo = () => import('./dominfo-
|
|
3
|
+
const DRdominfo = () => import('./dominfo-0VtYQrCk.js');
|
|
4
4
|
const VButton = () => defineAsyncComponent(() => import('./index-lDlR9NjA.js'));
|
|
5
5
|
const VSwitch = () => defineAsyncComponent(() => import('./index-BvvdDtUd.js'));
|
|
6
6
|
const VScale = () => defineAsyncComponent(() => import('./index-l4J1-e0K.js'));
|
|
7
7
|
const VMask = () => defineAsyncComponent(() => import('./index-ycYY--mh.js'));
|
|
8
8
|
const VCircle = () => defineAsyncComponent(() => import('./index-ti4E-Nv5.js'));
|
|
9
9
|
const VIcon = () => defineAsyncComponent(() => import('./index-BGzY32VF.js'));
|
|
10
|
-
const VSelect = () => defineAsyncComponent(() => import('./index-
|
|
10
|
+
const VSelect = () => defineAsyncComponent(() => import('./index-ClZ7RWBn.js'));
|
|
11
11
|
const VSIcon = () => defineAsyncComponent(() => import('./index-mrAwG3J3.js'));
|
|
12
12
|
const installDR = (fun, app) => {
|
|
13
13
|
fun().then((module) => module.install(app));
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var cc1Vue3$1 = {exports: {}};
|
|
4
|
-
|
|
5
|
-
var cc1Vue3 = cc1Vue3$1.exports;
|
|
6
|
-
|
|
7
|
-
var hasRequiredCc1Vue3;
|
|
8
|
-
|
|
9
|
-
function requireCc1Vue3 () {
|
|
10
|
-
if (hasRequiredCc1Vue3) return cc1Vue3$1.exports;
|
|
11
|
-
hasRequiredCc1Vue3 = 1;
|
|
12
|
-
(function (module, exports$1) {
|
|
13
|
-
!function(e,t){t(exports$1,require$$0);}(cc1Vue3,function(e,t){const n="__scopeObjFun";class o{static map={};static get(e,n){const r=o,s=t.getCurrentInstance();return s?(r.map[e]||(r.map[e]={value:n(),refs:new Set}),r.map[e].refs.add(s),t.onUnmounted(()=>{r.map[e]?.refs.delete(s),0===r.map[e]?.refs.size&&delete r.map[e];}),r.map[e].value):n()}}const r=window.Scope||class{static setConf=(e,o)=>{o||"string"==typeof e||(o=e,e="conf");const r=t.getCurrentInstance();let s=o;if("function"!=typeof s&&(s=()=>o),r){let t=r[n];t||(t=[]),t.push({key:e,fun:s}),r[n]=t;}};static getConf=(e,o)=>{e?"number"==typeof e&&(o=e,e="conf"):e="conf",o||(o=1);let r=t.getCurrentInstance(),s=0,c=()=>null;for(;r=r.parent;){const t=r[n];if(t)for(let n=0;n<t.length;n++){const r=t[n];if(r.key===e&&(s++,c=r.fun,s===o))return r.fun()}}return c()};static CEventBean=null;static CEventBeanDeactivated=false;static Event=()=>{if(!this.CEventBean)return null;const e=t.getCurrentInstance(),n=new this.CEventBean;return n.vm=()=>()=>e.isDeactivated?this.CEventBeanDeactivated:!e.isUnmounted,n};static TimerBean=null;static TimerBeanDeactivated="pause";static Timer=()=>{if(!this.TimerBean)return null;const e=new this.TimerBean,n=t.getCurrentInstance();return e.vm=()=>()=>n.isDeactivated?this.TimerBeanDeactivated:!n.isUnmounted,e}};window.TimerBean&&(r.TimerBean=window.TimerBean),window.CEventBean&&(r.CEventBean=window.CEventBean),window.Scope||(window.Scope=r),e.CRouter=class{static init=e=>{const t=e.root||"/src/views";if(!e.modules)throw new Error("modules is required");const n=e.modules,o={},r=e.diffModules||{},s={},c=e.pathHook||(e=>e),i=(n,o)=>{Object.keys(o).forEach(r=>{let s=r.replace(t,"").replace(".vue","");const i=e.mapKeyPathHook?.(s)||r;n[i]={path:c(s),component:o[r],useNum:0};});};i(o,n),i(s,r);((e,t)=>{for(const n in t)n in e||(e[n]=t[n]);})(o,s);const a=e.children||[],u=[],p=e=>{const t=Object.keys(o);for(let n=0;n<t.length;n++)if(o[t[n]].path===e)return o[t[n]]};if(a.length){const e=t=>{if(t.children=t.children||[],t.childrenList&&t.childrenList.forEach(e=>{const n=p(e);n&&(t.children.push({path:e,component:n.component}),n.useNum++);}),t.children&&t.children.forEach(t=>{e(t);}),t.component){const e=p(t.component);e&&(t.component=e.component,e.useNum++);}if(t.childrenReg){const e=(n=t.childrenReg,Array.isArray(n)?n.map(e=>e instanceof RegExp?e:new RegExp(e)):n instanceof RegExp?[n]:n?[new RegExp(n)]:[]);Object.keys(o).forEach(n=>{e.some(e=>e.test(n))&&(t.children.push({path:n,component:o[n].component}),o[n].useNum++);});}var n;};for(let t=0;t<a.length;t++){const n=a[t];e(n),u.push(n);}}Object.keys(o).forEach(e=>{0===o[e].useNum&&u.push({path:e,component:o[e].component});});const l=t=>{t.path=o[t.path].path,e.setInfoHook?.(t),t.children&&t.children.forEach(e=>{l(e);});};u.forEach(e=>{l(e);});const d={};return Object.keys(o).forEach(e=>{d[o[e].path]=o[e];}),{array:u,map:d}}},e.CVue3=class{static onDispose=e=>{const n=t.getCurrentInstance();let o=n.vnode.el?.parentElement?.parentElement,r=false;const s=setInterval(()=>{if(r)return void clearInterval(s);const t=n.vnode.el?.parentElement?.parentElement;return void 0===o&&(o=t),o&&!t?(clearInterval(s),void e()):void 0},50);t.onUnmounted(()=>{r=true,e();});};static createCom=e=>{let n=e.domOrIdOrClass||document.body;"string"==typeof n&&(n=document.querySelector(n));const o=(...e)=>{r.unmount(),r=void 0,e.forEach(e=>{e&&n.removeChild(e);}),n.removeChild(s);};e.props||(e.props={}),e.props.remove=o;let r=t.createApp(e.component,e.props);const s=document.createElement("div");return e.beforeMount&&e.beforeMount(r),r.mount(s),e.first?n.insertBefore(s,n.firstChild):n.appendChild(s),{vm:r,remove:o}}},e.Minxins=o,e.Scope=r;});
|
|
14
|
-
} (cc1Vue3$1, cc1Vue3$1.exports));
|
|
15
|
-
return cc1Vue3$1.exports;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var cc1Vue3Exports = requireCc1Vue3();
|
|
1
|
+
import { defineComponent, ref, reactive, watch, nextTick, onMounted, onUnmounted, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, withDirectives, vModelText, normalizeStyle, Transition, withCtx, withModifiers, normalizeClass, Fragment, renderList, toDisplayString, vShow } from 'vue';
|
|
19
2
|
|
|
20
3
|
const _hoisted_1 = { style: { "width": "calc(100% - 18px)" } };
|
|
21
4
|
const _hoisted_2 = ["readonly", "autocomplete", "placeholder"];
|
|
@@ -37,7 +20,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
20
|
const emit = __emit;
|
|
38
21
|
const dialogRef = ref({});
|
|
39
22
|
const inputRef = ref({});
|
|
40
|
-
const timer = cc1Vue3Exports.Scope.Timer();
|
|
41
23
|
const conf = reactive({
|
|
42
24
|
activeItem: { value: "", label: "" },
|
|
43
25
|
input: {
|
|
@@ -114,26 +96,68 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
114
96
|
() => props.active,
|
|
115
97
|
() => conf.input.initValue()
|
|
116
98
|
);
|
|
99
|
+
const updateDialogPosition = () => {
|
|
100
|
+
if (!conf.dialog.show || !inputRef.value?.getBoundingClientRect || !dialogRef.value?.getBoundingClientRect) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const inputrect = inputRef.value.getBoundingClientRect();
|
|
104
|
+
const rect = dialogRef.value.getBoundingClientRect();
|
|
105
|
+
if (inputrect.top + inputrect.height + rect.height > document.body.clientHeight) {
|
|
106
|
+
dialogRef.value.style.top = "";
|
|
107
|
+
dialogRef.value.style.bottom = inputrect.height + 10 + "px";
|
|
108
|
+
conf.dialog.transition = "fade-down";
|
|
109
|
+
} else {
|
|
110
|
+
dialogRef.value.style.top = inputrect.height + 10 + "px";
|
|
111
|
+
dialogRef.value.style.bottom = "";
|
|
112
|
+
conf.dialog.transition = "fade-up";
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
watch(
|
|
116
|
+
() => conf.dialog.show,
|
|
117
|
+
async (show) => {
|
|
118
|
+
if (show) {
|
|
119
|
+
await nextTick();
|
|
120
|
+
updateDialogPosition();
|
|
121
|
+
if (resizeObserver && dialogRef.value) {
|
|
122
|
+
resizeObserver.observe(dialogRef.value);
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
if (resizeObserver && dialogRef.value) {
|
|
126
|
+
resizeObserver.unobserve(dialogRef.value);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
let resizeObserver = null;
|
|
132
|
+
let scrollHandler = null;
|
|
117
133
|
onMounted(() => {
|
|
118
134
|
conf.input.initValue();
|
|
119
|
-
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
dialogRef.value.style.top = inputrect.height + 10 + "px";
|
|
131
|
-
dialogRef.value.style.bottom = "";
|
|
132
|
-
conf.dialog.transition = "fade-up";
|
|
133
|
-
}
|
|
135
|
+
scrollHandler = () => {
|
|
136
|
+
if (conf.dialog.show) {
|
|
137
|
+
updateDialogPosition();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
window.addEventListener("scroll", scrollHandler, true);
|
|
141
|
+
window.addEventListener("resize", scrollHandler);
|
|
142
|
+
if (window.ResizeObserver) {
|
|
143
|
+
resizeObserver = new ResizeObserver(() => {
|
|
144
|
+
if (conf.dialog.show) {
|
|
145
|
+
updateDialogPosition();
|
|
134
146
|
}
|
|
147
|
+
});
|
|
148
|
+
if (inputRef.value) {
|
|
149
|
+
resizeObserver.observe(inputRef.value);
|
|
135
150
|
}
|
|
136
|
-
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
onUnmounted(() => {
|
|
154
|
+
if (scrollHandler) {
|
|
155
|
+
window.removeEventListener("scroll", scrollHandler, true);
|
|
156
|
+
window.removeEventListener("resize", scrollHandler);
|
|
157
|
+
}
|
|
158
|
+
if (resizeObserver) {
|
|
159
|
+
resizeObserver.disconnect();
|
|
160
|
+
}
|
|
137
161
|
});
|
|
138
162
|
return (_ctx, _cache) => {
|
|
139
163
|
const _component_VIcon = resolveComponent("VIcon");
|
package/dist/index.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ declare module 'vue' {
|
|
|
14
14
|
export interface GlobalComponents {
|
|
15
15
|
VButton:typeof import('./components/Button/index.vue')['default']
|
|
16
16
|
VCircle:typeof import('./components/Circle/index.vue')['default']
|
|
17
|
+
VMask:typeof import('./components/Mask/index.vue')['default']
|
|
17
18
|
VIcon:typeof import('./components/Icon/index.vue')['default']
|
|
18
19
|
VSIcon:typeof import('./components/SIcon/index.vue')['default']
|
|
19
20
|
VScale:typeof import('./components/Scale/index.vue')['default']
|
|
20
|
-
VSwitch:typeof import('./components/Switch/index.vue')['default']
|
|
21
21
|
VSelect:typeof import('./components/Select/index.vue')['default']
|
|
22
|
-
|
|
22
|
+
VSwitch:typeof import('./components/Switch/index.vue')['default']
|
|
23
23
|
}
|
|
24
24
|
export interface ComponentCustomProperties {
|
|
25
25
|
}
|