@kingteza/crud-component 1.0.15 → 1.0.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const d=require("react/jsx-runtime"),s=require("antd"),t=require("dayjs"),E=require("
|
|
1
|
+
"use strict";const d=require("react/jsx-runtime"),s=require("antd"),t=require("dayjs"),E=require("dayjs/plugin/advancedFormat"),F=require("dayjs/plugin/customParseFormat"),I=require("dayjs/plugin/localeData"),v=require("dayjs/plugin/weekday"),S=require("dayjs/plugin/weekOfYear"),T=require("dayjs/plugin/weekYear"),Y=require("../../../locale/hooks/translation-constants.cjs"),$=require("react"),L=require("react-i18next");t.extend(F);t.extend(E);t.extend(v);t.extend(I);t.extend(S);t.extend(T);const M=({type:_,required:q,label:o,rules:x=[],placeholder:a,disabledPastDays:c=!1,disableToday:i=!1,onEnter:z,disabled:f,nextFocus:B,onChange:r,range:m,showTime:l,disabledFutureDays:u,picker:k,defaultValue:O,value:y,format:P,autoComplete:G="off",enabledDates:H=[],renderExtraFooter:j,...p})=>{const{t:w}=L.useTranslation(Y.TRANSLATION_NAMESPACE),A=m?s.DatePicker.RangePicker:s.DatePicker,D=$.useCallback(e=>{if(!e)return!1;const n=t(),N=c&&e<n.startOf("day"),R=u&&e>n.endOf("day"),C=i&&e<n.endOf("day")&&n.startOf("day")<e;return N||R||C},[c,u,i]);return d.jsx(s.Form.Item,{...p,label:o,rules:[{required:q,message:`${o??a??""} ${w("err.validation.required")}`},...x],children:d.jsx(A,{renderExtraFooter:j,value:y,picker:k,defaultValue:O,format:P,onChange:e=>r==null?void 0:r(e),disabledDate:D,disabled:f,className:"w-100",placeholder:a,showTime:l})})};module.exports=M;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { DatePicker as d, Form as C } from "antd";
|
|
3
3
|
import e from "dayjs";
|
|
4
|
-
import I from "
|
|
5
|
-
import R from "
|
|
6
|
-
import S from "
|
|
7
|
-
import T from "
|
|
8
|
-
import Y from "
|
|
9
|
-
import $ from "
|
|
4
|
+
import I from "dayjs/plugin/advancedFormat";
|
|
5
|
+
import R from "dayjs/plugin/customParseFormat";
|
|
6
|
+
import S from "dayjs/plugin/localeData";
|
|
7
|
+
import T from "dayjs/plugin/weekday";
|
|
8
|
+
import Y from "dayjs/plugin/weekOfYear";
|
|
9
|
+
import $ from "dayjs/plugin/weekYear";
|
|
10
10
|
import { TRANSLATION_NAMESPACE as q } from "../../../locale/hooks/translation-constants.js";
|
|
11
11
|
import { useCallback as L } from "react";
|
|
12
12
|
import { useTranslation as M } from "react-i18next";
|
package/dist/util/ImageUtil.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("
|
|
1
|
+
"use strict";const c=require("browser-image-compression");class g{async resizeImage(t){const e=await c(t,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0}),a=t.uid;return Object.assign(e,{uid:a,lastModifiedDate:new Date})}async getImageData(t){const e=await this.getImageData0(t);if(e){const a=new Image;a.src=e.data;const o=await new Promise(n=>{a.onload=function(){n({height:a.height,width:a.width})}});return Object.assign(e,o),e}else return null}async getImageData0(t){try{if(t.startsWith("data:image/")){const e=t.match(/^data:image\/(png|jpeg|jpg);base64,(.*)$/);if(!e)throw new Error("Invalid base64 image data");return{data:t,type:e[1]}}else{const e=await fetch(t);if(!e.ok)throw new Error("Network response was not ok");const a=await e.blob();return new Promise((o,n)=>{const s=new FileReader;s.onloadend=function(){const r=s.result,i=r.match(/^data:image\/(png|jpeg|jpg);base64,/);i?o({data:r,type:i[1]}):n(new Error("Could not determine image type"))},s.onerror=n,s.readAsDataURL(a)})}}catch(e){return console.warn(e),null}}}const d=new g;module.exports=d;
|
package/dist/util/ImageUtil.js
CHANGED