@semcore/inline-input 17.2.2-prerelease.1 → 17.3.0-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/cjs/InlineInput.js +16 -14
  3. package/lib/cjs/InlineInput.js.map +1 -1
  4. package/lib/cjs/InlineInput.type.js +2 -0
  5. package/lib/cjs/InlineInput.type.js.map +1 -0
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/cjs/translations/de.json +3 -1
  8. package/lib/cjs/translations/en.json +3 -1
  9. package/lib/cjs/translations/es.json +3 -1
  10. package/lib/cjs/translations/fr.json +3 -1
  11. package/lib/cjs/translations/it.json +3 -1
  12. package/lib/cjs/translations/ja.json +3 -1
  13. package/lib/cjs/translations/ko.json +3 -1
  14. package/lib/cjs/translations/nl.json +3 -1
  15. package/lib/cjs/translations/pl.json +3 -1
  16. package/lib/cjs/translations/pt.json +3 -1
  17. package/lib/cjs/translations/sv.json +3 -1
  18. package/lib/cjs/translations/tr.json +3 -1
  19. package/lib/cjs/translations/vi.json +3 -1
  20. package/lib/cjs/translations/zh.json +3 -1
  21. package/lib/es6/InlineInput.js +16 -14
  22. package/lib/es6/InlineInput.js.map +1 -1
  23. package/lib/es6/InlineInput.type.js +2 -0
  24. package/lib/es6/InlineInput.type.js.map +1 -0
  25. package/lib/es6/index.js.map +1 -1
  26. package/lib/es6/translations/de.json +3 -1
  27. package/lib/es6/translations/en.json +3 -1
  28. package/lib/es6/translations/es.json +3 -1
  29. package/lib/es6/translations/fr.json +3 -1
  30. package/lib/es6/translations/it.json +3 -1
  31. package/lib/es6/translations/ja.json +3 -1
  32. package/lib/es6/translations/ko.json +3 -1
  33. package/lib/es6/translations/nl.json +3 -1
  34. package/lib/es6/translations/pl.json +3 -1
  35. package/lib/es6/translations/pt.json +3 -1
  36. package/lib/es6/translations/sv.json +3 -1
  37. package/lib/es6/translations/tr.json +3 -1
  38. package/lib/es6/translations/vi.json +3 -1
  39. package/lib/es6/translations/zh.json +3 -1
  40. package/lib/esm/InlineInput.mjs +17 -15
  41. package/lib/esm/translations/de.json.mjs +8 -2
  42. package/lib/esm/translations/en.json.mjs +8 -2
  43. package/lib/esm/translations/es.json.mjs +8 -2
  44. package/lib/esm/translations/fr.json.mjs +8 -2
  45. package/lib/esm/translations/it.json.mjs +8 -2
  46. package/lib/esm/translations/ja.json.mjs +8 -2
  47. package/lib/esm/translations/ko.json.mjs +8 -2
  48. package/lib/esm/translations/nl.json.mjs +8 -2
  49. package/lib/esm/translations/pl.json.mjs +8 -2
  50. package/lib/esm/translations/pt.json.mjs +8 -2
  51. package/lib/esm/translations/sv.json.mjs +8 -2
  52. package/lib/esm/translations/tr.json.mjs +8 -2
  53. package/lib/esm/translations/vi.json.mjs +8 -2
  54. package/lib/esm/translations/zh.json.mjs +8 -2
  55. package/lib/types/InlineInput.d.ts +3 -2
  56. package/lib/types/InlineInput.d.ts.map +1 -0
  57. package/lib/types/InlineInput.type.d.ts +154 -0
  58. package/lib/types/InlineInput.type.d.ts.map +1 -0
  59. package/lib/types/index.d.ts +3 -2
  60. package/lib/types/index.d.ts.map +1 -0
  61. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +29 -0
  62. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts.map +1 -0
  63. package/package.json +12 -12
  64. package/lib/cjs/index.type.js +0 -2
  65. package/lib/cjs/index.type.js.map +0 -1
  66. package/lib/es6/index.type.js +0 -2
  67. package/lib/es6/index.type.js.map +0 -1
  68. package/lib/types/index.type.d.ts +0 -107
