Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected render(): DNode {
let { aria = {}, closeText, open = false, title = '', theme, classes } = this.properties;
const contentStyles = this.getStyles();
const contentClasses = this.getModifierClasses();
const fixedContentClasses = this.getFixedModifierClasses();
if (!closeText) {
const { messages } = this.localizeBundle(commonBundle);
closeText = `${messages.close} ${title}`;
}
// This is a side-effect of rendering, it clears the slide styles for the next render.
this._slide = undefined;
return v(
'div',
{
'aria-labelledby': this._titleId,
classes: this.theme(css.root),
onmousedown: this._onSwipeStart,
onmousemove: this._onSwipeMove,
onmouseup: this._onSwipeEnd,
ontouchend: this._onSwipeEnd,
ontouchmove: this._onSwipeMove,
ontouchstart: this._onSwipeStart
},
[
open ? this.renderUnderlay() : null,
v(
'div',
{
render(): DNode {
const { active, controls, disabled, id } = this.properties;
const { messages } = this.localizeBundle(commonBundle);
return v(
'div',
{
'aria-controls': controls,
'aria-disabled': disabled ? 'true' : 'false',
'aria-selected': active === true ? 'true' : 'false',
classes: this.theme([css.tabButton, ...this.getModifierClasses()]),
focus: this.shouldFocus,
id,
key: 'tab-button',
onclick: this._onClick,
onkeydown: this._onKeyDown,
role: 'tab',
tabIndex: active === true ? 0 : -1
},
[v('span', { classes: this.theme(css.tabButtonContent) }, this.getContent(messages))]
);
year: this._year,
onMonthChange: (month: number) => {
this._month = month;
this.invalidate();
},
onYearChange: (year: number) => {
this._year = year;
this.invalidate();
},
onDateSelect: (date: Date) => {
this._selectedDate = date;
this.invalidate();
}
}),
this._selectedDate
? v('p', [`Selected Date: ${this._selectedDate.toDateString()}`])
: null
]);
}
}
protected renderPagingButtonContent(type: Paging, labels: CalendarMessages): DNode[] {
const { theme, classes } = this.properties;
const iconType = type === Paging.next ? 'rightIcon' : 'leftIcon';
const labelText = type === Paging.next ? labels.nextMonth : labels.previousMonth;
return [
w(Icon, { type: iconType, theme, classes }),
v('span', { classes: [baseCss.visuallyHidden] }, [labelText])
];
}
const toggleChecked = icache.getOrSet('toggle-checked', true);
const selectedRadio = icache.getOrSet('radio', 'first');
function radioChange(value: string) {
icache.set('radio', value);
}
return v('div', { classes: css.root }, [
v('h2', ['Buttons']),
v(
'div',
{
classes: css.buttons
},
[
v('h3', ['Enabled']),
w(Button, {}, ['Basic Button']),
w(Button, {}, ['Icon Button ', w(Icon, { type: 'searchIcon' })]),
w(
Button,
{
popup: { expanded: false, id: 'fakeId' }
},
['Popup']
),
w(
Button,
{
pressed: togglePressed,
onClick: () => {
icache.set('toggle-pressed', !togglePressed);
}
render() {
return v('div', [
w(Select, {
key: 'select1',
...this.getOptionSettings(),
getOptionSelected: (option: any) => !!this._value1 && option.value === this._value1,
label: 'Native select',
options: this._selectOptions,
useNativeElement: true,
value: this._value1,
onChange: (option: any) => {
this._value1 = option.value;
this.invalidate();
}
}),
v('p', {
innerHTML: 'Result value: ' + this._value1
}),
w(Select, {
key: 'select2',
...this.getOptionSettings(),
label: 'Custom select box',
options: this._moreSelectOptions,
value: this._value2,
onChange: (option: any) => {
this._value2 = option.value;
this.invalidate();
}
}),
v('br'),
w(Select, {
key: 'select3',
fixedCss.containerFixed,
this.theme(css.details),
fixedCss.detailsFixed
]
},
[total ? `${from} - ${total < to ? total : to} of ${total} Results` : '0 Results']
),
v(
'nav',
{
role: 'navigation',
'aria-label': 'Pagination Navigation',
classes: [this.theme(css.pagination)]
},
[
v(
'ul',
{
classes: [
fixedCss.containerFixed,
this.theme(css.paginationList),
fixedCss.paginationListFixed
]
},
[
v('li', { classes: [fixedCss.itemFixed, this.theme(css.item)] }, [
totalPages > 1 &&
v(
'button',
{
key: 'previous',
disabled: page === 1,
protected renderActions(): DNode {
const { close } = this.localizeBundle(commonBundle).messages;
const { align = Align.right, theme, classes, heading } = this.properties;
const actions = v(
'div',
{
classes: this.theme(css.actions),
key: 'menu'
},
this.children
);
return this._collapsed
? w(
SlidePane,
{
align,
closeText: close,
key: 'slide-pane-menu',
onRequestClose: this._closeMenu,
render(): DNode {
return v('div', [
v('h2', {}, ['Range Slider']),
v('h3', {}, ['Value']),
w(RangeSlider, {
key: 'value1',
label: 'mostly default settings',
min: 0,
max: 50,
value: { min: this._state.value1Min, max: this._state.value1Max },
onValue: ({ min, max }) => {
this._state.value1Min = min;
this._state.value1Max = max;
this.invalidate();
}
}),
v('div', {}, [`Min: ${this._state.value1Min} - Max: ${this._state.value1Max}`]),
v('h3', {}, ['Tooltips']),
v('h4', {}, ['showOutput']),
Nam sollicitudin varius augue, sed lacinia felis tempor in.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque id purus ipsum. Aenean ac purus purus.
Nam sollicitudin varius augue, sed lacinia felis tempor in.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque id purus ipsum. Aenean ac purus purus.
Nam sollicitudin varius augue, sed lacinia felis tempor in.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque id purus ipsum. Aenean ac purus purus.
Nam sollicitudin varius augue, sed lacinia felis tempor in.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque id purus ipsum. Aenean ac purus purus.
Nam sollicitudin varius augue, sed lacinia felis tempor in.`
]
),
v('button', {
id: 'button',
innerHTML: 'open slidepane',
onclick: this.openSlidePane
}),
v('div', { classes: 'option' }, [
v('input', {
type: 'checkbox',
id: 'underlay',
onchange: this.toggleUnderlay
}),
v('label', {
for: 'underlay',
innerHTML: 'underlay'
})
]),
v('div', { classes: 'option' }, [