@activecollab/components 1.0.385 → 1.0.387
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/cjs/components/EditableContent/EditableContent.js +2 -2
- package/dist/cjs/components/EditableContent/EditableContent.js.map +1 -1
- package/dist/cjs/components/EditableHours/EditableHours.js.map +1 -1
- package/dist/cjs/components/HoursWrapper/HoursWrapper.js +12 -3
- package/dist/cjs/components/HoursWrapper/HoursWrapper.js.map +1 -1
- package/dist/cjs/components/Icons/collection/ClockStopwatchIndicator.js +48 -0
- package/dist/cjs/components/Icons/collection/ClockStopwatchIndicator.js.map +1 -0
- package/dist/cjs/components/Icons/collection/index.js +7 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/components/EditableContent/EditableContent.d.ts.map +1 -1
- package/dist/esm/components/EditableContent/EditableContent.js +2 -2
- package/dist/esm/components/EditableContent/EditableContent.js.map +1 -1
- package/dist/esm/components/EditableHours/EditableHours.d.ts +1 -1
- package/dist/esm/components/EditableHours/EditableHours.d.ts.map +1 -1
- package/dist/esm/components/EditableHours/EditableHours.js.map +1 -1
- package/dist/esm/components/HoursWrapper/HoursWrapper.d.ts.map +1 -1
- package/dist/esm/components/HoursWrapper/HoursWrapper.js +12 -3
- package/dist/esm/components/HoursWrapper/HoursWrapper.js.map +1 -1
- package/dist/esm/components/Icons/collection/ClockStopwatchIndicator.d.ts +23 -0
- package/dist/esm/components/Icons/collection/ClockStopwatchIndicator.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/ClockStopwatchIndicator.js +41 -0
- package/dist/esm/components/Icons/collection/ClockStopwatchIndicator.js.map +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +1 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/index.js +53 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ var EditableContent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
40
40
|
forwardedAs: "span",
|
|
41
41
|
weight: weight,
|
|
42
42
|
$disabled: disabled
|
|
43
|
-
}, inputProps === null || inputProps === void 0 ? void 0 : inputProps.value), /*#__PURE__*/_react.default.createElement(_Styles.StyledInput, _extends({}, inputProps, {
|
|
43
|
+
}, inputProps === null || inputProps === void 0 ? void 0 : inputProps.value), !disabled ? /*#__PURE__*/_react.default.createElement(_Styles.StyledInput, _extends({}, inputProps, {
|
|
44
44
|
ref: handleRef,
|
|
45
45
|
forwardedAs: "input",
|
|
46
46
|
variant: variant,
|
|
@@ -49,7 +49,7 @@ var EditableContent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
49
49
|
onBlur: handleBlur,
|
|
50
50
|
disabled: disabled,
|
|
51
51
|
"data-form-type": "other"
|
|
52
|
-
})));
|
|
52
|
+
})) : null);
|
|
53
53
|
});
|
|
54
54
|
exports.EditableContent = EditableContent;
|
|
55
55
|
EditableContent.displayName = "EditableContent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableContent.js","names":["EditableContent","forwardRef","ref","className","variant","weight","disabled","inputProps","wrapRef","props","intInputRef","useRef","handleRef","useForkRef","handleBlur","useCallback","evt","current","scrollLeft","onBlur","value","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef } from \"react\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n return (\n <StyledDiv className={className} ref={wrapRef} {...props}>\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n >\n {inputProps?.value}\n </StyledSpan>\n <StyledInput\n
|
|
1
|
+
{"version":3,"file":"EditableContent.js","names":["EditableContent","forwardRef","ref","className","variant","weight","disabled","inputProps","wrapRef","props","intInputRef","useRef","handleRef","useForkRef","handleBlur","useCallback","evt","current","scrollLeft","onBlur","value","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef } from \"react\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n return (\n <StyledDiv className={className} ref={wrapRef} {...props}>\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n >\n {inputProps?.value}\n </StyledSpan>\n {!disabled ? (\n <StyledInput\n {...inputProps}\n ref={handleRef}\n forwardedAs=\"input\"\n variant={variant}\n weight={weight}\n value={inputProps?.value}\n onBlur={handleBlur}\n disabled={disabled}\n data-form-type=\"other\"\n />\n ) : null}\n </StyledDiv>\n );\n }\n);\n\nEditableContent.displayName = \"EditableContent\";\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AAA8D;AAAA;AAAA;AAAA;AAAA;AAAA;AAevD,IAAMA,eAAe,gBAAG,IAAAC,iBAAU,EAKvC,gBAUEC,GAAG,EACA;EAAA,IATDC,SAAS,QAATA,SAAS;IAAA,oBACTC,OAAO;IAAPA,OAAO,6BAAG,QAAQ;IAClBC,MAAM,QAANA,MAAM;IAAA,qBACNC,QAAQ;IAARA,QAAQ,8BAAG,KAAK;IAChBC,UAAU,QAAVA,UAAU;IACVC,OAAO,QAAPA,OAAO;IACJC,KAAK;EAIV,IAAMC,WAAW,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAClD,IAAMC,SAAS,GAAG,IAAAC,iBAAU,EAACX,GAAG,EAAEQ,WAAW,CAAC;EAE9C,IAAMI,UAAU,GAAG,IAAAC,kBAAW,EAC5B,UAACC,GAAG,EAAK;IACP,IAAIN,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEO,OAAO,EAAE;MACxBP,WAAW,CAACO,OAAO,CAACC,UAAU,GAAG,CAAC;IACpC;IACA,QAAOX,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEY,MAAM,gBAAe,KAAIZ,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEY,MAAM,CAACH,GAAG,CAAC;EACrE,CAAC,EACD,CAACT,UAAU,CAAC,CACb;EAED,oBACE,6BAAC,iBAAS;IAAC,SAAS,EAAEJ,SAAU;IAAC,GAAG,EAAEK;EAAQ,GAAKC,KAAK,gBACtD,6BAAC,kBAAU;IACT,OAAO,EAAEL,OAAQ;IACjB,WAAW,EAAC,MAAM;IAClB,MAAM,EAAEC,MAAO;IACf,SAAS,EAAEC;EAAS,GAEnBC,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEa,KAAK,CACP,EACZ,CAACd,QAAQ,gBACR,6BAAC,mBAAW,eACNC,UAAU;IACd,GAAG,EAAEK,SAAU;IACf,WAAW,EAAC,OAAO;IACnB,OAAO,EAAER,OAAQ;IACjB,MAAM,EAAEC,MAAO;IACf,KAAK,EAAEE,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEa,KAAM;IACzB,MAAM,EAAEN,UAAW;IACnB,QAAQ,EAAER,QAAS;IACnB,kBAAe;EAAO,GACtB,GACA,IAAI,CACE;AAEhB,CAAC,CACF;AAAC;AAEFN,eAAe,CAACqB,WAAW,GAAG,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableHours.js","names":["EditableHours","React","forwardRef","ref","value","onCancel","onSave","allowEmptyValue","withLeadingZero","validation","validateTimeInput","incrementOnlySelected","minuteIncrement","className","inputProps","rest","inputRef","useRef","handleRef","useForkRef","type","classNames","displayName"],"sources":["../../../../src/components/EditableHours/EditableHours.tsx"],"sourcesContent":["import { EditableContent, EditableContentInterface } from \"../EditableContent\";\nimport React, { useRef } from \"react\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport classNames from \"classnames\";\nimport { validateTimeInput } from \"../../utils\";\nimport { HoursWrapper } from \"../HoursWrapper\";\n\nexport interface EditableHoursProps extends EditableContentInterface {\n value?: number | string;\n onSave?: (e: Event) => void;\n onCancel?: () => void;\n onEnterKeyPress?: () => void;\n withLeadingZero?: boolean;\n incrementOnlySelected?: boolean;\n validation?: (value: string, withLeadingZero: boolean) => boolean;\n allowEmptyValue?: boolean;\n minuteIncrement?: number;\n className?: string;\n}\nexport const EditableHours = React.forwardRef<\n HTMLDivElement,\n EditableHoursProps\n>(\n (\n {\n value,\n onCancel,\n onSave,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n className,\n inputProps,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n\n return (\n <HoursWrapper\n value={value}\n onCancel={onCancel}\n onSave={onSave}\n incrementOnlySelected={incrementOnlySelected}\n minuteIncrement={minuteIncrement}\n allowEmptyValue={allowEmptyValue}\n withLeadingZero={withLeadingZero}\n validation={validation}\n >\n <EditableContent\n ref={handleRef}\n inputProps={{\n ...inputProps,\n type: \"text\",\n className: classNames(\"c-input\", className),\n }}\n {...rest}\n />\n </HoursWrapper>\n );\n }\n);\n\nEditableHours.displayName = \"EditableHours\";\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAA+C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcxC,IAAMA,aAAa,gBAAGC,cAAK,CAACC,UAAU,CAI3C,gBAcEC,GAAG,EACA;EAAA,IAbDC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,MAAM,QAANA,MAAM;IACNC,eAAe,QAAfA,eAAe;IAAA,4BACfC,eAAe;IAAfA,eAAe,qCAAG,IAAI;IAAA,uBACtBC,UAAU;IAAVA,UAAU,gCAAGC,wBAAiB;IAAA,6BAC9BC,qBAAqB;IAArBA,qBAAqB,sCAAG,KAAK;IAAA,4BAC7BC,eAAe;IAAfA,eAAe,qCAAG,CAAC;IACnBC,SAAS,QAATA,SAAS;IACTC,UAAU,QAAVA,UAAU;IACPC,IAAI;EAIT,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAC/C,IAAMC,SAAS,GAAG,IAAAC,mBAAU,EAAChB,GAAG,EAAEa,QAAQ,CAAC;EAE3C,oBACE,6BAAC,0BAAY;IACX,KAAK,EAAEZ,KAAM;IACb,QAAQ,EAAEC,QAAS;IACnB,MAAM,EAAEC,MAAO;IACf,qBAAqB,EAAEK,qBAAsB;IAC7C,eAAe,EAAEC,eAAgB;IACjC,eAAe,EAAEL,eAAgB;IACjC,eAAe,EAAEC,eAAgB;IACjC,UAAU,EAAEC;EAAW,gBAEvB,6BAAC,gCAAe;IACd,GAAG,EAAES,SAAU;IACf,UAAU,kCACLJ,UAAU;MACbM,IAAI,EAAE,MAAM;MACZP,SAAS,EAAE,IAAAQ,mBAAU,EAAC,SAAS,EAAER,SAAS;IAAC;EAC3C,GACEE,IAAI,EACR,CACW;AAEnB,CAAC,CACF;AAAC;AAEFf,aAAa,CAACsB,WAAW,GAAG,eAAe"}
|
|
1
|
+
{"version":3,"file":"EditableHours.js","names":["EditableHours","React","forwardRef","ref","value","onCancel","onSave","allowEmptyValue","withLeadingZero","validation","validateTimeInput","incrementOnlySelected","minuteIncrement","className","inputProps","rest","inputRef","useRef","handleRef","useForkRef","type","classNames","displayName"],"sources":["../../../../src/components/EditableHours/EditableHours.tsx"],"sourcesContent":["import { EditableContent, EditableContentInterface } from \"../EditableContent\";\nimport React, { useRef } from \"react\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport classNames from \"classnames\";\nimport { validateTimeInput } from \"../../utils\";\nimport { HoursWrapper } from \"../HoursWrapper\";\n\nexport interface EditableHoursProps extends EditableContentInterface {\n value?: number | string;\n onSave?: (e: Event) => void;\n onCancel?: (e: Event) => void;\n onEnterKeyPress?: () => void;\n withLeadingZero?: boolean;\n incrementOnlySelected?: boolean;\n validation?: (value: string, withLeadingZero: boolean) => boolean;\n allowEmptyValue?: boolean;\n minuteIncrement?: number;\n className?: string;\n}\nexport const EditableHours = React.forwardRef<\n HTMLDivElement,\n EditableHoursProps\n>(\n (\n {\n value,\n onCancel,\n onSave,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n className,\n inputProps,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n\n return (\n <HoursWrapper\n value={value}\n onCancel={onCancel}\n onSave={onSave}\n incrementOnlySelected={incrementOnlySelected}\n minuteIncrement={minuteIncrement}\n allowEmptyValue={allowEmptyValue}\n withLeadingZero={withLeadingZero}\n validation={validation}\n >\n <EditableContent\n ref={handleRef}\n inputProps={{\n ...inputProps,\n type: \"text\",\n className: classNames(\"c-input\", className),\n }}\n {...rest}\n />\n </HoursWrapper>\n );\n }\n);\n\nEditableHours.displayName = \"EditableHours\";\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAA+C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcxC,IAAMA,aAAa,gBAAGC,cAAK,CAACC,UAAU,CAI3C,gBAcEC,GAAG,EACA;EAAA,IAbDC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,MAAM,QAANA,MAAM;IACNC,eAAe,QAAfA,eAAe;IAAA,4BACfC,eAAe;IAAfA,eAAe,qCAAG,IAAI;IAAA,uBACtBC,UAAU;IAAVA,UAAU,gCAAGC,wBAAiB;IAAA,6BAC9BC,qBAAqB;IAArBA,qBAAqB,sCAAG,KAAK;IAAA,4BAC7BC,eAAe;IAAfA,eAAe,qCAAG,CAAC;IACnBC,SAAS,QAATA,SAAS;IACTC,UAAU,QAAVA,UAAU;IACPC,IAAI;EAIT,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAC/C,IAAMC,SAAS,GAAG,IAAAC,mBAAU,EAAChB,GAAG,EAAEa,QAAQ,CAAC;EAE3C,oBACE,6BAAC,0BAAY;IACX,KAAK,EAAEZ,KAAM;IACb,QAAQ,EAAEC,QAAS;IACnB,MAAM,EAAEC,MAAO;IACf,qBAAqB,EAAEK,qBAAsB;IAC7C,eAAe,EAAEC,eAAgB;IACjC,eAAe,EAAEL,eAAgB;IACjC,eAAe,EAAEC,eAAgB;IACjC,UAAU,EAAEC;EAAW,gBAEvB,6BAAC,gCAAe;IACd,GAAG,EAAES,SAAU;IACf,UAAU,kCACLJ,UAAU;MACbM,IAAI,EAAE,MAAM;MACZP,SAAS,EAAE,IAAAQ,mBAAU,EAAC,SAAS,EAAER,SAAS;IAAC;EAC3C,GACEE,IAAI,EACR,CACW;AAEnB,CAAC,CACF;AAAC;AAEFf,aAAa,CAACsB,WAAW,GAAG,eAAe"}
|
|
@@ -73,10 +73,19 @@ var HoursWrapper = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
73
73
|
setCurrentValue(_value);
|
|
74
74
|
typeof onSave === "function" && onSave(e);
|
|
75
75
|
} else {
|
|
76
|
-
!allowEmptyValue
|
|
76
|
+
if (!allowEmptyValue) {
|
|
77
|
+
setCurrentValue(prevValue);
|
|
78
|
+
typeof onCancel === "function" && onCancel(e);
|
|
79
|
+
} else {
|
|
80
|
+
if (typeof onSave === "function" && prevValue !== e.target.value) {
|
|
81
|
+
onSave(e);
|
|
82
|
+
} else {
|
|
83
|
+
typeof onCancel === "function" && onCancel(e);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
}
|
|
79
|
-
}, [allowEmptyValue, onSave, prevValue, withLeadingZero]);
|
|
88
|
+
}, [allowEmptyValue, onCancel, onSave, prevValue, withLeadingZero]);
|
|
80
89
|
var handleIncrementDecrement = (0, _react.useCallback)(function (increment) {
|
|
81
90
|
if (inputRef.current) {
|
|
82
91
|
var selectionStart = inputRef.current.selectionStart;
|
|
@@ -148,7 +157,7 @@ var HoursWrapper = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
148
157
|
if (e.key === "Escape") {
|
|
149
158
|
escapeRef.current = true;
|
|
150
159
|
e.target.blur();
|
|
151
|
-
typeof onCancel === "function" && onCancel();
|
|
160
|
+
typeof onCancel === "function" && onCancel(e);
|
|
152
161
|
escapeRef.current = false;
|
|
153
162
|
}
|
|
154
163
|
if (e.key === "Backspace") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoursWrapper.js","names":["HoursWrapper","React","forwardRef","ref","children","value","onCancel","onSave","onEnterKeyPress","allowEmptyValue","withLeadingZero","validation","validateTimeInput","incrementOnlySelected","minuteIncrement","inputRef","useRef","handleRef","useForkRef","useState","decimalToHours","currentValue","setCurrentValue","prevValue","setPrevValue","escapeRef","useEffect","_value","undefined","handleBlur","useCallback","e","current","target","trim","length","handleIncrementDecrement","increment","selectionStart","dotsIndex","indexOf","split","map","Number","hours","minutes","newHours","newMinutes","newMinutesString","newHoursString","newValue","requestAnimationFrame","newDotsIndex","isHoursSelected","newSelectionStart","selectionEnd","setSelectionRange","handleKeyDown","key","blur","metaKey","ctrlKey","select","input","start","end","shiftKey","isMinutesSelected","preventDefault","substring","handleChange","handleClick","handleDoubleClick","inputProps","onBlur","onKeyDown","onChange","onClick","onDoubleClick","console","error","Children","child","el","type","EditableContent","cloneElement","displayName"],"sources":["../../../../src/components/HoursWrapper/HoursWrapper.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { decimalToHours } from \"../../utils/timeUtils\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { validateTimeInput } from \"../../utils\";\nimport { InputHoursProps } from \"../Input/InputHours\";\nimport { EditableContent } from \"../EditableContent\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface HoursWrapperProps extends InputHoursProps {}\n\nexport const HoursWrapper = React.forwardRef<\n HTMLInputElement,\n PropsWithChildren<HoursWrapperProps>\n>(\n (\n {\n children,\n value,\n onCancel,\n onSave,\n onEnterKeyPress,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n const [currentValue, setCurrentValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const [prevValue, setPrevValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const escapeRef = useRef(false);\n\n useEffect(() => {\n let _value;\n if (value !== undefined) {\n _value = decimalToHours(value, withLeadingZero);\n }\n if (currentValue !== _value) {\n setCurrentValue(_value);\n setPrevValue(_value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n const handleBlur = useCallback(\n (e) => {\n if (escapeRef.current) {\n setCurrentValue(prevValue);\n } else {\n if (\n e.target.value.trim().length > 0 &&\n prevValue !== e.target.value\n ) {\n const _value = decimalToHours(e.target.value, withLeadingZero);\n setPrevValue(_value);\n setCurrentValue(_value);\n typeof onSave === \"function\" && onSave(e);\n } else {\n !allowEmptyValue\n ? setCurrentValue(prevValue)\n : typeof onSave === \"function\" &&\n prevValue !== e.target.value &&\n onSave(e);\n }\n }\n },\n [allowEmptyValue, onSave, prevValue, withLeadingZero]\n );\n\n const handleIncrementDecrement = useCallback(\n (increment: boolean) => {\n if (inputRef.current) {\n const selectionStart = inputRef.current.selectionStart;\n if (selectionStart !== null) {\n const dotsIndex = currentValue.indexOf(\":\");\n const [hours, minutes] = currentValue.split(\":\").map(Number);\n let newHours = hours;\n let newMinutes = minutes;\n\n if (selectionStart < dotsIndex) {\n if (increment) {\n newHours += 1;\n } else {\n newHours -= 1;\n if (newHours < 0) newHours = 0;\n }\n } else if (selectionStart > dotsIndex) {\n if (increment) {\n newMinutes += minuteIncrement;\n if (newMinutes > 59) {\n newMinutes = 0;\n if (!incrementOnlySelected) newHours += 1;\n }\n } else {\n if (newMinutes >= minuteIncrement || newMinutes === 0) {\n newMinutes -= minuteIncrement;\n if (newMinutes < 0 && newHours > 0) {\n newMinutes = 60 - minuteIncrement;\n if (!incrementOnlySelected) newHours -= 1;\n }\n if (newHours < 0) {\n newHours = 0;\n }\n } else {\n newMinutes = 0;\n }\n }\n }\n\n const newMinutesString =\n newMinutes < 10 ? `0${newMinutes}` : newMinutes;\n const newHoursString =\n withLeadingZero && newHours < 10 ? `0${newHours}` : newHours;\n const newValue = `${newHoursString}:${newMinutesString}`;\n\n if (validation(newValue, withLeadingZero)) {\n setCurrentValue(newValue);\n\n requestAnimationFrame(() => {\n const newDotsIndex = newValue.indexOf(\":\");\n const isHoursSelected = selectionStart < newDotsIndex;\n const newSelectionStart = isHoursSelected\n ? 0\n : newDotsIndex + 1;\n const selectionEnd = isHoursSelected\n ? newDotsIndex\n : newValue.length;\n inputRef.current?.setSelectionRange(\n newSelectionStart,\n selectionEnd\n );\n });\n }\n }\n }\n },\n [\n currentValue,\n incrementOnlySelected,\n minuteIncrement,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleKeyDown = useCallback(\n (e) => {\n if (e.key === \"Enter\") {\n e.target.blur();\n onEnterKeyPress && onEnterKeyPress();\n }\n if (e.key === \"ArrowLeft\") {\n return;\n }\n if (e.key === \"ArrowRight\") {\n return;\n }\n if (e.key === \"Escape\") {\n escapeRef.current = true;\n e.target.blur();\n typeof onCancel === \"function\" && onCancel();\n escapeRef.current = false;\n }\n if (e.key === \"Backspace\") {\n return;\n }\n if ((e.metaKey || e.ctrlKey) && e.key === \"a\") {\n inputRef.current?.select();\n return;\n }\n const input = e.target;\n const start = input.selectionStart;\n const end = input.selectionEnd;\n const currentValue = input.value;\n if (e.key === \"Tab\") {\n if (start !== end) {\n if (e.shiftKey) {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isMinutesSelected = start > newDotsIndex;\n if (isMinutesSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(0, newDotsIndex);\n }\n } else {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isHoursSelected = start < newDotsIndex;\n if (isHoursSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(\n newDotsIndex + 1,\n currentValue.length\n );\n }\n }\n }\n return;\n }\n\n if (start !== end) {\n if (e.key === \"ArrowUp\") {\n handleIncrementDecrement(true);\n return;\n }\n if (e.key === \"ArrowDown\") {\n handleIncrementDecrement(false);\n return;\n }\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n } else {\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n }\n },\n [\n handleIncrementDecrement,\n onCancel,\n onEnterKeyPress,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleChange = useCallback((e) => {\n setCurrentValue(e.target.value);\n }, []);\n\n const handleClick = () => {\n const selectionStart = inputRef.current?.selectionStart;\n if (\n inputRef.current &&\n currentValue &&\n currentValue.length > 0 &&\n typeof selectionStart === \"number\"\n ) {\n const dotsIndex = currentValue.indexOf(\":\");\n if (selectionStart < dotsIndex) {\n inputRef.current?.setSelectionRange(0, dotsIndex);\n } else if (selectionStart >= dotsIndex) {\n inputRef.current?.setSelectionRange(\n dotsIndex + 1,\n currentValue.length\n );\n }\n }\n };\n\n const handleDoubleClick = () => {\n if (inputRef.current) {\n inputRef.current?.select();\n }\n };\n\n const inputProps = {\n value: currentValue,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onChange: handleChange,\n onClick: handleClick,\n onDoubleClick: handleDoubleClick,\n onEnterKeyPress: onEnterKeyPress,\n };\n\n if (!children) {\n console.error(\"No children provided!\");\n return null;\n }\n\n return (\n <>\n {React.Children.map(children, (child) => {\n const el = child as React.ReactElement;\n if (el && el.type === EditableContent) {\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n inputProps: inputProps,\n });\n }\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n ...inputProps,\n });\n })}\n </>\n );\n }\n);\n\nHoursWrapper.displayName = \"HoursWrapper\";\n"],"mappings":";;;;;;;AAAA;AAOA;AACA;AACA;AAEA;AAAqD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAK9C,IAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAI1C,gBAaEC,GAAG,EACA;EAAA,IAZDC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,MAAM,QAANA,MAAM;IACNC,eAAe,QAAfA,eAAe;IACfC,eAAe,QAAfA,eAAe;IAAA,4BACfC,eAAe;IAAfA,eAAe,qCAAG,IAAI;IAAA,uBACtBC,UAAU;IAAVA,UAAU,gCAAGC,wBAAiB;IAAA,6BAC9BC,qBAAqB;IAArBA,qBAAqB,sCAAG,KAAK;IAAA,4BAC7BC,eAAe;IAAfA,eAAe,qCAAG,CAAC;EAIrB,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAC/C,IAAMC,SAAS,GAAG,IAAAC,mBAAU,EAACf,GAAG,EAAEY,QAAQ,CAAC;EAC3C,gBAAwC,IAAAI,eAAQ,EAAC;MAAA,OAC/C,IAAAC,yBAAc,EAACf,KAAK,EAAEK,eAAe,CAAC;IAAA,EACvC;IAAA;IAFMW,YAAY;IAAEC,eAAe;EAGpC,iBAAkC,IAAAH,eAAQ,EAAC;MAAA,OACzC,IAAAC,yBAAc,EAACf,KAAK,EAAEK,eAAe,CAAC;IAAA,EACvC;IAAA;IAFMa,SAAS;IAAEC,YAAY;EAG9B,IAAMC,SAAS,GAAG,IAAAT,aAAM,EAAC,KAAK,C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e,EAAE;MACrC,oBAAOpF,cAAK,CAACqF,YAAY,CAACJ,KAAK,EAAwB;QACrD/E,GAAG,EAAEc,SAAS;QACdwD,UAAU,EAAEA;MACd,CAAC,CAAC;IACJ;IACA,oBAAOxE,cAAK,CAACqF,YAAY,CAACJ,KAAK;MAC7B/E,GAAG,EAAEc;IAAS,GACXwD,UAAU,EACb;EACJ,CAAC,CAAC,CACD;AAEP,CAAC,CACF;AAAC;AAEFzE,YAAY,CAACuF,WAAW,GAAG,cAAc"}
|
|
1
|
+
{"version":3,"file":"HoursWrapper.js","names":["HoursWrapper","React","forwardRef","ref","children","value","onCancel","onSave","onEnterKeyPress","allowEmptyValue","withLeadingZero","validation","validateTimeInput","incrementOnlySelected","minuteIncrement","inputRef","useRef","handleRef","useForkRef","useState","decimalToHours","currentValue","setCurrentValue","prevValue","setPrevValue","escapeRef","useEffect","_value","undefined","handleBlur","useCallback","e","current","target","trim","length","handleIncrementDecrement","increment","selectionStart","dotsIndex","indexOf","split","map","Number","hours","minutes","newHours","newMinutes","newMinutesString","newHoursString","newValue","requestAnimationFrame","newDotsIndex","isHoursSelected","newSelectionStart","selectionEnd","setSelectionRange","handleKeyDown","key","blur","metaKey","ctrlKey","select","input","start","end","shiftKey","isMinutesSelected","preventDefault","substring","handleChange","handleClick","handleDoubleClick","inputProps","onBlur","onKeyDown","onChange","onClick","onDoubleClick","console","error","Children","child","el","type","EditableContent","cloneElement","displayName"],"sources":["../../../../src/components/HoursWrapper/HoursWrapper.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { decimalToHours } from \"../../utils/timeUtils\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { validateTimeInput } from \"../../utils\";\nimport { InputHoursProps } from \"../Input/InputHours\";\nimport { EditableContent } from \"../EditableContent\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface HoursWrapperProps extends InputHoursProps {}\n\nexport const HoursWrapper = React.forwardRef<\n HTMLInputElement,\n PropsWithChildren<HoursWrapperProps>\n>(\n (\n {\n children,\n value,\n onCancel,\n onSave,\n onEnterKeyPress,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n const [currentValue, setCurrentValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const [prevValue, setPrevValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const escapeRef = useRef(false);\n\n useEffect(() => {\n let _value;\n if (value !== undefined) {\n _value = decimalToHours(value, withLeadingZero);\n }\n if (currentValue !== _value) {\n setCurrentValue(_value);\n setPrevValue(_value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n const handleBlur = useCallback(\n (e) => {\n if (escapeRef.current) {\n setCurrentValue(prevValue);\n } else {\n if (\n e.target.value.trim().length > 0 &&\n prevValue !== e.target.value\n ) {\n const _value = decimalToHours(e.target.value, withLeadingZero);\n setPrevValue(_value);\n setCurrentValue(_value);\n typeof onSave === \"function\" && onSave(e);\n } else {\n if (!allowEmptyValue) {\n setCurrentValue(prevValue);\n typeof onCancel === \"function\" && onCancel(e);\n } else {\n if (\n typeof onSave === \"function\" &&\n prevValue !== e.target.value\n ) {\n onSave(e);\n } else {\n typeof onCancel === \"function\" && onCancel(e);\n }\n }\n }\n }\n },\n [allowEmptyValue, onCancel, onSave, prevValue, withLeadingZero]\n );\n\n const handleIncrementDecrement = useCallback(\n (increment: boolean) => {\n if (inputRef.current) {\n const selectionStart = inputRef.current.selectionStart;\n if (selectionStart !== null) {\n const dotsIndex = currentValue.indexOf(\":\");\n const [hours, minutes] = currentValue.split(\":\").map(Number);\n let newHours = hours;\n let newMinutes = minutes;\n\n if (selectionStart < dotsIndex) {\n if (increment) {\n newHours += 1;\n } else {\n newHours -= 1;\n if (newHours < 0) newHours = 0;\n }\n } else if (selectionStart > dotsIndex) {\n if (increment) {\n newMinutes += minuteIncrement;\n if (newMinutes > 59) {\n newMinutes = 0;\n if (!incrementOnlySelected) newHours += 1;\n }\n } else {\n if (newMinutes >= minuteIncrement || newMinutes === 0) {\n newMinutes -= minuteIncrement;\n if (newMinutes < 0 && newHours > 0) {\n newMinutes = 60 - minuteIncrement;\n if (!incrementOnlySelected) newHours -= 1;\n }\n if (newHours < 0) {\n newHours = 0;\n }\n } else {\n newMinutes = 0;\n }\n }\n }\n\n const newMinutesString =\n newMinutes < 10 ? `0${newMinutes}` : newMinutes;\n const newHoursString =\n withLeadingZero && newHours < 10 ? `0${newHours}` : newHours;\n const newValue = `${newHoursString}:${newMinutesString}`;\n\n if (validation(newValue, withLeadingZero)) {\n setCurrentValue(newValue);\n\n requestAnimationFrame(() => {\n const newDotsIndex = newValue.indexOf(\":\");\n const isHoursSelected = selectionStart < newDotsIndex;\n const newSelectionStart = isHoursSelected\n ? 0\n : newDotsIndex + 1;\n const selectionEnd = isHoursSelected\n ? newDotsIndex\n : newValue.length;\n inputRef.current?.setSelectionRange(\n newSelectionStart,\n selectionEnd\n );\n });\n }\n }\n }\n },\n [\n currentValue,\n incrementOnlySelected,\n minuteIncrement,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleKeyDown = useCallback(\n (e) => {\n if (e.key === \"Enter\") {\n e.target.blur();\n onEnterKeyPress && onEnterKeyPress();\n }\n if (e.key === \"ArrowLeft\") {\n return;\n }\n if (e.key === \"ArrowRight\") {\n return;\n }\n if (e.key === \"Escape\") {\n escapeRef.current = true;\n e.target.blur();\n typeof onCancel === \"function\" && onCancel(e);\n escapeRef.current = false;\n }\n if (e.key === \"Backspace\") {\n return;\n }\n if ((e.metaKey || e.ctrlKey) && e.key === \"a\") {\n inputRef.current?.select();\n return;\n }\n const input = e.target;\n const start = input.selectionStart;\n const end = input.selectionEnd;\n const currentValue = input.value;\n if (e.key === \"Tab\") {\n if (start !== end) {\n if (e.shiftKey) {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isMinutesSelected = start > newDotsIndex;\n if (isMinutesSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(0, newDotsIndex);\n }\n } else {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isHoursSelected = start < newDotsIndex;\n if (isHoursSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(\n newDotsIndex + 1,\n currentValue.length\n );\n }\n }\n }\n return;\n }\n\n if (start !== end) {\n if (e.key === \"ArrowUp\") {\n handleIncrementDecrement(true);\n return;\n }\n if (e.key === \"ArrowDown\") {\n handleIncrementDecrement(false);\n return;\n }\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n } else {\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n }\n },\n [\n handleIncrementDecrement,\n onCancel,\n onEnterKeyPress,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleChange = useCallback((e) => {\n setCurrentValue(e.target.value);\n }, []);\n\n const handleClick = () => {\n const selectionStart = inputRef.current?.selectionStart;\n if (\n inputRef.current &&\n currentValue &&\n currentValue.length > 0 &&\n typeof selectionStart === \"number\"\n ) {\n const dotsIndex = currentValue.indexOf(\":\");\n if (selectionStart < dotsIndex) {\n inputRef.current?.setSelectionRange(0, dotsIndex);\n } else if (selectionStart >= dotsIndex) {\n inputRef.current?.setSelectionRange(\n dotsIndex + 1,\n currentValue.length\n );\n }\n }\n };\n\n const handleDoubleClick = () => {\n if (inputRef.current) {\n inputRef.current?.select();\n }\n };\n\n const inputProps = {\n value: currentValue,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onChange: handleChange,\n onClick: handleClick,\n onDoubleClick: handleDoubleClick,\n onEnterKeyPress: onEnterKeyPress,\n };\n\n if (!children) {\n console.error(\"No children provided!\");\n return null;\n }\n\n return (\n <>\n {React.Children.map(children, (child) => {\n const el = child as React.ReactElement;\n if (el && el.type === EditableContent) {\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n inputProps: inputProps,\n });\n }\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n ...inputProps,\n });\n })}\n </>\n );\n }\n);\n\nHoursWrapper.displayName = \"HoursWrapper\";\n"],"mappings":";;;;;;;AAAA;AAOA;AACA;AACA;AAEA;AAAqD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAK9C,IAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAI1C,gBAaEC,GAAG,EACA;EAAA,IAZDC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,MAAM,QAANA,MAAM;IACNC,eAAe,QAAfA,eAAe;IACfC,eAAe,QAAfA,eAAe;IAAA,4BACfC,eAAe;IAAfA,eAAe,qCAAG,IAAI;IAAA,uBACtBC,UAAU;IAAVA,UAAU,gCAAGC,wBAAiB;IAAA,6BAC9BC,qBAAqB;IAArBA,qBAAqB,sCAAG,KAAK;IAAA,4BAC7BC,eAAe;IAAfA,eAAe,qCAAG,CAAC;EAIrB,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAC/C,IAAMC,SAAS,GAAG,IAAAC,mBAAU,EAACf,GAAG,EAAEY,QAAQ,CAAC;EAC3C,gBAAwC,IAAAI,eAAQ,EAAC;MAAA,OAC/C,IAAAC,yBAAc,EAACf,KAAK,EAAEK,eAAe,CAAC;IAAA,EACvC;IAAA;IAFMW,YAAY;IAAEC,eAAe;EAGpC,iBAAkC,IAAAH,eAAQ,EAAC;MAAA,OACzC,IAAAC,yBAAc,EAACf,KAAK,EAAEK,eAAe,CAAC;IAAA,EACvC;IAAA;IAFMa,SAAS;IAAEC,YAAY;EAG9B,IAAMC,SAAS,GAAG,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E;IACb2E,OAAO,CAACC,KAAK,CAAC,uBAAuB,CAAC;IACtC,OAAO,IAAI;EACb;EAEA,oBACE,4DACG/E,cAAK,CAACgF,QAAQ,CAACvC,GAAG,CAACtC,QAAQ,EAAE,UAAC8E,KAAK,EAAK;IACvC,IAAMC,EAAE,GAAGD,KAA2B;IACtC,IAAIC,EAAE,IAAIA,EAAE,CAACC,IAAI,KAAKC,gCAAe,EAAE;MACrC,oBAAOpF,cAAK,CAACqF,YAAY,CAACJ,KAAK,EAAwB;QACrD/E,GAAG,EAAEc,SAAS;QACdwD,UAAU,EAAEA;MACd,CAAC,CAAC;IACJ;IACA,oBAAOxE,cAAK,CAACqF,YAAY,CAACJ,KAAK;MAC7B/E,GAAG,EAAEc;IAAS,GACXwD,UAAU,EACb;EACJ,CAAC,CAAC,CACD;AAEP,CAAC,CACF;AAAC;AAEFzE,YAAY,CAACuF,WAAW,GAAG,cAAc"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
|
+
/**
|
|
11
|
+
* @component ClockStopwatchIndicatorIcon
|
|
12
|
+
* @description
|
|
13
|
+
*
|
|
14
|
+
* The React Icon component is a visual element that displays an icon to represent a concept, object, or action.
|
|
15
|
+
* The Icon component is
|
|
16
|
+
* customizable, allowing for variations in size, color, and style to fit the needs of the application.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* return (
|
|
21
|
+
* <ClockStopwatchIndicatorIcon className="mr-2" />
|
|
22
|
+
* )
|
|
23
|
+
*
|
|
24
|
+
* @see
|
|
25
|
+
* https://system.activecollab.com/?path=/story/foundation-icons-icons--icons
|
|
26
|
+
* @see
|
|
27
|
+
* https://design.activecollab.com/docs/foundations/icons
|
|
28
|
+
*/
|
|
29
|
+
var ClockStopwatchIndicatorIcon = /*#__PURE__*/_react.default.forwardRef(function (props, svgRef) {
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement("svg", _extends({
|
|
31
|
+
width: 24,
|
|
32
|
+
height: 24,
|
|
33
|
+
viewBox: "0 0 24 24",
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
"data-testid": "ClockStopwatchIndicatorIcon",
|
|
36
|
+
fill: "var(--color-theme-600)",
|
|
37
|
+
focusable: false,
|
|
38
|
+
ref: svgRef
|
|
39
|
+
}, props), /*#__PURE__*/_react.default.createElement("path", {
|
|
40
|
+
fillRule: "evenodd",
|
|
41
|
+
clipRule: "evenodd",
|
|
42
|
+
d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 100 16 8 8 0 000-16zm1 2v7h-2V6h2zM19.586.172l4.242 4.242-1.414 1.414-4.242-4.242L19.586.172z"
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
ClockStopwatchIndicatorIcon.displayName = "ClockStopwatchIndicatorIcon";
|
|
46
|
+
var _default = ClockStopwatchIndicatorIcon;
|
|
47
|
+
exports.default = _default;
|
|
48
|
+
//# sourceMappingURL=ClockStopwatchIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClockStopwatchIndicator.js","names":["ClockStopwatchIndicatorIcon","React","forwardRef","props","svgRef","displayName"],"sources":["../../../../../src/components/Icons/collection/ClockStopwatchIndicator.tsx"],"sourcesContent":["import React from \"react\";\n\n/**\n * @component ClockStopwatchIndicatorIcon\n * @description\n *\n * The React Icon component is a visual element that displays an icon to represent a concept, object, or action.\n * The Icon component is\n * customizable, allowing for variations in size, color, and style to fit the needs of the application.\n *\n *\n * @example\n * return (\n * <ClockStopwatchIndicatorIcon className=\"mr-2\" />\n * )\n *\n * @see\n * https://system.activecollab.com/?path=/story/foundation-icons-icons--icons\n * @see\n * https://design.activecollab.com/docs/foundations/icons\n */\nconst ClockStopwatchIndicatorIcon = React.forwardRef(\n (props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>) => (\n <svg\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"ClockStopwatchIndicatorIcon\"\n fill=\"var(--color-theme-600)\"\n focusable={false}\n ref={svgRef}\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 100 16 8 8 0 000-16zm1 2v7h-2V6h2zM19.586.172l4.242 4.242-1.414 1.414-4.242-4.242L19.586.172z\"\n />\n </svg>\n )\n);\nClockStopwatchIndicatorIcon.displayName = \"ClockStopwatchIndicatorIcon\";\nexport default ClockStopwatchIndicatorIcon;\n"],"mappings":";;;;;;AAAA;AAA0B;AAAA;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,2BAA2B,gBAAGC,cAAK,CAACC,UAAU,CAClD,UAACC,KAAoC,EAAEC,MAAiC;EAAA,oBACtE;IACE,KAAK,EAAE,EAAG;IACV,MAAM,EAAE,EAAG;IACX,OAAO,EAAC,WAAW;IACnB,KAAK,EAAC,4BAA4B;IAClC,eAAY,6BAA6B;IACzC,IAAI,EAAC,wBAAwB;IAC7B,SAAS,EAAE,KAAM;IACjB,GAAG,EAAEA;EAAO,GACRD,KAAK,gBAET;IACE,QAAQ,EAAC,SAAS;IAClB,QAAQ,EAAC,SAAS;IAClB,CAAC,EAAC;EAAkL,EACpL,CACE;AAAA,CACP,CACF;AACDH,2BAA2B,CAACK,WAAW,GAAG,6BAA6B;AAAC,eACzDL,2BAA2B;AAAA"}
|
|
@@ -237,6 +237,12 @@ Object.defineProperty(exports, "ClockStopwatchIcon", {
|
|
|
237
237
|
return _ClockStopwatch.default;
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
|
+
Object.defineProperty(exports, "ClockStopwatchIndicatorIcon", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function get() {
|
|
243
|
+
return _ClockStopwatchIndicator.default;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
240
246
|
Object.defineProperty(exports, "ClockStopwatchSmallIcon", {
|
|
241
247
|
enumerable: true,
|
|
242
248
|
get: function get() {
|
|
@@ -1072,6 +1078,7 @@ var _Checklist = _interopRequireDefault(require("./Checklist"));
|
|
|
1072
1078
|
var _CircleMultiple = _interopRequireDefault(require("./CircleMultiple"));
|
|
1073
1079
|
var _ClockAdd = _interopRequireDefault(require("./ClockAdd"));
|
|
1074
1080
|
var _ClockSmall = _interopRequireDefault(require("./ClockSmall"));
|
|
1081
|
+
var _ClockStopwatchIndicator = _interopRequireDefault(require("./ClockStopwatchIndicator"));
|
|
1075
1082
|
var _ClockStopwatchSmall = _interopRequireDefault(require("./ClockStopwatchSmall"));
|
|
1076
1083
|
var _ClockStopwatch = _interopRequireDefault(require("./ClockStopwatch"));
|
|
1077
1084
|
var _Clock = _interopRequireDefault(require("./Clock"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Icons/collection/index.tsx"],"sourcesContent":["export { default as AccessLogIcon } from \"./AccessLog\";\nexport { default as ActivityIcon } from \"./Activity\";\nexport { default as AddCrossTinyIcon } from \"./AddCrossTiny\";\nexport { default as AddCrossIcon } from \"./AddCross\";\nexport { default as ArchiveIcon } from \"./Archive\";\nexport { default as ArrowBackMobileIcon } from \"./ArrowBackMobile\";\nexport { default as ArrowCollapseMultipleIcon } from \"./ArrowCollapseMultiple\";\nexport { default as ArrowDownLongIcon } from \"./ArrowDownLong\";\nexport { default as ArrowDownIcon } from \"./ArrowDown\";\nexport { default as ArrowExpandeMultipleIcon } from \"./ArrowExpandeMultiple\";\nexport { default as ArrowLeftBoxIcon } from \"./ArrowLeftBox\";\nexport { default as ArrowLeftIcon } from \"./ArrowLeft\";\nexport { default as ArrowRefreshIcon } from \"./ArrowRefresh\";\nexport { default as ArrowRightIcon } from \"./ArrowRight\";\nexport { default as ArrowUpLongIcon } from \"./ArrowUpLong\";\nexport { default as ArrowUpIcon } from \"./ArrowUp\";\nexport { default as AssignIcon } from \"./Assign\";\nexport { default as AttachmentIcon } from \"./Attachment\";\nexport { default as BellOffSmallIcon } from \"./BellOffSmall\";\nexport { default as BellOffIcon } from \"./BellOff\";\nexport { default as BillingIcon } from \"./Billing\";\nexport { default as BudgetAlertIcon } from \"./BudgetAlert\";\nexport { default as CalendarAddXIcon } from \"./CalendarAddX\";\nexport { default as CalendarIcon } from \"./Calendar\";\nexport { default as CancelCrossIcon } from \"./CancelCross\";\nexport { default as CaretLeftIcon } from \"./CaretLeft\";\nexport { default as CaretRightIcon } from \"./CaretRight\";\nexport { default as ChatIcon } from \"./Chat\";\nexport { default as CheckIcon } from \"./Check\";\nexport { default as CheckboxBlankTogglerIcon } from \"./CheckboxBlankToggler\";\nexport { default as CheckboxCircleArrowIcon } from \"./CheckboxCircleArrow\";\nexport { default as CheckboxIcon } from \"./Checkbox\";\nexport { default as ChecklistSmallIcon } from \"./ChecklistSmall\";\nexport { default as ChecklistIcon } from \"./Checklist\";\nexport { default as CircleMultipleIcon } from \"./CircleMultiple\";\nexport { default as ClockAddIcon } from \"./ClockAdd\";\nexport { default as ClockSmallIcon } from \"./ClockSmall\";\nexport { default as ClockStopwatchSmallIcon } from \"./ClockStopwatchSmall\";\nexport { default as ClockStopwatchIcon } from \"./ClockStopwatch\";\nexport { default as ClockIcon } from \"./Clock\";\nexport { default as CloseSmallIcon } from \"./CloseSmall\";\nexport { default as CloseIcon } from \"./Close\";\nexport { default as CollapsIcon } from \"./CollapsIcon\";\nexport { default as CollapseAllIcon } from \"./CollapseAll\";\nexport { default as CollapseExpandSingleIcon } from \"./CollapseExpandSingle\";\nexport { default as CompanyIcon } from \"./Company\";\nexport { default as ComputerIcon } from \"./Computer\";\nexport { default as CopyIcon } from \"./Copy\";\nexport { default as CrownBlankIcon } from \"./CrownBlank\";\nexport { default as CrownSelectedIcon } from \"./CrownSelected\";\nexport { default as DependencySmallIcon } from \"./DependencySmall\";\nexport { default as DependencyIcon } from \"./Dependency\";\nexport { default as DiscussionAddIcon } from \"./DiscussionAdd\";\nexport { default as DiscussionIcon } from \"./Discussion\";\nexport { default as DollarCheckmarkSmallIcon } from \"./DollarCheckmarkSmall\";\nexport { default as DollarCheckmarkIcon } from \"./DollarCheckmark\";\nexport { default as DollarClockSmallIcon } from \"./DollarClockSmall\";\nexport { default as DollarClockIcon } from \"./DollarClock\";\nexport { default as DollarDocumentIcon } from \"./DollarDocument\";\nexport { default as DollarOffSmallIcon } from \"./DollarOffSmall\";\nexport { default as DollarOffIcon } from \"./DollarOff\";\nexport { default as DollarSmallIcon } from \"./DollarSmall\";\nexport { default as DollarIcon } from \"./Dollar\";\nexport { default as DownloadIcon } from \"./Download\";\nexport { default as DriveIcon } from \"./Drive\";\nexport { default as DropboxIcon } from \"./Dropbox\";\nexport { default as DuplicateIcon } from \"./Duplicate\";\nexport { default as EditMultipleIcon } from \"./EditMultiple\";\nexport { default as EditIcon } from \"./Edit\";\nexport { default as EmojiIcon } from \"./Emoji\";\nexport { default as EstimatePlusIcon } from \"./EstimatePlus\";\nexport { default as EstimatesIcon } from \"./Estimates\";\nexport { default as ExpandAllIcon } from \"./ExpandAll\";\nexport { default as ExpenseAddIcon } from \"./ExpenseAdd\";\nexport { default as EyeOffSmallIcon } from \"./EyeOffSmall\";\nexport { default as EyeOffIcon } from \"./EyeOff\";\nexport { default as EyeSmallIcon } from \"./EyeSmall\";\nexport { default as EyeIcon } from \"./Eye\";\nexport { default as FilterIcon } from \"./Filter\";\nexport { default as FolderMoveIcon } from \"./FolderMove\";\nexport { default as FolderOutlineIcon } from \"./FolderOutline\";\nexport { default as GiftIcon } from \"./Gift\";\nexport { default as HashtagIcon } from \"./Hashtag\";\nexport { default as HelpIcon } from \"./Help\";\nexport { default as ImageIcon } from \"./Image\";\nexport { default as InfoSmallIcon } from \"./InfoSmall\";\nexport { default as InfoIcon } from \"./Info\";\nexport { default as InsertLinkIcon } from \"./InsertLink\";\nexport { default as IntegrationsIcon } from \"./Integrations\";\nexport { default as InvoicesIcon } from \"./Invoices\";\nexport { default as LabelsIcon } from \"./Labels\";\nexport { default as LockSmallIcon } from \"./LockSmall\";\nexport { default as LockIcon } from \"./Lock\";\nexport { default as MarkerIcon } from \"./Marker\";\nexport { default as MessageAddIcon } from \"./MessageAdd\";\nexport { default as MessageEmptyIcon } from \"./MessageEmpty\";\nexport { default as MessageSmallIcon } from \"./MessageSmall\";\nexport { default as MessageSolidIcon } from \"./MessageSolid\";\nexport { default as MessageIcon } from \"./Message\";\nexport { default as MinusIcon } from \"./Minus\";\nexport { default as MoveTriggerIcon } from \"./MoveTrigger\";\nexport { default as MoveIcon } from \"./Move\";\nexport { default as MyWorkIcon } from \"./MyWork\";\nexport { default as NoteAddIcon } from \"./NoteAdd\";\nexport { default as NoteIcon } from \"./Note\";\nexport { default as NotebookIcon } from \"./Notebook\";\nexport { default as NotificationBellIcon } from \"./NotificationBell\";\nexport { default as OpenExpandedIcon } from \"./OpenExpanded\";\nexport { default as OpenSheetIcon } from \"./OpenSheet\";\nexport { default as OrderFirstIcon } from \"./OrderFirst\";\nexport { default as PaidSmallIcon } from \"./PaidSmall\";\nexport { default as PauseCircleOutlineIcon } from \"./PauseCircleOutline\";\nexport { default as PauseIcon } from \"./PauseIcon\";\nexport { default as PauseSmallIcon } from \"./PauseSmall\";\nexport { default as PencilSmallIcon } from \"./PencilSmall\";\nexport { default as PencilIcon } from \"./Pencil\";\nexport { default as PendingPaymentSmallIcon } from \"./PendingPaymentSmall\";\nexport { default as PeopleIcon } from \"./People\";\nexport { default as PersonCircleOffIcon } from \"./PersonCircleOff\";\nexport { default as PersonCircleIcon } from \"./PersonCircle\";\nexport { default as PersonPlusIcon } from \"./PersonPlus\";\nexport { default as PersonIcon } from \"./Person\";\nexport { default as PinIcon } from \"./Pin\";\nexport { default as PlayCircleOutlineIcon } from \"./PlayCircleOutline\";\nexport { default as PlayIcon } from \"./PlayIcon\";\nexport { default as PlaySmallIcon } from \"./PlaySmall\";\nexport { default as PriorityLowIcon } from \"./PriorityLow\";\nexport { default as ProjectAddIcon } from \"./ProjectAdd\";\nexport { default as ProjectSearchIcon } from \"./ProjectSearch\";\nexport { default as ProjectStarIcon } from \"./ProjectStar\";\nexport { default as ProjectTemplateAddIcon } from \"./ProjectTemplateAdd\";\nexport { default as ProjectTemplateConvertIcon } from \"./ProjectTemplateConvert\";\nexport { default as ProjectTemplateIcon } from \"./ProjectTemplate\";\nexport { default as ProjectsIcon } from \"./Projects\";\nexport { default as RadioBlankIcon } from \"./RadioBlank\";\nexport { default as RadioButtonIcon } from \"./RadioButton\";\nexport { default as RearangeIcon } from \"./Rearange\";\nexport { default as RearrangeSmallIcon } from \"./RearrangeSmall\";\nexport { default as RecurringCheckmarkSmallIcon } from \"./RecurringCheckmarkSmall\";\nexport { default as RecurringCheckmarkIcon } from \"./RecurringCheckmark\";\nexport { default as RecurringSmallIcon } from \"./RecurringSmall\";\nexport { default as ReportTimeIcon } from \"./ReportTime\";\nexport { default as ReportsIcon } from \"./Reports\";\nexport { default as RocketIcon } from \"./Rocket\";\nexport { default as SearchLargeIcon } from \"./SearchLarge\";\nexport { default as SearchIcon } from \"./Search\";\nexport { default as SendBlankIcon } from \"./SendBlank\";\nexport { default as SendFilledIcon } from \"./SendFilled\";\nexport { default as SettingsIcon } from \"./Settings\";\nexport { default as ShieldIcon } from \"./Shield\";\nexport { default as SortGeneralIcon } from \"./SortGeneral\";\nexport { default as SortIcon } from \"./SortIcon\";\nexport { default as StarOutlineIcon } from \"./StarOutline\";\nexport { default as StarIcon } from \"./Star\";\nexport { default as StopwatchIcon } from \"./Stopwatch\";\nexport { default as SystemSettingsIcon } from \"./SystemSettings\";\nexport { default as TaskAddIcon } from \"./TaskAdd\";\nexport { default as TaskListAddIcon } from \"./TaskListAdd\";\nexport { default as TaskListCompleteIcon } from \"./TaskListComplete\";\nexport { default as TaskListIcon } from \"./TaskList\";\nexport { default as ThumbUpOutlineIcon } from \"./ThumbUpOutline\";\nexport { default as TrashIcon } from \"./Trash\";\nexport { default as TreeDotsIcon } from \"./TreeDots\";\nexport { default as UploadIcon } from \"./Upload\";\nexport { default as ViewGridIcon } from \"./ViewGrid\";\nexport { default as ViewListIcon } from \"./ViewList\";\nexport { default as ViewTimelineIcon } from \"./ViewTimeline\";\nexport { default as VolumeHighIcon } from \"./VolumeHigh\";\nexport { default as WarningTriangleSmallIcon } from \"./WarningTriangleSmall\";\nexport { default as WarningTriangleIcon } from \"./WarningTriangle\";\nexport { default as WarningIcon } from \"./Warning\";\nexport { default as WorkloadIcon } from \"./Workload\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAqD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Icons/collection/index.tsx"],"sourcesContent":["export { default as AccessLogIcon } from \"./AccessLog\";\nexport { default as ActivityIcon } from \"./Activity\";\nexport { default as AddCrossTinyIcon } from \"./AddCrossTiny\";\nexport { default as AddCrossIcon } from \"./AddCross\";\nexport { default as ArchiveIcon } from \"./Archive\";\nexport { default as ArrowBackMobileIcon } from \"./ArrowBackMobile\";\nexport { default as ArrowCollapseMultipleIcon } from \"./ArrowCollapseMultiple\";\nexport { default as ArrowDownLongIcon } from \"./ArrowDownLong\";\nexport { default as ArrowDownIcon } from \"./ArrowDown\";\nexport { default as ArrowExpandeMultipleIcon } from \"./ArrowExpandeMultiple\";\nexport { default as ArrowLeftBoxIcon } from \"./ArrowLeftBox\";\nexport { default as ArrowLeftIcon } from \"./ArrowLeft\";\nexport { default as ArrowRefreshIcon } from \"./ArrowRefresh\";\nexport { default as ArrowRightIcon } from \"./ArrowRight\";\nexport { default as ArrowUpLongIcon } from \"./ArrowUpLong\";\nexport { default as ArrowUpIcon } from \"./ArrowUp\";\nexport { default as AssignIcon } from \"./Assign\";\nexport { default as AttachmentIcon } from \"./Attachment\";\nexport { default as BellOffSmallIcon } from \"./BellOffSmall\";\nexport { default as BellOffIcon } from \"./BellOff\";\nexport { default as BillingIcon } from \"./Billing\";\nexport { default as BudgetAlertIcon } from \"./BudgetAlert\";\nexport { default as CalendarAddXIcon } from \"./CalendarAddX\";\nexport { default as CalendarIcon } from \"./Calendar\";\nexport { default as CancelCrossIcon } from \"./CancelCross\";\nexport { default as CaretLeftIcon } from \"./CaretLeft\";\nexport { default as CaretRightIcon } from \"./CaretRight\";\nexport { default as ChatIcon } from \"./Chat\";\nexport { default as CheckIcon } from \"./Check\";\nexport { default as CheckboxBlankTogglerIcon } from \"./CheckboxBlankToggler\";\nexport { default as CheckboxCircleArrowIcon } from \"./CheckboxCircleArrow\";\nexport { default as CheckboxIcon } from \"./Checkbox\";\nexport { default as ChecklistSmallIcon } from \"./ChecklistSmall\";\nexport { default as ChecklistIcon } from \"./Checklist\";\nexport { default as CircleMultipleIcon } from \"./CircleMultiple\";\nexport { default as ClockAddIcon } from \"./ClockAdd\";\nexport { default as ClockSmallIcon } from \"./ClockSmall\";\nexport { default as ClockStopwatchIndicatorIcon } from \"./ClockStopwatchIndicator\";\nexport { default as ClockStopwatchSmallIcon } from \"./ClockStopwatchSmall\";\nexport { default as ClockStopwatchIcon } from \"./ClockStopwatch\";\nexport { default as ClockIcon } from \"./Clock\";\nexport { default as CloseSmallIcon } from \"./CloseSmall\";\nexport { default as CloseIcon } from \"./Close\";\nexport { default as CollapsIcon } from \"./CollapsIcon\";\nexport { default as CollapseAllIcon } from \"./CollapseAll\";\nexport { default as CollapseExpandSingleIcon } from \"./CollapseExpandSingle\";\nexport { default as CompanyIcon } from \"./Company\";\nexport { default as ComputerIcon } from \"./Computer\";\nexport { default as CopyIcon } from \"./Copy\";\nexport { default as CrownBlankIcon } from \"./CrownBlank\";\nexport { default as CrownSelectedIcon } from \"./CrownSelected\";\nexport { default as DependencySmallIcon } from \"./DependencySmall\";\nexport { default as DependencyIcon } from \"./Dependency\";\nexport { default as DiscussionAddIcon } from \"./DiscussionAdd\";\nexport { default as DiscussionIcon } from \"./Discussion\";\nexport { default as DollarCheckmarkSmallIcon } from \"./DollarCheckmarkSmall\";\nexport { default as DollarCheckmarkIcon } from \"./DollarCheckmark\";\nexport { default as DollarClockSmallIcon } from \"./DollarClockSmall\";\nexport { default as DollarClockIcon } from \"./DollarClock\";\nexport { default as DollarDocumentIcon } from \"./DollarDocument\";\nexport { default as DollarOffSmallIcon } from \"./DollarOffSmall\";\nexport { default as DollarOffIcon } from \"./DollarOff\";\nexport { default as DollarSmallIcon } from \"./DollarSmall\";\nexport { default as DollarIcon } from \"./Dollar\";\nexport { default as DownloadIcon } from \"./Download\";\nexport { default as DriveIcon } from \"./Drive\";\nexport { default as DropboxIcon } from \"./Dropbox\";\nexport { default as DuplicateIcon } from \"./Duplicate\";\nexport { default as EditMultipleIcon } from \"./EditMultiple\";\nexport { default as EditIcon } from \"./Edit\";\nexport { default as EmojiIcon } from \"./Emoji\";\nexport { default as EstimatePlusIcon } from \"./EstimatePlus\";\nexport { default as EstimatesIcon } from \"./Estimates\";\nexport { default as ExpandAllIcon } from \"./ExpandAll\";\nexport { default as ExpenseAddIcon } from \"./ExpenseAdd\";\nexport { default as EyeOffSmallIcon } from \"./EyeOffSmall\";\nexport { default as EyeOffIcon } from \"./EyeOff\";\nexport { default as EyeSmallIcon } from \"./EyeSmall\";\nexport { default as EyeIcon } from \"./Eye\";\nexport { default as FilterIcon } from \"./Filter\";\nexport { default as FolderMoveIcon } from \"./FolderMove\";\nexport { default as FolderOutlineIcon } from \"./FolderOutline\";\nexport { default as GiftIcon } from \"./Gift\";\nexport { default as HashtagIcon } from \"./Hashtag\";\nexport { default as HelpIcon } from \"./Help\";\nexport { default as ImageIcon } from \"./Image\";\nexport { default as InfoSmallIcon } from \"./InfoSmall\";\nexport { default as InfoIcon } from \"./Info\";\nexport { default as InsertLinkIcon } from \"./InsertLink\";\nexport { default as IntegrationsIcon } from \"./Integrations\";\nexport { default as InvoicesIcon } from \"./Invoices\";\nexport { default as LabelsIcon } from \"./Labels\";\nexport { default as LockSmallIcon } from \"./LockSmall\";\nexport { default as LockIcon } from \"./Lock\";\nexport { default as MarkerIcon } from \"./Marker\";\nexport { default as MessageAddIcon } from \"./MessageAdd\";\nexport { default as MessageEmptyIcon } from \"./MessageEmpty\";\nexport { default as MessageSmallIcon } from \"./MessageSmall\";\nexport { default as MessageSolidIcon } from \"./MessageSolid\";\nexport { default as MessageIcon } from \"./Message\";\nexport { default as MinusIcon } from \"./Minus\";\nexport { default as MoveTriggerIcon } from \"./MoveTrigger\";\nexport { default as MoveIcon } from \"./Move\";\nexport { default as MyWorkIcon } from \"./MyWork\";\nexport { default as NoteAddIcon } from \"./NoteAdd\";\nexport { default as NoteIcon } from \"./Note\";\nexport { default as NotebookIcon } from \"./Notebook\";\nexport { default as NotificationBellIcon } from \"./NotificationBell\";\nexport { default as OpenExpandedIcon } from \"./OpenExpanded\";\nexport { default as OpenSheetIcon } from \"./OpenSheet\";\nexport { default as OrderFirstIcon } from \"./OrderFirst\";\nexport { default as PaidSmallIcon } from \"./PaidSmall\";\nexport { default as PauseCircleOutlineIcon } from \"./PauseCircleOutline\";\nexport { default as PauseIcon } from \"./PauseIcon\";\nexport { default as PauseSmallIcon } from \"./PauseSmall\";\nexport { default as PencilSmallIcon } from \"./PencilSmall\";\nexport { default as PencilIcon } from \"./Pencil\";\nexport { default as PendingPaymentSmallIcon } from \"./PendingPaymentSmall\";\nexport { default as PeopleIcon } from \"./People\";\nexport { default as PersonCircleOffIcon } from \"./PersonCircleOff\";\nexport { default as PersonCircleIcon } from \"./PersonCircle\";\nexport { default as PersonPlusIcon } from \"./PersonPlus\";\nexport { default as PersonIcon } from \"./Person\";\nexport { default as PinIcon } from \"./Pin\";\nexport { default as PlayCircleOutlineIcon } from \"./PlayCircleOutline\";\nexport { default as PlayIcon } from \"./PlayIcon\";\nexport { default as PlaySmallIcon } from \"./PlaySmall\";\nexport { default as PriorityLowIcon } from \"./PriorityLow\";\nexport { default as ProjectAddIcon } from \"./ProjectAdd\";\nexport { default as ProjectSearchIcon } from \"./ProjectSearch\";\nexport { default as ProjectStarIcon } from \"./ProjectStar\";\nexport { default as ProjectTemplateAddIcon } from \"./ProjectTemplateAdd\";\nexport { default as ProjectTemplateConvertIcon } from \"./ProjectTemplateConvert\";\nexport { default as ProjectTemplateIcon } from \"./ProjectTemplate\";\nexport { default as ProjectsIcon } from \"./Projects\";\nexport { default as RadioBlankIcon } from \"./RadioBlank\";\nexport { default as RadioButtonIcon } from \"./RadioButton\";\nexport { default as RearangeIcon } from \"./Rearange\";\nexport { default as RearrangeSmallIcon } from \"./RearrangeSmall\";\nexport { default as RecurringCheckmarkSmallIcon } from \"./RecurringCheckmarkSmall\";\nexport { default as RecurringCheckmarkIcon } from \"./RecurringCheckmark\";\nexport { default as RecurringSmallIcon } from \"./RecurringSmall\";\nexport { default as ReportTimeIcon } from \"./ReportTime\";\nexport { default as ReportsIcon } from \"./Reports\";\nexport { default as RocketIcon } from \"./Rocket\";\nexport { default as SearchLargeIcon } from \"./SearchLarge\";\nexport { default as SearchIcon } from \"./Search\";\nexport { default as SendBlankIcon } from \"./SendBlank\";\nexport { default as SendFilledIcon } from \"./SendFilled\";\nexport { default as SettingsIcon } from \"./Settings\";\nexport { default as ShieldIcon } from \"./Shield\";\nexport { default as SortGeneralIcon } from \"./SortGeneral\";\nexport { default as SortIcon } from \"./SortIcon\";\nexport { default as StarOutlineIcon } from \"./StarOutline\";\nexport { default as StarIcon } from \"./Star\";\nexport { default as StopwatchIcon } from \"./Stopwatch\";\nexport { default as SystemSettingsIcon } from \"./SystemSettings\";\nexport { default as TaskAddIcon } from \"./TaskAdd\";\nexport { default as TaskListAddIcon } from \"./TaskListAdd\";\nexport { default as TaskListCompleteIcon } from \"./TaskListComplete\";\nexport { default as TaskListIcon } from \"./TaskList\";\nexport { default as ThumbUpOutlineIcon } from \"./ThumbUpOutline\";\nexport { default as TrashIcon } from \"./Trash\";\nexport { default as TreeDotsIcon } from \"./TreeDots\";\nexport { default as UploadIcon } from \"./Upload\";\nexport { default as ViewGridIcon } from \"./ViewGrid\";\nexport { default as ViewListIcon } from \"./ViewList\";\nexport { default as ViewTimelineIcon } from \"./ViewTimeline\";\nexport { default as VolumeHighIcon } from \"./VolumeHigh\";\nexport { default as WarningTriangleSmallIcon } from \"./WarningTriangleSmall\";\nexport { default as WarningTriangleIcon } from \"./WarningTriangle\";\nexport { default as WarningIcon } from \"./Warning\";\nexport { default as WorkloadIcon } from \"./Workload\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAqD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableContent.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,GAAG,EAAuB,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjD,mBAAmB;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB;IACzB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"EditableContent.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,GAAG,EAAuB,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjD,mBAAmB;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB;IACzB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,yuJAwD3B,CAAC"}
|
|
@@ -30,7 +30,7 @@ export var EditableContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
30
30
|
forwardedAs: "span",
|
|
31
31
|
weight: weight,
|
|
32
32
|
$disabled: disabled
|
|
33
|
-
}, inputProps == null ? void 0 : inputProps.value), /*#__PURE__*/React.createElement(StyledInput, _extends({}, inputProps, {
|
|
33
|
+
}, inputProps == null ? void 0 : inputProps.value), !disabled ? /*#__PURE__*/React.createElement(StyledInput, _extends({}, inputProps, {
|
|
34
34
|
ref: handleRef,
|
|
35
35
|
forwardedAs: "input",
|
|
36
36
|
variant: variant,
|
|
@@ -39,7 +39,7 @@ export var EditableContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
39
39
|
onBlur: handleBlur,
|
|
40
40
|
disabled: disabled,
|
|
41
41
|
"data-form-type": "other"
|
|
42
|
-
})));
|
|
42
|
+
})) : null);
|
|
43
43
|
});
|
|
44
44
|
EditableContent.displayName = "EditableContent";
|
|
45
45
|
//# sourceMappingURL=EditableContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableContent.js","names":["React","forwardRef","useCallback","useRef","useForkRef","StyledDiv","StyledInput","StyledSpan","EditableContent","ref","className","variant","weight","disabled","inputProps","wrapRef","props","intInputRef","handleRef","handleBlur","evt","current","scrollLeft","onBlur","value","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef } from \"react\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n return (\n <StyledDiv className={className} ref={wrapRef} {...props}>\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n >\n {inputProps?.value}\n </StyledSpan>\n <StyledInput\n
|
|
1
|
+
{"version":3,"file":"EditableContent.js","names":["React","forwardRef","useCallback","useRef","useForkRef","StyledDiv","StyledInput","StyledSpan","EditableContent","ref","className","variant","weight","disabled","inputProps","wrapRef","props","intInputRef","handleRef","handleBlur","evt","current","scrollLeft","onBlur","value","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef } from \"react\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n return (\n <StyledDiv className={className} ref={wrapRef} {...props}>\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n >\n {inputProps?.value}\n </StyledSpan>\n {!disabled ? (\n <StyledInput\n {...inputProps}\n ref={handleRef}\n forwardedAs=\"input\"\n variant={variant}\n weight={weight}\n value={inputProps?.value}\n onBlur={handleBlur}\n disabled={disabled}\n data-form-type=\"other\"\n />\n ) : null}\n </StyledDiv>\n );\n }\n);\n\nEditableContent.displayName = \"EditableContent\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAOC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AACnE,SAASC,UAAU,QAAQ,aAAa;AAExC,SAASC,SAAS,EAAEC,WAAW,EAAEC,UAAU,QAAQ,UAAU;AAe7D,OAAO,IAAMC,eAAe,gBAAGP,UAAU,CAKvC,gBAUEQ,GAAG,EACA;EAAA,IATDC,SAAS,QAATA,SAAS;IAAA,oBACTC,OAAO;IAAPA,OAAO,6BAAG,QAAQ;IAClBC,MAAM,QAANA,MAAM;IAAA,qBACNC,QAAQ;IAARA,QAAQ,8BAAG,KAAK;IAChBC,UAAU,QAAVA,UAAU;IACVC,OAAO,QAAPA,OAAO;IACJC,KAAK;EAIV,IAAMC,WAAW,GAAGd,MAAM,CAAmB,IAAI,CAAC;EAClD,IAAMe,SAAS,GAAGd,UAAU,CAACK,GAAG,EAAEQ,WAAW,CAAC;EAE9C,IAAME,UAAU,GAAGjB,WAAW,CAC5B,UAACkB,GAAG,EAAK;IACP,IAAIH,WAAW,YAAXA,WAAW,CAAEI,OAAO,EAAE;MACxBJ,WAAW,CAACI,OAAO,CAACC,UAAU,GAAG,CAAC;IACpC;IACA,QAAOR,UAAU,oBAAVA,UAAU,CAAES,MAAM,gBAAe,KAAIT,UAAU,oBAAVA,UAAU,CAAES,MAAM,CAACH,GAAG,CAAC;EACrE,CAAC,EACD,CAACN,UAAU,CAAC,CACb;EAED,oBACE,oBAAC,SAAS;IAAC,SAAS,EAAEJ,SAAU;IAAC,GAAG,EAAEK;EAAQ,GAAKC,KAAK,gBACtD,oBAAC,UAAU;IACT,OAAO,EAAEL,OAAQ;IACjB,WAAW,EAAC,MAAM;IAClB,MAAM,EAAEC,MAAO;IACf,SAAS,EAAEC;EAAS,GAEnBC,UAAU,oBAAVA,UAAU,CAAEU,KAAK,CACP,EACZ,CAACX,QAAQ,gBACR,oBAAC,WAAW,eACNC,UAAU;IACd,GAAG,EAAEI,SAAU;IACf,WAAW,EAAC,OAAO;IACnB,OAAO,EAAEP,OAAQ;IACjB,MAAM,EAAEC,MAAO;IACf,KAAK,EAAEE,UAAU,oBAAVA,UAAU,CAAEU,KAAM;IACzB,MAAM,EAAEL,UAAW;IACnB,QAAQ,EAAEN,QAAS;IACnB,kBAAe;EAAO,GACtB,GACA,IAAI,CACE;AAEhB,CAAC,CACF;AAEDL,eAAe,CAACiB,WAAW,GAAG,iBAAiB"}
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
export interface EditableHoursProps extends EditableContentInterface {
|
|
4
4
|
value?: number | string;
|
|
5
5
|
onSave?: (e: Event) => void;
|
|
6
|
-
onCancel?: () => void;
|
|
6
|
+
onCancel?: (e: Event) => void;
|
|
7
7
|
onEnterKeyPress?: () => void;
|
|
8
8
|
withLeadingZero?: boolean;
|
|
9
9
|
incrementOnlySelected?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableHours.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableHours/EditableHours.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,MAAM,WAAW,kBAAmB,SAAQ,wBAAwB;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"EditableHours.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableHours/EditableHours.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,MAAM,WAAW,kBAAmB,SAAQ,wBAAwB;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,KAAK,OAAO,CAAC;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,aAAa,2FA8CzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableHours.js","names":["EditableContent","React","useRef","useForkRef","classNames","validateTimeInput","HoursWrapper","EditableHours","forwardRef","ref","value","onCancel","onSave","allowEmptyValue","withLeadingZero","validation","incrementOnlySelected","minuteIncrement","className","inputProps","rest","inputRef","handleRef","type","displayName"],"sources":["../../../../src/components/EditableHours/EditableHours.tsx"],"sourcesContent":["import { EditableContent, EditableContentInterface } from \"../EditableContent\";\nimport React, { useRef } from \"react\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport classNames from \"classnames\";\nimport { validateTimeInput } from \"../../utils\";\nimport { HoursWrapper } from \"../HoursWrapper\";\n\nexport interface EditableHoursProps extends EditableContentInterface {\n value?: number | string;\n onSave?: (e: Event) => void;\n onCancel?: () => void;\n onEnterKeyPress?: () => void;\n withLeadingZero?: boolean;\n incrementOnlySelected?: boolean;\n validation?: (value: string, withLeadingZero: boolean) => boolean;\n allowEmptyValue?: boolean;\n minuteIncrement?: number;\n className?: string;\n}\nexport const EditableHours = React.forwardRef<\n HTMLDivElement,\n EditableHoursProps\n>(\n (\n {\n value,\n onCancel,\n onSave,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n className,\n inputProps,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n\n return (\n <HoursWrapper\n value={value}\n onCancel={onCancel}\n onSave={onSave}\n incrementOnlySelected={incrementOnlySelected}\n minuteIncrement={minuteIncrement}\n allowEmptyValue={allowEmptyValue}\n withLeadingZero={withLeadingZero}\n validation={validation}\n >\n <EditableContent\n ref={handleRef}\n inputProps={{\n ...inputProps,\n type: \"text\",\n className: classNames(\"c-input\", className),\n }}\n {...rest}\n />\n </HoursWrapper>\n );\n }\n);\n\nEditableHours.displayName = \"EditableHours\";\n"],"mappings":";;;AAAA,SAASA,eAAe,QAAkC,oBAAoB;AAC9E,OAAOC,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,YAAY,QAAQ,iBAAiB;AAc9C,OAAO,IAAMC,aAAa,gBAAGN,KAAK,CAACO,UAAU,CAI3C,gBAcEC,GAAG,EACA;EAAA,IAbDC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,MAAM,QAANA,MAAM;IACNC,eAAe,QAAfA,eAAe;IAAA,4BACfC,eAAe;IAAfA,eAAe,qCAAG,IAAI;IAAA,uBACtBC,UAAU;IAAVA,UAAU,gCAAGV,iBAAiB;IAAA,6BAC9BW,qBAAqB;IAArBA,qBAAqB,sCAAG,KAAK;IAAA,4BAC7BC,eAAe;IAAfA,eAAe,qCAAG,CAAC;IACnBC,SAAS,QAATA,SAAS;IACTC,UAAU,QAAVA,UAAU;IACPC,IAAI;EAIT,IAAMC,QAAQ,GAAGnB,MAAM,CAAmB,IAAI,CAAC;EAC/C,IAAMoB,SAAS,GAAGnB,UAAU,CAACM,GAAG,EAAEY,QAAQ,CAAC;EAE3C,oBACE,oBAAC,YAAY;IACX,KAAK,EAAEX,KAAM;IACb,QAAQ,EAAEC,QAAS;IACnB,MAAM,EAAEC,MAAO;IACf,qBAAqB,EAAEI,qBAAsB;IAC7C,eAAe,EAAEC,eAAgB;IACjC,eAAe,EAAEJ,eAAgB;IACjC,eAAe,EAAEC,eAAgB;IACjC,UAAU,EAAEC;EAAW,gBAEvB,oBAAC,eAAe;IACd,GAAG,EAAEO,SAAU;IACf,UAAU,eACLH,UAAU;MACbI,IAAI,EAAE,MAAM;MACZL,SAAS,EAAEd,UAAU,CAAC,SAAS,EAAEc,SAAS;IAAC;EAC3C,GACEE,IAAI,EACR,CACW;AAEnB,CAAC,CACF;AAEDb,aAAa,CAACiB,WAAW,GAAG,eAAe"}
|
|
1
|
+
{"version":3,"file":"EditableHours.js","names":["EditableContent","React","useRef","useForkRef","classNames","validateTimeInput","HoursWrapper","EditableHours","forwardRef","ref","value","onCancel","onSave","allowEmptyValue","withLeadingZero","validation","incrementOnlySelected","minuteIncrement","className","inputProps","rest","inputRef","handleRef","type","displayName"],"sources":["../../../../src/components/EditableHours/EditableHours.tsx"],"sourcesContent":["import { EditableContent, EditableContentInterface } from \"../EditableContent\";\nimport React, { useRef } from \"react\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport classNames from \"classnames\";\nimport { validateTimeInput } from \"../../utils\";\nimport { HoursWrapper } from \"../HoursWrapper\";\n\nexport interface EditableHoursProps extends EditableContentInterface {\n value?: number | string;\n onSave?: (e: Event) => void;\n onCancel?: (e: Event) => void;\n onEnterKeyPress?: () => void;\n withLeadingZero?: boolean;\n incrementOnlySelected?: boolean;\n validation?: (value: string, withLeadingZero: boolean) => boolean;\n allowEmptyValue?: boolean;\n minuteIncrement?: number;\n className?: string;\n}\nexport const EditableHours = React.forwardRef<\n HTMLDivElement,\n EditableHoursProps\n>(\n (\n {\n value,\n onCancel,\n onSave,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n className,\n inputProps,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n\n return (\n <HoursWrapper\n value={value}\n onCancel={onCancel}\n onSave={onSave}\n incrementOnlySelected={incrementOnlySelected}\n minuteIncrement={minuteIncrement}\n allowEmptyValue={allowEmptyValue}\n withLeadingZero={withLeadingZero}\n validation={validation}\n >\n <EditableContent\n ref={handleRef}\n inputProps={{\n ...inputProps,\n type: \"text\",\n className: classNames(\"c-input\", className),\n }}\n {...rest}\n />\n </HoursWrapper>\n );\n }\n);\n\nEditableHours.displayName = \"EditableHours\";\n"],"mappings":";;;AAAA,SAASA,eAAe,QAAkC,oBAAoB;AAC9E,OAAOC,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,YAAY,QAAQ,iBAAiB;AAc9C,OAAO,IAAMC,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C;AAItD,UAAU,iBAAkB,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,YAAY;;
|
|
1
|
+
{"version":3,"file":"HoursWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/HoursWrapper/HoursWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,UAAU,iBAAkB,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,YAAY;;0CAgTxB,CAAC"}
|
|
@@ -56,10 +56,19 @@ export var HoursWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
56
56
|
setCurrentValue(_value);
|
|
57
57
|
typeof onSave === "function" && onSave(e);
|
|
58
58
|
} else {
|
|
59
|
-
!allowEmptyValue
|
|
59
|
+
if (!allowEmptyValue) {
|
|
60
|
+
setCurrentValue(prevValue);
|
|
61
|
+
typeof onCancel === "function" && onCancel(e);
|
|
62
|
+
} else {
|
|
63
|
+
if (typeof onSave === "function" && prevValue !== e.target.value) {
|
|
64
|
+
onSave(e);
|
|
65
|
+
} else {
|
|
66
|
+
typeof onCancel === "function" && onCancel(e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
60
69
|
}
|
|
61
70
|
}
|
|
62
|
-
}, [allowEmptyValue, onSave, prevValue, withLeadingZero]);
|
|
71
|
+
}, [allowEmptyValue, onCancel, onSave, prevValue, withLeadingZero]);
|
|
63
72
|
var handleIncrementDecrement = useCallback(function (increment) {
|
|
64
73
|
if (inputRef.current) {
|
|
65
74
|
var selectionStart = inputRef.current.selectionStart;
|
|
@@ -130,7 +139,7 @@ export var HoursWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
130
139
|
if (e.key === "Escape") {
|
|
131
140
|
escapeRef.current = true;
|
|
132
141
|
e.target.blur();
|
|
133
|
-
typeof onCancel === "function" && onCancel();
|
|
142
|
+
typeof onCancel === "function" && onCancel(e);
|
|
134
143
|
escapeRef.current = false;
|
|
135
144
|
}
|
|
136
145
|
if (e.key === "Backspace") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoursWrapper.js","names":["React","useCallback","useEffect","useRef","useState","decimalToHours","useForkRef","validateTimeInput","EditableContent","HoursWrapper","forwardRef","ref","children","value","onCancel","onSave","onEnterKeyPress","allowEmptyValue","withLeadingZero","validation","incrementOnlySelected","minuteIncrement","inputRef","handleRef","currentValue","setCurrentValue","prevValue","setPrevValue","escapeRef","_value","undefined","handleBlur","e","current","target","trim","length","handleIncrementDecrement","increment","selectionStart","dotsIndex","indexOf","split","map","Number","hours","minutes","newHours","newMinutes","newMinutesString","newHoursString","newValue","requestAnimationFrame","newDotsIndex","isHoursSelected","newSelectionStart","selectionEnd","setSelectionRange","handleKeyDown","key","blur","metaKey","ctrlKey","select","input","start","end","shiftKey","isMinutesSelected","preventDefault","substring","handleChange","handleClick","handleDoubleClick","inputProps","onBlur","onKeyDown","onChange","onClick","onDoubleClick","console","error","Children","child","el","type","cloneElement","displayName"],"sources":["../../../../src/components/HoursWrapper/HoursWrapper.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { decimalToHours } from \"../../utils/timeUtils\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { validateTimeInput } from \"../../utils\";\nimport { InputHoursProps } from \"../Input/InputHours\";\nimport { EditableContent } from \"../EditableContent\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface HoursWrapperProps extends InputHoursProps {}\n\nexport const HoursWrapper = React.forwardRef<\n HTMLInputElement,\n PropsWithChildren<HoursWrapperProps>\n>(\n (\n {\n children,\n value,\n onCancel,\n onSave,\n onEnterKeyPress,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n const [currentValue, setCurrentValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const [prevValue, setPrevValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const escapeRef = useRef(false);\n\n useEffect(() => {\n let _value;\n if (value !== undefined) {\n _value = decimalToHours(value, withLeadingZero);\n }\n if (currentValue !== _value) {\n setCurrentValue(_value);\n setPrevValue(_value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n const handleBlur = useCallback(\n (e) => {\n if (escapeRef.current) {\n setCurrentValue(prevValue);\n } else {\n if (\n e.target.value.trim().length > 0 &&\n prevValue !== e.target.value\n ) {\n const _value = decimalToHours(e.target.value, withLeadingZero);\n setPrevValue(_value);\n setCurrentValue(_value);\n typeof onSave === \"function\" && onSave(e);\n } else {\n !allowEmptyValue\n ? setCurrentValue(prevValue)\n : typeof onSave === \"function\" &&\n prevValue !== e.target.value &&\n onSave(e);\n }\n }\n },\n [allowEmptyValue, onSave, prevValue, withLeadingZero]\n );\n\n const handleIncrementDecrement = useCallback(\n (increment: boolean) => {\n if (inputRef.current) {\n const selectionStart = inputRef.current.selectionStart;\n if (selectionStart !== null) {\n const dotsIndex = currentValue.indexOf(\":\");\n const [hours, minutes] = currentValue.split(\":\").map(Number);\n let newHours = hours;\n let newMinutes = minutes;\n\n if (selectionStart < dotsIndex) {\n if (increment) {\n newHours += 1;\n } else {\n newHours -= 1;\n if (newHours < 0) newHours = 0;\n }\n } else if (selectionStart > dotsIndex) {\n if (increment) {\n newMinutes += minuteIncrement;\n if (newMinutes > 59) {\n newMinutes = 0;\n if (!incrementOnlySelected) newHours += 1;\n }\n } else {\n if (newMinutes >= minuteIncrement || newMinutes === 0) {\n newMinutes -= minuteIncrement;\n if (newMinutes < 0 && newHours > 0) {\n newMinutes = 60 - minuteIncrement;\n if (!incrementOnlySelected) newHours -= 1;\n }\n if (newHours < 0) {\n newHours = 0;\n }\n } else {\n newMinutes = 0;\n }\n }\n }\n\n const newMinutesString =\n newMinutes < 10 ? `0${newMinutes}` : newMinutes;\n const newHoursString =\n withLeadingZero && newHours < 10 ? `0${newHours}` : newHours;\n const newValue = `${newHoursString}:${newMinutesString}`;\n\n if (validation(newValue, withLeadingZero)) {\n setCurrentValue(newValue);\n\n requestAnimationFrame(() => {\n const newDotsIndex = newValue.indexOf(\":\");\n const isHoursSelected = selectionStart < newDotsIndex;\n const newSelectionStart = isHoursSelected\n ? 0\n : newDotsIndex + 1;\n const selectionEnd = isHoursSelected\n ? newDotsIndex\n : newValue.length;\n inputRef.current?.setSelectionRange(\n newSelectionStart,\n selectionEnd\n );\n });\n }\n }\n }\n },\n [\n currentValue,\n incrementOnlySelected,\n minuteIncrement,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleKeyDown = useCallback(\n (e) => {\n if (e.key === \"Enter\") {\n e.target.blur();\n onEnterKeyPress && onEnterKeyPress();\n }\n if (e.key === \"ArrowLeft\") {\n return;\n }\n if (e.key === \"ArrowRight\") {\n return;\n }\n if (e.key === \"Escape\") {\n escapeRef.current = true;\n e.target.blur();\n typeof onCancel === \"function\" && onCancel();\n escapeRef.current = false;\n }\n if (e.key === \"Backspace\") {\n return;\n }\n if ((e.metaKey || e.ctrlKey) && e.key === \"a\") {\n inputRef.current?.select();\n return;\n }\n const input = e.target;\n const start = input.selectionStart;\n const end = input.selectionEnd;\n const currentValue = input.value;\n if (e.key === \"Tab\") {\n if (start !== end) {\n if (e.shiftKey) {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isMinutesSelected = start > newDotsIndex;\n if (isMinutesSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(0, newDotsIndex);\n }\n } else {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isHoursSelected = start < newDotsIndex;\n if (isHoursSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(\n newDotsIndex + 1,\n currentValue.length\n );\n }\n }\n }\n return;\n }\n\n if (start !== end) {\n if (e.key === \"ArrowUp\") {\n handleIncrementDecrement(true);\n return;\n }\n if (e.key === \"ArrowDown\") {\n handleIncrementDecrement(false);\n return;\n }\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n } else {\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n }\n },\n [\n handleIncrementDecrement,\n onCancel,\n onEnterKeyPress,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleChange = useCallback((e) => {\n setCurrentValue(e.target.value);\n }, []);\n\n const handleClick = () => {\n const selectionStart = inputRef.current?.selectionStart;\n if (\n inputRef.current &&\n currentValue &&\n currentValue.length > 0 &&\n typeof selectionStart === \"number\"\n ) {\n const dotsIndex = currentValue.indexOf(\":\");\n if (selectionStart < dotsIndex) {\n inputRef.current?.setSelectionRange(0, dotsIndex);\n } else if (selectionStart >= dotsIndex) {\n inputRef.current?.setSelectionRange(\n dotsIndex + 1,\n currentValue.length\n );\n }\n }\n };\n\n const handleDoubleClick = () => {\n if (inputRef.current) {\n inputRef.current?.select();\n }\n };\n\n const inputProps = {\n value: currentValue,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onChange: handleChange,\n onClick: handleClick,\n onDoubleClick: handleDoubleClick,\n onEnterKeyPress: onEnterKeyPress,\n };\n\n if (!children) {\n console.error(\"No children provided!\");\n return null;\n }\n\n return (\n <>\n {React.Children.map(children, (child) => {\n const el = child as React.ReactElement;\n if (el && el.type === EditableContent) {\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n inputProps: inputProps,\n });\n }\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n ...inputProps,\n });\n })}\n </>\n );\n }\n);\n\nHoursWrapper.displayName = \"HoursWrapper\";\n"],"mappings":";AAAA,OAAOA,KAAK,IAEVC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,Q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CAAC8E,WAAW,GAAG,cAAc"}
|
|
1
|
+
{"version":3,"file":"HoursWrapper.js","names":["React","useCallback","useEffect","useRef","useState","decimalToHours","useForkRef","validateTimeInput","EditableContent","HoursWrapper","forwardRef","ref","children","value","onCancel","onSave","onEnterKeyPress","allowEmptyValue","withLeadingZero","validation","incrementOnlySelected","minuteIncrement","inputRef","handleRef","currentValue","setCurrentValue","prevValue","setPrevValue","escapeRef","_value","undefined","handleBlur","e","current","target","trim","length","handleIncrementDecrement","increment","selectionStart","dotsIndex","indexOf","split","map","Number","hours","minutes","newHours","newMinutes","newMinutesString","newHoursString","newValue","requestAnimationFrame","newDotsIndex","isHoursSelected","newSelectionStart","selectionEnd","setSelectionRange","handleKeyDown","key","blur","metaKey","ctrlKey","select","input","start","end","shiftKey","isMinutesSelected","preventDefault","substring","handleChange","handleClick","handleDoubleClick","inputProps","onBlur","onKeyDown","onChange","onClick","onDoubleClick","console","error","Children","child","el","type","cloneElement","displayName"],"sources":["../../../../src/components/HoursWrapper/HoursWrapper.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { decimalToHours } from \"../../utils/timeUtils\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { validateTimeInput } from \"../../utils\";\nimport { InputHoursProps } from \"../Input/InputHours\";\nimport { EditableContent } from \"../EditableContent\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface HoursWrapperProps extends InputHoursProps {}\n\nexport const HoursWrapper = React.forwardRef<\n HTMLInputElement,\n PropsWithChildren<HoursWrapperProps>\n>(\n (\n {\n children,\n value,\n onCancel,\n onSave,\n onEnterKeyPress,\n allowEmptyValue,\n withLeadingZero = true,\n validation = validateTimeInput,\n incrementOnlySelected = false,\n minuteIncrement = 1,\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, inputRef);\n const [currentValue, setCurrentValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const [prevValue, setPrevValue] = useState(() =>\n decimalToHours(value, withLeadingZero)\n );\n const escapeRef = useRef(false);\n\n useEffect(() => {\n let _value;\n if (value !== undefined) {\n _value = decimalToHours(value, withLeadingZero);\n }\n if (currentValue !== _value) {\n setCurrentValue(_value);\n setPrevValue(_value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n const handleBlur = useCallback(\n (e) => {\n if (escapeRef.current) {\n setCurrentValue(prevValue);\n } else {\n if (\n e.target.value.trim().length > 0 &&\n prevValue !== e.target.value\n ) {\n const _value = decimalToHours(e.target.value, withLeadingZero);\n setPrevValue(_value);\n setCurrentValue(_value);\n typeof onSave === \"function\" && onSave(e);\n } else {\n if (!allowEmptyValue) {\n setCurrentValue(prevValue);\n typeof onCancel === \"function\" && onCancel(e);\n } else {\n if (\n typeof onSave === \"function\" &&\n prevValue !== e.target.value\n ) {\n onSave(e);\n } else {\n typeof onCancel === \"function\" && onCancel(e);\n }\n }\n }\n }\n },\n [allowEmptyValue, onCancel, onSave, prevValue, withLeadingZero]\n );\n\n const handleIncrementDecrement = useCallback(\n (increment: boolean) => {\n if (inputRef.current) {\n const selectionStart = inputRef.current.selectionStart;\n if (selectionStart !== null) {\n const dotsIndex = currentValue.indexOf(\":\");\n const [hours, minutes] = currentValue.split(\":\").map(Number);\n let newHours = hours;\n let newMinutes = minutes;\n\n if (selectionStart < dotsIndex) {\n if (increment) {\n newHours += 1;\n } else {\n newHours -= 1;\n if (newHours < 0) newHours = 0;\n }\n } else if (selectionStart > dotsIndex) {\n if (increment) {\n newMinutes += minuteIncrement;\n if (newMinutes > 59) {\n newMinutes = 0;\n if (!incrementOnlySelected) newHours += 1;\n }\n } else {\n if (newMinutes >= minuteIncrement || newMinutes === 0) {\n newMinutes -= minuteIncrement;\n if (newMinutes < 0 && newHours > 0) {\n newMinutes = 60 - minuteIncrement;\n if (!incrementOnlySelected) newHours -= 1;\n }\n if (newHours < 0) {\n newHours = 0;\n }\n } else {\n newMinutes = 0;\n }\n }\n }\n\n const newMinutesString =\n newMinutes < 10 ? `0${newMinutes}` : newMinutes;\n const newHoursString =\n withLeadingZero && newHours < 10 ? `0${newHours}` : newHours;\n const newValue = `${newHoursString}:${newMinutesString}`;\n\n if (validation(newValue, withLeadingZero)) {\n setCurrentValue(newValue);\n\n requestAnimationFrame(() => {\n const newDotsIndex = newValue.indexOf(\":\");\n const isHoursSelected = selectionStart < newDotsIndex;\n const newSelectionStart = isHoursSelected\n ? 0\n : newDotsIndex + 1;\n const selectionEnd = isHoursSelected\n ? newDotsIndex\n : newValue.length;\n inputRef.current?.setSelectionRange(\n newSelectionStart,\n selectionEnd\n );\n });\n }\n }\n }\n },\n [\n currentValue,\n incrementOnlySelected,\n minuteIncrement,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleKeyDown = useCallback(\n (e) => {\n if (e.key === \"Enter\") {\n e.target.blur();\n onEnterKeyPress && onEnterKeyPress();\n }\n if (e.key === \"ArrowLeft\") {\n return;\n }\n if (e.key === \"ArrowRight\") {\n return;\n }\n if (e.key === \"Escape\") {\n escapeRef.current = true;\n e.target.blur();\n typeof onCancel === \"function\" && onCancel(e);\n escapeRef.current = false;\n }\n if (e.key === \"Backspace\") {\n return;\n }\n if ((e.metaKey || e.ctrlKey) && e.key === \"a\") {\n inputRef.current?.select();\n return;\n }\n const input = e.target;\n const start = input.selectionStart;\n const end = input.selectionEnd;\n const currentValue = input.value;\n if (e.key === \"Tab\") {\n if (start !== end) {\n if (e.shiftKey) {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isMinutesSelected = start > newDotsIndex;\n if (isMinutesSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(0, newDotsIndex);\n }\n } else {\n const newDotsIndex = currentValue.indexOf(\":\");\n const isHoursSelected = start < newDotsIndex;\n if (isHoursSelected) {\n e.preventDefault();\n inputRef.current?.setSelectionRange(\n newDotsIndex + 1,\n currentValue.length\n );\n }\n }\n }\n return;\n }\n\n if (start !== end) {\n if (e.key === \"ArrowUp\") {\n handleIncrementDecrement(true);\n return;\n }\n if (e.key === \"ArrowDown\") {\n handleIncrementDecrement(false);\n return;\n }\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n } else {\n const newValue =\n currentValue.substring(0, start) +\n e.key +\n currentValue.substring(end);\n\n if (!validation(newValue, withLeadingZero)) {\n e.preventDefault();\n return;\n }\n }\n },\n [\n handleIncrementDecrement,\n onCancel,\n onEnterKeyPress,\n validation,\n withLeadingZero,\n ]\n );\n\n const handleChange = useCallback((e) => {\n setCurrentValue(e.target.value);\n }, []);\n\n const handleClick = () => {\n const selectionStart = inputRef.current?.selectionStart;\n if (\n inputRef.current &&\n currentValue &&\n currentValue.length > 0 &&\n typeof selectionStart === \"number\"\n ) {\n const dotsIndex = currentValue.indexOf(\":\");\n if (selectionStart < dotsIndex) {\n inputRef.current?.setSelectionRange(0, dotsIndex);\n } else if (selectionStart >= dotsIndex) {\n inputRef.current?.setSelectionRange(\n dotsIndex + 1,\n currentValue.length\n );\n }\n }\n };\n\n const handleDoubleClick = () => {\n if (inputRef.current) {\n inputRef.current?.select();\n }\n };\n\n const inputProps = {\n value: currentValue,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onChange: handleChange,\n onClick: handleClick,\n onDoubleClick: handleDoubleClick,\n onEnterKeyPress: onEnterKeyPress,\n };\n\n if (!children) {\n console.error(\"No children provided!\");\n return null;\n }\n\n return (\n <>\n {React.Children.map(children, (child) => {\n const el = child as React.ReactElement;\n if (el && el.type === EditableContent) {\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n inputProps: inputProps,\n });\n }\n return React.cloneElement(child as React.ReactElement, {\n ref: handleRef,\n ...inputProps,\n });\n })}\n </>\n );\n }\n);\n\nHoursWrapper.displayName = \"HoursWrapper\";\n"],"mappings":";AAAA,OAAOA,KAAK,IAEVC,WAAW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