code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function getExtension(type, name) { return getMap({ map: extensions, keys: [type, name] }); }
@brief : Function used for keeping track of compound node sizes, since they should bound all their subnodes.
getExtension
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function setModule(type, name, moduleType, moduleName, registrant) { return setMap({ map: modules, keys: [type, name, moduleType, moduleName], value: registrant }); }
@brief : Function used for keeping track of compound node sizes, since they should bound all their subnodes.
setModule
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function getModule(type, name, moduleType, moduleName) { return getMap({ map: modules, keys: [type, name, moduleType, moduleName] }); }
@brief : Function used for keeping track of compound node sizes, since they should bound all their subnodes.
getModule
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
extension = function extension() { // e.g. extension('renderer', 'svg') if (arguments.length === 2) { return getExtension.apply(null, arguments); } // e.g. extension('renderer', 'svg', { ... }) else if (arguments.length === 3) { return setExtension.apply(null, arguments); } // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') else if (arguments.length === 4) { return getModule.apply(null, arguments); } // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) else if (arguments.length === 5) { return setModule.apply(null, arguments); } else { error('Invalid extension access syntax'); } }
@brief : Function used for keeping track of compound node sizes, since they should bound all their subnodes.
extension
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
Stylesheet = function Stylesheet() { if (!(this instanceof Stylesheet)) { return new Stylesheet(); } this.length = 0; }
@brief : Function used for keeping track of compound node sizes, since they should bound all their subnodes.
Stylesheet
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
cytoscape = function cytoscape(options) { // if no options specified, use default if (options === undefined) { options = {}; } // create instance if (plainObject(options)) { return new Core(options); } // allow for registration of extensions else if (string(options)) { return extension.apply(extension, arguments); } }
@brief : Function used for keeping track of compound node sizes, since they should bound all their subnodes.
cytoscape
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
now = function() { return root.Date.now(); }
Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). @static @memberOf _ @since 2.4.0 @category Date @returns {number} Returns the timestamp. @example _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // => Logs the number of milliseconds it took for the deferred invocation.
now
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result = wait - timeSinceLastCall; return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
debounce
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
invokeFunc
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
leadingEdge
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result = wait - timeSinceLastCall; return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
remainingWait
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
shouldInvoke
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
timerExpired
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
trailingEdge
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
cancel
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function flush() { return timerId === undefined ? result : trailingEdge(now()); }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
flush
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; }
Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation. **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout. If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`. See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. @static @memberOf _ @since 0.1.0 @category Function @param {Function} func The function to debounce. @param {number} [wait=0] The number of milliseconds to delay. @param {Object} [options={}] The options object. @param {boolean} [options.leading=false] Specify invoking on the leading edge of the timeout. @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's invoked. @param {boolean} [options.trailing=true] Specify invoking on the trailing edge of the timeout. @returns {Function} Returns the new debounced function. @example // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel);
debounced
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); }
Checks if `value` is the [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) @static @memberOf _ @since 0.1.0 @category Lang @param {*} value The value to check. @returns {boolean} Returns `true` if `value` is an object, else `false`. @example _.isObject({}); // => true _.isObject([1, 2, 3]); // => true _.isObject(_.noop); // => true _.isObject(null); // => false
isObject
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function isObjectLike(value) { return !!value && typeof value == 'object'; }
Checks if `value` is object-like. A value is object-like if it's not `null` and has a `typeof` result of "object". @static @memberOf _ @since 4.0.0 @category Lang @param {*} value The value to check. @returns {boolean} Returns `true` if `value` is object-like, else `false`. @example _.isObjectLike({}); // => true _.isObjectLike([1, 2, 3]); // => true _.isObjectLike(_.noop); // => false _.isObjectLike(null); // => false
isObjectLike
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); }
Converts `value` to a number. @static @memberOf _ @since 4.0.0 @category Lang @param {*} value The value to process. @returns {number} Returns the number. @example _.toNumber(3.2); // => 3.2 _.toNumber(Number.MIN_VALUE); // => 5e-324 _.toNumber(Infinity); // => Infinity _.toNumber('3.2'); // => 3.2
toNumber
javascript
pistazie/cdk-dia
src/render/cytoscape/base/js/app.8e9fe77f.js
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
MIT
function f() { return (0, p.jsxs)(a.WI, { title: 'Drawers', lead: 'A navigation drawer slides in from the left and contains the navigation destinations for your app.', module: '@rmwc/drawer', styles: ['@material/drawer/dist/mdc.drawer.css'], docsLink: 'https://material.io/develop/web/components/drawers/', examples: s, children: [ (0, p.jsx)(a.sb, { children: 'Permanent' }), (0, p.jsx)(a.PJ, { children: 'These are drawers that are permanently fixed inside of a view.' }), (0, p.jsx)(a.q3, { children: (0, p.jsxs)(l.dy, { children: [ (0, p.jsxs)(l.OX, { children: [ (0, p.jsx)(l.iI, { children: 'DrawerHeader' }), (0, p.jsx)(l.I1, { children: 'Subtitle' }) ] }), (0, p.jsx)(l.sc, { children: (0, p.jsxs)(c.a, { children: [ (0, p.jsx)(u.HC, { children: 'Cookies' }), (0, p.jsx)(u.HC, { children: 'Pizza' }), (0, p.jsx)(u.HC, { children: 'Icecream' }) ] }) }) ] }) }), (0, p.jsx)(a.sb, { children: 'Dismissible' }), (0, p.jsx)(a.PJ, { children: 'These are drawers that can be toggled to an open or closed state inside of a view, but still takes up viewable space when closed.' }), (0, p.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, p.jsxs)(p.Fragment, { children: [ (0, p.jsxs)('div', { style: { overflow: 'hidden', position: 'relative' }, children: [ (0, p.jsxs)(l.dy, { dismissible: !0, open: n, children: [ (0, p.jsxs)(l.OX, { children: [ (0, p.jsx)(l.iI, { children: 'DrawerHeader' }), (0, p.jsx)(l.I1, { children: 'Subtitle' }) ] }), (0, p.jsx)(l.sc, { children: (0, p.jsxs)(c.a, { children: [ (0, p.jsx)(u.HC, { children: 'Cookies' }), (0, p.jsx)(u.HC, { children: 'Pizza' }), (0, p.jsx)(u.HC, { children: 'Icecream' }) ] }) }) ] }), (0, p.jsx)(l.px, { style: { minHeight: '15rem', padding: '1rem' }, children: 'DrawerAppContent is an optional component that will resize content when the dismissible drawer is open and closed. It must be placed directly after the Drawer component.' }) ] }), (0, p.jsx)('div', { style: { textAlign: 'center' }, children: (0, p.jsx)(d.z, { onClick: function () { return a(!n); }, raised: !0, children: 'Toggle Dismissible' }) }) ] }); } }), (0, p.jsx)(a.sb, { children: 'Modal' }), (0, p.jsx)(a.PJ, { children: 'These are drawers that can be temporarily displayed fixed on the side of the entire viewport.' }), (0, p.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, p.jsxs)(p.Fragment, { children: [ (0, p.jsxs)(l.dy, { modal: !0, open: n, onClose: function () { return a(!1); }, children: [ (0, p.jsxs)(l.OX, { children: [ (0, p.jsx)(l.iI, { children: 'DrawerHeader' }), (0, p.jsx)(l.I1, { children: 'Subtitle' }) ] }), (0, p.jsx)(l.sc, { children: (0, p.jsxs)(c.a, { children: [ (0, p.jsx)(u.HC, { children: 'Cookies' }), (0, p.jsx)(u.HC, { children: 'Pizza' }), (0, p.jsx)(u.HC, { children: 'Icecream' }) ] }) }) ] }), (0, p.jsx)(d.z, { onClick: function () { return a(!n); }, raised: !0, children: 'Toggle Modal' }) ] }); } }), (0, p.jsx)(a.sb, { children: 'Right Side Drawers' }), (0, p.jsx)(a.PJ, { children: "`material-components-web` doesn't directly support right hand drawers, but it respects the `dir` attribute on DOM elements. This simple hack will allow you to get drawers that appear from the right hand side of your app. As an aside, the `dir` attribute can be used to invert many other behaviors where the element is anchored on the left." }), (0, p.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, p.jsxs)(p.Fragment, { children: [ (0, p.jsxs)(l.dy, { dir: 'rtl', modal: !0, open: n, onClose: function () { return a(!1); }, children: [ (0, p.jsxs)(l.OX, { dir: 'ltr', children: [ (0, p.jsx)(l.iI, { children: 'Right Drawer' }), (0, p.jsx)(l.I1, { children: 'Subtitle' }) ] }), (0, p.jsx)(l.sc, { dir: 'ltr', children: (0, p.jsxs)(c.a, { children: [ (0, p.jsx)(u.HC, { children: 'Cookies' }), (0, p.jsx)(u.HC, { children: 'Pizza' }), (0, p.jsx)(u.HC, { children: 'Icecream' }) ] }) }) ] }), (0, p.jsx)(d.z, { onClick: function () { return a(!n); }, raised: !0, children: 'Toggle Right Drawer' }) ] }); } }), (0, p.jsx)(a.PQ, { src: o, components: [ { displayName: 'Drawer', component: l.dy }, { displayName: 'DrawerHeader', component: l.OX }, { displayName: 'DrawerTitle', component: l.iI }, { displayName: 'DrawerSubtitle', component: l.I1 }, { displayName: 'DrawerContent', component: l.sc }, { displayName: 'DrawerAppContent', component: l.px } ] }) ] }); }
Set the content back to left-to-right
f
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function u() { return (0, c.jsxs)(a.WI, { title: 'Elevation', lead: 'Elevation is the relative distance between two surfaces along the z-axis.', module: '@rmwc/elevation', styles: ['@material/elevation/dist/mdc.elevation.css'], docsLink: 'https://material.io/develop/web/components/elevation/', examples: s, children: [ (0, c.jsx)(a.q3, { label: 'Elevation', children: (0, c.jsx)(c.Fragment, { children: Array(25) .fill(void 0) .map(function (e, t) { return (0, c.jsxs)(l.u, { z: t, children: [t, 'dp'] }, t); }) }) }), (0, c.jsx)(a.q3, { label: 'Transition', children: function () { var e = i.useState(0), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, c.jsxs)(l.u, { z: n, transition: !0, onMouseOver: function () { return a(24); }, onMouseOut: function () { return a(0); }, children: ['Hover Me ', n, 'dp'] }); } }), (0, c.jsx)(a.sb, { children: 'Wrapping Children' }), (0, c.jsx)(a.PJ, { children: 'You can avoid adding extra DOM nodes by using the `wrap` prop on elevation. This will apply the classes directly to the child component. Additionally, Elevation is simply a `className`, so you can achieve the same effect by adding `className="mdc-elevation--z15"`.' }), (0, c.jsx)(a.q3, { children: (0, c.jsx)(l.u, { z: 21, wrap: !0, children: (0, c.jsx)('span', { children: 'Wrapped!' }) }) }), (0, c.jsx)(a.PQ, { src: o, components: [{ displayName: 'Elevation', component: l.u }] }) ] }); }
Set the content back to left-to-right
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function l() { return (0, s.jsxs)(r.WI, { title: 'Fabs', lead: 'A floating action button (FAB) represents the primary action of a screen.', module: '@rmwc/fab', styles: [ '@material/fab/dist/mdc.fab.css', '@rmwc/icon/icon.css', '@material/ripple/dist/mdc.ripple.css' ], docsLink: 'https://material.io/develop/web/components/buttons/floating-action-buttons/', examples: a, children: [ (0, s.jsx)(r.q3, { label: 'Default', children: (0, s.jsx)(o.L, { icon: 'favorite' }) }), (0, s.jsx)(r.q3, { label: 'Mini', children: (0, s.jsx)(o.L, { icon: 'favorite', mini: !0 }) }), (0, s.jsx)(r.q3, { label: 'Extended', children: (0, s.jsxs)(s.Fragment, { children: [ (0, s.jsx)(o.L, { icon: 'add', label: 'Create' }), (0, s.jsx)(o.L, { trailingIcon: 'add', label: 'Create' }), (0, s.jsx)(o.L, { label: 'Label only' }) ] }) }), (0, s.jsx)(r.q3, { label: 'Theming', children: (0, s.jsxs)(s.Fragment, { children: [ (0, s.jsx)(o.L, { icon: 'favorite_outline', theme: ['primaryBg', 'onPrimary'] }), (0, s.jsx)(o.L, { icon: 'delete', style: { backgroundColor: 'var(--mdc-theme-error)' }, theme: ['onError'] }) ] }) }), (0, s.jsx)(r.PQ, { src: i, components: [{ displayName: 'Fab', component: o.L }] }) ] }); }
Set the content back to left-to-right
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function (e, t) { return ( (s = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), s(e, t) ); }
Set the content back to left-to-right
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
l = function () { return ( (l = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), l.apply(this, arguments) ); }
Set the content back to left-to-right
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, l(l({}, t.defaultAdapter), n)) || this; return ( (r.shakeAnimationEndHandler_ = function () { return r.handleShakeAnimationEnd_(); }), r ); }
Set the content back to left-to-right
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
Set the content back to left-to-right
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
o = function (e, t) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), o(e, t) ); }
Set the content back to left-to-right
o
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function () { return ( (s = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), s.apply(this, arguments) ); }
Set the content back to left-to-right
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, s(s({}, t.defaultAdapter), n)) || this; return ( (r.click = function () { r.handleClick(); }), r ); }
Set the content back to left-to-right
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
Set the content back to left-to-right
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function m() { return (0, f.jsxs)(s.WI, { title: 'Grid Lists', lead: 'Grid lists are an alternative to standard list views. Note that as of Material Components Web 6.0.0, this component is deprecated.', module: '@rmwc/grid-list', styles: ['@material/grid-list/dist/mdc.grid-list.css'], docsLink: 'https://material.io/components/web/catalog/grid-lists/', examples: c, children: [ (0, f.jsx)(s.q3, { children: function () { var e = o.useState({ tileGutter1: !1, headerCaption: !1, twolineCaption: !1, withIconAlignStart: !1, tileAspect: '1x1' }), t = (0, a.Z)(e, 2), n = t[0], s = t[1]; return (0, f.jsxs)(f.Fragment, { children: [ (0, f.jsx)(u.e_, { tileGutter1: n.tileGutter1, headerCaption: n.headerCaption, twolineCaption: n.twolineCaption, withIconAlignStart: n.withIconAlignStart, tileAspect: n.tileAspect, children: Array(8) .fill(void 0) .map(function (e, t) { return (0, f.jsxs)(u.$X, { children: [(0, f.jsx)(u.co, { children: (0, f.jsx)(u.lu, { src: 'images/backgrounds/mb-bg-fb-06.png', alt: 'test' }) }), (0, f.jsxs)(u.mu, { children: [(0, f.jsx)(u.F3, { icon: 'info' }), (0, f.jsxs)(u.uB, { children: ['Tile ', t + 1] })] })] }, t); }) }), [ 'tileGutter1', 'headerCaption', 'twoLineCaption', 'withIconAlignStart' ].map(function (e) { return (0, f.jsx)( d.X, { label: e, onChange: function (t) { return s( (0, i.Z)( (0, i.Z)({}, n), {}, (0, r.Z)({}, e, t.currentTarget.checked) ) ); } }, e ); }), (0, f.jsx)(p.P, { value: n.tileAspect, onChange: function (e) { return s( (0, i.Z)( (0, i.Z)({}, n), {}, { tileAspect: String(e.currentTarget.value) } ) ); }, label: 'tileAspect', options: ['1x1', '16x9', '2x3', '3x2', '4x3', '3x4'] }) ] }); } }), (0, f.jsx)(s.PQ, { src: l, components: [ { displayName: 'GridList', component: u.e_ }, { displayName: 'GridTile', component: u.$X }, { displayName: 'GridTileIcon', component: u.F3 }, { displayName: 'GridTilePrimary', component: u.co }, { displayName: 'GridTileSecondary', component: u.mu }, { displayName: 'GridTileTitleSupportText', component: u.O$ }, { displayName: 'GridTileTitle', component: u.uB } ] }) ] }); }
Set the content back to left-to-right
m
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function l() { return (0, s.jsxs)(r.WI, { title: 'Layout Grid', lead: 'Material design\u2019s responsive UI is based on a column-variate grid layout. It has 12 columns on desktop, 8 columns on tablet and 4 columns on phone.', module: '@rmwc/grid', styles: ['@material/layout-grid/dist/mdc.layout-grid.css'], docsLink: 'https://material.io/develop/web/components/layout-grid/', examples: a, children: [ (0, s.jsx)(r.q3, { label: 'Standard Grid', children: (0, s.jsxs)(o.rj, { children: [ (0, s.jsx)(o.r8, { span: 4, children: '1' }), (0, s.jsx)(o.r8, { span: 4, children: '2' }), (0, s.jsx)(o.r8, { span: 4, children: '3' }) ] }) }), (0, s.jsx)(r.q3, { label: 'Sub Grids', children: (0, s.jsx)(o.rj, { children: (0, s.jsxs)(o.Jn, { children: [ (0, s.jsx)(o.r8, { span: 6, children: '1' }), (0, s.jsx)(o.r8, { span: 6, children: (0, s.jsxs)(o.Jn, { children: [ (0, s.jsx)(o.r8, { span: 6, children: 'a' }), (0, s.jsx)(o.r8, { span: 6, children: 'b' }) ] }) }) ] }) }) }), (0, s.jsx)(r.PQ, { src: i, components: [ { displayName: 'Grid', component: o.rj }, { displayName: 'GridCell', component: o.r8 }, { displayName: 'GridRow', component: o.Jn } ] }) ] }); }
Set the content back to left-to-right
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
u = function (e, t) { return ( (u = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), u(e, t) ); }
Set the content back to left-to-right
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
d = function () { return ( (d = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), d.apply(this, arguments) ); }
Set the content back to left-to-right
d
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, d(d({}, t.defaultAdapter), n)) || this; return (r.hasToggledAriaLabel = !1), r; }
Set the content back to left-to-right
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
Set the content back to left-to-right
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function u() { return (0, c.jsxs)(a.WI, { title: 'Icon Buttons', lead: 'Icon buttons allow users to take actions, and make choices, with a single tap.', module: '@rmwc/icon-button', styles: [ '@material/icon-button/dist/mdc.icon-button.css', '@rmwc/icon/icon.css', '@material/ripple/dist/mdc.ripple.css' ], docsLink: 'https://material.io/develop/web/components/buttons/icon-buttons/', examples: s, children: [ (0, c.jsx)(a.sb, { children: 'Basic Usage' }), (0, c.jsx)(a.PJ, { children: '`IconButton` inherits from the `Icon` component and can be passed icons in the same way.' }), (0, c.jsx)(a.q3, { label: 'Default', children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(l.h, { icon: 'star', label: 'Rate this!' }), (0, c.jsx)(l.h, { icon: 'favorite', label: 'Favorite', disabled: !0 }), (0, c.jsx)(l.h, { icon: 'images/icons/twitter.png', 'aria-label': 'Tweet it!', tag: 'a', target: '_blank', href: 'https://twitter.com/intent/tweet?text='.concat( encodeURIComponent( 'You should definitely be using RMWC for your next project! https://rmwc.io' ) ) }) ] }) }), (0, c.jsx)(a.sb, { children: 'Usage as a Toggle' }), (0, c.jsx)(a.PJ, { children: "To use as a toggle, specify an additional toggled on state using 'onIcon'." }), (0, c.jsx)(a.q3, { label: 'Uncontrolled', children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(l.h, { icon: 'favorite_border', onIcon: 'favorite' }), (0, c.jsx)(l.h, { icon: 'favorite', onIcon: 'favorite', disabled: !0 }) ] }) }), (0, c.jsx)(a.q3, { label: 'Controlled', children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(l.h, { checked: n, onClick: function () { return a(!n); }, onIcon: 'star', icon: 'star_border' }), (0, c.jsx)(l.h, { checked: n, onClick: function () { return a(!n); }, onIcon: 'images/icons/twitter.png', icon: 'images/icons/facebook.png' }) ] }); } }), (0, c.jsx)(a.q3, { label: 'Component as Icon', children: (0, c.jsx)(l.h, { onIcon: (0, c.jsx)('div', { style: { background: 'red', width: '24px', height: '24px' } }), icon: (0, c.jsx)('div', { style: { background: 'green', width: '24px', height: '24px', borderRadius: '50%' } }) }) }), (0, c.jsx)(a.PQ, { src: o, components: [{ displayName: 'IconButton', component: l.h }] }) ] }); }
Set the content back to left-to-right
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
y = function (e, t, n) { return 'auto' === (t = t || n || 'auto') ? (function (e) { return 'string' === typeof e && e.includes('/') ? 'url' : o.isValidElement(e) ? 'component' : 'ligature'; })(e) : t; }
Set the content back to left-to-right
y
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function u() { return (0, c.jsxs)(r.WI, { title: 'Icons', lead: 'Material icons use geometric shapes to visually represent core ideas, capabilities, or topics.', module: '@rmwc/icon', styles: ['@rmwc/icon/icon.css'], docsLink: 'https://material.io/icons', examples: a, children: [ (0, c.jsx)(r.sb, { children: 'Setup' }), (0, c.jsx)(r.PJ, { children: "Icons are not part of the official material-components-web spec, but they are referenced many times in the documentation. RMWC provides a declarative way to use icons. Note that RMWC does not ship with any icons of its own. Make sure you include an icon set! You can use any one you want, but Google's Material Icons are available through open source. Follow Google's developer guide to get them setup with your app. https://google.github.io/material-design-icons/" }), (0, c.jsx)(r.PJ, { children: "There are lots of different strategies for implementing icons on the web, and the Icon component is flexible for most of them. Use ligatures, classNames, inline SVGs, HTML, or URLs to get icons into your app. The default strategy is 'ligature' which works with the material.io font icon set." }), (0, c.jsx)(r.sb, { children: 'Basic Usage' }), (0, c.jsx)(r.PJ, { children: 'The Icon component, (really the icon prop itself) can accept a variety of formats. Anywhere you see a component prop like `icon` or `trailingIcon` will inherit the same behavior.' }), (0, c.jsx)(r.q3, { label: 'String', children: (0, c.jsx)(o.J, { icon: 'favorite' }) }), (0, c.jsx)(r.q3, { label: 'Child Component', children: (0, c.jsx)(o.J, { icon: (0, c.jsx)('div', { style: { background: 'green', width: '24px', height: '24px', borderRadius: '100px' } }) }) }), (0, c.jsx)(r.q3, { label: 'Passing Options', children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(o.J, { icon: { icon: 'star', strategy: 'ligature' } }), (0, c.jsx)(s.z, { label: 'Hello!', icon: { icon: 'add', onMouseOver: function () { return console.log('OVER'); } } }) ] }) }), (0, c.jsx)(r.sb, { children: 'Icon Sizing' }), (0, c.jsx)(r.PJ, { children: "The Material spec details multiple sizes for icons. The Icon component doesn't assign a size by default, but these are available to you to force a size. Please note, this will only work if you've included the RMWC icon css file." }), (0, c.jsx)(r.q3, { children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(o.J, { icon: { icon: 'favorite', size: 'xsmall' } }), (0, c.jsx)(o.J, { icon: { icon: 'favorite', size: 'small' } }), (0, c.jsx)(o.J, { icon: { icon: 'favorite', size: 'medium' } }), (0, c.jsx)(o.J, { icon: { icon: 'favorite', size: 'large' } }), (0, c.jsx)(o.J, { icon: { icon: 'favorite', size: 'xlarge' } }) ] }) }), (0, c.jsx)(r.sb, { children: 'Ligatures' }), (0, c.jsx)(r.PJ, { children: "This is for icon fonts that support ligatures like material-icons. This is the default strategy if nothing is set and doesn't require any additional setup if you are using material-icons." }), (0, c.jsx)(r.q3, { children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(o.J, { icon: 'favorite' }), (0, c.jsx)(o.J, { icon: 'favorite_outline' }), (0, c.jsx)(o.J, { icon: { icon: 'star', strategy: 'ligature' } }) ] }) }), (0, c.jsx)(r.sb, { children: 'URLs' }), (0, c.jsx)(r.PJ, { children: 'This is for icons that are accessible via HTTP(S) and will be loaded directly into an `img` tag. This can be auto-detected for things that look like urls. The image will be set as a backgroundImage of the icon. Make sure you impor the RMWC icon css file for this to work properly.' }), (0, c.jsx)(r.q3, { children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(o.J, { icon: 'images/icons/twitter.png' }), (0, c.jsx)(o.J, { icon: { icon: 'images/icons/twitter.png', strategy: 'url' } }) ] }) }), (0, c.jsx)(r.sb, { children: 'Components / Inline SVGs' }), (0, c.jsx)(r.PJ, { children: 'This will render a child component inside of the icon. This is useful for all sorts of customization and for rendering inline SVGs. The following example shows rendering an SVG, as well as an arbitrary `div`.' }), (0, c.jsx)(r.q3, { children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(o.J, { icon: (0, c.jsx)('div', { style: { background: 'green', width: '24px', height: '24px', borderRadius: '100px' } }) }), (0, c.jsx)(o.J, { icon: { strategy: 'component', icon: (0, c.jsx)('svg', { style: { width: '24px', height: '24px' }, viewBox: '0 0 24 24', children: (0, c.jsx)('path', { fill: '#4285F4', d: 'M21.35,11.1H12.18V13.83H18.69C18.36,17.64 15.19,19.27 12.19,19.27C8.36,19.27 5,16.25 5,12C5,7.9 8.2,4.73 12.2,4.73C15.29,4.73 17.1,6.7 17.1,6.7L19,4.72C19,4.72 16.56,2 12.1,2C6.42,2 2.03,6.8 2.03,12C2.03,17.05 6.16,22 12.25,22C17.6,22 21.5,18.33 21.5,12.91C21.5,11.76 21.35,11.1 21.35,11.1V11.1Z' }) }) } }) ] }) }), (0, c.jsx)(r.sb, { children: 'Classnames' }), (0, c.jsx)(r.PJ, { children: "Some font icon sets like Ion Icons and Glyph Icons render based on a className that is set. RMWC docs doesn't include extra icon fonts so there is no example to render, but the below code should give you an approximation." }), (0, c.jsx)(r.PJ, { children: "**THIS CANNOT BE AUTO DETECTED**. You'll have to explicitly set the strategy directly on the Icon or specify it globally via the RMWCProvider." }), (0, c.jsx)(r.q3, { codeOnly: !0, children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(o.J, { icon: { icon: 'star', strategy: 'className', basename: 'icon', prefix: 'ion-' } }), (0, c.jsx)(l.pK, { icon: { strategy: 'className', basename: 'glyphicons', prefix: 'glyphicons-' }, children: (0, c.jsx)(o.J, { icon: 'heart' }) }) ] }) }), (0, c.jsx)(r.sb, { children: 'Custom Rendering' }), (0, c.jsx)(r.PJ, { children: 'Sometimes, you just need to do your own thing. Maybe you have a legacy project that already has icons and you want to incorporate them with RMWC. If none of the other strategies are what you need, then you can hijack the whole thing and delegate it to your own render function.' }), (0, c.jsx)(r.q3, { label: 'Simple Example', children: (0, c.jsx)(o.J, { icon: { icon: 'favorite', strategy: 'custom', render: function (e) { var t = e.content; return (0, c.jsxs)('div', { children: ['Hello + ', t] }); } } }) }), (0, c.jsx)(r.PJ, { children: "A more relevant example involves an app that has a custom / existing icon component. There are a litany of reasons why your app might need one, but if you've found this section of the docs you likely know what problem you need to solve." }), (0, c.jsx)(r.q3, { codeOnly: !0, children: "\n // 1) Your app has an icon component you use\n import { MyIconComponent } from '@rmwc/icon';\n <MyIconComponent name=\"search\" />\n\n // 2) Now you are using RMWC, lots of components are instances of Icons\n // You need to be able to delegate the handling of an icon prop to your own component\n import { TextField } from '@rmwc/textField';\n import { Chip } from '@rmwc/chip';\n <TextField icon=\"favorite\" />\n <Chip icon=\"favorite\" />\n\n // 3) Instead, you should set the custom strategy to be your default\n // and add your own handling with RMWCProvider\n import React from 'react';\n import * as ReactDOM from 'react-dom';\n import App from './App'; // your main app component\n import { RMWCProvider } from '@rmwc/provider';\n import { MyIconComponent } from '@rmwc/icon';\n\n const iconRenderHandler = ({ content, className, ...rest }) => {\n // content is whatever was passed to the icon prop\n\n // className is the fully processed className taking into account the basename and prefix defaults\n // it's important to include this because MDC often has classes like text-field-icon directly\n // on the component for alignment\n\n // rest is just any other props\n return <MyIconComponent className={className} name={content} {...rest} />\n };\n\n ReactDOM.render(\n <RMWCProvider icon={{strategy: 'custom', render: iconRenderHandler}}>\n <App />\n </RMWCProvider>,\n document.getElementById('root')\n );\n\n // 4) Now anywhere in your app that an Icon instance is used, it will be\n // delegated to your handler and render your custom component\n import { TextFieldIcon } from '@rmwc/textfield';\n <TextFieldIcon icon=\"search\" />\n " }), (0, c.jsx)(r.PQ, { src: i, components: [{ displayName: 'Icon', component: o.J }] }) ] }); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function l() { return (0, s.jsxs)(r.WI, { title: 'Image Lists', lead: 'MDC Image List provides a RTL-aware Material Design image list component, representing an evolution of the Material Design Grid List spec. An Image List consists of several items, each containing an image and optionally supporting content (i.e. a text label).', module: '@rmwc/image-list', styles: ['@material/image-list/dist/mdc.image-list.css'], docsLink: 'https://material.io/develop/web/components/image-lists/', examples: a, children: [ (0, s.jsx)(r.sb, { children: 'Standard Layout' }), (0, s.jsx)(r.PJ, { children: 'Image Lists will give you basic layout, but you will have to use inline styling or CSS to achieve things like spacing, aspect ratio, and column count. Check out the inline styles below as examples.' }), (0, s.jsx)(r.q3, { label: 'Default', children: (0, s.jsx)(o.Y, { children: [ 'images/photos/3x2-1.jpg', 'images/photos/2x3-1.jpg', 'images/photos/3x2-4.jpg', 'images/photos/3x2-5.jpg', 'images/photos/3x2-6.jpg', 'images/photos/2x3-2.jpg', 'images/photos/3x2-8.jpg', 'images/photos/3x2-11.jpg', 'images/photos/2x3-5.jpg', 'images/photos/3x2-13.jpg', 'images/photos/3x2-14.jpg', 'images/photos/2x3-6.jpg', 'images/photos/3x2-15.jpg', 'images/photos/3x2-16.jpg', 'images/photos/2x3-7.jpg' ].map(function (e) { return (0, s.jsxs)(o.W0, { style: { margin: '2px', width: 'calc(100% / 5 - 4.2px)' }, children: [(0, s.jsx)(o.i4, { style: { paddingBottom: 'calc(100% / 1.5)' }, children: (0, s.jsx)(o.OM, { src: e }) }), (0, s.jsx)(o.Bx, { children: (0, s.jsx)(o.rj, { children: 'Text label' }) })] }, e); }) }) }), (0, s.jsx)(r.sb, { children: 'Masonry Layout' }), (0, s.jsx)(r.q3, { children: (0, s.jsx)(o.Y, { masonry: !0, withTextProtection: !0, style: { columnCount: 5, columnGap: '16px', maxWidth: '1000px' }, children: [ 'images/photos/3x2-1.jpg', 'images/photos/2x3-1.jpg', 'images/photos/3x2-4.jpg', 'images/photos/3x2-5.jpg', 'images/photos/2x3-5.jpg', 'images/photos/3x2-6.jpg', 'images/photos/2x3-2.jpg', 'images/photos/3x2-8.jpg', 'images/photos/3x2-11.jpg', 'images/photos/3x2-13.jpg', 'images/photos/3x2-14.jpg', 'images/photos/2x3-6.jpg', 'images/photos/3x2-15.jpg', 'images/photos/2x3-7.jpg', 'images/photos/3x2-16.jpg' ].map(function (e) { return (0, s.jsxs)(o.W0, { style: { marginBottom: '16px' }, children: [(0, s.jsx)(o.OM, { src: e }), (0, s.jsx)(o.Bx, { children: (0, s.jsx)(o.rj, { children: 'Text label' }) })] }, e); }) }) }), (0, s.jsx)(r.PQ, { src: i, components: [ { displayName: 'ImageList', component: o.Y }, { displayName: 'ImageListItem', component: o.W0 }, { displayName: 'ImageListImageAspectContainer', component: o.i4 }, { displayName: 'ImageListImage', component: o.OM }, { displayName: 'ImageListSupporting', component: o.Bx }, { displayName: 'ImageListLabel', component: o.rj } ] }) ] }); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function (e, t) { return ( (s = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), s(e, t) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
l = function () { return ( (l = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), l.apply(this, arguments) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, l(l({}, t.defaultAdapter), n)) || this; return ( (r.transitionEndHandler_ = function (e) { return r.handleTransitionEnd(e); }), r ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function (e, t) { return ( (s = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), s(e, t) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
l = function () { return ( (l = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), l.apply(this, arguments) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function u(e) { return ( Boolean(e.document) && 'function' === typeof e.document.createElement ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function e(e) { void 0 === e && (e = {}), (this.adapter = e); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
e
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { return e.call(this, l(l({}, t.defaultAdapter), n)) || this; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
t = function (e, t, n, r) { var i, a = null !== (i = null === e || void 0 === e ? void 0 : e.querySelector(t)) && void 0 !== i ? i : null; a && (a.style[n] = r); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function l() { return (0, s.jsxs)(r.WI, { title: 'Linear Progress', lead: 'Progress and activity indicators are visual indications of an app loading content.', module: '@rmwc/linear-progress', styles: ['@material/linear-progress/dist/mdc.linear-progress.css'], docsLink: 'https://material.io/develop/web/components/linear-progress/', examples: a, children: [ (0, s.jsx)(r.q3, { label: 'Default', children: (0, s.jsx)(o.u, { progress: 0.5 }) }), (0, s.jsx)(r.q3, { label: 'Buffered', children: (0, s.jsx)(o.u, { progress: 0.6, buffer: 0.8 }) }), (0, s.jsx)(r.q3, { label: 'Indeterminate', children: (0, s.jsx)(o.u, {}) }), (0, s.jsx)(r.q3, { label: 'Reversed', children: (0, s.jsx)(o.u, { progress: 0.2, reversed: !0 }) }), (0, s.jsx)(r.PQ, { src: i, components: [{ displayName: 'LinearProgress', component: o.u }] }) ] }); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
g = function (e) { if (!e) return !1; var t = e.getAttribute('tabindex'); return !!(t && Number(t) >= 0) && (e.focus(), !0); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
g
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
b = function e(t, n) { if (!t) return null; var r = n ? t.previousElementSibling : t.nextElementSibling; return null === r ? e(t.parentElement, n) : r; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
b
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n(e) { var r; return ( (0, a.Z)(this, n), ((r = t.call(this, e)).childContainer = null), (r.root = null), (r.rafId = null), (r.timerId = null), (r.state = { open: !!r.props.defaultOpen || !!r.props.open, childrenStyle: {} }), (r.handleClick = r.handleClick.bind((0, s.Z)(r))), (r.handleKeydown = r.handleKeydown.bind((0, s.Z)(r))), (r.handleFocus = r.handleFocus.bind((0, s.Z)(r))), r ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function (e, t) { return ( (s = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), s(e, t) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
l = function () { return ( (l = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), l.apply(this, arguments) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
f = function (e) { var t = e.target; if (t) { var n = ('' + t.tagName).toLowerCase(); -1 === p.indexOf(n) && e.preventDefault(); } }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
f
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function m(e, t) { var n, r = e.nextChar, i = e.focusItemAtIndex, a = e.sortedIndexByFirstChar, o = e.focusedItemIndex, s = e.skipFocus, l = e.isItemAtIndexDisabled; return ( clearTimeout(t.bufferClearTimeout), (t.bufferClearTimeout = setTimeout(function () { g(t); }, d.KT.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS)), (t.typeaheadBuffer = t.typeaheadBuffer + r), (n = 1 === t.typeaheadBuffer.length ? (function (e, t, n, r) { var i = r.typeaheadBuffer[0], a = e.get(i); if (!a) return -1; if ( i === r.currentFirstChar && a[r.sortedIndexCursor].index === t ) { r.sortedIndexCursor = (r.sortedIndexCursor + 1) % a.length; var o = a[r.sortedIndexCursor].index; if (!n(o)) return o; } r.currentFirstChar = i; var s, l = -1; for (s = 0; s < a.length; s++) if (!n(a[s].index)) { l = s; break; } for (; s < a.length; s++) if (a[s].index > t && !n(a[s].index)) { l = s; break; } if (-1 !== l) return ( (r.sortedIndexCursor = l), a[r.sortedIndexCursor].index ); return -1; })(a, o, l, t) : (function (e, t, n) { var r = n.typeaheadBuffer[0], i = e.get(r); if (!i) return -1; var a = i[n.sortedIndexCursor]; if ( 0 === a.text.lastIndexOf(n.typeaheadBuffer, 0) && !t(a.index) ) return a.index; var o = (n.sortedIndexCursor + 1) % i.length, s = -1; for (; o !== n.sortedIndexCursor; ) { var l = i[o], c = 0 === l.text.lastIndexOf(n.typeaheadBuffer, 0), u = !t(l.index); if (c && u) { s = o; break; } o = (o + 1) % i.length; } if (-1 !== s) return ( (n.sortedIndexCursor = s), i[n.sortedIndexCursor].index ); return -1; })(a, l, t)), -1 === n || s || i(n), n ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
m
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function h(e) { return e.typeaheadBuffer.length > 0; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
h
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function g(e) { e.typeaheadBuffer = ''; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
g
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function b(e, t) { var n = e.event, r = e.isTargetListItem, i = e.focusedItemIndex, a = e.focusItemAtIndex, o = e.sortedIndexByFirstChar, s = e.isItemAtIndexDisabled, l = 'ArrowLeft' === (0, u.ku)(n), c = 'ArrowUp' === (0, u.ku)(n), d = 'ArrowRight' === (0, u.ku)(n), p = 'ArrowDown' === (0, u.ku)(n), g = 'Home' === (0, u.ku)(n), b = 'End' === (0, u.ku)(n), v = 'Enter' === (0, u.ku)(n), x = 'Spacebar' === (0, u.ku)(n); return l || c || d || p || g || b || v ? -1 : x || 1 !== n.key.length ? x ? (r && f(n), r && h(t) ? m( { focusItemAtIndex: a, focusedItemIndex: i, nextChar: ' ', sortedIndexByFirstChar: o, skipFocus: !1, isItemAtIndexDisabled: s }, t ) : -1) : -1 : (f(n), m( { focusItemAtIndex: a, focusedItemIndex: i, nextChar: n.key.toLowerCase(), sortedIndexByFirstChar: o, skipFocus: !1, isItemAtIndexDisabled: s }, t )); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
b
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, l(l({}, t.defaultAdapter), n)) || this; return ( (r.wrapFocus_ = !1), (r.isVertical_ = !0), (r.isSingleSelectionList_ = !1), (r.selectedIndex_ = d.KT.UNSET_INDEX), (r.focusedItemIndex = d.KT.UNSET_INDEX), (r.useActivatedClass_ = !1), (r.ariaCurrentAttrValue_ = null), (r.isCheckboxList_ = !1), (r.isRadioList_ = !1), (r.hasTypeahead = !1), (r.typeaheadState = { bufferClearTimeout: 0, currentFirstChar: '', sortedIndexCursor: 0, typeaheadBuffer: '' }), (r.sortedIndexByFirstChar = new Map()), r ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function c() { return (0, l.jsxs)(r.WI, { title: 'Lists', lead: 'Lists are continuous, vertical indexes of text or images.', module: '@rmwc/list', styles: [ '@material/list/dist/mdc.list.css', '@material/ripple/dist/mdc.ripple.css', '@rmwc/icon/icon.css' ], docsLink: 'https://material.io/develop/web/components/lists/', examples: a, children: [ (0, l.jsx)(r.sb, { children: 'Basic Usage' }), (0, l.jsx)(r.q3, { label: 'Default', children: (0, l.jsxs)(o.a, { children: [ (0, l.jsx)(s.HC, { children: 'Cookies' }), (0, l.jsx)(s.HC, { children: 'Pizza' }), (0, l.jsx)(s.HC, { children: 'Icecream' }) ] }) }), (0, l.jsx)(r.q3, { label: 'Fully Featured', children: (0, l.jsxs)(o.a, { twoLine: !0, children: [ (0, l.jsxs)(s.HC, { children: [ (0, l.jsx)(s.rk, { icon: 'star_border' }), (0, l.jsxs)(s.F_, { children: [ (0, l.jsx)(s.iY, { children: 'Cookies' }), (0, l.jsx)(s.N0, { children: '$4.99 a dozen' }) ] }), (0, l.jsx)(s.GN, { icon: 'info' }) ] }), (0, l.jsxs)(s.HC, { children: [ (0, l.jsx)(s.rk, { icon: 'local_pizza' }), (0, l.jsxs)(s.F_, { children: [ (0, l.jsx)(s.iY, { children: 'Pizza' }), (0, l.jsx)(s.N0, { children: '$1.99 a slice' }) ] }), (0, l.jsx)(s.GN, { icon: 'info' }) ] }), (0, l.jsxs)(s.HC, { activated: !0, children: [ (0, l.jsx)(s.rk, { icon: 'mood' }), (0, l.jsxs)(s.F_, { children: [ (0, l.jsx)(s.iY, { children: 'Icecream' }), (0, l.jsx)(s.N0, { children: '$0.99 a scoop' }) ] }), (0, l.jsx)(s.GN, { children: 'Winner!' }) ] }) ] }) }), (0, l.jsx)(r.sb, { children: 'Simplified Usage' }), (0, l.jsx)(r.PJ, { children: 'While there are siutations where you would need / want to compose the entire list yourself, it can be quite verbose. `SimpleListItem` provides a compact syntax that allows you to pass all options as props. The following example is roughly equivalent to the one above.' }), (0, l.jsx)(r.q3, { label: 'Simple', children: (0, l.jsxs)(o.a, { twoLine: !0, children: [ (0, l.jsx)(s.ug, { graphic: 'star_border', text: 'Cookies', secondaryText: 'Chocolate chip', metaIcon: 'info' }), (0, l.jsx)(s.ug, { graphic: 'local_pizza', text: 'Pizza', secondaryText: 'Pepperoni', metaIcon: 'info' }), (0, l.jsx)(s.ug, { activated: !0, graphic: 'mood', text: 'Icecream', secondaryText: 'Chocolate cookie dough', meta: 'Winner!' }) ] }) }), (0, l.jsx)(r.PQ, { src: i, components: [ { displayName: 'List', component: o.a }, { displayName: 'ListItem', component: s.HC }, { displayName: 'ListItemPrimaryText', component: s.iY }, { displayName: 'ListItemSecondaryText', component: s.N0 }, { displayName: 'ListItemGraphic', component: s.rk }, { displayName: 'ListItemMeta', component: s.GN }, { displayName: 'ListDivider', component: s.Rx }, { displayName: 'ListGroup', component: s.NX }, { displayName: 'ListGroupSubheader', component: s.JV }, { displayName: 'SimpleListItem', component: s.ug } ] }) ] }); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
c
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
g = function (e, t) { var n = (0, o.useState)(e.open), s = (0, l.Z)(n, 2), g = s[0], b = s[1], v = (0, o.useRef)(null), x = (0, o.useRef)(null), y = (0, o.useRef)(null), k = (0, o.useRef)(null), w = (0, c.j)({ props: e, elements: { rootEl: !0 }, api: function (e) { var t = e.foundation, n = e.rootEl; return { setAnchorCorner: function (e) { return t.setAnchorCorner(e); }, setAnchorElement: function (e) { return (y.current = e); }, setOpen: function (e) { return b(e); }, getSurfaceElement: function () { return n.ref; } }; }, foundation: function (e) { var t = e.rootEl, n = e.getProps, a = e.emit, o = function (e) { E.handleBodyClick(e); }, s = function () { document.body.removeEventListener('click', o), document.body.removeEventListener('touchstart', o); }, l = new f.k( (0, i.Z)( (0, i.Z)( { addClass: function (e) { t.addClass(e); }, removeClass: function (e) { t.removeClass(e); }, hasClass: function (e) { return 'mdc-menu-surface' === e || t.hasClass(e); }, hasAnchor: function () { return !!y.current; }, notifyClose: function () { s(), b(!1); }, notifyOpen: function () { a('onOpen', {}), setTimeout(function () { document.body.addEventListener('click', o), document.body.addEventListener( 'touchstart', o ); }, 150); }, isElementInContainer: function (e) { return ( t.ref === e || (!!t.ref && t.ref.contains(e)) ); }, isRtl: function () { return ( !!t.ref && 'rtl' === getComputedStyle(t.ref).getPropertyValue( 'direction' ) ); }, setTransformOrigin: function (e) { t.setStyle( ''.concat( (function (e, t) { if ( (void 0 === t && (t = !1), void 0 === r || t) ) { var n = e.document.createElement('div'); r = 'transform' in n.style ? 'transform' : 'webkitTransform'; } return r; })(window), '-origin' ), e ); } }, { isFocused: function () { return document.activeElement === t.ref; }, saveFocus: function () { x.current = document.activeElement; }, restoreFocus: function () { t.ref && t.ref.contains(document.activeElement) && x.current && x.current.focus && x.current.focus(); }, isFirstElementFocused: function () { return ( !!v.current && v.current === document.activeElement ); }, isLastElementFocused: function () { return ( !!v.current && v.current === document.activeElement ); }, focusFirstElement: function () { return ( !!v.current && v.current.focus && v.current.focus() ); }, focusLastElement: function () { return ( !!v.current && v.current.focus && v.current.focus() ); } } ), { getInnerDimensions: function () { return { width: t.ref ? t.ref.offsetWidth : 0, height: t.ref ? t.ref.offsetHeight : 0 }; }, getAnchorDimensions: function () { var e; return ( (null === (e = y.current) || void 0 === e ? void 0 : e.getBoundingClientRect()) || u.B ); }, getWindowDimensions: function () { return { width: window.innerWidth, height: window.innerHeight }; }, getBodyDimensions: function () { return { width: document.body.clientWidth, height: document.body.clientHeight }; }, getWindowScroll: function () { return { x: window.pageXOffset, y: window.pageYOffset }; }, setPosition: function (e) { t.setStyle( 'left', void 0 !== e.left ? e.left : null ), t.setStyle( 'right', void 0 !== e.right ? e.right : null ), t.setStyle( 'top', void 0 !== e.top ? e.top : null ), t.setStyle( 'bottom', void 0 !== e.bottom ? e.bottom : null ); }, setMaxHeight: function (e) { t.setStyle('maxHeight', e); } } ) ), c = l.close.bind(l); l.close = function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; a('onClose', {}), (k.current = window.setTimeout(function () { n().open || c(e); })); }; var d = l.destroy.bind(l); return ( (l.destroy = function () { s(), d(); }), l ); } }), E = w.foundation, T = (0, a.Z)(w, m), C = T.rootEl, S = e.onKeyDown, _ = (0, o.useCallback)( function (e) { null === S || void 0 === S || S(e), E.handleKeydown(e); }, [S, E] ); return ( C.setProp('onKeyDown', _, !0), (0, o.useEffect)( function () { E.setFixedPosition(!!e.fixed); }, [e.fixed, E] ), (0, o.useEffect)( function () { var e = (null === t || void 0 === t ? void 0 : t.current) || C.ref; if (e) { var n = (0, d.o)(e, '.'.concat(f.k.cssClasses.ANCHOR)); n && (y.current = n); } }, [t, C.ref] ), (0, o.useEffect)( function () { e.renderToPortal ? E.setIsHoisted(!0) : E.setIsHoisted(!1); var t = e.renderToPortal ? function () { try { E.autoposition(); } catch (e) {} } : function () {}; return ( (0, p.W)(function () { E.isOpen(); }), window.addEventListener('resize', t), function () { window.removeEventListener('resize', t); } ); }, [e.renderToPortal, E] ), (0, o.useEffect)( function () { var t = e.anchorCorner && (function (e) { return f.k.Corner[h[e]]; })(e.anchorCorner); if (void 0 !== t) { E.setAnchorCorner(t), (E.dimensions = E.adapter.getInnerDimensions()); try { E.autoposition(); } catch (n) {} } }, [e.anchorCorner, E] ), (0, o.useEffect)( function () { if (g) { var e = C.ref ? C.ref.querySelectorAll(f.k.strings.FOCUSABLE_ELEMENTS) : []; (v.current = e.length > 0 ? e[0] : null), E.open(); } else E.isOpen() && E.close(); }, [g, E, C.ref] ), (0, o.useEffect)( function () { b(!!e.open); }, [e.open] ), (0, o.useEffect)(function () { return function () { k.current && window.clearTimeout(k.current); }; }, []), (0, i.Z)({}, T) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
g
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function () { document.body.removeEventListener('click', o), document.body.removeEventListener('touchstart', o); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
m = function (e, t) { return ( (m = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), m(e, t) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
m
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
h = function () { return ( (h = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), h.apply(this, arguments) ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
h
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, h(h({}, t.defaultAdapter), n)) || this; return ( (r.closeAnimationEndTimerId_ = 0), (r.defaultFocusState_ = g.LIST_ROOT), r ); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
O = function (e) { return 'MenuItems' === (0, u.G)(e); }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
O
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
N = function (e) { return function (t) { var n = (0, o.useState)(!!t.open), s = (0, r.Z)(n, 2), l = s[0], c = s[1]; (0, o.useEffect)( function () { void 0 !== t.open && t.open !== l && c(!!t.open); }, [t.open, l] ); var u = t.handle, d = t.onClose, p = t.children, m = t.rootProps, h = void 0 === m ? {} : m, g = t.open, b = (t.foundationRef, (0, i.Z)(t, A)), v = o.cloneElement( u, (0, a.Z)( (0, a.Z)({}, u.props), {}, { onClick: function (e) { c(!l), u.props.onClick && u.props.onClick(e); } } ) ), x = e; return (0, _.jsxs)( f.W, (0, a.Z)( (0, a.Z)({}, h), {}, { children: [ (0, _.jsx)( x, (0, a.Z)( (0, a.Z)({}, b), {}, { onClose: function (e) { c(!!g || !1), null === d || void 0 === d || d(e); }, open: l, children: p } ) ), v ] } ) ); }; }
\\n * Set the option globally throug RMWCProvider\\n * Glyphicons <span class=\\\"glyphicons glyphicons-heart\\\"></span>\\n *
N
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function g() { return (0, h.jsxs)(a.WI, { title: 'Menus', lead: 'Menus display a list of choices on a transient sheet of material.', module: '@rmwc/menu', styles: [ '@material/menu/dist/mdc.menu.css', '@material/menu-surface/dist/mdc.menu-surface.css', '@material/ripple/dist/mdc.ripple.css', '@material/list/dist/mdc.list.css', '@rmwc/icon/icon.css' ], docsLink: 'https://material.io/develop/web/components/menus/', examples: s, children: [ (0, h.jsx)(a.sb, { children: 'Basic Usage' }), (0, h.jsx)(a.PJ, { children: 'You can compose a menu with the given components, and manually manage the open state. `Menu` expects MenuItems as children while `MenuSurface` is a generic container which can have anything as a child.' }), (0, h.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, h.jsxs)(l.W, { children: [ (0, h.jsxs)(c.v2, { open: n, onSelect: function (e) { return console.log(e.detail.index); }, onClose: function (e) { return a(!1); }, children: [ (0, h.jsx)(c.sN, { children: 'Cookies' }), (0, h.jsx)(c.sN, { children: 'Pizza' }), (0, h.jsx)(u.Rx, {}), (0, h.jsx)(c.sN, { children: 'Icecream' }) ] }), (0, h.jsx)(d.z, { raised: !0, onClick: function (e) { return a(!n); }, children: 'Menu' }) ] }); } }), (0, h.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, h.jsxs)(l.W, { children: [ (0, h.jsx)(l.g, { open: n, onClose: function (e) { return a(!1); }, children: (0, h.jsx)('div', { style: { padding: '1rem', width: '8rem' }, children: 'Make the content whatever you want.' }) }), (0, h.jsx)(d.z, { raised: !0, onClick: function (e) { return a(!n); }, children: 'Menu Surface' }) ] }); } }), (0, h.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, h.jsxs)(l.W, { children: [ (0, h.jsx)(l.g, { open: n, onClose: function (e) { return a(!1); }, children: (0, h.jsx)('div', { style: { padding: '1rem', width: '8rem' }, children: 'Menu' }) }), (0, h.jsx)(f.h, { icon: 'menu', onClick: function (e) { return a(!n); } }) ] }); } }), (0, h.jsx)(a.q3, { children: function () { var e = i.useState(!1), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, h.jsxs)(l.W, { children: [ (0, h.jsxs)(c.v2, { open: n, onSelect: function (e) { return console.log(e.detail.index); }, onClose: function (e) { return a(!1); }, children: [ (0, h.jsx)(c.sN, { children: 'Item One' }), (0, h.jsx)(c.sN, { disabled: !0, children: 'Item Two (disabled)' }), (0, h.jsx)(c.sN, { children: 'Item Three' }) ] }), (0, h.jsx)(d.z, { raised: !0, onClick: function () { return a(!n); }, children: 'Menu' }) ] }); } }), (0, h.jsx)(a.sb, { children: 'Simplified usage' }), (0, h.jsx)(a.PJ, { children: 'RMWC provides a convenience `SimpleMenu` component that takes a handle as a prop, and manages the open state for you.' }), (0, h.jsx)(a.q3, { children: (0, h.jsxs)(c.O2, { handle: (0, h.jsx)(d.z, { children: 'Simple Menu' }), children: [ (0, h.jsx)(c.sN, { children: 'Cookies' }), (0, h.jsx)(c.sN, { children: 'Pizza' }), (0, h.jsx)(c.sN, { children: 'Icecream' }) ] }) }), (0, h.jsx)(a.q3, { children: (0, h.jsx)(c.jf, { handle: (0, h.jsx)(d.z, { children: 'Simple Menu Surface' }), children: (0, h.jsx)('div', { style: { padding: '1rem', width: '8rem' }, children: 'Make the content whatever you want.' }) }) }), (0, h.jsx)(a.sb, { children: 'Anchoring' }), (0, h.jsx)(a.PJ, { children: 'By default, Menus will attempt to automatically position themselves, but this behavior can be overridden by setting the `anchorCorner` prop.' }), (0, h.jsx)(a.q3, { children: function () { var e = i.useState('topLeft'), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, h.jsxs)(h.Fragment, { children: [ (0, h.jsxs)(l.W, { children: [ (0, h.jsx)(l.g, { anchorCorner: n, open: !0, children: (0, h.jsxs)('div', { style: { padding: '1rem', width: '8rem' }, children: ['anchorCorner: ', n] }) }), (0, h.jsx)(d.z, { raised: !0, label: 'Anchored Menu' }) ] }), (0, h.jsx)(p.P, { value: n, label: 'anchorCorner', onChange: function (e) { return a(e.currentTarget.value); }, options: [ 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'topStart', 'topEnd', 'bottomStart', 'bottomEnd' ] }) ] }); } }), (0, h.jsx)(a.sb, { children: 'Rendering through Portals' }), (0, h.jsx)(a.PJ, { children: "Occasionally, you may find your menu being cut off from being inside a container that is styled to be `overflow:hidden`. RMWC provides a `renderToPortal` prop that lets you use React's portal functionality to render the menu dropdown in a different container." }), (0, h.jsx)(a.PJ, { children: "You can specify any element or selector you want, but the simplest method is to pass `true` and use RMWC's built in `Portal` component." }), (0, h.jsx)(a.q3, { codeOnly: !0, children: "\n // Somewhere at the top level of your app\n // Render the RMWC Portal\n // You only have to do this once\n import React from 'react';\n import { Portal } from '@rmwc/base';\n\n export default function App() {\n return (\n <div>\n ...\n <Portal />\n </div>\n )\n }\n " }), (0, h.jsx)(a.PJ, { children: 'Now you can use the `renderToPortal` prop. Below is a contrived example of a menu being cut off due to `overflow: hidden`.' }), (0, h.jsx)(a.q3, { children: function () { var e = i.useState(!0), t = (0, r.Z)(e, 2), n = t[0], a = t[1], o = i.useState(!1), s = (0, r.Z)(o, 2), u = s[0], p = s[1]; return (0, h.jsxs)(h.Fragment, { children: [ (0, h.jsx)('div', { style: { marginBottom: '10rem', height: '3.5rem', overflow: 'hidden' }, children: (0, h.jsxs)(l.W, { children: [ (0, h.jsx)(d.z, { raised: !0, onClick: function () { return p(!u); }, children: 'Open Menu' }), (0, h.jsx)(c.v2, { open: u, onClose: function () { return p(!1); }, renderToPortal: n, children: ['Cookies', 'Pizza', 'Icecream'].map( function (e) { return (0, h.jsx)(c.sN, { children: e }, e); } ) }) ] }) }), (0, h.jsx)(m.X, { checked: n, onChange: function (e) { return a(e.currentTarget.checked); }, label: 'renderToPortal' }) ] }); } }), (0, h.jsx)(a.PQ, { src: o, components: [ { displayName: 'Menu', component: c.v2 }, { displayName: 'MenuItem', component: c.sN }, { displayName: 'MenuSurface', component: l.g }, { displayName: 'MenuSurfaceAnchor', component: l.W }, { displayName: 'SimpleMenu', component: c.O2 }, { displayName: 'SimpleMenuSurface', component: c.jf } ] }) ] }); }
The handle can be any component you want
g
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
s = function (e, t) { return ( (s = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), s(e, t) ); }
The handle can be any component you want
s
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
l = function () { return ( (l = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), l.apply(this, arguments) ); }
The handle can be any component you want
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { return e.call(this, l(l({}, t.defaultAdapter), n)) || this; }
The handle can be any component you want
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
The handle can be any component you want
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
u = function () { return a.useContext(c); }
The handle can be any component you want
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
d = function (e) { var t = e.children, n = (0, i.Z)(e, s); return (0, o.jsx)(c.Provider, { value: (0, r.Z)((0, r.Z)({}, l), n), children: t }); }
The handle can be any component you want
d
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
u = function (e, t) { return ( (u = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), u(e, t) ); }
The handle can be any component you want
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
d = function () { return ( (d = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), d.apply(this, arguments) ); }
The handle can be any component you want
d
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { return e.call(this, d(d({}, t.defaultAdapter), n)) || this; }
The handle can be any component you want
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
The handle can be any component you want
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function u() { return (0, c.jsxs)(a.WI, { title: 'Radio Buttons', lead: 'Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive selection if you think that the user needs to see all available options side-by-side.', module: '@rmwc/radio', styles: [ '@material/radio/dist/mdc.radio.css', '@material/form-field/dist/mdc.form-field.css', '@material/ripple/dist/mdc.ripple.css' ], docsLink: 'https://material.io/develop/web/components/input-controls/radio-buttons/', examples: s, children: [ (0, c.jsx)(a.sb, { children: 'Controlled Usage' }), (0, c.jsx)(a.q3, { children: function () { var e = i.useState('cookies'), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(l.Y, { value: 'cookies', checked: 'cookies' === n, onChange: function (e) { return a(String(e.currentTarget.value)); }, children: 'Cookies' }), (0, c.jsx)(l.Y, { value: 'pizza', checked: 'pizza' === n, onChange: function (e) { return a(String(e.currentTarget.value)); }, children: 'Pizza' }), (0, c.jsx)(l.Y, { value: 'icecream', checked: 'icecream' === n, onChange: function (e) { return a(String(e.currentTarget.value)); }, children: 'Icecream' }) ] }); } }), (0, c.jsx)(a.sb, { children: 'Uncontrolled Usage' }), (0, c.jsx)(a.PJ, { children: 'You can use Radio Buttons and receive change events without having to manually set the `checked` prop. Just give the Radio components the same `name`. This example also shows using the `label` prop instead of setting the label as a child.' }), (0, c.jsx)(a.q3, { children: (0, c.jsxs)(c.Fragment, { children: [ (0, c.jsx)(l.Y, { label: 'Cookies', value: 'cookies', name: 'myRadioGroup', onChange: function (e) { return console.log(e.currentTarget.value); } }), (0, c.jsx)(l.Y, { label: 'Pizza', value: 'pizza', name: 'myRadioGroup', onChange: function (e) { return console.log(e.currentTarget.value); } }), (0, c.jsx)(l.Y, { label: 'Icecream', value: 'icecream', name: 'myRadioGroup', onChange: function (e) { return console.log(e.currentTarget.value); } }) ] }) }), (0, c.jsx)(a.PQ, { src: o, components: [{ displayName: 'Radio', component: l.Y }] }) ] }); }
The handle can be any component you want
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
b = function (e, t) { return ( (b = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), b(e, t) ); }
The handle can be any component you want
b
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
v = function () { return ( (v = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), v.apply(this, arguments) ); }
The handle can be any component you want
v
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function t(n) { var r = e.call(this, v(v({}, t.defaultAdapter), n)) || this; return ( (r.activationAnimationHasEnded_ = !1), (r.activationTimer_ = 0), (r.fgDeactivationRemovalTimer_ = 0), (r.fgScale_ = '0'), (r.frame_ = { width: 0, height: 0 }), (r.initialSize_ = 0), (r.layoutFrame_ = 0), (r.maxRadius_ = 0), (r.unboundedCoords_ = { left: 0, top: 0 }), (r.activationState_ = r.defaultActivationState_()), (r.activationTimerCallback_ = function () { (r.activationAnimationHasEnded_ = !0), r.runDeactivationUXLogicIfReady_(); }), (r.activateHandler_ = function (e) { return r.activate_(e); }), (r.deactivateHandler_ = function () { return r.deactivate_(); }), (r.focusHandler_ = function () { return r.handleFocus(); }), (r.blurHandler_ = function () { return r.handleBlur(); }), (r.resizeHandler_ = function () { return r.layout(); }), r ); }
The handle can be any component you want
t
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
The handle can be any component you want
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
A = function (e) { var t = (0, c.useRef)(!1), n = (0, m.j)({ props: e, elements: { rootEl: !0, surfaceEl: !0 }, foundation: function (e) { var t = e.rootEl, n = e.surfaceEl, r = e.getProps; return new _({ browserSupportsCssVars: function () { return (function (e, t) { void 0 === t && (t = !1); var n, r = e.CSS; if ('boolean' === typeof x && !t) return x; if (!r || 'function' !== typeof r.supports) return !1; var i = r.supports('--css-vars', 'yes'), a = r.supports('(--css-vars: yes)') && r.supports('color', '#00000000'); return (n = i || a), t || (x = n), n; })(window); }, isUnbounded: function () { return !!r().unbounded; }, isSurfaceActive: function () { return !!t.ref && (0, g.w)(t.ref, ':active'); }, isSurfaceDisabled: function () { return !!r().disabled; }, addClass: function (e) { n.addClass(e); }, removeClass: function (e) { n.removeClass(e); }, containsEventTarget: function (e) { return !!t.ref && t.ref.contains(e); }, registerInteractionHandler: function (e, t) {}, deregisterInteractionHandler: function (e, t) {}, registerDocumentInteractionHandler: function (e, t) { return document.documentElement.addEventListener(e, t, { passive: !0 }); }, deregisterDocumentInteractionHandler: function (e, t) { return document.documentElement.removeEventListener(e, t); }, registerResizeHandler: function (e) { return window.addEventListener('resize', e); }, deregisterResizeHandler: function (e) { return window.removeEventListener('resize', e); }, updateCssVariable: function (e, t) { return n.setStyle(e, t); }, computeBoundingRect: function () { return t.ref ? t.ref.getBoundingClientRect() : h.B; }, getWindowPageOffset: function () { return { x: window.pageXOffset, y: window.pageYOffset }; } }); } }), a = n.foundation, o = (0, r.Z)(n, P), s = o.rootEl, l = (0, c.useCallback)( function (e) { e.persist(), a.activate(e); }, [a] ), u = (0, c.useCallback)( function (e) { e.persist(), a.deactivate(); }, [a] ), d = e.onFocus, p = (0, c.useCallback)( function (e) { null === d || void 0 === d || d(e), a.handleFocus(); }, [a, d] ), f = e.onBlur, b = (0, c.useCallback)( function (e) { null === f || void 0 === f || f(e), a.handleBlur(); }, [a, f] ), v = e.onMouseDown, y = (0, c.useCallback)( function (e) { null === v || void 0 === v || v(e), t.current || l(e), (t.current = !1); }, [v, l] ), k = e.onMouseUp, w = (0, c.useCallback)( function (e) { null === k || void 0 === k || k(e), u(e); }, [k, u] ), E = e.onTouchStart, T = (0, c.useCallback)( function (e) { (t.current = !0), null === E || void 0 === E || E(e), l(e); }, [E, l] ), C = e.onTouchEnd, S = (0, c.useCallback)( function (e) { null === C || void 0 === C || C(e), u(e); }, [C, u] ), A = e.onKeyDown, I = (0, c.useCallback)( function (e) { null === A || void 0 === A || A(e), l(e); }, [A, l] ), R = e.onKeyUp, O = (0, c.useCallback)( function (e) { null === R || void 0 === R || R(e), u(e); }, [R, u] ); return ( s.setProp('onFocus', p, !0), s.setProp('onBlur', b, !0), s.setProp('onMouseDown', y, !0), s.setProp('onMouseUp', w, !0), s.setProp('onTouchStart', T, !0), s.setProp('onTouchEnd', S, !0), s.setProp('onKeyDown', I, !0), s.setProp('onKeyUp', O, !0), (0, c.useEffect)( function () { s.setRef(e.domNode); }, [s, e.domNode] ), (0, c.useEffect)( function () { a.setUnbounded(!!e.unbounded); }, [e.unbounded, a] ), (0, c.useEffect)( function () { e.disabled && a.handleBlur(); }, [e.disabled, a] ), (0, i.Z)({}, o) ); }
The handle can be any component you want
A
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function r() { var e; (0, a.Z)(this, r); for ( var t = arguments.length, i = new Array(t), o = 0; o < t; o++ ) i[o] = arguments[o]; return ( ((e = n.call.apply(n, [this].concat(i))).state = { domNode: null }), e ); }
The handle can be any component you want
r
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
D = function (e) { var t = e.className, n = (0, r.Z)(e, O); return (0, I.jsx)(N.Consumer, { children: function (e) { return (0, I.jsx)( 'div', (0, i.Z)( (0, i.Z)((0, i.Z)({}, n), e), {}, { className: ''.concat(t, ' ').concat(e.className || '') } ) ); } }); }
The handle can be any component you want
D
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
M = function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.unbounded, n = e.accent, a = e.surface; return function (e) { var o = c.forwardRef(function (o, s) { var l, c = o.ripple, u = (0, r.Z)(o, L), d = (0, f.wv)(), p = 'object' !== typeof (c = null !== (l = c) && void 0 !== l ? l : d.ripple) ? {} : c; return c ? (0, I.jsx)( j, (0, i.Z)( (0, i.Z)({}, u), {}, { accent: p.accent || n, unbounded: p.unbounded || t, surface: p.surface || a, children: (0, I.jsx)( e, (0, i.Z)((0, i.Z)({}, u), {}, { ref: s }) ) } ) ) : (0, I.jsx)(e, (0, i.Z)((0, i.Z)({}, u), {}, { ref: s })); }); return ( (o.displayName = 'withRipple('.concat( e.displayName || e.constructor.name || 'Unknown', ')' )), o ); }; }
The handle can be any component you want
M
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function l() { return (0, s.jsxs)(r.WI, { title: 'Ripples', lead: 'MDC Ripple provides the JavaScript and CSS required to provide components (or any element at all) with a material \u201cink ripple\u201d interaction effect. It is designed to be efficient, uninvasive, and usable without adding any extra DOM to your elements.', module: '@rmwc/ripple', styles: ['@material/ripple/dist/mdc.ripple.css'], docsLink: 'https://material.io/develop/web/components/ripples/', examples: a, children: [ (0, s.jsx)(r.PJ, { children: 'Ripples will wrap whatever child component you pass it and apply the appropriate classes and styles.' }), (0, s.jsx)(r.q3, { children: (0, s.jsx)(o.HW, { children: (0, s.jsx)('p', { children: 'Standard Ripple' }) }) }), (0, s.jsx)(r.q3, { children: (0, s.jsx)(o.HW, { primary: !0, children: (0, s.jsx)('p', { children: 'Primary' }) }) }), (0, s.jsx)(r.q3, { children: (0, s.jsx)(o.HW, { accent: !0, children: (0, s.jsx)('p', { children: 'Accent' }) }) }), (0, s.jsx)(r.q3, { children: (0, s.jsx)(o.HW, { unbounded: !0, children: (0, s.jsx)('p', { children: 'Unbounded' }) }) }), (0, s.jsx)(r.PQ, { src: i, components: [{ displayName: 'Ripple', component: o.HW }] }) ] }); }
The handle can be any component you want
l
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function u() { return (0, c.jsxs)(a.WI, { title: 'Select Menus', lead: 'Menus display a list of choices on a transient sheet of material.', module: '@rmwc/select', styles: [ '@rmwc/select/select.css', '@material/select/dist/mdc.select.css', '@material/floating-label/dist/mdc.floating-label.css', '@material/notched-outline/dist/mdc.notched-outline.css', '@material/line-ripple/dist/mdc.line-ripple.css', '@material/list/dist/mdc.list.css', '@material/menu/dist/mdc.menu.css', '@material/menu-surface/dist/mdc.menu-surface.css', '@material/ripple/dist/mdc.ripple.css' ], docsLink: 'https://material.io/develop/web/components/input-controls/select-menus/', examples: s, children: [ (0, c.jsx)(a.sb, { children: 'Select Styles' }), (0, c.jsx)(a.PJ, { children: 'Selects come in three different styles: standard,outlined, and enhanced.' }), (0, c.jsx)(a.q3, { label: 'Standard', children: (0, c.jsx)(l.P, { label: 'Standard', options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.q3, { label: 'Outlined', children: (0, c.jsx)(l.P, { label: 'Outlined', outlined: !0, options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.q3, { label: 'Enhanced', children: (0, c.jsx)(l.P, { label: 'Enhanced', enhanced: !0, options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.q3, { label: 'With Options', children: (0, c.jsx)(l.P, { label: 'With Icon', defaultValue: 'Pizza', helpText: 'Choose your favorite snack...', icon: 'favorite', options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.sb, { children: 'Validation' }), (0, c.jsx)(a.q3, { label: 'Required', children: (0, c.jsx)(l.P, { label: 'Required', required: !0, options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.q3, { label: 'Invalid', children: (0, c.jsx)(l.P, { label: 'Invalid', invalid: !0, options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.q3, { label: 'Disabled', children: (0, c.jsx)(l.P, { label: 'Disabled', disabled: !0, options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.sb, { children: 'Controlled / Uncontrolled' }), (0, c.jsx)(a.PJ, { children: 'The Select component has the same behaviors as a native HTML select and be both controlled and uncontrolled.' }), (0, c.jsx)(a.q3, { label: 'Controlled', children: function () { var e = i.useState('Cookies'), t = (0, r.Z)(e, 2), n = t[0], a = t[1]; return (0, c.jsx)(l.P, { label: 'Controlled', options: ['Cookies', 'Pizza', 'Icecream'], value: n, onChange: function (e) { return a(e.currentTarget.value); } }); } }), (0, c.jsx)(a.q3, { label: 'Uncontrolled', children: (0, c.jsx)(l.P, { label: 'Uncontrolled', options: ['Cookies', 'Pizza', 'Icecream'], defaultValue: 'Cookies', onChange: function (e) { return console.log(e.currentTarget.value); } }) }), (0, c.jsx)(a.sb, { children: 'Data Driven Selects' }), (0, c.jsx)(a.PJ, { children: 'To fit common use cases, RMWC Select provides a data driven method for rendering select menus. There are multiple formats you can pass data in, use the one that best fits your requirements. To make your label not float by default and to have an unselected blank value, set the `placeholder` prop to a blank string.' }), (0, c.jsx)(a.q3, { label: 'Formatted Options', children: function () { return (0, c.jsx)(l.P, { label: 'Array', options: [ { label: 'Cookies', value: '1' }, { label: 'Pizza', value: '2', 'aria-disabled': !0, tabIndex: -1 }, { label: 'Icecream', value: '3' } ] }); } }), (0, c.jsx)(a.q3, { label: 'Value => Label Map', children: (0, c.jsx)(l.P, { label: 'Object map', options: { 1: 'Cookies', 2: 'Pizza', 3: 'Icecream' } }) }), (0, c.jsx)(a.q3, { label: 'Array', children: (0, c.jsx)(l.P, { label: 'Simple Array', placeholder: '-- Select One --', options: ['Cookies', 'Pizza', 'Icecream'] }) }), (0, c.jsx)(a.sb, { children: 'Manually Building the List' }), (0, c.jsx)(a.PJ, { children: 'If you want full control over the child `ListItems`, you can manually build the list yourself.' }), (0, c.jsx)(a.q3, { label: 'Manually Built', children: (0, c.jsxs)(l.P, { label: 'Manual', defaultValue: 'Cookies', children: [ (0, c.jsx)('option', { value: 'Cookies', children: 'Cookies' }), (0, c.jsx)('option', { value: 'Pizza', children: 'Pizza' }), (0, c.jsx)('option', { value: 'Icecream', children: 'Icecream' }) ] }) }), (0, c.jsx)(a.sb, { children: 'Option Groups' }), (0, c.jsx)(a.PJ, { children: 'Both native and enhanced Selects can contain option groups. Just nest additional options arrays in your data.' }), (0, c.jsx)(a.q3, { label: 'Option Groups: Formatted', children: (0, c.jsx)(l.P, { label: 'Formatted', enhanced: !0, options: [ { label: 'Dinner', options: [{ label: 'Pizza', value: '2' }] }, { label: 'Dessert', options: [ { label: 'Cookies', value: '1' }, { label: 'Icecream', value: '3' } ] } ] }) }), (0, c.jsx)(a.q3, { label: 'Options Groups: Manually Built', children: (0, c.jsxs)(l.P, { label: 'Manually Built', children: [ (0, c.jsx)('optgroup', { label: 'Dinner', children: (0, c.jsx)('option', { value: 'Pizza', children: 'Pizza' }) }), (0, c.jsxs)('optgroup', { label: 'Dessert', children: [ (0, c.jsx)('option', { value: 'Cookies', children: 'Cookies' }), (0, c.jsx)('option', { value: 'Icecream', children: 'Icecream' }) ] }) ] }) }), (0, c.jsx)(a.PQ, { src: o, components: [{ displayName: 'Select', component: l.P }] }) ] }); }
Any additional items will be passed to the\\n child ListItem as props
u
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
b = function (e, t) { return ( (b = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }), b(e, t) ); }
Any additional items will be passed to the\\n child ListItem as props
b
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function v(e, t) { function n() { this.constructor = e; } b(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n())); }
Any additional items will be passed to the\\n child ListItem as props
v
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
function n() { this.constructor = e; }
Any additional items will be passed to the\\n child ListItem as props
n
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT
x = function () { return ( (x = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }), x.apply(this, arguments) ); }
Any additional items will be passed to the\\n child ListItem as props
x
javascript
rmwc/rmwc
apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
https://github.com/rmwc/rmwc/blob/master/apps/docs/public/version/8.0.8/static/js/main.6c3f4ae5.js
MIT