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 |
|---|---|---|---|---|---|---|---|
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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n, r) {
void 0 === r && (r = {});
var i = e.call(this, x(x({}, t.defaultAdapter), n)) || this;
return (
(i.disabled = !1),
(i.isMenuOpen = !1),
(i.useDefaultValidation = !0),
(i.customValidity = !0),
(i.lastSelectedIndex = C.UNSET_INDEX),
(i.leadingIcon = r.leadingIcon),
(i.helperText = r.helperText),
i
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
P = function (e) {
var t,
n = (0, a.useState)(),
o = (0, m.Z)(n, 2),
s = o[0],
l = o[1],
c = (0, a.useState)(!1),
u = (0, m.Z)(c, 2),
d = u[0],
p = u[1],
f = (0, a.useState)(0),
b = (0, m.Z)(f, 2),
v = b[0],
x = b[1],
y = (0, a.useState)(!1),
k = (0, m.Z)(y, 2),
w = k[0],
T = k[1],
C = (0, a.useState)(!1),
P = (0, m.Z)(C, 2),
A = P[0],
I = P[1],
R = (0, a.useState)(''),
O = (0, m.Z)(R, 2),
L = O[0],
N = O[1],
j = (0, a.useRef)(-1),
D = (0, a.useRef)(),
M = (0, a.useRef)(),
F = (0, a.useRef)(null),
B = (0, a.useRef)(),
U = (0, a.useRef)(),
z = (0, a.useRef)(!1),
H = (0, h.j)({
props: e,
elements: { rootEl: !0, anchorEl: !0 },
foundation: function (e) {
var t = e.rootEl,
n = e.anchorEl,
r = e.getProps,
a = e.emit,
o = function () {
return !r().enhanced;
},
s = new S(
(0, i.Z)(
(0, i.Z)(
(0, i.Z)(
(0, i.Z)(
{},
(function () {
var e = function () {
var e, t;
return (
(o()
? Array.apply(
null,
null === (e = U.current) ||
void 0 === e
? void 0
: e.options
)
: null === (t = M.current) ||
void 0 === t
? void 0
: t.items()) || []
);
},
t = function (e) {
return (
e.getAttribute('data-value') ||
e.getAttribute('value') ||
''
);
};
return {
setSelectedText: function (e) {
return N(e);
},
openMenu: function () {
I(!0);
},
closeMenu: function () {
I(!1);
},
getAnchorElement: function () {
return F.current;
},
setMenuAnchorElement: function (e) {
return (t = e), void (F.current = t);
var t;
},
setMenuAnchorCorner: function (e) {
var t;
return null === (t = M.current) ||
void 0 === t
? void 0
: t.setAnchorCorner(e);
},
setMenuWrapFocus: function (e) {},
focusMenuItemAtIndex: function (e) {
var t;
return null === (t = M.current) ||
void 0 === t
? void 0
: t.focusItemAtIndex(e);
},
getMenuItemCount: function () {
return e().length;
},
getMenuItemValues: function () {
return e().map(t) || [];
},
getMenuItemTextAtIndex: function (t) {
return e()[t].textContent;
},
isSelectAnchorFocused: function () {
return !(
!n.ref || n.ref !== document.activeElement
);
},
getSelectAnchorAttr: function (e) {
return n.getProp(e);
},
setSelectAnchorAttr: function (e, t) {
if ('tabindex' === e) {
if (o()) return;
e = 'tabIndex';
}
return n.setProp(e, t);
},
removeSelectAnchorAttr: function (e) {
var t;
null === (t = F.current) ||
void 0 === t ||
t.removeAttribute(e);
},
addMenuClass: function (e) {
var t, n, r;
return null === (t = M.current) ||
void 0 === t ||
null === (n = t.getSurfaceElement()) ||
void 0 === n ||
null ===
(r = n.querySelector(
'.mdc-list-item--activated'
)) ||
void 0 === r
? void 0
: r.classList.add(e);
},
removeMenuClass: function (e) {
var t, n, r;
return null === (t = M.current) ||
void 0 === t ||
null === (n = t.getSurfaceElement()) ||
void 0 === n ||
null ===
(r = n.querySelector(
'.mdc-list-item--activated'
)) ||
void 0 === r
? void 0
: r.classList.remove(e);
},
getSelectedIndex: function () {
return o() && void 0 !== U.current
? U.current.selectedOptions[0].index
: j.current;
},
setSelectedIndex: function (e) {
return j;
}
};
})()
),
{
addClass: function (e) {
t.addClass(e);
},
removeClass: function (e) {
t.removeClass(e);
},
hasClass: function (e) {
return t.hasClass(e);
},
isRtl: function () {
return (
t.ref &&
'rtl' ===
window
.getComputedStyle(t.ref)
.getPropertyValue('direction')
);
},
setRippleCenter: function (e) {
x(e);
},
activateBottomLine: function () {
return p(!0);
},
deactivateBottomLine: function () {
return p(!1);
},
notifyChange: function (e) {
z.current ||
a(
'onChange',
{ index: j.current, value: e },
!0
);
}
}
),
{
hasOutline: function () {
return !!r().outlined;
},
notchOutline: function (e) {
l(e);
},
closeOutline: function () {
l(void 0);
}
}
),
{
hasLabel: function () {
return !!r().label;
},
floatLabel: function (e) {
T(e);
},
getLabelWidth: function () {
var e;
return (
(null === (e = D.current) || void 0 === e
? void 0
: e.getWidth()) || 0
);
},
setLabelRequired: function (e) {
var t;
return null === (t = D.current) || void 0 === t
? void 0
: t.setRequired(e);
}
}
),
{
leadingIcon:
(B.current && B.current.getFoundation()) || void 0
}
),
c = s.adapter;
(s.layout = function () {
!(function () {
var e = s.getValue();
if (c.hasLabel()) {
var t =
!!r().placeholder || e.length > 0 || j.current > -1,
n = c.hasClass(E.FOCUSED),
i = t || n,
a = c.hasClass(E.REQUIRED);
s.notchOutline(i),
c.floatLabel(i),
c.setLabelRequired(a);
}
})();
}),
Object.defineProperty(s, 'menuItemValues', {
get: function () {
return c.getMenuItemValues();
}
});
var u = s.init.bind(s);
return (
(s.init = function () {
(z.current = !0), u();
var e = String(r().placeholder || '');
!s.getValue() && e && c.setSelectedText(e),
(z.current = !1);
}),
s
);
}
}),
Z = H.foundation,
W = (0, r.Z)(H, _),
V = W.rootEl,
q = e.onFocus,
G = (0, a.useCallback)(
function (e) {
null === q || void 0 === q || q(e), Z.handleFocus();
},
[q, Z]
),
K = e.onBlur,
Y = (0, a.useCallback)(
function (e) {
null === K || void 0 === K || K(e), Z.handleBlur();
},
[K, Z]
),
X = e.onChange,
$ = (0, a.useCallback)(
function (e) {
null === X || void 0 === X || X(e), Z.handleChange();
},
[X, Z]
),
J = (0, a.useCallback)(
function (e) {
var t, n;
if (
null === (t = V.ref) ||
void 0 === t ||
!t.querySelector('.mdc-select--disabled')
)
if (
null !== (n = V.ref) &&
void 0 !== n &&
n.querySelector('.mdc-menu-surface--open')
)
Z.handleMenuClosed();
else {
var r = (function (e) {
var t = e.target.getBoundingClientRect();
return e.clientX - t.left;
})(e);
V.ref && V.ref.focus(), Z.handleClick(r);
}
},
[Z, V.ref]
),
Q = e.onKeyDown,
ee = (0, a.useCallback)(
function (e) {
null === Q || void 0 === Q || Q(e), Z.handleKeydown(e);
},
[Z, Q]
),
te = (0, a.useCallback)(
function (e) {
(j.current = e), Z.handleMenuItemAction(e);
},
[Z]
),
ne = (0, a.useCallback)(
function () {
Z.handleMenuOpened();
},
[Z]
),
re = (0, a.useCallback)(
function () {
I(!1), Z.handleMenuClosed();
},
[Z]
),
ie = Z.getValue(),
ae =
null !== (t = e.value) && void 0 !== t
? t
: -1 === j.current
? e.defaultValue
: void 0,
oe = Array.isArray(e.options)
? e.options.length
: Object.values(e.options || {}).length;
return (
(0, a.useEffect)(
function () {
if (((z.current = !0), void 0 !== ae && ae !== ie)) {
var e = Z.menuItemValues.indexOf(ae);
if (
((j.current = e),
Z.setValue(ae || ''),
Z.menuItemValues.includes(ae))
) {
var t = Z.adapter.getMenuItemTextAtIndex(e);
N(t);
}
}
(0, g.W)(function () {
z.current = !1;
});
},
[ae, ie, oe, Z]
),
(0, a.useEffect)(
function () {
Z.setDisabled(!!e.disabled);
},
[Z, e.disabled]
),
(0, a.useEffect)(
function () {
var e;
V.ref &&
(null === (e = M.current) ||
void 0 === e ||
e.setAnchorElement(V.ref));
},
[V.ref]
),
(0, i.Z)(
{
notchWidth: s,
menuOpen: A,
lineRippleActive: d,
lineRippleCenter: v,
floatLabel: w,
selectedIndex: j.current,
selectedTextContent: L,
setFloatingLabel: function (e) {
D.current = e;
},
setMenu: function (e) {
M.current = e;
},
setLeadingIcon: function (e) {
B.current = e;
},
setNativeControl: function (e) {
U.current = e;
},
handleFocus: G,
handleBlur: Y,
handleClick: J,
handleChange: $,
handleKeydown: ee,
handleMenuClosed: re,
handleMenuOpened: ne,
handleMenuSelected: te
},
W
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
P
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
o = function () {
return !r().enhanced;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
o
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
e = function () {
var e, t;
return (
(o()
? Array.apply(
null,
null === (e = U.current) ||
void 0 === e
? void 0
: e.options
)
: null === (t = M.current) ||
void 0 === t
? void 0
: t.items()) || []
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
e
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
t = function (e) {
return (
e.getAttribute('data-value') ||
e.getAttribute('value') ||
''
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n) {
var r = e.call(this, x(x({}, t.defaultAdapter), n)) || this;
return (
(r.savedTabIndex_ = null),
(r.interactionHandler_ = function (e) {
return r.handleInteraction(e);
}),
r
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
D = function (e) {
e.apiRef;
var t = (0, r.Z)(e, j),
n = (function (e) {
var t = (0, h.j)({
props: e,
elements: { rootEl: !0 },
api: function (e) {
var t = e.foundation;
return {
getFoundation: function () {
return t;
}
};
},
foundation: function (e) {
var t = e.rootEl,
n = e.emit;
return new O({
getAttr: function (e) {
return t.getProp(e);
},
setAttr: function (e, n) {
return t.setProp(e, n);
},
removeAttr: function (e) {
return t.removeProp(e);
},
setContent: function (e) {
t.ref && (t.ref.textContent = e);
},
registerInteractionHandler: function (e, n) {
return t.addEventListener(e, n);
},
deregisterInteractionHandler: function (e, n) {
return t.removeEventListener(e, n);
},
notifyIconAction: function () {
return n('onClick', {}, !0);
}
});
}
}),
n = (t.foundation, (0, r.Z)(t, L));
return (0, i.Z)({}, n);
})(e),
a = n.rootEl,
s = (0, o.oC)(e, ['mdc-select__icon']);
return (0, N.jsx)(
A.J,
(0, i.Z)(
{},
a.props((0, i.Z)((0, i.Z)({}, t), {}, { className: s }))
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
D
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
V = function e(t) {
return Array.isArray(t) && t[0] && 'object' === typeof t[0]
? t.map(function (t) {
if ('object' !== typeof t)
throw new Error(
'Encountered non object for Select '.concat(t)
);
return (0,
i.Z)((0, i.Z)({}, t), {}, { options: e(t.options) });
})
: Array.isArray(t)
? t.map(function (e) {
return { value: e, label: e };
})
: 'object' === typeof t
? Object.keys(t).map(function (e) {
return { value: e, label: t[e] };
})
: t;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
V
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
q = function () {
return (0, N.jsxs)('span', {
className: 'mdc-select__dropdown-icon',
children: [
(0, N.jsx)(A.J, {
className: 'mdc-select__dropdown-icon-inactive',
icon: 'arrow_drop_down'
}),
(0, N.jsx)(A.J, {
className: 'mdc-select__dropdown-icon-active',
icon: 'arrow_drop_up'
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
q
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function G(e) {
var t = e.selectOptions,
n = e.placeholder,
a = void 0 === n ? '' : n,
o = e.children,
s = e.elementRef,
l = (e.open, (0, r.Z)(e, M)),
c = function (e) {
var t = e.label,
n = e.option,
r = e.index;
return (0, N.jsx)(
'option',
(0, i.Z)((0, i.Z)({}, n), {}, { value: n.value, children: t }),
r
);
},
u = !e.value && !e.defaultValue;
return (0, N.jsxs)(
'select',
(0, i.Z)(
(0, i.Z)({ tabIndex: 0 }, l),
{},
{
ref: s,
className: 'rmwc-select__native-control '.concat(
l.className || ''
),
children: [
(void 0 !== e.placeholder || u) &&
(0, N.jsx)('option', {
value: '',
disabled: u,
children: a
}),
!!t &&
t.map(function (e, t) {
var n = e.label,
i = e.options,
a = (0, r.Z)(e, F);
return i
? (0, N.jsx)(
'optgroup',
{
label: n,
children: i.map(function (e, t) {
var n = e.label,
i = (0, r.Z)(e, B);
return c({ label: n, option: i, index: t });
})
},
t
)
: c({ label: n, option: a, index: t });
}),
o
]
}
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
G
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
c = function (e) {
var t = e.label,
n = e.option,
r = e.index;
return (0, N.jsx)(
'option',
(0, i.Z)((0, i.Z)({}, n), {}, { value: n.value, children: t }),
r
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
c
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
g = function (e) {
var t = e.label,
n = e.option;
return (
(m += 1),
(0, N.jsx)(
d.sN,
(0, i.Z)(
(0, i.Z)(
{
activated: void 0 !== s ? n.value === s : m - 1 === u
},
n
),
{},
{
'data-value': n.value,
children: (0, N.jsx)('span', {
className: 'mdc-list-item__text',
children: t
})
}
),
''.concat(t, '-').concat(n.value)
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
g
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
u
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function m(e) {
return (
Boolean(e.document) &&
'function' === typeof e.document.createElement
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
m
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function e(e) {
void 0 === e && (e = {}), (this.adapter = e);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
e
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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.savedTabIndex_ = NaN),
(r.active_ = !1),
(r.inTransit_ = !1),
(r.isDiscrete_ = !1),
(r.hasTrackMarker_ = !1),
(r.handlingThumbTargetEvt_ = !1),
(r.min_ = 0),
(r.max_ = 100),
(r.step_ = 0),
(r.value_ = 0),
(r.disabled_ = !1),
(r.preventFocusState_ = !1),
(r.thumbContainerPointerHandler_ = function () {
return (r.handlingThumbTargetEvt_ = !0);
}),
(r.interactionStartHandler_ = function (e) {
return r.handleDown_(e);
}),
(r.keydownHandler_ = function (e) {
return r.handleKeydown_(e);
}),
(r.focusHandler_ = function () {
return r.handleFocus_();
}),
(r.blurHandler_ = function () {
return r.handleBlur_();
}),
(r.resizeHandler_ = function () {
return r.layout();
}),
r
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
i = function e() {
t.handleUp_(),
t.adapter.deregisterBodyInteractionHandler(r, n),
w.forEach(function (n) {
return t.adapter.deregisterBodyInteractionHandler(
n,
e
);
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
i
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function u() {
return (0, c.jsxs)(a.WI, {
title: 'Sliders',
lead: 'Sliders let users select from a range of values by moving the slider thumb.',
module: '@rmwc/slider',
styles: ['@material/slider/dist/mdc.slider.css'],
docsLink:
'https://material.io/develop/web/components/input-controls/sliders/',
examples: s,
children: [
(0, c.jsx)(a.PJ, {
children:
'Sliders can be both uncontrolled and controlled. When creating a controlled `Slider`, you should be listening to the `onInput` event and use `evt.detail.value` to set your new value.'
}),
(0, c.jsx)(a.PJ, {
children:
"Sliders will automatically layout themselves on window resize. If you need to manually trigger a layout because the sliders container size changed, the simplest way is to trigger a resize event `window.dispatchEvent(new Event('resize'));`."
}),
(0, c.jsx)(a.PJ, {
children:
'**Known Issue** `material-components-web` uses pointer events internally. If you are using something below React 16.4, you will see unknown attribute errors, however the slider should still work.'
}),
(0, c.jsx)(a.q3, {
label: 'Uncontrolled',
children: (0, c.jsx)(l.i, {
onInput: function (e) {
return console.log(e);
},
onChange: function (e) {
return console.log(e);
}
})
}),
(0, c.jsx)(a.q3, {
label: 'Controlled',
children: function () {
var e = i.useState(50),
t = (0, r.Z)(e, 2),
n = t[0],
a = t[1];
return (0, c.jsx)(l.i, {
value: n,
onChange: function (e) {
return a(e.detail.value);
},
onInput: function (e) {
return a(e.detail.value);
},
discrete: !0,
step: 1
});
}
}),
(0, c.jsx)(a.PQ, {
src: o,
components: [{ displayName: 'Slider', component: l.i }]
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
u
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function p() {
return (0, d.jsxs)(a.WI, {
title: 'Snackbars',
lead: 'Snackbars provide brief feedback about an operation through a message at the bottom of the screen.',
module: '@rmwc/snackbar',
styles: [
'@material/snackbar/dist/mdc.snackbar.css',
'@material/button/dist/mdc.button.css',
'@material/ripple/dist/mdc.ripple.css'
],
docsLink: 'https://material.io/develop/web/components/snackbars/',
examples: s,
children: [
(0, d.jsx)(a.sb, { children: 'Basic Usage' }),
(0, d.jsx)(a.PJ, {
children:
'You can render a snackbar in your UI and control its open state.'
}),
(0, d.jsx)(a.q3, {
label: 'Default',
children: function () {
var e = i.useState(!1),
t = (0, r.Z)(e, 2),
n = t[0],
a = t[1];
return (0, d.jsxs)(d.Fragment, {
children: [
(0, d.jsx)(l.P, {
open: n,
onClose: function (e) {
return a(!1);
},
message: 'This is a new message',
dismissesOnAction: !0,
action: (0, d.jsx)(l.A, {
label: 'Dismiss',
onClick: function () {
return console.log('Click Me');
}
})
}),
(0, d.jsx)(u.z, {
raised: !0,
label: 'Show snackbar',
onClick: function (e) {
return a(!n);
}
})
]
});
}
}),
(0, d.jsx)(a.q3, {
label: 'Start Aligned',
children: function () {
var e = i.useState(!1),
t = (0, r.Z)(e, 2),
n = t[0],
a = t[1];
return (0, d.jsxs)(d.Fragment, {
children: [
(0, d.jsx)(l.P, {
open: n,
onClose: function (e) {
return a(!1);
},
message: 'Start aligned, open until dismissed',
stacked: !0,
dismissesOnAction: !0,
action: [
(0, d.jsx)(l.A, { label: 'Yeah!' }),
(0, d.jsx)(l.A, { label: 'No...' })
],
leading: !0,
timeout: -1
}),
(0, d.jsx)(u.z, {
raised: !0,
label: 'Show start-aligned',
onClick: function (e) {
return a(!n);
}
})
]
});
}
}),
(0, d.jsx)(a.sb, { children: 'Usage with SnackbarQueue' }),
(0, d.jsx)(a.PJ, {
children:
"While rendering the Snackbar inline works for simple cases, you'll likely have a notification system, or want to send notifications from anywhere in your app. The `SnackbarQueue` exists as a convenient interface for handling these cases and rendering the snackbar messages for you. If you've used the `DialogQueue`, the `SnackbarQueue` is very similar."
}),
(0, d.jsx)(a.PJ, {
children:
'Setup is nice and easy, create a queue object you can pass around in your code base, pass the queues `messages` to the `SnackbarQueue` component, and then use the `notify` function to send notifications.'
}),
(0, d.jsx)(a.q3, {
codeOnly: !0,
children:
"\n // Create a file that exports your queue\n // myQueue.js\n import { createSnackbarQueue } from '@rmwc/snackbar';\n\n export const queue = createSnackbarQueue();\n "
}),
(0, d.jsx)(a.q3, {
codeOnly: !0,
children:
"\n // Somewhere at the top level of your app\n // Render the SnackbarQueue\n import React from 'react';\n import { queue } from './myQueue';\n\n export default function App() {\n return (\n <div>\n ...\n <SnackbarQueue\n messages={queue.messages}\n // You can also pass default options to pass to your notifications\n // ie, make them all leading, stacked, etc\n leading\n stacked\n />\n </div>\n )\n }\n \n "
}),
(0, d.jsx)(a.PJ, {
children:
'The `notify` function was designed to mimic the the built-in browser Notifications api and can accept most of the relevant options (icon, image, title, body, actions, ,etc). It also can accept any of the Snackbar props. Just import your queue, and call the notify method.'
}),
(0, d.jsx)(a.q3, {
codeOnly: !0,
children:
"\n // Somewhere else in your app\n // Could be a view, your redux store, anywhere you want...\n import { queue } from './myQueue';\n\n // Simple example\n queue.notify({\n title: 'Hi there'\n });\n\n // With some features\n queue.notify({\n title: <b>Warning</b>,\n body: 'You have selected pizza instead icecream!',\n icon: 'warning',\n actions: [\n {\n // NotificationAction api format\n title: 'Fix It!',\n icon: 'close',\n action: 'fixit' // action will be available as evt.detail.reason in the onClose event\n },\n {\n // OR SnackbarActionProps format\n label: 'Continue...',\n icon: 'check',\n onClick: () => {}\n },\n ]\n });\n "
}),
(0, d.jsx)(a.q3, {
label: 'Inline Example',
children: function () {
var e = (0, c.L)(),
t = e.messages,
n = e.notify;
function r() {
return (0, d.jsxs)('div', {
children: [
(0, d.jsx)(u.z, {
label: 'Notify',
onClick: function () {
return n({
title: (0, d.jsx)('b', { children: 'Success' }),
body: 'You have selected pizza!',
dismissesOnAction: !0,
icon: 'check',
actions: [{ title: 'Dismiss' }]
});
}
}),
(0, d.jsx)(c.w, { messages: t })
]
});
}
return (0, d.jsx)(r, {});
}
}),
(0, d.jsx)(a.PQ, {
src: o,
components: [
{ displayName: 'Snackbar', component: l.P },
{ displayName: 'SnackbarAction', component: l.A }
]
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
p
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function r() {
return (0, d.jsxs)('div', {
children: [
(0, d.jsx)(u.z, {
label: 'Notify',
onClick: function () {
return n({
title: (0, d.jsx)('b', { children: 'Success' }),
body: 'You have selected pizza!',
dismissesOnAction: !0,
icon: 'check',
actions: [{ title: 'Dismiss' }]
});
}
}),
(0, d.jsx)(c.w, { messages: t })
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
r
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function f(e) {
var t = e.messages,
n = (0, a.Z)(e, u),
l = t.array[0],
f = (0, o.useState)(0),
m = (0, i.Z)(f, 2)[1],
h = (0, o.useState)(t.array[0]),
g = (0, i.Z)(h, 2),
b = g[0],
v = g[1],
x = (0, o.useCallback)(
function (e) {
e && t.remove(e);
},
[t]
);
(0, o.useEffect)(
function () {
var e,
n = function () {
t.array[0] !== b &&
(m(function (e) {
return e + 1;
}),
(e = window.setTimeout(function () {
return v(t.array[0]);
}, 150)));
};
return (
t.on('change', n),
function () {
e && clearTimeout(e), t.off('change', n);
}
);
},
[t, b]
);
var y = b || {},
k = y.body,
w = void 0 === k ? '' : k,
E = y.image,
T = y.title,
C = void 0 === T ? '' : T,
S = y.onClose,
_ = y.actions,
P = (0, a.Z)(y, d),
A = _
? _.map(function (e) {
var t = e.title,
n = e.label,
i = (0, a.Z)(e, p);
return (0,
c.jsx)(s.A, (0, r.Z)((0, r.Z)({}, i), {}, { label: n || t }));
})
: null,
I = b && b === l;
return (0, c.jsx)(
s.P,
(0, r.Z)(
(0, r.Z)((0, r.Z)({}, n), P),
{},
{
open: I,
message: (0, c.jsxs)(c.Fragment, {
children: [
C,
!!C && !!w && (0, c.jsx)('br', {}),
w,
!!E &&
(0, c.jsx)('div', {
className: 'rmwc-snackbar__image',
style: { margin: '1rem auto', textAlign: 'center' },
children: (0, c.jsx)('img', {
src: E,
alt: ''.concat(E),
style: { maxWidth: '100%', maxHeight: '18rem' }
})
})
]
}),
onClose: function (e) {
null === S || void 0 === S || S(e), x(b);
},
action: A
}
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
f
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
n = function () {
t.array[0] !== b &&
(m(function (e) {
return e + 1;
}),
(e = window.setTimeout(function () {
return v(t.array[0]);
}, 150)));
}
|
Any additional items will be passed to the\\n child ListItem as props
|
n
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
m = function () {
var e = new l.A();
return {
messages: e,
clearAll: function () {
return e.empty();
},
notify: function (t) {
return (
e.push(t),
{
close: function () {
e.remove(t);
}
}
);
}
};
}
|
Any additional items will be passed to the\\n child ListItem as props
|
m
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
o
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
s
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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.isOpen_ = !1),
(r.animationFrame_ = 0),
(r.animationTimer_ = 0),
(r.autoDismissTimer_ = 0),
(r.autoDismissTimeoutMs_ = d.DEFAULT_AUTO_DISMISS_TIMEOUT_MS),
(r.closeOnEscape_ = !0),
r
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function S(e) {
var t = (0, T.j)({
props: e,
elements: { rootEl: !0, surfaceEl: !0, labelEl: !0 },
foundation: function (e) {
var t = e.rootEl,
n = e.labelEl,
r = e.emit;
return new b({
addClass: function (e) {
return t.addClass(e);
},
removeClass: function (e) {
return t.removeClass(e);
},
announce: function () {
return (
n.ref &&
(function (e, t) {
void 0 === t && (t = e);
var n = e.getAttribute('aria-live'),
r = t.textContent.trim();
r &&
n &&
(e.setAttribute('aria-live', 'off'),
(t.textContent = ''),
(t.innerHTML =
'<span style="display: inline-block; width: 0; height: 1px;"> </span>'),
t.setAttribute(k, r),
setTimeout(function () {
e.setAttribute('aria-live', n),
t.removeAttribute(k),
(t.textContent = r);
}, y));
})(n.ref)
);
},
notifyOpening: function () {
return r('onOpen', {});
},
notifyOpened: function () {
(0, w.x)(), r('onOpened', {});
},
notifyClosing: function (e) {
r('onClose', e ? { reason: e } : {});
},
notifyClosed: function (e) {
return r('onClosed', e ? { reason: e } : {});
}
});
}
}),
n = t.foundation,
o = (0, i.Z)(t, C),
s = o.rootEl,
l = o.surfaceEl;
return (
s.setProp(
'onKeyDown',
function (t) {
e.onKeyDown && e.onKeyDown(t), n.handleKeyDown(t);
},
!0
),
l.setProp(
'onClick',
function (t) {
if (t.target instanceof Element) {
var r = t.target,
i = (0, E.o)(r, '.mdc-button');
i && (r = i),
e.dismissesOnAction &&
r.classList.contains('mdc-snackbar__action')
? n.handleActionButtonClick(
t,
r.dataset.mdcSnackbarAction
)
: r.classList.contains('mdc-snackbar__dismiss') &&
n.handleActionIconClick(t);
}
},
!0
),
(0, a.useEffect)(
function () {
e.open ? n.open() : n.close();
},
[e.open, n]
),
(0, a.useEffect)(
function () {
e.timeout &&
(-1 === e.timeout
? n.setTimeoutMs(e.timeout)
: (n.autoDismissTimeoutMs_ = e.timeout));
},
[e.timeout, n]
),
(0, r.Z)({ foundation: n }, o)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
S
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function L(e) {
return (0, A.jsx)(
'div',
(0, r.Z)(
{
role: 'status',
'aria-live': 'polite',
className: 'mdc-snackbar__label'
},
e
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
L
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function N(e) {
return (0, A.jsx)(
'div',
(0, r.Z)({ className: 'mdc-snackbar__actions' }, e)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
N
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function D(e) {
return (0, A.jsx)(
_.h,
(0, r.Z)(
(0, r.Z)({}, e),
{},
{ className: 'mdc-snackbar__dismiss' }
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
D
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
p = function (e, t) {
return (
(p =
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]);
}),
p(e, t)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
p
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
f = function () {
return (
(f =
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;
}),
f.apply(this, arguments)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
f
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n) {
return e.call(this, f(f({}, t.defaultAdapter), n)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function u() {
return (0, c.jsxs)(a.WI, {
title: 'Switches',
lead: 'On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state it\u2019s in, should be made clear from the corresponding inline label. Switches take on the same visual properties of the radio button.',
module: '@rmwc/switch',
styles: [
'@material/switch/dist/mdc.switch.css',
'@material/form-field/dist/mdc.form-field.css',
'@material/ripple/dist/mdc.ripple.css'
],
docsLink:
'https://material.io/develop/web/components/input-controls/switches/',
examples: s,
children: [
(0, c.jsx)(a.PJ, {
children:
'Switches are identical in function to the Checkbox component, they just present a different UI / UX paradigm.'
}),
(0, c.jsx)(a.q3, {
label: 'Uncontrolled',
children: (0, c.jsx)(l.r, {
defaultChecked: !0,
label: 'Pizza'
})
}),
(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.jsx)(l.r, {
checked: n,
onChange: function (e) {
return a(!!e.currentTarget.checked);
},
label: 'Cookies'
});
}
}),
(0, c.jsx)(a.q3, {
label: 'Label as Child',
children: (0, c.jsx)(l.r, { children: 'Icecream' })
}),
(0, c.jsx)(a.q3, {
label: 'Disabled',
children: (0, c.jsxs)(c.Fragment, {
children: [
(0, c.jsx)(l.r, { disabled: !0, label: 'Disabled' }),
(0, c.jsx)(l.r, {
disabled: !0,
defaultChecked: !0,
label: 'Disabled'
})
]
})
}),
(0, c.jsx)(a.PQ, {
src: o,
components: [{ displayName: 'Switch', component: l.r }]
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
u
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function d() {
return (0, u.jsxs)(a.WI, {
title: 'Tabs',
lead: 'Tabs make it easy to explore and switch between different views.',
module: '@rmwc/tabs',
styles: [
'@material/tab-bar/dist/mdc.tab-bar.css',
'@material/tab/dist/mdc.tab.css',
'@material/tab-scroller/dist/mdc.tab-scroller.css',
'@material/tab-indicator/dist/mdc.tab-indicator.css',
'@material/ripple/dist/mdc.ripple.css',
'@rmwc/icon/icon.css'
],
docsLink:
'https://material.io/develop/web/components/tabs/tab-bar/',
examples: s,
children: [
(0, u.jsx)(a.sb, { children: 'Basic Usage' }),
(0, u.jsx)(a.PJ, {
children:
'Tabs can be either controlled or uncontrolled just like inputs. Use the `activeTabIndex` and `onActivate` callback for controlled components.'
}),
(0, u.jsx)(a.q3, {
label: 'Uncontrolled',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, { children: 'Cookies' }),
(0, u.jsx)(c.O, { children: 'Pizza' }),
(0, u.jsx)(c.O, { children: 'Icecream' })
]
})
}),
(0, u.jsx)(a.q3, {
label: 'Controlled',
children: function () {
var e = i.useState(0),
t = (0, r.Z)(e, 2),
n = t[0],
a = t[1];
return (0, u.jsxs)(l.n, {
activeTabIndex: n,
onActivate: function (e) {
return a(e.detail.index);
},
children: [
(0, u.jsx)(c.O, { children: 'Cookies' }),
(0, u.jsx)(c.O, { children: 'Pizza' }),
(0, u.jsx)(c.O, { children: 'Icecream' })
]
});
}
}),
(0, u.jsx)(a.sb, { children: 'Variants' }),
(0, u.jsx)(a.q3, {
label: 'Basic',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, { children: 'Cookies' }),
(0, u.jsx)(c.O, { children: 'Pizza' }),
(0, u.jsx)(c.O, { children: 'Icecream' })
]
})
}),
(0, u.jsx)(a.q3, {
label: 'With Icons',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, { icon: 'star_border', label: 'Cookies' }),
(0, u.jsx)(c.O, {
icon: 'favorite_border',
label: 'Pizza'
}),
(0, u.jsx)(c.O, { icon: 'mood', label: 'Icecream' })
]
})
}),
(0, u.jsx)(a.q3, {
label: 'Icons Only',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, { icon: 'star_border' }),
(0, u.jsx)(c.O, { icon: 'favorite_border' }),
(0, u.jsx)(c.O, { icon: 'mood' })
]
})
}),
(0, u.jsx)(a.q3, {
label: 'Stacked',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, {
stacked: !0,
icon: 'star_border',
label: 'Cookies'
}),
(0, u.jsx)(c.O, {
stacked: !0,
icon: 'favorite_border',
label: 'Pizza'
}),
(0, u.jsx)(c.O, {
stacked: !0,
icon: 'mood',
label: 'Icecream'
})
]
})
}),
(0, u.jsx)(a.q3, {
label: 'Restricted Indicator',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, {
stacked: !0,
restrictIndicator: !0,
icon: 'star_border',
label: 'Cookies'
}),
(0, u.jsx)(c.O, {
stacked: !0,
restrictIndicator: !0,
icon: 'favorite_border',
label: 'Pizza'
}),
(0, u.jsx)(c.O, {
stacked: !0,
restrictIndicator: !0,
icon: 'mood',
label: 'Icecream'
})
]
})
}),
(0, u.jsx)(a.q3, {
label: 'Scrollable',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, { children: 'Cookies' }),
(0, u.jsx)(c.O, { children: 'Pizza' }),
(0, u.jsx)(c.O, { children: 'Icecream' }),
(0, u.jsx)(c.O, { children: 'Chocolate' }),
(0, u.jsx)(c.O, { children: 'Fishsticks' }),
(0, u.jsx)(c.O, { children: 'Ratatouille' }),
(0, u.jsx)(c.O, { children: 'Bread' }),
(0, u.jsx)(c.O, { children: 'Rolls' }),
(0, u.jsx)(c.O, { children: 'Sushi' }),
(0, u.jsx)(c.O, { children: 'Cupcake' }),
(0, u.jsx)(c.O, { children: 'Cheesecake' })
]
})
}),
(0, u.jsx)(a.sb, { children: 'Transitions' }),
(0, u.jsx)(a.q3, {
label: 'Slide (Default)',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, { children: 'Cookies' }),
(0, u.jsx)(c.O, { children: 'Pizza' }),
(0, u.jsx)(c.O, { children: 'Icecream' })
]
})
}),
(0, u.jsx)(a.sb, { children: 'Icons as Indicators' }),
(0, u.jsx)(a.PJ, {
children:
"`material-components-web` has some light support for using icons as indicators (it's buried in their docs but there are no working examples or demos). Support has been added to RMWC, but your mileage may vary since it will require quite a bit of manual positioning and styling. By default, the icons appear full size at the center of the tab, effectively making them overlay images."
}),
(0, u.jsx)(a.q3, {
label: 'Default Positioning',
children: (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, {
iconIndicator: 'star',
children: 'Cookies'
}),
(0, u.jsx)(c.O, {
iconIndicator: 'favorite',
children: 'Pizza'
}),
(0, u.jsx)(c.O, {
iconIndicator: 'mood',
children: 'Icecream'
})
]
})
}),
(0, u.jsx)(a.q3, {
label: 'Manually Positioned',
children: function () {
var e = {
transformOrigin: 'center center',
transform: 'translateY(1rem) scale(0.45)'
};
return (0, u.jsxs)(l.n, {
children: [
(0, u.jsx)(c.O, {
label: 'Cookies',
iconIndicator: { icon: 'star', style: e }
}),
(0, u.jsx)(c.O, {
label: 'Pizza',
iconIndicator: { icon: 'favorite', style: e }
}),
(0, u.jsx)(c.O, {
label: 'Icecream',
iconIndicator: { icon: 'mood', style: e }
})
]
});
}
}),
(0, u.jsx)(a.PQ, {
src: o,
components: [
{ displayName: 'TabBar', component: l.n },
{ displayName: 'Tab', component: c.O }
]
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
d = function (e, t) {
return (
(d =
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]);
}),
d(e, t)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
p = function () {
return (
(p =
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;
}),
p.apply(this, arguments)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
p
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n) {
var r = e.call(this, p(p({}, t.defaultAdapter), n)) || this;
return (r.useAutomaticActivation_ = !1), r;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
d = function (e, t) {
return (
(d =
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]);
}),
d(e, t)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function p(e, t) {
function n() {
this.constructor = e;
}
d(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
|
p
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
f = function () {
return (
(f =
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;
}),
f.apply(this, arguments)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
f
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n) {
return e.call(this, f(f({}, t.defaultAdapter), n)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
k = function (e) {
var t = (0, c.j)({
props: e,
elements: { rootEl: !0, contentEl: !0 },
foundation: function (t) {
var n = t.rootEl,
r = t.contentEl,
i = {
addClass: function (e) {
n.addClass(e);
},
removeClass: function (e) {
n.removeClass(e);
},
computeContentClientRect: function () {
return r.ref ? r.ref.getBoundingClientRect() : u.B;
},
setContentStyleProperty: function (e, t) {
r.setStyle(e, t);
}
};
return 'fade' === e.transition ? new v(i) : new x(i);
},
api: function (e) {
var t = e.foundation;
return {
activate: function (e) {
t.activate(e);
},
deactivate: function () {
t.deactivate();
},
computeContentClientRect: function () {
return t.computeContentClientRect();
}
};
}
}),
n = (t.foundation, (0, l.Z)(t, y));
return (0, s.Z)({}, n);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
k
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function E(e) {
var t = k(e),
n = t.rootEl,
i = t.contentEl,
s = e.icon,
l = e.transition;
return (0, w.jsx)(r.Vp, {
tag: 'span',
element: n,
className: a()('mdc-tab-indicator', {
'mdc-tab-indicator--fade': 'fade' === l
}),
children: (0, w.jsx)(r.Vp, {
tag: s ? o.J : 'span',
'aria-hidden': 'true',
icon: s,
element: i,
className:
'mdc-tab-indicator__content mdc-tab-indicator__content--'.concat(
s ? 'icon' : 'underline'
)
})
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
E
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
c = function (e, t) {
return (
(c =
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]);
}),
c(e, t)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
c
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function u(e, t) {
function n() {
this.constructor = e;
}
c(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
|
u
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function p(e, t) {
var n = 'function' === typeof Symbol && e[Symbol.iterator];
if (!n) return e;
var r,
i,
a = n.call(e),
o = [];
try {
for (; (void 0 === t || t-- > 0) && !(r = a.next()).done; )
o.push(r.value);
} catch (s) {
i = { error: s };
} finally {
try {
r && !r.done && (n = a.return) && n.call(a);
} finally {
if (i) throw i.error;
}
}
return o;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
p
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
b = function (e) {
this.adapter = e;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
b
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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.isAnimating_ = !1), r;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
E = function (e) {
var t = (0, o.j)({
props: e,
api: function (e) {
var t = e.foundation,
n = e.contentEl,
r = t;
return {
scrollTo: function (e) {
return r.scrollTo(e);
},
incrementScroll: function (e) {
return r.incrementScroll(e);
},
getScrollPosition: function () {
return r.getScrollPosition();
},
getScrollContentWidth: function () {
var e;
return (
(null === (e = n.ref) || void 0 === e
? void 0
: e.offsetWidth) || 0
);
}
};
},
elements: { rootEl: !0, areaEl: !0, contentEl: !0 },
foundation: function (e) {
var t = e.rootEl,
n = e.areaEl,
r = e.contentEl;
return new k({
eventTargetMatchesSelector: function (e, t) {
return (0, l.w)(e, t);
},
addClass: function (e) {
return t.addClass(e);
},
removeClass: function (e) {
return t.removeClass(e);
},
addScrollAreaClass: function (e) {
return n.addClass(e);
},
setScrollAreaStyleProperty: function (e, t) {
return n.setStyle(e, t);
},
setScrollContentStyleProperty: function (e, t) {
return r.setStyle(e, t);
},
getScrollContentStyleValue: function (e) {
return (
(r.ref &&
window.getComputedStyle(r.ref).getPropertyValue(e)) ||
'none'
);
},
setScrollAreaScrollLeft: function (e) {
return n.ref && (n.ref.scrollLeft = e);
},
getScrollAreaScrollLeft: function () {
return n.ref ? n.ref.scrollLeft : 0;
},
getScrollContentOffsetWidth: function () {
return r.ref ? r.ref.offsetWidth : 0;
},
getScrollAreaOffsetWidth: function () {
return n.ref ? n.ref.offsetWidth : 0;
},
computeScrollAreaClientRect: function () {
return n.ref ? n.ref.getBoundingClientRect() : s.B;
},
computeScrollContentClientRect: function () {
return r.ref ? r.ref.getBoundingClientRect() : s.B;
},
computeHorizontalScrollbarHeight: function () {
return (function (e, t) {
if (
(void 0 === t && (t = !0),
t && 'undefined' !== typeof f)
)
return f;
var n = e.createElement('div');
n.classList.add(h.SCROLL_TEST), e.body.appendChild(n);
var r = n.offsetHeight - n.clientHeight;
return e.body.removeChild(n), t && (f = r), r;
})(document);
}
});
}
}),
n = t.foundation,
a = (0, i.Z)(t, w),
c = a.areaEl,
u = a.contentEl,
d = function () {
n.handleInteraction();
};
return (
c.setProp('onWheel', d, !0),
c.setProp('onTouchStart', d, !0),
c.setProp('onPointerDown', d, !0),
c.setProp('onMouseDown', d, !0),
c.setProp('onKeyDown', d, !0),
u.setProp(
'onTransitionEnd',
function (e) {
n.handleTransitionEnd(e);
},
!0
),
(0, r.Z)({}, a)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
E
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function S(e) {
var t = e.children,
n = (e.apiRef, (0, i.Z)(e, C)),
o = E(e),
s = o.rootEl,
l = o.areaEl,
c = o.contentEl;
return (0, T.jsx)(
a.Vp,
(0, r.Z)(
(0, r.Z)({}, n),
{},
{
ref: null,
element: s,
className: 'mdc-tab-scroller',
children: (0, T.jsx)(a.Vp, {
element: l,
className: 'mdc-tab-scroller__scroll-area',
children: (0, T.jsx)(a.Vp, {
element: c,
className: 'mdc-tab-scroller__scroll-content',
children: t
})
})
}
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
S
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
m
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
h
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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.focusOnActivate_ = !0), r;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
m
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function h(e, t) {
function n() {
this.constructor = e;
}
m(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
|
h
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/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
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
g = function () {
return (
(g =
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;
}),
g.apply(this, arguments)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
g
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n) {
var r = e.call(this, g(g({}, t.defaultAdapter), n)) || this;
return (
(r.savedTabIndex_ = null),
(r.interactionHandler_ = function (e) {
return r.handleInteraction(e);
}),
r
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n, r) {
void 0 === r && (r = {});
var i = e.call(this, g(g({}, t.defaultAdapter), n)) || this;
return (
(i.isFocused_ = !1),
(i.receivedUserInput_ = !1),
(i.isValid_ = !0),
(i.useNativeValidation_ = !0),
(i.validateOnValueChange_ = !0),
(i.helperText_ = r.helperText),
(i.characterCounter_ = r.characterCounter),
(i.leadingIcon_ = r.leadingIcon),
(i.trailingIcon_ = r.trailingIcon),
(i.inputFocusHandler_ = function () {
return i.activateFocus();
}),
(i.inputBlurHandler_ = function () {
return i.deactivateFocus();
}),
(i.inputInputHandler_ = function () {
return i.handleInput();
}),
(i.setPointerXOffset_ = function (e) {
return i.setTransformOrigin(e);
}),
(i.textFieldInteractionHandler_ = function () {
return i.handleTextFieldInteraction();
}),
(i.validationAttributeChangeHandler_ = function (e) {
return i.handleValidationAttributeChange(e);
}),
i
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function t(n) {
return e.call(this, g(g({}, t.defaultAdapter), n)) || this;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
t
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
M = function (e) {
var t = (0, a.useState)(!1),
n = (0, E.Z)(t, 2),
o = n[0],
s = n[1],
l = (0, a.useState)(0),
c = (0, E.Z)(l, 2),
u = c[0],
d = c[1],
p = (0, a.useState)(),
m = (0, E.Z)(p, 2),
h = m[0],
g = m[1],
b = (0, a.useState)(!1),
v = (0, E.Z)(b, 2),
x = v[0],
y = v[1],
k = (0, a.useState)(!1),
w = (0, E.Z)(k, 2),
T = w[0],
C = w[1],
S = (0, a.useRef)(),
_ = function (e) {
S.current = e;
},
P = (0, a.useRef)(),
A = (0, a.useRef)(),
I = (0, a.useRef)(),
O = (function (e) {
var t = (0, a.useState)(),
n = (0, E.Z)(t, 2),
o = n[0],
s = n[1],
l = (0, f.j)({
props: e,
api: function (e) {
var t = e.foundation;
return {
getFoundation: function () {
return t;
}
};
},
elements: {},
foundation: function () {
return new N({
setContent: function (e) {
s(e);
}
});
}
}),
c = (l.foundation, (0, i.Z)(l, j));
return (0, r.Z)({ content: o }, c);
})({ apiRef: e.characterCount ? _ : void 0 }),
L = O.content,
M = (0, f.j)({
props: e,
elements: { rootEl: !0, inputEl: !0 },
foundation: function (e) {
var t = e.rootEl,
n = e.inputEl,
i = e.getProps;
return new R(
(0, r.Z)(
(0, r.Z)(
(0, r.Z)(
(0, r.Z)(
{
addClass: function (e) {
return t.addClass(e);
},
removeClass: function (e) {
return t.removeClass(e);
},
hasClass: function (e) {
return t.hasClass(e);
},
registerTextFieldInteractionHandler: function (
e,
n
) {
return t.addEventListener(e, n);
},
deregisterTextFieldInteractionHandler: function (
e,
n
) {
return t.removeEventListener(e, n);
},
registerValidationAttributeChangeHandler:
function (e) {
if (n.ref) {
var t = new MutationObserver(function (t) {
return e(
(function (e) {
return e.map(function (e) {
return e.attributeName;
});
})(t)
);
}),
r = n.ref;
return (
r && t.observe(r, { attributes: !0 }), t
);
}
return {};
},
deregisterValidationAttributeChangeHandler:
function (e) {
e && e.disconnect();
},
isFocused: function () {
return document.activeElement === n.ref;
}
},
{
registerInputInteractionHandler: function (e, t) {
return n.addEventListener(e, t);
},
deregisterInputInteractionHandler: function (
e,
t
) {
return n.removeEventListener(e, t);
},
getNativeInput: function () {
return n.ref;
}
}
),
{
shakeLabel: function (e) {
return y(e);
},
floatLabel: function (e) {
var t;
C(
null !== (t = i().floatLabel) && void 0 !== t
? t
: e
);
},
hasLabel: function () {
return !!i().label;
},
getLabelWidth: function () {
var e;
return (
(null === (e = I.current) || void 0 === e
? void 0
: e.getWidth()) || 0
);
}
}
),
{
activateLineRipple: function () {
s(!0);
},
deactivateLineRipple: function () {
s(!1);
},
setLineRippleTransformOrigin: function (e) {
d(e);
}
}
),
{
notchOutline: function (e) {
g(e);
},
closeOutline: function () {
var e;
(null !== (e = i().floatLabel) && void 0 !== e) ||
g(void 0);
},
hasOutline: function () {
return !!i().outlined;
}
}
),
{
characterCounter: S.current
? S.current.getFoundation()
: void 0,
helperText: void 0,
leadingIcon: P.current
? P.current.getFoundation()
: void 0,
trailingIcon: A.current
? A.current.getFoundation()
: void 0
}
);
}
}),
F = M.foundation,
B = (0, i.Z)(M, D),
U = F.getValue();
return (
(0, a.useEffect)(
function () {
void 0 !== e.value &&
e.value !== U &&
F.setValue(String(e.value));
},
[e.value, F, U]
),
(0, a.useEffect)(
function () {
void 0 !== e.floatLabel &&
(F.notchOutline(e.floatLabel),
F.adapter.floatLabel(e.floatLabel));
},
[F, e.floatLabel]
),
(0, r.Z)(
{
shakeLabel: x,
floatLabel: T,
notchWidth: h,
lineRippleActive: o,
lineRippleCenter: u,
setCharacterCounter: _,
setLeadingIcon: function (e) {
return (P.current = e);
},
setTrailingIcon: function (e) {
return (A.current = e);
},
setFloatingLabel: function (e) {
return (I.current = e);
},
characterCountContent: L
},
B
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
M
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
_ = function (e) {
S.current = e;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
_
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
J = function (e, t) {
return (0, F.jsx)(K, {
apiRef: function (e) {
'leading' === t ? U(e) : z(e);
},
position: t,
tabIndex: 'trailing' === t ? 0 : void 0,
icon: e
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
J
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
K = function (e) {
e.apiRef;
var t = e.position,
n = (0, i.Z)(e, z),
a = (function (e) {
var t = (0, f.j)({
props: e,
elements: { rootEl: !0 },
api: function (e) {
var t = e.foundation;
return {
getFoundation: function () {
return t;
}
};
},
foundation: function (e) {
var t = e.rootEl,
n = e.emit;
return new k({
getAttr: function (e) {
return t.getProp(e);
},
setAttr: function (e, n) {
return t.setProp(e, n);
},
removeAttr: function (e) {
return t.removeProp(e);
},
setContent: function (e) {
t.setProp('icon', e);
},
registerInteractionHandler: function (e, n) {
return t.addEventListener(e, n);
},
deregisterInteractionHandler: function (e, n) {
return t.removeEventListener(e, n);
},
notifyIconAction: function () {
return n('onClick', {}, !0);
}
});
}
}),
n = (t.foundation, (0, i.Z)(t, w));
return (0, r.Z)({}, n);
})(e),
s = a.rootEl,
c = (0, o.oC)(e, [
'mdc-text-field__icon',
{
'mdc-text-field__icon--trailing': 'trailing' === t,
'mdc-text-field__icon--leading': 'leading' === t
}
]);
return (0, F.jsx)(
l.J,
(0, r.Z)(
{},
s.props((0, r.Z)((0, r.Z)({}, n), {}, { className: c }))
)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
K
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function l() {
return (0, s.jsxs)(r.WI, {
title: 'Text Fields',
lead: 'Text fields allow users to input, edit, and select text.',
module: '@rmwc/textfield',
styles: [
'@material/textfield/dist/mdc.textfield.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/ripple/dist/mdc.ripple.css',
'@rmwc/icon/icon.css'
],
docsLink:
'https://material.io/develop/web/components/input-controls/text-field/',
examples: a,
children: [
(0, s.jsx)(r.sb, { children: 'TextField Variants' }),
(0, s.jsx)(r.q3, {
label: 'Standard',
children: (0, s.jsx)(o.n, { label: 'standard...' })
}),
(0, s.jsx)(r.q3, {
label: 'Outlined',
children: (0, s.jsx)(o.n, {
outlined: !0,
label: 'outlined...'
})
}),
(0, s.jsx)(r.q3, {
label: 'No Label',
children: (0, s.jsx)(o.n, { placeholder: 'No label' })
}),
(0, s.jsx)(r.q3, {
label: 'Icons',
children: (0, s.jsxs)(s.Fragment, {
children: [
(0, s.jsx)(o.n, {
icon: 'search',
trailingIcon: 'close',
label: 'icon...'
}),
(0, s.jsx)(o.n, {
label: 'trailingIcon...',
trailingIcon: {
icon: 'close',
tabIndex: 0,
onClick: function () {
return console.log('Clear');
}
}
})
]
})
}),
(0, s.jsx)(r.sb, { children: 'Textareas' }),
(0, s.jsx)(r.PJ, {
children:
'You can make the TextField a textarea. Make sure to include `outlined` for proper styling You can optionally make help text always visible by passing an object as props with persistent set to true. Textareas can also have an optional character counter which will work with the maxLength property.'
}),
(0, s.jsx)(r.q3, {
children: (0, s.jsx)('div', {
children: (0, s.jsx)(o.n, {
textarea: !0,
label: 'textarea...',
rows: 8,
maxLength: 20,
characterCount: !0,
resizeable: !0,
helpText: {
persistent: !0,
validationMsg: !0,
children: 'The field is required'
}
})
})
}),
(0, s.jsx)(r.sb, { children: 'Validation' }),
(0, s.jsx)(r.q3, {
label: 'Disabled',
children: (0, s.jsx)(o.n, {
disabled: !0,
label: 'Disabled...'
})
}),
(0, s.jsx)(r.q3, {
label: 'Required',
children: (0, s.jsx)(o.n, {
required: !0,
label: 'Required...',
value: ''
})
}),
(0, s.jsx)(r.q3, {
label: 'Invalid',
children: (0, s.jsx)(o.n, {
invalid: !0,
label: 'Invalid...',
value: '#@!$',
onChange: function () {}
})
}),
(0, s.jsx)(r.q3, {
label: 'Validation Pattern',
children: (0, s.jsx)(o.n, {
label: 'Validate Pattern',
pattern: '[A-Za-z]{3}'
})
}),
(0, s.jsx)(r.sb, { children: 'HTML Input Types' }),
(0, s.jsx)(r.PJ, {
children:
'A preview of how `material-components-web` handles styling input types for your browser.'
}),
(0, s.jsx)(r.q3, {
children: (0, s.jsxs)(s.Fragment, {
children: [
(0, s.jsx)(o.n, { label: 'text', type: 'text' }),
(0, s.jsx)(o.n, {
label: 'color',
type: 'color',
style: { width: '6rem' }
}),
(0, s.jsx)(o.n, { label: 'date', type: 'date' }),
(0, s.jsx)(o.n, {
label: 'datetime-local',
type: 'datetime-local'
}),
(0, s.jsx)(o.n, { label: 'month', type: 'month' }),
(0, s.jsx)(o.n, { label: 'range', type: 'range' }),
(0, s.jsx)(o.n, { label: 'time', type: 'time' }),
(0, s.jsx)(o.n, { label: 'week', type: 'week' })
]
})
}),
(0, s.jsx)(r.PQ, {
src: i,
components: [{ displayName: 'TextField', component: o.n }]
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
l
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function d() {
return (0, u.jsxs)(r.WI, {
title: 'Theming',
lead: 'MDC Theme is a foundational module that themes MDC Web components.',
module: '@rmwc/theme',
styles: [
'@material/theme/dist/mdc.theme.css',
'@rmwc/theme/theme.css'
],
docsLink: 'https://material.io/develop/web/components/theme/',
examples: a,
children: [
(0, u.jsx)(r.sb, { children: 'Theme Options' }),
(0, u.jsx)(r.PJ, {
children:
'The Theme module fully embraces using CSS variables for runtime theming. This allows for some really powerful usecases like a built in dark mode, custom palettes for your clients, or dynamic configuration for accessibility.'
}),
(0, u.jsx)(r.PJ, {
children:
'Support for theming inside of `material-components-web` is not without issue, so RMWC maintains a theme fixes file to correct any anomalies for you. Please make sure you include both!'
}),
(0, u.jsx)(r.PJ, {
children:
'**Important** You should include the theme style sheets BEFORE any of your other styles.'
}),
(0, u.jsx)(r.q3, {
children: (0, u.jsxs)(u.Fragment, {
children: [
(0, u.jsx)('div', {
style: { backgroundColor: '#ddd' },
children: [
'primary',
'secondary',
'error',
'background',
'surface',
'primaryBg',
'secondaryBg',
'textPrimaryOnBackground',
'textSecondaryOnBackground',
'textHintOnBackground',
'textDisabledOnBackground',
'textIconOnBackground',
'textPrimaryOnLight',
'textSecondaryOnLight',
'textHintOnLight',
'textDisabledOnLight',
'textIconOnLight'
].map(function (e, t) {
return (0, u.jsx)(o.Q, { use: e, children: e }, t);
})
}),
(0, u.jsx)('div', {
style: { backgroundColor: '#333' },
children: [
'onPrimary',
'onSecondary',
'onError',
'textPrimaryOnDark',
'textSecondaryOnDark',
'textHintOnDark',
'textDisabledOnDark',
'textIconOnDark'
].map(function (e, t) {
return (0, u.jsx)(o.Q, { use: e, children: e }, t);
})
})
]
})
}),
(0, u.jsx)(r.sb, { children: 'ThemeProvider' }),
(0, u.jsx)(r.PJ, {
children:
'The `ThemeProvider` is an optional component that allows you to specify theme colors and settings for all of its subtree. This is useful to use once at the top of your app, or in parts of your app where the styles or color scheme differ.'
}),
(0, u.jsx)(r.PJ, {
children:
"You don't have to pass in all options. The `ThemeProvider` will automatically adjust some of the values like `onSurface` white or black text depending on colors contrast ratio."
}),
(0, u.jsx)(r.PJ, {
children:
'Theming in `material-components-web` isn\'t perfect, but a few basic options will get you most of the way. Try using the ThemePicker at the top and selecting "Shrine". You\'ll see that most things are colored appropriately, but the defaults provided for things like Buttons and tabs still have to have their colors overridden.'
}),
(0, u.jsx)(r.q3, {
label: 'Defaults',
children: (0, u.jsxs)(u.Fragment, {
children: [
(0, u.jsx)(s.z, { raised: !0, children: 'Cookies' }),
(0, u.jsx)(c.X, { label: 'Pizza', defaultChecked: !0 }),
(0, u.jsx)(l.Y, { label: 'Icecream', defaultChecked: !0 })
]
})
}),
(0, u.jsx)(r.q3, {
label: 'With Provider',
children: (0, u.jsxs)(o.f, {
options: { primary: 'red', secondary: 'blue' },
children: [
(0, u.jsx)(s.z, { raised: !0, children: 'Cookies' }),
(0, u.jsx)(c.X, { label: 'Pizza', defaultChecked: !0 }),
(0, u.jsx)(l.Y, { label: 'Icecream', defaultChecked: !0 })
]
})
}),
(0, u.jsx)(r.q3, {
label: 'More Options',
children: (0, u.jsxs)(o.f, {
options: {
primary: 'lightpink',
secondary: 'black',
onPrimary: '#000',
textPrimaryOnBackground: 'black'
},
children: [
(0, u.jsx)(s.z, { raised: !0, children: 'Cookies' }),
(0, u.jsx)(c.X, { label: 'Pizza', defaultChecked: !0 }),
(0, u.jsx)(l.Y, { label: 'Icecream', defaultChecked: !0 })
]
})
}),
(0, u.jsx)(r.sb, { children: 'Theme Component' }),
(0, u.jsx)(r.PJ, {
children:
"The Theme component allows you to apply theme colors to RMWC components, or components of your own. Almost every component in RMWC has a `theme` prop that you can use that takes the same options as the `Theme` component's `use` prop."
}),
(0, u.jsx)(r.q3, {
label: 'Custom',
children: (0, u.jsx)(o.Q, {
use: ['primaryBg', 'onPrimary'],
wrap: !0,
children: (0, u.jsx)('div', {
style: { width: '4rem', height: '4rem', padding: '1rem' },
children: 'Cookies'
})
})
}),
(0, u.jsx)(r.q3, {
label: 'Theme Prop',
children: (0, u.jsxs)(u.Fragment, {
children: [
(0, u.jsx)(o.Q, {
use: ['secondaryBg', 'onSecondary'],
wrap: !0,
children: (0, u.jsx)(s.z, { children: 'Pizza' })
}),
(0, u.jsx)(s.z, {
theme: ['secondaryBg', 'onSecondary'],
children: 'Pizza'
})
]
})
}),
(0, u.jsx)(r.q3, {
label: 'Typography',
children: (0, u.jsx)(u.Fragment, {
children: (0, u.jsxs)('h3', {
children: [
'I ',
(0, u.jsx)(o.Q, { use: 'primary', children: 'Want' }),
' ',
(0, u.jsx)(o.Q, {
use: 'secondary',
children: 'Icecream'
})
]
})
})
}),
(0, u.jsx)(r.PQ, {
src: i,
components: [
{ displayName: 'ThemeProvider', component: o.f },
{ displayName: 'Theme', component: o.Q }
]
})
]
});
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
a = function (e, t, n) {
var r = [e, t, n].map(function (e) {
return (e /= 255) <= 0.03928
? e / 12.92
: Math.pow((e + 0.055) / 1.055, 2.4);
});
return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2];
}
|
Any additional items will be passed to the\\n child ListItem as props
|
a
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
o = function (e) {
var t;
return (function (e) {
4 === e.length && (e += e.slice(1));
var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
return t
? {
r: parseInt(t[1], 16),
g: parseInt(t[2], 16),
b: parseInt(t[3], 16)
}
: { r: 0, g: 0, b: 0 };
})((e = i[(t = e)] || t));
}
|
Any additional items will be passed to the\\n child ListItem as props
|
o
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
s = function (e) {
var t,
n,
r = o(e),
i = r.r,
s = r.g,
l = r.b;
return !(
((n = [i, s, l]),
(a((t = [255, 255, 255])[0], t[1], t[2]) + 0.05) /
(a(n[0], n[1], n[2]) + 0.05)) > 3
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
s
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
d = function (e) {
var t = Object.keys(l).reduce(function (t, n) {
if (e[n]) {
var r = s(e[n]) ? c : u;
l[n].forEach(function (e) {
t[e[0]] = r[e[1]];
});
}
return t;
}, {});
return (0, r.Z)((0, r.Z)({}, t), e);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
d
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function s(e) {
var t = e.className,
n = e.style,
s = e.rootProps,
l = e.label,
c = e.children,
u = e.disabled,
d = e.label || e.children,
p = (0, i.M)('toggle-', e),
f = d
? { disabled: u }
: (0, r.Z)({ className: t, style: n, disabled: u }, s);
return {
id: p,
renderToggle: function (e) {
return d
? (0, o.jsxs)(
a.W,
(0, r.Z)(
(0, r.Z)({}, s),
{},
{
className: t,
style: n,
children: [
e,
(0, o.jsxs)('label', {
id: p + 'label',
htmlFor: p,
children: [l, c]
})
]
}
)
)
: e;
},
toggleRootProps: f
};
}
|
Any additional items will be passed to the\\n child ListItem as props
|
s
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function g() {
var e = this.constructor.getDerivedStateFromProps(
this.props,
this.state
);
null !== e && void 0 !== e && this.setState(e);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
g
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function b(e) {
this.setState(
function (t) {
var n = this.constructor.getDerivedStateFromProps(e, t);
return null !== n && void 0 !== n ? n : null;
}.bind(this)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
b
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function v(e, t) {
try {
var n = this.props,
r = this.state;
(this.props = e),
(this.state = t),
(this.__reactInternalSnapshotFlag = !0),
(this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
n,
r
));
} finally {
(this.props = n), (this.state = r);
}
}
|
Any additional items will be passed to the\\n child ListItem as props
|
v
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function x(e, t) {
for (var n = t; n; ) {
if (n === e) return !0;
n = n.parentNode;
}
return !1;
}
|
Any additional items will be passed to the\\n child ListItem as props
|
x
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function w(e, t, n, r) {
var i = h.unstable_batchedUpdates
? function (e) {
h.unstable_batchedUpdates(n, e);
}
: n;
return k()(e, t, i, r);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
w
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
function E(e) {
return (
(E =
'function' === typeof Symbol &&
'symbol' === typeof Symbol.iterator
? function (e) {
return typeof e;
}
: function (e) {
return e &&
'function' === typeof Symbol &&
e.constructor === Symbol &&
e !== Symbol.prototype
? 'symbol'
: typeof e;
}),
E(e)
);
}
|
Any additional items will be passed to the\\n child ListItem as props
|
E
|
javascript
|
rmwc/rmwc
|
docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
https://github.com/rmwc/rmwc/blob/master/docs/version/8.0.8/static/js/main.6c3f4ae5.js
|
MIT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.