smart-webcomponents-angular
Version:
[](https://jqwidgets.com/license/)
1,046 lines (1,036 loc) • 49.5 kB
JavaScript
if(typeof window !== 'undefined') {
if (!window['Smart']) {
window['Smart'] = { RenderMode: 'manual' };
}
else {
window['Smart'].RenderMode = 'manual';
}
}
import './../source/modules/smart.menu';
import { __awaiter } from 'tslib';
import * as i0 from '@angular/core';
import { EventEmitter, Directive, Output, Input, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
class BaseElement {
constructor(ref) {
this.onCreate = new EventEmitter();
this.onReady = new EventEmitter();
this.onAttach = new EventEmitter();
this.onDetach = new EventEmitter();
const that = this;
this.nativeElement = ref.nativeElement;
that.nativeElement.onAttached = () => {
that.onAttach.emit(that.nativeElement);
};
that.nativeElement.onDetached = () => {
that.onDetach.emit(that.nativeElement);
};
}
addEventListener(type, listener, options = false) {
this.nativeElement.addEventListener(type, listener, options);
}
removeEventListener(type, listener, options = false) {
this.nativeElement.removeEventListener(type, listener, options);
}
dispatchEvent(event) {
return this.nativeElement.dispatchEvent(event);
}
blur() {
this.nativeElement.blur();
}
click() {
this.nativeElement.click();
}
focus(options) {
this.nativeElement.focus(options);
}
/** @description Sets or gets the license. */
get license() {
return this.nativeElement ? this.nativeElement.license : undefined;
}
set license(value) {
this.nativeElement ? this.nativeElement.license = value : undefined;
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Determines the theme. Theme defines the look of the element */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
}
BaseElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BaseElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
BaseElement.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: BaseElement, inputs: { license: "license", locale: "locale", localizeFormatFunction: "localizeFormatFunction", messages: "messages", rightToLeft: "rightToLeft", theme: "theme" }, outputs: { onCreate: "onCreate", onReady: "onReady", onAttach: "onAttach", onDetach: "onDetach" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BaseElement, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onCreate: [{
type: Output
}], onReady: [{
type: Output
}], onAttach: [{
type: Output
}], onDetach: [{
type: Output
}], license: [{
type: Input
}], locale: [{
type: Input
}], localizeFormatFunction: [{
type: Input
}], messages: [{
type: Input
}], rightToLeft: [{
type: Input
}], theme: [{
type: Input
}] } });
let Smart;
if (typeof window !== "undefined") {
Smart = window.Smart;
}
class MenuComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
/** @description This event is triggered when the menu is closed. The event is fired only in 'dropDown' mode.
* @param event. The custom event. */
this.onClose = new EventEmitter();
/** @description This event is triggered when the menu is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function. The event is fired only in 'dropDown' mode.
* @param event. The custom event. Custom event was created with: event.detail( trigger)
* trigger - Indicates whether the event was called from inside the element or programatically.
*/
this.onClosing = new EventEmitter();
/** @description This event is triggered when a smart-menu-items-group is collapsed.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, path, children)
* item - The menu item that was collapsed.
* label - The label of the toggled item that was collapsed.
* value - The value of the toggled item that was collapsed.
* path - The path of the toggled item that was collapsed, e.g. '0.1', '1.1.2'.
* children - The children items of the toggled item that was collapsed.
*/
this.onCollapse = new EventEmitter();
/** @description This event is triggered when a smart-menu-items-group is collapsing.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, path, children)
* item - The menu item that is going to be collapsed.
* label - The label of the toggled item that is going to be collapsed.
* value - The value of the toggled item that is going to be collapsed.
* path - The path of the toggled item that is going to be collapsed, e.g. '0.1', '1.1.2'.
* children - The children items of the toggled item that is going to be collapsed.
*/
this.onCollapsing = new EventEmitter();
/** @description This event is triggered when a smart-menu-items-group is expanded.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, path, children)
* item - The menu item that was expanded.
* label - The label of the toggled item that was expanded.
* value - The value of the toggled item that was expanded.
* path - The path of the toggled item that was expanded, e.g. '0.1', '1.1.2'.
* children - The children items of the toggled item that was expanded.
*/
this.onExpand = new EventEmitter();
/** @description This event is triggered before a smart-menu-items-group is expanded.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, path, children)
* item - The menu item that is going to be expanded.
* label - The label of the toggled item that is going to be expanded.
* value - The value of the toggled item that is going to be expanded.
* path - The path of the toggled item that is going to be expanded, e.g. '0.1', '1.1.2'.
* children - The children items of the toggled item that is going to be expanded.
*/
this.onExpanding = new EventEmitter();
/** @description This event is triggered when a menu item check state is changed.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, checked)
* item - The menu item which state was changed.
* label - The label of the item which state was changed.
* value - The value of the item which state was changed.
* checked - The checked state of the toggled item. If false the item is not toggled.
*/
this.onItemCheckChange = new EventEmitter();
/** @description This event is triggered when a menu item is clicked.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value)
* item - The menu item that is toggled.
* label - The label of the toggled item.
* value - The value of the toggled item.
*/
this.onItemClick = new EventEmitter();
/** @description This event is triggered when the menu is opened. The event is fired only in 'dropDown' mode.
* @param event. The custom event. */
this.onOpen = new EventEmitter();
/** @description This event is triggered when the menu is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function. The event is fired only in 'dropDown' mode.
* @param event. The custom event. */
this.onOpening = new EventEmitter();
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-menu');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description Sets or gets the animation mode. Animation is disabled when the property is set to 'none' */
get animation() {
return this.nativeElement ? this.nativeElement.animation : undefined;
}
set animation(value) {
this.nativeElement ? this.nativeElement.animation = value : undefined;
}
/** @description Determines delay (in milliseconds) before a Menu dropdown is closed when leaving the Menu with the mouse. Applicable only when selectionMode is 'mouseenter'. */
get autoCloseDelay() {
return this.nativeElement ? this.nativeElement.autoCloseDelay : undefined;
}
set autoCloseDelay(value) {
this.nativeElement ? this.nativeElement.autoCloseDelay = value : undefined;
}
/** @description If set to true, on mouseenter, the element receives focus automatically. */
get autoFocusOnMouseenter() {
return this.nativeElement ? this.nativeElement.autoFocusOnMouseenter : undefined;
}
set autoFocusOnMouseenter(value) {
this.nativeElement ? this.nativeElement.autoFocusOnMouseenter = value : undefined;
}
/** @description Allows top-level Menu items (immediate children of the Menu) to be checkable. Sublevels are controlled by setting checkable to the respective smart-menu-items-group. */
get checkable() {
return this.nativeElement ? this.nativeElement.checkable : undefined;
}
set checkable(value) {
this.nativeElement ? this.nativeElement.checkable = value : undefined;
}
/** @description Sets or gets whether checkboxes and radio buttons can be displayed in the Menu. This property is applicable only to the Menu itself, and not its smart-menu-item/smart-menu-items-group subitems. See also the property checkable. */
get checkboxes() {
return this.nativeElement ? this.nativeElement.checkboxes : undefined;
}
set checkboxes(value) {
this.nativeElement ? this.nativeElement.checkboxes = value : undefined;
}
/** @description Sets the check mode of top-level Menu items (immediate children of the Menu). checkMode can be set to 'checkbox', 'radioButton', or a comma-separated list containing 'checkbox', 'radioButton', or 'none' (e.g. 'checkbox, radioButton, none, checkbox'). When set to a list, each value in the list is applied to groups of Menu items separated by an item with separator (item after the one with separator is the start of a new checkMode context). Sublevels are controlled by setting checkMode to the respective smart-menu-items-group. */
get checkMode() {
return this.nativeElement ? this.nativeElement.checkMode : undefined;
}
set checkMode(value) {
this.nativeElement ? this.nativeElement.checkMode = value : undefined;
}
/** @description Sets the document event which closes any open Menu drop downs (or the Menu itself when mode is 'dropDown'). */
get closeAction() {
return this.nativeElement ? this.nativeElement.closeAction : undefined;
}
set closeAction(value) {
this.nativeElement ? this.nativeElement.closeAction = value : undefined;
}
/** @description Determines the data source that will be loaded to the Menu. The data source represents an array of objects with the following properties: label - a string representing the text content of the item.value - the value of the item.shortcut - a string representing a shortuct for the item. It will be displayed inside the item.items - allows to define an array of sub menu items. */
get dataSource() {
return this.nativeElement ? this.nativeElement.dataSource : undefined;
}
set dataSource(value) {
this.nativeElement ? this.nativeElement.dataSource = value : undefined;
}
/** @description Enables or disables element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description Determines the field in the data source that corresponds to an item's label. */
get displayMember() {
return this.nativeElement ? this.nativeElement.displayMember : undefined;
}
set displayMember(value) {
this.nativeElement ? this.nativeElement.displayMember = value : undefined;
}
/** @description Sets custom outer container, where all dropdown containers must be appended. By default they are inside the menu. The value of the property can be an HTML element or the id of an HTML element. In mode 'dropDown', the property dropDownAppendTo also controls the parent element of the whole Menu. The open method works relatively to the original place of the Menu in the DOM. */
get dropDownAppendTo() {
return this.nativeElement ? this.nativeElement.dropDownAppendTo : undefined;
}
set dropDownAppendTo(value) {
this.nativeElement ? this.nativeElement.dropDownAppendTo = value : undefined;
}
/** @description If this property is enabled, when an element's dropdown is opened, a transparent overlay is positioned between the dropdown and the rest of the document. */
get dropDownOverlay() {
return this.nativeElement ? this.nativeElement.dropDownOverlay : undefined;
}
set dropDownOverlay(value) {
this.nativeElement ? this.nativeElement.dropDownOverlay = value : undefined;
}
/** @description Determines the opening direction of Menu dropdowns. */
get dropDownPosition() {
return this.nativeElement ? this.nativeElement.dropDownPosition : undefined;
}
set dropDownPosition(value) {
this.nativeElement ? this.nativeElement.dropDownPosition = value : undefined;
}
/** @description A getter that returns an array of all Menu items. */
get items() {
return this.nativeElement ? this.nativeElement.items : undefined;
}
set items(value) {
this.nativeElement ? this.nativeElement.items = value : undefined;
}
/** @description Determines the field in the data source that corresponds to an item group's subitems collection. */
get itemsMember() {
return this.nativeElement ? this.nativeElement.itemsMember : undefined;
}
set itemsMember(value) {
this.nativeElement ? this.nativeElement.itemsMember = value : undefined;
}
/** @description Sets or gets the unlockKey which unlocks the product. */
get unlockKey() {
return this.nativeElement ? this.nativeElement.unlockKey : undefined;
}
set unlockKey(value) {
this.nativeElement ? this.nativeElement.unlockKey = value : undefined;
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Used to load a custom minimize icon from an HTMLTemplateElement object. The HTMLTemplateElement is selected by it's id. */
get minimizeIconTemplate() {
return this.nativeElement ? this.nativeElement.minimizeIconTemplate : undefined;
}
set minimizeIconTemplate(value) {
this.nativeElement ? this.nativeElement.minimizeIconTemplate = value : undefined;
}
/** @description Determines the minimum width of the Menu at which it will switch from normal to minimized mode. If set to null, the Menu does not minimize automatically. */
get minimizeWidth() {
return this.nativeElement ? this.nativeElement.minimizeWidth : undefined;
}
set minimizeWidth(value) {
this.nativeElement ? this.nativeElement.minimizeWidth = value : undefined;
}
/** @description Determines the menu's display mode. */
get mode() {
return this.nativeElement ? this.nativeElement.mode : undefined;
}
set mode(value) {
this.nativeElement ? this.nativeElement.mode = value : undefined;
}
/** @description Opens or closes thte menu when it's in 'dropDown' mode. */
get opened() {
return this.nativeElement ? this.nativeElement.opened : undefined;
}
set opened(value) {
this.nativeElement ? this.nativeElement.opened = value : undefined;
}
/** @description Sets or gets the menu's scroll buttons behavior. Applicable only when dropDownAppendTo is not null. */
get overflow() {
return this.nativeElement ? this.nativeElement.overflow : undefined;
}
set overflow(value) {
this.nativeElement ? this.nativeElement.overflow = value : undefined;
}
/** @description If set to true, prevents the closing of the Menu or its dropdowns when Menu items are checked/unchecked. */
get preventCloseOnCheck() {
return this.nativeElement ? this.nativeElement.preventCloseOnCheck : undefined;
}
set preventCloseOnCheck(value) {
this.nativeElement ? this.nativeElement.preventCloseOnCheck = value : undefined;
}
/** @description If the element is readonly, users cannot interact with it. */
get readonly() {
return this.nativeElement ? this.nativeElement.readonly : undefined;
}
set readonly(value) {
this.nativeElement ? this.nativeElement.readonly = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Determines the menu's selection mode. */
get selectionMode() {
return this.nativeElement ? this.nativeElement.selectionMode : undefined;
}
set selectionMode(value) {
this.nativeElement ? this.nativeElement.selectionMode = value : undefined;
}
/** @description Determines the theme. Theme defines the look of the element */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
/** @description If is set to true, the element cannot be focused. */
get unfocusable() {
return this.nativeElement ? this.nativeElement.unfocusable : undefined;
}
set unfocusable(value) {
this.nativeElement ? this.nativeElement.unfocusable = value : undefined;
}
/** @description Determines the field in the data source that corresponds to an item's value. */
get valueMember() {
return this.nativeElement ? this.nativeElement.valueMember : undefined;
}
set valueMember(value) {
this.nativeElement ? this.nativeElement.valueMember = value : undefined;
}
/** @description Adds an item to the menu.
* @param {HTMLElement} Item. A smart-menu-item to add to the Menu.
* @param {HTMLElement | string} Parent?. The smart-menu-items-group or its id or numeric path to add the item to.
*/
addItem(Item, Parent) {
if (this.nativeElement.isRendered) {
this.nativeElement.addItem(Item, Parent);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.addItem(Item, Parent);
});
}
}
/** @description Checks an item.
* @param {HTMLElement | string} item. smart-menu-item/smart-menu-items-group or its id or numeric path.
*/
checkItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.checkItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.checkItem(item);
});
}
}
/** @description Clears all Menu items.
*/
clear() {
if (this.nativeElement.isRendered) {
this.nativeElement.clear();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.clear();
});
}
}
/** @description Clicks on an item programatically.
* @param {HTMLElement | string} item. smart-menu-item/smart-menu-items-group or its id or numeric path.
*/
clickItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.clickItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.clickItem(item);
});
}
}
/** @description Closes the Menu when mode is 'dropDown'.
*/
close() {
if (this.nativeElement.isRendered) {
this.nativeElement.close();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.close();
});
}
}
/** @description Collapses an item.
* @param {HTMLElement | string} item?. smart-menu-item/smart-menu-items-group or its id or numeric path. If no item is passed, all open items are collapsed.
* @param {boolean} animation?. If set to false, disables collapse animation even if animation is enabled for the element.
*/
collapseItem(item, animation) {
if (this.nativeElement.isRendered) {
this.nativeElement.collapseItem(item, animation);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.collapseItem(item, animation);
});
}
}
/** @description Expands an item.
* @param {HTMLElement | string} item. smart-menu-item/smart-menu-items-group or its id or numeric path.
* @param {boolean} animation?. If set to false, disables expand animation even if animation is enabled for the element.
*/
expandItem(item, animation) {
if (this.nativeElement.isRendered) {
this.nativeElement.expandItem(item, animation);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.expandItem(item, animation);
});
}
}
/** @description Gets an item by its id or numeric path.
* @param {string} id. The id or numeric path of an item
* @returns {HTMLElement}
*/
getItem(id) {
return __awaiter(this, void 0, void 0, function* () {
const getResultOnRender = () => {
return new Promise(resolve => {
this.nativeElement.whenRendered(() => {
const result = this.nativeElement.getItem(id);
resolve(result);
});
});
};
const result = yield getResultOnRender();
return result;
});
}
getItemSync(id) {
if (this.nativeElement.isRendered) {
return this.nativeElement.getItem(id);
}
return null;
}
/** @description Maximizes the Menu.
*/
maximize() {
if (this.nativeElement.isRendered) {
this.nativeElement.maximize();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.maximize();
});
}
}
/** @description Minimizes the Menu.
*/
minimize() {
if (this.nativeElement.isRendered) {
this.nativeElement.minimize();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.minimize();
});
}
}
/** @description Opens the Menu when mode is 'dropDown'.
* @param {number} left. Horizontal position
* @param {number} top. Vertical position
*/
open(left, top) {
if (this.nativeElement.isRendered) {
this.nativeElement.open(left, top);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.open(left, top);
});
}
}
/** @description Removes an item from the menu.
* @param {HTMLElement | string} item. The smart-menu-item/smart-menu-items-group or its id or numeric path to remove.
*/
removeItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.removeItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.removeItem(item);
});
}
}
/** @description Unchecks an item.
* @param {HTMLElement | string} item. smart-menu-item/smart-menu-items-group (or its id or numeric path)
*/
uncheckItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.uncheckItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.uncheckItem(item);
});
}
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
if (Smart)
Smart.Render();
this.nativeElement.classList.add('smart-angular');
if (this.nativeElement.whenRendered)
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
this.listen();
}
ngOnDestroy() {
this.unlisten();
}
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
/** @description Add event listeners. */
listen() {
const that = this;
that.eventHandlers['closeHandler'] = (event) => { that.onClose.emit(event); };
that.nativeElement.addEventListener('close', that.eventHandlers['closeHandler']);
that.eventHandlers['closingHandler'] = (event) => { that.onClosing.emit(event); };
that.nativeElement.addEventListener('closing', that.eventHandlers['closingHandler']);
that.eventHandlers['collapseHandler'] = (event) => { that.onCollapse.emit(event); };
that.nativeElement.addEventListener('collapse', that.eventHandlers['collapseHandler']);
that.eventHandlers['collapsingHandler'] = (event) => { that.onCollapsing.emit(event); };
that.nativeElement.addEventListener('collapsing', that.eventHandlers['collapsingHandler']);
that.eventHandlers['expandHandler'] = (event) => { that.onExpand.emit(event); };
that.nativeElement.addEventListener('expand', that.eventHandlers['expandHandler']);
that.eventHandlers['expandingHandler'] = (event) => { that.onExpanding.emit(event); };
that.nativeElement.addEventListener('expanding', that.eventHandlers['expandingHandler']);
that.eventHandlers['itemCheckChangeHandler'] = (event) => { that.onItemCheckChange.emit(event); };
that.nativeElement.addEventListener('itemCheckChange', that.eventHandlers['itemCheckChangeHandler']);
that.eventHandlers['itemClickHandler'] = (event) => { that.onItemClick.emit(event); };
that.nativeElement.addEventListener('itemClick', that.eventHandlers['itemClickHandler']);
that.eventHandlers['openHandler'] = (event) => { that.onOpen.emit(event); };
that.nativeElement.addEventListener('open', that.eventHandlers['openHandler']);
that.eventHandlers['openingHandler'] = (event) => { that.onOpening.emit(event); };
that.nativeElement.addEventListener('opening', that.eventHandlers['openingHandler']);
}
/** @description Remove event listeners. */
unlisten() {
const that = this;
if (that.eventHandlers['closeHandler']) {
that.nativeElement.removeEventListener('close', that.eventHandlers['closeHandler']);
}
if (that.eventHandlers['closingHandler']) {
that.nativeElement.removeEventListener('closing', that.eventHandlers['closingHandler']);
}
if (that.eventHandlers['collapseHandler']) {
that.nativeElement.removeEventListener('collapse', that.eventHandlers['collapseHandler']);
}
if (that.eventHandlers['collapsingHandler']) {
that.nativeElement.removeEventListener('collapsing', that.eventHandlers['collapsingHandler']);
}
if (that.eventHandlers['expandHandler']) {
that.nativeElement.removeEventListener('expand', that.eventHandlers['expandHandler']);
}
if (that.eventHandlers['expandingHandler']) {
that.nativeElement.removeEventListener('expanding', that.eventHandlers['expandingHandler']);
}
if (that.eventHandlers['itemCheckChangeHandler']) {
that.nativeElement.removeEventListener('itemCheckChange', that.eventHandlers['itemCheckChangeHandler']);
}
if (that.eventHandlers['itemClickHandler']) {
that.nativeElement.removeEventListener('itemClick', that.eventHandlers['itemClickHandler']);
}
if (that.eventHandlers['openHandler']) {
that.nativeElement.removeEventListener('open', that.eventHandlers['openHandler']);
}
if (that.eventHandlers['openingHandler']) {
that.nativeElement.removeEventListener('opening', that.eventHandlers['openingHandler']);
}
}
}
MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
MenuComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: MenuComponent, selector: "smart-menu, [smart-menu]", inputs: { animation: "animation", autoCloseDelay: "autoCloseDelay", autoFocusOnMouseenter: "autoFocusOnMouseenter", checkable: "checkable", checkboxes: "checkboxes", checkMode: "checkMode", closeAction: "closeAction", dataSource: "dataSource", disabled: "disabled", displayMember: "displayMember", dropDownAppendTo: "dropDownAppendTo", dropDownOverlay: "dropDownOverlay", dropDownPosition: "dropDownPosition", items: "items", itemsMember: "itemsMember", unlockKey: "unlockKey", locale: "locale", localizeFormatFunction: "localizeFormatFunction", messages: "messages", minimizeIconTemplate: "minimizeIconTemplate", minimizeWidth: "minimizeWidth", mode: "mode", opened: "opened", overflow: "overflow", preventCloseOnCheck: "preventCloseOnCheck", readonly: "readonly", rightToLeft: "rightToLeft", selectionMode: "selectionMode", theme: "theme", unfocusable: "unfocusable", valueMember: "valueMember" }, outputs: { onClose: "onClose", onClosing: "onClosing", onCollapse: "onCollapse", onCollapsing: "onCollapsing", onExpand: "onExpand", onExpanding: "onExpanding", onItemCheckChange: "onItemCheckChange", onItemClick: "onItemClick", onOpen: "onOpen", onOpening: "onOpening" }, exportAs: ["smart-menu"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuComponent, decorators: [{
type: Directive,
args: [{
exportAs: 'smart-menu', selector: 'smart-menu, [smart-menu]'
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { animation: [{
type: Input
}], autoCloseDelay: [{
type: Input
}], autoFocusOnMouseenter: [{
type: Input
}], checkable: [{
type: Input
}], checkboxes: [{
type: Input
}], checkMode: [{
type: Input
}], closeAction: [{
type: Input
}], dataSource: [{
type: Input
}], disabled: [{
type: Input
}], displayMember: [{
type: Input
}], dropDownAppendTo: [{
type: Input
}], dropDownOverlay: [{
type: Input
}], dropDownPosition: [{
type: Input
}], items: [{
type: Input
}], itemsMember: [{
type: Input
}], unlockKey: [{
type: Input
}], locale: [{
type: Input
}], localizeFormatFunction: [{
type: Input
}], messages: [{
type: Input
}], minimizeIconTemplate: [{
type: Input
}], minimizeWidth: [{
type: Input
}], mode: [{
type: Input
}], opened: [{
type: Input
}], overflow: [{
type: Input
}], preventCloseOnCheck: [{
type: Input
}], readonly: [{
type: Input
}], rightToLeft: [{
type: Input
}], selectionMode: [{
type: Input
}], theme: [{
type: Input
}], unfocusable: [{
type: Input
}], valueMember: [{
type: Input
}], onClose: [{
type: Output
}], onClosing: [{
type: Output
}], onCollapse: [{
type: Output
}], onCollapsing: [{
type: Output
}], onExpand: [{
type: Output
}], onExpanding: [{
type: Output
}], onItemCheckChange: [{
type: Output
}], onItemClick: [{
type: Output
}], onOpen: [{
type: Output
}], onOpening: [{
type: Output
}] } });
class MenuItemComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-menu-item');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description */
get checked() {
return this.nativeElement ? this.nativeElement.checked : undefined;
}
set checked(value) {
this.nativeElement ? this.nativeElement.checked = value : undefined;
}
/** @description Enables or disables element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description */
get label() {
return this.nativeElement ? this.nativeElement.label : undefined;
}
set label(value) {
this.nativeElement ? this.nativeElement.label = value : undefined;
}
/** @description */
get level() {
return this.nativeElement ? this.nativeElement.level : undefined;
}
set level(value) {
this.nativeElement ? this.nativeElement.level = value : undefined;
}
/** @description */
get separator() {
return this.nativeElement ? this.nativeElement.separator : undefined;
}
set separator(value) {
this.nativeElement ? this.nativeElement.separator = value : undefined;
}
/** @description */
get shortcut() {
return this.nativeElement ? this.nativeElement.shortcut : undefined;
}
set shortcut(value) {
this.nativeElement ? this.nativeElement.shortcut = value : undefined;
}
/** @description */
get value() {
return this.nativeElement ? this.nativeElement.value : undefined;
}
set value(value) {
this.nativeElement ? this.nativeElement.value = value : undefined;
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
this.nativeElement.classList.add('smart-angular');
if (this.nativeElement.whenRendered)
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
}
ngOnDestroy() { }
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
}
MenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
MenuItemComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: MenuItemComponent, selector: "smart-menu-item, [smart-menu-item]", inputs: { checked: "checked", disabled: "disabled", label: "label", level: "level", separator: "separator", shortcut: "shortcut", value: "value" }, exportAs: ["smart-menu-item"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuItemComponent, decorators: [{
type: Directive,
args: [{
exportAs: 'smart-menu-item', selector: 'smart-menu-item, [smart-menu-item]'
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { checked: [{
type: Input
}], disabled: [{
type: Input
}], label: [{
type: Input
}], level: [{
type: Input
}], separator: [{
type: Input
}], shortcut: [{
type: Input
}], value: [{
type: Input
}] } });
class MenuItemsGroupComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-menu-items-group');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description */
get checkable() {
return this.nativeElement ? this.nativeElement.checkable : undefined;
}
set checkable(value) {
this.nativeElement ? this.nativeElement.checkable = value : undefined;
}
/** @description */
get checked() {
return this.nativeElement ? this.nativeElement.checked : undefined;
}
set checked(value) {
this.nativeElement ? this.nativeElement.checked = value : undefined;
}
/** @description */
get checkMode() {
return this.nativeElement ? this.nativeElement.checkMode : undefined;
}
set checkMode(value) {
this.nativeElement ? this.nativeElement.checkMode = value : undefined;
}
/** @description Enables or disables element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description */
get dropDownHeight() {
return this.nativeElement ? this.nativeElement.dropDownHeight : undefined;
}
set dropDownHeight(value) {
this.nativeElement ? this.nativeElement.dropDownHeight = value : undefined;
}
/** @description */
get expanded() {
return this.nativeElement ? this.nativeElement.expanded : undefined;
}
set expanded(value) {
this.nativeElement ? this.nativeElement.expanded = value : undefined;
}
/** @description */
get label() {
return this.nativeElement ? this.nativeElement.label : undefined;
}
set label(value) {
this.nativeElement ? this.nativeElement.label = value : undefined;
}
/** @description */
get level() {
return this.nativeElement ? this.nativeElement.level : undefined;
}
set level(value) {
this.nativeElement ? this.nativeElement.level = value : undefined;
}
/** @description */
get separator() {
return this.nativeElement ? this.nativeElement.separator : undefined;
}
set separator(value) {
this.nativeElement ? this.nativeElement.separator = value : undefined;
}
/** @description */
get value() {
return this.nativeElement ? this.nativeElement.value : undefined;
}
set value(value) {
this.nativeElement ? this.nativeElement.value = value : undefined;
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
this.nativeElement.classList.add('smart-angular');
if (this.nativeElement.whenRendered)
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
}
ngOnDestroy() { }
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
}
MenuItemsGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuItemsGroupComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
MenuItemsGroupComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: MenuItemsGroupComponent, selector: "smart-menu-items-group, [smart-menu-items-group]", inputs: { checkable: "checkable", checked: "checked", checkMode: "checkMode", disabled: "disabled", dropDownHeight: "dropDownHeight", expanded: "expanded", label: "label", level: "level", separator: "separator", value: "value" }, exportAs: ["smart-menu-items-group"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuItemsGroupComponent, decorators: [{
type: Directive,
args: [{
exportAs: 'smart-menu-items-group', selector: 'smart-menu-items-group, [smart-menu-items-group]'
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { checkable: [{
type: Input
}], checked: [{
type: Input
}], checkMode: [{
type: Input
}], disabled: [{
type: Input
}], dropDownHeight: [{
type: Input
}], expanded: [{
type: Input
}], label: [{
type: Input
}], level: [{
type: Input
}], separator: [{
type: Input
}], value: [{
type: Input
}] } });
class MenuModule {
}
MenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
MenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuModule, declarations: [MenuComponent, MenuItemComponent, MenuItemsGroupComponent], exports: [MenuComponent, MenuItemComponent, MenuItemsGroupComponent] });
MenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuModule });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MenuModule, decorators: [{
type: NgModule,
args: [{
declarations: [MenuComponent, MenuItemComponent, MenuItemsGroupComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
exports: [MenuComponent, MenuItemComponent, MenuItemsGroupComponent]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { MenuComponent, MenuItemComponent, MenuItemsGroupComponent, MenuModule, Smart };
//# sourceMappingURL=smart-webcomponents-angular-menu.mjs.map