d2coreui 23.0.33 → 23.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"durationInput.js","sourceRoot":"","sources":["../../../../components/date/durationInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,EAAE,EAAC,UAAU,EAAiB,MAAM,OAAO,CAAC;AAExD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,kBAAkB,MAAM,8CAA8C,CAAC;AA8C9E,MAAM,iBAAiB,GAAgB;IACnC,EAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;IACzE,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAC;IACxE,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,GAAG,EAAC;IAC7E,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAA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E,CAAC;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAE/D,IAAI,IAAI,EAAE,CAAC;YACP,MAAM,KAAK,GAAe;gBACtB,MAAM,EAAE,CAAC;gBACT,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,IAAI;aAClB,CAAA;YAED,KAAK,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAEzB,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;oBACX,KAAK,CAAC,MAAM,EAAE,CAAC;gBACnB,CAAC;qBAAM,CAAC;oBACJ,MAAM;gBACV,CAAC;YACL,CAAC;YAED,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["import React, {HTMLAttributes, RefObject} from \"react\";\r\nimport MaskedInput from \"d2coreui/components/input/maskedInput\";\r\nimport dayjs, {isDuration, ManipulateType} from \"dayjs\";\r\nimport {Duration} from \"d2core/dayjs/duration\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport {AutoComplete} from \"antd\";\r\nimport DropdownArrow from \"../icons/dropdownArrow\";\r\nimport WithInputNumberCss from \"d2coreui/components/style/withInputNumberCss\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\n\r\ninterface DurationInputProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\r\n mask: string\r\n value: Duration | null\r\n onChange?: (time: Duration | null) => void\r\n predefinedValues?: { key: string, value: string }[]\r\n disabled?: boolean\r\n inputStyle?: React.CSSProperties\r\n autoFocus?: boolean\r\n size?: SizeType;\r\n}\r\n\r\ninterface DurationInputState {\r\n valid: boolean\r\n selectionStart: number | null\r\n selectionEnd: number | null\r\n currentInfo: MaskResult\r\n opened: boolean\r\n value: string\r\n}\r\n\r\ninterface MaskResult {\r\n time?: Duration\r\n info?: InfoEntry\r\n infoFromMask?: EntryValue[]\r\n length: number\r\n}\r\n\r\ninterface InfoEntry {\r\n key: string\r\n min: number\r\n max: number\r\n minLen: number\r\n maxLen: number\r\n mult: number\r\n unit: ManipulateType\r\n}\r\n\r\ninterface EntryValue {\r\n length: number\r\n infoEntry: InfoEntry\r\n value: number\r\n}\r\n\r\nconst DURATION_DATA_MAP: InfoEntry[] = [\r\n {key: \"SSS\", min: 0, max: 999, minLen: 3, maxLen: 3, mult: 1, unit: \"ms\"},\r\n {key: \"s\", min: 0, max: 59, minLen: 1, maxLen: 2, mult: 1000, unit: \"s\"},\r\n {key: \"m\", min: 0, max: 59, minLen: 1, maxLen: 2, mult: 60 * 1000, unit: \"m\"},\r\n {key: \"H\", min: 0, max: 23, minLen: 1, maxLen: 2, mult: 60 * 60 * 1000, unit: \"h\"},\r\n {key: \"D\", min: 0, max: 24854, minLen: 1, maxLen: 5, mult: 24 * 60 * 60 * 1000, unit: \"d\"},\r\n];\r\n\r\nexport const MAX_VALID_DURATION = 24854 * 24 * 60 * 60 * 1000 + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000 + 499;\r\n\r\nexport function parseDuration(value: string, mask: string, cursorPos?: number, maskResult?: MaskResult): Duration | null {\r\n let result: Duration = dayjs.duration(0);\r\n const clearMaskResult = () => {\r\n if (maskResult) {\r\n maskResult.info = undefined;\r\n maskResult.length = 0;\r\n maskResult.infoFromMask = undefined;\r\n maskResult.time = undefined;\r\n }\r\n }\r\n let maskPos: number = 0;\r\n let valPos: number;\r\n\r\n for (valPos = 0; valPos < value.length; valPos++) {\r\n const c: string = value.charAt(valPos);\r\n\r\n if (['D', 'H', 'm', 's', 'S'].includes(mask.charAt(maskPos))) { // je to maska\r\n if (/\\d/.test(c)) {\r\n const entry: EntryValue | undefined = getInfoFromMask(mask, maskPos);\r\n\r\n if (entry) {\r\n let str = c;\r\n\r\n while (/\\d/.test(value.charAt(valPos + 1))) {\r\n valPos++;\r\n str += value.charAt(valPos);\r\n }\r\n\r\n if (str.length !== entry.length) {\r\n clearMaskResult();\r\n return null;\r\n }\r\n\r\n const time: number = parseInt(str);\r\n\r\n result = result.add(dayjs.duration(time, entry.infoEntry.unit));\r\n if (maskResult) {\r\n const item: EntryValue = {\r\n value: time,\r\n length: str.length,\r\n infoEntry: entry.infoEntry,\r\n }\r\n\r\n if (maskResult.infoFromMask) {\r\n maskResult.infoFromMask.push(item);\r\n } else {\r\n maskResult.infoFromMask = [item];\r\n }\r\n }\r\n maskPos += entry.length;\r\n\r\n if (cursorPos !== undefined && maskResult !== undefined && cursorPos >= valPos - str.length + 1 && cursorPos <= valPos + 1) {\r\n maskResult.info = entry.infoEntry;\r\n maskResult.length = str.length;\r\n }\r\n } else {\r\n clearMaskResult();\r\n return null;\r\n }\r\n } else {\r\n // non-numeric character when value expected\r\n clearMaskResult();\r\n return null;\r\n }\r\n } else {\r\n if (c === mask.charAt(maskPos)) {\r\n // skip special characters\r\n maskPos++;\r\n }\r\n }\r\n }\r\n\r\n if (maskPos === mask.length && valPos === value.length && result.asMilliseconds() <= MAX_VALID_DURATION) {\r\n if (maskResult !== undefined) {\r\n maskResult.time = result;\r\n }\r\n return result;\r\n }\r\n\r\n clearMaskResult();\r\n return null;\r\n}\r\n\r\nexport default class DurationInput extends React.Component<DurationInputProps, DurationInputState> {\r\n private inputRef: RefObject<MaskedInput> = React.createRef();\r\n\r\n constructor(props: Readonly<DurationInputProps>) {\r\n super(props);\r\n this.state = {\r\n valid: isDuration(props.value),\r\n selectionStart: null,\r\n selectionEnd: null,\r\n currentInfo: {\r\n info: undefined,\r\n infoFromMask: undefined,\r\n time: undefined,\r\n length: 0\r\n },\r\n opened: false,\r\n value: formatDuration(props.value, props.mask),\r\n };\r\n\r\n this.recalc = this.recalc.bind(this);\r\n this.increment = this.increment.bind(this);\r\n this.decrement = this.decrement.bind(this);\r\n }\r\n\r\n componentDidUpdate(): void {\r\n if (this.inputRef.current !== null) {\r\n this.inputRef.current.input.selectionStart = this.state.selectionStart;\r\n this.inputRef.current.input.selectionEnd = this.state.selectionEnd;\r\n }\r\n\r\n const value: string = formatDuration(this.props.value, this.props.mask);\r\n\r\n if (this.state.value !== value) {\r\n this.setState({\r\n value: value,\r\n valid: isDuration(this.props.value),\r\n });\r\n }\r\n }\r\n\r\n recalc(): void {\r\n if (this.inputRef.current !== null) {\r\n const value: MaskResult = {length: 0};\r\n parseDuration(this.inputRef.current.input.value, this.props.mask, this.inputRef.current.input.selectionStart ?? undefined, value);\r\n this.setState({\r\n currentInfo: value,\r\n selectionStart: this.inputRef.current.input.selectionStart,\r\n selectionEnd: this.inputRef.current.input.selectionEnd,\r\n });\r\n }\r\n }\r\n\r\n increment(): void {\r\n if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, 1)) {\r\n this.props.onChange?.(this.props.value?.add(1, this.state.currentInfo.info.unit) ?? null);\r\n this.setState({selectionEnd: this.state.selectionStart});\r\n }\r\n\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n decrement(): void {\r\n if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, -1)) {\r\n this.props.onChange?.(this.props.value?.subtract(1, this.state.currentInfo.info.unit) ?? null);\r\n this.setState({selectionEnd: this.state.selectionStart});\r\n }\r\n\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n get input() {\r\n return this.inputRef.current?.input;\r\n }\r\n\r\n focus() {\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n render() {\r\n const {mask, value, onChange, style, disabled, predefinedValues, autoFocus, size, className, ...props} = this.props;\r\n const incrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, 1);\r\n const decrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, -1);\r\n\r\n return (\r\n <WithInputNumberCss>\r\n <div style={style} {...props}\r\n className={(className ? className + \" \" : \"\") + (!predefinedValues ? \"ant-input-number ant-input-number-outlined\" : \"\")}\r\n onKeyDown={(event) => {\r\n if (event.code === \"ArrowUp\") { // up\r\n this.increment();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (event.code === \"ArrowDown\") { // down\r\n this.decrement();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }}\r\n >\r\n <AutoComplete\r\n className={this.state.valid ? \"\" : \"invalid\"}\r\n options={this.state.opened ? predefinedValues?.map(v => {\r\n return {value: v.value, label: v.key}\r\n }) : []}\r\n defaultOpen={false}\r\n defaultActiveFirstOption={false}\r\n defaultValue={undefined}\r\n disabled={disabled}\r\n autoFocus={autoFocus}\r\n style={{width: \"100%\", height: \"inherit\"}}\r\n value={this.state.valid ? this.state.value : \"\"}\r\n onSelect={(e) => {\r\n const val: Duration = dayjs.duration(Number(e));\r\n this.setState({\r\n opened: false,\r\n valid: isDuration(val),\r\n value: formatDuration(val, this.props.mask),\r\n });\r\n onChange?.(val === undefined ? null : val);\r\n }}\r\n onBlur={() => {\r\n this.setState({opened: false});\r\n }}>\r\n <MaskedInput mask={this.props.mask.replace(/[a-zA-Z]/g, '1')}\r\n ref={this.inputRef}\r\n style={{\r\n border: predefinedValues ? undefined : \"none\",\r\n ...this.props.inputStyle\r\n }}\r\n size={size}\r\n placeholder={this.props.mask.replace(/[a-zA-Z]/g, '_')}\r\n autoFocus={autoFocus}\r\n onFocus={(event => {\r\n event.target.selectionStart = event.target.selectionEnd = this.state.selectionStart;\r\n })}\r\n suffix={\r\n this.props.predefinedValues !== undefined && this.props.predefinedValues.length > 0 &&\r\n <DropdownArrow opened={this.state.opened}\r\n onClick={() => {\r\n if (!this.props.disabled) {\r\n this.setState({opened: !this.state.opened});\r\n }\r\n }}/>\r\n }\r\n onMouseUp={this.recalc}\r\n onKeyUp={this.recalc}\r\n onChange={(event) => {\r\n const value: MaskResult = {length: 0};\r\n parseDuration(event.target.value, this.props.mask, event.target.selectionStart ?? undefined, value);\r\n onChange?.(value.time === undefined ? null : value.time);\r\n this.setState({\r\n valid: isDuration(value.time),\r\n currentInfo: value,\r\n value: event.target.value,\r\n });\r\n }}\r\n />\r\n </AutoComplete>\r\n {!predefinedValues && !disabled &&\r\n <div className=\"ant-input-number-handler-wrap\">\r\n <span onClick={this.increment} className={`ant-input-number-handler ant-input-number-handler-up ${incrementButtonDisabled ? \"ant-input-number-handler-up-disabled\" : \"\"}`}>\r\n <span className=\"anticon anticon-up ant-input-number-handler-up-inner\">\r\n <svg viewBox=\"64 64 896 896\" focusable=\"false\" data-icon=\"up\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path d=\"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z\"></path>\r\n </svg>\r\n </span>\r\n </span>\r\n <span onClick={this.decrement} className={`ant-input-number-handler ant-input-number-handler-down ${decrementButtonDisabled ? \"ant-input-number-handler-down-disabled\" : \"\"}`}>\r\n <span className=\"anticon anticon-down ant-input-number-handler-down-inner\">\r\n <svg viewBox=\"64 64 896 896\" focusable=\"false\" data-icon=\"down\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\"></path>\r\n </svg>\r\n </span>\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n </WithInputNumberCss>\r\n );\r\n }\r\n}\r\n\r\nfunction checkValue(info: MaskResult, value: Duration | null, offset = 0): boolean {\r\n const currentMillis = value ? value.add(offset, info.info?.unit).asMilliseconds() : 0;\r\n const maxValues = info?.infoFromMask ? info.infoFromMask.map((i) => (i.length !== i.infoEntry.maxLen ? (Math.pow(10, i.length) - 1) : i.infoEntry.max) * i.infoEntry.mult) : [];\r\n const maxMaskedValue = info?.infoFromMask ? maxValues.reduce((p, n) => p + n, 0) : 0;\r\n return !!value && currentMillis >= 0 && currentMillis <= MAX_VALID_DURATION && currentMillis <= maxMaskedValue;\r\n}\r\n\r\nfunction formatDuration(value: Duration | null, mask: string): string {\r\n //@ts-ignore\r\n return (isDuration(value) ? value : dayjs.duration(0)).locale(\"locale.d2000\").format(mask, {\r\n trim: false,\r\n decimalSeparator: LocaleHolder.decimalSeparator,\r\n useGrouping: false,\r\n groupingSeparator: \"\",\r\n userLocale: LocaleHolder.formattingLocale\r\n })\r\n}\r\n\r\nfunction getInfoFromMask(mask: string, fromPos: number): EntryValue | undefined {\r\n if (fromPos < mask.length) {\r\n const ch = mask.charAt(fromPos);\r\n const info = DURATION_DATA_MAP.find((d) => d.key.includes(ch));\r\n\r\n if (info) {\r\n const entry: EntryValue = {\r\n length: 1,\r\n value: 0,\r\n infoEntry: info,\r\n }\r\n\r\n for (let i = fromPos + 1; i < mask.length; i++) {\r\n const c = mask.charAt(i);\r\n\r\n if (c === ch) {\r\n entry.length++;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n return entry;\r\n }\r\n }\r\n\r\n return undefined;\r\n}"]}
1
+ {"version":3,"file":"durationInput.js","sourceRoot":"","sources":["../../../../components/date/durationInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,E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,CAAA;AACN,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,OAAe;IAClD,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAE/D,IAAI,IAAI,EAAE,CAAC;YACP,MAAM,KAAK,GAAe;gBACtB,MAAM,EAAE,CAAC;gBACT,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,IAAI;aAClB,CAAA;YAED,KAAK,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAEzB,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;oBACX,KAAK,CAAC,MAAM,EAAE,CAAC;gBACnB,CAAC;qBAAM,CAAC;oBACJ,MAAM;gBACV,CAAC;YACL,CAAC;YAED,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["import React, {HTMLAttributes, RefObject} from \"react\";\r\nimport MaskedInput from \"d2coreui/components/input/maskedInput\";\r\nimport dayjs, {isDuration, ManipulateType} from \"dayjs\";\r\nimport {Duration} from \"d2core/dayjs/duration\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport {AutoComplete} from \"antd\";\r\nimport DropdownArrow from \"../icons/dropdownArrow\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\nimport WithCss from \"../style/withCss\";\r\nimport {createStyles} from \"antd-style\";\r\n\r\nconst useStyles = createStyles(({token, css}) => {\r\n return {\r\n baseLayout: css`\r\n &.input-number {\r\n display: inline-block;\r\n position: relative;\r\n width: 100%;\r\n height: ${token.controlHeight}px;\r\n padding: 0;\r\n color: ${token.colorText};\r\n font-size: ${token.fontSize}px;\r\n line-height: ${token.lineHeight};\r\n background-color: ${token.colorBgContainer};\r\n border: 1px solid ${token.colorBorder};\r\n border-radius: ${token.borderRadius}px;\r\n transition: all ${token.motionDurationMid};\r\n\r\n &:hover {\r\n border-color: ${token.colorPrimaryHover};\r\n }\r\n\r\n &.disabled {\r\n color: ${token.colorTextDisabled};\r\n background-color: ${token.colorBgContainerDisabled};\r\n border-color: ${token.colorBorder};\r\n cursor: not-allowed;\r\n\r\n &:hover {\r\n border-color: ${token.colorBorder};\r\n }\r\n }\r\n\r\n .handler-wrap {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n width: 22px;\r\n height: 100%;\r\n background: ${token.colorBgContainer};\r\n border-inline-start: ${token.lineWidth}px ${token.lineType} ${token.colorBorder};\r\n border-radius: 0 ${token.borderRadius}px ${token.borderRadius}px 0;\r\n display: flex;\r\n flex-direction: column;\r\n opacity: 0;\r\n transition: opacity ${token.motionDurationMid};\r\n\r\n .number-handler {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n flex: 1;\r\n width: 100%;\r\n height: 50%;\r\n overflow: hidden;\r\n color: ${token.colorTextDescription};\r\n line-height: 1;\r\n user-select: none;\r\n transition: all ${token.motionDurationMid};\r\n cursor: pointer;\r\n border-inline-start: ${token.lineWidth}px ${token.lineType} transparent;\r\n\r\n &:hover:not(&-up-disabled):not(&-down-disabled) {\r\n flex: 1.5; /* This button grows */\r\n color: ${token.colorPrimary};\r\n background: ${token.colorFillAlter};\r\n }\r\n \r\n &:hover {\r\n color: ${token.colorPrimary};\r\n }\r\n\r\n &:active {\r\n background: ${token.colorFillAlter};\r\n }\r\n\r\n .anticon {\r\n display: inline-block;\r\n font-size: 7px;\r\n }\r\n }\r\n\r\n .number-handler-up {\r\n border-top-right-radius: ${token.borderRadius}px;\r\n }\r\n\r\n .number-handler-down {\r\n border-top: ${token.lineWidth}px ${token.lineType} ${token.colorBorder};\r\n border-bottom-right-radius: ${token.borderRadius}px;\r\n }\r\n\r\n .number-handler-up-disabled,\r\n .number-handler-down-disabled {\r\n cursor: not-allowed;\r\n color: ${token.colorTextDisabled};\r\n\r\n &:hover {\r\n color: ${token.colorTextDisabled};\r\n }\r\n }\r\n }\r\n\r\n &:hover .handler-wrap {\r\n opacity: 1;\r\n }\r\n }\r\n `,\r\n\r\n // Specific to the UP handler\r\n handlerUp: css`\r\n border-top-right-radius: ${token.borderRadius}px;\r\n \r\n /* The line between UP and DOWN */\r\n border-bottom: ${token.lineWidth}px ${token.lineType} ${token.colorBorder};\r\n `,\r\n\r\n // Specific to the DOWN handler\r\n handlerDown: css`\r\n border-bottom-right-radius: ${token.borderRadius}px;\r\n `,\r\n\r\n // Icon container\r\n handlerIcon: css`\r\n display: inline-block;\r\n font-style: normal;\r\n line-height: 0;\r\n text-transform: none;\r\n `\r\n }\r\n})\r\n\r\ninterface DurationInputProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\r\n mask: string\r\n value: Duration | null\r\n onChange?: (time: Duration | null) => void\r\n predefinedValues?: { key: string, value: string }[]\r\n disabled?: boolean\r\n inputStyle?: React.CSSProperties\r\n autoFocus?: boolean\r\n size?: SizeType;\r\n}\r\n\r\ninterface DurationInputState {\r\n valid: boolean\r\n selectionStart: number | null\r\n selectionEnd: number | null\r\n currentInfo: MaskResult\r\n opened: boolean\r\n value: string\r\n}\r\n\r\ninterface MaskResult {\r\n time?: Duration\r\n info?: InfoEntry\r\n infoFromMask?: EntryValue[]\r\n length: number\r\n}\r\n\r\ninterface InfoEntry {\r\n key: string\r\n min: number\r\n max: number\r\n minLen: number\r\n maxLen: number\r\n mult: number\r\n unit: ManipulateType\r\n}\r\n\r\ninterface EntryValue {\r\n length: number\r\n infoEntry: InfoEntry\r\n value: number\r\n}\r\n\r\nconst DURATION_DATA_MAP: InfoEntry[] = [\r\n {key: \"SSS\", min: 0, max: 999, minLen: 3, maxLen: 3, mult: 1, unit: \"ms\"},\r\n {key: \"s\", min: 0, max: 59, minLen: 1, maxLen: 2, mult: 1000, unit: \"s\"},\r\n {key: \"m\", min: 0, max: 59, minLen: 1, maxLen: 2, mult: 60 * 1000, unit: \"m\"},\r\n {key: \"H\", min: 0, max: 23, minLen: 1, maxLen: 2, mult: 60 * 60 * 1000, unit: \"h\"},\r\n {key: \"D\", min: 0, max: 24854, minLen: 1, maxLen: 5, mult: 24 * 60 * 60 * 1000, unit: \"d\"},\r\n];\r\n\r\nexport const MAX_VALID_DURATION = 24854 * 24 * 60 * 60 * 1000 + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000 + 499;\r\n\r\nexport function parseDuration(value: string, mask: string, cursorPos?: number, maskResult?: MaskResult): Duration | null {\r\n let result: Duration = dayjs.duration(0);\r\n const clearMaskResult = () => {\r\n if (maskResult) {\r\n maskResult.info = undefined;\r\n maskResult.length = 0;\r\n maskResult.infoFromMask = undefined;\r\n maskResult.time = undefined;\r\n }\r\n }\r\n let maskPos: number = 0;\r\n let valPos: number;\r\n\r\n for (valPos = 0; valPos < value.length; valPos++) {\r\n const c: string = value.charAt(valPos);\r\n\r\n if (['D', 'H', 'm', 's', 'S'].includes(mask.charAt(maskPos))) { // je to maska\r\n if (/\\d/.test(c)) {\r\n const entry: EntryValue | undefined = getInfoFromMask(mask, maskPos);\r\n\r\n if (entry) {\r\n let str = c;\r\n\r\n while (/\\d/.test(value.charAt(valPos + 1))) {\r\n valPos++;\r\n str += value.charAt(valPos);\r\n }\r\n\r\n if (str.length !== entry.length) {\r\n clearMaskResult();\r\n return null;\r\n }\r\n\r\n const time: number = parseInt(str);\r\n\r\n result = result.add(dayjs.duration(time, entry.infoEntry.unit));\r\n if (maskResult) {\r\n const item: EntryValue = {\r\n value: time,\r\n length: str.length,\r\n infoEntry: entry.infoEntry,\r\n }\r\n\r\n if (maskResult.infoFromMask) {\r\n maskResult.infoFromMask.push(item);\r\n } else {\r\n maskResult.infoFromMask = [item];\r\n }\r\n }\r\n maskPos += entry.length;\r\n\r\n if (cursorPos !== undefined && maskResult !== undefined && cursorPos >= valPos - str.length + 1 && cursorPos <= valPos + 1) {\r\n maskResult.info = entry.infoEntry;\r\n maskResult.length = str.length;\r\n }\r\n } else {\r\n clearMaskResult();\r\n return null;\r\n }\r\n } else {\r\n // non-numeric character when value expected\r\n clearMaskResult();\r\n return null;\r\n }\r\n } else {\r\n if (c === mask.charAt(maskPos)) {\r\n // skip special characters\r\n maskPos++;\r\n }\r\n }\r\n }\r\n\r\n if (maskPos === mask.length && valPos === value.length && result.asMilliseconds() <= MAX_VALID_DURATION) {\r\n if (maskResult !== undefined) {\r\n maskResult.time = result;\r\n }\r\n return result;\r\n }\r\n\r\n clearMaskResult();\r\n return null;\r\n}\r\n\r\nexport default class DurationInput extends React.Component<DurationInputProps, DurationInputState> {\r\n private inputRef: RefObject<MaskedInput> = React.createRef();\r\n\r\n constructor(props: Readonly<DurationInputProps>) {\r\n super(props);\r\n this.state = {\r\n valid: isDuration(props.value),\r\n selectionStart: null,\r\n selectionEnd: null,\r\n currentInfo: {\r\n info: undefined,\r\n infoFromMask: undefined,\r\n time: undefined,\r\n length: 0\r\n },\r\n opened: false,\r\n value: formatDuration(props.value, props.mask),\r\n };\r\n\r\n this.recalc = this.recalc.bind(this);\r\n this.increment = this.increment.bind(this);\r\n this.decrement = this.decrement.bind(this);\r\n }\r\n\r\n componentDidUpdate(): void {\r\n if (this.inputRef.current !== null) {\r\n this.inputRef.current.input.selectionStart = this.state.selectionStart;\r\n this.inputRef.current.input.selectionEnd = this.state.selectionEnd;\r\n }\r\n\r\n const value: string = formatDuration(this.props.value, this.props.mask);\r\n\r\n if (this.state.value !== value) {\r\n this.setState({\r\n value: value,\r\n valid: isDuration(this.props.value),\r\n });\r\n }\r\n }\r\n\r\n recalc(): void {\r\n if (this.inputRef.current !== null) {\r\n const value: MaskResult = {length: 0};\r\n parseDuration(this.inputRef.current.input.value, this.props.mask, this.inputRef.current.input.selectionStart ?? undefined, value);\r\n this.setState({\r\n currentInfo: value,\r\n selectionStart: this.inputRef.current.input.selectionStart,\r\n selectionEnd: this.inputRef.current.input.selectionEnd,\r\n });\r\n }\r\n }\r\n\r\n increment(): void {\r\n if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, 1)) {\r\n this.props.onChange?.(this.props.value?.add(1, this.state.currentInfo.info.unit) ?? null);\r\n this.setState({selectionEnd: this.state.selectionStart});\r\n }\r\n\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n decrement(): void {\r\n if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, -1)) {\r\n this.props.onChange?.(this.props.value?.subtract(1, this.state.currentInfo.info.unit) ?? null);\r\n this.setState({selectionEnd: this.state.selectionStart});\r\n }\r\n\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n get input() {\r\n return this.inputRef.current?.input;\r\n }\r\n\r\n focus() {\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n render() {\r\n const {mask, value, onChange, style, disabled, predefinedValues, autoFocus, size, className, ...props} = this.props;\r\n const incrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, 1);\r\n const decrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, -1);\r\n\r\n return (\r\n <WithCss useStyles={useStyles}>\r\n {(context) =>\r\n <div style={style} {...props}\r\n className={(className ? className + \" \" : \"\") + (!predefinedValues ? \"input-number\" : \"\") + \" \" + context.styles.baseLayout + \" \" + (disabled ? \"disabled\" : \"\")}\r\n onKeyDown={(event) => {\r\n if (event.code === \"ArrowUp\") { // up\r\n this.increment();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (event.code === \"ArrowDown\") { // down\r\n this.decrement();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }}\r\n >\r\n <AutoComplete\r\n className={this.state.valid ? \"\" : \"invalid\"}\r\n options={this.state.opened ? predefinedValues?.map(v => {\r\n return {value: v.value, label: v.key}\r\n }) : []}\r\n defaultOpen={false}\r\n defaultActiveFirstOption={false}\r\n defaultValue={undefined}\r\n disabled={disabled}\r\n autoFocus={autoFocus}\r\n style={{width: \"100%\", height: \"inherit\"}}\r\n value={this.state.valid ? this.state.value : \"\"}\r\n onSelect={(e) => {\r\n const val: Duration = dayjs.duration(Number(e));\r\n this.setState({\r\n opened: false,\r\n valid: isDuration(val),\r\n value: formatDuration(val, this.props.mask),\r\n });\r\n onChange?.(val === undefined ? null : val);\r\n }}\r\n onBlur={() => {\r\n this.setState({opened: false});\r\n }}>\r\n <MaskedInput mask={this.props.mask.replace(/[a-zA-Z]/g, '1')}\r\n ref={this.inputRef}\r\n style={{\r\n border: predefinedValues ? undefined : \"none\",\r\n ...this.props.inputStyle\r\n }}\r\n size={size}\r\n placeholder={this.props.mask.replace(/[a-zA-Z]/g, '_')}\r\n autoFocus={autoFocus}\r\n onFocus={(event => {\r\n event.target.selectionStart = event.target.selectionEnd = this.state.selectionStart;\r\n })}\r\n suffix={\r\n this.props.predefinedValues !== undefined && this.props.predefinedValues.length > 0 &&\r\n <DropdownArrow opened={this.state.opened}\r\n onClick={() => {\r\n if (!this.props.disabled) {\r\n this.setState({opened: !this.state.opened});\r\n }\r\n }}/>\r\n }\r\n onMouseUp={this.recalc}\r\n onKeyUp={this.recalc}\r\n onChange={(event) => {\r\n const value: MaskResult = {length: 0};\r\n parseDuration(event.target.value, this.props.mask, event.target.selectionStart ?? undefined, value);\r\n onChange?.(value.time === undefined ? null : value.time);\r\n this.setState({\r\n valid: isDuration(value.time),\r\n currentInfo: value,\r\n value: event.target.value,\r\n });\r\n }}\r\n />\r\n </AutoComplete>\r\n {!predefinedValues && !disabled &&\r\n <div className=\"handler-wrap\">\r\n <span onClick={this.increment}\r\n className={`number-handler number-handler-up ${incrementButtonDisabled ? \"number-handler-up-disabled\" : \"\"}`}>\r\n <span className=\"anticon anticon-up number-handler-up-inner\">\r\n <svg viewBox=\"64 64 896 896\" focusable=\"false\" data-icon=\"up\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path\r\n d=\"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z\"></path>\r\n </svg>\r\n </span>\r\n </span>\r\n <span onClick={this.decrement}\r\n className={`number-handler number-handler-down ${decrementButtonDisabled ? \"number-handler-down-disabled\" : \"\"}`}>\r\n <span className=\"anticon anticon-down number-handler-down-inner\">\r\n <svg viewBox=\"64 64 896 896\" focusable=\"false\" data-icon=\"down\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path\r\n d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\"></path>\r\n </svg>\r\n </span>\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </WithCss>\r\n );\r\n }\r\n}\r\n\r\nfunction checkValue(info: MaskResult, value: Duration | null, offset = 0): boolean {\r\n const currentMillis = value ? value.add(offset, info.info?.unit).asMilliseconds() : 0;\r\n const maxValues = info?.infoFromMask ? info.infoFromMask.map((i) => (i.length !== i.infoEntry.maxLen ? (Math.pow(10, i.length) - 1) : i.infoEntry.max) * i.infoEntry.mult) : [];\r\n const maxMaskedValue = info?.infoFromMask ? maxValues.reduce((p, n) => p + n, 0) : 0;\r\n return !!value && currentMillis >= 0 && currentMillis <= MAX_VALID_DURATION && currentMillis <= maxMaskedValue;\r\n}\r\n\r\nfunction formatDuration(value: Duration | null, mask: string): string {\r\n //@ts-ignore\r\n return (isDuration(value) ? value : dayjs.duration(0)).locale(\"locale.d2000\").format(mask, {\r\n trim: false,\r\n decimalSeparator: LocaleHolder.decimalSeparator,\r\n useGrouping: false,\r\n groupingSeparator: \"\",\r\n userLocale: LocaleHolder.formattingLocale\r\n })\r\n}\r\n\r\nfunction getInfoFromMask(mask: string, fromPos: number): EntryValue | undefined {\r\n if (fromPos < mask.length) {\r\n const ch = mask.charAt(fromPos);\r\n const info = DURATION_DATA_MAP.find((d) => d.key.includes(ch));\r\n\r\n if (info) {\r\n const entry: EntryValue = {\r\n length: 1,\r\n value: 0,\r\n infoEntry: info,\r\n }\r\n\r\n for (let i = fromPos + 1; i < mask.length; i++) {\r\n const c = mask.charAt(i);\r\n\r\n if (c === ch) {\r\n entry.length++;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n return entry;\r\n }\r\n }\r\n\r\n return undefined;\r\n}"]}
@@ -165,6 +165,7 @@ export default class DataGrid extends React.Component<DataGridProps, DataGridSta
165
165
  lastPaginationEvent?: PaginationChangedEvent | null;
