1.1.0
Utility class to handle fetch requests.
Make a fetch call. This method ensures that all requests behave the same including handling SAML errors when a user's session times out.
Utility class that provdides CSS-related functionality.
Given two integers, find a new one that is "percentage" percent of the way from "from" to "to." Percentage is a number between 0 and 1.0. This is done over the squares of the numbers.
number
Takes two CSS colors, from and to, and calculates a new color "percentage" percent of the way from "from" to "to." Percentage should be between 0 and 1.0. Both the from and to parameters can be hex strings prefixed with an octothorpe (either 3 or 6 digits), expressions with rgb() or rgba(), or valid CSS color names. It always returns a hex encoded number prefixed with an octothorpe, e.g., "#f2a902," regardless of the format of the original colors.
string
Takes a CSS color, orig, and lightens it by the specified percentage, which should be between 0 and 1.0 (where 0 is the original color and 1.0 is white). (This is the equivalent of calling blendColors() with the value of "to" set to white.) The orig parameter can be a hex string prefixed with an octothorpe (either 3 or 6 digits), an expression with rgb() or rgba(), or a valid CSS color name. It always returns the color as a hex string prefixed with an octothorpe, e.g., "#f2a902," regardless of the format of the original color.
string
Takes a CSS color, orig, and darkens it by the specified percentage, which should be between 0 and 1.0 (where 0 is the original color and 1.0 is black). (This is the equivalent of calling blendColors() with the value of "to" set to black.) The orig parameter can be a hex string prefixed with an octothorpe (either 3 or 6 digits), an expression with rgb() or rgba(), or a valid CSS color name. It always returns the color as a hex string prefixed with an octothorpe, e.g., "#f2a902," regardless of the format of the original color.
string
Utility class for working with various types of JavaScript objects.
Utility class that provides various string-manipulation functionality.
Simply format a string/number combination based on the value of the number. The format parameter is a string containing multiple formatting templates separated by a pipe character (|). If there are two parts, then the first part is used if the value is 1 and the second part is used if the value is not 1 (e.g., 0 or > 1). If there are three parts, then the first is used if the value is 0, the second if the value is 1 and the third if the value is > 1. (If there is only one part, then it's used in all cases.)
In any case, if the part of the string being used contains the characters '{}', that is substituted with the number itself, as a string.
(any)
the format string
(any)
the numeric value to switch on/replace with
Find the match for a regular expression in a string closest to the end of the string.
(string)
the string
(RegExp)
the regular expression
((number | null)
= null
)
and optional position in the string at which to stsrt
number
:
the position of the last match or -1 if none was found
Truncate the passed-in string so it is no longer than the number of characters specified by maxLen. The truncation will happen at a word boundary, if possible. Unless otherwise specified, an ellipsis is appended to the resulting string.
(string)
the string to truncate
(number)
the maximum number of characters to allow
(boolean
= true
)
if true, an ellipsis character will be appended to the
truncated string
string
:
the truncated string
Split the string onto multiple lines, separated with the given character, if the given limit is reached.
(string)
the string to wrap
(string
= '\n'
)
the line break string to use, optional—defaults to a newline
character but could be replaced with a string like
(number
= 50
)
the maximum number of characters to allow on any given row
string
:
the wrapped string
Take a number and format it as a string accordning to the specified format. The format string must consist of two main parts separated by a colon— before the colon is the number of decimal points that should be used when formatting the number. The remainder of the format string describes how to format the overall string with instances of "{}" being replaced with the formatted value—it can contanin separate to use if the number is 0, 1, or more than one, separated by pipe characters. For example: "2:${}" with 3.215 will produce the string "$3.22" "4:None|{}% More" with 0 will produce the string "None" "4:None|{}% More" with 72.324214566 will produce the string "72.3242% More" "0:No Queries|{} Query|{} Queries" with 0 will produce the string "No Queries" "0:No Queries|{} Query|{} Queries" with 1 will produce the string "1 Query" "0:No Queries|{} Query|{} Queries" with 72.1 will produce the string "72 Queries"
string
Normnalize a suggestion coming from autocomplete to make sure it doesn't have any special character. This involves lowercasing the string and replacing punctuation with spaces, except: detected email addresses are left intact if a period isn't followed by whitespace, it's left intact if one side of a hyphen is a number, it's left intact
This will also ensure that unwanted characters aren't included in simple query request (e.g. "?" will match exactly one character so if the suggestion is "who?" then documents containing "who" will not be found (but those with "whom" would).
(string)
the string to modify
string
:
the normalized string suitable for using in a query
Check to see if the given character is a punctuation character. This handles all punctuation, including various non-ASCII types like curly quotes, CJK punctuation, etc. Note that this doesn't check for whitespsce characters.
(string)
the character to check
boolean
:
true if it's a punctuation character.
Given a string and a position in the string, check to see if the adjacent characters preceeding the character at that position are digits, up until either a whitespace character, a punctuation character, or the beginning of the string.
(string)
the string to check
(number)
the position of the character before which to start looking
boolean
:
true if the preceeding characters are all digits
Given a string and a position in the string, check to see if the adjacent characters following the character at that position are digits, up until either a whitespace character, a punctuation character, or the end of the string.
(string)
the string to check
(number)
the position of the character after which to start looking
boolean
:
true if the following characters are all digits
Find any punctuation characters in the given string and replace them with a space character. Ignores periods that aren't followed by whitespace or other punctuation and ignores hyphens if the "word" immediately before or after them is comprised solely of digits.
(string)
the string to strip
string
:
the modified string
Utility class with functions that help manipulate dates.
Format the date range presented for display in places such as tooltips on TimeSeries charts. Based on the difference in the start and end times, it will display either a single value or a range, with varying precision. For example, if the points are an hour apart, it will format based on the halfway point with precision to the hour, e.g., "March 14, 2017 2:00 AM." In some cases, the result will be a range, such as if they're a week apart, in which case you might get "June 14 - 21, 2018."
The point is to not clutter the formatted value with unnecessary information, essentially.
Here is a complete list of the possible formats:
(any)
(any)
Convert the response from a call to the Elasticsearch engine into an Attivio QueryResponse so that it can be processed by the Search UI.
Convert the response from a call to the Solr engine into an Attivio QueryResponse so that it can be processed by the Search UI.
Do the conversion.
(any)
the JSON returned from the call
(any)
the custom options defined in the configuration
QueryResponse
Turn non-array field values into arrays.
(any)
Utility class for handling auhentication in SUIT-based applications. Also handles configuration of application including the configuration used for components wrapped with the Configurable higher-order component.
The special role representing a top-level admin, granting full permission.
Called by the application to pass in configuration to the library's utility and API classes.
(any)
the contents of the users.xml file, converted to JavaScript objects
(any)
the contents of the configuration.properties.js file with any
maps converted already
(boolean
= false
)
if set to true, then a lot of the validation
specific to search applications won't be done
(string | null)
:
a configuraiton error message, if one occurred
Go through the passed in object and conver any nested objects to JavaScript Map objects if and only if their name starts with a lowercase letter. Thus orig.ALL and orig.Masthead won't be converted but orig.ALL.entityColors will.
(any)
any
Logs the currently logged-in user out.
Attempt to log the specified user in. If an error occurs logging in, then it is returned. Otherwise this returns null. The log in is valid for the timeout set in the authentication configuration.
(Error | null)
Save the currently logged-in user's info into session storage for easy access.
(any)
Get the full info object for a logged-in user we already know about. If no user is logged in or if the logged-in user's login has expired, then this method returns null.
any
Get the full info object for the logged-in user and call the passed-in callback function with this info. If no user is logged in, the callback is passed null.
(function (any): void)
a function which takes the user info as a parameter
Utility functions used by the KnowledgeGraphPanel component to construct the queries needed for populating it's graph.
Build up the query to use to get the knowledge graph's documents. The results of the query will be the main document (the one whose ID is passed in) with any related documents listed as its children.
(string)
the ID of the document to look up.
((string | null))
the name of the table containing the document, if you want to exclude
joining to other documents in the same table (pass null to join with
any document, regardless of its table)
(string)
(number)
the maximum number of additional documents to return
((string | null))
((string | null))
string
Create a graph from the search results. The main document should have children that represent the others. If firstIsPrimary is false, no document will be the primary (shadowed) one. If filterOutSingletons is false, then external "leaf" entity nodes will be shown
GraphDefinition