d2coreui 23.0.27 → 23.0.29

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,4 +1,6 @@
1
1
  import React from 'react';
2
2
  import { CustomCellEditorProps } from "ag-grid-react";
3
+ export declare const MIN_SIGNED_64_BIT_INT: bigint;
4
+ export declare const MAX_SIGNED_64_BIT_INT: bigint;
3
5
  declare const _default: (props: CustomCellEditorProps) => React.JSX.Element;
4
6
  export default _default;
@@ -4,7 +4,8 @@ import { Key } from "ts-key-enum";
4
4
  import KeyboardUtils from "d2coreui/components/keyboard/keyboardUtils";
5
5
  import { CellEditorUtils } from "./cellEditorUtils";
6
6
  import { DataGridCellEditorComponent, withAgGridHooks } from "./dataGridCellEditorComponent";
7
- import { MAX_SIGNED_64_BIT_INT, MIN_SIGNED_64_BIT_INT } from "d2api/constants";
7
+ export const MIN_SIGNED_64_BIT_INT = BigInt("-9223372036854775808");
8
+ export const MAX_SIGNED_64_BIT_INT = BigInt("9223372036854775807");
8
9
  class BigNumberCellEditor extends DataGridCellEditorComponent {
9
10
  constructor(props) {
10
11
  super(props);
@@ -1 +1 @@
1
- {"version":3,"file":"bigNumberCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/bigNumberCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAC;AACjC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAC,qBAAqB,EAAE,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAe7E,MAAM,mBAAoB,SAAQ,2BAAkF;IAGhH,YAAY,KAA8C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AM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ;AAED,eAAe,eAAe,CAAC,mBAAmB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {InputNumber} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport {CellEditorUtils} from \"./cellEditorUtils\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\nimport {MAX_SIGNED_64_BIT_INT, MIN_SIGNED_64_BIT_INT} from \"d2api/constants\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\n\r\ninterface BigNumberCellEditorProperties extends CustomCellEditorProps {\r\n decimalSeparator?: string\r\n precision?: number\r\n min?: number\r\n max?: number\r\n}\r\n\r\ninterface NumericCellEditorState {\r\n value: string | null\r\n}\r\n\r\n// same as NumberCellEditor, but values that are not in range of safe integer values are returned as string\r\nclass BigNumberCellEditor extends DataGridCellEditorComponent<BigNumberCellEditorProperties, NumericCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n\r\n constructor(props: Readonly<BigNumberCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<BigNumberCellEditorProperties>): NumericCellEditorState {\r\n let value: string | null;\r\n\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n }\r\n return {\r\n value: value,\r\n };\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n\r\n render() {\r\n return (\r\n <InputNumber<string>\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n size=\"small\"\r\n autoFocus\r\n stringMode\r\n decimalSeparator={this.props.decimalSeparator}\r\n precision={this.props.precision}\r\n min={this.props.min ? String(this.props.min) : MIN_SIGNED_64_BIT_INT.toString()}\r\n max={this.props.max ? String(this.props.max) : MAX_SIGNED_64_BIT_INT.toString()}\r\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (typeof value === \"string\" && value !== \"\") {\r\n this.setState({value: value});\r\n if (value !== null && /^(?:-?\\d+)?$/.test(value)) {\r\n if (BigInt(value) > Number.MAX_SAFE_INTEGER || BigInt(value) < Number.MIN_SAFE_INTEGER) {\r\n this.props.onValueChange(value);\r\n } else {\r\n this.props.onValueChange(parseInt(value, 10));\r\n }\r\n }\r\n } else if (value === null || value === \"\") {\r\n this.setState({value: null});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n onKeyDown={(e) => {\r\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\r\n // this.props.onKeyDown(e.nativeEvent);\r\n e.preventDefault();\r\n e.nativeEvent.stopImmediatePropagation();\r\n e.nativeEvent.preventDefault();\r\n }\r\n }}\r\n style={{width: '100%'}}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(BigNumberCellEditor)"]}
1
+ {"version":3,"file":"bigNumberCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/bigNumberCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAC;AACjC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAG3F,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAcnE,MAAM,mBAAoB,SAAQ,2BAAkF;IAGhH,YAAY,KAA8C;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC;QAHT,mBAAc,GAA4B,IAAI,CAAC;QAInD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAA8C;QAC1D,IAAI,KAAoB,CAAC;QAEzB,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;YAEpE,KAAK,GAAG,IAAI,CAAC;YACb,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAEvD,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CA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;6BAAM,CAAC;4BACJ,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;wBAClD,CAAC;oBACL,CAAC;gBACL,CAAC;qBAAM,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBACxC,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;oBAC7B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBACnC,CAAC;YACL,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;oBAE1C,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,CAAC,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;oBACzC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;gBACnC,CAAC;YACL,CAAC,EACD,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ;AAED,eAAe,eAAe,CAAC,mBAAmB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {InputNumber} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport {CellEditorUtils} from \"./cellEditorUtils\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\n\r\nexport const MIN_SIGNED_64_BIT_INT = BigInt(\"-9223372036854775808\");\r\nexport const MAX_SIGNED_64_BIT_INT = BigInt(\"9223372036854775807\");\r\n\r\ninterface BigNumberCellEditorProperties extends CustomCellEditorProps {\r\n decimalSeparator?: string\r\n precision?: number\r\n min?: number\r\n max?: number\r\n}\r\n\r\ninterface NumericCellEditorState {\r\n value: string | null\r\n}\r\n\r\n// same as NumberCellEditor, but values that are not in range of safe integer values are returned as string\r\nclass BigNumberCellEditor extends DataGridCellEditorComponent<BigNumberCellEditorProperties, NumericCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n\r\n constructor(props: Readonly<BigNumberCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<BigNumberCellEditorProperties>): NumericCellEditorState {\r\n let value: string | null;\r\n\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n }\r\n return {\r\n value: value,\r\n };\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n\r\n render() {\r\n return (\r\n <InputNumber<string>\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n size=\"small\"\r\n autoFocus\r\n stringMode\r\n decimalSeparator={this.props.decimalSeparator}\r\n precision={this.props.precision}\r\n min={this.props.min ? String(this.props.min) : MIN_SIGNED_64_BIT_INT.toString()}\r\n max={this.props.max ? String(this.props.max) : MAX_SIGNED_64_BIT_INT.toString()}\r\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (typeof value === \"string\" && value !== \"\") {\r\n this.setState({value: value});\r\n if (value !== null && /^(?:-?\\d+)?$/.test(value)) {\r\n if (BigInt(value) > Number.MAX_SAFE_INTEGER || BigInt(value) < Number.MIN_SAFE_INTEGER) {\r\n this.props.onValueChange(value);\r\n } else {\r\n this.props.onValueChange(parseInt(value, 10));\r\n }\r\n }\r\n } else if (value === null || value === \"\") {\r\n this.setState({value: null});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n onKeyDown={(e) => {\r\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\r\n // this.props.onKeyDown(e.nativeEvent);\r\n e.preventDefault();\r\n e.nativeEvent.stopImmediatePropagation();\r\n e.nativeEvent.preventDefault();\r\n }\r\n }}\r\n style={{width: '100%'}}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(BigNumberCellEditor)"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d2coreui",
3
- "version": "23.0.27",
3
+ "version": "23.0.29",
4
4
  "description": "Core UI components and utilities library.",
5
5
  "author": "Ipesoft s.r.o.",
6
6
  "license": "MIT",
package/style/index.less CHANGED
@@ -7,10 +7,6 @@ body {
7
7
  'Noto Color Emoji';
8
8
  }
9
9
 
10
- .ant-tree .ant-tree-switcher {
11
- height: 26px;
12
- }
13
-
14
10
  .stronger-divider-with-text.ant-divider-horizontal.ant-divider-with-text-center::before,
15
11
  .stronger-divider-with-text.ant-divider-horizontal.ant-divider-with-text-center::after {
16
12
  border-top: 1px solid #bbb;