cnhis-design-vue 3.1.42-beta.0 → 3.1.42-beta.2

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.
Files changed (32) hide show
  1. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  2. package/es/components/annotation-edit/src/type.d.ts +3 -0
  3. package/es/components/base-search/index.d.ts +0 -22
  4. package/es/components/base-search/src/index.vue.d.ts +0 -22
  5. package/es/components/base-search/src/index.vue.js +1 -1
  6. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  7. package/es/components/classification/src/index.vue.js +1 -1
  8. package/es/components/date-picker/index.d.ts +5 -13
  9. package/es/components/date-picker/src/DatePicker.vue.d.ts +5 -13
  10. package/es/components/date-picker/src/DatePicker.vue.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/useLeft.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/useRight.js +1 -1
  13. package/es/components/form-config/src/FormConfig.vue.js +1 -1
  14. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  15. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +5 -13
  16. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +4 -10
  17. package/es/components/iho-table/style/index.css +1 -1
  18. package/es/components/index.css +1 -1
  19. package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
  20. package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
  21. package/es/components/time-picker/index.d.ts +4 -10
  22. package/es/components/time-picker/src/TimePicker.vue.d.ts +4 -10
  23. package/es/components/time-picker/src/TimePicker.vue.js +1 -1
  24. package/es/shared/mixins/index.d.ts +1 -0
  25. package/es/shared/mixins/index.js +1 -1
  26. package/es/shared/mixins/useDateTime.d.ts +6 -0
  27. package/es/shared/mixins/useDateTime.js +1 -0
  28. package/package.json +2 -2
  29. package/es/components/base-search/src/directive/resize.d.ts +0 -4
  30. package/es/components/base-search/src/directive/resize.js +0 -1
  31. package/es/components/base-search/src/tool/resizeSensor.d.ts +0 -16
  32. package/es/components/base-search/src/tool/resizeSensor.js +0 -1
@@ -3,16 +3,10 @@ declare const _default: import("vue").DefineComponent<{}, {
3
3
  attrs: {
4
4
  [x: string]: unknown;
5
5
  };
6
- emits: (event: "update:formattedValue", ...args: any[]) => void;
7
- timePickerRef: import("vue").Ref<null>;
8
- __formattedValue: import("vue").Ref<any>;
9
- keyupValue: import("vue").Ref<string>;
6
+ timePickerRef: import("vue").Ref<AnyObject | null>;
10
7
  formatRef: import("vue").ComputedRef<string>;
11
- updateFormattedValue: (value: any) => void;
12
- onBlur: () => void;
13
- onKeyUp: (event: AnyObject) => any;
8
+ focus: () => any;
9
+ blur: () => any;
14
10
  NTimePicker: any;
15
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formattedValue"[], "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
16
- "onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
17
- }, {}>;
11
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
18
12
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as u,computed as l,watch as a,openBlock as r,createBlock as o,unref as i,mergeProps as n,createSlots as v,renderList as m,withCtx as f,renderSlot as d}from"vue";import{NTimePicker as s}from"naive-ui";import{parse as c,isValid as p,format as _}from"date-fns";import k from"../../../_virtual/plugin-vue_export-helper.js";var P=k(e({__name:"TimePicker",emits:["update:formattedValue"],setup(e,{expose:k,emit:P}){const $=t(),b=u(null),x=u(),y=u(""),V=l((()=>$.format?$.format:"HH:mm:ss"));function g(e){P("update:formattedValue",e)}function H(){const e=c(y.value,V.value.replace(/:/,""),new Date);p(e)&&(x.value=_(e,V.value),g(x.value))}function T(e){var t,u;const{keyCode:l=0}=e;if(13==l)return null==(t=b.value)?void 0:t.blur();y.value=(null==(u=e.target)?void 0:u.value)||""}return a((()=>$["formatted-value"]),(e=>{x.value=e}),{immediate:!0}),k({$timePicker:b,focus:()=>{var e,t;return null==(t=null==(e=b.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=b.value)?void 0:e.blur)?void 0:t.call(e)}}),(e,t)=>(r(),o(i(s),n({ref_key:"timePickerRef",ref:b},e.$attrs,{"formatted-value":x.value,"onUpdate:formattedValue":g,onBlur:H,onKeyup:T}),v({_:2},[m(e.$slots,((t,u)=>({name:u,fn:f((()=>[d(e.$slots,u)]))})))]),1040,["formatted-value"]))}}),[["__file","TimePicker.vue"]]);export{P as default};
1
+ import{defineComponent as e,useAttrs as r,ref as i,computed as s,openBlock as t,createBlock as m,unref as o,mergeProps as u,createSlots as a,renderList as f,withCtx as l,renderSlot as p}from"vue";import{NTimePicker as n}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as _}from"../../../shared/mixins/useDateTime.js";import c from"../../../_virtual/plugin-vue_export-helper.js";var v=c(e({__name:"TimePicker",setup(e,{expose:c}){const v=r(),d=i(null),k=s((()=>v.format?v.format:"HH:mm:ss")),{focus:x,blur:h}=_(d,k);return c({$timePicker:d,focus:x,blur:h}),(e,r)=>(t(),m(o(n),u({ref_key:"timePickerRef",ref:d},e.$attrs),a({_:2},[f(e.$slots,((r,i)=>({name:i,fn:l((()=>[p(e.$slots,i)]))})))]),1040))}}),[["__file","TimePicker.vue"]]);export{v as default};
@@ -1 +1,2 @@
1
1
  export * from './useTheme';