166
166
  table_context: any;
167
167
  private wrappingDiv;
168
+ private readonly getTheme;
168
169
  constructor(props: Readonly<DataGridProps>);
169
170
  private static getCellValue;
170
171
  textCustomComparator(filter: string, value: any, filterText: string): boolean;
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import React from "react";
13
13
  import { ColumnWidthOutlined, ControlOutlined, DownloadOutlined, FileSearchOutlined, LoadingOutlined, ReloadOutlined, SearchOutlined, SettingOutlined, TableOutlined } from "@ant-design/icons";
14
- import { Button, Card, Dropdown, Empty, Space } from "antd";
14
+ import { Button, Card, ConfigProvider, Dropdown, Empty, Space, theme } from "antd";
15
15
  import { AgGridReact } from "ag-grid-react";
16
16
  import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
17
17
  import TextColumnFilter from "d2coreui/components/grid/filter/textColumnFilter";
@@ -56,10 +56,16 @@ import DataGridPagination from "./panel/dataGridPagination";
56
56
  import { calculateLineHeight, calculateRowHeight, getFontSize, getLineHeight, getRowHeightDelta, GRID_DEFAULT_FONT_SIZE, GRID_DEFAULT_ROW_HEIGHT_DELTA } from "./config/rowHeightCalculator";
