Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Prop({ default: 0 })
public scrollToOffset: number; // the offset to add (in case of a sticky header)
@Prop({ default: true })
public disabled: boolean;
public get transitionName(): string | undefined {
return !this.disabled ? 'm--is' : undefined;
}
public get isLeftToRight(): boolean {
return this.direction === MSlideTransitionDirection.LeftToRight;
}
@Emit('enter')
private transitionEnter(el: HTMLElement, done): void {
if (!this.disabled) {
this.$scrollTo.goTo(this.$el as HTMLElement, this.scrollToOffset, ScrollToDuration.Regular);
setTimeout(() => {
this.transitionBeforeLeave(el);
}, 100);
} else {
done();
}
}
private transitionAfterEnter(): void {
(this.$el as HTMLElement).style.removeProperty('height');
(this.$el as HTMLElement).style.removeProperty('overflow');
}
public get popupBody(): Element {
return (this.$children[0] as any).popupBody;
}
private get propOpen(): boolean {
return this.open === undefined ? this.internalOpen : this.open;
}
private set propOpen(value: boolean) {
if (!this.disabled) {
this.internalOpen = value;
this.$emit('update:open', value);
}
}
@Emit('open')
private onOpen(): void { }
@Emit('close')
private onClose(): void { }
public get propOpenTrigger(): MOpenTrigger {
return this.openTrigger; // todo: mobile + hover ??
}
public get propTrigger(): HTMLElement {
return this.trigger || this.as().triggerHook || undefined;
}
private onPortalMounted(): void {
this.$emit('portal-mounted');
}
this.tableList.map((item) => {
if (item.dataIndex) {
this.checkList.push(item.dataIndex);
}
return false;
});
}
}
// methods
@Emit()
onSearch(): void {
this.$emit('search', Object.assign(this.params, this.Form.getFieldsValue()));
}
@Emit()
reset(): void {
this.Form.resetFields();
this.$emit('clearOut');
this.params = JSON.parse(JSON.stringify(this.initParams));
this.$emit('search', this.Form.resetFields());
}
@Emit()
levelcodeChange(val: any, key: string): void {
const value = JSON.parse(JSON.stringify(val));
this.params.levelCode = value.pop();
}
@Emit()
openSetting(): void {
this.setModel = true;
default: 0
})
minItemCount: number;
@Prop({
default: Infinity
})
maxItemCount: number;
mounted(): void {
if (!this.$scopedSlots.row && !this.$scopedSlots.item) {
throw new Error('MRepeater requires content to be provided through row or item slot.');
}
}
@Emit('add')
onAddBtnClick(): void { }
@Emit('delete')
onDeleteBtnClick(index: number): void { }
getRowProps(item: MRepeaterItem, index: number): MRepeaterRowProps {
return {
...this.getItemProps(item, index),
canDelete: this.canDelete
};
}
getRowListeners(item: MRepeaterItem, index: number): MRepeaterRowListeners {
return {
onDelete: () => this.onDeleteBtnClick(index)
};
};
private selectedChildrenCount: number = 0;
@Watch('isSelected')
public notifyParentOfChildCheckboxState(): void {
if (this.withCheckboxes) {
if (!this.hasChildren || this.isParentAutoSelect) {
this.$emit('auto-select-child-checkbox-change', this.isSelected);
} else if (this.isButtonAutoSelect && this.hasChildren) {
this.onAutoSelectChildCheckboxChange(this.isSelected, true);
}
}
}
@Emit('click')
public emitClick(path: string): string {
return path;
}
protected mounted(): void {
this.internalOpen = this.open || this.isParentOfOpenedFolder() || this.isParentOfSelectedFile;
if (this.isSelected) {
this.notifyParentOfChildCheckboxState();
}
}
public onClick(): void {
if (this.isFolder) {
this.internalOpen = !this.internalOpen;
this.$emit('update:open', this.internalOpen);
} else if (this.selectable) {
onMonthNext(event: Event): void {
}
@Emit(CalendarEvent.MONTH_PREVIOUS)
onMonthPrevious(event: Event): void {
}
@Emit(CalendarEvent.YEAR_SELECT)
onYearSelect(year: YearState): void {
}
@Emit(CalendarEvent.YEAR_MONTH_SELECT)
onYearMonthSelect(year: YearState, month: MonthState): void {
}
@Emit(CalendarEvent.YEAR_NEXT)
onYearNext(event: Event): void {
}
@Emit(CalendarEvent.YEAR_PREVIOUS)
onYearPrevious(event: Event): void {
}
}
@Prop(String)
eventLabel?: string;
@State
app!: AppStore;
@State
grid!: GridClient;
isProcessing = false;
@Emit('join')
join(_community: Community) {}
@Emit('leave')
leave(_community: Community) {}
get badge() {
return !this.hideCount && this.community.member_count
? number(this.community.member_count)
: '';
}
get tooltipContainer() {
return findTooltipContainer(this);
}
async onClick() {
if (!this.app.user || this.isProcessing) {
return;
}
}
}
@Emit('hide')
private hideDone() {
this.isVisible = false;
}
private clearHideTimeout() {
if (this.hideTimeout) {
clearTimeout(this.hideTimeout);
this.hideTimeout = undefined;
}
}
@Emit('auto-hide')
private onAutoHide() {}
}
import { FLAG_NAME } from '../component-names';
import WithRender from './flag.html?style=./flag.scss';
@WithRender
@Component
export class MFlag extends ModulVue {
@Prop({ required: true })
public iso: string;
@Prop()
public title: string;
@Prop({ default: '20px' })
public size: string;
@Prop({ default: false })
public squared: boolean;
@Emit('click')
onClick(event: Event): void { }
@Emit('keydown')
onKeydown(event: Event): void { }
private get hasTitle(): boolean {
return !!this.title;
}
private get height(): string {
return this.size;
}
private get width(): string {
return ((parseInt(this.size, 10) * 4) / 3) + 'px';
}
@Emit('change')
setValue(val: number | string): ReturnParamsEntity {
this.setNumber(val);
const reParams: ReturnParamsEntity = {
value: this.number,
original: this.originalNumber,
};
this.returnModal();
(this.change as Function)(reParams);
return reParams;
}
@Emit('model')
returnModal(): number | string {
return this.number;
}
changeValue(ev: MouseEvent) {
this.setValue((this.parser as Function)(getValueFromEvent(ev)));
}
focusFn() {
this.write = !this.readonly;
}
blurFn(ev: MouseEvent) {
let value = (this.parser as Function)(getValueFromEvent(ev));
if (value >= this.max) {
value = this.max;