2
+ export * from './useDateTime';
@@ -1 +1 @@
1
- export{useTheme}from"./useTheme.js";
1
+ export{useTheme}from"./useTheme.js";export{useDateTime}from"./useDateTime.js";
@@ -0,0 +1,6 @@
1
+ import { Ref } from 'vue';
2
+ import { AnyObject } from '../../../es/shared/types';
3
+ export declare function useDateTime(datePickerRef: Ref<AnyObject | null>, formatRef: Ref<string>): {
4
+ focus: () => any;
5
+ blur: () => any;
6
+ };
@@ -0,0 +1 @@
1
+ import{computed as e,onMounted as t,onUnmounted as n}from"vue";import{useDebounceFn as l}from"@vueuse/core";function o(o,c){const u=l((e=>{!function(e){const t=e.target;if(["INPUT"].includes(t.tagName)){const{selectionStart:e=0,selectionEnd:n=0}=t;e===n&&t.select()}}(e)}),200),s=e((()=>{var e;return null==(e=o.value)?void 0:e.$el}));function r(e){const t=e.target;t.value&&Reflect.get(t,"_f_")&&(Reflect.set(t,"_f_",0),a(t,!0)&&(e.preventDefault(),e.stopPropagation()))}function i(e){const{key:t,target:n}=e;/\d/.test(t)&&n?Reflect.set(n,"_f_",1):"Enter"===t&&a(e.target,!1,!0)}function a(e,t,n){const l=e.value;if(!l)return;const o=e.selectionEnd||0,u=l.length;let s=0,r=0,i=0,a="",v=0;for(;s<u;){const e=l[s++];if(/\d/.test(e)&&(a+=e),s===o){i=a.length;const e=l.slice(s).match(/^\d+/);v=e?e[0].length:0}}const d=c.value;let f="",g=0,h=0;for(s=0;s<d.length&&(n||!(r>=a.length));){const e=d[s++];if(/[yMdHms]/.test(e)?f+=a[r++]||"0":f+=e,t&&r===i){i=-1,g=f.length,h=g;let e=d.slice(s).match(/^[yMdHms]+/);e?(v=Math.min(v,e[0].length),v&&(f+=a.slice(r,r+v),r+=v),s+=e[0].length):(e=d.slice(s).match(/^([^yMdHms]+)([yMdHms]*)/),e&&(g+=e[1].length,h=g+e[2].length))}}const m=f!==l;if(m){e.value=f;const t=new InputEvent("input");e.dispatchEvent(t)}return t&&(g=g||f.length+1,h=h||f.length+1,e.setSelectionRange(g,h)),m}return t((()=>{s.value&&(s.value.addEventListener("input",r,!0),s.value.addEventListener("keydown",i,!0),s.value.addEventListener("click",u,!0))})),n((()=>{s.value&&(s.value.removeEventListener("input",r,!0),s.value.removeEventListener("keydown",i,!0),s.value.removeEventListener("click",u,!0))})),{focus:()=>{var e,t;return null==(t=null==(e=o.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=o.value)?void 0:e.blur)?void 0:t.call(e)}}}export{o as useDateTime};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.42-beta.0",
3
+ "version": "3.1.42-beta.2",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "25a3ef21bd2f21d981d76f64955822c2f202a601"
64
+ "gitHead": "e8fdeb8a9c5f516409ae639692f72ba1f9e4fbd7"
65
65
  }
