@skedulo/sked-ui 21.11.0 → 21.11.2

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/README.md CHANGED
@@ -8,11 +8,11 @@ Run:
8
8
 
9
9
  ```bash
10
10
  yarn storybook
11
- ```
11
+ ```
12
12
 
13
13
  ## Development
14
14
 
15
- Use NodeJS 16 for development
15
+ Use NodeJS 24 for development
16
16
 
17
17
  ### Installation
18
18
 
@@ -32,7 +32,7 @@ yarn test
32
32
 
33
33
  Run with the watch command:
34
34
 
35
- yarn test:watch
35
+ yarn test:watch
36
36
 
37
37
  ### Build
38
38
 
@@ -88,11 +88,11 @@ Semantic-release will create a new commit at some point in the build pipeline th
88
88
 
89
89
  If the build fails BEFORE this occurs, then feel free to rerun the build pipeline as it will cleanly re-attempt to release.
90
90
 
91
- If the build fails AFTER a commit is created, then you will not be able to rerun the build pipeline. This is because the release
91
+ If the build fails AFTER a commit is created, then you will not be able to rerun the build pipeline. This is because the release
92
92
 
93
93
  process relies on being at the tip of master to release to NPM and a previous pipeline has already added a commit changing the package version.
94
94
 
95
- In this instance you will have to create another commit and merge it through a PR. If the build pipeline is still broken and needs to be debugged
95
+ In this instance you will have to create another commit and merge it through a PR. If the build pipeline is still broken and needs to be debugged
96
96
 
97
97
  then the only other option is asking an administrator to rebase master and drop the release commit allowing the release process to cleanly retry.
98
98
 
@@ -15,7 +15,8 @@ export interface DatepickerProps {
15
15
  */
16
16
  selected: Date;
17
17
  /**
18
- * The action to take when the date changes
18
+ * Called when the date changes. Receives the new Date on selection, or
19
+ * `undefined` when the date is cleared (requires `clearable={true}`).
19
20
  */
20
21
  onChange: (value?: Date) => void;
21
22
  /**
@@ -35,11 +36,11 @@ export interface DatepickerProps {
35
36
  */
36
37
  fixedHeight?: ReactDatePickerProps['fixedHeight'];
37
38
  /**
38
- * Earliest date allowed to be selected. This will also affect the month navigation
39
+ * Earliest date allowed to be selected. This will also affect the month navigation.
39
40
  */
40
41
  minDate?: ReactDatePickerProps['minDate'];
41
42
  /**
42
- * Latest date allowed to be selected. This will also affect the month navigation
43
+ * Latest date allowed to be selected. This will also affect the month navigation.
43
44
  */
44
45
  maxDate?: ReactDatePickerProps['maxDate'];
45
46
  /**
@@ -51,7 +52,7 @@ export interface DatepickerProps {
51
52
  */
52
53
  placeholderText?: string;
53
54
  /**
54
- * The format of the date to display. Custom date-fns format string
55
+ * The format of the date to display. Custom date-fns format string.
55
56
  */
56
57
  dateFormat?: string;
57
58
  /**
@@ -103,21 +104,30 @@ export interface DatepickerProps {
103
104
  */
104
105
  onClickOutside?: () => void;
105
106
  /**
106
- * The element name for vaildation
107
+ * The element name for validation
107
108
  */
108
109
  name?: string;
109
110
  /**
110
- * The element id for vaildation
111
+ * The element id for validation
111
112
  */
112
113
  id?: string;
113
114
  /**
114
- * Allow the datepicker to be cleared
115
+ * Whether the date can be cleared. When `true` (default), pressing
116
+ * Backspace on an empty input clears the selected date and calls
117
+ * `onChange(undefined)`. When `false`, the input reverts to the
118
+ * previous date value. Normal text editing via Backspace works
119
+ * regardless of this setting.
120
+ *
121
+ * @default true
115
122
  */
116
123
  clearable?: boolean;
117
124
  /**
118
- * onCalendarClose fuction
125
+ * Called when the calendar popover closes
119
126
  */
120
127
  onCalendarClose?: () => void;
128
+ /**
129
+ * Ref to the underlying input element
130
+ */
121
131
  inputRef?: React.MutableRefObject<HTMLInputElement>;
122
132
  }
123
133
  export declare const CustomInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
package/dist/index.js CHANGED
@@ -20224,7 +20224,10 @@ var CustomInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__["forwardRef"](
20224
20224
  break;
20225
20225
 
20226
20226
  case 'Backspace':
20227
- onBackspace();
20227
+ if (!event.currentTarget.value) {
20228
+ onBackspace();
20229
+ }
20230
+
20228
20231
  break;
20229
20232
  }
20230
20233
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/sked-ui",
3
- "version": "21.11.0",
3
+ "version": "21.11.2",
4
4
  "license": "UNLICENSED",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -10,15 +10,15 @@
10
10
  "build": "yarn build:test && yarn build:storybook && yarn build:package",
11
11
  "build:declarations": "tsc --emitDeclarationOnly --skipLibCheck",
12
12
  "build:declarations:watch": "yarn build:declarations --watch",
13
- "build:webpack": "export NODE_ENV='production' && webpack",
13
+ "build:webpack": "export NODE_OPTIONS=--openssl-legacy-provider && export NODE_ENV='production' && webpack",
14
14
  "build:test": "yarn test --runInBand",
15
- "build:storybook": "export NODE_ENV='production' && build-storybook",
15
+ "build:storybook": "export NODE_OPTIONS=--openssl-legacy-provider && export NODE_ENV='production' && build-storybook",
16
16
  "build:package": "yarn build:webpack && yarn build:declarations",
17
17
  "test": "jest",
18
18
  "test:watch": "jest --watch",
19
19
  "test:coverage": "jest --coverage",
20
- "package:watch": "yarn build:webpack --watch",
21
- "storybook": "start-storybook -p 6006",
20
+ "package:watch": "export NODE_OPTIONS=--openssl-legacy-provider && yarn build:webpack --watch",
21
+ "storybook": "export NODE_OPTIONS=--openssl-legacy-provider && start-storybook -p 6006",
22
22
  "release": "npx semantic-release",
23
23
  "lint": "eslint './src/**/*.{ts,tsx}'",
24
24
  "check:types": "tsc --noEmit --pretty",