outsystems-ui
Version:
OutSystems UI Framework
961 lines • 1.25 MB
JavaScript
/*!
OutSystems UI 2.22.0 • ODC Platform
Website:
• https://www.outsystems.com/outsystems-ui
GitHub:
• https://github.com/OutSystems/outsystems-ui
*/
"use strict";
var osui;
(function (osui) {
function GetVersion() {
console.warn('osui.GetVersion(), is deprecated. Please use the API `OutSystems.OSUI.GetVersion()`.');
return OutSystems.OSUI.GetVersion();
}
osui.GetVersion = GetVersion;
function ToggleClass(el, state, className) {
console.warn('osui.ToggleClass(...), is deprecated. Please use the API `OutSystems.OSUI.Utils.ToggleClass(...)`.');
OutSystems.OSUI.Utils.ToggleClass(el, state, className);
}
osui.ToggleClass = ToggleClass;
function GetClosest(elem, selector) {
console.warn('osui.GetClosest(...), is deprecated. Please use the API `OutSystems.OSUI.Utils.GetClosest(...)`.');
return OutSystems.OSUI.Utils.GetClosest(elem, selector);
}
osui.GetClosest = GetClosest;
function FixInputs() {
console.warn('osui.FixInputs(...), is deprecated. Please use the API `OutSystems.OSUI.Utils.FixInputs(...)`.');
OutSystems.OSUI.Utils.LayoutPrivate.FixInputs();
}
osui.FixInputs = FixInputs;
function HasMasterDetail() {
console.warn('osui.HasMasterDetail(), is deprecated. Please use the API `OutSystems.OSUI.Utils.HasMasterDetail()`.');
return OutSystems.OSUI.Utils.HasMasterDetail();
}
osui.HasMasterDetail = HasMasterDetail;
function HideOnScroll() {
console.warn('osui.HideOnScroll(), is deprecated. Please use the API `OutSystems.OSUI.Utils.HideOnScroll.Init()`.');
return {
init: () => {
OutSystems.OSUI.Utils.HideOnScroll.Init();
},
};
}
osui.HideOnScroll = HideOnScroll;
})(osui || (osui = {}));
var OutSystems;
(function (OutSystems) {
var OSUI;
(function (OSUI) {
var Utils;
(function (Utils) {
var Menu;
(function (Menu) {
function AddMenuOnOrientationChange(callback) {
console.warn('OutSystems.OSUI.Utils.Menu.AddMenuOnOrientationChange(...), is deprecated. Please use the API `OutSystems.OSUI.Utils.Menu.OnReady(...)`.');
return OutSystems.OSUI.Utils.Menu.addMenuOnOrientationChange(callback);
}
Menu.AddMenuOnOrientationChange = AddMenuOnOrientationChange;
function RemoveMenuOnOrientationChange() {
console.warn('OutSystems.OSUI.Utils.Menu.RemoveMenuOnOrientationChange(), is deprecated. Please use the API `OutSystems.OSUI.Utils.Menu.OnDestroy()`.');
return OutSystems.OSUI.Utils.Menu.removeMenuOnOrientationChange();
}
Menu.RemoveMenuOnOrientationChange = RemoveMenuOnOrientationChange;
})(Menu = Utils.Menu || (Utils.Menu = {}));
})(Utils = OSUI.Utils || (OSUI.Utils = {}));
})(OSUI = OutSystems.OSUI || (OutSystems.OSUI = {}));
})(OutSystems || (OutSystems = {}));
var OSFramework;
(function (OSFramework) {
var OSUI;
(function (OSUI) {
var Constants;
(function (Constants) {
Constants.A11YAttributes = {
Aria: {
Atomic: 'aria-atomic',
Busy: 'aria-busy',
Controls: 'aria-controls',
Describedby: 'aria-describedby',
Disabled: 'aria-disabled',
Expanded: 'aria-expanded',
Haspopup: {
prop: 'aria-haspopup',
value: {
False: 'false',
True: 'true',
Menu: 'menu',
Listbox: 'listbox',
Tree: 'tree',
Grid: 'grid',
Dialog: 'dialog',
},
},
Hidden: 'aria-hidden',
Label: 'aria-label',
Labelledby: 'aria-labelledby',
Multiselectable: 'aria-multiselectable',
Selected: 'aria-selected',
ValueMax: 'valuemax',
ValueMin: 'valuemin',
},
AriaLive: {
AttrName: 'aria-live',
Assertive: 'assertive',
Polite: 'polite',
Off: 'off',
},
Role: {
Alert: 'alert',
AlertDialog: 'alertdialog',
AttrName: 'role',
Button: 'button',
Complementary: 'complementary',
Listbox: 'listbox',
Menu: 'menu',
MenuItem: 'menuitem',
Option: 'option',
Presentation: 'presentation',
Progressbar: 'progressbar',
Region: 'region',
Search: 'search',
Tab: 'tab',
TabList: 'tablist',
TabPanel: 'tabpanel',
Tooltip: 'tooltip',
},
TabIndex: 'tabindex',
States: {
Empty: '',
False: 'false',
TabIndexHidden: '-1',
TabIndexShow: '0',
True: 'true',
},
};
Constants.AccessibilityHideElementClass = 'wcag-hide-text';
Constants.AllowPropagationAttr = '[data-allow-event-propagation]';
Constants.Comma = ',';
Constants.Dot = '.';
Constants.EmptyString = '';
Constants.EnableLogMessages = false;
Constants.FocusableElems = 'a[href]:not([disabled]), [tabindex="0"], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])';
Constants.FocusableTabIndexDefault = 'default-tabindex-element';
Constants.FocusableTabIndexHidden = '[tabindex="-1"][default-tabindex-element]';
Constants.FocusTrapIgnoreAttr = 'ignore-focus-trap';
Constants.HasAccessibilityClass = 'has-accessible-features';
Constants.InvalidNumber = -1;
Constants.IsRTLClass = 'is-rtl';
Constants.IsRTLDeviceType = 'is-rtl-device';
Constants.JavaScriptTypes = {
Undefined: 'undefined',
Boolean: 'boolean',
Number: 'number',
String: 'string',
Symbol: 'symbol',
Function: 'function',
Object: 'object',
};
Constants.JustInputs = 'input:not([type=button]):not([type=checkbox]):not([type=color]):not([type=file]):not([type=hidden]):not([type=image]):not([type=image]):not([type=radio]):not([type=range]):not([type=reset]):not([type=submit]), textarea';
Constants.Language = {
code: 'en-US',
short: 'en',
};
Constants.Months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
];
Constants.NoTransition = 'no-transition';
Constants.OSPlatform = 'ODC';
Constants.OSUIVersion = '2.22.0';
Constants.ZeroValue = 0;
})(Constants = OSUI.Constants || (OSUI.Constants = {}));
})(OSUI = OSFramework.OSUI || (OSFramework.OSUI = {}));
})(OSFramework || (OSFramework = {}));
var OSFramework;
(function (OSFramework) {
var OSUI;
(function (OSUI) {
var ErrorCodes;
(function (ErrorCodes) {
ErrorCodes.AbstractChild = {
FailParentNotFound: 'OSUI-GEN-01001',
};
ErrorCodes.Accordion = {
FailChildItemClicked: 'OSUI-GEN-07001',
FailSetNewChildItem: 'OSUI-GEN-07002',
FailToSetChildItemAction: 'OSUI-GEN-07003',
FailUnsetNewChildItem: 'OSUI-GEN-07004',
};
ErrorCodes.Dropdown = {
FailOptionItemClicked: 'OSUI-GEN-02001',
FailOptionItemKeyPressed: 'OSUI-GEN-02002',
FailSetNewOptionItem: 'OSUI-GEN-02003',
FailToSetOptionItemAction: 'OSUI-GEN-02004',
FailUnsetNewOptionItem: 'OSUI-GEN-02005',
HasNoImplementation: {
code: 'OSUI-GEN-02006',
message: 'This method has no implementation on this Dropdown Type.',
},
};
ErrorCodes.DropdownServerSide = {
FailOnSetIntersectionObserver: 'OSUI-GEN-0401',
};
ErrorCodes.RangeSlider = {
FailSetValue: 'OSUI-GEN-04001',
};
ErrorCodes.SectionIndex = {
FailChildItemClicked: 'OSUI-GEN-05001',
FailSetNewChildItem: 'OSUI-GEN-05002',
FailToSetChildItemAction: 'OSUI-GEN-05003',
FailUnsetNewChildItem: 'OSUI-GEN-05004',
};
ErrorCodes.SectionIndexItem = {
FailToSetTargetElement: 'OSUI-GEN-06001',
};
ErrorCodes.Tooltip = {
FailOnSetIntersectionObserver: 'OSUI-GEN-08001',
};
ErrorCodes.Tabs = {
FailChildItemClicked: 'OSUI-GEN-09001',
FailSetNewChildContentItem: 'OSUI-GEN-09002',
FailSetNewChildHeaderItem: 'OSUI-GEN-09003',
FailToSetChildItemAction: 'OSUI-GEN-09004',
FailUnsetNewChildContentItem: 'OSUI-GEN-09005',
FailUnsetNewChildHeaderItem: 'OSUI-GEN-09006',
};
ErrorCodes.AbstractParent = {
FailChildNotFound: 'OSUI-GEN-10001',
FailChildsNotFound: 'OSUI-GEN-10002',
FailTypeNotFound: 'OSUI-GEN-10003',
};
ErrorCodes.AbstractProviderPattern = {
FailProviderEventHandler: 'OSUI-GEN-11001',
FailProviderEventRemoval: {
code: 'OSUI-GEN-11002',
message: 'The event with this eventId does not exist',
},
FailProviderEventSet: {
code: 'OSUI-GEN-11003',
message: 'The provided eventName does not exist or is not supported by the provider',
},
};
ErrorCodes.ProviderEventsManager = {
FailPendingEventRemoval: 'OSUI-GEN-12001',
FailSavingPendingEvent: 'OSUI-GEN-12002',
FailSavedEventRemoval: 'OSUI-GEN-12003',
FailSavingEvent: 'OSUI-GEN-12004',
};
})(ErrorCodes = OSUI.ErrorCodes || (OSUI.ErrorCodes = {}));
})(OSUI = OSFramework.OSUI || (OSFramework.OSUI = {}));
})(OSFramework || (OSFramework = {}));
var OSFramework;
(function (OSFramework) {
var OSUI;
(function (OSUI) {
var GlobalEnum;
(function (GlobalEnum) {
let CommonPatternsProperties;
(function (CommonPatternsProperties) {
CommonPatternsProperties["ExtendedClass"] = "ExtendedClass";
})(CommonPatternsProperties = GlobalEnum.CommonPatternsProperties || (GlobalEnum.CommonPatternsProperties = {}));
let CssClassElements;
(function (CssClassElements) {
CssClassElements["AcessibilityStyleTag"] = "acessibility-style-tag";
CssClassElements["ActiveScreen"] = "active-screen";
CssClassElements["AsideExpandable"] = "aside-expandable";
CssClassElements["Container"] = "screen-container";
CssClassElements["Content"] = "content";
CssClassElements["DarkMode"] = "os-dark-mode";
CssClassElements["DeprecatedSubmenu"] = "submenu";
CssClassElements["Footer"] = "footer";
CssClassElements["Header"] = "header";
CssClassElements["HeaderHideOnScroll"] = "hide-header-on-scroll";
CssClassElements["HeaderIsFixed"] = "fixed-header";
CssClassElements["HeaderIsVisible"] = "header-is--visible";
CssClassElements["HeaderTopContent"] = "header-top-content";
CssClassElements["HighContrast"] = "os-high-contrast";
CssClassElements["InputNotValid"] = "not-valid";
CssClassElements["IsTouch"] = "is--touch";
CssClassElements["Layout"] = "layout";
CssClassElements["LayoutNative"] = "layout-native";
CssClassElements["LayoutSide"] = "layout-side";
CssClassElements["LayoutTop"] = "layout-top";
CssClassElements["List"] = "list";
CssClassElements["LoginPassword"] = "login-password";
CssClassElements["MainContent"] = "main-content";
CssClassElements["MenuLinks"] = "app-menu-links";
CssClassElements["Placeholder"] = "ph";
CssClassElements["Popup"] = "popup-dialog";
CssClassElements["SkipContent"] = "skip-nav";
})(CssClassElements = GlobalEnum.CssClassElements || (GlobalEnum.CssClassElements = {}));
let CSSSelectors;
(function (CSSSelectors) {
CSSSelectors["InputFormControl"] = "input.form-control";
CSSSelectors["IosBounceScroll"] = "ios .ios-bounce:not(.hide-header-on-scroll) .content";
CSSSelectors["LayoutNativeHeader"] = "layout-native:not(.hide-header-on-scroll) .header";
})(CSSSelectors = GlobalEnum.CSSSelectors || (GlobalEnum.CSSSelectors = {}));
let CSSVariables;
(function (CSSVariables) {
CSSVariables["FooterHeight"] = "--footer-height";
CSSVariables["HeaderContentHeight"] = "--header-size-content";
CSSVariables["OverlayOpacity"] = "--overlay-opacity";
CSSVariables["ViewportHeight"] = "--viewport-height";
})(CSSVariables = GlobalEnum.CSSVariables || (GlobalEnum.CSSVariables = {}));
let Position;
(function (Position) {
Position["Bottom"] = "bottom";
Position["BottomLeft"] = "bottom-left";
Position["BottomRight"] = "bottom-right";
Position["Center"] = "center";
Position["Left"] = "left";
Position["Right"] = "right";
Position["Top"] = "top";
Position["TopLeft"] = "top-left";
Position["TopRight"] = "top-right";
})(Position = GlobalEnum.Position || (GlobalEnum.Position = {}));
let FloatingAlignment;
(function (FloatingAlignment) {
FloatingAlignment["Center"] = "center";
FloatingAlignment["End"] = "end";
FloatingAlignment["Start"] = "start";
})(FloatingAlignment = GlobalEnum.FloatingAlignment || (GlobalEnum.FloatingAlignment = {}));
let FloatingPosition;
(function (FloatingPosition) {
FloatingPosition["Auto"] = "auto";
FloatingPosition["Bottom"] = "bottom";
FloatingPosition["BottomEnd"] = "bottom-end";
FloatingPosition["BottomStart"] = "bottom-start";
FloatingPosition["Center"] = "center";
FloatingPosition["Left"] = "left";
FloatingPosition["LeftEnd"] = "left-end";
FloatingPosition["LeftStart"] = "left-start";
FloatingPosition["Right"] = "right";
FloatingPosition["RightEnd"] = "right-end";
FloatingPosition["RightStart"] = "right-start";
FloatingPosition["Top"] = "top";
FloatingPosition["TopEnd"] = "top-end";
FloatingPosition["TopStart"] = "top-start";
})(FloatingPosition = GlobalEnum.FloatingPosition || (GlobalEnum.FloatingPosition = {}));
let CssProperties;
(function (CssProperties) {
CssProperties["Auto"] = "auto";
CssProperties["Initial"] = "initial";
CssProperties["MaxContent"] = "max-content";
CssProperties["None"] = "none";
CssProperties["PaddingTop"] = "padding-top";
})(CssProperties = GlobalEnum.CssProperties || (GlobalEnum.CssProperties = {}));
let DataBlocksTag;
(function (DataBlocksTag) {
DataBlocksTag["DataBlock"] = "[data-block]";
DataBlocksTag["Input"] = "[data-input]";
DataBlocksTag["Label"] = "[data-label]";
DataBlocksTag["TextArea"] = "[data-textarea]";
})(DataBlocksTag = GlobalEnum.DataBlocksTag || (GlobalEnum.DataBlocksTag = {}));
let DateFormat;
(function (DateFormat) {
DateFormat["D"] = "D";
DateFormat["d"] = "d";
DateFormat["DD"] = "DD";
DateFormat["DDD"] = "DDD";
DateFormat["M"] = "M";
DateFormat["m"] = "m";
DateFormat["MM"] = "MM";
DateFormat["MMM"] = "MMM";
DateFormat["Y"] = "Y";
DateFormat["y"] = "y";
DateFormat["YY"] = "YY";
DateFormat["YYY"] = "YYY";
DateFormat["YYYY"] = "YYYY";
})(DateFormat = GlobalEnum.DateFormat || (GlobalEnum.DateFormat = {}));
let Direction;
(function (Direction) {
Direction["Bottom"] = "bottom";
Direction["Down"] = "down";
Direction["Left"] = "left";
Direction["LTR"] = "ltr";
Direction["None"] = "";
Direction["Right"] = "right";
Direction["RTL"] = "rtl";
Direction["Top"] = "top";
Direction["TTB"] = "ttb";
Direction["Up"] = "up";
})(Direction = GlobalEnum.Direction || (GlobalEnum.Direction = {}));
let ScrollBehavior;
(function (ScrollBehavior) {
ScrollBehavior["Auto"] = "auto";
ScrollBehavior["Instant"] = "instant";
ScrollBehavior["Smooth"] = "smooth";
})(ScrollBehavior = GlobalEnum.ScrollBehavior || (GlobalEnum.ScrollBehavior = {}));
let ScrollPositionBehavior;
(function (ScrollPositionBehavior) {
ScrollPositionBehavior["Start"] = "start";
ScrollPositionBehavior["Center"] = "center";
ScrollPositionBehavior["End"] = "end";
ScrollPositionBehavior["Nearest"] = "nearest";
})(ScrollPositionBehavior = GlobalEnum.ScrollPositionBehavior || (GlobalEnum.ScrollPositionBehavior = {}));
let HTMLAttributes;
(function (HTMLAttributes) {
HTMLAttributes["AllowEventPropagation"] = "[data-allow-event-propagation=true], [data-allow-event-propagation=True]";
HTMLAttributes["Class"] = "class";
HTMLAttributes["DataInput"] = "data-input";
HTMLAttributes["Disabled"] = "disabled";
HTMLAttributes["Href"] = "href";
HTMLAttributes["Id"] = "id";
HTMLAttributes["Name"] = "name";
HTMLAttributes["StatusBar"] = "data-status-bar-height";
HTMLAttributes["Style"] = "style";
HTMLAttributes["Type"] = "type";
HTMLAttributes["Value"] = "value";
})(HTMLAttributes = GlobalEnum.HTMLAttributes || (GlobalEnum.HTMLAttributes = {}));
let HTMLElement;
(function (HTMLElement) {
HTMLElement["Body"] = "body";
HTMLElement["Button"] = "button";
HTMLElement["Div"] = "div";
HTMLElement["FieldSet"] = "fieldset";
HTMLElement["Input"] = "input";
HTMLElement["Link"] = "a";
HTMLElement["Radio"] = "radio";
HTMLElement["Span"] = "span";
})(HTMLElement = GlobalEnum.HTMLElement || (GlobalEnum.HTMLElement = {}));
let HTMLEvent;
(function (HTMLEvent) {
HTMLEvent["AnimationEnd"] = "animationend";
HTMLEvent["AnimationStart"] = "animationstart";
HTMLEvent["Blur"] = "blur";
HTMLEvent["Change"] = "change";
HTMLEvent["Click"] = "click";
HTMLEvent["Focus"] = "focus";
HTMLEvent["keyDown"] = "keydown";
HTMLEvent["MouseDown"] = "mousedown";
HTMLEvent["MouseEnter"] = "mouseenter";
HTMLEvent["MouseLeave"] = "mouseleave";
HTMLEvent["MouseUp"] = "mouseup";
HTMLEvent["OrientationChange"] = "orientationchange";
HTMLEvent["Prefix"] = "on";
HTMLEvent["Resize"] = "resize";
HTMLEvent["Scroll"] = "scroll";
HTMLEvent["ScrollEnd"] = "scrollend";
HTMLEvent["TouchEnd"] = "touchend";
HTMLEvent["TouchMove"] = "touchmove";
HTMLEvent["TouchStart"] = "touchstart";
HTMLEvent["TransitionEnd"] = "transitionend";
HTMLEvent["Message"] = "message";
})(HTMLEvent = GlobalEnum.HTMLEvent || (GlobalEnum.HTMLEvent = {}));
let CustomEvent;
(function (CustomEvent) {
CustomEvent["BalloonOnToggle"] = "balloon.onToggle";
})(CustomEvent = GlobalEnum.CustomEvent || (GlobalEnum.CustomEvent = {}));
let InlineStyle;
(function (InlineStyle) {
InlineStyle["Display"] = "display";
InlineStyle["Height"] = "height";
InlineStyle["Left"] = "left";
InlineStyle["Opacity"] = "opacity";
InlineStyle["PointerEvents"] = "pointerEvents";
InlineStyle["Top"] = "top";
InlineStyle["Transform"] = "transform";
InlineStyle["Width"] = "width";
})(InlineStyle = GlobalEnum.InlineStyle || (GlobalEnum.InlineStyle = {}));
GlobalEnum.InlineStyleValue = {
Display: {
block: 'block',
contents: 'contents',
inline: 'inline',
none: 'none',
unset: '',
},
};
let Keycodes;
(function (Keycodes) {
Keycodes["ArrowDown"] = "ArrowDown";
Keycodes["ArrowLeft"] = "ArrowLeft";
Keycodes["ArrowRight"] = "ArrowRight";
Keycodes["ArrowUp"] = "ArrowUp";
Keycodes["End"] = "End";
Keycodes["Enter"] = "Enter";
Keycodes["Escape"] = "Escape";
Keycodes["Home"] = "Home";
Keycodes["PageDown"] = "PageDown";
Keycodes["PageUp"] = "PageUp";
Keycodes["Shift"] = "Shift";
Keycodes["ShiftTab"] = "ShiftTab";
Keycodes["Space"] = " ";
Keycodes["Tab"] = "Tab";
})(Keycodes = GlobalEnum.Keycodes || (GlobalEnum.Keycodes = {}));
let KeyframesEffectOptions;
(function (KeyframesEffectOptions) {
KeyframesEffectOptions["EasingLinear"] = "linear";
KeyframesEffectOptions["FillBoth"] = "both";
})(KeyframesEffectOptions = GlobalEnum.KeyframesEffectOptions || (GlobalEnum.KeyframesEffectOptions = {}));
let MobileOS;
(function (MobileOS) {
MobileOS["Android"] = "android";
MobileOS["IOS"] = "ios";
MobileOS["MacOS"] = "osx";
MobileOS["Unknown"] = "unknown";
MobileOS["Windows"] = "windows";
})(MobileOS = GlobalEnum.MobileOS || (GlobalEnum.MobileOS = {}));
let Orientation;
(function (Orientation) {
Orientation["Horizontal"] = "horizontal";
Orientation["None"] = "";
Orientation["Vertical"] = "vertical";
})(Orientation = GlobalEnum.Orientation || (GlobalEnum.Orientation = {}));
let PatternName;
(function (PatternName) {
PatternName["Accordion"] = "Accordion";
PatternName["AccordionItem"] = "Accordion Item";
PatternName["AnimatedLabel"] = "Animated Label";
PatternName["Balloon"] = "Balloon";
PatternName["BottomSheet"] = "Bottom Sheet";
PatternName["ButtonLoading"] = "ButtonLoading";
PatternName["Carousel"] = "Carousel";
PatternName["Datepicker"] = "Datepicker";
PatternName["Dropdown"] = "Dropdown";
PatternName["DropdownServerSideItem"] = "DropdownServerSideItem";
PatternName["FlipContent"] = "Flip Content";
PatternName["FloatingActions"] = "Floating Actions";
PatternName["FloatingActionsItem"] = "Floating Actions Item";
PatternName["Gallery"] = "Gallery";
PatternName["InlineSvg"] = "InlineSVG";
PatternName["MonthPicker"] = "MonthPicker";
PatternName["Notification"] = "Notification";
PatternName["OverflowMenu"] = "OverflowMenu";
PatternName["ProgressBar"] = "Progress Bar";
PatternName["ProgressCircle"] = "Progress Circle";
PatternName["RangeSlider"] = "Range Slider";
PatternName["RangeSliderInterval"] = "Range Slider Interval";
PatternName["Rating"] = "Rating";
PatternName["Search"] = "Search";
PatternName["SectionIndex"] = "Section Index";
PatternName["SectionIndexItem"] = "Section Index Item";
PatternName["Sidebar"] = "Sidebar";
PatternName["Submenu"] = "Submenu";
PatternName["SwipeEvents"] = "SwipeEvents";
PatternName["Tabs"] = "Tabs";
PatternName["TabsContentItem"] = "TabsContentItem";
PatternName["TabsHeaderItem"] = "TabsHeaderItem";
PatternName["Timepicker"] = "Timepicker";
PatternName["Tooltip"] = "Tooltip";
PatternName["TouchEvents"] = "TouchEvents";
PatternName["Video"] = "Video";
})(PatternName = GlobalEnum.PatternName || (GlobalEnum.PatternName = {}));
let ShapeTypes;
(function (ShapeTypes) {
ShapeTypes["Rounded"] = "rounded";
ShapeTypes["Sharp"] = "none";
ShapeTypes["SoftRounded"] = "soft";
})(ShapeTypes = GlobalEnum.ShapeTypes || (GlobalEnum.ShapeTypes = {}));
let InputClassTypes;
(function (InputClassTypes) {
InputClassTypes["InputLarge"] = "input-large";
InputClassTypes["InputSmall"] = "input-small";
})(InputClassTypes = GlobalEnum.InputClassTypes || (GlobalEnum.InputClassTypes = {}));
let InputTypeAttr;
(function (InputTypeAttr) {
InputTypeAttr["Date"] = "date";
InputTypeAttr["DateTime"] = "date-time-edit";
InputTypeAttr["Password"] = "password";
InputTypeAttr["Text"] = "text";
InputTypeAttr["Time"] = "time";
})(InputTypeAttr = GlobalEnum.InputTypeAttr || (GlobalEnum.InputTypeAttr = {}));
let Units;
(function (Units) {
Units["Percentage"] = "%";
Units["Pixel"] = "px";
Units["Em"] = "em";
})(Units = GlobalEnum.Units || (GlobalEnum.Units = {}));
let Browser;
(function (Browser) {
Browser["chrome"] = "chrome";
Browser["edge"] = "edge";
Browser["firefox"] = "firefox";
Browser["ie"] = "ie";
Browser["kindle"] = "kindle";
Browser["miui"] = "miui";
Browser["opera"] = "opera";
Browser["safari"] = "safari";
Browser["samsung"] = "samsung";
Browser["uc"] = "uc";
Browser["unknown"] = "unknown";
Browser["yandex"] = "yandex";
})(Browser = GlobalEnum.Browser || (GlobalEnum.Browser = {}));
let DeviceOrientation;
(function (DeviceOrientation) {
DeviceOrientation["landscape"] = "landscape";
DeviceOrientation["portrait"] = "portrait";
DeviceOrientation["unknown"] = "unknown";
})(DeviceOrientation = GlobalEnum.DeviceOrientation || (GlobalEnum.DeviceOrientation = {}));
let DeviceType;
(function (DeviceType) {
DeviceType["desktop"] = "desktop";
DeviceType["phone"] = "phone";
DeviceType["tablet"] = "tablet";
})(DeviceType = GlobalEnum.DeviceType || (GlobalEnum.DeviceType = {}));
let NotchClasses;
(function (NotchClasses) {
NotchClasses["IPhoneX"] = "iphonex";
})(NotchClasses = GlobalEnum.NotchClasses || (GlobalEnum.NotchClasses = {}));
let FocusTrapClasses;
(function (FocusTrapClasses) {
FocusTrapClasses["FocusTrapBottom"] = "focus-trap-bottom";
FocusTrapClasses["FocusTrapTop"] = "focus-trap-top";
})(FocusTrapClasses = GlobalEnum.FocusTrapClasses || (GlobalEnum.FocusTrapClasses = {}));
let WarningMessages;
(function (WarningMessages) {
WarningMessages["FeatureNotImplemented"] = "This feature is not yet implemented!";
WarningMessages["MethodNotImplemented"] = "This Method has no implementation on the context of this pattern.";
})(WarningMessages = GlobalEnum.WarningMessages || (GlobalEnum.WarningMessages = {}));
let NullValues;
(function (NullValues) {
NullValues["Time"] = "00:00:00";
})(NullValues = GlobalEnum.NullValues || (GlobalEnum.NullValues = {}));
let ProviderEvents;
(function (ProviderEvents) {
ProviderEvents["Initialized"] = "Initialized";
ProviderEvents["OnProviderConfigsApplied"] = "OnProviderConfigsApplied";
})(ProviderEvents = GlobalEnum.ProviderEvents || (GlobalEnum.ProviderEvents = {}));
let SVGHelperConstants;
(function (SVGHelperConstants) {
SVGHelperConstants["DOMType"] = "image/svg+xml";
SVGHelperConstants["ParserError"] = "parsererror";
SVGHelperConstants["SVG"] = "svg";
})(SVGHelperConstants = GlobalEnum.SVGHelperConstants || (GlobalEnum.SVGHelperConstants = {}));
let Time;
(function (Time) {
Time[Time["HourInSeconds"] = 3600] = "HourInSeconds";
Time[Time["MinuteInSeconds"] = 60] = "MinuteInSeconds";
})(Time = GlobalEnum.Time || (GlobalEnum.Time = {}));
})(GlobalEnum = OSUI.GlobalEnum || (OSUI.GlobalEnum = {}));
})(OSUI = OSFramework.OSUI || (OSFramework.OSUI = {}));
})(OSFramework || (OSFramework = {}));
var OSFramework;
(function (OSFramework) {
var OSUI;
(function (OSUI) {
var Behaviors;
(function (Behaviors) {
class DragParams {
constructor() {
this.DragOrientation = OSUI.GlobalEnum.Orientation.None;
this.ExpectedDirection = OSUI.GlobalEnum.Direction.Right;
this.InvalidDrag = false;
this.IsMoving = false;
this.IsOpen = false;
this.IsReadyToTriggerCallback = false;
this.LastX = 0;
this.LastY = 0;
this.MoveX = 0;
this.MoveY = 0;
this.Size = undefined;
this.VerticalDrag = false;
}
}
class AnimateOnDrag {
constructor(target) {
this._swipeTriggerSpeed = 0.3;
this._targetElement = target;
this._dragParams = new DragParams();
}
_checkIsDraggingInsideBounds(currentDrag) {
const move = this._dragParams.VerticalDrag ? this._dragParams.MoveY : this._dragParams.MoveX;
const last = this._dragParams.VerticalDrag ? this._dragParams.LastY : this._dragParams.LastX;
const isLeftOrUp = this._dragParams.ExpectedDirection === OSUI.GlobalEnum.Direction.Left ||
this._dragParams.ExpectedDirection === OSUI.GlobalEnum.Direction.Up;
const baseThreshold = move + (currentDrag - last);
return isLeftOrUp
? baseThreshold > -parseInt(this._dragParams.Size) && move + (currentDrag - last) <= 0
: baseThreshold < parseInt(this._dragParams.Size) && move + (currentDrag - last) >= 0;
}
_updateLastPositions(x, y) {
this._dragParams.LastX = x;
this._dragParams.LastY = y;
}
_updateUI() {
if (this._dragParams.IsMoving) {
if (this._dragParams.VerticalDrag) {
this._targetElement.style.transform = `translateY(${this._dragParams.MoveY}px)`;
}
else {
this._targetElement.style.transform = `translateX(${this._dragParams.MoveX}px)`;
}
requestAnimationFrame(this._updateUI.bind(this));
}
}
get dragParams() {
return this._dragParams;
}
onDragEnd(offsetX, offsetY, timeTaken, callback, springProperties) {
this._dragParams.IsMoving = false;
OSUI.Helper.Dom.Styles.RemoveClass(this._targetElement, OSUI.Constants.NoTransition);
if ((offsetX === 0 && offsetY === 0) || this._dragParams.InvalidDrag) {
this._targetElement.style.transform = '';
return;
}
const checkSwipeSpeed = (this._dragParams.VerticalDrag ? Math.abs(offsetY) : Math.abs(offsetX)) / timeTaken >
this._swipeTriggerSpeed;
const sizeThreshold = -parseInt(this._dragParams.Size) / 2;
const axisToValidate = this._dragParams.VerticalDrag ? this._dragParams.MoveY : this._dragParams.MoveX;
const swipedHalfWidth = axisToValidate < sizeThreshold;
this._dragParams.IsReadyToTriggerCallback = swipedHalfWidth || checkSwipeSpeed;
if (this._dragParams.IsReadyToTriggerCallback) {
callback();
}
else if ((springProperties === null || springProperties === void 0 ? void 0 : springProperties.addSpringAnimation) && this._dragParams.IsOpen) {
this._dragParams.SpringAnimation = SpringAnimation.CreateSpringAnimation(this._targetElement, offsetX, offsetY, this._dragParams.VerticalDrag ? OSUI.GlobalEnum.Orientation.Vertical : OSUI.GlobalEnum.Orientation.Horizontal, springProperties.springAnimationProperties);
this._dragParams.SpringAnimation.play();
}
this._targetElement.style.transform = '';
}
onDragMove(offsetX, offsetY, currentX, currentY, event) {
let _dragDirection;
if (!this._dragParams.VerticalDrag) {
_dragDirection = offsetX > 0 ? OSUI.GlobalEnum.Direction.Right : OSUI.GlobalEnum.Direction.Left;
}
else {
_dragDirection = offsetY < 0 ? OSUI.GlobalEnum.Direction.Up : OSUI.GlobalEnum.Direction.Down;
}
this._dragParams.InvalidDrag =
this._dragParams.IsOpen && _dragDirection !== this._dragParams.ExpectedDirection;
if (this._dragParams.InvalidDrag) {
this._updateLastPositions(currentX, currentY);
return;
}
if (this._dragParams.DragOrientation === '') {
const isHorizontal = Math.abs(offsetX) >= Math.abs(offsetY);
this._dragParams.DragOrientation = isHorizontal
? OSUI.GlobalEnum.Orientation.Horizontal
: OSUI.GlobalEnum.Orientation.Vertical;
requestAnimationFrame(this._updateUI.bind(this));
}
if (this._dragParams.VerticalDrag === false &&
this._dragParams.DragOrientation === OSUI.GlobalEnum.Orientation.Vertical) {
this._updateLastPositions(currentX, currentY);
return;
}
event.preventDefault();
const IsDraggingInsideBounds = this._checkIsDraggingInsideBounds(this._dragParams.VerticalDrag ? currentY : currentX);
if (IsDraggingInsideBounds) {
if (this._dragParams.VerticalDrag) {
this._dragParams.MoveY = this._dragParams.MoveY + (currentY - this._dragParams.LastY);
}
else {
this._dragParams.MoveX = this._dragParams.MoveX + (currentX - this._dragParams.LastX);
}
}
this._updateLastPositions(currentX, currentY);
}
onDragStart(verticalDrag, expectedDirection, currentX, currentY, isOpen, size) {
this._dragParams.DragOrientation = OSUI.GlobalEnum.Orientation.None;
this._dragParams.ExpectedDirection = expectedDirection;
this._dragParams.IsMoving = true;
this._dragParams.IsOpen = isOpen;
this._dragParams.LastX = currentX;
this._dragParams.LastY = currentY;
this._dragParams.Size = size;
this._dragParams.VerticalDrag = verticalDrag;
if (this._dragParams.SpringAnimation) {
this._dragParams.SpringAnimation.cancel();
}
if (this._dragParams.IsOpen) {
this._dragParams.MoveX = 0;
this._dragParams.MoveY = 0;
}
else if (this._dragParams.ExpectedDirection === OSUI.GlobalEnum.Direction.Left) {
this._dragParams.MoveX = -parseInt(this._dragParams.Size);
this._dragParams.MoveY = -parseInt(this._dragParams.Size);
}
else {
this._dragParams.MoveX = parseInt(this._dragParams.Size);
this._dragParams.MoveY = parseInt(this._dragParams.Size);
}
OSUI.Helper.Dom.Styles.AddClass(this._targetElement, OSUI.Constants.NoTransition);
}
}
Behaviors.AnimateOnDrag = AnimateOnDrag;
class OverlayTransitionOnDrag {
static Set(target, currentDragValue, direction, size) {
const isLeftOrUp = direction === OSUI.GlobalEnum.Direction.Left || direction === OSUI.GlobalEnum.Direction.Up;
const currentOpacity = parseInt(target.style.getPropertyValue(OSUI.GlobalEnum.CSSVariables.OverlayOpacity));
const percentageBeforeDif = (Math.abs(currentDragValue) * 100) / parseInt(size);
const percentage = isLeftOrUp ? 0 + percentageBeforeDif : 100 - percentageBeforeDif;
const newOpacity = Math.floor(percentage) / 100;
if (currentOpacity !== newOpacity && newOpacity % 1 !== 0) {
OSUI.Helper.Dom.Styles.SetStyleAttribute(target, OSUI.GlobalEnum.CSSVariables.OverlayOpacity, newOpacity);
}
}
static UnSet(target) {
OSUI.Helper.Dom.Styles.SetStyleAttribute(target, OSUI.GlobalEnum.CSSVariables.OverlayOpacity, 0);
}
}
Behaviors.OverlayTransitionOnDrag = OverlayTransitionOnDrag;
class SpringAnimation {
static _createSpringEffect(dx, dy, orientation, springProperties) {
if (dx === 0 && dy === 0)
return { positions: [], frames: 0 };
const tension = springProperties.tension;
const friction = springProperties.friction;
const mass = springProperties.mass;
const spring_length = 0;
const k = -tension;
const d = -friction;
const frame_rate = 1 / 60;
const displacement_threshold = 3;
const isVertical = orientation === OSUI.GlobalEnum.Orientation.Vertical;
let velocity = 0;
const positions = [];
let frames = 0;
let frames_below_threshold = 0;
let largest_displ;
let directionDisplacement = isVertical ? dy : dx;
for (let step = 0; step <= 1000; step += 1) {
const Fspring = k * (directionDisplacement - spring_length);
const Fdamping = d * velocity;
const accel = (Fspring + Fdamping) / mass;
velocity += accel * frame_rate;
directionDisplacement += velocity * frame_rate;
positions.push({
transform: isVertical
? `translateY(${directionDisplacement}px)`
: `translateX(${directionDisplacement}px)`,
});
largest_displ =
largest_displ < 0
? Math.max(largest_displ || -Infinity, Math.sqrt(directionDisplacement ** 2))
: Math.min(largest_displ || Infinity, Math.sqrt(directionDisplacement ** 2));
if (Math.abs(largest_displ) < displacement_threshold) {
frames_below_threshold += 1;
}
else {
frames_below_threshold = 0;
}
if (frames_below_threshold >= 60) {
frames = step;
break;
}
}
if (frames === 0) {
frames = 1000;
}
return { positions, frames };
}
static CreateSpringAnimation(target, offsetX, offsetY, orientation, springProperties) {
const { positions, frames } = this._createSpringEffect(offsetX, offsetY, orientation, springProperties);
const keyframes = new KeyframeEffect(target, positions, {
duration: (frames / 60) * 1000,
fill: OSUI.GlobalEnum.KeyframesEffectOptions.FillBoth,
easing: OSUI.GlobalEnum.KeyframesEffectOptions.EasingLinear,
iterations: 1,
});
return new Animation(keyframes);
}
}
Behaviors.SpringAnimation = SpringAnimation;
})(Behaviors = OSUI.Behaviors || (OSUI.Behaviors = {}));
})(OSUI = OSFramework.OSUI || (OSFramework.OSUI = {}));
})(OSFramework || (OSFramework = {}));
var OSFramework;
(function (OSFramework) {
var OSUI;
(function (OSUI) {
var Behaviors;
(function (Behaviors) {
class FocusManager {
constructor() {
}
setFocusToStoredElement() {
if (this._lastFocusedElem === undefined ||
!document.body.contains(this._lastFocusedElem) ||
this._lastFocusedElem.hasAttribute(OSUI.GlobalEnum.HTMLAttributes.Disabled) ||
this._lastFocusedElem.tabIndex < 0) {
document.querySelector(OSFramework.OSUI.Constants.FocusableElems).focus();
}
else {
this._lastFocusedElem.focus();
}
}
storeLastFocusedElement() {
if (document.activeElement !== undefined &&
document.activeElement !== null &&
document.activeElement !== document.body)
this._lastFocusedElem = document.activeElement;
}
}
Behaviors.FocusManager = FocusManager;
})(Behaviors = OSUI.Behaviors || (OSUI.Behaviors = {}));
})(OSUI = OSFramework.OSUI || (OSFramework.OSUI = {}));
})(OSFramework || (OSFramework = {}));
var OSFramework;
(function (OSFramework) {
var OSUI;
(function (OSUI) {
var Behaviors;
(function (Behaviors) {
class FocusTrap {
constructor(opts) {
this._canTargetContainOtherPatts = false;
this._hasBeenPassThoughFirstOne = false;
this._focusableElements = [];
this._targetElement = opts.focusTargetElement;
this._focusBottomCallback = opts.focusBottomCallback;
this._focusTopCallback = opts.focusTopCallback;
this._canTargetContainOtherPatts = opts.canContainOtherPatterns || false;
this._buildPredictableElements();
}
_buildPredictableElements() {
this._predictableTopElement = document.createElement(OSUI.GlobalEnum.HTMLElement.Span);
this._predictableBottomElement = document.createElement(OSUI.GlobalEnum.HTMLElement.Span);
this._targetElement.prepend(this._predictableTopElement);
this._targetElement.append(this._predictableBottomElement);
this._setFocusableProperties();
this._setFocusableElements();
}
_focusBottomHandler() {
this._focusHandler(this._predictableBottomElement, this._focusBottomCallback);
}
_focusHandler(focusableElement, callback) {
this._setFocusableElements();
if (callback === undefined) {
if (focusableElement === this._predictableTopElement && this._hasBeenPassThoughFirstOne === false) {
this._firstFocusableElement.focus();
this._hasBeenPassThoughFirstOne = true;
}
else {
this._lastFocusableElement.focus();
}
if (focusableElement === this._predictableBottomElement) {
this._firstFocusableElement.focus();
this._hasBeenPassThoughFirstOne = true;
}
}
else {
callback();
}
}
_focusTopHandler() {
this._focusHandler(this._predictableTopElement, this._focusTopCallback);
}
_removeEventListeners() {
this._predictableBottomElement.removeEventListener(OSUI.GlobalEnum.HTMLEvent.Focus, this._focusBottomHandler.bind(this));
this._predictableTopElement.removeEventListener(OSUI.GlobalEnum.HTMLEvent.Focus, this._focusTopHandler.bind(this));
}
_setEventListeners() {
this._predictableBottomElement.addEventListener(OSUI.GlobalEnum.HTMLEvent.Focus, this._focusBottomHandler.bind(this));
this._predictableTopElement.addEventListener(OSUI.GlobalEnum.HTMLEvent.Focus, this._focusTopHandler.bind(this));
}
_setFocusableElements(includeTabIndexHidden = false) {
includeTabIndexHidden = false;
this._focusableElements = OSUI.Helper.Dom.GetFocusableElements(this._targetElement, false);
for (const predictedElement of this._focusableElements.filter((item) => item === this._predictableTopElement || item =