@@ -1,4 +0,0 @@
1
- declare const Resize: {
2
- mounted(el: any, binding: any): void;
3
- };
4
- export default Resize;
@@ -1 +0,0 @@
1
- import o from"../tool/resizeSensor.js";import{useDebounceFn as e}from"@vueuse/core";const r={mounted(r,t){const s=t.value,m=e(s,10);new o(r,m)}};export{r as default};
@@ -1,16 +0,0 @@
1
- /**
2
- * Class for dimension change detection.
3
- *
4
- * @param {Element|Element[]} element
5
- * @param {Function} callback
6
- *
7
- * @constructor
8
- */
9
- declare class ResizeSensor {
10
- _isCollectionTyped: boolean;
11
- _element: any;
12
- constructor(element: any, callback: any);
13
- static detach(element: any): void;
14
- detach(): void;
15
- }
16
- export default ResizeSensor;
@@ -1 +0,0 @@
1
- const e=window.requestAnimationFrame||function(e){return window.setTimeout(e,20)};class t{constructor(e){let t;this.q=[],this.add=function(e){this.q.push(e)},this.call=function(){for(t=0;t<this.q.length;t++)this.q[t].call(this,e)}}}function s(s,i){if(s.resizedAttached){if(s.resizedAttached)return void s.resizedAttached.add(i)}else s.resizedAttached=new t(s),s.resizedAttached.add(i);s.resizeSensor=document.createElement("div"),s.resizeSensor.className="resize-sensor";const o="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden; opacity: 0;direction: ltr;",n="position: absolute; left: 0; top: 0; transition: 0s;";s.resizeSensor.style.cssText=o,s.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+o+'"><div style="'+n+'"></div></div><div class="resize-sensor-shrink" style="'+o+'"><div style="'+n+' width: 200%; height: 200%"></div></div>',s.appendChild(s.resizeSensor),"static"==function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null).getPropertyValue(t):e.style[t]}(s,"position")&&(s.style.position="relative");const l=s.resizeSensor.childNodes[0],r=l.childNodes[0],d=s.resizeSensor.childNodes[1],c=function(){r.style.width="100000px",r.style.height="100000px",l.scrollLeft=1e5,l.scrollTop=1e5,d.scrollLeft=1e5,d.scrollTop=1e5};c();let h=!1;const a=function(){s.resizedAttached&&(h&&(s.resizedAttached.call(),h=!1),e(a))};let u,f,p,z;e(a);const y=function(){(p=s.offsetWidth)==u&&(z=s.offsetHeight)==f||(h=!0,u=p,f=z),c()},v=function(e,t,s){e.attachEvent?e.attachEvent("on"+t,s):e.addEventListener(t,s)};v(l,"scroll",y),v(d,"scroll",y)}class i{constructor(e,t){const i=Object.prototype.toString.call(e);if(this._isCollectionTyped="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i,this._element=e,this._isCollectionTyped)for(let i=0;i<e.length;i++)s(e[i],t);else s(e,t)}static detach(e){e.resizeSensor&&(e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached)}detach(){const e=this._isCollectionTyped,t=this._element;if(e)for(let e=0;e<t.length;e++)i.detach(t[e]);else i.detach(t)}}export{i as default};