57
57
  import BeanAccessor from "./cell/beanAccessor";
58
58
  import WildcardQuickFilterEngine from "./filter/wildcardQuickFilterEngine";
59
- import { themeBalham } from "ag-grid-community";
60
- const myTheme = themeBalham
61
- .withParams({
62
- selectedRowBackgroundColor: "#b7e4ff",
59
+ import { colorSchemeDark, themeBalham } from "ag-grid-community";
60
+ import WithCss from "../style/withCss";
61
+ import { createStyles } from "antd-style";
62
+ const useStyles = createStyles(({ css }) => {
63
+ return {
64
+ baseLayout: css `
65
+ width: 100%;
66
+ height: 100%;
67
+ `
68
+ };
63
69
  });
64
70
  const gridFrameworkComponents = {
65
71
  customColumnFilter: CustomColumnFilter,
@@ -411,6 +417,7 @@ class DataGrid extends React.Component {
411
417
  },
412
418
  "alignRight": {}
413
419
  };
420
+ this.getTheme = memoizeOne(getAgGridThemeFromAntd);
414
421
  }
415
422
  static getCellValue(props) {
416
423
  if (props) {
@@ -1605,7 +1612,7 @@ class DataGrid extends React.Component {
1605
1612
  }
1606
1613
  const adaptedColumnDefs = columnDefs ? columnDefs.map((columnDef) => {
1607
1614
  var _a, _b, _c, _d;
1608
- const _e = columnDef, { group, floatingFilter, hide, cellEditorPopup, editable } = _e, rest = __rest(_e, ["group", "floatingFilter", "hide", "cellEditorPopup", "editable"]);
1615
+ const _e = columnDef, { group, floatingFilter, hide, cellEditorPopup, editable, headerComponent, headerComponentParams } = _e, rest = __rest(_e, ["group", "floatingFilter", "hide", "cellEditorPopup", "editable", "headerComponent", "headerComponentParams"]);
1609
1616
  let floatingFilterEnabledForColumn = !!floatingFilter;
1610
1617
  if (typeof columnDef.type === "string") {
1611
1618
  if (!!((_a = this.columnTypes[columnDef.type]) === null || _a === void 0 ? void 0 : _a.floatingFilter)) {
@@ -1620,7 +1627,7 @@ class DataGrid extends React.Component {
1620
1627
  }
1621
1628
  });
1622
1629
  }
1623
- return Object.assign(Object.assign({}, rest), { floatingFilter: floatingFilterEnabledForColumn && floatingFilterEnabled, resizable: true, headerComponent: "simpleHeader", headerComponentParams: {
1630
+ return Object.assign(Object.assign({}, rest), { floatingFilter: floatingFilterEnabledForColumn && floatingFilterEnabled, resizable: true, headerComponent: headerComponent !== null && headerComponent !== void 0 ? headerComponent : "simpleHeader", headerComponentParams: headerComponentParams !== null && headerComponentParams !== void 0 ? headerComponentParams : {
1624
1631
  onColumnsConfigVisible: this.showColumnsConfig
1625
1632
  }, hide: (_d = (_c = this.state.columnModel.find((c) => c.colId === columnDef.colId)) === null || _c === void 0 ? void 0 : _c.hide) !== null && _d !== void 0 ? _d : (hide === undefined ? rest.initialHide : hide), cellStyle: this._getCellStyle, cellRendererParams: columnDef.cellStyle ? Object.assign(columnDef.cellRendererParams !== undefined ? columnDef.cellRendererParams : {}, { originalCellStyle: columnDef.cellStyle }) : columnDef.cellRendererParams, editable: editable, cellEditorPopup: !editable ? undefined : cellEditorPopup !== false, cellClassRules: {
1626
1633
  'cell-has-handle': (p) => { var _a, _b; return ((_a = this.state.focusedCell) === null || _a === void 0 ? void 0 : _a.rowIndex) === p.rowIndex && ((_b = this.state.focusedCell) === null || _b === void 0 ? void 0 : _b.colId) === p.colDef.colId && !this.state.isDragging; },
@@ -1652,8 +1659,8 @@ class DataGrid extends React.Component {
1652
1659
  }
1653
1660
  ;
1654
1661
  render() {
1655
- var _a, _b, _c, _d;
1656
- const _e = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, rowStyleRules, onChangeRowStyleRules, defaultShowMilliseconds, onShowMilliseconds, defaultHideYear, onShowYear, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _e, passedProperties = __rest(_e, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "rowStyleRules", "onChangeRowStyleRules", "defaultShowMilliseconds", "onShowMilliseconds", "defaultHideYear", "onShowYear", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1662
+ var _a, _b;
1663
+ const _c = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, rowStyleRules, onChangeRowStyleRules, defaultShowMilliseconds, onShowMilliseconds, defaultHideYear, onShowYear, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _c, passedProperties = __rest(_c, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "rowStyleRules", "onChangeRowStyleRules", "defaultShowMilliseconds", "onShowMilliseconds", "defaultHideYear", "onShowYear", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1657
1664
  let key;
1658
1665
  let paginationPageSize = undefined;
1659
1666
  if (paging.pageSize > 0) {
@@ -1689,7 +1696,6 @@ class DataGrid extends React.Component {
1689
1696
  Object.assign(tPanelStyle, tablePanelStyle);
1690
1697
  }
1691
1698
  const headerFilterRowHeight = calculateRowHeight(this.state.fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA + 2);
1692
- const defaultTheme = theme !== null && theme !== void 0 ? theme : myTheme;
1693
1699
  return (React.createElement(React.Fragment, null,
1694
1700
  React.createElement(Card, { size: "small", bordered: false, style: { height: "100%" }, styles: { body: bodyStyle } },
1695
1701
  React.createElement("div", { style: { display: "flex" } }, this.renderNavigationPanel()),
@@ -1715,15 +1721,22 @@ class DataGrid extends React.Component {
1715
1721
  this.setState({ contextMenuVisible: false });
1716
1722
  }
1717
1723
  } },
1718
- React.createElement("div", { className: "ag-theme-balham", style: { width: "100%", height: "100%" }, ref: (wrapingDiv) => {
1719
- this.wrappingDiv = wrapingDiv;
1720
- } },
1721
- React.createElement(AgGridReact, Object.assign({ key: key, debug: debugMode, ref: gridRef, theme: defaultTheme, paginationPageSize: paginationPageSize, maxConcurrentDatasourceRequests: this.props.rowModelType === "infinite" ? 1 : undefined, onGridReady: this.onGridReady, onPaginationChanged: this.onPaginationChanged, onFilterModified: this.onFilterModified, onFilterChanged: this.onFilterChanged, onSortChanged: this.onSortChanged, defaultColDef: this.getDefaultColDefinition(defaultColDef), columnDefs: adaptedColumnDefs, rowData: !rowDataManualMode ? rowData : undefined }, passedProperties, { onCellFocused: this.onCellFocused, cellSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", rowSelection: rowSelection, suppressPaginationPanel: true, getRowId: getRowId, maintainColumnOrder: true, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onCellMouseOver: this.onCellMouseOver, onCellMouseDown: this.onCellMouseDown, navigateToNextCell: this.navigateToNextCell, onViewportChanged: this.onViewportChanged, onCellContextMenu: this.onCellContextMenu, loadingOverlayComponent: 'loadingOverlay', noRowsOverlayComponent: 'noRecordsOverlay', onRowDataUpdated: this.onRowDataUpdated, context: this.table_context, rowHeight: this.state.rowHeight, getRowStyle: this._getRowStyle, getRowHeight: this._getRowHeight, headerHeight: headerHeight !== undefined ? headerHeight : headerFilterRowHeight, floatingFiltersHeight: headerFilterRowHeight, suppressLoadingOverlay: this.props.loadingOverlayRenderer ? true : this.props.suppressLoadingOverlay, quickFilterParser: this.wildcardQuickFilter.quickFilterParser, quickFilterMatcher: this.wildcardQuickFilter.quickFilterMatcher })),
1722
- this.state.loading && this.props.loadingOverlayRenderer &&
1723
- React.createElement("div", { className: "ag-overlay", "aria-hidden": "true", ref: "overlayWrapper" },
1724
- React.createElement("div", { className: "ag-overlay-panel" },
1725
- React.createElement("div", { className: "ag-overlay-wrapper ag-layout-normal ag-overlay-loading-wrapper" },
1726
- React.createElement("div", { className: "ag-react-container" }, (_d = (_c = this.props).loadingOverlayRenderer) === null || _d === void 0 ? void 0 : _d.call(_c))))))), tableOverlayRenderer === null || tableOverlayRenderer === void 0 ? void 0 :
1724
+ React.createElement(WithCss, { useStyles: useStyles }, (styles) => {
1725
+ var _a, _b;
1726
+ return React.createElement("div", { className: "ag-theme-balham " + styles.styles.baseLayout, style: { width: "100%", height: "100%" }, ref: (wrapingDiv) => {
1727
+ this.wrappingDiv = wrapingDiv;
1728
+ } },
1729
+ React.createElement(ConfigProvider.ConfigContext.Consumer, null, (context) => {
1730
+ var _a;
1731
+ const defaultTheme = theme !== null && theme !== void 0 ? theme : this.getTheme((_a = context.theme) === null || _a === void 0 ? void 0 : _a.algorithm, styles.theme);
1732
+ return (React.createElement(AgGridReact, Object.assign({ key: key, debug: debugMode, ref: gridRef, theme: defaultTheme, paginationPageSize: paginationPageSize, maxConcurrentDatasourceRequests: this.props.rowModelType === "infinite" ? 1 : undefined, onGridReady: this.onGridReady, onPaginationChanged: this.onPaginationChanged, onFilterModified: this.onFilterModified, onFilterChanged: this.onFilterChanged, onSortChanged: this.onSortChanged, defaultColDef: this.getDefaultColDefinition(defaultColDef), columnDefs: adaptedColumnDefs, rowData: !rowDataManualMode ? rowData : undefined }, passedProperties, { onCellFocused: this.onCellFocused, cellSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", rowSelection: rowSelection, suppressPaginationPanel: true, getRowId: getRowId, maintainColumnOrder: true, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onCellMouseOver: this.onCellMouseOver, onCellMouseDown: this.onCellMouseDown, navigateToNextCell: this.navigateToNextCell, onViewportChanged: this.onViewportChanged, onCellContextMenu: this.onCellContextMenu, loadingOverlayComponent: 'loadingOverlay', noRowsOverlayComponent: 'noRecordsOverlay', onRowDataUpdated: this.onRowDataUpdated, context: this.table_context, rowHeight: this.state.rowHeight, getRowStyle: this._getRowStyle, getRowHeight: this._getRowHeight, headerHeight: headerHeight !== undefined ? headerHeight : headerFilterRowHeight, floatingFiltersHeight: headerFilterRowHeight, suppressLoadingOverlay: this.props.loadingOverlayRenderer ? true : this.props.suppressLoadingOverlay, quickFilterParser: this.wildcardQuickFilter.quickFilterParser, quickFilterMatcher: this.wildcardQuickFilter.quickFilterMatcher })));
1733
+ }),
1734
+ this.state.loading && this.props.loadingOverlayRenderer &&
1735
+ React.createElement("div", { className: "ag-overlay", "aria-hidden": "true", ref: "overlayWrapper" },
1736
+ React.createElement("div", { className: "ag-overlay-panel" },
1737
+ React.createElement("div", { className: "ag-overlay-wrapper ag-layout-normal ag-overlay-loading-wrapper" },
1738
+ React.createElement("div", { className: "ag-react-container" }, (_b = (_a = this.props).loadingOverlayRenderer) === null || _b === void 0 ? void 0 : _b.call(_a))))));
1739
+ })), tableOverlayRenderer === null || tableOverlayRenderer === void 0 ? void 0 :
1727
1740
  tableOverlayRenderer())),
1728
1741
  !!this.gridApi && !!this.gridApi && this.state.pageSize !== null &&
1729
1742
  React.createElement(DataGridEditor, { dataGrid: this, gridApi: this.gridApi, columnDefinitions: columnDefs, columnModel: this.state.columnModel, visible: !!this.props.tableConfigVisible, onTableConfigVisible: this.showTableConfiguration, paginationPageSize: paging.pageSize, paginationDefaultPageSize: paging.defaultPageSize, currentPageSize: this.state.pageSize, showMilliseconds: !!this.props.showMilliseconds, defaultShowMilliseconds: !!this.props.defaultShowMilliseconds, showYear: !this.props.hideYear, defaultShowYear: !this.props.defaultHideYear, rowStyleRules: this.props.rowStyleRules, defaultRowStyleRules: this.props.defaultRowStyleRules, onChangeRowStyleRules: onChangeRowStyleRules }),
@@ -1757,4 +1770,17 @@ DataGrid.defaultProps = {
1757
1770
  };
1758
1771
  DataGrid.EMPTY_STYLE = {};
1759
1772
  export default DataGrid;
1773
+ function getAgGridThemeFromAntd(algorithm, token) {
1774
+ const isDark = algorithm === theme.darkAlgorithm;
1775
+ let agTheme = isDark ? themeBalham.withPart(colorSchemeDark) : themeBalham;
1776
+ return agTheme.withParams({
1777
+ accentColor: token.colorPrimary,
1778
+ backgroundColor: token.colorBgContainer,
1779
+ foregroundColor: token.colorText,
1780
+ selectedRowBackgroundColor: token.controlItemBgActive,
1781
+ rowHoverColor: token.controlItemBgHover,
1782
+ borderColor: token.colorBorder,
1783
+ headerBackgroundColor: token.colorFillAlter,
1784
+ });
1785
+ }
1760
1786
  //# sourceMappingURL=dataGrid.js.map