@@ -1,11 +1,17 @@
1
1
  const confirm = "Lưu";
2
2
  const discard = "Hủy";
3
+ const increment = "Tăng số";
4
+ const decrement = "Giảm số";
3
5
  const vi = {
4
6
  confirm,
5
- discard
7
+ discard,
8
+ increment,
9
+ decrement
6
10
  };
7
11
  export {
8
12
  confirm,
13
+ decrement,
9
14
  vi as default,
10
- discard
15
+ discard,
16
+ increment
11
17
  };
@@ -1,11 +1,17 @@
1
1
  const confirm = "保存";
2
2
  const discard = "取消";
3
+ const increment = "增量";
4
+ const decrement = "减量";
3
5
  const zh = {
4
6
  confirm,
5
- discard
7
+ discard,
8
+ increment,
9
+ decrement
6
10
  };
7
11
  export {
8
12
  confirm,
13
+ decrement,
9
14
  zh as default,
10
- discard
15
+ discard,
16
+ increment
11
17
  };
@@ -1,8 +1,9 @@
1
- import type { InlineInputComponent } from './index.type';
1
+ import type { NSInlineInput } from './InlineInput.type';
2
2
  /**
3
3
  * InlineInput
4
4
  *
5
5
  * {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-api/|API} | {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-code/|Examples}
6
6
  */
7
- declare const InlineInput: InlineInputComponent;
7
+ declare const InlineInput: NSInlineInput.Component;
8
8
  export default InlineInput;
