diff --git a/BeWo/Scheduler/Utils/Utils.cs b/BeWo/Scheduler/Utils/Utils.cs index 7bc46f6c7..952ab86af 100644 --- a/BeWo/Scheduler/Utils/Utils.cs +++ b/BeWo/Scheduler/Utils/Utils.cs @@ -4,19 +4,19 @@ namespace BeWo.Scheduler.Utils { public static class Utils { - private static readonly Regex indexRegex = new Regex("(?:Index=\"){1}([0-9]+)\"{1}"); - private static readonly Regex idRegex = new Regex("(?:Id=\")(([a-z0-9]{8})-{1}([a-z0-9]{4})-{1}([a-z0-9]{4})-{1}([a-z0-9]{4})-{1}([a-z0-9]{12}))(?=\"{1})"); + private static readonly Regex _IndexRegex = new Regex("(?:Index=\"){1}([0-9]+)\"{1}"); + private static readonly Regex _IdRegex = new Regex("(?:Id=\")(([a-z0-9]{8})-{1}([a-z0-9]{4})-{1}([a-z0-9]{4})-{1}([a-z0-9]{4})-{1}([a-z0-9]{12}))(?=\"{1})"); public static string ExtractIdFromRecurrenceInfo(string pRecurrenceInfo) { - return pRecurrenceInfo != null ? idRegex.Match(pRecurrenceInfo).Groups[1].Value : null; + return pRecurrenceInfo != null ? _IdRegex.Match(pRecurrenceInfo).Groups[1].Value : null; } public static int ExtractIndexFromRecurrenceInfo(string pRecurrenceInfo) { if(pRecurrenceInfo != null) { - var indexString = indexRegex.Match(pRecurrenceInfo).Groups[1].Value; + var indexString = _IndexRegex.Match(pRecurrenceInfo).Groups[1].Value; var index = !string.IsNullOrEmpty(indexString) ? int.Parse(indexString) : 0; diff --git a/BeWo/Scheduler/View/NewSchedulerView.xaml.cs b/BeWo/Scheduler/View/NewSchedulerView.xaml.cs index a98668c9f..d540530fc 100644 --- a/BeWo/Scheduler/View/NewSchedulerView.xaml.cs +++ b/BeWo/Scheduler/View/NewSchedulerView.xaml.cs @@ -37,6 +37,7 @@ using DevExpress.Xpf.Scheduler; using DevExpress.Xpf.Scheduler.Reporting; using DevExpress.XtraScheduler; using DevExpress.XtraScheduler.Compatibility; +using DevExpress.XtraScheduler.Forms; using DevExpress.XtraScheduler.iCalendar; using DevExpress.XtraScheduler.Services; using Microsoft.Win32; @@ -44,372 +45,382 @@ using Appointment = DevExpress.XtraScheduler.Appointment; using AppointmentViewInfoCustomizingEventArgs = DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs; using ColorConverter = System.Windows.Media.ColorConverter; using DateTime = System.DateTime; +using DeleteRecurrentAppointmentFormEventArgs = DevExpress.Xpf.Scheduler.DeleteRecurrentAppointmentFormEventArgs; using InplaceEditorEventArgs = DevExpress.Xpf.Scheduler.InplaceEditorEventArgs; using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl; namespace BeWo.Scheduler.View { - public partial class NewSchedulerView : INotifyPropertyChanged - { + public partial class NewSchedulerView : INotifyPropertyChanged + { private bool _IsEmployeeBrushVisible; - public bool IsEmployeeBrushVisible - { - get => _IsEmployeeBrushVisible; + public bool IsEmployeeBrushVisible + { + get => _IsEmployeeBrushVisible; - set - { - _IsEmployeeBrushVisible = value; - OnPropertyChanged(nameof(IsEmployeeBrushVisible)); - } - } + set + { + _IsEmployeeBrushVisible = value; + OnPropertyChanged(nameof(IsEmployeeBrushVisible)); + } + } - private bool _IsAbsenceTimeVisible; + private bool _IsAbsenceTimeVisible; - public bool IsAbsenceTimeVisible - { - get => _IsAbsenceTimeVisible; + public bool IsAbsenceTimeVisible + { + get => _IsAbsenceTimeVisible; - set - { - _IsAbsenceTimeVisible = value; - OnPropertyChanged(nameof(IsAbsenceTimeVisible)); - } - } + set + { + _IsAbsenceTimeVisible = value; + OnPropertyChanged(nameof(IsAbsenceTimeVisible)); + } + } - private bool _IsTasksVisible; + private bool _IsTasksVisible; - public bool IsTasksVisible - { - get => _IsTasksVisible; + public bool IsTasksVisible + { + get => _IsTasksVisible; - set - { - _IsTasksVisible = value; - OnPropertyChanged(nameof(IsTasksVisible)); - } - } + set + { + _IsTasksVisible = value; + OnPropertyChanged(nameof(IsTasksVisible)); + } + } - public bool IsInCustomerViewMode { get; set; } + public bool IsInCustomerViewMode { get; set; } - private SchedulerPrintingSettings _PrintingSettings = new SchedulerPrintingSettings(); + private SchedulerPrintingSettings _PrintingSettings = new SchedulerPrintingSettings(); - public NewSchedulerViewModel ViewModel { get; set; } + public NewSchedulerViewModel ViewModel { get; set; } - public event PropertyChangedEventHandler PropertyChanged; + public event PropertyChangedEventHandler PropertyChanged; [NotifyPropertyChangedInvocator] - public void OnPropertyChanged(string propertyName) - { - var handler = PropertyChanged; - handler?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } + public void OnPropertyChanged(string propertyName) + { + var handler = PropertyChanged; + handler?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } - public bool ZeigeNurMeineTermine - { - get => BeWoApp.AppSettings.ZeigeNurMeineTermine; - set - { + public bool ZeigeNurMeineTermine + { + get => BeWoApp.AppSettings.ZeigeNurMeineTermine; + set + { if(BeWoApp.AppSettings.ZeigeNurMeineTermine != value) - { + { BeWoApp.AppSettings.ZeigeNurMeineTermine = value; BeWoApp.SaveAppSettings(); OnPropertyChanged(nameof(ZeigeNurMeineTermine)); - } - } - } + } + } + } - private List _AllEmployees; - public List AllEmployees - { - get => _AllEmployees ?? (_AllEmployees = new List()); + private List _AllEmployees; - set - { - if(!ListEquals(_AllEmployees, value)) - { + public List AllEmployees + { + get => _AllEmployees ?? (_AllEmployees = new List()); + + set + { + if(!ListEquals(_AllEmployees, value)) + { _AllEmployees = value; OnPropertyChanged(nameof(AllEmployees)); - } - } - } - - private List _GefilterteMitarbeiter; - public List GefilterteMitarbeiter - { - get => _GefilterteMitarbeiter ?? (_GefilterteMitarbeiter = new List(AllEmployees)); - - set - { - if(!ListEquals(_GefilterteMitarbeiter, value)) - { - _GefilterteMitarbeiter = value; - _GefilterteMitarbeiter.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); - - OnPropertyChanged(nameof(GefilterteMitarbeiter)); - } - } - } - - private List _GefilterteKlienten; - public List GefilterteKlienten - { - get => _GefilterteKlienten ?? (_GefilterteKlienten = new List(AllCustomers)); - - set - { - if(!ListEquals(_GefilterteKlienten, value)) - { - _GefilterteKlienten = value; - _GefilterteKlienten.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); - - OnPropertyChanged(nameof(GefilterteKlienten)); - } - } - } - - private List _AllCustomers; - public List AllCustomers - { - get => _AllCustomers ?? (_AllCustomers = new List()); - - set - { - if(!ListEquals(_AllCustomers, value)) - { - _AllCustomers = value; - OnPropertyChanged(nameof(AllCustomers)); - } - } - } - - private List _AllResources; - public List AllResources - { - get => _AllResources ?? (_AllResources = new List()); - - set - { - if(!ListEquals(_AllResources, value)) - { - _AllResources = value; - OnPropertyChanged(nameof(AllResources)); - } - } - } - - private List _CustomerList; - public List CustomerList - { - get => _CustomerList ?? (_CustomerList = new List()); - - set - { - if(!ListEquals(_CustomerList, value)) - { - _CustomerList = value; - _CustomerList.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); - OnPropertyChanged(nameof(CustomerList)); - } - } - } - - private int _TimelineDayCount; - private SchedulerViewType _CurrentViewType; - - private Dictionary> _Category2ResourcesDictionary; - public Dictionary> Category2ResourcesDictionary - { - get => _Category2ResourcesDictionary ?? (_Category2ResourcesDictionary = new Dictionary>()); - - set - { - if(!CheckCats2ResourcesForEqualitiy(value)) - { - _Category2ResourcesDictionary = value; - - AllResources = new List(); - value.DoForEach(d => AllResources.AddRange(d.Value)); - - OnPropertyChanged(nameof(Category2ResourcesDictionary)); - } - } - } - - private bool CheckCats2ResourcesForEqualitiy(Dictionary> dic2) - { - if(_Category2ResourcesDictionary == null && dic2 != null || dic2 == null && _Category2ResourcesDictionary != null) - { - return false; - } - - return _Category2ResourcesDictionary == null && dic2 == null || _Category2ResourcesDictionary != null && dic2 != null && _Category2ResourcesDictionary.Count == dic2.Count && _Category2ResourcesDictionary.Except(dic2).Any(); - } - - private static bool ListEquals(IReadOnlyCollection list1, ICollection list2) - { - if(list1 == null && list2 == null) - { - return true; - } - - if(list1 == null && list2 != null || list1 != null && list2 == null) - { - return false; - } - - return list1.Count == list2.Count && list1.All(list2.Contains); + } + } } - private List _SelectedEmployees = new List(); - private List _SelectedCustomers = new List(); - private List _SelectedResources = new List(); + private List _GefilterteMitarbeiter; - public List SelectedEmployees - { - get => _SelectedEmployees; - set - { - if(!ListEquals(_SelectedEmployees, value)) - { - _SelectedEmployees = value; - _SelectedEmployees.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); + public List GefilterteMitarbeiter + { + get => _GefilterteMitarbeiter ?? (_GefilterteMitarbeiter = new List(AllEmployees)); - AlleMitarbeiterCB.IsChecked = ListEquals(value, AllEmployees); + set + { + if(!ListEquals(_GefilterteMitarbeiter, value)) + { + _GefilterteMitarbeiter = value; + _GefilterteMitarbeiter.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); - ZeigeNurMeineTermine = value.Count == 1 && value.Contains(BeWoApp.CompactLoggedOnEmployee); + OnPropertyChanged(nameof(GefilterteMitarbeiter)); + } + } + } - OnPropertyChanged(nameof(SelectedEmployees)); - OnPropertyChanged(nameof(SelectedItems)); - } - } - } + private List _GefilterteKlienten; - public List SelectedCustomers - { - get => _SelectedCustomers; - set - { - if(!ListEquals(_SelectedCustomers, value)) - { - _SelectedCustomers = value; - _SelectedCustomers.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); + public List GefilterteKlienten + { + get => _GefilterteKlienten ?? (_GefilterteKlienten = new List(AllCustomers)); - if(NurMeineKlientenCB.IsChecked.HasValue && NurMeineKlientenCB.IsChecked.Value && value.Equals(GefilterteKlienten) || value.Equals(AllCustomers)) - { - AlleKlientenCB.IsChecked = true; - } + set + { + if(!ListEquals(_GefilterteKlienten, value)) + { + _GefilterteKlienten = value; + _GefilterteKlienten.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); - OnPropertyChanged(nameof(SelectedCustomers)); - OnPropertyChanged(nameof(SelectedItems)); - } - } - } + OnPropertyChanged(nameof(GefilterteKlienten)); + } + } + } - public List SelectedResources - { - get => _SelectedResources; - set - { - if(!ListEquals(_SelectedResources, value)) - { - _SelectedResources = value; + private List _AllCustomers; - AlleRessourcenCB.IsChecked = ListEquals(value, AllResources); + public List AllCustomers + { + get => _AllCustomers ?? (_AllCustomers = new List()); - OnPropertyChanged(nameof(SelectedResources)); - OnPropertyChanged(nameof(SelectedItems)); - } - } - } + set + { + if(!ListEquals(_AllCustomers, value)) + { + _AllCustomers = value; + OnPropertyChanged(nameof(AllCustomers)); + } + } + } - public IEnumerable SelectedItems - { - get - { - var erg = new List(); + private List _AllResources; - erg.AddRange(SelectedEmployees); - erg.AddRange(SelectedCustomers); - erg.AddRange(SelectedResources); + public List AllResources + { + get => _AllResources ?? (_AllResources = new List()); - return erg; - } - } + set + { + if(!ListEquals(_AllResources, value)) + { + _AllResources = value; + OnPropertyChanged(nameof(AllResources)); + } + } + } - public IEnumerable AllItems - { - get - { - var erg = new List(); + private List _CustomerList; - erg.AddRange(GefilterteKlienten); - erg.AddRange(AllResources); + public List CustomerList + { + get => _CustomerList ?? (_CustomerList = new List()); - return erg; - } - } + set + { + if(!ListEquals(_CustomerList, value)) + { + _CustomerList = value; + _CustomerList.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); + OnPropertyChanged(nameof(CustomerList)); + } + } + } - public static bool IgnoreChangeEvents; + private int _TimelineDayCount; + private SchedulerViewType _CurrentViewType; - //private List _EmployeesTeams = new List(); - - private string _Requests; - public string Requests - { - get => _Requests ?? (_Requests = "keine Benachrichtigungen"); - set - { - _Requests = value; - OnPropertyChanged(nameof(Requests)); - } - } + private Dictionary> _Category2ResourcesDictionary; - public static TimeSpan FetchPadding = TimeSpan.FromDays(14); - - private TimeInterval _LastFetchedInterval = new TimeInterval(); + public Dictionary> Category2ResourcesDictionary + { + get => _Category2ResourcesDictionary ?? (_Category2ResourcesDictionary = new Dictionary>()); - public long CustomerOidToPreselect { get; set; } + set + { + if(!CheckCats2ResourcesForEqualitiy(value)) + { + _Category2ResourcesDictionary = value; - //private static string[] outlookCalendarPaths; - //public static string[] OutlookCalendarPaths - //{ - // get - // { - // if (outlookCalendarPaths != null) - // return outlookCalendarPaths; + AllResources = new List(); + value.DoForEach(d => AllResources.AddRange(d.Value)); - // try - // { - // outlookCalendarPaths = OutlookExchangeHelper.GetOutlookCalendarPaths(); - // } - // catch - // { - // outlookCalendarPaths = new string[0]; - // } + OnPropertyChanged(nameof(Category2ResourcesDictionary)); + } + } + } - // return outlookCalendarPaths; - // } - //} + private bool CheckCats2ResourcesForEqualitiy(Dictionary> dic2) + { + if(_Category2ResourcesDictionary == null && dic2 != null || dic2 == null && _Category2ResourcesDictionary != null) + { + return false; + } - // KONSTRUKTOR - public NewSchedulerView(long customerOid) - { - // Kalenderaufruf aus dem CustomerView2 heraus - CustomerOidToPreselect = customerOid; - ConstructObject(); - } + return _Category2ResourcesDictionary == null && dic2 == null || _Category2ResourcesDictionary != null && dic2 != null && _Category2ResourcesDictionary.Count == dic2.Count && _Category2ResourcesDictionary.Except(dic2).Any(); + } - public NewSchedulerView() - { - ConstructObject(); - } + private static bool ListEquals(IReadOnlyCollection list1, ICollection list2) + { + if(list1 == null && list2 == null) + { + return true; + } + + if(list1 == null && list2 != null || list1 != null && list2 == null) + { + return false; + } + + return list1.Count == list2.Count && list1.All(list2.Contains); + } + + private List _SelectedEmployees = new List(); + private List _SelectedCustomers = new List(); + private List _SelectedResources = new List(); + + public List SelectedEmployees + { + get => _SelectedEmployees; + set + { + if(!ListEquals(_SelectedEmployees, value)) + { + _SelectedEmployees = value; + _SelectedEmployees.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); + + AlleMitarbeiterCB.IsChecked = ListEquals(value, AllEmployees); + + ZeigeNurMeineTermine = value.Count == 1 && value.Contains(BeWoApp.CompactLoggedOnEmployee); + + OnPropertyChanged(nameof(SelectedEmployees)); + OnPropertyChanged(nameof(SelectedItems)); + } + } + } + + public List SelectedCustomers + { + get => _SelectedCustomers; + set + { + if(!ListEquals(_SelectedCustomers, value)) + { + _SelectedCustomers = value; + _SelectedCustomers.Sort((x, y) => string.Compare(x.LastName + ", " + x.FirstName, y.LastName + ", " + y.FirstName, StringComparison.Ordinal)); + + if(NurMeineKlientenCB.IsChecked.HasValue && NurMeineKlientenCB.IsChecked.Value && value.Equals(GefilterteKlienten) || value.Equals(AllCustomers)) + { + AlleKlientenCB.IsChecked = true; + } + + OnPropertyChanged(nameof(SelectedCustomers)); + OnPropertyChanged(nameof(SelectedItems)); + } + } + } + + public List SelectedResources + { + get => _SelectedResources; + set + { + if(!ListEquals(_SelectedResources, value)) + { + _SelectedResources = value; + + AlleRessourcenCB.IsChecked = ListEquals(value, AllResources); + + OnPropertyChanged(nameof(SelectedResources)); + OnPropertyChanged(nameof(SelectedItems)); + } + } + } + + public IEnumerable SelectedItems + { + get + { + var erg = new List(); + + erg.AddRange(SelectedEmployees); + erg.AddRange(SelectedCustomers); + erg.AddRange(SelectedResources); + + return erg; + } + } + + public IEnumerable AllItems + { + get + { + var erg = new List(); + + erg.AddRange(GefilterteKlienten); + erg.AddRange(AllResources); + + return erg; + } + } + + public static bool IgnoreChangeEvents; + + //private List _EmployeesTeams = new List(); + + private string _Requests; + + public string Requests + { + get => _Requests ?? (_Requests = "keine Benachrichtigungen"); + set + { + _Requests = value; + OnPropertyChanged(nameof(Requests)); + } + } + + public static TimeSpan FetchPadding = TimeSpan.FromDays(14); + + private TimeInterval _LastFetchedInterval = new TimeInterval(); + + public long CustomerOidToPreselect { get; set; } + + //private static string[] outlookCalendarPaths; + //public static string[] OutlookCalendarPaths + //{ + // get + // { + // if (outlookCalendarPaths != null) + // return outlookCalendarPaths; + + // try + // { + // outlookCalendarPaths = OutlookExchangeHelper.GetOutlookCalendarPaths(); + // } + // catch + // { + // outlookCalendarPaths = new string[0]; + // } + + // return outlookCalendarPaths; + // } + //} + + // KONSTRUKTOR + public NewSchedulerView(long customerOid) + { + // Kalenderaufruf aus dem CustomerView2 heraus + CustomerOidToPreselect = customerOid; + ConstructObject(); + } + + public NewSchedulerView() + { + ConstructObject(); + } private DateTime? _SelectedAppointmentStartDate; private readonly SchedulerAppointmentDC _SelectedAppointmentFromHomePanelView; private bool _IsComingFromHomeDragPanel; + public NewSchedulerView(DateTime pIntervalStartDate, SchedulerAppointmentDC pAppointment) { _IsComingFromHomeDragPanel = true; @@ -422,22 +433,22 @@ namespace BeWo.Scheduler.View } private void GetCacheObjects(Action, List, Dictionary>> callback) - { - Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees => - { - this.Dispatch(() => - { - Cache.GetInstance().GetAllActiveCustomersCompact(allCustomers => - { - this.Dispatch(() => - { + { + Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees => + { + this.Dispatch(() => + { + Cache.GetInstance().GetAllActiveCustomersCompact(allCustomers => + { + this.Dispatch(() => + { Cache.GetInstance().GetCategories2ResourcesDictionary(resourceDictionary => { this.Dispatch(() => { if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) { - allEmployees = new List { BeWoApp.CompactLoggedOnEmployee }; + allEmployees = new List {BeWoApp.CompactLoggedOnEmployee}; } var darfKlientenAnsichtSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View); @@ -459,18 +470,18 @@ namespace BeWo.Scheduler.View { resourceDictionary.Clear(); } - + callback(allCustomers, allEmployees, resourceDictionary); }); }); - }); - }); + }); + }); }); - }); + }); } - - private void ConstructObject() - { + + private void ConstructObject() + { IsEmployeeBrushVisible = true; InitializeComponent(); @@ -481,70 +492,71 @@ namespace BeWo.Scheduler.View DataContext = this; - + EditorLocalizer.Active = new GermanEditorLocalizer(); InitRights(); - foreach(var item in from object item in TabControl.Items let ti = (TabItem)item where ti.Visibility.Equals(Visibility.Visible) select item) + foreach(var item in from object item in TabControl.Items let ti = (TabItem) item where ti.Visibility.Equals(Visibility.Visible) select item) { TabControl.SelectedIndex = TabControl.Items.IndexOf(item); break; } } - //private void Synchronize() - //{ - // var synchronizer = new OutlookExportSynchronizer(Scheduler.Storage.GetCoreStorage()); - - // if (OutlookCalendarPaths.Length <= 0) return; + //private void Synchronize() + //{ + // var synchronizer = new OutlookExportSynchronizer(Scheduler.Storage.GetCoreStorage()); - // ((ISupportCalendarFolders) synchronizer).CalendarFolderName = OutlookCalendarPaths[0]; - // synchronizer.ForeignIdFieldName = "OutlookEntryId"; + // if (OutlookCalendarPaths.Length <= 0) return; - // synchronizer.AppointmentSynchronizing += (sender, args) => - // { - - // }; + // ((ISupportCalendarFolders) synchronizer).CalendarFolderName = OutlookCalendarPaths[0]; + // synchronizer.ForeignIdFieldName = "OutlookEntryId"; - - // synchronizer.Synchronize(); - //} - - private bool _IstErsterAufruf = true; + // synchronizer.AppointmentSynchronizing += (sender, args) => + // { - #region InitViewModel - private void InitViewModel() - { + // }; + + + // synchronizer.Synchronize(); + //} + + private bool _IstErsterAufruf = true; + + #region InitViewModel + + private void InitViewModel() + { ViewModel = new NewSchedulerViewModel(); ViewModel.ViewModelChanged += ViewModel_ViewModelChanged; ViewModel.ViewModelChanged += UpdateRequestStringEvent; } - private void ViewModel_ViewModelChanged(object sender, EventArgs e) - { + private void ViewModel_ViewModelChanged(object sender, EventArgs e) + { this.Dispatch(() => - { + { UpdateDataSource(e.Data); LoadSchedulerViewType(); - if (_IstErsterAufruf) - { - if(MainControl.HatNeueTermine && !_IsComingFromHomeDragPanel) - { - FensterOeffnen(); - } + if(_IstErsterAufruf) + { + if(MainControl.HatNeueTermine && !_IsComingFromHomeDragPanel) + { + FensterOeffnen(); + } - _IstErsterAufruf = false; - } + _IstErsterAufruf = false; + } }); - } + } - private void InitScheduler() + private void InitScheduler() { - if (_IsComingFromHomeDragPanel && _SelectedAppointmentStartDate.HasValue) + if(_IsComingFromHomeDragPanel && _SelectedAppointmentStartDate.HasValue) { var monday = _SelectedAppointmentStartDate.Value.FirstDateOfWeek(_SelectedAppointmentStartDate.Value.GetIso8601WeekOfYear()); @@ -553,7 +565,7 @@ namespace BeWo.Scheduler.View else { Scheduler.Start = DateTime.Today; - + } _TimelineDayCount = 0; @@ -582,33 +594,33 @@ namespace BeWo.Scheduler.View { var settings = ViewModel.GetActiveSettings(); - _CurrentViewType = BeWoApp.AppSettings.SchedulerViewType; + _CurrentViewType = BeWoApp.AppSettings.SchedulerViewType; Scheduler.ActiveViewType = _CurrentViewType; Scheduler.DayView.DayCount = BeWoApp.AppSettings.SchedulerDayViewDayCount; settings.DayViewCount = BeWoApp.AppSettings.SchedulerDayViewDayCount; Scheduler.TimelineView.IntervalCount = BeWoApp.AppSettings.SchedulerTimelineViewDayCount; settings.TimelineIntervalCount = BeWoApp.AppSettings.SchedulerTimelineViewDayCount; - UpdateOptionPanel(); + UpdateOptionPanel(); - switch (_CurrentViewType) + switch(_CurrentViewType) { - case SchedulerViewType.Day: + case SchedulerViewType.Day: DayViewOptions.Visibility = Visibility.Visible; TimelineViewOptions.Visibility = Visibility.Collapsed; - break; - case SchedulerViewType.Month: + break; + case SchedulerViewType.Month: var interval = Scheduler.ActiveView.GetVisibleIntervals(); - Scheduler.ActiveView.SetVisibleIntervals(new TimeIntervalCollection { new TimeInterval(interval.Start, new TimeSpan(35, 0, 0, 0)) }); + Scheduler.ActiveView.SetVisibleIntervals(new TimeIntervalCollection {new TimeInterval(interval.Start, new TimeSpan(35, 0, 0, 0))}); UpdateOptionPanel(); - break; - case SchedulerViewType.Timeline: + break; + case SchedulerViewType.Timeline: DayViewOptions.Visibility = Visibility.Collapsed; TimelineViewOptions.Visibility = Visibility.Visible; - break; + break; } - } + } private void SaveSchedulerViewType(SchedulerViewType schedulerViewType) { @@ -617,25 +629,27 @@ namespace BeWo.Scheduler.View var settings = ViewModel.GetActiveSettings(); BeWoApp.AppSettings.SchedulerTimelineViewDayCount = settings.TimelineIntervalCount; - BeWoApp.SaveAppSettings(); + BeWoApp.SaveAppSettings(); } - private void InitRights() - { + private void InitRights() + { MitarbeiterTabItem.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen) ? Visibility.Visible : Visibility.Collapsed; - RessourcenTabItem.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen) ? Visibility.Visible : Visibility.Collapsed; - KlientenTabItem.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) - || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) ? Visibility.Visible : Visibility.Collapsed; - + RessourcenTabItem.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen) ? Visibility.Visible : Visibility.Collapsed; + KlientenTabItem.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) + || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) + ? Visibility.Visible + : Visibility.Collapsed; + MitarbeiterEbenenCheckBox.Visibility = MitarbeiterTabItem.Visibility; - RessourcenEbenenCheckBox.Visibility = RessourcenTabItem.Visibility; - KlientenEbenenCheckBox.Visibility = KlientenTabItem.Visibility; - MitarbeiterfarbenEinAusCheckBox.Visibility = MitarbeiterTabItem.Visibility; + RessourcenEbenenCheckBox.Visibility = RessourcenTabItem.Visibility; + KlientenEbenenCheckBox.Visibility = KlientenTabItem.Visibility; + MitarbeiterfarbenEinAusCheckBox.Visibility = MitarbeiterTabItem.Visibility; ButtonDeleteAppointments.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.Termine_IntervalDelete) ? Visibility.Visible : Visibility.Collapsed; } - private void UpdateDataSource(ISchedulerViewModel vm) + private void UpdateDataSource(ISchedulerViewModel vm) { try { @@ -696,13 +710,13 @@ namespace BeWo.Scheduler.View } } - private void UpdateSchedulerSettings() - { + private void UpdateSchedulerSettings() + { var settings = ViewModel.GetActiveSettings(); Scheduler.Start = settings.StartDate; var starttimeInterval = settings.StartDate.Date; - if (_SelectedAppointmentStartDate.HasValue) + if(_SelectedAppointmentStartDate.HasValue) { var weekOfYear = _SelectedAppointmentStartDate.Value.GetIso8601WeekOfYear(); var monday = _SelectedAppointmentStartDate.Value.FirstDateOfWeek(weekOfYear); @@ -721,65 +735,67 @@ namespace BeWo.Scheduler.View } starttimeInterval = starttimeInterval.AddHours(Scheduler.WorkWeekView.WorkTime.Start.Hours); - - switch (settings.ViewType) - { - case AppointmentViewType.Day: - Scheduler.ActiveViewType = SchedulerViewType.Day; - Scheduler.ActiveView.GotoTimeInterval(new TimeInterval(starttimeInterval, new TimeSpan(8, 0, 0))); - Scheduler.DayView.DayCount = settings.DayViewCount; - break; - case AppointmentViewType.Week: - Scheduler.ActiveViewType = SchedulerViewType.Week; - Scheduler.ActiveView.GotoTimeInterval(new TimeInterval(starttimeInterval, new TimeSpan(8, 0, 0))); - break; - case AppointmentViewType.Month: - Scheduler.ActiveViewType = SchedulerViewType.Month; - break; - case AppointmentViewType.WorkWeek: - Scheduler.ActiveViewType = SchedulerViewType.WorkWeek; - Scheduler.ActiveView.GotoTimeInterval(new TimeInterval(starttimeInterval, new TimeSpan(8, 0, 0))); - break; - case AppointmentViewType.Timeline: - Scheduler.ActiveViewType = SchedulerViewType.Timeline; - Scheduler.TimelineView.ResourcesPerPage = settings.TimelineResourceCount; - Scheduler.TimelineView.IntervalCount = settings.TimelineIntervalCount; - break; - } - UpdateOptionPanel(); + switch(settings.ViewType) + { + case AppointmentViewType.Day: + Scheduler.ActiveViewType = SchedulerViewType.Day; + Scheduler.ActiveView.GotoTimeInterval(new TimeInterval(starttimeInterval, new TimeSpan(8, 0, 0))); + Scheduler.DayView.DayCount = settings.DayViewCount; + break; + case AppointmentViewType.Week: + Scheduler.ActiveViewType = SchedulerViewType.Week; + Scheduler.ActiveView.GotoTimeInterval(new TimeInterval(starttimeInterval, new TimeSpan(8, 0, 0))); + break; + case AppointmentViewType.Month: + Scheduler.ActiveViewType = SchedulerViewType.Month; + break; + case AppointmentViewType.WorkWeek: + Scheduler.ActiveViewType = SchedulerViewType.WorkWeek; + Scheduler.ActiveView.GotoTimeInterval(new TimeInterval(starttimeInterval, new TimeSpan(8, 0, 0))); + break; + case AppointmentViewType.Timeline: + Scheduler.ActiveViewType = SchedulerViewType.Timeline; + Scheduler.TimelineView.ResourcesPerPage = settings.TimelineResourceCount; + Scheduler.TimelineView.IntervalCount = settings.TimelineIntervalCount; + break; + } - try - { - Scheduler.GroupType = settings.GroupByResource ? SchedulerGroupType.Resource : SchedulerGroupType.None; + UpdateOptionPanel(); - Scheduler.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.Custom; - Scheduler.OptionsCustomization.AllowAppointmentDrag = UsedAppointmentType.Custom; - Scheduler.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.Custom; - Scheduler.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.Custom; - Scheduler.OptionsCustomization.AllowAppointmentDragBetweenResources = UsedAppointmentType.Custom; - } - catch (Exception) - { - MessageBox.Show("Ein Fehler bei der Darstellung ist aufgetreten.", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error); - } + try + { + Scheduler.GroupType = settings.GroupByResource ? SchedulerGroupType.Resource : SchedulerGroupType.None; + + Scheduler.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.Custom; + Scheduler.OptionsCustomization.AllowAppointmentDrag = UsedAppointmentType.Custom; + Scheduler.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.Custom; + Scheduler.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.Custom; + Scheduler.OptionsCustomization.AllowAppointmentDragBetweenResources = UsedAppointmentType.Custom; + } + catch(Exception) + { + MessageBox.Show("Ein Fehler bei der Darstellung ist aufgetreten.", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error); + } } - private void UpdateCustomFieldMappings(ISchedulerViewModel vm) - { + private void UpdateCustomFieldMappings(ISchedulerViewModel vm) + { Scheduler.Storage.AppointmentStorage.CustomFieldMappings.Clear(); - vm.AddCustomFieldsMapping(Scheduler.Storage); + vm.AddCustomFieldsMapping(Scheduler.Storage); } - #endregion - public CheckBoxConverter CheckBoxConverter => Resources[nameof(CheckBoxConverter)] as CheckBoxConverter; + #endregion - #region Filterauswahl - private void AlleMitarbeiterCB_OnClick(object sender, RoutedEventArgs e) - { + public CheckBoxConverter CheckBoxConverter => Resources[nameof(CheckBoxConverter)] as CheckBoxConverter; + + #region Filterauswahl + + private void AlleMitarbeiterCB_OnClick(object sender, RoutedEventArgs e) + { var cb = (CheckBox) sender; - if (!cb.IsChecked.HasValue) + if(!cb.IsChecked.HasValue) { return; } @@ -790,320 +806,432 @@ namespace BeWo.Scheduler.View { ZeigeNurMeineTermine = false; } - } + } - private void MitarbeiterListe_OnClick(object sender, RoutedEventArgs e) - { + private void MitarbeiterListe_OnClick(object sender, RoutedEventArgs e) + { var cb = (CheckBox) sender; - if (CheckBoxConverter != null && cb.DataContext is CompactEmployeeDC selectedEmployee) - { - CheckBoxConverter.AktuellerMitarbeiter = selectedEmployee; - } - } - - private void AlleRessourcenCB_OnClick(object sender, RoutedEventArgs e) - { - var cb = (CheckBox) sender; - if (!cb.IsChecked.HasValue) - { - return; - } - - SelectedResources = cb.IsChecked.Value ? new List(AllResources) : new List(); - if (CheckBoxConverter != null && SelectedResources != null) + if(CheckBoxConverter != null && cb.DataContext is CompactEmployeeDC selectedEmployee) { - CheckBoxConverter.SelektierteRessourcen = SelectedResources; + CheckBoxConverter.AktuellerMitarbeiter = selectedEmployee; + } + } + + private void AlleRessourcenCB_OnClick(object sender, RoutedEventArgs e) + { + var cb = (CheckBox) sender; + if(!cb.IsChecked.HasValue) + { + return; + } + + SelectedResources = cb.IsChecked.Value ? new List(AllResources) : new List(); + if(CheckBoxConverter != null && SelectedResources != null) + { + CheckBoxConverter.SelektierteRessourcen = SelectedResources; ReloadVM(true); } } - private void RessourcenTV_OnClick(object sender, RoutedEventArgs e) - { + private void RessourcenTV_OnClick(object sender, RoutedEventArgs e) + { var cb = (CheckBox) sender; - if (CheckBoxConverter != null && cb.DataContext is ResourceDC selectedResource) - { - CheckBoxConverter.AktuelleRessource = selectedResource; - } - } - - private void AlleKlientennCB_OnClick(object sender, RoutedEventArgs e) - { - var cb = (CheckBox) sender; - if (!cb.IsChecked.HasValue) return; - - if (NurMeineKlientenCB.IsChecked.HasValue && NurMeineKlientenCB.IsChecked.Value) - { - SelectedCustomers = cb.IsChecked.Value ? new List(GefilterteKlienten) : new List(); - } - else - { - SelectedCustomers = cb.IsChecked.Value ? new List(AllCustomers) : new List(); - } + if(CheckBoxConverter != null && cb.DataContext is ResourceDC selectedResource) + { + CheckBoxConverter.AktuelleRessource = selectedResource; + } } - private void KlientenListe_OnClick(object sender, RoutedEventArgs e) - { + private void AlleKlientennCB_OnClick(object sender, RoutedEventArgs e) + { + var cb = (CheckBox) sender; + if(!cb.IsChecked.HasValue) return; + + if(NurMeineKlientenCB.IsChecked.HasValue && NurMeineKlientenCB.IsChecked.Value) + { + SelectedCustomers = cb.IsChecked.Value ? new List(GefilterteKlienten) : new List(); + } + else + { + SelectedCustomers = cb.IsChecked.Value ? new List(AllCustomers) : new List(); + } + } + + private void KlientenListe_OnClick(object sender, RoutedEventArgs e) + { var cb = (CheckBox) sender; - if(CheckBoxConverter != null && cb.DataContext is CompactCustomerDC selectedCustomer) - { - CheckBoxConverter.AktuellerKlient = selectedCustomer; - } - } + if(CheckBoxConverter != null && cb.DataContext is CompactCustomerDC selectedCustomer) + { + CheckBoxConverter.AktuellerKlient = selectedCustomer; + } + } - private void ListItemCheckedEvent(object sender, RoutedEventArgs e) - { + private void ListItemCheckedEvent(object sender, RoutedEventArgs e) + { ReloadVM(true); } - private void BtnRemoveElement_Click(object sender, RoutedEventArgs e) - { + private void BtnRemoveElement_Click(object sender, RoutedEventArgs e) + { var selectedDC = ((Button) sender).Tag as IDataContract; - switch(selectedDC) - { - case CompactEmployeeDC _: - var employee = selectedDC as CompactEmployeeDC; - SelectedEmployees.Remove(employee); - OnPropertyChanged(nameof(SelectedEmployees)); + switch(selectedDC) + { + case CompactEmployeeDC _: + var employee = selectedDC as CompactEmployeeDC; + SelectedEmployees.Remove(employee); + OnPropertyChanged(nameof(SelectedEmployees)); - if (employee != null && employee.Equals(BeWoApp.CompactLoggedOnEmployee)) - { - ZeigeNurMeineTermine = false; + if(employee != null && employee.Equals(BeWoApp.CompactLoggedOnEmployee)) + { + ZeigeNurMeineTermine = false; ReloadVM(true); - } - else if (SelectedEmployees.Count == 1 && SelectedEmployees.First().Equals(BeWoApp.CompactLoggedOnEmployee)) - { - ZeigeNurMeineTermine = true; - } + } + else if(SelectedEmployees.Count == 1 && SelectedEmployees.First().Equals(BeWoApp.CompactLoggedOnEmployee)) + { + ZeigeNurMeineTermine = true; + } - break; - case CompactCustomerDC _: - var customer = selectedDC as CompactCustomerDC; + break; + case CompactCustomerDC _: + var customer = selectedDC as CompactCustomerDC; - SelectedCustomers.Remove(customer); - OnPropertyChanged(nameof(SelectedCustomers)); + SelectedCustomers.Remove(customer); + OnPropertyChanged(nameof(SelectedCustomers)); - break; - case ResourceDC _: - var resource = selectedDC as ResourceDC; + break; + case ResourceDC _: + var resource = selectedDC as ResourceDC; - SelectedResources.Remove(resource); - OnPropertyChanged(nameof(SelectedResources)); + SelectedResources.Remove(resource); + OnPropertyChanged(nameof(SelectedResources)); - break; - } - - OnPropertyChanged(nameof(SelectedItems)); + break; + } + + OnPropertyChanged(nameof(SelectedItems)); } - private void ButtonDayView_Click(object sender, RoutedEventArgs e) - { + private void ButtonDayView_Click(object sender, RoutedEventArgs e) + { Scheduler.ActiveViewType = SchedulerViewType.Day; - _CurrentViewType = Scheduler.ActiveViewType; - UpdateOptionPanel(); + _CurrentViewType = Scheduler.ActiveViewType; + UpdateOptionPanel(); - DayViewOptions.Visibility = Visibility.Visible; - TimelineViewOptions.Visibility = Visibility.Collapsed; + DayViewOptions.Visibility = Visibility.Visible; + TimelineViewOptions.Visibility = Visibility.Collapsed; SaveSchedulerViewType(SchedulerViewType.Day); } - private void ButtonMonthView_Click(object sender, RoutedEventArgs e) - { + private void ButtonMonthView_Click(object sender, RoutedEventArgs e) + { Scheduler.ActiveViewType = SchedulerViewType.Month; - _CurrentViewType = Scheduler.ActiveViewType; - var interval = Scheduler.ActiveView.GetVisibleIntervals(); - Scheduler.ActiveView.SetVisibleIntervals(new TimeIntervalCollection {new TimeInterval(interval.Start, new TimeSpan(35, 0, 0, 0))}); + _CurrentViewType = Scheduler.ActiveViewType; + var interval = Scheduler.ActiveView.GetVisibleIntervals(); + Scheduler.ActiveView.SetVisibleIntervals(new TimeIntervalCollection {new TimeInterval(interval.Start, new TimeSpan(35, 0, 0, 0))}); - UpdateOptionPanel(); + UpdateOptionPanel(); SaveSchedulerViewType(SchedulerViewType.Month); - } + } - private void ButtonWorkWeekView_Click(object sender, RoutedEventArgs e) - { + private void ButtonWorkWeekView_Click(object sender, RoutedEventArgs e) + { Scheduler.ActiveViewType = SchedulerViewType.WorkWeek; - _CurrentViewType = Scheduler.ActiveViewType; - UpdateOptionPanel(); + _CurrentViewType = Scheduler.ActiveViewType; + UpdateOptionPanel(); SaveSchedulerViewType(SchedulerViewType.WorkWeek); - } + } - private void ButtonWeekView_Click(object sender, RoutedEventArgs e) - { + private void ButtonWeekView_Click(object sender, RoutedEventArgs e) + { Scheduler.ActiveViewType = SchedulerViewType.Week; - _CurrentViewType = Scheduler.ActiveViewType; - UpdateOptionPanel(); + _CurrentViewType = Scheduler.ActiveViewType; + UpdateOptionPanel(); SaveSchedulerViewType(SchedulerViewType.Week); - } + } - private void ButtonTimelineView_Click(object sender, RoutedEventArgs e) - { + private void ButtonTimelineView_Click(object sender, RoutedEventArgs e) + { Scheduler.ActiveViewType = SchedulerViewType.Timeline; - _CurrentViewType = Scheduler.ActiveViewType; - UpdateOptionPanel(); + _CurrentViewType = Scheduler.ActiveViewType; + UpdateOptionPanel(); - DayViewOptions.Visibility = Visibility.Collapsed; - TimelineViewOptions.Visibility = Visibility.Visible; + DayViewOptions.Visibility = Visibility.Collapsed; + TimelineViewOptions.Visibility = Visibility.Visible; SaveSchedulerViewType(SchedulerViewType.Timeline); - } + } - private void SpinEditDayViewDayCount_EditValueChanged(object sender, EditValueChangedEventArgs e) - { - if (e.NewValue != null && int.TryParse(e.NewValue.ToString(), out var count) && count > 0) + private void SpinEditDayViewDayCount_EditValueChanged(object sender, EditValueChangedEventArgs e) + { + if(e.NewValue != null && int.TryParse(e.NewValue.ToString(), out var count) && count > 0) { Scheduler.DayView.DayCount = count; _TimelineDayCount = count; BeWoApp.AppSettings.SchedulerDayViewDayCount = count; - } + } } - private void SpinEditTimelineViewDayCount_EditValueChanged(object sender, EditValueChangedEventArgs e) - { + private void SpinEditTimelineViewDayCount_EditValueChanged(object sender, EditValueChangedEventArgs e) + { if(e.NewValue != null && int.TryParse(e.NewValue.ToString(), out var count) && count > 0) { Scheduler.TimelineView.IntervalCount = count; _TimelineDayCount = count; BeWoApp.AppSettings.SchedulerTimelineViewDayCount = count; - } - } - #endregion + } + } - private bool _Enabled; - public bool Enabled - { - get => _Enabled; - set - { - _Enabled = value; - OnPropertyChanged(nameof(Enabled)); - } - } - - public void UpdateRequestString() - { - ServiceFacade.DoResourceServiceSync(r => _Liste = r.GetAllOpenAppointmentsForEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value)); + #endregion - var count = 0; + private bool _Enabled; + + public bool Enabled + { + get => _Enabled; + set + { + _Enabled = value; + OnPropertyChanged(nameof(Enabled)); + } + } + + public void UpdateRequestString() + { + ServiceFacade.DoResourceServiceSync(r => _Liste = r.GetAllOpenAppointmentsForEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value)); + + var count = 0; var oidList = new List(); - foreach (var termin in _Liste) - { - if (termin.Originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) - { - foreach (var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid != BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) - { - if (status.IsPChanged && status.ParticipationAnswer != ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value)) - { + foreach(var termin in _Liste) + { + if(termin.Originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) + { + foreach(var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid != BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) + { + if(status.IsPChanged && status.ParticipationAnswer != ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value)) + { oidList.Add(status.Employee2SchedulerAppointmentOid.Value); count++; - } - } - } - else - { - if (termin.EmployeeList.Any(a => a.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) - { - foreach (var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) + } + } + } + else + { + if(termin.EmployeeList.Any(a => a.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) + { + foreach(var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)) { - if (!status.IsPChanged && status.ParticipationAnswer == ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value)) + if(!status.IsPChanged && status.ParticipationAnswer == ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value)) { oidList.Add(status.Employee2SchedulerAppointmentOid.Value); count++; } } } - } - } + } + } Enabled = count > 0; - Requests = $"{(count == 0 ? "keine" : count.ToString())} Benachrichtigung{(count == 1 ? "" : "en")}"; - } + Requests = $"{(count == 0 ? "keine" : count.ToString())} Benachrichtigung{(count == 1 ? "" : "en")}"; + } - private List _Liste = new List(); + private List _Liste = new List(); - private void NewSchedulerStorage_AppointmentsChanged(object sender, PersistentObjectsEventArgs e) - { - if (IgnoreChangeEvents || IgnoreManualAppointmentCreation) - { + private void NewSchedulerStorage_AppointmentsChanged(object sender, PersistentObjectsEventArgs e) + { + if(IgnoreChangeEvents || IgnoreManualAppointmentCreation) + { return; - } + } - var appList = e.Objects.Cast().ToList(); - - if (appList.Any(f => f.CF_IsPrivate())) - { - ShowPrivateAppointmentsCheckBox.IsChecked = true; - } + var appList = e.Objects.Cast().ToList(); + + if(appList.Any(f => f.CF_IsPrivate())) + { + ShowPrivateAppointmentsCheckBox.IsChecked = true; + } + + var changedAppointments = appList.Where(appointment => appointment.Type != AppointmentType.DeletedOccurrence).ToList(); + + ViewModel.ActiveAppointmentViewModel.SaveAppointments(Scheduler, changedAppointments); - ViewModel.ActiveAppointmentViewModel.SaveAppointments(Scheduler, appList); - ReloadVM(true); } - private void NewSchedulerStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) - { - var appointment = (Appointment) e.Object; - var sourceObj = (SchedulerAppointmentVM) appointment.GetSourceObject(Scheduler.GetCoreStorage()); - - if(appointment != null && sourceObj != null) - { - if(!BeWoUtils.CheckSchedulerRights(appointment, sourceObj.IsNew, SchedulerRightsCheckType.Edit)) - { - e.Cancel = true; - return; - } - } - - if(e.Object is Appointment app && app.Type != AppointmentType.ChangedOccurrence) + private int _NumberOfAppointmentsToDelete; + private readonly List _AppointmentsToDelete = new List(); + + private void NewSchedulerStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) + { + var selectedAppointmentCount = Scheduler.SelectedAppointments.Count; + + if (_NumberOfAppointmentsToDelete == 0) { - const string msg = "Möchten Sie den gewählten Termin wirklich löschen?"; + _NumberOfAppointmentsToDelete = selectedAppointmentCount; + } - if(app.Type != AppointmentType.DeletedOccurrence && MessageBox.Show(msg, "BeWoPlaner", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) - { - e.Cancel = true; - } - else - { - var appList = new List(); + var appointment = (Appointment) e.Object; + var sourceObj = (SchedulerAppointmentVM) appointment.GetSourceObject(Scheduler.GetCoreStorage()); - if(app.Type != AppointmentType.ChangedOccurrence) - { - appList.Add(app); - } + if(appointment != null && sourceObj != null) + { + if(!BeWoUtils.CheckSchedulerRights(appointment, sourceObj.IsNew, SchedulerRightsCheckType.Edit)) + { + e.Cancel = true; + return; + } + } - var dcList = appList.Select(item => item.GetSourceObject(Scheduler.GetCoreStorage())).OfType().Select(vm => vm.CommitToDataContract()).Where(dc => dc.SchedulerAppointmentOid.HasValue).ToList(); - var idList = (from item in dcList where item.SchedulerAppointmentOid.HasValue select item.SchedulerAppointmentOid.Value).ToList(); + if (e.Object is Appointment app) + { + e.Cancel = PrepareDeletion(app); + } + } - IgnoreChangeEvents = true; + private bool PrepareDeletion(Appointment appointment) + { + var shouldCancel = false; - var appointments = new List(); - var updatedAppointments = new List(); - ServiceFacade.DoResourceServiceSync(s => appointments = s.GetSchedulerAppointmentsById(idList)); - if(appointments.Any()) + var msg = GetDeleteMessageForAppointment(appointment); + + var dataContract = appointment.GetSourceObject(Scheduler.GetCoreStorage()) is SchedulerAppointmentVM schedulerAppointmentVM ? schedulerAppointmentVM.CommitToDataContract() : CreateDummyAppointment(appointment); + + if(dataContract.SchedulerAppointmentOid.HasValue) + { + // Nur bei Normalem Typ nachfragen. Bei Serienterminen wird bereits im Fenster vorher gefragt wurde, ob gelöscht werden soll. + if (appointment.Type == AppointmentType.Normal && MessageBox.Show(msg, "BeWoPlaner", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) + { + shouldCancel = true; + + if(_NumberOfAppointmentsToDelete > 0) { - ServiceFacade.DoResourceServiceSync(s => updatedAppointments = s.DeactivateSchedulerAppointmentsForSync(appointments.ToDictionary(dc => dc.SchedulerAppointmentOid.Value, dc => dc.NewSchedulerAppointmentVersion.Value))); + _NumberOfAppointmentsToDelete--; + } - ViewModel.ActiveAppointmentViewModel.UpdateViewModel(updatedAppointments); + _AppointmentsToDelete.Remove(dataContract); + } + else + { + _AppointmentsToDelete.AddIfNotIn(dataContract); - Scheduler.ActiveView.LayoutChanged(); + if(_AppointmentsToDelete.Count == _NumberOfAppointmentsToDelete) + { + DeleteAppointments(); + } + } + } + + return shouldCancel; + } + + private long _DummyOid = -1; + + private SchedulerAppointmentDC CreateDummyAppointment(Appointment appointment) + { + var dummyAppointment = new SchedulerAppointmentDC + { + SchedulerAppointmentOid = _DummyOid, + Subject = appointment.Subject, + StartDate = appointment.Start, + EndDate = appointment.End + }; + + _DummyOid--; + + return dummyAppointment; + } + + private void DeleteAppointments() + { + BeWoApp.LogMessage($"DeleteAppointments aufgerufen. Es werden {_AppointmentsToDelete.Count} Termine gelöscht", Colors.Red); + + var idList = (from item in _AppointmentsToDelete where item.SchedulerAppointmentOid.HasValue && item.SchedulerAppointmentOid.Value > 0 select item.SchedulerAppointmentOid.Value).ToList(); + + IgnoreChangeEvents = true; + + ServiceFacade.DoResourceServiceAsync(s => s.GetSchedulerAppointmentsById(idList), appointments2 => + { + var oids2Versions = appointments2.ToDictionary(dc => dc.SchedulerAppointmentOid.Value, dc => dc.NewSchedulerAppointmentVersion.Value); + + ServiceFacade.DoResourceServiceAsync(s2 => s2.DeactivateSchedulerAppointmentsForSync(oids2Versions), updatedAppointments2 => + { + this.Dispatch(() => + { + ViewModel.ActiveAppointmentViewModel.UpdateViewModel(updatedAppointments2); + + Scheduler.ActiveView.LayoutChanged(); UpdateRequestString(); - ReloadVM(true); + ReloadVM(true); + + ResetDeletionMode(); IgnoreChangeEvents = false; - } - } - } - } + }); + }); + }); + } - private void NewSchedulerStorage_AppointmentsInserted(object sender, PersistentObjectsEventArgs e) - { + private static string GetDeleteMessageForAppointment(Appointment appointment) + { + var message = "Möchten Sie den gewählten Termin wirklich löschen?"; + + if(appointment != null) + { + var subject = appointment.Subject; + + var interval = GetAppointmentTimeString(appointment); + + message = $"Möchten Sie den gewählten Termin \"{subject}\" vom {interval} wirklich löschen?"; + } + + return message; + } + + public static string GetAppointmentTimeString(Appointment appointment) + { + var interval = string.Empty; + + if(appointment != null) + { + var start = appointment.Start; + var end = appointment.End; + + // 1. 17. August 2021 09:00 Uhr bis 10:00 Uhr + // 2. 17. August 2021 + // 3. 17. August 2021 09:00 Uhr bis 19. August 2021 10 Uhr + // 4. 17. August 2021 bis 19. August 2021 + + if(start.Date == end.Date) + { + interval = appointment.AllDay ? $"{start:dd. MMMM yyyy}" : $"{start:dd. MMMM yyyy HH:mm} Uhr bis {end:HH:mm} Uhr"; + } + else + { + interval = appointment.AllDay ? $"{start:dd. MMMM yyyy} bis zum {end:dd. MMMM yyyy}" : $"{start: dd. MMMM yyyy HH:mm} Uhr bis zum {end:dd. MMMM yyyy HH:mm} Uhr"; + } + } + + return interval; + } + + private void ResetDeletionMode() + { + _AppointmentsToDelete.Clear(); + _NumberOfAppointmentsToDelete = 0; + _DummyOid = 0; + } + + private void NewSchedulerStorage_AppointmentsInserted(object sender, PersistentObjectsEventArgs e) + { if(IgnoreManualAppointmentCreation) { return; @@ -1111,59 +1239,61 @@ namespace BeWo.Scheduler.View var appList = e.Objects.Cast().ToList(); - if(appList.Any(f => f.CF_IsPrivate())) - { - ShowPrivateAppointmentsCheckBox.IsChecked = true; - } + if(appList.Any(f => f.CF_IsPrivate())) + { + ShowPrivateAppointmentsCheckBox.IsChecked = true; + } - ViewModel.ActiveAppointmentViewModel.InsertAppointments(Scheduler, appList); - UpdateRequestString(); - ReloadVM(true); - } - - private void Scheduler_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) - { - var control = (SchedulerControl) sender; - - IgnoreChangeEvents = true; - - if (_IsNew) - { - var n = new ObservableCollection(SelectedEmployees.Select(item => new Employee2SchedulerAppointmentDC { Employee = item, ParticipationAnswer = ParticipationAnswer.Offen }).ToList()); - e.Appointment.CF_EmployeeList(n); - e.Appointment.CF_CustomerList(new List(SelectedCustomers)); - e.Appointment.CF_ResourceList(new List(SelectedResources)); - } - - var form = ViewModel.GetEditAppointmentForm(control, e.Appointment); - if (form == null) - { - if(_IsNew) - { - _IsNew = false; - } - - IgnoreChangeEvents = false; - - return; - } - - e.Form = form; - e.AllowResize = false; - - if (_IsNew) - { - _IsNew = false; - } - - IgnoreChangeEvents = false; + ViewModel.ActiveAppointmentViewModel.InsertAppointments(Scheduler, appList); + UpdateRequestString(); + ReloadVM(true); } - private void SchedulerControl_EditRecurrentAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) { } + private void Scheduler_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) + { + var control = (SchedulerControl) sender; - private void Scheduler_PopupMenuShowing(object sender, SchedulerMenuEventArgs e) - { - if(Scheduler.SelectedAppointments?.Count == 1) + IgnoreChangeEvents = true; + + if(_IsNew) + { + var n = new ObservableCollection(SelectedEmployees.Select(item => new Employee2SchedulerAppointmentDC {Employee = item, ParticipationAnswer = ParticipationAnswer.Offen}).ToList()); + e.Appointment.CF_EmployeeList(n); + e.Appointment.CF_CustomerList(new List(SelectedCustomers)); + e.Appointment.CF_ResourceList(new List(SelectedResources)); + } + + var form = ViewModel.GetEditAppointmentForm(control, e.Appointment); + if(form == null) + { + if(_IsNew) + { + _IsNew = false; + } + + IgnoreChangeEvents = false; + + return; + } + + e.Form = form; + e.AllowResize = false; + + if(_IsNew) + { + _IsNew = false; + } + + IgnoreChangeEvents = false; + } + + private void SchedulerControl_EditRecurrentAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) + { + } + + private void Scheduler_PopupMenuShowing(object sender, SchedulerMenuEventArgs e) + { + if(Scheduler.SelectedAppointments?.Count == 1) { bool isAllowedToEdit; var test = Scheduler.SelectedAppointments.First(); @@ -1177,58 +1307,58 @@ namespace BeWo.Scheduler.View } else { - isAllowedToEdit = Scheduler.SelectedAppointments.Any(a => BeWoUtils.CheckSchedulerRights(a, ((SchedulerAppointmentVM)a.GetSourceObject(Scheduler.GetCoreStorage())).IsNew, SchedulerRightsCheckType.Edit)); + isAllowedToEdit = Scheduler.SelectedAppointments.Any(a => BeWoUtils.CheckSchedulerRights(a, ((SchedulerAppointmentVM) a.GetSourceObject(Scheduler.GetCoreStorage())).IsNew, SchedulerRightsCheckType.Edit)); } - if(!isAllowedToEdit) - { - var menuItem = e.Menu.ItemLinks.FirstOrDefault(f => f.Name.Contains("DeleteAppointment")); + if(!isAllowedToEdit) + { + var menuItem = e.Menu.ItemLinks.FirstOrDefault(f => f.Name.Contains("DeleteAppointment")); + + if(menuItem != null) + { + e.Menu.ItemLinks.Remove(menuItem); + } + } + } - if(menuItem != null) - { - e.Menu.ItemLinks.Remove(menuItem); - } - } - } - if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewAll)) { - var verfuegbarkeitMenue = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && (((BarButtonItemLink)f).Item?.Name.Contains("MitarbeiterVerfuegbarkeitPruefenButtonItem") ?? false)); + var verfuegbarkeitMenue = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && (((BarButtonItemLink) f).Item?.Name.Contains("MitarbeiterVerfuegbarkeitPruefenButtonItem") ?? false)); - if (verfuegbarkeitMenue != null) + if(verfuegbarkeitMenue != null) { e.Menu.ItemLinks.Remove(verfuegbarkeitMenue); } } - if(Scheduler.SelectedAppointments.Count == 0 || Scheduler.SelectedAppointments[0]?.Type != AppointmentType.ChangedOccurrence) - { - var restoreMenu = e.Menu.ItemLinks.FirstOrDefault(f => - { - var type = f.GetType(); - if(type == typeof(BarButtonItemLink)) - { - var item = (BarButtonItemLink) f; - - if(item.Name.Contains("RestoreAppointmentButtonItem")) - { - return true; - } - } - - return false; - }); + if(Scheduler.SelectedAppointments.Count == 0 || Scheduler.SelectedAppointments[0]?.Type != AppointmentType.ChangedOccurrence) + { + var restoreMenu = e.Menu.ItemLinks.FirstOrDefault(f => + { + var type = f.GetType(); + if(type == typeof(BarButtonItemLink)) + { + var item = (BarButtonItemLink) f; - if(restoreMenu != null) - { - e.Menu.ItemLinks.Remove(restoreMenu); - } - } + if(item.Name.Contains("RestoreAppointmentButtonItem")) + { + return true; + } + } + + return false; + }); + + if(restoreMenu != null) + { + e.Menu.ItemLinks.Remove(restoreMenu); + } + } if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderInZeiterfassungUebernehmen)) { BarItemLinkBase menuItem = null; - + foreach(var item in e.Menu.ItemLinks) { if(item.GetType() == typeof(BarButtonItemLink)) @@ -1249,55 +1379,56 @@ namespace BeWo.Scheduler.View } - if (Scheduler.SelectedAppointments.Count > 0) - { - var zusageButton = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink) f).BarItemName.Equals("ZusagenButtonItem")); - var mitVorbehaltButton = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink) f).BarItemName.Equals("MitVorbehaltButtonItem")); - var absageButton = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink) f).BarItemName.Equals("AbsagenButtonItem")); - var seperatorTop = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarItemLinkSeparator) && ((BarItemLinkSeparator) f).BarItemName.Equals("ZusagenStackSeperatorTop")); - var seperatorBottom = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarItemLinkSeparator) && ((BarItemLinkSeparator) f).BarItemName.Equals("ZusagenStackSeperatorBottom")); + if(Scheduler.SelectedAppointments.Count > 0) + { + var zusageButton = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink) f).BarItemName.Equals("ZusagenButtonItem")); + var mitVorbehaltButton = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink) f).BarItemName.Equals("MitVorbehaltButtonItem")); + var absageButton = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink) f).BarItemName.Equals("AbsagenButtonItem")); + var seperatorTop = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarItemLinkSeparator) && ((BarItemLinkSeparator) f).BarItemName.Equals("ZusagenStackSeperatorTop")); + var seperatorBottom = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarItemLinkSeparator) && ((BarItemLinkSeparator) f).BarItemName.Equals("ZusagenStackSeperatorBottom")); - if(!Scheduler.SelectedAppointments[0].CF_IsTask() && Scheduler.SelectedAppointments[0].CF_EmployeeList().Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) - { - return; - } + if(!Scheduler.SelectedAppointments[0].CF_IsTask() && Scheduler.SelectedAppointments[0].CF_EmployeeList().Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) + { + return; + } - if(seperatorTop != null) - { - e.Menu.ItemLinks.Remove(seperatorTop); - } + if(seperatorTop != null) + { + e.Menu.ItemLinks.Remove(seperatorTop); + } if(seperatorBottom != null) { e.Menu.ItemLinks.Remove(seperatorBottom); } - if (zusageButton != null) - { - e.Menu.ItemLinks.Remove(zusageButton); - } + if(zusageButton != null) + { + e.Menu.ItemLinks.Remove(zusageButton); + } - if (mitVorbehaltButton != null) - { - e.Menu.ItemLinks.Remove(mitVorbehaltButton); - } + if(mitVorbehaltButton != null) + { + e.Menu.ItemLinks.Remove(mitVorbehaltButton); + } - if (absageButton != null) - { - e.Menu.ItemLinks.Remove(absageButton); - } + if(absageButton != null) + { + e.Menu.ItemLinks.Remove(absageButton); + } } } - private bool _IsNew; - private void Scheduler_InitNewAppointment(object sender, AppointmentEventArgs e) - { - _IsNew = true; - ViewModel.InitNewAppointment(e.Appointment); - } + private bool _IsNew; - private void Scheduler_AppointmentViewInfoCustomizing(object sender, AppointmentViewInfoCustomizingEventArgs e) - { + private void Scheduler_InitNewAppointment(object sender, AppointmentEventArgs e) + { + _IsNew = true; + ViewModel.InitNewAppointment(e.Appointment); + } + + private void Scheduler_AppointmentViewInfoCustomizing(object sender, AppointmentViewInfoCustomizingEventArgs e) + { var cf = e.ViewInfo.Appointment.CustomFields; if(cf[nameof(CustomFieldStorage)] == null) @@ -1308,14 +1439,14 @@ namespace BeWo.Scheduler.View cf.BeginUpdate(); e.ViewInfo.CustomViewInfo = cf; - + cf.EndUpdate(); } - private void AllowAppointmentAenderung(object sender, AppointmentOperationEventArgs e) - { + private void AllowAppointmentAenderung(object sender, AppointmentOperationEventArgs e) + { var darfTerminDetailsSehen = true; - var appointment = e.Appointment; + var appointment = e.Appointment; if(appointment.GetCustomFieldStorage() == null) { @@ -1324,153 +1455,153 @@ namespace BeWo.Scheduler.View } if(appointment.CF_IsAbsenceTime()) - { - e.Allow = false; - return; - } + { + e.Allow = false; + return; + } - var ersteller = appointment.CF_Originator(); - var mitarbeiterliste = appointment.CF_EmployeeList(); - var istErsteller = ersteller?.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ?? false; - - if(!istErsteller && appointment.CF_IsPrivate() && !mitarbeiterliste.Any(a => Equals(a.Employee, BeWoApp.CompactLoggedOnEmployee))) - { - darfTerminDetailsSehen = false; - } + var ersteller = appointment.CF_Originator(); + var mitarbeiterliste = appointment.CF_EmployeeList(); + var istErsteller = ersteller?.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ?? false; - e.Allow = darfTerminDetailsSehen; - } + if(!istErsteller && appointment.CF_IsPrivate() && !mitarbeiterliste.Any(a => Equals(a.Employee, BeWoApp.CompactLoggedOnEmployee))) + { + darfTerminDetailsSehen = false; + } - private void AllowAppointmentCreateEvent(object sender, AppointmentOperationEventArgs e) - { + e.Allow = darfTerminDetailsSehen; + } + + private void AllowAppointmentCreateEvent(object sender, AppointmentOperationEventArgs e) + { var darfAnlegen = (BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAnlegen) || BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnlegen)); - e.Allow = darfAnlegen; - } + e.Allow = darfAnlegen; + } - private void UpdateOptionPanel() - { - switch (ViewTypeConvert.ToAppointmentViewType(_CurrentViewType)) - { - case AppointmentViewType.Day: - TimelineViewOptions.Visibility = Visibility.Collapsed; - DayViewOptions.Visibility = Visibility.Visible; - SpinEditDayViewDayCount.Value = Scheduler.DayView.DayCount; - _TimelineDayCount = 0; - break; - case AppointmentViewType.Timeline: - TimelineViewOptions.Visibility = Visibility.Visible; - DayViewOptions.Visibility = Visibility.Collapsed; - SpinEditTimelineViewDayCount.Value = _TimelineDayCount == 0 ? Scheduler.TimelineView.IntervalCount : _TimelineDayCount; - break; - default: - _TimelineDayCount = 0; - TimelineViewOptions.Visibility = Visibility.Collapsed; - DayViewOptions.Visibility = Visibility.Collapsed; - break; - } + private void UpdateOptionPanel() + { + switch(ViewTypeConvert.ToAppointmentViewType(_CurrentViewType)) + { + case AppointmentViewType.Day: + TimelineViewOptions.Visibility = Visibility.Collapsed; + DayViewOptions.Visibility = Visibility.Visible; + SpinEditDayViewDayCount.Value = Scheduler.DayView.DayCount; + _TimelineDayCount = 0; + break; + case AppointmentViewType.Timeline: + TimelineViewOptions.Visibility = Visibility.Visible; + DayViewOptions.Visibility = Visibility.Collapsed; + SpinEditTimelineViewDayCount.Value = _TimelineDayCount == 0 ? Scheduler.TimelineView.IntervalCount : _TimelineDayCount; + break; + default: + _TimelineDayCount = 0; + TimelineViewOptions.Visibility = Visibility.Collapsed; + DayViewOptions.Visibility = Visibility.Collapsed; + break; + } - Scheduler.WeekView.AppointmentDisplayOptions.AppointmentAutoHeight = true; - Scheduler.MonthView.AppointmentDisplayOptions.AppointmentAutoHeight = true; - Scheduler.TimelineView.AppointmentDisplayOptions.AppointmentAutoHeight = true; - } + Scheduler.WeekView.AppointmentDisplayOptions.AppointmentAutoHeight = true; + Scheduler.MonthView.AppointmentDisplayOptions.AppointmentAutoHeight = true; + Scheduler.TimelineView.AppointmentDisplayOptions.AppointmentAutoHeight = true; + } - private void ShowPrivateAppointmentsCheckBox_OnClick(object sender, RoutedEventArgs e) - { + private void ShowPrivateAppointmentsCheckBox_OnClick(object sender, RoutedEventArgs e) + { ReloadVM(true); - } + } - private void LeftExpanderClick(object sender, RoutedEventArgs e) - { - if (!LeftExpanderButton.IsChecked.HasValue) - { - return; - } + private void LeftExpanderClick(object sender, RoutedEventArgs e) + { + if(!LeftExpanderButton.IsChecked.HasValue) + { + return; + } AuswahlGrid.Visibility = ZeigeNurMeineTermineCheckBox.Visibility = LeftExpanderButton.IsChecked.Value ? Visibility.Collapsed : Visibility.Visible; - } + } - private void RightExpanderClick(object sender, RoutedEventArgs e) - { - if (!RightExpanderButton.IsChecked.HasValue) - { - return; - } + private void RightExpanderClick(object sender, RoutedEventArgs e) + { + if(!RightExpanderButton.IsChecked.HasValue) + { + return; + } - DateNavigator.Visibility = RightExpanderButton.IsChecked.Value ? Visibility.Collapsed : Visibility.Visible; - } + DateNavigator.Visibility = RightExpanderButton.IsChecked.Value ? Visibility.Collapsed : Visibility.Visible; + } - private void NurEigeneKlientenAnzeigen(object sender, RoutedEventArgs e) - { + private void NurEigeneKlientenAnzeigen(object sender, RoutedEventArgs e) + { //!BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) && BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) ? AllCustomers : - var relatedCustomerOids = BeWoApp.LoggedOnEmployee.RelatedCustomers.Select(s => s.Customer.CustomerOid); + var relatedCustomerOids = BeWoApp.LoggedOnEmployee.RelatedCustomers.Select(s => s.Customer.CustomerOid); - if (NurMeineKlientenCB.IsChecked.HasValue && NurMeineKlientenCB.IsChecked.Value) - { + if(NurMeineKlientenCB.IsChecked.HasValue && NurMeineKlientenCB.IsChecked.Value) + { GefilterteKlienten = AllCustomers.Where(ac => relatedCustomerOids.Contains(ac.CustomerOid)).ToList(); - } - else if (NurMeineKlientenCB.IsChecked.HasValue && !NurMeineKlientenCB.IsChecked.Value) - { - GefilterteKlienten = AllCustomers; - } - } + } + else if(NurMeineKlientenCB.IsChecked.HasValue && !NurMeineKlientenCB.IsChecked.Value) + { + GefilterteKlienten = AllCustomers; + } + } - private void TextBoxEmployees_OnTextChanged(object sender, TextChangedEventArgs e) - { - var suchtext = ((TextBox)sender).Text; - - GefilterteMitarbeiter = AllEmployees.Where(m => m.FirstName.ToLower().Contains(suchtext.ToLower()) || m.LastName.ToLower().Contains(suchtext.ToLower())).ToList(); - } + private void TextBoxEmployees_OnTextChanged(object sender, TextChangedEventArgs e) + { + var suchtext = ((TextBox) sender).Text; - private void TextBoxCustomers_OnTextChanged(object sender, TextChangedEventArgs e) - { - var suchtext = ((TextBox)sender).Text; + GefilterteMitarbeiter = AllEmployees.Where(m => m.FirstName.ToLower().Contains(suchtext.ToLower()) || m.LastName.ToLower().Contains(suchtext.ToLower())).ToList(); + } - GefilterteKlienten = AllCustomers.Where(m => m.FullName.ToLower().Contains(suchtext.ToLower())).ToList(); - } + private void TextBoxCustomers_OnTextChanged(object sender, TextChangedEventArgs e) + { + var suchtext = ((TextBox) sender).Text; - private void FensterOeffnen() - { - var neueListe = new SchedulerAppointmentListVM(_Liste, AllCustomers, AllEmployees, Category2ResourcesDictionary); + GefilterteKlienten = AllCustomers.Where(m => m.FullName.ToLower().Contains(suchtext.ToLower())).ToList(); + } - var vm = neueListe; + private void FensterOeffnen() + { + var neueListe = new SchedulerAppointmentListVM(_Liste, AllCustomers, AllEmployees, Category2ResourcesDictionary); - var zuBestaetigen = vm.Appointments.Where(app => - { - var customFieldStorage = (CustomFieldStorage) app.CustomFields[nameof(CustomFieldStorage)]; - - var originator = customFieldStorage.Originator; + var vm = neueListe; - if(customFieldStorage.EmployeeList == null || originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) - { - return false; - } + var zuBestaetigen = vm.Appointments.Where(app => + { + var customFieldStorage = (CustomFieldStorage) app.CustomFields[nameof(CustomFieldStorage)]; - var empList = customFieldStorage.EmployeeList; + var originator = customFieldStorage.Originator; + + if(customFieldStorage.EmployeeList == null || originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value) + { + return false; + } + + var empList = customFieldStorage.EmployeeList; return empList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && a.ParticipationAnswer == ParticipationAnswer.Offen); - }).ToList(); + }).ToList(); - var updates = vm.Appointments.Where(app => - { - var customFieldStorage = (CustomFieldStorage)app.CustomFields[nameof(CustomFieldStorage)]; + var updates = vm.Appointments.Where(app => + { + var customFieldStorage = (CustomFieldStorage) app.CustomFields[nameof(CustomFieldStorage)]; if(customFieldStorage.Originator == null || customFieldStorage.EmployeeList == null) - { - return false; - } + { + return false; + } - var empList = customFieldStorage.EmployeeList; - var or = customFieldStorage.Originator; + var empList = customFieldStorage.EmployeeList; + var or = customFieldStorage.Originator; return or.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && empList.Any(a => a.IsPChanged && a.ParticipationAnswer != ParticipationAnswer.Offen && a.ParticipationAnswer != ParticipationAnswer.Verstrichen && !a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)); - }).ToList(); + }).ToList(); - if(!zuBestaetigen.Any() && !updates.Any()) - { - return; - } + if(!zuBestaetigen.Any() && !updates.Any()) + { + return; + } var requestAnswerView = new RequestAnswerView(zuBestaetigen, updates); @@ -1479,77 +1610,77 @@ namespace BeWo.Scheduler.View requestAnswerView.ParticipationChanged += UpdateBeiParticipationChanged; requestAnswerView.Show(); - } + } - private void RequestAnswerViewClosedEvent(object sender, EventArgs e) - { - ReloadVM(true); - UpdateRequestString(); - } + private void RequestAnswerViewClosedEvent(object sender, EventArgs e) + { + ReloadVM(true); + UpdateRequestString(); + } - public void ShowAppointmentRequests(object sender, RequestNavigateEventArgs e) - { - FensterOeffnen(); - } + public void ShowAppointmentRequests(object sender, RequestNavigateEventArgs e) + { + FensterOeffnen(); + } - private void UpdateBeiParticipationChanged(object sender, EventArgs e) - { - ReloadVM(true); - } + private void UpdateBeiParticipationChanged(object sender, EventArgs e) + { + ReloadVM(true); + } - private void UpdateRequestStringEvent(object sender, EventArgs e) - { - UpdateRequestString(); - } + private void UpdateRequestStringEvent(object sender, EventArgs e) + { + UpdateRequestString(); + } - private void AuswahlAufhebenClick(object sender, RoutedEventArgs e) - { - SelectedResources.Clear(); - SelectedEmployees.Clear(); - SelectedCustomers.Clear(); + private void AuswahlAufhebenClick(object sender, RoutedEventArgs e) + { + SelectedResources.Clear(); + SelectedEmployees.Clear(); + SelectedCustomers.Clear(); - AlleMitarbeiterCB.IsChecked = false; - AlleKlientenCB.IsChecked = false; - AlleRessourcenCB.IsChecked = false; + AlleMitarbeiterCB.IsChecked = false; + AlleKlientenCB.IsChecked = false; + AlleRessourcenCB.IsChecked = false; - OnPropertyChanged(nameof(SelectedCustomers)); - OnPropertyChanged(nameof(SelectedEmployees)); - OnPropertyChanged(nameof(SelectedResources)); + OnPropertyChanged(nameof(SelectedCustomers)); + OnPropertyChanged(nameof(SelectedEmployees)); + OnPropertyChanged(nameof(SelectedResources)); OnPropertyChanged(nameof(SelectedItems)); - } + } - private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) - { - var tabControl = (TabControl)sender; - var selectedItem = (TabItem)tabControl.SelectedItem; + private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + var tabControl = (TabControl) sender; + var selectedItem = (TabItem) tabControl.SelectedItem; - var mitarbeiterPinsel = new LinearGradientBrush(new GradientStopCollection { new GradientStop(Color.FromRgb(69, 153, 59), 0), new GradientStop(Color.FromRgb(32, 92, 25), 1) }, new Point(0.5, 0), new Point(0.5, 1)); - var klientenPinsel = new LinearGradientBrush(new GradientStopCollection { new GradientStop(Color.FromRgb(59, 119, 153), 0), new GradientStop(Color.FromRgb(25, 72, 92), 1) }, new Point(0.5, 0), new Point(0.5, 1)); - var ressourcenPinsel = new LinearGradientBrush(new GradientStopCollection { new GradientStop(Color.FromRgb(4, 180, 208), 0), new GradientStop(Color.FromRgb(3, 129, 149), 1) }, new Point(0.5, 0), new Point(0.5, 1)); + var mitarbeiterPinsel = new LinearGradientBrush(new GradientStopCollection {new GradientStop(Color.FromRgb(69, 153, 59), 0), new GradientStop(Color.FromRgb(32, 92, 25), 1)}, new Point(0.5, 0), new Point(0.5, 1)); + var klientenPinsel = new LinearGradientBrush(new GradientStopCollection {new GradientStop(Color.FromRgb(59, 119, 153), 0), new GradientStop(Color.FromRgb(25, 72, 92), 1)}, new Point(0.5, 0), new Point(0.5, 1)); + var ressourcenPinsel = new LinearGradientBrush(new GradientStopCollection {new GradientStop(Color.FromRgb(4, 180, 208), 0), new GradientStop(Color.FromRgb(3, 129, 149), 1)}, new Point(0.5, 0), new Point(0.5, 1)); - var h = selectedItem.Header.ToString(); + var h = selectedItem.Header.ToString(); - if (h == Translator.Translate("Mitarbeiter")) - { - tabControl.Background = mitarbeiterPinsel; - tabControl.BorderBrush = mitarbeiterPinsel; - } - else if (h == Translator.Translate("Klienten")) - { - tabControl.Background = klientenPinsel; - tabControl.BorderBrush = klientenPinsel; - } - else - { - tabControl.Background = ressourcenPinsel; - tabControl.BorderBrush = ressourcenPinsel; - } - } + if(h == Translator.Translate("Mitarbeiter")) + { + tabControl.Background = mitarbeiterPinsel; + tabControl.BorderBrush = mitarbeiterPinsel; + } + else if(h == Translator.Translate("Klienten")) + { + tabControl.Background = klientenPinsel; + tabControl.BorderBrush = klientenPinsel; + } + else + { + tabControl.Background = ressourcenPinsel; + tabControl.BorderBrush = ressourcenPinsel; + } + } - private void ReloadButton_OnClick(object sender, RoutedEventArgs e) - { - ReloadVM(true); - } + private void ReloadButton_OnClick(object sender, RoutedEventArgs e) + { + ReloadVM(true); + } //private void ExportButton_OnClick(object sender, RoutedEventArgs e) //{ @@ -1570,58 +1701,58 @@ namespace BeWo.Scheduler.View //} private void ZusagenButtonItem_OnItemClick(object sender, ItemClickEventArgs e) - { - if (Scheduler.SelectedAppointments.Count <= 0) - { - return; - } + { + if(Scheduler.SelectedAppointments.Count <= 0) + { + return; + } - ZusageAendern(ParticipationAnswer.Zusage, Scheduler.SelectedAppointments[0]); - } + ZusageAendern(ParticipationAnswer.Zusage, Scheduler.SelectedAppointments[0]); + } - private void MitVorbehaltButtonItem_OnItemClick(object sender, ItemClickEventArgs e) - { - if (Scheduler.SelectedAppointments.Count <= 0) - { - return; - } + private void MitVorbehaltButtonItem_OnItemClick(object sender, ItemClickEventArgs e) + { + if(Scheduler.SelectedAppointments.Count <= 0) + { + return; + } - ZusageAendern(ParticipationAnswer.Vorbehalt, Scheduler.SelectedAppointments[0]); - } + ZusageAendern(ParticipationAnswer.Vorbehalt, Scheduler.SelectedAppointments[0]); + } - private void AbsagenButtonItem_OnItemClick(object sender, ItemClickEventArgs e) - { - if (Scheduler.SelectedAppointments.Count <= 0) - { - return; - } + private void AbsagenButtonItem_OnItemClick(object sender, ItemClickEventArgs e) + { + if(Scheduler.SelectedAppointments.Count <= 0) + { + return; + } - ZusageAendern(ParticipationAnswer.Absage, Scheduler.SelectedAppointments[0]); - } + ZusageAendern(ParticipationAnswer.Absage, Scheduler.SelectedAppointments[0]); + } - private void ZusageAendern(ParticipationAnswer antwort, Appointment sa) - { - var el = sa.CF_EmployeeList(); - var neu = new ObservableCollection(el.DoForEach(dfe => - { - if(!dfe.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) - { - return; - } + private void ZusageAendern(ParticipationAnswer antwort, Appointment sa) + { + var el = sa.CF_EmployeeList(); + var neu = new ObservableCollection(el.DoForEach(dfe => + { + if(!dfe.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) + { + return; + } - dfe.ParticipationAnswer = antwort; - dfe.IsPC_CheckedTs = null; - }).ToList()); - sa.CF_EmployeeList(neu); + dfe.ParticipationAnswer = antwort; + dfe.IsPC_CheckedTs = null; + }).ToList()); + sa.CF_EmployeeList(neu); - var appointment = (SchedulerAppointmentVM) sa.GetSourceObject(Scheduler.GetCoreStorage()); - - ServiceFacade.DoResourceServiceAsync(s => s.UpdateSchedulerAppointments(new List{ appointment.CommitToDataContract() }), delegate { this.Dispatch(() => {ReloadVM(true);}); }); - } + var appointment = (SchedulerAppointmentVM) sa.GetSourceObject(Scheduler.GetCoreStorage()); + + ServiceFacade.DoResourceServiceAsync(s => s.UpdateSchedulerAppointments(new List {appointment.CommitToDataContract()}), delegate { this.Dispatch(() => { ReloadVM(true); }); }); + } private void ZeiterfassungButtonItem_OnItemClick(object sender, ItemClickEventArgs e) { - if (Scheduler.SelectedAppointments.Count <= 0) + if(Scheduler.SelectedAppointments.Count <= 0) { return; } @@ -1635,7 +1766,7 @@ namespace BeWo.Scheduler.View var employee2SchedulerAppointmentList = appointment.CF_EmployeeList(); var customerList = appointment.CF_CustomerList(); - + var employeeList = employee2SchedulerAppointmentList.Select(employee2SchedulerAppointment => employee2SchedulerAppointment.Employee).ToList(); BeWoUtils.CreateZeiterfassung(appointment.Start, appointment.End, customerList, employeeList, appointment.Subject, appointment, () => @@ -1691,56 +1822,56 @@ namespace BeWo.Scheduler.View { IgnoreManualAppointmentCreation = false; IgnoreChangeEvents = false; - } + } }); } - private bool IgnoreManualAppointmentCreation { get; set; } + private bool IgnoreManualAppointmentCreation { get; set; } private void MeinTB_OnChecked(object sender, RoutedEventArgs e) - { - var tb = (ToggleButton) sender; + { + var tb = (ToggleButton) sender; - if (tb?.IsChecked == null) - { - return; - } + if(tb?.IsChecked == null) + { + return; + } - if (!tb.IsChecked.Value) - { - MitarbeiterSuchGrid.Visibility = Visibility.Collapsed; - MitarbeiterSuchTextBox.Clear(); - } - else - { - MitarbeiterSuchGrid.Visibility = Visibility.Visible; - MitarbeiterSuchTextBox.Focus(); - } - } + if(!tb.IsChecked.Value) + { + MitarbeiterSuchGrid.Visibility = Visibility.Collapsed; + MitarbeiterSuchTextBox.Clear(); + } + else + { + MitarbeiterSuchGrid.Visibility = Visibility.Visible; + MitarbeiterSuchTextBox.Focus(); + } + } - private void MeinTB2_OnChecked(object sender, RoutedEventArgs e) - { - var tb = (ToggleButton)sender; + private void MeinTB2_OnChecked(object sender, RoutedEventArgs e) + { + var tb = (ToggleButton) sender; - if (tb?.IsChecked == null) - { - return; - } + if(tb?.IsChecked == null) + { + return; + } - if (!tb.IsChecked.Value) - { - KlientenSuchGrid.Visibility = Visibility.Collapsed; - KlientenSuchTextBox.Clear(); - } - else - { - KlientenSuchGrid.Visibility = Visibility.Visible; - KlientenSuchTextBox.Focus(); - } - } + if(!tb.IsChecked.Value) + { + KlientenSuchGrid.Visibility = Visibility.Collapsed; + KlientenSuchTextBox.Clear(); + } + else + { + KlientenSuchGrid.Visibility = Visibility.Visible; + KlientenSuchTextBox.Focus(); + } + } - private void SchedulerStorage_OnFetchAppointments(object sender, FetchAppointmentsEventArgs e) - { + private void SchedulerStorage_OnFetchAppointments(object sender, FetchAppointmentsEventArgs e) + { if(_LastFetchingDateTime != null && _LastFetchingDateTime.Value < DateTime.Now.AddMilliseconds(-500d)) { return; @@ -1751,60 +1882,62 @@ namespace BeWo.Scheduler.View ReloadVM(); } - private bool _ReloadingViewModel; + private bool _ReloadingViewModel; private DateTime? _LastFetchingDateTime; private void ReloadVM(bool shouldForceReload = false) { - if (_ReloadingViewModel) + if(_ReloadingViewModel) { return; } _ReloadingViewModel = true; - if (ViewModel == null) - { - _ReloadingViewModel = false; + if(ViewModel == null) + { + _ReloadingViewModel = false; return; - } + } var range = Scheduler.ActiveView.GetVisibleIntervals(); - var start = range.Start; - var end = range.End; + var start = range.Start; + var end = range.End; var newFetchingInterval = new TimeInterval(start - FetchPadding, end + FetchPadding); - var selectedEmployeeOids = SelectedEmployees.Select(s => s.EmployeeOid).ToList(); - var selectedCustomerOids = SelectedCustomers.Select(s => s.CustomerOid).ToList(); - var selectedResourceOids = SelectedResources.Where(w => w.ResourceOid.HasValue).Select(s => s.ResourceOid.Value).ToList(); - var employeesOnly = MitarbeiterEbenenCheckBox.IsChecked != null && MitarbeiterEbenenCheckBox.IsChecked.Value; - var customersOnly = KlientenEbenenCheckBox.IsChecked != null && KlientenEbenenCheckBox.IsChecked.Value; - var resourcesOnly = RessourcenEbenenCheckBox.IsChecked != null && RessourcenEbenenCheckBox.IsChecked.Value; - var onlyPrivateAppointments = ShowPrivateAppointmentsCheckBox.IsChecked != null && ShowPrivateAppointmentsCheckBox.IsChecked.Value; - var showOnlyMyAppointments = ZeigeNurMeineTermine; - var showAbsenceTimes = AbwesenheitenEinAusCheckBox.IsChecked != null && AbwesenheitenEinAusCheckBox.IsChecked.Value; + var selectedEmployeeOids = SelectedEmployees.Select(s => s.EmployeeOid).ToList(); + var selectedCustomerOids = SelectedCustomers.Select(s => s.CustomerOid).ToList(); + var selectedResourceOids = SelectedResources.Where(w => w.ResourceOid.HasValue).Select(s => s.ResourceOid.Value).ToList(); + var employeesOnly = MitarbeiterEbenenCheckBox.IsChecked != null && MitarbeiterEbenenCheckBox.IsChecked.Value; + var customersOnly = KlientenEbenenCheckBox.IsChecked != null && KlientenEbenenCheckBox.IsChecked.Value; + var resourcesOnly = RessourcenEbenenCheckBox.IsChecked != null && RessourcenEbenenCheckBox.IsChecked.Value; + var onlyPrivateAppointments = ShowPrivateAppointmentsCheckBox.IsChecked != null && ShowPrivateAppointmentsCheckBox.IsChecked.Value; + var showOnlyMyAppointments = ZeigeNurMeineTermine; + var showAbsenceTimes = AbwesenheitenEinAusCheckBox.IsChecked != null && AbwesenheitenEinAusCheckBox.IsChecked.Value; if(!shouldForceReload && newFetchingInterval.Equals(_LastFetchedInterval)) - { - _ReloadingViewModel = false; - return; - } + { + _ReloadingViewModel = false; + return; + } _LastFetchedInterval = newFetchingInterval; - - ReloadAppointmentViewModel(start, end, selectedEmployeeOids, selectedCustomerOids, selectedResourceOids, employeesOnly, customersOnly, resourcesOnly, onlyPrivateAppointments, showOnlyMyAppointments, showAbsenceTimes); + + ReloadAppointmentViewModel(start, end, selectedEmployeeOids, selectedCustomerOids, selectedResourceOids, employeesOnly, customersOnly, resourcesOnly, onlyPrivateAppointments, showOnlyMyAppointments, showAbsenceTimes); } public void ReloadAppointmentViewModel(DateTime pIntervalStart, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomer, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, bool pShouldShowAbsenceTimes) { + ResetDeletionMode(); + if (!BeWoApp.LoggedOnEmployee.EmployeeOid.HasValue) { return; } - + var start = pIntervalStart - FetchPadding; - var end = pIntervalEnd + FetchPadding; + var end = pIntervalEnd + FetchPadding; var service = Scheduler.GetService(); @@ -1812,98 +1945,96 @@ namespace BeWo.Scheduler.View { if(service.IsDataRefreshAllowed) { - GetCacheObjects((c, e, r) => - { - ServiceFacade.DoResourceServiceAsync(s2 => s2.LoadFilteredAppointmentsMitAufgaben(BeWoApp.HasLoggedOnUserRight(new[] { UserRightType.KalenderMitarbeitertermineAnsehen }), BeWoApp.LoggedOnEmployee.EmployeeOid.Value, start, end, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, IsTasksVisible), - appointments => - { - ServiceFacade.DoResourceServiceAsync(s3 => s3.GetAllActiveAbsenceTimesInInterval(start, end, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)), - absenceTimes => - { - this.Dispatch(() => - { - var prefilteredAppointments = appointments.Where(w => (w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) || - w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) || - BeWoUtils.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || w.EmployeeList == null || w.EmployeeList.Count == 0)).ToList(); + GetCacheObjects((c, e, r) => + { + ServiceFacade.DoResourceServiceAsync(s2 => s2.LoadFilteredAppointmentsMitAufgaben(BeWoApp.HasLoggedOnUserRight(new[] {UserRightType.KalenderMitarbeitertermineAnsehen}), BeWoApp.LoggedOnEmployee.EmployeeOid.Value, start, end, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, IsTasksVisible), + appointments => + { + ServiceFacade.DoResourceServiceAsync(s3 => s3.GetAllActiveAbsenceTimesInInterval(start, end, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)), + absenceTimes => + { + this.Dispatch(() => + { + var prefilteredAppointments = appointments.Where(w => (w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) || + w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) || + BeWoUtils.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || w.EmployeeList == null || w.EmployeeList.Count == 0)).ToList(); - if(!IsTasksVisible) - { - prefilteredAppointments = prefilteredAppointments.Where(app => !app.IsTask).ToList(); - } + if(!IsTasksVisible) + { + prefilteredAppointments = prefilteredAppointments.Where(app => !app.IsTask).ToList(); + } - var vm = new SchedulerAppointmentListVM(prefilteredAppointments, c, e, r); - if(pShouldShowAbsenceTimes) - { - vm.Appointments.AddRange(ViewModel.ConvertAbsenceTimesToAppointments(absenceTimes.Where(w => - { - return SelectedEmployees.Count == 0 || SelectedEmployees.Any(a => a.EmployeeOid == w.EmployeeOid); - }), end, e)); - } + var vm = new SchedulerAppointmentListVM(prefilteredAppointments, c, e, r); + if(pShouldShowAbsenceTimes) + { + vm.Appointments.AddRange(ViewModel.ConvertAbsenceTimesToAppointments(absenceTimes.Where(w => { return SelectedEmployees.Count == 0 || SelectedEmployees.Any(a => a.EmployeeOid == w.EmployeeOid); }), end, e)); + } - ViewModel.ActiveAppointmentViewModel = vm; + ViewModel.ActiveAppointmentViewModel = vm; - ViewModel.SchedulerSettings = ViewModel.GetActiveSettings(); - ViewModel.SchedulerSettings.StartDate = pIntervalStart; + ViewModel.SchedulerSettings = ViewModel.GetActiveSettings(); + ViewModel.SchedulerSettings.StartDate = pIntervalStart; - GefilterteMitarbeiter = ViewModel.ActiveAppointmentViewModel.AllEmployees; - AllEmployees = ViewModel.ActiveAppointmentViewModel.AllEmployees; - GefilterteKlienten = ViewModel.ActiveAppointmentViewModel.AllCustomers; - AllCustomers = ViewModel.ActiveAppointmentViewModel.AllCustomers; + GefilterteMitarbeiter = ViewModel.ActiveAppointmentViewModel.AllEmployees; + AllEmployees = ViewModel.ActiveAppointmentViewModel.AllEmployees; + GefilterteKlienten = ViewModel.ActiveAppointmentViewModel.AllCustomers; + AllCustomers = ViewModel.ActiveAppointmentViewModel.AllCustomers; - Category2ResourcesDictionary = ViewModel.ActiveAppointmentViewModel.Categories2Resources; + Category2ResourcesDictionary = ViewModel.ActiveAppointmentViewModel.Categories2Resources; - SelectedEmployees = AllEmployees.Where(w => SelectedEmployees.Any(a => a.EmployeeOid.Equals(w.EmployeeOid))).ToList(); - SelectedCustomers = AllCustomers.Where(w => SelectedCustomers.Any(a => a.CustomerOid.Equals(w.CustomerOid))).ToList(); - SelectedResources = AllResources.Where(w => SelectedResources.Any(a => a.ResourceOid.Equals(w.ResourceOid))).ToList(); + SelectedEmployees = AllEmployees.Where(w => SelectedEmployees.Any(a => a.EmployeeOid.Equals(w.EmployeeOid))).ToList(); + SelectedCustomers = AllCustomers.Where(w => SelectedCustomers.Any(a => a.CustomerOid.Equals(w.CustomerOid))).ToList(); + SelectedResources = AllResources.Where(w => SelectedResources.Any(a => a.ResourceOid.Equals(w.ResourceOid))).ToList(); - var items = SelectedItems; + var items = SelectedItems; - var testtesttest = ViewModel.ActiveAppointmentViewModel; + var testtesttest = ViewModel.ActiveAppointmentViewModel; - _ReloadingViewModel = false; + _ReloadingViewModel = false; - Scheduler.Storage.RefreshData(); - Scheduler.Storage.RefreshUI(); + // TODO: Hier tritt eine Exception auf, wenn man zu schnell löscht? + Scheduler.Storage.RefreshData(); + Scheduler.Storage.RefreshUI(); - if(_IsComingFromHomeDragPanel && _SelectedAppointmentFromHomePanelView != null) - { - var apps = Scheduler.ActiveView.GetAppointments().ToList(); + if(_IsComingFromHomeDragPanel && _SelectedAppointmentFromHomePanelView != null) + { + var apps = Scheduler.ActiveView.GetAppointments().ToList(); - var oid = _SelectedAppointmentFromHomePanelView.SchedulerAppointmentOid; - Appointment appointmentToOpen; + var oid = _SelectedAppointmentFromHomePanelView.SchedulerAppointmentOid; + Appointment appointmentToOpen; - if(oid != null) - { - appointmentToOpen = apps.Find(app => - { - var oidValue = app.CF_SchedulerAppointmentOid(); + if(oid != null) + { + appointmentToOpen = apps.Find(app => + { + var oidValue = app.CF_SchedulerAppointmentOid(); - return oidValue.HasValue && oidValue.Value == oid; - }); + return oidValue.HasValue && oidValue.Value == oid; + }); - if(appointmentToOpen != null) - { - Scheduler.ShowEditAppointmentForm(appointmentToOpen); - } - } - else if(_SelectedAppointmentFromHomePanelView.RecurrenceId != null && _SelectedAppointmentFromHomePanelView.RecurrenceIndex > 0) - { - appointmentToOpen = apps.Find(appointment => appointment.RecurrenceInfo.Id.ToString().Equals(_SelectedAppointmentFromHomePanelView.RecurrenceId)); + if(appointmentToOpen != null) + { + Scheduler.ShowEditAppointmentForm(appointmentToOpen); + } + } + else if(_SelectedAppointmentFromHomePanelView.RecurrenceId != null && _SelectedAppointmentFromHomePanelView.RecurrenceIndex > 0) + { + appointmentToOpen = apps.Find(appointment => appointment.RecurrenceInfo.Id.ToString().Equals(_SelectedAppointmentFromHomePanelView.RecurrenceId)); - if(appointmentToOpen != null) - { - Scheduler.ShowEditAppointmentForm(appointmentToOpen); - } - } + if(appointmentToOpen != null) + { + Scheduler.ShowEditAppointmentForm(appointmentToOpen); + } + } - _IsComingFromHomeDragPanel = false; - } - }); - }); - }); - }); - } + _IsComingFromHomeDragPanel = false; + } + }); + }); + }); + }); + } else { _ReloadingViewModel = false; @@ -1913,12 +2044,12 @@ namespace BeWo.Scheduler.View private void ExportButton_OnClick(object sender, RoutedEventArgs e) { - var dialog = new SaveFileDialog { Filter = "iCalendar files (*.ics)|*.ics", FilterIndex = 1 }; + var dialog = new SaveFileDialog {Filter = "iCalendar files (*.ics)|*.ics", FilterIndex = 1}; - if (dialog.ShowDialog() != true) + if(dialog.ShowDialog() != true) return; - using (var stream = dialog.OpenFile()) + using(var stream = dialog.OpenFile()) { ExportAppointmentsAs_iCal(stream); } @@ -1926,17 +2057,17 @@ namespace BeWo.Scheduler.View private void ExportAppointmentsAs_iCal(Stream stream) { - if (stream == null) + if(stream == null) return; try { var productIdentifier = string.Format("-//{0}//DXScheduler iCalendarExchange Example//DE", BeWoApp.Mandator); - var exporter = new iCalendarExporter(Scheduler.GetCoreStorage()) { ProductIdentifier = productIdentifier }; + var exporter = new iCalendarExporter(Scheduler.GetCoreStorage()) {ProductIdentifier = productIdentifier}; exporter.AppointmentExporting += OnAppointmentExporting; exporter.Export(stream); } - catch (Exception e) + catch(Exception e) { MessageBox.Show(string.Format("Der Kalender konnte leider nicht exportiert werden.\n{0}", e.Message), "Fehler beim Export", MessageBoxButton.OK, MessageBoxImage.Error); } @@ -1963,305 +2094,306 @@ namespace BeWo.Scheduler.View //} private void PrintCalendar(object sender, RequestNavigateEventArgs e) - { - if (Scheduler.ActiveView.GetAppointments().Count == 0) - { - MessageBox.Show("Das Drucken ist nicht möglich, da im ausgewählten Intervall keine Termine vorhanden sind.", - "Drucken nicht möglich", - MessageBoxButton.OK, - MessageBoxImage.Error); - return; - } - - var range = Scheduler.ActiveView.GetVisibleIntervals(); - var datesList = new List(); + { + if(Scheduler.ActiveView.GetAppointments().Count == 0) + { + MessageBox.Show("Das Drucken ist nicht möglich, da im ausgewählten Intervall keine Termine vorhanden sind.", + "Drucken nicht möglich", + MessageBoxButton.OK, + MessageBoxImage.Error); + return; + } - if (range.GetType() == typeof(WeekIntervalCollection)) - { - for (var i = 0; i < range.Duration.Days; i++) - { - datesList.Add(range.Start.AddDays(i)); - } - } - else - { - datesList.AddRange(range.Select(x => x.Start)); - } - - var apps = Scheduler.ActiveView.GetAppointments().Where(w => !w.CF_IsAbsenceTime()).ToList(); - var appointmentOidListe = apps.Where(w => !w.IsOccurrence && !w.IsRecurring || w.IsException).Select(app => Convert.ToInt64(((SchedulerAppointmentVM) app.GetSourceObject(Scheduler.GetCoreStorage())).Id)).Distinct().ToList(); - var serienTerminOids = apps.Where(w => w.IsRecurring || w.IsOccurrence).Select(app => Convert.ToInt64(((SchedulerAppointmentVM)app.RecurrencePattern.GetSourceObject(Scheduler.GetCoreStorage())).Id)).Distinct().ToList(); - var serienTermine = new List(); - var recurringAppointments = new List(); + var range = Scheduler.ActiveView.GetVisibleIntervals(); + var datesList = new List(); - foreach (var app in apps.Where(w => w.IsOccurrence || w.IsRecurring).Where(app => !recurringAppointments.Any(a => a.RecurrenceInfo.Id.Equals(app.RecurrenceInfo.Id)))) - { - recurringAppointments.Add(app); - } - - foreach (var serienTermin in recurringAppointments) - { - var basistermin = (SchedulerAppointmentVM) serienTermin.RecurrencePattern.GetSourceObject(Scheduler.GetCoreStorage()); - var info = serienTermin.RecurrenceInfo; - var ausnahmen = apps.Where(w => w.RecurrenceInfo != null && w.RecurrenceInfo.Id.Equals(info.Id) && w.IsException).ToList(); - var calc = OccurrenceCalculator.CreateInstance(info); - var ttc = new TimeInterval(range.Start, range.End + new TimeSpan(1, 0, 0)); - var kollektionOhneAusnahmen = calc.CalcOccurrences(ttc, serienTermin.RecurrencePattern).Where(w => w.RecurrenceIndex != 0 && !w.IsException).ToList(); - - if (ausnahmen.Any(appointment => appointment.IsException && appointment.RecurrenceIndex == 0) && basistermin.DataContract.SchedulerAppointmentOid != null) - { - serienTerminOids.Remove(basistermin.DataContract.SchedulerAppointmentOid.Value); - } + if(range.GetType() == typeof(WeekIntervalCollection)) + { + for(var i = 0; i < range.Duration.Days; i++) + { + datesList.Add(range.Start.AddDays(i)); + } + } + else + { + datesList.AddRange(range.Select(x => x.Start)); + } - if (ausnahmen.Count > 0) - { - kollektionOhneAusnahmen = kollektionOhneAusnahmen.Where(w => !ausnahmen.Select(s => s.RecurrenceIndex).Contains(w.RecurrenceIndex)).ToList(); - } + var apps = Scheduler.ActiveView.GetAppointments().Where(w => !w.CF_IsAbsenceTime()).ToList(); + var appointmentOidListe = apps.Where(w => !w.IsOccurrence && !w.IsRecurring || w.IsException).Select(app => Convert.ToInt64(((SchedulerAppointmentVM) app.GetSourceObject(Scheduler.GetCoreStorage())).Id)).Distinct().ToList(); + var serienTerminOids = apps.Where(w => w.IsRecurring || w.IsOccurrence).Select(app => Convert.ToInt64(((SchedulerAppointmentVM) app.RecurrencePattern.GetSourceObject(Scheduler.GetCoreStorage())).Id)).Distinct().ToList(); + var serienTermine = new List(); + var recurringAppointments = new List(); - serienTermine.AddRange(kollektionOhneAusnahmen.Select(z => new SchedulerAppointmentDC - { - AllDay = z.AllDay, CustomerList = basistermin.CustomerList, EmployeeList = basistermin.EmployeeList.ToList(), ResourceList = basistermin.ResourceList, StartDate = z.Start, EndDate = z.End, Description = z.Description, IsPrivate = basistermin.IsPrivate, Location = z.Location, Subject = z.Subject, LabelId = z.LabelId, Type = (int) z.Type, Originator = basistermin.Originator, RecurrenceInfo = z.RecurrenceInfo.ToXml() - })); - } - - appointmentOidListe.AddRange(serienTerminOids.Where(w => !appointmentOidListe.Contains(w))); + foreach(var app in apps.Where(w => w.IsOccurrence || w.IsRecurring).Where(app => !recurringAppointments.Any(a => a.RecurrenceInfo.Id.Equals(app.RecurrenceInfo.Id)))) + { + recurringAppointments.Add(app); + } + + foreach(var serienTermin in recurringAppointments) + { + var basistermin = (SchedulerAppointmentVM) serienTermin.RecurrencePattern.GetSourceObject(Scheduler.GetCoreStorage()); + var info = serienTermin.RecurrenceInfo; + var ausnahmen = apps.Where(w => w.RecurrenceInfo != null && w.RecurrenceInfo.Id.Equals(info.Id) && w.IsException).ToList(); + var calc = OccurrenceCalculator.CreateInstance(info); + var ttc = new TimeInterval(range.Start, range.End + new TimeSpan(1, 0, 0)); + var kollektionOhneAusnahmen = calc.CalcOccurrences(ttc, serienTermin.RecurrencePattern).Where(w => w.RecurrenceIndex != 0 && !w.IsException).ToList(); + + if(ausnahmen.Any(appointment => appointment.IsException && appointment.RecurrenceIndex == 0) && basistermin.DataContract.SchedulerAppointmentOid != null) + { + serienTerminOids.Remove(basistermin.DataContract.SchedulerAppointmentOid.Value); + } + + if(ausnahmen.Count > 0) + { + kollektionOhneAusnahmen = kollektionOhneAusnahmen.Where(w => !ausnahmen.Select(s => s.RecurrenceIndex).Contains(w.RecurrenceIndex)).ToList(); + } + + serienTermine.AddRange(kollektionOhneAusnahmen.Select(z => new SchedulerAppointmentDC + { + AllDay = z.AllDay, CustomerList = basistermin.CustomerList, EmployeeList = basistermin.EmployeeList.ToList(), ResourceList = basistermin.ResourceList, StartDate = z.Start, EndDate = z.End, Description = z.Description, IsPrivate = basistermin.IsPrivate, Location = z.Location, Subject = z.Subject, LabelId = z.LabelId, Type = (int) z.Type, Originator = basistermin.Originator, RecurrenceInfo = z.RecurrenceInfo.ToXml() + })); + } + + appointmentOidListe.AddRange(serienTerminOids.Where(w => !appointmentOidListe.Contains(w))); - var mehrTaegigeTermine = apps.Where(a => !a.SameDay && !(!a.SameDay && a.AllDay && a.Duration == new TimeSpan(1,0,0,0))).Select(s => ((SchedulerAppointmentVM)s.GetSourceObject(Scheduler.GetCoreStorage())).CommitToDataContract()).ToList(); - appointmentOidListe.RemoveRange(mehrTaegigeTermine.Select(s => s.SchedulerAppointmentOid.Value)); - var neueTermine = new List(); + var mehrTaegigeTermine = apps.Where(a => !a.SameDay && !(!a.SameDay && a.AllDay && a.Duration == new TimeSpan(1, 0, 0, 0))).Select(s => ((SchedulerAppointmentVM) s.GetSourceObject(Scheduler.GetCoreStorage())).CommitToDataContract()).ToList(); + appointmentOidListe.RemoveRange(mehrTaegigeTermine.Select(s => s.SchedulerAppointmentOid.Value)); + var neueTermine = new List(); - foreach (var termin in mehrTaegigeTermine) - { - var tage = termin.StartDate.Value.GetDayNumberBetweenTwoDates(termin.EndDate.Value); - if (tage > 31) - { - tage = 31; - } - if (termin.AllDay) - { - tage -= 1; - } + foreach(var termin in mehrTaegigeTermine) + { + var tage = termin.StartDate.Value.GetDayNumberBetweenTwoDates(termin.EndDate.Value); + if(tage > 31) + { + tage = 31; + } - if (tage > 0) - { - if (termin.AllDay) - { - for (var i = 0; i <= tage; i++) - { - neueTermine.Add(new SchedulerAppointmentDC - { - AllDay = termin.AllDay, - CustomerList = termin.CustomerList, - Description = termin.Description, - EmployeeList = termin.EmployeeList, - EndDate = new DateTime(termin.StartDate.Value.AddDays(i + 1).Year, termin.StartDate.Value.AddDays(i + 1).Month, termin.StartDate.Value.AddDays(i + 1).Day), - FormerBookingSequenceOid = termin.FormerBookingSequenceOid, - IsPrivate = termin.IsPrivate, - LabelId = termin.LabelId, - Location = termin.Location, - Originator = termin.Originator, - RecurrenceInfo = termin.RecurrenceInfo, - ReminderInfo = termin.ReminderInfo, - ResourceList = termin.ResourceList, - StartDate = new DateTime(termin.StartDate.Value.AddDays(i).Year, termin.StartDate.Value.AddDays(i).Month, termin.StartDate.Value.AddDays(i).Day), - Status = termin.Status, - Subject = termin.Subject, - Type = termin.Type - }); - } - } - else - { - for (var i = 0; i <= tage; i++) - { - if (i == 0) - { - neueTermine.Add(new SchedulerAppointmentDC - { - AllDay = false, - CustomerList = termin.CustomerList, - Description = termin.Description, - EmployeeList = termin.EmployeeList, - EndDate = new DateTime(termin.StartDate.Value.AddDays(1).Year, termin.StartDate.Value.AddDays(1).Month, termin.StartDate.Value.AddDays(1).Day), - FormerBookingSequenceOid = termin.FormerBookingSequenceOid, - IsPrivate = termin.IsPrivate, - LabelId = termin.LabelId, - Location = termin.Location, - Originator = termin.Originator, - RecurrenceInfo = termin.RecurrenceInfo, - ReminderInfo = termin.ReminderInfo, - ResourceList = termin.ResourceList, - StartDate = termin.StartDate, - Status = termin.Status, - Subject = termin.Subject, - Type = termin.Type - }); - } - else if (i == tage) - { - neueTermine.Add(new SchedulerAppointmentDC - { - AllDay = false, - CustomerList = termin.CustomerList, - Description = termin.Description, - EmployeeList = termin.EmployeeList, - EndDate = termin.EndDate, - FormerBookingSequenceOid = termin.FormerBookingSequenceOid, - IsPrivate = termin.IsPrivate, - LabelId = termin.LabelId, - Location = termin.Location, - Originator = termin.Originator, - RecurrenceInfo = termin.RecurrenceInfo, - ReminderInfo = termin.ReminderInfo, - ResourceList = termin.ResourceList, - StartDate = new DateTime(termin.EndDate.Value.Year, termin.EndDate.Value.Month, termin.EndDate.Value.Day), - Status = termin.Status, - Subject = termin.Subject, - Type = termin.Type - }); - } - else - { - neueTermine.Add(new SchedulerAppointmentDC - { - AllDay = true, - CustomerList = termin.CustomerList, - Description = termin.Description, - EmployeeList = termin.EmployeeList, - EndDate = new DateTime(termin.StartDate.Value.AddDays(i + 1).Year, termin.StartDate.Value.AddDays(i + 1).Month, termin.StartDate.Value.AddDays(i + 1).Day), - FormerBookingSequenceOid = termin.FormerBookingSequenceOid, - IsPrivate = termin.IsPrivate, - LabelId = termin.LabelId, - Location = termin.Location, - Originator = termin.Originator, - RecurrenceInfo = termin.RecurrenceInfo, - ReminderInfo = termin.ReminderInfo, - ResourceList = termin.ResourceList, - StartDate = new DateTime(termin.StartDate.Value.AddDays(i).Year, termin.StartDate.Value.AddDays(i).Month, termin.StartDate.Value.AddDays(i).Day), - Status = termin.Status, - Subject = termin.Subject, - Type = termin.Type - }); - } - } - } - } - } + if(termin.AllDay) + { + tage -= 1; + } - var variablenDictionary = new Dictionary - { - { "appointmentOidListe", appointmentOidListe }, - { "datesList", datesList }, - { "employeeOid", BeWoApp.LoggedOnEmployee.EmployeeOid }, - { "serienTermine", serienTermine }, - {"mehrtaegigeTermine", neueTermine} - }; + if(tage > 0) + { + if(termin.AllDay) + { + for(var i = 0; i <= tage; i++) + { + neueTermine.Add(new SchedulerAppointmentDC + { + AllDay = termin.AllDay, + CustomerList = termin.CustomerList, + Description = termin.Description, + EmployeeList = termin.EmployeeList, + EndDate = new DateTime(termin.StartDate.Value.AddDays(i + 1).Year, termin.StartDate.Value.AddDays(i + 1).Month, termin.StartDate.Value.AddDays(i + 1).Day), + FormerBookingSequenceOid = termin.FormerBookingSequenceOid, + IsPrivate = termin.IsPrivate, + LabelId = termin.LabelId, + Location = termin.Location, + Originator = termin.Originator, + RecurrenceInfo = termin.RecurrenceInfo, + ReminderInfo = termin.ReminderInfo, + ResourceList = termin.ResourceList, + StartDate = new DateTime(termin.StartDate.Value.AddDays(i).Year, termin.StartDate.Value.AddDays(i).Month, termin.StartDate.Value.AddDays(i).Day), + Status = termin.Status, + Subject = termin.Subject, + Type = termin.Type + }); + } + } + else + { + for(var i = 0; i <= tage; i++) + { + if(i == 0) + { + neueTermine.Add(new SchedulerAppointmentDC + { + AllDay = false, + CustomerList = termin.CustomerList, + Description = termin.Description, + EmployeeList = termin.EmployeeList, + EndDate = new DateTime(termin.StartDate.Value.AddDays(1).Year, termin.StartDate.Value.AddDays(1).Month, termin.StartDate.Value.AddDays(1).Day), + FormerBookingSequenceOid = termin.FormerBookingSequenceOid, + IsPrivate = termin.IsPrivate, + LabelId = termin.LabelId, + Location = termin.Location, + Originator = termin.Originator, + RecurrenceInfo = termin.RecurrenceInfo, + ReminderInfo = termin.ReminderInfo, + ResourceList = termin.ResourceList, + StartDate = termin.StartDate, + Status = termin.Status, + Subject = termin.Subject, + Type = termin.Type + }); + } + else if(i == tage) + { + neueTermine.Add(new SchedulerAppointmentDC + { + AllDay = false, + CustomerList = termin.CustomerList, + Description = termin.Description, + EmployeeList = termin.EmployeeList, + EndDate = termin.EndDate, + FormerBookingSequenceOid = termin.FormerBookingSequenceOid, + IsPrivate = termin.IsPrivate, + LabelId = termin.LabelId, + Location = termin.Location, + Originator = termin.Originator, + RecurrenceInfo = termin.RecurrenceInfo, + ReminderInfo = termin.ReminderInfo, + ResourceList = termin.ResourceList, + StartDate = new DateTime(termin.EndDate.Value.Year, termin.EndDate.Value.Month, termin.EndDate.Value.Day), + Status = termin.Status, + Subject = termin.Subject, + Type = termin.Type + }); + } + else + { + neueTermine.Add(new SchedulerAppointmentDC + { + AllDay = true, + CustomerList = termin.CustomerList, + Description = termin.Description, + EmployeeList = termin.EmployeeList, + EndDate = new DateTime(termin.StartDate.Value.AddDays(i + 1).Year, termin.StartDate.Value.AddDays(i + 1).Month, termin.StartDate.Value.AddDays(i + 1).Day), + FormerBookingSequenceOid = termin.FormerBookingSequenceOid, + IsPrivate = termin.IsPrivate, + LabelId = termin.LabelId, + Location = termin.Location, + Originator = termin.Originator, + RecurrenceInfo = termin.RecurrenceInfo, + ReminderInfo = termin.ReminderInfo, + ResourceList = termin.ResourceList, + StartDate = new DateTime(termin.StartDate.Value.AddDays(i).Year, termin.StartDate.Value.AddDays(i).Month, termin.StartDate.Value.AddDays(i).Day), + Status = termin.Status, + Subject = termin.Subject, + Type = termin.Type + }); + } + } + } + } + } - BeWoUtils.ShowReport("Kalender", variablenDictionary, ReportEnum.KalenderMonatsReportEnum); - } + var variablenDictionary = new Dictionary + { + {"appointmentOidListe", appointmentOidListe}, + {"datesList", datesList}, + {"employeeOid", BeWoApp.LoggedOnEmployee.EmployeeOid}, + {"serienTermine", serienTermine}, + {"mehrtaegigeTermine", neueTermine} + }; - public void PreselectCustomer(long pCustomerOid) - { - if (AllCustomers.Any(c => c.CustomerOid.Equals(pCustomerOid))) - { - SelectedCustomers = new List {AllCustomers.Find(f => f.CustomerOid.Equals(pCustomerOid))}; - - OnPropertyChanged(nameof(SelectedCustomers)); - OnPropertyChanged(nameof(SelectedItems)); - OnPropertyChanged(nameof(GefilterteKlienten)); - } - } - - private void DateNavigator_OnSelectedDatesChanged(object sender, EventArgs e) - { - _CurrentViewType = Scheduler.ActiveViewType; - - var navigator = (DevExpress.Xpf.Editors.DateNavigator.DateNavigator) sender; - - var selectedDates = navigator.SelectedDates; - - var isSelectedDateFetched = _LastFetchedInterval.ContainsEveryDateFromList(selectedDates); - if(!isSelectedDateFetched && !(_LastFetchedInterval.Start.Equals(new DateTime(1,1,1,0,0,0)) && _LastFetchedInterval.End.Equals(new DateTime(1, 1, 1, 0, 30, 0)))) - { - ReloadVM(); - } + BeWoUtils.ShowReport("Kalender", variablenDictionary, ReportEnum.KalenderMonatsReportEnum); } - private void MitarbeiterVerfuegbarkeitPruefenButtonItem_OnItemClick(object sender, ItemClickEventArgs e) - { - var intervall = Scheduler.ActiveView.SelectedInterval; + public void PreselectCustomer(long pCustomerOid) + { + if(AllCustomers.Any(c => c.CustomerOid.Equals(pCustomerOid))) + { + SelectedCustomers = new List {AllCustomers.Find(f => f.CustomerOid.Equals(pCustomerOid))}; - ServiceFacade.DoEmployeeServiceAsync(s1 => s1.GetAllActiveEmployeesCompact(), - dcs => ServiceFacade.DoReportServiceAsync( - s2 => s2.GetMitarbeiterverfuegbarkeiten(dcs, intervall.Start, intervall.End), s3 => this.Dispatch(() => - { - var mviv = new MitarbeiterverfuegbarkeitsinfoView(s3, intervall.Start, intervall.End); + OnPropertyChanged(nameof(SelectedCustomers)); + OnPropertyChanged(nameof(SelectedItems)); + OnPropertyChanged(nameof(GefilterteKlienten)); + } + } - if (mviv.CommandBindings.Count == 0) - { - mviv.CommandBindings.Add( - new CommandBinding( - ApplicationCommands.Close, - (s, e2) => - { - if (!mviv.DoSaveCheck()) - { - return; - } + private void DateNavigator_OnSelectedDatesChanged(object sender, EventArgs e) + { + _CurrentViewType = Scheduler.ActiveViewType; - PopupContent.Visibility = Visibility.Hidden; - PopupContent.Child = null; - })); - } + var navigator = (DevExpress.Xpf.Editors.DateNavigator.DateNavigator) sender; - PopupContent.Child = mviv; - PopupContent.Height = 400; - PopupContent.Width = 450; - PopupContent.Visibility = Visibility.Visible; - }))); - } + var selectedDates = navigator.SelectedDates; - private void MitarbeiterfarbenEinAusCheckBox_OnChecked(object sender, RoutedEventArgs e) - { - var cb = (CheckBox) sender; - IsEmployeeBrushVisible = cb.IsChecked ?? true; - } + var isSelectedDateFetched = _LastFetchedInterval.ContainsEveryDateFromList(selectedDates); + if(!isSelectedDateFetched && !(_LastFetchedInterval.Start.Equals(new DateTime(1, 1, 1, 0, 0, 0)) && _LastFetchedInterval.End.Equals(new DateTime(1, 1, 1, 0, 30, 0)))) + { + ReloadVM(); + } + } - private void NurMeineTermineEinAusCheckBox_OnChecked(object sender, RoutedEventArgs e) - { - var cb = (CheckBox) sender; + private void MitarbeiterVerfuegbarkeitPruefenButtonItem_OnItemClick(object sender, ItemClickEventArgs e) + { + var intervall = Scheduler.ActiveView.SelectedInterval; - if (CheckBoxConverter != null && BeWoApp.CompactLoggedOnEmployee != null) - { - if (cb.IsChecked != null && cb.IsChecked.Value) - { - SelectedEmployees = new List{BeWoApp.CompactLoggedOnEmployee}; + ServiceFacade.DoEmployeeServiceAsync(s1 => s1.GetAllActiveEmployeesCompact(), + dcs => ServiceFacade.DoReportServiceAsync( + s2 => s2.GetMitarbeiterverfuegbarkeiten(dcs, intervall.Start, intervall.End), s3 => this.Dispatch(() => + { + var mviv = new MitarbeiterverfuegbarkeitsinfoView(s3, intervall.Start, intervall.End); + + if(mviv.CommandBindings.Count == 0) + { + mviv.CommandBindings.Add( + new CommandBinding( + ApplicationCommands.Close, + (s, e2) => + { + if(!mviv.DoSaveCheck()) + { + return; + } + + PopupContent.Visibility = Visibility.Hidden; + PopupContent.Child = null; + })); + } + + PopupContent.Child = mviv; + PopupContent.Height = 400; + PopupContent.Width = 450; + PopupContent.Visibility = Visibility.Visible; + }))); + } + + private void MitarbeiterfarbenEinAusCheckBox_OnChecked(object sender, RoutedEventArgs e) + { + var cb = (CheckBox) sender; + IsEmployeeBrushVisible = cb.IsChecked ?? true; + } + + private void NurMeineTermineEinAusCheckBox_OnChecked(object sender, RoutedEventArgs e) + { + var cb = (CheckBox) sender; + + if(CheckBoxConverter != null && BeWoApp.CompactLoggedOnEmployee != null) + { + if(cb.IsChecked != null && cb.IsChecked.Value) + { + SelectedEmployees = new List {BeWoApp.CompactLoggedOnEmployee}; CheckBoxConverter.AktuellerMitarbeiter = BeWoApp.CompactLoggedOnEmployee; - } - else if (cb.IsChecked != null && !cb.IsChecked.Value && SelectedEmployees.Count == 1) - { + } + else if(cb.IsChecked != null && !cb.IsChecked.Value && SelectedEmployees.Count == 1) + { SelectedEmployees.Remove(BeWoApp.CompactLoggedOnEmployee); - CheckBoxConverter.AktuellerMitarbeiter = null; - } + CheckBoxConverter.AktuellerMitarbeiter = null; + } OnPropertyChanged(nameof(SelectedEmployees)); OnPropertyChanged(nameof(SelectedItems)); - ReloadVM(true); + ReloadVM(true); } - } + } - private void AbwesenheitenEinAusCheckBox_OnChecked(object sender, RoutedEventArgs e) - { - var cb = (CheckBox) sender; - IsAbsenceTimeVisible = cb.IsChecked ?? true; + private void AbwesenheitenEinAusCheckBox_OnChecked(object sender, RoutedEventArgs e) + { + var cb = (CheckBox) sender; + IsAbsenceTimeVisible = cb.IsChecked ?? true; - ReloadVM(true); - } + ReloadVM(true); + } - public static void WriteToDebugLog(string message, bool isWithoutTimestamp = false) - { + public static void WriteToDebugLog(string message, bool isWithoutTimestamp = false) + { #if DEBUG var callerName2 = new StackTrace().GetFrame(2).GetMethod().Name; var callerName = new StackTrace().GetFrame(1).GetMethod().Name; @@ -2278,182 +2410,176 @@ namespace BeWo.Scheduler.View #endif } - public static void WriteMethodCallToLog(long pElapsedMilliseconds) - { + public static void WriteMethodCallToLog(long pElapsedMilliseconds) + { #if DEBUG - var callerName = new StackTrace().GetFrame(1).GetMethod().Name; + var callerName = new StackTrace().GetFrame(1).GetMethod().Name; - using(var logFile = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\method_calls_log.txt", true)) - { - logFile.WriteLine($"{callerName} took {pElapsedMilliseconds} ms"); - } -#endif - } - - private void Scheduler_OnInplaceEditorShowing(object sender, InplaceEditorEventArgs e) - { - if(_IsNew) - { - var n = new ObservableCollection(SelectedEmployees.Select(item => new Employee2SchedulerAppointmentDC { Employee = item, ParticipationAnswer = ParticipationAnswer.Offen }).ToList()); - e.Appointment.CF_EmployeeList(n); - e.Appointment.CF_CustomerList(new List(SelectedCustomers)); - e.Appointment.CF_ResourceList(new List(SelectedResources)); - - _IsNew = false; + using(var logFile = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\method_calls_log.txt", true)) + { + logFile.WriteLine($"{callerName} took {pElapsedMilliseconds} ms"); } - } +#endif + } - private void ButtonDeleteAppointmentsInInterval_Click(object sender, RoutedEventArgs e) - { - DeleteAppointmentsPopup.IsOpen = true; - } + private void Scheduler_OnInplaceEditorShowing(object sender, InplaceEditorEventArgs e) + { + if(_IsNew) + { + var n = new ObservableCollection(SelectedEmployees.Select(item => new Employee2SchedulerAppointmentDC {Employee = item, ParticipationAnswer = ParticipationAnswer.Offen}).ToList()); + e.Appointment.CF_EmployeeList(n); + e.Appointment.CF_CustomerList(new List(SelectedCustomers)); + e.Appointment.CF_ResourceList(new List(SelectedResources)); - private void AbortDeletingAppointments_Click(object sender, RoutedEventArgs e) - { - DeleteAppointmentsPopup.IsOpen = false; - } + _IsNew = false; + } + } - private void DeleteAppointmentsForGood_Click(object sender, RoutedEventArgs e) - { - var employeesOnly = MitarbeiterEbenenCheckBox.IsChecked != null && MitarbeiterEbenenCheckBox.IsChecked.Value; - var customersOnly = KlientenEbenenCheckBox.IsChecked != null && KlientenEbenenCheckBox.IsChecked.Value; - var resourcesOnly = RessourcenEbenenCheckBox.IsChecked != null && RessourcenEbenenCheckBox.IsChecked.Value; - var onlyPrivateAppointments = ShowPrivateAppointmentsCheckBox.IsChecked != null && ShowPrivateAppointmentsCheckBox.IsChecked.Value; - var showOnlyMyAppointments = ZeigeNurMeineTermine; + private void ButtonDeleteAppointmentsInInterval_Click(object sender, RoutedEventArgs e) + { + DeleteAppointmentsPopup.IsOpen = true; + } - var loggedOnUserHasRightToSeeAllAppointments = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll); - var loggedOnEmployeeOid = BeWoApp.LoggedOnEmployee.EmployeeOid.Value; - var date = DeleteForGoodIntervalEndDateEdit.DateTime; + private void AbortDeletingAppointments_Click(object sender, RoutedEventArgs e) + { + DeleteAppointmentsPopup.IsOpen = false; + } + + private void DeleteAppointmentsForGood_Click(object sender, RoutedEventArgs e) + { + var employeesOnly = MitarbeiterEbenenCheckBox.IsChecked != null && MitarbeiterEbenenCheckBox.IsChecked.Value; + var customersOnly = KlientenEbenenCheckBox.IsChecked != null && KlientenEbenenCheckBox.IsChecked.Value; + var resourcesOnly = RessourcenEbenenCheckBox.IsChecked != null && RessourcenEbenenCheckBox.IsChecked.Value; + var onlyPrivateAppointments = ShowPrivateAppointmentsCheckBox.IsChecked != null && ShowPrivateAppointmentsCheckBox.IsChecked.Value; + var showOnlyMyAppointments = ZeigeNurMeineTermine; + + var loggedOnUserHasRightToSeeAllAppointments = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll); + var loggedOnEmployeeOid = BeWoApp.LoggedOnEmployee.EmployeeOid.Value; + var date = DeleteForGoodIntervalEndDateEdit.DateTime; var userRights = new Dictionary - { - { - UserRightType.KalenderKliententermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern) - }, - { - UserRightType.KalenderMitarbeitertermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern) - }, - { - UserRightType.KalenderRessourcentermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern) - }, - { - UserRightType.KalenderRessourcentermineAndererAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAndererAendern) - } - }; + { + { + UserRightType.KalenderKliententermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern) + }, + { + UserRightType.KalenderMitarbeitertermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern) + }, + { + UserRightType.KalenderRessourcentermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern) + }, + { + UserRightType.KalenderRessourcentermineAndererAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAndererAendern) + } + }; var dialog = new MessageDialog(() => { - ServiceFacade.DoOperationsServiceAsync(s => s.DeleteAppointmentsInInterval( - loggedOnUserHasRightToSeeAllAppointments, - loggedOnEmployeeOid, - date, - SelectedEmployees.Select(employee => employee.EmployeeOid).ToList(), - SelectedCustomers.Select(customer => customer.CustomerOid).ToList(), - SelectedResources.Select(resource => resource.ResourceOid.Value).ToList(), - employeesOnly, - customersOnly, - resourcesOnly, - onlyPrivateAppointments, - showOnlyMyAppointments, - userRights), () => + ServiceFacade.DoOperationsServiceAsync(s => s.DeleteAppointmentsInInterval( + loggedOnUserHasRightToSeeAllAppointments, + loggedOnEmployeeOid, + date, + SelectedEmployees.Select(employee => employee.EmployeeOid).ToList(), + SelectedCustomers.Select(customer => customer.CustomerOid).ToList(), + SelectedResources.Select(resource => resource.ResourceOid.Value).ToList(), + employeesOnly, + customersOnly, + resourcesOnly, + onlyPrivateAppointments, + showOnlyMyAppointments, + userRights), () => + { + this.Dispatch(() => { - this.Dispatch(() => - { - DeleteAppointmentsPopup.IsOpen = false; - ReloadVM(true); - }); + DeleteAppointmentsPopup.IsOpen = false; + ReloadVM(true); }); + }); }); - - ServiceFacade.DoOperationsServiceAsync( - s => s.GetMessageFromServerForDeletingAppointments( - loggedOnUserHasRightToSeeAllAppointments, - loggedOnEmployeeOid, - date, - SelectedEmployees.Select(employee => employee.EmployeeOid).ToList(), - SelectedCustomers.Select(customer => customer.CustomerOid).ToList(), - SelectedResources.Select(resource => resource.ResourceOid.Value).ToList(), - employeesOnly, - customersOnly, - resourcesOnly, - onlyPrivateAppointments, - showOnlyMyAppointments, - userRights), xaml => - { - this.Dispatch(() => - { - dialog.SetXaml(xaml); - dialog.ShowDialog(); - }); - }); + + ServiceFacade.DoOperationsServiceAsync( + s => s.GetMessageFromServerForDeletingAppointments( + loggedOnUserHasRightToSeeAllAppointments, + loggedOnEmployeeOid, + date, + SelectedEmployees.Select(employee => employee.EmployeeOid).ToList(), + SelectedCustomers.Select(customer => customer.CustomerOid).ToList(), + SelectedResources.Select(resource => resource.ResourceOid.Value).ToList(), + employeesOnly, + customersOnly, + resourcesOnly, + onlyPrivateAppointments, + showOnlyMyAppointments, + userRights), xaml => + { + this.Dispatch(() => + { + dialog.SetXaml(xaml); + dialog.ShowDialog(); + }); + }); } - private void RestoreAppointmentButtonItem_OnItemClick(object sender, ItemClickEventArgs e) - { - var appointmentToRestore = Scheduler.SelectedAppointments[0]; + private void RestoreAppointmentButtonItem_OnItemClick(object sender, ItemClickEventArgs e) + { + var appointmentToRestore = Scheduler.SelectedAppointments[0]; - var appointmentVM = (SchedulerAppointmentVM) appointmentToRestore.GetSourceObject(Scheduler.GetCoreStorage()); + var appointmentVM = (SchedulerAppointmentVM) appointmentToRestore.GetSourceObject(Scheduler.GetCoreStorage()); - var appointmentDC = appointmentVM?.CommitToDataContract(); + var appointmentDC = appointmentVM?.CommitToDataContract(); if(appointmentDC?.SchedulerAppointmentOid == null || appointmentDC.NewSchedulerAppointmentVersion == null || appointmentToRestore.Type != AppointmentType.ChangedOccurrence) { return; } - ServiceFacade.DoResourceServiceAsync(s => s.GetSchedulerAppointmentByid(appointmentDC.SchedulerAppointmentOid.Value), appointment => - { - if(appointment.SchedulerAppointmentOid == null || appointment.NewSchedulerAppointmentVersion == null) - { - return; - } - - ServiceFacade.DoResourceServiceAsync(s => s.DeleteSchedulerAppointments(new Dictionary { { appointment.SchedulerAppointmentOid.Value, appointment.NewSchedulerAppointmentVersion.Value } }), - () => - { - this.Dispatch(() => - { - ReloadVM(true); - }); - }); + ServiceFacade.DoResourceServiceAsync(s => s.GetSchedulerAppointmentByid(appointmentDC.SchedulerAppointmentOid.Value), appointment => + { + if(appointment.SchedulerAppointmentOid == null || appointment.NewSchedulerAppointmentVersion == null) + { + return; + } + + ServiceFacade.DoResourceServiceAsync(s => s.DeleteSchedulerAppointments(new Dictionary {{appointment.SchedulerAppointmentOid.Value, appointment.NewSchedulerAppointmentVersion.Value}}), + () => { this.Dispatch(() => { ReloadVM(true); }); }); }); } - private void AufgabeAnlegen_OnItemClick(object sender, ItemClickEventArgs e) - { - // TODO: Durch eigenen Editor ersetzen, der mit dem Scheduler nichts am Hut hat! + private void AufgabeAnlegen_OnItemClick(object sender, ItemClickEventArgs e) + { + // TODO: Durch eigenen Editor ersetzen, der mit dem Scheduler nichts am Hut hat! - // var dueDate = Scheduler.SelectedInterval.End; - //var end = dueDate.GetShortDateTime().AddDays(1); - // var start = Scheduler.SelectedInterval.Start.GetShortDateTime(); + // var dueDate = Scheduler.SelectedInterval.End; + //var end = dueDate.GetShortDateTime().AddDays(1); + // var start = Scheduler.SelectedInterval.Start.GetShortDateTime(); - // var newTask = Scheduler.Storage.CreateAppointment(AppointmentType.Normal, start, end, "Neue Aufgabe"); - - // newTask.AllDay = true; + // var newTask = Scheduler.Storage.CreateAppointment(AppointmentType.Normal, start, end, "Neue Aufgabe"); - //var employees2Appointments = SelectedEmployees.Select(item => new Employee2SchedulerAppointmentDC { Employee = item, ParticipationAnswer = ParticipationAnswer.Offen }).ToList(); + // newTask.AllDay = true; - // ViewModel.InitNewTask(newTask, dueDate, employees2Appointments, SelectedCustomers, SelectedResources, new List()); + //var employees2Appointments = SelectedEmployees.Select(item => new Employee2SchedulerAppointmentDC { Employee = item, ParticipationAnswer = ParticipationAnswer.Offen }).ToList(); - // Scheduler.ShowEditAppointmentForm(newTask); - } + // ViewModel.InitNewTask(newTask, dueDate, employees2Appointments, SelectedCustomers, SelectedResources, new List()); - private void ShowTasksCheckBox_OnClick(object sender, RoutedEventArgs e) - { - var cb = (CheckBox) sender; - IsTasksVisible = cb.IsChecked ?? false; + // Scheduler.ShowEditAppointmentForm(newTask); + } - ReloadVM(true); - } + private void ShowTasksCheckBox_OnClick(object sender, RoutedEventArgs e) + { + var cb = (CheckBox) sender; + IsTasksVisible = cb.IsChecked ?? false; - private void Scheduler_OnAppointmentDrag(object sender, AppointmentDragEventArgs e) - { + ReloadVM(true); + } + + private void Scheduler_OnAppointmentDrag(object sender, AppointmentDragEventArgs e) + { var editedAppointment = e.EditedAppointment; var editedIsTask = editedAppointment.CF_IsTask(); var editedEnd = editedAppointment.End; var editedDueDate = editedAppointment.CF_DueDate(); - + var sourceAppointment = e.SourceAppointment; var sourceIsTask = sourceAppointment.CF_IsTask(); @@ -2484,7 +2610,7 @@ namespace BeWo.Scheduler.View var sb = new StringBuilder(); sb.Append("AppointmentStorage-Inhalt:\n"); - foreach (var app in storageAppointments) + foreach(var app in storageAppointments) { sb.Append($"{app.Subject} {app.Start:dd.MM.yyyy HH:mm}-{app.End:dd.MM.yyyy HH:mm}\n"); } @@ -2494,58 +2620,58 @@ namespace BeWo.Scheduler.View private void Scheduler_OnAppointmentDrop(object sender, AppointmentDragEventArgs e) { - + } private void ListView_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) { - var datacontext = (ListView)sender; - var selected = datacontext.SelectedItem; + var datacontext = (ListView) sender; + var selected = datacontext.SelectedItem; } private void btn_showEmployeeInformation_Click(object sender, RoutedEventArgs e) { - var cb = (Button)sender; - var datacontext = cb.DataContext; - CompactEmployeeDC emp = (CompactEmployeeDC)datacontext; + var cb = (Button) sender; + var datacontext = cb.DataContext; + CompactEmployeeDC emp = (CompactEmployeeDC) datacontext; - var control = new InformationView(); - control.SetXaml(ServiceFacade.DoOperationsServiceSync(s => s.GetXAMLInformationStringForEmployee(emp.EmployeeOid))); + var control = new InformationView(); + control.SetXaml(ServiceFacade.DoOperationsServiceSync(s => s.GetXAMLInformationStringForEmployee(emp.EmployeeOid))); - var beWoWindow = new BeWoWindow(); + var beWoWindow = new BeWoWindow(); - control.ButtonCloseClicked += () => beWoWindow.Close(); + control.ButtonCloseClicked += () => beWoWindow.Close(); - beWoWindow.Height = 200; - beWoWindow.Width = 400; - beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; - beWoWindow.GroupBoxContent = control; - beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; - beWoWindow.rootGroupBox.Header = "Infos zu " + emp.FirstName + " " + emp.LastName; - beWoWindow.ShowDialog(); - } + beWoWindow.Height = 200; + beWoWindow.Width = 400; + beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; + beWoWindow.GroupBoxContent = control; + beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; + beWoWindow.rootGroupBox.Header = "Infos zu " + emp.FirstName + " " + emp.LastName; + beWoWindow.ShowDialog(); + } private void btn_showCustomerInformation_Click(object sender, RoutedEventArgs e) { - var cb = (Button)sender; - var datacontext = cb.DataContext; - CompactCustomerDC customer = (CompactCustomerDC)datacontext; + var cb = (Button) sender; + var datacontext = cb.DataContext; + CompactCustomerDC customer = (CompactCustomerDC) datacontext; - var control = new InformationView(); - control.SetXaml(ServiceFacade.DoOperationsServiceSync(s => s.GetXAMLInformationStringForCustomer(customer.CustomerOid))); + var control = new InformationView(); + control.SetXaml(ServiceFacade.DoOperationsServiceSync(s => s.GetXAMLInformationStringForCustomer(customer.CustomerOid))); - var beWoWindow = new BeWoWindow(); + var beWoWindow = new BeWoWindow(); - control.ButtonCloseClicked += () => beWoWindow.Close(); + control.ButtonCloseClicked += () => beWoWindow.Close(); - beWoWindow.Height = 200; - beWoWindow.Width = 500; - beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; - beWoWindow.GroupBoxContent = control; - beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; - beWoWindow.rootGroupBox.Header = "Infos zu " + customer.FirstName + " " + customer.LastName; - beWoWindow.ShowDialog(); - } + beWoWindow.Height = 200; + beWoWindow.Width = 500; + beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; + beWoWindow.GroupBoxContent = control; + beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; + beWoWindow.rootGroupBox.Header = "Infos zu " + customer.FirstName + " " + customer.LastName; + beWoWindow.ShowDialog(); + } private void SpinEditTimelineViewDayCount_OnLostFocus(object sender, RoutedEventArgs e) { @@ -2554,323 +2680,340 @@ namespace BeWo.Scheduler.View private void SpinEditDayViewDayCount_OnLostFocus(object sender, RoutedEventArgs e) { - BeWoApp.SaveAppSettings(); - } + BeWoApp.SaveAppSettings(); + } } #region Converter + public static class ViewTypeConvert - { - public static AppointmentViewType ToAppointmentViewType(SchedulerViewType svt) - { - switch (svt) - { - case SchedulerViewType.Day: - return AppointmentViewType.Day; - case SchedulerViewType.Week: - return AppointmentViewType.Week; - case SchedulerViewType.Timeline: - return AppointmentViewType.Timeline; - case SchedulerViewType.Month: - return AppointmentViewType.Month; - default: - return AppointmentViewType.WorkWeek; - } - } - } + { + public static AppointmentViewType ToAppointmentViewType(SchedulerViewType svt) + { + switch(svt) + { + case SchedulerViewType.Day: + return AppointmentViewType.Day; + case SchedulerViewType.Week: + return AppointmentViewType.Week; + case SchedulerViewType.Timeline: + return AppointmentViewType.Timeline; + case SchedulerViewType.Month: + return AppointmentViewType.Month; + default: + return AppointmentViewType.WorkWeek; + } + } + } - public class TextFromIDataContractConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if(value is ResourceDC resourceDC) - { - return resourceDC.Name; - } + public class TextFromIDataContractConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is ResourceDC resourceDC) + { + return resourceDC.Name; + } - if (value is Employee2SchedulerAppointmentDC dc) - { - return dc.Employee.SimpleDescription; - } + if(value is Employee2SchedulerAppointmentDC dc) + { + return dc.Employee.SimpleDescription; + } - var filterableDC = value as IFilterableDC; - return filterableDC?.SimpleDescription; - } + var filterableDC = value as IFilterableDC; + return filterableDC?.SimpleDescription; + } - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } - public class GermanEditorLocalizer : EditorLocalizer - { - public override string Language => "Deutsch"; + public class GermanEditorLocalizer : EditorLocalizer + { + public override string Language => "Deutsch"; - public override string GetLocalizedString(EditorStringId id) - { - return id.Equals(EditorStringId.Today) ? "Heute" : base.GetLocalizedString(id); - } - } + public override string GetLocalizedString(EditorStringId id) + { + return id.Equals(EditorStringId.Today) ? "Heute" : base.GetLocalizedString(id); + } + } - public class ViewInfo2CustomFieldsConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var customFields = (CustomFieldCollection) value; - var customFieldStorage = (CustomFieldStorage) customFields[nameof(CustomFieldStorage)]; + public class ViewInfo2CustomFieldsConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is CustomFieldCollection customFields) + { + var customFieldStorage = (CustomFieldStorage)customFields[nameof(CustomFieldStorage)]; - if(customFieldStorage != null && parameter != null && parameter.Equals("AlleRessourcen")) - { - return customFieldStorage.ResourceList; - } + if (customFieldStorage != null && parameter != null && parameter.Equals("AlleRessourcen")) + { + return customFieldStorage.ResourceList; + } + } - return null; - } + return null; + } - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } - public class AppointmentToolTipConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - try - { - var customFields = (CustomFieldCollection) value; + public class AppointmentToolTipConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + var customFields = (CustomFieldCollection) value; if(customFields == null) { return string.Empty; } - var customFieldStorage = (CustomFieldStorage) customFields[nameof(CustomFieldStorage)]; - - var mitarbeiter = customFieldStorage.EmployeeList; - var ressourcen = customFieldStorage.ResourceList; - var klienten = customFieldStorage.CustomerList; - var tooltip = string.Empty; - var seperator = "; "; + var customFieldStorage = (CustomFieldStorage) customFields[nameof(CustomFieldStorage)]; - if (parameter == null) - { - return tooltip; - } + var mitarbeiter = customFieldStorage.EmployeeList; + var ressourcen = customFieldStorage.ResourceList; + var klienten = customFieldStorage.CustomerList; + var tooltip = string.Empty; + var seperator = "; "; - var auswahl = new List(); - switch (parameter.ToString()) - { - case "Ressourcen": - seperator = ", "; - if(ressourcen != null) - { - auswahl = ressourcen.Cast().ToList(); - } - break; - case "Mitarbeiter": - if (mitarbeiter != null) - { - auswahl = mitarbeiter.Select(s => s.Employee).Cast().ToList(); - } - break; - case "Klienten": - if(klienten != null) - { - auswahl = klienten.Cast().ToList(); - } - break; - } - - foreach (var item in auswahl) - { - var index = auswahl.IndexOf(item); - - if (index % 3 == 0 && index < auswahl.Count - 1 && index > 0) - { - tooltip += "\n"; - } - - tooltip += item.ToString(); - - if (index < auswahl.Count - 1) - { - tooltip += seperator; - } - } - - return tooltip; - } - catch(Exception e) - { - return string.Empty; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } - - public class WidthAdditionMultiConverter : IMultiValueConverter - { - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - var w1 = System.Convert.ToDouble(values[0]); - var w2 = System.Convert.ToDouble(values[1]); - - return w1 + w2; - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } - - public class FilterBackgroundConverter : IMultiValueConverter - { - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - var farbe = Color.FromRgb(192, 255, 208); - - try - { - if (!(values[0] is List selectedItems) || !selectedItems.Any()) - { - return new LinearGradientBrush(new GradientStopCollection { new GradientStop(farbe, 1) }, new Point(.5, 0), new Point(.5, 1)); - } - - if (!(values[1] is CustomFieldCollection customViewInfo)) - { - return new LinearGradientBrush(new GradientStopCollection { new GradientStop(farbe, 1) }, new Point(.5, 0), new Point(.5, 1)); - } - - var customFieldStorage = (CustomFieldStorage) customViewInfo[nameof(CustomFieldStorage)]; - - var isTask = customFieldStorage.IsTask; - - if (isTask) - { - farbe = Color.FromRgb(153, 59, 59); - } - - var aptCustomers = customFieldStorage.CustomerList; - var aptResources = customFieldStorage.ResourceList; - - var gradientCollection = new GradientStopCollection(); - var farbKollektion = new List(); - - if (selectedItems.Any(aptCustomers.Contains)) - { - farbKollektion.Add(Color.FromRgb(59, 119, 153)); - } - - if (selectedItems.Any(aptResources.Contains)) - { - farbKollektion.Add(Color.FromRgb(4, 180, 208)); - } - - switch (farbKollektion.Count) - { - case 1: - var first = aptResources.FirstOrDefault(); - - gradientCollection.Add(first != null ? new GradientStop((Color) (ColorConverter.ConvertFromString(first.Color) ?? Color.FromRgb(4, 180, 208)), 1) : new GradientStop(farbKollektion[0], 1)); - break; - case 2: - gradientCollection.Add(new GradientStop(farbKollektion[0], 0.5)); - - var first2 = aptResources.FirstOrDefault(); - - if (first2 != null) - { - gradientCollection.Add(new GradientStop((Color) (ColorConverter.ConvertFromString(first2.Color) ?? Color.FromRgb(4, 180, 208)), 0.5)); - } - - break; - default: - gradientCollection.Add(new GradientStop(farbe, 1)); - break; - } - - return new LinearGradientBrush(gradientCollection, new Point(.5, 0), new Point(.5, 1)); - } - catch (Exception) - { - return new LinearGradientBrush(new GradientStopCollection { new GradientStop(farbe, 1) }, new Point(.5, 0), new Point(.5, 1)); - } - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } - - public class AppointmentBorderZusageConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - try - { - var customFields = (CustomFieldCollection)value; - - if(customFields == null) - { - return new SolidColorBrush(Color.FromRgb(192, 255, 208)); + if(parameter == null) + { + return tooltip; } - var customFieldStorage = (CustomFieldStorage) customFields[nameof(CustomFieldStorage)]; + var auswahl = new List(); + switch(parameter.ToString()) + { + case "Ressourcen": + seperator = ", "; + if(ressourcen != null) + { + auswahl = ressourcen.Cast().ToList(); + } + break; + case "Mitarbeiter": + if(mitarbeiter != null) + { + auswahl = mitarbeiter.Select(s => s.Employee).Cast().ToList(); + } - var employeeList = customFieldStorage.EmployeeList; - var isTask = customFieldStorage.IsTask; + break; + case "Klienten": + if(klienten != null) + { + auswahl = klienten.Cast().ToList(); + } - return employeeList.Any(e => e.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && e.ParticipationAnswer == ParticipationAnswer.Vorbehalt) ? - new SolidColorBrush(Color.FromRgb(185, 39, 217)) : - isTask ? new SolidColorBrush(Color.FromRgb(153, 59, 59)) : new SolidColorBrush(Color.FromRgb(192, 255, 208)); + break; + } + + foreach(var item in auswahl) + { + var index = auswahl.IndexOf(item); + + if(index % 3 == 0 && index < auswahl.Count - 1 && index > 0) + { + tooltip += "\n"; + } + + tooltip += item.ToString(); + + if(index < auswahl.Count - 1) + { + tooltip += seperator; + } + } + + return tooltip; } - catch(Exception e) - { - Console.WriteLine(e); - return new SolidColorBrush(Color.FromRgb(192, 255, 208)); - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } - - public class NichtNochEinConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if(!(value is Employee2SchedulerAppointmentDC)) + catch(Exception e) { - return null; + return string.Empty; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class WidthAdditionMultiConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + var w1 = System.Convert.ToDouble(values[0]); + var w2 = System.Convert.ToDouble(values[1]); + + return w1 + w2; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class FilterBackgroundConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + var farbe = Color.FromRgb(192, 255, 208); + + try + { + if(!(values[0] is List selectedItems) || !selectedItems.Any()) + { + return new LinearGradientBrush(new GradientStopCollection {new GradientStop(farbe, 1)}, new Point(.5, 0), new Point(.5, 1)); + } + + if(!(values[1] is CustomFieldCollection customViewInfo)) + { + return new LinearGradientBrush(new GradientStopCollection {new GradientStop(farbe, 1)}, new Point(.5, 0), new Point(.5, 1)); + } + + var customFieldStorage = (CustomFieldStorage) customViewInfo[nameof(CustomFieldStorage)]; + + var isTask = customFieldStorage.IsTask; + + if(isTask) + { + farbe = Color.FromRgb(153, 59, 59); + } + + var aptCustomers = customFieldStorage.CustomerList; + var aptResources = customFieldStorage.ResourceList; + + var gradientCollection = new GradientStopCollection(); + var farbKollektion = new List(); + + if(selectedItems.Any(aptCustomers.Contains)) + { + farbKollektion.Add(Color.FromRgb(59, 119, 153)); + } + + if(selectedItems.Any(aptResources.Contains)) + { + farbKollektion.Add(Color.FromRgb(4, 180, 208)); + } + + switch(farbKollektion.Count) + { + case 1: + var first = aptResources.FirstOrDefault(); + + gradientCollection.Add(first != null ? new GradientStop((Color) (ColorConverter.ConvertFromString(first.Color) ?? Color.FromRgb(4, 180, 208)), 1) : new GradientStop(farbKollektion[0], 1)); + break; + case 2: + gradientCollection.Add(new GradientStop(farbKollektion[0], 0.5)); + + var first2 = aptResources.FirstOrDefault(); + + if(first2 != null) + { + gradientCollection.Add(new GradientStop((Color) (ColorConverter.ConvertFromString(first2.Color) ?? Color.FromRgb(4, 180, 208)), 0.5)); + } + + break; + default: + gradientCollection.Add(new GradientStop(farbe, 1)); + break; + } + + return new LinearGradientBrush(gradientCollection, new Point(.5, 0), new Point(.5, 1)); + } + catch(Exception) + { + return new LinearGradientBrush(new GradientStopCollection {new GradientStop(farbe, 1)}, new Point(.5, 0), new Point(.5, 1)); + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class AppointmentBorderZusageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + var customFields = (CustomFieldCollection) value; + + if(customFields == null) + { + return new SolidColorBrush(Color.FromRgb(192, 255, 208)); + } + + var customFieldStorage = (CustomFieldStorage) customFields[nameof(CustomFieldStorage)]; + + var employeeList = customFieldStorage.EmployeeList; + var isTask = customFieldStorage.IsTask; + + return employeeList.Any(e => e.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && e.ParticipationAnswer == ParticipationAnswer.Vorbehalt) ? new SolidColorBrush(Color.FromRgb(185, 39, 217)) : + isTask ? new SolidColorBrush(Color.FromRgb(153, 59, 59)) : new SolidColorBrush(Color.FromRgb(192, 255, 208)); + } + catch(Exception e) + { + Console.WriteLine(e); + return new SolidColorBrush(Color.FromRgb(192, 255, 208)); + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class NichtNochEinConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is Employee2SchedulerAppointmentDC employee2SchedulerAppointment) + { + if (parameter != null && parameter.Equals("GibName")) + { + return employee2SchedulerAppointment.Employee.DetailDescription; + } + + var color = Color.FromRgb(255, 255, 255); + + switch (employee2SchedulerAppointment.ParticipationAnswer) + { + case ParticipationAnswer.Vorbehalt: + color = Color.FromRgb(185, 39, 217); + break; + case ParticipationAnswer.Zusage: + color = Color.FromRgb(72, 212, 78); + break; + case ParticipationAnswer.Absage: + color = Color.FromRgb(171, 0, 48); + break; + } + + return new SolidColorBrush(color); } - if (parameter != null && parameter.Equals("GibName")) - { - var v = (Employee2SchedulerAppointmentDC) value; + return null; + } - if(v != null) - { - return v.Employee.DetailDescription; - } - } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } - var val = (Employee2SchedulerAppointmentDC)value; - var c = Color.FromRgb(255, 255, 255); - - if(val != null) - { - switch(val.ParticipationAnswer) - { - case ParticipationAnswer.Vorbehalt: - c = Color.FromRgb(185, 39, 217); - break; - case ParticipationAnswer.Zusage: - c = Color.FromRgb(72, 212, 78); - break; - case ParticipationAnswer.Absage: - c = Color.FromRgb(171, 0, 48); - break; - } - } - - return new SolidColorBrush(c); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } - } #endregion } diff --git a/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs b/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs index 5bb76d22c..4f286e01e 100644 --- a/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs +++ b/BeWo/Scheduler/ViewModel/SchedulerAppointmentVM.cs @@ -123,7 +123,7 @@ namespace BeWo.Scheduler.ViewModel SupportConceptList = customFieldStorage.SupportConceptList; } } - + public int EventType { get => _Type; diff --git a/BeWo/View/Detail/DebugMessageLogView.xaml b/BeWo/View/Detail/DebugMessageLogView.xaml index 22c02e1b3..512c81107 100644 --- a/BeWo/View/Detail/DebugMessageLogView.xaml +++ b/BeWo/View/Detail/DebugMessageLogView.xaml @@ -4,9 +4,9 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:BeWo.View.Detail" - WindowStartupLocation="Manual" Topmost="True" + WindowStartupLocation="Manual" Title="Debug Log" mc:Ignorable="d" - Height="900" Width="700"> + Height="900" Width="1000"> @@ -16,7 +16,7 @@ - + diff --git a/BeWo/View/Detail/PreisView.xaml b/BeWo/View/Detail/PreisView.xaml index f1a15846b..9c39d040a 100644 --- a/BeWo/View/Detail/PreisView.xaml +++ b/BeWo/View/Detail/PreisView.xaml @@ -10,30 +10,48 @@ Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True"> - + - - - - + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + - diff --git a/BeWo/View/Detail/PreisView.xaml.cs b/BeWo/View/Detail/PreisView.xaml.cs index 53dd07199..b2e2974b0 100644 --- a/BeWo/View/Detail/PreisView.xaml.cs +++ b/BeWo/View/Detail/PreisView.xaml.cs @@ -38,7 +38,6 @@ namespace BeWo.View.Detail get { return "Preise"; } } - // TODO internal override DependencyObject ValidationOnSaveRootElement { get { return button_addPreis; } @@ -79,13 +78,13 @@ namespace BeWo.View.Detail private void DeleteButton_Click(object sender, RoutedEventArgs e) { - ViewModel.VMList.Remove(DatagridRegions.GetCurrentValue()); - BeWoWpfUtils.RefreshDXGrid(DatagridRegions); + ViewModel.VMList.Remove(DatagridPreis.GetCurrentValue()); + BeWoWpfUtils.RefreshDXGrid(DatagridPreis); } private void ReloadViewModel() { - VMFactory.CreatePreisListVMAsync(r => this.Dispatch(delegate { ViewModel = r; })); + VMFactory.CreatePreisListVMAsync(r => this.Dispatch(delegate { ViewModel = r; })); } private void Button_addPreis_Click(object sender, RoutedEventArgs e) @@ -96,6 +95,22 @@ namespace BeWo.View.Detail } } + private void PART_Editor_Click(object sender, RoutedEventArgs e) + { + RowData data = DatagridPreis.View.FocusedRowData; + + if (data != null && data.RowHandle != null) + { + var vm = DatagridPreis.GetRow(data.RowHandle.Value) as PreisVM; + + if (vm != null) + { + ViewModel.EditVM = vm; + popup_costrateperiods.IsOpen = true; + } + } + } + private void button_edit_Click(object sender, RoutedEventArgs e) { popup_costrateperiods.IsOpen = false; diff --git a/BeWo/ViewModel/ListViewModel/PreisListVM.cs b/BeWo/ViewModel/ListViewModel/PreisListVM.cs index a67138657..32456ee1d 100644 --- a/BeWo/ViewModel/ListViewModel/PreisListVM.cs +++ b/BeWo/ViewModel/ListViewModel/PreisListVM.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; -using BS.Shared; -using BS.Shared.Core; using BS.Shared.DataContracts; namespace BeWo.ViewModel.ListViewModel diff --git a/BeWo/ViewModel/PreisVM.cs b/BeWo/ViewModel/PreisVM.cs index 8e5f5f2f0..9d14f41af 100644 --- a/BeWo/ViewModel/PreisVM.cs +++ b/BeWo/ViewModel/PreisVM.cs @@ -1,21 +1,37 @@ using BS.Shared; +using BS.Shared.Core; using BS.Shared.DataContracts; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using BeWo.Validation; +using BeWo.ViewModel.ListViewModel; namespace BeWo.ViewModel { public class PreisVM : AbstractDCMapperVM { - private DateTime? _PreisInsTs; private long? _PreisOid; private long? _PreisVersion; private SystemEntryID? _PreisSystemEntryID; private string _Name; - private decimal? _Betrag; + + public static string PropertyName_CostRatePeriods = "CostRatePeriods"; + + public static string PropertyName_CurrentAmount = "CurrentAmount"; + + public static string PropertyName_IsDefault = "IsDefault"; + + public static string PropertyName_DoNotCheckOverlapping = "DoNotCheckOverlapping"; + + private bool _IsDeleteable = true; + + private bool _IsDefault; + + private bool _DoNotCheckOverlapping; + + private CostRatePeriodListVM _CostRatePeriods; public PreisVM(PreisDC preisDC) : base(preisDC, preisDC.PreisOid == null) { } @@ -31,20 +47,6 @@ namespace BeWo.ViewModel } } - public DateTime? PreisInsTs - { - get { return _PreisInsTs; } - set - { - if (AreDifferent(_PreisInsTs, value)) - { - _PreisInsTs = value; - StoreDirtyInformation(AreDifferent(DataContract.PreisInsTs, value), nameof(_PreisInsTs)); - FirePropertyChanged(nameof(_PreisInsTs)); - } - } - } - public long? PreisVersion { get { return _PreisVersion; } @@ -78,35 +80,137 @@ namespace BeWo.ViewModel } } - public decimal? Betrag + public bool IsDeleteable { - get { return _Betrag; } + get { return _IsDeleteable; } + } + + public CostRatePeriodListVM CostRatePeriods + { + get { return _CostRatePeriods; } + set { - _Betrag = value; - StoreDirtyInformation(AreDifferent(DataContract.Betrag, value), nameof(_Betrag)); - FirePropertyChanged(nameof(_Betrag)); + if (AreDifferent(_CostRatePeriods, value)) + { + _CostRatePeriods = value; + if ( _CostRatePeriods != null && _CostRatePeriods.VMList.Count > 0) + FirePropertyChanged(PropertyName_CostRatePeriods); + } + } + } + + public bool IsDefault + { + get { return this._IsDefault; } + + set + { + if (this.AreDifferent(this._IsDefault, value)) + { + this._IsDefault = value; + this.StoreDirtyInformation(this.AreDifferent(this.DataContract.IsDefault, value), PropertyName_IsDefault); + this.FirePropertyChanged(PropertyName_IsDefault); + } + } + } + + public bool DoNotCheckOverlapping + { + get { return this._DoNotCheckOverlapping; } + + set + { + if (this.AreDifferent(this._DoNotCheckOverlapping, value)) + { + this._DoNotCheckOverlapping = value; + this.StoreDirtyInformation(this.AreDifferent(this.DataContract.IsDefault, value), PropertyName_DoNotCheckOverlapping); + this.FirePropertyChanged(PropertyName_DoNotCheckOverlapping); + } + } + } + + public CostRatePeriodVM CurrentAmount + { + get { return CostRatePeriods.GetCurrentlyValidRate(CostRatePeriodType.AmountOfMoney); } + } + + public override bool IsDirty + { + get + { + if (_CostRatePeriods == null) + { + return false; + } + + return base.IsDirty || _CostRatePeriods.IsDirty; } } protected override void InitByDataContract(PreisDC bDataContract) { - _PreisOid = bDataContract.PreisOid; - _PreisVersion = bDataContract.PreisVersion; - _PreisSystemEntryID = bDataContract.PreisSystemEntryID; - Name = bDataContract.Name; - Betrag = bDataContract.Betrag; - PreisInsTs = bDataContract.PreisInsTs; + if (!IsNew) + { + _IsDeleteable = !bDataContract.IsSystemEntry; + _IsDefault = bDataContract.IsDefault; + _DoNotCheckOverlapping = bDataContract.DoNotCheckOverlapping; + _PreisOid = bDataContract.PreisOid; + _PreisVersion = bDataContract.PreisVersion; + _PreisSystemEntryID = bDataContract.PreisSystemEntryID; + Name = bDataContract.Name; + } + + if (bDataContract.CostRatePeriods == null) + { + bDataContract.CostRatePeriods = new List(); + } + + Utils.GetAllEnumValues().ToList().ForEach( + t => + { + if (t == CostRatePeriodType.AmountOfMoney && !bDataContract.CostRatePeriods.Exists(i => i.CostRateType == t)) + { + bDataContract.CostRatePeriods.Add( + new CostRatePeriodDC + { + CostRateType = t + }); + } + }); + + _CostRatePeriods = new CostRatePeriodListVM(bDataContract.CostRatePeriods); + + _CostRatePeriods.VMList.ListChanged += (s, e) => + { + if (e.ListChangedType != ListChangedType.ItemChanged) + { + FirePropertyChanged(PropertyName_CostRatePeriods); + + } + FirePropertyChanged(PropertyName_CurrentAmount); + }; + } protected override PreisDC MapToDataContract(PreisDC bDataContract, bool doCommit) { - bDataContract.PreisOid = _PreisOid; - bDataContract.PreisVersion = _PreisVersion; - bDataContract.PreisSystemEntryID = _PreisSystemEntryID; - bDataContract.Name = _Name; - bDataContract.Betrag = _Betrag; - bDataContract.PreisInsTs = _PreisInsTs; + bDataContract.IsDefault = _IsDefault; + bDataContract.DoNotCheckOverlapping = _DoNotCheckOverlapping; + bDataContract.PreisOid = _PreisOid; + bDataContract.PreisVersion = _PreisVersion; + bDataContract.PreisSystemEntryID = _PreisSystemEntryID; + bDataContract.Name = _Name; + + bDataContract.CostRatePeriods = new List(); + + List crpList = _CostRatePeriods.CopyToDCList(doCommit); + foreach (var costRatePeriodDc in crpList) + { + if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value > 0) + bDataContract.CostRatePeriods.Add(costRatePeriodDc); + } + return bDataContract; } } diff --git a/BeWoPlanerMobil/App_Start/RouteConfig.cs b/BeWoPlanerMobil/App_Start/RouteConfig.cs index 73c275ec0..b2bb599e6 100644 --- a/BeWoPlanerMobil/App_Start/RouteConfig.cs +++ b/BeWoPlanerMobil/App_Start/RouteConfig.cs @@ -8,6 +8,7 @@ namespace BeWoPlanerMobil public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + routes.IgnoreRoute("{resource}.ashx/{*pathInfo}"); routes.MapRoute( name: "Login", diff --git a/BeWoPlanerMobil/App_Start/WebApiConfig.cs b/BeWoPlanerMobil/App_Start/WebApiConfig.cs index 5ce4d8a0a..48da4e20a 100644 --- a/BeWoPlanerMobil/App_Start/WebApiConfig.cs +++ b/BeWoPlanerMobil/App_Start/WebApiConfig.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Http; +using System.Web.Http; namespace BeWoPlanerMobil { diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 5fa863ac8..18302a1cc 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -54,14 +54,27 @@ ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll + False + + + + + + + + + + + + - - False - ..\Lib\log4net.dll + + + ..\packages\log4net.2.0.12\lib\net45\log4net.dll ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -161,11 +174,13 @@ + + @@ -211,6 +226,7 @@ + @@ -278,6 +294,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -286,11 +557,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -378,6 +723,7 @@ + Designer @@ -403,6 +749,8 @@ + + diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user b/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user index 5918dadf4..8e2df4fc8 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user @@ -12,13 +12,15 @@ ProjectFiles 600 MvcControllerEmptyScaffolder - root/Controller + root/Common/MVC/Controller 600 True False False ~/Views/Shared/_Layout.cshtml False + MvcViewScaffolder + root/Common/MVC/View diff --git a/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs b/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs new file mode 100644 index 000000000..9c659a0c5 --- /dev/null +++ b/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Web.Mvc; +using BeWoPlanerMobil.Models; +using BeWoPlanerMobil.Service; +using BeWoPlanerMobil.Views.DevExpressScheduler; +using BS.Shared.DataContracts; +using DevExpress.Web.Mvc; + +namespace BeWoPlanerMobil.Controllers +{ + public class DevExpressSchedulerController : AbstractBaseController + { + private DevExpressSchedulerModel _Model; + public DevExpressSchedulerModel Model + { + get + { + if (!MobileSessionFacade.IsUserLoggedIn()) + { + Logout(); + return null; + } + + if (((DevExpressSchedulerModel)Session["DevExpressSchedulerModel"])?.Employee == null) + { + _Model = new DevExpressSchedulerModel { Employee = MobileSessionFacade.LoggedInEmployee }; + Session["DevExpressSchedulerModel"] = _Model; + } + else + { + _Model = (DevExpressSchedulerModel)Session["DevExpressSchedulerModel"]; + } + + return _Model; + } + } + + [Authorize] + public ActionResult DevExpressScheduler() + { + if (!MobileSessionFacade.IsUserLoggedIn() || Model == null) + { + return RedirectToActionPermanent("Index", "Login"); + } + + var appointments = KalenderService.LoadFilteredAppointments( + true, + Model?.Employee?.EmployeeOid ?? 1, + DateTime.Today.AddDays(-60), + DateTime.Today.AddDays(60), + new List(), + new List(), + new List(), + false, + false, + false, + false, + false); + + Model.Appointments = appointments; + + return View(Model); + } + + [Authorize] + public ActionResult SchedulerPagePartial() + { + return PartialView("SchedulerPagePartial", Model); + } + + [Authorize] + public ActionResult EditAppointment() + { + UpdateAppointment(); + return PartialView("SchedulerPagePartial", Model); + } + + [Authorize] + private void UpdateAppointment() + { + var appointmentsToInsert = SchedulerExtension.GetAppointmentsToInsert(SchedulerHelper.GetSchedulerSettings(), Model.Appointments); + var appointmentsToUpdate = SchedulerExtension.GetAppointmentsToUpdate(SchedulerHelper.GetSchedulerSettings(), Model.Appointments); + var appointmentsToRemove = SchedulerExtension.GetAppointmentsToRemove(SchedulerHelper.GetSchedulerSettings(), Model.Appointments); + } + } +} \ No newline at end of file diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 5de7f0392..fb0b2f498 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -362,7 +362,7 @@ namespace BeWoPlanerMobil.Controllers foreach (var ziel in ziele.Where(z => z.ValueListEntryOid.HasValue)) { - var treeItem = new GoalTreeItem { Children = new List(), Header = ziel.DisplayName, ParentOid = ziel.ParentOid, ValueListEntryOid = ziel.ValueListEntryOid }; + var treeItem = new GoalTreeItem { Children = new List(), Header = ziel.DisplayName ?? string.Empty, ParentOid = ziel.ParentOid, ValueListEntryOid = ziel.ValueListEntryOid }; goalTreeDic.Add(ziel.ValueListEntryOid.Value, treeItem); @@ -392,8 +392,8 @@ namespace BeWoPlanerMobil.Controllers } } - var kind = new GoalTreeItem { Children = new List(), Header = ziel.DisplayName, IsLeaf = true, ValueListEntryOid = ziel.ValueListEntryOid, RatingName = ratingName}; - + var kind = new GoalTreeItem { Children = new List(), Header = ziel.DisplayName ?? string.Empty, IsLeaf = true, ValueListEntryOid = ziel.ValueListEntryOid, RatingName = ratingName}; + if(ziel.ParentOid != null && goalTreeDic.ContainsKey(ziel.ParentOid.Value)) { kind.ParentOid = goalTreeDic[ziel.ParentOid.Value].ParentOid; @@ -2250,6 +2250,16 @@ namespace BeWoPlanerMobil.Controllers return RedirectToMain(); } + [Authorize] + public ActionResult RedirectToDevExpressScheduler() + { + #if DEBUG + return RedirectToActionPermanent("DevExpressScheduler", "DevExpressScheduler"); + #endif + + return RedirectToMain(); + } + // Gruppenbuchungen [HttpPost] [Authorize] diff --git a/BeWoPlanerMobil/Global.asax.cs b/BeWoPlanerMobil/Global.asax.cs index 0f68f595b..fc871a623 100644 --- a/BeWoPlanerMobil/Global.asax.cs +++ b/BeWoPlanerMobil/Global.asax.cs @@ -5,6 +5,8 @@ using System.Web.Http; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; +using DevExpress.Web.Mvc; +using log4net.Config; namespace BeWoPlanerMobil @@ -22,9 +24,9 @@ namespace BeWoPlanerMobil FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); - - log4net.Config.XmlConfigurator.Configure(); - } + + XmlConfigurator.Configure(); + } protected void Application_BeginRequest(object sender, EventArgs e) { @@ -36,5 +38,10 @@ namespace BeWoPlanerMobil ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; } + + protected void Application_PreRequestHandlerExecute(object sender, EventArgs e) + { + DevExpressHelper.Theme = "Metropolis"; + } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/DevExpressSchedulerModel.cs b/BeWoPlanerMobil/Models/DevExpressSchedulerModel.cs new file mode 100644 index 000000000..d595268eb --- /dev/null +++ b/BeWoPlanerMobil/Models/DevExpressSchedulerModel.cs @@ -0,0 +1,17 @@ +using System.Collections; +using DevExpress.Web.ASPxScheduler; + +namespace BeWoPlanerMobil.Models +{ + public class DevExpressSchedulerModel : AbstractModel + { + public IEnumerable Appointments { get; set; } + } + + public class CustomAppointmentTemplateContainer : AppointmentFormTemplateContainer + { + public CustomAppointmentTemplateContainer(ASPxScheduler scheduler) : base(scheduler) { } + + public string CustomInfo => Appointment.CustomFields["AppointmentCustomField"] != null ? Appointment.CustomFields["AppointmentCustomField"].ToString() : ""; + } +} \ No newline at end of file diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/ace.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/ace.js new file mode 100644 index 000000000..be2be04b6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/ace.js @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/** + * The main class required to set up an Ace instance in the browser. + * + * @class Ace + **/ + +define(function(require, exports, module) { +"use strict"; + +require("./lib/fixoldbrowsers"); + +var dom = require("./lib/dom"); +var event = require("./lib/event"); + +var Range = require("./range").Range; +var Editor = require("./editor").Editor; +var EditSession = require("./edit_session").EditSession; +var UndoManager = require("./undomanager").UndoManager; +var Renderer = require("./virtual_renderer").VirtualRenderer; + +// The following require()s are for inclusion in the built ace file +require("./worker/worker_client"); +require("./keyboard/hash_handler"); +require("./placeholder"); +require("./multi_select"); +require("./mode/folding/fold_mode"); +require("./theme/textmate"); +require("./ext/error_marker"); + +exports.config = require("./config"); + +/** + * Provides access to require in packed noconflict mode + * @param {String} moduleName + * @returns {Object} + **/ +exports.require = require; + +if (typeof define === "function") + exports.define = define; + +/** + * Embeds the Ace editor into the DOM, at the element provided by `el`. + * @param {String | DOMElement} el Either the id of an element, or the element itself + * @param {Object } options Options for the editor + * + **/ +exports.edit = function(el, options) { + if (typeof el == "string") { + var _id = el; + el = document.getElementById(_id); + if (!el) + throw new Error("ace.edit can't find div #" + _id); + } + + if (el && el.env && el.env.editor instanceof Editor) + return el.env.editor; + + var value = ""; + if (el && /input|textarea/i.test(el.tagName)) { + var oldNode = el; + value = oldNode.value; + el = dom.createElement("pre"); + oldNode.parentNode.replaceChild(el, oldNode); + } else if (el) { + value = el.textContent; + el.innerHTML = ""; + } + + var doc = exports.createEditSession(value); + + var editor = new Editor(new Renderer(el), doc, options); + + var env = { + document: doc, + editor: editor, + onResize: editor.resize.bind(editor, null) + }; + if (oldNode) env.textarea = oldNode; + event.addListener(window, "resize", env.onResize); + editor.on("destroy", function() { + event.removeListener(window, "resize", env.onResize); + env.editor.container.env = null; // prevent memory leak on old ie + }); + editor.container.env = editor.env = env; + return editor; +}; + +/** + * Creates a new [[EditSession]], and returns the associated [[Document]]. + * @param {Document | String} text {:textParam} + * @param {TextMode} mode {:modeParam} + * + **/ +exports.createEditSession = function(text, mode) { + var doc = new EditSession(text, mode); + doc.setUndoManager(new UndoManager()); + return doc; +}; +exports.Range = Range; +exports.Editor = Editor; +exports.EditSession = EditSession; +exports.UndoManager = UndoManager; +exports.VirtualRenderer = Renderer; +exports.version = exports.config.version; +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.bowerrc b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.bowerrc new file mode 100644 index 000000000..0eedc4885 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.bowerrc @@ -0,0 +1,6 @@ +{ + "directory": "external", + "scripts": { + "postinstall": "node ./node_modules/cldr-data-downloader/bin/download.js -i external/cldr-data/index.json -o external/cldr-data/" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.eslintignore b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.eslintignore new file mode 100644 index 000000000..d01d0515f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.eslintignore @@ -0,0 +1,6 @@ +/dist/.build/ +/examples/ +/external/ +/src/build/ +/test/compiler/_compiled/ +/tmp/ diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.eslintrc.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.eslintrc.json new file mode 100644 index 000000000..ea95a6056 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.eslintrc.json @@ -0,0 +1,41 @@ +{ + "root": true, + "extends": "jquery", + "rules": { + "lines-around-comment": ["error", { "ignorePattern": "falls through" }], + "space-in-parens": "off" + }, + "overrides": [ + { + "files": [ + "script/**/*.js" + ], + "extends": "jquery", + "env": { + "node": true + } + }, + { + "files": [ + "dist/**/*.js" + ], + "env": { + "amd": true, + "node": true + }, + "globals": { + "Cldr": "readonly", + "Globalize": "readonly" + }, + "rules": { + "array-bracket-spacing": "off", + "computed-property-spacing": "off", + "max-len": "off", + "no-multiple-empty-lines": "off", + "no-nested-ternary": "off", + "no-unused-vars": "off", + "wrap-iife": "off" + } + } + ] +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.gitattributes b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.gitattributes new file mode 100644 index 000000000..b7ca95b5b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.gitattributes @@ -0,0 +1,5 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# JS files must always use LF for tools to work +*.js eol=lf diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.gitignore b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.gitignore new file mode 100644 index 000000000..f310183a3 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.gitignore @@ -0,0 +1,7 @@ +.sizecache.json +.tmp-globalize-webpack/ +dist/.build/ +external/ +node_modules/ +tmp/ +test/compiler/_compiled/ diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.mailmap b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.mailmap new file mode 100644 index 000000000..e2f31561c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.mailmap @@ -0,0 +1,10 @@ +Andreas Blixt +Boris Moore +Dave Reed +Ed Sanders +Fredrik Blomqvist +John Resig +Jörn Zaefferer +Richard D. Worth +Riku Nieminen +Stephen Walther diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.travis.yml b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.travis.yml new file mode 100644 index 000000000..19a70a1ec --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: +- '12' +before_install: +- npm install -g bower +install: +- npm install +- npm ls || echo # Avoid that `npm ls` aborts +- bower install diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/AUTHORS.txt b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/AUTHORS.txt new file mode 100644 index 000000000..d49161165 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/AUTHORS.txt @@ -0,0 +1,85 @@ +Authors ordered by number of contributions + +Rafael Xavier de Souza +Richard D. Worth +Eric Bréchemier +Jörn Zaefferer +Dave Reed +Nikolaus Graf +Timo Tijhof +Scott González +Nick Schonning +Kyle Florence +Nova Patch +Manraj Singh +Tobie Langel +Nikola Kovacs +Rob Garrison +John Reilly +hmizutanitsi +shivijais +Pavel Karoukin +Karan Sharma +Andrew Lunny +Wes Cravens +Michael Birtwell +Kris Borchers +Yasuhiro Yoshida +Oleg Gulverdashvili +Sean Cady +Andrey Stukalin +Éric Hernández <65465670+OfficialURL@users.noreply.github.com> +Georgi Tsaklev +Daniel Friesen +robaw <38808938+robaw@users.noreply.github.com> +Ashish Shubham +Phillip Wills +FND +Edward Salter +Matt York +Gethin Webster +gingerbbm +z.ky +Jac +Adam Brons +Christian Tellnes +Alex Sexton +Kemal Ahmed +Katie Sievert +Manikandan, Ramalingam Kandaswamy +Zack Birkenbuel +Reza Payami +Artur Eshenbrener +Marat Dyatko +Retsam +Devang Negandhi +manj +Grégoire Castre +Lee Nave +Brahim Arkni +Amanpreet Singh +Oleg Gaidarenko +Isaac Durazo +Ed Sanders +Kevin Kirsche +Tobias Nießen +Arvind Kalyan +Juan Soto +Luke Page +Mateusz Bożyk +Arthur Verschaeve +Riku Nieminen +Anne-Gaelle Colom +Raphael Amorim +Peter Dave Hello +Bao Ngo +Leonardo Balter +Andreas Blixt +Tomasz Peczek +Robert Plummer +Fredrik Blomqvist +Christian Vuerings +David De Sloovere +Boris Moore +John Resig +Stephen Walther diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/CONTRIBUTING.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/CONTRIBUTING.md new file mode 100644 index 000000000..c97f0fa99 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/CONTRIBUTING.md @@ -0,0 +1,5 @@ +Welcome! Thanks for your interest in contributing to Globalize. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). Before writing code for this project, be sure to read [Writing Code for jQuery Foundation Projects](http://contribute.jquery.org/code/). + +You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). + +You can find us on [Slack](https://globalizejs.slack.com/). If you're new, [join here](https://join.slack.com/t/globalizejs/shared_invite/enQtMjk4OTUwNzM1Nzk0LTk2YmY0YjY3Yzk4YzU3M2NkMDZjNThlNzcwNTkyNGJhNDhiNjdkMWUyN2Q2MjVmNTk0ZjkyNGQ3MWEyNzNmMWU). If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/Gruntfile.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/Gruntfile.js new file mode 100644 index 000000000..740c2d719 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/Gruntfile.js @@ -0,0 +1,655 @@ +/* eslint-env node */ +module.exports = function( grunt ) { + + "use strict"; + + var isConnectTestRunning, + rdefineEnd = /\}\);[^}\w]*$/, + pkg = grunt.file.readJSON( "package.json" ); + + function camelCase( input ) { + return input.toLowerCase().replace( /[-/](.)/g, function( _match, group1 ) { + return group1.toUpperCase(); + }); + } + + function mountFolder( connect, path ) { + return connect.static( require( "path" ).resolve( path ) ); + } + + function replaceConsts( content ) { + return content + + // Replace Version + .replace( /@VERSION/g, pkg.version ) + + // Replace Date yyyy-mm-ddThh:mmZ + .replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) ); + } + + grunt.initConfig({ + pkg: pkg, + authors: { + order: "count" + }, + commitplease: { + last: { + options: { + committish: "-n 2" + } + } + }, + connect: { + options: { + port: 9001, + hostname: "localhost" + }, + test: { + options: { + middleware: function( connect ) { + return [ + mountFolder( connect, "." ), + mountFolder( connect, "test" ) + ]; + } + } + }, + keepalive: { + options: { + keepalive: true, + middleware: function( connect ) { + return [ + mountFolder( connect, "." ) + ]; + } + } + } + }, + eslint: { + main: ".", + dist: "dist/" + }, + mochaTest: { + test: { + options: { + reporter: "spec" + }, + src: [ "test/compiler/*.js" ] + } + }, + qunit: { + functional: { + options: { + urls: [ + + // Use es5-shim here due to .bind(), which is not present on phantomjs v1.9. + // But, it should be on v2.x. + "http://localhost:<%= connect.options.port %>/functional-es5-shim.html" + ] + } + }, + unit: { + options: { + urls: [ "http://localhost:<%= connect.options.port %>/unit.html" ] + } + } + }, + requirejs: { + options: { + dir: "dist/.build", + appDir: "src", + baseUrl: ".", + optimize: "none", + paths: { + cldr: "../external/cldrjs/dist/cldr", + "make-plural": "../external/make-plural/make-plural", + messageformat: "../external/messageformat/messageformat", + "zoned-date-time": "../node_modules/zoned-date-time/src/zoned-date-time" + }, + shim: { + "zoned-date-time": { + exports: "ZonedDateTime" + } + }, + skipSemiColonInsertion: true, + skipModuleInsertion: true, + + // Strip all definitions generated by requirejs. + // Convert content as follows: + // a) "Single return" means the module only contains a return statement that is + // converted to a var declaration. + // b) "Module" means the define wrappers are removed, but content is untouched. + // Only for root id's (the ones in src, not in src's subpaths). Note there's no + // conditional code checking for this type. + onBuildWrite: function( id, _path, contents ) { + var messageformat, + name = camelCase( id.replace( /util\/|common\//, "" ) ); + + // MakePlural + if ( ( /make-plural/ ).test( id ) ) { + return contents + + // Remove browserify wrappers. + .replace( /^\(function\(f\){if\(typeof exports==="object"&&type.*/, "" ) + .replace( /\},\{\}\]\},\{\},\[1\]\)\(1\)[\s\S]*?$/, "" ) + + // Remove browserify exports. + .replace( /Object.defineProperty\(exports[\s\S]*?\n}\);/, "" ) + .replace( "exports['default'] = MakePlural;", "" ) + .replace( "module.exports = exports['default'];", "" ) + + // Remove self-tests. + .replace( /var Tests =[\s\S]*?\n}\)\(\);/, "" ) + .replace( "this.tests = new Tests(this);", "" ) + .replace( /this.fn.test =[\s\S]*?bind\(this\);/, "" ) + .replace( "this.tests.add(type, cat, examples);", "" ) + + // Remove load method. + .replace( /load: \{[\s\S]*?\n \}/, "" ) + + // Replace its wrapper into var assignment. + .replace( /\(function \(global\) \{/, [ + "var MakePlural;", + "/* eslint-disable */", + "MakePlural = (function() {" + ].join( "\n" ) ) + .replace( /if \(\(typeof module !== 'undefined'[\s\S]*/, [ + "return MakePlural;", + "}());", + "/* eslint-enable */" + ].join( "\n" ) ) + + // Wrap everything into a var assignment. + .replace( /^/, [ + "var MakePlural;", + "/* eslint-disable */", + "MakePlural = (function() {" + ].join( "\n" ) ) + .replace( /$/, [ + "return MakePlural;", + "}());", + "/* eslint-enable */" + ].join( "\n" ) ); + + // messageformat + } else if ( ( /messageformat/ ).test( id ) ) { + return contents + + // Remove browserify wrappers. + .replace( /^\(function\(f\)\{if\(typeof exports==="object"&&type.*/, "" ) + .replace( "},{}],2:[function(require,module,exports){", "" ) + .replace( /\},\{"\.\/messageformat-parser":1,"make-plural\/plural.*/, "" ) + .replace( /\},\{\}\]\},\{\},\[2\]\)\(2\)[\s\S]*?$/, "" ) + + // Set `MessageFormat.plurals` and remove `make-plural/plurals` + // completely. This is populated by Globalize on demand. + .replace( /var _cp = \[[\s\S]*?$/, "" ) + .replace( + "MessageFormat.plurals = require('make-plural/plurals')", + "MessageFormat.plurals = {}" + ) + + // Set `MessageFormat._parse` + .replace( + "MessageFormat._parse = require('./messageformat-parser').parse;", + "" + ) + .replace( /module\.exports = \(function\(\) \{([\s\S]*?)\n\}\)\(\);/, [ + "MessageFormat._parse = (function() {", + "$1", + "}()).parse;" + ].join( "\n" ) ) + + // Remove unused code. + .replace( /if \(!pluralFunc\) \{\n[\s\S]*?\n \}/, "" ) + .replace( /if \(!locale\) \{\n[\s\S]*? \}\n/, "this.lc = [locale];" ) + .replace( /(MessageFormat\.formatters) = \{[\s\S]*?\n\};/, "$1 = {};" ) + .replace( /MessageFormat\.prototype\.setIntlSupport[\s\S]*?\n\};/, "" ) + + // Wrap everything into a var assignment. + .replace( "module.exports = MessageFormat;", "" ) + .replace( /^/, [ + "var MessageFormat;", + "/* eslint-disable */", + "MessageFormat = (function() {" + ].join( "\n" ) ) + .replace( /$/, [ + "return MessageFormat;", + "}());", + "/* eslint-enable */" + ].join( "\n" ) ); + + // message-runtime + } else if ( ( /message-runtime/ ).test( id ) ) { + messageformat = require( "./external/messageformat/messageformat" ); + delete messageformat.prototype.runtime.fmt; + delete messageformat.prototype.runtime.pluralFuncs; + contents = contents.replace( "Globalize._messageFormat = {};", [ + "/* eslint-disable */", + "Globalize._messageFormat = (function() {", + messageformat.prototype.runtime.toString(), + "return {number: number, plural: plural, select: select};", + "}());", + "/* eslint-enable */" + ].join( "\n" ) ); + + // ZonedDateTime + } else if ( ( /zoned-date-time/ ).test( id ) ) { + contents = contents.replace( + "if (typeof module !== \"undefined\" && module.exports) {\n" + + " module.exports = ZonedDateTime;\n}", + "return ZonedDateTime;" + ); + contents = "var ZonedDateTime = (function() {\n" + contents + "}());"; + } + + // 1, and 2: Remove define() wrap. + // 3: Remove empty define()'s. + contents = contents + .replace( /define\([^{]*?\{/, "" ) /* 1 */ + .replace( rdefineEnd, "" ) /* 2 */ + .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" ); /* 3 */ + + // Type b (not as simple as a single return) + if ( [ "expand-pattern/augment-format" ].indexOf( id ) !== -1 ) { + contents = "var " + name + " = (function() {" + contents + "}());"; + + // Type a (single return) + } else if ( ( /\// ).test( id ) ) { + contents = contents + .replace( /\nreturn/, "\nvar " + name + " =" ); + } + + return contents; + } + }, + bundle: { + options: { + modules: [ + { + name: "globalize", + include: [ "core" ], + exclude: [ "cldr", "cldr/event" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-core.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.currency", + include: [ "currency" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core", + "./number" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-currency.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.date", + include: [ "date" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core", + "./number" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-date.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.message", + include: [ "message" ], + exclude: [ "cldr", "./core" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-message.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.number", + include: [ "number" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-number.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.plural", + include: [ "plural" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-plural.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.relative-time", + include: [ "relative-time" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core", + "./number", + "./plural" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-relative-time.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.unit", + include: [ "unit" ], + exclude: [ + "cldr", + "./core", + "./number", + "./plural" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-unit.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize-runtime", + include: [ "core-runtime" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-core-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.currency-runtime", + include: [ "currency-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-currency-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.date-runtime", + include: [ "date-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-date-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.message-runtime", + include: [ "message-runtime" ], + exclude: [ "./core-runtime" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-message-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.number-runtime", + include: [ "number-runtime" ], + exclude: [ + "./core-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-number-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.plural-runtime", + include: [ "plural-runtime" ], + exclude: [ + "./core-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-plural-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.relative-time-runtime", + include: [ "relative-time-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime", + "./plural-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-relative-time-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.unit-runtime", + include: [ "unit-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime", + "./plural-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-unit-runtime.js", + endFile: "src/build/outro.js" + } + } + } + ] + } + } + }, + watch: { + files: [ "src/*.js", "test/functional/**/*.js", "test/unit/**/*.js", "test/*.html" ], + tasks: [ "default" ] + }, + copy: { + options: { + processContent: function( content ) { + + // Remove leftover define created during rjs build + content = content.replace( /define\(".*/, "" ); + + // Embed VERSION and DATE + return replaceConsts( content ); + } + }, + coreAndRuntime: { + expand: true, + cwd: "dist/.build/", + src: [ "globalize.js", "globalize-runtime.js" ], + dest: "dist/" + }, + modules: { + expand: true, + cwd: "dist/.build/", + src: [ "globalize*.js", "!globalize.js", "!*runtime*.js" ], + dest: "dist/globalize", + rename: function( dest, src ) { + return require( "path" ).join( dest, src.replace( /globalize\./, "" ) ); + } + }, + runtimeModules: { + expand: true, + cwd: "dist/.build/", + src: [ "globalize.*runtime.js" ], + dest: "dist/globalize-runtime", + rename: function( dest, src ) { + return require( "path" ).join( dest, src.replace( /(globalize\.|-runtime)/g, "" ) ); + } + }, + allInOneNode: { + src: "src/build/node-main.js", + dest: "dist/node-main.js" + } + }, + uglify: { + options: { + banner: replaceConsts( grunt.file.read( "src/build/intro.min.js" ) ) + }, + dist: { + files: { + "tmp/globalize.min.js": [ "dist/globalize.js" ], + "tmp/globalize/currency.min.js": [ "dist/globalize/currency.js" ], + "tmp/globalize/date.min.js": [ "dist/globalize/date.js" ], + "tmp/globalize/number.min.js": [ "dist/globalize/number.js" ], + "tmp/globalize/plural.min.js": [ "dist/globalize/plural.js" ], + "tmp/globalize/message.min.js": [ "dist/globalize/message.js" ], + "tmp/globalize/relative-time.min.js": [ "dist/globalize/relative-time.js" ], + "tmp/globalize/unit.min.js": [ "dist/globalize/unit.js" ], + + "tmp/globalize-runtime.min.js": [ "dist/globalize-runtime.js" ], + "tmp/globalize-runtime/currency.min.js": [ + "dist/globalize-runtime/currency.js" + ], + "tmp/globalize-runtime/date.min.js": [ "dist/globalize-runtime/date.js" ], + "tmp/globalize-runtime/message.min.js": [ "dist/globalize-runtime/message.js" ], + "tmp/globalize-runtime/number.min.js": [ "dist/globalize-runtime/number.js" ], + "tmp/globalize-runtime/plural.min.js": [ "dist/globalize-runtime/plural.js" ], + "tmp/globalize-runtime/relative-time.min.js": [ + "dist/globalize-runtime/relative-time.js" + ], + "tmp/globalize-runtime/unit.min.js": [ "dist/globalize-runtime/unit.js" ] + } + } + }, + + // TODO figure out how to specify exceptions for externals + "compare_size": { + files: [ + "tmp/globalize.min.js", + "tmp/globalize/*min.js", + "tmp/globalize-runtime.min.js", + "tmp/globalize-runtime/*min.js" + ], + options: { + compress: { + gz: function( fileContents ) { + return require( "gzip-js" ).zip( fileContents, {}).length; + } + } + } + }, + clean: { + dist: [ + "dist" + ] + }, + checkDependencies: { + bower: { + options: { + packageManager: "bower" + } + }, + npm: { + options: { + packageManager: "npm" + } + } + } + }); + + require( "matchdep" ).filterDev( "grunt-*" ).forEach( grunt.loadNpmTasks ); + + grunt.registerTask( "test", function() { + var args = [].slice.call( arguments ); + if ( !isConnectTestRunning ) { + grunt.task.run( "checkDependencies" ); + grunt.task.run( "connect:test" ); + isConnectTestRunning = true; + } + grunt.task.run( [ "qunit" ].concat( args ).join( ":" ) ); + }); + + // Default task. + grunt.registerTask( "default", [ + "eslint:main", + + "test:unit", + "clean", + "requirejs", + "copy", + "eslint:dist", + + "test:functional", + "mochaTest", + "uglify", + "compare_size", + "commitplease" + ]); + +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/LICENSE b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/LICENSE new file mode 100644 index 000000000..9b7baf96e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/LICENSE @@ -0,0 +1,20 @@ +Copyright OpenJS Foundation and other contributors, https://openjsf.org + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/README.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/README.md new file mode 100644 index 000000000..c3a069b43 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/README.md @@ -0,0 +1,818 @@ +# Globalize + +[![Build Status](https://secure.travis-ci.org/globalizejs/globalize.svg?branch=master)](http://travis-ci.org/globalizejs/globalize) +[![devDependency Status](https://david-dm.org/globalizejs/globalize/status.svg)](https://david-dm.org/globalizejs/globalize#info=dependencies) +[![devDependency Status](https://david-dm.org/globalizejs/globalize/dev-status.svg)](https://david-dm.org/globalizejs/globalize#info=devDependencies) + +A JavaScript library for internationalization and localization that leverage the official [Unicode CLDR](http://cldr.unicode.org/) JSON data. The library works both for the browser and as a +Node.js module. + +- [About Globalize](#about-globalize) + - [Why globalization?](#why-globalization) + - [Why Globalize?](#why-globalize) + - [Migrating from Globalize 0.x](#migrating-from-globalize-0x) + - [Where to use it?](#where-to-use-it) + - [Where does the data come from?](#where-does-the-data-come-from) + - [Only load and use what you need](#pick-the-modules-you-need) + - [Browser support](#browser-support) +- [Getting started](#getting-started) + - [Requirements](#requirements) + - [Installation](#installation) + - [Usage](#usage) + - [Performance](#performance) + - [Compilation and the Runtime modules](#compilation-and-the-runtime-modules) + - [Examples](#examples) + - [Community](#community) +- [API](#api) + - [Core](#core-module) + - [Date module](#date-module) + - [Message module](#message-module) + - [Number module](#number-module) + - [Currency module](#currency-module) + - [Plural module](#plural-module) + - [Relative time module](#relative-time-module) + - [Unit module](#unit-module) + - more to come... +- [Error reference](#error-reference) +- [Contributing](#contributing) + - [Roadmap](#roadmap) +- [Development](#development) + - [File structure](#file-structure) + - [Source files](#source-files) + - [Tests](#tests) + - [Build](#build) + + +## About Globalize + +### Why globalization? + +Each language, and the countries that speak that language, have different expectations when it comes to how numbers (including currency and percentages) and dates should appear. Obviously, each language has different names for the days of the week and the months of the year. But they also have different expectations for the structure of dates, such as what order the day, month and year are in. In number formatting, not only does the character used to delineate number groupings and the decimal portion differ, but the placement of those characters differ as well. + +A user using an application should be able to read and write dates and numbers in the format they are accustomed to. This library makes this possible, providing an API to convert user-entered number and date strings - in their own format - into actual numbers and dates, and conversely, to format numbers and dates into that string format. + +Even if the application deals only with the English locale, it may still need globalization to format programming language bytes into human-understandable language and vice-versa in an effective and reasonable way. For example, to display something better than "Edited 1 minutes ago". + +### Why Globalize? + +Globalize provides number formatting and parsing, date and time formatting and parsing, currency formatting, message formatting (ICU message format pattern), and plural support. + +Design Goals. + +- Leverages the Unicode CLDR data and follows its UTS#35 specification. +- Keeps code separate from i18n content. Doesn't host or embed any locale data in the library. Empowers developers to control the loading mechanism of their choice. +- Allows developers to load as much or as little data as they need. Avoids duplicating data if using multiple i18n libraries that leverage CLDR. +- Keeps code modular. Allows developers to load the i18n functionalities they need. +- Runs in browsers and Node.js, consistently across all of them. +- Makes globalization as easy to use as jQuery. + +Globalize is based on the Unicode Consortium's Common Locale Data Repository (CLDR), the largest and most extensive standard repository of locale data available. CLDR is constantly updated and is used by many large applications and operating systems, so you'll always have access to the most accurate and up-to-date locale data. + +Globalize needs CLDR content to function properly, although it doesn't embed, hard-code, or host such content. Instead, Globalize empowers developers to load CLDR data the way they want. Vanilla CLDR in its official JSON format (no pre-processing) is expected to be provided. As a consequence, (a) Globalize avoids bugs caused by outdated i18n content. Developers can use up-to-date CLDR data directly from Unicode as soon as it's released, without having to wait for any pipeline on our side. (b) Developers have full control over which locale coverage they want to provide on their applications. (c) Developers are able to share the same i18n dataset between Globalize and other libraries that leverage CLDR. There's no need for duplicating data. + +Globalize is systematically tested against desktop and mobile browsers and Node.js. So, using it you'll get consistent results across different browsers and across browsers and the server. + +Globalize doesn't use native Ecma-402 yet, which could potentially improve date and number formatting performance. Although Ecma-402 support is improving among modern browsers and even Node.js, the functionality and locale coverage level varies between different environments (see Comparing JavaScript Libraries [slide 25][]). Globalize needs to do more research and testings to use it reliably. + +For alternative libraries and more, check out this [JavaScript globalization overview][]. + +[slide 25]: http://jsi18n.com/jsi18n.pdf +[JavaScript globalization overview]: http://rxaviers.github.io/javascript-globalization/ + +### Migrating from Globalize 0.x + +Are you coming from Globalize 0.x? Read our [migration guide][] to learn what have changed and how to migrate older 0.x code to up-to-date 1.x. + +[migration guide]: doc/migrating-from-0.x.md + +### Where to use it? + +Globalize is designed to work both in the [browser](#browser-support), or in [Node.js](#usage). It supports both [AMD](#usage) and [CommonJS](#usage). + +### Where does the data come from? + +Globalize uses the [Unicode CLDR](http://cldr.unicode.org/), the largest and most extensive standard repository of locale data. + +We do NOT embed any i18n data within our library. However, we make it really easy to use. Read [How to get and load CLDR JSON data](#2-cldr-content) for more information on its usage. + +### Pick the modules you need + +| File | Minified + gzipped size | Runtime minified + gzipped size | Summary | +| -------------------------- | ----------------------: | ------------------------------: | ------------------------------------------------------------ | +| globalize.js | 1.7KB | 1.1KB | [Core library](#core-module) | +| globalize/currency.js | 3.0KB | 0.7KB | [Currency module](#currency-module) provides currency formatting | +| globalize/date.js | 7.7KB | 4.3KB | [Date module](#date-module) provides date formatting and parsing | +| globalize/message.js | 5.3KB | 0.7KB | [Message module](#message-module) provides ICU message format support | +| globalize/number.js | 4.4KB | 2.6KB | [Number module](#number-module) provides number formatting and parsing | +| globalize/plural.js | 2.3KB | 0.4KB | [Plural module](#plural-module) provides pluralization support | +| globalize/relative-time.js | 0.8KB | 0.5KB | [Relative time module](#relative-time-module) provides relative time formatting support | +| globalize/unit.js | 0.9KB | 0.6KB | [Unit module](#unit-module) provides unit formatting support | + +### Browser Support + +Globalize 1.x supports the following browsers: + +- Chrome: (Current - 1) or Current +- Firefox: (Current - 1) or Current +- Safari: 5.1+ +- Opera: 12.1x, (Current - 1) or Current +- IE9+ + +*(Current - 1)* or *Current* denotes that we support the current stable version of the browser and the version that preceded it. For example, if the current version of a browser is 24.x, we support the 24.x and 23.x versions. + +## Getting Started + + npm install globalize cldr-data iana-tz-data + +```js +var Globalize = require( "globalize" ); +Globalize.load( require( "cldr-data" ).entireSupplemental() ); +Globalize.load( require( "cldr-data" ).entireMainFor( "en", "es" ) ); +Globalize.loadTimeZone( require( "iana-tz-data" ) ); + +Globalize("en").formatDate(new Date()); +// > "11/27/2015" + +Globalize("es").formatDate(new Date()); +// > "27/11/2015" +``` + +Note `cldr-data` is an optional module, read [CLDR content](#2-cldr-content) section below for more information on how to get CLDR from different sources. + +The [`iana-tz-data`](https://github.com/rxaviers/iana-tz-data) module is only needed when IANA time zones (via `options.timeZone`) are used with date functions. Read [IANA time zone data](#3-iana-time-zone-data) below for more information. + +Read the [Locales section](#locales) for more information about supported locales. For AMD, bower and other usage examples, see [Examples section](#examples). + +### Installation + +#### Downloading a ZIP or tarball archive + +Click the GitHub [releases tab](https://github.com/globalizejs/globalize/releases) and download the latest available Globalize package. + +#### Using a package manager + +You can use either npm or bower: + +- `npm install globalize` +- `bower install globalize` + +#### Building from source + +1. `git clone https://github.com/globalizejs/globalize.git` +2. [Build the distribution files](#build) + +### Requirements + +#### 1. Dependencies + +If you use module loading like ES6 import, CommonJS, or AMD and fetch your code using package managers like *npm* or *bower*, you don't need to worry about this and can skip reading this section. Otherwise, you need to satisfy Globalize dependencies prior to using it. There is only one external dependency: [cldr.js][], which is a CLDR low level manipulation tool. Additionally, you need to satisfy the cross-dependencies between modules. + +| Module | Dependencies (load in order) | +| -------------------- | ---------------------------------------- | +| Core module | [cldr.js][] | +| Currency module | globalize.js (core), globalize/number.js, and globalize/plural.js (only required for "code" or "name" styles) | +| Date module | globalize.js (core) and globalize/number.js | +| Message module | globalize.js (core) and globalize/plural.js (if using messages that need pluralization support) | +| Number module | globalize.js (core) | +| Plural | globalize.js (core) | +| Relative time module | globalize.js (core), globalize/number.js, and globalize/plural.js | +| Unit module | globalize.js (core), globalize/number.js, and globalize/plural.js | + +As an alternative to deducing this yourself, use this [online tool](http://johnnyreilly.github.io/globalize-so-what-cha-want/). The tool allows you to select the modules you're interested in using and tells you the Globalize files *and* CLDR JSON that you need. + +[cldr.js]: https://github.com/rxaviers/cldrjs + +#### 2. CLDR content + +Globalize is the i18n software (the engine). Unicode CLDR is the i18n content (the fuel). You need to feed Globalize on the appropriate portions of CLDR prior to using it. + +*(a) How do I figure out which CLDR portions are appropriate for my needs?* + +Each Globalize function requires a special set of CLDR portions. Once you know which Globalize functionalities you need, you can deduce its respective CLDR requirements. See table below. + +| Module | Required CLDR JSON files | +| -------------------- | ---------------------------------------- | +| Core module | cldr/supplemental/likelySubtags.json | +| Currency module | cldr/main/`locale`/currencies.json
cldr/supplemental/currencyData.json
+CLDR JSON files from number module
+CLDR JSON files from plural module for name style support | +| Date module | cldr/main/`locale`/ca-gregorian.json
cldr/main/`locale`/timeZoneNames.json
cldr/supplemental/metaZones.json
cldr/supplemental/timeData.json
cldr/supplemental/weekData.json
+CLDR JSON files from number module | +| Number module | cldr/main/`locale`/numbers.json
cldr/supplemental/numberingSystems.json | +| Plural module | cldr/supplemental/plurals.json (for cardinals)
cldr/supplemental/ordinals.json (for ordinals) | +| Relative time module | cldr/main/`locale`/dateFields.json
+CLDR JSON files from number and plural modules | +| Unit module | cldr/main/`locale`/units.json
+CLDR JSON files from number and plural module | + +As an alternative to deducing this yourself, use this [online tool](http://johnnyreilly.github.io/globalize-so-what-cha-want/). The tool allows you to select the modules you're interested in using and tells you the Globalize files *and* CLDR JSON that you need. + +*(b) How am I supposed to get and load CLDR content?* + +Learn [how to get and load CLDR content...](doc/cldr.md) and use +[`Globalize.load()`](#core-module) to load it. + +#### 3. IANA time zone data + +The IANA time zone (tz) database, sometimes called the Olson database, is the standard data used by Unicode CLDR, ECMA-402, Linux, UNIX, Java, ICU, and others. It's used by Globalize to circumvent the JavaScript limitations with respect to manipulating date in time zones other than the user's environment. + +In short, feed Globalize on IANA time zone data if you need to format or parse dates in a specific time zone, independently of the user's environment, e.g., `America/Los_Angeles`. + +It's important to note there's no official IANA time zone data in the JSON format. Therefore, [`iana-tz-data`](https://github.com/rxaviers/iana-tz-data) has been adopted for convenience. + +Learn more on [`Globalize.loadTimeZone()`](#date-module). + +### Usage + +Globalize's consumable-files are located in the `./dist` directory. If you don't find it, it's because you are using a development branch. You should either use a tagged version or [build the distribution files yourself](#build). Read [installation](#installation) above if you need more information on how to download. + +Globalize can be used for a variety of different i18n tasks, eg. formatting or parsing dates, formatting or parsing numbers, formatting messages, etc. You may NOT need Globalize in its entirety. For that reason, we made it modular. So, you can cherry-pick the pieces you need, eg. load `dist/globalize.js` to get Globalize core, load `dist/globalize/date.js` to extend Globalize with Date functionalities, etc. + +An example is worth a thousand words. Check out our [Examples](#examples) section below. + +### Performance + +When formatting or parsing, there's actually a two-step process: (a) the formatter (or parser) *creation* and (b) its *execution*, where creation takes an order of magnitude more time (more expensive) than execution. In the creation phase, Globalize traverses the CLDR tree, processes data (e.g., expands date patterns, parses plural rules, etc), and returns a function that actually executes the formatting or parsing. + +```js +// Formatter creation. +var formatter = Globalize.numberFormatter(); + +// Formatter execution (roughly 10x faster than above). +formatter( Math.PI ); +// > 3.141 +``` + +As a rule of thumb for optimal performance, cache your formatters and parsers. For example: (a) on iterations, generate them outside the loop and reuse while looping; (b) on server applications, generate them in advance and execute when requests arrive. + +### Compilation and the Runtime modules + +Take advantage of compiling your formatters and/or parsers during build time when deploying to production. It's much faster than generating them in real-time and it's also much smaller (i.e., better loading performance). + +Your compiled formatters and parsers allow you to skip a big part of the library and also allow you to skip loading CLDR data, because they have already been created (see [Performance](#performance) above for more information). + +To illustrate, see our [Basic Globalize Compiler example][]. + + +#### Globalize Compiler + +For information about the Globalize Compiler CLI or its JavaScript API, see the [Globalize Compiler documentation][]. + +[Globalize Compiler documentation]: https://github.com/globalizejs/globalize-compiler#README + +### Examples + +The fastest and easiest way to use Globalize is by integrating it into your existing tools. + +- [Application example using webpack and npm](examples/app-npm-webpack/): easy to get started, automated CLDR loading and precompilation for production, but requires npm and webpack knowledge. +- [Application example using globalize-express middleware with any express web app](https://github.com/devangnegandhi/globalize-express/tree/master/example): easy to incorporate globalize as a middleware within your Express web app. (also checkout [globalize-express](https://github.com/devangnegandhi/globalize)) + +If you're using a different tool than the one above, but you're comfortable using JavaScript modules (such as ES6 modules, CommonJS, or AMD) and package managers like npm or bower, you may want to check out the following examples. Note you'll need to compile your code for production yourself. + +- [Basic example using AMD and bower](examples/amd-bower/): feeding Globalize on CLDR is not completely transparent. +- [Basic example using Node.js and npm](examples/node-npm/): feeding Globalize on CLDR is not completely transparent. +- [Basic Globalize Compiler example][]: shows how to use Globalize Compiler CLI. + +[Basic Globalize Compiler example]: examples/globalize-compiler/ + +If you're using none of the tools above, but instead you're using the plain and old script tags only, the following example may interest you. Note Globalize allows you to go low level like this. But, acknowledge that you'll need to handle dependencies and CLDR loading manually yourself. + +- [Basic example using plain JavaScript](examples/plain-javascript/): requires loading CLDR and handling dependencies manually. + +### Community + +You can find us on [Slack](https://globalizejs.slack.com/). If you're new, [join here](https://join.slack.com/t/globalizejs/shared_invite/zt-3tc3js1e-ETn09rNHL_5fclun8jtckQ). + +## API + +### Core module + +#### `Globalize.load( cldrJSONData, ... )` + +This method allows you to load CLDR JSON locale data. `Globalize.load()` is a proxy to `Cldr.load()`. [Read more...](doc/api/core/load.md) + +#### `Globalize.locale( [locale|cldr] )` + +Set default locale, or get it if locale argument is omitted. [Read more...](doc/api/core/locale.md) + +#### `[new] Globalize( locale|cldr )` + +Create a Globalize instance. [Read more...](doc/api/core/constructor.md) + +#### Locales + +A locale is an identifier (id) that refers to a set of user preferences that tend to be shared across significant swaths of the world. In technical terms, it's a String composed of three parts: language, script, and region. For example: + +| locale | description | +| ------------ | ---------------------------------------- | +| *en-Latn-US* | English as spoken in the Unites States in the Latin script. | +| *en-US* | English as spoken in the Unites States (Latin script is deduced given it's the most likely script used in this place). | +| *en* | English (United States region and Latin script are deduced given they are respectively the most likely region and script used in this place). | +| *en-GB* | English as spoken in the United Kingdom (Latin script is deduced given it's the most likely script used in this place). | +| *en-IN* | English as spoken in India (Latin script is deduced). | +| *es* | Spanish (Spain region and Latin script are deduced). | +| *es-MX* | Spanish as spoken in Mexico (Latin script is deduced). | +| *zh* | Chinese (China region and Simplified Han script are deduced). | +| *zh-TW* | Chinese as spoken in Taiwan (Traditional Han script is deduced). | +| *ja* | Japanese (Japan region and Japanese script are deduced). | +| *de* | German (Germany region and Latin script are deduced). | +| *pt* | Portuguese (Brazil region and Latin script are deduced). | +| *pt-PT* | Portuguese as spoken in Portugal (Latin script is deduced). | +| *fr* | French (France region and Latin script are deduced). | +| *ru* | Russian (Russia region and Cyrillic script are deduced). | +| *ar* | Arabic (Egypt region and Arabic script are deduced). | + +The likely deductibility is computed by using CLDR data, which is based on the population and the suppress-script data in BCP47 (among others). The data is heuristically derived, and may change over time. + +Figure out the deduced information by looking at the `cldr.attributes.maxLanguageId` property of a Globalize instance: + +```js +var Globalize = require( "globalize" ); +Globalize.load( require( "cldr-data" ).entireSupplemental() ); +Globalize( "en" ).cldr.attributes.maxLanguageId; +// > "en-Latn-US" +``` + +Globalize supports all the locales available in CLDR, which are around 740. For more information, search for coverage charts at the downloads section of http://cldr.unicode.org/. + +Read more details about locale at [UTS#35 locale][]. + +[UTS#35 locale]: http://www.unicode.org/reports/tr35/#Locale + +### Date module + +#### `Globalize.loadTimeZone( ianaTzData )` + +This method allows you to load IANA time zone data to enable `options.timeZone` feature on date formatters and parsers. + +[Read more...](doc/api/date/load-iana-time-zone.md) + +#### `.dateFormatter( [options] )` + +Return a function that formats a date according to the given `options`. The default formatting is numeric year, month, and day (i.e., `{ skeleton: "yMd" }`. + +```javascript +.dateFormatter()( new Date() ) +// > "11/30/2010" + +.dateFormatter({ skeleton: "GyMMMd" })( new Date() ) +// > "Nov 30, 2010 AD" + +.dateFormatter({ date: "medium" })( new Date() ) +// > "Nov 1, 2010" + +.dateFormatter({ time: "medium" })( new Date() ) +// > "5:55:00 PM" + +.dateFormatter({ datetime: "medium" })( new Date() ) +// > "Nov 1, 2010, 5:55:00 PM" + +.dateFormatter({ datetime: "full", timeZone: "America/New_York" })( new Date() ); +// > "Monday, November 1, 2010 at 3:55:00 AM Eastern Daylight Time" + +.dateFormatter({ datetime: "full", timeZone: "America/Los_Angeles" })( new Date() ); +// > "Monday, November 1, 2010 at 12:55:00 AM Pacific Daylight Time" +``` + +[Read more...](doc/api/date/date-formatter.md) + +#### `.dateToPartsFormatter( [options] )` + +Return a function that formats a date into parts tokens according to the given `options`. The default formatting is numeric year, month, and day (i.e., `{ skeleton: "yMd" }`. + +```javascript +.dateToPartsFormatter()( new Date() ) +// > [ +// { "type": "month", "value": "3" }, +// { "type": "literal", "value": "/" }, +// { "type": "day", "value": "17" }, +// { "type": "literal", "value": "/" }, +// { "type": "year", "value": "2017" } +// ] +``` + +[Read more...](doc/api/date/date-to-parts-formatter.md) + +#### `.dateParser( [options] )` + +Return a function that parses a string representing a date into a JavaScript Date object according to the given `options`. The default parsing assumes numeric year, month, and day (i.e., `{ skeleton: "yMd" }`). + +```javascript +.dateParser()( "11/30/2010" ) +// > new Date( 2010, 10, 30, 0, 0, 0 ) + +.dateParser({ skeleton: "GyMMMd" })( "Nov 30, 2010 AD" ) +// > new Date( 2010, 10, 30, 0, 0, 0 ) + +.dateParser({ date: "medium" })( "Nov 1, 2010" ) +// > new Date( 2010, 10, 30, 0, 0, 0 ) + +.dateParser({ time: "medium" })( "5:55:00 PM" ) +// > new Date( 2015, 3, 22, 17, 55, 0 ) // i.e., today @ 5:55PM + +.dateParser({ datetime: "medium" })( "Nov 1, 2010, 5:55:00 PM" ) +// > new Date( 2010, 10, 30, 17, 55, 0 ) +``` + +[Read more...](doc/api/date/date-parser.md) + +#### `.formatDate( value [, options] )` + +Alias for `.dateFormatter( [options] )( value )`. + +#### `.formatDateToParts( value [, options] )` + +Alias for `.dateToPartsFormatter( [options] )( value )`. + +#### `.parseDate( value [, options] )` + +Alias for `.dateParser( [options] )( value )`. + +### Message module + +#### `Globalize.loadMessages( json )` + +Load messages data. [Read more...](doc/api/message/load-messages.md) + +#### `.messageFormatter( path ) ➡ function( [variables] )` + +Return a function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. + +```javascript +.messageFormatter( "task" )( 1000 ) +// > "You have 1,000 tasks remaining" + +.messageFormatter( "like" )( 3 ) +// > "You and 2 others liked this" +``` + +[Read more...](doc/api/message/message-formatter.md) + +#### `.formatMessage( path [, variables ] )` + +Alias for `.messageFormatter( path )([ variables ])`. + +### Number module + +#### `.numberFormatter( [options] )` + +Return a function that formats a number according to the given options or locale's defaults. + +```javascript +.numberFormatter()( pi ) +// > "3.142" + +.numberFormatter({ maximumFractionDigits: 5 })( pi ) +// > "3.14159" + +.numberFormatter({ round: "floor" })( pi ) +// > "3.141" + +.numberFormatter({ minimumFractionDigits: 2 })( 10000 ) +// > "10,000.00" + +.numberFormatter({ style: "percent" })( 0.5 ) +// > "50%" + +.numberFormatter({ compact: "short", maximumFractionDigits: 0 })( 14305 ) +// > "14K" +``` + +[Read more...](doc/api/number/number-formatter.md) + +#### `.numberToPartsFormatter( [options] )` + +Return a function that formats a number into parts tokens according to the given options or locale's defaults. + +```javascript +.numberToPartsFormatter()( new Date() ) +// > [ +// { "type": "integer", "value": "3" }, +// { "type": "decimal", "value": "." }, +// { "type": "fraction", "value": "142" } +// ] +``` + +[Read more...](doc/api/number/number-to-parts-formatter.md) + +#### `.numberParser( [options] )` + +Return a function that parses a string representing a number according to the given options or locale's defaults. + +```javascript +.numberParser()( "3.14159" ) +// > 3.14159 + +.numberParser()( "10,000.00" ) +// > 10000 + +.numberParser({ style: "percent" })( "50%" ) +// > 0.5 +``` + +[Read more...](doc/api/number/number-parser.md) + +#### `.formatNumber( value [, options] )` + +Alias for `.numberFormatter( [options] )( value )`. + +#### `.formatNumberToParts( value [, options] )` + +Alias for `.numberToPartsFormatter( [options] )( value )`. + +#### `.parseNumber( value [, options] )` + +Alias for `.numberParser( [options] )( value )`. + +### Currency module + +#### `.currencyFormatter( currency [, options] )` + +Return a function that formats a currency according to the given options or locale's defaults. + +```javascript +.currencyFormatter( "USD" )( 1 ) +// > "$1.00" + +.currencyFormatter( "USD", { style: "accounting" })( -1 ) +// > "($1.00)" + +.currencyFormatter( "USD", { style: "name" })( 69900 ) +// > "69,900.00 US dollars" + +.currencyFormatter( "USD", { style: "code" })( 69900 ) +// > "69,900.00 USD" + +.currencyFormatter( "USD", { round: "ceil" })( 1.491 ) +// > "$1.50" +``` + +[Read more...](doc/api/currency/currency-formatter.md) + +#### `.currencyToPartsFormatter( currency [, options] )` + +Return a function that formats a currency into parts tokens according to the given options or locale's defaults. + +```javascript +.currencyToPartsFormatter()( new Date() ) +// > [ +// { "type": "currency", "value": "USD" }, +// { "type": "literal", "value": " " }, +// { "type": "integer", "value": "69" }, +// { "type": "group", "value": "," }, +// { "type": "integer", "value": "900" }, +// { "type": "decimal", "value": "." }, +// { "type": "fraction", "value": "00" } +// ] +``` + +[Read more...](doc/api/currency/currency-to-parts-formatter.md) + +#### `.formatCurrency( value, currency [, options] )` + +Alias for `.currencyFormatter( currency [, options] )( value )`. + +#### `.formatCurrencyToParts( value, currency [, options] )` + +Alias for `.currencyToPartsFormatter( currency [, options] )( value )`. + +### Plural module + +#### `.pluralGenerator( [options] )` + +Return a function that returns the value's corresponding plural group: `zero`, `one`, `two`, `few`, `many`, or `other`. + +The function may be used for cardinals or ordinals. + +```javascript +.pluralGenerator()( 0 ) +// > "other" + +.pluralGenerator()( 1 ) +// > "one" + +.pluralGenerator({ type: "ordinal" })( 1 ) +// > "one" + +.pluralGenerator({ type: "ordinal" })( 2 ) +// > "two" +``` + +[Read more...](doc/api/plural/plural-generator.md) + +#### `.plural( value[, options ] )` + +Alias for `.pluralGenerator( [options] )( value )`. + +### Relative time module + +#### `.relativeTimeFormatter( unit [, options] )` + + Returns a function that formats a relative time according to the given unit, options, and the default/instance locale. + + ```javascript + .relativeTimeFormatter( "day" )( 1 ) + // > "tomorrow" + + .relativeTimeFormatter( "month" )( -1 ) + // > "last month" + + .relativeTimeFormatter( "month" )( 3 ) + // > "in 3 months" + ``` + + [Read more...](doc/api/relative-time/relative-time-formatter.md) + +#### `.formatRelativeTime( value, unit [, options] )` + +Alias for `.relativeTimeFormatter( unit, options )( value )`. + +### Unit module + +#### `.unitFormatter( unit [, options] )` + +Returns a function that formats a unit according to the given unit, options, and the default/instance locale. + +```javascript +.unitFormatter( "second" )( 10 ) +// > "10 seconds" + +.unitFormatter( "second", { form: "short" } )( 10 ) +// > "10 secs" + +.unitFormatter( "second", { form: "narrow" } )( 10 ) +// > "10s" +``` + +[Read more...](doc/api/unit/unit-formatter.md) + +#### `.formatUnit( value, unit [, options] )` + +Alias for `.unitFormatter( unit, options )( value )`. + +## Error reference + +### CLDR Errors + +- **`E_INVALID_CLDR`** + + Thrown when a CLDR item has an invalid or unexpected value. + + [Read more...](doc/error/e-invalid-cldr.md) + +- **`E_MISSING_CLDR`** + + Thrown when any required CLDR item is NOT found. + + [Read more...](doc/error/e-missing-cldr.md) + +### Parameter Errors + +- **`E_INVALID_PAR_TYPE`** + + Thrown when a parameter has an invalid type on any static or instance methods. + + [Read more...](doc/error/e-invalid-par-type.md) + +- **`E_INVALID_PAR_VALUE`** + + Thrown for certain parameters when the type is correct, but the value is + invalid. + + [Read more...](doc/error/e-invalid-par-value.md) + +- **`E_MISSING_PARAMETER`** + + Thrown when a required parameter is missing on any static or instance methods. + + [Read more...](doc/error/e-missing-parameter.md) + +- **`E_PAR_OUT_OF_RANGE`** + + Thrown when a parameter is not within a valid range of values. + + [Read more...](doc/error/e-par-out-of-range.md) + +### Other Errors + +- **`E_DEFAULT_LOCALE_NOT_DEFINED`** + + Thrown when any static method, eg. `Globalize.formatNumber()` is used prior to setting the Global locale with `Globalize.locale( )`. + + [Read more...](doc/error/e-default-locale-not-defined.md) + +- **`E_MISSING_PLURAL_MODULE`** + + Thrown when plural module is needed, but not loaded, eg. to format currencies using the named form. + + [Read more...](doc/error/e-missing-plural-module.md) + +- **`E_UNSUPPORTED`** + + Thrown for unsupported features, eg. to format unsupported date patterns. + + [Read more...](doc/error/e-unsupported.md) + + +## Contributing + +If you are having trouble using Globalize after reading the documentation carefully, please post a question to [StackOverflow with the "javascript-globalize" tag][]. Questions that include a minimal demo are more likely to receive responses. + +In the spirit of open source software development, we always encourage community code contribution. To help you get started and before you jump into writing code, be sure to read [CONTRIBUTING.md](CONTRIBUTING.md). + +[StackOverflow with the "javascript-globalize" tag]: http://stackoverflow.com/tags/javascript-globalize + +For ideas where to start contributing, see the following queries to find what best suites your interest: [quick change][], [new features][], [bug fixes][], [documentation improvements][], [date module][], [currency module][], [message module][], [number module][], [plural module][], [relative time module][]. Last but not least, feel free to [get in touch](http://irc.jquery.org/). + +[bug fixes]: https://github.com/globalizejs/globalize/labels/bug +[documentation improvements]: https://github.com/globalizejs/globalize/labels/docs +[new features]: https://github.com/globalizejs/globalize/labels/new%20feature +[quick change]: https://github.com/globalizejs/globalize/labels/quick%20change + +[currency module]: https://github.com/globalizejs/globalize/labels/currency%20module +[date module]: https://github.com/globalizejs/globalize/labels/date%20module +[message module]: https://github.com/globalizejs/globalize/labels/message%20module +[number module]: https://github.com/globalizejs/globalize/labels/number%20module +[plural module]: https://github.com/globalizejs/globalize/labels/plural%20module +[relative time module]: https://github.com/globalizejs/globalize/labels/relative%20time%20module + +### Roadmap + +Our roadmap is the collection of all open issues and pull requests where you can find: + +- [Ongoing work][] lists our current sprint. Here you find where we're actively working on at this very moment. Priority is determined by the community needs and volunteering. If there is anything you want to be done, share your thoughts with us on any existing or new issue and especially volunteer to do it. +- [Everything else][] is potential next work that you could help us to accomplish now. Releases are published following semver rules as often as possible. + +[Ongoing work]: https://github.com/globalizejs/globalize/labels/Current%20Sprint +[Everything else]: https://github.com/globalizejs/globalize/issues?utf8=%E2%9C%93&q=is%3Aopen+-label%3A%22Current+Sprint%22+ + +## Development + +### File structure +``` +├── bower.json (metadata file) +├── CONTRIBUTING.md (doc file) +├── dist/ (consumable files, the built files) +├── external/ (external dependencies, eg. cldr.js, QUnit, RequireJS) +├── Gruntfile.js (Grunt tasks) +├── LICENSE (license file) +├── package.json (metadata file) +├── README.md (doc file) +├── src/ (source code) +│ ├── build/ (build helpers, eg. intro, and outro) +│ ├── common/ (common function helpers across modules) +│ ├── core.js (core module) +│ ├── date/ (date source code) +│ ├── date.js (date module) +│ ├── message.js (message module) +│ ├── number.js (number module) +│ ├── number/ (number source code) +│ ├── plural.js (plural module) +│ ├── plural/ (plural source code) +│ ├── relative-time.js (relative time module) +│ ├── relative-time/ (relative time source code) +│ ├── unit.js (unit module) +│ ├── unit/ (unit source code) +│ └── util/ (basic JavaScript helpers polyfills, eg array.map) +└── test/ (unit and functional test files) + ├── fixtures/ (CLDR fixture data) + ├── functional/ (functional tests) + ├── functional.html + ├── functional.js + ├── unit/ (unit tests) + ├── unit.html + └── unit.js +``` + +### Source files + +The source files are as granular as possible. When combined to generate the build file, all the excessive/overhead wrappers are cut off. It's following the same build model of jQuery and Modernizr. + +Core, and all modules' public APIs are located in the `src/` directory, ie. `core.js`, `date.js`, `message.js`, `number.js`, and `plural.js`. + +### Install development external dependencies + +Install Grunt and external dependencies. First, install the [grunt-cli](http://gruntjs.com/getting-started#installing-the-cli) and [bower](http://bower.io/) packages if you haven't before. These should be installed globally (like this: `npm install -g grunt-cli bower`). Then: + +```bash +npm install && bower install +``` + +### Tests + +Tests can be run either in the browser or using Node.js (via Grunt) after having installed the external development dependencies (for more details, see above). + +#### Unit tests + +To run the unit tests, run `grunt test:unit`, or run `grunt connect:keepalive` and open `http://localhost:9001/test/unit.html` in a browser. It tests the very specific functionality of each function (sometimes internal/private). + +The goal of the unit tests is to make it easy to spot bugs, easy to debug. + +#### Functional tests + +To run the functional tests, create the dist files by running `grunt`. Then, run `grunt test:functional`, or open `http://localhost:9001/test/functional.html` in a browser. Note that `grunt` will automatically run unit and functional tests for you to ensure the built files are safe. + +The goal of the functional tests is to ensure that everything works as expected when it is combined. + +### Build + +Build the distribution files after having installed the external development dependencies (for more details, see above). + +```bash +grunt +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/bower.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/bower.json new file mode 100644 index 000000000..b4fe6e50c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/bower.json @@ -0,0 +1,22 @@ +{ + "name": "globalize", + "license": "MIT", + "ignore": [ + "**/.*", + "test", + "CONTRIBUTING.md", + "bower.json" + ], + "dependencies": { + "cldrjs": "^0.5.4" + }, + "devDependencies": { + "cldr-data": ">=25", + "es5-shim": "3.4.0", + "make-plural": "eemeli/make-plural.js#3.0.0", + "messageformat": "SlexAxton/messageformat.js#v0.3.0-1", + "requirejs": "2.1.20", + "requirejs-plugins": "1.0.2", + "requirejs-text": "2.0.10" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/browserstack.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/browserstack.json new file mode 100644 index 000000000..cbffa87f1 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/browserstack.json @@ -0,0 +1,17 @@ +{ + "test_framework": "qunit", + "test_path": [ "test/unit.html", "test/functional.html" ], + "browsers": [ + "chrome_previous", + "chrome_latest", + "firefox_previous", + "firefox_latest", + "ie_9", + "ie_10", + "ie_11", + "opera_previous", + "opera_latest", + "safari_previous", + "safari_latest" + ] +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/constructor.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/constructor.md new file mode 100644 index 000000000..cbc9147ff --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/constructor.md @@ -0,0 +1,28 @@ +## [new] Globalize( locale|cldr ) + +Create a Globalize instance. + +### Parameters + +#### locale|cldr + +Locale string or [Cldr instance](https://github.com/rxaviers/cldrjs) of the instance. + +### Example + +Prior to creating any Globalize instance, you must load `cldr/supplemental/likelySubtags.json`. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +```javascript +var en = new Globalize( "en" ); + +// You can optionally omit the `new` operator. +var pt = Globalize( "pt" ); + +en.formatNumber( 3.1415 ); +// > 3.142 + +pt.formatNumber( 3.1415 ); +// > 3,142 +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/load.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/load.md new file mode 100644 index 000000000..7bd87c88f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/load.md @@ -0,0 +1,96 @@ +## Globalize.load( cldrJSONData, ... ) + +This method allows you to load CLDR JSON locale data. `Globalize.load()` is a proxy to `Cldr.load()`. + +This method can be called as many times as needed. All passed JSON objects are deeply merged internally. + +For more information, see https://github.com/rxaviers/cldrjs#readme. + +### Parameters + +#### cldrJSONData + +A JSON object with CLDR data. See [Getting Started](#../../../README.md#2-cldr-content) for more information. + +### Example + +```javascript +Globalize.load({ + "main": { + "en": { + "identity": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "generation": { + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + }, + "language": "en" + }, + "dates": { + "calendars": { + "gregorian": { + "months": { + "format": { + "abbreviated": { + "1": "Jan", + "2": "Feb", + "3": "Mar", + "4": "Apr", + "5": "May", + "6": "Jun", + "7": "Jul", + "8": "Aug", + "9": "Sep", + "10": "Oct", + "11": "Nov", + "12": "Dec" + } + } + }, + "dayPeriods": { + "format": { + "wide": { + "am": "AM", + "am-alt-variant": "am", + "noon": "noon", + "pm": "PM", + "pm-alt-variant": "pm" + } + } + }, + "dateFormats": { + "medium": "MMM d, y" + }, + "timeFormats": { + "medium": "h:mm:ss a", + }, + "dateTimeFormats": { + "medium": "{1}, {0}" + } + } + } + }, + "numbers": { + "defaultNumberingSystem": "latn", + "symbols-numberSystem-latn": { + "group": "," + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###" + } + } + } + }, + "supplemental": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "likelySubtags": { + "en": "en-Latn-US", + } + } +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/locale.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/locale.md new file mode 100644 index 000000000..8deb1b2d7 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/core/locale.md @@ -0,0 +1,43 @@ +## Globalize.locale( [locale|cldr] ) + +Set default locale, or get it if locale argument is omitted. + +Return the default [Cldr instance](https://github.com/rxaviers/cldrjs). + +An application that supports globalization and/or localization will need to have a way to determine the user's preference. Attempting to automatically determine the appropriate locale is useful, but it is good practice to always offer the user a choice, by whatever means. + +Whatever your mechanism, it is likely that you will have to correlate the user's preferences with the list of locale data supported in the app. This method allows you to select the best match given the locale data that you have included and to set the Globalize locale to the one which the user prefers. + +LanguageMatching TBD (CLDR's spec http://www.unicode.org/reports/tr35/#LanguageMatching). + +### Parameters + +#### locale|cldr + +- The locale string, e.g., `"en"`, `"pt-BR"`, or `"zh-Hant-TW"`. Or, +- The [Cldr instance](https://github.com/rxaviers/cldrjs), e.g., new `Cldr( "en" )`. + +### Example + +Prior to using this function, you must load `cldr/supplemental/likelySubtags.json`. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +```javascript +// Set "pt" as our default locale. +Globalize.locale( "pt" ); + +// Get default locale. +Globalize.locale(); +// > { +// attributes: { +// "languageId": "pt", +// "maxLanguageId": "pt_Latn_BR", +// "language": "pt", +// "script": "Latn", +// "territory": "BR", +// "region": "BR" +// }, +// some more stuff... +// } +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/currency/currency-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/currency/currency-formatter.md new file mode 100644 index 000000000..41ea0c0f0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/currency/currency-formatter.md @@ -0,0 +1,196 @@ +## .currencyFormatter( currency [, options] ) ➜ function( value ) + +Return a function that formats a `currency` according to the given `options` or locale's defaults. + +The returned function is invoked with one argument: the Number `value` to be formatted. + +### Parameters + +#### currency + +3-letter currency code as defined by ISO 4217, eg. `"USD"`. + +#### options.style + +Optional. String `"symbol"` (default), `"accounting"`, `"code"` or `"name"`. See [`.numberFormatter( [options] )`](../number/number-formatter.md) for more options. + +#### value + +Number to be formatted, eg. `9.99`. + +### Example + +#### Static Formatter + +Prior to using any currency methods, you must load `cldr/main/{locale}/currencies.json`, `cldr/supplemental/currencyData.json`, and the CLDR content required by the number module. If using plural messages, you also must load the CLDR content required by the plural module. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +#### Using the default options + +You can use the static method `Globalize.currencyFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.currencyFormatter( "USD" ); + +formatter( 9.99 ); +// > "$9.99" +``` + +#### Instance Formatter + +You can use the instance method `.currencyFormatter()`, which uses the instance locale. + +```javascript +var deFormatter = Globalize( "de" ).currencyFormatter( "EUR" ), + zhFormatter = Globalize( "zh" ).currencyFormatter( "EUR" ); + +deFormatter( 9.99 ); +// > "9,99 €" + +zhFormatter( 9.99 ); +// > "€ 9.99" + +``` + +For comparison, follow the formatting output of different symbols in different locales. + +| 3-letter currency code | en (English) | de (German) | zh (Chinese) | +| ---------------------------------- | ------------ | ----------- | ------------ | +| `.currencyFormatter( "USD" )( 1 )` | `$1.00` | `1,00 $` | `US$ 1.00` | +| `.currencyFormatter( "EUR" )( 1 )` | `€1.00` | `1,00 €` | `€ 1.00` | +| `.currencyFormatter( "CNY" )( 1 )` | `CN¥1.00` | `1,00 CN¥` | `¥ 1.00` | +| `.currencyFormatter( "JPY" )( 1 )` | `¥1` | `1 ¥` | `JP¥ 1` | +| `.currencyFormatter( "GBP" )( 1 )` | `£1.00` | `1,00 £` | `£ 1.00` | +| `.currencyFormatter( "BRL" )( 1 )` | `R$1.00` | `1,00 R$` | `R$ 1.00` | + +#### Using alternative `options.symbolForm` + +Using the narrow symbol form, the same symbols may be used for multiple currencies. Thus the symbol may be ambiguous, and should only be used where the context is clear. + +```js +Globalize( "en" ).currencyFormatter( "HKD" )( 1 ); +// > "HK$1.00" + +Globalize( "en" ).currencyFormatter( "HKD", { symbolForm: "narrow" } )( 1 ); +// > "$1.00" +``` + +#### Configuring style + +For the accounting variation of the symbol format, use `style: "accounting"`. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD", { + style: "accounting" +}); + +formatter( -1 ); +// > "($1.00)" +``` + +For plural messages, use `style: "name"`. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD", { + style: "name" +}); + +formatter( 0 ); +// > "0.00 US dollars" + +formatter( 1 ); +// > "1.00 US dollar" +``` + +For comparison, follow the formatting output of different symbols in different locales using the plural messages `Globalize( locale ).currencyFormatter( currency, { style: "name" } )( 1 )`. + +| 3-letter currency code | en (English) | de (German) | zh (Chinese) | +| ---------------------- | ----------------------------- | -------------------------------- | ------------ | +| `USD` | `1.00 US dollar` | `1,00 US-Dollar` | `1.00美元` | +| `EUR` | `1.00 euro` | `1,00 Euro` | `1.00欧元` | +| `CNY` | `1.00 Chinese yuan` | `1,00 Chinesischer Yuan` | `1.00人民币` | +| `JPY` | `1 Japanese yen` | `1 Japanischer Yen` | `1日元` | +| `GBP` | `1.00 British pound sterling` | `1,00 Britisches Pfund Sterling` | `1.00英镑` | +| `BRL` | `1.00 Brazilian real` | `1,00 Brasilianischer Real` | `1.00巴西雷亚尔` | + +For the international currency code, use `style: "code"`. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD", { + style: "code" +}); + +formatter( 9.99 ); +// > "9.99 USD" +``` + +#### Configuring inherited number options + +Override the number of digits, grouping separators, rounding function or any other [`.numberFormatter()` options](../number/number-formatter.md). + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.currencyFormatter( "USD", { + minimumFractionDigits: 0, + style: "name" +}); + +formatter( 1 ); +// > "1 US dollar" + +formatter = Globalize.currencyFormatter( "USD", { + round: "ceil" +}); + +formatter( 1.491 ); +// > "$1.50" +``` + +#### Formatting Compact Currencies + +```js +var shortFormatter = Globalize( "en" ).currencyFormatter( "USD", { + compact: "short" +}); + +var longFormatter = Globalize( "en" ).currencyFormatter( "USD", { + compact: "long" +}); + +shortFormatter( 12830000000 ); +// > "$13B" + +longFormatter( 12830000000 ); +// > "$13 billion" +``` + +The minimumSignificantDigits and maximumSignificantDigits options are specially useful to control the number of digits to display. + +```js +Globalize( "en" ).formatCurrency( 12830000000, "USD", { + compact: "short", + minimumSignificantDigits: 3, + maximumSignificantDigits: 3 +}); +// > "$12.8B" +``` + +#### Performance Suggestion + +For improved performance on iterations, first create the formatter. Then, reuse it on each loop. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD" ); + +renderInvoice({ + prices: prices.map(function( price ) { + return formatter( price ); + }) +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/currency/currency-to-parts-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/currency/currency-to-parts-formatter.md new file mode 100644 index 000000000..0dcbb4d02 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/currency/currency-to-parts-formatter.md @@ -0,0 +1,117 @@ +## .currencyToPartsFormatter( currency [, options] ) ➜ function( value ) + +Return a function that formats a `currency` into parts tokens according to the given `options` or locale's defaults. + +The returned function is invoked with one argument: the Number `value` to be formatted. + +### Parameters + +#### currency + +3-letter currency code as defined by ISO 4217, eg. `"USD"`. + +#### options + +Please, see [.currencyFormatter() options](./currency-formatter.md#parameters). + +#### value + +Number to be formatted, eg. `9.99`. + +### Returns + +An Array of objects containing the formatted currency in parts. The returned structure looks like this: + +```js +[ + { type: "day", value: "17" }, + { type: "weekday", value: "Monday" } +] +``` + +Possible types are the following: + +- `currency` + + The currency string, such as the symbols `"$"` and `"€"` or the name `"Dollar"`, `"Euro"` depending on which style is used. + +Please, see [.numberToPartsFormatter()](../number/number-to-parts-formatter.md#returns) for details about the inherited number parts such as `decimal`, `fraction`, `group`, `infinity`, `integer`, `literal`, `minusSign`, `nan`, `plusSign`, `percentSign`, and `compact`. + +### Example + +Prior to using any currency methods, you must load `cldr/main/{locale}/currencies.json`, `cldr/supplemental/currencyData.json`, and the CLDR content required by the number module. If using plural messages, you also must load the CLDR content required by the plural module. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +#### Static Formatter + +#### Using the default options + +You can use the static method `Globalize.currencyToPartsFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.currencyToPartsFormatter( "USD" ); + +formatter( 9.99 ); +// > [ +// { "type": "currency", "value": "$" }, +// { "type": "integer", "value": "9" }, +// { "type": "decimal", "value": "." }, +// { "type": "fraction", "value": "99" } +// ] +``` + +#### Instance Formatter + +You can use the instance method `.currencyFormatter()`, which uses the instance locale. + +```javascript +var deFormatter = Globalize( "de" ).currencyToPartsFormatter( "EUR" ), + zhFormatter = Globalize( "zh" ).currencyToPartsFormatter( "EUR" ); + +deFormatter( 9.99 ); +// > [ +// { "type": "integer", "value": "9" }, +// { "type": "decimal", "value": "," }, +// { "type": "fraction", "value": "99" }, +// { "type": "literal", "value": " " }, +// { "type": "currency", "value": "€" } +// ] + +zhFormatter( 9.99 ); +// > [ +// { "type": "currency", "value": "€" }, +// { "type": "integer", "value": "9" }, +// { "type": "decimal", "value": "." }, +// { "type": "fraction", "value": "99" } +// ] +``` + +The information is available separately and it can be formatted and concatenated again in a customized way. For example by using [`Array.prototype.map()`][], [arrow functions][], a [switch statement][], [template literals][], and [`Array.prototype.reduce()`][]. + +[`Array.prototype.map()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map +[arrow functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions +[switch statement]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch +[template literals]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals +[`Array.prototype.reduce()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce + +#### More Examples + +Please, see [.currencyFormatter() example](./currency-formatter.md#example) for additional examples such as using alternative `symbolForm`, configuring `style` (symbol, accounting, and name styles), and the inherited number options (e.g., compact numbers). + +#### Performance Suggestion + +For improved performance on iterations, first create the formatter. Then, reuse it on each loop. + +```javascript +var formatter = Globalize( "en" ).currencyToPartsFormatter( "USD" ); + +renderInvoice({ + prices: prices.map(function( price ) { + return formatter( price ); + }) +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-formatter.md new file mode 100644 index 000000000..a74cc07a0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-formatter.md @@ -0,0 +1,203 @@ +## .dateFormatter( [options] ) ➜ function( value ) + +Return a function that formats a date according to the given `options`. The default formatting is numeric year, month, and day (i.e., `{ skeleton: "yMd" }`. + +The returned function is invoked with one argument: the Date instance `value` to be formatted. + +### Parameters + +#### options.skeleton + +String value indicating a skeleton (see description above), eg. `{ skeleton: "GyMMMd" }`. + +Skeleton provides a more flexible formatting mechanism than the predefined list `full`, `long`, `medium`, or `short` represented by date, time, or datetime. Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order. For a complete list of skeleton patterns [check the unicode CLDR documentation](http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). + +For example: + +| locale | `"GyMMMd"` skeleton | +| ------ | ------------------------- | +| *en* | `"Apr 9, 2014 AD"` | +| *zh* | `"公元2014年4月9日"` | +| *es* | `"9 abr. de 2014 d. C."` | +| *ar* | `"٩ أبريل، ٢٠١٤ م"` | +| *pt* | `"9 de abr de 2014 d.C."` | + +#### options.date + +One of the following String values: `full`, `long`, `medium`, or `short`, eg., `{ date: "full" }`. + +#### options.time + +One of the following String values: `full`, `long`, `medium`, or `short`, eg., `{ time: "full" }`. + +#### options.datetime + +One of the following String values: `full`, `long`, `medium`, or `short`, eg., `{ datetime: "full" }`. + +#### options.raw + +String value indicating a machine [raw pattern (anything in the "Sym." column)](http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table) eg. `{ raw: "dd/mm" }`. Note this is NOT recommended for i18n in general. Use `skeleton` instead. + +#### options.timeZone + +String based on the time zone names of the [IANA time zone database](https://www.iana.org/time-zones), such as `"Asia/Shanghai"`, `"Asia/Kolkata"`, `"America/New_York"`. + +#### value + +Date instance to be formatted, eg. `new Date()`; + +### Example + +Prior to using any date methods, you must load `cldr/main/{locale}/ca-gregorian.json`, `cldr/main/{locale}/timeZoneNames.json`, `cldr/supplemental/metaZones.json`, `cldr/supplemental/timeData.json`, `cldr/supplemental/weekData.json`, and the CLDR content required by the number module. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.dateFormatter(); + +formatter( new Date( 2010, 10, 30, 17, 55 ) ); +// > "11/30/2010" +``` + +You can use the instance method `.dateFormatter()`, which uses the instance locale. + +```javascript +var enFormatter = Globalize( "en" ).dateFormatter(), + deFormatter = Globalize( "de" ).dateFormatter(); + +enFormatter( new Date( 2010, 10, 30, 17, 55 ) ); +// > "11/30/2010" + +deFormatter( new Date( 2010, 10, 30, 17, 55 ) ); +// > "30.11.2010" +``` + +#### Using short, medium, long, and full presets + +Use convenient presets for `date`, `time`, or `datetime`. Their possible values are: `short`, `medium`, `long`, and `full`. + +| `presetValue` | `Globalize( "en" ).dateFormatter( presetValue )( new Date( 2010, 10, 1, 17, 55 ) )` | +| ------------------------ | ---------------------------------------- | +| `{ date: "short" }` | `"11/1/10"` | +| `{ date: "medium" }` | `"Nov 1, 2010"` | +| `{ date: "long" }` | `"November 1, 2010"` | +| `{ date: "full" }` | `"Monday, November 1, 2010"` | +| `{ time: "short" }` | `"5:55 PM"` | +| `{ time: "medium" }` | `"5:55:00 PM"` | +| `{ time: "long" }` | `"5:55:00 PM PST"` | +| `{ time: "full" }` | `"5:55:00 PM Pacific Standard Time"` | +| `{ datetime: "short" }` | `"11/1/10, 5:55 PM"` | +| `{ datetime: "medium" }` | `"Nov 1, 2010, 5:55:00 PM"` | +| `{ datetime: "long" }` | `"November 1, 2010 at 5:55:00 PM PST"` | +| `{ datetime: "full" }` | `"Monday, November 1, 2010 at 5:55:00 PM Pacific Standard Time"` | + +For comparison, follow the same formatter `{ datetime: "short" }` on different locales. + +| locale | `Globalize( locale ).dateFormatter({ datetime: "short" })( new Date( 2010, 10, 1, 17, 55 ) )` | +| ---------------- | ---------------------------------------- | +| *en* | `"11/1/10, 5:55 PM"` | +| *en_GB* | `"01/11/2010 17:55"` | +| *zh* | `"10/11/1 下午5:55"` | +| *zh-u-nu-native* | `"一〇/一一/一 下午五:五五"` | +| *es* | `"1/11/10 17:55"` | +| *de* | `"01.11.10 17:55"` | +| *pt* | `"01/11/10 17:55"` | +| *ar* | `"١‏/١١‏/٢٠١٠ ٥،٥٥ م"` | + +#### Using open-ended skeletons + +Use open-ended skeletons for more flexibility (see its description [above](#parameters)). See some examples below. + +| `skeleton` | `Globalize( "en" ).dateFormatter( skeleton )( new Date( 2010, 10, 1, 17, 55 ) )` | +| ---------------------------- | ---------------------------------------- | +| `{ skeleton: "E" }` | `"Tue"` | +| `{ skeleton: "EHm" }` | `"Tue 17:55"` | +| `{ skeleton: "EHms" }` | `"Tue 17:55:00"` | +| `{ skeleton: "Ed" }` | `"30 Tue"` | +| `{ skeleton: "Ehm" }` | `"Tue 5:55 PM"` | +| `{ skeleton: "Ehms" }` | `"Tue 5:55:00 PM"` | +| `{ skeleton: "Gy" }` | `"2010 AD"` | +| `{ skeleton: "GyMMM" }` | `"Nov 2010 AD"` | +| `{ skeleton: "GyMMMEd" }` | `"Tue, Nov 30, 2010 AD"` | +| `{ skeleton: "GyMMMd" }` | `"Nov 30, 2010 AD"` | +| `{ skeleton: "H" }` | `"17"` | +| `{ skeleton: "Hm" }` | `"17:55"` | +| `{ skeleton: "Hms" }` | `"17:55:00"` | +| `{ skeleton: "M" }` | `"11"` | +| `{ skeleton: "MEd" }` | `"Tue, 11/30"` | +| `{ skeleton: "MMM" }` | `"Nov"` | +| `{ skeleton: "MMMEd" }` | `"Tue, Nov 30"` | +| `{ skeleton: "MMMd" }` | `"Nov 30"` | +| `{ skeleton: "Md" }` | `"11/30"` | +| `{ skeleton: "d" }` | `"30"` | +| `{ skeleton: "h" }` | `"5 PM"` | +| `{ skeleton: "hm" }` | `"5:55 PM"` | +| `{ skeleton: "hms" }` | `"5:55:00 PM"` | +| `{ skeleton: "ms" }` | `"55:00"` | +| `{ skeleton: "y" }` | `"2010"` | +| `{ skeleton: "yM" }` | `"11/2010"` | +| `{ skeleton: "yMEd" }` | `"Tue, 11/30/2010"` | +| `{ skeleton: "yMMM" }` | `"Nov 2010"` | +| `{ skeleton: "yMMMEd" }` | `"Tue, Nov 30, 2010"` | +| `{ skeleton: "yMMMd" }` | `"Nov 30, 2010"` | +| `{ skeleton: "yMd" }` | `"11/30/2010"` | +| `{ skeleton: "yQQQ" }` | `"Q4 2010"` | +| `{ skeleton: "yQQQQ" }` | `"4th quarter 2010"` | +| `{ skeleton: "GyMMMEdhms" }` | `"Tue, Nov 30, 2010 AD, 5:55:00 PM"` | +| `{ skeleton: "Ehms" }` | `"Tue 5:55:00 PM"` | +| `{ skeleton: "yQQQHm" }` | `"Q4 2010, 17:55"` | +| `{ skeleton: "MMMEdhm" }` | `"Tue, Nov 30, 5:55 PM"` | +| `{ skeleton: "yMMMdhm" }` | `"Nov 30, 2010, 5:55 PM"` | + + +```javascript +var globalize = Globalize( "en" ), + date = new Date( 2010, 10, 30, 17, 55 ), + monthDayFormatter = globalize.dateFormatter({ skeleton: "MMMd" }), + hourMinuteSecondFormatter = globalize.dateFormatter({ skeleton: "Hms" }); + +monthDayFormatter( date ); +// > "Nov 30" + +hourMinuteSecondFormatter( date ); +// > "17:55:00" +``` + +#### Using time zones + +Using specific timeZones, i.e., using `options.timezone`. Note that prior to using it, you must load IANA time zone data. + +```js +Globalize.loadTimeZone( require( "iana-tz-data" ) ); +``` + +```js +Globalize.locale( "en" ); + +Globalize.dateFormatter({ datetime: "medium", timeZone: "America/Los_Angeles" })( new Date() ); +// > "Nov 1, 2010, 12:55:00 PM" + +Globalize.dateFormatter({ datetime: "medium", timeZone: "America/Sao_Paulo" })( new Date() ) +// > "Nov 1, 2010, 5:55:00 PM" + +Globalize.dateFormatter({ datetime: "full", timeZone: "Europe/Berlin" })( new Date() ) +// > "Monday, November 1, 2010 at 8:55:00 PM Central European Standard Time" +``` + +#### Note on performance + +For improved performance on iterations, first create the formatter. Then, reuse it on each loop. + +```javascript +// In an application, this array could have a few hundred entries +var dates = [ new Date( 2010, 10, 30, 17, 55 ), new Date( 2015, 3, 18, 4, 25 ) ]; +var formatter = Globalize( "en" ).dateFormatter({ time: "short" }); + +var formattedDates = dates.map(function( date ) { + return formatter( date ); +}); +// > Array [ "5:55 PM", "4:25 AM" ] +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-parser.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-parser.md new file mode 100644 index 000000000..5800069e9 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-parser.md @@ -0,0 +1,60 @@ +## .dateParser( [options] ) ➜ function( value ) + +Return a function that parses a string representing a date into a JavaScript Date object according to the given `options`. The default parsing assumes numeric year, month, and day (i.e., `{ skeleton: "yMd" }`). + +The returned function is invoked with one argument: the String `value` to be parsed. + +### Parameters + +#### options + +See [.dateFormatter() options](./date-formatter.md#parameters). + +#### value + +String with date to be parsed, eg. `"11/1/10, 5:55 PM"`. + +### Example + +Prior to using any date methods, you must load `cldr/main/{locale}/ca-gregorian.json`, `cldr/main/{locale}/timeZoneNames.json`, `cldr/supplemental/timeData.json`, `cldr/supplemental/weekData.json`, and the CLDR content required by the number module. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.dateParser()`, which uses the default locale. + +```javascript +var parser; + +Globalize.locale( "en" ); +parser = Globalize.dateParser(); + +parser( "1/2/2013" ); +// > Wed Jan 02 2013 00:00:00 + +Globalize.locale( "es" ); +parser = Globalize.dateParser(); + +parser( "1/2/2013" ); +// > Fri Feb 01 2013 00:00:00 +``` + +You can use the instance method `.dateParser()`, which uses the instance locale. + +```javascript +var esParser = Globalize( "es" ).dateParser({ date: short }); + +esParser( "1/2/13" ); +// > Fri Feb 01 2013 00:00:00 +``` + +For improved performance on iterations, first create the parser. Then, reuse it +on each loop. + +```javascript +var formattedDates = [ new Date( a ), new Date( b ), ... ]; +var parser = Globalize( "en" ).dateParser({ time: "short" }); + +dates = formattedDates.map(function( formattedDate ) { + return parser( formattedDate ); +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-to-parts-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-to-parts-formatter.md new file mode 100644 index 000000000..e43938ce6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/date-to-parts-formatter.md @@ -0,0 +1,176 @@ +## .dateToPartsFormatter( [options] ) ➜ function( value ) + +Return a function that formats a date into parts tokens according to the given `options`. The default formatting is numeric year, month, and day (i.e., `{ skeleton: "yMd" }`. + +The returned function is invoked with one argument: the Date instance `value` to be formatted. + +### Parameters + +#### options + +Please, see [.dateFormatter() options](./date-formatter.md#parameters). + +#### value + +Date instance to be formatted, eg. `new Date()`; + +### Returns + +An Array of objects containing the formatted date in parts. The returned structure looks like this: + +```js +[ + { type: "day", value: "17" }, + { type: "weekday", value: "Monday" } +] +``` + +Possible types are the following: + +- `day` + + The string used for the day, e.g., `"17"`, `"١٦"`. + +- `dayperiod` + + The string used for the day period, e.g., `"AM"`, `"PM"`. + +- `era` + + The string used for the era, e.g., `"AD"`, `"d. C."`. + +- `hour` + + The string used for the hour, e.g., `"3"`, `"03"`. + +- `literal` + + The string used for separating date and time values, e.g., `"/"`, `", "`, + `"o'clock"`, `" de "`. + +- `minute` + + The string used for the minute, e.g., `"00"`. + +- `month` + + The string used for the month, e.g., `"12"`. + +- `second` + + The string used for the second, e.g., `"07"` or `"42"`. + +- `zone` + + The string used for the name of the time zone, e.g., `"EST".` + +- `weekday` + + The string used for the weekday, e.g., `"M"`, `"Monday"`, `"Montag".` + +- `year` + + The string used for the year, e.g., `"2012"`, `"96".` + + +### Example + +Prior to using any date methods, you must load `cldr/main/{locale}/ca-gregorian.json`, `cldr/main/{locale}/timeZoneNames.json`, `cldr/supplemental/timeData.json`, `cldr/supplemental/weekData.json`, and the CLDR content required by the number module. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.dateToPartsFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.dateToPartsFormatter(); + +formatter( new Date( 2010, 10, 30 ) ); +// > [ +// { "type": "month", "value": "11" }, +// { "type": "literal", "value": "/" }, +// { "type": "day", "value": "30" }, +// { "type": "literal", "value": "/" }, +// { "type": "year", "value": "2010" } +// ] +``` + +You can use the instance method `.dateToPartsFormatter()`, which uses the instance locale. + +```javascript +var enFormatter = Globalize( "en" ).dateToPartsFormatter(), + deFormatter = Globalize( "de" ).dateToPartsFormatter(); + +enFormatter( new Date( 2010, 10, 30 ) ); +// > [ +// { "type": "month", "value": "11" }, +// { "type": "literal", "value": "/" }, +// { "type": "day", "value": "30" }, +// { "type": "literal", "value": "/" }, +// { "type": "year", "value": "2010" } +// ] + +deFormatter( new Date( 2010, 10, 30 ) ); +// > [ +// { type: 'day', value: '30' }, +// { type: 'literal', value: '.' }, +// { type: 'month', value: '11' }, +// { type: 'literal', value: '.' }, +// { type: 'year', value: '2010' } +// ] +``` + +The information is available separately and it can be formatted and concatenated again in a customized way. For example by using [`Array.prototype.map()`][], [arrow functions][], a [switch statement][], [template literals][], and [`Array.prototype.reduce()`][]. + +[`Array.prototype.map()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map +[arrow functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions +[switch statement]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch +[template literals]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals +[`Array.prototype.reduce()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.dateToPartsFormatter({datetime: "short"}); + +formatter( new Date( 2010, 10, 30, 17, 55 ) ).map(({type, value}) => { + switch ( type ) { + case "year": return `${value}`; + default: return value; + } +}).join( "" ); +// > "11/30/10, 5:55 PM" +``` + +Please, see [.dateFormatter() example](./date-formatter.md#example) for additional examples such as using `date`, `time`, `datetime`, and `skeleton` options. + +For improved performance on iterations, first create the formatter. Then, reuse it on each loop. + +```javascript +// In an application, this array could have a few hundred entries +var dates = [ new Date( 2010, 10, 30, 17, 55 ), new Date( 2015, 3, 18, 4, 25 ) ]; +var formatter = Globalize( "en" ).dateToPartsFormatter({ time: "short" }); + +var formattedDates = dates.map(function( date ) { + return formatter( date ); +}); +// > [ +// [ +// { "type": "hour", "value": "5" }, +// { "type": "literal", "value": ":" }, +// { "type": "minute", "value": "55" }, +// { "type": "literal", "value": " " }, +// { "type": "dayperiod", "value": "PM" } +// ], +// [ +// { "type": "hour", "value": "4" }, +// { "type": "literal", "value": ":" }, +// { "type": "minute", "value": "25" }, +// { "type": "literal", "value": " " }, +// { "type": "dayperiod", "value": "AM" } +// ] +// ] +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/load-iana-time-zone.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/load-iana-time-zone.md new file mode 100644 index 000000000..fe7a5b8c9 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/date/load-iana-time-zone.md @@ -0,0 +1,29 @@ +## Globalize.loadTimeZone( ianaTzData ) + +This method allows you to load IANA time zone data to enable `options.timeZone` feature on date formatters and parsers. + +### Parameters + +#### ianaTzData + +A JSON object with zdumped IANA timezone data. Get the data via [`iana-tz-data`](https://github.com/rxaviers/iana-tz-data). + +### Example + +```javascript +Globalize.loadTimeZone({ + "zoneData": { + ... + "America": { + ... + "New_York": { + abbrs: [], + untils: [], + offsets: [], + isdsts: [] + } + ... + } + } +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/message/load-messages.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/message/load-messages.md new file mode 100644 index 000000000..7ee0b842b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/message/load-messages.md @@ -0,0 +1,105 @@ +## .loadMessages( json ) + +Load messages data. + +The first level of keys must be locales. For example: + +``` +{ + en: { + hello: "Hello" + }, + pt: { + hello: "Olá" + } +} +``` + +ICU MessageFormat pattern is supported: variable replacement, gender and plural inflections. For more information see [`.messageFormatter( path ) ➡ function([ variables ])`](./message-formatter.md). + +The provided messages are stored along side other cldr data, under the "globalize-messages" key. This allows Globalize to reuse the traversal methods provided by cldrjs. You can inspect this data using `cldrjs.get("globalize-messages")`. + +### Parameters + +#### json + +JSON object of messages data. Keys can use any character, except `/`, `{` and `}`. Values (i.e., the message content itself) can contain any character. + +### Example + +```javascript +Globalize.loadMessages({ + pt: { + greetings: { + hello: "Olá", + bye: "Tchau" + } + } +}); + +Globalize( "pt" ).formatMessage( "greetings/hello" ); +// > Olá +``` + +#### Multiline strings + +Use Arrays as a convenience for multiline strings. The lines will be joined by a space. + +```javascript +Globalize.loadMessages({ + en: { + longText: [ + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non", + "quis exercitationem culpa nesciunt nihil aut nostrum explicabo", + "reprehenderit optio amet ab temporibus asperiores quasi cupiditate.", + "Voluptatum ducimus voluptates voluptas?" + ] + } +}); + +Globalize( "en" ).formatMessage( "longText" ); +// > "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?" +``` + +#### Messages inheritance + +It's possible to inherit messages, for example: + +```javascript +Globalize.loadMessages({ + root: { + amen: "Amen" + }, + de: {}, + en: {}, + "en-GB": {}, + fr: {}, + pt: { + amen: "Amém" + }, + "pt-PT": {} +}); + +Globalize( "de" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "en" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "en-GB" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "fr" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "pt-PT" ).formatMessage( "amen" ); +// > "Amém" +``` + +Note that `de`, `en`, `en-GB`, `fr`, and `pt-PT` are empty. `.formatMessage()` inherits `pt-PT` messages from `pt` (`pt-PT` ➡ `pt`), and it inherits the other messages from root, eg. `en-GB` ➡ `en-001` ➡ `en` ➡ `root`. Yes, `root` is the last bundle of the parent lookup. + +Attention: On browsers, message inheritance only works if the optional dependency `cldr/unresolved` is loaded. + +```html + +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/message/message-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/message/message-formatter.md new file mode 100644 index 000000000..e501a24c0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/message/message-formatter.md @@ -0,0 +1,208 @@ +## .messageFormatter( path ) ➡ function([ variables ]) + +Return a function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. + +Use [`Globalize.loadMessages( json )`](./load-messages.md) to load +messages data. + +### Parameters + +#### path + +String or Array containing the path of the message content, eg., `"greetings/bye"`, or `[ "greetings", "bye" ]`. + +#### variables + +Optional. Variables can be Objects, where each property can be referenced by name inside a message; or Arrays, where each entry of the Array can be used inside a message, using numeric indices. When passing one or more arguments of other types, they're converted to an Array and used as such. + +### Example + +You can use the static method `Globalize.messageFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.loadMessages({ + pt: { + greetings: { + bye: "Tchau" + } + } +}); + +Globalize.locale( "pt" ); +formatter = Globalize.messageFormatter( "greetings/bye" ); + +formatter(); +// > "Tchau" +``` + +You can use the instance method `.messageFormatter()`, which uses the instance locale. + +```javascript +var pt = new Globalize( "pt" ), + formatter = pt.messageFormatter( "greetings/bye" ); + +formatter(); +// > "Tchau" +``` + +#### Simple Variable Replacement + +```javascript +var formatter; + +Globalize.loadMessages({ + en: { + hello: "Hello, {0} {1} {2}", + hey: "Hey, {first} {middle} {last}" + } +}); + +formatter = Globalize( "en" ).messageFormatter( "hello" ); + +// Numbered variables using Array. +formatter([ "Wolfgang", "Amadeus", "Mozart" ]); +// > "Hello, Wolfgang Amadeus Mozart" + +// Numbered variables using function arguments. +formatter( "Wolfgang", "Amadeus", "Mozart" ); +// > "Hello, Wolfgang Amadeus Mozart" + +// Named variables using Object key-value pairs. +formatter = Globalize( "en" ).messageFormatter( "hey" ); +formatter({ + first: "Wolfgang", + middle: "Amadeus", + last: "Mozart" +}); +// > "Hey, Wolfgang Amadeus Mozart" +``` + +#### Gender inflections + +`select` can be used to format any message variations that works like a switch. + +```javascript +var formatter; + +// Note you can define multiple lines message using an Array of Strings. +Globalize.loadMessages({ + en: { + party: [ + "{hostGender, select,", + " female {{host} invites {guest} to her party}", + " male {{host} invites {guest} to his party}", + " other {{host} invites {guest} to their party}", + "}" + ] + } +}); + +formatter = Globalize( "en" ).messageFormatter( "party" ); + +formatter({ + guest: "Mozart", + host: "Beethoven", + hostGender: "male" +}); +// > "Beethoven invites Mozart to his party" +``` + +#### Plural inflections + +It uses the plural forms `zero`, `one`, `two`, `few`, `many`, or `other` (required). Note English only uses `one` and `other`. So, including `zero` will never get called, even when the number is 0. For more information see [`.pluralGenerator()`](../plural/plural-generator.md). + +```javascript +var numberFormatter, taskFormatter, + en = new Globalize( "en" ); + +// Note you can define multiple lines message using an Array of Strings. +Globalize.loadMessages({ + en: { + task: [ + "You have {count, plural,", + " one {one task}", + " other {{formattedCount} tasks}", + "} remaining" + ] + } +}); + +numberFormatter = en.numberFormatter(); +taskFormatter = en.messageFormatter( "task" ); + +taskFormatter({ + count: 1000, + formattedCount: numberFormatter( 1000 ) +}); +// > "You have 1,000 tasks remaining" +``` + +Literal numeric keys can be used in `plural` to match single, specific numbers. + +```javascript +var taskFormatter, + en = new Globalize( "en" ); + +// Note you can define multiple lines message using an Array of Strings. +Globalize.loadMessages({ + en: { + task: [ + "You have {count, plural,", + " =0 {no tasks}", + " one {one task}", + " other {{formattedCount} tasks}", + "} remaining" + ] + } +}); + +taskFormatter = Globalize( "en" ).messageFormatter( "task" ); + +taskFormatter({ + count: 0, + formattedCount: en.numberFormatter( 0 ) +}); +// > "You have no tasks remaining" +``` + +You may find useful having the plural forms calculated with an offset applied. +Use `#` to output the resulting number. Note literal numeric keys do NOT use the +offset value. + +```javascript +var likeFormatter, + en = new Globalize( "en" ); + +Globalize.loadMessages({ + en: { + likeIncludingMe: [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +}); + +likeFormatter = Globalize( "en" ).messageFormatter( "likeIncludingMe" ); + +likeFormatter( 0 ); +// > "Be the first to like this" + +likeFormatter( 1 ); +// > "You liked this" + +likeFormatter( 2 ); +// > "You and someone else liked this" + +likeFormatter( 3 ); +// > "You and 2 others liked this" +``` + +Read on [SlexAxton/messageFormatter.js][] for more information on regard of ICU MessageFormat. + +[SlexAxton/messageFormatter.js]: https://github.com/SlexAxton/messageformat.js/#no-frills diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-formatter.md new file mode 100644 index 000000000..dc51802d2 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-formatter.md @@ -0,0 +1,202 @@ +## .numberFormatter( [options] ) ➜ function( value ) + +Return a function that formats a number according to the given options. + +The returned function is invoked with one argument: the Number `value` to be formatted. + +### Parameters + +#### options.style + +Optional. String `decimal` (default), or `percent`. + +#### options.minimumIntegerDigits + +Optional. Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + +#### options.minimumFractionDigits, options.maximumFractionDigits + +Optional. Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + +#### options.minimumSignificantDigits, options.maximumSignificantDigits + +Optional. Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + +#### options.round + +Optional. String with rounding method `ceil`, `floor`, `round` (default), or `truncate`. + +#### options.useGrouping + +Optional. Boolean (default is true) value indicating whether a grouping separator should be used. + +#### options.compact + +Optional. String `short` or `long` indicating which compact number format should be used to represent the number. + +### Examples + +#### Static Formatter + +Prior to using any number methods, you must load `cldr/main/{locale}/numbers.json` and `cldr/supplemental/numberingSystems.json`. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.numberFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.numberFormatter(); + +formatter( 3.141592 ); +// > "3.142" +``` + +#### Instance Formatter + +You can use the instance method `.numberFormatter()`, which uses the instance +locale. + +```javascript +var arFormatter = Globalize( "ar" ).numberFormatter(), + esFormatter = Globalize( "es" ).numberFormatter(), + zhFormatter = Globalize( "zh-u-nu-native" ).numberFormatter(); + +arFormatter( 3.141592 ); +// > "٣٫١٤٢" + +esFormatter( 3.141592 ); +// > "3,142" + +zhFormatter( 3.141592 ); +// > "三.一四二" +``` + +#### Configuring decimal places + +The number of decimal places can be decreased or increased using `minimumFractionDigits` and `maximumFractionDigits`. + +```javascript +Globalize.numberFormatter({ maximumFractionDigits: 2 })( 3.141592 ); +// > "3.14" + +Globalize.numberFormatter({ minimumFractionDigits: 2 })( 1.5 ); +// > "1.50" +``` + +#### Configuring significant digits + +The number of significant (non-zero) digits can be decreased or increased using `minimumSignificantDigits` and `maximumSignificantDigits`. + +```javascript +var formatter = Globalize.numberFormatter({ + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +formatter( 3.141592 ); +// > "3.14" + +formatter = Globalize.numberFormatter({ + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +formatter( 12345 ); +// > "12,300" + +formatter = Globalize.numberFormatter({ + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +formatter( 0.00012345 ); +// > "0.000123" +``` + +#### Formatting Percentages + +Numbers can be formatted as percentages. + +```javascript +var enFormatter = Globalize( "en" ).numberFormatter({ + style: "percent", + minimumFractionDigits: 1, + maximumFractionDigits: 1 +}); + +var frFormatter = Globalize( "fr" ).numberFormatter({ + style: "percent", + minimumFractionDigits: 2, + maximumFractionDigits: 2 +}); + +enFormatter( 0.0016 ); +// > "0.2%" + +enFormatter( 0.0014 ); +// > "0.1%" + +frFormatter( 0.0005 ); +// > "0,05 %" +``` + +#### Formatting Compact Numbers + +Long numbers can be represented in a compact format, with `short` using abbreviated units and `long` using the full unit name. + +```javascript +var shortFormatter = Globalize( "en" ).numberFormatter({ + compact: "short" +}); + +var longFormatter = Globalize( "en" ).numberFormatter({ + compact: "long" +}); + +shortFormatter( 27588910 ); +// > "28M" + +longFormatter( 27588910 ); +// > "28 million" +``` + +The minimumSignificantDigits and maximumSignificantDigits options are specially useful to control the number of digits to display. + +```js +Globalize( "en" ).formatNumber( 27588910, { + compact: "short", + minimumSignificantDigits: 3, + maximumSignificantDigits: 3 +}); +// > "27.6M" +``` + +#### Configuring Rounding + +Numbers with a decreased amount of decimal places can be rounded up, rounded down, rounded arithmetically, or truncated by setting the `round` option to `ceil`, `floor`, `round` (default), or `truncate`. + +```javascript +var formatter = Globalize.numberFormatter({ + maximumFractionDigits: 2, + round: "ceil" +}); + +formatter( 3.141592 ); +// > "3.15" +``` + +#### Performance Suggestions + +For improved performance on iterations, the formatter should be created before the loop. Then, it can be reused in each iteration. + +```javascript +var numbers = [ 1, 1, 2, 3, ... ]; +var formatter = Globalize( "en" ).numberFormatter(); + +formattedNumbers = numbers.map(function( number ) { + return formatter( number ); +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-parser.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-parser.md new file mode 100644 index 000000000..fb4651f0a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-parser.md @@ -0,0 +1,130 @@ +## .numberParser( [options] ) ➜ function( value ) + +Return a function that parses a String representing a number according to the given options. If value is invalid, `NaN` is returned. + +The returned function is invoked with one argument: the String representing a number `value` to be parsed. + +### Parameters + +#### options + +See [.numberFormatter() options](./number-formatter.md#parameters). + +#### value + +String with number to be parsed, eg. `"3.14"`. + +### Example + +Prior to using any number methods, you must load `cldr/main/{locale}/numbers.json` and `cldr/supplemental/numberingSystems.json`. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.numberParser()`, which uses the default locale. + +```javascript +var parser; + +Globalize.locale( "en" ); +parser = Globalize.numberParser(); + +parser( "3.14" ); +// > 3.14 +``` + +You can use the instance method `.numberParser()`, which uses the instance locale. + +```javascript +var enParser = Globalize( "en" ).numberParser(), + esParser = Globalize( "es" ).numberParser(); + +enParser( "3.14" ); +// > 3.14 + +esParser( "3,14" ); +// > 3.14 +``` + +Some more examples. + +```javascript +var enParser = Globalize( "en" ).numberParser(); + +enParser( "12,735" ); +// > 12735 + +enParser( "12,735.00" ); +// > 12735 + +Globalize( "en" ).numberParser({ style: "percent" })( "100%" ); +// > 1 + +enParser( "∞" ); +// > Infinity + +enParser( "-3" ); +// > -3 + +enParser( "-∞" ); +// > -Infinity + +enParser( "invalid-stuff" ); +// > NaN + +enParser( "invalid-stuff-that-includes-number-123" ); +// > NaN + +enParser( "invalid-stuff-123-that-includes-number" ); +// > NaN + +enParser( "123-invalid-stuff-that-includes-number" ); +// > NaN + +// Invalid decimal separator. (note `.` is used as decimal separator for English) +enParser( "3,14" ); +// > NaN + +// Invalid grouping separator position. +enParser( "127,35.00" ); +// > NaN +``` + +Loose matching examples. + +```js +var svParser = Globalize( "sv" ).numberParser(); + +// Swedish uses NO-BREAK-SPACE U+00A0 as grouping separator. +svParser( "1\xA0000,50" ); +// > 1000.5 + +// The parser is lenient and accepts various space characters like regular space +// SPACE U+0020. Technically, it accepts any character of the Unicode general +// category [:Zs:]. +svParser( "1 000,50" ); +// > 1000.5 + +var fiParser = Globalize( "fi" ).numberParser(); + +// Finish uses MINUS SIGN U+2212 for the minus sign. +fiParser( "\u22123" ); +// > -3 + +// The parser is lenient and accepts various hyphen characters like regular +// HYPHEN-MINUS U+002D. Technically, it accepts any character of the Unicode +// general category [:Dash:]. +fiParser( "-3" ); +// > -3 +``` + +For improved performance on iterations, first create the parser. Then, reuse it +on each loop. + +```javascript +var formattedNumbers = [ "1", "1", "2", "3", ... ]; +var parser = Globalize( "en" ).numberParser(); + +numbers = formattedNumbers.map(function( formattedNumber ) { + return parser( formattedNumber ); +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-to-parts-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-to-parts-formatter.md new file mode 100644 index 000000000..c2b656271 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/number/number-to-parts-formatter.md @@ -0,0 +1,140 @@ +## .numberToPartsFormatter( [options] ) ➜ function( value ) + +Return a function that formats a number into parts tokens according to the given options. + +The returned function is invoked with one argument: the Number `value` to be formatted. + +### Parameters + +#### options + +Please, see [.numberFormatter() options](./number-formatter.md#parameters). + +### Returns + +An Array of objects containing the formatted number in parts. The returned structure looks like this: + +- `decimal` + + The decimal separator string, e.g., `"."`. + +- `fraction` + + The fraction number. + +- `group` + + The group separator string, e.g., `","`. + +- `infinity` + + The Infinity string, e.g., `"∞"`. + +- `integer` + + The integer number. + +- `literal` + + Any literal strings or whitespace in the formatted number. + +- `minusSign` + + The minus sign string, e.g., `"-"`. + +- `nan` + + The NaN string, e.g., `"NaN"`. + +- `plusSign` + + The plus sign string, e.g., `"+"`. + +- `percentSign` + + The percent sign string, e.g., `"%"`. + +- `compact` + + The compact string, e.g., `"thousand"`. + +### Examples + +Prior to using any number methods, you must load `cldr/main/{locale}/numbers.json` and `cldr/supplemental/numberingSystems.json`. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +#### Static Formatter + +You can use the static method `Globalize.numberToPartsFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.numberToPartsFormatter(); + +formatter( 3.141592 ); +// > [ +// { "type": "integer", "value": "3" }, +// { "type": "decimal", "value": "." }, +// { "type": "fraction", "value": "142" } +// ] +``` + +#### Instance Formatter + +You can use the instance method `.numberFormatter()`, which uses the instance +locale. + +```javascript +var arFormatter = Globalize( "ar" ).numberToPartsFormatter(), + esFormatter = Globalize( "es" ).numberToPartsFormatter(), + zhFormatter = Globalize( "zh-u-nu-native" ).numberToPartsFormatter(); + +arFormatter( 3.141592 ); +// > [ +// { "type": "integer", "value": "٣" }, +// { "type": "decimal", "value": "٫" }, +// { "type": "fraction", "value": "١٤٢" } +// ] + +esFormatter( 3.141592 ); +// > [ +// { "type": "integer", "value": "3" }, +// { "type": "decimal", "value": "," }, +// { "type": "fraction", "value": "142" } +// ] + +zhFormatter( 3.141592 ); +// > [ +// { "type": "integer", "value": "三" }, +// { "type": "decimal", "value": "." }, +// { "type": "fraction", "value": "一四二" } +// ] +``` + +The information is available separately and it can be formatted and concatenated again in a customized way. For example by using [`Array.prototype.map()`][], [arrow functions][], a [switch statement][], [template literals][], and [`Array.prototype.reduce()`][]. + +[`Array.prototype.map()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map +[arrow functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions +[switch statement]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch +[template literals]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals +[`Array.prototype.reduce()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce + +#### More Examples + +Please, see [.numberFormatter() example](./number-formatter.md#example) for additional examples such as configuring decimal places, significant digits, percentages, and compact numbers. + +#### Performance Suggestions + +For improved performance on iterations, the formatter should be created before the loop. Then, it can be reused in each iteration. + +```javascript +var numbers = [ 1, 1, 2, 3, ... ]; +var formatter = Globalize( "en" ).numberFormatter(); + +formattedNumbers = numbers.map(function( number ) { + return formatter( number ); +}); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/plural/plural-generator.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/plural/plural-generator.md new file mode 100644 index 000000000..d9cea88ef --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/plural/plural-generator.md @@ -0,0 +1,84 @@ +## .pluralGenerator( [options] ) ➜ function( value ) + +It supports the creation of internationalized messages with plural inflection by returning a function that returns the value's plural group: `zero`, `one`, `two`, `few`, `many`, or `other`. + +The returned function is invoked with one argument: the Number `value` for which to return the plural group. + +### Parameters + +#### options.type + +Optional. String `cardinal` (default), or `ordinal`. + +#### value + +A Number for which to return the plural group. + +### Example + +Prior to using any plural method, you must load either `supplemental/plurals.json` for cardinals or `supplemental/ordinals.json` for ordinals. + +Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.pluralGenerator()`, which uses the default locale. + +```javascript +var plural; + +Globalize.locale( "en" ); + +// Cardinals +plural = Globalize.pluralGenerator(); + +plural( 0 ); +// > "other" + +plural( 1 ); +// > "one" + +plural( 2 ); +// > "other" + +// Ordinals +plural = Globalize.pluralGenerator({ type: "ordinal" }); + +plural( 0 ); +// > "other" + +plural( 1 ); +// > "one" + +plural( 2 ); +// > "two" +``` + +You can use the instance method `.pluralGenerator()`, which uses the instance locale. + +```javascript +var plural = Globalize( "zh" ).pluralGenerator(); + +plural( 1 ); +// > "other" +``` + +For comparison (cardinals): + +| | en (English) | ru (Russian) | ar (Arabic) | +| ------------- | ------------ | ------------ | ----------- | +| `plural( 0 )` | `other` | `many` | `zero` | +| `plural( 1 )` | `one` | `one` | `one` | +| `plural( 2 )` | `other` | `few` | `two` | +| `plural( 3 )` | `other` | `few` | `few` | +| `plural( 5 )` | `other` | `many` | `few` | + +For comparison (ordinals): + +| | en (English) | ru (Russian) | ar (Arabic) | +| ---------------------------------- | ------------ | ------------ | ----------- | +| `plural( 0, { type: "ordinal" } )` | `other` | `other` | `other` | +| `plural( 1, { type: "ordinal" } )` | `one` | `other` | `other` | +| `plural( 2, { type: "ordinal" } )` | `two` | `other` | `other` | +| `plural( 3, { type: "ordinal" } )` | `few` | `other` | `other` | +| `plural( 5, { type: "ordinal" } )` | `other` | `other` | `other` | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/relative-time/relative-time-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/relative-time/relative-time-formatter.md new file mode 100644 index 000000000..a04e345d5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/relative-time/relative-time-formatter.md @@ -0,0 +1,60 @@ +## .relativeTimeFormatter( unit [, options] ) ➜ function( value ) + +Returns a function that formats a relative time according to the given unit, options, and the default/instance locale. + +The returned function is invoked with one argument: the number `value` to be formatted. + +### Parameters + +#### unit + +String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + +#### options.form + +String, e.g., `"short"` or `"narrow"`, or falsy for default long form. + +#### value + +The number to be formatted. + + +### Example + +Prior to using any relative time methods, you must load `cldr/main/{locale}/dateFields.json` and the CLDR content required by the number and plural modules. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.relativeTimeFormatter()`, which uses the default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.relativeTimeFormatter( "month" ); + +formatter( 1 ); +// > "next month" + +formatter( 3 ); +// > "in 3 months" + +formatter( -1 ); +// > "last month" + +formatter( -3 ); +// > "3 months ago" +``` + +You can use the instance method `.relativeTimeFormatter()`, which uses the instance locale. + +```javascript +var globalize = new Globalize( "en" ), + formatter = globalize.relativeTimeFormatter( "week" ); + +formatter( 1 ); +// > "next week" +``` + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/unit/unit-formatter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/unit/unit-formatter.md new file mode 100644 index 000000000..0ab88f203 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/api/unit/unit-formatter.md @@ -0,0 +1,72 @@ +## .unitFormatter( unit [, options] ) ➜ function( value ) + +Returns a function that formats a unit according to the given unit, options, and the default/instance locale. + +The returned function is invoked with one argument: the number `value` to be formatted. + +### Parameters + +#### unit + +String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" + +#### options.form + +Optional. String, e.g., `"long"` (default), `"short"` or `"narrow"`. + +#### options.numberFormatter + +Optional. A number formatter function. Defaults to `Globalize.numberFormatter()` for the current locale using the default options. + +#### value + +The number to be formatted. + +### Example + +Prior to using any unit methods, you must load `cldr/main/{locale}/units.json` and the CLDR content required by the plural module. Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.unitFormatter()`, which uses the default locale. + +```javascript +var customNumberFormatter, formatter; + +Globalize.locale( "en" ); +formatter = Globalize.unitFormatter( "month", { form: "long" } ); + +formatter( 1 ); +// > "1 month" + +formatter( 3 ); +// > "3 months" + +formatter( 3000 ); +// > "3,000 months" +``` + +You can pass a custom number formatter to format the number of units. + +```javascript +var customNumberFormatter, formatter; + +Globalize.locale( "en" ); +customNumberFormatter = Globalize.numberFormatter({ useGrouping = false }) +formatter = Globalize.unitFormatter( "mile-per-hour", { + form: "narrow", numberFormatter: customNumberFormatter +} ); + +formatter(5000) +// > "5000mph" +``` + +You can use the instance method `.unitFormatter()`, which uses the instance locale. + +```javascript +var globalize = new Globalize( "en" ), + formatter = globalize.unitFormatter( "mile-per-hour", { form: "narrow" } ); + +formatter( 10 ); +// > "10mph" +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/blog-post/2017-07-xx-1.3.0-announcement.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/blog-post/2017-07-xx-1.3.0-announcement.md new file mode 100644 index 000000000..004e5b96e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/blog-post/2017-07-xx-1.3.0-announcement.md @@ -0,0 +1,177 @@ +# Globalize 1.3.0 announcement + +On July 3rd, we released Globalize 1.3.0. It is a special release, because it includes some very useful feature enhancements to support advanced date, time, timezone manipulation, and other long due fixes. We wanted to share more details on these improvements. + +## IANA/Olson Time Zone Support + +> This change was contributed by Kandaswamy Manikandan @rajavelmani (PayPal) and Rafael Xavier @rxaviers in #687 and #701. + +In previous versions, Globalize had some partial time zone support for a user's runtime time zone. However specific CLDR patterns (`z`, `v`, and `V`) that display strings such as `PDT`, `Pacific Daylight Time`, `Pacific Time`, and `Los Angeles Time` could not be displayed. The challenge [we had](https://github.com/globalizejs/globalize/pull/202) to determine how costly a solution would be to provide full IANA/Olson time zone support due to the additional manipulation code and data (i.e., IANA database). Therefore, in the past, we encouraged users that needed to manipulate date in arbitrary time zones to use a separate library, like *moment-timezone*. Nevertheless, this solution never closed the gap between internationalization (i18n) implementations leveraging CLDR and having full maneuverability of time zones. + +With the latest release 1.3.0, Globalize fully supports time zone. Simply put, by using Globalize 1.3.0, you now have full IANA support with the strength of CLDR for i18n! + +```js +Globalize.locale("en"); +let date = new Date(); + +Globalize.formatDate(date, {datetime: "short", timeZone: "America/Los_Angeles"}); +// > '3/19/17, 3:19 PM' +Globalize.formatDate(date, {datetime: "short", timeZone: "America/New_York"}); +// > '3/19/17, 6:19 PM' +Globalize.formatDate(date, {datetime: "short", timeZone: "America/Sao_Paulo"}); +// > '3/19/17, 7:19 PM' +Globalize.formatDate(date, {datetime: "short", timeZone: "Europe/Berlin"}); +// > '3/19/17, 11:19 PM' + +Globalize.formatDate(date, {datetime: "full", timeZone: "America/Los_Angeles"}); +// > 'Sunday, March 19, 2017 at 3:19:22 PM Pacific Daylight Time' +Globalize.formatDate(date, {datetime: "full", timeZone: "America/New_York"}); +// > 'Sunday, March 19, 2017 at 6:19:22 PM Eastern Daylight Time' +Globalize.formatDate(date, {datetime: "full", timeZone: "America/Sao_Paulo"}); +// > 'Sunday, March 19, 2017 at 7:19:22 PM Brasilia Standard Time' +Globalize.formatDate(date, {datetime: "full", timeZone: "Europe/Berlin"}); +// > 'Sunday, March 19, 2017 at 11:19:22 PM Central European Standard Time' + +Globalize("pt").formatDate(date, {datetime: "full", timeZone: "America/Sao_Paulo"}); +// > 'domingo, 19 de março de 2017 19:19:22 Horário Padrão de Brasília' +Globalize("de").formatDate(date, {datetime: "full", timeZone: "Europe/Berlin"}); +// > 'Sonntag, 19. März 2017 um 23:19:22 Mitteleuropäische Normalzeit' +Globalize("zh").formatDate(date, {datetime: "full", timeZone: "Asia/Shanghai"}); +// > '2017年3月20日星期一 中国标准时间 上午6:19:22' +Globalize("ar").formatDate(date, {datetime: "full", timeZone: "Africa/Cairo"}); +// > 'الاثنين، ٢٠ مارس، ٢٠١٧ ١٢:١٩:٢٢ ص توقيت شرق أوروبا الرسمي' +``` + +We have solved this in a low footprint, high performance implementation using [zoned-date-time](https://github.com/rxaviers/zoned-date-time) under the hoods, which is a 0.6KB library for the time zone manipulations. We have leveraged the Globalize Compiler for precompling the IANA data base for production. For example, let's say you are serving content in English (e.g. locale en-US) for America/Los_Angeles time using the following formatter: + +```js +var dateWithTimeZoneFormatter = Globalize.dateFormatter({ + datetime: "full", + timeZone: "America/Los_Angeles" +}); +``` + +The final size (for production) of this code will be: + +| filename | minified+gzipped size | +| ---------------------------------------- | --------------------- | +| i18n/en.js (includes CLDR and IANA data) | 1.7KB | +| core, number, and date globalize runtime lib + zoned-date-time | 7.0KB | + +See globalize [compiler example](https://github.com/globalizejs/globalize/tree/master/examples/globalize-compiler) or [app-npm-webpack example](https://github.com/globalizejs/globalize/tree/master/examples/app-npm-webpack) for details. + +## Format Date To Parts + +> This change was contributed by Reza Payami @rpayami (PayPal) and Rafael Xavier @rxaviers in #697 and #700. + +Modern user interfaces often need to manipulate the date format output, which is impossible via the existing format function that returns an opaque string. Making any attempt to do this can break internationalization support. [Ecma-402](https://github.com/tc39/ecma402/) has recently added [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts) to fulfill that purpose, which at the time of this post, is at stage 4 and is implemented by latest Firefox and Chrome. + +In Globalize, we introduced [`.dateToPartsFormatter`](https://github.com/globalizejs/globalize/blob/master/doc/api/date/date-to-parts-formatter.md) and [`.formatDateToParts`](https://github.com/globalizejs/globalize/blob/master/doc/api/date/date-to-parts-formatter.md). + +```js +Globalize.locale( "en" ); +Globalize.formatDateToParts(new Date(2010, 10, 30)); +// > [ +// { "type": "month", "value": "11" }, +// { "type": "literal", "value": "/" }, +// { "type": "day", "value": "30" }, +// { "type": "literal", "value": "/" }, +// { "type": "year", "value": "2010" } +// ] +``` + +The data is available separately and it can be formatted and concatenated again in a customized way. For example by using [`Array.prototype.map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map), [arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions), a [switch statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch), [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals), and [`Array.prototype.reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce). + +```js +let formatter; + +Globalize.locale( "en" ); +formatter = Globalize.dateToPartsFormatter({datetime: "short"}); + +formatter( new Date( 2010, 10, 30, 17, 55 ) ).map(({type, value}) => { + switch ( type ) { + case "year": return `${value}`; + default: return value; + } +}).join( "" ); +// > "11/30/10, 5:55 PM" +``` + +See [React Date Input](https://github.com/rxaviers/react-date-input) as a demo of a UI component for React optimized for i18n and a11y. + +| Localized and smart date input | Feb 28 in `en`, `es`, `pt`, `de`, `zh`, `ko`, and `ar` | +| ---------------------------------------- | ---------------------------------------- | +| ![en](https://media.giphy.com/media/xUA7aZAUNINGP2jI4M/giphy.gif) | ![en-es-pt-de-zh-ko-ar](https://media.giphy.com/media/3og0ILQu0KxLRewJnW/giphy.gif) | + +## Dynamically Augmented Date Skeletons + +> This change was contributed by Marat Dyatko @vectart and Artur Eshenbrener @Strate in #462 and #604. + +The style used to display a date format often varies depending on the application. CLDR offers data for certain presets like short (e.g., short date `"7/1/17"`), medium (e.g., medium date `"Jul 1, 2017"`), long (e.g., long date `"July 1, 2017"`), and full (e.g., full date `"Saturday, July 1, 2017"`). Although, we may want something different such as `"Jul 1"`. For that CLDR offers data for individual [date fields](http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table) and their combinations, which are used by Globalize to synthesize an open-ended list of custom formats (called skeletons). But, what's interesting is that it would be prohibitively large if CLDR provided data for every single possible combination. So, there's an algorithm specified by [UTS#35](http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems) to deduce missing data from the requested format. + +For the `"Jul 1"` example, we should use `{skeleton: "MMMd"}`. Internally, Globalize finds a direct match in CLDR for the requested skeleton. This works fine in previous Globalize versions. + +For that next example, let's assume we want `"July 1"`, i.e., `{skeleton: "MMMMd"}`. Internally, Globalize doesn't find a direct match in CLDR. For this skeleton, Globalize needs to use the data for `MMMd`, which maps to `"MMM d"` in the English case, and then it needs to replace `MMM` with `MMMM` dynamically generating `"MMMM d"`. This doesn't work in previous versions of Globalize, but it works now on latest v1.3.0. + +If we wanted `"07/01"` instead, we should use `{skeleton: "MMdd"}`. Internally, Globalize doesn't find a direct match in CLDR for this skeleton and, therefore, it fais in globalize v1.2.3. Globalize needs to use the data for `Md`, which in the case of English maps to `"M/d"`, and then replace `M` wtih `MM` and `d` with `dd` dynamically generating `"MM/dd"`. + +To make a long story short, the algorithm in globalize v1.3.0 has been significantly improved and it allows using virtually any skeletons. + +```js +// A skeleton not directly found in CLDR and that needs to be deduced by globalize. +// In English, globalize needs to use the data for GyMMMEd, and adjust MMM with MMMM, +// and E with EEEE. Then, it needs to find the data for hms and glue them together +// using the appropriate format. +// On globalize v1.2.3, an error is thrown saying this skeleton wasn't found. +let skeleton = "GyMMMMEEEEdhms"; +Globalize("en").formatDate(new Date(), {skeleton}); +// > 'Saturday, July 1, 2017 AD at 4:58:27 PM' +Globalize("pt").formatDate(new Date(), {skeleton}); +// > 'sábado, 1 de julho de 2017 d.C. 5:01:20 PM' +Globalize("de").formatDate(new Date(), {skeleton}); +// > 'Samstag, 1. Juli 2017 n. Chr. um 5:01:33 nachm.' +Globalize("zh").formatDate(new Date(), {skeleton}); +// > '公元2017年七月月1日星期六 下午5:01:35' +Globalize("ko").formatDate(new Date(), {skeleton}); +// > 'AD 2017년 7월 1일 토요일 오후 5:01:38' +Globalize("ar").formatDate(new Date(), {skeleton}); +// > 'السبت، ١ يوليو، ٢٠١٧ م ٥:٠١:٤٠ م' +Globalize("ar-MA").formatDate(new Date(), {skeleton}); +// > 'السبت، 1 يوليوز، 2017 م 5:04:29 م' +Globalize("it").formatDate(new Date(), {skeleton}); +// > 'sabato 1 luglio 2017 d.C. 5:01:52 PM' +``` + +Read our [getting started](https://github.com/globalizejs/globalize/#getting-started) and play with it yourself. + +## Other Enhancements and Bug Fixes + +🎉 Enhancements + +- Date: Show timezone offset optional minutes for O pattern (e.g., GMT-6:30 note the :30) [#339](https://github.com/globalizejs/globalize/pull/339) (via PR [#729](https://github.com/globalizejs/globalize/pull/729)) (Rafael Xavier) +- Date: Show timezone offset optional minutes and seconds for x and X patterns (e.g., -06:30 note the :30) [#339](https://github.com/globalizejs/globalize/pull/339) (via PR [#729](https://github.com/globalizejs/globalize/pull/729)) (Rafael Xavier) +- Date: Assert options.skeleton (PR [#726](https://github.com/globalizejs/globalize/pull/726)) (Rafael Xavier) +- Date parser: Make runtime phase lighter [#735](https://github.com/globalizejs/globalize/pull/735) (Rafael Xavier) +- Date parser: Loose Matching PR [#730](https://github.com/globalizejs/globalize/pull/730) (Rafael Xavier) + - Allows, among others, parsing arabic dates as user types them (i.e., without control characters) +- Number formatter: Amend integer and fraction formatter for small numbers like 1e-7 [#750](https://github.com/globalizejs/globalize/pull/750) (Rafael Xavier) +- Number parser: Lenient about trailing decimal separator [#744](https://github.com/globalizejs/globalize/pull/744) (Rafael Xavier) +- Runtime: Use strict [#676](https://github.com/globalizejs/globalize/pull/676) (Zack Birkenbuel) + +🐛 Fixes + +- Date parser: invalid output by mixing numbering systems [#696](https://github.com/globalizejs/globalize/pull/696) (via PR [#733](https://github.com/globalizejs/globalize/pull/733)) (Rafael Xavier) +- Date parser: fails on Turkish full datetime with Monday or Saturday [#690](https://github.com/globalizejs/globalize/pull/690) (via PR [#732](https://github.com/globalizejs/globalize/pull/732)) (Rafael Xavier) + +⚙️ Others + +- Compiler tests! [#721](https://github.com/globalizejs/globalize/pull/721) (via PR [#727](https://github.com/globalizejs/globalize/pull/727)) (Nikola Kovacs) +- Documentation style refactor [#737](https://github.com/globalizejs/globalize/pull/737) (Rafael Xavier) + +## Last but not least + +Special thanks to other PayPal internationalization team members including Daniel Bruhn, Lucas Welti, Alolita Sharma, Mike McKenna for testing and helping integrate Globalize for PayPal products. + +Special thanks to James Bellenger and Nicolas Gallagher for the React and Webpack integration enhancements for Twitter products, which certainly deserves its own blog post. + +Many thanks to all of you who participated in this release by testing, reporting bugs, or submitting patches, including Jörn Zaefferer, Frédéric Miserey, Nova Patch, and whole Globalize team. diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/cldr.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/cldr.md new file mode 100644 index 000000000..e7fe767ef --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/cldr.md @@ -0,0 +1,114 @@ +# Unicode CLDR usage + +## How do I get CLDR data? + +*By downloading the JSON packages individually...* + +Unicode CLDR is available as JSON at https://github.com/unicode-cldr/ (after this [json-packaging proposal][] took place). Please, read https://github.com/unicode-cldr/cldr-json for more information about package organization. + +[json-packaging proposal]: http://cldr.unicode.org/development/development-process/design-proposals/json-packaging + +*By using a package manager...* + +`cldr-data` can be used for convenience. It always downloads from the correct source. + +Use bower `bower install cldr-data` ([detailed instructions][]) or npm `npm install cldr-data`. For more information, see: + +- https://github.com/rxaviers/cldr-data-npm +- https://github.com/rxaviers/cldr-data-bower + +[detailed instructions]: https://github.com/rxaviers/cldr-data-bower + +## How do I load CLDR data into Globalize? + +The short answer is by using `Globalize.load()` and passing the JSON data as the first argument. Below, follow several examples on how this could be accomplished. + +Example of embedding CLDR JSON data: + +```html + +``` + +Example of loading it dynamically: + +```html + + +``` + +Example using AMD (also see our [functional tests](../../test/functional.js)): +```javascript +define([ + "globalize", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "globalize/date" +], function( Globalize, enCaGregorian, likelySubtags, timeData, weekData ) { + + Globalize.load( + enCaGregorian, + likelySubtags, + timeData, + weekData + ); + + // Your code goes here. + +}); +``` + +Example using Node.js: + +```javascript +var Globalize = require( "globalize" ); + +Globalize.load( + require( "cldr-data/main/en/ca-gregorian" ), + require( "cldr-data/supplemental/likelySubtags" ), + require( "cldr-data/supplemental/timeData" ), + require( "cldr-data/supplemental/weekData" ) +); +``` diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-default-locale-not-defined.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-default-locale-not-defined.md new file mode 100644 index 000000000..84e6d8156 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-default-locale-not-defined.md @@ -0,0 +1,9 @@ +## E_DEFAULT_LOCALE_NOT_DEFINED + +Thrown when any static method, eg. `Globalize.formatNumber()` is used prior to setting the Global locale with `Globalize.locale( )`. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_DEFAULT_LOCALE_NOT_DEFINED` | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-cldr.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-cldr.md new file mode 100644 index 000000000..8a954cc79 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-cldr.md @@ -0,0 +1,14 @@ +## E_INVALID_CLDR + +Thrown when a CLDR item has an invalid or unexpected value. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_CLDR` | +| description | Reason why the data was considered invalid | + +- description "Missing rules to deduce plural form of \`{value}\`" + + Thrown when the plural form (also known as plural group) is not found for the given value. This error is very unlikely to occur and is related to incomplete or invalid CLDR `supplemental/plurals-type-cardinal/{language}` data. diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-par-type.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-par-type.md new file mode 100644 index 000000000..893cf1bf0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-par-type.md @@ -0,0 +1,12 @@ +## E_INVALID_PAR_TYPE + +Thrown when a parameter has an invalid type on any static or instance methods. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_PAR_TYPE` | +| name | Name of the invalid parameter | +| value | Invalid value | +| expected | Expected type | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-par-value.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-par-value.md new file mode 100644 index 000000000..d9e32ba3e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-invalid-par-value.md @@ -0,0 +1,11 @@ +## E_INVALID_PAR_VALUE + +Thrown for certain parameters when the type is correct, but the value is invalid. Currently, the only parameter with such validation is the date format (for either format and parse). Format allows [certain variants](../api/date/date-formatter.md#parameters), if it's none of them, error is thrown. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_PAR_VALUE` | +| name | Name of the invalid parameter | +| value | Invalid value | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-cldr.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-cldr.md new file mode 100644 index 000000000..fc77dbf9d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-cldr.md @@ -0,0 +1,11 @@ +## E_MISSING_CLDR + +Thrown when any required CLDR item is NOT found. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_CLDR` | +| path | Missing CLDR item path | + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-parameter.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-parameter.md new file mode 100644 index 000000000..f0efac2cd --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-parameter.md @@ -0,0 +1,10 @@ +## E_MISSING_PARAMETER + +Thrown when a required parameter is missing on any static or instance methods. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_PARAMETER` | +| name | Name of the missing parameter | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-plural-module.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-plural-module.md new file mode 100644 index 000000000..e80610c5f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-missing-plural-module.md @@ -0,0 +1,9 @@ +## E_MISSING_PLURAL_MODULE + +Thrown when plural module is needed, but not loaded, eg. formatting currencies using plural messages. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_PLURAL_MODULE` | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-par-missing-key.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-par-missing-key.md new file mode 100644 index 000000000..974aa5b10 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-par-missing-key.md @@ -0,0 +1,11 @@ +## E_PAR_MISSING_KEY + +Thrown when a parameter misses a required key. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_PAR_MISSING_KEY` | +| key | Name of the missing parameter's key | +| name | Name of the missing parameter | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-par-out-of-range.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-par-out-of-range.md new file mode 100644 index 000000000..44c0c91fc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-par-out-of-range.md @@ -0,0 +1,13 @@ +## E_PAR_OUT_OF_RANGE + +Thrown when a parameter is not within a valid range of values. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_PAR_OUT_OF_RANGE` | +| name | Name of the invalid parameter | +| value | Invalid value | +| minimum | Minimum value of the valid range | +| maximum | Maximum value of the valid range | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-unsupported.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-unsupported.md new file mode 100644 index 000000000..33546c165 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/error/e-unsupported.md @@ -0,0 +1,10 @@ +## E_UNSUPPORTED + +Thrown for unsupported features, eg. to format unsupported date patterns. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_UNSUPPORTED` | +| feature | Description of the unsupported feature | diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/migrating-from-0.x.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/migrating-from-0.x.md new file mode 100644 index 000000000..6187beb3a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/doc/migrating-from-0.x.md @@ -0,0 +1,64 @@ +# Migrating from Globalize 0.x + +Globalize 0.x came with a bundled locale for US English, and optional files for various other locales. Globalize 1.x uses CLDR for the locale data, and it doesn't bundle any locale data. Check out the documentation for loading CLDR data in 1.x to learn more about that. If you were only using the bundle locale, you only need to load CLDR data for US English. If you were loading other locales, make sure you load those from CLDR as well. + +On the API side, things have also changed, to simplify usage, remove ambiguity and add features. The rest of this document provides a brief function-by-function list. + +If you still need help with migration, let us know. We may extend this guide later as necessary. + +## Globalize.addCultureInfo() + +This method is replaced by `Globalize.loadMessages( json )`. If you were using it for anything except message translations, you may also need to use `Globalize.load`. + +## Globalize.cultures + +This property is gone. You can use Cldrjs to traverse CLDR directly. + +## Globalize.culture( [locale] ) + +This method is replaced by the `Globalize.locale( [locale|cldr] )` method. Call it without arguments to retrieve the default locale, call it with a string argument to set the default locale. + +## Globalize.findClosestCulture + +This method is gone, there is no replacement. If you still need this method, create an issue with your usecase. + +## Globalize.format + +Replaced by three separate methods: + +* `.formatNumber( value [, options] )` +* `.formatCurrency( value, currency [, options] )` +* `.formatDate( value, pattern )` + +See their respective documentation for usage details. Note that the number and date formats are now based on CLDR, using the options and patterns standardized by Unicode. We don't currently have documentation for migrating these formats. + +## Globalize.localize + +Replaced by `.formatMessage( path [, variables ] )`. The new API is quite different and provides much more than just value-lookup. See their respective documentation for usage details. + +## Globalize.parseInt/parseFloat + +Replaced by `.parseNumber( value [, options] )`. So where you might have previously executed: + +```js +Globalize( "en" ).parseFloat( "123,456.789" ) +// > 123456.789 +``` + +You could now execute: + +```js +Globalize( "en" ).parseNumber( "123,456.789" ) +// > 123456.789 +``` + +`parseNumber` is an alias for [`.numberParser( [options] )( value )`](api/number/number-parser.md). So you could also do this: + +```js +Globalize( "en" ).numberParser()( "123,456.789" ) +// > 123456.789 +``` + +## Globalize.parseDate + +This method still exists, and the signature is almost the same: `.parseDate( value, pattern )`. Note that `pattern` indicates just a single "format", where Globalize 0.x supported multiple of those "formats". diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/.bowerrc b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/.bowerrc new file mode 100644 index 000000000..adf6a3662 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/.bowerrc @@ -0,0 +1,7 @@ +{ + "directory": "bower_components", + "scripts": { + "preinstall": "npm install cldr-data-downloader", + "postinstall": "node ./node_modules/cldr-data-downloader/bin/download.js -i bower_components/cldr-data/index.json -o bower_components/cldr-data/" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/.gitignore b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/.gitignore new file mode 100644 index 000000000..fbe05fc93 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/.gitignore @@ -0,0 +1 @@ +bower_components/ diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/README.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/README.md new file mode 100644 index 000000000..0ea1e5d5c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/README.md @@ -0,0 +1,65 @@ +# Hello World (AMD + bower) + +We assume you know what [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) and +[bower](http://bower.io/) is. + +The demo is composed of the following files: + +``` +. +├── index.html +└── main.js +``` + +Before running it, execute the requirements below. + + +## Requirements + +**1. Install Globalize** + +Let's use bower to download Globalize. For more information on regard of +installation, please read [Getting Started](../../README.md#installation). + +``` +bower install +``` + +Note bower will also fetch some other dependencies of this demo, eg. require.js +and its json plugin. + +You'll get this: + +``` +. +├── bower_components/ +│ ├── globalize/ +│ │ └── dist/ +│ │ ├── globalize +│ │ │ ├── date.js +│ │ │ └── ... +│ │ └── globalize.js +│ └── ... +├── index.html +└── main.js +``` + +**2. Install Dependencies** + +No action needed, because bower has already handled that for us. + +**3. CLDR content** + +No action needed, because bower has already handled that for us. Note `.bowerrc` +has postinstall hook that populates bower's cldr-data skeleton. For more +information, see [bower's cldr-data](https://github.com/rxaviers/cldr-data-bower). + + +## Running the demo + +Once you've completed the requirements above: + +1. Start a server by running `python -m SimpleHTTPServer` or other alternative servers such as [http-server](https://github.com/nodeapps/http-server), [nginx](http://nginx.org/en/docs/), [apache](http://httpd.apache.org/docs/trunk/). +1. Point your browser at `http://localhost:8000/`. +1. Understand the demo by reading the source code (both index.html and main.js). +We have comments there for you. diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/bower.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/bower.json new file mode 100644 index 000000000..f7e6a3c0c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/bower.json @@ -0,0 +1,13 @@ +{ + "name": "globalize-hello-world-amd-bower", + "dependencies": { + "cldr-data": "*", + "globalize": "^1.3.0", + "iana-tz-data": "*" + }, + "devDependencies": { + "requirejs": "2.1.14", + "requirejs-plugins": "1.0.2" , + "requirejs-text": "2.0.12" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/index.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/index.html new file mode 100644 index 000000000..753c99c95 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/index.html @@ -0,0 +1,46 @@ + + + + + Globalize Hello World (AMD + bower) + + +

Globalize Hello World (AMD + bower)

+ +
+

Requirements

+
    +
  • Run `bower install` (you must have bower installed first).
  • +
  • Start a server, e.g., by running `python -m SimpleHTTPServer`.
  • +
  • Point your browser at `http://localhost:8000/`.
  • +
  • Please, read README.md for more information on any of the above.
  • +
+
+ + + + + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/main.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/main.js new file mode 100644 index 000000000..3b72d7fa5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/main.js @@ -0,0 +1,141 @@ +/** + * 1. Configure require.js paths. + */ +require.config({ + paths: { + // Globalize dependencies paths. + cldr: "./bower_components/cldrjs/dist/cldr", + + // Unicode CLDR JSON data. + "cldr-data": "./bower_components/cldr-data", + + // IANA time zone data. + "iana-tz-data": "../bower_components/iana-tz-data/iana-tz-data", + + // require.js plugin we'll use to fetch CLDR JSON content. + json: "./bower_components/requirejs-plugins/src/json", + + // text is json's dependency. + text: "./bower_components/requirejs-text/text", + + // Globalize. + globalize: "./bower_components/globalize/dist/globalize" + } +}); + + +/** + * 2. Require dependencies and run your code. + */ +require([ + "globalize", + + // CLDR content. + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/dateFields.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/en/units.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/metaZones.json", + "json!cldr-data/supplemental/plurals.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!messages/en.json", + "json!iana-tz-data.json", + + // Extend Globalize with Date and Number modules. + "globalize/currency", + "globalize/date", + "globalize/message", + "globalize/number", + "globalize/plural", + "globalize/relative-time", + "globalize/unit" +], function( Globalize, enGregorian, enCurrencies, enDateFields, enNumbers, + enTimeZoneNames, enUnits, currencyData, likelySubtags, metaZones, + pluralsData, timeData, weekData, messages, ianaTzData ) { + + var en, like, number; + + // At this point, we have Globalize loaded. But, before we can use it, we need to feed it on the appropriate I18n content (Unicode CLDR). Read Requirements on Getting Started on the root's README.md for more information. + Globalize.load( + currencyData, + enCurrencies, + enDateFields, + enGregorian, + enNumbers, + enTimeZoneNames, + enUnits, + likelySubtags, + metaZones, + pluralsData, + timeData, + weekData + ); + Globalize.loadMessages( messages ); + Globalize.loadTimeZone( ianaTzData ); + + // Instantiate "en". + en = Globalize( "en" ); + + // Use Globalize to format dates. + document.getElementById( "date" ).textContent = en.formatDate( new Date(), { + datetime: "medium" + }); + + // Use Globalize to format dates on specific time zone. + document.getElementById( "zonedDate" ).textContent = en.formatDate( new Date(), { + datetime: "full", + timeZone: "America/Sao_Paulo" + }); + + // Use Globalize to format dates to parts. + document.getElementById( "dateToParts" ).innerHTML = en.formatDateToParts( new Date(), { + datetime: "medium" + }).map( function( part ) { + switch ( part.type ) { + case "month": return "" + part.value + ""; + default: return part.value; + } + }).reduce( function( memo, value ) { + return memo + value; + }); + + // Use Globalize to format numbers. + number = en.numberFormatter(); + document.getElementById( "number" ).textContent = number( 12345.6789 ); + document.getElementById( "number-compact" ).textContent = en.formatNumber( 12345.6789, { + compact: "short", + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }); + + // Use Globalize to format currencies. + document.getElementById( "currency" ).textContent = en.formatCurrency( 69900, "USD" ); + + // Use Globalize to get the plural form of a numeric value. + document.getElementById( "plural-number" ).textContent = number( 12345.6789 ); + document.getElementById( "plural-form" ).textContent = en.plural( 12345.6789 ); + + // Use Globalize to format a message with plural inflection. + like = en.messageFormatter( "like" ); + document.getElementById( "message-0" ).textContent = like( 0 ); + document.getElementById( "message-1" ).textContent = like( 1 ); + document.getElementById( "message-2" ).textContent = like( 2 ); + document.getElementById( "message-3" ).textContent = like( 3 ); + + // Use Globalize to format a relative time. + document.getElementById( "relative-time" ).textContent = en.formatRelativeTime( -35, "second" ); + + // Use Globalize to format a unit. + document.getElementById( "unit" ).textContent = en.formatUnit( 60, "mile/hour", { + form: "short" + }); + + document.getElementById( "requirements" ).style.display = "none"; + document.getElementById( "demo" ).style.display = "block"; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/messages/en.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/messages/en.json new file mode 100644 index 000000000..cd37baee8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/messages/en.json @@ -0,0 +1,12 @@ +{ + "en": { + "like": [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/package.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/package.json new file mode 100644 index 000000000..d5d3f391b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/amd-bower/package.json @@ -0,0 +1,14 @@ +{ + "name": "globalize-hello-world-amd-bower", + "private": true, + "comment": [ + "You don't need this file. The only reasone this example does have a", + "package.json is to fool npm, so cldr-data-downloader doesn't get", + "installed on Globalize's root.", + "", + "It's analogous to `chroot .` for npm. [:P]" + ], + "dependencies": { + "cldr-data-downloader": "^0.3.4" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/.gitignore b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/.gitignore new file mode 100644 index 000000000..1b4210d4e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules +.tmp-globalize-webpack diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/README.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/README.md new file mode 100644 index 000000000..ead9d4307 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/README.md @@ -0,0 +1,74 @@ +# Globalize App example using webpack + +This example demonstrates how to integrate Globalize with Webpack in your +Application. If you already have an existing Application using Webpack stack, +this example should as well provide you guidance on how to integrate Globalize. +It focuses on the [Globalize Webpack Plugin][], which automates data loading +(CLDR and app messages) during development and automates Globalize compilation +and the usage of Globalize runtime modules for production. It assumes knowledge +of Globalize, npm, and Webpack usage basics. + +## Requirements + +**1. Install app development dependencies** + +This example uses `npm` to download the app development dependencies (i.e., +Globalize, CLDR data, Cldrjs, Webpack, [Globalize Webpack Plugin][], and +others). + +``` +npm install +``` + +## Running the example + +### Development mode + +``` +npm start +``` + +1. Start a server by running `npm start`, which uses webpack's live reload HMR +(Hot Module Replacement). See `package.json` to understand the actual shell +command that is used. +1. Point your browser at `http://localhost:8080`. Note that your browser will +automatically reload on any changes made to the application code (`app/*.js` +files). Also note that for faster page reload, formatters are created +dynamically and automatically by the [Globalize Webpack Plugin][]. +1. Note you can specify the development locale of your choice by setting the +`developmentLocale` property of the Globalize Webpack Plugin on the Webpack +config file. +1. Note that CLDR data and your messages data are automatically loaded by the +[Globalize Webpack Plugin][]. +1. Understand the demo by reading the source code. We have comments there for +you. + +### Production mode + +``` +npm run build +``` + +1. Generate the compiled bundles by running `npm run build`, which will be +created at `./dist`. Note the production bundles are split into three chunks: +(a) vendor, which holds third-party libraries, which in this case means +Globalize Runtime modules, (b) i18n precompiled data, which means the minimum +yet sufficient set of precompiled i18n data that your application needs (one +file for each supported locale), and (c) app, which means your application code. +Also note that all the production code is already minified using UglifyJS. See +`package.json` to understand the actual shell command that is used. +1. Note that your formatters are already precompiled. This is +obvious, but worth emphasizing. It means your formatters are prebuilt, so no client +CPU clock is wasted to generate them and no CLDR or messages data needs to be +dynamically loaded. It means fast to load code (small code) and fast to run +code. +1. Point your browser at `./dist/index.html` to run the application using the +generated production files. Edit this file to display the application using a +different locale (source code has instructions). +1. Understand the demo by reading the source code. We have comments there for +you. + +For more information about the plugin, see the [Globalize Webpack Plugin][] +documentation. + +[Globalize Webpack Plugin]: https://github.com/rxaviers/globalize-webpack-plugin diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/app/index.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/app/index.js new file mode 100644 index 000000000..2c3bb1b34 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/app/index.js @@ -0,0 +1,89 @@ +var Globalize = require( "globalize" ); +var startTime = new Date(); + +// Standalone table. +var numberFormatter = Globalize.numberFormatter({ maximumFractionDigits: 2 }); +document.getElementById( "number" ).textContent = numberFormatter( 12345.6789 ); + +var numberCompactFormatter = Globalize.numberFormatter({ + compact: "short", + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); +document.getElementById( "number-compact" ).textContent = numberCompactFormatter( 12345.6789 ); + +var currencyFormatter = Globalize.currencyFormatter( "USD" ); +document.getElementById( "currency" ).textContent = currencyFormatter( 69900 ); + +var dateFormatter = Globalize.dateFormatter({ datetime: "medium" }); +document.getElementById( "date" ).textContent = dateFormatter( new Date() ); + +var dateWithTimeZoneFormatter = Globalize.dateFormatter({ + datetime: "full", + timeZone: "America/Sao_Paulo" +}); +document.getElementById( "date-time-zone" ).textContent = dateWithTimeZoneFormatter( new Date() ); + +var _dateToPartsFormatter = Globalize.dateToPartsFormatter({ datetime: "medium" }); +var dateToPartsFormatter = function( value ) { + return _dateToPartsFormatter( value, { + datetime: "medium" + }).map(function( part ) { + switch(part.type) { + case "month": return "" + part.value + ""; + default: return part.value; + } + }).reduce(function( memo, value ) { + return memo + value; + }); +}; +document.getElementById( "date-to-parts" ).innerHTML = dateToPartsFormatter( new Date() ); + +var relativeTimeFormatter = Globalize.relativeTimeFormatter( "second" ); +document.getElementById( "relative-time" ).textContent = relativeTimeFormatter( 0 ); + +var unitFormatter = Globalize.unitFormatter( "mile/hour", { form: "short" } ); +document.getElementById( "unit" ).textContent = unitFormatter( 60 ); + +// Messages. +document.getElementById( "intro-1" ).textContent = Globalize.formatMessage( "intro-1" ); +document.getElementById( "number-label" ).textContent = Globalize.formatMessage( "number-label" ); +document.getElementById( "number-compact-label" ).textContent = Globalize.formatMessage( "number-compact-label" ); +document.getElementById( "currency-label" ).textContent = Globalize.formatMessage( "currency-label" ); +document.getElementById( "date-label" ).textContent = Globalize.formatMessage( "date-label" ); +document.getElementById( "date-time-zone-label" ).textContent = Globalize.formatMessage( "date-time-zone-label" ); +document.getElementById( "date-to-parts-label" ).textContent = Globalize.formatMessage( "date-to-parts-label" ); +document.getElementById( "relative-time-label" ).textContent = Globalize.formatMessage( "relative-time-label" ); +document.getElementById( "unit-label" ).textContent = Globalize.formatMessage( "unit-label" ); +document.getElementById( "message-1" ).textContent = Globalize.formatMessage( "message-1", { + currency: currencyFormatter( 69900 ), + date: dateFormatter( new Date() ), + number: numberFormatter( 12345.6789 ), + relativeTime: relativeTimeFormatter( 0 ), + unit: unitFormatter( 60 ) +}); + +document.getElementById( "message-2" ).textContent = Globalize.formatMessage( "message-2", { + count: 3 +}); + +// Display demo. +document.getElementById( "requirements" ).style.display = "none"; +document.getElementById( "demo" ).style.display = "block"; + +// Refresh elapsed time +setInterval(function() { + var elapsedTime = +( ( startTime - new Date() ) / 1000 ).toFixed( 0 ); + document.getElementById( "date" ).textContent = dateFormatter( new Date() ); + document.getElementById( "date-time-zone" ).textContent = dateWithTimeZoneFormatter( new Date() ); + document.getElementById( "date-to-parts" ).innerHTML = dateToPartsFormatter( new Date() ); + document.getElementById( "relative-time" ).textContent = relativeTimeFormatter( elapsedTime ); + document.getElementById( "message-1" ).textContent = Globalize.formatMessage( "message-1", { + currency: currencyFormatter( 69900 ), + date: dateFormatter( new Date() ), + number: numberFormatter( 12345.6789 ), + relativeTime: relativeTimeFormatter( elapsedTime ), + unit: unitFormatter( 60 ) + }); + +}, 1000); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/index-template.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/index-template.html new file mode 100644 index 000000000..48966fd8e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/index-template.html @@ -0,0 +1,71 @@ + + + + + + Globalize App example using Webpack + + + +

Globalize App example using Webpack

+ +
+

Requirements

+
    +
  • Read README.md for instructions on how to run the demo. +
  • +
+
+ + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/ar.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/ar.json new file mode 100644 index 000000000..cb4142b99 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/ar.json @@ -0,0 +1,25 @@ +{ + "ar": { + "intro-1": "‫استخدم Globalize لتدويل تطبيقك.‬", + "number-label": "رقم", + "number-compact-label": "الرقم (شكل مدمج)", + "currency-label": "عملة", + "date-label": "تاريخ", + "date-time-zone-label": "التاريخ (في منطقة زمنية محددة ل إيانا، على سبيل المثال، America/Sao_Paulo)", + "date-to-parts-label": "التاريخ (لاحظ الشهر القوي، تمت إضافة الترميز باستخدام formatDateToParts)", + "relative-time-label": "الوقت النسبي", + "unit-label": "وحدة القياس", + "message-1": "مثال علي رسالة باستخدام رقم مختلط \"{number}\", عملة \"{currency}\", تاريخ \"{date}\", وقت نسبي \"{relativeTime}\", و وحدة قياس \"{unit}\" .", + "message-2": [ + "مثال على رسالة بدعم صيغة الجمع:", + "{count, plural,", + " zero {لا يوجد لديك اي مهام متبقية}", + " one {لديك مهمة واحدة متبقية}", + " two {لديك اثنين من المهام المتبقية}", + " few {لديك # من المهام المتبقية}", + " many {لديك # من المهام المتبقية}", + " other {لديك # من المهام المتبقية}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/de.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/de.json new file mode 100644 index 000000000..00b8326a0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/de.json @@ -0,0 +1,21 @@ +{ + "de": { + "intro-1": "Verwenden Sie Globalize um Ihre Anwendung zu internationalisieren.", + "number-label": "Zahl", + "number-compact-label": "Zahl (kompakte Form)", + "currency-label": "Währung", + "date-label": "Datum", + "date-time-zone-label": "Datum (in einer bestimmten IANA-Zeitzone, z. B. America/Sao_Paulo)", + "date-to-parts-label": "Datum (beachten Sie den hervorgehobenen Monat, das Markup wurde mit dateToPartsFormatter hinzugefügt)", + "relative-time-label": "Relative Zeit", + "unit-label": "Einheit", + "message-1": "Ein Beispiel mit Zahl \"{number}\", Währung \"{currency}\", Datum \"{date}\", relative Zeit \"{relativeTime}\", und Einheit \"{unit}\".", + "message-2": [ + "Ein Beispieltext mit Unterstützung von Plural Formen: ", + "{count, plural,", + " one {Sie haben noch eine Aufgabe}", + " other {Sie haben noch # verbliebende Aufgaben}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/en.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/en.json new file mode 100644 index 000000000..290c91d46 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/en.json @@ -0,0 +1,21 @@ +{ + "en": { + "intro-1": "Use Globalize to internationalize your application.", + "number-label": "Number", + "number-compact-label": "Number (compact form)", + "currency-label": "Currency", + "date-label": "Date", + "date-time-zone-label": "Date (in a specific IANA time zone, e.g., America/Sao_Paulo)", + "date-to-parts-label": "Date (note the highlighted month, the markup was added using formatDateToParts)", + "relative-time-label": "Relative Time", + "unit-label": "Unit", + "message-1": "An example of a message using mixed number \"{number}\", currency \"{currency}\", date \"{date}\", relative time \"{relativeTime}\", and unit \"{unit}\".", + "message-2": [ + "An example of a message with pluralization support:", + "{count, plural,", + " one {You have one remaining task}", + " other {You have # remaining tasks}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/es.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/es.json new file mode 100644 index 000000000..6cc794275 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/es.json @@ -0,0 +1,21 @@ +{ + "es": { + "intro-1": "Usa Globalize para internacionalizar tu aplicación.", + "number-label": "Número", + "number-compact-label": "Número (forma compacta)", + "currency-label": "Moneda", + "date-label": "Fecha", + "date-time-zone-label": "Fecha (en una zona horaria IANA específica, por ejemplo, America/Sao_Paulo)", + "date-to-parts-label": "Fecha (note el mes destacado en negro, el marcador de html se agregó utilizando dateToPartsFormatter)", + "relative-time-label": "Tiempo Relativo", + "unit-label": "Unidad", + "message-1": "Un ejemplo de mensaje usando números mixtos \"{number}\", monedas \"{currency}\", fechas \"{date}\", tiempo relativo \"{relativeTime}\", y unidades \"{unit}\".", + "message-2": [ + "Un ejemplo de mensaje con soporte de pluralización:", + "{count, plural,", + " one {Tienes una tarea restante}", + " other {Tienes # tareas restantes}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/pt.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/pt.json new file mode 100644 index 000000000..b58f8cf50 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/pt.json @@ -0,0 +1,21 @@ +{ + "pt": { + "intro-1": "Use o Globalize para internacionalizar sua aplicação.", + "number-label": "Número", + "number-compact-label": "Número (forma compacta)", + "currency-label": "Moeda", + "date-label": "Data", + "date-time-zone-label": "Data (em um fuso horário IANA específico, por exemplo, America/Sao_Paulo)", + "date-to-parts-label": "Data (note o mês em negrito, a marcação HTML foi adicionada usando formatDateToParts)", + "relative-time-label": "Tempo relativo", + "unit-label": "Unit", + "message-1": "Um exemplo de mensagem com mistura de número \"{number}\", moeda \"{currency}\", data \"{date}\", tempo relativo \"{relativeTime}\", e unidade \"{unit}\".", + "message-2": [ + "Um exemplo de message com suporte a pluralização:", + "{count, plural,", + " one {Você tem uma tarefa restante}", + " other {Você tem # tarefas restantes}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/ru.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/ru.json new file mode 100644 index 000000000..bedfa2de5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/ru.json @@ -0,0 +1,23 @@ +{ + "ru": { + "intro-1": "Используйте Globalize для интернационализиции вашего приложения.", + "number-label": "Число", + "number-compact-label": "Число (компактная форма)", + "currency-label": "Валюта", + "date-label": "Дата", + "date-time-zone-label": "Дата (в определенном часовом поясе IANA, например, America/Sao_Paulo)", + "date-to-parts-label": "Дата (обратите внимание на сильный месяц, разметка была добавлена с помощью formatDateToParts)", + "relative-time-label": "Относительное время", + "unit-label": "Единица измерения", + "message-1": "Пример сообщения с числом \"{number}\", валютой \"{currency}\", датой \"{date}\", относительным временем \"{relativeTime}\" и единицей измерения \"{unit}\".", + "message-2": [ + "Пример сообщения с поддержкой множественного числа:", + "{count, plural,", + " one {У вас осталась одна задача}", + " many {У вас осталось # задач}", + " few {У вас осталось # задачи}", + " other {У вас осталось # задачи}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/zh.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/zh.json new file mode 100644 index 000000000..6f89ef30a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/messages/zh.json @@ -0,0 +1,20 @@ +{ + "zh": { + "intro-1": "使用Globalize的国际化应用程序", + "number-label": "号码", + "number-compact-label": "编号(紧凑形式)", + "currency-label": "币", + "date-label": "迄今", + "date-time-zone-label": "日期(在特定的IANA时区,例如America / Sao_Paulo)", + "date-to-parts-label": "日期(注意强烈的月份,使用formatDateToParts添加标记)", + "relative-time-label": "相对时间", + "unit-label": "单元", + "message-1": "使用混合数\"{number}\",货币\"{currency}\",日期\"{date}\",相对时间\"{relativeTime}\"和单元\"{unit}\"的消息的例子。", + "message-2": [ + "与多元化支持消息的例子:", + "{count, plural,", + " other {你有#剩下的任务}", + "}." + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/package.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/package.json new file mode 100644 index 000000000..47326c016 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "devDependencies": { + "cldr-data": ">=25", + "globalize": "^1.3.0", + "globalize-webpack-plugin": "^2.1.0", + "html-webpack-plugin": "^2.30.1", + "iana-tz-data": "^2017.1.0", + "webpack": "^3.11.0", + "webpack-dev-server": "^2.11.1" + }, + "scripts": { + "start": "webpack-dev-server --config webpack-config.js --hot --progress --colors --inline", + "build": "NODE_ENV=production webpack --config webpack-config.js" + }, + "cldr-data-urls-filter": "(core|dates|numbers|units)" +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/webpack-config.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/webpack-config.js new file mode 100644 index 000000000..0cd8fece5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/app-npm-webpack/webpack-config.js @@ -0,0 +1,63 @@ +var webpack = require( "webpack" ); +var path = require("path"); +var CommonsChunkPlugin = require( "webpack/lib/optimize/CommonsChunkPlugin" ); +var HtmlWebpackPlugin = require( "html-webpack-plugin" ); +var GlobalizePlugin = require( "globalize-webpack-plugin" ); + +var production = process.env.NODE_ENV === "production"; +var globalizeCompiledDataRegex = new RegExp( /^(globalize\-compiled\-data)\-\S+$/ ); + +function subLocaleNames( name ) { + return name.replace( globalizeCompiledDataRegex, "$1" ); +} + +module.exports = { + entry: { + main: "./app/index.js", + }, + output: { + path: path.join( __dirname, production ? "./dist" : "./tmp" ), + publicPath: production ? "" : "http://localhost:8080/", + chunkFilename: "[name].[chunkhash].js", + filename: production ? "[name].[chunkhash].js" : "app.js" + }, + resolve: { + extensions: [ "*", ".js" ] + }, + plugins: [ + new HtmlWebpackPlugin({ + template: "./index-template.html", + // filter to a single compiled globalize language + // change 'en' to language of choice or remove inject all languages + // NOTE: last language will be set language + chunks: [ "vendor", "globalize-compiled-data-en", "main" ], + chunksSortMode: function ( c1, c2 ) { + var orderedChunks = [ "vendor", "globalize-compiled-data", "main" ]; + var o1 = orderedChunks.indexOf( subLocaleNames( c1.names[ 0 ])); + var o2 = orderedChunks.indexOf( subLocaleNames( c2.names[ 0 ])); + return o1 - o2; + }, + }), + new GlobalizePlugin({ + production: production, + developmentLocale: "en", + supportedLocales: [ "ar", "de", "en", "es", "pt", "ru", "zh" ], + messages: "messages/[locale].json", + output: "i18n/[locale].[chunkhash].js" + }) + ].concat( production ? [ + new CommonsChunkPlugin({ + name: "vendor", + minChunks: function(module) { + return ( + module.context && module.context.indexOf("node_modules") !== -1 + ); + } + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }) + ] : [] ) +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/.gitignore b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/.gitignore new file mode 100644 index 000000000..9537a1c27 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/.gitignore @@ -0,0 +1 @@ +compiled-formatters.js diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/README.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/README.md new file mode 100644 index 000000000..65c3918c0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/README.md @@ -0,0 +1,45 @@ +# Basic Globalize Compiler example + +This example focuses on the Globalize Compiler and the Globalize runtime +modules. It assumes knowledge of Globalize usage basics. + +## Requirements + +**1. Install Globalize dependencies and Globalize Compiler** + +This example uses `npm` to download Globalize dependencies (i.e., CLDR data and +the Cldrjs library) and the [Globalize Compiler][]. + +``` +npm install +``` + +[Globalize Compiler]: https://github.com/globalizejs/globalize-compiler + +## Running the example + +### Development mode + +1. Start a server by running `python -m SimpleHTTPServer` or other alternative +servers such as [http-server][], [nginx][], [apache][]. +1. Point your browser at `http://localhost:8000/development.html`. Note that the +formatters are created dynamically. Therefore, Cldrjs and CLDR data are +required. +1. Understand the demo by reading the source code. We have comments there for +you. + +[http-server]: https://github.com/nodeapps/http-server +[nginx]: http://nginx.org/en/docs/ +[apache]: http://httpd.apache.org/docs/trunk/ + +### Production mode + +1. Compile the application formatters by running `npm run build`. See +`package.json` to understand the actual shell command that is used. For more +information about the compiler, see the [Globalize Compiler documentation][]. +1. Point your browser at `./production.html`. Note that we don't need Cldrjs nor +CLDR data in production here. +1. Understand the demo by reading the source code. We have comments there for +you. + +[Globalize Compiler documentation]: https://github.com/globalizejs/globalize-compiler#README diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/app.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/app.js new file mode 100644 index 000000000..895855581 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/app.js @@ -0,0 +1,58 @@ +var like, number; + +// Use Globalize to format dates. +document.getElementById( "date" ).textContent = Globalize.formatDate( new Date(), { + datetime: "medium" +}); + +// Use Globalize to format dates on specific time zone. +document.getElementById( "zonedDate" ).textContent = Globalize.formatDate( new Date(), { + datetime: "full", + timeZone: "America/Sao_Paulo" +}); + +// Use Globalize to format dates to parts. +document.getElementById( "dateToParts" ).innerHTML = Globalize.formatDateToParts( new Date(), { + datetime: "medium" +}).map(function( part ) { + switch(part.type) { + case "month": return "" + part.value + ""; + default: return part.value; + } +}).reduce(function( memo, value ) { + return memo + value; +}); + +// Use Globalize to format numbers. +number = Globalize.numberFormatter(); +document.getElementById( "number" ).textContent = number( 12345.6789 ); +document.getElementById( "number-compact" ).textContent = Globalize.formatNumber( 12345.6789, { + compact: "short", + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +// Use Globalize to format currencies. +document.getElementById( "currency" ).textContent = Globalize.formatCurrency( 69900, "USD" ); + +// Use Globalize to get the plural form of a numeric value. +document.getElementById( "plural-number" ).textContent = number( 12345.6789 ); +document.getElementById( "plural-form" ).textContent = Globalize.plural( 12345.6789 ); + +// Use Globalize to format a message with plural inflection. +like = Globalize.messageFormatter( "like" ); +document.getElementById( "message-0" ).textContent = like( 0 ); +document.getElementById( "message-1" ).textContent = like( 1 ); +document.getElementById( "message-2" ).textContent = like( 2 ); +document.getElementById( "message-3" ).textContent = like( 3 ); + +// Use Globalize to format a relative time. +document.getElementById( "relative-time" ).textContent = Globalize.formatRelativeTime( -35, "second" ); + +// Use Globalize to format a unit. +document.getElementById( "unit" ).textContent = Globalize.formatUnit( 60, "mile/hour", { + form: "short" +}); + +document.getElementById( "requirements" ).style.display = "none"; +document.getElementById( "demo" ).style.display = "block"; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/development.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/development.html new file mode 100644 index 000000000..e93906473 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/development.html @@ -0,0 +1,121 @@ + + + + + Basic Globalize Compiler example (development mode) + + +

Basic Globalize Compiler example (development mode)

+ +
+

Requirements

+
    +
  • Read README.md for instructions.
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/messages.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/messages.json new file mode 100644 index 000000000..4a5f1f488 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/messages.json @@ -0,0 +1,12 @@ +{ + "en": { + "like": [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/package.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/package.json new file mode 100644 index 000000000..5cf05b475 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/package.json @@ -0,0 +1,15 @@ +{ + "name": "basic-globalize-compiler", + "private": true, + "scripts": { + "build": "globalize-compiler -l en -m messages.json -o compiled-formatters.js app.js" + }, + "devDependencies": { + "cldr-data": ">=25", + "globalize": "^1.5.0", + "globalize-compiler": "^1.1.1", + "iana-tz-data": "^2017.1.0", + "jquery": "latest" + }, + "cldr-data-urls-filter": "(core|dates|numbers|units)" +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/production.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/production.html new file mode 100644 index 000000000..5b8a7defd --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/globalize-compiler/production.html @@ -0,0 +1,75 @@ + + + + + Basic Globalize Compiler example (production mode) + + +

Basic Globalize Compiler example (production mode)

+ +
+

Requirements

+
    +
  • You need to build the `compiled-formatters.js`. Read README.md for instructions. +
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/README.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/README.md new file mode 100644 index 000000000..6b39f7db4 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/README.md @@ -0,0 +1,57 @@ +# Hello World (Node.js + npm) + +We assume you know what [Node.js](http://nodejs.org/) and +[npm](https://www.npmjs.org/) is. + +The demo contains one single file: + +``` +. +└── main.js +``` + +Before running it, execute the requirements below. + + +## Requirements + +**1. Install Globalize** + +Let's use npm to download Globalize. For more information on regard of +installation, please read [Getting Started](../../README.md#installation). + +``` +npm install +``` + +Then, you'll get this: + +``` +. +├── node_modules/ +│ ├── globalize/ +│ │ └── dist/ +│ │ ├── globalize +│ │ │ ├── date.js +│ │ │ └── ... +│ │ └── globalize.js +│ └── ... +└── main.js +``` + +**2. Dependencies** + +No action needed, because npm has already handled that for us. + +**3. CLDR content** + +No action needed, because npm has already handled that for us. For more +information, see [npm's cldr-data](https://github.com/rxaviers/cldr-data-npm). + + +## Running the demo + +Once you've completed the requirements above: + +1. Run `node main.js`. +1. Understand the demo by reading the source code. We have comments there for you. diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/main.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/main.js new file mode 100644 index 000000000..9a79fe89f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/main.js @@ -0,0 +1,65 @@ +var like; +var Globalize = require( "globalize" ); + +// Before we can use Globalize, we need to feed it on the appropriate I18n content (Unicode CLDR). Read Requirements on Getting Started on the root's README.md for more information. +Globalize.load( + require( "cldr-data/main/en/ca-gregorian" ), + require( "cldr-data/main/en/currencies" ), + require( "cldr-data/main/en/dateFields" ), + require( "cldr-data/main/en/numbers" ), + require( "cldr-data/main/en/timeZoneNames" ), + require( "cldr-data/main/en/units" ), + require( "cldr-data/supplemental/currencyData" ), + require( "cldr-data/supplemental/likelySubtags" ), + require( "cldr-data/supplemental/metaZones" ), + require( "cldr-data/supplemental/plurals" ), + require( "cldr-data/supplemental/timeData" ), + require( "cldr-data/supplemental/weekData" ) +); +Globalize.loadMessages( require( "./messages/en" ) ); + +Globalize.loadTimeZone( require( "iana-tz-data" ) ); + +// Set "en" as our default locale. +Globalize.locale( "en" ); + +// Use Globalize to format dates. +console.log( Globalize.formatDate( new Date(), { datetime: "medium" } ) ); + +// Use Globalize to format dates in specific time zones. +console.log( Globalize.formatDate( new Date(), { + datetime: "full", + timeZone: "America/Sao_Paulo" +})); + +// Use Globalize to format dates to parts. +console.log( Globalize.formatDateToParts( new Date(), { datetime: "medium" } ) ); + +// Use Globalize to format numbers. +console.log( Globalize.formatNumber( 12345.6789 ) ); + +// Use Globalize to format numbers (compact form). +console.log( Globalize.formatNumber( 12345.6789, { + compact: "short", + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +})); + +// Use Globalize to format currencies. +console.log( Globalize.formatCurrency( 69900, "USD" ) ); + +// Use Globalize to get the plural form of a numeric value. +console.log( Globalize.plural( 12345.6789 ) ); + +// Use Globalize to format a message with plural inflection. +like = Globalize.messageFormatter( "like" ); +console.log( like( 0 ) ); +console.log( like( 1 ) ); +console.log( like( 2 ) ); +console.log( like( 3 ) ); + +// Use Globalize to format relative time. +console.log( Globalize.formatRelativeTime( -35, "second" ) ); + +// Use Globalize to format unit. +console.log( Globalize.formatUnit( 60, "mile/hour", { form: "short" } ) ); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/messages/en.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/messages/en.json new file mode 100644 index 000000000..cd37baee8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/messages/en.json @@ -0,0 +1,12 @@ +{ + "en": { + "like": [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/package.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/package.json new file mode 100644 index 000000000..7d91ffd99 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/node-npm/package.json @@ -0,0 +1,10 @@ +{ + "name": "globalize-hello-world-node-npm", + "private": true, + "dependencies": { + "cldr-data": "latest", + "globalize": "^1.3.0", + "iana-tz-data": ">=2017.0.0" + }, + "cldr-data-urls-filter": "(core|dates|numbers|units)" +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/.gitignore b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/.gitignore new file mode 100644 index 000000000..39f8b6658 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/.gitignore @@ -0,0 +1,2 @@ +cldrjs/ +globalize/ diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/README.md b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/README.md new file mode 100644 index 000000000..f9eaa0562 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/README.md @@ -0,0 +1,81 @@ +# Hello World (plain javascript) + +The demo contains one single file: + +``` +. +└── index.html +``` + +Before running it, execute the requirements below. + + +## Requirements + +**1. Dependencies** + +The demo requires Globalize and its dependencies. Globalize's dependencies are listed on [Getting +Started](../../README.md#dependencies), and the only one is +[cldrjs](https://github.com/rxaviers/cldrjs). You are free to fetch it the way you want. But, as an +exercise of this demo, we'll download it ourselves. So: + +1. Click at [Globalize releases tab](https://github.com/globalizejs/globalize/releases). +1. Download the latest package. +1. Unzip it. +1. Rename the extracted directory `globalize` and move it alongside `index.html` and `README.md`. +1. Click at [cldrjs releases tab](https://github.com/rxaviers/cldrjs/releases). +1. Download the latest package. +1. Unzip it. +1. Rename the extracted directory `cldrjs` and move it alongside `index.html` and `README.md`. + +Then, you'll get this: + +``` +. +├── cldrjs +│ └── dist +│ ├── cldr.js +│ ├── ... +│ └── cldr +│ ├── event.js +│ ├── supplemental.js +│ └── ... +├── globalize +│ └── dist +│ ├── globalize.js +│ ├── ... +│ └── globalize +│ ├── currency.js +│ ├── date.js +│ └── ... +├── index.html +└── README.md +``` + +For more information read [cldrjs' usage and +installation](https://github.com/rxaviers/cldrjs#usage-and-installation) docs. + +**2. CLDR content** + +Another typical Globalize requirement is to fetch CLDR content yourself. But, on +this demo we made the things a little easier for you: we've embedded static JSON +into the demo. So, you don't need to actually fetch it anywhere. For more +information about fetching Unicode CLDR JSON data, see [How do I get CLDR +data?](../../doc/cldr.md). + +No action needed here. + +**3. Globalize `dist` files** + +*This step only applies if you are building the source files. If you have downloaded a ZIP or a TAR.GZ or are using a package manager (such as bower or npm) to install then you can ignore this step.* + +[Install the development external dependencies](../../README.md#install-development-external-dependencies) and [build the distribution files](../../README.md#build). + +## Running the demo + +Once you've completed the requirements above: + +1. Point your browser at `./index.html`. +1. Open your JavaScript console to see the demo output. +1. Understand the demo by reading the source code. We have comments there for +you. diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/index.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/index.html new file mode 100644 index 000000000..bcd4703a2 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/examples/plain-javascript/index.html @@ -0,0 +1,445 @@ + + + + + Globalize Hello World (plain javascript) + + +

Globalize Hello World (plain javascript)

+ +
+

Requirements

+
    +
  • You need to download `cldrjs` and `globalize` dependencies yourself. Read README.md for instructions. +
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/package-lock.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/package-lock.json new file mode 100644 index 000000000..2a2b976af --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/package-lock.json @@ -0,0 +1,5686 @@ +{ + "name": "globalize", + "version": "1.6.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@eslint/eslintrc": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz", + "integrity": "sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "accepts": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.0.3.tgz", + "integrity": "sha1-krHbDU89tHsFMN9uFa6X21FNwvg=", + "dev": true, + "requires": { + "mime": "~1.2.11", + "negotiator": "0.4.6" + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "adm-zip": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.11.tgz", + "integrity": "sha512-L8vcjDTCOIJk7wFvmlEUN7AsSb8T+2JrdP7KINBjzr24TJ5Mwj590sLu3BC7zNZowvJWa/JtPmD8eJCzdtDWjA==", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + }, + "dependencies": { + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "basic-auth-connect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz", + "integrity": "sha1-/bC0OWLKe0BFanwrtI/hc9otISI=", + "dev": true + }, + "batch": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.5.0.tgz", + "integrity": "sha1-/S4Fp6XWlrTbkxQBPihdj/NVfsM=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "body-parser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.3.1.tgz", + "integrity": "sha1-GnRRP8eJfXDbVlieDQPwoT8b+pQ=", + "dev": true, + "requires": { + "bytes": "1.0.0", + "qs": "0.6.6", + "raw-body": "1.1.6", + "type-is": "1.2.1" + }, + "dependencies": { + "qs": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", + "integrity": "sha1-bgFQmP9RlouKPIGQAdXyyJvEsQc=", + "dev": true + } + } + }, + "bower-config": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/bower-config/-/bower-config-1.4.3.tgz", + "integrity": "sha512-MVyyUk3d1S7d2cl6YISViwJBc2VXCkxF5AUFykvN0PQj5FsUiMNSgAYTso18oRFfyZ6XEtjrgg9MAaufHbOwNw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.3", + "minimist": "^0.2.1", + "mout": "^1.0.0", + "osenv": "^0.1.3", + "untildify": "^2.1.0", + "wordwrap": "^0.0.3" + }, + "dependencies": { + "minimist": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.1.tgz", + "integrity": "sha512-GY8fANSrTMfBVfInqJAY41QkOM+upUTytK1jZ0c8+3HdHrJxBJ3rF5i9moClXTE8uUSnUo8cAsCoxDXvSY4DHg==", + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "~0.2.0" + } + }, + "buffer-crc32": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz", + "integrity": "sha1-vj5TgvwCttYySVasGvmKqYsIU0w=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "check-dependencies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/check-dependencies/-/check-dependencies-1.1.0.tgz", + "integrity": "sha512-GDrbGzzJ6Gc6tQh87HBMGhrJ4UWIlR9MKJwgvlrJyj/gWvTYYb2jQetKbajt/EYK5Y8/4g7gH2LEvq8GdUWTag==", + "dev": true, + "requires": { + "bower-config": "^1.4.0", + "chalk": "^2.1.0", + "findup-sync": "^2.0.0", + "lodash.camelcase": "^4.3.0", + "minimist": "^1.2.0", + "semver": "^5.4.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cldr-data-downloader": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/cldr-data-downloader/-/cldr-data-downloader-0.3.5.tgz", + "integrity": "sha512-uyIMa1K98DAp/PE7dYpq2COIrkWn681Atjng1GgEzeJzYb1jANtugtp9wre6+voE+qzVC8jtWv6E/xZ1GTJdlw==", + "dev": true, + "requires": { + "adm-zip": "0.4.11", + "mkdirp": "0.5.0", + "nopt": "3.0.x", + "progress": "1.1.8", + "q": "1.0.1", + "request": "~2.87.0", + "request-progress": "0.3.1" + } + }, + "cldrjs": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/cldrjs/-/cldrjs-0.5.5.tgz", + "integrity": "sha512-KDwzwbmLIPfCgd8JERVDpQKrUUM1U4KpFJJg2IROv89rF172lLufoJnqJ/Wea6fXL5bO6WjuLMzY8V52UWPvkA==" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "commitplease": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/commitplease/-/commitplease-2.2.0.tgz", + "integrity": "sha1-4i6/LBfK7bT+XHLeYPdxKDy1xHc=", + "dev": true, + "requires": { + "chalk": "0.4.0", + "mout": "0.8.0", + "semver": "2.2.1" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "dev": true, + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + }, + "mout": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/mout/-/mout-0.8.0.tgz", + "integrity": "sha1-uxn31l7ZgNOSLRHcGezvnoZVgUc=", + "dev": true + }, + "semver": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-2.2.1.tgz", + "integrity": "sha1-eUEYKz/8xYC/8cF5QqzfeVHA0hM=", + "dev": true + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "dev": true + } + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "compressible": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-1.1.0.tgz", + "integrity": "sha1-Ek2Ke7oYoFpBCi8lutQTsblK/2c=", + "dev": true + }, + "compression": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.0.7.tgz", + "integrity": "sha1-/Ev/Jh3043oTAAby2yqZo0iW9Vo=", + "dev": true, + "requires": { + "accepts": "1.0.3", + "bytes": "1.0.0", + "compressible": "1.1.0", + "on-headers": "0.0.0", + "vary": "0.1.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "connect": { + "version": "2.19.6", + "resolved": "https://registry.npmjs.org/connect/-/connect-2.19.6.tgz", + "integrity": "sha1-1HP9eUnFW0I6ZPhCDb0Gnbd82dI=", + "dev": true, + "requires": { + "basic-auth-connect": "1.0.0", + "body-parser": "1.3.1", + "bytes": "1.0.0", + "compression": "1.0.7", + "connect-timeout": "1.1.0", + "cookie": "0.1.2", + "cookie-parser": "1.1.0", + "cookie-signature": "1.0.3", + "csurf": "1.2.1", + "debug": "1.0.2", + "errorhandler": "1.0.2", + "escape-html": "1.0.1", + "express-session": "1.2.1", + "fresh": "0.2.2", + "method-override": "2.0.2", + "morgan": "1.1.1", + "multiparty": "3.2.8", + "on-headers": "0.0.0", + "parseurl": "1.0.1", + "pause": "0.0.1", + "qs": "0.6.6", + "response-time": "2.0.0", + "serve-favicon": "2.0.1", + "serve-index": "1.1.1", + "serve-static": "1.2.3", + "type-is": "1.2.1", + "vhost": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-1.0.2.tgz", + "integrity": "sha1-OElZHBDM5khHbDx8Li40FttZY8Q=", + "dev": true, + "requires": { + "ms": "0.6.2" + } + }, + "ms": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz", + "integrity": "sha1-2JwhJMb9wTU9Zai3e/GqxLGTcIw=", + "dev": true + }, + "qs": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", + "integrity": "sha1-bgFQmP9RlouKPIGQAdXyyJvEsQc=", + "dev": true + } + } + }, + "connect-livereload": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/connect-livereload/-/connect-livereload-0.4.1.tgz", + "integrity": "sha1-D4oagWvJuv+uRjfM6pF0Yv41kXo=", + "dev": true + }, + "connect-timeout": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/connect-timeout/-/connect-timeout-1.1.0.tgz", + "integrity": "sha1-/IBhX8els4Y70DGa8kkdLX/cXwU=", + "dev": true, + "requires": { + "debug": "0.8.1" + }, + "dependencies": { + "debug": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz", + "integrity": "sha1-IP9NJvXkIstoobrLu2EDmtjBwTA=", + "dev": true + } + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "cookie": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz", + "integrity": "sha1-cv7D0k5Io0Mgc9kMEmQgBQYQBLE=", + "dev": true + }, + "cookie-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.1.0.tgz", + "integrity": "sha1-L4JlqjtVczqF7vIH8OJTDD6M9wU=", + "dev": true, + "requires": { + "cookie": "0.1.2", + "cookie-signature": "1.0.3" + } + }, + "cookie-signature": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz", + "integrity": "sha1-kc2ZfMUftkFZVzjGnNoCAyj1D/k=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "crc32": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/crc32/-/crc32-0.2.2.tgz", + "integrity": "sha1-etIg1v/c0Rn5/BJ6d3LKzqOQpLo=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "csrf-tokens": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/csrf-tokens/-/csrf-tokens-1.0.4.tgz", + "integrity": "sha1-SWclaLJwM0hkTqyvYc29wFS6VvI=", + "dev": true, + "requires": { + "rndm": "1", + "scmp": "~0.0.3", + "uid2": "~0.0.2" + } + }, + "csurf": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/csurf/-/csurf-1.2.1.tgz", + "integrity": "sha1-OSj6I3WS7Vgkp8Ih2Fgb81ap2nY=", + "dev": true, + "requires": { + "csrf-tokens": "~1.0.2" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "deflate-js": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/deflate-js/-/deflate-js-0.2.3.tgz", + "integrity": "sha1-+Fq7WOvFFRowYUdHPVfD5PfkQms=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.3.tgz", + "integrity": "sha1-bJjECJq+y1p7hcGsRJqmA9Oz2r4=", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "errorhandler": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.0.2.tgz", + "integrity": "sha1-WH1Hu7vEjP/hMsOs2nIVyQJVgQg=", + "dev": true + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "escape-html": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz", + "integrity": "sha1-GBoobq05ejmpKFfPsdQwUuNWv/A=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "eslint": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.13.0.tgz", + "integrity": "sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.2.1", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + } + } + }, + "eslint-config-jquery": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-jquery/-/eslint-config-jquery-3.0.0.tgz", + "integrity": "sha512-VDdRAIlNq1EM5P7J4JGQSCnZEIvIlNGGTUTCPT2wQNZ2GT69rsAwSIqZVcoiyZbwY7TaaMwLOxwSjqm+DEUjbA==", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "espree": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "express-session": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.2.1.tgz", + "integrity": "sha1-J0GhZh6zpKF6fbCkgEn78FV05GU=", + "dev": true, + "requires": { + "buffer-crc32": "0.2.1", + "cookie": "0.1.2", + "cookie-signature": "1.0.3", + "debug": "0.8.1", + "on-headers": "0.0.0", + "uid2": "0.0.3", + "utils-merge": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz", + "integrity": "sha1-IP9NJvXkIstoobrLu2EDmtjBwTA=", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extract-zip": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", + "dev": true, + "requires": { + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "faye-websocket": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "file-sync-cmp": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", + "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=", + "dev": true + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "dev": true, + "requires": { + "glob": "~5.0.0" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "finished": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/finished/-/finished-1.2.2.tgz", + "integrity": "sha1-QWCOr639ZWg7RqEiC8Sx7D2u3Ng=", + "dev": true, + "requires": { + "ee-first": "1.0.3" + } + }, + "flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.2.tgz", + "integrity": "sha1-lzHc9WeMf660T7kDxPct9VGH+nc=", + "dev": true + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.0" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getobject": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "git-tools": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/git-tools/-/git-tools-0.1.1.tgz", + "integrity": "sha1-z521gDHxEEFB7OVqLtUD0xXiXkg=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globalize-compiler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/globalize-compiler/-/globalize-compiler-1.1.1.tgz", + "integrity": "sha512-oZIwVp3L/waDidle7Qrw4FiCCmOLAqvdM9P7W8nEO4OfXO//l/abBiA+RL2+mYZPOpTAlRDVS2FLfFVWxHovWA==", + "dev": true, + "requires": { + "escodegen": "^1.6.1", + "esprima": "^2.3.0", + "nopt": "^3.0.3" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "globalyzer": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.4.tgz", + "integrity": "sha512-LeguVWaxgHN0MNbWC6YljNMzHkrCny9fzjmEUdnF1kQ7wATFD1RHFRqA1qxaX2tgxGENlcxjOflopBwj3YZiXA==", + "dev": true + }, + "globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, + "globule": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", + "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", + "dev": true, + "requires": { + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "grunt": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.2.0.tgz", + "integrity": "sha512-uGMrucC+isjLBEcEyQjaSj41ehhePr07uCykQFJR0ciKs9kDsLdr1L976+v5aFsLB+l0n7JoWpovs941xbI9MA==", + "dev": true, + "requires": { + "dateformat": "~3.0.3", + "eventemitter2": "~0.4.13", + "exit": "~0.1.2", + "findup-sync": "~0.3.0", + "glob": "~7.1.6", + "grunt-cli": "~1.3.2", + "grunt-known-options": "~1.1.0", + "grunt-legacy-log": "~2.0.0", + "grunt-legacy-util": "~1.1.1", + "iconv-lite": "~0.4.13", + "js-yaml": "~3.14.0", + "minimatch": "~3.0.4", + "mkdirp": "~1.0.4", + "nopt": "~3.0.6", + "path-is-absolute": "~2.0.0", + "rimraf": "~3.0.2" + }, + "dependencies": { + "grunt-cli": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz", + "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==", + "dev": true, + "requires": { + "grunt-known-options": "~1.1.0", + "interpret": "~1.1.0", + "liftoff": "~2.5.0", + "nopt": "~4.0.1", + "v8flags": "~3.1.1" + }, + "dependencies": { + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "path-is-absolute": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-2.0.0.tgz", + "integrity": "sha512-ajROpjq1SLxJZsgSVCcVIt+ZebVH+PwJtPnVESjfg6JKwJGwAgHRC3zIcjvI0LnecjIHCJhtfNZ/Y/RregqyXg==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "grunt-check-dependencies": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-check-dependencies/-/grunt-check-dependencies-1.0.0.tgz", + "integrity": "sha1-UYiVh8V+gn3enN9pt1CuCy+IHFA=", + "dev": true, + "requires": { + "check-dependencies": "^1.0.1", + "lodash.clonedeep": "^4.5.0" + } + }, + "grunt-commitplease": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/grunt-commitplease/-/grunt-commitplease-0.0.6.tgz", + "integrity": "sha1-cwYOhh1CqzaldXUUzojkZ2rI190=", + "dev": true, + "requires": { + "commitplease": "2.2.0", + "git-tools": "0.1.1" + } + }, + "grunt-compare-size": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/grunt-compare-size/-/grunt-compare-size-0.4.2.tgz", + "integrity": "sha1-0qvx082dOaFiA+EdI7cYtXV571E=", + "dev": true, + "requires": { + "lodash": "^4.11.1" + } + }, + "grunt-contrib-clean": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz", + "integrity": "sha1-Vkq/LQN4qYOhW54/MO51tzjEBjg=", + "dev": true, + "requires": { + "async": "^1.5.2", + "rimraf": "^2.5.1" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "grunt-contrib-connect": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-connect/-/grunt-contrib-connect-0.8.0.tgz", + "integrity": "sha1-H3AEPjpHOuj7eorL+SnOEE6vQyM=", + "dev": true, + "requires": { + "async": "~0.9.0", + "connect": "~2.19.5", + "connect-livereload": "~0.4.0", + "open": "0.0.5", + "portscanner": "~0.2.3" + }, + "dependencies": { + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + } + } + }, + "grunt-contrib-copy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", + "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "file-sync-cmp": "^0.1.0" + } + }, + "grunt-contrib-qunit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-qunit/-/grunt-contrib-qunit-2.0.0.tgz", + "integrity": "sha1-VKUbSyyE/uYsO34AFFySjR7Ct+w=", + "dev": true, + "requires": { + "grunt-lib-phantomjs": "^1.0.0" + } + }, + "grunt-contrib-requirejs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-requirejs/-/grunt-contrib-requirejs-1.0.0.tgz", + "integrity": "sha1-7BZwyvwycTkC7lNWlFRxWy48utU=", + "dev": true, + "requires": { + "requirejs": "^2.1.0" + } + }, + "grunt-contrib-uglify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-3.0.1.tgz", + "integrity": "sha1-/etfk4pMgEL46Grkb2NVTo6VEcs=", + "dev": true, + "requires": { + "chalk": "^1.0.0", + "maxmin": "^1.1.0", + "uglify-js": "~3.0.4", + "uri-path": "^1.0.0" + } + }, + "grunt-contrib-watch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-watch/-/grunt-contrib-watch-1.0.0.tgz", + "integrity": "sha1-hKGnodar0m7VaEE0lscxM+mQAY8=", + "dev": true, + "requires": { + "async": "^1.5.0", + "gaze": "^1.0.0", + "lodash": "^3.10.1", + "tiny-lr": "^0.2.1" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + } + } + }, + "grunt-eslint": { + "version": "23.0.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-23.0.0.tgz", + "integrity": "sha512-QqHSAiGF08EVD7YlD4OSRWuLRaDvpsRdTptwy9WaxUXE+03mCLVA/lEaR6SHWehF7oUwIqCEjaNONeeeWlB4LQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "eslint": "^7.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "grunt-git-authors": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/grunt-git-authors/-/grunt-git-authors-3.2.0.tgz", + "integrity": "sha1-D/WrbTxu/+CrIV1jNDRcD2v+FnI=", + "dev": true, + "requires": { + "spawnback": "~1.0.0" + } + }, + "grunt-known-options": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", + "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", + "dev": true + }, + "grunt-legacy-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", + "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", + "dev": true, + "requires": { + "colors": "~1.1.2", + "grunt-legacy-log-utils": "~2.0.0", + "hooker": "~0.2.3", + "lodash": "~4.17.5" + } + }, + "grunt-legacy-log-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", + "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", + "dev": true, + "requires": { + "chalk": "~2.4.1", + "lodash": "~4.17.10" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "grunt-legacy-util": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", + "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", + "dev": true, + "requires": { + "async": "~1.5.2", + "exit": "~0.1.1", + "getobject": "~0.1.0", + "hooker": "~0.2.3", + "lodash": "~4.17.10", + "underscore.string": "~3.3.4", + "which": "~1.3.0" + }, + "dependencies": { + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "grunt-lib-phantomjs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-lib-phantomjs/-/grunt-lib-phantomjs-1.1.0.tgz", + "integrity": "sha1-np7c3Z/S3UDgwYHJQ3HVcqpe6tI=", + "dev": true, + "requires": { + "eventemitter2": "^0.4.9", + "phantomjs-prebuilt": "^2.1.3", + "rimraf": "^2.5.2", + "semver": "^5.1.0", + "temporary": "^0.0.8" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "grunt-mocha-test": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/grunt-mocha-test/-/grunt-mocha-test-0.13.3.tgz", + "integrity": "sha512-zQGEsi3d+ViPPi7/4jcj78afKKAKiAA5n61pknQYi25Ugik+aNOuRmiOkmb8mN2CeG8YxT+YdT1H1Q7B/eNkoQ==", + "dev": true, + "requires": { + "hooker": "^0.2.3", + "mkdirp": "^0.5.0" + } + }, + "gzip-js": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/gzip-js/-/gzip-js-0.3.2.tgz", + "integrity": "sha1-IxF+/usozzhSSN7/Df+tiUg22Ws=", + "dev": true, + "requires": { + "crc32": ">= 0.2.2", + "deflate-js": ">= 0.2.2" + } + }, + "gzip-size": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz", + "integrity": "sha1-Zs+LEBBHInuVus5uodoMF37Vwi8=", + "dev": true, + "requires": { + "browserify-zlib": "^0.1.4", + "concat-stream": "^1.4.1" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "requires": { + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hasha": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", + "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "dev": true, + "requires": { + "is-stream": "^1.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "http-errors": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", + "integrity": "sha1-GX4izevUGYWF6GlO9nhhl7ke2UI=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "statuses": "1" + } + }, + "http-parser-js": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.2.tgz", + "integrity": "sha512-opCO9ASqg5Wy2FNo7A0sxy71yGbbkJJXLdgMK04Tcypw9jr2MgWbyubb0+WdmDmGnFflO7fRbqbaihh/ENDlRQ==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iana-tz-data": { + "version": "2019.1.0", + "resolved": "https://registry.npmjs.org/iana-tz-data/-/iana-tz-data-2019.1.0.tgz", + "integrity": "sha512-T7+26Skkyxqjp4mg20/O065j9J5qP39nWVQj/2ArxQ0gSPkL+T9lwerRmiOAzFRNsNXepX45QqchqTVENwNvig==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-core-module": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", + "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-reporters": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/js-reporters/-/js-reporters-1.2.3.tgz", + "integrity": "sha512-2YzWkHbbRu6LueEs5ZP3P1LqbECvAeUJYrjw3H4y1ofW06hqCS0AbzBtLwbr+Hke51bt9CUepJ/Fj1hlCRIF6A==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "liftoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", + "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + }, + "dependencies": { + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + } + } + }, + "livereload-js": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.4.0.tgz", + "integrity": "sha512-XPQH8Z2GDP/Hwz2PCDrh2mth4yFejwA1OZ/81Ti3LgKyhDcEjsSsqFWZojHG0va/duGd+WyosY7eXLDoOyqcPw==", + "dev": true + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "^3.0.0", + "lodash.keys": "^3.0.0" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true, + "requires": { + "lodash._baseassign": "^3.0.0", + "lodash._basecreate": "^3.0.0", + "lodash._isiterateecall": "^3.0.0" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "matchdep": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-1.0.1.tgz", + "integrity": "sha1-pXozgESR+64girqPaDgEN6vC3KU=", + "dev": true, + "requires": { + "findup-sync": "~0.3.0", + "micromatch": "^2.3.7", + "resolve": "~1.1.6", + "stack-trace": "0.0.9" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=", + "dev": true + } + } + }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true + }, + "maxmin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-1.1.0.tgz", + "integrity": "sha1-cTZehKmd2Piz99X94vANHn9zvmE=", + "dev": true, + "requires": { + "chalk": "^1.0.0", + "figures": "^1.0.1", + "gzip-size": "^1.0.0", + "pretty-bytes": "^1.0.0" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "method-override": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/method-override/-/method-override-2.0.2.tgz", + "integrity": "sha1-AFMSeMeXiWQL8n6X4mo6Wh98ynM=", + "dev": true, + "requires": { + "methods": "1.0.1", + "parseurl": "1.0.1", + "vary": "0.1.0" + } + }, + "methods": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.0.1.tgz", + "integrity": "sha1-dbyRlD3/19oDfPPusO1zoAN80Us=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "dev": true + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": ">= 1.0.0" + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "morgan": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.1.1.tgz", + "integrity": "sha1-zeRdLoB+vMQ5dFhG6oA5LmkJgUY=", + "dev": true, + "requires": { + "bytes": "1.0.0" + } + }, + "mout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/mout/-/mout-1.2.2.tgz", + "integrity": "sha512-w0OUxFEla6z3d7sVpMZGBCpQvYh8PHS1wZ6Wu9GNKHMpAHWJ0if0LsQZh3DlOqw55HlhJEOMLpFnwtxp99Y5GA==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multiparty": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-3.2.8.tgz", + "integrity": "sha1-veITAdrSlChuFVsrYHEMauBK5k8=", + "dev": true, + "requires": { + "readable-stream": "~1.1.9", + "stream-counter": "~0.2.0" + } + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.6.tgz", + "integrity": "sha1-9F+vn6gz7TylElDqmn3fxCZ6RLM=", + "dev": true + }, + "node-watch": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.0.tgz", + "integrity": "sha512-OOBiglke5SlRQT5WYfwXTmYqTfXjcTNBHpalyHLtLxDpQYVpVRkJqabcch1kmwJsjV/J4OZuzEafeb4soqtFZA==", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + } + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + } + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + }, + "dependencies": { + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + } + } + }, + "on-headers": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-0.0.0.tgz", + "integrity": "sha1-7igX+DRDJXhc2cLfKyQrvBfK9MQ=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "open": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", + "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=", + "dev": true + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "package": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package/-/package-1.0.1.tgz", + "integrity": "sha1-0lofmeJQbcsn1nBLg9yooxLk7cw=", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parseurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.0.1.tgz", + "integrity": "sha1-Llfc5u/dN8NRhwEDCUTCK/OIt7Q=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=", + "dev": true + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "phantomjs-prebuilt": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", + "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3", + "extract-zip": "^1.6.5", + "fs-extra": "^1.0.0", + "hasha": "^2.2.0", + "kew": "^0.7.0", + "progress": "^1.1.8", + "request": "^2.81.0", + "request-progress": "^2.0.1", + "which": "^1.2.10" + }, + "dependencies": { + "request-progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", + "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "dev": true, + "requires": { + "throttleit": "^1.0.0" + } + }, + "throttleit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", + "dev": true + } + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "portscanner": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-0.2.3.tgz", + "integrity": "sha1-QNityS4BsgWrAgqhbw44asXtGXg=", + "dev": true, + "requires": { + "async": "0.1.15" + }, + "dependencies": { + "async": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/async/-/async-0.1.15.tgz", + "integrity": "sha1-IYDqyizypspSgNQcBYW+ybPkm9M=", + "dev": true + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "pretty-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "meow": "^3.1.0" + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "q": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.0.1.tgz", + "integrity": "sha1-EYcq7t7okmgRCxCnGESP+xARKhQ=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "qunit": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.12.0.tgz", + "integrity": "sha512-Lu3tbKziVzXTfseoEtTiiSAbSPB6SGU4Emc2uo8n+fbsXuRCLzfqPwJfAVJwKu9NdukX1V/L0qWf2UvmPX+QeA==", + "dev": true, + "requires": { + "commander": "6.2.0", + "js-reporters": "1.2.3", + "node-watch": "0.7.0", + "tiny-glob": "0.2.6" + }, + "dependencies": { + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "dev": true + } + } + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "range-parser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz", + "integrity": "sha1-aHKCNTXGkuLCoBA4Jq/YLC4P8XU=", + "dev": true + }, + "raw-body": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.6.tgz", + "integrity": "sha1-mOnfmn4t+ZSTG3zbSyprlpSnTwI=", + "dev": true, + "requires": { + "bytes": "1" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + }, + "request-progress": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-0.3.1.tgz", + "integrity": "sha1-ByHBBdipasayzossia4tXs/Pazo=", + "dev": true, + "requires": { + "throttleit": "~0.0.2" + } + }, + "requirejs": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", + "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", + "dev": true + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "response-time": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/response-time/-/response-time-2.0.0.tgz", + "integrity": "sha1-Zcs5/VDeL0/9vdKF8YVZZr1vyzY=", + "dev": true, + "requires": { + "on-headers": "0.0.0" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rndm": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/rndm/-/rndm-1.2.0.tgz", + "integrity": "sha1-8z/pz7Urv9UgqhgyO8ZdsRCht2w=", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "scmp": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/scmp/-/scmp-0.0.3.tgz", + "integrity": "sha1-NkjfLXKUZB5/eGc//CloHZutkHM=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "send": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.4.3.tgz", + "integrity": "sha1-lieyO3cH+/Y3ODHKxXkzMLWUtkA=", + "dev": true, + "requires": { + "debug": "1.0.2", + "escape-html": "1.0.1", + "finished": "1.2.2", + "fresh": "0.2.2", + "mime": "1.2.11", + "range-parser": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-1.0.2.tgz", + "integrity": "sha1-OElZHBDM5khHbDx8Li40FttZY8Q=", + "dev": true, + "requires": { + "ms": "0.6.2" + } + }, + "ms": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz", + "integrity": "sha1-2JwhJMb9wTU9Zai3e/GqxLGTcIw=", + "dev": true + } + } + }, + "serve-favicon": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.0.1.tgz", + "integrity": "sha1-SCaXXZ8XPKOkFY6WmBYfdd7Hr+w=", + "dev": true, + "requires": { + "fresh": "0.2.2" + } + }, + "serve-index": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.1.1.tgz", + "integrity": "sha1-6trdj9B0E63RejAcZX9S/AXxnS8=", + "dev": true, + "requires": { + "accepts": "1.0.3", + "batch": "0.5.0" + } + }, + "serve-static": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.2.3.tgz", + "integrity": "sha1-k87Lw0Dweey4WJKB0dwxwmwM0Vg=", + "dev": true, + "requires": { + "escape-html": "1.0.1", + "parseurl": "1.0.1", + "send": "0.4.3" + } + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spawnback": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.1.tgz", + "integrity": "sha512-340ZqtqJzWAZtHwaCC2gx4mdQOnkUWAWNDp7y0bCEatdjmgQ4j7b0qQ7qO5WIJWx/luNrKcrYzpKbH3NTR030A==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "stream-counter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz", + "integrity": "sha1-3tJmVWMZyLDiIoErnPOyb6fZR94=", + "dev": true, + "requires": { + "readable-stream": "~1.1.8" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } + } + }, + "temporary": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/temporary/-/temporary-0.0.8.tgz", + "integrity": "sha1-oYqYHSi6jKNgJ/s8MFOMPst0CsA=", + "dev": true, + "requires": { + "package": ">= 1.0.0 < 1.2.0" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throttleit": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", + "integrity": "sha1-z+34jmDADdlpe2H90qg0OptoDq8=", + "dev": true + }, + "tiny-glob": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.6.tgz", + "integrity": "sha512-A7ewMqPu1B5PWwC3m7KVgAu96Ch5LA0w4SnEN/LbDREj/gAD0nPWboRbn8YoP9ISZXqeNAlMvKSKoEuhcfK3Pw==", + "dev": true, + "requires": { + "globalyzer": "^0.1.0", + "globrex": "^0.1.1" + } + }, + "tiny-lr": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.2.1.tgz", + "integrity": "sha1-s/26gC5dVqM8L28QeUsy5Hescp0=", + "dev": true, + "requires": { + "body-parser": "~1.14.0", + "debug": "~2.2.0", + "faye-websocket": "~0.10.0", + "livereload-js": "^2.2.0", + "parseurl": "~1.3.0", + "qs": "~5.1.0" + }, + "dependencies": { + "body-parser": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.14.2.tgz", + "integrity": "sha1-EBXLH+LEQ4WCWVgdtTMy+NDPUPk=", + "dev": true, + "requires": { + "bytes": "2.2.0", + "content-type": "~1.0.1", + "debug": "~2.2.0", + "depd": "~1.1.0", + "http-errors": "~1.3.1", + "iconv-lite": "0.4.13", + "on-finished": "~2.3.0", + "qs": "5.2.0", + "raw-body": "~2.1.5", + "type-is": "~1.6.10" + }, + "dependencies": { + "qs": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz", + "integrity": "sha1-qfMRQq9GjLcrJbMBNrokVoNJFr4=", + "dev": true + } + } + }, + "bytes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.2.0.tgz", + "integrity": "sha1-/TVGSkA/b5EXwt42Cez/nK4ABYg=", + "dev": true + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "iconv-lite": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", + "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", + "dev": true + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "qs": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-5.1.0.tgz", + "integrity": "sha1-TZMuXH6kEcynajEtOaYGIA/VDNk=", + "dev": true + }, + "raw-body": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz", + "integrity": "sha1-rf6s4uT7MJgFgBTQjActzFl1h3Q=", + "dev": true, + "requires": { + "bytes": "2.4.0", + "iconv-lite": "0.4.13", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", + "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=", + "dev": true + } + } + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + } + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "dev": true, + "requires": { + "punycode": "^1.4.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "type-is": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.2.1.tgz", + "integrity": "sha1-c9RICApPHdGKyx7v/2KWjFtdVKI=", + "dev": true, + "requires": { + "mime-types": "1.0.0" + }, + "dependencies": { + "mime-types": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.0.tgz", + "integrity": "sha1-antKavLn2S+Xr+A/BHx4AejwAdI=", + "dev": true + } + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uglify-js": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.0.28.tgz", + "integrity": "sha512-0h/qGay016GG2lVav3Kz174F3T2Vjlz2v6HCt+WDQpoXfco0hWwF5gHK9yh88mUYvIC+N7Z8NT8WpjSp1yoqGA==", + "dev": true, + "requires": { + "commander": "~2.11.0", + "source-map": "~0.5.1" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "underscore.string": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", + "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "dev": true, + "requires": { + "sprintf-js": "^1.0.3", + "util-deprecate": "^1.0.2" + } + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "untildify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-2.1.0.tgz", + "integrity": "sha1-F+soB5h/dpUunASF/DEdBqgmouA=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0" + } + }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "uri-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz", + "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, + "v8flags": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", + "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "vary": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vary/-/vary-0.1.0.tgz", + "integrity": "sha1-3wlFiZ6TwMxb0YzIMh2dIedPYXY=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vhost": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vhost/-/vhost-1.0.0.tgz", + "integrity": "sha1-ZUUT8omk+Jiqt0W71jPkAYDJxMA=", + "dev": true + }, + "websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "dev": true, + "requires": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true + }, + "which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } + } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + }, + "dependencies": { + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + } + } + }, + "zoned-date-time": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/zoned-date-time/-/zoned-date-time-1.1.0.tgz", + "integrity": "sha512-MhjAUwM1ABOmE9J5SzjNnoXQL83NDaZbRYsZtVTTIjKxXeGJ70GZNEC/NJAyhYiyFiteu24N8Q6gaGhOI/A51A==", + "dev": true + } + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/package.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/package.json new file mode 100644 index 000000000..e131d20bc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/package.json @@ -0,0 +1,109 @@ +{ + "name": "globalize", + "version": "1.7.0", + "description": "A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data.", + "keywords": [ + "utility", + "globalization", + "internationalization", + "multilingualization", + "localization", + "g11n", + "i18n", + "m17n", + "L10n", + "localize", + "format", + "parse", + "translate", + "strings", + "numbers", + "dates", + "times", + "calendars", + "plural", + "plurals", + "pluralize", + "cultures", + "languages", + "locales", + "Unicode", + "CLDR", + "JSON" + ], + "homepage": "https://github.com/globalizejs/globalize", + "author": { + "name": "OpenJS Foundation and other contributors", + "url": "https://github.com/globalizejs/globalize/blob/master/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Rafael Xavier de Souza", + "email": "rxaviers@gmail.com", + "url": "http://rafael.xavier.blog.br" + } + ], + "main": "./dist/node-main.js", + "files": [ + "CONTRIBUTING.md", + "dist/", + "!dist/.build", + "doc/", + "examples/", + "!examples/**/.tmp-globalize-webpack", + "!examples/**/bower_components", + "!examples/**/node_modules", + "!examples/plain-javascript/cldrjs", + "!examples/plain-javascript/globalize", + "README.md" + ], + "repository": { + "type": "git", + "url": "git://github.com/globalizejs/globalize.git" + }, + "bugs": { + "url": "https://github.com/globalizejs/globalize/issues" + }, + "dependencies": { + "cldrjs": "^0.5.4" + }, + "devDependencies": { + "cldr-data-downloader": "^0.3.1", + "eslint-config-jquery": "3.0.0", + "glob": "^7.1.2", + "globalize-compiler": "^1.1.1", + "grunt": "1.2.0", + "grunt-check-dependencies": "1.0.0", + "grunt-commitplease": "0.0.6", + "grunt-compare-size": "0.4.2", + "grunt-contrib-clean": "1.1.0", + "grunt-contrib-connect": "0.8.0", + "grunt-contrib-copy": "1.0.0", + "grunt-contrib-qunit": "2.0.0", + "grunt-contrib-requirejs": "1.0.0", + "grunt-contrib-uglify": "3.0.1", + "grunt-contrib-watch": "1.0.0", + "grunt-eslint": "23.0.0", + "grunt-git-authors": "^3.2.0", + "grunt-mocha-test": "^0.13.2", + "gzip-js": "0.3.2", + "iana-tz-data": ">=2017.0.0", + "matchdep": "1.0.1", + "mocha": "^3.4.2", + "qunit": "2.12.0", + "semver": "^5.3.0", + "zoned-date-time": "1.1.0" + }, + "commitplease": { + "nohook": true + }, + "license": "MIT", + "scripts": { + "test": "grunt" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/lib/version_inc.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/lib/version_inc.js new file mode 100644 index 000000000..1e424207e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/lib/version_inc.js @@ -0,0 +1,7 @@ +var packageJson = require( "../../package.json" ); +var semver = require( "semver" ); + +// Note argv[0] is supposed to be `node`, argv[1] to be this file. +var next = process.argv[ 2 ]; +var prereleaseIdentifier = process.argv[ 3 ]; +console.log( semver.inc( packageJson.version, next, prereleaseIdentifier ) ); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/lib/version_update.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/lib/version_update.js new file mode 100644 index 000000000..0e608f17e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/lib/version_update.js @@ -0,0 +1,11 @@ +var fs = require( "fs" ); +var packageJson = require( "../../package.json" ); +var path = require( "path" ); + +// Note argv[0] is supposed to be `node`, argv[1] to be this file. +packageJson.version = process.argv[ 2 ]; + +fs.writeFileSync( + path.join( __dirname, "../../package.json" ), + JSON.stringify( packageJson, null, 2 ) + "\n" +); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/release.sh b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/release.sh new file mode 100644 index 000000000..b4b1fc97d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/script/release.sh @@ -0,0 +1,182 @@ +#! /bin/bash + +SCRIPT_ROOT=`dirname $0` + +function abort { + echo Quiting... + exit 1 +} + +function process_args { + while [[ $# -gt 0 ]]; do + key="$1" + case $key in + major|minor|patch|premajor|preminor|prepatch|prerelease) + NEXT=$key + ;; + --prerelease-identifier=*) + PRERELEASE_IDENTIFIER="${key#*=}" + ;; + -h|--help) + HELP=true + ;; + *) + UNKNOWN="$1" + ;; + esac + shift + done + if [ :$NEXT = : -a :$HELP = : ]; then + echo 'You must choose a version bump type.' + HELP=true + fi + if [ ! -z "$UNKNOWN" ]; then + echo 'Illegal option: '$UNKNOWN + HELP=true + fi + if [ :$HELP = :true ]; then + echo 'Usage:' + echo ' version major | minor | patch | premajor | preminor | prepatch | prerelease' + echo ' [--prerelease-identifier=]' + echo '' + echo ' major, minor, patch, premajor, preminor, prepatch, prerelease' + echo ' Type of bump, see semver for more details' + echo '' + echo ' --prerelease-identifier=' + echo ' String argument that will append the value of the string as a prerelease' + echo ' identifier, e.g., beta. The default is alpha.' + echo '' + echo ' -h, --help' + echo ' Show this help.' + exit 1 + fi + VERSION=$(node $SCRIPT_ROOT/lib/version_inc.js $NEXT $PRERELEASE_IDENTIFIER) + TARGET_BRANCH=b$VERSION + PRERELEASE_IDENTIFIER=alpha +} + +function assertions { + if ! git diff-index --quiet HEAD; then + echo Current branch "isn't" clean. Use '`git status` for more details.' + abort + fi + + if git rev-parse --verify --quiet refs/tags/$VERSION > /dev/null; then + echo 'Target tag `'$VERSION'` already exists.' + abort + fi + + assert_git_origin + + if git ls-remote --exit-code origin refs/tags/$VERSION > /dev/null; then + echo 'Target tag `'$VERSION'` already exists in *origin*.' + abort + fi + + if npm show globalize versions | grep "'"$VERSION"'" >/dev/null; then + echo 'Target npm version `'$VERSION'` already exists.' + abort + fi + + if [ ! -z `git branch --list $TARGET_BRANCH` ]; then + echo 'Target branch `'$TARGET_BRANCH'` already exists.' + abort + fi + + CURRENT_BRANCH=`git name-rev --name-only HEAD` + if [ :$CURRENT_BRANCH != :master ]; then + echo 'Current branch `'$CURRENT_BRANCH'`' "isn't" '`master`.' + abort + fi + + echo Preparing release for '`'$VERSION'`' + echo -n Proceed? "[Y|n] " + read input + test :$input = :N -o :$input = :n && exit 1 + + h1 Test + grunt +} + +function assert_git_origin { + # Abort unless origin points to git@github.com:globalizejs/globalize.git. + if [ :`git config remote.origin.url` != :git@github.com:globalizejs/globalize.git ]; then + echo 'remote.origin.url should be `git@github.com:globalizejs/globalize.git`.' + abort + fi + + echo 'Fetching origin ('`git config remote.origin.url`')' + if ! git fetch origin; then + echo "Couldn't"' fetch origin.' + abort + fi +} + +function h1 { + echo + echo '## '$* +} + +function error { + echo 'ERROR: '$* + exit 2 +} + +function update_authors { + h1 Update AUTHORS file + grunt update-authors > /dev/null + if [ -z "$(git diff)" ]; then + echo No updates for AUTHORS file needed... + else + git commit -a -m 'AUTHORS: Update' > /dev/null && + git show --stat + fi +} + +function update_version { + h1 Update package.json '`versions`' attribute + node $SCRIPT_ROOT/lib/version_update.js $VERSION && + git commit -a -m $VERSION && + git show +} + +function build { + h1 Include distribution files + + # Yeap, again. Now including the new version in the dist files. + grunt > /dev/null || error Build failed + + git add dist/* > /dev/null && + git commit -a -m "Build: Include distribution files" > /dev/null && + git show --stat || + error Failed including distribution files +} + +function tag { + h1 'Tag `'$VERSION'` (detached)' + git tag -a -m $VERSION $VERSION > /dev/null +} + +function checkout_back_to_master { + git checkout master > /dev/null +} + +function final_message { + h1 Done + echo + echo Now you need to: + echo git push --tags origin + echo npm publish + echo git checkout master + echo git push origin master + echo git branch -D $TARGET_BRANCH +} + +process_args "$@" && + assertions && + update_authors && + update_version && + git checkout -b $TARGET_BRANCH && + build && + tag && + final_message diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/.dist-jshintrc b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/.dist-jshintrc new file mode 100644 index 000000000..c9da5455b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/.dist-jshintrc @@ -0,0 +1,22 @@ +{ + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "expr": true, + "immed": true, + "noarg": true, + "onevar": false, + "smarttabs": true, + "trailing": true, + "undef": true, + "unused": true, + + "globals": { + "Cldr": false, + "define": false, + "Globalize": false, + "module": false, + "require": false + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/.eslintrc.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/.eslintrc.json new file mode 100644 index 000000000..0b69c6c11 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "root": true, + "extends": "../.eslintrc.json", + "env": { + "amd": true + }, + "rules": { + "no-nested-ternary": "off" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-core-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-core-runtime.js new file mode 100644 index 000000000..eca09d482 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-core-runtime.js @@ -0,0 +1,36 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define( factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory(); + } else { + + // Globalize + root.Globalize = factory(); + } +}( this, function() { + +"use strict"; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-core.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-core.js new file mode 100644 index 000000000..37b818134 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-core.js @@ -0,0 +1,35 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ) ); + } else { + + // Global + root.Globalize = factory( root.Cldr ); + } +}( this, function( Cldr ) { diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-currency-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-currency-runtime.js new file mode 100644 index 000000000..2c846d674 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-currency-runtime.js @@ -0,0 +1,49 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var formatMessageToParts = Globalize._formatMessageToParts, + partsJoin = Globalize._partsJoin, + partsPush = Globalize._partsPush, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-currency.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-currency.js new file mode 100644 index 000000000..271e84518 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-currency.js @@ -0,0 +1,50 @@ +/*! + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + createError = Globalize._createError, + formatMessageToParts = Globalize._formatMessageToParts, + numberNumberingSystem = Globalize._numberNumberingSystem, + numberPattern = Globalize._numberPattern, + partsJoin = Globalize._partsJoin, + partsPush = Globalize._partsPush, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-date-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-date-runtime.js new file mode 100644 index 000000000..b7c23736a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-date-runtime.js @@ -0,0 +1,54 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + looseMatching = Globalize._looseMatching, + partsJoin = Globalize._partsJoin, + partsPush = Globalize._partsPush, + regexpEscape = Globalize._regexpEscape, + removeLiteralQuotes = Globalize._removeLiteralQuotes, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-date.js new file mode 100644 index 000000000..e08196deb --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-date.js @@ -0,0 +1,59 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + formatMessage = Globalize._formatMessage, + isPlainObject = Globalize._isPlainObject, + looseMatching = Globalize._looseMatching, + numberNumberingSystemDigitsMap = Globalize._numberNumberingSystemDigitsMap, + numberSymbol = Globalize._numberSymbol, + partsJoin = Globalize._partsJoin, + partsPush = Globalize._partsPush, + regexpEscape = Globalize._regexpEscape, + removeLiteralQuotes = Globalize._removeLiteralQuotes, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validate = Globalize._validate, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-message-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-message-runtime.js new file mode 100644 index 000000000..268d80e9e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-message-runtime.js @@ -0,0 +1,41 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var runtimeKey = Globalize._runtimeKey, + validateParameterType = Globalize._validateParameterType; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-message.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-message.js new file mode 100644 index 000000000..5c18f786b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-message.js @@ -0,0 +1,46 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + createError = Globalize._createError, + isPlainObject = Globalize._isPlainObject, + runtimeBind = Globalize._runtimeBind, + validateDefaultLocale = Globalize._validateDefaultLocale, + validate = Globalize._validate, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-number-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-number-runtime.js new file mode 100644 index 000000000..23e61edbd --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-number-runtime.js @@ -0,0 +1,48 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var createError = Globalize._createError, + partsJoin = Globalize._partsJoin, + partsPush = Globalize._partsPush, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterType = Globalize._validateParameterType, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-number.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-number.js new file mode 100644 index 000000000..704aef3a3 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-number.js @@ -0,0 +1,50 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + partsJoin = Globalize._partsJoin, + partsPush = Globalize._partsPush, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterRange = Globalize._validateParameterRange, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-plural-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-plural-runtime.js new file mode 100644 index 000000000..bfafbed1e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-plural-runtime.js @@ -0,0 +1,42 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-plural.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-plural.js new file mode 100644 index 000000000..66fddbc36 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-plural.js @@ -0,0 +1,44 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-relative-time-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-relative-time-runtime.js new file mode 100644 index 000000000..31d7055dc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-relative-time-runtime.js @@ -0,0 +1,49 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-relative-time.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-relative-time.js new file mode 100644 index 000000000..fe1f5eb04 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-relative-time.js @@ -0,0 +1,47 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-unit-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-unit-runtime.js new file mode 100644 index 000000000..31d7055dc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-unit-runtime.js @@ -0,0 +1,49 @@ +/** + * Globalize Runtime v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + "use strict"; + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +"use strict"; + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-unit.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-unit.js new file mode 100644 index 000000000..8a0fd06fb --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro-unit.js @@ -0,0 +1,44 @@ +/** + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "../globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro.min.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro.min.js new file mode 100644 index 000000000..d5d29a8b8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/intro.min.js @@ -0,0 +1,4 @@ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/node-main.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/node-main.js new file mode 100644 index 000000000..fcb1b4872 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/node-main.js @@ -0,0 +1,27 @@ +/*! + * Globalize v@VERSION + * + * https://github.com/globalizejs/globalize + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: @DATE + */ + +// Core +module.exports = require( "./globalize" ); + +// Extent core with the following modules +require( "./globalize/message" ); +require( "./globalize/number" ); +require( "./globalize/plural" ); + +// Load after globalize/number +require( "./globalize/currency" ); +require( "./globalize/date" ); + +// Load after globalize/number and globalize/plural +require( "./globalize/relative-time" ); +require( "./globalize/unit" ); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/outro.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/outro.js new file mode 100644 index 000000000..be4600a5c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/build/outro.js @@ -0,0 +1 @@ +})); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error.js new file mode 100644 index 000000000..aa1623600 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error.js @@ -0,0 +1,18 @@ +define([ + "./format-message", + "../util/object/extend" +], function( formatMessage, objectExtend ) { + +return function( code, message, attributes ) { + var error; + + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; + + objectExtend( error, attributes ); + + return error; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/invalid-parameter-value.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/invalid-parameter-value.js new file mode 100644 index 000000000..b014c29fe --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/invalid-parameter-value.js @@ -0,0 +1,12 @@ +define([ + "../create-error" +], function( createError ) { + +return function( name, value ) { + return createError( "E_INVALID_PAR_VALUE", "Invalid `{name}` value ({value}).", { + name: name, + value: value + }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/plural-module-presence.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/plural-module-presence.js new file mode 100644 index 000000000..d7a93965a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/plural-module-presence.js @@ -0,0 +1,9 @@ +define([ + "../create-error" +], function( createError ) { + +return function() { + return createError( "E_MISSING_PLURAL_MODULE", "Plural module not loaded." ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/unsupported-feature.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/unsupported-feature.js new file mode 100644 index 000000000..27de1edab --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/create-error/unsupported-feature.js @@ -0,0 +1,11 @@ +define([ + "../create-error" +], function( createError ) { + +return function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/format-message-to-parts.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/format-message-to-parts.js new file mode 100644 index 000000000..380e20130 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/format-message-to-parts.js @@ -0,0 +1,44 @@ +define([ + "./parts/push" +], function( partsPush ) { + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); + * > [{type: "variable", value: "1", name: "0"}, {type: "literal", value: " second"}] + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); + * > [ + * { type: "variable", value: "m", name: "0" }, + * { type: "literal", value: " /" }, + * { type: "variable", value: "s", name: "1" } + * ] + */ +return function( message, data ) { + + var lastOffset = 0, + parts = []; + + // Create parts. + message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( nameIncludingBrackets, offset ) { + var name = nameIncludingBrackets.slice( 1, -1 ); + partsPush( parts, "literal", message.slice( lastOffset, offset )); + partsPush( parts, "variable", data[ name ] ); + parts[ parts.length - 1 ].name = name; + lastOffset += offset + nameIncludingBrackets.length; + }); + + // Skip empty ones such as `{ type: 'literal', value: '' }`. + return parts.filter(function( part ) { + return part.value !== ""; + }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/format-message.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/format-message.js new file mode 100644 index 000000000..a3e825c12 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/format-message.js @@ -0,0 +1,34 @@ +define([ + "../util/to-string" +], function( toString ) { + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +return function( message, data ) { + + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); + + return message; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/parts/join.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/parts/join.js new file mode 100644 index 000000000..1080b4aac --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/parts/join.js @@ -0,0 +1,12 @@ +define(function() { + +/** + * Returns joined parts values. + */ +return function( parts ) { + return parts.map( function( part ) { + return part.value; + }).join( "" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/parts/push.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/parts/push.js new file mode 100644 index 000000000..d1f30dfb5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/parts/push.js @@ -0,0 +1,17 @@ +define(function() { + +/** + * Pushes part to parts array, concat two consecutive parts of the same type. + */ +return function( parts, type, value ) { + + // Concat two consecutive parts of same type + if ( parts.length && parts[ parts.length - 1 ].type === type ) { + parts[ parts.length - 1 ].value += value; + return; + } + + parts.push( { type: type, value: value } ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-bind.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-bind.js new file mode 100644 index 000000000..72468f1ed --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-bind.js @@ -0,0 +1,30 @@ +define([ + "./runtime-key", + "./runtime-stringify", + "../util/function-name" +], function( runtimeKey, runtimeStringify, functionName ) { + +return function( args, cldr, fn, runtimeArgs ) { + + var argsStr = runtimeStringify( args ), + fnName = functionName( fn ), + locale = cldr.locale; + + // If name of the function is not available, this is most likely due to uglification, + // which most likely means we are in production, and runtimeBind here is not necessary. + if ( !fnName ) { + return fn; + } + + fn.runtimeKey = runtimeKey( fnName, locale, null, argsStr ); + + fn.generatorString = function() { + return "Globalize(\"" + locale + "\")." + fnName + "(" + argsStr.slice( 1, -1 ) + ")"; + }; + + fn.runtimeArgs = runtimeArgs; + + return fn; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-cache-data-bind.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-cache-data-bind.js new file mode 100644 index 000000000..75dde1187 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-cache-data-bind.js @@ -0,0 +1,12 @@ +define(function() { + +return function( key, data ) { + var fn = function() { + return data; + }; + fn.dataCacheKey = key; + return fn; +}; + +}); + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-key.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-key.js new file mode 100644 index 000000000..904092ffc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-key.js @@ -0,0 +1,13 @@ +define([ + "./runtime-stringify", + "../util/string/hash" +], function( runtimeStringify, stringHash ) { + +return function( fnName, locale, args, argsStr ) { + var hash; + argsStr = argsStr || runtimeStringify( args ); + hash = stringHash( fnName + locale + argsStr ); + return hash > 0 ? "a" + hash : "b" + Math.abs( hash ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-stringify.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-stringify.js new file mode 100644 index 000000000..8ddc39866 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/runtime-stringify.js @@ -0,0 +1,12 @@ +define([], function( ) { + +return function( args ) { + return JSON.stringify( args, function( _key, value ) { + if ( value && value.runtimeKey ) { + return value.runtimeKey; + } + return value; + } ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate.js new file mode 100644 index 000000000..ace034241 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate.js @@ -0,0 +1,11 @@ +define([ + "./create-error" +], function( createError ) { + +return function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/cldr.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/cldr.js new file mode 100644 index 000000000..0a2feb358 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/cldr.js @@ -0,0 +1,19 @@ +define([ + "../validate", + "../../util/always-array" +], function( validate, alwaysArray ) { + +return function( path, value, options ) { + var skipBoolean; + options = options || {}; + + skipBoolean = alwaysArray( options.skip ).some(function( pathRe ) { + return pathRe.test( path ); + }); + + validate( "E_MISSING_CLDR", "Missing required CLDR content `{path}`.", value || skipBoolean, { + path: path + }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/default-locale.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/default-locale.js new file mode 100644 index 000000000..7e2379f77 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/default-locale.js @@ -0,0 +1,10 @@ +define([ + "../validate" +], function( validate ) { + +return function( value ) { + validate( "E_DEFAULT_LOCALE_NOT_DEFINED", "Default locale has not been defined.", + value !== undefined, {} ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-bundle.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-bundle.js new file mode 100644 index 000000000..1c7ea3a03 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-bundle.js @@ -0,0 +1,16 @@ +define([ + "../validate" +], function( validate ) { + +return function( cldr ) { + validate( + "E_MISSING_MESSAGE_BUNDLE", + "Missing message bundle for locale `{locale}`.", + cldr.attributes.bundle && cldr.get( "globalize-messages/{bundle}" ) !== undefined, + { + locale: cldr.locale + } + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-presence.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-presence.js new file mode 100644 index 000000000..5f7fd9395 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-presence.js @@ -0,0 +1,11 @@ +define([ + "../validate" +], function( validate ) { + +return function( path, value ) { + path = path.join( "/" ); + validate( "E_MISSING_MESSAGE", "Missing required message content `{path}`.", + value !== undefined, { path: path } ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-type.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-type.js new file mode 100644 index 000000000..185d2b4cf --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/message-type.js @@ -0,0 +1,18 @@ +define([ + "../validate" +], function( validate ) { + +return function( path, value ) { + path = path.join( "/" ); + validate( + "E_INVALID_MESSAGE", + "Invalid message content `{path}`. {expected} expected.", + typeof value === "string", + { + expected: "a string", + path: path + } + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-presence.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-presence.js new file mode 100644 index 000000000..81bc2ccd7 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-presence.js @@ -0,0 +1,10 @@ +define([ + "../validate" +], function( validate ) { + +return function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-range.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-range.js new file mode 100644 index 000000000..df5478221 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-range.js @@ -0,0 +1,30 @@ +define([ + "../validate" +], function( validate ) { + +/** + * range( value, name, minimum, maximum ) + * + * @value [Number]. + * + * @name [String] name of variable. + * + * @minimum [Number]. The lowest valid value, inclusive. + * + * @maximum [Number]. The greatest valid value, inclusive. + */ +return function( value, name, minimum, maximum ) { + validate( + "E_PAR_OUT_OF_RANGE", + "Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].", + value === undefined || value >= minimum && value <= maximum, + { + maximum: maximum, + minimum: minimum, + name: name, + value: value + } + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type.js new file mode 100644 index 000000000..6a45d1700 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type.js @@ -0,0 +1,18 @@ +define([ + "../validate" +], function( validate ) { + +return function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value + } + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/array.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/array.js new file mode 100644 index 000000000..9ee77a8b7 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/array.js @@ -0,0 +1,9 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( value, name, value === undefined || Array.isArray( value ), "Array" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/currency.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/currency.js new file mode 100644 index 000000000..7497d3908 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/currency.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" && ( /^[A-Za-z]{3}$/ ).test( value ), + "3-letter currency code string as defined by ISO 4217" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/date.js new file mode 100644 index 000000000..d29a1e0c5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/date.js @@ -0,0 +1,9 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/locale.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/locale.js new file mode 100644 index 000000000..f1bb61ba6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/locale.js @@ -0,0 +1,15 @@ +define([ + "cldr", + "../parameter-type" +], function( Cldr, validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" || value instanceof Cldr, + "String or Cldr instance" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/message-variables.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/message-variables.js new file mode 100644 index 000000000..a0f0d5d09 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/message-variables.js @@ -0,0 +1,15 @@ +define([ + "../parameter-type", + "../../../util/is-plain-object" +], function( validateParameterType, isPlainObject ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ) || Array.isArray( value ), + "Array or Plain Object" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/number.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/number.js new file mode 100644 index 000000000..c7dfb0037 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/number.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/plain-object.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/plain-object.js new file mode 100644 index 000000000..6a5781075 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/plain-object.js @@ -0,0 +1,15 @@ +define([ + "../parameter-type", + "../../../util/is-plain-object" +], function( validateParameterType, isPlainObject ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ), + "Plain Object" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/plural-type.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/plural-type.js new file mode 100644 index 000000000..8991f1907 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/plural-type.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || value === "cardinal" || value === "ordinal", + "String \"cardinal\" or \"ordinal\"" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/string.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/string.js new file mode 100644 index 000000000..c53512e01 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/parameter-type/string.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/skeleton.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/skeleton.js new file mode 100644 index 000000000..53c0b9049 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/skeleton.js @@ -0,0 +1,50 @@ +define([ + "../create-error", + "./skeleton/fields-pos-map" +], function( createError, validateSkeletonFieldsPosMap ) { + +/** + * validateSkeleton( skeleton ) + * + * skeleton: Assume `j` has already been converted into a localized hour field. + */ +return function validateSkeleton( skeleton ) { + var last, + + // Using easier to read variable. + fieldsPosMap = validateSkeletonFieldsPosMap; + + // "The fields are from the Date Field Symbol Table in Date Format Patterns" + // Ref: http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems + // I.e., check for invalid characters. + skeleton.replace( /[^GyYuUrQqMLlwWEecdDFghHKkmsSAzZOvVXx]/, function( field ) { + throw createError( + "E_INVALID_OPTIONS", "Invalid field `{invalidField}` of skeleton `{value}`", + { + invalidField: field, + type: "skeleton", + value: skeleton + } + ); + }); + + // "The canonical order is from top to bottom in that table; that is, yM not My". + // http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems + // I.e., check for invalid order. + skeleton.split( "" ).every(function( field ) { + if ( fieldsPosMap[ field ] < last ) { + throw createError( + "E_INVALID_OPTIONS", "Invalid order `{invalidField}` of skeleton `{value}`", + { + invalidField: field, + type: "skeleton", + value: skeleton + } + ); + } + last = fieldsPosMap[ field ]; + return true; + }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/skeleton/fields-pos-map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/skeleton/fields-pos-map.js new file mode 100644 index 000000000..65f380530 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/common/validate/skeleton/fields-pos-map.js @@ -0,0 +1,16 @@ +define(function() { + +/** + * Create a map between the skeleton fields and their positions, e.g., + * { + * G: 0 + * y: 1 + * ... + * } + */ +return "GyYuUrQqMLlwWEecdDFghHKkmsSAzZOvVXx".split( "" ).reduce(function( memo, item, i ) { + memo[ item ] = i; + return memo; +}, {}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/core-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/core-runtime.js new file mode 100644 index 000000000..c1ae4717b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/core-runtime.js @@ -0,0 +1,51 @@ +define([ + "./common/create-error", + "./common/format-message", + "./common/format-message-to-parts", + "./common/parts/join", + "./common/parts/push", + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type", + "./common/validate/parameter-type/string", + "./util/regexp/escape", + "./util/string/pad" +], function( createError, formatMessage, formatMessageToParts, partsJoin, partsPush, runtimeKey, + validateParameterPresence, validateParameterType, validateParameterTypeString, regexpEscape, + stringPad ) { + +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeString( locale, "locale" ); + + this._locale = locale; +} + +Globalize.locale = function( locale ) { + validateParameterTypeString( locale, "locale" ); + + if ( arguments.length ) { + this._locale = locale; + } + return this._locale; +}; + +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._formatMessageToParts = formatMessageToParts; +Globalize._partsJoin = partsJoin; +Globalize._partsPush = partsPush; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeKey = runtimeKey; +Globalize._stringPad = stringPad; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeString = validateParameterTypeString; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/core.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/core.js new file mode 100644 index 000000000..cb5a4fc0b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/core.js @@ -0,0 +1,117 @@ +define([ + "cldr", + "./common/create-error", + "./common/format-message", + "./common/format-message-to-parts", + "./common/parts/join", + "./common/parts/push", + "./common/runtime-bind", + "./common/validate", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-range", + "./common/validate/parameter-type", + "./common/validate/parameter-type/locale", + "./common/validate/parameter-type/plain-object", + "./util/always-array", + "./util/always-cldr", + "./util/is-plain-object", + "./util/object/extend", + "./util/regexp/escape", + "./util/string/pad", + + "cldr/event" +], function( Cldr, createError, formatMessage, formatMessageToParts, partsJoin, partsPush, + runtimeBind, validate, validateCldr, validateDefaultLocale, validateParameterPresence, + validateParameterRange, validateParameterType, validateParameterTypeLocale, + validateParameterTypePlainObject, alwaysArray, alwaysCldr, isPlainObject, objectExtend, + regexpEscape, stringPad ) { + +function validateLikelySubtags( cldr ) { + cldr.once( "get", validateCldr ); + cldr.get( "supplemental/likelySubtags" ); +} + +/** + * [new] Globalize( locale|cldr ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Create a Globalize instance. + */ +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeLocale( locale, "locale" ); + + this.cldr = alwaysCldr( locale ); + + validateLikelySubtags( this.cldr ); +} + +/** + * Globalize.load( json, ... ) + * + * @json [JSON] + * + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ +Globalize.load = function() { + + // validations are delegated to Cldr.load(). + Cldr.load.apply( Cldr, arguments ); +}; + +/** + * Globalize.locale( [locale|cldr] ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Set default Cldr instance if locale or cldr argument is passed. + * + * Return the default Cldr instance. + */ +Globalize.locale = function( locale ) { + validateParameterTypeLocale( locale, "locale" ); + + if ( arguments.length ) { + this.cldr = alwaysCldr( locale ); + validateLikelySubtags( this.cldr ); + } + return this.cldr; +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._alwaysArray = alwaysArray; +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._formatMessageToParts = formatMessageToParts; +Globalize._isPlainObject = isPlainObject; +Globalize._objectExtend = objectExtend; +Globalize._partsJoin = partsJoin; +Globalize._partsPush = partsPush; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeBind = runtimeBind; +Globalize._stringPad = stringPad; +Globalize._validate = validate; +Globalize._validateCldr = validateCldr; +Globalize._validateDefaultLocale = validateDefaultLocale; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterRange = validateParameterRange; +Globalize._validateParameterTypePlainObject = validateParameterTypePlainObject; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency-runtime.js new file mode 100644 index 000000000..4bbb85958 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency-runtime.js @@ -0,0 +1,50 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./core-runtime", + "./currency/formatter-fn", + "./currency/name-format", + "./currency/to-parts-formatter-fn", + + "./number-runtime" +], function( runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize, + currencyFormatterFn, currencyNameFormat, currencyToPartsFormatterFn ) { + +Globalize._currencyFormatterFn = currencyFormatterFn; +Globalize._currencyNameFormat = currencyNameFormat; +Globalize._currencyToPartsFormatterFn = currencyToPartsFormatterFn; + +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + options = options || {}; + return Globalize[ runtimeKey( "currencyFormatter", this._locale, [ currency, options ] ) ]; +}; + +Globalize.currencyToPartsFormatter = +Globalize.prototype.currencyToPartsFormatter = function( currency, options ) { + options = options || {}; + return Globalize[ + runtimeKey( "currencyToPartsFormatter", this._locale, [ currency, options ] ) + ]; +}; + +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +Globalize.formatCurrencyToParts = +Globalize.prototype.formatCurrencyToParts = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyToPartsFormatter( currency, options )( value ); +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency.js new file mode 100644 index 000000000..66c67511d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency.js @@ -0,0 +1,221 @@ +define([ + "./core", + "./common/create-error/plural-module-presence", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/currency", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./currency/formatter-fn", + "./currency/name-properties", + "./currency/symbol-properties", + "./currency/to-parts-formatter-fn", + "./util/object/omit", + "./number", + + "cldr/event", + "cldr/supplemental" + +], function( Globalize, createErrorPluralModulePresence, runtimeBind, validateCldr, + validateDefaultLocale, validateParameterPresence, validateParameterTypeCurrency, + validateParameterTypeNumber, validateParameterTypePlainObject, currencyFormatterFn, + currencyNameProperties, currencySymbolProperties, currencyToPartsFormatterFn, objectOmit ) { + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ + /numbers\/currencies\/[^/]+\/symbol-alt-/, + /supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/ + ] + }); +} + +/** + * .currencyFormatter( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: + * - style: [String] "symbol" (default), "accounting", "code" or "name". + * - see also number/format options. + * + * Return a function that formats a currency according to the given options and default/instance + * locale. + */ +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + var args, currencyToPartsFormatter, returnFn; + + validateParameterPresence( currency, "currency" ); + validateParameterTypeCurrency( currency, "currency" ); + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + args = [ currency, options ]; + + currencyToPartsFormatter = this.currencyToPartsFormatter( currency, options ); + returnFn = currencyFormatterFn( currencyToPartsFormatter ); + runtimeBind( args, this.cldr, returnFn, [ currencyToPartsFormatter ] ); + + return returnFn; +}; + +/** + * .currencyToPartsFormatter( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: + * - style: [String] "symbol" (default), "accounting", "code" or "name". + * - see also number/format options. + * + * Return a currency formatter function (of the form below) according to the given options and the + * default/instance locale. + * + * fn( value ) + * + * @value [Number] + * + * Return a function that formats a currency to parts according to the given options + * and the default/instance locale. + */ +Globalize.currencyToPartsFormatter = +Globalize.prototype.currencyToPartsFormatter = function( currency, options ) { + var args, cldr, numberToPartsFormatter, pluralGenerator, properties, returnFn, style; + + validateParameterPresence( currency, "currency" ); + validateParameterTypeCurrency( currency, "currency" ); + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || {}; + + args = [ currency, options ]; + style = options.style || "symbol"; + + validateDefaultLocale( cldr ); + + // Get properties given style ("symbol" default, "code" or "name"). + cldr.on( "get", validateRequiredCldr ); + try { + properties = ({ + accounting: currencySymbolProperties, + code: currencySymbolProperties, + name: currencyNameProperties, + symbol: currencySymbolProperties + }[ style ] )( currency, cldr, options ); + } finally { + cldr.off( "get", validateRequiredCldr ); + } + + // options = options minus style, plus raw pattern. + options = objectOmit( options, "style" ); + options.raw = properties.pattern; + + // Return formatter when style is "symbol", "accounting", or "code". + if ( style === "symbol" || style === "accounting" || style === "code" ) { + numberToPartsFormatter = this.numberToPartsFormatter( options ); + + returnFn = currencyToPartsFormatterFn( numberToPartsFormatter, properties.symbol ); + + runtimeBind( args, cldr, returnFn, [ numberToPartsFormatter, properties.symbol ] ); + + // Return formatter when style is "name". + } else { + numberToPartsFormatter = this.numberToPartsFormatter( options ); + + // Is plural module present? Yes, use its generator. Nope, use an error generator. + pluralGenerator = this.plural !== undefined ? + this.pluralGenerator() : + createErrorPluralModulePresence; + + returnFn = currencyToPartsFormatterFn( + numberToPartsFormatter, + pluralGenerator, + properties + ); + + runtimeBind( args, cldr, returnFn, [ + numberToPartsFormatter, + pluralGenerator, + properties + ]); + } + + return returnFn; +}; + +/** + * .currencyParser( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Return the currency parser according to the given options and the default/instance locale. + */ +Globalize.currencyParser = +Globalize.prototype.currencyParser = function( /* currency, options */ ) { + + // TODO implement parser. + +}; + +/** + * .formatCurrency( value, currency [, options] ) + * + * @value [Number] number to be formatted. + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Format a currency according to the given options and the default/instance locale. + */ +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.currencyFormatter( currency, options )( value ); +}; + +/** + * .formatCurrencyToParts( value, currency [, options] ) + * + * @value [Number] number to be formatted. + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Format a currency to parts according to the given options and the default/instance locale. + */ +Globalize.formatCurrencyToParts = +Globalize.prototype.formatCurrencyToParts = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.currencyToPartsFormatter( currency, options )( value ); +}; + +/** + * .parseCurrency( value, currency [, options] ) + * + * @value [String] + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: See currencyFormatter. + * + * Return the parsed currency or NaN when value is invalid. + */ +Globalize.parseCurrency = +Globalize.prototype.parseCurrency = function( /* value, currency, options */ ) { +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/formatter-fn.js new file mode 100644 index 000000000..5f2d6c856 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/formatter-fn.js @@ -0,0 +1,11 @@ +define([ + "../common/parts/join" +], function( partsJoin ) { + +return function( currencyToPartsFormatter ) { + return function currencyFormatter( value ) { + return partsJoin( currencyToPartsFormatter( value )); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/name-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/name-format.js new file mode 100644 index 000000000..859e8b885 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/name-format.js @@ -0,0 +1,39 @@ +define([ + "../common/format-message-to-parts", + "../common/parts/push" +], function( formatMessageToParts, partsPush ) { + +/** + * nameFormat( formattedNumber, pluralForm, properties ) + * + * Return the appropriate name form currency format. + */ +return function( formattedNumber, pluralForm, properties ) { + var displayName, unitPattern, + parts = [], + displayNames = properties.displayNames || {}, + unitPatterns = properties.unitPatterns; + + displayName = displayNames[ "displayName-count-" + pluralForm ] || + displayNames[ "displayName-count-other" ] || + displayNames.displayName || + properties.currency; + unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] || + unitPatterns[ "unitPattern-count-other" ]; + + formatMessageToParts( unitPattern, [ formattedNumber, displayName ]).forEach(function( part ) { + if ( part.type === "variable" && part.name === "0" ) { + part.value.forEach(function( part ) { + partsPush( parts, part.type, part.value ); + }); + } else if ( part.type === "variable" && part.name === "1" ) { + partsPush( parts, "currency", part.value ); + } else { + partsPush( parts, "literal", part.value ); + } + }); + + return parts; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/name-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/name-properties.js new file mode 100644 index 000000000..47452d0d9 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/name-properties.js @@ -0,0 +1,30 @@ +define([ + "./supplemental-override", + "./unit-patterns", + "../util/object/filter", + "../number/pattern" +], function( currencySupplementalOverride, currencyUnitPatterns, objectFilter, numberPattern ) { + +/** + * nameProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +return function( currency, cldr ) { + var pattern = numberPattern( "decimal", cldr ); + + // The number of decimal places and the rounding for each currency is not locale-specific. Those + // values overridden by Supplemental Currency Data. + pattern = currencySupplementalOverride( currency, pattern, cldr ); + + return { + displayNames: objectFilter( cldr.main([ + "numbers/currencies", + currency + ]), /^displayName/ ), + pattern: pattern, + unitPatterns: currencyUnitPatterns( cldr ) + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/supplemental-override.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/supplemental-override.js new file mode 100644 index 000000000..73fbaf5f3 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/supplemental-override.js @@ -0,0 +1,25 @@ +define([ + "../util/string/pad" +], function( stringPad ) { + +/** + * supplementalOverride( currency, pattern, cldr ) + * + * Return pattern with fraction digits overriden by supplemental currency data. + */ +return function( currency, pattern, cldr ) { + var digits, + fraction = "", + fractionData = cldr.supplemental([ "currencyData/fractions", currency ]) || + cldr.supplemental( "currencyData/fractions/DEFAULT" ); + + digits = +fractionData._digits; + + if ( digits ) { + fraction = "." + stringPad( "0", digits ).slice( 0, -1 ) + fractionData._rounding; + } + + return pattern.replace( /\.(#+|0*[0-9]|0+[0-9]?)/g, fraction ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/symbol-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/symbol-format.js new file mode 100644 index 000000000..cd13d5766 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/symbol-format.js @@ -0,0 +1,17 @@ +define(function() { + +/** + * symbolFormat( parts, symbol ) + * + * Return the appropriate symbol/account form format. + */ +return function( parts, symbol ) { + parts.forEach(function( part ) { + if ( part.type === "currency" ) { + part.value = symbol; + } + }); + return parts; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/symbol-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/symbol-properties.js new file mode 100644 index 000000000..4f3f699dc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/symbol-properties.js @@ -0,0 +1,91 @@ +define([ + "./supplemental-override", + "../number/numbering-system", + "../util/regexp/not-s", + "../util/regexp/not-s-and-z" +], function( currencySupplementalOverride, numberNumberingSystem, regexpNotS, regexpNotSAndZ ) { + +/** + * symbolProperties( currency, cldr ) + * + * Return pattern replacing `¤` with the appropriate currency symbol literal. + */ +return function( currency, cldr, options ) { + var currencySpacing, pattern, symbol, symbolEntries, + regexp = { + "[:digit:]": /\d/, + "[:^S:]": regexpNotS, + "[[:^S:]&[:^Z:]]": regexpNotSAndZ + }; + + if ( options.style === "code" ) { + symbol = currency; + } else { + symbolEntries = [ "symbol" ]; + + // If options.symbolForm === "narrow" was passed, prepend it. + if ( options.symbolForm === "narrow" ) { + symbolEntries.unshift( "symbol-alt-narrow" ); + } + + symbolEntries.some(function( symbolEntry ) { + return symbol = cldr.main([ + "numbers/currencies", + currency, + symbolEntry + ]); + }); + } + + currencySpacing = [ "beforeCurrency", "afterCurrency" ].map(function( position ) { + return cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + "currencySpacing", + position + ]); + }); + + pattern = cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + options.style === "accounting" ? "accounting" : "standard" + ]); + + pattern = + + // The number of decimal places and the rounding for each currency is not locale-specific. + // Those values are overridden by Supplemental Currency Data. + currencySupplementalOverride( currency, pattern, cldr ) + + // Replace "¤" (\u00A4) with the appropriate symbol literal. + .split( ";" ).map(function( pattern ) { + + return pattern.split( "\u00A4" ).map(function( part, i ) { + var currencyMatch = regexp[ currencySpacing[ i ].currencyMatch ], + surroundingMatch = regexp[ currencySpacing[ i ].surroundingMatch ], + insertBetween = ""; + + // For currencyMatch and surroundingMatch definitions, read [1]. + // When i === 0, beforeCurrency is being handled. Otherwise, afterCurrency. + // 1: http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies + currencyMatch = currencyMatch.test( symbol.charAt( i ? symbol.length - 1 : 0 ) ); + surroundingMatch = surroundingMatch.test( + part.charAt( i ? 0 : part.length - 1 ).replace( /[#@,.]/g, "0" ) + ); + + if ( currencyMatch && part && surroundingMatch ) { + insertBetween = currencySpacing[ i ].insertBetween; + } + + return ( i ? insertBetween : "" ) + part + ( i ? "" : insertBetween ); + }).join( "\u00A4" ); + }).join( ";" ); + + return { + pattern: pattern, + symbol: symbol + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/to-parts-formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/to-parts-formatter-fn.js new file mode 100644 index 000000000..f1072085f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/to-parts-formatter-fn.js @@ -0,0 +1,36 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./name-format", + "./symbol-format" +], function( validateParameterPresence, validateParameterTypeNumber, currencyNameFormat, + currencySymbolFormat ) { + +return function( numberToPartsFormatter, pluralGenerator, properties ) { + var fn; + + // Return formatter when style is "name". + if ( pluralGenerator && properties ) { + fn = function currencyToPartsFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return currencyNameFormat( + numberToPartsFormatter( value ), + pluralGenerator( value ), + properties + ); + }; + + // Return formatter when style is "symbol", "accounting", or "code". + } else { + fn = function currencyToPartsFormatter( value ) { + + // 1: Reusing pluralGenerator argument, but in this case it is actually `symbol` + return currencySymbolFormat( numberToPartsFormatter( value ), pluralGenerator /* 1 */ ); + }; + } + + return fn; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/unit-patterns.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/unit-patterns.js new file mode 100644 index 000000000..3a908612a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/currency/unit-patterns.js @@ -0,0 +1,13 @@ +define([ + "../util/object/filter", + "../number/numbering-system" +], function( objectFilter, numberNumberingSystem ) { + +return function( cldr ) { + return objectFilter( cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ) + ]), /^unitPattern/ ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date-runtime.js new file mode 100644 index 000000000..4c7ce98fe --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date-runtime.js @@ -0,0 +1,88 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/date", + "./common/validate/parameter-type/string", + "./core-runtime", + "./date/format", + "./date/formatter-fn", + "./date/parse", + "./date/parser-fn", + "./date/tokenizer", + "./date/to-parts-formatter-fn", + + "./number-runtime" +], function( runtimeKey, validateParameterPresence, validateParameterTypeDate, + validateParameterTypeString, Globalize, dateFormat, dateFormatterFn, dateParse, dateParserFn, + dateToPartsFormatterFn, dateTokenizer ) { + +Globalize._dateFormat = dateFormat; +Globalize._dateFormatterFn = dateFormatterFn; +Globalize._dateParser = dateParse; +Globalize._dateParserFn = dateParserFn; +Globalize._dateTokenizer = dateTokenizer; +Globalize._dateToPartsFormatterFn = dateToPartsFormatterFn; +Globalize._validateParameterTypeDate = validateParameterTypeDate; + +function optionsHasStyle( options ) { + return options.skeleton !== undefined || + options.date !== undefined || + options.time !== undefined || + options.datetime !== undefined || + options.raw !== undefined; +} + +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + options = options || {}; + if ( !optionsHasStyle( options ) ) { + options.skeleton = "yMd"; + } + return Globalize[ runtimeKey( "dateFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.dateToPartsFormatter = +Globalize.prototype.dateToPartsFormatter = function( options ) { + options = options || {}; + if ( !optionsHasStyle( options ) ) { + options.skeleton = "yMd"; + } + return Globalize[ runtimeKey( "dateToPartsFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + options = options || {}; + if ( !optionsHasStyle( options ) ) { + options.skeleton = "yMd"; + } + return Globalize[ runtimeKey( "dateParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +Globalize.formatDateToParts = +Globalize.prototype.formatDateToParts = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateToPartsFormatter( options )( value ); +}; + +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date.js new file mode 100644 index 000000000..4453a914f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date.js @@ -0,0 +1,323 @@ +define([ + "cldr", + "./common/runtime-bind", + "./common/validate", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/date", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/string", + "./core", + "./date/expand-pattern", + "./date/format-properties", + "./date/formatter-fn", + "./date/parse-properties", + "./date/parser-fn", + "./date/tokenizer-properties", + "./date/to-parts-formatter-fn", + + "cldr/event", + "cldr/supplemental", + "./number" +], function( Cldr, runtimeBind, validate, validateCldr, validateDefaultLocale, + validateParameterPresence, validateParameterTypeDate, validateParameterTypePlainObject, + validateParameterTypeString, Globalize, dateExpandPattern, dateFormatProperties, + dateFormatterFn, dateParseProperties, dateParserFn, dateTokenizerProperties, + dateToPartsFormatterFn ) { + +function optionsHasStyle( options ) { + return options.skeleton !== undefined || + options.date !== undefined || + options.time !== undefined || + options.datetime !== undefined || + options.raw !== undefined; +} + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ + /dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/, + /dates\/calendars\/gregorian\/days\/.*\/short/, + /dates\/timeZoneNames\/zone/, + /dates\/timeZoneNames\/metazone/, + /globalize-iana/, + /supplemental\/metaZones/, + /supplemental\/timeData\/(?!001)/, + /supplemental\/weekData\/(?!001)/ + ] + }); +} + +function validateOptionsPreset( options ) { + validateOptionsPresetEach( "date", options ); + validateOptionsPresetEach( "time", options ); + validateOptionsPresetEach( "datetime", options ); +} + +function validateOptionsPresetEach( type, options ) { + var value = options[ type ]; + validate( + "E_INVALID_OPTIONS", + "Invalid `{{type}: \"{value}\"}`.", + value === undefined || [ "short", "medium", "long", "full" ].indexOf( value ) !== -1, + { type: type, value: value } + ); +} + +function validateOptionsSkeleton( pattern, skeleton ) { + validate( + "E_INVALID_OPTIONS", + "Invalid `{skeleton: \"{value}\"}` based on provided CLDR.", + skeleton === undefined || ( typeof pattern === "string" && pattern ), + { type: "skeleton", value: skeleton } + ); +} + +function validateRequiredIana( timeZone ) { + return function( path, value ) { + + if ( !/globalize-iana/.test( path ) ) { + return; + } + + validate( + "E_MISSING_IANA_TZ", + "Missing required IANA timezone content for `{timeZone}`: `{path}`.", + value, + { + path: path.replace( /globalize-iana\//, "" ), + timeZone: timeZone + } + ); + }; +} + +/** + * .loadTimeZone( json ) + * + * @json [JSON] + * + * Load IANA timezone data. + */ +Globalize.loadTimeZone = function( json ) { + var customData = { + "globalize-iana": json + }; + + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); + + Cldr.load( customData ); +}; + +/** + * .dateFormatter( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a date formatter function (of the form below) according to the given options and the + * default/instance locale. + * + * fn( value ) + * + * @value [Date] + * + * Return a function that formats a date according to the given `format` and the default/instance + * locale. + */ +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + var args, dateToPartsFormatter, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + if ( !optionsHasStyle( options ) ) { + options.skeleton = "yMd"; + } + args = [ options ]; + + dateToPartsFormatter = this.dateToPartsFormatter( options ); + returnFn = dateFormatterFn( dateToPartsFormatter ); + runtimeBind( args, this.cldr, returnFn, [ dateToPartsFormatter ] ); + + return returnFn; +}; + +/** + * .dateToPartsFormatter( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a date formatter function (of the form below) according to the given options and the + * default/instance locale. + * + * fn( value ) + * + * @value [Date] + * + * Return a function that formats a date to parts according to the given `format` + * and the default/instance + * locale. + */ +Globalize.dateToPartsFormatter = +Globalize.prototype.dateToPartsFormatter = function( options ) { + var args, cldr, numberFormatters, pad, pattern, properties, returnFn, + timeZone, ianaListener; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || {}; + if ( !optionsHasStyle( options ) ) { + options.skeleton = "yMd"; + } + + validateOptionsPreset( options ); + validateDefaultLocale( cldr ); + + timeZone = options.timeZone; + validateParameterTypeString( timeZone, "options.timeZone" ); + + args = [ options ]; + + cldr.on( "get", validateRequiredCldr ); + if ( timeZone ) { + ianaListener = validateRequiredIana( timeZone ); + cldr.on( "get", ianaListener ); + } + try { + pattern = dateExpandPattern( options, cldr ); + validateOptionsSkeleton( pattern, options.skeleton ); + properties = dateFormatProperties( pattern, cldr, timeZone ); + } finally { + cldr.off( "get", validateRequiredCldr ); + if ( ianaListener ) { + cldr.off( "get", ianaListener ); + } + } + + // Create needed number formatters. + numberFormatters = properties.numberFormatters; + delete properties.numberFormatters; + for ( pad in numberFormatters ) { + numberFormatters[ pad ] = this.numberFormatter({ + raw: numberFormatters[ pad ] + }); + } + + returnFn = dateToPartsFormatterFn( numberFormatters, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatters, properties ] ); + + return returnFn; +}; + +/** + * .dateParser( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a function that parses a string date according to the given `formats` and the + * default/instance locale. + */ +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + var args, cldr, numberParser, parseProperties, pattern, returnFn, timeZone, + tokenizerProperties; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || {}; + if ( !optionsHasStyle( options ) ) { + options.skeleton = "yMd"; + } + + validateOptionsPreset( options ); + validateDefaultLocale( cldr ); + + timeZone = options.timeZone; + validateParameterTypeString( timeZone, "options.timeZone" ); + + args = [ options ]; + + try { + cldr.on( "get", validateRequiredCldr ); + if ( timeZone ) { + cldr.on( "get", validateRequiredIana( timeZone ) ); + } + pattern = dateExpandPattern( options, cldr ); + validateOptionsSkeleton( pattern, options.skeleton ); + tokenizerProperties = dateTokenizerProperties( pattern, cldr, timeZone ); + parseProperties = dateParseProperties( cldr, timeZone ); + } finally { + cldr.off( "get", validateRequiredCldr ); + if ( timeZone ) { + cldr.off( "get", validateRequiredIana( timeZone ) ); + } + } + numberParser = this.numberParser({ raw: "0" }); + + returnFn = dateParserFn( numberParser, parseProperties, tokenizerProperties ); + + runtimeBind( args, cldr, returnFn, [ numberParser, parseProperties, tokenizerProperties ] ); + + return returnFn; +}; + +/** + * .formatDate( value, options ) + * + * @value [Date] + * + * @options [Object] see date/expand_pattern for more info. + * + * Formats a date or number according to the given options string and the default/instance locale. + */ +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +/** + * .formatDateToParts( value, options ) + * + * @value [Date] + * + * @options [Object] see date/expand_pattern for more info. + * + * Formats a date or number to parts according to the given options and the default/instance locale. + */ +Globalize.formatDateToParts = +Globalize.prototype.formatDateToParts = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateToPartsFormatter( options )( value ); +}; + +/** + * .parseDate( value, options ) + * + * @value [String] + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a Date instance or null. + */ +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/day-of-week.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/day-of-week.js new file mode 100644 index 000000000..7c70c20dc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/day-of-week.js @@ -0,0 +1,20 @@ +define(function() { + +/** + * dayOfWeek( date, firstDay ) + * + * @date + * + * @firstDay the result of `dateFirstDayOfWeek( cldr )` + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +return function( date, firstDay ) { + return ( date.getDay() - firstDay + 7 ) % 7; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/day-of-year.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/day-of-year.js new file mode 100644 index 000000000..5158eae26 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/day-of-year.js @@ -0,0 +1,15 @@ +define([ + "./distance-in-days", + "./start-of" +], function( dateDistanceInDays, dateStartOf ) { + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +return function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/distance-in-days.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/distance-in-days.js new file mode 100644 index 000000000..1f1f265ed --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/distance-in-days.js @@ -0,0 +1,13 @@ +define(function() { + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +return function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern.js new file mode 100644 index 000000000..34eefb3cf --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern.js @@ -0,0 +1,127 @@ +define([ + "../common/create-error/invalid-parameter-value", + "../common/format-message", + "../common/validate/skeleton", + "./expand-pattern/get-best-match-pattern" +], function( createErrorInvalidParameterValue, formatMessage, validateSkeleton, + dateExpandPatternGetBestMatchPattern ) { + +/** + * expandPattern( options, cldr ) + * + * @options [Object] if String, it's considered a skeleton. Object accepts: + * - skeleton: [String] lookup availableFormat; + * - date: [String] ( "full" | "long" | "medium" | "short" ); + * - time: [String] ( "full" | "long" | "medium" | "short" ); + * - datetime: [String] ( "full" | "long" | "medium" | "short" ); + * - raw: [String] For more info see datetime/format.js. + * + * @cldr [Cldr instance]. + * + * Return the corresponding pattern. + * Eg for "en": + * - "GyMMMd" returns "MMM d, y G"; + * - { skeleton: "GyMMMd" } returns "MMM d, y G"; + * - { date: "full" } returns "EEEE, MMMM d, y"; + * - { time: "full" } returns "h:mm:ss a zzzz"; + * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; + * - { raw: "dd/mm" } returns "dd/mm"; + */ +return function( options, cldr ) { + var dateSkeleton, result, skeleton, timeSkeleton, type, + + // Using easier to read variables. + getBestMatchPattern = dateExpandPatternGetBestMatchPattern; + + function combineDateTime( type, datePattern, timePattern ) { + return formatMessage( + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats", + type + ]), + [ timePattern, datePattern ] + ); + } + + switch ( true ) { + case "skeleton" in options: + skeleton = options.skeleton; + + // Preferred hour (j). + skeleton = skeleton.replace( /j/g, function() { + return cldr.supplemental.timeData.preferred(); + }); + + validateSkeleton( skeleton ); + + // Try direct map (note that getBestMatchPattern handles it). + // ... or, try to "best match" the whole skeleton. + result = getBestMatchPattern( + cldr, + skeleton + ); + if ( result ) { + break; + } + + // ... or, try to "best match" the date and time parts individually. + timeSkeleton = skeleton.split( /[^hHKkmsSAzZOvVXx]/ ).slice( -1 )[ 0 ]; + dateSkeleton = skeleton.split( /[^GyYuUrQqMLlwWdDFgEec]/ )[ 0 ]; + dateSkeleton = getBestMatchPattern( + cldr, + dateSkeleton + ); + timeSkeleton = getBestMatchPattern( + cldr, + timeSkeleton + ); + + if ( /(MMMM|LLLL).*[Ec]/.test( dateSkeleton ) ) { + type = "full"; + } else if ( /MMMM|LLLL/.test( dateSkeleton ) ) { + type = "long"; + } else if ( /MMM|LLL/.test( dateSkeleton ) ) { + type = "medium"; + } else { + type = "short"; + } + + if ( dateSkeleton && timeSkeleton ) { + result = combineDateTime( type, dateSkeleton, timeSkeleton ); + } else { + result = dateSkeleton || timeSkeleton; + } + + break; + + case "date" in options: + case "time" in options: + result = cldr.main([ + "dates/calendars/gregorian", + "date" in options ? "dateFormats" : "timeFormats", + ( options.date || options.time ) + ]); + break; + + case "datetime" in options: + result = combineDateTime( options.datetime, + cldr.main([ "dates/calendars/gregorian/dateFormats", options.datetime ]), + cldr.main([ "dates/calendars/gregorian/timeFormats", options.datetime ]) + ); + break; + + case "raw" in options: + result = options.raw; + break; + + default: + throw createErrorInvalidParameterValue({ + name: "options", + value: options + }); + } + + return result; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/augment-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/augment-format.js new file mode 100644 index 000000000..e403a4471 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/augment-format.js @@ -0,0 +1,56 @@ +define([ + "./normalize-pattern-type", + "../pattern-re", + "../../util/string/repeat" +], function( dateExpandPatternNormalizePatternType, datePatternRe, stringRepeat ) { + +function expandBestMatchFormat( skeletonWithoutFractionalSeconds, bestMatchFormat ) { + var i, j, bestMatchFormatParts, matchedType, matchedLength, requestedType, + requestedLength, requestedSkeletonParts, + + // Using an easier to read variable. + normalizePatternType = dateExpandPatternNormalizePatternType; + + requestedSkeletonParts = skeletonWithoutFractionalSeconds.match( datePatternRe ); + bestMatchFormatParts = bestMatchFormat.match( datePatternRe ); + + for ( i = 0; i < bestMatchFormatParts.length; i++ ) { + matchedType = bestMatchFormatParts[ i ].charAt( 0 ); + matchedLength = bestMatchFormatParts[ i ].length; + for ( j = 0; j < requestedSkeletonParts.length; j++ ) { + requestedType = requestedSkeletonParts[ j ].charAt( 0 ); + requestedLength = requestedSkeletonParts[ j ].length; + if ( normalizePatternType( matchedType ) === normalizePatternType( requestedType ) && + matchedLength < requestedLength + ) { + bestMatchFormatParts[ i ] = stringRepeat( matchedType, requestedLength ); + } + } + } + + return bestMatchFormatParts.join( "" ); +} + +// See: http://www.unicode.org/reports/tr35/tr35-dates.html#Matching_Skeletons +return function( requestedSkeleton, bestMatchFormat, decimalSeparator ) { + var countOfFractionalSeconds, fractionalSecondMatch, lastSecondIdx, + skeletonWithoutFractionalSeconds; + + fractionalSecondMatch = requestedSkeleton.match( /S/g ); + countOfFractionalSeconds = fractionalSecondMatch ? fractionalSecondMatch.length : 0; + skeletonWithoutFractionalSeconds = requestedSkeleton.replace( /S/g, "" ); + + bestMatchFormat = expandBestMatchFormat( skeletonWithoutFractionalSeconds, bestMatchFormat ); + + lastSecondIdx = bestMatchFormat.lastIndexOf( "s" ); + if ( lastSecondIdx !== -1 && countOfFractionalSeconds !== 0 ) { + bestMatchFormat = + bestMatchFormat.slice( 0, lastSecondIdx + 1 ) + + decimalSeparator + + stringRepeat( "S", countOfFractionalSeconds ) + + bestMatchFormat.slice( lastSecondIdx + 1 ); + } + return bestMatchFormat; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/compare-formats.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/compare-formats.js new file mode 100644 index 000000000..3ddc8b74a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/compare-formats.js @@ -0,0 +1,58 @@ +define([ + "./normalize-pattern-type", + "../pattern-re" +], function( dateExpandPatternNormalizePatternType, datePatternRe ) { + +return function( formatA, formatB ) { + var a, b, distance, lenA, lenB, typeA, typeB, i, j, + + // Using easier to read variables. + normalizePatternType = dateExpandPatternNormalizePatternType; + + if ( formatA === formatB ) { + return 0; + } + + formatA = formatA.match( datePatternRe ); + formatB = formatB.match( datePatternRe ); + + if ( formatA.length !== formatB.length ) { + return -1; + } + + distance = 1; + for ( i = 0; i < formatA.length; i++ ) { + a = formatA[ i ].charAt( 0 ); + typeA = normalizePatternType( a ); + typeB = null; + for ( j = 0; j < formatB.length; j++ ) { + b = formatB[ j ].charAt( 0 ); + typeB = normalizePatternType( b ); + if ( typeA === typeB ) { + break; + } else { + typeB = null; + } + } + if ( typeB === null ) { + return -1; + } + lenA = formatA[ i ].length; + lenB = formatB[ j ].length; + distance = distance + Math.abs( lenA - lenB ); + + // Most symbols have a small distance from each other, e.g., M ≅ L; E ≅ c; a ≅ b ≅ B; + // H ≅ k ≅ h ≅ K; ... + if ( a !== b ) { + distance += 1; + } + + // Numeric (l<3) and text fields (l>=3) are given a larger distance from each other. + if ( ( lenA < 3 && lenB >= 3 ) || ( lenA >= 3 && lenB < 3 ) ) { + distance += 20; + } + } + return distance; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/get-best-match-pattern.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/get-best-match-pattern.js new file mode 100644 index 000000000..fbc17630f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/get-best-match-pattern.js @@ -0,0 +1,46 @@ +define([ + "./augment-format", + "./compare-formats", + "../../number/symbol" +], function( dateExpandPatternAugmentFormat, dateExpandPatternCompareFormats, numberSymbol ) { + +return function( cldr, askedSkeleton ) { + var availableFormats, decimalSeparator, pattern, ratedFormats, skeleton, + path = "dates/calendars/gregorian/dateTimeFormats/availableFormats", + + // Using easier to read variables. + augmentFormat = dateExpandPatternAugmentFormat, + compareFormats = dateExpandPatternCompareFormats; + + pattern = cldr.main([ path, askedSkeleton ]); + + if ( askedSkeleton && !pattern ) { + availableFormats = cldr.main([ path ]); + ratedFormats = []; + + for ( skeleton in availableFormats ) { + ratedFormats.push({ + skeleton: skeleton, + pattern: availableFormats[ skeleton ], + rate: compareFormats( askedSkeleton, skeleton ) + }); + } + + ratedFormats = ratedFormats + .filter( function( format ) { + return format.rate > -1; + } ) + .sort( function( formatA, formatB ) { + return formatA.rate - formatB.rate; + }); + + if ( ratedFormats.length ) { + decimalSeparator = numberSymbol( "decimal", cldr ); + pattern = augmentFormat( askedSkeleton, ratedFormats[ 0 ].pattern, decimalSeparator ); + } + } + + return pattern; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/normalize-pattern-type.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/normalize-pattern-type.js new file mode 100644 index 000000000..34ddc6b84 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/normalize-pattern-type.js @@ -0,0 +1,9 @@ +define([ + "./similar-fields-map" +], function( dateExpandPatternSimilarFieldsMap ) { + +return function( character ) { + return dateExpandPatternSimilarFieldsMap[ character ] || character; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/similar-fields-map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/similar-fields-map.js new file mode 100644 index 000000000..b27c75097 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/expand-pattern/similar-fields-map.js @@ -0,0 +1,16 @@ +define([ + "../../util/object/invert" +], function( objectInvert ) { + +// Invert key and values, e.g., {"e": "eEc"} ==> {"e": "e", "E": "e", "c": "e"}. +return objectInvert({ + "e": "eEc", + "L": "ML" +}, function( object, key, value ) { + value.split( "" ).forEach(function( field ) { + object[ field ] = key; + }); + return object; +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/fields-map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/fields-map.js new file mode 100644 index 000000000..411454b35 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/fields-map.js @@ -0,0 +1,26 @@ +define([ + "../util/object/invert" +], function( objectInvert ) { + +// Invert key and values, e.g., {"year": "yY"} ==> {"y": "year", "Y": "year"} +return objectInvert({ + "era": "G", + "year": "yY", + "quarter": "qQ", + "month": "ML", + "week": "wW", + "day": "dDF", + "weekday": "ecE", + "dayperiod": "a", + "hour": "hHkK", + "minute": "m", + "second": "sSA", + "zone": "zvVOxX" +}, function( object, key, value ) { + value.split( "" ).forEach(function( symbol ) { + object[ symbol ] = key; + }); + return object; +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/first-day-of-week.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/first-day-of-week.js new file mode 100644 index 000000000..44490b43c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/first-day-of-week.js @@ -0,0 +1,12 @@ +define([ + "./week-days" +], function( dateWeekDays ) { + +/** + * firstDayOfWeek + */ +return function( cldr ) { + return dateWeekDays.indexOf( cldr.supplemental.weekData.firstDay() ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/format-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/format-properties.js new file mode 100644 index 000000000..223dd6220 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/format-properties.js @@ -0,0 +1,355 @@ +define([ + "./first-day-of-week", + "./get-time-zone-name", + "./pattern-re", + "./timezone-hour-format/h", + "./timezone-hour-format/hm", + "../common/create-error/unsupported-feature", + "../common/format-message", + "../common/runtime-cache-data-bind", + "../number/symbol", + "../util/string/pad" +], function( dateFirstDayOfWeek, dateGetTimeZoneName, datePatternRe, dateTimezoneHourFormatH, + dateTimezoneHourFormatHm, createErrorUnsupportedFeature, formatMessage, runtimeCacheDataBind, + numberSymbol, stringPad ) { + +/** + * properties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + * + * @cldr [Cldr instance]. + * + * Return the properties given the pattern and cldr. + * + * TODO Support other calendar types. + */ +return function( pattern, cldr, timeZone ) { + var properties = { + numberFormatters: {}, + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function setNumberFormatterPattern( pad ) { + properties.numberFormatters[ pad ] = stringPad( "", pad ); + } + + if ( timeZone ) { + properties.timeZoneData = runtimeCacheDataBind( "iana/" + timeZone, { + offsets: cldr.get([ "globalize-iana/zoneData", timeZone, "offsets" ]), + untils: cldr.get([ "globalize-iana/zoneData", timeZone, "untils" ]), + isdsts: cldr.get([ "globalize-iana/zoneData", timeZone, "isdsts" ]) + }); + } + + pattern.replace( datePatternRe, function( current ) { + var aux, chr, daylightTzName, formatNumber, genericTzName, length, standardTzName; + + chr = current.charAt( 0 ); + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + properties.preferredTime = chr = cldr.supplemental.timeData.preferred(); + } + + // ZZZZ: same as "OOOO". + if ( chr === "Z" && length === 4 ) { + chr = "O"; + length = 4; + } + + // z...zzz: "{shortRegion}", eg. "PST" or "PDT". + // zzzz: "{regionName} {Standard Time}" or "{regionName} {Daylight Time}", + // e.g., "Pacific Standard Time" or "Pacific Daylight Time". + // http://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + if ( chr === "z" ) { + standardTzName = dateGetTimeZoneName( length, "standard", timeZone, cldr ); + daylightTzName = dateGetTimeZoneName( length, "daylight", timeZone, cldr ); + if ( standardTzName ) { + properties.standardTzName = standardTzName; + } + if ( daylightTzName ) { + properties.daylightTzName = daylightTzName; + } + + // Fall through the "O" format in case one name is missing. + if ( !standardTzName || !daylightTzName ) { + chr = "O"; + if ( length < 4 ) { + length = 1; + } + } + } + + // v...vvv: "{shortRegion}", eg. "PT". + // vvvv: "{regionName} {Time}" or "{regionName} {Time}", + // e.g., "Pacific Time" + // http://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + if ( chr === "v" ) { + genericTzName = dateGetTimeZoneName( length, "generic", timeZone, cldr ); + + // Fall back to "V" format. + if ( !genericTzName ) { + chr = "V"; + length = 4; + } + } + + switch ( chr ) { + + // Era + case "G": + properties.eras = cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + + // Plain year. + formatNumber = true; + break; + + case "Y": + + // Year in "Week of Year" + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + if ( !properties.quarters ) { + properties.quarters = {}; + } + if ( !properties.quarters[ chr ] ) { + properties.quarters[ chr ] = {}; + } + properties.quarters[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Month + case "M": + case "L": + if ( length > 2 ) { + if ( !properties.months ) { + properties.months = {}; + } + if ( !properties.months[ chr ] ) { + properties.months[ chr ] = {}; + } + properties.months[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Week - Week of Year (w) or Week of Month (W). + case "w": + case "W": + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + // Day + case "d": + case "D": + case "F": + formatNumber = true; + break; + + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + properties.firstDay = dateFirstDayOfWeek( cldr ); + formatNumber = true; + break; + } + + /* falls through */ + case "E": + if ( !properties.days ) { + properties.days = {}; + } + if ( !properties.days[ chr ] ) { + properties.days[ chr ] = {}; + } + if ( length === 6 ) { + + // If short day names are not explicitly specified, abbreviated day names are + // used instead. + // http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + // http://unicode.org/cldr/trac/ticket/6790 + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "abbreviated" + ]); + } else { + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + properties.dayPeriods = { + am: cldr.main( + "dates/calendars/gregorian/dayPeriods/format/wide/am" + ), + pm: cldr.main( + "dates/calendars/gregorian/dayPeriods/format/wide/pm" + ) + }; + break; + + // Hour + case "h": // 1-12 + case "H": // 0-23 + case "K": // 0-11 + case "k": // 1-24 + + // Minute + case "m": + + // Second + case "s": + case "S": + case "A": + formatNumber = true; + break; + + // Zone + case "v": + if ( length !== 1 && length !== 4 ) { + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + pattern + "`" + }); + } + properties.genericTzName = genericTzName; + break; + + case "V": + + if ( length === 1 ) { + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + pattern + "`" + }); + } + + if ( timeZone ) { + if ( length === 2 ) { + properties.timeZoneName = timeZone; + break; + } + + var timeZoneName, + exemplarCity = cldr.main([ + "dates/timeZoneNames/zone", timeZone, "exemplarCity" + ]); + + if ( length === 3 ) { + if ( !exemplarCity ) { + exemplarCity = cldr.main([ + "dates/timeZoneNames/zone/Etc/Unknown/exemplarCity" + ]); + } + timeZoneName = exemplarCity; + } + + if ( exemplarCity && length === 4 ) { + timeZoneName = formatMessage( + cldr.main( + "dates/timeZoneNames/regionFormat" + ), + [ exemplarCity ] + ); + } + + if ( timeZoneName ) { + properties.timeZoneName = timeZoneName; + break; + } + } + + if ( current === "v" ) { + length = 1; + } + + /* falls through */ + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + properties.gmtFormat = cldr.main( "dates/timeZoneNames/gmtFormat" ); + properties.gmtZeroFormat = cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + + // Unofficial deduction of the hourFormat variations. + // Official spec is pending resolution: http://unicode.org/cldr/trac/ticket/8293 + aux = cldr.main( "dates/timeZoneNames/hourFormat" ); + properties.hourFormat = length < 4 ? + [ dateTimezoneHourFormatH( aux ), dateTimezoneHourFormatHm( aux, "H" ) ] : + dateTimezoneHourFormatHm( aux, "HH" ); + + /* falls through */ + case "Z": + case "X": + case "x": + setNumberFormatterPattern( 1 ); + setNumberFormatterPattern( 2 ); + break; + } + + if ( formatNumber ) { + setNumberFormatterPattern( length ); + } + }); + + return properties; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/format.js new file mode 100644 index 000000000..18fe8480e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/format.js @@ -0,0 +1,360 @@ +define([ + "zoned-date-time", + "./day-of-week", + "./day-of-year", + "./fields-map", + "./milliseconds-in-day", + "./pattern-re", + "./start-of", + "./timezone-hour-format", + "./week-days", + "../common/parts/push", + "../util/remove-literal-quotes" +], function( ZonedDateTime, dateDayOfWeek, dateDayOfYear, dateFieldsMap, dateMillisecondsInDay, + datePatternRe, dateStartOf, dateTimezoneHourFormat, dateWeekDays, partsPush, + removeLiteralQuotes ) { + +/** + * format( date, properties ) + * + * @date [Date instance]. + * + * @properties + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +return function( date, numberFormatters, properties ) { + var parts = []; + + var timeSeparator = properties.timeSeparator; + + // create globalize date with given timezone data + if ( properties.timeZoneData ) { + date = new ZonedDateTime( date, properties.timeZoneData() ); + } + + properties.pattern.replace( datePatternRe, function( current ) { + var aux, dateField, type, value, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTime; + } + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + // z...zzz: "{shortRegion}", e.g., "PST" or "PDT". + // zzzz: "{regionName} {Standard Time}" or "{regionName} {Daylight Time}", + // e.g., "Pacific Standard Time" or "Pacific Daylight Time". + if ( chr === "z" ) { + if ( date.isDST ) { + value = date.isDST() ? properties.daylightTzName : properties.standardTzName; + } + + // Fall back to "O" format. + if ( !value ) { + chr = "O"; + if ( length < 4 ) { + length = 1; + } + } + } + + switch ( chr ) { + + // Era + case "G": + value = properties.eras[ date.getFullYear() < 0 ? 0 : 1 ]; + break; + + // Year + case "y": + + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + value = date.getFullYear(); + if ( length === 2 ) { + value = String( value ); + value = +value.substr( value.length - 2 ); + } + break; + + case "Y": + + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + value = new Date( date.getTime() ); + value.setDate( + value.getDate() + 7 - + dateDayOfWeek( date, properties.firstDay ) - + properties.firstDay - + properties.minDays + ); + value = value.getFullYear(); + if ( length === 2 ) { + value = String( value ); + value = +value.substr( value.length - 2 ); + } + break; + + // Quarter + case "Q": + case "q": + value = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length > 2 ) { + value = properties.quarters[ chr ][ length ][ value ]; + } + break; + + // Month + case "M": + case "L": + value = date.getMonth() + 1; + if ( length > 2 ) { + value = properties.months[ chr ][ length ][ value ]; + } + break; + + // Week + case "w": + + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + value = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); + value = Math.ceil( ( dateDayOfYear( date ) + value ) / 7 ) - + ( 7 - value >= properties.minDays ? 0 : 1 ); + break; + + case "W": + + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + value = dateDayOfWeek( dateStartOf( date, "month" ), properties.firstDay ); + value = Math.ceil( ( date.getDate() + value ) / 7 ) - + ( 7 - value >= properties.minDays ? 0 : 1 ); + break; + + // Day + case "d": + value = date.getDate(); + break; + + case "D": + value = dateDayOfYear( date ) + 1; + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + value = Math.floor( date.getDate() / 7 ) + 1; + break; + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + value = dateDayOfWeek( date, properties.firstDay ) + 1; + break; + } + + /* falls through */ + case "E": + value = dateWeekDays[ date.getDay() ]; + value = properties.days[ chr ][ length ][ value ]; + break; + + // Period (AM or PM) + case "a": + value = properties.dayPeriods[ date.getHours() < 12 ? "am" : "pm" ]; + break; + + // Hour + case "h": // 1-12 + value = ( date.getHours() % 12 ) || 12; + break; + + case "H": // 0-23 + value = date.getHours(); + break; + + case "K": // 0-11 + value = date.getHours() % 12; + break; + + case "k": // 1-24 + value = date.getHours() || 24; + break; + + // Minute + case "m": + value = date.getMinutes(); + break; + + // Second + case "s": + value = date.getSeconds(); + break; + + case "S": + value = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + break; + + case "A": + value = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + break; + + // Zone + case "z": + break; + + case "v": + + // v...vvv: "{shortRegion}", eg. "PT". + // vvvv: "{regionName} {Time}", + // e.g., "Pacific Time". + if ( properties.genericTzName ) { + value = properties.genericTzName; + break; + } + + /* falls through */ + case "V": + + //VVVV: "{explarCity} {Time}", e.g., "Los Angeles Time" + if ( properties.timeZoneName ) { + value = properties.timeZoneName; + break; + } + + if ( current === "v" ) { + length = 1; + } + + /* falls through */ + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + value = properties.gmtZeroFormat; + } else { + + // If O..OOO and timezone offset has non-zero minutes, show minutes. + if ( length < 4 ) { + aux = date.getTimezoneOffset(); + aux = properties.hourFormat[ aux % 60 - aux % 1 === 0 ? 0 : 1 ]; + } else { + aux = properties.hourFormat; + } + + value = dateTimezoneHourFormat( + date, + aux, + timeSeparator, + numberFormatters + ); + value = properties.gmtFormat.replace( /\{0\}/, value ); + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + value = "Z"; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH[mm];-HH[mm]") + // xx: hourFormat("+HHmm;-HHmm") + // xxx: hourFormat("+HH:mm;-HH:mm") + // xxxx: hourFormat("+HHmm[ss];-HHmm[ss]") + // xxxxx: hourFormat("+HH:mm[:ss];-HH:mm[:ss]") + aux = date.getTimezoneOffset(); + + // If x and timezone offset has non-zero minutes, use xx (i.e., show minutes). + if ( length === 1 && aux % 60 - aux % 1 !== 0 ) { + length += 1; + } + + // If (xxxx or xxxxx) and timezone offset has zero seconds, use xx or xxx + // respectively (i.e., don't show optional seconds). + if ( ( length === 4 || length === 5 ) && aux % 1 === 0 ) { + length -= 2; + } + + value = [ + "+HH;-HH", + "+HHmm;-HHmm", + "+HH:mm;-HH:mm", + "+HHmmss;-HHmmss", + "+HH:mm:ss;-HH:mm:ss" + ][ length - 1 ]; + + value = dateTimezoneHourFormat( date, value, ":" ); + break; + + // timeSeparator + case ":": + value = timeSeparator; + break; + + // ' literals. + case "'": + value = removeLiteralQuotes( current ); + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and + // arabic characters. + default: + value = current; + + } + if ( typeof value === "number" ) { + value = numberFormatters[ length ]( value ); + } + + dateField = dateFieldsMap[ chr ]; + type = dateField ? dateField : "literal"; + + partsPush( parts, type, value ); + }); + + return parts; + +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/formatter-fn.js new file mode 100644 index 000000000..224e5b147 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/formatter-fn.js @@ -0,0 +1,11 @@ +define([ + "../common/parts/join" +], function( partsJoin ) { + +return function( dateToPartsFormatter ) { + return function dateFormatter( value ) { + return partsJoin( dateToPartsFormatter( value )); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/get-time-zone-name.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/get-time-zone-name.js new file mode 100644 index 000000000..420b5b179 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/get-time-zone-name.js @@ -0,0 +1,39 @@ +define(function() { + +/** + * getTimeZoneName( length, type ) + */ +return function( length, type, timeZone, cldr ) { + var metaZone, result; + + if ( !timeZone ) { + return; + } + + result = cldr.main([ + "dates/timeZoneNames/zone", + timeZone, + length < 4 ? "short" : "long", + type + ]); + + if ( result ) { + return result; + } + + // The latest metazone data of the metazone array. + // TODO expand to support the historic metazones based on the given date. + metaZone = cldr.supplemental([ + "metaZones/metazoneInfo/timezone", timeZone, 0, + "usesMetazone/_mzone" + ]); + + return cldr.main([ + "dates/timeZoneNames/metazone", + metaZone, + length < 4 ? "short" : "long", + type + ]); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/is-leap-year.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/is-leap-year.js new file mode 100644 index 000000000..86ee8be60 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/is-leap-year.js @@ -0,0 +1,14 @@ +define(function() { + +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +return function( year ) { + return new Date( year, 1, 29 ).getMonth() === 1; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/last-day-of-month.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/last-day-of-month.js new file mode 100644 index 000000000..c5208b7ad --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/last-day-of-month.js @@ -0,0 +1,14 @@ +define(function() { + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +return function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/milliseconds-in-day.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/milliseconds-in-day.js new file mode 100644 index 000000000..99d60e7d0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/milliseconds-in-day.js @@ -0,0 +1,14 @@ +define([ + "./start-of" +], function( dateStartOf ) { + +/** + * millisecondsInDay + */ +return function( date ) { + + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parse-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parse-properties.js new file mode 100644 index 000000000..085bfd904 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parse-properties.js @@ -0,0 +1,30 @@ +define([ + "../common/runtime-cache-data-bind" +], function( runtimeCacheDataBind ) { + +/** + * parseProperties( cldr ) + * + * @cldr [Cldr instance]. + * + * @timeZone [String] FIXME. + * + * Return parser properties. + */ +return function( cldr, timeZone ) { + var properties = { + preferredTimeData: cldr.supplemental.timeData.preferred() + }; + + if ( timeZone ) { + properties.timeZoneData = runtimeCacheDataBind( "iana/" + timeZone, { + offsets: cldr.get([ "globalize-iana/zoneData", timeZone, "offsets" ]), + untils: cldr.get([ "globalize-iana/zoneData", timeZone, "untils" ]), + isdsts: cldr.get([ "globalize-iana/zoneData", timeZone, "isdsts" ]) + }); + } + + return properties; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parse.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parse.js new file mode 100644 index 000000000..d0af9cd8e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parse.js @@ -0,0 +1,301 @@ +define([ + "zoned-date-time", + "./is-leap-year", + "./last-day-of-month", + "./start-of", + "../common/create-error/unsupported-feature", + "../util/date/set-month", + "../util/out-of-range" +], function( ZonedDateTime, dateIsLeapYear, dateLastDayOfMonth, dateStartOf, + createErrorUnsupportedFeature, dateSetMonth, outOfRange ) { + +/** + * parse( value, tokens, properties ) + * + * @value [String] string date. + * + * @tokens [Object] tokens returned by date/tokenizer. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +return function( _value, tokens, properties ) { + var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + // Create globalize date with given timezone data. + if ( properties.timeZoneData ) { + date = new ZonedDateTime( date, properties.timeZoneData() ); + } + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTimeData; + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = token.value; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = token.value; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + + // Setting the month later so that we have the correct year and can determine + // the correct last day of February in case of leap year. + month = value; + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + day = token.value; + truncateAt.push( DAY ); + break; + + case "D": + daysOfYear = token.value; + truncateAt.push( DAY ); + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + // Week day + case "e": + case "c": + case "E": + + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = token.value; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = token.value; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = token.value; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = token.value; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + case "z": + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": + if ( typeof token.value === "number" ) { + timezoneOffset = token.value; + } + break; + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( month !== undefined ) { + dateSetMonth( date, month - 1 ); + } + + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth( 0 ); + date.setDate( daysOfYear ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + if ( timezoneOffset !== undefined ) { + date.setMinutes( date.getMinutes() + timezoneOffset - date.getTimezoneOffset() ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + // Get date back from globalize date. + if ( date instanceof ZonedDateTime ) { + date = date.toDate(); + } + + return date; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parser-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parser-fn.js new file mode 100644 index 000000000..3619d3f35 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/parser-fn.js @@ -0,0 +1,20 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/string", + "./parse", + "./tokenizer" +], function( validateParameterPresence, validateParameterTypeString, dateParse, dateTokenizer ) { + +return function( numberParser, parseProperties, tokenizerProperties ) { + return function dateParser( value ) { + var tokens; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); + return dateParse( value, tokens, parseProperties ) || null; + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/pattern-re.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/pattern-re.js new file mode 100644 index 000000000..0fe86386d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/pattern-re.js @@ -0,0 +1,5 @@ +define(function() { + +return ( /([a-z])\1*|'([^']|'')+'|''|./ig ); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/start-of.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/start-of.js new file mode 100644 index 000000000..3fdc58d82 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/start-of.js @@ -0,0 +1,38 @@ +define([ + "zoned-date-time" +], function( ZonedDateTime ) { + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +return function( date, unit ) { + date = date instanceof ZonedDateTime ? date.clone() : new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format.js new file mode 100644 index 000000000..d2b42b207 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format.js @@ -0,0 +1,53 @@ +define([ + "../util/string/pad" +], function( stringPad ) { + +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + * - "+HH:mm:ss;-HH:mm:ss": -03:00:00 + */ +return function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( Math.floor( absOffset % 60 ) ); + }) + + // Update minutes offset and return. + .replace( /ss/, function() { + return formatNumber[ 2 ]( Math.floor( absOffset % 1 * 60 ) ); + }); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format/h.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format/h.js new file mode 100644 index 000000000..a5ac0f9e6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format/h.js @@ -0,0 +1,26 @@ +define(function() { + +/** + * timezoneHourFormatShortH( hourFormat ) + * + * @hourFormat [String] + * + * Unofficial deduction of the short hourFormat given time zone `hourFormat` element. + * Official spec is pending resolution: http://unicode.org/cldr/trac/ticket/8293 + * + * Example: + * - "+HH.mm;-HH.mm" => "+H;-H" + * - "+HH:mm;-HH:mm" => "+H;-H" + * - "+HH:mm;−HH:mm" => "+H;−H" (Note MINUS SIGN \u2212) + * - "+HHmm;-HHmm" => "+H:-H" + */ +return function( hourFormat ) { + return hourFormat + .split( ";" ) + .map(function( format ) { + return format.slice( 0, format.indexOf( "H" ) + 1 ); + }) + .join( ";" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format/hm.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format/hm.js new file mode 100644 index 000000000..469d69b75 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/timezone-hour-format/hm.js @@ -0,0 +1,35 @@ +define(function() { + +/** + * timezoneHourFormatLongHm( hourFormat ) + * + * @hourFormat [String] + * + * Unofficial deduction of the short hourFormat given time zone `hourFormat` element. + * Official spec is pending resolution: http://unicode.org/cldr/trac/ticket/8293 + * + * Example (hFormat === "H"): (used for short Hm) + * - "+HH.mm;-HH.mm" => "+H.mm;-H.mm" + * - "+HH:mm;-HH:mm" => "+H:mm;-H:mm" + * - "+HH:mm;−HH:mm" => "+H:mm;−H:mm" (Note MINUS SIGN \u2212) + * - "+HHmm;-HHmm" => "+Hmm:-Hmm" + * + * Example (hFormat === "HH": (used for long Hm) + * - "+HH.mm;-HH.mm" => "+HH.mm;-HH.mm" + * - "+HH:mm;-HH:mm" => "+HH:mm;-HH:mm" + * - "+H:mm;-H:mm" => "+HH:mm;-HH:mm" + * - "+HH:mm;−HH:mm" => "+HH:mm;−HH:mm" (Note MINUS SIGN \u2212) + * - "+HHmm;-HHmm" => "+HHmm:-HHmm" + */ +return function( hourFormat, hFormat ) { + return hourFormat + .split( ";" ) + .map(function( format ) { + var parts = format.split( /H+/ ); + parts.splice( 1, 0, hFormat ); + return parts.join( "" ); + }) + .join( ";" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/to-parts-formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/to-parts-formatter-fn.js new file mode 100644 index 000000000..54da67d4d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/to-parts-formatter-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/date", + "./format" +], function( validateParameterPresence, validateParameterTypeDate, dateFormat ) { + +return function( numberFormatters, properties ) { + return function dateToPartsFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return dateFormat( value, numberFormatters, properties ); + }; + +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/tokenizer-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/tokenizer-properties.js new file mode 100644 index 000000000..34b7c8f2b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/tokenizer-properties.js @@ -0,0 +1,385 @@ +define([ + "./get-time-zone-name", + "./pattern-re", + "./timezone-hour-format/h", + "./timezone-hour-format/hm", + "../common/create-error/unsupported-feature", + "../common/format-message", + "../number/numbering-system-digits-map", + "../number/symbol", + "../util/is-plain-object", + "../util/loose-matching", + "../util/object/filter", + "../util/regexp/escape" +], function( dateGetTimeZoneName, datePatternRe, dateTimezoneHourFormatH, dateTimezoneHourFormatHm, + createErrorUnsupportedFeature, formatMessage, numberNumberingSystemDigitsMap, numberSymbol, + isPlainObject, looseMatching, objectFilter, regexpEscape ) { + +/** + * tokenizerProperties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * + * @cldr [Cldr instance]. + * + * Return Object with data that will be used by tokenizer. + */ +return function( pattern, cldr, timeZone ) { + var digitsReSource, + properties = { + pattern: looseMatching( pattern ) + }, + timeSeparator = numberSymbol( "timeSeparator", cldr ), + widths = [ "abbreviated", "wide", "narrow" ]; + + digitsReSource = numberNumberingSystemDigitsMap( cldr ); + digitsReSource = digitsReSource ? "[" + digitsReSource + "]" : "\\d"; + properties.digitsRe = new RegExp( digitsReSource ); + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, digitsReSource, timeSeparator ) { + var re; + + if ( !digitsReSource ) { + digitsReSource = "\\d"; + } + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm|ss/g, "((" + digitsReSource + "){2})" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + digitsReSource + "){1,2})" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( "^" + re ); + } + + function populateProperties( path, value ) { + + // Skip + var skipRe = /(timeZoneNames\/zone|supplemental\/metaZones|timeZoneNames\/metazone|timeZoneNames\/regionFormat|timeZoneNames\/gmtFormat)/; + if ( skipRe.test( path ) ) { + return; + } + + if ( !value ) { + return; + } + + // The `dates` and `calendars` trim's purpose is to reduce properties' key size only. + path = path.replace( /^.*\/dates\//, "" ).replace( /calendars\//, "" ); + + // Specific filter for "gregorian/dayPeriods/format/wide". + if ( path === "gregorian/dayPeriods/format/wide" ) { + value = objectFilter( value, /^am|^pm/ ); + } + + // Transform object into array of pairs [key, /value/], sort by desc value length. + if ( isPlainObject( value ) ) { + value = Object.keys( value ).map(function( key ) { + return [ key, new RegExp( "^" + regexpEscape( looseMatching( value[ key ] ) ) ) ]; + }).sort(function( a, b ) { + return b[ 1 ].source.length - a[ 1 ].source.length; + }); + + // If typeof value === "string". + } else { + value = looseMatching( value ); + } + properties[ path ] = value; + } + + function regexpSourceSomeTerm( terms ) { + return "(" + terms.filter(function( item ) { + return item; + }).reduce(function( memo, item ) { + return memo + "|" + item; + }) + ")"; + } + + cldr.on( "get", populateProperties ); + + pattern.match( datePatternRe ).forEach(function( current ) { + var aux, chr, daylightTzName, gmtFormat, length, standardTzName; + + chr = current.charAt( 0 ); + length = current.length; + + if ( chr === "Z" ) { + if ( length < 5 ) { + chr = "O"; + length = 4; + } else { + chr = "X"; + length = 5; + } + } + + // z...zzz: "{shortRegion}", eg. "PST" or "PDT". + // zzzz: "{regionName} {Standard Time}" or "{regionName} {Daylight Time}", + // e.g., "Pacific Standard Time" or "Pacific Daylight Time". + // http://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + if ( chr === "z" ) { + standardTzName = dateGetTimeZoneName( length, "standard", timeZone, cldr ); + daylightTzName = dateGetTimeZoneName( length, "daylight", timeZone, cldr ); + if ( standardTzName ) { + standardTzName = regexpEscape( looseMatching( standardTzName ) ); + } + if ( daylightTzName ) { + daylightTzName = regexpEscape( looseMatching( daylightTzName ) ); + } + if ( standardTzName || daylightTzName ) { + properties.standardOrDaylightTzName = new RegExp( + "^" + regexpSourceSomeTerm([ standardTzName, daylightTzName ]) + ); + } + + // Fall through the "O" format in case one name is missing. + if ( !standardTzName || !daylightTzName ) { + chr = "O"; + if ( length < 4 ) { + length = 1; + } + } + } + + // v...vvv: "{shortRegion}", eg. "PT". + // vvvv: "{regionName} {Time}" or "{regionName} {Time}", + // e.g., "Pacific Time" + // http://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + if ( chr === "v" ) { + if ( length !== 1 && length !== 4 ) { + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + pattern + "`" + }); + } + var genericTzName = dateGetTimeZoneName( length, "generic", timeZone, cldr ); + if ( genericTzName ) { + properties.genericTzName = new RegExp( + "^" + regexpEscape( looseMatching( genericTzName ) ) + ); + chr = "O"; + + // Fall back to "V" format. + } else { + chr = "V"; + length = 4; + } + } + + switch ( chr ) { + + // Era + case "G": + cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Day + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + + // lookup for length >=3. + if ( length <= 2 ) { + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + // eslint-disable-next-line no-unused-expressions + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + cldr.main( + "dates/calendars/gregorian/dayPeriods/format/wide" + ); + break; + + // Zone + case "V": + + if ( length === 1 ) { + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + pattern + "`" + }); + } + + if ( timeZone ) { + if ( length === 2 ) { + + // Skip looseMatching processing since timeZone is a canonical posix value. + properties.timeZoneName = timeZone; + properties.timeZoneNameRe = new RegExp( "^" + regexpEscape( timeZone ) ); + break; + } + + var timeZoneName, + exemplarCity = cldr.main([ + "dates/timeZoneNames/zone", timeZone, "exemplarCity" + ]); + + if ( length === 3 ) { + if ( !exemplarCity ) { + exemplarCity = cldr.main([ + "dates/timeZoneNames/zone/Etc/Unknown/exemplarCity" + ]); + } + timeZoneName = exemplarCity; + } + + if ( exemplarCity && length === 4 ) { + timeZoneName = formatMessage( + cldr.main( + "dates/timeZoneNames/regionFormat" + ), + [ exemplarCity ] + ); + } + + if ( timeZoneName ) { + timeZoneName = looseMatching( timeZoneName ); + properties.timeZoneName = timeZoneName; + properties.timeZoneNameRe = new RegExp( + "^" + regexpEscape( timeZoneName ) + ); + } + } + + if ( current === "v" ) { + length = 1; + } + + /* falls through */ + case "z": + case "O": + gmtFormat = cldr.main( "dates/timeZoneNames/gmtFormat" ); + cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + cldr.main( "dates/timeZoneNames/hourFormat" ); + properties[ "timeZoneNames/gmtZeroFormatRe" ] = + new RegExp( "^" + regexpEscape( properties[ "timeZoneNames/gmtZeroFormat" ] ) ); + aux = properties[ "timeZoneNames/hourFormat" ]; + properties[ "timeZoneNames/hourFormat" ] = ( + length < 4 ? + [ dateTimezoneHourFormatHm( aux, "H" ), dateTimezoneHourFormatH( aux ) ] : + [ dateTimezoneHourFormatHm( aux, "HH" ) ] + ).map(function( hourFormat ) { + return hourFormatRe( + hourFormat, + gmtFormat, + digitsReSource, + timeSeparator + ); + }); + + /* falls through */ + case "X": + case "x": + + // x: hourFormat("+HH[mm];-HH[mm]") + // xx: hourFormat("+HHmm;-HHmm") + // xxx: hourFormat("+HH:mm;-HH:mm") + // xxxx: hourFormat("+HHmm[ss];-HHmm[ss]") + // xxxxx: hourFormat("+HH:mm[:ss];-HH:mm[:ss]") + properties.x = [ + [ "+HHmm;-HHmm", "+HH;-HH" ], + [ "+HHmm;-HHmm" ], + [ "+HH:mm;-HH:mm" ], + [ "+HHmmss;-HHmmss", "+HHmm;-HHmm" ], + [ "+HH:mm:ss;-HH:mm:ss", "+HH:mm;-HH:mm" ] + ][ length - 1 ].map(function( hourFormat ) { + return hourFormatRe( hourFormat ); + }); + } + }); + + cldr.off( "get", populateProperties ); + + return properties; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/tokenizer.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/tokenizer.js new file mode 100644 index 000000000..2e8a0fc70 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/tokenizer.js @@ -0,0 +1,479 @@ +/* eslint-disable no-unused-expressions */ + +define([ + "./pattern-re", + "../util/loose-matching", + "../util/regexp/escape", + "../util/remove-literal-quotes" +], function( datePatternRe, looseMatching, regexpEscape, removeLiteralQuotes ) { + +/** + * tokenizer( value, numberParser, properties ) + * + * @value [String] string date. + * + * @numberParser [Function] + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +return function( value, numberParser, properties ) { + var digitsRe, valid, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + digitsRe = properties.digitsRe; + value = looseMatching( value ); + + valid = properties.pattern.match( datePatternRe ).every(function( current ) { + var aux, chr, length, numeric, tokenRe, + token = {}; + + function hourFormatParse( tokenRe, numberParser ) { + var aux, isPositive, + match = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !match ) { + return false; + } + + isPositive = match[ 1 ]; + + // hourFormat containing H only, e.g., `+H;-H` + if ( match.length < 6 ) { + aux = isPositive ? 1 : 3; + token.value = numberParser( match[ aux ] ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else if ( match.length < 10 ) { + aux = isPositive ? [ 1, 3 ] : [ 5, 7 ]; + token.value = numberParser( match[ aux[ 0 ] ] ) * 60 + + numberParser( match[ aux[ 1 ] ] ); + + // hourFormat containing H, m, and s e.g., `+HHmmss;-HHmmss` + } else { + aux = isPositive ? [ 1, 3, 5 ] : [ 7, 9, 11 ]; + token.value = numberParser( match[ aux[ 0 ] ] ) * 60 + + numberParser( match[ aux[ 1 ] ] ) + + numberParser( match[ aux[ 2 ] ] ) / 60; + } + + if ( isPositive ) { + token.value *= -1; + } + + return true; + } + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = digitsRe; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "^(" + digitsRe.source + "){1,2}" ); + } + } + + function oneOrTwoDigitsIfLengthOneOrTwo() { + if ( length === 1 || length === 2 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "^(" + digitsRe.source + "){1,2}" ); + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "^(" + digitsRe.source + "){2}" ); + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var array = properties[ path.join( "/" ) ]; + + if ( !array ) { + return null; + } + + // array of pairs [key, value] sorted by desc value length. + array.some(function( item ) { + var valueRe = item[ 1 ]; + if ( valueRe.test( value ) ) { + token.value = item[ 0 ]; + tokenRe = item[ 1 ]; + return true; + } + }); + return null; + } + + token.type = current; + chr = current.charAt( 0 ); + length = current.length; + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + if ( chr === "z" ) { + if ( properties.standardOrDaylightTzName ) { + token.value = null; + tokenRe = properties.standardOrDaylightTzName; + } + } + + // v...vvv: "{shortRegion}", eg. "PT". + // vvvv: "{regionName} {Time}" or "{regionName} {Time}", + // e.g., "Pacific Time" + // http://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + if ( chr === "v" ) { + if ( properties.genericTzName ) { + token.value = null; + tokenRe = properties.genericTzName; + + // Fall back to "V" format. + } else { + chr = "V"; + length = 4; + } + } + + if ( chr === "V" && properties.timeZoneName ) { + token.value = length === 2 ? properties.timeZoneName : null; + tokenRe = properties.timeZoneNameRe; + } + + switch ( chr ) { + + // Era + case "G": + lookup([ + "gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + numeric = true; + + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "^(" + digitsRe.source + ")+" ); + } else if ( length === 2 ) { + + // Lenient parsing: there's no year pattern to indicate non-zero-padded 2-digits + // year, so parser accepts both zero-padded and non-zero-padded for `yy`. + // + // Unicode equivalent to /\d\d?/ + tokenRe = new RegExp( "^(" + digitsRe.source + "){1,2}" ); + } else { + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "^(" + digitsRe.source + "){" + length + ",}" ); + } + break; + + // Quarter + case "Q": + case "q": + + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || + lookup([ + "gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + // + // Lenient parsing: skeleton "yMd" (i.e., one M) may include MM for the pattern, + // therefore parser accepts both zero-padded and non-zero-padded for M and MM. + // Similar for L. + oneOrTwoDigitsIfLengthOneOrTwo() || lookup([ + "gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day + case "D": + + // number {l,3}. + if ( length <= 3 ) { + + // Equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "^(" + digitsRe.source + "){" + length + ",3}" ); + } + break; + + case "W": + case "F": + + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + // Week day + case "e": + case "c": + + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "gregorian/dayPeriods/format/wide" + ]); + break; + + // Week + case "w": + + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + // Day, Hour, Minute, or Second + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + + // number l1:{1,2}, l2:{2}. + // + // Lenient parsing: + // - skeleton "hms" (i.e., one m) always includes mm for the pattern, i.e., it's + // impossible to use a different skeleton to parse non-zero-padded minutes, + // therefore parser accepts both zero-padded and non-zero-padded for m. Similar + // for seconds s. + // - skeleton "hms" (i.e., one h) may include h or hh for the pattern, i.e., it's + // impossible to use a different skeleton to parser non-zero-padded hours for some + // locales, therefore parser accepts both zero-padded and non-zero-padded for h. + // Similar for d (in skeleton yMd). + oneOrTwoDigitsIfLengthOneOrTwo(); + break; + + case "S": + + // number {l}. + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "^(" + digitsRe.source + "){" + length + "}" ); + break; + + case "A": + + // number {l+5}. + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "^(" + digitsRe.source + "){" + ( length + 5 ) + "}" ); + break; + + // Zone + case "v": + case "V": + case "z": + if ( tokenRe && tokenRe.test( value ) ) { + break; + } + if ( chr === "V" && length === 2 ) { + break; + } + + /* falls through */ + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = properties[ "timeZoneNames/gmtZeroFormatRe" ]; + } else { + aux = properties[ "timeZoneNames/hourFormat" ].some(function( hourFormatRe ) { + if ( hourFormatParse( hourFormatRe, numberParser ) ) { + tokenRe = hourFormatRe; + return true; + } + }); + if ( !aux ) { + return null; + } + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /^Z/; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH[mm];-HH[mm]") + // xx: hourFormat("+HHmm;-HHmm") + // xxx: hourFormat("+HH:mm;-HH:mm") + // xxxx: hourFormat("+HHmm[ss];-HHmm[ss]") + // xxxxx: hourFormat("+HH:mm[:ss];-HH:mm[:ss]") + aux = properties.x.some(function( hourFormatRe ) { + if ( hourFormatParse( hourFormatRe ) ) { + tokenRe = hourFormatRe; + return true; + } + }); + if ( !aux ) { + return null; + } + break; + + case "'": + token.type = "literal"; + tokenRe = new RegExp( "^" + regexpEscape( removeLiteralQuotes( current ) ) ); + break; + + default: + token.type = "literal"; + tokenRe = new RegExp( "^" + regexpEscape( current ) ); + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( tokenRe, function( lexeme ) { + token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + if ( numeric && isNaN( token.value ) ) { + return false; + } + + tokens.push( token ); + return true; + }); + + if ( value !== "" ) { + valid = false; + } + + return valid ? tokens : []; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/week-days.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/week-days.js new file mode 100644 index 000000000..2e0d4db3d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/date/week-days.js @@ -0,0 +1,5 @@ +define(function() { + +return [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message-runtime.js new file mode 100644 index 000000000..6880351de --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message-runtime.js @@ -0,0 +1,26 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-type/message-variables", + "./core-runtime", + "./message/formatter-fn" +], function( runtimeKey, validateParameterTypeMessageVariables, Globalize, messageFormatterFn ) { + +Globalize._messageFormatterFn = messageFormatterFn; +Globalize._messageFormat = {}; +Globalize._validateParameterTypeMessageVariables = validateParameterTypeMessageVariables; + +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( /* path */ ) { + return Globalize[ + runtimeKey( "messageFormatter", this._locale, [].slice.call( arguments, 0 ) ) + ]; +}; + +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, [].slice.call( arguments, 1 ) ); +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message.js new file mode 100644 index 000000000..2c3305727 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message.js @@ -0,0 +1,115 @@ +define([ + "cldr", + "messageformat", + "./common/create-error/plural-module-presence", + "./common/runtime-bind", + "./common/validate/default-locale", + "./common/validate/message-bundle", + "./common/validate/message-presence", + "./common/validate/message-type", + "./common/validate/parameter-presence", + "./common/validate/parameter-type", + "./common/validate/parameter-type/plain-object", + "./core", + "./message/formatter-fn", + "./message/formatter-runtime-bind", + "./util/always-array", + + "cldr/event" +], function( Cldr, MessageFormat, createErrorPluralModulePresence, runtimeBind, + validateDefaultLocale, validateMessageBundle, validateMessagePresence, validateMessageType, + validateParameterPresence, validateParameterType, validateParameterTypePlainObject, Globalize, + messageFormatterFn, messageFormatterRuntimeBind, alwaysArray ) { + +var slice = [].slice; + +/** + * .loadMessages( json ) + * + * @json [JSON] + * + * Load translation data. + */ +Globalize.loadMessages = function( json ) { + var locale, + customData = { + "globalize-messages": json, + "main": {} + }; + + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); + + // Set available bundles by populating customData main dataset. + for ( locale in json ) { + if ( json.hasOwnProperty( locale ) ) { + customData.main[ locale ] = {}; + } + } + + Cldr.load( customData ); +}; + +/** + * .messageFormatter( path ) + * + * @path [String or Array] + * + * Format a message given its path. + */ +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( path ) { + var cldr, formatter, message, pluralGenerator, returnFn, + args = slice.call( arguments, 0 ); + + validateParameterPresence( path, "path" ); + validateParameterType( path, "path", typeof path === "string" || Array.isArray( path ), + "a String nor an Array" ); + + path = alwaysArray( path ); + cldr = this.cldr; + + validateDefaultLocale( cldr ); + validateMessageBundle( cldr ); + + message = cldr.get( [ "globalize-messages/{bundle}" ].concat( path ) ); + validateMessagePresence( path, message ); + + // If message is an Array, concatenate it. + if ( Array.isArray( message ) ) { + message = message.join( " " ); + } + validateMessageType( path, message ); + + // Is plural module present? Yes, use its generator. Nope, use an error generator. + pluralGenerator = this.plural !== undefined ? + this.pluralGenerator() : + createErrorPluralModulePresence; + + formatter = new MessageFormat( cldr.locale, pluralGenerator ).compile( message ); + + returnFn = messageFormatterFn( formatter ); + + runtimeBind( args, cldr, returnFn, + [ messageFormatterRuntimeBind( cldr, formatter ), pluralGenerator ] ); + + return returnFn; +}; + +/** + * .formatMessage( path [, variables] ) + * + * @path [String or Array] + * + * @variables [Number, String, Array or Object] + * + * Format a message given its path. + */ +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, slice.call( arguments, 1 ) ); +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message/formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message/formatter-fn.js new file mode 100644 index 000000000..720f481cb --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message/formatter-fn.js @@ -0,0 +1,15 @@ +define([ + "../common/validate/parameter-type/message-variables" +], function( validateParameterTypeMessageVariables ) { + +return function( formatter ) { + return function messageFormatter( variables ) { + if ( typeof variables === "number" || typeof variables === "string" ) { + variables = [].slice.call( arguments, 0 ); + } + validateParameterTypeMessageVariables( variables, "variables" ); + return formatter( variables ); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message/formatter-runtime-bind.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message/formatter-runtime-bind.js new file mode 100644 index 000000000..c2b285d65 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/message/formatter-runtime-bind.js @@ -0,0 +1,46 @@ +define(function() { + +return function( cldr, messageformatter ) { + var locale = cldr.locale, + origToString = messageformatter.toString; + + messageformatter.toString = function() { + var argNames, argValues, output, + args = {}; + + // Properly adjust SlexAxton/messageformat.js compiled variables with Globalize variables: + output = origToString.call( messageformatter ); + + if ( /number\(/.test( output ) ) { + args.number = "messageFormat.number"; + } + + if ( /plural\(/.test( output ) ) { + args.plural = "messageFormat.plural"; + } + + if ( /select\(/.test( output ) ) { + args.select = "messageFormat.select"; + } + + output.replace( /pluralFuncs(\[([^\]]+)\]|\.([a-zA-Z]+))/, function( match ) { + args.pluralFuncs = "{" + + "\"" + locale + "\": Globalize(\"" + locale + "\").pluralGenerator()" + + "}"; + return match; + }); + + argNames = Object.keys( args ).join( ", " ); + argValues = Object.keys( args ).map(function( key ) { + return args[ key ]; + }).join( ", " ); + + return "(function( " + argNames + " ) {\n" + + " return " + output + "\n" + + "})(" + argValues + ")"; + }; + + return messageformatter; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number-runtime.js new file mode 100644 index 000000000..872580a50 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number-runtime.js @@ -0,0 +1,87 @@ +define([ + "./common/runtime-key", + "./common/create-error/unsupported-feature", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/string", + "./core-runtime", + "./number/format", + "./number/formatter-fn", + "./number/parse", + "./number/parser-fn", + "./number/to-parts-formatter-fn", + "./util/loose-matching", + "./util/number/round", + "./util/remove-literal-quotes" +], function( runtimeKey, createErrorUnsupportedFeature, validateParameterPresence, + validateParameterTypeNumber, validateParameterTypeString, Globalize, numberFormat, + numberFormatterFn, numberParse, numberParserFn, numberToPartsFormatterFn, looseMatching, + numberRound, removeLiteralQuotes ) { + +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._looseMatching = looseMatching; +Globalize._numberFormat = numberFormat; +Globalize._numberFormatterFn = numberFormatterFn; +Globalize._numberParse = numberParse; +Globalize._numberParserFn = numberParserFn; +Globalize._numberRound = numberRound; +Globalize._numberToPartsFormatterFn = numberToPartsFormatterFn; +Globalize._removeLiteralQuotes = removeLiteralQuotes; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +// Stamp runtimeKey and return cached fn. +// Note, this function isn't made common to all formatters and parsers, because in practice this is +// only used (at the moment) for numberFormatter used by unitFormatter. +// TODO: Move this function into a common place when this is used by different formatters. +function cached( runtimeKey ) { + Globalize[ runtimeKey ].runtimeKey = runtimeKey; + return Globalize[ runtimeKey ]; +} + +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + options = options || {}; + return cached( runtimeKey( "numberFormatter", this._locale, [ options ] ) ); +}; + +Globalize.numberToPartsFormatter = +Globalize.prototype.numberToPartsFormatter = function( options ) { + options = options || {}; + return cached( runtimeKey( "numberToPartsFormatter", this._locale, [ options ] ) ); +}; + +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +Globalize.formatNumberToParts = +Globalize.prototype.formatNumberToParts = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number.js new file mode 100644 index 000000000..b132b7ee5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number.js @@ -0,0 +1,246 @@ +define([ + "./core", + "./common/create-error/unsupported-feature", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-range", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/string", + "./number/formatter-fn", + "./number/format-properties", + "./number/numbering-system", + "./number/numbering-system-digits-map", + "./number/parser-fn", + "./number/parse-properties", + "./number/pattern", + "./number/symbol", + "./number/to-parts-formatter-fn", + "./util/loose-matching", + "./util/remove-literal-quotes", + "./util/string/pad", + + "cldr/event", + "cldr/supplemental" +], function( Globalize, createErrorUnsupportedFeature, runtimeBind, validateCldr, + validateDefaultLocale, validateParameterPresence, validateParameterRange, + validateParameterTypeNumber, validateParameterTypePlainObject, validateParameterTypeString, + numberFormatterFn, numberFormatProperties, numberNumberingSystem, + numberNumberingSystemDigitsMap, numberParserFn, numberParseProperties, numberPattern, + numberSymbol, numberToPartsFormatterFn, looseMatching, removeLiteralQuotes, stringPad ) { + +function validateDigits( properties ) { + var minimumIntegerDigits = properties[ 2 ], + minimumFractionDigits = properties[ 3 ], + maximumFractionDigits = properties[ 4 ], + minimumSignificantDigits = properties[ 5 ], + maximumSignificantDigits = properties[ 6 ]; + + // Validate significant digit format properties + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + validateParameterRange( minimumSignificantDigits, "minimumSignificantDigits", 1, 21 ); + validateParameterRange( maximumSignificantDigits, "maximumSignificantDigits", + minimumSignificantDigits, 21 ); + + } else if ( !isNaN( minimumSignificantDigits ) || !isNaN( maximumSignificantDigits ) ) { + throw new Error( "Neither or both the minimum and maximum significant digits must be " + + "present" ); + + // Validate integer and fractional format + } else { + validateParameterRange( minimumIntegerDigits, "minimumIntegerDigits", 1, 21 ); + validateParameterRange( minimumFractionDigits, "minimumFractionDigits", 0, 20 ); + validateParameterRange( maximumFractionDigits, "maximumFractionDigits", + minimumFractionDigits, 20 ); + } +} + +/** + * .numberFormatter( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * - see also number/format options. + * + * Return a function that formats a number according to the given options and default/instance + * locale. + */ +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + var args, numberToPartsFormatter, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + args = [ options ]; + + numberToPartsFormatter = this.numberToPartsFormatter( options ); + returnFn = numberFormatterFn( numberToPartsFormatter ); + runtimeBind( args, this.cldr, returnFn, [ numberToPartsFormatter ] ); + + return returnFn; +}; + +/** + * .numberToPartsFormatter( [options] ) + * + * @options [Object]: + * - style: [String] "symbol" (default), "accounting", "code" or "name". + * - see also number/format options. + * + * Return a function that formats a number to parts according to the given options and + * default/instance locale. + */ +Globalize.numberToPartsFormatter = +Globalize.prototype.numberToPartsFormatter = function( options ) { + var args, cldr, fnArgs, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + try { + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberFormatProperties( pattern, cldr, options ); + fnArgs = [ properties ]; + } finally { + cldr.off( "get", validateCldr ); + } + + validateDigits( properties ); + + if ( options.compact ) { + fnArgs.push( this.pluralGenerator() ); + } + returnFn = numberToPartsFormatterFn.apply( null, fnArgs ); + runtimeBind( args, cldr, returnFn, fnArgs ); + + return returnFn; +}; + +/** + * .numberParser( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * + * Return the number parser according to the default/instance locale. + */ +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + if ( options.compact ) { + throw createErrorUnsupportedFeature({ + feature: "compact number parsing (not implemented)" + }); + } + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberParseProperties( pattern, cldr, options ); + + cldr.off( "get", validateCldr ); + + returnFn = numberParserFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .formatNumber( value [, options] ) + * + * @value [Number] number to be formatted. + * + * @options [Object]: see number/format-properties. + * + * Format a number according to the given options and default/instance locale. + */ +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +/** + * .formatNumberToParts( value [, options] ) + * + * @value [Number] number to be formatted. + * + * @options [Object]: see number/format-properties. + * + * Format a number to pars according to the given options and default/instance locale. + */ +Globalize.formatNumberToParts = +Globalize.prototype.formatNumberToParts = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberToPartsFormatter( options )( value ); +}; + +/** + * .parseNumber( value [, options] ) + * + * @value [String] + * + * @options [Object]: See numberParser(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + */ +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberNumberingSystem = numberNumberingSystem; +Globalize._numberNumberingSystemDigitsMap = numberNumberingSystemDigitsMap; +Globalize._numberPattern = numberPattern; +Globalize._numberSymbol = numberSymbol; +Globalize._looseMatching = looseMatching; +Globalize._removeLiteralQuotes = removeLiteralQuotes; +Globalize._stringPad = stringPad; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/compact-pattern-re.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/compact-pattern-re.js new file mode 100644 index 000000000..dc4840ad7 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/compact-pattern-re.js @@ -0,0 +1,21 @@ +define(function() { + +/** + * EBNF representation: + * + * compact_pattern_re = prefix? + * number_pattern_re + * suffix? + * + * number_pattern_re = 0+ + * + * Regexp groups: + * + * 0: compact_pattern_re + * 1: prefix + * 2: number_pattern_re (the number pattern to use in compact mode) + * 3: suffix + */ +return ( /^([^0]*)(0+)([^0]*)$/ ); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/compact.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/compact.js new file mode 100644 index 000000000..24771ca79 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/compact.js @@ -0,0 +1,37 @@ +define([ + "./numbering-system" +], function( numberNumberingSystem ) { + +/** + * Compact( name, cldr ) + * + * @compactType [String] Compact mode, `short` or `long`. + * + * @cldr [Cldr instance]. + * + * Return the localized compact map for the given compact mode. + */ +return function( compactType, cldr ) { + var maxExponent = 0; + + var object = cldr.main([ + "numbers/decimalFormats-numberSystem-" + numberNumberingSystem( cldr ), + compactType, + "decimalFormat" + ]); + + object = Object.keys( object ).reduce(function( newObject, compactKey ) { + var numberExponent = compactKey.split( "0" ).length - 1; + var pluralForm = compactKey.split( "-" )[ 2 ]; + newObject[ numberExponent ] = newObject[ numberExponent ] || {}; + newObject[ numberExponent ][ pluralForm ] = object[ compactKey ]; + maxExponent = Math.max( numberExponent, maxExponent ); + return newObject; + }, {}); + + object.maxExponent = maxExponent; + + return object; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format-properties.js new file mode 100644 index 000000000..7310a3e9a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format-properties.js @@ -0,0 +1,121 @@ +define([ + "./compact", + "./numbering-system-digits-map", + "./pattern-properties", + "./symbol", + "./symbol/map", + "../util/number/round" +], function( numberCompact, numberNumberingSystemDigitsMap, numberPatternProperties, numberSymbol, + numberSymbolMap, numberRound ) { + +/** + * formatProperties( pattern, cldr [, options] ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * @options [Object]: + * - minimumIntegerDigits [Number] + * - minimumFractionDigits, maximumFractionDigits [Number] + * - minimumSignificantDigits, maximumSignificantDigits [Number] + * - round [String] "ceil", "floor", "round" (default), or "truncate". + * - useGrouping [Boolean] default true. + * + * Return the processed properties that will be used in number/format. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( pattern, cldr, options ) { + var negativePattern, negativePrefix, negativeProperties, negativeSuffix, positivePattern, + roundFn, properties; + + function getOptions( attribute, propertyIndex ) { + if ( attribute in options ) { + properties[ propertyIndex ] = options[ attribute ]; + } + } + + options = options || {}; + pattern = pattern.split( ";" ); + + positivePattern = pattern[ 0 ]; + + negativePattern = pattern[ 1 ] || "-" + positivePattern; + negativeProperties = numberPatternProperties( negativePattern ); + negativePrefix = negativeProperties[ 0 ]; + negativeSuffix = negativeProperties[ 10 ]; + + // Have runtime code to refer to numberRound() instead of including it explicitly. + roundFn = numberRound( options.round ); + roundFn.generatorString = function() { + return "numberRound(" + ( options.round ? "\"" + options.round + "\"" : "" ) + ")"; + }; + + properties = numberPatternProperties( positivePattern ).concat([ + positivePattern, + negativePrefix + positivePattern + negativeSuffix, + negativePrefix, + negativeSuffix, + roundFn, + numberSymbol( "infinity", cldr ), + numberSymbol( "nan", cldr ), + numberSymbolMap( cldr ), + numberNumberingSystemDigitsMap( cldr ) + ]); + + if ( options.compact ) { + + // The compact digits number pattern is always `0+`, so override the following properties. + // Note: minimumIntegerDigits would actually range from `0` to `000` based on the scale of + // the value to be formatted, though we're always using 1 as a simplification, because the + // number won't be zero-padded since we chose the right format based on the scale, i.e., + // we'd never see something like `003M` anyway. + properties[ 2 ] = 1; // minimumIntegerDigits + properties[ 3 ] = 0; // minimumFractionDigits + properties[ 4 ] = 0; // maximumFractionDigits + properties[ 5 ] = // minimumSignificantDigits & + properties[ 6 ] = undefined; // maximumSignificantDigits + + properties[ 20 ] = numberCompact( options.compact, cldr ); + } + + getOptions( "minimumIntegerDigits", 2 ); + getOptions( "minimumFractionDigits", 3 ); + getOptions( "maximumFractionDigits", 4 ); + getOptions( "minimumSignificantDigits", 5 ); + getOptions( "maximumSignificantDigits", 6 ); + + // Grouping separators + if ( options.useGrouping === false ) { + properties[ 8 ] = null; + } + + // Normalize number of digits if only one of either minimumFractionDigits or + // maximumFractionDigits is passed in as an option + if ( "minimumFractionDigits" in options && !( "maximumFractionDigits" in options ) ) { + + // maximumFractionDigits = Math.max( minimumFractionDigits, maximumFractionDigits ); + properties[ 4 ] = Math.max( properties[ 3 ], properties[ 4 ] ); + } else if ( !( "minimumFractionDigits" in options ) && + "maximumFractionDigits" in options ) { + + // minimumFractionDigits = Math.min( minimumFractionDigits, maximumFractionDigits ); + properties[ 3 ] = Math.min( properties[ 3 ], properties[ 4 ] ); + } + + // Return: + // 0-10: see number/pattern-properties. + // 11: @positivePattern [String] Positive pattern. + // 12: @negativePattern [String] Negative pattern. + // 13: @negativePrefix [String] Negative prefix. + // 14: @negativeSuffix [String] Negative suffix. + // 15: @round [Function] Round function. + // 16: @infinitySymbol [String] Infinity symbol. + // 17: @nanSymbol [String] NaN symbol. + // 18: @symbolMap [Object] A bunch of other symbols. + // 19: @nuDigitsMap [Array] Digits map if numbering system is different than `latn`. + // 20: @compactMap [Object] Map of per-digit-count format patterns for specified compact mode. + return properties; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format.js new file mode 100644 index 000000000..6e7e06c2a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format.js @@ -0,0 +1,220 @@ +define([ + "./compact-pattern-re", + "./format/grouping-separator", + "./format/integer-fraction-digits", + "./format/significant-digits", + "./symbol/name", + "../common/parts/push", + "../util/remove-literal-quotes" +], function( numberCompactPatternRe, numberFormatGroupingSeparator, + numberFormatIntegerFractionDigits, numberFormatSignificantDigits, + numberSymbolName, partsPush, removeLiteralQuotes ) { + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( number, properties, pluralGenerator ) { + var aux, compactMap, infinitySymbol, maximumFractionDigits, maximumSignificantDigits, + minimumFractionDigits, minimumIntegerDigits, minimumSignificantDigits, nanSymbol, + nuDigitsMap, prefix, primaryGroupingSize, pattern, round, roundIncrement, + secondaryGroupingSize, stringToParts, suffix, symbolMap; + + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + compactMap = properties[ 20 ]; + + // NaN + if ( isNaN( number ) ) { + return [ { type: "nan", value: nanSymbol } ]; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // For prefix, suffix, and number parts. + stringToParts = function( string ) { + var numberType = "integer", + parts = []; + + // TODO Move the tokenization of all parts that don't depend on number into + // format-properties. + string.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + partsPush( parts, "literal", removeLiteralQuotes( literal ) ); + return; + } + + // Currency symbol + if ( character === "\u00A4" ) { + partsPush( parts, "currency", character ); + return; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + if ( symbol === "." ) { + numberType = "fraction"; + } + partsPush( parts, numberSymbolName[ symbol ], symbolMap[ symbol ] ); + + // "Erase" handled character. + return ""; + }); + + // Number + character = character.replace( /[0-9]/, function( digit ) { + + // Numbering system + if ( nuDigitsMap ) { + digit = nuDigitsMap[ +digit ]; + } + partsPush( parts, numberType, digit ); + + // "Erase" handled character. + return ""; + }); + + // Etc + character.replace( /./, function( etc ) { + partsPush( parts, "literal", etc ); + }); + }); + return parts; + }; + + prefix = stringToParts( prefix ); + suffix = stringToParts( suffix ); + + // Infinity + if ( !isFinite( number ) ) { + return prefix.concat( + { type: "infinity", value: infinitySymbol }, + suffix + ); + } + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + var compactPattern, compactDigits, compactProperties, divisor, numberExponent, pluralForm; + + // Compact mode: initial number digit processing + if ( compactMap ) { + numberExponent = Math.abs( Math.floor( number ) ).toString().length - 1; + numberExponent = Math.min( numberExponent, compactMap.maxExponent ); + + // Use default plural form to perform initial decimal shift + if ( numberExponent >= 3 ) { + compactPattern = compactMap[ numberExponent ] && compactMap[ numberExponent ].other; + } + + if ( compactPattern === "0" ) { + compactPattern = null; + } else if ( compactPattern ) { + compactDigits = compactPattern.split( "0" ).length - 1; + divisor = numberExponent - ( compactDigits - 1 ); + number = number / Math.pow( 10, divisor ); + } + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Compact mode: apply formatting + if ( compactMap && compactPattern ) { + + // Get plural form after possible roundings + pluralForm = pluralGenerator ? pluralGenerator( +number ) : "other"; + + compactPattern = compactMap[ numberExponent ][ pluralForm ] || compactPattern; + compactProperties = compactPattern.match( numberCompactPatternRe ); + + // TODO Move the tokenization of all parts that don't depend on number into + // format-properties. + aux = function( string ) { + var parts = []; + string.replace( /(\s+)|([^\s0]+)/g, function( _garbage, space, compact ) { + + // Literals + if ( space ) { + partsPush( parts, "literal", space ); + return; + } + + // Compact value + if ( compact ) { + partsPush( parts, "compact", compact ); + return; + } + }); + return parts; + }; + + // update prefix/suffix with compact prefix/suffix + prefix = prefix.concat( aux( compactProperties[ 1 ] ) ); + suffix = aux( compactProperties[ 3 ] ).concat( suffix ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + return prefix.concat( + stringToParts( number ), + suffix + ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/grouping-separator.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/grouping-separator.js new file mode 100644 index 000000000..0cb013a28 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/grouping-separator.js @@ -0,0 +1,38 @@ +define(function() { + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +return function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/integer-fraction-digits.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/integer-fraction-digits.js new file mode 100644 index 000000000..7650117c7 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/integer-fraction-digits.js @@ -0,0 +1,76 @@ +define([ + "../../util/string/pad" +], function( stringPad ) { + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +return function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + } else { + number = round( number ); + } + + number = String( number ); + + // Maximum integer digits (post string phase) + if ( maximumFractionDigits && /e-/.test( number ) ) { + + // Use toFixed( maximumFractionDigits ) to make sure small numbers like 1e-7 are + // displayed using plain digits instead of scientific notation. + // 1: Remove leading decimal zeros. + // 2: Remove leading decimal separator. + // Note: String() is still preferred so it doesn't mess up with a number precision + // unnecessarily, e.g., (123456789.123).toFixed(10) === "123456789.1229999959", + // String(123456789.123) === "123456789.123". + number = ( +number ).toFixed( maximumFractionDigits ) + .replace( /0+$/, "" ) /* 1 */ + .replace( /\.$/, "" ); /* 2 */ + } + + // Minimum fraction digits (post string phase) + if ( minimumFractionDigits ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/significant-digits.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/significant-digits.js new file mode 100644 index 000000000..343e23886 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/format/significant-digits.js @@ -0,0 +1,53 @@ +define([ + "../../common/create-error/unsupported-feature", + "../../util/number/to-precision", + "../../util/string/pad" +], function( createErrorUnsupportedFeature, numberToPrecision, stringPad ) { + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +return function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( ( /e/ ).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/formatter-fn.js new file mode 100644 index 000000000..0b16ef704 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/formatter-fn.js @@ -0,0 +1,11 @@ +define([ + "../common/parts/join" +], function( partsJoin ) { + +return function( numberToPartsFormatter ) { + return function numberFormatter( value ) { + return partsJoin( numberToPartsFormatter( value )); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/numbering-system-digits-map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/numbering-system-digits-map.js new file mode 100644 index 000000000..cfdd1ef03 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/numbering-system-digits-map.js @@ -0,0 +1,30 @@ +define([ + "./numbering-system", + "../common/create-error/unsupported-feature" +], function( numberNumberingSystem, createErrorUnsupportedFeature ) { + +/** + * nuMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return digits map if numbering system is different than `latn`. + */ +return function( cldr ) { + var aux, + nu = numberNumberingSystem( cldr ); + + if ( nu === "latn" ) { + return; + } + + aux = cldr.supplemental([ "numberingSystems", nu ]); + + if ( aux._type !== "numeric" ) { + throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" ); + } + + return aux._digits; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/numbering-system.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/numbering-system.js new file mode 100644 index 000000000..020a3c2dc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/numbering-system.js @@ -0,0 +1,32 @@ +define(function() { + +/** + * NumberingSystem( cldr ) + * + * - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems + * - http://cldr.unicode.org/index/bcp47-extension + * - http://www.unicode.org/reports/tr35/#u_Extension + */ +return function( cldr ) { + var nu = cldr.attributes[ "u-nu" ]; + + if ( nu ) { + if ( nu === "traditio" ) { + nu = "traditional"; + } + if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) { + + // Unicode locale extension `u-nu` is set using either (native, traditional or + // finance). So, lookup the respective locale's numberingSystem and return it. + return cldr.main([ "numbers/otherNumberingSystems", nu ]); + } + + // Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it. + return nu; + } + + // Return the default numberingSystem. + return cldr.main( "numbers/defaultNumberingSystem" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parse-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parse-properties.js new file mode 100644 index 000000000..c8a52acfc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parse-properties.js @@ -0,0 +1,154 @@ +define([ + "./format-properties", + "./symbol/inverted-map", + "../util/loose-matching", + "../util/object/map", + "../util/regexp/escape", + "../util/remove-literal-quotes" +], function( numberFormatProperties, numberSymbolInvertedMap, looseMatching, objectMap, + regexpEscape, removeLiteralQuotes ) { + +/** + * parseProperties( pattern, cldr ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * Return parser properties, used to feed parser function. + * + * TODO: + * - Scientific_notation; + * - Padding; + */ +return function( pattern, cldr, options ) { + var aux, decimalSymbolRe, digitsRe, groupingSeparatorRe, infinitySymbol, invertedNuDigitsMap, + invertedSymbolMap, maximumFractionDigits, maximumSignificantDigits, + minimumSignificantDigits, nanSymbol, negativePrefix, negativeSuffix, nuDigitsMap, + numberTokenizer, prefix, primaryGroupingSize, secondaryGroupingSize, suffix, symbolMap, + formatProperties = numberFormatProperties( pattern, cldr, options ); + + prefix = looseMatching( formatProperties[ 0 ] ); + maximumFractionDigits = formatProperties[ 4 ]; + minimumSignificantDigits = formatProperties[ 5 ]; + maximumSignificantDigits = formatProperties[ 6 ]; + primaryGroupingSize = formatProperties[ 8 ]; + secondaryGroupingSize = formatProperties[ 9 ]; + suffix = looseMatching( formatProperties[ 10 ] ); + negativePrefix = looseMatching( formatProperties[ 13 ] ); + negativeSuffix = looseMatching( formatProperties[ 14 ] ); + infinitySymbol = looseMatching( formatProperties[ 16 ] ); + nanSymbol = looseMatching( formatProperties[ 17 ] ); + symbolMap = objectMap( formatProperties[ 18 ], function( pair ) { + return [ pair[ 0 ], looseMatching( pair[ 1 ] ) ]; + }); + nuDigitsMap = formatProperties[ 19 ]; + + invertedSymbolMap = objectMap( numberSymbolInvertedMap( cldr ), function( pair ) { + return [ looseMatching( pair[ 0 ] ), pair[ 1 ] ]; + }); + + digitsRe = nuDigitsMap ? "[" + nuDigitsMap + "]" : "\\d"; + groupingSeparatorRe = regexpEscape( symbolMap[ "," ] ); + decimalSymbolRe = regexpEscape( symbolMap[ "." ] ); + + if ( nuDigitsMap ) { + invertedNuDigitsMap = nuDigitsMap.split( "" ).reduce(function( object, localizedDigit, i ) { + object[ localizedDigit ] = String( i ); + return object; + }, {} ); + } + + aux = [ prefix, suffix, negativePrefix, negativeSuffix ].map(function( value ) { + return value.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + return removeLiteralQuotes( literal ); + } + + // Symbols + character = character.replace( /[\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + return character; + }); + }); + + prefix = aux[ 0 ]; + suffix = aux[ 1 ]; + negativePrefix = aux[ 2 ]; + negativeSuffix = aux[ 3 ]; + + // Number + // + // number_re = integer fraction? + // + // integer = digits | digits_using_grouping_separators + // + // fraction = regexp((.\d+)?) + // + // digits = regexp(\d+) + // + // digits_w_grouping_separators = digits_w_1_grouping_separators | + // digits_w_2_grouping_separators + // + // digits_w_1_grouping_separators = regexp(\d{1,3}(,\d{3})+) + // + // digits_w_2_grouping_separators = regexp(\d{1,2}((,\d{2})*(,\d{3}))) + + // Integer part + numberTokenizer = digitsRe + "+"; + + // Grouping separators + if ( primaryGroupingSize ) { + if ( secondaryGroupingSize ) { + aux = digitsRe + "{1," + secondaryGroupingSize + "}((" + groupingSeparatorRe + + digitsRe + "{" + secondaryGroupingSize + "})*(" + groupingSeparatorRe + + digitsRe + "{" + primaryGroupingSize + "}))"; + } else { + aux = digitsRe + "{1," + primaryGroupingSize + "}(" + groupingSeparatorRe + + digitsRe + "{" + primaryGroupingSize + "})+"; + } + numberTokenizer = "(" + aux + "|" + numberTokenizer + ")"; + } + + // Fraction part? Only included if 1 or 2. + // 1: Using significant digit format. + // 2: Using integer and fractional format && it has a maximumFractionDigits. + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) || /* 1 */ + maximumFractionDigits /* 2 */ ) { + + // 1: Handle trailing decimal separator, e.g., `"1." => `1``. + aux = decimalSymbolRe + digitsRe + "+"; + numberTokenizer = numberTokenizer + "(" + aux + "|" + decimalSymbolRe /* 1 */ + ")?" + + + // Handle non-padded decimals, e.g., `".12"` => `0.12` by making the integer part + // optional. + "|(" + numberTokenizer + ")?" + aux; + + numberTokenizer = "(" + numberTokenizer + ")"; + } + + // 0: @invertedSymbolMap [Object] Inverted symbol map. + // 1: @invertedNuDigitsMap [Object] Inverted digits map if numbering system is different than + // `latn`. + // 2: @tokenizer [Object] Tokenizer map, used by parser to consume input. + return [ + invertedSymbolMap, + invertedNuDigitsMap, + { + infinity: new RegExp( "^" + regexpEscape( infinitySymbol ) ), + nan: new RegExp( "^" + regexpEscape( nanSymbol ) ), + negativePrefix: new RegExp( "^" + regexpEscape( negativePrefix ) ), + negativeSuffix: new RegExp( "^" + regexpEscape( negativeSuffix ) ), + number: new RegExp( "^" + numberTokenizer ), + prefix: new RegExp( "^" + regexpEscape( prefix ) ), + suffix: new RegExp( "^" + regexpEscape( suffix ) ) + } + ]; + +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parse.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parse.js new file mode 100644 index 000000000..ce3d5bb34 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parse.js @@ -0,0 +1,132 @@ +define([ + "../util/loose-matching" +], function( looseMatching ) { + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( value, properties ) { + var grammar, invertedNuDigitsMap, invertedSymbolMap, negative, number, prefix, prefixNSuffix, + suffix, tokenizer, valid; + + // Grammar: + // - Value <= NaN | PositiveNumber | NegativeNumber + // - PositiveNumber <= PositivePrefix NumberOrInf PositiveSufix + // - NegativeNumber <= NegativePrefix NumberOrInf + // - NumberOrInf <= Number | Inf + grammar = [ + [ "nan" ], + [ "prefix", "infinity", "suffix" ], + [ "prefix", "number", "suffix" ], + [ "negativePrefix", "infinity", "negativeSuffix" ], + [ "negativePrefix", "number", "negativeSuffix" ] + ]; + + invertedSymbolMap = properties[ 0 ]; + invertedNuDigitsMap = properties[ 1 ] || {}; + tokenizer = properties[ 2 ]; + + value = looseMatching( value ); + + function parse( type ) { + return function( lexeme ) { + + // Reverse localized symbols and numbering system. + lexeme = lexeme.split( "" ).map(function( character ) { + return invertedSymbolMap[ character ] || + invertedNuDigitsMap[ character ] || + character; + }).join( "" ); + + switch ( type ) { + case "infinity": + number = Infinity; + break; + + case "nan": + number = NaN; + break; + + case "number": + + // Remove grouping separators. + lexeme = lexeme.replace( /,/g, "" ); + + number = +lexeme; + break; + + case "prefix": + case "negativePrefix": + prefix = lexeme; + break; + + case "suffix": + suffix = lexeme; + break; + + case "negativeSuffix": + suffix = lexeme; + negative = true; + break; + + // This should never be reached. + default: + throw new Error( "Internal error" ); + } + return ""; + }; + } + + function tokenizeNParse( _value, grammar ) { + return grammar.some(function( statement ) { + var value = _value; + + // The whole grammar statement should be used (i.e., .every() return true) and value be + // entirely consumed (i.e., !value.length). + return statement.every(function( type ) { + if ( value.match( tokenizer[ type ] ) === null ) { + return false; + } + + // Consume and parse it. + value = value.replace( tokenizer[ type ], parse( type ) ); + return true; + }) && !value.length; + }); + } + + valid = tokenizeNParse( value, grammar ); + + // NaN + if ( !valid || isNaN( number ) ) { + return NaN; + } + + prefixNSuffix = "" + prefix + suffix; + + // Percent + if ( prefixNSuffix.indexOf( "%" ) !== -1 ) { + number /= 100; + + // Per mille + } else if ( prefixNSuffix.indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + } + + // Negative number + if ( negative ) { + number *= -1; + } + + return number; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parser-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parser-fn.js new file mode 100644 index 000000000..c626e706b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/parser-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/string", + "./parse" +], function( validateParameterPresence, validateParameterTypeString, numberParse ) { + +return function( properties ) { + return function numberParser( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return numberParse( value, properties ); + }; + +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern-properties.js new file mode 100644 index 000000000..a501a659e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern-properties.js @@ -0,0 +1,136 @@ +define([ + "./pattern-re", + "../common/create-error/unsupported-feature" +], function( numberPatternRe, createErrorUnsupportedFeature ) { + +/** + * format( number, pattern ) + * + * @number [Number]. + * + * @pattern [String] raw pattern for numbers. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( pattern ) { + var aux1, aux2, fractionPattern, integerFractionOrSignificantPattern, integerPattern, + maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, padding, prefix, primaryGroupingSize, + roundIncrement, scientificNotation, secondaryGroupingSize, significantPattern, suffix; + + pattern = pattern.match( numberPatternRe ); + if ( !pattern ) { + throw new Error( "Invalid pattern: " + pattern ); + } + + prefix = pattern[ 1 ]; + padding = pattern[ 4 ]; + integerFractionOrSignificantPattern = pattern[ 5 ]; + significantPattern = pattern[ 9 ]; + scientificNotation = pattern[ 10 ]; + suffix = pattern[ 11 ]; + + // Significant digit format + if ( significantPattern ) { + significantPattern.replace( /(@+)(#*)/, function( _match, minimumSignificantDigitsMatch, maximumSignificantDigitsMatch ) { + minimumSignificantDigits = minimumSignificantDigitsMatch.length; + maximumSignificantDigits = minimumSignificantDigits + + maximumSignificantDigitsMatch.length; + }); + + // Integer and fractional format + } else { + fractionPattern = pattern[ 8 ]; + integerPattern = pattern[ 7 ]; + + if ( fractionPattern ) { + + // Minimum fraction digits, and rounding. + fractionPattern.replace( /[0-9]+/, function( match ) { + minimumFractionDigits = match; + }); + if ( minimumFractionDigits ) { + roundIncrement = +( "0." + minimumFractionDigits ); + minimumFractionDigits = minimumFractionDigits.length; + } else { + minimumFractionDigits = 0; + } + + // Maximum fraction digits + // 1: ignore decimal character + maximumFractionDigits = fractionPattern.length - 1; /* 1 */ + } else { + minimumFractionDigits = 0; + maximumFractionDigits = 0; + } + + // Minimum integer digits + integerPattern.replace( /0+$/, function( match ) { + minimumIntegerDigits = match.length; + }); + } + + // Scientific notation + if ( scientificNotation ) { + throw createErrorUnsupportedFeature({ + feature: "scientific notation (not implemented)" + }); + } + + // Padding + if ( padding ) { + throw createErrorUnsupportedFeature({ + feature: "padding (not implemented)" + }); + } + + // Grouping + if ( ( aux1 = integerFractionOrSignificantPattern.lastIndexOf( "," ) ) !== -1 ) { + + // Primary grouping size is the interval between the last group separator and the end of + // the integer (or the end of the significant pattern). + aux2 = integerFractionOrSignificantPattern.split( "." )[ 0 ]; + primaryGroupingSize = aux2.length - aux1 - 1; + + // Secondary grouping size is the interval between the last two group separators. + if ( ( aux2 = integerFractionOrSignificantPattern.lastIndexOf( ",", aux1 - 1 ) ) !== -1 ) { + secondaryGroupingSize = aux1 - 1 - aux2; + } + } + + // Return: + // 0: @prefix String + // 1: @padding Array [ , ] TODO + // 2: @minimumIntegerDigits non-negative integer Number value indicating the minimum integer + // digits to be used. Numbers will be padded with leading zeroes if necessary. + // 3: @minimumFractionDigits and + // 4: @maximumFractionDigits are non-negative integer Number values indicating the minimum and + // maximum fraction digits to be used. Numbers will be rounded or padded with trailing + // zeroes if necessary. + // 5: @minimumSignificantDigits and + // 6: @maximumSignificantDigits are positive integer Number values indicating the minimum and + // maximum fraction digits to be shown. Either none or both of these properties are + // present; if they are, they override minimum and maximum integer and fraction digits + // – the formatter uses however many integer and fraction digits are required to display + // the specified number of significant digits. + // 7: @roundIncrement Decimal round increment or null + // 8: @primaryGroupingSize + // 9: @secondaryGroupingSize + // 10: @suffix String + return [ + prefix, + padding, + minimumIntegerDigits, + minimumFractionDigits, + maximumFractionDigits, + minimumSignificantDigits, + maximumSignificantDigits, + roundIncrement, + primaryGroupingSize, + secondaryGroupingSize, + suffix + ]; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern-re.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern-re.js new file mode 100644 index 000000000..2d2b206b1 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern-re.js @@ -0,0 +1,50 @@ +define(function() { + +/** + * EBNF representation: + * + * number_pattern_re = prefix? + * padding? + * (integer_fraction_pattern | significant_pattern) + * scientific_notation? + * suffix? + * + * prefix = non_number_stuff + * + * padding = "*" regexp(.) + * + * integer_fraction_pattern = integer_pattern + * fraction_pattern? + * + * integer_pattern = regexp([#,]*[0,]*0+) + * + * fraction_pattern = "." regexp(0*[0-9]*#*) + * + * significant_pattern = regexp([#,]*@+#*) + * + * scientific_notation = regexp(E\+?0+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp(('[^']+'|''|[^*#@0,.E])*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: - + * 3: - + * 4: padding + * 5: (integer_fraction_pattern | significant_pattern) + * 6: integer_fraction_pattern + * 7: integer_pattern + * 8: fraction_pattern + * 9: significant_pattern + * 10: scientific_notation + * 11: suffix + * 12: - + */ +return ( /^(('([^']|'')*'|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/ ); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern.js new file mode 100644 index 000000000..fceb3e525 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/pattern.js @@ -0,0 +1,24 @@ +define([ + "./numbering-system" +], function( numberNumberingSystem ) { + +/** + * Pattern( style ) + * + * @style [String] "decimal" (default) or "percent". + * + * @cldr [Cldr instance]. + */ +return function( style, cldr ) { + if ( style !== "decimal" && style !== "percent" ) { + throw new Error( "Invalid style" ); + } + + return cldr.main([ + "numbers", + style + "Formats-numberSystem-" + numberNumberingSystem( cldr ), + "standard" + ]); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol.js new file mode 100644 index 000000000..431d95edb --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol.js @@ -0,0 +1,21 @@ +define([ + "./numbering-system" +], function( numberNumberingSystem ) { + +/** + * Symbol( name, cldr ) + * + * @name [String] Symbol name. + * + * @cldr [Cldr instance]. + * + * Return the localized symbol given its name. + */ +return function( name, cldr ) { + return cldr.main([ + "numbers/symbols-numberSystem-" + numberNumberingSystem( cldr ), + name + ]); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/inverted-map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/inverted-map.js new file mode 100644 index 000000000..76101ae72 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/inverted-map.js @@ -0,0 +1,29 @@ +define([ + "./name", + "../symbol" +], function( numberSymbolName, numberSymbol ) { + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * "٫": ".", + * "٬": ",", + * "٪": "%", + * ... + * }; + */ +return function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ numberSymbol( numberSymbolName[ symbol ], cldr ) ] = symbol; + } + + return symbolMap; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/map.js new file mode 100644 index 000000000..4d94bd578 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/map.js @@ -0,0 +1,29 @@ +define([ + "./name", + "../symbol" +], function( numberSymbolName, numberSymbol ) { + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * ".": "٫", + * ",": "٬", + * "%": "٪", + * ... + * }; + */ +return function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ symbol ] = numberSymbol( numberSymbolName[ symbol ], cldr ); + } + + return symbolMap; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/name.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/name.js new file mode 100644 index 000000000..2efd2a237 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/symbol/name.js @@ -0,0 +1,13 @@ +define(function() { + +return { + ".": "decimal", + ",": "group", + "%": "percentSign", + "+": "plusSign", + "-": "minusSign", + "E": "exponential", + "\u2030": "perMille" +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/to-parts-formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/to-parts-formatter-fn.js new file mode 100644 index 000000000..b366cacb3 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/number/to-parts-formatter-fn.js @@ -0,0 +1,16 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./format" +], function( validateParameterPresence, validateParameterTypeNumber, numberFormat ) { + +return function( properties, pluralGenerator ) { + return function numberToPartsFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return numberFormat( value, properties, pluralGenerator ); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural-runtime.js new file mode 100644 index 000000000..849d95dd8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural-runtime.js @@ -0,0 +1,28 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./core-runtime", + "./plural/generator-fn" +], function( runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize, + pluralGeneratorFn ) { + +Globalize._pluralGeneratorFn = pluralGeneratorFn; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; + +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "pluralGenerator", this._locale, [ options ] ) ]; +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural.js new file mode 100644 index 000000000..183b7d1be --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural.js @@ -0,0 +1,90 @@ +define([ + "cldr", + "make-plural", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/plural-type", + "./core", + "./plural/generator-fn", + + "cldr/event", + "cldr/supplemental" +], function( _Cldr, MakePlural, runtimeBind, validateCldr, validateDefaultLocale, + validateParameterPresence, validateParameterTypeNumber, + validateParameterTypePlainObject, validateParameterTypePluralType, Globalize, + pluralGeneratorFn ) { + +/** + * .plural( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a + * value given locale. + */ +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +/** + * .pluralGenerator( [options] ) + * + * Return a plural function (of the form below). + * + * fn( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a value given the + * default/instance locale. + */ +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + var args, cldr, isOrdinal, plural, returnFn, type; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + type = options.type || "cardinal"; + + validateParameterTypePluralType( options.type, "options.type" ); + + validateDefaultLocale( cldr ); + + isOrdinal = type === "ordinal"; + + cldr.on( "get", validateCldr ); + try { + cldr.supplemental([ "plurals-type-" + type, "{language}" ]); + } finally { + cldr.off( "get", validateCldr ); + } + + MakePlural.rules = {}; + MakePlural.rules[ type ] = cldr.supplemental( "plurals-type-" + type ); + + plural = new MakePlural( cldr.attributes.language, { + "ordinals": isOrdinal, + "cardinals": !isOrdinal + }); + + returnFn = pluralGeneratorFn( plural ); + + runtimeBind( args, cldr, returnFn, [ plural ] ); + + return returnFn; +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural/generator-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural/generator-fn.js new file mode 100644 index 000000000..3c052396c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/plural/generator-fn.js @@ -0,0 +1,15 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number" +], function( validateParameterPresence, validateParameterTypeNumber ) { + +return function( plural ) { + return function pluralGenerator( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return plural( value ); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time-runtime.js new file mode 100644 index 000000000..eb4e25e13 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time-runtime.js @@ -0,0 +1,31 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./core-runtime", + "./relative-time/formatter-fn", + + "./number-runtime", + "./plural-runtime" +], function( runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize, + relativeTimeFormatterFn ) { + +Globalize._relativeTimeFormatterFn = relativeTimeFormatterFn; + +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "relativeTimeFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time.js new file mode 100644 index 000000000..a4d5f8314 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time.js @@ -0,0 +1,81 @@ +define([ + "./core", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/string", + "./relative-time/formatter-fn", + "./relative-time/properties", + + "./number", + "./plural", + "cldr/event" +], function( Globalize, runtimeBind, validateCldr, validateDefaultLocale, validateParameterPresence, + validateParameterTypeNumber, validateParameterTypeString, relativeTimeFormatterFn, + relativeTimeProperties ) { + +/** + * .formatRelativeTime( value, unit [, options] ) + * + * @value [Number] The number of unit to format. + * + * @unit [String] see .relativeTimeFormatter() for details. + * + * @options [Object] see .relativeTimeFormatter() for details. + * + * Formats a relative time according to the given unit, options, and the default/instance locale. + */ +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +/** + * .relativeTimeFormatter( unit [, options ]) + * + * @unit [String] String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Returns a function that formats a relative time according to the given unit, options, and the + * default/instance locale. + */ +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + cldr = this.cldr; + options = options || {}; + + args = [ unit, options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + try { + properties = relativeTimeProperties( unit, cldr, options ); + } finally { + cldr.off( "get", validateCldr ); + } + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = relativeTimeFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/format.js new file mode 100644 index 000000000..71b065cd4 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/format.js @@ -0,0 +1,36 @@ +define([ + "../common/format-message" +], function( formatMessage ) { + +/** + * format( value, numberFormatter, pluralGenerator, properties ) + * + * @value [Number] The number to format + * + * @numberFormatter [String] A numberFormatter from Globalize.numberFormatter + * + * @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator + * + * @properties [Object] containing relative time plural message. + * + * Format relative time. + */ +return function( value, numberFormatter, pluralGenerator, properties ) { + + var relativeTime, + message = properties[ "relative-type-" + value ]; + + if ( message ) { + return message; + } + + relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ] : + properties[ "relativeTime-type-future" ]; + + value = Math.abs( value ); + + message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ]; + return formatMessage( message, [ numberFormatter( value ) ] ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/formatter-fn.js new file mode 100644 index 000000000..b2be713fe --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/formatter-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./format" +], function( validateParameterPresence, validateParameterTypeNumber, relativeTimeFormat ) { + +return function( numberFormatter, pluralGenerator, properties ) { + return function relativeTimeFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties ); + }; + +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/properties.js new file mode 100644 index 000000000..346cd997b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/relative-time/properties.js @@ -0,0 +1,41 @@ +define(function() { + +/** + * properties( unit, cldr, options ) + * + * @unit [String] eg. "day", "week", "month", etc. + * + * @cldr [Cldr instance]. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Return relative time properties. + */ +return function( unit, cldr, options ) { + + var form = options.form, + raw, properties, key, match; + + if ( form ) { + unit = unit + "-" + form; + } + + raw = cldr.main( [ "dates", "fields", unit ] ); + properties = { + "relativeTime-type-future": raw[ "relativeTime-type-future" ], + "relativeTime-type-past": raw[ "relativeTime-type-past" ] + }; + for ( key in raw ) { + if ( raw.hasOwnProperty( key ) ) { + match = /relative-type-(-?[0-9]+)/.exec( key ); + if ( match ) { + properties[ key ] = raw[ key ]; + } + } + } + + return properties; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit-runtime.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit-runtime.js new file mode 100644 index 000000000..8eb697232 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit-runtime.js @@ -0,0 +1,25 @@ +define([ + "./common/runtime-key", + "./core-runtime", + "./unit/formatter-fn", + + "./number-runtime", + "./plural-runtime" +], function( runtimeKey, Globalize, unitFormatterFn ) { + +Globalize._unitFormatterFn = unitFormatterFn; + +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + return this.unitFormatter( unit, options )( value ); +}; + +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "unitFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit.js new file mode 100644 index 000000000..024b68e51 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit.js @@ -0,0 +1,74 @@ +define([ + "./core", + "./common/runtime-bind", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/string", + "./unit/formatter-fn", + "./unit/properties", + + "./number", + "./plural" +], function( Globalize, runtimeBind, validateParameterPresence, validateParameterTypeNumber, + validateParameterTypePlainObject, validateParameterTypeString, unitFormatterFn, + unitProperties ) { + +/** + * Globalize.formatUnit( value, unit, options ) + * + * @value [Number] + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * Format units such as seconds, minutes, days, weeks, etc. + */ +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.unitFormatter( unit, options )( value ); +}; + +/** + * Globalize.unitFormatter( unit, options ) + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * - numberFormatter: [Function] a number formatter function. Defaults to Globalize + * `.numberFormatter()` for the current locale using the default options. + */ +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + var args, form, numberFormatter, pluralGenerator, returnFn, properties; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + + args = [ unit, options ]; + form = options.form || "long"; + properties = unitProperties( unit, form, this.cldr ); + + numberFormatter = options.numberFormatter || this.numberFormatter(); + pluralGenerator = this.pluralGenerator(); + returnFn = unitFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, this.cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/categories.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/categories.js new file mode 100644 index 000000000..7a2fcad8d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/categories.js @@ -0,0 +1,11 @@ +define(function() { + +/** + * categories() + * + * Return all unit categories. + */ +return [ "acceleration", "angle", "area", "digital", "duration", "length", "mass", "power", +"pressure", "speed", "temperature", "volume" ]; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/format.js new file mode 100644 index 000000000..9ce9d683a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/format.js @@ -0,0 +1,51 @@ +define([ + "../common/format-message" +], function( formatMessage ) { + +/** + * format( value, numberFormatter, pluralGenerator, unitProperies ) + * + * @value [Number] + * + * @numberFormatter [Object]: A numberFormatter from Globalize.numberFormatter. + * + * @pluralGenerator [Object]: A pluralGenerator from Globalize.pluralGenerator. + * + * @unitProperies [Object]: localized unit data from cldr. + * + * Format units such as seconds, minutes, days, weeks, etc. + * + * OBS: + * + * Unit Sequences are not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#Unit_Sequences + * + * Duration Unit (for composed time unit durations) is not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#durationUnit + */ +return function( value, numberFormatter, pluralGenerator, unitProperties ) { + var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties, + formattedValue, divisor, divisorProperties, message, pluralValue, oneProperty; + + unitProperties = unitProperties.unitProperties; + formattedValue = numberFormatter( value ); + pluralValue = pluralGenerator( value ); + + // computed compound unit, eg. "megabyte-per-second". + if ( unitProperties instanceof Array ) { + dividendProperties = unitProperties[ 0 ]; + divisorProperties = unitProperties[ 1 ]; + oneProperty = divisorProperties.hasOwnProperty( "one" ) ? "one" : "other"; + + dividend = formatMessage( dividendProperties[ pluralValue ], [ formattedValue ] ); + divisor = formatMessage( divisorProperties[ oneProperty ], [ "" ] ).trim(); + + return formatMessage( compoundUnitPattern, [ dividend, divisor ] ); + } + + message = unitProperties[ pluralValue ]; + + return formatMessage( message, [ formattedValue ] ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/formatter-fn.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/formatter-fn.js new file mode 100644 index 000000000..7131c1dd6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/formatter-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./format" +], function( validateParameterPresence, validateParameterTypeNumber, unitFormat ) { + +return function( numberFormatter, pluralGenerator, unitProperties ) { + return function unitFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return unitFormat( value, numberFormatter, pluralGenerator, unitProperties ); + }; + +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/get.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/get.js new file mode 100644 index 000000000..f905b77a3 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/get.js @@ -0,0 +1,97 @@ +define([ + "./categories" +], function( unitCategories ) { + +function stripPluralGarbage( data ) { + var aux, pluralCount; + + if ( data ) { + aux = {}; + for ( pluralCount in data ) { + aux[ pluralCount.replace( /unitPattern-count-/, "" ) ] = data[ pluralCount ]; + } + } + + return aux; +} + +/** + * get( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + * + * Return the plural map of a unit, eg: "second" + * { "one": "{0} second", + * "other": "{0} seconds" } + * } + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Uses the precomputed form of a compound-unit if available, eg: "mile-per-hour" + * { "displayName": "miles per hour", + * "unitPattern-count-one": "{0} mile per hour", + * "unitPattern-count-other": "{0} miles per hour" + * }, + * + * Also supports "/" instead of "-per-", eg. "foot/second", using the precomputed form if + * available. + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Or undefined in case the unit (or a unit of the compound-unit) doesn't exist. + */ +var get = function( unit, form, cldr ) { + var ret; + + // Ensure that we get the 'precomputed' form, if present. + unit = unit.replace( /\//, "-per-" ); + + // Get unit or -unit (eg. "duration-second"). + [ "" ].concat( unitCategories ).some(function( category ) { + return ret = cldr.main([ + "units", + form, + category.length ? category + "-" + unit : unit + ]); + }); + + // Rename keys s/unitPattern-count-//g. + ret = stripPluralGarbage( ret ); + + // Compound Unit, eg. "foot-per-second" or "foot/second". + if ( !ret && ( /-per-/ ).test( unit ) ) { + + // "Some units already have 'precomputed' forms, such as kilometer-per-hour; + // where such units exist, they should be used in preference" UTS#35. + // Note that precomputed form has already been handled above (!ret). + + // Get both recursively. + unit = unit.split( "-per-" ); + ret = unit.map(function( unit ) { + return get( unit, form, cldr ); + }); + if ( !ret[ 0 ] || !ret[ 1 ] ) { + return; + } + } + + return ret; +}; + +return get; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/properties.js new file mode 100644 index 000000000..edabde0cc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/unit/properties.js @@ -0,0 +1,28 @@ +define([ + "./get" +], function( unitGet ) { + +/** + * properties( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + */ +return function( unit, form, cldr ) { + var compoundUnitPattern, unitProperties; + + compoundUnitPattern = cldr.main( [ "units", form, "per/compoundUnitPattern" ] ); + unitProperties = unitGet( unit, form, cldr ); + + return { + compoundUnitPattern: compoundUnitPattern, + unitProperties: unitProperties + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/always-array.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/always-array.js new file mode 100644 index 000000000..b7276615d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/always-array.js @@ -0,0 +1,7 @@ +define(function() { + +return function( stringOrArray ) { + return Array.isArray( stringOrArray ) ? stringOrArray : stringOrArray ? [ stringOrArray ] : []; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/always-cldr.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/always-cldr.js new file mode 100644 index 000000000..a17e74dd0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/always-cldr.js @@ -0,0 +1,9 @@ +define([ + "cldr" +], function( Cldr ) { + +return function( localeOrCldr ) { + return localeOrCldr instanceof Cldr ? localeOrCldr : new Cldr( localeOrCldr ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/date/set-date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/date/set-date.js new file mode 100644 index 000000000..e83c732b9 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/date/set-date.js @@ -0,0 +1,16 @@ +define(function() { + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +return function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/date/set-month.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/date/set-month.js new file mode 100644 index 000000000..3befece31 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/date/set-month.js @@ -0,0 +1,20 @@ +define([ + "./set-date" +], function( dateSetDate ) { + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +return function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/function-name.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/function-name.js new file mode 100644 index 000000000..9ab3a4dc8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/function-name.js @@ -0,0 +1,16 @@ +define([], function() { + +return function( fn ) { + if ( fn.name !== undefined ) { + return fn.name; + } + + // fn.name is not supported by IE. + var matches = /^function\s+([\w\$]+)\s*\(/.exec( fn.toString() ); + + if ( matches && matches.length > 0 ) { + return matches[ 1 ]; + } +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/is-plain-object.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/is-plain-object.js new file mode 100644 index 000000000..de8cc3d25 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/is-plain-object.js @@ -0,0 +1,10 @@ +define(function() { + +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +return function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/loose-matching.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/loose-matching.js new file mode 100644 index 000000000..ea501eaa8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/loose-matching.js @@ -0,0 +1,21 @@ +define([ + "./regexp/cf-g", + "./regexp/dash-g", + "./regexp/zs-g" +], function( regexpCfG, regexpDashG, regexpZsG ) { + +/** + * Loose Matching: + * - Ignore all format characters, which includes RLM, LRM or ALM used to control BIDI + * formatting. + * - Map all characters in [:Zs:] to U+0020 SPACE; + * - Map all characters in [:Dash:] to U+002D HYPHEN-MINUS; + */ +return function( value ) { + return value + .replace( regexpCfG, "" ) + .replace( regexpDashG, "-" ) + .replace( regexpZsG, " " ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/round.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/round.js new file mode 100644 index 000000000..35ed3f0be --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/round.js @@ -0,0 +1,88 @@ +define([ + "./truncate" +], function( numberTruncate ) { + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +return function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +( value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/to-precision.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/to-precision.js new file mode 100644 index 000000000..eb9573b42 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/to-precision.js @@ -0,0 +1,27 @@ +define(function() { + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +return function( number, precision, round ) { + var roundOrder; + + if ( number === 0 ) { // Fix #706 + return number; + } + + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/truncate.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/truncate.js new file mode 100644 index 000000000..0fe06270e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/number/truncate.js @@ -0,0 +1,10 @@ +define(function() { + +return function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/extend.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/extend.js new file mode 100644 index 000000000..6d1f44915 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/extend.js @@ -0,0 +1,17 @@ +define(function() { + +return function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/filter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/filter.js new file mode 100644 index 000000000..5b16e47df --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/filter.js @@ -0,0 +1,16 @@ +define(function() { + +return function( object, testRe ) { + var key, + copy = {}; + + for ( key in object ) { + if ( testRe.test( key ) ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/invert.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/invert.js new file mode 100644 index 000000000..1f49c99be --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/invert.js @@ -0,0 +1,16 @@ +define(function() { + +/** + * Returns a new object created by using `object`'s values as keys, and the keys as values. + */ +return function( object, fn ) { + fn = fn || function( object, key, value ) { + object[ value ] = key; + return object; + }; + return Object.keys( object ).reduce(function( newObject, key ) { + return fn( newObject, key, object[ key ] ); + }, {}); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/map.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/map.js new file mode 100644 index 000000000..d1fa8b2d4 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/map.js @@ -0,0 +1,19 @@ +define(function() { + +/** + * objectMap( object, fn) + * + * - object + * + * - fn( pair ) => pair + */ +return function( object, fn ) { + return Object.keys( object ).map(function( key ) { + return fn([ key, object[ key ] ]); + }).reduce(function( object, pair ) { + object[ pair[ 0 ] ] = pair[ 1 ]; + return object; + }, {}); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/omit.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/omit.js new file mode 100644 index 000000000..e4e981a8f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/omit.js @@ -0,0 +1,25 @@ +define([ + "../always-array" +], function( alwaysArray ) { + +/** + * objectOmit( object, keys ) + * + * Return a copy of the object, filtered to omit the blacklisted key or array of keys. + */ +return function( object, keys ) { + var key, + copy = {}; + + keys = alwaysArray( keys ); + + for ( key in object ) { + if ( keys.indexOf( key ) === -1 ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/values.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/values.js new file mode 100644 index 000000000..9364f9dde --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/object/values.js @@ -0,0 +1,14 @@ +define(function() { + +return function( object ) { + var i, + result = []; + + for ( i in object ) { + result.push( object[ i ] ); + } + + return result; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/out-of-range.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/out-of-range.js new file mode 100644 index 000000000..eea8bc3b9 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/out-of-range.js @@ -0,0 +1,7 @@ +define(function() { + +return function( value, low, high ) { + return value < low || value > high; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/cf-g.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/cf-g.js new file mode 100644 index 000000000..e419a62e0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/cf-g.js @@ -0,0 +1,15 @@ +define(function() { + +/** + * Generated by: + * + * var regenerate = require( "regenerate" ); + * var formatSymbols = require( "@unicode/unicode-13.0.0/General_Category/Format/symbols" ); + * regenerate().add( formatSymbols ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/node-unicode/unicode-13.0.0 + */ +return /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC38]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/g; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/dash-g.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/dash-g.js new file mode 100644 index 000000000..0e733a7e5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/dash-g.js @@ -0,0 +1,17 @@ +define(function() { + +/** + * Generated by: + * + * var regenerate = require( "regenerate" ); + * var dashSymbols = require( "https://github.com/node-unicode/unicode-13.0.0/General_Category/Dash_Punctuation/symbols" ); + * regenerate().add( dashSymbols ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/node-unicode/unicode-13.0.0 + * + * NOTE: In addition to [:dash:], the below includes MINUS SIGN U+2212. + */ +return /[\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D\u2212]|\uD803\uDEAD/g; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/escape.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/escape.js new file mode 100644 index 000000000..ebfdb73a2 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/escape.js @@ -0,0 +1,8 @@ +define(function() { + +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +return function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/not-s-and-z.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/not-s-and-z.js new file mode 100644 index 000000000..d33ebcbf6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/not-s-and-z.js @@ -0,0 +1,24 @@ +define(function() { + +/** + * Unicode regular expression for: everything except symbols from categories S and Z + * + * Generated by: + * + * var s = regenerate() + * .addRange( 0x0, 0x10FFFF ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Math_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Currency_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Modifier_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Other_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Space_Separator/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Line_Separator/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Paragraph_Separator/symbols" ) ); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/node-unicode/unicode-13.0.0 + * http://www.unicode.org/reports/tr44/#General_Category_Values + */ +return /[\0-\x1F!-#%-\*,-;\?-\]_a-\{\}\x7F-\x9F\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-\xB7\xB9-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0383\u0386-\u03F5\u03F7-\u0481\u0483-\u058C\u0590-\u0605\u0609\u060A\u060C\u060D\u0610-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF-\u07F5\u07F7-\u07FD\u0800-\u09F1\u09F4-\u09F9\u09FC-\u0AF0\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C7E\u0C80-\u0D4E\u0D50-\u0D78\u0D7A-\u0E3E\u0E40-\u0F00\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39-\u0FBD\u0FC6\u0FCD\u0FD0-\u0FD4\u0FD9-\u109D\u10A0-\u138F\u139A-\u166C\u166E-\u167F\u1681-\u17DA\u17DC-\u193F\u1941-\u19DD\u1A00-\u1B60\u1B6B-\u1B73\u1B7D-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u2043\u2045-\u2051\u2053-\u205E\u2060-\u2079\u207D-\u2089\u208D-\u209F\u20C0-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u2308-\u230B\u2329\u232A\u2427-\u243F\u244B-\u249B\u24EA-\u24FF\u2768-\u2793\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2B74\u2B75\u2B96\u2C00-\u2CE4\u2CEB-\u2E4F\u2E52-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3001-\u3003\u3005-\u3011\u3014-\u301F\u3021-\u3035\u3038-\u303D\u3040-\u309A\u309D-\u318F\u3192-\u3195\u31A0-\u31BF\u31E4-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uAA76\uAA7A-\uAB5A\uAB5C-\uAB69\uAB6C-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBC2-\uFDFB\uFDFE-\uFE61\uFE63\uFE67\uFE68\uFE6A-\uFF03\uFF05-\uFF0A\uFF0C-\uFF1B\uFF1F-\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5F-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDFFF]|[\uD801\uD803\uD804\uD806\uD808-\uD819\uD81B-\uD82E\uD830-\uD833\uD837\uD839\uD83A\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDC76\uDC79-\uDEC7\uDEC9-\uDFFF]|\uD805[\uDC00-\uDF3E\uDF40-\uDFFF]|\uD807[\uDC00-\uDFD4\uDFF2-\uDFFF]|\uD81A[\uDC00-\uDF3B\uDF40-\uDF44\uDF46-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDE9-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE87-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED8-\uDEDF\uDEED-\uDEEF\uDEFD-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFDF\uDFEC-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCB2-\uDCFF\uDD79\uDDCC\uDE54-\uDE5F\uDE6E\uDE6F\uDE75-\uDE77\uDE7B-\uDE7F\uDE87-\uDE8F\uDEA9-\uDEAF\uDEB7-\uDEBF\uDEC3-\uDECF\uDED7-\uDEFF\uDF93\uDFCB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/not-s.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/not-s.js new file mode 100644 index 000000000..76ed25fd0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/not-s.js @@ -0,0 +1,21 @@ +define(function() { + +/** + * Unicode regular expression for: everything except symbols from the category S + * + * Generated by: + * + * var s = regenerate() + * .addRange( 0x0, 0x10FFFF ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Math_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Currency_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Modifier_Symbol/symbols" ) ) + * .remove( require( "@unicode/unicode-13.0.0/General_Category/Other_Symbol/symbols" ) ) + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/node-unicode/unicode-13.0.0 + * http://www.unicode.org/reports/tr44/#General_Category_Values + */ +return /[\0-#%-\*,-;\?-\]_a-\{\}\x7F-\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-\xB7\xB9-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0383\u0386-\u03F5\u03F7-\u0481\u0483-\u058C\u0590-\u0605\u0609\u060A\u060C\u060D\u0610-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF-\u07F5\u07F7-\u07FD\u0800-\u09F1\u09F4-\u09F9\u09FC-\u0AF0\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C7E\u0C80-\u0D4E\u0D50-\u0D78\u0D7A-\u0E3E\u0E40-\u0F00\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39-\u0FBD\u0FC6\u0FCD\u0FD0-\u0FD4\u0FD9-\u109D\u10A0-\u138F\u139A-\u166C\u166E-\u17DA\u17DC-\u193F\u1941-\u19DD\u1A00-\u1B60\u1B6B-\u1B73\u1B7D-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF-\u2043\u2045-\u2051\u2053-\u2079\u207D-\u2089\u208D-\u209F\u20C0-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u2308-\u230B\u2329\u232A\u2427-\u243F\u244B-\u249B\u24EA-\u24FF\u2768-\u2793\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2B74\u2B75\u2B96\u2C00-\u2CE4\u2CEB-\u2E4F\u2E52-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u3003\u3005-\u3011\u3014-\u301F\u3021-\u3035\u3038-\u303D\u3040-\u309A\u309D-\u318F\u3192-\u3195\u31A0-\u31BF\u31E4-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uAA76\uAA7A-\uAB5A\uAB5C-\uAB69\uAB6C-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBC2-\uFDFB\uFDFE-\uFE61\uFE63\uFE67\uFE68\uFE6A-\uFF03\uFF05-\uFF0A\uFF0C-\uFF1B\uFF1F-\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5F-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDFFF]|[\uD801\uD803\uD804\uD806\uD808-\uD819\uD81B-\uD82E\uD830-\uD833\uD837\uD839\uD83A\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDC76\uDC79-\uDEC7\uDEC9-\uDFFF]|\uD805[\uDC00-\uDF3E\uDF40-\uDFFF]|\uD807[\uDC00-\uDFD4\uDFF2-\uDFFF]|\uD81A[\uDC00-\uDF3B\uDF40-\uDF44\uDF46-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDE9-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE87-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED8-\uDEDF\uDEED-\uDEEF\uDEFD-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFDF\uDFEC-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCB2-\uDCFF\uDD79\uDDCC\uDE54-\uDE5F\uDE6E\uDE6F\uDE75-\uDE77\uDE7B-\uDE7F\uDE87-\uDE8F\uDEA9-\uDEAF\uDEB7-\uDEBF\uDEC3-\uDECF\uDED7-\uDEFF\uDF93\uDFCB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/zs-g.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/zs-g.js new file mode 100644 index 000000000..3ccf0a65d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/regexp/zs-g.js @@ -0,0 +1,15 @@ +define(function() { + +/** + * Generated by: + * + * var regenerate = require( "regenerate" ); + * var spaceSeparatorSymbols = require( "@unicode/unicode-13.0.0/General_Category/Space_Separator/symbols" ); + * regenerate().add( spaceSeparatorSymbols ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/node-unicode/unicode-13.0.0 + */ +return /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/g; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/remove-literal-quotes.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/remove-literal-quotes.js new file mode 100644 index 000000000..5fb17ea5c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/remove-literal-quotes.js @@ -0,0 +1,22 @@ +define(function() { + +/** + * removeLiteralQuotes( string ) + * + * Return: + * - `'` if input string is `''`. + * - `o'clock` if input string is `'o''clock'`. + * - `foo` if input string is `foo`, i.e., return the same value in case it isn't a single-quoted + * string. + */ +return function( string ) { + if ( string[ 0 ] + string[ string.length - 1 ] !== "''" ) { + return string; + } + if ( string === "''" ) { + return "'"; + } + return string.replace( /''/g, "'" ).slice( 1, -1 ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/hash.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/hash.js new file mode 100644 index 000000000..83e26a88a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/hash.js @@ -0,0 +1,12 @@ +define(function() { + +// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery +return function( str ) { + return [].reduce.call( str, function( hash, i ) { + var chr = i.charCodeAt( 0 ); + hash = ( ( hash << 5 ) - hash ) + chr; + return hash | 0; + }, 0 ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/pad.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/pad.js new file mode 100644 index 000000000..7ab105870 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/pad.js @@ -0,0 +1,14 @@ +define(function() { + +return function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/repeat.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/repeat.js new file mode 100644 index 000000000..46393a838 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/string/repeat.js @@ -0,0 +1,11 @@ +define(function() { + +return function( str, count ) { + var i, result = ""; + for ( i = 0; i < count; i++ ) { + result = result + str; + } + return result; +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/to-string.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/to-string.js new file mode 100644 index 000000000..29d0f1d32 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/src/util/to-string.js @@ -0,0 +1,14 @@ +define(function() { + +/** + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify + */ +return function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/.eslintrc.json b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/.eslintrc.json new file mode 100644 index 000000000..51416a1be --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "root": true, + "extends": "../.eslintrc.json", + "env": { + "node": true, + "amd": true, + "mocha": true + }, + "globals": { + "QUnit": "readonly" + }, + "rules": { + "array-bracket-spacing": "off", + "comma-dangle": "off", + "max-len": "off" + } +} diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/currency.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/currency.js new file mode 100644 index 000000000..596b65dba --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/currency.js @@ -0,0 +1,77 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ), + // currency + require( "../../../external/cldr-data/main/en/currencies.json" ), + require( "../../../external/cldr-data/main/de/currencies.json" ), + require( "../../../external/cldr-data/main/zh/currencies.json" ), + require( "../../../external/cldr-data/supplemental/currencyData.json" ), + // number + require( "../../../external/cldr-data/main/en/numbers.json" ), + require( "../../../external/cldr-data/main/de/numbers.json" ), + require( "../../../external/cldr-data/main/zh/numbers.json" ), + require( "../../../external/cldr-data/supplemental/numberingSystems.json" ), + // plural + require( "../../../external/cldr-data/supplemental/plurals.json" ), + require( "../../../external/cldr-data/supplemental/ordinals.json" ) + ); + + return Globalize; + }, + cases: function( Globalize ) { + var accounting = { style: "accounting" }, + code = { style: "code" }, + name = { style: "name" }, + teslaS = 69900; + + var de, zh; + + de = Globalize( "de" ); + zh = Globalize( "zh" ); + Globalize.locale( "en" ); + + return [ + { formatter: Globalize.currencyFormatter( "USD" ), args: [ teslaS ] }, + { formatter: de.currencyFormatter( "USD" ), args: [ teslaS ] }, + { formatter: zh.currencyFormatter( "USD" ), args: [ teslaS ] }, + + { formatter: Globalize.currencyFormatter( "USD" ), args: [ -teslaS ] }, + { formatter: de.currencyFormatter( "USD" ), args: [ -teslaS ] }, + { formatter: zh.currencyFormatter( "USD" ), args: [ -teslaS ] }, + + { formatter: Globalize.currencyFormatter( "USD", code ), args: [ teslaS ] }, + { formatter: de.currencyFormatter( "USD", code ), args: [ teslaS ] }, + { formatter: zh.currencyFormatter( "USD", code ), args: [ teslaS ] }, + + { formatter: Globalize.currencyFormatter( "USD", name ), args: [ teslaS ] }, + { formatter: de.currencyFormatter( "USD", name ), args: [ teslaS ] }, + { formatter: zh.currencyFormatter( "USD", name ), args: [ teslaS ] }, + + { formatter: Globalize.currencyFormatter( "USD", accounting ), args: [ -1 ] }, + + { formatter: Globalize.currencyFormatter( "CLF" ), args: [ 12345 ] }, + { formatter: Globalize.currencyFormatter( "CLF" ), args: [ 12345.67 ] }, + { formatter: Globalize.currencyFormatter( "ZWD" ), args: [ 12345 ] }, + { formatter: Globalize.currencyFormatter( "ZWD" ), args: [ 12345.67 ] }, + { formatter: Globalize.currencyFormatter( "JPY" ), args: [ 12345.67 ] }, + { formatter: Globalize.currencyFormatter( "CLF", code ), args: [ 12345.67 ] }, + { formatter: Globalize.currencyFormatter( "CLF", name ), args: [ 12345.67 ] }, + + { formatter: Globalize.currencyFormatter( "CLF", { + minimumFractionDigits: 0 + }), args: [ 12345 ] }, + { formatter: Globalize.currencyFormatter( "CLF", { + style: "code", + minimumFractionDigits: 0 + }), args: [ 12345 ] }, + { formatter: Globalize.currencyFormatter( "CLF", { + style: "name", + minimumFractionDigits: 0 + }), args: [ 12345 ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/date.js new file mode 100644 index 000000000..81cfc4377 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/date.js @@ -0,0 +1,43 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ), + // date + require( "../../../external/cldr-data/main/en/ca-gregorian.json" ), + require( "../../../external/cldr-data/main/en/timeZoneNames.json" ), + require( "../../../external/cldr-data/supplemental/metaZones.json" ), + require( "../../../external/cldr-data/supplemental/timeData.json" ), + require( "../../../external/cldr-data/supplemental/weekData.json" ), + // number + require( "../../../external/cldr-data/main/en/numbers.json" ), + require( "../../../external/cldr-data/supplemental/numberingSystems.json" ) + ); + + Globalize.loadTimeZone( require( "iana-tz-data" ) ); + + return Globalize; + }, + cases: function( Globalize ) { + var date = new Date( 2010, 8, 15, 17, 35, 7, 369 ); + Globalize.locale( "en" ); + return [ + { formatter: Globalize.dateFormatter({ datetime: "full", timeZone: "Europe/Berlin" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ datetime: "full", timeZone: "America/Los_Angeles" }), args: [ date ] }, + + { formatter: Globalize.dateFormatter({ skeleton: "GyMMMEd" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "dhms" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "GyMMMEdhms" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "GyMMMEdhmsSSS" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "Ems" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "yQQQhm" }), args: [ date ] }, + + { formatter: Globalize.dateFormatter({ skeleton: "yMMMMd" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "MMMMd" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "MMMM" }), args: [ date ] }, + { formatter: Globalize.dateFormatter({ skeleton: "EEEE" }), args: [ date ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/message.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/message.js new file mode 100644 index 000000000..16e81e883 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/message.js @@ -0,0 +1,28 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ) + ); + + Globalize.loadMessages({ + en: { + greetings: { + hello: "Hello, {name}" + } + } + }); + + return Globalize; + }, + cases: function( Globalize ) { + Globalize.locale( "en" ); + return [ + { formatter: Globalize( "en" ).messageFormatter( "greetings/hello" ), args: [ { + name: "Beethoven" + } ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/number.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/number.js new file mode 100644 index 000000000..d2369baba --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/number.js @@ -0,0 +1,63 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ), + // number + require( "../../../external/cldr-data/main/ar/numbers.json" ), + require( "../../../external/cldr-data/main/en/numbers.json" ), + require( "../../../external/cldr-data/main/es/numbers.json" ), + require( "../../../external/cldr-data/main/zh/numbers.json" ), + require( "../../../external/cldr-data/supplemental/numberingSystems.json" ) + ); + + return Globalize; + }, + cases: function( Globalize ) { + var big = 99999999.99; + Globalize.locale( "en" ); + return [ + { formatter: Globalize.numberFormatter(), args: [ Math.PI ] }, + { formatter: Globalize( "es" ).numberFormatter(), args: [ Math.PI ] }, + { formatter: Globalize( "ar" ).numberFormatter(), args: [ Math.PI ] }, + { formatter: Globalize( "zh-u-nu-native" ).numberFormatter(), args: [ Math.PI ] }, + { formatter: Globalize.numberFormatter(), args: [ big ] }, + + { formatter: Globalize.numberFormatter( { + minimumIntegerDigits: 2, + minimumFractionDigits: 2, + maximumFractionDigits: 2 + } ), args: [ Math.PI ] }, + { formatter: Globalize.numberFormatter( { + maximumFractionDigits: 0 + } ), args: [ Math.PI ] }, + { formatter: Globalize.numberFormatter( { + minimumFractionDigits: 3 + } ), args: [ 1.1 ] }, + { formatter: Globalize.numberFormatter( { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + } ), args: [ Math.PI ] }, + { formatter: Globalize.numberFormatter( { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + } ), args: [ 12345 ] }, + { formatter: Globalize.numberFormatter( { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + } ), args: [ 0.00012345 ] }, + { formatter: Globalize.numberFormatter( { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + } ), args: [ 0.00010001 ] }, + { formatter: Globalize.numberFormatter( { useGrouping: false } ), args: [ big ] }, + + { formatter: Globalize.numberFormatter( { style: "percent" } ), args: [ Math.PI ] }, + { formatter: Globalize( "ar" ).numberFormatter( { style: "percent" } ), args: [ Math.PI ] }, + { formatter: Globalize.numberFormatter( { compact: "short" } ), args: [ big ] }, + { formatter: Globalize.numberFormatter( { compact: "long" } ), args: [ big ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/plural.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/plural.js new file mode 100644 index 000000000..229419ece --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/plural.js @@ -0,0 +1,102 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ), + // plural + require( "../../../external/cldr-data/supplemental/plurals.json" ), + require( "../../../external/cldr-data/supplemental/ordinals.json" ) + ); + + return Globalize; + }, + cases: function( Globalize ) { + Globalize.locale( "en" ); + return [ + { formatter: Globalize.pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize.pluralGenerator(), args: [ 0.14 ] }, + + { formatter: Globalize( "en" ).pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize( "en" ).pluralGenerator(), args: [ 1 ] }, + { formatter: Globalize( "en" ).pluralGenerator(), args: [ 2 ] }, + { formatter: Globalize( "en" ).pluralGenerator(), args: [ 1412 ] }, + { formatter: Globalize( "en" ).pluralGenerator(), args: [ 0.14 ] }, + { formatter: Globalize( "en" ).pluralGenerator(), args: [ 3.14 ] }, + + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 0 ] }, + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 1 ] }, + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 2 ] }, + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 3 ] }, + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 1412 ] }, + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 0.14 ] }, + { formatter: Globalize( "en" ).pluralGenerator( { type: "ordinal" } ), args: [ 3.14 ] }, + + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 1 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 2 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 3 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 6 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 9 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 10 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 11 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 15 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 21 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 70 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 99 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 100 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 101 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 102 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 103 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 111 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 199 ] }, + { formatter: Globalize( "ar" ).pluralGenerator(), args: [ 3.14 ] }, + + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 0 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 1 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 2 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 3 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 9 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 10 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 11 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 99 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 100 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 101 ] }, + { formatter: Globalize( "ar" ).pluralGenerator( { type: "ordinal" } ), args: [ 3.14 ] }, + + + { formatter: Globalize( "ja" ).pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize( "ja" ).pluralGenerator(), args: [ 1 ] }, + { formatter: Globalize( "ja" ).pluralGenerator(), args: [ 2 ] }, + { formatter: Globalize( "ja" ).pluralGenerator(), args: [ 3.14 ] }, + + { formatter: Globalize( "pt" ).pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize( "pt" ).pluralGenerator(), args: [ 1 ] }, + { formatter: Globalize( "pt" ).pluralGenerator(), args: [ 2 ] }, + { formatter: Globalize( "pt" ).pluralGenerator(), args: [ 0.1 ] }, + { formatter: Globalize( "pt" ).pluralGenerator(), args: [ 3.14 ] }, + + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 1 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 2 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 3 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 4 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 5 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 6 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 9 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 11 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 12 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 19 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 21 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 22 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 29 ] }, + { formatter: Globalize( "ru" ).pluralGenerator(), args: [ 3.14 ] }, + + { formatter: Globalize( "zh" ).pluralGenerator(), args: [ 0 ] }, + { formatter: Globalize( "zh" ).pluralGenerator(), args: [ 1 ] }, + { formatter: Globalize( "zh" ).pluralGenerator(), args: [ 2 ] }, + { formatter: Globalize( "zh" ).pluralGenerator(), args: [ 3.14 ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/relative-time.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/relative-time.js new file mode 100644 index 000000000..452e89ad1 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/relative-time.js @@ -0,0 +1,36 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ), + // relative time + require( "../../../external/cldr-data/main/en/dateFields.json" ), + require( "../../../external/cldr-data/main/de/dateFields.json" ), + // number + require( "../../../external/cldr-data/main/en/numbers.json" ), + require( "../../../external/cldr-data/main/de/numbers.json" ), + require( "../../../external/cldr-data/supplemental/numberingSystems.json" ), + // plural + require( "../../../external/cldr-data/supplemental/plurals.json" ), + require( "../../../external/cldr-data/supplemental/ordinals.json" ) + ); + + return Globalize; + }, + cases: function( Globalize ) { + var de, en; + Globalize.locale( "en" ); + de = new Globalize( "de" ); + en = new Globalize( "en" ); + + return [ + { formatter: en.relativeTimeFormatter( "week" ), args: [ -2 ] }, + { formatter: en.relativeTimeFormatter( "year" ), args: [ 3 ] }, + { formatter: en.relativeTimeFormatter( "day" ), args: [ 0 ] }, + { formatter: en.relativeTimeFormatter( "day" ), args: [ 1 ] }, + { formatter: de.relativeTimeFormatter( "day" ), args: [ 2 ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/unit.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/unit.js new file mode 100644 index 000000000..c7f42035c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/cases/unit.js @@ -0,0 +1,65 @@ +module.exports = { + dependencies: function() { + var Globalize = require( "../../../dist/node-main.js" ); + + Globalize.load( + // core + require( "../../../external/cldr-data/supplemental/likelySubtags.json" ), + // unit + require( "../../../external/cldr-data/main/en/units.json" ), + require( "../../../external/cldr-data/main/de/units.json" ), + // number + require( "../../../external/cldr-data/main/en/numbers.json" ), + require( "../../../external/cldr-data/main/de/numbers.json" ), + require( "../../../external/cldr-data/supplemental/numberingSystems.json" ), + // plural + require( "../../../external/cldr-data/supplemental/plurals.json" ), + require( "../../../external/cldr-data/supplemental/ordinals.json" ) + ); + + return Globalize; + }, + cases: function( Globalize ) { + var de, en; + Globalize.locale( "en" ); + de = new Globalize( "de" ); + en = new Globalize( "en" ); + return [ + { formatter: Globalize.unitFormatter( "hour", { + numberFormatter: Globalize.numberFormatter( { minimumIntegerDigits: 1 } ) + } ), args: [ 3 ] }, + { formatter: Globalize.unitFormatter( "hour", { + numberFormatter: Globalize.numberFormatter( { minimumIntegerDigits: 2 } ) + } ), args: [ 3 ] }, + + { formatter: en.unitFormatter( "day" ), args: [ 1 ] }, + { formatter: en.unitFormatter( "day" ), args: [ 100 ] }, + + { formatter: de.unitFormatter( "day" ), args: [ 1 ] }, + { formatter: de.unitFormatter( "day" ), args: [ 100 ] }, + + { formatter: en.unitFormatter( "day", { form: "long" } ), args: [ 1 ] }, + { formatter: en.unitFormatter( "day", { form: "long" } ), args: [ 100 ] }, + + { formatter: de.unitFormatter( "day", { form: "long" } ), args: [ 1 ] }, + { formatter: de.unitFormatter( "day", { form: "long" } ), args: [ 100 ] }, + + { formatter: en.unitFormatter( "second", { form: "short" } ), args: [ 1 ] }, + { formatter: en.unitFormatter( "second", { form: "short" } ), args: [ 100 ] }, + + { formatter: en.unitFormatter( "second", { form: "narrow" } ), args: [ 1 ] }, + { formatter: en.unitFormatter( "second", { form: "narrow" } ), args: [ 100 ] }, + + { formatter: en.unitFormatter( "mile-per-hour", { form: "narrow" } ), args: [ 5 ] }, + + { formatter: en.unitFormatter( "mile-per-second", { form: "narrow" } ), args: [ 5 ] }, + + { formatter: en.unitFormatter( "mile/hour", { form: "narrow" } ), args: [ 5 ] }, + + { formatter: en.unitFormatter( "mile/second", { form: "narrow" } ), args: [ 5 ] }, + + { formatter: en.unitFormatter( "mile/hour", { form: "short" } ), args: [ 55000 ] }, + { formatter: de.unitFormatter( "mile/hour", { form: "short" } ), args: [ 55000 ] } + ]; + } +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/test.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/test.js new file mode 100644 index 000000000..a6b10ba9d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/compiler/test.js @@ -0,0 +1,74 @@ +var globalizeCompiler = require( "globalize-compiler" ); +var fs = require( "fs" ); +var path = require( "path" ); +var childProcess = require( "child_process" ); +var assert = require( "assert" ); +var glob = require( "glob" ); + +describe( "compiled", function() { + if ( !fs.existsSync( path.join( __dirname, "_compiled" ) ) ) { + fs.mkdirSync( path.join( __dirname, "_compiled" ) ); + } + var files = glob.sync( "cases/*.js", { + cwd: __dirname + } ); + files.forEach( function(file) { + var name = path.basename( file, ".js" ); + describe( name, function() { + it( "should return identical data", function( done ) { + var test = require( "./" + file ); + var expectedOutput = ""; + var formatters = []; + var testCases = test.cases( test.dependencies() ); + testCases.forEach( function( testCase ) { + formatters.push( testCase.formatter ); + expectedOutput += testCase.formatter.apply( null, testCase.args ) + "\n"; + }); + var out = globalizeCompiler.compile( formatters, { + template: function( data ) { + var deps = "var Globalize = " + + data.dependencies.map( function( dependency ) { + return "require( \"../../../dist/" + dependency + "\" )"; + } ).join( ";\n" ); + return [ + deps, + "", + data.code, + "", + "module.exports = Globalize;" + ].join( "\n" ); + } + } ); + fs.writeFileSync( path.join( __dirname, "_compiled/" + name + ".compiled.js" ), out ); + fs.writeFileSync( path.join( __dirname, "_compiled/" + name + ".test.js" ), [ + "var test = require( \"../" + file + "\" );", + "var Globalize = require( \"../_compiled/" + name + ".compiled.js\" );", + "testCases = test.cases( Globalize );", + "testCases.forEach( function( testCase ) {", + "console.log( testCase.formatter.apply( null, testCase.args ) );", + "});" + ].join("\n") ); + var childOutput = ""; + var child = childProcess.fork( + path.join( __dirname, "_compiled/" + name + ".test.js" ), + { silent: true } + ); + child.on( "error", function( err ) { + done( err ); + } ); + child.on( "exit", function( exit ) { + if ( exit !== 0 ) { + done( new Error( "exited with non-zero" ) ); + } + } ); + child.stdout.on( "data", function( chunk ) { + childOutput += chunk.toString(); + } ); + child.stdout.on( "end", function() { + assert.equal( childOutput, expectedOutput ); + done(); + } ); + } ); + } ); + } ); +} ); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/config.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/config.js new file mode 100644 index 000000000..e0150536c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/config.js @@ -0,0 +1,23 @@ +// eslint-disable-next-line no-unused-vars +var requirejs = { + paths: { + qunit: "../node_modules/qunit/qunit/qunit", + cldr: "../external/cldrjs/dist/cldr", + "cldr-data": "../external/cldr-data", + globalize: "../dist/globalize", + "iana-tz-data": "../node_modules/iana-tz-data/iana-tz-data", + json: "../external/requirejs-plugins/src/json", + src: "../src", + text: "../external/requirejs-text/text", + "zoned-date-time": "../node_modules/zoned-date-time/src/zoned-date-time" + }, + + shim: { + "zoned-date-time": { + exports: "ZonedDateTime" + } + }, + + // Increase the default of 7 seconds for high-latency envs like browserstack-runner. + waitSeconds: 60 +}; diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional-es5-shim.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional-es5-shim.html new file mode 100644 index 000000000..05e14f0b7 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional-es5-shim.html @@ -0,0 +1,16 @@ + + + + + Globalize Functional Tests + + + +
+
+ + + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional.html new file mode 100644 index 000000000..a16ce0a8f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional.html @@ -0,0 +1,16 @@ + + + + + + Globalize Functional Tests + + + +
+
+ + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional.js new file mode 100644 index 000000000..2ae2656c1 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional.js @@ -0,0 +1,55 @@ +require([ + "qunit", + + // core + "./functional/core", + "./functional/core/load", + "./functional/core/locale", + + // currency + "./functional/currency/currency-formatter", + "./functional/currency/currency-to-parts-formatter", + "./functional/currency/format-currency", + "./functional/currency/format-currency-to-parts", + + // date + "./functional/date/date-formatter", + "./functional/date/date-to-parts-formatter", + "./functional/date/date-parser", + "./functional/date/format-date", + "./functional/date/format-date-to-parts", + "./functional/date/parse-date", + + // message + "./functional/message/message-formatter", + "./functional/message/format-message", + + // number + "./functional/number/number-formatter", + "./functional/number/number-to-parts-formatter", + "./functional/number/number-parser", + "./functional/number/format-number", + "./functional/number/format-number-to-parts", + "./functional/number/parse-number", + + // plural + "./functional/plural/plural", + "./functional/plural/plural-generator", + + // relative-time + "./functional/relative-time/format-relative-time", + "./functional/relative-time/relative-time-formatter", + + // unit + "./functional/unit/format-unit", + "./functional/unit/unit-formatter" + +], function() { + QUnit.start(); +}, function( error ) { + QUnit.test( "requirejs load failure", function( assert ) { + assert.ok( false, "requirejs failed to load: " + QUnit.dump.parse( error ) ); + }); + QUnit.start(); +}); + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core.js new file mode 100644 index 000000000..21e7da3af --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core.js @@ -0,0 +1,30 @@ +define([ + "globalize", + "../util" +], function( Globalize, util ) { + +QUnit.module( "Globalize class constructor" ); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "locale", function() { + new Globalize(); + }); + + util.assertParameterPresence( assert, "locale", function() { + Globalize(); + }); + + util.assertLocaleParameter( assert, "locale", function( invalidValue ) { + return function() { + new Globalize( invalidValue ); + }; + }); + + util.assertLocaleParameter( assert, "locale", function( invalidValue ) { + return function() { + Globalize( invalidValue ); + }; + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core/load.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core/load.js new file mode 100644 index 000000000..a9407b0a6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core/load.js @@ -0,0 +1,20 @@ +define([ + "globalize", + "../../util" +], function( Globalize, util ) { + +QUnit.module( "Globalize.load( cldrJSONData )" ); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "json", function() { + Globalize.load(); + }); + + util.assertCldrJsonDataParameter( assert, "json", function( invalidValue ) { + return function() { + Globalize.load( invalidValue ); + }; + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core/locale.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core/locale.js new file mode 100644 index 000000000..90382d6df --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/core/locale.js @@ -0,0 +1,50 @@ +define([ + "globalize", + "../../util", + + "globalize/date", + "globalize/message", + "globalize/number" +], function( Globalize, util ) { + +QUnit.module( "Globalize.locale( [locale|cldr] )" ); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertLocaleOrNullParameter( assert, "locale", function( invalidValue ) { + return function() { + Globalize.locale( invalidValue ); + }; + }); +}); + +QUnit.test( "should validate whether default locale is defined on static calls", function( assert ) { + + // Ensure default locale is not set. + delete Globalize.cldr; + + util.assertDefaultLocalePresence( assert, function() { + Globalize.formatDate( new Date() ); + }); + + util.assertDefaultLocalePresence( assert, function() { + Globalize.formatDateToParts( new Date() ); + }); + + util.assertDefaultLocalePresence( assert, function() { + Globalize.parseDate( "15" ); + }); + + util.assertDefaultLocalePresence( assert, function() { + Globalize.formatNumber( 3 ); + }); + + util.assertDefaultLocalePresence( assert, function() { + Globalize.parseNumber( "3" ); + }); + + util.assertDefaultLocalePresence( assert, function() { + Globalize.formatMessage( "amen" ); + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/currency-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/currency-formatter.js new file mode 100644 index 000000000..c1cc72038 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/currency-formatter.js @@ -0,0 +1,160 @@ +define([ + "globalize", + "json!cldr-data/main/de/currencies.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/zh/currencies.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/currency", + "globalize/number", + "globalize/plural" +], function( Globalize, deCurrencies, deNumbers, enCurrencies, enNumbers, zhCurrencies, + zhNumbers, currencyData, likelySubtags, plurals, util ) { + +var accounting = { style: "accounting" }, + code = { style: "code" }, + name = { style: "name" }, + narrow = { symbolForm: "narrow" }, + teslaS = 69900; + +function extraSetup() { + Globalize.load( + currencyData, + deCurrencies, + deNumbers, + enCurrencies, + enNumbers, + plurals, + zhCurrencies, + zhNumbers + ); + +} + +QUnit.module( ".currencyFormatter( currency [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "currency", function() { + Globalize.currencyFormatter(); + }); + + util.assertCurrencyParameter( assert, "currency", function( invalidValue ) { + return function() { + Globalize.currencyFormatter( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.currencyFormatter( "USD", invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.currencyFormatter( "USD" ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.currencyFormatter( "USD" ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should return a currency formatter", function( assert ) { + var de, zh; + + extraSetup(); + + de = Globalize( "de" ); + zh = Globalize( "zh" ); + + assert.equal( Globalize.currencyFormatter( "USD" )( teslaS ), "$69,900.00" ); + assert.equal( de.currencyFormatter( "USD" )( teslaS ), "69.900,00 $" ); + assert.equal( zh.currencyFormatter( "USD" )( teslaS ), "US$69,900.00" ); + + assert.equal( Globalize.currencyFormatter( "USD" )( -teslaS ), "-$69,900.00" ); + assert.equal( de.currencyFormatter( "USD" )( -teslaS ), "-69.900,00 $" ); + assert.equal( zh.currencyFormatter( "USD" )( -teslaS ), "-US$69,900.00" ); + + assert.equal( Globalize.currencyFormatter( "HKD", narrow )( teslaS ), "$69,900.00" ); + + assert.equal( Globalize.currencyFormatter( "USD", code )( teslaS ), "USD 69,900.00" ); + assert.equal( de.currencyFormatter( "USD", code )( teslaS ), "69.900,00 USD" ); + assert.equal( zh.currencyFormatter( "USD", code )( teslaS ), "USD 69,900.00" ); + + assert.equal( Globalize.currencyFormatter( "USD", name )( teslaS ), "69,900.00 US dollars" ); + assert.equal( de.currencyFormatter( "USD", name )( teslaS ), "69.900,00 US-Dollar" ); + assert.equal( zh.currencyFormatter( "USD", name )( teslaS ), "69,900.00美元" ); + + assert.equal( Globalize.currencyFormatter( "USD", accounting )( -1 ), "($1.00)" ); +}); + +// The number of decimal places and the rounding for each currency is not locale-specific data. +// Those values are overriden by Supplemental Currency Data. +QUnit.test( "should return a currency formatter, overriden by Supplemental Currency Data", + function( assert ) { + extraSetup(); + + assert.equal( Globalize.currencyFormatter( "CLF" )( 12345 ), "CLF 12,345.0000" ); + assert.equal( Globalize.currencyFormatter( "CLF" )( 12345.67 ), "CLF 12,345.6700" ); + assert.equal( Globalize.currencyFormatter( "ZWD" )( 12345 ), "ZWD 12,345" ); + assert.equal( Globalize.currencyFormatter( "ZWD" )( 12345.67 ), "ZWD 12,346" ); + assert.equal( Globalize.currencyFormatter( "JPY" )( 12345.67 ), "¥12,346" ); + + assert.equal( Globalize.currencyFormatter( "CLF", code )( 12345.67 ), + "CLF 12,345.6700" ); + + assert.equal( Globalize.currencyFormatter( "CLF", name )( 12345.67 ), + "12,345.6700 Chilean units of account (UF)" ); +}); + +// User options should override everything. +QUnit.test( "should return a currency formatter, overriden by user options", + function( assert ) { + extraSetup(); + + assert.equal( Globalize.currencyFormatter( "CLF", { + minimumFractionDigits: 0 + })( 12345 ), "CLF 12,345" ); + + assert.equal( Globalize.currencyFormatter( "JPY", { + maximumFractionDigits: 0 + })( 12345 ), "¥12,345" ); + + assert.equal( Globalize.currencyFormatter( "JPY", { + minimumFractionDigits: 2 + })( 12345 ), "¥12,345.00" ); + + assert.equal( Globalize.currencyFormatter( "CLF", { + style: "code", + minimumFractionDigits: 0 + })( 12345 ), "CLF 12,345" ); + + assert.equal( Globalize.currencyFormatter( "CLF", { + style: "name", + minimumFractionDigits: 0 + })( 12345 ), "12,345 Chilean units of account (UF)" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/currency-to-parts-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/currency-to-parts-formatter.js new file mode 100644 index 000000000..a14b5a369 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/currency-to-parts-formatter.js @@ -0,0 +1,828 @@ +define([ + "globalize", + "json!cldr-data/main/de/currencies.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/zh/currencies.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/currency", + "globalize/number", + "globalize/plural" +], function( Globalize, deCurrencies, deNumbers, enCurrencies, enNumbers, zhCurrencies, + zhNumbers, currencyData, likelySubtags, plurals, util ) { + +var accounting = { style: "accounting" }, + code = { style: "code" }, + name = { style: "name" }, + narrow = { symbolForm: "narrow" }, + teslaS = 69900; + +function extraSetup() { + Globalize.load( + currencyData, + deCurrencies, + deNumbers, + enCurrencies, + enNumbers, + plurals, + zhCurrencies, + zhNumbers + ); + +} + +QUnit.module( ".currencyToPartsFormatter( currency [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "currency", function() { + Globalize.currencyToPartsFormatter(); + }); + + util.assertCurrencyParameter( assert, "currency", function( invalidValue ) { + return function() { + Globalize.currencyToPartsFormatter( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.currencyToPartsFormatter( "USD", invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.currencyToPartsFormatter( "USD" ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.currencyToPartsFormatter( "USD" ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should return a currency formatter", function( assert ) { + var de, zh; + + extraSetup(); + + de = Globalize( "de" ); + zh = Globalize( "zh" ); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "USD" )( teslaS ), [ + { + "type": "currency", + "value": "$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + assert.deepEqual( de.currencyToPartsFormatter( "USD" )( teslaS ), [ + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "." + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "$" + } + ]); + assert.deepEqual( zh.currencyToPartsFormatter( "USD" )( teslaS ), [ + { + "type": "currency", + "value": "US$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "USD" )( -teslaS ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "currency", + "value": "$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + assert.deepEqual( de.currencyToPartsFormatter( "USD" )( -teslaS ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "." + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "$" + } + ]); + assert.deepEqual( zh.currencyToPartsFormatter( "USD" )( -teslaS ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "currency", + "value": "US$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "HKD", narrow )( teslaS ), [ + { + "type": "currency", + "value": "$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "USD", code )( teslaS ), [ + { + "type": "currency", + "value": "USD" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + assert.deepEqual( de.currencyToPartsFormatter( "USD", code )( teslaS ), [ + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "." + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "USD" + } + ]); + assert.deepEqual( zh.currencyToPartsFormatter( "USD", code )( teslaS ), [ + { + "type": "currency", + "value": "USD" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "USD", name )( teslaS ), [ + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "US dollars" + } + ]); + assert.deepEqual( de.currencyToPartsFormatter( "USD", name )( teslaS ), [ + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "." + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "US-Dollar" + } + ]); + assert.deepEqual( zh.currencyToPartsFormatter( "USD", name )( teslaS ), [ + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "currency", + "value": "美元" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "USD", accounting )( -1 ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "currency", + "value": "$" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + }, + { + "type": "literal", + "value": ")" + } + ]); +}); + +// The number of decimal places and the rounding for each currency is not locale-specific data. +// Those values are overriden by Supplemental Currency Data. +QUnit.test( "should return a currency formatter, overriden by Supplemental Currency Data", + function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF" )( 12345 ), [ + { + "type": "currency", + "value": "CLF" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0000" + } + ]); + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF" )( 12345.67 ), [ + { + "type": "currency", + "value": "CLF" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "6700" + } + ]); + assert.deepEqual( Globalize.currencyToPartsFormatter( "ZWD" )( 12345 ), [ + { + "type": "currency", + "value": "ZWD" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + } + ]); + assert.deepEqual( Globalize.currencyToPartsFormatter( "ZWD" )( 12345.67 ), [ + { + "type": "currency", + "value": "ZWD" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "346" + } + ]); + assert.deepEqual( Globalize.currencyToPartsFormatter( "JPY" )( 12345.67 ), [ + { + "type": "currency", + "value": "¥" + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "346" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF", code )( 12345.67 ), [ + { + "type": "currency", + "value": "CLF" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "6700" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF", name )( 12345.67 ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "6700" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "Chilean units of account (UF)" + } + ]); +}); + +// User options should override everything. +QUnit.test( "should return a currency formatter, overriden by user options", + function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF", { + minimumFractionDigits: 0 + })( 12345 ), [ + { + "type": "currency", + "value": "CLF" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "JPY", { + maximumFractionDigits: 0 + })( 12345 ), [ + { + "type": "currency", + "value": "¥" + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "JPY", { + minimumFractionDigits: 2 + })( 12345 ), [ + { + "type": "currency", + "value": "¥" + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF", { + style: "code", + minimumFractionDigits: 0 + })( 12345 ), [ + { + "type": "currency", + "value": "CLF" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + } + ]); + + assert.deepEqual( Globalize.currencyToPartsFormatter( "CLF", { + style: "name", + minimumFractionDigits: 0 + })( 12345 ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "Chilean units of account (UF)" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/format-currency-to-parts.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/format-currency-to-parts.js new file mode 100644 index 000000000..b82f13a4d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/format-currency-to-parts.js @@ -0,0 +1,101 @@ +define([ + "globalize", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/currency", + "globalize/number" +], function( Globalize, enCurrencies, enNumbers, currencyData, likelySubtags, plurals, util ) { + +var teslaS = 69900; + +function extraSetup() { + Globalize.load( + currencyData, + enCurrencies, + enNumbers, + plurals + ); +} + +QUnit.module( ".formatCurrencyToParts( value, currency [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatCurrencyToParts(); + }); + + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatCurrencyToParts( invalidValue ); + }; + }); + + util.assertParameterPresence( assert, "currency", function() { + Globalize.formatCurrencyToParts( 7 ); + }); + + util.assertCurrencyParameter( assert, "currency", function( invalidValue ) { + return function() { + Globalize.formatCurrencyToParts( 7, invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.formatCurrencyToParts( 7, "USD", invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.formatCurrencyToParts( 7, "USD" ); + }); +}); + +QUnit.test( "should format currencies", function( assert ) { + extraSetup(); + assert.deepEqual( Globalize.formatCurrencyToParts( teslaS, "USD" ), [ + { + "type": "currency", + "value": "$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/format-currency.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/format-currency.js new file mode 100644 index 000000000..eb65f6dc5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/currency/format-currency.js @@ -0,0 +1,76 @@ +define([ + "globalize", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/currency", + "globalize/number" +], function( Globalize, enCurrencies, enNumbers, currencyData, likelySubtags, plurals, util ) { + +var teslaS = 69900; + +function extraSetup() { + Globalize.load( + currencyData, + enCurrencies, + enNumbers, + plurals + ); +} + +QUnit.module( ".formatCurrency( value, currency [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatCurrency(); + }); + + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatCurrency( invalidValue ); + }; + }); + + util.assertParameterPresence( assert, "currency", function() { + Globalize.formatCurrency( 7 ); + }); + + util.assertCurrencyParameter( assert, "currency", function( invalidValue ) { + return function() { + Globalize.formatCurrency( 7, invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.formatCurrency( 7, "USD", invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.formatCurrency( 7, "USD" ); + }); +}); + +QUnit.test( "should format currencies", function( assert ) { + extraSetup(); + assert.equal( Globalize.formatCurrency( teslaS, "USD" ), "$69,900.00" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-formatter.js new file mode 100644 index 000000000..850324e16 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-formatter.js @@ -0,0 +1,106 @@ +define([ + "globalize", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "../../util", + + "globalize/date" +], function( Globalize, enNumbers, enCaGregorian, likelySubtags, numberingSystems, timeData, + weekData, util ) { + +var date = new Date( 2010, 8, 15, 17, 35, 7, 369 ); + +function extraSetup() { + Globalize.load( + enCaGregorian, + enNumbers, + numberingSystems, + timeData, + weekData + ); +} + +QUnit.module( ".dateFormatter( pattern )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidPattern ) { + return function() { + Globalize.dateFormatter( invalidPattern ); + }; + }); + + assert.throws(function() { + Globalize.dateFormatter({ date: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*date.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateFormatter({ time: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*time.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateFormatter({ datetime: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*datetime.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateFormatter({ skeleton: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*skeleton.*invalid-stuff/ ); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + Globalize.load({ + "main": { + "en": { + "dates": { + "calendars": { + "gregorian": { + "dateTimeFormats": { + "availableFormats": { + "MMMd": "MMM d" + } + } + } + } + } + } + } + }); + util.assertCldrContent( assert, function() { + Globalize.dateFormatter({ skeleton: "MMMd" }); + }); +}); + +QUnit.test( "should return a formatter", function( assert ) { + extraSetup(); + + assert.equal( Globalize.dateFormatter({ skeleton: "GyMMMEd" })( date ), "Wed, Sep 15, 2010 AD" ); + assert.equal( Globalize.dateFormatter({ skeleton: "dhms" })( date ), "15, 5:35:07 PM" ); + assert.equal( Globalize.dateFormatter({ skeleton: "GyMMMEdhms" })( date ), "Wed, Sep 15, 2010 AD, 5:35:07 PM" ); + assert.equal( Globalize.dateFormatter({ skeleton: "GyMMMEdhmsSSS" })( date ), "Wed, Sep 15, 2010 AD, 5:35:07.369 PM" ); + assert.equal( Globalize.dateFormatter({ skeleton: "Ems" })( date ), "Wed, 35:07" ); + assert.equal( Globalize.dateFormatter({ skeleton: "yQQQhm" })( date ), "Q3 2010, 5:35 PM" ); +}); + +QUnit.test( "should augment a skeleton", function( assert ) { + extraSetup(); + + assert.equal( Globalize.dateFormatter({ skeleton: "yMMMMd" })( date ), "September 15, 2010" ); + assert.equal( Globalize.dateFormatter({ skeleton: "MMMMd" })( date ), "September 15" ); + assert.equal( Globalize.dateFormatter({ skeleton: "MMMM" })( date ), "September" ); + assert.equal( Globalize.dateFormatter({ skeleton: "EEEE" })( date ), "Wednesday" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-parser.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-parser.js new file mode 100644 index 000000000..637505183 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-parser.js @@ -0,0 +1,122 @@ +define([ + "globalize", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/pt/ca-gregorian.json", + "json!cldr-data/main/pt/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "../../util", + + "globalize/date" +], function( Globalize, enCaGregorian, enNumbers, ptCaGregorian, ptNumbers, likelySubtags, + numberingSystems, timeData, weekData, util ) { + +function assertParseDate( assert, input, options, output ) { + assert.deepEqual( Globalize.dateParser( options )( input ), output, JSON.stringify( options ) ); +} + +function extraSetup() { + Globalize.load( + enCaGregorian, + enNumbers, + ptCaGregorian, + ptNumbers, + numberingSystems, + timeData, + weekData + ); +} + +QUnit.module( ".dateParser( pattern )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.dateParser( invalidValue ); + }; + }); + + assert.throws(function() { + Globalize.dateParser({ date: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "date" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*date.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateParser({ time: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "time" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*time.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateParser({ datetime: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "datetime" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*datetime.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateParser({ skeleton: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "skeleton" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*skeleton.*invalid-stuff/ ); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + Globalize.load({ + "main": { + "en": { + "dates": { + "calendars": { + "gregorian": { + "dateTimeFormats": { + "availableFormats": { + "MMMd": "MMM d" + } + } + } + } + } + } + } + }); + util.assertCldrContent( assert, function() { + Globalize.dateParser({ skeleton: "MMMd" } ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.dateParser({ skeleton: "invalid-stuff" }); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should return a parser", function( assert ) { + extraSetup(); + assertParseDate( assert, "Wed, Sep 15, 2010 AD", { skeleton: "GyMMMEd" }, + new Date( 2010, 8, 15 ) ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-to-parts-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-to-parts-formatter.js new file mode 100644 index 000000000..6db005544 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/date-to-parts-formatter.js @@ -0,0 +1,297 @@ +define([ + "globalize", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "../../util", + + "globalize/date" +], function( Globalize, enNumbers, enCaGregorian, likelySubtags, numberingSystems, timeData, + weekData, util ) { + +var date = new Date( 2010, 8, 15, 17, 35, 7, 369 ); + +function extraSetup() { + Globalize.load( + enCaGregorian, + enNumbers, + numberingSystems, + timeData, + weekData + ); +} + +QUnit.module( ".dateToPartsFormatter( pattern )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidPattern ) { + return function() { + Globalize.dateToPartsFormatter( invalidPattern ); + }; + }); + + assert.throws(function() { + Globalize.dateToPartsFormatter({ date: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*date.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateToPartsFormatter({ time: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*time.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateToPartsFormatter({ datetime: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*datetime.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.dateToPartsFormatter({ skeleton: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*skeleton.*invalid-stuff/ ); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + Globalize.load({ + "main": { + "en": { + "dates": { + "calendars": { + "gregorian": { + "dateTimeFormats": { + "availableFormats": { + "MMMd": "MMM d" + } + } + } + } + } + } + } + }); + util.assertCldrContent( assert, function() { + Globalize.dateToPartsFormatter({ skeleton: "MMMd" }); + }); +}); + +QUnit.test( "should return a formatter", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.dateToPartsFormatter({ skeleton: "GyMMMEd" })( date ), [ + { + "type": "weekday", + "value": "Wed" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "month", + "value": "Sep" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "era", + "value": "AD" + } + ]); + assert.deepEqual( Globalize.dateToPartsFormatter({ skeleton: "dhms" })( date ), [ + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); + assert.deepEqual( Globalize.dateToPartsFormatter({ skeleton: "GyMMMEdhms" })( date ), [ + { + "type": "weekday", + "value": "Wed" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "month", + "value": "Sep" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "era", + "value": "AD" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); + assert.deepEqual( Globalize.dateToPartsFormatter({ skeleton: "Ems" })( date ), [ + { + "type": "weekday", + "value": "Wed" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + } + ]); + assert.deepEqual( Globalize.dateToPartsFormatter({ skeleton: "yQQQhm" })( date ), [ + { + "type": "quarter", + "value": "Q3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/format-date-to-parts.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/format-date-to-parts.js new file mode 100644 index 000000000..f7bdf54df --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/format-date-to-parts.js @@ -0,0 +1,698 @@ +define([ + "globalize", + "json!cldr-data/main/ar/ca-gregorian.json", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/ar/timeZoneNames.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/pt/ca-gregorian.json", + "json!cldr-data/main/pt/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!iana-tz-data.json", + "../../util", + + "globalize/date" +], function( Globalize, arCaGregorian, arNumbers, arTimeZoneNames, enCaGregorian, enNumbers, + enTimeZoneNames, ptCaGregorian, ptNumbers, likelySubtags, numberingSystems, timeData, weekData, + ianaTimezoneData, util ) { + +var ar, + date = new Date( 2010, 8, 15, 17, 35, 7, 369 ); + +function extraSetup() { + Globalize.load( + arCaGregorian, + arNumbers, + arTimeZoneNames, + enCaGregorian, + enNumbers, + enTimeZoneNames, + numberingSystems, + ptCaGregorian, + ptNumbers, + timeData, + weekData + ); + Globalize.loadTimeZone( ianaTimezoneData ); +} + +QUnit.module( ".formatDateToParts( value, options )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters (1/2)", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatDateToParts(); + }); + + util.assertDateParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatDateToParts( invalidValue, "GyMMMEd" ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidPattern ) { + return function() { + Globalize.formatDateToParts( date, invalidPattern ); + }; + }); + + assert.throws(function() { + Globalize.formatDateToParts(date, { date: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*date.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.formatDateToParts(date, { time: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*time.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.formatDateToParts(date, { datetime: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*datetime.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.formatDateToParts(date, { skeleton: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*skeleton.*invalid-stuff/ ); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + Globalize.load({ + "main": { + "en": { + "dates": { + "calendars": { + "gregorian": { + "dateTimeFormats": { + "availableFormats": { + "MMMd": "MMM d" + } + } + } + } + } + } + } + }); + util.assertCldrContent( assert, function() { + Globalize.formatDateToParts( date, { skeleton: "MMMd" }); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.formatDateToParts( date, { skeleton: "invalid-stuff" } ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should validate parameters (2/2)", function( assert ) { + extraSetup(); + + // Use the default style when passing {timeZone} only. + assert.deepEqual( Globalize.formatDateToParts( new Date( "2010-09-15T08:00:00Z" ), { timeZone: "America/Los_Angeles" } ), [ + { type: "month", value: "9" }, + { type: "literal", value: "/" }, + { type: "day", value: "15" }, + { type: "literal", value: "/" }, + { type: "year", value: "2010" } + ]); + + assert.throws(function() { + Globalize.formatDateToParts( date, { timeZone: "invalid-time-zone" }); + }, /E_MISSING_IANA_TZ.*Missing required IANA timezone content.*invalid-time-zone/ ); +}); + +QUnit.test( "should format skeleton to parts", function( assert ) { + extraSetup(); + + ar = Globalize( "ar" ); + + assert.deepEqual( Globalize.formatDateToParts( date, { skeleton: "d" } ), [ + { + "type": "day", + "value": "15" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { skeleton: "Ed" } ), [ + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "weekday", + "value": "Wed" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { skeleton: "Ehms" } ), [ + { + "type": "weekday", + "value": "Wed" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { skeleton: "GyMMMEd" } ), [ + { + "type": "weekday", + "value": "Wed" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "month", + "value": "Sep" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "era", + "value": "AD" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { skeleton: "yMd" } ), [ + { + "type": "month", + "value": "9" + }, + { + "type": "literal", + "value": "/" + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": "/" + }, + { + "type": "year", + "value": "2010" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { skeleton: "yQQQ" } ), [ + { + "type": "quarter", + "value": "Q3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "year", + "value": "2010" + } + ]); + + assert.deepEqual( ar.formatDateToParts( date, { skeleton: "yQQQ" } ), [ + { + "type": "quarter", + "value": "الربع الثالث" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "year", + "value": "٢٠١٠" + } + ]); + + // Via instance .formatDateToParts(). + assert.deepEqual( Globalize( "pt" ).formatDateToParts( date, { skeleton: "Ehms" } ), [ + { + "type": "weekday", + "value": "qua" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); + + assert.deepEqual( Globalize( "pt" ).formatDateToParts( date, { skeleton: "GyMMMEd" } ), [ + { + "type": "weekday", + "value": "qua" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": " de " + }, + { + "type": "month", + "value": "set" + }, + { + "type": "literal", + "value": " de " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "era", + "value": "d.C." + } + ]); +}); + +QUnit.test( "should format time presets", function( assert ) { + extraSetup(); + + ar = Globalize( "ar" ); + + assert.deepEqual( Globalize.formatDateToParts( date, { time: "medium" } ), [ + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); + + assert.deepEqual( ar.formatDateToParts( date, { time: "medium" } ), [ + { + "type": "hour", + "value": "٥" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "٣٥" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "٠٧" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "م" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { time: "short" } ), [ + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); + + assert.deepEqual( ar.formatDateToParts( date, { time: "short" } ), [ + { + "type": "hour", + "value": "٥" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "٣٥" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "م" + } + ]); +}); + +QUnit.test( "should format date presets", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.formatDateToParts( date, { date: "full" } ), + [ + { + "type": "weekday", + "value": "Wednesday" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "month", + "value": "September" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { date: "long" } ), + [ + { + "type": "month", + "value": "September" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { date: "medium" } ), + [ + { + "type": "month", + "value": "Sep" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + } + ]); + + assert.deepEqual( Globalize.formatDateToParts( date, { date: "short" } ), [ + { + "type": "month", + "value": "9" + }, + { + "type": "literal", + "value": "/" + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": "/" + }, + { + "type": "year", + "value": "10" + } + ]); +}); + +QUnit.test( "should format datetime presets", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.formatDateToParts( date, { datetime: "medium" } ), [ + { + "type": "month", + "value": "Sep" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "hour", + "value": "5" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "35" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "07" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "dayperiod", + "value": "PM" + } + ]); +}); + +QUnit.test( "should format raw patterns", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.formatDateToParts( date, { raw: "E, MMM d, y G" } ), [ + { + "type": "weekday", + "value": "Wed" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "month", + "value": "Sep" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "day", + "value": "15" + }, + { + "type": "literal", + "value": ", " + }, + { + "type": "year", + "value": "2010" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "era", + "value": "AD" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/format-date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/format-date.js new file mode 100644 index 000000000..b5e37bdfc --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/format-date.js @@ -0,0 +1,214 @@ +define([ + "globalize", + "json!cldr-data/main/ar/ca-gregorian.json", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/ar/timeZoneNames.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/pt/ca-gregorian.json", + "json!cldr-data/main/pt/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/metaZones.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!iana-tz-data.json", + "../../util", + + "globalize/date" +], function( Globalize, arCaGregorian, arNumbers, arTimeZoneNames, enCaGregorian, enNumbers, + enTimeZoneNames, ptCaGregorian, ptNumbers, likelySubtags, metaZones, numberingSystems, timeData, + weekData, ianaTimezoneData, util ) { + +var ar, + date = new Date( 2010, 8, 15, 17, 35, 7, 369 ); + +function extraSetup() { + Globalize.load( + arCaGregorian, + arNumbers, + arTimeZoneNames, + enCaGregorian, + enNumbers, + enTimeZoneNames, + metaZones, + numberingSystems, + ptCaGregorian, + ptNumbers, + timeData, + weekData + ); + Globalize.loadTimeZone( ianaTimezoneData ); +} + +QUnit.module( ".formatDate( value, options )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters (1/2)", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatDate(); + }); + + util.assertDateParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatDate( invalidValue, "GyMMMEd" ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidPattern ) { + return function() { + Globalize.formatDate( date, invalidPattern ); + }; + }); + + assert.throws(function() { + Globalize.formatDate(date, { date: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "date" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*date.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.formatDate(date, { time: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "time" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*time.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.formatDate(date, { datetime: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "datetime" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*datetime.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.formatDate(date, { skeleton: "invalid-stuff" }); + }, function( error ) { + return error.code === "E_INVALID_OPTIONS" && + error.type === "skeleton" && + error.value === "invalid-stuff"; + }, /E_INVALID_OPTIONS.*skeleton.*invalid-stuff/ ); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + Globalize.load({ + "main": { + "en": { + "dates": { + "calendars": { + "gregorian": { + "dateTimeFormats": { + "availableFormats": { + "MMMd": "MMM d" + } + } + } + } + } + } + } + }); + util.assertCldrContent( assert, function() { + Globalize.formatDate( date, { skeleton: "MMMd" }); + }); +}); + +QUnit.test( "should validate parameters (2/2)", function( assert ) { + extraSetup(); + + // Use the default style when passing {timeZone} only. + assert.equal( Globalize.formatDate( new Date( "2010-09-15T08:00:00Z" ), { timeZone: "America/Los_Angeles" } ), "9/15/2010" ); + + assert.throws(function() { + Globalize.formatDate( date, { timeZone: "invalid-time-zone" }); + }, /E_MISSING_IANA_TZ.*Missing required IANA timezone content.*invalid-time-zone/ ); +}); + +QUnit.test( "should format skeleton", function( assert ) { + extraSetup(); + + ar = Globalize( "ar" ); + + assert.equal( Globalize.formatDate( date, { skeleton: "d" } ), "15" ); + assert.equal( Globalize.formatDate( date, { skeleton: "Ed" } ), "15 Wed" ); + assert.equal( Globalize.formatDate( date, { skeleton: "Ehms" } ), "Wed 5:35:07 PM" ); + assert.equal( Globalize.formatDate( date, { skeleton: "GyMMMEd" } ), "Wed, Sep 15, 2010 AD" ); + assert.equal( Globalize.formatDate( date, { skeleton: "yMd" } ), "9/15/2010" ); + assert.equal( Globalize.formatDate( date, { skeleton: "yQQQ" } ), "Q3 2010" ); + assert.equal( ar.formatDate( date, { skeleton: "yQQQ" } ), "الربع الثالث ٢٠١٠" ); + + // Via instance .formatDate(). + assert.equal( Globalize( "pt" ).formatDate( date, { skeleton: "Ehms" } ), "qua, 5:35:07 PM" ); + assert.equal( Globalize( "pt" ).formatDate( date, { skeleton: "GyMMMEd" } ), "qua, 15 de set de 2010 d.C." ); +}); + +QUnit.test( "should format time presets", function( assert ) { + extraSetup(); + + ar = Globalize( "ar" ); + + assert.equal( Globalize.formatDate( date, { time: "medium" } ), "5:35:07 PM" ); + assert.equal( ar.formatDate( date, { time: "medium" } ), "٥:٣٥:٠٧ م" ); + + assert.equal( Globalize.formatDate( date, { time: "short" } ), "5:35 PM" ); + assert.equal( ar.formatDate( date, { time: "short" } ), "٥:٣٥ م" ); +}); + +QUnit.test( "should format date presets", function( assert ) { + extraSetup(); + + assert.equal( Globalize.formatDate( date, { date: "full" } ), "Wednesday, September 15, 2010" ); + assert.equal( Globalize.formatDate( date, { date: "long" } ), "September 15, 2010" ); + assert.equal( Globalize.formatDate( date, { date: "medium" } ), "Sep 15, 2010" ); + assert.equal( Globalize.formatDate( date, { date: "short" } ), "9/15/10" ); +}); + +QUnit.test( "should format datetime presets", function( assert ) { + extraSetup(); + + assert.equal( Globalize.formatDate( date, { datetime: "medium" } ), "Sep 15, 2010, 5:35:07 PM" ); +}); + +QUnit.test( "should format raw patterns", function( assert ) { + extraSetup(); + + assert.equal( Globalize.formatDate( date, { raw: "E, MMM d, y G" } ), "Wed, Sep 15, 2010 AD" ); +}); + +QUnit.test( "should format date in various timezones", function( assert ) { + var date = new Date( "2010-09-15T16:35:07.000Z" ); + extraSetup(); + + assert.equal( + Globalize.formatDate( date, { datetime: "long", timeZone: "Etc/UTC" } ), + "September 15, 2010 at 4:35:07 PM GMT" + ); + assert.equal( + Globalize.formatDate( date, { datetime: "long", timeZone: "Europe/Berlin" } ), + "September 15, 2010 at 6:35:07 PM GMT+2" + ); + assert.equal( + Globalize.formatDate( date, { datetime: "long", timeZone: "America/Sao_Paulo" } ), + "September 15, 2010 at 1:35:07 PM GMT-3" + ); + assert.equal( + Globalize.formatDate( date, { datetime: "long", timeZone: "America/Los_Angeles" } ), + "September 15, 2010 at 9:35:07 AM PDT" + ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/parse-date.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/parse-date.js new file mode 100644 index 000000000..2e688a01f --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/date/parse-date.js @@ -0,0 +1,295 @@ +define([ + "globalize", + "src/date/start-of", + "json!cldr-data/main/ar/ca-gregorian.json", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/ar/timeZoneNames.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/pt/ca-gregorian.json", + "json!cldr-data/main/pt/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/metaZones.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!iana-tz-data.json", + "../../util", + + "globalize/date" +], function( Globalize, startOf, arCaGregorian, arNumbers, arTimeZoneNames, enCaGregorian, + enNumbers, enTimeZoneNames, ptCaGregorian, ptNumbers, likelySubtags, metaZones, + numberingSystems, timeData, weekData, ianaTimezoneData, util ) { + +var ar, date; + +function extraSetup() { + Globalize.load( + arCaGregorian, + arNumbers, + arTimeZoneNames, + enCaGregorian, + enNumbers, + enTimeZoneNames, + ptCaGregorian, + ptNumbers, + metaZones, + numberingSystems, + timeData, + weekData + ); + Globalize.loadTimeZone( ianaTimezoneData ); +} + +QUnit.module( ".parseDate( value, options )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +function assertParseDate( assert, input, options, output, globalize ) { + assert.deepEqual( ( globalize || Globalize ).parseDate( input, options ), output, JSON.stringify( options ) ); +} + +QUnit.test( "should validate parameters (1/2)", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.parseDate(); + }); + + util.assertStringParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.parseDate( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.parseDate( "15 Wed", invalidValue ); + }; + }); + + assert.throws(function() { + Globalize.parseDate( "15", { date: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*date.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.parseDate( "15", { time: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*time.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.parseDate( "15", { datetime: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*datetime.*invalid-stuff/ ); + + assert.throws(function() { + Globalize.parseDate( "15", { skeleton: "invalid-stuff" }); + }, /E_INVALID_OPTIONS.*skeleton.*invalid-stuff/ ); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + Globalize.load({ + "main": { + "en": { + "dates": { + "calendars": { + "gregorian": { + "dateTimeFormats": { + "availableFormats": { + "MMMd": "MMM d" + } + } + } + } + } + } + } + }); + util.assertCldrContent( assert, function() { + Globalize.parseDate( "Jan 15", { skeleton: "MMMd" } ); + }); +}); + +QUnit.test( "should validate parameters (2/2)", function( assert ) { + extraSetup(); + + // Use the default style when passing {timeZone} only. + assert.deepEqual( Globalize.parseDate( "5/17/2017", { timeZone: "America/Los_Angeles" } ), new Date( "2017-05-17T07:00:00.000Z" ) ); + + assert.throws(function() { + Globalize.parseDate( "15", { timeZone: "invalid-time-zone" }); + }, /E_MISSING_IANA_TZ.*Missing required IANA timezone content.*invalid-time-zone/ ); +}); + +QUnit.test( "should parse skeleton", function( assert ) { + extraSetup(); + + ar = Globalize( "ar" ); + + date = new Date(); + date.setDate( 15 ); + date = startOf( date, "day" ); + assertParseDate( assert, "15", { skeleton: "d" }, date ); + assertParseDate( assert, "15 Wed", { skeleton: "Ed" }, date ); + + date = new Date(); + date.setHours( 17 ); + date.setMinutes( 35 ); + date.setSeconds( 7 ); + date = startOf( date, "second" ); + assertParseDate( assert, "Wed 5:35:07 PM", { skeleton: "Ehms" }, date ); + + date = new Date(); + date.setHours( 17 ); + date.setMinutes( 35 ); + date.setSeconds( 7 ); + date.setMilliseconds(734); + assertParseDate( assert, "Wed 5:35:07.734 PM", { skeleton: "EhmsSSS" }, date ); + + date = new Date( 2010, 8, 15 ); + date = startOf( date, "day" ); + assertParseDate( assert, "Wed, Sep 15, 2010 AD", { skeleton: "GyMMMEd" }, date ); + assertParseDate( assert, "9/15/2010", { skeleton: "yMd" }, date ); + assertParseDate( assert, "الأربعاء، ١٥ سبتمبر، ٢٠١٠ م", { skeleton: "GyMMMEd" }, date, ar ); + + // Loose matching: ignore control characters. + assertParseDate( assert, "١٥/٩/٢٠١٠", { skeleton: "yMd" }, date, ar ); + + date = new Date( 2010, 0 ); + date = startOf( date, "year" ); + assertParseDate( assert, "Q3 2010", { skeleton: "yQQQ" }, date ); + assertParseDate( assert, "الربع الثالث ٢٠١٠", { skeleton: "yQQQ" }, date, ar ); + + // Via instance globalize.parseDate(). + assert.deepEqual( Globalize( "pt" ).parseDate( "2010 T3", { skeleton: "yQQQ" } ), date, "{ skeleton: \"yQQQ\" }" ); +}); + +QUnit.test( "should parse time presets", function( assert ) { + extraSetup(); + + ar = Globalize( "ar" ); + + date = new Date(); + date.setHours( 17 ); + date.setMinutes( 35 ); + date.setSeconds( 7 ); + date = startOf( date, "second" ); + assertParseDate( assert, "5:35:07 PM", { time: "medium" }, date ); + assertParseDate( assert, "٥:٣٥:٠٧ م", { time: "medium" }, date, ar ); + date = startOf( date, "minute" ); + assertParseDate( assert, "5:35 PM", { time: "short" }, date ); + assertParseDate( assert, "٥:٣٥ م", { time: "short" }, date, ar ); +}); + +QUnit.test( "should parse date presets", function( assert ) { + extraSetup(); + + date = new Date( 2010, 8, 15 ); + date = startOf( date, "day" ); + assertParseDate( assert, "Wednesday, September 15, 2010", { date: "full" }, date ); + assertParseDate( assert, "September 15, 2010", { date: "long" }, date ); + assertParseDate( assert, "Sep 15, 2010", { date: "medium" }, date ); + assertParseDate( assert, "9/15/10", { date: "short" }, date ); +}); + +QUnit.test( "should parse datetime presets", function( assert ) { + extraSetup(); + + date = new Date( 2010, 8, 15 ); + date = startOf( date, "day" ); + assertParseDate( assert, "Wednesday, September 15, 2010", { date: "full" }, date ); + + date = new Date( 2010, 8, 15, 17, 35, 7 ); + date = startOf( date, "second" ); + assertParseDate( assert, "Sep 15, 2010, 5:35:07 PM", { datetime: "medium" }, date ); +}); + +QUnit.test( "should parse raw pattern", function( assert ) { + extraSetup(); + + date = new Date( 2010, 8, 15 ); + date = startOf( date, "day" ); + assertParseDate( assert, "Wed, Sep 15, 2010 AD", { raw: "E, MMM d, y G" }, date ); +}); + +QUnit.test( "should parse date in various timezones", function( assert ) { + var date = new Date( "2010-09-15T16:35:07.000Z" ); + extraSetup(); + + assert.deepEqual( + Globalize.parseDate( "September 15, 2010 at 1:35:07 PM GMT-3", { datetime: "long", timeZone: "America/Sao_Paulo" } ), + date + ); + assert.deepEqual( + Globalize.parseDate( "September 15, 2010 at 9:35:07 AM PDT", { datetime: "long", timeZone: "America/Los_Angeles" } ), + date + ); +}); + +QUnit.test( "should parse a formatted date (reverse operation test)", function( assert ) { + var OrigDate; + + extraSetup(); + + ar = Globalize( "ar" ); + + date = new Date(); + date = startOf( date, "minute" ); + assert.deepEqual( Globalize.parseDate( Globalize.formatDate( date, { datetime: "full" } ), { datetime: "full" } ), date ); + assert.deepEqual( ar.parseDate( ar.formatDate( date, { datetime: "full" } ), { datetime: "full" } ), date ); + + assert.deepEqual( + Globalize.parseDate( + Globalize.formatDate( date, { datetime: "full", timeZone: "America/Los_Angeles" } ), + { datetime: "full", timeZone: "America/Los_Angeles" } + ), + date + ); + assert.deepEqual( + Globalize.parseDate( + Globalize.formatDate( date, { datetime: "long", timeZone: "America/New_York" } ), + { datetime: "long", timeZone: "America/New_York" } + ), + date + ); + assert.deepEqual( + ar.parseDate( + ar.formatDate( date, { datetime: "full", timeZone: "Africa/Cairo" } ), + { datetime: "full", timeZone: "Africa/Cairo" } + ), + date + ); + + // Testing DST edge cases... + // Note we can't reliably parse overlapping times (daylight to standard cases). For example, we + // can't reliably parse "2/18/2017 11:00 PM" for America/Sao_Paulo into + // "2017-02-19T01:00:00.000Z" or "2017-02-19T02:00:00.000Z" without providing the zone string, + // e.g., 11:00 PM BRT or 11:00 PM BRST (both times are valid). Therefore, formatting either one + // should return back the parsed string. + assert.deepEqual( + Globalize.formatDate( + Globalize.parseDate( "2/18/2017 11:00 PM", { raw: "M/d/y h:mm a", timeZone: "America/Sao_Paulo" } ), + { raw: "M/d/y h:mm a", timeZone: "America/Sao_Paulo" } + ), + "2/18/2017 11:00 PM" + ); + + // Test #689 - special test when target date and today are in different DST rules. + // Note it was arbitrarily chosen O, other timezone patterns are supposed to pass too. + // date1 = a DST date (or vice-versa depending on the running environment). + // FakeDate.today = a standard time date (or vice-versa depending on the running environment). + /* globals Date:true */ + OrigDate = Date; + Date = util.FakeDate; + date = new Date( 2017, 6, 1, 12, 0 ); + util.FakeDate.today = new Date( 2017, 0, 1 ); + assert.deepEqual( Globalize.parseDate( Globalize.formatDate( date, { datetime: "full" } ), { datetime: "full" } ), date ); + Date = OrigDate; +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/message/format-message.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/message/format-message.js new file mode 100644 index 000000000..44a0e5e63 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/message/format-message.js @@ -0,0 +1,50 @@ +define([ + "globalize", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/message", + "globalize/plural" +], function( Globalize, likelySubtags, plurals, util ) { + +QUnit.module( ".formatMessage( path [, variables] )", { + beforeEach: function() { + Globalize.load( likelySubtags ); + Globalize.load( plurals ); + Globalize.loadMessages({ + en: { + greetings: { + hello: "Hello, {name}" + } + } + }); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "path", function() { + Globalize( "en" ).formatMessage(); + }); + + util.assertPathParameter( assert, "path", function( invalidValue ) { + return function() { + Globalize( "en" ).formatMessage( invalidValue ); + }; + }); + + util.assertMessageVariablesType( assert, "variables", function( invalidValue ) { + return function() { + Globalize( "en" ).formatMessage( "greetings/hello", invalidValue ); + }; + }); +}); + +QUnit.test( "should format a message", function( assert ) { + assert.equal( Globalize( "en" ).formatMessage( "greetings/hello", { + name: "Beethoven" + }), "Hello, Beethoven" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/message/message-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/message/message-formatter.js new file mode 100644 index 000000000..c32d4c374 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/message/message-formatter.js @@ -0,0 +1,194 @@ +define([ + "globalize", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "cldr/unresolved", + "globalize/message", + "globalize/plural" +], function( Globalize, likelySubtags, plurals, util ) { + +QUnit.assert.messageFormatter = function( locale, path, variables, expected ) { + if ( arguments.length === 3 ) { + expected = variables; + variables = undefined; + } + this.equal( Globalize( locale ).messageFormatter( path )( variables ), expected ); +}; + +QUnit.assert.messageBundlePresence = function( fn ) { + this.throws( fn, function E_MISSING_MESSAGE_BUNDLE( error ) { + return error.code === "E_MISSING_MESSAGE_BUNDLE" && + "locale" in error; + }, "Expected \"E_MISSING_MESSAGE_BUNDLE\" to be thrown" ); +}; + +QUnit.module( ".messageFormatter( path )", { + beforeEach: function() { + Globalize.load( likelySubtags ); + Globalize.load( plurals ); + Globalize.loadMessages({ + root: { + amen: "Amen" + }, + de: {}, + en: { + greetings: { + hello: "Hello", + helloArray: "Hello, {0}", + helloArray2: "Hello, {0} and {1}", + helloName: "Hello, {name}" + }, + like: [ + "{count, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and {someone} liked this}", + " other {You and # others liked this}", + "}" + ], + party: [ + "{hostGender, select,", + " female {{host} invites {guest} to her party}", + " male {{host} invites {guest} to his party}", + " other {{host} invites {guest} to their party}", + "}" + ], + task: [ + "You have {0, plural,", + " one {one task}", + " other {# tasks}", + "} remaining" + ] + }, + "en-GB": {}, + fr: {}, + pt: { + amen: "Amém" + }, + "pt-PT": {}, + zh: { + amen: "阿门" + } + }); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should pass test's prerequisites", function( assert ) { + var sr = new Globalize( "sr" ); + + // OBS: Ensure `sr` cldr/main dataset hasn't being loaded elsewhere. It's a prerequisites for + // the below messageBundlePresence test. + assert.deepEqual( sr.cldr.attributes.bundle, null, "`sr` cldr/main dataset cannot be loaded" ); +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "path", function() { + Globalize( "en" ).messageFormatter(); + }); + + util.assertPathParameter( assert, "path", function( invalidValue ) { + return function() { + Globalize( "en" ).messageFormatter( invalidValue ); + }; + }); +}); + +QUnit.test( "should validate messages", function( assert ) { + assert.messageBundlePresence(function() { + Globalize( "sr" ).messageFormatter( "path" ); + }); + + util.assertMessagePresence( assert, "non-existent/path", function() { + Globalize( "en" ).messageFormatter( "non-existent/path" ); + }); + + util.assertMessageType( assert, "invalid-message", function( invalidValue ) { + Globalize.loadMessages({ + en: { + "invalid-message": invalidValue + } + }); + return function() { + Globalize( "en" ).messageFormatter( "invalid-message" ); + }; + }); +}); + +QUnit.test( "should return the loaded translation", function( assert ) { + assert.messageFormatter( "pt", "amen", "Amém" ); + assert.messageFormatter( "zh", "amen", "阿门" ); +}); + +QUnit.test( "should traverse the translation data", function( assert ) { + assert.messageFormatter( "en", "greetings/hello", "Hello" ); + assert.messageFormatter( "en", [ "greetings", "hello" ], "Hello" ); +}); + +QUnit.test( "should return inherited translation if cldr/unresolved is loaded", function( assert ) { + assert.messageFormatter( "en", "amen", "Amen" ); + assert.messageFormatter( "de", "amen", "Amen" ); + assert.messageFormatter( "en-GB", "amen", "Amen" ); + assert.messageFormatter( "fr", "amen", "Amen" ); + assert.messageFormatter( "pt-PT", "amen", "Amém" ); +}); + +QUnit.test( "should support ICU message format", function( assert ) { + var like; + + // Var replacement + assert.messageFormatter( "en", "greetings/helloArray", [ "Beethoven" ], "Hello, Beethoven" ); + assert.messageFormatter( "en", "greetings/helloArray", "Beethoven", "Hello, Beethoven" ); + assert.messageFormatter( "en", "greetings/helloArray2", [ "Beethoven", "Mozart" ], + "Hello, Beethoven and Mozart" ); + assert.equal( + Globalize( "en" ).messageFormatter( "greetings/helloArray2" )( "Beethoven", "Mozart" ), + "Hello, Beethoven and Mozart" + ); + assert.messageFormatter( "en", "greetings/helloName", { + name: "Beethoven" + }, "Hello, Beethoven" ); + + // Plural + assert.messageFormatter( "en", "task", 123, "You have 123 tasks remaining" ); + + // Select + assert.messageFormatter( "en", "party", { + guest: "Mozart", + host: "Beethoven", + hostGender: "male" + }, "Beethoven invites Mozart to his party" ); + + // Plural offset + like = new Globalize( "en" ).messageFormatter( "like" ); + assert.equal( like({ count: 0 }), "Be the first to like this" ); + + assert.equal( like({ count: 1 }), "You liked this" ); + + assert.equal( like({ + count: 2, + someone: "Beethoven" + }), "You and Beethoven liked this" ); + + assert.equal( like({ count: 3 }), "You and 2 others liked this" ); +}); + +// Reference #473 +QUnit.test( "should NOT merge array data", function( assert ) { + // Re-loading a message that uses array syntax. + Globalize.loadMessages({ + en: { + task: [ + "You have {0, plural,", + " one {one task}", + " other {# tasks}", + "} remaining" + ] + } + }); + assert.messageFormatter( "en", "task", 123, "You have 123 tasks remaining" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/format-number-to-parts.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/format-number-to-parts.js new file mode 100644 index 000000000..93381771a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/format-number-to-parts.js @@ -0,0 +1,337 @@ +define([ + "globalize", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "../../util", + + "globalize/number" +], function( Globalize, arNumbers, enNumbers, esNumbers, zhNumbers, likelySubtags, numberingSystems, + util ) { + +var pi = 3.14159265359; + +function extraSetup() { + Globalize.load( + arNumbers, + enNumbers, + esNumbers, + zhNumbers, + numberingSystems + ); +} + +QUnit.module( ".formatNumberToParts( value [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatNumberToParts(); + }); + + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatNumberToParts( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.formatNumberToParts( 7, invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.formatNumberToParts( pi ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.formatNumberToParts( pi ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should format decimal style", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.formatNumberToParts( pi ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "142" + } + ]); + assert.deepEqual( Globalize( "es" ).formatNumberToParts( pi ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "142" + } + ]); + assert.deepEqual( Globalize( "ar" ).formatNumberToParts( pi ), [ + { + "type": "integer", + "value": "٣" + }, + { + "type": "decimal", + "value": "٫" + }, + { + "type": "fraction", + "value": "١٤٢" + } + ]); + assert.deepEqual( Globalize( "zh-u-nu-native" ).formatNumberToParts( pi ), [ + { + "type": "integer", + "value": "三" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "一四二" + } + ]); + assert.deepEqual( Globalize.formatNumberToParts( 99999999.99 ), [ + { + "type": "integer", + "value": "99" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "999" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "999" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "99" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( pi, { + minimumIntegerDigits: 2, + minimumFractionDigits: 2, + maximumFractionDigits: 2 + }), [ + { + "type": "integer", + "value": "03" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( pi, { + maximumFractionDigits: 0 + }), [ + { + "type": "integer", + "value": "3" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( 1.1, { + minimumFractionDigits: 3 + }), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "100" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( pi, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( 12345, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "300" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( 0.00012345, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "000123" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( 0.00010001, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0001" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( 99999999.99, { useGrouping: false } ), [ + { + "type": "integer", + "value": "99999999" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "99" + } + ]); + + assert.deepEqual( Globalize.formatNumberToParts( 0, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0" + } + ]); +}); + +QUnit.test( "should format percent style", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.formatNumberToParts( pi, { style: "percent" } ), [ + { + "type": "integer", + "value": "314" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + assert.deepEqual( Globalize( "ar" ).formatNumberToParts( pi, { style: "percent" } ), [ + { + "type": "integer", + "value": "٣١٤" + }, + { + "type": "percentSign", + "value": "٪" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/format-number.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/format-number.js new file mode 100644 index 000000000..8a110b74b --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/format-number.js @@ -0,0 +1,129 @@ +define([ + "globalize", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "../../util", + + "globalize/number" +], function( Globalize, arNumbers, enNumbers, esNumbers, zhNumbers, likelySubtags, numberingSystems, + util ) { + +var pi = 3.14159265359; + +function extraSetup() { + Globalize.load( + arNumbers, + enNumbers, + esNumbers, + zhNumbers, + numberingSystems + ); +} + +QUnit.module( ".formatNumber( value [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatNumber(); + }); + + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatNumber( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.formatNumber( 7, invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.formatNumber( pi ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.formatNumber( pi ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should format decimal style", function( assert ) { + extraSetup(); + + assert.equal( Globalize.formatNumber( pi ), "3.142" ); + assert.equal( Globalize( "es" ).formatNumber( pi ), "3,142" ); + assert.equal( Globalize( "ar" ).formatNumber( pi ), "٣٫١٤٢" ); + assert.equal( Globalize( "zh-u-nu-native" ).formatNumber( pi ), "三.一四二" ); + assert.equal( Globalize.formatNumber( 99999999.99 ), "99,999,999.99" ); + + assert.equal( Globalize.formatNumber( pi, { + minimumIntegerDigits: 2, + minimumFractionDigits: 2, + maximumFractionDigits: 2 + }), "03.14" ); + + assert.equal( Globalize.formatNumber( pi, { + maximumFractionDigits: 0 + }), "3" ); + + assert.equal( Globalize.formatNumber( 1.1, { + minimumFractionDigits: 3 + }), "1.100" ); + + assert.equal( Globalize.formatNumber( pi, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), "3.14" ); + + assert.equal( Globalize.formatNumber( 12345, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), "12,300" ); + + assert.equal( Globalize.formatNumber( 0.00012345, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), "0.000123" ); + + assert.equal( Globalize.formatNumber( 0.00010001, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), "0.0001" ); + + assert.equal( Globalize.formatNumber( 99999999.99, { useGrouping: false } ), "99999999.99" ); + + assert.equal( Globalize.formatNumber( 0, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 + }), "0.0" ); +}); + +QUnit.test( "should format percent style", function( assert ) { + extraSetup(); + + assert.equal( Globalize.formatNumber( pi, { style: "percent" } ), "314%" ); + assert.equal( Globalize( "ar" ).formatNumber( pi, { style: "percent" } ), "٣١٤٪" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-formatter.js new file mode 100644 index 000000000..fed343a07 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-formatter.js @@ -0,0 +1,80 @@ +define([ + "globalize", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "../../util", + + "globalize/number" +], function( Globalize, arNumbers, enNumbers, esNumbers, likelySubtags, util ) { + +var pi = 3.14159265359; + +function extraSetup() { + Globalize.load( + arNumbers, + enNumbers, + esNumbers + ); +} + +QUnit.module( ".numberFormatter( [options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.numberFormatter( invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.numberFormatter(); + }); +}); + +QUnit.test( "should validate options", function( assert ) { + extraSetup(); + + util.assertParameterRange( assert, 1, 21, function( num ) { + Globalize.numberFormatter({ + maximumSignificantDigits: 1, + minimumSignificantDigits: num + }); + }); + util.assertParameterRange( assert, 1, 21, function( num ) { + Globalize.numberFormatter({ + maximumSignificantDigits: num, + minimumSignificantDigits: 1 + }); + }); + util.assertParameterRange( assert, 1, 21, function( num ) { + Globalize.numberFormatter({ minimumIntegerDigits: num } ); + }); + util.assertParameterRange( assert, 0, 20, function( num ) { + Globalize.numberFormatter({ minimumFractionDigits: num } ); + }); + util.assertParameterRange( assert, 0, 20, function( num ) { + Globalize.numberFormatter({ maximumFractionDigits: num } ); + }); +}); + +QUnit.test( "should return a formatter", function( assert ) { + extraSetup(); + + assert.equal( Globalize.numberFormatter()( pi ), "3.142" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-parser.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-parser.js new file mode 100644 index 000000000..b7d80fd98 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-parser.js @@ -0,0 +1,67 @@ +define([ + "globalize", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en-IN/numbers.json", + "json!cldr-data/main/tr-CY/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "../../util", + + "globalize/number" +], function( Globalize, enNumbers, enInNumbers, trCyNumbers, likelySubtags, util ) { + +function extraSetup() { + Globalize.load( enNumbers ); + Globalize.load( enInNumbers ); + Globalize.load( trCyNumbers ); +} + +QUnit.module( ".numberParser( [options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {}, + "en-IN": {}, + "tr-CY": {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.numberParser( invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.numberParser(); + }); +}); + +QUnit.test( "should throw unsupported exception if compact option is set", function( assert ) { + assert.throws(function() { + Globalize.numberParser({ compact: "short" }); + }, /Unsupported.*compact number parsing/); +}); + +QUnit.test( "should return parser", function( assert ) { + extraSetup(); + + assert.equal( Globalize.numberParser()( "3" ), 3 ); + assert.equal( Globalize( "en-IN" ).numberParser()( "76,54,321" ), 7654321 ); + + assert.equal( Globalize.numberParser({ + style: "percent" + })( "50%" ), 0.5 ); + + assert.equal( Globalize( "tr-CY" ).numberParser({ + style: "percent" + })( "%50" ), 0.5 ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-to-parts-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-to-parts-formatter.js new file mode 100644 index 000000000..445457e10 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/number-to-parts-formatter.js @@ -0,0 +1,93 @@ +define([ + "globalize", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "../../util", + + "globalize/number" +], function( Globalize, arNumbers, enNumbers, esNumbers, likelySubtags, util ) { + +var pi = 3.14159265359; + +function extraSetup() { + Globalize.load( + arNumbers, + enNumbers, + esNumbers + ); +} + +QUnit.module( ".numberToPartsFormatter( [options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.numberToPartsFormatter( invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.numberToPartsFormatter(); + }); +}); + +QUnit.test( "should validate options", function( assert ) { + extraSetup(); + + util.assertParameterRange( assert, 1, 21, function( num ) { + Globalize.numberToPartsFormatter({ + maximumSignificantDigits: 1, + minimumSignificantDigits: num + }); + }); + util.assertParameterRange( assert, 1, 21, function( num ) { + Globalize.numberToPartsFormatter({ + maximumSignificantDigits: num, + minimumSignificantDigits: 1 + }); + }); + util.assertParameterRange( assert, 1, 21, function( num ) { + Globalize.numberToPartsFormatter({ minimumIntegerDigits: num } ); + }); + util.assertParameterRange( assert, 0, 20, function( num ) { + Globalize.numberToPartsFormatter({ minimumFractionDigits: num } ); + }); + util.assertParameterRange( assert, 0, 20, function( num ) { + Globalize.numberToPartsFormatter({ maximumFractionDigits: num } ); + }); +}); + +QUnit.test( "should return a formatter", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.numberToPartsFormatter()( pi ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "142" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/parse-number.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/parse-number.js new file mode 100644 index 000000000..0e11786af --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/number/parse-number.js @@ -0,0 +1,226 @@ +define([ + "globalize", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en-IN/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/fa/numbers.json", + "json!cldr-data/main/sv/numbers.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "../../util", + + "globalize/number" +], function( Globalize, arNumbers, enNumbers, enInNumbers, esNumbers, faNumbers, svNumbers, + zhNumbers, likelySubtags, numberingSystems, util ) { + +var ar, enIn, es, fa, sv, zh; + +function extraSetup() { + Globalize.load( + arNumbers, + enNumbers, + enInNumbers, + esNumbers, + faNumbers, + svNumbers, + zhNumbers, + numberingSystems + ); +} + +QUnit.module( ".parseNumber( value [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + ar: {}, + en: {}, + "en-IN": {}, + es: {}, + fa: {}, + sv: {}, + zh: {} + } + }); + ar = new Globalize( "ar" ); + enIn = new Globalize( "en-IN" ); + es = new Globalize( "es" ); + fa = new Globalize( "fa" ); + sv = new Globalize( "sv" ); + zh = new Globalize( "zh-u-nu-native" ); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.parseNumber(); + }); + + util.assertStringParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.parseNumber( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.parseNumber( "3", invalidValue ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.parseNumber( "3" ); + }); +}); + +/** + * Integers + */ + +QUnit.test( "should parse integers", function( assert ) { + extraSetup(); + + assert.equal( Globalize.parseNumber( "3" ), 3 ); + assert.equal( Globalize.parseNumber( "12735" ), 12735 ); + + // Loose match: ignore control format symbols. + assert.equal( ar.parseNumber( "-٣" ), -3 ); + + // Grouping separator. + assert.equal( Globalize.parseNumber( "12,735" ), 12735 ); + assert.equal( enIn.parseNumber( "76,54,321" ), 7654321 ); + assert.deepEqual( enIn.parseNumber( "654,321" ), NaN ); + assert.equal( es.parseNumber( "12.735" ), 12735 ); + assert.equal( sv.parseNumber( "12\xA0735" ), 12735 ); + + // Loose match: map all characters in [:Zs:] to U+0020 SPACE, e.g., accept non-breaking space as + // grouping separator. + assert.equal( sv.parseNumber( "12 735" ), 12735 ); +}); + +QUnit.test( "should parse negative integers", function( assert ) { + extraSetup(); + + assert.equal( Globalize.parseNumber( "-3" ), -3 ); + assert.equal( Globalize.parseNumber( "-12,735" ), -12735 ); +}); + +/** + * Decimals + */ + +QUnit.test( "should parse decimals", function( assert ) { + extraSetup(); + + assert.equal( Globalize.parseNumber( "3.14" ), 3.14 ); + assert.deepEqual( Globalize.parseNumber( "3,14" ), NaN ); + assert.equal( es.parseNumber( "3,14" ), 3.14 ); + assert.deepEqual( es.parseNumber( "3.14" ), NaN ); + assert.equal( ar.parseNumber( "٣٫١٤" ), 3.14 ); + assert.equal( zh.parseNumber( "三.一四" ), 3.14 ); + assert.equal( Globalize.parseNumber( "3.00" ), 3 ); + assert.equal( Globalize.parseNumber( "12735.0" ), 12735 ); + assert.equal( Globalize.parseNumber( "0.10" ), 0.1 ); +}); + +QUnit.test( "should parse negative decimal", function( assert ) { + extraSetup(); + + assert.equal( Globalize.parseNumber( "-3.14" ), -3.14 ); +}); + +/** + * Percent + */ + +QUnit.test( "should parse percent", function( assert ) { + extraSetup(); + + assert.equal( Globalize.parseNumber( "1%", { style: "percent" } ), 0.01 ); + assert.equal( Globalize.parseNumber( "01%", { style: "percent" } ), 0.01 ); + assert.equal( Globalize.parseNumber( "10%", { style: "percent" } ), 0.1 ); + assert.equal( Globalize.parseNumber( "50%", { style: "percent" } ), 0.5 ); + assert.equal( Globalize.parseNumber( "100%", { style: "percent" } ), 1 ); + + assert.equal( Globalize.parseNumber( "0.5%", { + style: "percent", + minimumFractionDigits: 0, + maximumFractionDigits: 1 + }), 0.005 ); + + assert.equal( Globalize.parseNumber( "0.5%", { + style: "percent", + minimumFractionDigits: 0, + maximumFractionDigits: 1 + }), 0.005 ); + + assert.equal( ar.parseNumber( "٥٠٪", { style: "percent" } ), 0.5 ); + assert.equal( Globalize.parseNumber( "-10%", { style: "percent" } ), -0.1 ); +}); + +/** + * Infinite number + */ +QUnit.test( "should parse infinite numbers", function( assert ) { + extraSetup(); + + assert.equal( Globalize.parseNumber( "∞" ), Infinity ); + assert.equal( Globalize.parseNumber( "-∞" ), -Infinity ); +}); + +/** + * NaN + */ + +QUnit.test( "should parse invalid numbers as NaN", function( assert ) { + extraSetup(); + + assert.deepEqual( Globalize.parseNumber( "invalid" ), NaN ); + assert.deepEqual( Globalize.parseNumber( "NaN" ), NaN ); +}); + +/** + * Prefix + */ + +QUnit.test( "should parse literals", function( assert ) { + extraSetup(); + + // TODO: Move this test to parse-currency when implemented. + assert.equal( Globalize.parseNumber( "-$1,214.12", { raw: "'$'#,##0.##" } ), -1214.12 ); +}); + +/** + * Other + */ +QUnit.test( "should parse a formatted number (reverse operation test)", function( assert ) { + extraSetup(); + var options; + var number = 12345.67; + assert.equal( Globalize.parseNumber( Globalize.formatNumber( number ) ), number ); + assert.equal( ar.parseNumber( ar.formatNumber( number ) ), number ); + assert.equal( fa.parseNumber( fa.formatNumber( number ) ), number ); + + number = -12345.67; + assert.equal( Globalize.parseNumber( Globalize.formatNumber( number ) ), number ); + assert.equal( ar.parseNumber( ar.formatNumber( number ) ), number ); + assert.equal( fa.parseNumber( fa.formatNumber( number ) ), number ); + + number = 0.5; + options = { style: "percent" }; + + assert.equal( + Globalize.parseNumber( Globalize.formatNumber( number, options ), options ), + number + ); + + assert.equal( ar.parseNumber( ar.formatNumber( number, options ), options ), number ); + assert.equal( fa.parseNumber( fa.formatNumber( number, options ), options ), number ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/plural/plural-generator.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/plural/plural-generator.js new file mode 100644 index 000000000..a48c215df --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/plural/plural-generator.js @@ -0,0 +1,23 @@ +define([ + "globalize", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "json!cldr-data/supplemental/ordinals.json", + "../../util", + + "globalize/plural" +], function( Globalize, likelySubtags, plurals, ordinals, util ) { + +QUnit.module( ".pluralGenerator()", { + beforeEach: function() { + Globalize.load( likelySubtags, plurals, ordinals, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/plural/plural.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/plural/plural.js new file mode 100644 index 000000000..b34aa2c94 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/plural/plural.js @@ -0,0 +1,151 @@ +define([ + "globalize", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "json!cldr-data/supplemental/ordinals.json", + "../../util", + + "globalize/plural" +], function( Globalize, likelySubtags, plurals, ordinals, util ) { + +function extraSetup() { + Globalize.load( plurals ); + Globalize.load( ordinals ); + + // Temporary fix due to CLDR v26 regression about pt_BR plural + // http://unicode.org/cldr/trac/ticket/7178 + Globalize.load({ + "supplemental": { + "plurals-type-cardinal": { + pt: { + "pluralRule-count-one": "i = 0,1", + "pluralRule-count-other": "" + } + } + } + }); + +} + +QUnit.module( ".plural( value )", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate parameters", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.plural(); + }); + + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.plural( invalidValue ); + }; + }); + + util.assertPlainObjectParameter( assert, "options", function( invalidOptions ) { + return function() { + Globalize.plural( 0, invalidOptions ); + }; + }); +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.plural( 1 ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.plural( 1 ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.test( "should return plural form", function( assert ) { + extraSetup(); + assert.equal( Globalize.plural( 0 ), "other" ); + assert.equal( Globalize.plural( 0.14 ), "other" ); + + assert.equal( Globalize( "en" ).plural( 0 ), "other" ); + assert.equal( Globalize( "en" ).plural( 1 ), "one" ); + assert.equal( Globalize( "en" ).plural( 2 ), "other" ); + assert.equal( Globalize( "en" ).plural( 1412 ), "other" ); + assert.equal( Globalize( "en" ).plural( 0.14 ), "other" ); + assert.equal( Globalize( "en" ).plural( 3.14 ), "other" ); + + assert.equal( Globalize( "en" ).plural( 0, { type: "ordinal" } ), "other" ); + assert.equal( Globalize( "en" ).plural( 1, { type: "ordinal" } ), "one" ); + assert.equal( Globalize( "en" ).plural( 2, { type: "ordinal" } ), "two" ); + assert.equal( Globalize( "en" ).plural( 3, { type: "ordinal" } ), "few" ); + assert.equal( Globalize( "en" ).plural( 1412, { type: "ordinal" } ), "other" ); + assert.equal( Globalize( "en" ).plural( 0.14, { type: "ordinal" } ), "other" ); + assert.equal( Globalize( "en" ).plural( 3.14, { type: "ordinal" } ), "other" ); + + assert.equal( Globalize( "ar" ).plural( 0 ), "zero" ); + assert.equal( Globalize( "ar" ).plural( 1 ), "one" ); + assert.equal( Globalize( "ar" ).plural( 2 ), "two" ); + assert.equal( Globalize( "ar" ).plural( 3 ), "few" ); + assert.equal( Globalize( "ar" ).plural( 6 ), "few" ); + assert.equal( Globalize( "ar" ).plural( 9 ), "few" ); + assert.equal( Globalize( "ar" ).plural( 10 ), "few" ); + assert.equal( Globalize( "ar" ).plural( 11 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 15 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 21 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 70 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 99 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 100 ), "other" ); + assert.equal( Globalize( "ar" ).plural( 101 ), "other" ); + assert.equal( Globalize( "ar" ).plural( 102 ), "other" ); + assert.equal( Globalize( "ar" ).plural( 103 ), "few" ); + assert.equal( Globalize( "ar" ).plural( 111 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 199 ), "many" ); + assert.equal( Globalize( "ar" ).plural( 3.14 ), "other" ); + + [ 0, 1, 2, 3, 9, 10, 11, 99, 100, 101, 3.14 ].forEach(function( value ) { + assert.equal( Globalize( "ar" ).plural( value, { type: "ordinal" } ), "other" ); + }); + + assert.equal( Globalize( "ja" ).plural( 0 ), "other" ); + assert.equal( Globalize( "ja" ).plural( 1 ), "other" ); + assert.equal( Globalize( "ja" ).plural( 2 ), "other" ); + assert.equal( Globalize( "ja" ).plural( 3.14 ), "other" ); + + assert.equal( Globalize( "pt" ).plural( 0 ), "one" ); + assert.equal( Globalize( "pt" ).plural( 1 ), "one" ); + assert.equal( Globalize( "pt" ).plural( 2 ), "other" ); + assert.equal( Globalize( "pt" ).plural( 0.1 ), "one" ); + assert.equal( Globalize( "pt" ).plural( 3.14 ), "other" ); + + assert.equal( Globalize( "ru" ).plural( 0 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 1 ), "one" ); + assert.equal( Globalize( "ru" ).plural( 2 ), "few" ); + assert.equal( Globalize( "ru" ).plural( 3 ), "few" ); + assert.equal( Globalize( "ru" ).plural( 4 ), "few" ); + assert.equal( Globalize( "ru" ).plural( 5 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 6 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 9 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 11 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 12 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 19 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 21 ), "one" ); + assert.equal( Globalize( "ru" ).plural( 22 ), "few" ); + assert.equal( Globalize( "ru" ).plural( 29 ), "many" ); + assert.equal( Globalize( "ru" ).plural( 3.14 ), "other" ); + + assert.equal( Globalize( "zh" ).plural( 0 ), "other" ); + assert.equal( Globalize( "zh" ).plural( 1 ), "other" ); + assert.equal( Globalize( "zh" ).plural( 2 ), "other" ); + assert.equal( Globalize( "zh" ).plural( 3.14 ), "other" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/relative-time/format-relative-time.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/relative-time/format-relative-time.js new file mode 100644 index 000000000..415912266 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/relative-time/format-relative-time.js @@ -0,0 +1,105 @@ +define( [ + "globalize", + "json!cldr-data/main/en/dateFields.json", + "json!cldr-data/main/de/dateFields.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/number", + "globalize/relative-time" +], function( Globalize, enDateFields, deDateFields, enNumbers, deNumbers, + likelySubtags, numberingSystems, plurals, util ) { + +var de, en; + +QUnit.module( ".fomatRelativeTime( value, unit [, options] ) - no CLDR", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function( ) { + Globalize.formatRelativeTime( 1, "day" ); + }); +}); + +QUnit.test( "should un-register event listener", function( assert ) { + try { + Globalize.formatRelativeTime( 1, "day" ); + } catch ( error ) { + assert.equal( Globalize.cldr.ee.getListeners( "get" ).length, 0 ); + } +}); + +QUnit.module( ".formatRelativeTime( value, unit [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, enDateFields, deDateFields, + numberingSystems, enNumbers, deNumbers, + plurals ); + Globalize.locale( "en" ); + de = new Globalize( "de" ); + en = new Globalize( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate value argument presence", function( assert ) { + util.assertParameterPresence( assert, "value", function( ) { + Globalize.formatRelativeTime( ); + }); +}); + +QUnit.test( "should validate value argument is number", function( assert ) { + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function( ) { + Globalize.formatRelativeTime( invalidValue, "day" ); + }; + }); +}); + +QUnit.test( "should validate unit argument presence", function( assert ) { + util.assertParameterPresence( assert, "unit", function( ) { + Globalize.formatRelativeTime( 0 ); + }); +}); + +QUnit.test( "should validate unit argument is string", function( assert ) { + util.assertStringParameter( assert, "unit", function( invalidValue ) { + return function( ) { + Globalize.formatRelativeTime( 0, invalidValue ); + }; + }); +}); + +QUnit.test( "should format long form in past", function( assert ) { + assert.equal( en.formatRelativeTime( -2, "week" ), "2 weeks ago" ); +}); + +QUnit.test( "should format long form in future", function( assert ) { + assert.equal( en.formatRelativeTime( 3, "year" ), "in 3 years" ); +}); + +QUnit.test( "should format 0 offset with as special word", function( assert ) { + assert.equal( en.formatRelativeTime( 0, "day" ), "today" ); +}); + +QUnit.test( "should format 1 day of offset with special word", function( assert ) { + assert.equal( en.formatRelativeTime( 1, "day" ), "tomorrow" ); +}); + +QUnit.test( "should format using word if available", function( assert ) { + assert.equal( de.formatRelativeTime( 2, "day" ), "übermorgen" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/relative-time/relative-time-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/relative-time/relative-time-formatter.js new file mode 100644 index 000000000..2167a670e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/relative-time/relative-time-formatter.js @@ -0,0 +1,71 @@ +define( [ + "globalize", + "json!cldr-data/main/en/dateFields.json", + "json!cldr-data/main/de/dateFields.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/number", + "globalize/relative-time" +], function( Globalize, enDateFields, deDateFields, enNumbers, deNumbers, + likelySubtags, numberingSystems, plurals, util ) { + +var en, de; + +QUnit.module( ".relativeTimeFormatter( unit [, options] ) - no CLDR", { + beforeEach: function() { + Globalize.load( likelySubtags, { + main: { + en: {} + } + }); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function( ) { + Globalize.relativeTimeFormatter( "day" ); + }); +}); + +QUnit.module( ".relativeTimeFormatter( unit [, options] )", { + beforeEach: function() { + Globalize.load( likelySubtags, enDateFields, deDateFields, + numberingSystems, enNumbers, deNumbers, + plurals ); + Globalize.locale( "en" ); + en = new Globalize( "en" ); + de = new Globalize( "de" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate unit argument presence", function( assert ) { + util.assertParameterPresence( assert, "unit", function( ) { + Globalize.formatRelativeTime( 0 ); + }); +}); + +QUnit.test( "should validate unit argument is string", function( assert ) { + util.assertStringParameter( assert, "unit", function( invalidValue ) { + return function( ) { + Globalize.relativeTimeFormatter( invalidValue ); + }; + }); +}); + +QUnit.test( "should format long form", function( assert ) { + assert.equal( en.relativeTimeFormatter( "week" )( -2 ), "2 weeks ago" ); +}); + +QUnit.test( "should format using word if available", function( assert ) { + assert.equal( de.relativeTimeFormatter( "day" )( 2 ), "übermorgen" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/unit/format-unit.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/unit/format-unit.js new file mode 100644 index 000000000..fd1e9bcb3 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/unit/format-unit.js @@ -0,0 +1,139 @@ +define( [ + "globalize", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/main/en/units.json", + "json!cldr-data/main/de/units.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/unit" +], function( Globalize, enNumbers, deNumbers, enUnitFields, deUnitFields, likelySubtags, + numberingSystems, plurals, util ) { + +var de, en; + +QUnit.module( ".formatUnit( value, unit, options ) - no CLDR", { + beforeEach: function() { + Globalize.load( enUnitFields, likelySubtags ); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.formatUnit( 1, "day", { form: "long" } ); + }); +}); + +QUnit.module( ".formatUnit( value, unit, options )", { + beforeEach: function() { + Globalize.load( enNumbers, deNumbers, enUnitFields, deUnitFields, likelySubtags, + numberingSystems, plurals ); + de = new Globalize( "de" ); + en = new Globalize( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate value argument presence", function( assert ) { + util.assertParameterPresence( assert, "value", function() { + Globalize.formatUnit(); + }); +}); + +QUnit.test( "should validate value argument is number", function( assert ) { + util.assertNumberParameter( assert, "value", function( invalidValue ) { + return function() { + Globalize.formatUnit( invalidValue, "day" ); + }; + }); +}); + +QUnit.test( "should validate unit argument presence", function( assert ) { + util.assertParameterPresence( assert, "unit", function() { + Globalize.formatUnit( 0 ); + }); +}); + +QUnit.test( "should validate unit argument is string", function( assert ) { + util.assertStringParameter( assert, "unit", function( invalidValue ) { + return function() { + Globalize.formatUnit( 0, invalidValue ); + }; + }); +}); + +QUnit.test( "should validate options argument is object", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.formatUnit( 1, "day", invalidValue ); + }; + }); +}); + +QUnit.test( "should format units using default form", function( assert ) { + assert.equal( en.formatUnit( 1, "day" ), "1 day" ); + assert.equal( en.formatUnit( 100, "day" ), "100 days" ); + + assert.equal( de.formatUnit( 1, "day" ), "1 Tag" ); + assert.equal( de.formatUnit( 100, "day" ), "100 Tage" ); +}); + +QUnit.test( "should format long form units", function( assert ) { + assert.equal( en.formatUnit( 1, "day", { form: "long" } ), "1 day" ); + assert.equal( en.formatUnit( 100, "day", { form: "long" } ), "100 days" ); + + assert.equal( de.formatUnit( 1, "day", { form: "long" } ), "1 Tag" ); + assert.equal( de.formatUnit( 100, "day", { form: "long" } ), "100 Tage" ); +}); + +QUnit.test( "should format short form units", function( assert ) { + assert.equal( en.formatUnit( 1, "second", { form: "short" } ), "1 sec" ); + assert.equal( en.formatUnit( 100, "second", { form: "short" } ), "100 sec" ); +}); + +QUnit.test( "should format narrow form units", function( assert ) { + assert.equal( en.formatUnit( 1, "second", { form: "narrow" } ), "1s" ); + assert.equal( en.formatUnit( 100, "second", { form: "narrow" } ), "100s" ); +}); + +QUnit.test( "should format precomputed compound units", function( assert ) { + assert.equal( en.formatUnit( 5, "mile-per-hour", { form: "narrow" } ), "5mph" ); +}); + +QUnit.test( "should format computed compound units", function( assert ) { + assert.equal( en.formatUnit( 5, "mile-per-second", { form: "narrow" } ), "5mi/s" ); +}); + +QUnit.test( "should format precomputed compound units with '/'", function( assert ) { + assert.equal( en.formatUnit( 5, "mile/hour", { form: "narrow" } ), "5mph" ); +}); + +QUnit.test( "should format computed compound units with '/'", function( assert ) { + assert.equal( en.formatUnit( 5, "mile/second", { form: "narrow" } ), "5mi/s" ); +}); + +QUnit.test( "should format numbers correctly", function( assert ) { + assert.equal( en.formatUnit( 55000, "mile/hour", { form: "short" } ), "55,000 mph" ); + assert.equal( de.formatUnit( 55000, "mile/hour", { form: "short" } ), "55.000 mi/h" ); +}); + +QUnit.test( "should accept custom number formatters", function( assert ) { + var enCustomFormatter = en.numberFormatter({ useGrouping: false }), + deCustomFormatter = de.numberFormatter({ useGrouping: false }); + + assert.equal( en.formatUnit( 55000, "mile/hour", { + form: "short", + numberFormatter: enCustomFormatter + }), "55000 mph" ); + assert.equal( de.formatUnit( 55000, "mile/hour", { + form: "short", + numberFormatter: deCustomFormatter + }), "55000 mi/h" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/unit/unit-formatter.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/unit/unit-formatter.js new file mode 100644 index 000000000..44a17b0e4 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/functional/unit/unit-formatter.js @@ -0,0 +1,103 @@ +define( [ + "globalize", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/main/en/units.json", + "json!cldr-data/main/de/units.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + "json!cldr-data/supplemental/plurals.json", + "../../util", + + "globalize/unit" +], function( Globalize, enNumbers, deNumbers, enUnitFields, deUnitFields, likelySubtags, + numberingSystems, plurals, util ) { + +var de, en; + +QUnit.module( ".unitFormatter( unit, options ) - no CLDR", { + beforeEach: function() { + Globalize.load( enUnitFields, likelySubtags ); + Globalize.locale( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate CLDR content", function( assert ) { + util.assertCldrContent( assert, function() { + Globalize.unitFormatter( "day", { form: "long" } ); + }); +}); + +QUnit.module( ".unitFormatter( unit, options )", { + beforeEach: function() { + Globalize.load( enNumbers, deNumbers, enUnitFields, deUnitFields, likelySubtags, + numberingSystems, plurals ); + Globalize.locale( "en" ); + de = new Globalize( "de" ); + en = new Globalize( "en" ); + }, + afterEach: util.resetCldrContent +}); + +QUnit.test( "should validate unit argument presence", function( assert ) { + util.assertParameterPresence( assert, "unit", function() { + Globalize.unitFormatter(); + }); +}); + +QUnit.test( "should validate unit argument is string", function( assert ) { + util.assertStringParameter( assert, "unit", function( invalidValue ) { + return function() { + Globalize.unitFormatter( invalidValue ); + }; + }); +}); + +QUnit.test( "should validate options argument is object", function( assert ) { + util.assertPlainObjectParameter( assert, "options", function( invalidValue ) { + return function() { + Globalize.unitFormatter( "day", invalidValue ); + }; + }); +}); + +QUnit.test( "should format long form units", function( assert ) { + var enFormatter = en.unitFormatter( "day", { form: "long" } ), + deFormatter = de.unitFormatter( "day", { form: "long" } ); + + assert.equal( enFormatter( 1 ), "1 day" ); + assert.equal( enFormatter( 100 ), "100 days" ); + + assert.equal( deFormatter( 1 ), "1 Tag" ); + assert.equal( deFormatter( 100 ), "100 Tage" ); +}); + +QUnit.test( "should format numbers correctly", function( assert ) { + var enFormatter = en.unitFormatter( "day", { form: "long" } ), + deFormatter = de.unitFormatter( "day", { form: "long" } ); + + assert.equal( enFormatter( 10000 ), "10,000 days" ); + assert.equal( deFormatter( 10000 ), "10.000 Tage" ); +}); + +QUnit.test( "should accept custom number formatter", function( assert ) { + var enCustomFormatter = en.numberFormatter({ maximumFractionDigits: 2 }), + deCustomFormatter = de.numberFormatter({ maximumFractionDigits: 2 }), + enUnitFormatter = en.unitFormatter( "meter", { + form: "long", numberFormatter: enCustomFormatter + }), + deUnitFormatter = de.unitFormatter( "meter", { + form: "long", numberFormatter: deCustomFormatter + }); + + assert.equal( enUnitFormatter( 3.14159 ), "3.14 meters" ); + assert.equal( deUnitFormatter( 3.14159 ), "3,14 Meter" ); +}); + +QUnit.test( "should generate different runtime key when using different numberFormatter", function( assert ) { + var formatter1 = Globalize.unitFormatter( "hour", { numberFormatter: Globalize.numberFormatter( { minimumIntegerDigits: 1 } ) }); + var formatter2 = Globalize.unitFormatter( "hour", { numberFormatter: Globalize.numberFormatter( { minimumIntegerDigits: 2 } ) }); + assert.notEqual( formatter1.runtimeKey, formatter2.runtimeKey ); +}); +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit.html b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit.html new file mode 100644 index 000000000..5fdc5691d --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit.html @@ -0,0 +1,16 @@ + + + + + + Globalize Unit Tests + + + +
+
+ + + + + diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit.js new file mode 100644 index 000000000..f40502a92 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit.js @@ -0,0 +1,61 @@ +require([ + "qunit", + + // util + "./unit/util/object/invert", + "./unit/util/regexp/escape", + "./unit/util/regexp/not-s-and-z", + "./unit/util/regexp/not-s", + + // core + "./unit/core", + "./unit/core/locale", + + // currency + "./unit/currency/name-properties", + "./unit/currency/symbol-properties", + + "./unit/currency/name-format", + + // date + "./unit/date/expand-pattern/augment-format", + "./unit/date/expand-pattern/compare-formats", + "./unit/date/expand-pattern/get-best-match-pattern", + "./unit/date/expand-pattern", + "./unit/date/timezone-hour-format", + + "./unit/date/format-properties", + "./unit/date/parse-properties", + "./unit/date/tokenizer-properties", + + "./unit/date/format", + "./unit/date/tokenizer", + + "./unit/date/parse", + + // number + "./unit/number/pattern-properties", + "./unit/number/format/integer-fraction-digits", + "./unit/number/format/significant-digits", + "./unit/number/format/grouping-separator", + "./unit/number/format-properties", + "./unit/number/format", + "./unit/number/parse-properties", + "./unit/number/parse", + + // relative time + "./unit/relative-time/properties", + "./unit/relative-time/format", + + /* unit */ + "./unit/unit/get", + "./unit/unit/format" + +], function() { + QUnit.start(); +}, function( error ) { + QUnit.test( "requirejs load failure", function( assert ) { + assert.ok( false, "requirejs failed to load: " + QUnit.dump.parse( error ) ); + }); + QUnit.start(); +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/common/runtime-bind.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/common/runtime-bind.js new file mode 100644 index 000000000..7cd0fd090 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/common/runtime-bind.js @@ -0,0 +1,14 @@ +define([ + "src/common/runtime-bind", +], function( runtimeBind ) { + +QUnit.module( "Common (runtimeBind)" ); + +QUnit.test( "runtimeBind should work with anonymous function", function( assert ) { + var fn = function() { + return "passed"; + }; + assert.equal( runtimeBind({}, {}, fn, {})(), "passed" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/core.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/core.js new file mode 100644 index 000000000..6cf9e4611 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/core.js @@ -0,0 +1,107 @@ +define([ + "cldr", + "src/core", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event" +], function( Cldr, Globalize, likelySubtags ) { + +Cldr.load( likelySubtags, { + supplemental: { + likelySubtags: { + + // The below are fictitious locales for the purpose of this test. + // Note to self: don't use zz, Zzzz or ZZ. These are reserved subtags. + "xx": "xx-Xxxx-XX", + "yy": "yy-Xxxx-YY" + } + }, + main: { + "de-CH": { + "test-bundle": "de-CH" + }, + en: { + "test-bundle": "en" + }, + "en-GB": { + "test-bundle": "en-GB" + }, + "pa-Arab": { + "test-bundle": "pa-Arab" + }, + "sr-Cyrl": { + "test-bundle": "sr-Cyrl" + }, + "sr-Latn": { + "test-bundle": "sr-Latn" + }, + "uz-Arab": { + "test-bundle": "uz-Arab" + }, + "xx": { + "test-bundle": "xx" + }, + "yy-YY": { + "test-bundle": "yy-YY" + }, + "zh": { + "test-bundle": "zh" + }, + "zh-Hant": { + "test-bundle": "zh-Hant" + } + } +}); + +QUnit.module( "Globalize (constructor)" ); + +QUnit.test( "should allow String locale", function( assert ) { + var en = new Globalize( "en" ); + assert.ok( en instanceof Globalize ); + assert.equal( en.cldr.locale, "en" ); +}); + +QUnit.test( "should allow Cldr instance to be passed as locale", function( assert ) { + var en = Globalize( new Cldr( "en" ) ); + assert.ok( en instanceof Globalize ); + assert.equal( en.cldr.locale, "en" ); +}); + +QUnit.test( "should lookup bundle", function( assert ) { + assert.equal( Globalize( "de-Latn-CH" ).cldr.main( "test-bundle" ), "de-CH" ); + assert.equal( Globalize( "en" ).cldr.main( "test-bundle" ), "en" ); + assert.equal( Globalize( "en-GB" ).cldr.main( "test-bundle" ), "en-GB" ); + assert.equal( Globalize( "en-Latn-GB" ).cldr.main( "test-bundle" ), "en-GB" ); + assert.equal( Globalize( "pa-Arab" ).cldr.main( "test-bundle" ), "pa-Arab" ); + assert.equal( Globalize( "pa-PK" ).cldr.main( "test-bundle" ), "pa-Arab" ); + assert.equal( Globalize( "sr" ).cldr.main( "test-bundle" ), "sr-Cyrl" ); + assert.equal( Globalize( "sr-Cyrl" ).cldr.main( "test-bundle" ), "sr-Cyrl" ); + assert.equal( Globalize( "sr-Latn" ).cldr.main( "test-bundle" ), "sr-Latn" ); + assert.equal( Globalize( "sr-Latn-RS" ).cldr.main( "test-bundle" ), "sr-Latn" ); + assert.equal( Globalize( "sr-RS" ).cldr.main( "test-bundle" ), "sr-Cyrl" ); + assert.equal( Globalize( "uz-AF" ).cldr.main( "test-bundle" ), "uz-Arab" ); + assert.equal( Globalize( "uz-Arab" ).cldr.main( "test-bundle" ), "uz-Arab" ); + assert.equal( Globalize( "zh" ).cldr.main( "test-bundle" ), "zh" ); + assert.equal( Globalize( "zh-CN" ).cldr.main( "test-bundle" ), "zh" ); + assert.equal( Globalize( "zh-Hans" ).cldr.main( "test-bundle" ), "zh" ); + assert.equal( Globalize( "zh-Hant" ).cldr.main( "test-bundle" ), "zh-Hant" ); + assert.equal( Globalize( "zh-TW" ).cldr.main( "test-bundle" ), "zh-Hant" ); + + // Simulate loading `en` main dataset. Both instances `en` or `en-US` will use + // `en` bundle. + assert.equal( Globalize( "xx" ).cldr.main( "test-bundle" ), "xx" ); + assert.equal( Globalize( "xx-XX" ).cldr.main( "test-bundle" ), "xx" ); + + // Simulate loading `en-US` main dataset. Both instances `en` or `en-US` will use + // `en-US` bundle. + assert.equal( Globalize( "yy" ).cldr.main( "test-bundle" ), "yy-YY" ); + assert.equal( Globalize( "yy-YY" ).cldr.main( "test-bundle" ), "yy-YY" ); + + assert.throws(function() { + Globalize( "xx-XZ" ).cldr.main( "test-bundle" ); + }, function E_MISSING_BUNDLE( error ) { + return error.code === "E_MISSING_BUNDLE" && error.locale === "xx-XZ"; + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/core/locale.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/core/locale.js new file mode 100644 index 000000000..8cc0fbb3a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/core/locale.js @@ -0,0 +1,25 @@ +define([ + "cldr", + "src/core", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event" +], function( Cldr, Globalize, likelySubtags ) { + +Cldr.load( likelySubtags ); + +QUnit.module( "Globalize.locale" ); + +QUnit.test( "should allow String locale", function( assert ) { + Globalize.locale( "en" ); + assert.ok( Globalize.cldr instanceof Cldr ); + assert.equal( Globalize.cldr.locale, "en" ); +}); + +QUnit.test( "should allow Cldr instance to be passed as locale", function( assert ) { + Globalize.locale( new Cldr( "pt" ) ); + assert.ok( Globalize.cldr instanceof Cldr ); + assert.equal( Globalize.cldr.locale, "pt" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/name-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/name-format.js new file mode 100644 index 000000000..ae5030b26 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/name-format.js @@ -0,0 +1,142 @@ +define([ + "cldr", + "src/currency/name-format", + "src/currency/name-properties", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/zh/currencies.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, format, properties, enCurrencies, enNumbers, zhCurrencies, zhNumbers, + currencyData, likelySubtags ) { + +var en, zh; + +Cldr.load( + currencyData, + enCurrencies, + enNumbers, + likelySubtags, + zhCurrencies, + zhNumbers +); + +en = new Cldr( "en" ); +zh = new Cldr( "zh" ); + +QUnit.module( "Currency Name Format" ); + +QUnit.test( "should format currencies", function( assert ) { + assert.deepEqual( format( [{ type: "integer", value: "1" }], "one", properties( "USD", en ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "US dollar" + } + ]); + + assert.deepEqual( format( [{ type: "integer", value: "2" }], "other", properties( "USD", en ) ), [ + { + "type": "integer", + "value": "2" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "US dollars" + } + ]); + + // Test the fallback to displayNames by the lack of displayNames-count-*. + assert.deepEqual( format( [{ type: "integer", value: "1" }], "something", { + "displayNames": { + "displayName": "US Dollar", + }, + "unitPatterns": { + "unitPattern-count-other": "{0} {1}" + } + }), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "US Dollar" + } + ]); + + // Test the fallback to currency by the lack of displayName and displayName-count-*. + assert.deepEqual( format( [{ type: "integer", value: "1" }], "something", { + "currency": "USD", + "unitPatterns": { + "unitPattern-count-other": "{0} {1}" + } + }), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "currency", + "value": "USD" + } + ]); + + assert.deepEqual( format( [{ type: "integer", value: "10" }], "other", properties( "CNY", zh ) ), [ + { + "type": "integer", + "value": "10" + }, + { + "type": "currency", + "value": "人民币" + } + ]); + + // Testing inverted unitPattern {1} {0}. + assert.deepEqual( format( [{ type: "integer", value: "1" }], "other", { + "currency": "TZS", + "unitPatterns": { + "unitPattern-count-other": "{1} {0}" + } + }), [ + { + "type": "currency", + "value": "TZS" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "integer", + "value": "1" + } + ]); + +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/name-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/name-properties.js new file mode 100644 index 000000000..f0ac16c6a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/name-properties.js @@ -0,0 +1,89 @@ +define([ + "cldr", + "src/currency/name-properties", + "json!cldr-data/main/de/currencies.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/zh/currencies.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, properties, deCurrencies, deNumbers, enCurrencies, enNumbers, zhCurrencies, + zhNumbers, currencyData, likelySubtags ) { + +var de, en, zh; + +Cldr.load( + currencyData, + deCurrencies, + deNumbers, + enCurrencies, + enNumbers, + likelySubtags, + zhCurrencies, + zhNumbers +); + +de = new Cldr( "de" ); +en = new Cldr( "en" ); +zh = new Cldr( "zh" ); + +QUnit.module( "Currency Name Properties" ); + +QUnit.test( "should return appropriate properties", function( assert ) { + assert.deepEqual( properties( "USD", en ), { + "displayNames": { + "displayName": "US Dollar", + "displayName-count-one": "US dollar", + "displayName-count-other": "US dollars" + }, + "pattern": "#,##0.00", + "unitPatterns": { + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + } + }); + assert.deepEqual( properties( "EUR", de ), { + "displayNames": { + "displayName": "Euro", + "displayName-count-one": "Euro", + "displayName-count-other": "Euro" + }, + "pattern": "#,##0.00", + "unitPatterns": { + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + } + }); + assert.deepEqual( properties( "CNY", zh ), { + "displayNames": { + "displayName": "人民币", + "displayName-count-other": "人民币" + }, + "pattern": "#,##0.00", + "unitPatterns": { + "unitPattern-count-other": "{0}{1}" + } + }); + + // The number of decimal places and the rounding for each currency is not locale-specific data. + // Those values are overriden by Supplemental Currency Data. + assert.deepEqual( properties( "CLF", en ), { + "displayNames": { + "displayName": "Chilean Unit of Account (UF)", + "displayName-count-one": "Chilean unit of account (UF)", + "displayName-count-other": "Chilean units of account (UF)", + }, + "pattern": "#,##0.0000", + "unitPatterns": { + "unitPattern-count-one": "{0} {1}", + "unitPattern-count-other": "{0} {1}" + } + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/symbol-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/symbol-properties.js new file mode 100644 index 000000000..efd4cb5ac --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/currency/symbol-properties.js @@ -0,0 +1,94 @@ +define([ + "cldr", + "src/currency/symbol-properties", + "json!cldr-data/main/de/currencies.json", + "json!cldr-data/main/de/numbers.json", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/zh/currencies.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, symbolProperties, deCurrencies, deNumbers, enCurrencies, enNumbers, zhCurrencies, + zhNumbers, currencyData, likelySubtags ) { + +var de, en, zh; + +Cldr.load( + currencyData, + deCurrencies, + deNumbers, + enCurrencies, + enNumbers, + likelySubtags, + zhCurrencies, + zhNumbers +); + +de = new Cldr( "de" ); +en = new Cldr( "en" ); +zh = new Cldr( "zh" ); + +QUnit.module( "Currency Symbol Properties" ); + +QUnit.test( "should return pattern replacing `¤` with the appropriate currency symbol literal", function( assert ) { + assert.deepEqual( symbolProperties( "USD", en, {} ), { + "pattern": "¤#,##0.00", + "symbol": "$" + }); + assert.deepEqual( symbolProperties( "EUR", en, {} ), { + "pattern": "¤#,##0.00", + "symbol": "€" + }); + assert.deepEqual( symbolProperties( "CLF", en, {} ), { + "pattern": "¤ #,##0.0000", + "symbol": "CLF" + }); + assert.deepEqual( symbolProperties( "USD", de, {} ), { + "pattern": "#,##0.00 ¤", + "symbol": "$" + }); + assert.deepEqual( symbolProperties( "EUR", de, {} ), { + "pattern": "#,##0.00 ¤", + "symbol": "€" + }); + assert.deepEqual( symbolProperties( "USD", zh, {} ), { + "pattern": "¤#,##0.00", + "symbol": "US$" + }); + assert.deepEqual( symbolProperties( "EUR", zh, {} ), { + "pattern": "¤#,##0.00", + "symbol": "€" + }); + assert.deepEqual( symbolProperties( "RUB", en, {} ), { + "pattern": "¤ #,##0.00", + "symbol": "RUB" + }); + + assert.deepEqual( symbolProperties( "USD", en, { + style: "accounting" + }), { + "pattern": "¤#,##0.00;(¤#,##0.00)", + "symbol": "$" + }); +}); + +QUnit.test( "Should use the supplied symbolForm, falling back to standard if none is found", function( assert ) { + assert.deepEqual( + symbolProperties( "RUB", en, { symbolForm: "narrow" } ), + { "pattern": "¤#,##0.00", "symbol": "₽" } + ); + assert.deepEqual( + symbolProperties( "HKD", en, { symbolForm: "narrow" } ), + { "pattern": "¤#,##0.00", "symbol": "$" } + ); + assert.deepEqual( + symbolProperties( "CHF", en, { symbolForm: "narrow" } ), + { "pattern": "¤ #,##0.00", "symbol": "CHF" } + ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern.js new file mode 100644 index 000000000..5c36117f0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern.js @@ -0,0 +1,120 @@ +define([ + "cldr", + "src/date/expand-pattern", + "json!cldr-data/main/de/ca-gregorian.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/ru/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, expandPattern, deCaGregorian, enCaGregorian, ruCaGregorian, likelySubtags, + timeData ) { + +var de, en, ru; + +Cldr.load( deCaGregorian, enCaGregorian, ruCaGregorian, likelySubtags, timeData ); + +de = new Cldr( "de" ); +en = new Cldr( "en" ); +ru = new Cldr( "ru" ); + +QUnit.assert.expandPattern = function( cldr, style, expected ) { + this.equal( expandPattern( style, cldr ), expected ); +}; + +/** + * Test actual patterns here + * @see https://ssl.icu-project.org/icu4jweb/flexTest.jsp + */ + +QUnit.module( "Date Expand Pattern" ); + +QUnit.test( "should expand {skeleton: \"\"}", function( assert ) { + + // Direct map. + assert.expandPattern( en, { skeleton: "GyMMMEd" }, "E, MMM d, y G" ); + assert.expandPattern( de, { skeleton: "MMMMd" }, "d. MMMM" ); + assert.expandPattern( ru, { skeleton: "MMMMd" }, "d MMMM" ); + + // Preferred hour (j). + assert.expandPattern( en, { skeleton: "jmm" }, "h:mm a" ); + assert.expandPattern( de, { skeleton: "jmm" }, "HH:mm" ); + assert.expandPattern( ru, { skeleton: "jmm" }, "H:mm" ); + + // Best matches the whole skeleton. + assert.expandPattern( en, { skeleton: "hhmm" }, "hh:mm a" ); + assert.expandPattern( en, { skeleton: "HHmm" }, "HH:mm" ); + assert.expandPattern( en, { skeleton: "EHmss" }, "E HH:mm:ss" ); + assert.expandPattern( en, { skeleton: "hhmmssSS" }, "hh:mm:ss.SS a" ); + assert.expandPattern( en, { skeleton: "yy" }, "yy" ); + assert.expandPattern( de, { skeleton: "yMMMMd" }, "d. MMMM y" ); + assert.expandPattern( de, { skeleton: "MMMM" }, "LLLL" ); + assert.expandPattern( de, { skeleton: "yMMMM" }, "MMMM y" ); + assert.expandPattern( de, { skeleton: "EEEE" }, "cccc" ); + assert.expandPattern( de, { skeleton: "cccc" }, "cccc" ); + assert.expandPattern( de, { skeleton: "MMMMEEEEd" }, "EEEE, d. MMMM" ); + assert.expandPattern( de, { skeleton: "MMMMccccd" }, "EEEE, d. MMMM" ); + assert.expandPattern( de, { skeleton: "HHmm" }, "HH:mm" ); + assert.expandPattern( de, { skeleton: "HHmmssSS" }, "HH:mm:ss,SS" ); + assert.expandPattern( de, { skeleton: "EEEEHHmm" }, "EEEE, HH:mm" ); + assert.expandPattern( de, { skeleton: "EEEEHmm" }, "EEEE, HH:mm" ); + assert.expandPattern( de, { skeleton: "ccccHmm" }, "EEEE, HH:mm" ); + assert.expandPattern( ru, { skeleton: "yMMMMd" }, "d MMMM y 'г'." ); + assert.expandPattern( ru, { skeleton: "MMMM" }, "LLLL" ); + assert.expandPattern( ru, { skeleton: "yMMMM" }, "LLLL y 'г'." ); + assert.expandPattern( ru, { skeleton: "EEEE" }, "cccc" ); + assert.expandPattern( ru, { skeleton: "cccc" }, "cccc" ); + assert.expandPattern( ru, { skeleton: "MMMMEEEEd" }, "cccc, d MMMM" ); + assert.expandPattern( ru, { skeleton: "MMMMccccd" }, "cccc, d MMMM" ); + assert.expandPattern( ru, { skeleton: "HHmm" }, "HH:mm" ); + assert.expandPattern( ru, { skeleton: "EEEEHHmm" }, "EEEE HH:mm" ); + assert.expandPattern( ru, { skeleton: "EEEEHmm" }, "EEEE HH:mm" ); + assert.expandPattern( ru, { skeleton: "ccccHHmm" }, "EEEE HH:mm" ); + assert.expandPattern( ru, { skeleton: "ccccHmm" }, "EEEE HH:mm" ); + + // Best matches the date and time parts individually then combine them together. + assert.expandPattern( en, { skeleton: "GyMMMEdhms" }, "E, MMM d, y G, h:mm:ss a" ); + assert.expandPattern( en, { skeleton: "MMMMEdhm" }, "E, MMMM d 'at' h:mm a" ); + assert.expandPattern( en, { skeleton: "MMMMh" }, "LLLL 'at' h a" ); + assert.expandPattern( de, { skeleton: "MMMMEdhm" }, "E, d. MMMM 'um' h:mm a" ); + assert.expandPattern( ru, { skeleton: "MMMMEdhm" }, "ccc, d MMMM, h:mm a" ); +}); + +QUnit.test( "should throw exception on invalid skeletons", function( assert ) { + // Invalid characters. + assert.throws(function() { + expandPattern({ skeleton: "MMM d" }, en ); + }); + assert.throws(function() { + expandPattern({ skeleton: "MM/dd" }, en ); + }); + + // Invalid order. + assert.throws(function() { + expandPattern({ skeleton: "dM" }, en ); + }); + assert.throws(function() { + expandPattern({ skeleton: "My" }, en ); + expandPattern({ skeleton: "MMMy" }, en ); + }); +}); + +QUnit.test( "should expand {date: \"(full, ...)\"}", function( assert ) { + assert.expandPattern( en, { date: "full" }, "EEEE, MMMM d, y" ); +}); + +QUnit.test( "should expand {time: \"(full, ...)\"}", function( assert ) { + assert.expandPattern( en, { time: "full" }, "h:mm:ss a zzzz" ); +}); + +QUnit.test( "should expand {datetime: \"(full, ...)\"}", function( assert ) { + assert.expandPattern( en, { datetime: "full" }, "EEEE, MMMM d, y 'at' h:mm:ss a zzzz" ); +}); + +QUnit.test( "should expand {raw: \"\"}", function( assert ) { + assert.expandPattern( en, { raw: "MMM d" }, "MMM d" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/augment-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/augment-format.js new file mode 100644 index 000000000..702516799 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/augment-format.js @@ -0,0 +1,35 @@ +define([ + "src/date/expand-pattern/augment-format" +], function( augmentFormat ) { + +QUnit.module( "Date Expand Pattern Augment Format" ); + +QUnit.test( "should augment date skeletons", function( assert ) { + assert.equal( augmentFormat( "yy", "y", "." ), "yy" ); + assert.equal( augmentFormat( "yMMdd", "M/d/y", "." ), "MM/dd/y" ); + + assert.equal( augmentFormat( "MMMMd", "MMM d", "." ), "MMMM d" ); + assert.equal( augmentFormat( "MMMMd", "M d", "." ), "MMMM d" ); + assert.equal( augmentFormat( "MMMMd", "'M' M d", "." ), "'M' MMMM d" ); + + assert.equal( augmentFormat( "LLLL", "LLL", "." ), "LLLL" ); + assert.equal( augmentFormat( "LLLLd", "MMM d", "." ), "MMMM d" ); + + assert.equal( augmentFormat( "EEEE", "ccc", "." ), "cccc" ); + assert.equal( augmentFormat( "EEEEd", "d E", "."), "d EEEE" ); + + assert.equal( augmentFormat( "cccc", "ccc", "." ), "cccc" ); + assert.equal( augmentFormat( "ccccd", "d E", "." ), "d EEEE" ); +}); + +QUnit.test( "should augment time skeletons", function( assert ) { + assert.equal( augmentFormat( "hhmm", "h:mm a", "." ), "hh:mm a" ); + assert.equal( augmentFormat( "hhmmsS", "hh:mm:ss a", "." ), "hh:mm:ss.S a" ); + assert.equal( augmentFormat( "hhmmssSSS", "hh:mm:ss a", "," ), "hh:mm:ss,SSS a" ); +}); + +QUnit.test( "should augment datetime skeletons", function( assert ) { + assert.equal( augmentFormat( "EEEhhmmss", "E h:mm:ss a", "." ), "EEE hh:mm:ss a" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/compare-formats.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/compare-formats.js new file mode 100644 index 000000000..f9e41212a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/compare-formats.js @@ -0,0 +1,27 @@ +define([ + "src/date/expand-pattern/compare-formats" +], function( compareFormats ) { + +QUnit.module( "Date Expand Pattern Compare Formats" ); + +// "Most symbols have a small distance from each other, e.g., M ≅ L; E ≅ c; a ≅ b ≅ B; +// H ≅ k ≅ h ≅ K; ..." +QUnit.test( "should add a small distance on similar patterns", function( assert ) { + assert.ok( compareFormats( "MM", "LL" ) > compareFormats( "MM", "MM" ) ); + assert.ok( compareFormats( "MM", "LLL" ) > compareFormats( "MM", "MMM" ) ); + assert.ok( compareFormats( "E", "c" ) > compareFormats( "E", "E" ) ); +}); + +// Numeric (l<3) and text fields (l>=3) are given a larger distance from each other. +QUnit.test( "should add a larger distance comparing numeric vs text fields", function( assert ) { + assert.ok( compareFormats( "MM", "MMM" ) > compareFormats( "MM", "M" ) ); + assert.ok( compareFormats( "MMM", "MM" ) > compareFormats( "MMM", "MMMMM" ) ); +}); + +QUnit.test( "should mark not equal things", function( assert ) { + assert.equal( compareFormats( "yMd", "d" ), -1 ); + assert.equal( compareFormats( "MM", "d" ), -1 ); + assert.equal( compareFormats( "yMMd", "MMM" ), -1 ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/get-best-match-pattern.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/get-best-match-pattern.js new file mode 100644 index 000000000..6968af836 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/expand-pattern/get-best-match-pattern.js @@ -0,0 +1,55 @@ +define([ + "cldr", + "src/date/expand-pattern/get-best-match-pattern", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, getBestMatchPattern, enCaGregorian, likelySubtags ) { + +var en; + +Cldr.load( enCaGregorian, likelySubtags ); + +en = new Cldr( "en" ); + +QUnit.module( "Date Expand Pattern Get Best Match Pattern" ); + +QUnit.test( "should get best match pattern", function( assert ) { + assert.equal( getBestMatchPattern( en, "MMMM" ), "LLLL" ); + assert.equal( getBestMatchPattern( en, "MMMMd" ), "MMMM d" ); + + assert.equal( getBestMatchPattern( en, "EEE" ), "ccc" ); + assert.equal( getBestMatchPattern( en, "EEEE" ), "cccc" ); + assert.equal( getBestMatchPattern( en, "EEEd" ), "d EEE" ); + assert.equal( getBestMatchPattern( en, "EEEEd" ), "d EEEE" ); + + assert.equal( getBestMatchPattern( en, "ccc" ), "ccc" ); + assert.equal( getBestMatchPattern( en, "cccc" ), "cccc" ); + assert.equal( getBestMatchPattern( en, "cccd" ), "d EEE" ); + assert.equal( getBestMatchPattern( en, "ccccd" ), "d EEEE" ); + + assert.equal( getBestMatchPattern( en, "hhmms" ), "hh:mm:ss a" ); + assert.equal( getBestMatchPattern( en, "hhmmsS" ), "hh:mm:ss.S a" ); +}); + +QUnit.test( "should be order-proof", function( assert ) { + var original = Cldr._resolved.main.en.dates.calendars.gregorian.dateTimeFormats.availableFormats; + Cldr._resolved.main.en.dates.calendars.gregorian.dateTimeFormats.availableFormats = { + "MMMd": "MMM d", + "Md": "M/d" + }; + assert.equal( getBestMatchPattern( en, "MMdd" ), "MM/dd" ); + + Cldr._resolved.main.en.dates.calendars.gregorian.dateTimeFormats.availableFormats = { + "Md": "M/d", + "MMMd": "MMM d" + }; + assert.equal( getBestMatchPattern( en, "MMdd" ), "MM/dd" ); + + // Reset it. + Cldr._resolved.main.en.dates.calendars.gregorian.dateTimeFormats.availableFormats = original; +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/format-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/format-properties.js new file mode 100644 index 000000000..a6890d22e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/format-properties.js @@ -0,0 +1,215 @@ +define([ + "cldr", + "src/date/format-properties", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/en-GB/ca-gregorian.json", + "json!cldr-data/main/en-GB/timeZoneNames.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!cldr-data/supplemental/metaZones.json", + "json!iana-tz-data.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, properties, enCaGregorian, enTimeZoneNames, enGbCaGregorian, enGbTimeZoneNames, + likelySubtags, timeData, weekData, metaZones, ianaTimezoneData ) { + +var cldr; + +Cldr.load( + enCaGregorian, + enTimeZoneNames, + enGbCaGregorian, + enGbTimeZoneNames, + likelySubtags, + timeData, + weekData, + metaZones +); + +// Needed for globalizeDate. +Cldr.load({ + "globalize-iana": ianaTimezoneData +}); + +cldr = new Cldr( "en" ); + +QUnit.module( "Date Format Properties" ); + +/** + * Era + */ + +QUnit.test( "should return eras property for (G|GG|GGG|GGGG|GGGGG)", function( assert ) { + [ "G", "GG", "GGG", "GGGG", "GGGGG" ].forEach(function( pattern ) { + assert.ok( "eras" in properties( pattern, cldr ) ); + }); +}); + +/** + * Year + */ + +QUnit.test( "should return appropriate properties for year in \"week of year\" (Y+)", + function( assert ) { + [ "Y", "YY", "YYY", "YYYYY" ].forEach(function( pattern ) { + assert.ok( "firstDay" in properties( pattern, cldr ) ); + assert.ok( "minDays" in properties( pattern, cldr ) ); + }); +}); + +/** + * Quarter + */ + +QUnit.test( "should return quarters properties for quarter (QQQ|QQQQ|qqq|qqqq)", + function( assert ) { + [ "QQQ", "qqq", "QQQQ", "qqqq" ].forEach(function( pattern ) { + var character = pattern.charAt( 0 ), + length = pattern.length; + assert.ok( "quarters" in properties( pattern, cldr ) ); + assert.ok( character in properties( pattern, cldr ).quarters ); + assert.ok( length in properties( pattern, cldr ).quarters[ character ] ); + }); +}); + +/** + * Month + */ + +QUnit.test( "should return months properties for month (MMM|MMMM|MMMMM|LLL|LLLL|LLLLL)", + function( assert ) { + [ "MMM", "LLL", "MMMM", "LLLL", "MMMMM", "LLLLL" ].forEach(function( pattern ) { + var character = pattern.charAt( 0 ), + length = pattern.length; + assert.ok( "months" in properties( pattern, cldr ) ); + assert.ok( character in properties( pattern, cldr ).months ); + assert.ok( length in properties( pattern, cldr ).months[ character ] ); + }); +}); + +/** + * Week + */ + +QUnit.test( "should return appropriate properties for week of year (w) or week of month (W)", + function( assert ) { + [ "w", "W" ].forEach(function( pattern ) { + assert.ok( "firstDay" in properties( pattern, cldr ) ); + assert.ok( "minDays" in properties( pattern, cldr ) ); + }); +}); + +/** + * Week day + */ + +QUnit.test( "should return firstDay property for day of week (e|ee|c|cc)", function( assert ) { + [ "e", "c", "ee", "cc" ].forEach(function( pattern ) { + assert.ok( "firstDay" in properties( pattern, cldr ) ); + }); +}); + +QUnit.test( "should return days properties for day of week (eee..eeeeee|ccc..cccccc)", + function( assert ) { + [ "eee", "ccc", "eeee", "cccc", "eeeee", "ccccc", "eeeeee", "cccccc" ].forEach( + function( pattern ) { + var character = pattern.charAt( 0 ), + length = pattern.length; + assert.ok( "days" in properties( pattern, cldr ) ); + assert.ok( character in properties( pattern, cldr ).days ); + assert.ok( length in properties( pattern, cldr ).days[ character ] ); + }); +}); + +/** + * Period + */ + +QUnit.test( "should return dayPeriods property for period (a)", function( assert ) { + assert.ok( "dayPeriods" in properties( "a", cldr ) ); + assert.equal( Object.keys(properties( "a", cldr ).dayPeriods).length, 2 ); +}); + +/** + * Zone + */ + +QUnit.test( "should return properties for timezone (z)", function( assert ) { + var timeZone, + enGb = new Cldr( "en-GB" ); + + timeZone = "America/Los_Angeles"; + [ "z", "zz", "zzz" ].forEach(function( pattern ) { + assert.equal( properties( pattern, cldr, timeZone ).standardTzName, "PST" ); + assert.equal( properties( pattern, cldr, timeZone ).daylightTzName, "PDT" ); + }); + [ "zzzz" ].forEach(function( pattern ) { + assert.equal( properties( pattern, cldr, timeZone ).standardTzName, "Pacific Standard Time" ); + assert.equal( properties( pattern, cldr, timeZone ).daylightTzName, "Pacific Daylight Time" ); + }); + + // Test for ??: + timeZone = "Asia/Dubai"; + [ "z", "zz", "zzz" ].forEach(function( pattern ) { + var formatProperties = properties( pattern, cldr, timeZone ); + assert.ok( !( "standardTzName" in formatProperties ) ); + assert.ok( !( "daylightTzName" in formatProperties ) ); + assert.ok( "gmtFormat" in formatProperties ); + assert.ok( "gmtZeroFormat" in formatProperties ); + assert.ok( "hourFormat" in formatProperties ); + }); + [ "zzzz" ].forEach(function( pattern ) { + var formatProperties = properties( pattern, cldr, timeZone ); + assert.equal( formatProperties.standardTzName, "Gulf Standard Time" ); + assert.ok( !( "daylightTzName" in formatProperties ) ); + assert.ok( "gmtFormat" in formatProperties ); + assert.ok( "gmtZeroFormat" in formatProperties ); + assert.ok( "hourFormat" in formatProperties ); + }); + + // Test for two things: + // - daylightTzName using the zone data (primary), not the metazone (secondary try); + // - standardTzName being undefined, therefore requiring the O fallback properties; + timeZone = "Europe/London"; + [ "z", "zz", "zzz" ].forEach(function( pattern ) { + var formatProperties = properties( pattern, enGb, timeZone ); + assert.ok( !( "standardTzName" in formatProperties ) ); + assert.equal( formatProperties.daylightTzName, "BST" ); + assert.ok( "gmtFormat" in formatProperties ); + assert.ok( "gmtZeroFormat" in formatProperties ); + assert.ok( "hourFormat" in formatProperties ); + }); + [ "zzzz" ].forEach(function( pattern ) { + var formatProperties = properties( pattern, enGb, timeZone ); + assert.ok( !( "standardTzName" in formatProperties ) ); + assert.equal( formatProperties.daylightTzName, "British Summer Time" ); + assert.ok( "gmtFormat" in formatProperties ); + assert.ok( "gmtZeroFormat" in formatProperties ); + assert.ok( "hourFormat" in formatProperties ); + }); +}); + +QUnit.test( "should return properties for timezone (v)", function( assert ) { + assert.equal( properties( "v", cldr, "America/Los_Angeles" ).genericTzName, "PT" ); + assert.equal( properties( "vvvv", cldr, "America/Los_Angeles" ).genericTzName, "Pacific Time" ); +}); + +QUnit.test( "should return properties for timezone (V)", function( assert ) { + assert.equal( properties( "VV", cldr, "America/Los_Angeles" ).timeZoneName, "America/Los_Angeles" ); + assert.equal( properties( "VVV", cldr, "America/Los_Angeles" ).timeZoneName, "Los Angeles" ); + assert.equal( properties( "VVVV", cldr, "America/Los_Angeles" ).timeZoneName, "Los Angeles Time" ); + assert.equal( properties( "VVVV", cldr, "America/Sao_Paulo" ).timeZoneName, "Sao Paulo Time" ); +}); + +QUnit.test( "should return properties.timeZoneData when using timeZone argument", function( assert ) { + var formatProperties = properties( "d", cldr, "America/Los_Angeles" ); + assert.ok( "timeZoneData" in formatProperties ); + assert.ok( "offsets" in formatProperties.timeZoneData() ); + assert.ok( "untils" in formatProperties.timeZoneData() ); + assert.ok( "isdsts" in formatProperties.timeZoneData() ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/format.js new file mode 100644 index 000000000..8aad26522 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/format.js @@ -0,0 +1,1674 @@ +define([ + "cldr", + "src/date/format", + "src/date/format-properties", + "src/util/string/pad", + "json!cldr-data/main/de/ca-gregorian.json", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/en-GB/ca-gregorian.json", + "json!cldr-data/main/en-GB/timeZoneNames.json", + "json!cldr-data/main/en-IN/ca-gregorian.json", + "json!cldr-data/main/pt/ca-gregorian.json", + "json!cldr-data/main/ru/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/metaZones.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!iana-tz-data.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, format, formatProperties, stringPad, deCaGregorian, enCaGregorian, + enTimeZoneNames, enGbCaGregorian, enGbTimeZoneNames, enInCaGregorian, ptCaGregorian, + ruCaGregorian, likelySubtags, metaZones, timeData, weekData, ianaTimezoneData ) { + +var cldr, + year0 = new Date( -62167190400000 ), + yearBc = new Date( -62482053600000 ), + date1 = new Date( 1982, 0, 2, 9, 5, 59 ), + date2 = new Date( 2010, 8, 15, 17, 35, 7, 369 ), + date3 = new Date( 1981, 11, 31, 12 ), // thu + date4 = new Date( 1994, 11, 31, 12 ); // sat + +function FakeDate( timezoneOffset ) { + this.timezoneOffset = timezoneOffset; +} + +function simpleFormatter( pad ) { + return function( value ) { + return stringPad( value, pad ); + }; +} + +FakeDate.prototype.getTimezoneOffset = function() { + return this.timezoneOffset * -60; +}; + +Cldr.load( + deCaGregorian, + enCaGregorian, + enGbCaGregorian, + enGbTimeZoneNames, + enInCaGregorian, + enTimeZoneNames, + ptCaGregorian, + ruCaGregorian, + likelySubtags, + metaZones, + timeData, + weekData +); + +cldr = new Cldr( "en" ); + +Cldr.load({ + "main": { + "en": { + "dates": { + "timeZoneNames": { + "zone": { + "Foo": { + "Baz": { + "exemplarCity": "Foo City" + } + } + } + } + } + } + } +}); + +// Needed for globalizeDate. +Cldr.load({ + "globalize-iana": ianaTimezoneData +}, { + "globalize-iana": { + "zoneData": { + "Foo": { + "Bar": { + offsets: ianaTimezoneData.zoneData.UTC.offsets, + untils: ianaTimezoneData.zoneData.UTC.untils, + isdsts: ianaTimezoneData.zoneData.UTC.isdsts + }, + "Baz": { + offsets: ianaTimezoneData.zoneData.UTC.offsets, + untils: ianaTimezoneData.zoneData.UTC.untils, + isdsts: ianaTimezoneData.zoneData.UTC.isdsts + } + } + } + } +}); + +QUnit.assert.dateFormat = function( date, pattern, cldr, expected ) { + this.dateFormatWithTimezone( date, pattern, undefined, cldr, expected ); +}; + +QUnit.assert.dateFormatWithTimezone = function( date, pattern, timeZone, cldr, expected ) { + var pad, + numberFormatters = [], + properties = formatProperties( pattern, cldr, timeZone ); + + // Create simple number formatters for this test purposes. + for ( pad in properties.numberFormatters ) { + numberFormatters[ pad ] = simpleFormatter( pad ); + } + + this.deepEqual( format( date, numberFormatters, properties ), expected ); +}; + +QUnit.module( "Date Format" ); + +/** + * Era + */ + +QUnit.test( "should format era (G|GG|GGG)", function( assert ) { + + assert.dateFormat( date1, "G", cldr, [{ + type: "era", + value: "AD" + }]); + assert.dateFormat( year0, "G", cldr, [{ + type: "era", + value: "AD" + }]); + assert.dateFormat( yearBc, "G", cldr, [{ + type: "era", + value: "BC" + }]); + assert.dateFormat( date1, "GG", cldr, [{ + type: "era", + value: "AD" + }]); + assert.dateFormat( year0, "GG", cldr, [{ + type: "era", + value: "AD" + }]); + assert.dateFormat( yearBc, "GG", cldr, [{ + type: "era", + value: "BC" + }]); + assert.dateFormat( date1, "GGG", cldr, [{ + type: "era", + value: "AD" + }]); + assert.dateFormat( year0, "GGG", cldr, [{ + type: "era", + value: "AD" + }]); + assert.dateFormat( yearBc, "GGG", cldr, [{ + type: "era", + value: "BC" + }]); +}); + +QUnit.test( "should format era (GGGG)", function( assert ) { + assert.dateFormat( date1, "GGGG", cldr, [{ + type: "era", + value: "Anno Domini" + }]); + assert.dateFormat( year0, "GGGG", cldr, [{ + type: "era", + value: "Anno Domini" + }]); + assert.dateFormat( yearBc, "GGGG", cldr, [{ + type: "era", + value: "Before Christ" + }]); +}); + +QUnit.test( "should format era (GGGGG)", function( assert ) { + assert.dateFormat( date1, "GGGGG", cldr, [{ + type: "era", + value: "A" + }]); + assert.dateFormat( year0, "GGGGG", cldr, [{ + type: "era", + value: "A" + }]); + assert.dateFormat( yearBc, "GGGGG", cldr, [{ + type: "era", + value: "B" + }]); +}); + +/** + * Year + */ + +QUnit.test( "should format year (y) with no padding", function( assert ) { + assert.dateFormat( date2, "y", cldr, [{ + type: "year", + value: "2010" + }]); + assert.dateFormat( date1, "y", cldr, [{ + type: "year", + value: "1982" + }]); + assert.dateFormat( year0, "y", cldr, [{ + type: "year", + value: "0" + }]); +}); + +QUnit.test( "should format year (yy) with padding, and limit 2 digits", function( assert ) { + assert.dateFormat( date2, "yy", cldr, [{ + type: "year", + value: "10" + }]); + assert.dateFormat( date1, "yy", cldr, [{ + type: "year", + value: "82" + }]); + assert.dateFormat( year0, "yy", cldr, [{ + type: "year", + value: "00" + }]); +}); + +QUnit.test( "should format year (yyy+) with padding", function( assert ) { + assert.dateFormat( date1, "yyy", cldr, [{ + type: "year", + value: "1982" + }]); + assert.dateFormat( date2, "yyy", cldr, [{ + type: "year", + value: "2010" + }]); + assert.dateFormat( year0, "yyyy", cldr, [{ + type: "year", + value: "0000" + }]); + assert.dateFormat( date1, "yyyyy", cldr, [{ + type: "year", + value: "01982" + }]); + assert.dateFormat( date2, "yyyyy", cldr, [{ + type: "year", + value: "02010" + }]); +}); + +QUnit.test( "should format year in \"week of year\" (Y) with no padding", function( assert ) { + assert.dateFormat( date3, "Y", cldr, [{ + type: "year", + value: "1982" + }]); + assert.dateFormat( date4, "Y", cldr, [{ + type: "year", + value: "1994" + }]); +}); + +QUnit.test( "should format year in \"week of year\" (YY) with padding, and limit 2 digits", function( assert ) { + assert.dateFormat( date3, "YY", cldr, [{ + type: "year", + value: "82" + }]); + assert.dateFormat( date4, "YY", cldr, [{ + type: "year", + value: "94" + }]); +}); + +QUnit.test( "should format year in \"week of year\" (YYY+) with padding", function( assert ) { + assert.dateFormat( date3, "YYY", cldr, [{ + type: "year", + value: "1982" + }]); + assert.dateFormat( date4, "YYY", cldr, [{ + type: "year", + value: "1994" + }]); + assert.dateFormat( date3, "YYYYY", cldr, [{ + type: "year", + value: "01982" + }]); + assert.dateFormat( date4, "YYYYY", cldr, [{ + type: "year", + value: "01994" + }]); +}); + +/** + * Quarter + */ + +QUnit.test( "should format quarter (Q|q) with no padding", function( assert ) { + assert.dateFormat( date1, "Q", cldr, [{ + type: "quarter", + value: "1" + }]); + assert.dateFormat( date2, "Q", cldr, [{ + type: "quarter", + value: "3" + }]); + assert.dateFormat( date1, "q", cldr, [{ + type: "quarter", + value: "1" + }]); + assert.dateFormat( date2, "q", cldr, [{ + type: "quarter", + value: "3" + }]); +}); + +QUnit.test( "should format quarter (QQ|qq) with padding", function( assert ) { + assert.dateFormat( date1, "QQ", cldr, [{ + type: "quarter", + value: "01" + }]); + assert.dateFormat( date2, "QQ", cldr, [{ + type: "quarter", + value: "03" + }]); + assert.dateFormat( date1, "qq", cldr, [{ + type: "quarter", + value: "01" + }]); + assert.dateFormat( date2, "qq", cldr, [{ + type: "quarter", + value: "03" + }]); +}); + +QUnit.test( "should format quarter (QQQ|qqq)", function( assert ) { + assert.dateFormat( date1, "QQQ", cldr, [{ + type: "quarter", + value: "Q1" + }]); + assert.dateFormat( date2, "QQQ", cldr, [{ + type: "quarter", + value: "Q3" + }]); + assert.dateFormat( date1, "qqq", cldr, [{ + type: "quarter", + value: "Q1" + }]); + assert.dateFormat( date2, "qqq", cldr, [{ + type: "quarter", + value: "Q3" + }]); +}); + +QUnit.test( "should format quarter (QQQQ|qqqq) with padding", function( assert ) { + assert.dateFormat( date1, "QQQQ", cldr, [{ + type: "quarter", + value: "1st quarter" + }]); + assert.dateFormat( date2, "QQQQ", cldr, [{ + type: "quarter", + value: "3rd quarter" + }]); + assert.dateFormat( date1, "qqqq", cldr, [{ + type: "quarter", + value: "1st quarter" + }]); + assert.dateFormat( date2, "qqqq", cldr, [{ + type: "quarter", + value: "3rd quarter" + }]); +}); + +/** + * Month + */ + +QUnit.test( "should format month (M|L) with no padding", function( assert ) { + assert.dateFormat( date1, "M", cldr, [{ + type: "month", + value: "1" + }]); + assert.dateFormat( date2, "M", cldr, [{ + type: "month", + value: "9" + }]); + assert.dateFormat( date1, "L", cldr, [{ + type: "month", + value: "1" + }]); + assert.dateFormat( date2, "L", cldr, [{ + type: "month", + value: "9" + }]); +}); + +QUnit.test( "should format month (MM|LL) with padding", function( assert ) { + assert.dateFormat( date1, "MM", cldr, [{ + type: "month", + value: "01" + }]); + assert.dateFormat( date2, "MM", cldr, [{ + type: "month", + value: "09" + }]); + assert.dateFormat( date1, "LL", cldr, [{ + type: "month", + value: "01" + }]); + assert.dateFormat( date2, "LL", cldr, [{ + type: "month", + value: "09" + }]); +}); + +QUnit.test( "should format month (MMM|LLL)", function( assert ) { + assert.dateFormat( date1, "MMM", cldr, [{ + type: "month", + value: "Jan" + }]); + assert.dateFormat( date2, "MMM", cldr, [{ + type: "month", + value: "Sep" + }]); + assert.dateFormat( date1, "LLL", cldr, [{ + type: "month", + value: "Jan" + }]); + assert.dateFormat( date2, "LLL", cldr, [{ + type: "month", + value: "Sep" + }]); +}); + +QUnit.test( "should format month (MMMM|LLLL)", function( assert ) { + assert.dateFormat( date1, "MMMM", cldr, [{ + type: "month", + value: "January" + }]); + assert.dateFormat( date2, "MMMM", cldr, [{ + type: "month", + value: "September" + }]); + assert.dateFormat( date1, "LLLL", cldr, [{ + type: "month", + value: "January" + }]); + assert.dateFormat( date2, "LLLL", cldr, [{ + type: "month", + value: "September" + }]); +}); + +QUnit.test( "should format month (MMMMM|LLLLL)", function( assert ) { + assert.dateFormat( date1, "MMMMM", cldr, [{ + type: "month", + value: "J" + }]); + assert.dateFormat( date2, "MMMMM", cldr, [{ + type: "month", + value: "S" + }]); + assert.dateFormat( date1, "LLLLL", cldr, [{ + type: "month", + value: "J" + }]); + assert.dateFormat( date2, "LLLLL", cldr, [{ + type: "month", + value: "S" + }]); +}); + +/** + * Week + */ + +QUnit.test( "should format week of year (w) with no padding", function( assert ) { + assert.dateFormat( date1, "w", cldr, [{ + type: "week", + value: "1" + }]); + assert.dateFormat( date2, "w", cldr, [{ + type: "week", + value: "38" + }]); +}); + +QUnit.test( "should format week of year (ww) with padding", function( assert ) { + assert.dateFormat( date1, "ww", cldr, [{ + type: "week", + value: "01" + }]); + assert.dateFormat( date2, "ww", cldr, [{ + type: "week", + value: "38" + }]); +}); + +QUnit.test( "should format week of month (W)", function( assert ) { + assert.dateFormat( date1, "W", cldr, [{ + type: "week", + value: "1" + }]); + assert.dateFormat( date2, "W", cldr, [{ + type: "week", + value: "3" + }]); + assert.dateFormat( date3, "W", cldr, [{ + type: "week", + value: "5" + }]); +}); + +/** + * Day + */ + +QUnit.test( "should format day (d) with no padding", function( assert ) { + assert.dateFormat( date1, "d", cldr, [{ + type: "day", + value: "2" + }]); + assert.dateFormat( date2, "d", cldr, [{ + type: "day", + value: "15" + }]); +}); + +QUnit.test( "should format day (dd) with padding", function( assert ) { + assert.dateFormat( date1, "dd", cldr, [{ + type: "day", + value: "02" + }]); + assert.dateFormat( date2, "dd", cldr, [{ + type: "day", + value: "15" + }]); +}); + +QUnit.test( "should format day of year (D) with no padding", function( assert ) { + assert.dateFormat( date1, "D", cldr, [{ + type: "day", + value: "2" + }]); + assert.dateFormat( date2, "D", cldr, [{ + type: "day", + value: "258" + }]); +}); + +QUnit.test( "should format day of year (DD|DDD) with padding", function( assert ) { + assert.dateFormat( date1, "DD", cldr, [{ + type: "day", + value: "02" + }]); + assert.dateFormat( date1, "DDD", cldr, [{ + type: "day", + value: "002" + }]); + assert.dateFormat( date2, "DD", cldr, [{ + type: "day", + value: "258" + }]); +}); + +QUnit.test( "should format day of week in month (F)", function( assert ) { + assert.dateFormat( date1, "F", cldr, [{ + type: "day", + value: "1" + }]); + assert.dateFormat( date2, "F", cldr, [{ + type: "day", + value: "3" + }]); +}); + +/** + * Week day + */ +QUnit.test( "should format local day of week (e|c) with no padding", function( assert ) { + assert.dateFormat( date1, "e", cldr, [{ + type: "weekday", + value: "7" + }]); + assert.dateFormat( date2, "e", cldr, [{ + type: "weekday", + value: "4" + }]); + assert.dateFormat( date1, "c", cldr, [{ + type: "weekday", + value: "7" + }]); + assert.dateFormat( date2, "c", cldr, [{ + type: "weekday", + value: "4" + }]); +}); + +QUnit.test( "should format local day of week (ee|cc) with padding", function( assert ) { + assert.dateFormat( date1, "ee", cldr, [{ + type: "weekday", + value: "07" + }]); + assert.dateFormat( date2, "ee", cldr, [{ + type: "weekday", + value: "04" + }]); + assert.dateFormat( date1, "cc", cldr, [{ + type: "weekday", + value: "07" + }]); + assert.dateFormat( date2, "cc", cldr, [{ + type: "weekday", + value: "04" + }]); +}); + +QUnit.test( "should format local day of week (E|EE|EEE|eee|ccc)", function( assert ) { + assert.dateFormat( date1, "E", cldr, [{ + type: "weekday", + value: "Sat" + }]); + assert.dateFormat( date2, "E", cldr, [{ + type: "weekday", + value: "Wed" + }]); + assert.dateFormat( date1, "EE", cldr, [{ + type: "weekday", + value: "Sat" + }]); + assert.dateFormat( date2, "EE", cldr, [{ + type: "weekday", + value: "Wed" + }]); + assert.dateFormat( date1, "EEE", cldr, [{ + type: "weekday", + value: "Sat" + }]); + assert.dateFormat( date2, "EEE", cldr, [{ + type: "weekday", + value: "Wed" + }]); + assert.dateFormat( date1, "eee", cldr, [{ + type: "weekday", + value: "Sat" + }]); + assert.dateFormat( date2, "eee", cldr, [{ + type: "weekday", + value: "Wed" + }]); + assert.dateFormat( date1, "ccc", cldr, [{ + type: "weekday", + value: "Sat" + }]); + assert.dateFormat( date2, "ccc", cldr, [{ + type: "weekday", + value: "Wed" + }]); +}); + +QUnit.test( "should format local day of week (EEEE|eeee|cccc)", function( assert ) { + assert.dateFormat( date1, "EEEE", cldr, [{ + type: "weekday", + value: "Saturday" + }]); + assert.dateFormat( date2, "EEEE", cldr, [{ + type: "weekday", + value: "Wednesday" + }]); + assert.dateFormat( date1, "eeee", cldr, [{ + type: "weekday", + value: "Saturday" + }]); + assert.dateFormat( date2, "eeee", cldr, [{ + type: "weekday", + value: "Wednesday" + }]); + assert.dateFormat( date1, "cccc", cldr, [{ + type: "weekday", + value: "Saturday" + }]); + assert.dateFormat( date2, "cccc", cldr, [{ + type: "weekday", + value: "Wednesday" + }]); +}); + +QUnit.test( "should format local day of week (EEEEE|eeeee|ccccc)", function( assert ) { + assert.dateFormat( date1, "EEEEE", cldr, [{ + type: "weekday", + value: "S" + }]); + assert.dateFormat( date2, "EEEEE", cldr, [{ + type: "weekday", + value: "W" + }]); + assert.dateFormat( date1, "eeeee", cldr, [{ + type: "weekday", + value: "S" + }]); + assert.dateFormat( date2, "eeeee", cldr, [{ + type: "weekday", + value: "W" + }]); + assert.dateFormat( date1, "ccccc", cldr, [{ + type: "weekday", + value: "S" + }]); + assert.dateFormat( date2, "ccccc", cldr, [{ + type: "weekday", + value: "W" + }]); +}); + +QUnit.test( "should format local day of week (EEEEEE|eeeeee|cccccc)", function( assert ) { + assert.dateFormat( date1, "EEEEEE", cldr, [{ + type: "weekday", + value: "Sa" + }]); + assert.dateFormat( date2, "EEEEEE", cldr, [{ + type: "weekday", + value: "We" + }]); + assert.dateFormat( date1, "eeeeee", cldr, [{ + type: "weekday", + value: "Sa" + }]); + assert.dateFormat( date2, "eeeeee", cldr, [{ + type: "weekday", + value: "We" + }]); + assert.dateFormat( date1, "cccccc", cldr, [{ + type: "weekday", + value: "Sa" + }]); + assert.dateFormat( date2, "cccccc", cldr, [{ + type: "weekday", + value: "We" + }]); +}); + +/** + * Period + */ + +QUnit.test( "should format period (a)", function( assert ) { + assert.dateFormat( date1, "a", cldr, [{ + type: "dayperiod", + value: "AM" + }]); + assert.dateFormat( date2, "a", cldr, [{ + type: "dayperiod", + value: "PM" + }]); +}); + +/** + * Hour + */ + +QUnit.test( "should format hour (h) using 12-hour-cycle [1-12] with no padding", function( assert ) { + assert.dateFormat( date1, "h", cldr, [{ + type: "hour", + value: "9" + }]); + assert.dateFormat( date2, "h", cldr, [{ + type: "hour", + value: "5" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "h", cldr, [{ + type: "hour", + value: "12" + }]); +}); + +QUnit.test( "should format hour (hh) using 12-hour-cycle [1-12] with padding", function( assert ) { + assert.dateFormat( date1, "hh", cldr, [{ + type: "hour", + value: "09" + }]); + assert.dateFormat( date2, "hh", cldr, [{ + type: "hour", + value: "05" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "hh", cldr, [{ + type: "hour", + value: "12" + }]); +}); + +QUnit.test( "should format hour (H) using 24-hour-cycle [0-23] with no padding", function( assert ) { + assert.dateFormat( date1, "H", cldr, [{ + type: "hour", + value: "9" + }]); + assert.dateFormat( date2, "H", cldr, [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "H", cldr, [{ + type: "hour", + value: "0" + }]); +}); + +QUnit.test( "should format hour (HH) using 24-hour-cycle [0-23] with padding", function( assert ) { + assert.dateFormat( date1, "HH", cldr, [{ + type: "hour", + value: "09" + }]); + assert.dateFormat( date2, "HH", cldr, [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "HH", cldr, [{ + type: "hour", + value: "00" + }]); +}); + +QUnit.test( "should format hour (K) using 12-hour-cycle [0-11] with no padding", function( assert ) { + assert.dateFormat( date1, "K", cldr, [{ + type: "hour", + value: "9" + }]); + assert.dateFormat( date2, "K", cldr, [{ + type: "hour", + value: "5" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "K", cldr, [{ + type: "hour", + value: "0" + }]); +}); + +QUnit.test( "should format hour (KK) using 12-hour-cycle [0-11] with padding", function( assert ) { + assert.dateFormat( date1, "KK", cldr, [{ + type: "hour", + value: "09" + }]); + assert.dateFormat( date2, "KK", cldr, [{ + type: "hour", + value: "05" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "KK", cldr, [{ + type: "hour", + value: "00" + }]); +}); + +QUnit.test( "should format hour (k) using 24-hour-cycle [1-24] with no padding", function( assert ) { + assert.dateFormat( date1, "k", cldr, [{ + type: "hour", + value: "9" + }]); + assert.dateFormat( date2, "k", cldr, [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "k", cldr, [{ + type: "hour", + value: "24" + }]); +}); + +QUnit.test( "should format hour (kk) using 24-hour-cycle [1-24] with padding", function( assert ) { + assert.dateFormat( date1, "kk", cldr, [{ + type: "hour", + value: "09" + }]); + assert.dateFormat( date2, "kk", cldr, [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "kk", cldr, [{ + type: "hour", + value: "24" + }]); +}); + +QUnit.test( "should format hour (j) using preferred hour format for the locale (h, H, K, or k) with no padding", function( assert ) { + assert.dateFormat( date2, "j", cldr, [{ + type: "hour", + value: "5" + }]); + assert.dateFormat( date2, "j", new Cldr( "pt-BR" ), [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( date2, "j", new Cldr( "de" ), [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( date2, "j", new Cldr( "en-IN" ), [{ + type: "hour", + value: "5" + }]); + assert.dateFormat( date2, "j", new Cldr( "en-GB" ), [{ + type: "hour", + value: "17" + }]); + assert.dateFormat( date2, "j", new Cldr( "ru" ), [{ + type: "hour", + value: "17" + }]); +}); + +QUnit.test( "should format hour (jj) using preferred hour format for the locale (h, H, K, or k) with padding", function( assert ) { + assert.dateFormat( date1, "jj", cldr, [{ + type: "hour", + value: "09" + }]); + assert.dateFormat( date2, "jj", cldr, [{ + type: "hour", + value: "05" + }]); + assert.dateFormat( new Date( 0, 0, 0, 0 ), "jj", cldr, [{ + type: "hour", + value: "12" + }]); +}); + +/** + * Minute + */ + +QUnit.test( "should format minute (m) with no padding", function( assert ) { + assert.dateFormat( date1, "m", cldr, [{ + type: "minute", + value: "5" + }]); + assert.dateFormat( date2, "m", cldr, [{ + type: "minute", + value: "35" + }]); +}); + +QUnit.test( "should format minute (mm) with padding", function( assert ) { + assert.dateFormat( date1, "mm", cldr, [{ + type: "minute", + value: "05" + }]); + assert.dateFormat( date2, "mm", cldr, [{ + type: "minute", + value: "35" + }]); +}); + +/** + * Second + */ + +QUnit.test( "should format second (s) with no padding", function( assert ) { + assert.dateFormat( date1, "s", cldr, [{ + type: "second", + value: "59" + }]); + assert.dateFormat( date2, "s", cldr, [{ + type: "second", + value: "7" + }]); +}); + +QUnit.test( "should format second (ss) with padding", function( assert ) { + assert.dateFormat( date1, "ss", cldr, [{ + type: "second", + value: "59" + }]); + assert.dateFormat( date2, "ss", cldr, [{ + type: "second", + value: "07" + }]); +}); + +QUnit.test( "should format various milliseconds (S+)", function( assert ) { + assert.dateFormat( date2, "S", cldr, [{ + type: "second", + value: "4" + }]); + assert.dateFormat( date2, "SS", cldr, [{ + type: "second", + value: "37" + }]); + assert.dateFormat( date2, "SSS", cldr, [{ + type: "second", + value: "369" + }]); + assert.dateFormat( date2, "SSSS", cldr, [{ + type: "second", + value: "3690" + }]); + assert.dateFormat( date2, "SSSSS", cldr, [{ + type: "second", + value: "36900" + }]); +}); + +QUnit.test( "should format various milliseconds (A+)", function( assert ) { + assert.dateFormat( date2, "A", cldr, [{ + type: "second", + value: "633074" + }]); + assert.dateFormat( date2, "AA", cldr, [{ + type: "second", + value: "6330737" + }]); + assert.dateFormat( date2, "AAA", cldr, [{ + type: "second", + value: "63307369" + }]); + assert.dateFormat( date2, "AAAA", cldr, [{ + type: "second", + value: "633073690" + }]); + assert.dateFormat( date2, "AAAAA", cldr, [{ + type: "second", + value: "6330736900" + }]); +}); + +/** + * Zone + */ +QUnit.test( "should format timezone (z)", function( assert ) { + var date, + enGb = new Cldr( "en-GB" ); + + // Test for country with Daylight Savings and Standard time, e.g., Pacific Standard Time and + // Pacific Daylight Time. + date = new Date( 2017, 0, 1 ); + assert.dateFormatWithTimezone( date, "z", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PST" + }]); + assert.dateFormatWithTimezone( date, "zz", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PST" + }]); + assert.dateFormatWithTimezone( date, "zzz", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PST" + }]); + assert.dateFormatWithTimezone( date, "zzzz", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "Pacific Standard Time" + }]); + + date = new Date( 2017, 6, 1 ); + assert.dateFormatWithTimezone( date, "z", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PDT" + }]); + assert.dateFormatWithTimezone( date, "zz", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PDT" + }]); + assert.dateFormatWithTimezone( date, "zzz", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PDT" + }]); + assert.dateFormatWithTimezone( date, "zzzz", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "Pacific Daylight Time" + }]); + + date = new Date( 2017, 0, 1 ); + assert.dateFormatWithTimezone( date, "zzzz", "Asia/Dubai", cldr, [{ + type: "zone", + value: "Gulf Standard Time" + }]); + + date = new Date( 2017, 6, 1 ); + assert.dateFormatWithTimezone( date, "zzzz", "Asia/Dubai", cldr, [{ + type: "zone", + value: "Gulf Standard Time" + }]); + + // Test for two things: + // - daylightTzName using the zone data (primary), not the metazone (secondary try); + // - standardTzName being undefined, therefore requiring the O fallback properties; + date = new Date( "2015-06-01T12:32:46" ); + assert.dateFormatWithTimezone( date, "z", "Europe/London", enGb, [{ + type: "zone", + value: "BST" + }]); + assert.dateFormatWithTimezone( date, "zz", "Europe/London", enGb, [{ + type: "zone", + value: "BST" + }]); + assert.dateFormatWithTimezone( date, "zzz", "Europe/London", enGb, [{ + type: "zone", + value: "BST" + }]); + assert.dateFormatWithTimezone( date, "zzzz", "Europe/London", enGb, [{ + type: "zone", + value: "British Summer Time" + }]); + + date = new Date( "2015-01-01T12:32:46" ); + assert.dateFormatWithTimezone( date, "z", "Europe/London", enGb, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormatWithTimezone( date, "zz", "Europe/London", enGb, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormatWithTimezone( date, "zzz", "Europe/London", enGb, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormatWithTimezone( date, "zzzz", "Europe/London", enGb, [{ + type: "zone", + value: "GMT" + }]); + + // Test for country with only standard time, e.g., long: Indian Standard Time. + // This test also covers the case where timezone name is undefined like short timezone name for + // Asia/Calcutta and should fall through 'O' format. + // isDST === false. + date = new Date( 2017, 0, 1 ); + assert.dateFormatWithTimezone( date, "z", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+5:30" + }]); + assert.dateFormatWithTimezone( date, "zz", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+5:30" + }]); + assert.dateFormatWithTimezone( date, "zzz", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+5:30" + }]); + assert.dateFormatWithTimezone( date, "zzzz", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "India Standard Time" + }]); + + // isDST === true: + date = new Date( 1943, 0, 1 ); + assert.dateFormatWithTimezone( date, "z", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+6:30" + }]); + assert.dateFormatWithTimezone( date, "zz", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+6:30" + }]); + assert.dateFormatWithTimezone( date, "zzz", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+6:30" + }]); + + // Fall through to 'O' format + assert.dateFormatWithTimezone( date, "zzzz", "Asia/Calcutta", cldr, [{ + type: "zone", + value: "GMT+06:30" + }]); + assert.dateFormatWithTimezone( date1, "z", "Foo/Bar", cldr, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormatWithTimezone( date1, "zz", "Foo/Bar", cldr, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormatWithTimezone( date1, "zzz", "Foo/Bar", cldr, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormatWithTimezone( date1, "zzzz", "Foo/Bar", cldr, [{ + type: "zone", + value: "GMT" + }]); +}); + +QUnit.test( "should format timezone (Z)", function( assert ) { + var date = new FakeDate( 0 ); + assert.dateFormat( date, "Z", cldr, [{ + type: "zone", + value: "+0000" + }]); + assert.dateFormat( date, "ZZ", cldr, [{ + type: "zone", + value: "+0000" + }]); + assert.dateFormat( date, "ZZZ", cldr, [{ + type: "zone", + value: "+0000" + }]); + assert.dateFormat( date, "ZZZZ", cldr, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormat( date, "ZZZZZ", cldr, [{ + type: "zone", + value: "Z" + }]); + + date = new FakeDate( -3 ); + assert.dateFormat( date, "Z", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "ZZ", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "ZZZ", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "ZZZZ", cldr, [{ + type: "zone", + value: "GMT-03:00" + }]); + assert.dateFormat( date, "ZZZZZ", cldr, [{ + type: "zone", + value: "-03:00" + }]); + + date = new FakeDate( 11 ); + assert.dateFormat( date, "Z", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "ZZ", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "ZZZ", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "ZZZZ", cldr, [{ + type: "zone", + value: "GMT+11:00" + }]); + assert.dateFormat( date, "ZZZZZ", cldr, [{ + type: "zone", + value: "+11:00" + }]); +}); + +QUnit.test( "should format timezone (O)", function( assert ) { + var date = new FakeDate( 0 ); + assert.dateFormat( date, "O", cldr, [{ + type: "zone", + value: "GMT" + }]); + assert.dateFormat( date, "OOOO", cldr, [{ + type: "zone", + value: "GMT" + }]); + + date = new FakeDate( -3 ); + assert.dateFormat( date, "O", cldr, [{ + type: "zone", + value: "GMT-3" + }]); + assert.dateFormat( date, "OOOO", cldr, [{ + type: "zone", + value: "GMT-03:00" + }]); + + date = new FakeDate( 11 ); + assert.dateFormat( date, "O", cldr, [{ + type: "zone", + value: "GMT+11" + }]); + assert.dateFormat( date, "OOOO", cldr, [{ + type: "zone", + value: "GMT+11:00" + }]); + + // TODO Support optional seconds. + date = new FakeDate( -7.883 ); + assert.dateFormat( date, "O", cldr, [{ + type: "zone", + value: "GMT-7:52" + }]); + assert.dateFormat( date, "OOOO", cldr, [{ + type: "zone", + value: "GMT-07:52" + }]); + + date = new FakeDate( 5.5 ); + assert.dateFormat( date, "O", cldr, [{ + type: "zone", + value: "GMT+5:30" + }]); + assert.dateFormat( date, "OOOO", cldr, [{ + type: "zone", + value: "GMT+05:30" + }]); +}); + +QUnit.test( "should format timezone (v)", function( assert ) { + var date = new Date( 2017, 5, 1 ); + assert.dateFormatWithTimezone( date, "v", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "PT" + }]); + assert.dateFormatWithTimezone( date, "vvvv", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "Pacific Time" + }]); + + // Use metazone. + assert.dateFormatWithTimezone( date, "vvvv", "America/Sao_Paulo", cldr, [{ + type: "zone", + value: "Brasilia Time" + }]); + + // Fall through 'VVVV' format. + assert.dateFormatWithTimezone( date, "v", "America/Sao_Paulo", cldr, [{ + type: "zone", + value: "Sao Paulo Time" + }]); + assert.dateFormatWithTimezone( date, "v", "Foo/Baz", cldr, [{ + type: "zone", + value: "Foo City Time" + }]); + assert.dateFormatWithTimezone( date, "vvvv", "Foo/Baz", cldr, [{ + type: "zone", + value: "Foo City Time" + }]); + + // Fall through 'O' and 'OOOO' formats. + assert.dateFormatWithTimezone( date, "v", "Etc/GMT+8", cldr, [{ + type: "zone", + value: "GMT-8" + }]); + assert.dateFormatWithTimezone( date, "vvvv", "Etc/GMT+8", cldr, [{ + type: "zone", + value: "GMT-08:00" + }]); +}); + +QUnit.test( "should format timezone (V)", function( assert ) { + var date = new Date( 2017, 5, 1 ); + assert.dateFormatWithTimezone( date, "VV", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "America/Los_Angeles" + }]); + assert.dateFormatWithTimezone( date, "VVV", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "Los Angeles" + }]); + assert.dateFormatWithTimezone( date, "VVVV", "America/Los_Angeles", cldr, [{ + type: "zone", + value: "Los Angeles Time" + }]); + assert.dateFormatWithTimezone( date, "VVVV", "America/Sao_Paulo", cldr, [{ + type: "zone", + value: "Sao Paulo Time" + }]); + + // Fall through 'VVV' format with "Unknown" exemplarCity. + assert.dateFormatWithTimezone( date, "VVV", "Foo/Bar", cldr, [{ + type: "zone", + value: "Unknown City" + }]); + + // Fall through 'OOOO' format. + assert.dateFormatWithTimezone( date, "VVVV", "Etc/GMT+8", cldr, [{ + type: "zone", + value: "GMT-08:00" + }]); +}); + +QUnit.test( "should format timezone (X)", function( assert ) { + var date = new FakeDate( 0 ); + assert.dateFormat( date, "X", cldr, [{ + type: "zone", + value: "Z" + }]); + assert.dateFormat( date, "XX", cldr, [{ + type: "zone", + value: "Z" + }]); + assert.dateFormat( date, "XXX", cldr, [{ + type: "zone", + value: "Z" + }]); + assert.dateFormat( date, "XXXX", cldr, [{ + type: "zone", + value: "Z" + }]); + assert.dateFormat( date, "XXXXX", cldr, [{ + type: "zone", + value: "Z" + }]); + + date = new FakeDate( -3 ); + assert.dateFormat( date, "X", cldr, [{ + type: "zone", + value: "-03" + }]); + assert.dateFormat( date, "XX", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "XXX", cldr, [{ + type: "zone", + value: "-03:00" + }]); + assert.dateFormat( date, "XXXX", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "XXXXX", cldr, [{ + type: "zone", + value: "-03:00" + }]); + + date = new FakeDate( -7.883 ); + assert.dateFormat( date, "X", cldr, [{ + type: "zone", + value: "-0752" + }]); + assert.dateFormat( date, "XX", cldr, [{ + type: "zone", + value: "-0752" + }]); + assert.dateFormat( date, "XXX", cldr, [{ + type: "zone", + value: "-07:52" + }]); + assert.dateFormat( date, "XXXX", cldr, [{ + type: "zone", + value: "-075258" + }]); + assert.dateFormat( date, "XXXXX", cldr, [{ + type: "zone", + value: "-07:52:58" + }]); + + date = new FakeDate( 5.5 ); + assert.dateFormat( date, "X", cldr, [{ + type: "zone", + value: "+0530" + }]); + assert.dateFormat( date, "XX", cldr, [{ + type: "zone", + value: "+0530" + }]); + assert.dateFormat( date, "XXX", cldr, [{ + type: "zone", + value: "+05:30" + }]); + assert.dateFormat( date, "XXXX", cldr, [{ + type: "zone", + value: "+0530" + }]); + assert.dateFormat( date, "XXXXX", cldr, [{ + type: "zone", + value: "+05:30" + }]); + + date = new FakeDate( 11 ); + assert.dateFormat( date, "X", cldr, [{ + type: "zone", + value: "+11" + }]); + assert.dateFormat( date, "XX", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "XXX", cldr, [{ + type: "zone", + value: "+11:00" + }]); + assert.dateFormat( date, "XXXX", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "XXXXX", cldr, [{ + type: "zone", + value: "+11:00" + }]); +}); + +QUnit.test( "should format timezone (x)", function( assert ) { + var date = new FakeDate( 0 ); + assert.dateFormat( date, "x", cldr, [{ + type: "zone", + value: "+00" + }]); + assert.dateFormat( date, "xx", cldr, [{ + type: "zone", + value: "+0000" + }]); + assert.dateFormat( date, "xxx", cldr, [{ + type: "zone", + value: "+00:00" + }]); + assert.dateFormat( date, "xxxx", cldr, [{ + type: "zone", + value: "+0000" + }]); + assert.dateFormat( date, "xxxxx", cldr, [{ + type: "zone", + value: "+00:00" + }]); + + date = new FakeDate( -3 ); + assert.dateFormat( date, "x", cldr, [{ + type: "zone", + value: "-03" + }]); + assert.dateFormat( date, "xx", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "xxx", cldr, [{ + type: "zone", + value: "-03:00" + }]); + assert.dateFormat( date, "xxxx", cldr, [{ + type: "zone", + value: "-0300" + }]); + assert.dateFormat( date, "xxxxx", cldr, [{ + type: "zone", + value: "-03:00" + }]); + + date = new FakeDate( -7.883 ); + assert.dateFormat( date, "x", cldr, [{ + type: "zone", + value: "-0752" + }]); + assert.dateFormat( date, "xx", cldr, [{ + type: "zone", + value: "-0752" + }]); + assert.dateFormat( date, "xxx", cldr, [{ + type: "zone", + value: "-07:52" + }]); + assert.dateFormat( date, "xxxx", cldr, [{ + type: "zone", + value: "-075258" + }]); + assert.dateFormat( date, "xxxxx", cldr, [{ + type: "zone", + value: "-07:52:58" + }]); + + date = new FakeDate( 5.5 ); + + assert.dateFormat( date, "x", cldr, [{ + type: "zone", + value: "+0530" + }]); + assert.dateFormat( date, "xx", cldr, [{ + type: "zone", + value: "+0530" + }]); + assert.dateFormat( date, "xxx", cldr, [{ + type: "zone", + value: "+05:30" + }]); + assert.dateFormat( date, "xxxx", cldr, [{ + type: "zone", + value: "+0530" + }]); + assert.dateFormat( date, "xxxxx", cldr, [{ + type: "zone", + value: "+05:30" + }]); + + date = new FakeDate( 11 ); + assert.dateFormat( date, "x", cldr, [{ + type: "zone", + value: "+11" + }]); + assert.dateFormat( date, "xx", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "xxx", cldr, [{ + type: "zone", + value: "+11:00" + }]); + assert.dateFormat( date, "xxxx", cldr, [{ + type: "zone", + value: "+1100" + }]); + assert.dateFormat( date, "xxxxx", cldr, [{ + type: "zone", + value: "+11:00" + }]); +}); + +/** + * Literal + */ +QUnit.test( "should format literal (')", function( assert ) { + assert.dateFormat( date1, "yyyy.MM.dd G 'at' HH:mm:ss", cldr, [ + { + "type": "year", + "value": "1982" + }, + { + "type": "literal", + "value": "." + }, + { + "type": "month", + "value": "01" + }, + { + "type": "literal", + "value": "." + }, + { + "type": "day", + "value": "02" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "era", + "value": "AD" + }, + { + "type": "literal", + "value": " at " + }, + { + "type": "hour", + "value": "09" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "minute", + "value": "05" + }, + { + "type": "literal", + "value": ":" + }, + { + "type": "second", + "value": "59" + } + ]); + + assert.dateFormat( date1, "hh 'o''clock' a", cldr, [ + { + "type": "hour", + "value": "09" + }, + { + "type": "literal", + "value": " o'clock " + }, + { + "type": "dayperiod", + "value": "AM" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/parse-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/parse-properties.js new file mode 100644 index 000000000..46149e937 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/parse-properties.js @@ -0,0 +1,43 @@ +define([ + "cldr", + "src/date/parse-properties", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + "json!iana-tz-data.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, parseProperties, enCaGregorian, likelySubtags, timeData, ianaTimezoneData ) { + +var cldr; + +Cldr.load( + enCaGregorian, + likelySubtags, + timeData +); + +// Needed for globalizeDate. +Cldr.load({ + "globalize-iana": ianaTimezoneData +}); + +cldr = new Cldr( "en" ); + +QUnit.module( "Date Parse Properties" ); + +QUnit.test( "should return parse properties", function( assert ) { + var properties; + + assert.ok( "preferredTimeData" in parseProperties( cldr ) ); + + properties = parseProperties( cldr, "America/Los_Angeles" ); + assert.ok( "preferredTimeData" in properties ); + assert.ok( "timeZoneData" in properties ); + assert.ok( "offsets" in properties.timeZoneData() ); + assert.ok( "untils" in properties.timeZoneData() ); + assert.ok( "isdsts" in properties.timeZoneData() ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/parse.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/parse.js new file mode 100644 index 000000000..336524cfb --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/parse.js @@ -0,0 +1,1283 @@ +define([ + "cldr", + "src/date/parse", + "src/date/parse-properties", + "src/date/start-of", + "src/date/tokenizer", + "src/date/tokenizer-properties", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/en-GB/ca-gregorian.json", + "json!cldr-data/main/en-GB/numbers.json", + "json!cldr-data/main/en-GB/timeZoneNames.json", + "json!cldr-data/main/fr/ca-gregorian.json", + "json!cldr-data/main/fr/numbers.json", + "json!cldr-data/main/fr/timeZoneNames.json", + "json!cldr-data/main/tr/ca-gregorian.json", + "json!cldr-data/main/tr/numbers.json", + "json!cldr-data/main/zh/ca-gregorian.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!iana-tz-data.json", + "../../util", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, parse, parseProperties, startOf, tokenizer, dateTokenizerProperties, + enCaGregorian, enNumbers, enTimeZoneNames, enGbCaGregorian, enGbNumbers, enGbTimeZoneNames, + frCaGregorian, frNumbers, frTimeZoneNames, trCaGregorian, trNumbers, zhCaGregorian, zhNumbers, + likelySubtags, timeData, weekData, ianaTimezoneData, util ) { + +var cldr, date1, date2, fr, midnight, zh; + +QUnit.assert.dateParse = function( stringDate, pattern, cldr, expected ) { + this.dateParseWithTimezone( stringDate, pattern, undefined, cldr, expected ); +}; + +QUnit.assert.dateParseWithTimezone = function( stringDate, pattern, timeZone, cldr, expected ) { + var tokenizerProperties, tokens; + + tokenizerProperties = dateTokenizerProperties( pattern, cldr, timeZone ); + tokens = tokenizer( stringDate, simpleNumberParser, tokenizerProperties ); + + this.deepEqual( parse( stringDate, tokens, parseProperties( cldr, timeZone ) ), expected ); +}; + +QUnit.assert.timezoneParse = function( stringDate, pattern, cldr, timezoneOffset ) { + var parsedTimezoneOffset, parsedDate, tokenizerProperties, tokens, + testPattern = "HH:mm " + pattern, + testStringDate = "00:00 " + stringDate; + + tokenizerProperties = dateTokenizerProperties( testPattern, cldr ); + tokens = tokenizer( testStringDate, simpleNumberParser, tokenizerProperties ); + parsedDate = parse( testStringDate, tokens, parseProperties( cldr ) ); + parsedTimezoneOffset = ( parsedDate - midnight ) / 1000 / 60 + midnight.getTimezoneOffset(); + + this.equal( parsedTimezoneOffset, timezoneOffset, "stringDate `" + stringDate + + "` pattern `" + pattern + "`" ); +}; + +// Simple number parser for this test purposes. +function simpleNumberParser( value ) { + return +value; +} + +Cldr.load( + enCaGregorian, + enNumbers, + enTimeZoneNames, + enGbCaGregorian, + enGbNumbers, + enGbTimeZoneNames, + frCaGregorian, + frNumbers, + frTimeZoneNames, + trCaGregorian, + trNumbers, + zhCaGregorian, + zhNumbers, + likelySubtags, + timeData, + weekData +); + +// Needed for globalizeDate. +Cldr.load({ + "globalize-iana": ianaTimezoneData +}); + +cldr = new Cldr( "en" ); +fr = new Cldr( "fr" ); +zh = new Cldr( "zh" ); + +midnight = new Date(); +midnight = startOf( midnight, "day" ); + +QUnit.module( "Date Parse" ); + +/** + * Era + */ + +QUnit.test( "should parse era (G|GG|GGG)", function( assert ) { + date1 = new Date( 0, 0 ); + date2 = new Date( 0, 0 ); + date1.setFullYear( 4 ); + date2.setFullYear( -4 ); + assert.dateParse( "AD 4", "G y", cldr, date1 ); + assert.dateParse( "BC 5", "G y", cldr, date2 ); + assert.dateParse( "AD 4", "GG y", cldr, date1 ); + assert.dateParse( "BC 5", "GG y", cldr, date2 ); + assert.dateParse( "AD 4", "GGG y", cldr, date1 ); + assert.dateParse( "BC 5", "GGG y", cldr, date2 ); +}); + +QUnit.test( "should parse era (GGGG)", function( assert ) { + date1 = new Date( 0, 0 ); + date2 = new Date( 0, 0 ); + date1.setFullYear( 4 ); + date2.setFullYear( -4 ); + assert.dateParse( "Anno Domini 4", "GGGG y", cldr, date1 ); + assert.dateParse( "Before Christ 5", "GGGG y", cldr, date2 ); +}); + +QUnit.test( "should parse era (GGGGG)", function( assert ) { + date1 = new Date( 0, 0 ); + date2 = new Date( 0, 0 ); + date1.setFullYear( 4 ); + date2.setFullYear( -4 ); + assert.dateParse( "A 4", "GGGGG y", cldr, date1 ); + assert.dateParse( "B 5", "GGGGG y", cldr, date2 ); +}); + +/** + * Year + */ + +QUnit.test( "should parse year (y) with no padding", function( assert ) { + assert.dateParse( "1982", "y", cldr, new Date( 1982, 0 ) ); + + date1 = new Date(0, 0); + date1.setFullYear(2); + assert.dateParse( "2", "y", cldr, date1 ); + assert.dateParse( "02", "y", cldr, date1 ); +}); + +QUnit.test( "should parse year (yy) with padding, and limit 2 digits", function( assert ) { + // This may change in the future, eg. 82 could eventually be 2082, same for the below years. + assert.dateParse( "82", "yy", cldr, new Date( 1982, 0 ) ); + assert.dateParse( "9", "yy", cldr, new Date( 2009, 0 ) ); + assert.dateParse( "09", "yy", cldr, new Date( 2009, 0 ) ); +}); + +QUnit.test( "should parse year (yyy+) with padding", function( assert ) { + assert.dateParse( "1982", "yyy", cldr, new Date( 1982, 0 ) ); + assert.dateParse( "82", "yyy", cldr, null ); + + assert.dateParse( "01982", "yyyyy", cldr, new Date( 1982, 0 ) ); + assert.dateParse( "1982", "yyyyy", cldr, null ); +}); + +/** + * Month + */ + +QUnit.test( "should parse month (M|L) with no padding", function( assert ) { + date1 = new Date(); + date1.setMonth( 0 ); + date1 = startOf( date1, "month" ); + assert.dateParse( "1", "M", cldr, date1 ); + assert.dateParse( "1", "L", cldr, date1 ); +}); + +QUnit.test( "should parse month (MM|LL) with padding", function( assert ) { + date1 = new Date(); + date1.setMonth( 0 ); + date1 = startOf( date1, "month" ); + assert.dateParse( "1", "MM", cldr, date1 ); + assert.dateParse( "01", "MM", cldr, date1 ); + assert.dateParse( "1", "LL", cldr, date1 ); + assert.dateParse( "01", "LL", cldr, date1 ); +}); + +QUnit.test( "should parse month (MMM|LLL)", function( assert ) { + date1 = new Date(); + date1.setMonth( 0 ); + date1 = startOf( date1, "month" ); + assert.dateParse( "Jan", "MMM", cldr, date1 ); + assert.dateParse( "Jan", "LLL", cldr, date1 ); +}); + +QUnit.test( "should parse month (MMMM|LLLL)", function( assert ) { + date1 = new Date(); + date1.setMonth( 0 ); + date1 = startOf( date1, "month" ); + assert.dateParse( "January", "MMMM", cldr, date1 ); + assert.dateParse( "January", "LLLL", cldr, date1 ); +}); + +QUnit.test( "should parse month (MMMMM|LLLLL)", function( assert ) { + date1 = new Date(); + date1.setMonth( 0 ); + date1 = startOf( date1, "month" ); + assert.dateParse( "J", "MMMMM", cldr, date1 ); + assert.dateParse( "J", "LLLLL", cldr, date1 ); +}); + +QUnit.test( "should parse February correctly in leap year", function( assert ) { + var OrigDate; + + /* globals Date:true */ + // Use a leap year and a day of month greater than 28 + OrigDate = Date; + Date = util.FakeDate; + util.FakeDate.today = new Date( 2016, 0, 29 ); + + date1 = new Date(); + date1.setMonth( 1 ); + date1 = startOf( date1, "month" ); + date1.setYear( 2015 ); + assert.dateParse( "2/2015", "M/y", cldr, date1 ); + assert.dateParse( "2/2015", "L/y", cldr, date1 ); + + Date = OrigDate; +}); + +/** + * Day + */ + +QUnit.test( "should parse day (d) with no padding", function( assert ) { + var OrigDate; + + date1 = new Date(); + date1.setDate( 2 ); + date1 = startOf( date1, "day" ); + assert.dateParse( "2", "d", cldr, date1 ); + + /* globals Date:true */ + // Test #323 - Day parsing must use the correct day range given its corresponding month/year. + OrigDate = Date; + Date = util.FakeDate; + + date1 = new Date( 2014, 1, 28 ); + date1 = startOf( date1, "day" ); + util.FakeDate.today = new Date( 2014, 1 ); + assert.dateParse( "29", "d", cldr, null ); + assert.dateParse( "28", "d", cldr, date1 ); + + date2 = new Date( 2016, 1, 29 ); + date2 = startOf( date2, "day" ); + util.FakeDate.today = new Date( 2016, 1 ); + assert.dateParse( "30", "d", cldr, null ); + assert.dateParse( "29", "d", cldr, date2 ); + Date = OrigDate; +}); + +QUnit.test( "should parse day (dd) with padding", function( assert ) { + date1 = new Date(); + date1.setDate( 2 ); + date1 = startOf( date1, "day" ); + assert.dateParse( "2", "dd", cldr, date1 ); + assert.dateParse( "02", "dd", cldr, date1 ); +}); + +QUnit.test( "should parse day of year (D) with no padding", function( assert ) { + var OrigDate; + + date1 = new Date(); + date1.setMonth( 0 ); + date1.setDate( 2 ); + date1 = startOf( date1, "day" ); + assert.dateParse( "2", "D", cldr, date1 ); + + /* globals Date:true */ + // Test #323 - Day of year parsing must use the correct day range given leap year into account. + OrigDate = Date; + Date = util.FakeDate; + + util.FakeDate.today = new Date( 2014, 1 ); + assert.dateParse( "366", "D", cldr, null ); + + // date1 = last day of 2016 + date1 = new Date( 2017, 0, 0 ); + util.FakeDate.today = new Date( 2016, 1 ); + assert.dateParse( "366", "D", cldr, date1 ); + + Date = OrigDate; +}); + +QUnit.test( "should parse day of year (DD|DDD) with padding", function( assert ) { + date1 = new Date(); + date1.setMonth( 0 ); + date1.setDate( 2 ); + date1 = startOf( date1, "day" ); + assert.dateParse( "02", "DD", cldr, date1 ); + assert.dateParse( "002", "DDD", cldr, date1 ); +}); + +/** + * Week day + */ + +QUnit.test( "should format local day of week (e|c) with no padding", function( assert ) { + date1 = new Date( 1982, 0, 2 ); + date2 = new Date( 2010, 8, 15 ); + assert.dateParse( "1/2/82 7", "M/d/yy e", cldr, date1 ); + assert.dateParse( "9/15/10 4", "M/d/yy e", cldr, date2 ); + assert.dateParse( "1/2/82 7", "M/d/yy c", cldr, date1 ); + assert.dateParse( "9/15/10 4", "M/d/yy c", cldr, date2 ); +}); + +QUnit.test( "should format local day of week (ee|cc) with padding", function( assert ) { + date1 = new Date( 1982, 0, 2 ); + date2 = new Date( 2010, 8, 15 ); + assert.dateParse( "1/2/82 07", "M/d/yy ee", cldr, date1 ); + assert.dateParse( "9/15/10 04", "M/d/yy ee", cldr, date2 ); + assert.dateParse( "1/2/82 07", "M/d/yy cc", cldr, date1 ); + assert.dateParse( "9/15/10 04", "M/d/yy cc", cldr, date2 ); +}); + +QUnit.test( "should format local day of week (E|EE|EEE|eee|ccc)", function( assert ) { + date1 = new Date( 1982, 0, 2 ); + date2 = new Date( 2010, 8, 15 ); + assert.dateParse( "1/2/82 Sat", "M/d/yy E", cldr, date1 ); + assert.dateParse( "9/15/10 Wed", "M/d/yy E", cldr, date2 ); + assert.dateParse( "1/2/82 Sat", "M/d/yy EE", cldr, date1 ); + assert.dateParse( "9/15/10 Wed", "M/d/yy EE", cldr, date2 ); + assert.dateParse( "1/2/82 Sat", "M/d/yy EEE", cldr, date1 ); + assert.dateParse( "9/15/10 Wed", "M/d/yy EEE", cldr, date2 ); + assert.dateParse( "1/2/82 Sat", "M/d/yy eee", cldr, date1 ); + assert.dateParse( "9/15/10 Wed", "M/d/yy eee", cldr, date2 ); + assert.dateParse( "1/2/82 Sat", "M/d/yy ccc", cldr, date1 ); + assert.dateParse( "9/15/10 Wed", "M/d/yy ccc", cldr, date2 ); +}); + +QUnit.test( "should format local day of week (EEEE|eeee|cccc)", function( assert ) { + var tr; + date1 = new Date( 1982, 0, 2 ); + date2 = new Date( 2010, 8, 15 ); + assert.dateParse( "1/2/82 Saturday", "M/d/yy EEEE", cldr, date1 ); + assert.dateParse( "9/15/10 Wednesday", "M/d/yy EEEE", cldr, date2 ); + assert.dateParse( "1/2/82 Saturday", "M/d/yy eeee", cldr, date1 ); + assert.dateParse( "9/15/10 Wednesday", "M/d/yy eeee", cldr, date2 ); + assert.dateParse( "1/2/82 Saturday", "M/d/yy cccc", cldr, date1 ); + assert.dateParse( "9/15/10 Wednesday", "M/d/yy cccc", cldr, date2 ); + + // Special test for #690 parseDate fails on Turkish full datetime with Monday or Saturday. + tr = new Cldr( "tr" ); + assert.dateParse( "1/2/82 Cumartesi", "M/d/yy EEEE", tr, date1 ); +}); + +QUnit.test( "should format local day of week (EEEEE|eeeee|ccccc)", function( assert ) { + date1 = new Date( 1982, 0, 2 ); + date2 = new Date( 2010, 8, 15 ); + assert.dateParse( "1/2/82 S", "M/d/yy EEEEE", cldr, date1 ); + assert.dateParse( "9/15/10 W", "M/d/yy EEEEE", cldr, date2 ); + assert.dateParse( "1/2/82 S", "M/d/yy eeeee", cldr, date1 ); + assert.dateParse( "9/15/10 W", "M/d/yy eeeee", cldr, date2 ); + assert.dateParse( "1/2/82 S", "M/d/yy ccccc", cldr, date1 ); + assert.dateParse( "9/15/10 W", "M/d/yy ccccc", cldr, date2 ); +}); + +QUnit.test( "should format local day of week (EEEEEE|eeeeee|cccccc)", function( assert ) { + date1 = new Date( 1982, 0, 2 ); + date2 = new Date( 2010, 8, 15 ); + assert.dateParse( "1/2/82 Sa", "M/d/yy EEEEEE", cldr, date1 ); + assert.dateParse( "9/15/10 We", "M/d/yy EEEEEE", cldr, date2 ); + assert.dateParse( "1/2/82 Sa", "M/d/yy eeeeee", cldr, date1 ); + assert.dateParse( "9/15/10 We", "M/d/yy eeeeee", cldr, date2 ); + assert.dateParse( "1/2/82 Sa", "M/d/yy cccccc", cldr, date1 ); + assert.dateParse( "9/15/10 We", "M/d/yy cccccc", cldr, date2 ); +}); + +/** + * Period + */ + +QUnit.test( "should parse period (a)", function( assert ) { + date1 = new Date(); + date2 = new Date(); + date1.setHours( 5 ); + date2.setHours( 17 ); + date1 = startOf( date1, "hour" ); + date2 = startOf( date2, "hour" ); + assert.dateParse( "5 AM", "h a", cldr, date1 ); + assert.dateParse( "5 PM", "h a", cldr, date2 ); + assert.dateParse( "上午5", "ah", zh, date1 ); + assert.dateParse( "下午5", "ah", zh, date2 ); +}); + +/** + * Date composite + */ + +QUnit.test( "should parse composite of date fields", function( assert ) { + var OrigDate; + + // Test #612 - Incorrect parsing when days in today's month is bigger than + // the parsing month. + OrigDate = Date; + Date = util.FakeDate; + util.FakeDate.today = new Date( 2016, 11, 31 ); + assert.dateParse( "2/2/2015", "M/d/y", cldr, new Date( 2015, 1, 2 ) ); + Date = OrigDate; + + // Loose matching: ignore control characters. + date1 = new Date( 2010, 8, 15 ); + assert.dateParse( "15/9/2010", "d\u200f/M\u200f/y", cldr, date1 ); + + // Test #696 - Mix of numbering systems. + assert.dateParse( "15/٧/2010", "d/M/y", cldr, null ); +}); + +/** + * Hour + */ + +QUnit.test( "should parse hour (h) using 12-hour-cycle [1-12] with no padding", function( assert ) { + assert.dateParse( "1", "h", cldr, null, "12-hour time without period should return null" ); + assert.dateParse( "0 AM", "h a", cldr, null, "Out of range should return null" ); + assert.dateParse( "13 AM", "h a", cldr, null, "Out of range should return null" ); + + date1 = new Date(); + date1.setHours( 9 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "9 AM", "h a", cldr, date1 ); + + date1.setHours( 0 ); + assert.dateParse( "12 AM", "h a", cldr, date1 ); + + date1.setHours( 1 ); + assert.dateParse( "1 AM", "h a", cldr, date1 ); + + date1.setHours( 12 ); + assert.dateParse( "12 PM", "h a", cldr, date1 ); + + date1.setHours( 13 ); + assert.dateParse( "1 PM", "h a", cldr, date1 ); +}); + +QUnit.test( "should parse hour (hh) using 12-hour-cycle [1-12] with padding", function( assert ) { + date1 = new Date(); + date1.setHours( 9 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "9 AM", "hh a", cldr, date1 ); + assert.dateParse( "09 AM", "hh a", cldr, date1 ); +}); + +QUnit.test( "should parse hour (H) using 24-hour-cycle [0-23] with no padding", function( assert ) { + assert.dateParse( "24", "H", cldr, null, "Out of range should return null" ); + + date1 = new Date(); + date1.setHours( 0 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "0", "H", cldr, date1 ); + + date1.setHours( 1 ); + assert.dateParse( "1", "H", cldr, date1 ); + + date1.setHours( 12 ); + assert.dateParse( "12", "H", cldr, date1 ); + + date1.setHours( 16 ); + assert.dateParse( "16", "H", cldr, date1 ); +}); + +QUnit.test( "should parse hour (HH) using 24-hour-cycle [0-23] with padding", function( assert ) { + date1 = new Date(); + date1.setHours( 9 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "9", "HH", cldr, date1 ); + assert.dateParse( "09", "HH", cldr, date1 ); + + date1.setHours( 16 ); + assert.dateParse( "16", "HH", cldr, date1 ); +}); + +QUnit.test( "should parse hour (K) using 12-hour-cycle [0-11] with no padding", function( assert ) { + assert.dateParse( "1", "K", cldr, null, "12-hour time without period should return null" ); + assert.dateParse( "12 AM", "K a", cldr, null, "Out of range should return null" ); + assert.dateParse( "13 AM", "K a", cldr, null, "Out of range should return null" ); + + date1 = new Date(); + date1.setHours( 0 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "0 AM", "K a", cldr, date1 ); + + date1.setHours( 8 ); + assert.dateParse( "8 AM", "K a", cldr, date1 ); + + date1.setHours( 12 ); + assert.dateParse( "0 PM", "K a", cldr, date1 ); + + date1.setHours( 20 ); + assert.dateParse( "8 PM", "K a", cldr, date1 ); +}); + +QUnit.test( "should parse hour (KK) using 12-hour-cycle [0-11] with padding", function( assert ) { + date1 = new Date(); + date1.setHours( 8 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "8 AM", "KK a", cldr, date1 ); + assert.dateParse( "08 AM", "KK a", cldr, date1 ); +}); + +QUnit.test( "should parse hour (k) using 24-hour-cycle [1-24] with no padding", function( assert ) { + assert.dateParse( "0", "k", cldr, null, "Out of range should return null" ); + + date1 = new Date(); + date1.setHours( 0 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "24", "k", cldr, date1 ); + + date1.setHours( 8 ); + assert.dateParse( "8", "k", cldr, date1 ); + + date1.setHours( 12 ); + assert.dateParse( "12", "k", cldr, date1 ); + + date1.setHours( 20 ); + assert.dateParse( "20", "k", cldr, date1 ); +}); + +QUnit.test( "should parse hour (kk) using 24-hour-cycle [1-24] with padding", function( assert ) { + date1 = new Date(); + date1.setHours( 5 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "5", "kk", cldr, date1 ); + assert.dateParse( "05", "kk", cldr, date1 ); + + date1.setHours( 17 ); + assert.dateParse( "17", "kk", cldr, date1 ); +}); + +QUnit.test( "should parse hour (j) using preferred hour format for the locale (h, H, K, or k) with no padding", function( assert ) { + date1 = new Date(); + date1.setHours( 9 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "9 AM", "j a", cldr, date1 ); +}); + +QUnit.test( "should parse hour (jj) using preferred hour format for the locale (h, H, K, or k) with padding", function( assert ) { + date1 = new Date(); + date1.setHours( 9 ); + date1 = startOf( date1, "hour" ); + assert.dateParse( "9 AM", "jj a", cldr, date1 ); + assert.dateParse( "09 AM", "jj a", cldr, date1 ); +}); + +/** + * Minute + */ + +QUnit.test( "should parse minute (m) with no padding", function( assert ) { + date1 = new Date(); + date1.setMinutes( 5 ); + date1 = startOf( date1, "minute" ); + assert.dateParse( "5", "m", cldr, date1 ); +}); + +QUnit.test( "should parse minute (mm) with padding", function( assert ) { + date1 = new Date(); + date1.setMinutes( 5 ); + date1 = startOf( date1, "minute" ); + assert.dateParse( "5", "mm", cldr, date1 ); + assert.dateParse( "05", "mm", cldr, date1 ); +}); + +/** + * Second + */ + +QUnit.test( "should parse second (s) with no padding", function( assert ) { + date1 = new Date(); + date1.setSeconds( 59 ); + date1 = startOf( date1, "second" ); + assert.dateParse( "59", "s", cldr, date1 ); +}); + +QUnit.test( "should parse second (ss) with padding", function( assert ) { + date1 = new Date(); + date1.setSeconds( 59 ); + date1 = startOf( date1, "second" ); + assert.dateParse( "59", "ss", cldr, date1 ); + + date1.setSeconds( 9 ); + assert.dateParse( "9", "ss", cldr, date1 ); + assert.dateParse( "09", "ss", cldr, date1 ); +}); + +QUnit.test( "should parse milliseconds (S+)", function( assert ) { + date1 = new Date(); + date1.setSeconds( 0 ); + date1.setMilliseconds( 400 ); + assert.dateParse( "0 4", "s S", cldr, date1 ); + date1.setMilliseconds( 370 ); + assert.dateParse( "0 37", "s SS", cldr, date1 ); + date1.setMilliseconds( 369 ); + assert.dateParse( "0 369", "s SSS", cldr, date1 ); + assert.dateParse( "0 3690", "s SSSS", cldr, date1 ); + assert.dateParse( "0 36900", "s SSSSS", cldr, date1 ); +}); + +QUnit.test( "should parse milliseconds in a day (A+)", function( assert ) { + date1 = new Date(); + date1 = startOf( date1, "day" ); + date1.setMilliseconds( 63307400 ); + assert.dateParse( "633074", "A", cldr, date1 ); + date1 = startOf( date1, "day" ); + date1.setMilliseconds( 63307370 ); + assert.dateParse( "6330737", "AA", cldr, date1 ); + date1 = startOf( date1, "day" ); + date1.setMilliseconds( 63307369 ); + assert.dateParse( "63307369", "AAA", cldr, date1 ); + assert.dateParse( "633073690", "AAAA", cldr, date1 ); + assert.dateParse( "6330736900", "AAAAA", cldr, date1 ); +}); + +/** + * Zone + */ + +QUnit.test( "should parse timezone (z)", function( assert ) { + var enGb = new Cldr( "en-GB" ); + + [ "z", "zz", "zzz" ].forEach(function( z ) { + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM PST", + "M/d/y h:mm a " + z, + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo Bar", + "M/d/y h:mm a " + z, + "America/Los_Angeles", + cldr, + null + ); + assert.dateParseWithTimezone( + "01/07/2017 00:00 BST", + "dd/MM/y H:mm " + z, + "Europe/London", + enGb, + new Date( "2017-06-30T23:00:00.000Z" ) + ); + }); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Pacific Standard Time", + "M/d/y h:mm a zzzz", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Gulf Standard Time", + "M/d/y h:mm a zzzz", + "Asia/Dubai", + cldr, + new Date( "2016-12-31T20:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "01/07/2017 00:00 British Summer Time", + "dd/MM/y H:mm zzzz", + "Europe/London", + enGb, + new Date( "2017-06-30T23:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM India Standard Time", + "M/d/y h:mm a zzzz", + "Asia/Calcutta", + cldr, + new Date( "2016-12-31T18:30:00.000Z" ) + ); + + // Fall through 'O' format. + [ "z", "zz", "zzz", "zzzz" ].forEach(function( z ) { + assert.timezoneParse( "GMT", z, cldr, 0 ); + }); + + assert.timezoneParse( "GMT-3", "z", cldr, 180 ); + assert.timezoneParse( "GMT-3", "zz", cldr, 180 ); + assert.timezoneParse( "GMT-3", "zzz", cldr, 180 ); + assert.timezoneParse( "GMT-03:00", "zzzz", cldr, 180 ); + + assert.timezoneParse( "GMT+11", "z", cldr, -660 ); + assert.timezoneParse( "GMT+11", "zz", cldr, -660 ); + assert.timezoneParse( "GMT+11", "zzz", cldr, -660 ); + assert.timezoneParse( "GMT+11:00", "zzzz", cldr, -660 ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a z", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-2", + "M/d/y h:mm a z", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a z", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-2", + "M/d/y h:mm a z", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a z", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-2", + "M/d/y h:mm a z", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a zzzz", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a zzzz", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a zzzz", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a zzzz", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a zzzz", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a zzzz", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); +}); + +QUnit.test( "should parse timezone (Z)", function( assert ) { + assert.timezoneParse( "+0000", "Z", cldr, 0 ); + assert.timezoneParse( "+0000", "ZZ", cldr, 0 ); + assert.timezoneParse( "+0000", "ZZZ", cldr, 0 ); + assert.timezoneParse( "GMT", "ZZZZ", cldr, 0 ); + assert.timezoneParse( "Z", "ZZZZZ", cldr, 0 ); + + assert.timezoneParse( "-0300", "Z", cldr, 180 ); + assert.timezoneParse( "-0300", "ZZ", cldr, 180 ); + assert.timezoneParse( "-0300", "ZZZ", cldr, 180 ); + assert.timezoneParse( "GMT-03:00", "ZZZZ", cldr, 180 ); + assert.timezoneParse( "-03:00", "ZZZZZ", cldr, 180 ); + + assert.timezoneParse( "+1100", "Z", cldr, -660 ); + assert.timezoneParse( "+1100", "ZZ", cldr, -660 ); + assert.timezoneParse( "+1100", "ZZZ", cldr, -660 ); + assert.timezoneParse( "GMT+11:00", "ZZZZ", cldr, -660 ); + assert.timezoneParse( "+11:00", "ZZZZZ", cldr, -660 ); +}); + +QUnit.test( "should parse timezone (O)", function( assert ) { + assert.timezoneParse( "GMT", "O", cldr, 0 ); + assert.timezoneParse( "GMT", "OOOO", cldr, 0 ); + + assert.timezoneParse( "GMT-3", "O", cldr, 180 ); + assert.timezoneParse( "GMT-03:00", "OOOO", cldr, 180 ); + + assert.timezoneParse( "GMT+11", "O", cldr, -660 ); + assert.timezoneParse( "GMT+11:00", "OOOO", cldr, -660 ); + + // Loose matching: normalize [:Dash:] category. + assert.timezoneParse( "UTC-7", "O", fr, 420 ); + assert.timezoneParse( "UTC\u22127", "O", fr, 420 ); +}); + +QUnit.test( "should parse timezone (v)", function( assert ) { + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM PT", + "M/d/y h:mm a v", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM XX", + "M/d/y h:mm a v", + "America/Los_Angeles", + cldr, + null + ); + assert.dateParse( + "1/1/2017 12:00 AM XX", + "M/d/y h:mm a v", + cldr, + null + ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Pacific Time", + "M/d/y h:mm a vvvv", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo Bar", + "M/d/y h:mm a v", + "America/Los_Angeles", + cldr, + null + ); + assert.dateParse( + "1/1/2017 12:00 AM Foo Bar", + "M/d/y h:mm a vvvv", + cldr, + null + ); + + // Use metazone. + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Brasilia Time", + "M/d/y h:mm a vvvv", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + + // Fall through 'VVVV' format. + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Sao Paulo Time", + "M/d/y h:mm a v", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo City Time", + "M/d/y h:mm a v", + "Foo/Baz", + cldr, + new Date( "2017-01-01T00:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo City Time", + "M/d/y h:mm a vvvv", + "Foo/Baz", + cldr, + new Date( "2017-01-01T00:00:00.000Z" ) + ); + + // Fall through 'O' and 'OOOO' formats. + assert.dateParse( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a v", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParse( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a vvvv", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a v", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-2", + "M/d/y h:mm a v", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a v", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-2", + "M/d/y h:mm a v", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-8", + "M/d/y h:mm a v", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-2", + "M/d/y h:mm a v", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a vvvv", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a vvvv", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a vvvv", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a vvvv", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a vvvv", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a vvvv", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); +}); + +QUnit.test( "should parse timezone (V)", function( assert ) { + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM America/Los_Angeles", + "M/d/y h:mm a VV", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo/Bar", + "M/d/y h:mm a VV", + "America/Los_Angeles", + cldr, + null + ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Los Angeles", + "M/d/y h:mm a VVV", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo Bar", + "M/d/y h:mm a VVV", + "America/Los_Angeles", + cldr, + null + ); + + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Los Angeles Time", + "M/d/y h:mm a VVVV", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Foo Bar", + "M/d/y h:mm a VVVV", + "America/Los_Angeles", + cldr, + null + ); + + // Fall through to 'VVV' format with "Unknown" exemplarCity. + // "VVV" / "Foo/Bar" / "Unknown City" + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM Unknown City", + "M/d/y h:mm a VVV", + "Foo/Bar", + cldr, + new Date( "2017-01-01T00:00:00.000Z" ) + ); + + // Fall through 'OOOO' format. + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a VVVV", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a VVVV", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a VVVV", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a VVVV", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-08:00", + "M/d/y h:mm a VVVV", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM GMT-02:00", + "M/d/y h:mm a VVVV", + "Etc/GMT+8", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); +}); + +QUnit.test( "should parse timezone (X)", function( assert ) { + assert.timezoneParse( "Z", "X", cldr, 0 ); + assert.timezoneParse( "Z", "XX", cldr, 0 ); + assert.timezoneParse( "Z", "XXX", cldr, 0 ); + assert.timezoneParse( "Z", "XXXX", cldr, 0 ); + assert.timezoneParse( "Z", "XXXXX", cldr, 0 ); + + assert.timezoneParse( "-03", "X", cldr, 180 ); + assert.timezoneParse( "-0300", "XX", cldr, 180 ); + assert.timezoneParse( "-03:00", "XXX", cldr, 180 ); + assert.timezoneParse( "-0300", "XXXX", cldr, 180 ); + assert.timezoneParse( "-03:00", "XXXXX", cldr, 180 ); + + assert.timezoneParse( "+0530", "XX", cldr, -330 ); + assert.timezoneParse( "+05:30", "XXX", cldr, -330 ); + assert.timezoneParse( "+0530", "XXXX", cldr, -330 ); + assert.timezoneParse( "+05:30", "XXXXX", cldr, -330 ); + + assert.timezoneParse( "+11", "X", cldr, -660 ); + assert.timezoneParse( "+1100", "XX", cldr, -660 ); + assert.timezoneParse( "+11:00", "XXX", cldr, -660 ); + assert.timezoneParse( "+1100", "XXXX", cldr, -660 ); + assert.timezoneParse( "+11:00", "XXXXX", cldr, -660 ); +}); + +QUnit.test( "should parse timezone (x)", function( assert ) { + assert.timezoneParse( "+00", "x", cldr, 0 ); + assert.timezoneParse( "+0000", "xx", cldr, 0 ); + assert.timezoneParse( "+00:00", "xxx", cldr, 0 ); + assert.timezoneParse( "+0000", "xxxx", cldr, 0 ); + assert.timezoneParse( "+00:00", "xxxxx", cldr, 0 ); + + assert.timezoneParse( "-03", "x", cldr, 180 ); + assert.timezoneParse( "-0300", "xx", cldr, 180 ); + assert.timezoneParse( "-03:00", "xxx", cldr, 180 ); + assert.timezoneParse( "-0300", "xxxx", cldr, 180 ); + assert.timezoneParse( "-03:00", "xxxxx", cldr, 180 ); + + assert.timezoneParse( "+0530", "x", cldr, -330 ); + assert.timezoneParse( "+0530", "xx", cldr, -330 ); + assert.timezoneParse( "+05:30", "xxx", cldr, -330 ); + assert.timezoneParse( "+0530", "xxxx", cldr, -330 ); + assert.timezoneParse( "+05:30", "xxxxx", cldr, -330 ); + + assert.timezoneParse( "+11", "x", cldr, -660 ); + assert.timezoneParse( "+1100", "xx", cldr, -660 ); + assert.timezoneParse( "+11:00", "xxx", cldr, -660 ); + assert.timezoneParse( "+1100", "xxxx", cldr, -660 ); + assert.timezoneParse( "+11:00", "xxxxx", cldr, -660 ); + + assert.timezoneParse( "-0752", "x", cldr, 472 ); + assert.timezoneParse( "-0752", "xx", cldr, 472 ); + assert.timezoneParse( "-07:52", "xxx", cldr, 472 ); + assert.timezoneParse( "-075258", "xxxx", cldr, 472 ); + assert.timezoneParse( "-07:52:58", "xxxxx", cldr, 472 ); + + assert.timezoneParse( "+0752", "x", cldr, -472 ); + assert.timezoneParse( "+0752", "xx", cldr, -472 ); + assert.timezoneParse( "+07:52", "xxx", cldr, -472 ); + assert.timezoneParse( "+075258", "xxxx", cldr, -472 ); + assert.timezoneParse( "+07:52:58", "xxxxx", cldr, -472 ); + + +}); + +QUnit.test( "should parse date according to passed timeZone in various datetime patterns", + function( assert ) { + + // "M/d/y h:mm a" + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM", + "M/d/y h:mm a", + "Etc/UTC", + cldr, + new Date( "2017-01-01T00:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM", + "M/d/y h:mm a", + "Europe/Berlin", + cldr, + new Date( "2016-12-31T23:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM", + "M/d/y h:mm a", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM", + "M/d/y h:mm a", + "America/New_York", + cldr, + new Date( "2017-01-01T05:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017 12:00 AM", + "M/d/y h:mm a", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); + + // Testing DST edge cases... + + // Note we can't reliably parse overlapping times (daylight to standard cases). For example, we + // can't reliably parse "2/18/2017 11:00 PM" for America/Sao_Paulo into + // "2017-02-19T01:00:00.000Z" or "2017-02-19T02:00:00.000Z" without providing the zone string, + // e.g., 11:00 PM BRT or 11:00 PM BRST (both times are valid). Therefore, formatting either one + // should return back the parsed string. This is tested on functional tests. + + // PST + assert.dateParseWithTimezone( + "3/12/2017 1:00 AM", + "M/d/y h:mm a", + "America/Los_Angeles", + cldr, + new Date( "2017-03-12T09:00:00.000Z" ) + ); + + // PDT + assert.dateParseWithTimezone( + "3/12/2017 3:00 AM", + "M/d/y h:mm a", + "America/Los_Angeles", + cldr, + new Date( "2017-03-12T10:00:00.000Z" ) + ); + + // "M/d/y" + assert.dateParseWithTimezone( + "1/1/2017", + "M/d/y", + "Etc/UTC", + cldr, + new Date( "2017-01-01T00:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017", + "M/d/y", + "Europe/Berlin", + cldr, + new Date( "2016-12-31T23:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017", + "M/d/y", + "America/Sao_Paulo", + cldr, + new Date( "2017-01-01T02:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017", + "M/d/y", + "America/New_York", + cldr, + new Date( "2017-01-01T05:00:00.000Z" ) + ); + assert.dateParseWithTimezone( + "1/1/2017", + "M/d/y", + "America/Los_Angeles", + cldr, + new Date( "2017-01-01T08:00:00.000Z" ) + ); +}); + +/** + * Literal + */ + +QUnit.test( "should parse literal (')", function( assert ) { + var date = new Date(); + date.setHours( 9 ); + date = startOf( date, "hour" ); + assert.dateParse( "09 o'clock AM", "hh 'o''clock' a", cldr, date ); +}); + +QUnit.test( "should parse invalid literal as null", function( assert ) { + assert.dateParse( "2-20-2017", "M/d/y", cldr, null ); + assert.dateParse( "2a20a2017", "M/d/y", cldr, null ); + assert.dateParse( "2/20/2017", "M-d-y", cldr, null ); + assert.dateParse( "2/20/2017x5xAM", "M/d/y h a", cldr, null ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/timezone-hour-format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/timezone-hour-format.js new file mode 100644 index 000000000..27d442f8e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/timezone-hour-format.js @@ -0,0 +1,50 @@ +define([ + "src/date/timezone-hour-format" +], function( hourFormat ) { + +var BRT, FakeDate, HST, IST, UTC; + +FakeDate = function( timezoneOffset ) { + this.timezoneOffset = timezoneOffset; +}; + +function foo() { + return "foo"; +} + +FakeDate.prototype.getTimezoneOffset = function() { + return this.timezoneOffset; +}; + +HST = new FakeDate( -600 ); +IST = new FakeDate( -330 ); +UTC = new FakeDate( 0 ); +BRT = new FakeDate( 180 ); + +QUnit.module( "Datetime Timezone Hour Format" ); + +QUnit.test( "should format +H;-H", function( assert ) { + assert.equal( hourFormat( BRT, "+H;-H", ":" ), "-3", "" ); + assert.equal( hourFormat( UTC, "+H;-H", ":" ), "+0", "" ); + assert.equal( hourFormat( IST, "+H;-H", ":" ), "+5", "" ); + assert.equal( hourFormat( HST, "+H;-H", ":" ), "+10", "" ); + assert.equal( hourFormat( IST, "+H;-H", "،", { 1: foo } ), "+foo", "" ); +}); + +QUnit.test( "should format +HHmm;-HHmm", function( assert ) { + assert.equal( hourFormat( BRT, "+HHmm;-HHmm", ":" ), "-0300", "" ); + assert.equal( hourFormat( UTC, "+HHmm;-HHmm", ":" ), "+0000", "" ); + assert.equal( hourFormat( IST, "+HHmm;-HHmm", ":" ), "+0530", "" ); + assert.equal( hourFormat( HST, "+HHmm;-HHmm", ":" ), "+1000", "" ); + assert.equal( hourFormat( IST, "+HHmm;-HHmm", "،", { 2: foo } ), "+foofoo", "" ); +}); + +QUnit.test( "should format +HH:mm;-HH:mm", function( assert ) { + assert.equal( hourFormat( BRT, "+HH:mm;-HH:mm", ":" ), "-03:00", "" ); + assert.equal( hourFormat( UTC, "+HH:mm;-HH:mm", ":" ), "+00:00", "" ); + assert.equal( hourFormat( IST, "+HH:mm;-HH:mm", ":" ), "+05:30", "" ); + assert.equal( hourFormat( HST, "+HH:mm;-HH:mm", ":" ), "+10:00", "" ); + assert.equal( hourFormat( IST, "+HH:mm;-HH:mm", "،", { 2: foo } ), "+foo،foo", "" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/tokenizer-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/tokenizer-properties.js new file mode 100644 index 000000000..065a983b0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/tokenizer-properties.js @@ -0,0 +1,486 @@ +define([ + "cldr", + "src/date/tokenizer-properties", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/en-GB/ca-gregorian.json", + "json!cldr-data/main/en-GB/timeZoneNames.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/metaZones.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, tokenizerProperties, enCaGregorian, enTimeZoneNames, enGbCaGregorian, + enGbTimeZoneNames, likelySubtags, metaZones ) { + +var cldr; + +Cldr.load( + enCaGregorian, + enTimeZoneNames, + enGbCaGregorian, + enGbTimeZoneNames, + likelySubtags, + metaZones +); + +Cldr.load({ + "main": { + "en": { + "dates": { + "timeZoneNames": { + "zone": { + "Foo": { + "Baz": { + "exemplarCity": "Foo City" + } + } + } + } + } + } + } +}); + +cldr = new Cldr( "en" ); + +QUnit.module( "Date Tokenizer Properties" ); + +/** + * Era + */ + +QUnit.test( "should return properties for era (G..GGGGG)", function( assert ) { + [ "G", "GG", "GGG" ].forEach(function( pattern ) { + assert.ok( "gregorian/eras/eraAbbr" in tokenizerProperties( pattern, cldr ) ); + }); + assert.ok( "gregorian/eras/eraNames" in tokenizerProperties( "GGGG", cldr ) ); + assert.ok( "gregorian/eras/eraNarrow" in tokenizerProperties( "GGGGG", cldr ) ); +}); + +/** + * Quarter + */ + +QUnit.test( "should return properties for quarter (QQQ..QQQQQ)", function( assert ) { + assert.ok( "gregorian/quarters/format/abbreviated" in tokenizerProperties( "QQQ", cldr ) ); + assert.ok( "gregorian/quarters/format/wide" in tokenizerProperties( "QQQQ", cldr ) ); + assert.ok( "gregorian/quarters/format/narrow" in tokenizerProperties( "QQQQQ", cldr ) ); +}); + +QUnit.test( "should return properties for quarter (qqq..qqqqq)", function( assert ) { + assert.ok( "gregorian/quarters/stand-alone/abbreviated" in tokenizerProperties( "qqq", cldr ) ); + assert.ok( "gregorian/quarters/stand-alone/wide" in tokenizerProperties( "qqqq", cldr ) ); + assert.ok( "gregorian/quarters/stand-alone/narrow" in tokenizerProperties( "qqqqq", cldr ) ); +}); + +/** + * Month + */ + +QUnit.test( "should return properties for month (MMM..MMMMM)", function( assert ) { + assert.ok( "gregorian/months/format/abbreviated" in tokenizerProperties( "MMM", cldr ) ); + assert.ok( "gregorian/months/format/wide" in tokenizerProperties( "MMMM", cldr ) ); + assert.ok( "gregorian/months/format/narrow" in tokenizerProperties( "MMMMM", cldr ) ); +}); + +QUnit.test( "should return properties for month (LL..LLLLL)", function( assert ) { + assert.ok( "gregorian/months/stand-alone/abbreviated" in tokenizerProperties( "LLL", cldr ) ); + assert.ok( "gregorian/months/stand-alone/wide" in tokenizerProperties( "LLLL", cldr ) ); + assert.ok( "gregorian/months/stand-alone/narrow" in tokenizerProperties( "LLLLL", cldr ) ); +}); + +/** + * Week day + */ + +QUnit.test( "should return properties for day of week (eee..eeeeee)", function( assert ) { + assert.ok( "gregorian/days/format/abbreviated" in tokenizerProperties( "eee", cldr ) ); + assert.ok( "gregorian/days/format/wide" in tokenizerProperties( "eeee", cldr ) ); + assert.ok( "gregorian/days/format/narrow" in tokenizerProperties( "eeeee", cldr ) ); + assert.ok( "gregorian/days/format/short" in tokenizerProperties( "eeeeee", cldr ) ); +}); + +QUnit.test( "should return properties for day of week (ccc..cccccc)", function( assert ) { + assert.ok( "gregorian/days/stand-alone/abbreviated" in tokenizerProperties( "ccc", cldr ) ); + assert.ok( "gregorian/days/stand-alone/wide" in tokenizerProperties( "cccc", cldr ) ); + assert.ok( "gregorian/days/stand-alone/narrow" in tokenizerProperties( "ccccc", cldr ) ); + assert.ok( "gregorian/days/stand-alone/short" in tokenizerProperties( "cccccc", cldr ) ); +}); + +QUnit.test( "should return properties for day of week (E..EEEEEE)", function( assert ) { + [ "E", "EE", "EEE" ].forEach(function( pattern ) { + assert.ok( "gregorian/days/format/abbreviated" in tokenizerProperties( pattern, cldr ) ); + }); + assert.ok( "gregorian/days/format/wide" in tokenizerProperties( "EEEE", cldr ) ); + assert.ok( "gregorian/days/format/narrow" in tokenizerProperties( "EEEEE", cldr ) ); + assert.ok( "gregorian/days/format/short" in tokenizerProperties( "EEEEEE", cldr ) ); +}); + +/** + * Period + */ + +QUnit.test( "should return properties for period (a)", function( assert ) { + assert.ok( "gregorian/dayPeriods/format/wide" in tokenizerProperties( "a", cldr ) ); +}); + +/** + * Zone + */ + +var properties; +QUnit.test( "should return properties for timezone (z)", function( assert ) { + var enGb = new Cldr( "en-GB" ); + + properties = tokenizerProperties( "z", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + properties = tokenizerProperties( "zzzz", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "z", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "standardOrDaylightTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + properties = tokenizerProperties( "zzzz", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "standardOrDaylightTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "z", enGb, "Europe/London" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "standardOrDaylightTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + properties = tokenizerProperties( "zzzz", cldr, "Europe/London" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "standardOrDaylightTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "zzzz", cldr, "Asia/Dubai" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "standardOrDaylightTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); +}); + +QUnit.test( "should return properties for timezone (Z)", function( assert ) { + properties = tokenizerProperties( "Z", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "ZZZZ", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "ZZZZZ", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); +}); + +QUnit.test( "should return properties for timezone (O)", function( assert ) { + properties = tokenizerProperties( "O", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "OOOO", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); +}); + +QUnit.test( "should return properties for timezone (v)", function( assert ) { + properties = tokenizerProperties( "v", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "genericTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + properties = tokenizerProperties( "vvvv", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "genericTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + // Use metazone. + properties = tokenizerProperties( "vvvv", cldr, "America/Sao_Paulo" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "genericTzName", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + // Fall through 'VVVV' format. + properties = tokenizerProperties( "v", cldr, "America/Sao_Paulo" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "v", cldr, "Foo/Baz" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + properties = tokenizerProperties( "vvvv", cldr, "Foo/Baz" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + // Fall through 'O' and 'OOOO' formats. + properties = tokenizerProperties( "v", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + properties = tokenizerProperties( "vvvv", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); +}); + +QUnit.test( "should return properties for timezone (V)", function( assert ) { + // FIXME assert.equal( JSON.stringify( properties ), "" ); + properties = tokenizerProperties( "VV", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe" + ]); + + properties = tokenizerProperties( "VVV", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + properties = tokenizerProperties( "VVVV", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + // Fall through to 'VVV' format with "Unknown" exemplarCity. + properties = tokenizerProperties( "VVV", cldr, "Foo/Bar" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); + + // Fall through 'OOOO' format. + properties = tokenizerProperties( "VVVV", cldr, "America/Los_Angeles" ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "timeZoneName", + "timeZoneNameRe", + "timeZoneNames/gmtZeroFormat", + "timeZoneNames/hourFormat", + "timeZoneNames/gmtZeroFormatRe", + "x" + ]); +}); + +QUnit.test( "should return properties for timezone (X)", function( assert ) { + properties = tokenizerProperties( "X", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "XX", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "XXX", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "XXXX", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "XXXXX", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); +}); + +QUnit.test( "should return properties for timezone (x)", function( assert ) { + properties = tokenizerProperties( "x", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "xx", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "xxx", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "xxxx", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); + + properties = tokenizerProperties( "xxxxx", cldr ); + assert.deepEqual( Object.keys( properties ), [ + "pattern", + "digitsRe", + "x" + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/tokenizer.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/tokenizer.js new file mode 100644 index 000000000..b93d30e3e --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/date/tokenizer.js @@ -0,0 +1,1179 @@ +define([ + "cldr", + "src/date/tokenizer", + "src/date/tokenizer-properties", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/timeZoneNames.json", + "json!cldr-data/main/en-GB/ca-gregorian.json", + "json!cldr-data/main/en-GB/numbers.json", + "json!cldr-data/main/en-GB/timeZoneNames.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/metaZones.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, tokenizer, tokenizerProperties, enCaGregorian, enNumbers, enTimeZoneNames, + enGbCaGregorian, enGbNumbers, enGbTimeZoneNames, likelySubtags, metaZones, timeData, weekData ) { + +var cldr; + +// Simple number parser for this test purposes. +function simpleNumberParser( value ) { + return +value; +} + +Cldr.load( + enCaGregorian, + enNumbers, + enTimeZoneNames, + enGbCaGregorian, + enGbNumbers, + enGbTimeZoneNames, + likelySubtags, + metaZones, + timeData, + weekData +); + +Cldr.load({ + "main": { + "en": { + "dates": { + "timeZoneNames": { + "zone": { + "Foo": { + "Baz": { + "exemplarCity": "Foo City" + } + } + } + } + } + } + } +}); + +cldr = new Cldr( "en" ); + +QUnit.assert.dateTokenizer = function( value, pattern, cldr, expected ) { + this.dateWithTimeZoneTokenizer( value, pattern, cldr, null, expected ); +}; + +QUnit.assert.dateWithTimeZoneTokenizer = function( value, pattern, cldr, timeZone, expected ) { + this.deepEqual( + tokenizer( value, simpleNumberParser, tokenizerProperties( pattern, cldr, timeZone ) ), + expected + ); +}; + +QUnit.module( "Date Tokenizer" ); + +/** + * Correctness + */ + +QUnit.test( "should not tokenize when extra characters present at the end", function( assert ) { + assert.dateTokenizer( "2016", "yy", cldr, [] ); +}); + +/** + * Era + */ + +QUnit.test( "should tokenize era (G|GG|GGG)", function( assert ) { + assert.dateTokenizer( "AD", "G", cldr, [{ + type: "G", + lexeme: "AD", + value: "1" + }] ); + assert.dateTokenizer( "AD", "GG", cldr, [{ + type: "GG", + lexeme: "AD", + value: "1" + }] ); + assert.dateTokenizer( "AD", "GGG", cldr, [{ + type: "GGG", + lexeme: "AD", + value: "1" + }] ); +}); + +QUnit.test( "should tokenize era (GGGG)", function( assert ) { + assert.dateTokenizer( "Anno Domini", "GGGG", cldr, [{ + type: "GGGG", + lexeme: "Anno Domini", + value: "1" + }] ); +}); + +QUnit.test( "should tokenize era (GGGGG)", function( assert ) { + assert.dateTokenizer( "A", "GGGGG", cldr, [{ + type: "GGGGG", + lexeme: "A", + value: "1" + }] ); +}); + +/** + * Year + */ + +QUnit.test( "should tokenize year (y) with no padding", function( assert ) { + assert.dateTokenizer( "1982", "y", cldr, [{ + type: "y", + lexeme: "1982", + value: 1982 + }] ); +}); + +QUnit.test( "should tokenize year (yy) with padding, and limit 2 digits", function( assert ) { + assert.dateTokenizer( "82", "yy", cldr, [{ + type: "yy", + lexeme: "82", + value: 82 + }] ); +}); + +QUnit.test( "should tokenize year (yyy+) with padding", function( assert ) { + assert.dateTokenizer( "1982", "yyy", cldr, [{ + type: "yyy", + lexeme: "1982", + value: 1982 + }] ); + assert.dateTokenizer( "01982", "yyyyy", cldr, [{ + type: "yyyyy", + lexeme: "01982", + value: 1982 + }] ); +}); + +QUnit.test( "should tokenize year in \"week of year\" (Y) with no padding", function( assert ) { + assert.dateTokenizer( "1982", "Y", cldr, [{ + type: "Y", + lexeme: "1982", + value: 1982 + }] ); +}); + +QUnit.test( "should tokenize year in \"week of year\" (YY) with padding, and limit 2 digits", function( assert ) { + assert.dateTokenizer( "82", "YY", cldr, [{ + type: "YY", + lexeme: "82", + value: 82 + }] ); +}); + +QUnit.test( "should tokenize year in \"week of year\" (YYY+) with padding", function( assert ) { + assert.dateTokenizer( "1982", "YYY", cldr, [{ + type: "YYY", + lexeme: "1982", + value: 1982 + }] ); + assert.dateTokenizer( "01982", "YYYYY", cldr, [{ + type: "YYYYY", + lexeme: "01982", + value: 1982 + }] ); +}); + +/** + * Quarter + */ + +QUnit.test( "should tokenize quarter (Q|q) with no padding", function( assert ) { + assert.dateTokenizer( "1", "Q", cldr, [{ + type: "Q", + lexeme: "1", + value: 1 + }] ); + assert.dateTokenizer( "1", "q", cldr, [{ + type: "q", + lexeme: "1", + value: 1 + }] ); +}); + +QUnit.test( "should tokenize quarter (QQ|qq) with padding", function( assert ) { + assert.dateTokenizer( "01", "QQ", cldr, [{ + type: "QQ", + lexeme: "01", + value: 1 + }] ); + assert.dateTokenizer( "01", "qq", cldr, [{ + type: "qq", + lexeme: "01", + value: 1 + }] ); +}); + +QUnit.test( "should tokenize quarter (QQQ|qqq)", function( assert ) { + assert.dateTokenizer( "Q1", "QQQ", cldr, [{ + type: "QQQ", + lexeme: "Q1", + value: "1" + }] ); + assert.dateTokenizer( "Q1", "qqq", cldr, [{ + type: "qqq", + lexeme: "Q1", + value: "1" + }] ); +}); + +QUnit.test( "should tokenize quarter (QQQQ|qqqq) with padding", function( assert ) { + assert.dateTokenizer( "1st quarter", "QQQQ", cldr, [{ + type: "QQQQ", + lexeme: "1st quarter", + value: "1" + }] ); + assert.dateTokenizer( "1st quarter", "qqqq", cldr, [{ + type: "qqqq", + lexeme: "1st quarter", + value: "1" + }] ); +}); + +/** + * Month + */ + +QUnit.test( "should tokenize month (M|L) with no padding", function( assert ) { + assert.dateTokenizer( "1", "M", cldr, [{ + type: "M", + lexeme: "1", + value: 1 + }] ); + assert.dateTokenizer( "1", "L", cldr, [{ + type: "L", + lexeme: "1", + value: 1 + }] ); +}); + +QUnit.test( "should tokenize month (MM|LL) with padding", function( assert ) { + assert.dateTokenizer( "01", "MM", cldr, [{ + type: "MM", + lexeme: "01", + value: 1 + }] ); + assert.dateTokenizer( "01", "LL", cldr, [{ + type: "LL", + lexeme: "01", + value: 1 + }] ); +}); + +QUnit.test( "should tokenize month (MMM|LLL)", function( assert ) { + assert.dateTokenizer( "Jan", "MMM", cldr, [{ + type: "MMM", + lexeme: "Jan", + value: "1" + }] ); + assert.dateTokenizer( "Jan", "LLL", cldr, [{ + type: "LLL", + lexeme: "Jan", + value: "1" + }] ); +}); + +QUnit.test( "should tokenize month (MMMM|LLLL)", function( assert ) { + assert.dateTokenizer( "January", "MMMM", cldr, [{ + type: "MMMM", + lexeme: "January", + value: "1" + }] ); + assert.dateTokenizer( "January", "LLLL", cldr, [{ + type: "LLLL", + lexeme: "January", + value: "1" + }] ); +}); + +QUnit.test( "should tokenize month (MMMMM|LLLLL)", function( assert ) { + assert.dateTokenizer( "J", "MMMMM", cldr, [{ + type: "MMMMM", + lexeme: "J", + value: "1" + }] ); + assert.dateTokenizer( "J", "LLLLL", cldr, [{ + type: "LLLLL", + lexeme: "J", + value: "1" + }] ); +}); + +/** + * Week + */ + +QUnit.test( "should tokenize week of year (w) with no padding", function( assert ) { + assert.dateTokenizer( "1", "w", cldr, [{ + type: "w", + lexeme: "1", + value: 1 + }] ); +}); + +QUnit.test( "should tokenize week of year (ww) with padding", function( assert ) { + assert.dateTokenizer( "01", "ww", cldr, [{ + type: "ww", + lexeme: "01", + value: 1 + }] ); +}); + +QUnit.test( "should tokenize week of month (W)", function( assert ) { + assert.dateTokenizer( "1", "W", cldr, [{ + type: "W", + lexeme: "1", + value: 1 + }] ); +}); + +/** + * Day + */ + +QUnit.test( "should tokenize day (d) with no padding", function( assert ) { + assert.dateTokenizer( "2", "d", cldr, [{ + type: "d", + lexeme: "2", + value: 2 + }] ); + + // Test #696 - Mix of numbering systems. + assert.dateTokenizer( "٧", "d", cldr, [] ); +}); + +QUnit.test( "should tokenize day (dd) with padding", function( assert ) { + assert.dateTokenizer( "02", "dd", cldr, [{ + type: "dd", + lexeme: "02", + value: 2 + }] ); +}); + +QUnit.test( "should tokenize day of year (D) with no padding", function( assert ) { + assert.dateTokenizer( "2", "D", cldr, [{ + type: "D", + lexeme: "2", + value: 2 + }] ); +}); + +QUnit.test( "should tokenize day of year (DD|DDD) with padding", function( assert ) { + assert.dateTokenizer( "02", "DD", cldr, [{ + type: "DD", + lexeme: "02", + value: 2 + }] ); + assert.dateTokenizer( "002", "DDD", cldr, [{ + type: "DDD", + lexeme: "002", + value: 2 + }] ); +}); + +QUnit.test( "should tokenize day of week in month (F)", function( assert ) { + assert.dateTokenizer( "1", "F", cldr, [{ + type: "F", + lexeme: "1", + value: 1 + }] ); +}); + +/** + * Week day + */ + +QUnit.test( "should tokenize local day of week (e|c) with no padding", function( assert ) { + assert.dateTokenizer( "7", "e", cldr, [{ + type: "e", + lexeme: "7", + value: 7 + }] ); + assert.dateTokenizer( "7", "c", cldr, [{ + type: "c", + lexeme: "7", + value: 7 + }] ); +}); + +QUnit.test( "should tokenize local day of week (ee|cc) with padding", function( assert ) { + assert.dateTokenizer( "07", "ee", cldr, [{ + type: "ee", + lexeme: "07", + value: 7 + }] ); + assert.dateTokenizer( "07", "cc", cldr, [{ + type: "cc", + lexeme: "07", + value: 7 + }] ); +}); + +QUnit.test( "should tokenize local day of week (E|EE|EEE|eee|ccc)", function( assert ) { + assert.dateTokenizer( "Sat", "E", cldr, [{ + type: "E", + lexeme: "Sat", + value: "sat" + }] ); + assert.dateTokenizer( "Sat", "EE", cldr, [{ + type: "EE", + lexeme: "Sat", + value: "sat" + }] ); + assert.dateTokenizer( "Sat", "EEE", cldr, [{ + type: "EEE", + lexeme: "Sat", + value: "sat" + }] ); + assert.dateTokenizer( "Sat", "eee", cldr, [{ + type: "eee", + lexeme: "Sat", + value: "sat" + }] ); + assert.dateTokenizer( "Sat", "ccc", cldr, [{ + type: "ccc", + lexeme: "Sat", + value: "sat" + }] ); +}); + +QUnit.test( "should tokenize local day of week (EEEE|eeee|cccc)", function( assert ) { + assert.dateTokenizer( "Saturday", "EEEE", cldr, [{ + type: "EEEE", + lexeme: "Saturday", + value: "sat" + }] ); + assert.dateTokenizer( "Saturday", "eeee", cldr, [{ + type: "eeee", + lexeme: "Saturday", + value: "sat" + }] ); + assert.dateTokenizer( "Saturday", "cccc", cldr, [{ + type: "cccc", + lexeme: "Saturday", + value: "sat" + }] ); +}); + +QUnit.test( "should tokenize local day of week (EEEEE|eeeee|ccccc)", function( assert ) { + // OBS: note the abbreviated S would matche sun or sat. But, only the first is returned. + assert.dateTokenizer( "S", "EEEEE", cldr, [{ + type: "EEEEE", + lexeme: "S", + value: "sun" + }] ); + assert.dateTokenizer( "S", "eeeee", cldr, [{ + type: "eeeee", + lexeme: "S", + value: "sun" + }] ); + assert.dateTokenizer( "S", "ccccc", cldr, [{ + type: "ccccc", + lexeme: "S", + value: "sun" + }] ); +}); + +QUnit.test( "should tokenize local day of week (EEEEEE|eeeeee|cccccc)", function( assert ) { + assert.dateTokenizer( "Sa", "EEEEEE", cldr, [{ + type: "EEEEEE", + lexeme: "Sa", + value: "sat" + }] ); + assert.dateTokenizer( "Sa", "eeeeee", cldr, [{ + type: "eeeeee", + lexeme: "Sa", + value: "sat" + }] ); + assert.dateTokenizer( "Sa", "cccccc", cldr, [{ + type: "cccccc", + lexeme: "Sa", + value: "sat" + }] ); +}); + +/** + * Period + */ + +QUnit.test( "should tokenize period (a)", function( assert ) { + assert.dateTokenizer( "AM", "a", cldr, [{ + type: "a", + lexeme: "AM", + value: "am" + }] ); +}); + +/** + * Hour + */ + +QUnit.test( "should tokenize hour (h) using 12-hour-cycle [1-12] with no padding", function( assert ) { + assert.dateTokenizer( "9", "h", cldr, [{ + type: "h", + lexeme: "9", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (hh) using 12-hour-cycle [1-12] with padding", function( assert ) { + assert.dateTokenizer( "09", "hh", cldr, [{ + type: "hh", + lexeme: "09", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (H) using 24-hour-cycle [0-23] with no padding", function( assert ) { + assert.dateTokenizer( "9", "H", cldr, [{ + type: "H", + lexeme: "9", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (HH) using 24-hour-cycle [0-23] with padding", function( assert ) { + assert.dateTokenizer( "09", "HH", cldr, [{ + type: "HH", + lexeme: "09", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (K) using 12-hour-cycle [0-11] with no padding", function( assert ) { + assert.dateTokenizer( "9", "K", cldr, [{ + type: "K", + lexeme: "9", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (KK) using 12-hour-cycle [0-11] with padding", function( assert ) { + assert.dateTokenizer( "09", "KK", cldr, [{ + type: "KK", + lexeme: "09", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (k) using 24-hour-cycle [1-24] with no padding", function( assert ) { + assert.dateTokenizer( "9", "k", cldr, [{ + type: "k", + lexeme: "9", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (kk) using 24-hour-cycle [1-24] with padding", function( assert ) { + assert.dateTokenizer( "09", "kk", cldr, [{ + type: "kk", + lexeme: "09", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (j) using preferred hour format for the locale (h, H, K, or k) with no padding", function( assert ) { + assert.dateTokenizer( "9", "j", cldr, [{ + type: "j", + lexeme: "9", + value: 9 + }] ); +}); + +QUnit.test( "should tokenize hour (jj) using preferred hour format for the locale (h, H, K, or k) with padding", function( assert ) { + assert.dateTokenizer( "09", "jj", cldr, [{ + type: "jj", + lexeme: "09", + value: 9 + }] ); +}); + +/** + * Minute + */ + +QUnit.test( "should tokenize minute (m) with no padding", function( assert ) { + assert.dateTokenizer( "5", "m", cldr, [{ + type: "m", + lexeme: "5", + value: 5 + }] ); +}); + +QUnit.test( "should tokenize minute (mm) with padding", function( assert ) { + assert.dateTokenizer( "05", "mm", cldr, [{ + type: "mm", + lexeme: "05", + value: 5 + }] ); +}); + +/** + * Second + */ + +QUnit.test( "should tokenize second (s) with no padding", function( assert ) { + assert.dateTokenizer( "59", "s", cldr, [{ + type: "s", + lexeme: "59", + value: 59 + }] ); +}); + +QUnit.test( "should tokenize second (ss) with padding", function( assert ) { + assert.dateTokenizer( "59", "ss", cldr, [{ + type: "ss", + lexeme: "59", + value: 59 + }] ); +}); + +QUnit.test( "should tokenize milliseconds (S+)", function( assert ) { + assert.dateTokenizer( "4", "S", cldr, [{ + type: "S", + lexeme: "4", + value: 4 + }] ); + assert.dateTokenizer( "37", "SS", cldr, [{ + type: "SS", + lexeme: "37", + value: 37 + }] ); + assert.dateTokenizer( "369", "SSS", cldr, [{ + type: "SSS", + lexeme: "369", + value: 369 + }] ); + assert.dateTokenizer( "3690", "SSSS", cldr, [{ + type: "SSSS", + lexeme: "3690", + value: 3690 + }] ); + assert.dateTokenizer( "36900", "SSSSS", cldr, [{ + type: "SSSSS", + lexeme: "36900", + value: 36900 + }] ); +}); + +QUnit.test( "should tokenize milliseconds in a day (A+)", function( assert ) { + assert.dateTokenizer( "633074", "A", cldr, [{ + type: "A", + lexeme: "633074", + value: 633074 + }] ); + assert.dateTokenizer( "6330737", "AA", cldr, [{ + type: "AA", + lexeme: "6330737", + value: 6330737 + }] ); + assert.dateTokenizer( "63307369", "AAA", cldr, [{ + type: "AAA", + lexeme: "63307369", + value: 63307369 + }] ); + assert.dateTokenizer( "633073690", "AAAA", cldr, [{ + type: "AAAA", + lexeme: "633073690", + value: 633073690 + }] ); + assert.dateTokenizer( "6330736900", "AAAAA", cldr, [{ + type: "AAAAA", + lexeme: "6330736900", + value: 6330736900 + }] ); +}); + +/** + * Zone + */ + +QUnit.test( "should tokenize timezone (z)", function( assert ) { + var enGb = new Cldr( "en-GB" ); + + assert.dateWithTimeZoneTokenizer( "PST", "z", cldr, "America/Los_Angeles", [{ + lexeme: "PST", + type: "z", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "PDT", "z", cldr, "America/Los_Angeles", [{ + lexeme: "PDT", + type: "z", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "BST", "z", enGb, "Europe/London", [{ + lexeme: "BST", + type: "z", + value: null + }] ); + + assert.dateWithTimeZoneTokenizer( "Pacific Standard Time", "zzzz", cldr, "America/Los_Angeles", [{ + lexeme: "Pacific Standard Time", + type: "zzzz", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Pacific Daylight Time", "zzzz", cldr, "America/Los_Angeles", [{ + lexeme: "Pacific Daylight Time", + type: "zzzz", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "British Summer Time", "zzzz", cldr, "Europe/London", [{ + lexeme: "British Summer Time", + type: "zzzz", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Gulf Standard Time", "zzzz", cldr, "Asia/Dubai", [{ + lexeme: "Gulf Standard Time", + type: "zzzz", + value: null + }] ); + + // Fall through 'O' format. + assert.dateTokenizer( "GMT", "z", cldr, [{ + lexeme: "GMT", + type: "z", + value: 0 + }] ); + assert.dateTokenizer( "GMT", "zzzz", cldr, [{ + lexeme: "GMT", + type: "zzzz", + value: 0 + }] ); + assert.dateTokenizer( "GMT-3", "z", cldr, [{ + lexeme: "GMT-3", + type: "z", + value: 180 + }] ); + assert.dateTokenizer( "GMT-03:00", "zzzz", cldr, [{ + lexeme: "GMT-03:00", + type: "zzzz", + value: 180 + }] ); + assert.dateTokenizer( "GMT+11", "z", cldr, [{ + lexeme: "GMT+11", + type: "z", + value: -660 + }] ); + assert.dateTokenizer( "GMT+11:00", "zzzz", cldr, [{ + lexeme: "GMT+11:00", + type: "zzzz", + value: -660 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT", "z", enGb, "Europe/London", [{ + lexeme: "GMT", + type: "z", + value: 0 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT", "zzzz", enGb, "Europe/London", [{ + lexeme: "GMT", + type: "zzzz", + value: 0 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-3", "z", cldr, "America/Los_Angeles", [{ + lexeme: "GMT-3", + type: "z", + value: 180 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-03:00", "zzzz", cldr, "America/Los_Angeles", [{ + lexeme: "GMT-03:00", + type: "zzzz", + value: 180 + }] ); +}); + +QUnit.test( "should tokenize timezone (Z)", function( assert ) { + assert.dateTokenizer( "+0000", "Z", cldr, [{ + lexeme: "+0000", + type: "Z", + value: 0 + }] ); + assert.dateTokenizer( "GMT", "ZZZZ", cldr, [{ + lexeme: "GMT", + type: "ZZZZ", + value: 0 + }] ); + assert.dateTokenizer( "Z", "ZZZZZ", cldr, [{ + lexeme: "Z", + type: "ZZZZZ", + value: 0 + }] ); + assert.dateTokenizer( "-0300", "Z", cldr, [{ + lexeme: "-0300", + type: "Z", + value: 180 + }] ); + assert.dateTokenizer( "GMT-03:00", "ZZZZ", cldr, [{ + lexeme: "GMT-03:00", + type: "ZZZZ", + value: 180 + }] ); + assert.dateTokenizer( "-03:00", "ZZZZZ", cldr, [{ + lexeme: "-03:00", + type: "ZZZZZ", + value: 180 + }] ); + assert.dateTokenizer( "+1100", "Z", cldr, [{ + lexeme: "+1100", + type: "Z", + value: -660 + }] ); + assert.dateTokenizer( "GMT+11:00", "ZZZZ", cldr, [{ + lexeme: "GMT+11:00", + type: "ZZZZ", + value: -660 + }] ); + assert.dateTokenizer( "+11:00", "ZZZZZ", cldr, [{ + lexeme: "+11:00", + type: "ZZZZZ", + value: -660 + }] ); +}); + +QUnit.test( "should tokenize timezone (O)", function( assert ) { + assert.dateTokenizer( "GMT", "O", cldr, [{ + lexeme: "GMT", + type: "O", + value: 0 + }] ); + assert.dateTokenizer( "GMT", "OOOO", cldr, [{ + lexeme: "GMT", + type: "OOOO", + value: 0 + }] ); + assert.dateTokenizer( "GMT-3", "O", cldr, [{ + lexeme: "GMT-3", + type: "O", + value: 180 + }] ); + assert.dateTokenizer( "GMT-03:00", "OOOO", cldr, [{ + lexeme: "GMT-03:00", + type: "OOOO", + value: 180 + }] ); + assert.dateTokenizer( "GMT+11", "O", cldr, [{ + lexeme: "GMT+11", + type: "O", + value: -660 + }] ); + assert.dateTokenizer( "GMT+11:00", "OOOO", cldr, [{ + lexeme: "GMT+11:00", + type: "OOOO", + value: -660 + }] ); +}); + +QUnit.test( "should tokenize timezone (v)", function( assert ) { + assert.dateWithTimeZoneTokenizer( "PT", "v", cldr, "America/Los_Angeles", [{ + lexeme: "PT", + type: "v", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Pacific Time", "vvvv", cldr, "America/Los_Angeles", [{ + lexeme: "Pacific Time", + type: "vvvv", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "PT", "v", cldr, "America/Los_Angeles", [{ + lexeme: "PT", + type: "v", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Pacific Time", "vvvv", cldr, "America/Los_Angeles", [{ + lexeme: "Pacific Time", + type: "vvvv", + value: null + }] ); + + // Use metazone. + assert.dateWithTimeZoneTokenizer( "Brasilia Time", "vvvv", cldr, "America/Sao_Paulo", [{ + lexeme: "Brasilia Time", + type: "vvvv", + value: null + }] ); + + // Fall through 'VVVV' format. + assert.dateWithTimeZoneTokenizer( "Sao Paulo Time", "v", cldr, "America/Sao_Paulo", [{ + lexeme: "Sao Paulo Time", + type: "v", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Foo City Time", "v", cldr, "Foo/Baz", [{ + lexeme: "Foo City Time", + type: "v", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Foo City Time", "vvvv", cldr, "Foo/Baz", [{ + lexeme: "Foo City Time", + type: "vvvv", + value: null + }] ); + + // Fall through 'O' and 'OOOO' formats. + assert.dateTokenizer( "GMT-8", "v", cldr, [{ + lexeme: "GMT-8", + type: "v", + value: 480 + }] ); + assert.dateTokenizer( "GMT-3", "v", cldr, [{ + lexeme: "GMT-3", + type: "v", + value: 180 + }] ); + assert.dateTokenizer( "GMT-08:00", "vvvv", cldr, [{ + lexeme: "GMT-08:00", + type: "vvvv", + value: 480 + }] ); + assert.dateTokenizer( "GMT-03:00", "vvvv", cldr, [{ + lexeme: "GMT-03:00", + type: "vvvv", + value: 180 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-8", "v", cldr, "America/Sao_Paulo", [{ + lexeme: "GMT-8", + type: "v", + value: 480 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-3", "v", cldr, "America/Sao_Paulo", [{ + lexeme: "GMT-3", + type: "v", + value: 180 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-08:00", "vvvv", cldr, "America/Sao_Paulo", [{ + lexeme: "GMT-08:00", + type: "vvvv", + value: 480 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-03:00", "vvvv", cldr, "America/Sao_Paulo", [{ + lexeme: "GMT-03:00", + type: "vvvv", + value: 180 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-8", "v", cldr, "Etc/GMT+8", [{ + lexeme: "GMT-8", + type: "v", + value: 480 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-3", "v", cldr, "Etc/GMT+8", [{ + lexeme: "GMT-3", + type: "v", + value: 180 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-08:00", "vvvv", cldr, "Etc/GMT+8", [{ + lexeme: "GMT-08:00", + type: "vvvv", + value: 480 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-03:00", "vvvv", cldr, "Etc/GMT+8", [{ + lexeme: "GMT-03:00", + type: "vvvv", + value: 180 + }] ); +}); + +QUnit.test( "should tokenize timezone (V)", function( assert ) { + assert.dateWithTimeZoneTokenizer( "America/Los_Angeles", "VV", cldr, "America/Los_Angeles", [{ + lexeme: "America/Los_Angeles", + type: "VV", + value: "America/Los_Angeles" + }] ); + assert.dateWithTimeZoneTokenizer( "Los Angeles", "VVV", cldr, "America/Los_Angeles", [{ + lexeme: "Los Angeles", + type: "VVV", + value: null + }] ); + assert.dateWithTimeZoneTokenizer( "Los Angeles Time", "VVVV", cldr, "America/Los_Angeles", [{ + lexeme: "Los Angeles Time", + type: "VVVV", + value: null + }] ); + + // Fall through to 'VVV' format with "Unknown" exemplarCity. + assert.dateWithTimeZoneTokenizer( "Unknown City", "VVV", cldr, "Foo/Bar", [{ + lexeme: "Unknown City", + type: "VVV", + value: null + }] ); + + // Fall through 'OOOO' format. + assert.dateWithTimeZoneTokenizer( "GMT-08:00", "VVVV", cldr, "America/Los_Angeles", [{ + lexeme: "GMT-08:00", + type: "VVVV", + value: 480 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-03:00", "VVVV", cldr, "America/Los_Angeles", [{ + lexeme: "GMT-03:00", + type: "VVVV", + value: 180 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-08:00", "VVVV", cldr, "Etc/GMT+8", [{ + lexeme: "GMT-08:00", + type: "VVVV", + value: 480 + }] ); + assert.dateWithTimeZoneTokenizer( "GMT-03:00", "VVVV", cldr, "Etc/GMT+8", [{ + lexeme: "GMT-03:00", + type: "VVVV", + value: 180 + }] ); +}); + +QUnit.test( "should tokenize timezone (X)", function( assert ) { + [ "X", "XX", "XXX", "XXXX", "XXXXX" ].forEach(function( X ) { + assert.dateTokenizer( "Z", X, cldr, [{ + lexeme: "Z", + type: X, + value: 0 + }] ); + }); + assert.dateTokenizer( "-03", "X", cldr, [{ + lexeme: "-03", + type: "X", + value: 180 + }] ); + assert.dateTokenizer( "-0300", "XX", cldr, [{ + lexeme: "-0300", + type: "XX", + value: 180 + }] ); + assert.dateTokenizer( "-03:00", "XXX", cldr, [{ + lexeme: "-03:00", + type: "XXX", + value: 180 + }] ); + assert.dateTokenizer( "-0300", "XXXX", cldr, [{ + lexeme: "-0300", + type: "XXXX", + value: 180 + }] ); + assert.dateTokenizer( "-03:00", "XXXXX", cldr, [{ + lexeme: "-03:00", + type: "XXXXX", + value: 180 + }] ); + assert.dateTokenizer( "+0530", "XX", cldr, [{ + lexeme: "+0530", + type: "XX", + value: -330 + }] ); + assert.dateTokenizer( "+05:30", "XXX", cldr, [{ + lexeme: "+05:30", + type: "XXX", + value: -330 + }] ); + assert.dateTokenizer( "+0530", "XXXX", cldr, [{ + lexeme: "+0530", + type: "XXXX", + value: -330 + }] ); + assert.dateTokenizer( "+05:30", "XXXXX", cldr, [{ + lexeme: "+05:30", + type: "XXXXX", + value: -330 + }] ); + assert.dateTokenizer( "+11", "X", cldr, [{ + lexeme: "+11", + type: "X", + value: -660 + }] ); + assert.dateTokenizer( "+1100", "XX", cldr, [{ + lexeme: "+1100", + type: "XX", + value: -660 + }] ); + assert.dateTokenizer( "+11:00", "XXX", cldr, [{ + lexeme: "+11:00", + type: "XXX", + value: -660 + }] ); + assert.dateTokenizer( "+1100", "XXXX", cldr, [{ + lexeme: "+1100", + type: "XXXX", + value: -660 + }] ); + assert.dateTokenizer( "+11:00", "XXXXX", cldr, [{ + lexeme: "+11:00", + type: "XXXXX", + value: -660 + }] ); +}); + +QUnit.test( "should tokenize timezone (x)", function( assert ) { + assert.dateTokenizer( "-03", "x", cldr, [{ + lexeme: "-03", + type: "x", + value: 180 + }] ); + assert.dateTokenizer( "-0300", "xx", cldr, [{ + lexeme: "-0300", + type: "xx", + value: 180 + }] ); + assert.dateTokenizer( "-03:00", "xxx", cldr, [{ + lexeme: "-03:00", + type: "xxx", + value: 180 + }] ); + assert.dateTokenizer( "-0300", "xxxx", cldr, [{ + lexeme: "-0300", + type: "xxxx", + value: 180 + }] ); + assert.dateTokenizer( "-03:00", "xxxxx", cldr, [{ + lexeme: "-03:00", + type: "xxxxx", + value: 180 + }] ); + assert.dateTokenizer( "+0530", "xx", cldr, [{ + lexeme: "+0530", + type: "xx", + value: -330 + }] ); + assert.dateTokenizer( "+05:30", "xxx", cldr, [{ + lexeme: "+05:30", + type: "xxx", + value: -330 + }] ); + assert.dateTokenizer( "+0530", "xxxx", cldr, [{ + lexeme: "+0530", + type: "xxxx", + value: -330 + }] ); + assert.dateTokenizer( "+05:30", "xxxxx", cldr, [{ + lexeme: "+05:30", + type: "xxxxx", + value: -330 + }] ); + assert.dateTokenizer( "+11", "x", cldr, [{ + lexeme: "+11", + type: "x", + value: -660 + }] ); + assert.dateTokenizer( "+1100", "xx", cldr, [{ + lexeme: "+1100", + type: "xx", + value: -660 + }] ); + assert.dateTokenizer( "+11:00", "xxx", cldr, [{ + lexeme: "+11:00", + type: "xxx", + value: -660 + }] ); + assert.dateTokenizer( "+1100", "xxxx", cldr, [{ + lexeme: "+1100", + type: "xxxx", + value: -660 + }] ); + assert.dateTokenizer( "+11:00", "xxxxx", cldr, [{ + lexeme: "+11:00", + type: "xxxxx", + value: -660 + }] ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format-properties.js new file mode 100644 index 000000000..f3b8be449 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format-properties.js @@ -0,0 +1,94 @@ +define([ + "cldr", + "src/number/format-properties", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/fa/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, properties, arNumbers, enNumbers, esNumbers, faNumbers, likelySubtags, + numberingSystems ) { + +var ar, en, es, fa; + +Cldr.load( + arNumbers, + enNumbers, + esNumbers, + faNumbers, + likelySubtags, + numberingSystems +); + +ar = new Cldr( "ar" ); +en = new Cldr( "en" ); +es = new Cldr( "es" ); +fa = new Cldr( "fa" ); + +QUnit.module( "Number Format Properties" ); + +QUnit.test( "should return positivePattern", function( assert ) { + assert.equal( properties( "0", en )[ 11 ], "0" ); + assert.equal( properties( "#,##0.0#;(0)", en )[ 11 ], "#,##0.0#" ); +}); + +QUnit.test( "should return negativePattern", function( assert ) { + assert.equal( properties( "0", en )[ 12 ], "-0" ); + assert.equal( properties( "#,##0.0#;(0)", en )[ 12 ], "(#,##0.0#)" ); +}); + +QUnit.test( "should return negativePrefix", function( assert ) { + assert.equal( properties( "#,##0.0#;(0)", en )[ 13 ], "(" ); + assert.equal( properties( "'$'#,##0.0#;-'$'0", en )[ 13 ], "-'$'" ); +}); + +QUnit.test( "should return negativeSuffix", function( assert ) { + assert.equal( properties( "#,##0.0#;(0)", en )[ 14 ], ")" ); +}); + +QUnit.test( "should return round function", function( assert ) { + assert.equal( properties( "0", en )[ 15 ]( 123.45 ), "123" ); + assert.equal( properties( "0", en, { + round: "ceil" + })[ 15 ]( 123.45 ), "124" ); +}); + +QUnit.test( "should return infinitySymbol", function( assert ) { + assert.equal( properties( "0", en )[ 16 ], "∞" ); +}); + +QUnit.test( "should return nanSymbol", function( assert ) { + assert.equal( properties( "0", en )[ 17 ], "NaN" ); +}); + +QUnit.test( "should return symbolMap", function( assert ) { + assert.deepEqual( properties( "0", es )[ 18 ], { + "%": "%", + "+": "+", + ",": ".", + "-": "-", + ".": ",", + "E": "E", + "‰": "‰" + }); + + assert.deepEqual( properties( "0", fa )[ 18 ], { + "%": "٪", + "+": "\u200e+\u200e", + ",": "٬", + "-": "\u200e−", + ".": "٫", + "E": "×۱۰^", + "‰": "؉" + }); +}); + +QUnit.test( "should return nuDigits", function( assert ) { + assert.deepEqual( properties( "0", ar )[ 19 ], "٠١٢٣٤٥٦٧٨٩" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format.js new file mode 100644 index 000000000..209e968d8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format.js @@ -0,0 +1,3017 @@ +/* eslint-disable object-curly-spacing */ +define([ + "cldr", + "src/number/format", + "src/number/format-properties", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/fa/numbers.json", + "json!cldr-data/main/hu/numbers.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, format, properties, arNumbers, enNumbers, esNumbers, faNumbers, huNumbers, + zhNumbers, likelySubtags, numberingSystems ) { + +// 1: Earth average diameter according to: +// http://www.wolframalpha.com/input/?i=earth+diameter +var ar, en, es, fa, hu, zh, zhSimplified, + deci = 0.1, + earthDiameter = 12735, /* 1 */ + pi = 3.14159265359; + +Cldr.load( + arNumbers, + enNumbers, + esNumbers, + faNumbers, + huNumbers, + zhNumbers, + likelySubtags, + numberingSystems +); + +ar = new Cldr( "ar" ); +en = new Cldr( "en" ); +es = new Cldr( "es" ); +fa = new Cldr( "fa" ); +hu = new Cldr( "hu" ); +zh = new Cldr( "zh-u-nu-native" ); +zhSimplified = new Cldr( "zh" ); + +QUnit.module( "Number Format" ); + +function esPluralGenerator( n ) { + return ( n === 1 ) ? "one" : "other"; +} + +/** + * Integers + */ + +QUnit.test( "should format integers", function( assert ) { + assert.deepEqual( format( pi, properties( "#0", en ) ), [{type: "integer", value: "3"}] ); + assert.deepEqual( format( pi, properties( "###0", en ) ), [{type: "integer", value: "3"}] ); +}); + +QUnit.test( "should zero-pad minimum integer digits", function( assert ) { + assert.deepEqual( format( pi, properties( "0", en ) ), [{type: "integer", value: "3"}] ); + assert.deepEqual( format( pi, properties( "00", en ) ), [{type: "integer", value: "03"}] ); + assert.deepEqual( format( pi, properties( "000", en ) ), [{type: "integer", value: "003"}] ); +}); + +QUnit.test( "should not limit the maximum number of digits of integers", function( assert ) { + assert.deepEqual( format( earthDiameter, properties( "0", en ) ), [{type: "integer", value: "12735"}] ); + assert.deepEqual( format( earthDiameter, properties( "00", en ) ), [{type: "integer", value: "12735"}] ); + assert.deepEqual( format( earthDiameter, properties( "#0", en ) ), [{type: "integer", value: "12735"}] ); +}); + +QUnit.test( "should format negative integer", function( assert ) { + assert.deepEqual( format( -earthDiameter, properties( "0", en ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "12735" + } + ]); + + assert.deepEqual( format( -earthDiameter, properties( "0;(0)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "12735" + }, + { + "type": "literal", + "value": ")" + } + ]); + + + // The number of digits, minimal digits, and other characteristics shall be ignored in the negative subpattern. + assert.deepEqual( format( -earthDiameter, properties( "0;(0.0##)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "12735" + }, + { + "type": "literal", + "value": ")" + } + ]); +}); + +/** + * Decimals + */ + +QUnit.test( "should format decimals", function( assert ) { + assert.deepEqual( format( pi, properties( "0.##", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); +}); + +QUnit.test( "should limit maximum fraction digits", function( assert ) { + assert.deepEqual( format( pi, properties( "0.##", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "0.0#", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "0.####", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( 0.10004, properties( "0.##", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); +}); + +QUnit.test( "should zero-pad minimum fraction digits", function( assert ) { + assert.deepEqual( format( earthDiameter, properties( "0.0", en ) ), [ + { + "type": "integer", + "value": "12735" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0" + } + ]); + + assert.deepEqual( format( deci, properties( "0.00", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "10" + } + ]); +}); + +QUnit.test( "should localize decimal separator symbol (.)", function( assert ) { + assert.deepEqual( format( pi, properties( "0.##", es ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", ar ) ), [ + { + "type": "integer", + "value": "٣" + }, + { + "type": "decimal", + "value": "٫" + }, + { + "type": "fraction", + "value": "١٤" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", zh ) ), [ + { + "type": "integer", + "value": "三" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "一四" + } + ]); +}); + +QUnit.test( "should allow integer and fraction options override", function( assert ) { + // Overriding minimum integer digits only. + assert.deepEqual( format( pi, properties( "0", en, { minimumIntegerDigits: 2 } ) ), [ + { + "type": "integer", + "value": "03" + } + ]); + + // Overriding both fraction options. + assert.deepEqual( format( pi, properties( "0.##", en, { + maximumFractionDigits: 5, + minimumFractionDigits: 3 + } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14159" + } + ]); + + assert.deepEqual( format( 0.1, properties( "0.##", en, { + maximumFractionDigits: 5, + minimumFractionDigits: 3 + } ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "100" + } + ]); + + // Overriding maximum fraction digits only. + assert.deepEqual( format( pi, properties( "0.##", en, { maximumFractionDigits: 0 } ) ), [ + { + "type": "integer", + "value": "3" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", en, { maximumFractionDigits: 1 } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", en, { maximumFractionDigits: 3 } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "142" + } + ]); + + assert.deepEqual( format( 0.01, properties( "0.##", en, { maximumFractionDigits: 1 } ) ), [ + { + "type": "integer", + "value": "0" + } + ]); + + assert.deepEqual( format( 0.01, properties( "0.0#", en, { maximumFractionDigits: 1 } ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0" + } + ]); + + // Sanity normalization: minimumFractionDigits = min( minimumFractionDigits, maximumFractionDigits ) + assert.deepEqual( format( 0.1, properties( "0.0000", en, { maximumFractionDigits: 2 } ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "10" + } + ]); + + // Overriding minimum fraction digits only. + assert.deepEqual( format( 1, properties( "0.00", en, { minimumFractionDigits: 0 } ) ), [ + { + "type": "integer", + "value": "1" + } + ]); + + assert.deepEqual( format( 0.1, properties( "0.00", en, { minimumFractionDigits: 0 } ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); + + assert.deepEqual( format( 0.001, properties( "0.00", en, { minimumFractionDigits: 0 } ) ), [ + { + "type": "integer", + "value": "0" + } + ]); + + assert.deepEqual( format( 0.1, properties( "0.##", en, { minimumFractionDigits: 2 } ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "10" + } + ]); + + // Sanity normalization: maximumFractionDigits = max( minimumFractionDigits, maximumFractionDigits ). + assert.deepEqual( format( pi, properties( "0.##", en, { minimumFractionDigits: 5 } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14159" + } + ]); + + // Overriding both minimum and maximum fraction digits. + assert.deepEqual( format( pi, properties( "0.##", en, { + minimumFractionDigits: 1, + maximumFractionDigits: 4 + }) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", en, { + minimumIntegerDigits: 2, + maximumFractionDigits: 3 + }) ), [ + { + "type": "integer", + "value": "03" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "142" + } + ]); + + // Overriding both integer and fraction options. + assert.deepEqual( format( 1.1, properties( "0.##", en, { + minimumIntegerDigits: 2, + minimumFractionDigits: 3 + }) ), [ + { + "type": "integer", + "value": "01" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "100" + } + ]); + + assert.deepEqual( format( 1.1, properties( "0.##", en, { + minimumIntegerDigits: 2, + maximumFractionDigits: 3 + }) ), [ + { + "type": "integer", + "value": "01" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); +}); + +QUnit.test( "should allow rounding", function( assert ) { + assert.deepEqual( format( pi, properties( "0.10", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "10" + } + ]); + + assert.deepEqual( format( pi, properties( "0.20", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "20" + } + ]); + + assert.deepEqual( format( pi, properties( "0.5", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0" + } + ]); + + assert.deepEqual( format( pi, properties( "0.1", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); + + // Handle inaccurate floating point arithmetics like 0.00015 * 10000 = 1.49999999999999. + // See #376. + assert.deepEqual( format( 0.00015, properties( "0.0000", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "0002" + } + ]); +}); + +QUnit.test( "should allow different rounding options", function( assert ) { + assert.deepEqual( format( pi, properties( "0.##", en, { round: "ceil" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "15" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", en, { round: "floor"} ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", en, { round: "round" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "0.##", en, { round: "truncate"} ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "0.####", en, { round: "ceil" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( pi, properties( "0.####", en, { round: "floor"} ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1415" + } + ]); + + assert.deepEqual( format( pi, properties( "0.####", en, { round: "round" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( pi, properties( "0.####", en, { round: "truncate"} ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1415" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.##", en, { round: "ceil" } ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.##", en, { round: "floor"} ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "15" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.##", en, { round: "round" } ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.##", en, { round: "truncate"} ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.####", en, { round: "ceil" } ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1415" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.####", en, { round: "floor"} ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.####", en, { round: "round" } ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.####", en, { round: "truncate"} ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1415" + } + ]); +}); + +QUnit.test( "should format significant digits", function( assert ) { + assert.deepEqual( format( 123, properties( "@@@", en ) ), [ + { + "type": "integer", + "value": "123" + } + ]); + + assert.deepEqual( format( 12345, properties( "@@@", en ) ), [ + { + "type": "integer", + "value": "12300" + } + ]); + + assert.deepEqual( format( 12345, properties( "@@#", en ) ), [ + { + "type": "integer", + "value": "12300" + } + ]); + + assert.deepEqual( format( 12345, properties( "@##", en ) ), [ + { + "type": "integer", + "value": "12300" + } + ]); + + assert.deepEqual( format( pi, properties( "@@", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); + + assert.deepEqual( format( pi, properties( "@@#", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( pi, properties( "@@##", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "142" + } + ]); + + assert.deepEqual( format( pi, properties( "@####", en ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1416" + } + ]); + + assert.deepEqual( format( 0.10004, properties( "@@", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "10" + } + ]); + + assert.deepEqual( format( 0.10004, properties( "@##", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "1" + } + ]); + + // This also test for the following inaccurate floating point arithmetics: + // `1234 * 0.0001 = 0.12340000000000001`. + assert.deepEqual( format( 0.12345, properties( "@@@", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "123" + } + ]); + + assert.deepEqual( format( 1.23004, properties( "@@##", en ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "23" + } + ]); + +}); + +QUnit.test( "should format negative decimal", function( assert ) { + assert.deepEqual( format( -pi, properties( "0.##", en ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( -pi, properties( "0.##;(0.##)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + }, + { + "type": "literal", + "value": ")" + } + ]); + + assert.deepEqual( format( -pi, properties( "@@#", en ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + } + ]); + + assert.deepEqual( format( -pi, properties( "@@#;(@@#)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + }, + { + "type": "literal", + "value": ")" + } + ]); + + + // The U+002D HYPHEN-MINUS sign shall be localized. + assert.deepEqual( format( -pi, properties( "0.##", fa ) ), [ + { + "type": "minusSign", + "value": "\u200e\u2212" + }, + { + "type": "integer", + "value": "۳" + }, + { + "type": "decimal", + "value": "٫" + }, + { + "type": "fraction", + "value": "۱۴" + } + ]); + + // The number of digits, minimal digits, and other characteristics shall be ignored in the negative subpattern. + assert.deepEqual( format( -pi, properties( "0.##;(0)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + }, + { + "type": "literal", + "value": ")" + } + ]); + + assert.deepEqual( format( -pi, properties( "@@#;(0)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "14" + }, + { + "type": "literal", + "value": ")" + } + ]); + +}); + +/** + * Grouping separators + */ + +QUnit.test( "should format grouping separators", function( assert ) { + assert.deepEqual( format( earthDiameter, properties( "#,##0.#", en ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "735" + } + ]); + + assert.deepEqual( format( earthDiameter, properties( "#,#,#0.#", en ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "2" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "7" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "35" + } + ]); + + assert.deepEqual( format( 123456789, properties( "#,##,###,###0", en ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "6789" + } + ]); + + assert.deepEqual( format( 123456789, properties( "###,###,###0", en ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "6789" + } + ]); + + assert.deepEqual( format( 123456789, properties( "##,#,###,###0", en ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "345" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "6789" + } + ]); + +}); + +/** + * Percent + */ + +QUnit.test( "should format percent", function( assert ) { + assert.deepEqual( format( 0.01, properties( "0%", en ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 0.01, properties( "00%", en ) ), [ + { + "type": "integer", + "value": "01" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 0.1, properties( "0%", en ) ), [ + { + "type": "integer", + "value": "10" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 0.5, properties( "#0%", en ) ), [ + { + "type": "integer", + "value": "50" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 1, properties( "0%", en ) ), [ + { + "type": "integer", + "value": "100" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 0.005, properties( "##0.#%", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "5" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 0.005, properties( "##0.#%", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "5" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + +}); + +QUnit.test( "should localize percent symbol (%)", function( assert ) { + assert.deepEqual( format( 0.5, properties( "#0%", ar ) ), [ + { + "type": "integer", + "value": "٥٠" + }, + { + "type": "percentSign", + "value": "٪" + } + ]); +}); + +QUnit.test( "should format negative percentage", function( assert ) { + assert.deepEqual( format( -0.1, properties( "0%", en ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "10" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( -0.1, properties( "0%;(0%)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "10" + }, + { + "type": "percentSign", + "value": "%" + }, + { + "type": "literal", + "value": ")" + } + ]); + + assert.deepEqual( format( -0.1, properties( "0%;(0)%", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "10" + }, + { + "type": "literal", + "value": ")" + }, + { + "type": "percentSign", + "value": "%" + } + ]); +}); + +/** + * Per mille + */ + +QUnit.test( "should format per mille", function( assert ) { + assert.deepEqual( format( 0.001, properties( "0\u2030", en ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.001, properties( "00\u2030", en ) ), [ + { + "type": "integer", + "value": "01" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.01, properties( "0\u2030", en ) ), [ + { + "type": "integer", + "value": "10" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.1, properties( "0\u2030", en ) ), [ + { + "type": "integer", + "value": "100" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + + assert.deepEqual( format( 0.5, properties( "#0\u2030", en ) ), [ + { + "type": "integer", + "value": "500" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 1, properties( "0\u2030", en ) ), [ + { + "type": "integer", + "value": "1000" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.0005, properties( "##0.#\u2030", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "5" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.0005, properties( "##0.#\u2030", en ) ), [ + { + "type": "integer", + "value": "0" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "5" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.5, properties( "#0‰", en ) ), [ + { + "type": "integer", + "value": "500" + }, + { + "type": "perMille", + "value": "‰" + } + ]); + + assert.deepEqual( format( 0.5, properties( "#0‰", en ) ), [ + { + "type": "integer", + "value": "500" + }, + { + "type": "perMille", + "value": "‰" + } + ]); +}); + +QUnit.test( "should localize per mille symbol (\u2030)", function( assert ) { + assert.deepEqual( format( 0.5, properties( "#0\u2030", ar ) ), [ + { + "type": "integer", + "value": "٥٠٠" + }, + { + "type": "perMille", + "value": "؉" + } + ]); +}); + +QUnit.test( "should format negative mille", function( assert ) { + assert.deepEqual( format( -0.001, properties( "0\u2030", en ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "perMille", + "value": "\u2030" + } + ]); + + assert.deepEqual( format( -0.001, properties( "0\u2030;(0\u2030)", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "perMille", + "value": "\u2030" + }, + { + "type": "literal", + "value": ")" + } + ]); + + assert.deepEqual( format( -0.001, properties( "0\u2030;(0)\u2030", en ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": ")" + }, + { + "type": "perMille", + "value": "\u2030" + } + ]); +}); + +/** + * Infinity + */ + +QUnit.test( "should format infinite numbers", function( assert ) { + assert.deepEqual( format( Math.pow(2, 2000 ), properties( "0", en ) ), [ + { + "type": "infinity", + "value": "∞" + } + ]); + + assert.deepEqual( format( Math.pow(-2, 2001 ), properties( "0", en ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "infinity", + "value": "∞" + } + ]); +}); + +/** + * NaN + */ + +QUnit.test( "should format infinite numbers", function( assert ) { + assert.deepEqual( format( NaN, properties( "0", en ) ), [ + { + "type": "nan", + "value": "NaN" + } + ]); +}); + +/** + * Literal + */ + +QUnit.test( "should format literal (')", function( assert ) { + assert.deepEqual( format( 69900, properties( "'$'#,##0", en ) ), [ + { + "type": "literal", + "value": "$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + } + ]); + + assert.deepEqual( format( 69900, properties( "'$'#,##0.00", en ) ), [ + { + "type": "literal", + "value": "$" + }, + { + "type": "integer", + "value": "69" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "900" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "00" + } + ]); + + // Make sure quoted characters (in this case, minus sign) aren't localized. + assert.deepEqual( format( -pi, properties( "0.##;'-'0.##", fa ) ), [ + { + "type": "literal", + "value": "-" + }, + { + "type": "integer", + "value": "۳" + }, + { + "type": "decimal", + "value": "٫" + }, + { + "type": "fraction", + "value": "۱۴" + } + ]); +}); + +/** + * Compact Numbers + */ + +QUnit.test( "should format numbers in compact mode", function( assert ) { + assert.deepEqual( format( 273.7, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "274" + } + ]); + + assert.deepEqual( format( 273.7, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "274" + } + ]); + + assert.deepEqual( format( 273, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "273" + } + ]); + + assert.deepEqual( format( 273, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "273" + } + ]); + + assert.deepEqual( format( 573, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "573" + } + ]); + + assert.deepEqual( format( 573, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "573" + } + ]); + + assert.deepEqual( format( 1273, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 1273, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 1234000000000000, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "1234" + }, + { + "type": "compact", + "value": "T" + } + ]); + + assert.deepEqual( format( 1273000, properties( "0", es, { + compact: "long" + } ), esPluralGenerator ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "millón" + } + ]); + + assert.deepEqual( format( 2273000, properties( "0", es, { + compact: "long" + } ), esPluralGenerator ), [ + { + "type": "integer", + "value": "2" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "millones" + } + ]); + + assert.deepEqual( format( 27371, properties( "0", zhSimplified, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "万" + } + ]); + + assert.deepEqual( format( 27371, properties( "0", zhSimplified, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "万" + } + ]); + + assert.deepEqual( format( 9999.9, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "10" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "13" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "13" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 127350, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "127" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 127350, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "127" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 1273500, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "compact", + "value": "M" + } + ]); + + assert.deepEqual( format( 1273500, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "million" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "compact", + "value": "M" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "million" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0;(0)", en, { compact: "short" } ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "compact", + "value": "M" + }, + { + "type": "literal", + "value": ")" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0;(0)", en, { compact: "long" } ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "million" + }, + { + "type": "literal", + "value": ")" + } + ]); + + + // Some hungarian short formats have a terminating E, which is treated as a special + // character in non-compact formats. + // \u00A0 is a unicode non-breaking space. + assert.deepEqual( format( 1273, properties( "0", hu, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "E" + } + ]); + + assert.deepEqual( format( 1273, properties( "0", hu, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "ezer" + } + ]); + + assert.deepEqual( format( 9000000, properties( "0", hu, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "9" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "M" + } + ]); + + assert.deepEqual( format( 9000000, properties( "0", hu, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "9" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "millió" + } + ]); + +}); + +QUnit.test( "should format numbers that lack pattern in compact mode (use default compact mode pattern)", function( assert ) { + assert.deepEqual( format( 0.01, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "0" + } + ]); + + assert.deepEqual( format( 273.7, properties( "0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "274" + } + ]); + + assert.deepEqual( format( 273.7, properties( "0", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "274" + } + ]); + + assert.deepEqual( format( 2737, properties( "0", zhSimplified, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "2737" + } + ]); + + assert.deepEqual( format( 2737, properties( "0", zhSimplified, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "2737" + } + ]); + +}); + +QUnit.test( "numbers should support fraction digits in compact mode", function( assert ) { + assert.deepEqual( format( 1273, properties( "0", en, { + compact: "short", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 1273, properties( "0", en, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 1273000, properties( "0", es, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + }), esPluralGenerator ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "millones" + } + ]); + + assert.deepEqual( format( 2273000, properties( "0", es, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + } ), esPluralGenerator ), [ + { + "type": "integer", + "value": "2" + }, + { + "type": "decimal", + "value": "," + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "millones" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "7" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "7" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 127350, properties( "0", en, { + compact: "short", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "127" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "4" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 127350, properties( "0", en, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "127" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "4" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + } + ]); + + assert.deepEqual( format( 1273500, properties( "0", en, { + compact: "short", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "compact", + "value": "M" + } + ]); + + assert.deepEqual( format( 1273500, properties( "0", en, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "million" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0", en, { + compact: "short", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "compact", + "value": "M" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0", en, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "million" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0;(0)", en, { + compact: "short", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "compact", + "value": "M" + }, + { + "type": "literal", + "value": ")" + } + ]); + + assert.deepEqual( format( -1273500, properties( "0;(0)", en, { + compact: "long", + maximumFractionDigits: 1, + minimumFractionDigits: 1 + })), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "1" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "3" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "million" + }, + { + "type": "literal", + "value": ")" + } + ]); + +}); + +QUnit.test( "numbers should support significant digits in compact mode", function( assert ) { + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumSignificantDigits: 3, + minimumSignificantDigits: 3 + })), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "7" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumSignificantDigits: 2, + minimumSignificantDigits: 2 + })), [ + { + "type": "integer", + "value": "13" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumSignificantDigits: 1, + minimumSignificantDigits: 1 + })), [ + { + "type": "integer", + "value": "10" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( -127350, properties( "0", en, { + compact: "short", + maximumSignificantDigits: 3, + minimumSignificantDigits: 1 + })), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "127" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( -127350000, properties( "0", en, { + compact: "short", + maximumSignificantDigits: 3, + minimumSignificantDigits: 1 + })), [ + { + "type": "minusSign", + "value": "-" + }, + { + "type": "integer", + "value": "127" + }, + { + "type": "compact", + "value": "M" + } + ]); + + assert.deepEqual( format( 12849872883, properties("0", en, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3, + compact: "short" + })), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "8" + }, + { + "type": "compact", + "value": "B" + } + ]); + + assert.deepEqual( format( 12850172883, properties("0", en, { + minimumSignificantDigits: 1, + maximumSignificantDigits: 3, + compact: "short" + })), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "9" + }, + { + "type": "compact", + "value": "B" + } + ]); +}); + +QUnit.test( "numbers should support rounding in compact mode", function( assert ) { + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumFractionDigits: 2, + minimumFractionDigits: 1 + } ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "74" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumFractionDigits: 2, + minimumFractionDigits: 1, + round: "ceil" + } ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "74" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumFractionDigits: 2, + minimumFractionDigits: 1, + round: "floor" + } ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "73" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12735, properties( "0", en, { + compact: "short", + maximumFractionDigits: 2, + minimumFractionDigits: 1, + round: "truncate" + } ) ), [ + { + "type": "integer", + "value": "12" + }, + { + "type": "decimal", + "value": "." + }, + { + "type": "fraction", + "value": "73" + }, + { + "type": "compact", + "value": "K" + } + ]); + +}); + +QUnit.test( "percents should format in compact mode", function( assert ) { + assert.deepEqual( format( 127, properties( "0%", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "13" + }, + { + "type": "compact", + "value": "K" + }, + { + "type": "percentSign", + "value": "%" + } + ]); + + assert.deepEqual( format( 127, properties( "0%", en, { compact: "long" } ) ), [ + { + "type": "integer", + "value": "13" + }, + { + "type": "literal", + "value": " " + }, + { + "type": "compact", + "value": "thousand" + }, + { + "type": "percentSign", + "value": "%" + } + ]); +}); + + +QUnit.test( "given pattern properties should be ignored in compact mode", function( assert ) { + + // minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, minimumSignificantDigits, + // maximumSignificantDigits extracted from the pattern should be ignored. + assert.deepEqual( format( 2737, properties( "0.#", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 2737, properties( "0.0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 2737, properties( "0.0#", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 2737, properties( "@@", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 69900, properties( "'$'#,##0.00", en, {compact: "short"} ) ), [ + { + "type": "literal", + "value": "$" + }, + { + "type": "integer", + "value": "70" + }, + { + "type": "compact", + "value": "K" + } + ]); + + assert.deepEqual( format( 12.01, properties( "0.#", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "12" + } + ]); + + assert.deepEqual( format( 12.01, properties( "0.#", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "12" + } + ]); + + assert.deepEqual( format( 12.01, properties( "0.0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "12" + } + ]); + + assert.deepEqual( format( 12.01, properties( "0.0#", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "12" + } + ]); + + assert.deepEqual( format( 12.01, properties( "@@", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "12" + } + ]); + + assert.deepEqual( format( 12.01, properties( "'$'#,##0.00", en, {compact: "short"} ) ), [ + { + "type": "literal", + "value": "$" + }, + { + "type": "integer", + "value": "12" + } + ]); + + // Preserve grouping separator from original pattern. (only used in very big numbers) + assert.deepEqual( format( 1234000000000000, properties( "#,##0", en, { compact: "short" } ) ), [ + { + "type": "integer", + "value": "1" + }, + { + "type": "group", + "value": "," + }, + { + "type": "integer", + "value": "234" + }, + { + "type": "compact", + "value": "T" + } + ]); + + // Preserve prefix and suffix + assert.deepEqual( format( 2737, properties( "(0.0#)", en, { compact: "short" } ) ), [ + { + "type": "literal", + "value": "(" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "compact", + "value": "K" + }, + { + "type": "literal", + "value": ")" + } + ]); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/grouping-separator.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/grouping-separator.js new file mode 100644 index 000000000..540aea5d6 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/grouping-separator.js @@ -0,0 +1,25 @@ +define([ + "src/number/format/grouping-separator" +], function( groupingSeparator ) { + +QUnit.module( "Number Format Grouping Separator" ); + +QUnit.test( "should format primary grouping separator", function( assert ) { + assert.equal( groupingSeparator( 1, 2 ), "1" ); + assert.equal( groupingSeparator( 11, 2 ), "11" ); + assert.equal( groupingSeparator( 111, 2 ), "1,11" ); + assert.equal( groupingSeparator( 1111, 2 ), "11,11" ); + assert.equal( groupingSeparator( 11111, 2 ), "1,11,11" ); + assert.equal( groupingSeparator( 1111111, 3 ), "1,111,111" ); + assert.equal( groupingSeparator( 1111111.1111, 3 ), "1,111,111.1111" ); +}); + +QUnit.test( "should format primary and second grouping separator", function( assert ) { + assert.equal( groupingSeparator( 111111, 3, 2 ), "1,11,111" ); + assert.equal( groupingSeparator( 1111111, 3, 2 ), "11,11,111" ); + assert.equal( groupingSeparator( 11111111, 3, 2 ), "1,11,11,111" ); + assert.equal( groupingSeparator( 11111111, 2, 1 ), "1,1,1,1,1,1,11" ); + assert.equal( groupingSeparator( 11111111.1111, 2, 1 ), "1,1,1,1,1,1,11.1111" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/integer-fraction-digits.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/integer-fraction-digits.js new file mode 100644 index 000000000..63cf74c5a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/integer-fraction-digits.js @@ -0,0 +1,86 @@ +define([ + "src/number/format/integer-fraction-digits", + "src/util/number/round" +], function( formatIntegerFractionDigits, round ) { + +// 1: Earth average diameter according to: +// http://www.wolframalpha.com/input/?i=earth+diameter +var ceil = round( "ceil" ), + deci = 0.1, + earthDiameter = 12735, /* 1 */ + floor = round( "floor" ), + pi = 3.14159265359, + truncate = round( "truncate" ), + round = round( "round" ); + +QUnit.module( "Number Integer and Fraction Format" ); + +/** + * Integers + */ + +QUnit.test( "should zero-pad minimum integer digits", function( assert ) { + assert.equal( formatIntegerFractionDigits( pi, 2, null, null, round, null ), "03" ); +}); + +QUnit.test( "should not limit the maximum number of digits of integers", function( assert ) { + assert.equal( formatIntegerFractionDigits( earthDiameter, 1, null, null, round, null ), "12735" ); +}); + +/** + * Decimals + */ + +QUnit.test( "should limit maximum fraction digits", function( assert ) { + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 0, round, null ), "3" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 2, round, null ), "3.14" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 4, 4, round, null ), "3.1416" ); +}); + +QUnit.test( "should zero-pad minimum fraction digits", function( assert ) { + assert.equal( formatIntegerFractionDigits( deci, 1, 2, 2, round, null ), "0.10" ); +}); + +QUnit.test( "should allow rounding", function( assert ) { + assert.equal( formatIntegerFractionDigits( pi, 1, 2, 2, round, 0.10 ), "3.10" ); + assert.equal( formatIntegerFractionDigits( 100.7, 1, 0, 0, round, null ), "101" ); +}); + +QUnit.test( "should allow different rounding options", function( assert ) { + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 2, ceil, null ), "3.15" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 2, floor, null ), "3.14" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 2, round, null ), "3.14" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 2, truncate, null ), "3.14" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 4, ceil, null ), "3.1416" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 4, floor, null), "3.1415" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 4, round, null ), "3.1416" ); + assert.equal( formatIntegerFractionDigits( pi, 1, 0, 4, truncate, null ), "3.1415" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 2, ceil, null ), "-3.14" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 2, floor, null ), "-3.15" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 2, round, null ), "-3.14" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 2, truncate, null ), "-3.14" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 4, ceil, null ), "-3.1415" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 4, floor, null ), "-3.1416" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 4, round, null ), "-3.1416" ); + assert.equal( formatIntegerFractionDigits( -pi, 1, 0, 4, truncate, null ), "-3.1415" ); +}); + +// `12341234.233` => `"12,341,234.233000001"` (#227). +// `0.00015 * 10000 = 1.49999999999999` (#376). +QUnit.test( "should handle inaccurate floating point arithmetics", function( assert ) { + assert.equal( formatIntegerFractionDigits( 12341234.233, 1, 1, 3, round, null ), "12341234.233" ); + assert.equal( formatIntegerFractionDigits( 1234 * 0.0001, 1, 1, 4, round, null ), "0.1234" ); + assert.equal( formatIntegerFractionDigits( 0.00015, 1, 1, 4, round, null ), "0.0002" ); +}); + +// `2e-7` => `"2,e-7"` (#750) +QUnit.test( "should handle small numbers", function( assert ) { + assert.equal( formatIntegerFractionDigits( 2e-7, 1, 0, 10, round, null ), "0.0000002" ); + assert.equal( formatIntegerFractionDigits( 1e-20, 1, 0, 20, round, null ), "0.00000000000000000001" ); + assert.equal( formatIntegerFractionDigits( 9e-8, 1, 0, 7, round, null ), "0.0000001" ); + + // Make sure precision isn't wrongly messed up, e.g., 123456789.1229999959. + assert.equal( formatIntegerFractionDigits( 123456789.123, 1, 0, 10, round, null ), "123456789.123" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/significant-digits.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/significant-digits.js new file mode 100644 index 000000000..cdd203d0a --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/format/significant-digits.js @@ -0,0 +1,44 @@ +define([ + "src/number/format/significant-digits", + "src/util/number/round" +], function( formatSignificantDigits, round ) { + +var ceil = round( "ceil" ), + deci = 0.1, + floor = round( "floor" ), + pi = 3.14159265359, + truncate = round( "truncate" ), + round = round( "round" ); + +QUnit.module( "Number Significant Format" ); + +QUnit.test( "should zero-pad minimum significant figures", function( assert ) { + assert.equal( formatSignificantDigits( deci, 3, 3, round ), "0.100" ); +}); + +QUnit.test( "should limit maximum significant figures", function( assert ) { + assert.equal( formatSignificantDigits( 123, 3, 3, round ), "123" ); + assert.equal( formatSignificantDigits( 12345, 3, 3, round ), "12300" ); + assert.equal( formatSignificantDigits( pi, 2, 2, round ), "3.1" ); + assert.equal( formatSignificantDigits( pi, 2, 3, round ), "3.14" ); + assert.equal( formatSignificantDigits( pi, 2, 4, round ), "3.142" ); + assert.equal( formatSignificantDigits( pi, 1, 5, round ), "3.1416" ); + assert.equal( formatSignificantDigits( 0.10004, 2, 2, round ), "0.10" ); + assert.equal( formatSignificantDigits( 0.12345, 3, 3, round ), "0.123" ); + assert.equal( formatSignificantDigits( 0.012345, 3, 3, round ), "0.0123" ); +}); + +QUnit.test( "should allow different round options", function( assert ) { + assert.equal( formatSignificantDigits( 0.12345, 3, 3, ceil ), "0.124" ); + assert.equal( formatSignificantDigits( 0.12345, 3, 3, floor ), "0.123" ); + assert.equal( formatSignificantDigits( 0.12345, 3, 3, truncate ), "0.123" ); + assert.equal( formatSignificantDigits( -0.12345, 3, 3, ceil ), "-0.123" ); + assert.equal( formatSignificantDigits( -0.12345, 3, 3, floor ), "-0.124" ); + assert.equal( formatSignificantDigits( -0.12345, 3, 3, truncate ), "-0.123" ); +}); + +QUnit.test( "should handle inaccurate floating point arithmetics", function( assert ) { + assert.equal( formatSignificantDigits( 0.00012345, 1, 3, round ), "0.000123" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/parse-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/parse-properties.js new file mode 100644 index 000000000..100539155 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/parse-properties.js @@ -0,0 +1,129 @@ +define([ + "cldr", + "src/number/parse-properties", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/fa/numbers.json", + "json!cldr-data/main/sv/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, properties, arNumbers, enNumbers, esNumbers, faNumbers, svNumbers, + likelySubtags ) { + +var ar, en, es, sv; + +Cldr.load( + arNumbers, + enNumbers, + esNumbers, + faNumbers, + svNumbers, + likelySubtags +); + +ar = new Cldr( "ar" ); +en = new Cldr( "en" ); +es = new Cldr( "es" ); +sv = new Cldr( "sv" ); + +QUnit.module( "Number Parse Properties" ); + +QUnit.test( "should return invertedSymbolMap", function( assert ) { + assert.deepEqual( properties( "0", es )[ 0 ], { + "%": "%", + "+": "+", + ",": ".", + "-": "-", + ".": ",", + "E": "E", + "‰": "‰" + }); + + // Note grouping separator is using regular U+0020 SPACE due to loose matching. + assert.deepEqual( properties( "0", sv )[ 0 ], { + "%": "%", + "+": "+", + ",": ".", + " ": ",", + "×10^": "E", + "‰": "‰", + "-": "-" + }); +}); + +QUnit.test( "should return invertedNuDigitsMap", function( assert ) { + assert.deepEqual( properties( "0", ar )[ 1 ], { + "٠": "0", + "١": "1", + "٢": "2", + "٣": "3", + "٤": "4", + "٥": "5", + "٦": "6", + "٧": "7", + "٨": "8", + "٩": "9" + }); +}); + +QUnit.test( "should return infinity tokenizer", function( assert ) { + assert.deepEqual( properties( "0", en )[ 2 ].infinity, /^∞/ ); +}); + +QUnit.test( "should return NaN tokenizer", function( assert ) { + assert.deepEqual( properties( "0", en )[ 2 ].nan, /^NaN/ ); + assert.deepEqual( properties( "0", ar )[ 2 ].nan, /^ليس رقم/ ); +}); + +QUnit.test( "should return negativePrefix tokenizer", function( assert ) { + assert.deepEqual( properties( "0", en )[ 2 ].negativePrefix, /^-/ ); + assert.deepEqual( properties( "0;(0)", en )[ 2 ].negativePrefix, /^\(/ ); + }); + +QUnit.test( "should return negativeSuffix tokenizer", function( assert ) { + assert.deepEqual( properties( "0", en )[ 2 ].negativeSuffix, /^/ ); + assert.deepEqual( properties( "0;(0)", en )[ 2 ].negativeSuffix, /^\)/ ); +}); + +QUnit.test( "should return number tokenizer", function( assert ) { + assert.deepEqual( properties( "0", en )[ 2 ].number, /^\d+/ ); + assert.deepEqual( properties( "0.##", en )[ 2 ].number, /^(\d+(\.\d+|\.)?|(\d+)?\.\d+)/ ); + + assert.deepEqual( + properties( "#,##0.##", en )[ 2 ].number, + /^((\d{1,3}(,\d{3})+|\d+)(\.\d+|\.)?|((\d{1,3}(,\d{3})+|\d+))?\.\d+)/ + ); + + assert.deepEqual( + properties( "#,##0.##", es )[ 2 ].number, + /^((\d{1,3}(\.\d{3})+|\d+)(,\d+|,)?|((\d{1,3}(\.\d{3})+|\d+))?,\d+)/ + ); + + assert.deepEqual( + properties( "#,##,##0.##", en )[ 2 ].number, + /^((\d{1,2}((,\d{2})*(,\d{3}))|\d+)(\.\d+|\.)?|((\d{1,2}((,\d{2})*(,\d{3}))|\d+))?\.\d+)/ + ); + + assert.deepEqual( + properties( "#,##0.##", sv )[ 2 ].number, + /^((\d{1,3}( \d{3})+|\d+)(,\d+|,)?|((\d{1,3}( \d{3})+|\d+))?,\d+)/ + ); +}); + +QUnit.test( "should return prefix tokenizer", function( assert ) { + assert.deepEqual( properties( "%0", en )[ 2 ].prefix, /^%/ ); + assert.deepEqual( properties( "'$'0.##", en )[ 2 ].prefix, /^\$/ ); + assert.deepEqual( properties( "'$ '0.##", en )[ 2 ].prefix, /^\$ / ); + assert.deepEqual( properties( "'foo''bar'0.##", en )[ 2 ].prefix, /^foo'bar/ ); + assert.deepEqual( properties( "-'foo''bar'0.##", en )[ 2 ].prefix, /^-foo'bar/ ); +}); + +QUnit.test( "should return suffix tokenizer", function( assert ) { + assert.deepEqual( properties( "#,##0%", en )[ 2 ].suffix, /^%/ ); + assert.deepEqual( properties( "#,##0 %", ar )[ 2 ].suffix, /^ ٪/ ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/parse.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/parse.js new file mode 100644 index 000000000..7e33dae95 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/parse.js @@ -0,0 +1,215 @@ +define([ + "cldr", + "src/number/parse", + "src/number/parse-properties", + "json!cldr-data/main/ar/numbers.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/es/numbers.json", + "json!cldr-data/main/pt/numbers.json", + "json!cldr-data/main/ru/numbers.json", + "json!cldr-data/main/sv/numbers.json", + "json!cldr-data/main/zh/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/numberingSystems.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, parse, properties, arNumbers, enNumbers, esNumbers, ptNumbers, ruNumbers, + svNumbers, zhNumbers, likelySubtags, numberingSystems ) { + +var ar, en, es, pt, ru, sv, zh; + +Cldr.load( + arNumbers, + enNumbers, + esNumbers, + ptNumbers, + ruNumbers, + svNumbers, + zhNumbers, + likelySubtags, + numberingSystems +); + +ar = new Cldr( "ar" ); +en = new Cldr( "en" ); +es = new Cldr( "es" ); +pt = new Cldr( "pt" ); +ru = new Cldr( "ru" ); +sv = new Cldr( "sv" ); +zh = new Cldr( "zh-u-nu-native" ); + +QUnit.module( "Number Parse" ); + +/** + * Integers + */ + +QUnit.test( "should parse integers", function( assert ) { + assert.equal( parse( "3", properties( "0", en ) ), 3 ); +}); + +QUnit.test( "should parse invalid integers as NaN", function( assert ) { + assert.deepEqual( parse( "", properties( "0", en ) ), NaN ); +}); + +QUnit.test( "should parse zero-padded integers", function( assert ) { + assert.equal( parse( "003", properties( "000", en ) ), 3 ); +}); + +QUnit.test( "should parse grouping separators", function( assert ) { + assert.equal( parse( "12,735", properties( "#,##0.#", en ) ), 12735 ); + assert.equal( parse( "12735", properties( "#,##0.#", en ) ), 12735 ); + assert.equal( parse( "1,2,7,35", properties( "#,#,#0.#", en ) ), 12735 ); + assert.equal( parse( "12.735", properties( "#,##0", es ) ), 12735 ); + assert.equal( parse( "1000", properties( "#,##0", en ) ), 1000 ); + assert.equal( parse( "1000", properties( "#,##,##0", en ) ), 1000 ); +}); + +QUnit.test( "should parse invalid grouping separators as NaN", function( assert ) { + assert.deepEqual( parse( "1,2735", properties( "#,##0.#", en ) ), NaN ); + assert.deepEqual( parse( "1,2,735", properties( "#,#,#0.#", en ) ), NaN ); + assert.deepEqual( parse( "1,27,35", properties( "#,#,#0.#", en ) ), NaN ); + assert.deepEqual( parse( "12,7,35", properties( "#,#,#0.#", en ) ), NaN ); + assert.deepEqual( parse( "1.2735", properties( "#,##0", es ) ), NaN ); +}); + +QUnit.test( "should parse negative integers", function( assert ) { + assert.equal( parse( "-3", properties( "0", en ) ), -3 ); + assert.equal( parse( "(3)", properties( "0;(0)", en ) ), -3 ); + assert.equal( parse( "-3", properties( "0", sv ) ), -3 ); + assert.equal( parse( "\u22123", properties( "0", sv ) ), -3 ); +}); + +QUnit.test( "should parse mixed non breaking space and breaking space", function( assert ) { + assert.equal( parse( "12\xA0735", properties( "#,##0", sv ) ), 12735 ); + assert.equal( parse( "12 735", properties( "#,##0", sv ) ), 12735 ); +}); + +/** + * Decimals + */ + +QUnit.test( "should parse decimals", function( assert ) { + assert.equal( parse( "3.14", properties( "0.##", en ) ), 3.14 ); + assert.equal( parse( "3,14", properties( "0.##", es ) ), 3.14 ); + assert.equal( parse( "٣٫١٤", properties( "0.##", ar ) ), 3.14 ); + assert.equal( parse( "三.一四", properties( "0.##", zh ) ), 3.14 ); + assert.equal( parse( "3.00", properties( "0.##", en ) ), 3 ); +}); + +QUnit.test( "should parse invalid decimals as NaN", function( assert ) { + assert.deepEqual( parse( "", properties( "0.#", en ) ), NaN ); + assert.deepEqual( parse( "3,14", properties( "0.#", en ) ), NaN ); + assert.deepEqual( parse( "3.14", properties( "0.#", es ) ), NaN ); +}); + +QUnit.test( "should parse zero-padded decimals", function( assert ) { + assert.equal( parse( "12735.0", properties( "0.0", en ) ), 12735 ); + assert.equal( parse( "0.10", properties( "0.00", en ) ), 0.1 ); +}); + +QUnit.test( "should parse trailing decimal separator", function( assert ) { + assert.equal( parse( "1.", properties( "0.0", en ) ), 1 ); + assert.equal( parse( "١٫", properties( "0.0", ar ) ), 1 ); + assert.equal( parse( "1,", properties( "0.0", pt ) ), 1 ); +}); + +QUnit.test( "should parse non-padded decimals", function( assert ) { + assert.equal( parse( ".14159", properties( "0.0", en ) ), 0.14159 ); + assert.equal( parse( ".752", properties( "0.0", en ) ), 0.752 ); + assert.equal( parse( "٫١٤١٥٩", properties( "0.0", ar ) ), 0.14159 ); + assert.equal( parse( ",752", properties( "0.0", pt ) ), 0.752 ); +}); + +QUnit.test( "should parse negative decimal", function( assert ) { + assert.equal( parse( "-3.14", properties( "0.##", en ) ), -3.14 ); + assert.equal( parse( "(3.14)", properties( "0.##;(0.##)", en ) ), -3.14 ); +}); + +QUnit.test( "should not parse too permissive", function( assert ) { + assert.deepEqual( parse( "3.14", properties( "0.##", ru ) ), NaN ); +}); + +/** + * Percent + */ + +QUnit.test( "should parse percent", function( assert ) { + assert.equal( parse( "1%", properties( "0%", en ) ), 0.01 ); + assert.equal( parse( "01%", properties( "00%", en ) ), 0.01 ); + assert.equal( parse( "10%", properties( "0%", en ) ), 0.1 ); + assert.equal( parse( "50%", properties( "#0%", en ) ), 0.5 ); + assert.equal( parse( "100%", properties( "0%", en ) ), 1 ); + assert.equal( parse( "0.5%", properties( "##0.#%", en ) ), 0.005 ); + assert.equal( parse( "0.5%", properties( "##0.#%", en ) ), 0.005 ); + assert.equal( parse( "%100", properties( "%0", en ) ), 1 ); + assert.deepEqual( parse( "1", properties( "0%", en ) ), NaN ); +}); + +QUnit.test( "should localize percent symbol (%)", function( assert ) { + assert.equal( parse( "٥٠٪", properties( "#0%", ar ) ), 0.5 ); +}); + +QUnit.test( "should parse negative percentage", function( assert ) { + assert.equal( parse( "-10%", properties( "0%", en ) ), -0.1 ); + assert.equal( parse( "(10%)", properties( "0%;(0%)", en ) ), -0.1 ); + assert.equal( parse( "(10)%", properties( "0%;(0)%", en ) ), -0.1 ); +}); + +/** + * Per mille + */ + +QUnit.test( "should parse per mille", function( assert ) { + assert.equal( parse( "1\u2030", properties( "0\u2030", en ) ), 0.001 ); + assert.equal( parse( "01\u2030", properties( "00\u2030", en ) ), 0.001 ); + assert.equal( parse( "10\u2030", properties( "0\u2030", en ) ), 0.01 ); + assert.equal( parse( "100\u2030", properties( "0\u2030", en ) ), 0.1 ); + assert.equal( parse( "500\u2030", properties( "#0\u2030", en ) ), 0.5 ); + assert.equal( parse( "1000\u2030", properties( "0\u2030", en ) ), 1 ); + assert.equal( parse( "0.5\u2030", properties( "##0.#\u2030", en ) ), 0.0005 ); + assert.equal( parse( "0.5\u2030", properties( "##0.#\u2030", en ) ), 0.0005 ); + assert.equal( parse( "500\u2030", properties( "#0‰", en ) ), 0.5 ); + assert.equal( parse( "500‰", properties( "#0‰", en ) ), 0.5 ); + assert.equal( parse( "٥٠٠؉", properties( "#0\u2030", ar ) ), 0.5 ); +}); + +QUnit.test( "should parse negative mille", function( assert ) { + assert.equal( parse( "-1\u2030", properties( "0\u2030", en ) ), -0.001 ); + assert.equal( parse( "(1\u2030)", properties( "0\u2030;(0\u2030)", en ) ), -0.001 ); + assert.equal( parse( "(1)\u2030", properties( "0\u2030;(0)\u2030", en ) ), -0.001 ); +}); + +/** + * Infinite number + */ +QUnit.test( "should parse infinite numbers", function( assert ) { + assert.equal( parse( "∞", properties( "0", en ) ), Infinity ); + assert.equal( parse( "-∞", properties( "0", en ) ), -Infinity ); + assert.equal( parse( "(∞)", properties( "0;(0)", en ) ), -Infinity ); +}); + +/** + * NaN + */ +QUnit.test( "should parse NaN", function( assert ) { + assert.deepEqual( parse( "NaN", properties( "0", en ) ), NaN ); +}); + +/** + * Prefix + */ +QUnit.test( "should parse invalid prefix as NaN", function( assert ) { + assert.deepEqual( parse( "invalid", properties( "0", en ) ), NaN ); + assert.deepEqual( parse( "garbage123", properties( "0", en ) ), NaN ); +}); + +/** + * Suffix + */ +QUnit.test( "should parse invalid suffix as NaN", function( assert ) { + assert.deepEqual( parse( "123garbage", properties( "0", en ) ), NaN ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/pattern-properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/pattern-properties.js new file mode 100644 index 000000000..8e1eed3ef --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/number/pattern-properties.js @@ -0,0 +1,83 @@ +define([ + "cldr", + "src/number/format-properties", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, properties, enNumbers, likelySubtags ) { + +var en; + +Cldr.load( enNumbers, likelySubtags ); + +en = new Cldr( "en" ); + +QUnit.module( "Number Pattern Properties" ); + +QUnit.test( "should return prefix", function( assert ) { + assert.equal( properties( "0", en )[ 0 ], "" ); + assert.equal( properties( "foo 0", en )[ 0 ], "foo " ); + assert.equal( properties( "-0", en )[ 0 ], "-" ); + assert.equal( properties( "'-'0", en )[ 0 ], "'-'" ); + assert.equal( properties( "-'$'0", en )[ 0 ], "-'$'" ); +}); + +QUnit.test( "should return minimumIntegerDigits", function( assert ) { + assert.equal( properties( "0", en )[ 2 ], 1 ); + assert.equal( properties( "#,##0", en )[ 2 ], 1 ); + assert.equal( properties( "00", en )[ 2 ], 2 ); + assert.equal( properties( "#0.00", en )[ 2 ], 1 ); +}); + +QUnit.test( "should return minimumFractionDigits", function( assert ) { + assert.equal( properties( "0", en )[ 3 ], 0 ); + assert.equal( properties( "0.##", en )[ 3 ], 0 ); + assert.equal( properties( "0.0#", en )[ 3 ], 1 ); +}); + +QUnit.test( "should return maximumFractionDigits", function( assert ) { + assert.equal( properties( "0", en )[ 4 ], 0 ); + assert.equal( properties( "0.##", en )[ 4 ], 2 ); + assert.equal( properties( "0.0#", en )[ 4 ], 2 ); +}); + +QUnit.test( "should return minimumSignificantDigits", function( assert ) { + assert.equal( properties( "0", en )[ 5 ], undefined ); + assert.equal( properties( "0.##", en )[ 5 ], undefined ); + assert.equal( properties( "@##", en )[ 5 ], 1 ); + assert.equal( properties( "#,#@@", en )[ 5 ], 2 ); +}); + +QUnit.test( "should return maximumSignificantDigits", function( assert ) { + assert.equal( properties( "0", en )[ 6 ], undefined ); + assert.equal( properties( "0.##", en )[ 6 ], undefined ); + assert.equal( properties( "@##", en )[ 6 ], 3 ); + assert.equal( properties( "#,#@@", en )[ 6 ], 2 ); +}); + +QUnit.test( "should return roundIncrement", function( assert ) { + assert.equal( properties( "0.##", en )[ 7 ], undefined ); + assert.equal( properties( "0.05", en )[ 7 ], 0.05 ); + assert.equal( properties( "0.002", en )[ 7 ], 0.002 ); +}); + +QUnit.test( "should return primaryGroupingSize", function( assert ) { + assert.equal( properties( "0.##", en )[ 8 ], undefined ); + assert.equal( properties( "#,##0.##", en )[ 8 ], 3 ); + assert.equal( properties( "#,##,##0.##", en )[ 8 ], 3 ); +}); + +QUnit.test( "should return secondaryGroupingSize", function( assert ) { + assert.equal( properties( "0.##", en )[ 9 ], undefined ); + assert.equal( properties( "#,##0.##", en )[ 9 ], undefined ); + assert.equal( properties( "#,##,##0.##", en )[ 9 ], 2 ); +}); + +QUnit.test( "should return suffix", function( assert ) { + assert.equal( properties( "0.##", en )[ 10 ], "" ); + assert.equal( properties( "0.## bar", en )[ 10 ], " bar" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/relative-time/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/relative-time/format.js new file mode 100644 index 000000000..ffc79c5ae --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/relative-time/format.js @@ -0,0 +1,112 @@ +define([ + "cldr", + "src/relative-time/format", + "src/relative-time/properties", + "json!cldr-data/main/en/dateFields.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, format, properties, enDateFields, likelySubtags ) { + +var cldr; + +Cldr.load( enDateFields ); +Cldr.load( likelySubtags ); + +cldr = new Cldr( "en" ); + +QUnit.module( "Relative Time Format" ); + +function mockNumberFormatter(assert, expectedValue) { + return function( value ) { + assert.equal( value, expectedValue ); + return expectedValue.toString(); + }; +} + +function mockPluralGenerator(plural) { + return function() { + return plural; + }; +} + +QUnit.test( "should format number in past", function( assert ) { + assert.equal( + format( + -7, + mockNumberFormatter( assert, 7 ), + mockPluralGenerator( "other" ), + properties( "month", cldr, {} ) + ), + "7 months ago" + ); +}); + +QUnit.test( "should format number in future", function( assert ) { + assert.equal( + format( + 7, + mockNumberFormatter( assert, 7 ), + mockPluralGenerator( "other" ), + properties( "month", cldr, {} ) + ), + "in 7 months" + ); +}); + +QUnit.test( "should format using word if possible", function( assert ) { + function mockNumberFormatter() { + assert.ok( false, "no need to call number formatter" ); + } + function mockPluralGenerator() { + assert.ok( false, "no need to call plural generator" ); + } + assert.equal( + format( 1, mockNumberFormatter, mockPluralGenerator, properties( "month", cldr, {} ) ), + "next month" + ); +}); + +QUnit.test( "should format numerically if relative-type is absent", function( assert ) { + assert.equal( + format( + 1, + mockNumberFormatter( assert, 1 ), + mockPluralGenerator( "one" ), { + "relative-type-0": "this month", + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} month", + "relativeTimePattern-count-other": "in {0} months" + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "{0} month ago", + "relativeTimePattern-count-other": "{0} months ago" + } + } + ), + "in 1 month" + ); +}); + +QUnit.test( "should format 0 as the past if no relative option is available", function( assert ) { + assert.equal( + format( + 0, + mockNumberFormatter( assert, 0 ), + mockPluralGenerator( "other" ), { + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} month", + "relativeTimePattern-count-other": "in {0} months" + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "{0} month ago", + "relativeTimePattern-count-other": "{0} months ago" + } + } + ), + "0 months ago" + ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/relative-time/properties.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/relative-time/properties.js new file mode 100644 index 000000000..160836107 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/relative-time/properties.js @@ -0,0 +1,89 @@ +define([ + "cldr", + "src/relative-time/properties", + "json!cldr-data/main/en/dateFields.json", + "json!cldr-data/main/de/dateFields.json", + "json!cldr-data/supplemental/likelySubtags.json", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, properties, enDateFields, deDateFields, likelySubtags ) { + +var cldr, de; + +Cldr.load( enDateFields ); +Cldr.load( deDateFields ); +Cldr.load( likelySubtags ); + +cldr = new Cldr( "en" ); +de = new Cldr( "de" ); + +QUnit.module( "Relative Time Properties" ); + +QUnit.test( "should return month info in english", function( assert ) { + assert.deepEqual( properties( "month", cldr, {} ), { + "relative-type--1": "last month", + "relative-type-0": "this month", + "relative-type-1": "next month", + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} month", + "relativeTimePattern-count-other": "in {0} months" + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "{0} month ago", + "relativeTimePattern-count-other": "{0} months ago" + } + }); +}); + +QUnit.test( "should return complete day info in german", function( assert ) { + assert.deepEqual( properties( "day", de, {} ), { + "relative-type--1": "gestern", + "relative-type--2": "vorgestern", + "relative-type-0": "heute", + "relative-type-1": "morgen", + "relative-type-2": "übermorgen", + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} Tag", + "relativeTimePattern-count-other": "in {0} Tagen" + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "vor {0} Tag", + "relativeTimePattern-count-other": "vor {0} Tagen" + } + }); +}); + +QUnit.test( "should return short info when requested", function( assert ) { + assert.deepEqual( properties( "month", cldr, { form: "short" } ), { + "relative-type--1": "last mo.", + "relative-type-0": "this mo.", + "relative-type-1": "next mo.", + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} mo.", + "relativeTimePattern-count-other": "in {0} mo." + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "{0} mo. ago", + "relativeTimePattern-count-other": "{0} mo. ago" + } + }); +}); + +QUnit.test( "should return narrow info when requested", function( assert ) { + assert.deepEqual( properties( "month", cldr, { form: "narrow" } ), { + "relative-type--1": "last mo.", + "relative-type-0": "this mo.", + "relative-type-1": "next mo.", + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} mo.", + "relativeTimePattern-count-other": "in {0} mo." + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "{0} mo. ago", + "relativeTimePattern-count-other": "{0} mo. ago" + } + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/unit/format.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/unit/format.js new file mode 100644 index 000000000..3a77c5c30 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/unit/format.js @@ -0,0 +1,169 @@ +define([ + "cldr", + "src/core", + "src/unit/format", + "src/unit/properties", + "json!cldr-data/main/en/units.json", + "json!cldr-data/main/ja/units.json", + "json!cldr-data/supplemental/likelySubtags.json" +], function( Cldr, Globalize, formatUnit, unitProperties, enUnits, jaUnits, likelySubtags ) { + +var cldr, globalize, units, pluralGenerator; + +QUnit.module( "Unit Format" ); + +units = { + en: enUnits, + ja: jaUnits +}; + +pluralGenerator = { + en: function oneOrOtherPluralGenerator( plural ) { + if ( plural === 1 ) { + return "one"; + } else { + return "other"; + } + }, + ja: function otherPluralGenerator() { + return "other"; + } +}; + +function stubNumberFormatter( number ) { + return number.toString(); +} + +QUnit.assert.unitFormat = function( value, unit, options, expected, language ) { + language = language || "en"; + + Cldr.load( units[ language ] ); + Cldr.load( likelySubtags ); + + globalize = new Globalize( language ); + cldr = globalize.cldr; + + var unitProps = unitProperties( unit, options.form, cldr ); + + this.equal( + formatUnit( value, options.numberFormatter || stubNumberFormatter, pluralGenerator[ language ], unitProps ), + expected + ); +}; + +QUnit.test( "Long form", function( assert ) { + assert.unitFormat( 1, "millisecond", { form: "long" }, "1 millisecond" ); + assert.unitFormat( 2, "millisecond", { form: "long" }, "2 milliseconds" ); + assert.unitFormat( 1, "second", { form: "long" }, "1 second" ); + assert.unitFormat( 2, "second", { form: "long" }, "2 seconds" ); + assert.unitFormat( 1, "minute", { form: "long" }, "1 minute" ); + assert.unitFormat( 2, "minute", { form: "long" }, "2 minutes" ); + assert.unitFormat( 1, "hour", { form: "long" }, "1 hour" ); + assert.unitFormat( 2, "hour", { form: "long" }, "2 hours" ); + assert.unitFormat( 1, "day", { form: "long" }, "1 day" ); + assert.unitFormat( 2, "day", { form: "long" }, "2 days" ); + assert.unitFormat( 1, "week", { form: "long" }, "1 week" ); + assert.unitFormat( 2, "week", { form: "long" }, "2 weeks" ); + assert.unitFormat( 1, "month", { form: "long" }, "1 month" ); + assert.unitFormat( 2, "month", { form: "long" }, "2 months" ); + assert.unitFormat( 1, "year", { form: "long" }, "1 year" ); + assert.unitFormat( 2, "year", { form: "long" }, "2 years" ); +}); + +QUnit.test( "Short form", function( assert ) { + assert.unitFormat( 1, "millisecond", { form: "short" }, "1 ms" ); + assert.unitFormat( 2, "millisecond", { form: "short" }, "2 ms" ); + assert.unitFormat( 1, "second", { form: "short" }, "1 sec" ); + assert.unitFormat( 2, "second", { form: "short" }, "2 sec" ); + assert.unitFormat( 1, "minute", { form: "short" }, "1 min" ); + assert.unitFormat( 2, "minute", { form: "short" }, "2 min" ); + assert.unitFormat( 1, "hour", { form: "short" }, "1 hr" ); + assert.unitFormat( 2, "hour", { form: "short" }, "2 hr" ); + assert.unitFormat( 1, "day", { form: "short" }, "1 day" ); + assert.unitFormat( 2, "day", { form: "short" }, "2 days" ); + assert.unitFormat( 1, "week", { form: "short" }, "1 wk" ); + assert.unitFormat( 2, "week", { form: "short" }, "2 wks" ); + assert.unitFormat( 1, "month", { form: "short" }, "1 mth" ); + assert.unitFormat( 2, "month", { form: "short" }, "2 mths" ); + assert.unitFormat( 1, "year", { form: "short" }, "1 yr" ); + assert.unitFormat( 2, "year", { form: "short" }, "2 yrs" ); +}); + +QUnit.test( "Narrow form", function( assert ) { + assert.unitFormat( 1, "millisecond", { form: "narrow" }, "1ms" ); + assert.unitFormat( 2, "millisecond", { form: "narrow" }, "2ms" ); + assert.unitFormat( 1, "second", { form: "narrow" }, "1s" ); + assert.unitFormat( 2, "second", { form: "narrow" }, "2s" ); + assert.unitFormat( 1, "minute", { form: "narrow" }, "1m" ); + assert.unitFormat( 2, "minute", { form: "narrow" }, "2m" ); + assert.unitFormat( 1, "hour", { form: "narrow" }, "1h" ); + assert.unitFormat( 2, "hour", { form: "narrow" }, "2h" ); + assert.unitFormat( 1, "day", { form: "narrow" }, "1d" ); + assert.unitFormat( 2, "day", { form: "narrow" }, "2d" ); + assert.unitFormat( 1, "week", { form: "narrow" }, "1w" ); + assert.unitFormat( 2, "week", { form: "narrow" }, "2w" ); + assert.unitFormat( 1, "month", { form: "narrow" }, "1m" ); + assert.unitFormat( 2, "month", { form: "narrow" }, "2m" ); + assert.unitFormat( 1, "year", { form: "narrow" }, "1y" ); + assert.unitFormat( 2, "year", { form: "narrow" }, "2y" ); +}); + +QUnit.test( "Compound form (long)", function( assert ) { + assert.unitFormat( 1, "speed-mile-per-hour", { form: "long" }, "1 mile per hour" ); + assert.unitFormat( 100, "speed-mile-per-hour", { form: "long" }, "100 miles per hour" ); + assert.unitFormat( 1, "consumption-mile-per-gallon", { form: "long" }, "1 mile per gallon" ); + assert.unitFormat( 100, "consumption-mile-per-gallon", { form: "long" }, "100 miles per gallon" ); +}); + +QUnit.test( "Compound form (without category)", function( assert ) { + assert.unitFormat( 1, "mile-per-hour", { form: "long" }, "1 mile per hour" ); + assert.unitFormat( 100, "mile-per-hour", { form: "long" }, "100 miles per hour" ); +}); + +QUnit.test( "Compound form (without precomputed)", function( assert ) { + assert.unitFormat( 1, "length-foot-per-second", { form: "long" }, "1 foot per second" ); + assert.unitFormat( 100, "length-foot-per-second", { form: "long" }, "100 feet per second" ); + assert.unitFormat( 1, "megabyte-per-second", { form: "narrow" }, "1MB/s" ); + assert.unitFormat( 100, "megabyte-per-second", { form: "narrow" }, "100MB/s" ); + + assert.unitFormat( 1.2345678910, "megabyte-per-second", + { + form: "narrow", + numberFormatter: function( number ) { + return number.toFixed(1); + } + }, + "1.2MB/s" ); +}); + +QUnit.test( "Compound form (short)", function( assert ) { + assert.unitFormat( 1, "speed-mile-per-hour", { form: "short" }, "1 mph" ); + assert.unitFormat( 100, "speed-mile-per-hour", { form: "short" }, "100 mph" ); + assert.unitFormat( 1, "consumption-mile-per-gallon", { form: "short" }, "1 mpg" ); + assert.unitFormat( 100, "consumption-mile-per-gallon", { form: "short" }, "100 mpg" ); +}); + +QUnit.test( "Compound form (narrow)", function( assert ) { + assert.unitFormat( 1, "speed-mile-per-hour", { form: "narrow" }, "1mph" ); + assert.unitFormat( 100, "speed-mile-per-hour", { form: "narrow" }, "100mph" ); + assert.unitFormat( 1, "consumption-mile-per-gallon", { form: "narrow" }, "1mpg" ); + assert.unitFormat( 100, "consumption-mile-per-gallon", { form: "narrow" }, "100mpg" ); +}); + +QUnit.test( "Compound form (without precomputed) in language without 'one' unit", function( assert ) { + assert.unitFormat( 1, "length-foot-per-second", { form: "long" }, "1 フィート毎秒", "ja" ); + assert.unitFormat( 100, "length-foot-per-second", { form: "long" }, "100 フィート毎秒", "ja" ); + assert.unitFormat( 1, "megabyte-per-second", { form: "narrow" }, "1MB/秒", "ja" ); + assert.unitFormat( 100, "megabyte-per-second", { form: "narrow" }, "100MB/秒", "ja" ); + + assert.unitFormat( 1.2345678910, "megabyte-per-second", + { + form: "narrow", + numberFormatter: function( number ) { + return number.toFixed(1); + } + }, + "1.2MB/秒", "ja" ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/unit/get.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/unit/get.js new file mode 100644 index 000000000..f048ef2e8 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/unit/get.js @@ -0,0 +1,87 @@ +define([ + "cldr", + "src/unit/get", + "json!cldr-data/main/en/units.json", + "json!cldr-data/supplemental/likelySubtags.json", +], function( Cldr, unitGet, enUnits, likelySubtags ) { + +var cldr; + +Cldr.load( enUnits ); +Cldr.load( likelySubtags ); + +cldr = new Cldr( "en" ); + +QUnit.module( "Unit Get" ); + +QUnit.test( "should get type-unit", function( assert ) { + assert.deepEqual( unitGet( "duration-second", "short", cldr ), { + "displayName": "secs", + "one": "{0} sec", + "other": "{0} sec", + "perUnitPattern": "{0}/s" + }); + assert.deepEqual( unitGet( "duration-second", "long", cldr ), { + "displayName": "seconds", + "one": "{0} second", + "other": "{0} seconds", + "perUnitPattern": "{0} per second" + }); + assert.deepEqual( unitGet( "digital-megabyte", "long", cldr ), { + "displayName": "megabytes", + "one": "{0} megabyte", + "other": "{0} megabytes" + }); +}); + +QUnit.test( "should get unit (when no type is provided)", function( assert ) { + assert.deepEqual( unitGet( "second", "short", cldr ), { + "displayName": "secs", + "one": "{0} sec", + "other": "{0} sec", + "perUnitPattern": "{0}/s" + }); + assert.deepEqual( unitGet( "second", "long", cldr ), { + "displayName": "seconds", + "one": "{0} second", + "other": "{0} seconds", + "perUnitPattern": "{0} per second" + }); + assert.deepEqual( unitGet( "megabyte", "long", cldr ), { + "displayName": "megabytes", + "one": "{0} megabyte", + "other": "{0} megabytes" + }); +}); + +QUnit.test( "should get precomputed compound-unit", function( assert ) { + assert.deepEqual( unitGet( "meter-per-second", "short", cldr ), { + "displayName": "meters/sec", + "one": "{0} m/s", + "other": "{0} m/s" + }); +}); + +QUnit.test( "should compute compound-unit", function( assert ) { + assert.deepEqual( unitGet( "foot-per-second", "short", cldr ), [{ + "displayName": "feet", + "one": "{0} ft", + "other": "{0} ft", + "perUnitPattern": "{0}/ft" + }, { + "displayName": "secs", + "one": "{0} sec", + "other": "{0} sec", + "perUnitPattern": "{0}/s" + }]); +}); + +QUnit.test( "should get precomputed compount-unit with '/'", function( assert ) { + assert.deepEqual( unitGet( "meter/second", "short", cldr ), { + "displayName": "meters/sec", + "one": "{0} m/s", + "other": "{0} m/s" + }); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/object/invert.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/object/invert.js new file mode 100644 index 000000000..5858f1f19 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/object/invert.js @@ -0,0 +1,24 @@ +define([ + "src/util/object/invert", +], function( objectInvert ) { + +QUnit.module( "Util object invert" ); + +QUnit.test( "it should invert an object", function( assert ) { + assert.deepEqual( + objectInvert({ a: "x", b: "y" }), + { x: "a", y: "b" } + ); +}); + +QUnit.test( "it should invert an object using a custom setter", function( assert ) { + assert.deepEqual( + objectInvert({ a: "x", b: "y" }, function( object, key, value ) { + object[ value ] = "foo-" + key; + return object; + }), + { x: "foo-a", y: "foo-b" } + ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/escape.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/escape.js new file mode 100644 index 000000000..ba6763711 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/escape.js @@ -0,0 +1,18 @@ +define([ + "src/util/regexp/escape", +], function( regexpEscape ) { + +QUnit.module( "Util regexp escape" ); + +QUnit.test( "it shouldn't escape not-reserved characters", function( assert ) { + assert.equal( regexpEscape( "foo" ), "foo" ); +}); + +QUnit.test( "it should escape reserved characters", function( assert ) { + assert.equal( + regexpEscape( ".*+?^=!:${}()|\[\]\/\\" ), + "\\.\\*\\+\\?\\^\\=\\!\\:\\$\\{\\}\\(\\)\\|\\[\\]\\/\\\\" + ); +}); + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/not-s-and-z.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/not-s-and-z.js new file mode 100644 index 000000000..400fbbf4c --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/not-s-and-z.js @@ -0,0 +1,56 @@ +define([ + "src/util/regexp/not-s-and-z", +], function( regexpNotSAndZ ) { + + QUnit.module( "Util regexp ^S&^Z" ); + + [ + { + symbol: "௹", + category: "Sc" + }, + { + symbol: "꜏", + category: "Sk" + }, + { + symbol: "∇", + category: "Sm" + }, + { + symbol: "❤", + category: "So" + }, + { + symbol: "\u2028", + category: "Zl" + }, + { + symbol: "\u2029", + category: "Zp" + }, + { + symbol: "\u2003", + category: "Zs" + } + ].forEach(function( c ) { + QUnit.test("it should NOT match category " + c.category, function( assert ) { + assert.notOk(regexpNotSAndZ.test(c.symbol)); + }); + }); + + [ + { + symbol: "𒐖", + category: "Nl" + }, + { + symbol: "א", + category: "Lo" + } + ].forEach(function( c ) { + QUnit.test("it should match category " + c.category, function( assert ) { + assert.ok(regexpNotSAndZ.test(c.symbol)); + }); + }); +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/not-s.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/not-s.js new file mode 100644 index 000000000..882419920 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/unit/util/regexp/not-s.js @@ -0,0 +1,56 @@ +define([ + "src/util/regexp/not-s", +], function( regexpNotS ) { + + QUnit.module( "Util regexp ^S" ); + + [ + { + symbol: "௹", + category: "Sc" + }, + { + symbol: "꜏", + category: "Sk" + }, + { + symbol: "∇", + category: "Sm" + }, + { + symbol: "❤", + category: "So" + } + ].forEach(function( c ) { + QUnit.test("it should NOT match category " + c.category, function( assert ) { + assert.notOk(regexpNotS.test(c.symbol)); + }); + }); + + [ + { + symbol: "𒐖", + category: "Nl" + }, + { + symbol: "א", + category: "Lo" + }, + { + symbol: "\u2028", + category: "Zl" + }, + { + symbol: "\u2029", + category: "Zp" + }, + { + symbol: "\u2003", + category: "Zs" + } + ].forEach(function( c ) { + QUnit.test("it should match category " + c.category, function( assert ) { + assert.ok(regexpNotS.test(c.symbol)); + }); + }); +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/util.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/util.js new file mode 100644 index 000000000..e503aeca0 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/globalize-master/test/util.js @@ -0,0 +1,222 @@ +define([ + "cldr" +], function( Cldr ) { + +var allTypes, FakeDate; + +allTypes = { + array: [], + cldr: new Cldr( "en" ), + date: new Date(), + "function": Foo, + "null": null, + number: 7, + plainObject: {}, + string: "foo" +}; + +FakeDate = (function( Date ) { + function FakeDate() { + var date; + if ( arguments.length === 0 ) { + return FakeDate.today; + } + if ( arguments.length === 1 ) { + date = new Date( arguments[ 0 ] ); + } else if ( arguments.length === 2 ) { + date = new Date( arguments[ 0 ], arguments[ 1 ] ); + } else if ( arguments.length === 3 ) { + date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ] ); + } else if ( arguments.length === 4 ) { + date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ] ); + } else if ( arguments.length === 5 ) { + date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ] ); + } else if ( arguments.length === 6 ) { + date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ], arguments[ 5 ] ); + } else if ( arguments.length === 7 ) { + date = new Date( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ], arguments[ 5 ], arguments[ 6 ] ); + } + + date.__proto__ = FakeDate.prototype; + return date; + } + FakeDate.prototype = FakeDate.today = new Date(); + return FakeDate; +})( Date ); + +function assertParameterType( assert, type, name, fn ) { + Object.keys( allTypes ).filter( not( type ) ).forEach(function( type ) { + assert.throws( fn( allTypes[ type ] ), function E_INVALID_PAR_TYPE( error ) { + return error.code === "E_INVALID_PAR_TYPE" && + error.name === name && + "value" in error && + "expected" in error; + }, "Expected \"E_INVALID_PAR_TYPE: Invalid `" + name + "` parameter type (" + type + ")\" to be thrown" ); + }); +} + +function Foo() {} + +/** + * not() should be used with Array.prototype.filter(). + * + * Return true only if b is different than any a. + * + * For example: + * [ 1, 2, 3 ].filter( not( 2 ) ) => [ 1, 3 ] + * [ 1, 2, 3 ].filter( not( [ 2, 3 ] ) ) => [ 1 ] + */ +function not( a ) { + return function( b ) { + if ( Array.isArray( a ) ) { + return !a.some(function( a ) { + return a === b; + }); + } + return a !== b; + }; +} + +return { + + /** + * CLDR content assertion + */ + assertCldrContent: function( assert, fn ) { + assert.throws( fn, function E_MISSING_CLDR( error ) { + return error.code === "E_MISSING_CLDR" && + "path" in error; + }, "Expected \"E_MISSING_CLDR\" to be thrown" ); + }, + + /** + * Default locale assertion + */ + assertDefaultLocalePresence: function( assert, fn) { + assert.throws( fn, function E_DEFAULT_LOCALE_NOT_DEFINED( error ) { + return error.code === "E_DEFAULT_LOCALE_NOT_DEFINED"; + }, "Expected \"E_DEFAULT_LOCALE_NOT_DEFINED\" to be thrown" ); + }, + + /** + * Parameter assertions + */ + assertArrayParameter: function( assert, name, fn ) { + assertParameterType( assert, "array", name, fn ); + }, + + assertCldrJsonDataParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "array", "cldr", "plainObject" ], name, fn ); + }, + + assertCurrencyParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "string" ], name, fn ); + assert.throws( fn( "ABCD" ), function E_INVALID_PAR_TYPE( error ) { + return error.code === "E_INVALID_PAR_TYPE" && + error.name === name && + "value" in error && + "expected" in error; + }, "Expected \"E_INVALID_PAR_TYPE: Invalid `" + name + "` parameter type (string.length > 3)\" to be thrown" ); + }, + + assertDateParameter: function( assert, name, fn ) { + assertParameterType( assert, "date", name, fn ); + }, + + assertLocaleParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "cldr", "string" ], name, fn ); + }, + + assertLocaleOrNullParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "cldr", "null", "string" ], name, fn ); + }, + + assertMessagePresence: function( assert, path, fn ) { + assert.throws( fn, function E_MISSING_PARAMETER( error ) { + return error.code === "E_MISSING_MESSAGE" && + error.path === path; + }, "Expected \"E_MISSING_MESSAGE: Missing required message content `" + path + "`\" to be thrown" ); + }, + + assertMessageType: function( assert, path, fn ) { + Object.keys( allTypes ).filter( not([ "array", "string" ]) ).forEach(function( type ) { + assert.throws( fn( allTypes[ type ] ), function E_INVALID_MESSAGE( error ) { + return error.code === "E_INVALID_MESSAGE" && + error.path === path && + "expected" in error; + }, "Expected \"E_INVALID_MESSAGE: Invalid message content `" + path + "`\" to be thrown. (" + type + ")" ); + }); + }, + + assertMessageVariablesType: function( assert, name, fn ) { + assertParameterType( assert, [ "array", "cldr", "number", "plainObject", "string" ], name, fn ); + }, + + assertNumberParameter: function( assert, name, fn ) { + assertParameterType( assert, "number", name, fn ); + }, + + assertParameterMissingKey: function( assert, name, key, fn ) { + assert.throws( fn, function E_PAR_MISSING_KEY( error ) { + return error.code === "E_PAR_MISSING_KEY" && + error.name === name && error.key === key; + }, "Expected \"E_PAR_MISSING_KEY: Parameter `" + name + "` misses key `" + + key + "`\" to be thrown" ); + }, + + assertParameterPresence: function( assert, name, fn ) { + assert.throws( fn, function E_MISSING_PARAMETER( error ) { + return error.code === "E_MISSING_PARAMETER" && + error.name === name; + }, "Expected \"E_MISSING_PARAMETER: Missing `" + name + "` parameter\" to be thrown" ); + }, + + assertParameterRange: function( assert, min, max, fn ) { + [ min - 1, max + 1 ].forEach(function( num ) { + assert.throws(function() { + fn( num ); + }, function E_OUT_OF_RANGE( error ) { + return error.code === "E_PAR_OUT_OF_RANGE"; + }, "Expected \"E_PAR_OUT_OF_RANGE error to be thrown testing " + num ); + }); + }, + + assertPathParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "array", "string" ], name, fn ); + }, + + assertPlainObjectParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "cldr", "plainObject" ], name, fn ); + }, + + assertPluralFormatValueParameter: function( assert, name, fn ) { + assertParameterType( assert, [ "string", "number" ], name, fn ); + }, + + assertStringParameter: function( assert, name, fn ) { + assertParameterType( assert, "string", name, fn ); + }, + + /** + * Etc + */ + assertRuntimeBind: function( assert, formatterOrParser, runtimeKey, generatorString, runtimeArgsFn ) { + assert.equal( typeof formatterOrParser, "function" ); + assert.ok( "runtimeKey" in formatterOrParser ); + assert.equal( formatterOrParser.runtimeKey, runtimeKey ); + assert.ok( "generatorString" in formatterOrParser ); + assert.equal( typeof formatterOrParser.generatorString, "function" ); + assert.equal( formatterOrParser.generatorString(), generatorString ); + assert.ok( "runtimeArgs" in formatterOrParser ); + runtimeArgsFn( formatterOrParser.runtimeArgs ); + }, + + resetCldrContent: function() { + Cldr._resolved = {}; + Cldr._raw = {}; + }, + + FakeDate: FakeDate +}; + +}); diff --git a/BeWoPlanerMobil/Scripts/devexpress-scripts/knockout-3.5.1.js b/BeWoPlanerMobil/Scripts/devexpress-scripts/knockout-3.5.1.js new file mode 100644 index 000000000..d7520e3b5 --- /dev/null +++ b/BeWoPlanerMobil/Scripts/devexpress-scripts/knockout-3.5.1.js @@ -0,0 +1,139 @@ +/*! + * Knockout JavaScript library v3.5.1 + * (c) The Knockout.js team - http://knockoutjs.com/ + * License: MIT (http://www.opensource.org/licenses/mit-license.php) + */ + +(function() {(function(n){var A=this||(0,eval)("this"),w=A.document,R=A.navigator,v=A.jQuery,H=A.JSON;v||"undefined"===typeof jQuery||(v=jQuery);(function(n){"function"===typeof define&&define.amd?define(["exports","require"],n):"object"===typeof exports&&"object"===typeof module?n(module.exports||exports):n(A.ko={})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d); +d=a.a.setTimeout(b,c)}}function Z(a,c){c&&"change"!==c?"beforeChange"===c?this.pc(a):this.gb(a,c):this.qc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c,a,this.mb[c]),this.mb[c]=null,--this.Qb):e.I[c]||d.uc(c,a,e.J?{da:a}:d.$c(a)),a.Ja&&a.gd())}var a="undefined"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;fa.a.A(c,b)&&c.push(b)});return c},Mb:function(a, +b,c){var d=[];if(a)for(var e=0,l=a.length;ee?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,Ab:g?d:c,P:b,Ga:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]= +b.call(c,a[e],e,a));return d},Tb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Yb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement("div"),d=0,e=b.length;dp?a.setAttribute("selected",b):a.selected=b},Db:function(a){return null===a||a===n?"":a.trim? +a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},vd:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Sb:function(b){return a.a.vd(b,b.ownerDocument.documentElement)},kd:function(b){return!!a.a.Lb(b,a.a.Sb)},R:function(a){return a&& +a.tagName&&a.tagName.toLowerCase()},Ac:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Ac(b),c)},Gc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},B:function(b,c,d){var e=a.a.Ac(d);d=l[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var k=function(a){e.call(b,a)},f="on"+c;b.attachEvent(f, +k);a.a.K.za(b,function(){b.detachEvent(f,k)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(c,e,!1);else t||(t="function"==typeof v(b).on?"on":"bind"),v(b)[t](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.R(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if("function"==typeof w.createEvent)if("function"== +typeof b.dispatchEvent)d=w.createEvent(k[c]||"HTMLEvents"),d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");else v(b).trigger(c)},f:function(b){return a.O(b)?b():b},bc:function(b){return a.O(b)?b.v():b},Eb:function(b,c,d){var l;c&&("object"===typeof b.classList? +(l=b.classList[d?"add":"remove"],a.a.D(c.match(q),function(a){l.call(b.classList,a)})):"string"===typeof b.className.baseVal?e(b.className,"baseVal",c,d):e(b,"className",c,d))},Bb:function(b,c){var d=a.a.f(c);if(null===d||d===n)d="";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.va(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Ad(b)},Yc:function(a,b){a.name=b;if(7>=p)try{var c=a.name.replace(/[&<>'"]/g,function(a){return"&#"+a.charCodeAt(0)+";"});a.mergeAttributes(w.createElement(""),!1)}catch(d){}},Ad:function(a){9<=p&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},wd:function(a){if(p){var b=a.style.width;a.style.width=0;a.style.width=b}},Pd:function(b,c){b=a.a.f(b);c=a.a.f(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c",""],d=[3,"","
"],e=[1,""],f={thead:c,tbody:c,tfoot:c,tr:[2,"","
"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ua=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var l=e[0];l.parentNode&&11!==l.parentNode.nodeType;)l=l.parentNode; +l.parentNode&&l.parentNode.removeChild(l)}}else{(e=d)||(e=w);var l=e.parentWindow||e.defaultView||A,p=a.a.Db(c).toLowerCase(),q=e.createElement("div"),t;t=(p=p.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&f[p[1]]||b;p=t[0];t="ignored
"+t[1]+c+t[2]+"
";"function"==typeof l.innerShiv?q.appendChild(l.innerShiv(t)):(g&&e.body.appendChild(q),q.innerHTML=t,g&&q.parentNode.removeChild(q));for(;p--;)q=q.lastChild;e=a.a.la(q.lastChild.childNodes)}return e};a.a.Md=function(b,c){var d=a.a.ua(b, +c);return d.length&&d[0].parentElement||a.a.Yb(d)};a.a.fc=function(b,c){a.a.Tb(b);c=a.a.f(c);if(null!==c&&c!==n)if("string"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ua(c,b.ownerDocument),e=0;eb){if(5E3<= +++c){h=f;a.a.Gc(Error("'Too much recursion' after processing "+c+" task groups."));break}b=f}try{d()}catch(p){a.a.Gc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;A.MutationObserver?d=function(a){var b=w.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):d=w&&"onreadystatechange"in w.createElement("script")?function(a){var b=w.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b); +b=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,zb:function(b){f||a.na.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&ad[0]?p+d[0]: +d[0]),p);for(var p=1===g?p:Math.min(c+(d[1]||0),p),g=c+g-2,h=Math.max(p,g),U=[],L=[],n=2;cc;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.ad(b);return a.a.hc(b,c,d)};d.prototype={constructor:d,save:function(b,c){var d=a.a.A(this.keys, +b);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:n}}})();a.b("toJS",a.ad);a.b("toJSON",a.toJSON);a.Wd=function(b,c,d){function e(c){var e=a.xb(b,d).extend({ma:"always"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return"function"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b("when",a.Wd);(function(){a.w={M:function(b){switch(a.a.R(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__? +a.a.g.get(b,a.c.options.$b):7>=a.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex]):n;default:return b.value}},cb:function(b,c,d){switch(a.a.R(b)){case "option":"string"===typeof c?(a.a.g.set(b,a.c.options.$b,n),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.c.options.$b,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"=== +typeof c?c:"");break;case "select":if(""===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f=h){c.push(p&&q.length?{key:p,value:q.join("")}:{unknown:p||q.join("")});p=h=0;q=[];continue}}else if(58===u){if(!h&&!p&&1===q.length){p=q.pop();continue}}else if(47===u&&1arguments.length){if(b=w.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?"); +}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");k(q(a,c),b)};a.Dc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Td(b)};a.Ec=function(b){return(b=a.Dc(b))?b.$data:n};a.b("bindingHandlers",a.c);a.b("bindingEvent",a.i);a.b("bindingEvent.subscribe",a.i.subscribe);a.b("bindingEvent.startPossiblyAsyncContentBinding",a.i.Cb);a.b("applyBindings",a.vc);a.b("applyBindingsToDescendants",a.Oa); +a.b("applyBindingAccessorsToNode",a.ib);a.b("applyBindingsToNode",a.ld);a.b("contextFor",a.Dc);a.b("dataFor",a.Ec)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.T,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Gd:e};delete f[c];l||e?k.notifySubscribers(b):a.na.zb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a, +c)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){var q=g[c];if(q){var t=!1;if(q.apply(g,d.concat(function(a){t?f(null):null!==a?f(a):e(c,d,f,l)}))!==b&&(t=!0,!g.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Gd?a.u.G(function(){e(f.definition)}): +a.na.zb(function(){e(f.definition)}):c(d,e)},Bc:function(a){delete g[a]},oc:e};a.j.loaders=[];a.b("components",a.j);a.b("components.get",a.j.get);a.b("components.clearCachedDefinition",a.j.Bc)})();(function(){function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.oc("loadTemplate",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.oc("loadViewModel",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)}); +else if("function"===typeof b[m])d(b[m]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in b?c(a,b.viewModel,d):a("Unknown viewModel value: "+b)}function d(b){switch(a.a.R(b)){case "script":return a.a.ua(b.text);case "textarea":return a.a.ua(b.value);case "template":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require? +T||A.require?(T||A.require)([b.require],function(a){a&&"object"===typeof a&&a.Xd&&a["default"]&&(a=a["default"]);c(a)}):a("Uses require, but no AMD loader is present"):c(b)}function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.j.tb(b))throw Error("Component "+b+" is already registered");h[b]=c};a.j.tb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b]; +a.j.Bc(b)};a.j.Fc={getConfig:function(b,c){c(a.j.tb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if("string"===typeof c)f(a.a.ua(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,A.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if("string"===typeof c){var h=w.getElementById(c);h?f(d(h)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+ +c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m="createViewModel";a.b("components.register",a.j.register);a.b("components.isRegistered",a.j.tb);a.b("components.unregister",a.j.unregister);a.b("components.defaultLoader",a.j.Fc);a.j.loaders.push(a.j.Fc);a.j.dd=h})();(function(){function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ga(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ga(f, +function(c){var e=c.v();return c.ja()?a.o({read:function(){return a.a.f(c())},write:a.Za(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,"$raw")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.R(b);if(a.j.tb(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b||8>=a.a.W&&b.tagName===c))return c};a.j.tc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component'); +var m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.j.register=function(a){return function(b){return a.apply(this,arguments)}}(a.j.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.j.dd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.Ca(c);a.h.va(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a, +b,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;"function"===typeof a&&a.call(l);q&&q.s();p=l=q=null}var l,p,q,t=a.a.la(a.h.childNodes(e));a.h.Ea(e);a.a.K.za(e,k);a.o(function(){var g=a.a.f(f()),h,u;"string"===typeof g?h=g:(h=a.a.f(g.name),u=a.a.f(g.params));if(!h)throw Error("No component name specified");var n=a.i.Cb(e,m),z=p=++d;a.j.get(h,function(d){if(p===z){k();if(!d)throw Error("Unknown component '"+h+"'");b(h,d,e);var f=c(d,u,{element:e,templateNodes:t}); +d=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=t}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.pa,f.koDescendantsComplete,f));l=f;a.Oa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={"class":"className","for":"htmlFor"};a.c.attr={update:function(b,c){var d=a.a.f(c())||{};a.a.P(d,function(c,d){d=a.a.f(d);var g=c.indexOf(":"),g="lookupNamespaceURI"in b&&0=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));"name"===c&&a.a.Yc(b,h?"":d)})}};(function(){a.c.checked={after:["value","attr"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var k=a.u.G(c);if(l){var q=p?k.v():k,z=t;t=f;z!==f?e&&(a.a.Na(q,f,!0),a.a.Na(q,z,!1)):a.a.Na(q,f,e);p&&a.Za(k)&&k(q)}else h&&(f===n?f=e:e||(f=n)),a.m.eb(k, +d,"checked",f,!0)}}function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.checked=h&&e===n?!!d:g()===d}var g=a.xb(function(){if(d.has("checkedValue"))return a.a.f(d.get("checkedValue"));if(q)return d.has("value")?a.a.f(d.get("value")):b.value}),h="checkbox"==b.type,m="radio"==b.type;if(h||m){var k=c(),l=h&&a.a.f(k)instanceof Array,p=!(l&&k.push&&k.splice),q=m||l,t=l?g():n;m&&!b.name&&a.c.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.B(b,"click",e);a.o(f,null,{l:b}); +k=n}}};a.m.wa.checked=!0;a.c.checkedValue={update:function(b,c){b.value=a.a.f(c())}}})();a.c["class"]={update:function(b,c){var d=a.a.Db(a.a.f(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.f(c());null!==d&&"object"==typeof d?a.a.P(d,function(c,d){d=a.a.f(d);a.a.Eb(b,c,d)}):a.c["class"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.f(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.c.disable= +{update:function(b,c){a.c.enable.update(b,function(){return!a.a.f(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.P(g,function(g){"string"==typeof g&&a.a.B(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.la(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Rc:function(b){return function(){var c=b(),d=a.a.bc(c); +if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.ba.Ma};a.a.f(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Ma}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Rc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Rc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach= +!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activeElement"in f){var g;try{g=f.activeElement}catch(l){g=f.body}e=g===b}f=c();a.m.eb(f,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.B(b,"focus",f);a.a.B(b,"focusin",f);a.a.B(b,"blur",g);a.a.B(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.f(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue=== +d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.G(a.a.Fb,null,[b,d?"focusin":"focusout"]))}};a.m.wa.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.wa.hasFocus="hasfocus";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.fc(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if(d){m=h.get("as");var u=h.get("noChildContext");n=!(m&&u);q={as:m,noChildContext:u,exportDependencies:n}}x=(t= +"render"==h.get("completeOn"))||h.has(a.i.pa);a.o(function(){var h=a.a.f(c()),m=!e!==!h,u=!p,r;if(n||m!==l){x&&(k=a.i.Cb(b,k));if(m){if(!d||n)q.dataDependency=a.S.o();r=d?k.createChildContext("function"==typeof h?h:c,q):a.S.qa()?k.extend(null,q):k}u&&a.S.qa()&&(p=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.va(b,a.a.Ca(p)),a.Oa(r,b)):(a.h.Ea(b),t||a.i.ma(b,a.i.H));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b("if");b("ifnot",!1,!0);b("with",!0)})();a.c.let={init:function(b, +c,d,e,f){c=f.extend(c);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.c.options={init:function(b){if("select"!==a.a.R(b))throw Error("options binding applies only to SELECT elements");for(;0g)var m=a.a.g.Z(),k=a.a.g.Z(),l=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,k))&&c(b)},p=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.B(d,"selectionchange",l));a.a.g.set(b,k,c)};a.c.textInput={init:function(b,c,k){function l(c,d){a.a.B(b,c,d)}function m(){var d=a.a.f(c());if(null===d||d===n)d="";L!==n&&d===L?a.a.setTimeout(m,4):b.value!==d&&(y=!0,b.value=d,y=!1,v=b.value)}function r(){w||(L=b.value,w=a.a.setTimeout(z, +4))}function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),k,"textInput",d))}var v=b.value,w,L,A=9==a.a.W?r:z,y=!1;g&&l("keypress",z);11>g&&l("propertychange",function(a){y||"value"!==a.propertyName||A(a)});8==g&&(l("keyup",z),l("keydown",z));p&&(p(b,A),l("dragend",r));(!g||9<=g)&&l("input",A);5>e&&"textarea"===a.a.R(b)?(l("keydown",r),l("paste",r),l("cut",r)):11>d?l("keydown",r):4>f?(l("DOMAutoComplete",z),l("dragdrop",z),l("drop",z)):h&&"number"===b.type&&l("keydown",r);l("change", +z);l("blur",z);a.o(m,null,{l:b})}};a.m.wa.textInput=!0;a.c.textinput={preprocess:function(a,b,c){c("textInput",a)}}})();a.c.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.c.uniqueName.rd;a.a.Yc(b,d)}}};a.c.uniqueName.rd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has("as")&&(g={as:d.get("as"),noChildContext:d.get("noChildContext")});c=f.createChildContext(c,g);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.c.value={init:function(b,c,d){var e=a.a.R(b),f="input"== +e;if(!f||"checkbox"!=b.type&&"radio"!=b.type){var g=[],h=d.get("valueUpdate"),m=!1,k=null;h&&("string"==typeof h?g=[h]:g=a.a.wc(h),a.a.Pa(g,"change"));var l=function(){k=null;m=!1;var e=c(),f=a.w.M(b);a.m.eb(e,d,"value",f)};!a.a.W||!f||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.A(g,"propertychange")||(a.a.B(b,"propertychange",function(){m=!0}),a.a.B(b,"focus",function(){m=!1}),a.a.B(b,"blur",function(){m&&l()}));a.a.D(g,function(c){var d=l;a.a.Ud(c,"after")&& +(d=function(){k=a.w.M(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.B(b,c,d)});var p;p=f&&"file"==b.type?function(){var d=a.a.f(c());null===d||d===n||""===d?b.value="":a.u.G(l)}:function(){var f=a.a.f(c()),g=a.w.M(b);if(null!==k&&f===k)a.a.setTimeout(p,0);else if(f!==g||g===n)"select"===e?(g=d.get("valueAllowUnset"),a.w.cb(b,f,g),g||f===a.w.M(b)||a.u.G(l)):a.w.cb(b,f)};if("select"===e){var q;a.i.subscribe(b,a.i.H,function(){q?d.get("valueAllowUnset")?p():l():(a.a.B(b,"change",l),q=a.o(p,null,{l:b}))}, +null,{notifyImmediately:!0})}else a.a.B(b,"change",l),a.o(p,null,{l:b})}else a.ib(b,{checkedValue:c})},update:function(){}};a.m.wa.value=!0;a.c.visible={update:function(b,c){var d=a.a.f(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.f(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click"); +a.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.ca.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.C.F(d)}if(1==b.nodeType||8==b.nodeType)return new a.C.ia(b);throw Error("Unknown template type: "+b);};a.ca.prototype.renderTemplate= +function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.ca);a.kc=function(){function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi, +d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kc.Ld(b,c)},d)},Ld:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",f)})},md:function(b,c){return a.aa.Xb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.ib(m,b,h)})}}}();a.b("__tr_ambtns",a.kc.md);(function(){a.C={};a.C.F=function(b){if(this.F=b){var c= +a.a.R(b);this.ab="script"===c?1:"textarea"===c?2:"template"==c&&b.content&&11===b.content.nodeType?3:4}};a.C.F.prototype.text=function(){var b=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[b];var c=arguments[0];"innerHTML"===b?a.a.fc(this.F,c):this.F[b]=c};var b=a.a.g.Z()+"_";a.C.F.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.F,b+c);a.a.g.set(this.F,b+c,arguments[1])};var c=a.a.g.Z();a.C.F.prototype.nodes=function(){var b=this.F; +if(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.lb||(3===this.ab?b.content:4===this.ab?b:n);if(!f||e.jd){var g=this.text();g&&g!==e.bb&&(f=a.a.Md(g,b.ownerDocument),a.a.g.set(b,c,{lb:f,bb:g,jd:!0}))}return f}e=arguments[0];this.ab!==n&&this.text("");a.a.g.set(b,c,{lb:e})};a.C.ia=function(a){this.F=a};a.C.ia.prototype=new a.C.F;a.C.ia.prototype.constructor=a.C.ia;a.C.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.F,c)||{};b.bb===n&&b.lb&&(b.bb=b.lb.innerHTML);return b.bb}a.a.g.set(this.F, +c,{bb:arguments[0]})};a.b("templateSources",a.C);a.b("templateSources.domElement",a.C.F);a.b("templateSources.anonymousTemplate",a.C.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e): +(c.push(e,f),a.a.Ua(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.vc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.cd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ua(b,e)};a.ba.Ma=new a.ba;a.gc(a.ba.Ma);a.b("nativeTemplateEngine",a.ba);(function(){a.$a=function(){var a=this.Hd=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}(); +this.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=v.template(null,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement("div"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+ +a+" })()) }}"};this.addTemplate=function(a,b){w.write(" - + @**@ + + @Html.DevExpress().GetStyleSheets( + new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout }, + new StyleSheet { ExtensionSuite = ExtensionSuite.Editors }, + new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor }, + new StyleSheet { ExtensionSuite = ExtensionSuite.GridView }, + new StyleSheet { ExtensionSuite = ExtensionSuite.PivotGrid }, + new StyleSheet { ExtensionSuite = ExtensionSuite.Chart }, + new StyleSheet { ExtensionSuite = ExtensionSuite.Report }, + new StyleSheet { ExtensionSuite = ExtensionSuite.Scheduler }, + new StyleSheet { ExtensionSuite = ExtensionSuite.TreeList }, + new StyleSheet { ExtensionSuite = ExtensionSuite.Spreadsheet }, + new StyleSheet { ExtensionSuite = ExtensionSuite.SpellChecker } + ) + + @Html.DevExpress().GetScripts( + new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout }, + new Script { ExtensionSuite = ExtensionSuite.HtmlEditor }, + new Script { ExtensionSuite = ExtensionSuite.GridView }, + new Script { ExtensionSuite = ExtensionSuite.PivotGrid }, + new Script { ExtensionSuite = ExtensionSuite.Editors }, + new Script { ExtensionSuite = ExtensionSuite.Chart }, + new Script { ExtensionSuite = ExtensionSuite.Report }, + new Script { ExtensionSuite = ExtensionSuite.Scheduler }, + new Script { ExtensionSuite = ExtensionSuite.TreeList }, + new Script { ExtensionSuite = ExtensionSuite.Spreadsheet }, + new Script { ExtensionSuite = ExtensionSuite.SpellChecker } + ) + @@ -34,6 +63,18 @@ +