Skip to content

Commit

Permalink
release: 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seawind543 committed Oct 23, 2021
2 parents 0bab87c + 2f3709d commit b6275a7
Show file tree
Hide file tree
Showing 39 changed files with 3,119 additions and 127 deletions.
9 changes: 5 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
doc
dist
lib
node_modules/
coverage/
doc/
dist/
lib/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules
node_modules/
coverage/
9 changes: 5 additions & 4 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
doc
dist
lib
node_modules/
coverage/
doc/
dist/
lib/
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,35 @@ Note: Sources code of Examples in the folder `examples`
*/
onRenderTokenDeleteButtonContent: PropTypes.func,
/**
* A callback function for determine whether the token is inline editable.
*
* onIsTokenEditable(tokenValue, tokenMeta)
*
* @ tokenValue
* Type: any (string | number | object | customize data structure)
* Description: The tokenValue build by `onBuildTokenValue`
*
* @ tokenMeta
* Description: token's meta data
* {
* // A private key for render
* key: string,
*
* // Specific the token is activated for `edit` or not
* activated: boolean,
*
* // Customize data structure built by `onTokenValue Validate`
* // Specific the token's validate status or errorMessage
* error: any,
* }
*
* @ return
* Type: boolean
* Description: `true` if editable. `false` if not.
*/
onIsTokenEditable: PropTypes.func,
/**
* A callback function for getting `string input value`
* from `tokenValue` for the end-user to perform `edit`
Expand Down Expand Up @@ -406,6 +435,7 @@ Enter | End editing and apply the new value. In case the new value is an `e
// Token
onGetTokenClassName: () => {}, // Dummy function
onGetTokenDisplayLabel: getDefaultTokenEditableValue,
onIsTokenEditable: () => true,
onGetTokenEditableValue: getDefaultTokenEditableValue,
onGetTokenErrorMessage: getDefaultTokenErrorMessage,
```
Expand All @@ -428,6 +458,8 @@ Could also reference this [Example Demo](https://seawind543.github.io/react-toke
onGetDisplayLabel: PropTypes.func.isRequired,
// Same as props `onRenderTokenDeleteButtonContent` of TokenInput
onRenderDeleteButtonContent: PropTypes.func,
// Same as props `onIsTokenEditable` of TokenInput
onIsEditable: PropTypes.func.isRequired,
// Same as props `onGetTokenEditableValue` of TokenInput
onGetEditableValue: PropTypes.func.isRequired,
// Same as props `onGetTokenErrorMessage` of TokenInput
Expand Down
2 changes: 1 addition & 1 deletion dist/react-customize-token-input.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 8 additions & 13 deletions dist/react-customize-token-input.original.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! react-customize-token-input v1.4.2 | (c) 2021 Mark Lin. | MIT | https://github.com/seawind543/react-token-input */
/*! react-customize-token-input v1.5.0 | (c) 2021 Mark Lin. | MIT | https://github.com/seawind543/react-token-input */
.token-input-container {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
Expand All @@ -11,11 +11,6 @@
border: 1px solid #ccc;
border-radius: 4px;
outline: 0;
-webkit-transition: all 0.2s linear 0s;
-moz-transition: all 0.2s linear 0s;
-o-transition: all 0.2s linear 0s;
-ms-transition: all 0.2s linear 0s;
transition: all 0.2s linear 0s;
}
.token-input-container *,
.token-input-container *::before,
Expand Down Expand Up @@ -72,20 +67,20 @@
border-radius: 4px;
color: #0096cc;
background-color: #cceaf5;
cursor: default;
}
.token-input-container .token-input-token-list .token-input-token:hover {
background-color: #e6f4fc;
}
.token-input-container .token-input-token-list .token-input-token.token-input-token--error {
color: #db3d44;
background-color: #f9b5b5;
}
.token-input-container .token-input-token-list .token-input-token:hover {
cursor: pointer;
background-color: #e6f4fc;
}
.token-input-container .token-input-token-list .token-input-token:hover.token-input-token--error {
.token-input-container .token-input-token-list .token-input-token.token-input-token--error:hover {
background-color: #ffdada;
}
.token-input-container .token-input-token-list .token-input-token:hover.token-input-token--read-only {
cursor: default;
.token-input-container .token-input-token-list .token-input-token.token-input-token--editable:hover {
cursor: pointer;
}
.token-input-container .token-input-token-list .token-input-token.token-input-token--active .token-input-autosized-wrapper {
display: -webkit-box;
Expand Down
Loading

0 comments on commit b6275a7

Please sign in to comment.