9
+ //# sourceMappingURL=InlineInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineInput.d.ts","sourceRoot":"","sources":["../../src/InlineInput.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmYxD;;;;GAIG;AACH,QAAA,MAAM,WAAW,yBAUf,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,154 @@
1
+ import type { NSBox } from '@semcore/base-components';
2
+ import type { ButtonLinkComponent } from '@semcore/button';
3
+ import type { PropGetterFn, Intergalactic } from '@semcore/core';
4
+ import type { NSInputNumber } from '@semcore/input-number';
5
+ import type React from 'react';
6
+ import type { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';
7
+ declare namespace NSInlineInput {
8
+ type Props = NSBox.Props & {
9
+ /**
10
+ * Visual state of inline input
11
+ * @default normal
12
+ */
13
+ state?: 'normal' | 'valid' | 'invalid';
14
+ /**
15
+ * Disabled input and shows spinner instead of confirm control
16
+ * @default false
17
+ */
18
+ loading?: boolean;
19
+ /**
20
+ * Disabled input and controls
21
+ * @default false
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
26
+ */
27
+ onConfirm?: (value: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
28
+ /**
29
+ * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
30
+ */
31
+ onCancel?: (prevValue: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
32
+ /**
33
+ * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
34
+ * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
35
+ */
36
+ onBlurBehavior?: 'cancel' | 'confirm' | 'none';
37
+ /** Specifies the locale for i18n support */
38
+ locale?: string;
39
+ };
40
+ type DefaultProps = {
41
+ state: 'normal';
42
+ onBlurBehavior: 'confirm';
43
+ i18n: LocalizedMessages;
44
+ locale: 'en';
45
+ };
46
+ type Ctx = {
47
+ getAddonProps: PropGetterFn;
48
+ getConfirmControlProps: PropGetterFn;
49
+ getCancelControlProps: PropGetterFn;
50
+ getValueProps: PropGetterFn;
51
+ };
52
+ namespace Addon {
53
+ type Props = NSBox.Props;
54
+ type Component = Intergalactic.Component<'div', Props>;
55
+ }
56
+ namespace Value {
57
+ type Props = NSBox.Props & {
58
+ /**
59
+ * id attribute of input tag
60
+ */
61
+ id?: string;
62
+ /**
63
+ * when `true`, element is focused immediately after mount
64
+ */
65
+ autoFocus?: boolean;
66
+ /**
67
+ * value of input tag
68
+ */
69
+ value?: string;
70
+ /**
71
+ * uncontrolled value of input tag
72
+ */
73
+ defaultValue?: string;
74
+ /**
75
+ * callback invoked on every change of input tag value
76
+ */
77
+ onChange?: (value: string, event: React.ChangeEvent) => void;
78
+ /**
79
+ * disables interactive elements
80
+ */
81
+ disabled?: boolean;
82
+ /**
83
+ * gray text in empty input tag
84
+ */
85
+ placeholder?: string;
86
+ };
87
+ type DefaultProps = {
88
+ defaultValue: '';
89
+ };
90
+ type Handlers = {
91
+ value: (event: React.ChangeEvent<HTMLInputElement>) => Props['value'];
92
+ };
93
+ type Component = Intergalactic.Component<'input', Props>;
94
+ }
95
+ namespace ConfirmControl {
96
+ type Props = NSBox.Props & {
97
+ /**
98
+ * Text of tooltip
99
+ * @default Confirm
100
+ */
101
+ title?: string;
102
+ /**
103
+ * Icon component
104
+ * @default CheckM
105
+ */
106
+ icon?: React.FC;
107
+ };
108
+ type Component = Intergalactic.Component<ButtonLinkComponent, Props>;
109
+ }
110
+ namespace CancelControl {
111
+ type Props = NSBox.Props & {
112
+ /**
113
+ * Text of tooltip
114
+ * @default Cancel
115
+ */
116
+ title?: string;
117
+ /**
118
+ * Icon component
119
+ * @default CloseM
120
+ */
121
+ icon?: React.FC;
122
+ };
123
+ type Component = Intergalactic.Component<ButtonLinkComponent, Props>;
124
+ }
125
+ namespace NumberValue {
126
+ type Props = {};
127
+ type Component = Intergalactic.Component<'div', Props>;
128
+ }
129
+ namespace NumberControls {
130
+ type Component = NSInputNumber.Controls.Component;
131
+ }
132
+ type Component = Intergalactic.Component<'div', Props, Ctx> & {
133
+ Addon: Addon.Component;
134
+ Value: Value.Component;
135
+ ConfirmControl: ConfirmControl.Component;
136
+ CancelControl: CancelControl.Component;
137
+ NumberValue: NumberValue.Component;
138
+ NumberControls: NumberControls.Component;
139
+ };
140
+ }
141
+ /** @deprecated It will be removed in v19. */
142
+ export type InlineInputProps = NSInlineInput.Props;
143
+ /** @deprecated It will be removed in v19. */
144
+ export type InlineInputAddonProps = NSInlineInput.Addon.Props;
145
+ /** @deprecated It will be removed in v19. */
146
+ export type InlineInputValueProps = NSInlineInput.Value.Props;
147
+ /** @deprecated It will be removed in v19. */
148
+ export type InlineInputConfirmControlProps = NSInlineInput.ConfirmControl.Props;
149
+ /** @deprecated It will be removed in v19. */
150
+ export type InlineInputCancelControlProps = NSInlineInput.CancelControl.Props;
151
+ /** @deprecated It will be removed in v19. */
152
+ export type InlineInputComponent = NSInlineInput.Component;
153
+ export type { NSInlineInput };
154
+ //# sourceMappingURL=InlineInput.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineInput.type.d.ts","sourceRoot":"","sources":["../../src/InlineInput.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAExF,OAAO,WAAW,aAAa,CAAC;IAC9B,KAAK,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG;QACzB;;;WAGG;QACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;QACvC;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;;WAGG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB;;WAEG;QACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;QACtG;;WAEG;QACH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;QACzG;;;WAGG;QACH,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;QAC/C,4CAA4C;QAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,YAAY,GA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;AACnD,6CAA6C;AAC7C,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;AAC9D,6CAA6C;AAC7C,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;AAC9D,6CAA6C;AAC7C,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,cAAc,CAAC,KAAK,CAAC;AAChF,6CAA6C;AAC7C,MAAM,MAAM,6BAA6B,GAAG,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC;AAC9E,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,SAAS,CAAC;AAE3D,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { InlineInputProps, InlineInputValueProps } from './index.type';
2
1
  import InlineInputBase from './InlineInput';
2
+ import type { InlineInputProps, InlineInputValueProps, NSInlineInput } from './InlineInput.type';
3
3
  export default InlineInputBase;
4
- export type { InlineInputProps, InlineInputValueProps };
4
+ export type { InlineInputProps, InlineInputValueProps, NSInlineInput };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjG,eAAe,eAAe,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,CAAC"}
@@ -2,58 +2,87 @@ export declare const localizedMessages: {
2
2
  de: {
3
3
  confirm: string;
4
4
  discard: string;
5
+ increment: string;
6
+ decrement: string;
5
7
  };
6
8
  en: {
7
9
  confirm: string;
8
10
  discard: string;
11
+ increment: string;
12
+ decrement: string;
9
13
  };
10
14
  es: {
11
15
  confirm: string;
12
16
  discard: string;
17
+ increment: string;
18
+ decrement: string;
13
19
  };
14
20
  fr: {
15
21
  confirm: string;
16
22
  discard: string;
23
+ increment: string;
24
+ decrement: string;
17
25
  };
18
26
  it: {
19
27
  confirm: string;
20
28
  discard: string;
29
+ increment: string;
30
+ decrement: string;
21
31
  };
22
32
  ja: {
23
33
  confirm: string;
24
34
  discard: string;
35
+ increment: string;
36
+ decrement: string;
25
37
  };
26
38
  ko: {
27
39
  confirm: string;
28
40
  discard: string;
41
+ increment: string;
42
+ decrement: string;
29
43
  };
30
44
  nl: {
31
45
  confirm: string;
32
46
  discard: string;
47
+ increment: string;
48
+ decrement: string;
33
49
  };
34
50
  pt: {
35
51
  confirm: string;
36
52
  discard: string;
53
+ increment: string;
54
+ decrement: string;
37
55
  };
38
56
  tr: {
39
57
  confirm: string;
40
58
  discard: string;
59
+ increment: string;
60
+ decrement: string;
41
61
  };
42
62
  vi: {
43
63
  confirm: string;
44
64
  discard: string;
65
+ increment: string;
66
+ decrement: string;
45
67
  };
46
68
  zh: {
47
69
  confirm: string;
48
70
  discard: string;
71
+ increment: string;
72
+ decrement: string;
49
73
  };
50
74
  pl: {
51
75
  confirm: string;
52
76
  discard: string;
77
+ increment: string;
78
+ decrement: string;
53
79
  };
54
80
  sv: {
55
81
  confirm: string;
56
82
  discard: string;
83
+ increment: string;
84
+ decrement: string;
57
85
  };
58
86
  };
59
87
  export type LocalizedMessages = typeof localizedMessages;
88
+ //# sourceMappingURL=__intergalactic-dynamic-locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__intergalactic-dynamic-locales.d.ts","sourceRoot":"","sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/inline-input",
3
3
  "description": "Semrush Input Component",
4
- "version": "17.2.2-prerelease.1",
4
+ "version": "17.3.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,22 +14,22 @@
14
14
  "require": "./lib/cjs/index.js"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/spin": "^17.2.1",
18
- "@semcore/tooltip": "^17.2.1",
19
- "@semcore/input-number": "^17.2.2-prerelease.1",
20
- "@semcore/input": "^17.2.2-prerelease.1",
21
- "@semcore/button": "^17.2.1"
17
+ "@semcore/spin": "^17.2.1-prerelease.0",
18
+ "@semcore/tooltip": "^17.2.1-prerelease.0",
19
+ "@semcore/input-number": "^17.3.0-prerelease.0",
20
+ "@semcore/input": "^17.2.2-prerelease.0",
21
+ "@semcore/button": "^17.2.2-prerelease.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@semcore/core": "17.2.1",
25
- "@semcore/base-components": "17.2.1",
26
- "@semcore/spin": "17.2.1",
24
+ "@semcore/core": "17.3.1-prerelease.0",
27
25
  "@semcore/testing-utils": "1.0.0",
26
+ "@semcore/base-components": "17.2.2-prerelease.0",
27
+ "@semcore/tooltip": "17.2.1-prerelease.0",
28
28
  "@semcore/icon": "17.2.0",
29
- "@semcore/tooltip": "17.2.1"
29
+ "@semcore/spin": "17.2.1-prerelease.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@semcore/base-components": "^17.2.1",
32
+ "@semcore/base-components": "^17.2.2",
33
33
  "@semcore/icon": "^17.2.0"
34
34
  },
35
35
  "repository": {
@@ -38,6 +38,6 @@
38
38
  "directory": "semcore/inline-input"
39
39
  },
40
40
  "scripts": {
41
- "build": "pnpm semcore-builder --source=ts && pnpm vite build"
41
+ "build": "pnpm semcore-builder && pnpm vite build"
42
42
  }
43
43
  }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=index.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.type.js","names":[],"sources":["../../src/index.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { ButtonLinkComponent } from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { NSInputNumber } from '@semcore/input-number';\nimport type React from 'react';\n\nexport type InlineInputProps = BoxProps & {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired\n * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)\n */\n onBlurBehavior?: 'cancel' | 'confirm' | 'none';\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\nexport type InlineInputAddonProps = BoxProps & {};\n\nexport type InlineInputValueProps = BoxProps & {\n /**\n * id attribute of input tag\n */\n id?: string;\n /**\n * when `true`, element is focused immediately after mount\n */\n autoFocus?: boolean;\n /**\n * value of input tag\n */\n value?: string;\n /**\n * uncontrolled value of input tag\n */\n defaultValue?: string;\n /**\n * callback invoked on every change of input tag value\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n};\n\nexport type InlineInputConfirmControlProps = BoxProps & {\n /**\n * Text of tooltip\n * @default Confirm\n */\n title?: string;\n /**\n * Icon component\n * @default CheckM\n */\n icon?: React.FC;\n};\n\nexport type InlineInputCancelControlProps = BoxProps & {\n /**\n * Text of tooltip\n * @default Cancel\n */\n title?: string;\n /**\n * Icon component\n * @default CloseM\n */\n icon?: React.FC;\n};\n\ntype InlineInputCtx = {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n};\n\nexport type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {\n Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;\n Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;\n ConfirmControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputConfirmControlProps,\n InlineInputProps\n >;\n CancelControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputCancelControlProps,\n InlineInputProps\n >;\n NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;\n NumberControls: Intergalactic.Component<'div', NSInputNumber.Controls.Props, InlineInputProps>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.type.js","names":[],"sources":["../../src/index.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { ButtonLinkComponent } from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { NSInputNumber } from '@semcore/input-number';\nimport type React from 'react';\n\nexport type InlineInputProps = BoxProps & {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired\n * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)\n */\n onBlurBehavior?: 'cancel' | 'confirm' | 'none';\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\nexport type InlineInputAddonProps = BoxProps & {};\n\nexport type InlineInputValueProps = BoxProps & {\n /**\n * id attribute of input tag\n */\n id?: string;\n /**\n * when `true`, element is focused immediately after mount\n */\n autoFocus?: boolean;\n /**\n * value of input tag\n */\n value?: string;\n /**\n * uncontrolled value of input tag\n */\n defaultValue?: string;\n /**\n * callback invoked on every change of input tag value\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n};\n\nexport type InlineInputConfirmControlProps = BoxProps & {\n /**\n * Text of tooltip\n * @default Confirm\n */\n title?: string;\n /**\n * Icon component\n * @default CheckM\n */\n icon?: React.FC;\n};\n\nexport type InlineInputCancelControlProps = BoxProps & {\n /**\n * Text of tooltip\n * @default Cancel\n */\n title?: string;\n /**\n * Icon component\n * @default CloseM\n */\n icon?: React.FC;\n};\n\ntype InlineInputCtx = {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n};\n\nexport type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {\n Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;\n Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;\n ConfirmControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputConfirmControlProps,\n InlineInputProps\n >;\n CancelControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputCancelControlProps,\n InlineInputProps\n >;\n NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;\n NumberControls: Intergalactic.Component<'div', NSInputNumber.Controls.Props, InlineInputProps>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,107 +0,0 @@
1
- import type { BoxProps } from '@semcore/base-components';
2
- import type { ButtonLinkComponent } from '@semcore/button';
3
- import type { PropGetterFn, Intergalactic } from '@semcore/core';
4
- import type { NSInputNumber } from '@semcore/input-number';
5
- import type React from 'react';
6
- export type InlineInputProps = BoxProps & {
7
- /**
8
- * Visual state of inline input
9
- * @default normal
10
- */
11
- state?: 'normal' | 'valid' | 'invalid';
12
- /**
13
- * Disabled input and shows spinner instead of confirm control
14
- * @default false
15
- */
16
- loading?: boolean;
17
- /**
18
- * Disabled input and controls
19
- * @default false
20
- */
21
- disabled?: boolean;
22
- /**
23
- * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
24
- */
25
- onConfirm?: (value: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
26
- /**
27
- * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
28
- */
29
- onCancel?: (prevValue: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
30
- /**
31
- * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
32
- * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
33
- */
34
- onBlurBehavior?: 'cancel' | 'confirm' | 'none';
35
- /** Specifies the locale for i18n support */
36
- locale?: string;
37
- };
38
- export type InlineInputAddonProps = BoxProps & {};
39
- export type InlineInputValueProps = BoxProps & {
40
- /**
41
- * id attribute of input tag
42
- */
43
- id?: string;
44
- /**
45
- * when `true`, element is focused immediately after mount
46
- */
47
- autoFocus?: boolean;
48
- /**
49
- * value of input tag
50
- */
51
- value?: string;
52
- /**
53
- * uncontrolled value of input tag
54
- */
55
- defaultValue?: string;
56
- /**
57
- * callback invoked on every change of input tag value
58
- */
59
- onChange?: (value: string, event: React.ChangeEvent) => void;
60
- /**
61
- * disables interactive elements
62
- */
63
- disabled?: boolean;
64
- /**
65
- * gray text in empty input tag
66
- */
67
- placeholder?: string;
68
- };
69
- export type InlineInputConfirmControlProps = BoxProps & {
70
- /**
71
- * Text of tooltip
72
- * @default Confirm
73
- */
74
- title?: string;
75
- /**
76
- * Icon component
77
- * @default CheckM
78
- */
79
- icon?: React.FC;
80
- };
81
- export type InlineInputCancelControlProps = BoxProps & {
82
- /**
83
- * Text of tooltip
84
- * @default Cancel
85
- */
86
- title?: string;
87
- /**
88
- * Icon component
89
- * @default CloseM
90
- */
91
- icon?: React.FC;
92
- };
93
- type InlineInputCtx = {
94
- getAddonProps: PropGetterFn;
95
- getConfirmControlProps: PropGetterFn;
96
- getCancelControlProps: PropGetterFn;
97
- getValueProps: PropGetterFn;
98
- };
99
- export type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {
100
- Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;
101
- Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;
102
- ConfirmControl: Intergalactic.Component<ButtonLinkComponent, InlineInputConfirmControlProps, InlineInputProps>;
103
- CancelControl: Intergalactic.Component<ButtonLinkComponent, InlineInputCancelControlProps, InlineInputProps>;
104
- NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;
105
- NumberControls: Intergalactic.Component<'div', NSInputNumber.Controls.Props, InlineInputProps>;
106
- };
107
- export {};